1. Why go discrete?
The Fourier and Laplace chapters worked with continuous functions. But a computer stores a list of numbers, not a function: samples x[n] = x(nT) taken every T seconds. Everything digital — audio, images, radar, wireless — lives in that world. Three questions organise this chapter:
- How fast must we sample so nothing is lost? (the sampling theorem and aliasing)
- What is the spectrum of a finite list of samples? (the DFT, and the FFT that computes it fast)
- What replaces the Laplace transform for sequences? (the z-transform)
2. Sampling & aliasing
The sampling theorem (Nyquist–Shannon): a signal whose frequencies all lie below fmax is determined completely by its samples, provided the sampling rate satisfies fs > 2 fmax. Frequencies above fs/2 do not disappear: they fold back and masquerade as lower ones:
Why does this happen? Sampling in time multiplies the signal by a train of impulses, and multiplication in time becomes repetition in frequency: the spectrum is copied to every multiple of fs. If the copies overlap (fs too small) they add up and cannot be separated:
Worked example 1: two frequencies, one set of samples
Sample at fs = 8 Hz. The tone cos(2π · 7t) gives cos(2π · 7n/8) = cos(2πn − 2πn/8) = cos(2π · 1 · n/8): exactly the samples of a 1 Hz tone. Likewise 5 Hz and 3 Hz are indistinguishable. In the same way a 900 Hz tone sampled at 1000 Hz appears at |900 − 1000| = 100 Hz.
The cure is not in software afterwards — the information is already gone — but an analogue anti-aliasing filter before the sampler that removes everything above fs/2.
A 60 Hz mains hum leaks into a sensor sampled at 100 Hz. At what frequency does it appear? What minimum rate would represent audio with content up to 20 kHz?
3. The discrete Fourier transform
Given N samples, the DFT asks, for each k = 0, …, N − 1: how much of the complex exponential that completes k cycles over the record is present? It is the same “wind the signal around a circle” idea as the Fourier transform, with sums instead of integrals:
Write W = e−2πi/N. The DFT is then multiplication by the N × N matrix with entries Wkn. Its columns are orthogonal, so F*F = N·I (a scaled unitary matrix — the orthonormal-basis idea of the previous chapter, with complex exponentials as the basis). Two practical facts: bin k corresponds to frequency k·fs/N, so the frequency resolution is fs/N (record longer to resolve closer tones); and for real data X[N − k] is the complex conjugate of X[k], so only k ≤ N/2 carries new information.
Worked example 2: the 4-point DFT of (1, 2, 3, 4)
With W = e−2πi/4 = −i:
X[0] is the sum (the “DC” component). Because the input is real, X[3] is the complex conjugate of X[1] as promised. Note also Parseval: Σ|x|² = 30 and (1/N)Σ|X|² = (100 + 8 + 4 + 8)/4 = 30.
1000 samples are recorded at fs = 1000 Hz. Which frequency does bin k = 50 represent, and how close can two tones be and still be told apart?
4. The FFT: divide and conquer
Computing the DFT from the definition costs N² multiplications. The fast Fourier transform gets the same numbers in about N log N. The trick: split x into its even-indexed and odd-indexed samples. Each half has its own length-N/2 DFT, E[k] and O[k], and the full DFT is assembled from them with just N/2 multiplications:
The two lines share WNkO[k], so each pair of outputs costs one multiplication — a “butterfly”. Apply the idea recursively to E and O down to length 1, and you get log₂N stages of N/2 butterflies:
Worked example 3: the split in action, and the cost
Redo (1, 2, 3, 4). Even samples (1, 3) have DFT E = (4, −2); odd samples (2, 4) have O = (6, −2). With W₄⁰ = 1 and W₄¹ = −i:
The same four numbers as before. The count for large N: with N = 2²⁰ ≈ 10⁶ samples the direct DFT needs N² ≈ 1.1 × 10¹² multiplications, while the FFT needs (N/2)log₂N ≈ 1.05 × 10⁷ — about 100,000 times fewer. A one-second-long audio frame becomes a millisecond job instead of hours.
5. Convolution & filtering
Filtering a signal x by a system with impulse response h is the convolution y = x * h, costing N² operations done directly. As in the Fourier chapter, convolution in time is multiplication in frequency — now with the FFT making the detour cheap:
One caveat: the DFT product computes circular convolution (the signals wrap around). Pad both with zeros to length at least len(x) + len(h) − 1 and it equals the ordinary linear convolution. This “fast convolution” is how long audio filters and big-integer multiplication run in O(N log N).
Worked example 4: convolution is polynomial multiplication
Multiply (1 + 2x + 3x²)(4 + 5x). The coefficient of each power of x is a sum of products, which is exactly the convolution of the coefficient lists:
so the product is 4 + 13x + 22x² + 15x³. Pad both lists to length 8, FFT, multiply pointwise, inverse FFT: the same four numbers appear. For polynomials with millions of terms (or integers with millions of digits) this is the only practical way.
6. The z-transform
For sequences, the z-transform plays the role the Laplace transform plays for functions. A delay by one sample becomes multiplication by z⁻¹, so difference equations become algebra:
The two transforms are tied together by sampling: a continuous pole at s corresponds to the discrete pole at z = esT. The left half of the s-plane maps to the inside of the unit circle, and the jω axis maps to the unit circle itself. So the stability test becomes: all poles strictly inside |z| = 1.
Worked example 5: a first-order digital filter
The filter y[n] = 0.5y[n − 1] + x[n] has H(z) = 1/(1 − 0.5z⁻¹) with a pole at z = 0.5. Feeding in a unit impulse gives h[n] = 0.5ⁿ: 1, 0.5, 0.25, 0.125, … — decaying, because the pole is inside the unit circle: stable.
Change the coefficient to 1.2: the pole at 1.2 is outside the circle and h[n] = 1.2ⁿ = 1, 1.2, 1.44, 1.73, 2.07, … grows without bound. The continuous analogue is a pole in the right half-plane; the correspondence is esT = 1.2, i.e. s = ln(1.2)/T > 0.
7. Practice & where it shows up
A continuous system has a pole at s = −2 (time constant 0.5 s). It is simulated with sample time T = 0.1 s. Where is the discrete pole, and is it stable?
The recursion above halves N each time. What if N is not a power of two, and what does zero-padding do to the spectrum?
Audio & video compression
MP3 and AAC transform each short block of samples into frequency coefficients (an MDCT, a close relative of the DFT) and discard what the ear cannot hear. JPEG does the same in 2D with the DCT.
Wireless communications
Wi-Fi, 4G and 5G use OFDM: data are placed on many orthogonal subcarriers with an inverse FFT at the transmitter and an FFT at the receiver.
Imaging & scientific instruments
MRI measures the 2D Fourier transform (k-space) and an inverse FFT forms the image. Spectrum analysers, radar and sonar are FFT engines.
Digital filters & control
FIR/IIR filters are designed with the z-transform; a continuous controller is discretised by z = e^(sT). Fast convolution makes long filters and reverb cheap.
8. Resources
This chapter follows the discrete-time half of MIT 6.003 (sampling, z-transform) and the Fourier-methods unit of MIT 18.085 (DFT, FFT, convolution). Stanford’s EE 261, taught by Brad Osgood, is the best long treatment of the Fourier transform and its discrete cousins.