Understanding Aliasing and How to Avoid It in Digital Signals

A striped shirt shimmers and crawls on a television screen. A wagon wheel in an old film appears to spin backwards. A cymbal captured at a low sample rate picks up a metallic whine that was never in the room. Three different media, one underlying fault.

Aliasing is one of the few engineering problems you can see or hear directly, and it is nearly always self-inflicted: the information needed to prevent it was available at the moment of sampling. The fix is well understood, and a little thought at the design stage usually keeps it out for good.

What aliasing actually is

When a continuous signal is measured at fixed intervals, the samples become the only record you keep. Anything that changed between two samples is gone — but it does not vanish politely. High-frequency content returns as lower-frequency content, behaving exactly as though it had been there all along. That false lower-frequency signal is the alias.

The name is apt: a high tone arrives under an assumed identity. Once it sits in your data, no amount of clever processing can separate the impostor from the genuine article, because the two are numerically identical. Filtering after the converter removes the alias and the real signal in the same stroke.

The Nyquist limit, and what lies beyond it

The sampling theorem sets a clear boundary: to capture a signal faithfully, you must sample at more than twice the highest frequency it contains. Sample at 48 kHz and you can represent content up to 24 kHz — the Nyquist frequency — which sits comfortably above the limit of human hearing and explains why that rate is a common choice for audio work.

Above that line, frequencies fold. A component at 30 kHz, sampled at 48 kHz, produces a stream of numbers indistinguishable from an 18 kHz component, because 48 − 30 = 18. Push the input higher and the alias slides back down: at 47 kHz it lands at 1 kHz. The fold points repeat at every multiple of the sample rate, so a fast sampler has a whole ladder of them.

Folding is not the same as filtering

A low-pass filter makes a signal duller; it removes energy and the top end fades. Aliasing moves energy to a new place without reducing it. That difference matters in practice: a badly sampled recording often sounds harsh and gritty rather than muffled, and the damage is usually worst in the quiet parts of the spectrum, where a false tone sits on top of detail you were trying to protect.

Anti-aliasing filters: the first line of defence

Every reliable defence works the same way — reduce the high-frequency content before it reaches the sampler. In the analogue domain that means a low-pass filter between the sensor or input and the analogue-to-digital converter, flat across the band you care about and heavily attenuating by the time the spectrum reaches the Nyquist frequency. The gap between “still passing” and “fully blocked” is the transition band, and its width decides how hard the filter has to work.

Common choices:

  • Simple RC or active filters for slow signals such as temperature or pressure, where a gentle roll-off is enough.
  • Higher-order analogue filters — Butterworth for a smooth passband, Chebyshev or elliptic where a steeper transition justifies a little ripple.
  • Switched-capacitor filters for a tunable cut-off in instrumentation and audio front ends.
  • Digital decimation filters inside the converter or downstream, used whenever the sample rate is reduced in software.

The trap is assuming the converter takes care of it. Plenty of ADCs will cheerfully digitise whatever you feed them, aliases included.

Oversampling: buying yourself room

Designers rarely fight this battle with analogue parts alone, because a steep analogue filter is costly, drifts with temperature and adds noise of its own. Instead, most modern converters sample far faster than the final rate — often by a factor of 64 or more, using a sigma-delta modulator — then apply a sharp digital low-pass filter and decimate down to 48 kHz, or whatever the system needs. Digital filtering is cheap, repeatable and can be made as steep as you like.

The same trick works in software. Any stage that creates new high frequencies — distortion, saturation, hard compression, bit-crushing, a non-linear amp model — generates harmonics reaching far above the Nyquist frequency. Running that stage at four or eight times the output rate, filtering, then returning to the original rate keeps those harmonics from folding back as gritty hash.

Where else it appears

Audio is only the most familiar case. The wagon wheel and the striped shirt are the same phenomenon in space and time: a pattern sampled by a frame rate or a pixel grid that cannot resolve it. In imaging you meet it as moiré on fine fabrics, roof tiles and distant brickwork.

In control systems it can be more serious. Sample a machine’s vibration at 100 Hz and a 60 Hz oscillation shows up in the data as 40 Hz — a phantom that a controller may try to correct, sometimes nudging the loop towards instability. In radio, mixing a signal to a new frequency band without adequate filtering folds unwanted channels on top of the one you want. In radar and ultrasound, an under-sampled return can place a target at the wrong range.

A practical checklist

  1. Work out the real bandwidth first. Not what you hope to measure, but the fastest thing the sensor, cable or microphone can deliver.
  2. Sample at two and a half to five times the highest frequency of interest, not merely twice, so your anti-aliasing filter has room to roll off.
  3. Put the filter before the converter. Software cannot repair what the ADC has already confused.
  4. Oversample every non-linear stage, then decimate. Clipping and distortion generate harmonics whether you plan for them or not.
  5. Test with a swept tone. Feed a sine sweep downwards from above the Nyquist frequency and watch the spectrum; an alias rising as you sweep confirms the problem is real and shows where your filter stops working.
  6. Check the whole chain, including sample-rate conversion, wireless links and logging code that resamples quietly in the background.

Get these right and aliasing stops being a mystery. It becomes what it should be: a design detail, settled early, that never troubles you again.

Photo: Javaistan / Pixabay