In the Python IDLE:
>>> from scipy.fftpack import fft
>>> fft([0, 1, 2, 3, 4, 5, 6, 7])
array([ 28.+0.j, -4.+9.65685425j,
-4.+4.j, -4.+1.65685425j,
-4.+0.j, -4.-1.65685425j,
-4.-4.j, -4.-9.65685425j ])
In the above code, I have used one of scipy’s FFT functions. The output is an array of complex numbers. How do I represent these complex numbers graphically?
I think I’ve usually seen these things represented as power spectra: — e.g. plot the result of
np.absoluteof your data. Sometimes you’ll also see a plot with 2 traces — one trace for the real part and one trace for the imaginary part. On the Wikipedia page for Fourier Transforms, they show plots of the real part an the imaginary part side-by-side. It all depends on what you’re looking for …