Dithering Demo — Noise Shaping

Hear dithering and noise shaping tame quantization distortion when reducing bit depth, with spectrum views. Interactive demo. Free in your browser, no download.

Protect your hearing. Start at a low volume. Never raise the volume to make a tone audible. Levels are shown in dBFS, relative to full scale — not SPL.

How it works

Quantization, TPDF dither, and psychoacoustic noise-shaping algorithms run 100% locally in browser memory. Nothing is ever uploaded or transmitted.

When digital audio is converted from high-resolution studio formats (such as 32-bit floating point or 24-bit fixed point) to lower bit depths (such as 16-bit CD quality or 8-bit embedded devices), continuous analog waveforms must be mapped to a discrete integer grid.

Without proper mathematical treatment, this process introduces severe, audible quantization distortion.

Truncation vs. Rounding vs. TPDF Dither

Each bit of resolution provides roughly $6.02\text{ dB}$ of dynamic range:

  • 16-bit: $\approx 96\text{ dB}$ dynamic range
  • 8-bit: $\approx 48\text{ dB}$ dynamic range
  • 6-bit: $\approx 36\text{ dB}$ dynamic range
  • 4-bit: $\approx 24\text{ dB}$ dynamic range

When a quiet signal passes through non-dithered quantization (rounding or truncation), the error is mathematically correlated with the input waveform:

$$e[n] = x[n] - \operatorname{round}\left(\frac{x[n]}{Q}\right) \cdot Q$$

Because $e[n]$ repeats periodically with the signal, it manifests as harsh harmonic overtones and granulation noise.

The Power of TPDF Dither

By adding a tiny amount of noise with a Triangular Probability Density Function (TPDF)—created by summing two independent uniform random variables with amplitude spanning $\pm 1\text{ LSB}$—the expected value of the quantization error becomes completely independent of the signal:

$$E{e[n] \mid x[n]} = 0$$

Signal-correlated distortion is converted into an un-correlated, constant white noise floor.

Psychoacoustic Noise Shaping

Human hearing is not equally sensitive at all frequencies. The Fletcher-Munson equal-loudness contours show human ears are most sensitive between $1\text{ kHz}$ and $5\text{ kHz}$, and substantially less sensitive near $16\text{ kHz}$ to $20\text{ kHz}$.

Noise shaping uses an error-feedback filter loop:

$$x’[n] = x[n] + \sum_{k=1}^{M} \alpha_k \cdot e[n-k]$$

This shapes the noise power spectral density, suppressing noise power across mid-frequencies and pushing it into the high-frequency ceiling where it is imperceptible to the human auditory system.

Frequently asked questions

What is audio dithering?

Dithering is the intentional addition of low-level randomized noise (specifically Triangular Probability Density Function noise, or TPDF) to an audio signal prior to reducing its bit depth (such as converting 24-bit studio masters to 16-bit distribution). It completely eliminates correlate quantization distortion.

Why is non-dithered bit reduction bad?

When reducing bit depth without dither, audio below the least significant bit (LSB) is truncated or rounded to static steps. This creates harsh, signal-correlated harmonic and intermodulation distortion. At low signal levels, smooth sine waves collapse into buzzy square waves or drop out into unnatural silence.

Does dither eliminate distortion or just hide it?

Mathematically, TPDF dither completely eradicates harmonic distortion. It converts deterministic non-linear error into benign, uncorrelated stationary white noise. Remarkable psychoacoustic proof: signals quieter than the quantization step size can still be heard cleanly beneath the noise floor!

How does noise shaping improve audio?

Noise shaping feeds quantization errors through an error-feedback filter that alters the frequency distribution of the dither noise. It shifts noise energy out of human ears' most sensitive hearing region (1 kHz to 4 kHz) into ultrasonic or high frequencies (>15 kHz), providing an apparent 10 dB to 15 dB boost in perceived dynamic range.