Reading
Stories Mode

Aliasing — What Happens When You Under-sample

~11 min read Lesson 2 of Module 2

When the Rules Are Broken

In the previous lesson, we established the Nyquist-Shannon Sampling Theorem: sample a bandlimited signal at twice its highest frequency and you can reconstruct it perfectly. The theorem is elegant — but what happens when you violate it? What goes wrong, how badly, and can it be fixed? The answer is aliasing, one of the most important failure modes in all of digital signal processing, and understanding it deeply is essential to building real systems that work.

Aliasing is not just an abstract mathematical pathology. It shows up in movies, in music recordings, in radar systems, in medical images, and in wireless communications. Every engineer who touches a signal — from a hobbyist recording audio at home to a team designing a 5G modem — must understand aliasing and the strategies used to prevent it.

Definition

Aliasing occurs when a signal is sampled below its Nyquist rate (fs < 2fmax). High-frequency components fold back into the spectrum and appear as spurious low-frequency signals — impostors that are indistinguishable from real content and cannot be removed after the fact.

Frequency Folding: The Mechanism

To understand aliasing, we need to think in the frequency domain. When a continuous signal is sampled at rate fs, the sampling process creates periodic copies of the signal’s spectrum, spaced fs apart. If the signal’s highest frequency fmax is less than fs/2, these copies don’t overlap and everything is fine. But if fmax exceeds fs/2, the copies collide — and the collision point is called the folding frequency, located at exactly fs/2.

Imagine a frequency component at 7 kHz being sampled at 10 kHz (fs/2 = 5 kHz). That 7 kHz component is 2 kHz above the folding frequency. When sampling copies the spectrum, the 7 kHz component folds back to 10 − 7 = 3 kHz. The 7 kHz tone has become a 3 kHz impostor — and it is now permanently embedded in the sampled signal.

Alias Frequency Formula
f_{\text{alias}} = \left| f - \operatorname{round}\!\left(\frac{f}{f_s}\right) \cdot f_s \right|
A signal at frequency f sampled at rate fs aliases to falias. The result always falls in [0, fs/2]. Here mod denotes the modulo operation and round(·) rounds to the nearest integer.

The folding is symmetric: a tone at fs/2 + Δf aliases to fs/2 − Δf, reflecting perfectly about the Nyquist frequency. This is why fs/2 is called the folding frequency — the spectrum literally folds back on itself at that point.

Visual Aliasing: The Wagon-Wheel Effect

The most striking everyday encounter with aliasing is the wagon-wheel effect in film and video. A camera captures frames at a fixed rate — a standard film camera shoots at 24 frames per second. This sampling rate has a Nyquist frequency of 12 Hz: it can faithfully capture any periodic visual pattern with a repetition rate below 12 cycles per second.

Now paint a single spoke red and spin the wheel at 23 revolutions per second. Between frames — 1/24 of a second apart — the red spoke travels 23/24 of a full turn, stopping just short of where it started. Your eye takes the shortest path and reads that as 1/24 of a turn backward. Frame after frame the wheel creeps the wrong way, at 1 revolution per second. Speed it up to 25 rev/s and the sign flips: now the spoke overshoots by 1/24 of a turn each frame, and the wheel crawls slowly forward at 1 rev/s. Both rates are far above the 12 Hz limit and both collapse to 1 Hz — the formula above returns |23 − 24| = |25 − 24| = 1 Hz in each case, because the absolute value discards the direction. The direction is the sign of f − round(f/fs)·fs: negative at 23 Hz means reversed, positive at 25 Hz means forward. Track one marked spoke rather than a set of identical ones, incidentally — twelve identical spokes repeat the pattern twelve times per turn, which multiplies the visual frequency by twelve and changes the answer.

Moiré patterns are the spatial equivalent. When a fine regular grid (such as a woven fabric or halftone print) is photographed by a camera sensor with a finite pixel pitch, the fine spatial frequencies of the pattern can exceed the sensor’s spatial Nyquist frequency. The result is large-scale swirling bands that were not present in the original scene — pure aliasing artifacts created by spatial under-sampling.

Why Cameras Have Anti-Aliasing Filters

High-end digital cameras place an optical low-pass filter (OLPF) in front of the sensor to blur fine spatial detail before it hits the pixel array. This is the optical analog of the anti-aliasing filter in an ADC — attenuating spatial frequencies above the sensor’s Nyquist limit to prevent moiré and false color artifacts. Some cameras omit the OLPF for slightly sharper images, at the cost of occasional aliasing on fine textures.

Audio Aliasing: Phantom Tones

In audio systems, aliasing produces phantom tones at incorrect frequencies — sounds that were not in the original recording but appear as if they were. Consider a musician playing a high harmonic at 22.5 kHz on a synthesizer, sampled at 44.1 kHz. The Nyquist frequency is 22.05 kHz. The 22.5 kHz tone is only 450 Hz above the Nyquist limit, so it aliases to 44.1 − 22.5 = 21.6 kHz — a faint but audible frequency well within the human hearing range.

The aliased tone is completely unrelated to any harmonic relationship in the original music. It is an inharmonic artifact, a dissonant ghost that corrupts the tonal structure of the recording. In extreme cases — such as trying to record audio at a much too low sample rate — aliasing produces harsh, buzzing distortion where the entire spectral structure of the signal folds over itself multiple times.

22.05 kHz
Nyquist freq. at 44.1 kHz
4 kHz
Nyquist freq. at 8 kHz (telephone)
0 dB
Alias power loss (no attenuation!)

The Mathematics of Aliasing

The frequency-domain picture of sampling comes from the Poisson summation formula. When a continuous signal x(t) with Fourier transform X(f) is sampled at rate fs, the spectrum of the discrete sequence x[n] is:

