I'm following the Nyquist FFT Tutorial. But I'm getting a slightly different result than expected. The output from `(ffttest)` should have 1 in the 9th array element, but I'm getting 16:
> (ffttest) ffttest : (SEND FFTITER :NEXT) = #(3.28013e15 2.79029e15 1.15578e15 2.79029e 15 2.79029e15 2.79029e15 6.73636e15 1.68587e07 16 2.79029e15 6.73636e15 2.79029e15 2.79029e15 2.79029e15 1.15578e15 3.28013e15 0 2.79029e15 1.15578e15 2.79029e15 2.79029e15 2.79029e15 6.73636e15 1.68587e07 3.4366e07 2.79029e15 6.73636e15 2.79029e15 2.79029e15 2.79029e15 1.15578e15 3.28013e15) I copied and pasted the code from the tutorial, so I doubt there's a mistake on my part. Is 16 the correct result? Also, the tutorial describes the FFT array as:  the DC component goes in array element 0  the Cosine part is in elements 2i  1  the Sine part is in elements 2i  the Nyquist frequency component is in the last element I'm not clear what the meaning of "cosine part" and "sine part" are. The array as shown above doesn't seem like it could be the coefficients for SUM(Asin(2πnt) + Bcos(2πnt)) where n is the frequency. Can anyone please clarify this for me? Thanks for your assistance! 
Hi Mark,
You are right. I don't know how the 1 got in there (maybe a typo) because I get 16 as well. I added some text to my copy of the Nyquist FFT Tutorial as follows, which might answer other questions: Running this prints an array of nearlyzero values except for the 9th element (index 8), which is 16. (In an ideal world, all other values would be exactly zero, but because numerical computation has limited precision, you may see some ugly values like 1.15578e15. The "e15" part means 10totheminus15 power, or 0.000000000000001, which is at least pretty close to zero.) The layout is as follows (remember that the Fourier Transform analyzes a signal as the sum of sines and cosines):
> (load "fft1.lsp") ;loading "fft1.lsp" ;ffttest : (SEND FFTITER :NEXT) = ; #(4.89859e16 0 0 0 0 0 0 2.38419e07 ; 16 0 0 0 0 0 0 4.89859e16 ; 0 0 0 0 0 0 0 2.38419e07 ; 0 0 0 0 0 0 0 4.89859e16) ;T ;> Thus, the element at index 8 is the 4th Sine component, indicating a 4th harmonic as expected. Why is the number 16 rather than 32 or 1? This is just how the FFT is defined. And why 16 rather than +16. Again, if you look closely at the definition, you'll find a minus sign either in front of the sine term or in the complex exponential. While these may not seem to be exactly coefficients of sines and cosines, the FFT and IFFT are carefully defined to be inverses of one another. 
Thank you, it's much clearer now.

Free forum by Nabble  Edit this page 