A fast Fourier transform (FFT) is an algorithm for efficiently computing the discrete Fourier transform (DFT) or its inverse. Rather than defining a different mathematical transform, an FFT reorganizes the DFT calculation to reuse intermediate results. Standard FFT methods reduce the arithmetic cost of transforming samples from to , making Fourier analysis practical for large datasets. FFTs are fundamental tools in signal processing and scientific computing. (fftw.org)
Mathematical definition
For a sequence of complex numbers, one common convention defines the DFT as
where . The inverse is
An FFT evaluates these finite sums more efficiently; in exact arithmetic, it produces the same result as direct evaluation. Sign and normalization conventions differ between implementations: some place the factor on the forward transform, while a unitary convention uses in both directions. (numpy.org)
The DFT is a finite-dimensional counterpart of the Fourier transform. For uniformly sampled time-domain data, its outputs describe frequency components on a discrete grid. With sampling frequency , adjacent frequency bins are separated by . In the usual output ordering, the zero-frequency component comes first, followed by positive-frequency components and then components interpreted as negative frequencies. (numpy.org)
Direct evaluation computes sums containing terms each. Its quadratic computational complexity contrasts with the near-linear cost of an FFT. The notation , expressed using big-O notation, describes asymptotic growth rather than a fixed execution time or speedup. (sigproc.mit.edu)
The Cooley–Tukey principle
The best-known FFT family is the Cooley–Tukey algorithm. It applies divide and conquer: a transform of composite length is decomposed into smaller transforms, whose outputs are combined using complex phase factors. (fftw.org)
Radix-2 decomposition
For even , separate the input into its even- and odd-indexed samples:
Writing , the original transform becomes
Thus two length- transforms produce all outputs after only a linear amount of additional work. The paired addition and subtraction is called a butterfly, and is a twiddle factor. (sigproc.mit.edu)
When , repeated recursive subdivision yields stages. The corresponding recurrence relation is
which gives . The speedup comes from shared subcomputations and the structure of the complex exponentials, not from discarding terms or approximating the transform. (sigproc.mit.edu)
Other factorizations
Cooley–Tukey is not restricted to powers of two. A factorization permits a decomposition into transforms of lengths and , together with twiddle-factor multiplications and rearrangement of indices. Mixed-radix algorithms combine different factors; split-radix algorithms combine decompositions of different sizes, commonly one transform of length with two of length . (fftw.org)
Algorithm families and transform lengths
Different FFT methods exploit different arithmetic structures:
- Prime-factor, or Good–Thomas, algorithms use relatively prime factors of to avoid the interstage twiddle factors required by a corresponding Cooley–Tukey decomposition.
- Rader’s algorithm converts a transform of prime length into a cyclic convolution of length , apart from the zero-frequency term.
- Bluestein’s algorithm rewrites a DFT as a convolution using quadratic phase factors. It handles arbitrary lengths, including primes.
- Split-radix methods seek to reduce arithmetic counts by combining different recursive decompositions. (fftw.org)
Consequently, an FFT does not inherently require a power-of-two input length. Sizes with small prime factors are often convenient, but efficient implementations can also compute prime-length transforms in operations. Padding to a different length may improve execution time, but it changes the transform being evaluated. (fftw.org)
Real-valued and multidimensional transforms
For real-valued input, the output has conjugate symmetry:
with indices interpreted modulo . Approximately half the frequency-domain values are therefore redundant. Real-input FFT algorithms exploit this symmetry to reduce computation and storage. The zero-frequency coefficient is real, as is the Nyquist-frequency coefficient when is even. (numpy.org)
A multidimensional DFT is separable: it can be computed by applying one-dimensional transforms along each array dimension. A two-dimensional transform, for example, can be evaluated by transforming every row and then every column. For a fixed-dimensional array containing elements, this approach gives an arithmetic cost of . Multidimensional FFTs support applications in image processing and computational science. (fftw.org)
Applications
Spectral analysis
FFTs convert sampled signals into frequency-domain representations, allowing analysis of oscillations, amplitude, and phase. They are used in audio analysis and other forms of signal processing. Applying transforms to successive data segments provides a time-dependent view of spectral content rather than a single spectrum for an entire record. (numpy.org)
Fast convolution and filtering
The convolution theorem connects convolution in one domain with multiplication in the other. With the normalization above,
where multiplication is elementwise and denotes circular convolution. This gives an efficient route to filtering long sequences. (mathworks.com)
Circular convolution is not automatically the same as linear convolution. For sequences of lengths and , both must be padded to a common transform length of at least to recover the full linear convolution without wraparound. The same coefficient-convolution relationship underlies FFT-based multiplication of polynomials. (mathworks.com)
Numerical computation
Fourier-transform methods can also assist in solving partial differential equations. Transforming along spatial dimensions can simplify suitable differential operators, while the choice of transform must match the problem’s boundary conditions. Related fast cosine and sine transforms are useful for different symmetry and boundary requirements. (fftw.org)
Implementation and numerical accuracy
Arithmetic count alone does not determine performance. Memory access, cache behavior, data layout, and processor capabilities can outweigh modest differences in operation counts. Optimized implementations therefore combine small specialized transform kernels with different decompositions and execution strategies. (fftw.org)
Some libraries construct a plan before execution, selecting an implementation for a particular transform size, layout, and machine. The planning cost can be reused across repeated transforms. FFTW is a prominent example of this adaptive approach. (fftw.org)
In floating-point arithmetic, intermediate operations introduce rounding errors. Different FFT algorithms may consequently produce slightly different numerical outputs even though they represent the same exact transform. Well-implemented Cooley–Tukey methods have favorable numerical stability, but accurate twiddle factors are important: poorly chosen recurrences for generating them can accumulate substantial error. (fftw.org)
Interpretation and limitations
An FFT accelerates a calculation; it does not eliminate the limitations of the sampled data. In particular, zero-padding creates a denser sampling of the finite record’s spectrum but does not improve its intrinsic ability to resolve closely spaced frequency components. That ability depends on the original observation length and sampling rate. (mathworks.com)
Normalization and output ordering also matter. Raw coefficients, normalized amplitudes, and power spectra are different representations; a one-sided spectrum for real input requires appropriate treatment of the redundant negative-frequency components. Comparisons between implementations must account for their sign, scaling, and ordering conventions. (numpy.org)
Computing a full FFT is not always necessary when only a few frequency components are required. Specialized or pruned methods can calculate selected outputs, although their savings depend on how many outputs are needed and on implementation overhead. (fftw.org)
History
FFT-like decompositions predate electronic computers. Carl Friedrich Gauss described a method in 1805 that was later recognized as an early form of the Cooley–Tukey approach. This connection was established through subsequent historical research. (ftp.fftw.org)
The modern widespread adoption of the FFT followed James W. Cooley and John W. Tukey’s 1965 paper, An Algorithm for the Machine Calculation of Complex Fourier Series. Their presentation showed how factorizations of the transform length could greatly reduce computational work. Later research developed additional algorithms, real-data and multidimensional methods, and implementations optimized for particular computing architectures. (research.ibm.com)
References
- FFTW Home Pagefftw.org
- Discrete Fourier Transform (numpy.fft) — NumPy v2.2 Manualnumpy.org
- FFTW FAQ - Section 3fftw.org
- Fast Fourier Transform — 6.300: Signal Processingsigproc.mit.edu
- The Design and Implementation of FFTW3fftw.org
- Introduction (FFTW 3.3.11)fftw.org
- Amplitude Estimation and Zero Paddingmathworks.com
- Multi-dimensional Transforms (FFTW 3.3.11)fftw.org
- Equalization, Convolution, and Cyclic Prefix Additionmathworks.com
- More DFTs of Real Data (FFTW 3.3.11)fftw.org