Discrete-Time Spectrum via Sampling
X\!\left(e^{j\omega}\right) = \frac{1}{T_s}\sum_{k=-\infty}^{\infty} X\!\left(\frac{\omega}{2\pi T_s} - k f_s\right)
The discrete-time Fourier transform X(ejω) equals the sum of frequency-shifted copies of X(f), spaced fs apart. When fmax < fs/2 the copies do not overlap (no aliasing). Otherwise they do.

When aliasing occurs, the copies overlap and their contributions add together. The result is that for any frequency ω in the discrete domain, the observed value is the superposition of contributions from many different original frequencies. There is no way to distinguish which copy a given value came from — aliasing is irreversible. Once the continuous signal has been sampled below the Nyquist rate, the information lost to aliasing cannot be recovered.

This irreversibility is crucial. Unlike many forms of signal degradation (noise, for example), aliasing cannot be undone by post-processing. A sophisticated filter or machine learning model cannot reconstruct the true high-frequency content from an aliased recording, because the aliased signal is mathematically consistent with infinitely many original signals. The only cure is prevention.

Anti-Aliasing Filters

The standard engineering solution to aliasing is to bandlimit the signal before sampling. An analog lowpass filter — called an anti-aliasing filter — attenuates all frequencies above fs/2. Whatever reaches the ADC then satisfies the Nyquist condition by construction, and aliasing cannot occur.

Designing an effective anti-aliasing filter involves real trade-offs. An ideal brick-wall filter would pass all frequencies below fs/2 perfectly and reject everything above — but such a filter has an infinitely long impulse response and cannot be built in analog hardware. Real filters have a transition band: a range of frequencies between the passband and the stopband where attenuation increases gradually. The steeper the filter roll-off, the more expensive and power-hungry the analog circuitry.

Filter Design Insight

A useful rule of thumb: a 5th-order Butterworth lowpass filter provides roughly 30 dB attenuation per decade above the corner frequency. To achieve 60 dB alias rejection at 1.1 × fs/2, you typically need a 7th- to 9th-order filter. This represents significant analog complexity — motivating the oversampling approach described next.

Oversampling: A Simpler Path

Rather than building a steep, expensive analog anti-aliasing filter, modern ADC designs often use oversampling: sampling at a rate many times higher than strictly necessary, applying a simple analog filter to remove only the grossest aliasing, and then using a sharp digital lowpass filter followed by downsampling to reach the final desired sample rate.

Why is this easier? Digital filters can be made arbitrarily sharp at negligible cost in a modern VLSI process. A 256-tap FIR filter implemented in digital logic is inexpensive, runs at nanosecond speeds, and has perfectly predictable characteristics. Its analog equivalent — a 256th-order analog filter — would be absurdly impractical. By pushing the hard frequency-selectivity work into the digital domain, oversampling architectures deliver superior alias rejection from a much simpler analog front end.

The technique is ubiquitous in consumer electronics. Your smartphone’s audio codec samples at 3–4× the final audio rate internally. Sigma-delta ADCs (used in precision instrumentation and audio) oversample by factors of 64 to 256 and rely entirely on digital filtering for alias rejection. The analog component of the anti-aliasing function is reduced to a simple first-order RC filter that merely prevents out-of-band signals from saturating the ADC input.

Oversampling Ratio
\text{OSR} = \frac{f_s}{2\,f_{\max}}
The oversampling ratio (OSR) is the ratio of the actual sampling rate to the minimum Nyquist rate. An OSR of 4 means sampling at four times the required minimum; the alias zone is pushed out to 2× the audio bandwidth, giving the analog filter plenty of room.

Aliasing Across Domains

Radar and sonar: A radar receiver samples returned pulses to measure Doppler frequency shifts — which correspond to target velocity. If the radar’s pulse repetition frequency (PRF) is too low, fast-moving targets produce aliases. A target moving at 120 m/s might appear as if it is moving at 20 m/s in the opposite direction — a blind speed. Radar designers carefully choose PRF to avoid aliasing of velocities expected in the target environment.

Medical imaging: MRI scanners sample raw data in “k-space” (the spatial frequency domain). Under-sampling in k-space causes the reconstructed image to wrap — a structure from one side of the field of view folds over and appears superimposed on the other side. This wraparound artifact is spatial aliasing, directly analogous to temporal aliasing in audio.

Wireless communications: Software-defined radios (SDRs) receive a wide RF bandwidth and sample the entire band. If the sample rate is insufficient for the total signal bandwidth, signals near the edge of the spectrum alias into the center and cause interference to legitimate channels. Every RF system designer must choose sample rates and analog filter specifications with aliasing clearly in mind.

In the next lesson, we turn to quantization: the second fundamental ADC operation, which introduces a different and complementary form of distortion as continuous amplitude values are rounded to discrete levels.

Key Takeaways
  • Aliasing occurs when a signal is sampled below its Nyquist rate: high-frequency components fold back to appear as spurious low-frequency signals.
  • The folding frequency is fs/2; any signal energy above this limit reflects symmetrically back into the baseband spectrum.
  • Aliasing is irreversible — once introduced during sampling, aliased content cannot be separated from genuine low-frequency content by any post-processing technique.
  • Anti-aliasing lowpass filters applied before the ADC remove signal content above fs/2, preventing aliasing at the cost of analog filter complexity.
  • Oversampling shifts the aliasing problem to high frequencies where a simple analog filter suffices, with a sharp digital filter handling the fine frequency selectivity needed at the Nyquist boundary.
  • Aliasing appears across all sampling domains: audio, video, radar, MRI, and wireless communications all require careful design to avoid it.
Previous The Sampling Theorem Module Overview Next Lesson Quantization & Bit Depth