HomeArticlesNyquist Sampling

Nyquist Sampling: When Digital Captures Analogue

Sample above twice a signal's highest frequency and it can be recovered perfectly. Sample too slowly and high frequencies pretend to be low ones.

mysimulator teamUpdated June 2026≈ 8 min read▶ Open the simulation

Turning a continuous wave into a list of numbers

Every digital recording, every digital photograph, every value your microcontroller reads off a sensor is the result of the same operation: an analogue-to-digital converter measures a continuous signal at regular instants and throws away everything in between. The obvious worry is whether that throwing-away loses information. The sampling theorem, developed by Harry Nyquist and proven rigorously by Claude Shannon, gives a precise and surprisingly generous answer: if the signal contains no frequency component above some limit B, and you sample it at a rate greater than 2B samples per second, the discrete samples contain everything needed to reconstruct the original continuous signal exactly.

Nyquist rate      fs > 2B          minimum safe sample rate
Nyquist frequency fs / 2           the highest frequency a rate fs can represent
CD audio          fs = 44,100 Hz   captures audio up to ~22 kHz, above human hearing

This is a genuinely strong result — it says a finite list of numbers, taken at the right rate, is not an approximation of a smooth waveform but a complete and lossless encoding of it, given the bandwidth limit. No information about the shape of the curve between samples is missing; it is uniquely determined by the samples through the reconstruction formula.

live demo · a smooth wave versus its discrete samples● LIVE

Aliasing: when frequencies masquerade as other frequencies

Sample below the Nyquist rate and the theorem's guarantee simply stops holding — the underlying frequency is no longer uniquely recoverable from the samples. A frequency f above the Nyquist frequency fs/2 is recorded identically to some lower alias frequency, indistinguishable in the sampled data from a real signal that was never there. Two familiar examples show the same mechanism: a spinning wheel filmed under a strobing light or a fixed-frame-rate camera can appear to rotate slowly backwards once its true rotation rate exceeds half the frame rate, and an audio signal recorded below the Nyquist rate develops harsh, unrelated tones that were not part of the original sound.

The anti-aliasing filter

Because aliasing cannot be undone after the fact — once a high frequency has folded down into the recorded band, no digital processing can tell it apart from a genuine low frequency — practical systems remove the risk before sampling. An analogue low-pass filter, the anti-aliasing filter, is placed ahead of the analogue-to-digital converter to attenuate everything above the Nyquist frequency, at the cost of also limiting the useful bandwidth of the recording. Choosing that filter's cutoff and steepness is itself an engineering trade-off: a gentler filter passes more of the wanted signal near the cutoff but lets more aliasing energy through, which is why real sample rates (44.1 kHz for CD audio, well above twice the 20 kHz limit of human hearing) sit comfortably above the theoretical minimum.

Reconstruction: turning samples back into a curve

The reconstruction side of the theorem is just as important as the sampling side. Given a properly sampled sequence, the unique bandlimited signal passing through every sample point is recovered by convolving the samples with a sinc function — an idealized low-pass filter with a perfectly sharp cutoff at the Nyquist frequency. A real digital-to-analogue converter cannot build a perfect sinc filter, so it uses practical approximations, but the underlying principle is the same: reconstruction is fundamentally a filtering operation, not a guess.

Where the limit shows up beyond audio

The theorem is not specific to sound. Image sensors sample a continuous scene spatially, and undersampling fine repeating patterns (a striped shirt, a picket fence) produces spatial aliasing seen as moiré patterns. Radio receivers deliberately exploit undersampling in a controlled way — bandpass sampling — to digitize a narrow slice of a much higher carrier frequency using a sample rate related to the signal's bandwidth rather than its absolute frequency, provided the surrounding spectrum is filtered out first so nothing else aliases into the band of interest.

Frequently asked questions

Why does the Nyquist rate need to be strictly greater than twice the bandwidth, not equal to it?

Sampling at exactly twice the highest frequency can capture that frequency at its zero crossings every time, recording only silence for a real tone. Practical systems sample comfortably above twice the bandwidth, and real anti-aliasing filters never cut off perfectly sharply, so extra headroom is built in as well.

What causes aliasing and why does it sound or look wrong rather than just quiet?

A frequency above half the sample rate does not disappear — it gets folded back and recorded as a lower, false frequency that was never present in the original signal. That is why undersampled audio gets a harsh, unrelated tone and undersampled video shows a wagon wheel appearing to spin backwards instead of simply losing detail.

Why is an analogue anti-aliasing filter needed before the analogue-to-digital converter?

The sampling theorem only guarantees perfect reconstruction if nothing above the Nyquist frequency reaches the sampler. Any energy above that limit, whether from the signal itself or from noise, folds down into the audible or visible band as aliasing, and once sampled that corruption cannot be removed digitally, so it must be filtered out in the analogue domain first.

Try it live

Everything above runs in your browser — open Nyquist Sampling and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.

▶ Open Nyquist Sampling simulation

What did you find?

Add reproduction steps (optional)