Questions tagged [dft]

Discrete Fourier transform (DFT) is a specific kind of discrete transform, used in Fourier analysis.

Given a sequence of N samples f(n), indexed by n = 0..N-1, the discrete Fourier transform (DFT) is defined as F(k), where k=0..N-1:

Enter image description here

Source: engineeringproductivitytools

428 questions
4
votes
1 answer

How to understand DFT results

I use this implementation of DFT: /* Direct fourier transform */ int DFT(int dir,int m,double *x1,double *y1) { long i,k; double arg; double cosarg,sinarg; double *x2=NULL,*y2=NULL; x2 = malloc(m*sizeof(double)); y2 =…
Long Smith
  • 1,339
  • 3
  • 21
  • 40
4
votes
0 answers

Applying Fast Fourier transform with a specific product function

Problem: Given 2N degree polynomials as a0+a1x+a2x2..+aNxN and b0+b1x+b2x2..+bNxN. Assume no 2 coefficient are the same in the 2 polynomials. Find the product of the polynomials, the catch is that the product(*) operator between the coefficients is…
yejc
  • 41
  • 5
4
votes
1 answer

Diferences between DFT and FFT (magnitude) results

I aim to get the DFT of an image in OpenCV. Using dft function, I'm able to calculate it, and then paint it by calculating its magnitude (then, apply the log and finally normalize it in order to paint values between 0 and 1). My result is, for the…
Btc Sources
  • 1,912
  • 2
  • 30
  • 58
4
votes
2 answers

Issues Translating Custom Discrete Fourier Transform from MATLAB to Python

I'm developing Python software for someone and they specifically requested that I use their DFT function, written in MATLAB, in my program. My translation is just plain not working, tested with sin(2*pi*r). The MATLAB function below: function…
Trilbador
  • 43
  • 3
4
votes
1 answer

DSP - Filtering frequencies using DFT

I'm trying to implement a DFT-based 8-band equalizer for the sole purpose of learning. To prove that my DFT implementation works I fed an audio signal, analyzed it and then resynthesized it again with no modifications made to the frequency spectrum.…
Trap
  • 12,050
  • 15
  • 55
  • 67
4
votes
1 answer

Point-product with fft

According to the convolution theorem, a convolution in the time domain is a product in the fft domain. With correct zero-padding, it works: % convolution in time domain a = [1 2 3]; b = [4 5 6]; c = conv(a,b); a_padded=[a 0 0]; b_padded=[b 0…
4
votes
1 answer

Sliding DFT in Java?

I'm familiar with JTransforms for doing FFTs in Java. I would like to do a series of short time Fourier transforms, and I've read that a sliding DFT is better for that. Are there any Java libraries that implement efficient sliding DFTs?
mattg
  • 1,731
  • 1
  • 12
  • 20
4
votes
1 answer

fourier and zero padding

I'm filtering an image using a mask and the Discret Fourier Trasform, till now i have this A=double(imread('C:\Users\samsung\Documents\Lab Imagenes\CHE.jpg','jpg')); B=[1 4 6 4 1; 4 16 24 16 4; 6 24 36 24 6; 4 16 24 16 4; 1 4 6 4…
4
votes
1 answer

Concise implementation of DCT, DFT in C#?

I have been looking at various implementations of Discrete Cosine Transforms and Discrete Fourier Transforms implemented in C#, yet none is as concise as I would like. A bonus point would be, code derived from a larger open source project (i.e.…
Lorenz Lo Sauer
  • 23,698
  • 16
  • 85
  • 87
4
votes
2 answers

DFT (discrete fourier transform) with C++ STL

I try to calculate the DFT for this array x_1. It must be dead simple, but my values are way too low. What's wrong with my code? Please no links to other examples - just looking for a fix for my own code. #include #include…
Johannes
  • 2,901
  • 5
  • 30
  • 50
3
votes
0 answers

implementation of DFT in C++

I want to implement the DFT (Discrete Fourier Transform) in C++ language to process images. As I was studying the theory, I got to know, that I can divide the 2D DFT into two 1D DFT parts. Firstly, for each row I perform 1D DFT then I do it for…
sashafierce
  • 83
  • 1
  • 11
3
votes
2 answers

Scaling performed by gpu::dft with OpenCV in C++

I want to use a GPU-accelerated algorithm, to perform a fast and memory saving dft. But, when I perform the gpu::dft, the destination matrix is scaled as it is explained in the documentation. How I can avoid this problem with the scaling of the…
Sonic
  • 194
  • 2
  • 9
3
votes
1 answer

I want to reduce the time to compute 2D FFT in C++ on 100 million complex data

I am trying to compute 2D FFT on 100 million complex data (100000x1000) and it is taking 4.6 seconds approximately, but I want to reduce time. Then I tried to compute it using fftw_thread. But then the computation time has increased (in 2 threads…
3
votes
1 answer

How to prove the signal separability property of 2D DFT? MATLAB

I tried to prove the separability of a signal property of 2D Fourier transform using a 2D matrix that's separable to 2 1D vectors. Where: f(x,y) = f(x)*f(y) Then F(u,v) = F(u)*F(v) Using the following code: % Separabilty of signal H =…
Merna Atef
  • 33
  • 3
3
votes
0 answers

How does discrete fourier transform pruning work?

I'm looking to utilise pruned DFTs. I can't get my head around FFTW's example - they don't have any DFT pruning utilities in the library, so you have to code your own. In general, how does it work? If I have to code it, I have to understand it in…
Tobi Akinyemi
  • 804
  • 1
  • 8
  • 24