Discrete Fourier Transform in MATLAB

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
5 replies · 5K views
SamuraiJack
Messages
9
Reaction score
0
Hello all, first time here and I have really silly problem...
I am working on something in MATLAB, in which I have to make discrete Fourier transform
of gaussian distributed variable. i.e. array of numbers which are taken from f(x)~exp(-x^2). I know that when you Fourier transform it with integral you get the same distribution in k-space. i.e. f(k)~exp(-k^2), but in the discrete transform I get the distribution something like f(k)~sin(k)exp(-k^2)...

help! someone... why?

Thnx,

The Samurai.
 
on Phys.org
Did you look at the modulus or just the real part? Hint: f(x)-> F(y); f(x-a) -> ?
 
Hello marcusl, thank you for your response. Let me change the question since it doesn't really matter if it is in MATLAB or not. If you are doing Fourier transform from x to k space to a gaussian f(x)~exp(-x^2), you get f(k)~exp(-k^2). However, doing discrete Fourier transform to set of values in the x space which are distributed as f(x)~exp(-x^2), you get set of values that are distributed as f(k)~sin(k)exp(-k^2). I thought that in the limit Delta x -> 0, the transforms should be almost the same but they are clearly different.
WHY?

Delta Kilo, I also checked modulus. But actually the real part in negligible. (which is also a problem, because in this transform, the imaginary part should vanish, there is a mysterious pi/2 phase shift. How ever, with this problem I can live)



thanks again.
 
Hi SamuraiJack,

I haven't worked with Matlab for ages but I remember a few things:

FFT is for perioidc sequences and Matlab makes your sequence periodic to calculate the FFT. When you give the sequance withing an interval, Matlab assumes that this is only one period if a periodic data. When the length of the sequence is infinite, you get the expected Fourier sequence.

Since your data length is limited, it is equal to your Gaussian sequence multiplied by a square function. As we know the the FFT for this mutiplication is the convolution of their FFT, which is the convolution of a sinc function and a Gaussian one.This is what your current result is.
 
Hello Hasan,
Although I watched it one week later... This is exactly the answer I was looking for.

Thanks.