📈Interpolation and Approximation
Trigonometric Interpolation and the FFT
The discrete Fourier transform, the fast Fourier transform, spectral analysis, leakage and aliasing
1963–1965: listening for bombs
The partial test-ban talks between the United States, the United Kingdom and the Soviet Union stumble on one technical question: atmospheric tests can be detected from afar, but can an underground explosion be told apart from an earthquake, using seismometers outside the Soviet Union? The answer lies in the frequency content of the recorded waves — and computing the spectrum of a long record with the obvious formula takes operations.
John Tukey, a Princeton statistician serving on President Kennedy's Science Advisory Committee, sketches a way to compute the transform in far fewer steps. The physicist Richard Garwin, who wants it for exactly this purpose, takes the idea to James Cooley, a programmer at IBM's research centre, and asks him to make it work. In 1965 Cooley and Tukey publish An Algorithm for the Machine Calculation of Complex Fourier Series — five pages.
For samples the fast algorithm is about 100,000 times faster. It changed signal processing, communications, imaging and computing itself. Years later, historians found that Gauss had derived the same idea in 1805 while interpolating asteroid orbits — in a manuscript published only after his death.
For a periodic signal, the natural interpolating functions are sines and cosines. Sample a signal at equally spaced times over one period. The discrete Fourier transform (DFT) gives the coefficients of the trigonometric polynomial through those samples:
Xₖ measures how much of frequency k cycles per record is in the signal. With sampling rate fs, bin k corresponds to f = k fs/N; the resolution is fs/N = 1/(record length). Computed directly: N² complex multiplications.
Derivation
Why the inverse formula undoes the transform
Complex exponentials. Euler's formula packs a cosine and a sine into one number, so is a sampled wave that makes complete turns over the samples. Working with them instead of separate sines and cosines makes the algebra short.
The key sum. Fix two indices and and add the waves over all . With the sum is a geometric series:
since . Different discrete frequencies are orthogonal.
Inverting. Substitute the definition of into the inverse formula and swap the order of the sums:
So the inverse formula reproduces every sample: it is a trigonometric polynomial passing through the data, and the are its coefficients — trigonometric interpolation.
💡The fast Fourier transform
Split the sum into even and odd samples:
and are DFTs of length , and since they repeat with period , . One transform of length becomes two of length plus multiplications by 'twiddle factors'. Recurse down to length 1: about multiplications instead of — 5,120 instead of a million for , and instead of for .
numpy.fft uses refined versions that work for any , fastest when has only small prime factors.Derivation
Counting the FFT's multiplications
Why the halves repeat. is a DFT of length , so (adding to adds a whole number of turns to every exponential); the same for . The twiddle factor changes sign, . That is why one pair gives two outputs, and , for one multiplication.
The count. Let be the multiplications for length . Two half-length transforms plus twiddle multiplications:
Each halving adds to , and there are halvings down to length 1, which costs nothing. So :
💡Aliasing and the Nyquist frequency
Sampled at rate , the signals and have identical samples. Frequencies above the Nyquist frequency fold back into : a 70 Hz vibration sampled at 100 Hz looks exactly like a 30 Hz one, and so do 130 and 170 Hz. No processing after sampling can undo it. The sampling theorem (Nyquist 1928, Shannon 1949): a signal containing no frequencies above is determined completely by samples taken faster than . That is why every data-acquisition system has an analogue anti-aliasing filter before the converter.
Derivation
Why two frequencies can share the same samples
Sampling at rate means looking only at the times . Shift the frequency by a whole multiple of :
because is a whole number of turns. The two signals differ between the samples but agree at every one of them. Since cosine is even, and also agree: . So every frequency has a twin in — the 70 Hz vibration and its 30 Hz alias at Hz — and from samples alone the two are indistinguishable.
📐Listening to a gearbox
An accelerometer on a gearbox, sampled at 1000 Hz for 4 s (, resolution 0.25 Hz), records a shaft vibration at 23.6 Hz and a ten-times-weaker gear-mesh tone at 147.3 Hz. Neither falls on a bin. With no window the FFT finds peaks at 23.50 and 147.25 Hz, but with amplitudes of only 0.76 and 0.093 (true: 1 and 0.1), and energy leaks across the spectrum — at 60 Hz, where there is nothing. A Hann window, which tapers the record smoothly to zero at both ends, gives amplitudes 0.90 and 0.097 and cuts the leakage at 60 Hz by a factor of 17. Windowing trades a slightly wider peak for a much cleaner spectrum — essential when a weak tone sits near a strong one.
mathematical analysis is as extensive as nature itself; it defines all perceptible relations, measures times, spaces, forces, temperatures
🕰Gauss, again
In 1805 Gauss needed to interpolate the orbits of the newly discovered asteroids Pallas and Juno from a handful of observations — trigonometric interpolation of a periodic function. His notes describe splitting a transform of size into smaller ones, the essential idea of the FFT. They were published only in 1866, in Latin, in his collected works, and were noticed by Heideman, Johnson and Burrus in 1984. Ceres opened Unit 5; the asteroids found after it close this unit.
💡Where you will use this
Structures and Rotating machinery: modal testing and condition monitoring are spectral analysis of accelerometer records. GNSS Navigation: receivers acquire satellite signals by FFT-based correlation over code phase and Doppler. Signals and Systems, Power Electronics: harmonic analysis of converter waveforms. Numerical PDEs (Unit 10): spectral methods solve periodic problems by FFT, and fast Poisson solvers use it for whole grids.
📚Further reading
- Michael Heath, Scientific Computing: An Introductory Survey (2nd ed.; SIAM Classics 2018), chapter 12, 'Fast Fourier Transform'.
- James Cooley and John Tukey, 'An algorithm for the machine calculation of complex Fourier series', Mathematics of Computation 19(90), 297–301 (1965).
- Michael Heideman, Don Johnson and C. Sidney Burrus, 'Gauss and the history of the fast Fourier transform', IEEE ASSP Magazine 1(4), 14–21 (1984).
- Steven W. Smith, The Scientist and Engineer's Guide to Digital Signal Processing (California Technical Publishing, 1997) — sampling, aliasing, windows and the FFT for engineers; free online.
↓But there is a problem
This unit was about knowing a function between the points where it was measured — by polynomials, splines and sines. With an interpolant in hand, we can do more than evaluate it.
A rocket motor's thrust is recorded every millisecond on a test stand. The number the customer pays for is the total impulse — the integral of that curve. A structural test records displacement at a few gauges; the engineer needs strain — a derivative. Both are calculus applied to numbers.
Differentiation, it turns out, is treacherous with measured data, and integration is forgiving. The next unit explains why — and how to squeeze astonishing accuracy out of a few function values.