Scientific Computing · Signal Processing
Sampling Rate, Aliasing, and the Folding of the Spectrum
Why the Nyquist criterion constrains the signal rather than the converter, how aliasing folds frequencies arithmetically, and what reconstruction actually requires.
A sampler converts a function of continuous time into a sequence of numbers. The conversion looks like a measurement, and it is natural to assume that a faster measurement recovers more of the input. That assumption is false in a specific and useful way: what a sampler can recover depends on a property of the input, not on the speed of the converter alone. Two different continuous signals can produce exactly the same sequence of samples, and no amount of arithmetic applied afterwards separates them.
The criterion is a constraint on the signal
The classical statement is that a signal containing no frequency content at or above $B$ hertz is completely determined by its values at instants spaced $1/(2B)$ seconds apart. Three claims are bundled inside that sentence: that the samples can represent the signal, that the representation is unique among bandlimited signals, and that an explicit reconstruction formula exists.
The qualifier carries the weight. A converter clocked at one million samples per second does not make a nine-hundred-kilohertz tone recoverable if the analog signal also contains energy above five hundred kilohertz. It converts the input faithfully; the input simply does not belong to the class of signals for which unique recovery holds. This is why an anti-aliasing filter sits in front of the converter, in the analog domain, and why its rejection in the transition band sets the true noise floor of a digitizing chain. Anything that reaches the converter above half the sample rate is not rejected later.
The terminology is worth fixing because datasheets mix it. The Nyquist rate of a signal is twice its highest frequency, a property of the signal. The Nyquist frequency of a system is half its sample rate, a property of the clock. A signal at exactly its own Nyquist rate requires a sample rate strictly greater than twice its bandwidth; equality is a degenerate case discussed below.
Folding follows from multiplication by an impulse train
The mechanism is easiest to see in the frequency domain. Sampling multiplies the continuous signal by a train of impulses spaced $T = 1/f_s$. Multiplication in time is convolution in frequency, and the spectrum of an impulse train is another impulse train, spaced $f_s$. The result is that the spectrum of the sampled signal consists of copies of the original spectrum centred at every integer multiple of $f_s$.
If the original spectrum fits inside the interval $[-f_s/2, f_s/2]$, the copies touch but do not overlap, and a lowpass filter recovers the original exactly. If it does not fit, adjacent copies overlap and add. The sum is the sampled spectrum; there is no flag that marks the overlap as damage. Every frequency $f$ in the input appears in the sampled data at the frequency $f - k f_s$ that lands inside the baseband interval, for whichever integer $k$ puts it there.
A tone at 25 kHz sampled at 44.1 kHz therefore appears at 19.1 kHz, because $44{,}100 - 25{,}000 = 19{,}100$. A tone at 30 kHz appears at 14.1 kHz. A tone at 50 kHz appears at 5.9 kHz after subtracting 44.1 kHz. The mapping is a sawtooth and it is not injective: the tones at 19.1 kHz and 25 kHz become the same sequence.
import numpy as np
fs = 44_100
n = np.arange(400)
# A 25 kHz tone is above fs/2; so is nothing about its samples that reveals it.
high = np.cos(2 * np.pi * 25_000 * n / fs)
folded = np.cos(2 * np.pi * 19_100 * n / fs)
print(np.max(np.abs(high - folded))) # ~1e-13, i.e. the same samples
That identity is exact because $25{,}000 + 19{,}100 = f_s$. Adding a whole multiple of the sample rate to a frequency changes nothing observable. The consequence is that aliasing is not noise added to a measurement; it is a superposition that destroys the distinction between two hypotheses about the input, and it does so before any digital processing begins.
Exactly at half the sample rate
The boundary deserves separate treatment because implementations get it wrong. Consider a tone at $f_s/2$. Its samples are $\cos(\pi n + \phi) = (-1)^n \cos\phi$. Amplitude and phase have collapsed into one number: a tone of amplitude $A$ at phase $\phi$ and a tone of amplitude $A\cos\phi$ at phase zero produce identical samples, and a tone at phase $\pi/2$ produces zeros. The sample sequence determines the product, not the two factors.
This is why practical designs specify a passband edge below $f_s/2$ and a stopband edge above it, with the transition band belonging to neither. The width of that band, in hertz, is what the analog filter must span, and it is the reason a converter with a relaxed analog front end is specified with an intermediate frequency plan rather than a bare sample rate.
Reconstruction is part of the contract
Recovering the continuous signal is not a formality appended to sampling. The ideal interpolator is a sinc filter: each sample contributes a sinc pulse centred on its instant, and the sum reproduces the bandlimited input. The sinc has infinite support and is non-causal, so no real converter implements it. A digital-to-analog converter holds each value constant for one sample period, a zero-order hold, whose frequency response is a sinc envelope that droops across the band: the magnitude at half the sample rate is $\mathrm{sinc}(0.5) = 2/\pi$, about $-3.9$ dB, and the droop at a tenth of the sample rate is already around $-0.14$ dB. Compensating that droop is a fixed equalization task, and the hold also images the spectrum at multiples of $f_s$, which the output filter must remove.
The same reconstruction question appears inside purely digital processing. Changing a sample rate requires bandlimited interpolation to the intermediate rate and then decimation with a filter at the lower Nyquist frequency; the polyphase structure that makes this affordable is treated in Polyphase Decimation and the Cost of Changing Sample Rate. The transform view of what the sampler produces, including the periodic extension that the discrete Fourier transform assumes, is in What the Discrete Fourier Transform Computes.
Oversampling buys resolution, and costs bandwidth
Because the quantization error of a converter is approximately white and spread over the full Nyquist band, sampling $M$ times faster spreads the same error power over $M$ times the bandwidth. Lowpass filtering to the original band and discarding the extra samples removes all but $1/M$ of the error power, which improves the signal-to-quantization-noise ratio by $10\log_{10} M$: about 3 dB per doubling of the rate, half a bit of resolution. Sigma-delta converters combine that averaging with noise shaping, which pushes error power toward high frequencies instead of spreading it evenly, and gain far more per doubling at the cost of a low usable bandwidth.
The trade is explicit: bandwidth against resolution against converter complexity. Quantization itself, and the conditions under which the white-error model fails, is the subject of Quantization Noise and the Six-Decibel Rule.
Where the idealization breaks
The theorem assumes samples taken at exact, uniform instants with infinite amplitude precision. Real clocks have jitter, and a timing error of $\sigma_t$ seconds on a sinusoid of frequency $f$ produces an amplitude error proportional to $2\pi f \sigma_t$; the resulting signal-to-noise ratio degrades as $20\log_{10}(2\pi f \sigma_t)$. Because the term scales with $f$, jitter limits high-frequency digitization long before amplitude resolution does, and it limits the upper end of the band that oversampling can usefully recover.
Real signals are also not exactly bandlimited. Every analog anti-alias filter has finite stopband attenuation and a nonzero transition width, so some energy above $f_s/2$ always reaches the converter, attenuated but present. The correct design question is not whether the input is bandlimited but how much alias power the application tolerates, which fixes the filter order and the ratio between the sample rate and the band of interest.
Nonuniform sampling is a separate case in which the failure mode is different: the samples still carry information, but the simple shift-and-add spectrum picture no longer holds, and reconstruction requires solving an interpolation problem rather than filtering. The bandlimited assumption is one way to make sampling invertible. Sparsity is another, and it replaces the frequency-domain guarantee with a combinatorial one, as Sparse Sampling and Recovery Limits describes.
References
- Communication in the Presence of Noise — C. E. Shannon, Proceedings of the IRE, vol. 37, 1949
- Discrete-Time Signal Processing — A. V. Oppenheim and R. W. Schafer, Pearson
- The Scientist and Engineer's Guide to Digital Signal Processing — Steven W. Smith