3
$\begingroup$

I am trying to utilize Numpy's fft function, however when I give the function a simple Gaussian function the FFT of that Gaussian function is not a Gaussian, its close but its halved so that each half is at either end of the x axis.

I was told by my professor that this has something to do with how when Fourier transform from x to k space, the k space in FFT algorithms tend to start from N=0 to N=N (where N is the size of the data array) and the k in this case would go from k(0) to k(N/2) (so far k would be positive) and then beyond k(N/2) k is negative and would go to k(N) = 0. So if there was a plot of k vs N, the shape would be like a slanted N if that makes sense.

In which part of the FFT algorithm is responsible for FFT of Gaussian to not be Gaussian? How to I change to make it Gaussian? Is it the Bit reversing or Butterfly operation that is responsible?

  • 1
    FFT computes a *discrete* transform, not a *continuous* one...2011-04-19

2 Answers 2

4
  1. Gaussians only map to Gaussians for the continuous Fourier transform. (Though the discrete Fourier transform is in some senses a reasonable approximation to the continuous transform).
  2. The discrete Fourier transfrom (which the FFT is a method to calculate) is naturally defined not on line, but a circle. The ends wrap around, and must be identified. In particular, this means that with $N$ samples, frequencies of $N-k$ and $-k$ are just different labels for the same thing. Half Gaussians at each end really is the same thing as a Gaussian centered at 0., just presented differently.
3

I just accept this as "the way the FFT does things". I can't explain why.

But to get the shape you want, just put your FFT results through numpy.fft.fftshift