Studio LOOS Audio Lab • The Hague
100% IN-BROWSER
đź”’ Zero Audio Uploads: Audio files are decoded & processed in your local browser RAM via Web Audio API. No sound data ever leaves your device.

Nyquist-Shannon Sampling Theorem & Anti-Aliasing Filters in DSP

The entire global infrastructure of digital audio—from high-resolution studio mastering and music streaming to digital synthesizers and cellular telecommunications—rests upon a single foundational mathematical theorem: the Nyquist-Shannon Sampling Theorem.

Formulated by Bell Labs engineer Harry Nyquist in 1928 and rigorously proven by Claude Shannon in 1949, this theorem answered what once seemed like an impossible question: Can a continuous, infinitely detailed analog sound wave be completely captured and perfectly reconstructed using a finite series of discrete digital numbers? The answer is an unequivocal yes—provided one strict mathematical condition is met. When that condition is violated, digital systems generate one of the most abrasive and musically destructive forms of distortion known to acoustic science: aliasing.

1. The Nyquist-Shannon Criterion & The Sinc Reconstruction Proof

The Nyquist-Shannon Sampling Theorem states:

"If a continuous signal \(x(t)\) contains no frequencies higher than \(B\) Hertz, it is completely determined by giving its ordinates at a series of points spaced \(T_s = 1/(2B)\) seconds apart."

In digital audio terminology, to perfectly capture an audio bandwidth extending up to maximum frequency \(f_{\text{max}}\), the uniform sampling rate \(f_s\) must be strictly greater than twice the highest frequency component:

$$f_s > 2 f_{\text{max}} \iff f_{\text{Nyquist}} = \frac{f_s}{2} > f_{\text{max}}$$
The Nyquist Criterion: Sampling rate must exceed twice the highest frequency in the signal

The "Stair-Step" Myth Disproven: The Whittaker-Shannon Sinc Interpolation

One of the most persistent and damaging myths in music production is the belief that digital audio resembles a "jagged staircase" of discrete voltage blocks, and that analog tape is superior because it is "smooth." This myth stems from a fundamental misunderstanding of Digital-to-Analog Converters (DACs).

A DAC does not output square steps. Under Shannon's mathematical proof, when discrete impulses \(x[n]\) pass through an ideal low-pass reconstruction filter (a Nyquist filter), each sample point is converted into a continuous sinc function (\(\text{sinc}(t) = \frac{\sin(\pi t)}{\pi t}\)). The Whittaker-Shannon Interpolation Equation sums these overlapping sinc curves:

$$x(t) = \sum_{n=-\infty}^{\infty} x[n] \cdot \text{sinc}\left(\frac{t - n T_s}{T_s}\right) = \sum_{n=-\infty}^{\infty} x[n] \cdot \frac{\sin\left(\pi \frac{t - n T_s}{T_s}\right)}{\pi \frac{t - n T_s}{T_s}}$$
The Whittaker-Shannon Sinc Interpolation Formula: Proving 100% exact continuous reconstruction

Because the zero-crossings of each sinc function align precisely with all other sampling points, there is only one unique continuous smooth mathematical curve in the universe that can pass through those sample points below the Nyquist limit! Digital audio does not approximate the original waveform; below the Nyquist frequency, it reproduces the original analog waveform with 100% mathematical perfection and zero stair-steps!

2. The Physics of Aliasing: Frequency Foldback Mechanics

What happens if an incoming audio signal contains frequencies that exceed half the sampling rate (\(f_{\text{in}} > f_s / 2\))? When the sampling rate is too slow to capture at least two points per wave cycle, the sampler cannot determine the true frequency of the wave. Instead, the high-frequency oscillation is misread as a completely different, lower-frequency wave—it assumes a false identity, or an alias.

In spectral analysis, sampling acts as a modulation process that repeats the original signal spectrum at integer multiples of the sampling frequency (\(\pm f_s, \pm 2f_s, \pm 3f_s, \dots\)). When a frequency extends beyond \(f_s / 2\), its upper sideband folds backward across the Nyquist boundary into the audible band:

$$f_{\text{alias}} = |k \cdot f_s - f_{\text{in}}| \quad \text{for } k = 1, 2, 3, \dots$$
Frequency foldback equation: higher frequencies reflect backwards across the Nyquist ceiling

Numerical Example at 44.1 kHz (Nyquist = 22.05 kHz)

Consider an un-bandlimited synthesizer oscillator playing into an ADC operating at 44.1 kHz:

Why Aliasing Sounds So Horrible

In musical acoustics, the harmonics of real acoustic instruments (such as pianos, violins, or brass) are integer multiples of the fundamental frequency (\(f_0, 2f_0, 3f_0, 4f_0, \dots\)). Human ears perceive these integer harmonics as pleasing, warm, and natural.

