Control Systems · signals

Sampling & Aliasing

Sample a wave too slowly and a phantom appears. See exactly when.
Nyquist: fₛ > 2f

Signal & sampler

Hz

What the sampler sees

true signal samples taken what you'd reconstruct

Frequency domain

where the energy actually lands
Nyquist frequency true frequency & mirror images what lands in the visible band
Readings
Field notes

The Nyquist rule & its ghosts

How it works

Why too-slow sampling lies

To capture a wave, you have to sample it more than twice per cycle. That threshold — fₛ > 2f — is the Nyquist criterion, and half the sampling rate (fₛ/2) is the Nyquist frequency, the highest frequency you can honestly record. Sample any faster wave than that and it doesn't just get lost: it masquerades as a lower frequency that was never there. That impostor is an alias.

Worked example

Sample a 900 Hz tone at 1000 Hz. The Nyquist frequency is only 500 Hz, so 900 Hz is over the limit. It folds down to |900 − 1000| = 100 Hz — you'd record and play back a 100 Hz hum that the original never contained.

It's the same effect as a car wheel appearing to spin backwards on film: the frame rate (sampling) is too slow for the wheel (signal), so your eye reconstructs a slower — even reversed — rotation.

What's the fold formula?

The apparent frequency is |f − fₛ·round(f/fₛ)| — the signal reflects ("folds") off multiples of the sampling rate and off the Nyquist frequency, landing somewhere between 0 and fₛ/2.

How do real systems avoid it?

With an anti-aliasing filter: an analogue low-pass filter before the sampler that removes anything above the Nyquist frequency, so nothing is left to fold down. CD audio samples at 44.1 kHz to cover hearing up to ~20 kHz with margin for the filter.

What happens exactly at f = fₛ/2?

You're right at the edge — two samples per cycle. In theory it's the limit; in practice phase luck means you can catch the peaks or the zero-crossings, so it's unreliable. Stay comfortably below fₛ/2.

Does a higher sample rate always help?

Up to a point — it raises the Nyquist frequency so more of your signal fits under it. But beyond covering your highest real frequency (plus filter margin), extra rate just makes bigger files without capturing anything new.

Why does the spectrum view show three lines instead of one?

The true frequency has mirror images at fs − f, fs + f, and beyond — sampling doesn’t destroy that energy, it copies it to every one of those positions. Only the copy that lands below the Nyquist frequency survives as something you can actually hear or reconstruct; the rest are shown faded because they never make it into the sampled signal.

A teaching model. Single sine wave, ideal instantaneous sampling. Real systems mix many frequencies and use anti-alias filters before the sampler. Audio playback and the spectrum view are illustrative aids, not a literal DAC simulation.
The fold

Where the fake frequency actually lands

Sampling too slowly does not lose the signal, it moves it. Anything above half the sample rate folds back down and reappears somewhere below it, as a perfectly convincing tone that was never there.

Real signalAppears at
1 kHz1 kHzunchanged
3 kHz3 kHzunchanged
3.9 kHz3.9 kHzunchanged
4 kHz4 kHzunchanged
5 kHz3 kHzfolded down
6 kHz2 kHzfolded down
7 kHz1 kHzfolded down
9 kHz1 kHzfolded down
15 kHz1 kHzfolded down

Sampled at 8 kHz, 7 kHz and 9 kHz both come out as 1 kHz — and so does 15 kHz. Once sampled there is nothing left in the data to say which of them was real, or whether a genuine 1 kHz tone was there all along. That is why the anti-alias filter goes before the converter: afterwards the information is gone rather than merely corrupted, and no amount of processing recovers it.

Twice the highest frequency is a floor, not a design target. It assumes a perfect brick-wall filter and infinite record length. Real converters run 2.5× to 10× the signal bandwidth to leave a filter something to work with.

Version history · site-wide passes only

This page has changed in 45 archived releases, but each of those was a site-wide pass, so none is attributable to this tool on its own and none is listed here. That is not a claim that the tool never changed — a release that reworked many pages at once may well have altered this one too. The changelog has them.