← Wiki Index / Computation & Algorithms / Cooley–Tukey FFT Algorithm
💻 Computation & Algorithms

Cooley–Tukey FFT Algorithm

The Cooley–Tukey FFT algorithm is the canonical divide-and-conquer Fast Fourier Transform algorithm published by James W. Cooley and John W. Tukey in 1965 that reduces the computation of a composite-length Discrete Fourier Transform from O(N^2) to O(N log N) arithmetic operations.

Cooley–Tukey FFT Algorithm is the foundational divide-and-conquer algorithm in computation and algorithms for computing the Discrete Fourier Transform (DFT) of a complex sequence of composite length N = N1 N2 and its inverse in O(N log N) arithmetic operations. Published by American mathematicians James W. Cooley (of IBM Research) and John W. Tukey (of Princeton University and Bell Labs) in Mathematics of Computation in April 1965—and later discovered by historical scholarship (Heideman, Johnson, & Burrus, 1984) to have been anticipated in an unpublished 1805 astronomical manuscript by Carl Friedrich Gauss—the Cooley–Tukey algorithm is the dominant realization of the Fast Fourier Transform across scientific computing, digital signal processing, spectral partial differential equation solvers, and large-integer polynomial multiplication.

Within computational complexity theory, direct evaluation of the N-point Discrete Fourier Transform from its matrix-vector definition requires N2 complex multiplications and N(N − 1) complex additions. For a signal of N = 220 ≈ 1.05 × 106 samples, direct O(N2) evaluation demands over 1012 operations, whereas the Radix-2 Cooley–Tukey decomposition requires only (N/2) log2 N ≈ 1.05 × 107 complex multiplications—a 100,000-fold reduction that made real-time spectral analysis, OFDM wireless communications (Wi-Fi, 5G LTE), medical MRI reconstruction, and fast integer multiplication for the Miller–Rabin primality test computationally practical.

Mathematical Formulation of the Composite-Length DFT Decomposition

The Discrete Fourier Transform and Primitive Roots of Unity

Given a sequence of N complex numbers x0, x1, ..., xN−1 ∈ ℂ, the N-point Discrete Fourier Transform (DFT) maps the time-domain (or spatial-domain) vector x to the frequency-domain spectrum X0, X1, ..., XN−1 ∈ ℂ defined by:

Xk = ∑n=0..N−1 xn · ωNnk for k ∈ {0, 1, ..., N − 1}

where ωN = exp(−2πi / N) = cos(2π/N) − i sin(2π/N) is the principal primitive N-th root of unity in ℂ, satisfying the periodicity identity ωNm+N = ωNm, the half-period negation identity ωNN/2 = −1 (for even N), and the subgroup decimation identity ωNd·m = ωN/dm whenever d divides N.

General Mixed-Radix Factorization (N = N1 · N2)

Suppose the transform length N is composite: N = N1 · N2 with N1, N2 > 1. The Cooley–Tukey algorithm re-indexes the one-dimensional time index n ∈ {0, ..., N − 1} and the one-dimensional frequency index k ∈ {0, ..., N − 1} as two-dimensional mixed-radix coordinates (n1, n2) and (k1, k2):

n = N2 n1 + n2 (0 ≤ n1 < N1, 0 ≤ n2 < N2)
k = k1 + N1 k2 (0 ≤ k1 < N1, 0 ≤ k2 < N2)

Substituting n · k = (N2 n1 + n2)(k1 + N1 k2) = N2 n1 k1 + n2 k1 + N1 n2 k2 + N n1 k2 into ωNnk and applying ωNN n1 k2 = 1n1k2 = 1 along with ωNN2 = ωN1 and ωNN1 = ωN2 separates the double sum into nested inner and outer DFTs:

Xk1 + N1k2 = ∑n2=0..N2−1 [ ( ∑n1=0..N1−1 xN2n1 + n2 · ωN1n1k1 ) · ωNn2k1 ] · ωN2n2k2

Thus, an N-point DFT reduces to three structured matrix steps:

  1. Compute N2 inner DFTs, each of length N1 (cost: N2 · T(N1)).
  2. Multiply each intermediate element (n2, k1) by the complex phase rotation factor ωNn2k1, called by Gentleman and Sande (1966) a twiddle factor (cost: N multiplications).
  3. Compute N1 outer DFTs, each of length N2 (cost: N1 · T(N2)).