Aliased frequencies, however, are inharmonic mirror frequencies. When you play a higher note on an aliasing synthesizer, the real pitch goes up while the aliased reflections sweep downward! This creates a harsh, dissonant, metallic ringing that cannot be removed with equalization because the aliasing frequencies overlap directly with the musical notes.

3. Aliasing in Modern DAW Plugins (The Non-Linear Trap)

Many producers believe that because their audio interface has anti-aliasing filters on its physical inputs, their digital mix is completely immune to aliasing. This is completely false.

While an ADC prevents aliasing during microphone tracking, aliasing is continually generated inside the computer whenever you use non-linear digital audio plugins:

4. The Solution: DSP Oversampling & Halfband Decimation Filters

To eliminate in-the-box plugin aliasing, professional audio plugins implement internal oversampling (typically 2x, 4x, 8x, or 16x):

Oversampling Rate Internal Sample Rate (at 44.1k Base) Internal Nyquist Ceiling Harmonic Headroom Before Aliasing
1x (No Oversampling) 44.1 kHz 22.05 kHz 0 kHz margin; non-linear harmonics immediately alias.
2x Oversampling 88.2 kHz 44.10 kHz Safely absorbs harmonics up to 44.1 kHz without foldback.
4x Oversampling 176.4 kHz 88.20 kHz Absorbs ultra-high saturation harmonics up to the 17th harmonic!
8x Oversampling 352.8 kHz 176.40 kHz Pristine mastering-grade transparency; eliminates aliasing on aggressive clippers.

The 5-Stage Oversampling Architecture Inside a Plugin

  1. Zero-Stuffing Upsampling: The plugin inserts zero samples between incoming audio samples to multiply the clock rate to 176.4 kHz (4x).
  2. Anti-Imaging Low-Pass Filter: A steep linear-phase digital filter removes the ultrasonic mirror images created by zero-stuffing.
  3. Non-Linear DSP Processing: The plugin applies its saturation, clipping, or compression curve at the elevated 176.4 kHz rate. All newly generated harmonics up to 88.2 kHz are captured cleanly without aliasing!
  4. Anti-Aliasing Low-Pass Decimation Filter: A brickwall halfband filter brutally attenuates all frequencies above 20 kHz down to -100 dB.
  5. Downsampling: The audio is decimated back to the original 44.1 kHz session sample rate—completely free of aliasing artifacts!

5. Master Aliasing Frequency Mapping Table

Input Frequency (\(f_{\text{in}}\)) System Sample Rate (\(f_s\)) Nyquist Boundary (\(f_N\)) Aliased Reflected Frequency (\(f_{\text{alias}}\)) Audibility & Timbral Impact
21.0 kHz 44.1 kHz 22.05 kHz 21.0 kHz (Clean) Below Nyquist; captured perfectly without aliasing.
23.0 kHz 44.1 kHz 22.05 kHz 21.1 kHz Ultrasonic foldover; inaudible to adult human ears.
26.0 kHz 44.1 kHz 22.05 kHz 18.1 kHz Audible high-end harshness; smears cymbal brilliance and air.
32.0 kHz 44.1 kHz 22.05 kHz 12.1 kHz Abrasive sibilant hash; clashes aggressively with vocal presence.
38.0 kHz 44.1 kHz 22.05 kHz 6.1 kHz Severe metallic grit right in the snare and electric guitar core.
43.0 kHz 44.1 kHz 22.05 kHz 1.1 kHz Devastating midrange ringing; sounds like a telephone ring modulator.

6. How to Test Your Plugins for Aliasing in 3 Steps

  1. Open your DAW and load a signal generator plugin producing a 10 kHz pure sine wave at -6 dBFS.
  2. Insert your favorite saturation, distortion, or compressor plugin after the tone generator, followed immediately by our Audio Spectrogram & Lossless Phase Checker or an FFT analyzer.
  3. Drive the saturator aggressively. If the plugin has poor anti-aliasing, you will see unexpected frequency spikes appearing below 10 kHz (e.g. at 4.1 kHz, 8.2 kHz, etc.) in the spectrum! Toggle the plugin's "HQ" or "Oversampling" switch to 4x: the low-frequency aliasing spikes will instantly vanish!
🎛️ Related Studio LOOS Forensic Tools

Inspect ultrasonic cutoff frequencies and detect aliasing with our Audio Spectrogram & Lossless Phase Checker, explore sample rate foundations in our Sample Rate Guide, or test real-time DSP ring modulation using the Voice Changer & Pitch FX Processor.

ADVERTISEMENT • STUDIO SPONSOR
Support Studio LOOS open web acoustic laboratory • High-grade pro audio gear & plugins
← Back to Knowledge Base Index Explore Web Audio Suite →