Usage Notes

Fast Fourier Transforms

A fast Fourier transform (FFT) is simply a discrete Fourier transform that is computed efficiently. The straightforward method for computing the Fourier transform takes approximately n2 operations where n is the number of points in the transform, while the FFT (which computes the same values) takes approximately n log n operations. It uses the system’s high performance library for the computation, if available. The algorithms in this chapter are modeled on the Cooley-Tukey (1965) algorithm. Hence, these functions are most efficient for integers that are highly composite; that is, integers that are a product of small primes.

For the two functions fftReal and fftComplex there is a corresponding initialization function. Use these functions only when repeatedly transforming sequences of the same length. In this situation, the initialization function computes the initial setup once. Subsequently, the user calls the corresponding main function with the appropriate option. This may result in substantial computational savings. For more information on the use of these functions, consult the documentation under the appropriate function name.

In addition to the one-dimensional transformations described above, we also provide a complex two-dimensional FFT and its inverse.

Continuous Versus Discrete Fourier Transform

There is, of course, a close connection between the discrete Fourier transform and the continuous Fourier transform. Recall that the continuous Fourier transform is defined (Brigham 1974) as

ˆf(ω)=f(t)e2πiωtdt

We begin by making the following approximation:

ˆf(ω)T/2T/2f(t)e2πiωtdt=T0f(tT/2)e2πiω(tT/2)dt=eπiωTT0f(tT/2)e2πiωtdt

If we approximate the last integral using the rectangle rule with spacing h=T/n, we have

ˆf(ω)=eπiωThn1k=0e2πiωkhf(khT/2)

Finally, setting ω=j/T for j=0,...,n1 yields

ˆf(j/T)eπijhn1k=0e2πijk/nf(khT/2)=(1)jn1k=0e2πijk/nfhk

where the vector fh=(f(T/2),...,f((n1)hT/2)). Thus, after scaling the components by (1)jh, the discrete Fourier transform, as computed in fftComplex (with input fh) is related to an approximation of the continuous Fourier transform by the above formula.

If the function f is expressed as a C function, then the continuous Fourier transform

ˆf

can be approximated using the IMSL function intFcnFourier (Quadrature).