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 nearly-zero 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.15578e-15. The "e-15" part means 10-to-the-minus-15 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):

The output should look like this:
> (load "fft1.lsp")
;loading "fft1.lsp"
;fft-test : (SEND FFT-ITER :NEXT) =
; #(4.89859e-16 0 0 0 0 0 0 2.38419e-07
; -16 0 0 0 0 0 0 4.89859e-16
; -0 0 0 0 0 0 0 -2.38419e-07
; 0 0 0 0 0 0 0 4.89859e-16)
;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.



View this message in context: Re: Nyquist FFT Tutorial Help
Sent from the audacity-nyquist mailing list archive at Nabble.com.