[SciPy-user] FFT not producing correct result

Vincent Favre-Nicolin vincefn at users.sourceforge.net
Thu Jul 6 14:23:16 EDT 2006


On Thursday 06 July 2006 20:07, Mike Duffy wrote:
> I have been trying to use fft/ifft for a program, but the program has been
> failing. So, I tried testing the fft fuunction alone and found that it does
> not work as I woul expect it to. The test I have been using is to feed it a
> standard Gaussian, since the FFT of this should be just another gaussian.
> But, this is not what I get at all. I've been using pylab to visualize the
> function before and after the transform. Here is my test code:

   That's normal - as written in the help of fft, the first element in the 
array is the zero-frequency term, so this is where your gaussian is.

   You should look at fftpack.fftshift if you want to shift the zero-frequency 
term to the center of the array.

-- 
Vincent Favre-Nicolin
Université Joseph Fourier
http://v.favrenicolin.free.fr
ObjCryst & Fox : http://objcryst.sourceforge.net



More information about the SciPy-User mailing list