Sampling, Nyquist and aliasing

How sample rate, the Nyquist frequency, aliasing and bit depth work, with a worked aliasing example and why plugins use oversampling.

Field guide / DSP

intermediate · 3 min read · Updated

Digital audio captures a continuous sound wave as a series of numbers. How often those numbers are taken, and how precisely each one is stored, define what the digital signal can represent.

Sample rate and the Nyquist frequency

The sample rate (fs) is the number of measurements taken each second, in hertz. At 44,100 Hz, the signal is measured 44,100 times per second.

The highest frequency that can be represented without error is half the sample rate, called the Nyquist frequency:

Nyquist = fs divided by 2

At 44.1 kHz the Nyquist frequency is 22.05 kHz. At 48 kHz it is 24 kHz.

Aliasing

If a frequency above Nyquist is sampled, it does not disappear. It folds back and appears as a lower frequency that was never in the original sound. This is aliasing. The alias frequency is:

f_alias = absolute value of (f minus k times fs)

where k is the whole number that puts the result in the range 0 to fs/2.

Worked example: a 30 kHz tone sampled at 44.1 kHz. With k = 1: |30,000 minus 44,100| = 14,100 Hz. The tone aliases to 14.1 kHz, which is well inside the audible range and sounds like an unrelated, inharmonic tone.

Alias components are not related musically to the source, so they sound harsh and cannot be removed after sampling.

Anti-aliasing filters

To avoid aliasing, an analog anti-aliasing filter (a steep low-pass filter) removes frequencies above Nyquist before the converter samples. Modern converters oversample internally, which allows a gentler analog filter, then digitally filter and reduce the rate to the target. The EQ basics article explains how a low-pass filter’s cutoff and slope work.

Why 44.1 and 48 kHz

Human hearing extends up to roughly 20 kHz at best, so a Nyquist frequency a little above that is sufficient to capture the audible range, leaving a small band for the filter to roll off. 44.1 kHz became the standard for audio CDs. 48 kHz is the common standard for video and many professional workflows. Higher rates such as 88.2 and 96 kHz are used too, mostly for easier filtering and processing headroom rather than because audible content needs them.

Bit depth and dynamic range

Bit depth sets how many amplitude values each sample can take. Each extra bit adds about 6.02 dB of theoretical dynamic range:

Bit depth Theoretical dynamic range (approximate)
16-bit about 96 dB
24-bit about 144 dB

These are theoretical limits. Real converters and analog electronics have a higher noise floor, so practical performance is lower. Bit depth determines the noise floor of the quantized signal, not the highest frequency; sample rate and bit depth are independent.

Oversampling in plugins

Nonlinear processing such as saturation, distortion and clipping creates new harmonics. If a harmonic lands above Nyquist, it aliases back down into the audible range as an inharmonic artifact. For example, at 44.1 kHz, a 10 kHz tone that is saturated gains harmonics at 20, 30 and 40 kHz, and the ones above 22.05 kHz fold back.

Many plugins therefore use oversampling. The plugin internally raises the sample rate (for example, two, four or more times), applies the nonlinear processing, filters out content above the original Nyquist frequency, and then returns to the session rate. The extra harmonics have room to exist and are removed before they can fold back. The cost is more CPU use and some added latency, so many plugins let you choose the oversampling amount.

Key points

  • Nyquist is half the sample rate.
  • Frequencies above it alias and cannot be removed afterwards.
  • Bit depth affects noise floor, about 6.02 dB per bit in theory.
  • Nonlinear plugins can generate aliasing, which oversampling reduces.