Recursively applying this factorization yields the recurrence T(N1 N2) = N2 T(N1) + N1 T(N2) + O(N), which solves to T(N) = O(N ∑ pi) = O(N log N) whenever N factors into small prime radices.

Radix-2 Decimation-in-Time (DIT) and Decimation-in-Frequency (DIF)

The Danielson–Lanczos Lemma and Radix-2 DIT Butterfly

In the most common special case where N = 2m is a power of two, choosing N2 = 2 and N1 = N/2 yields the Radix-2 Decimation-in-Time (DIT) algorithm (independently derived for X-ray crystallography by G. C. Danielson and Cornelius Lanczos in 1942). Splitting the input xn into its even-indexed samples x2r and its odd-indexed samples x2r+1 (r = 0 .. N/2 − 1) gives:

Xk = ∑r=0..N/2−1 x2r ωN/2rk + ωNk ∑r=0..N/2−1 x2r+1 ωN/2rk = Ek + ωNk Ok

where Ek is the (N/2)-point DFT of the even samples and Ok is the (N/2)-point DFT of the odd samples. Because both Ek and Ok are periodic with period N/2 (Ek+N/2 = Ek and Ok+N/2 = Ok) while the twiddle factor satisfies ωNk+N/2 = −ωNk, a single complex multiplication t = ωNk Ok simultaneously yields both frequency outputs Xk and Xk+N/2 via the Radix-2 DIT Butterfly:

Xk = Ek + ωNk · Ok (for 0 ≤ k < N/2)
Xk+N/2 = Ek − ωNk · Ok (for 0 ≤ k < N/2)

Unrolling this recursion across m = log2 N stages performs (N/2) log2 N butterflies—totaling (N/2) log2 N complex multiplications and N log2 N complex additions.

Gentleman–Sande Decimation-in-Frequency (DIF) and Bit-Reversal Permutation

Choosing the dual factorization N1 = 2 and N2 = N/2 yields the Radix-2 Decimation-in-Frequency (DIF) algorithm (Gentleman & Sande, 1966), which folds the first half xn and second half xn+N/2 of the input array first, and applies the twiddle factor ωNn to the difference before recursing on the even- and odd-indexed frequencies:

un = xn + xn+N/2 (fed to even-frequency DFT X2r)
vn = ( xn − xn+N/2 ) · ωNn (fed to odd-frequency DFT X2r+1)

In an in-place iterative implementation of Radix-2 DIT (or DIF), repeatedly separating even and odd indices permutes the array indices by reversing the binary representation (bm−1 bm−2 ··· b1 b0)2 ↦ (b0 b1 ··· bm−2 bm−1)2, known as the bit-reversal permutation. Notably, connecting a DIF forward transform (natural input → bit-reversed frequency output) to a DIT inverse transform (bit-reversed frequency input → natural output) for fast convolution via the Convolution Theorem cancels both bit-reversal passes!

FFT Algorithm VariantSupported Length NReal Arithmetic Flops (Adds + Mults)Complex MultiplicationsKey Structural Advantage
Direct DFT DefinitionAny N8N2N2Simple O(1) loop overhead for N ≤ 8
Cooley–Tukey Radix-2 (DIT / DIF)N = 2m5 N log2 N(1/2) N log2 NSimplest regular butterfly topology
Cooley–Tukey Radix-4N = 4m4.25 N log2 N(3/8) N log2 NTwiddle factors ±1, ±i at 4th roots are free
Split-Radix FFT (Duhamel–Hollmann, 1984)N = 2m4 N log2 N − 6N + 8 (34/9 N log2 N scaled)(1/3) N log2 NLowest known arithmetic operation count for N = 2m
Stockham Auto-Sort / Four-Step FFTN = N1 N2 (≈ √N × √N)5 N log2 N(1/2) N log2 NCache-oblivious / GPU coalesced (eliminates bit-reversal pass)
Bluestein Chirp-Z / Rader Prime FFTArbitrary Prime NO(N log N)O(N log N)Reduces prime N to power-of-two Cooley–Tukey convolution

Split-Radix Optimality, Cache-Aware Six-Step FFTs, and Historical Lineage

Split-Radix FFT and Cache-Oblivious / FFTW Architecture

In 1984, Pierre Duhamel and Henk Hollmann introduced the Split-Radix FFT, which applies a Radix-2 decomposition to the even-indexed frequencies X2k and a Radix-4 decomposition to the odd-indexed frequencies X4k+1 and X4k+3:

X2k = DFTN/2( xn + xn+N/2 )
X4k+1 = DFTN/4( [ (xn − xn+N/2) − i (xn+N/4 − xn+3N/4) ] ωNn )

Split-Radix reduces the total real arithmetic count (real additions + real multiplications) from 5 N log2 N to 4 N log2 N − 6N + 8 (further refined to (34/9) N log2 N by Johnson and Frigo in 2007 via conjugate-pair factor scaling).

On modern multi-core CPUs and GPUs, memory hierarchy bandwidth rather than raw floating-point count dominates runtime. David H. Bailey's (1990) Four-Step / Six-Step FFT chooses N1 ≈ N2 ≈ √N so that each √N-length sub-transform fits fully inside L1/L2 cache, while FFTW (Matteo Frigo and Steven G. Johnson, 2005) uses a dynamic-programming planner and codelet compiler (genfft) to select optimal mixed-radix Cooley–Tukey factorizations tailored to the target processor's SIMD vector registers (AVX-512, ARM NEON) alongside divide-and-conquer algorithms such as merge sort.

Carl Friedrich Gauss (1805) and the 1965 Nuclear Test Ban Context

Although the algorithm is named after Cooley and Tukey's 1965 publication—which arose when Richard Garwin on President Kennedy's Science Advisory Committee asked Tukey for a fast method to analyze seismic sensor arrays monitoring subterranean Soviet nuclear tests, and Cooley programmed and generalized it at IBM—Carl Friedrich Gauss had derived the precise same mixed-radix factorization N = N1 N2 in 1805 ("Theoria interpolationis methodo nova tractata", published posthumously in Latin in 1866) to interpolate the periodic orbital ephemeris of the asteroid 2 Pallas from 12 sample observations (N = 12 = 3 × 4).

Frequently Asked Questions

How does the Cooley–Tukey FFT compute the Inverse Discrete Fourier Transform (IDFT) using the precise same code?

The Inverse Discrete Fourier Transform xn = (1/N) ∑k=0..N−1 Xk ωN−nk differs from the forward DFT only in the sign of the exponent (+2πi/N instead of −2πi/N) and the final 1/N normalization factor. Taking the complex conjugate of Xk, running the unmodified forward Cooley–Tukey FFT, taking the complex conjugate of the result, and dividing by N (or simply swapping the real and imaginary parts of input and output) computes the precise IDFT in O(N log N) time.

What happens if the input length N is a prime number where N = N1 N2 cannot be factored?

If N is prime, the Cooley–Tukey index factorization N = N1 N2 does not apply directly. Instead, Bluestein's Chirp-Z algorithm (1970) rewrites the product 2*nk* = k2 + n2 − (k − n)2 to express the prime-length DFT as a cyclic convolution, pads that convolution to the next power of two M ≥ 2N − 1, and evaluates it in O(N log N) time using three power-of-two Cooley–Tukey FFTs!

References

  1. Cooley, J. W., & Tukey, J. W. (1965). "An algorithm for the machine calculation of complex Fourier series." Mathematics of Computation, 19(90), 297–301. https://doi.org/10.1090/S0025-5718-1965-0178586-1
  2. Gentleman, W. M., & Sande, G. (1966). "Fast Fourier transforms: For fun and profit." Proceedings of the 1966 Fall Joint Computer Conference (AFIPS '66), Vol. 29, 563–578. https://doi.org/10.1145/1464291.1464352
  3. Duhamel, P., & Hollmann, H. (1984). "Split radix FFT algorithm." Electronics Letters, 20(1), 14–16. https://doi.org/10.1049/el:19840012
  4. Heideman, M. T., Johnson, D. H., & Burrus, C. S. (1984). "Gauss and the history of the fast Fourier transform." IEEE ASSP Magazine, 1(4), 14–21. https://doi.org/10.1109/MASSP.1984.1162257
  5. Frigo, M., & Johnson, S. G. (2005). "The design and implementation of FFTW3." Proceedings of the IEEE, 93(2), 216–231. https://doi.org/10.1109/JPROC.2004.840301
🧬 Support Open Science
Explore interactive science games on LowKey Games or browse scientific apparel & accessories in the CRV Science Shop.
💡 Spot an inaccuracy or have primary literature to expand this article?
Submit a citation or revision note using your shared CRV Science / LowKey Games profile ID.
Suggest Revision