Discrete Fourier Transform in MATLAB

In summary, you are trying to Fourier transform a gaussian distributed variable, however when you do the discrete Fourier transform, you get a distribution that is sin(k)exp(-k^2).
  • #1
SamuraiJack
9
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.
 
Physics news on Phys.org
  • #2
It's hard to know what's going on from your vague description. Did you use fftshift after the fft?
 
  • #3
Did you look at the modulus or just the real part? Hint: f(x)-> F(y); f(x-a) -> ?
 
  • #4
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.
 
  • #5
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.
 
  • #6
Hello Hasan,
Although I watched it one week later... This is exactly the answer I was looking for.

Thanks.
 

Related to Discrete Fourier Transform in MATLAB

1. What is Discrete Fourier Transform (DFT)?

DFT is a mathematical technique used to convert a time-domain signal into its frequency-domain representation. It decomposes a signal into its constituent frequencies and their amplitudes.

2. How is DFT calculated in MATLAB?

In MATLAB, DFT can be calculated using the fft function. This function accepts a time-domain signal as its input and returns its frequency-domain representation as an array of complex numbers.

3. What is the difference between DFT and Fast Fourier Transform (FFT)?

DFT and FFT are essentially the same mathematical operation, but FFT is a more efficient algorithm for calculating DFT. FFT reduces the number of operations required for DFT from O(n^2) to O(nlogn).

4. Can DFT be applied to non-periodic signals?

No, DFT can only be applied to periodic signals. For non-periodic signals, a windowing function can be applied before calculating DFT to approximate its frequency-domain representation.

5. What are the applications of DFT in signal processing?

DFT is widely used in signal processing for tasks such as spectral analysis, filtering, and signal compression. It is also used in areas like image processing, audio processing, and telecommunications.

Similar threads

  • Calculus and Beyond Homework Help
Replies
5
Views
458
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
Replies
2
Views
376
  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
2K
  • Differential Equations
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
779
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
4K
Back
Top