[SciPy-dev] fft

Chuck Harris Chuck.Harris at sdl.usu.edu
Mon Feb 10 10:59:48 CST 2003


I was playing around with the fft programs in fftpack and fftw and
noticed that the real transforms return the coefficients in different
formats. If rk,ik are the real and imaginary components of the k'th
Fourier coefficient, then

fftpack: [r0,r1,i1,.....,rm] 
	where rm is absent in odd length transforms

fftw: [r0,r1,...,i2,i1]
	where again rm is absent in odd length transforms

Besides the incompatibility of the forms, neither is of much use
in Numeric, where the coefficients would preferably be exposed as an
array of complex. Of course they do have the virtue that the number
of (real) components is exactly equal to the number of points
transformed. However, I think the best solution would be to return
a complex array [r0+i0j,r1+i1j,...]. In this case i0==0 and when 
the number of samples is even im==0 also. This means that the length
of the returned complex array is n//2 + 1, which may seem a bit
inconvenient, but the result is then easy to use in Numeric for 
such things as convolution, amplitude, and phase. 

By the way, what happened to the other fft package that was being
discussed?

Chuck



More information about the Scipy-dev mailing list