[SciPy-user] Difference between ffts?

Collin Day dcday137@gmail....
Mon Oct 13 22:36:16 CDT 2008


Hi all,

I have looked around, but can't seem to find an answer.  I have been
trying the following (according to the Getting started page -
http://www.scipy.org/Getting_Started)

from scipy import *
a=zeros(1000)
a[:100]=1
b=fft(a)

plot(abs(b))

and I get what you would expect - the abs. value of a sinc function

rect(x) ->F-> sinc(Frequency)

now, if I try the Scipy.fftpack

import scipy.fftapck as S

c=S.fft(a)

figure()

plot(abs(c))

I get something I would expect if I did a FFT on a sine function (kind
of like dual spikes equally spaced)

I do see there is a difference in the packing or how the fft output is
represented.  How do you plot the data from fftpack so that it looks
correct?  Should I even bother?

Thanks for any help!

-Collin


More information about the SciPy-user mailing list