FAST FOURIER TRANSFORMS
There's one big problem with the code I've presented in this chapter's sample program: it's too slow! I've tried to make the code as easy to follow as possible, but that means that it's nowhere near optimized, and is therefore not suitable for anything other than teaching concepts. Even a small BUFFERSIZE value of 1024 will strain all but the latest hardware!Tip | If you run the popular SETI@Home screensaver, you may have noticed that it spends a lot of its time calculating "FFTs." These FFTs are, in fact, Fast Fourier Transforms—the screensaver is using the Fast Fourier Transform to deduce the amplitude of frequencies in the source input signal. |
To get any real mileage out of the DFT, it must be sped up. Fortunately, in 1965, Cooley and Turkey invented an amazing algorithm that speeds up the DFT by several orders of magnitude. This algorithm is called the Fast Fourier Transform, or FFT. The FFT does the same thing as a Discrete Fourier Transform, only it does it, well, wicked fast.I don't have the space to cover it in detail here, but I've provided several links on your CD that will point you to explanations and implementations of the FFT. Your mission, should you choose to accept it, is to add an FFT method to CDiscreteFourierTransform, making it truly ready for use in real-time applications.