Skip to content

Analog to digital

Quantization

Storing a sample in a fixed number of bits rounds it, and the rounding error is quantization noise. This topic shows why each added bit gives about 6 dB of signal-to-noise ratio, how dither stops the error following the signal, and how oversampling with noise shaping moves the error to frequencies a filter can remove.

Lessons on this topic

Two stacked panels against time in seconds, 0 to 8. Top: a ramp from −1 to 1, the input x, and its 3-bit staircase, the output x_q, over 8 faint level lines. Bottom: the error e = x_q − x, a sawtooth between dashed lines at ±Δ/2 = ±0.125. The whole ramp is drawn. Input 1.000, output 0.875, mean square of error ÷ Δ² 0.083.Two stacked panels against time in seconds, 0 to 8. Top: a ramp from −1 to 1, the input x, and its 3-bit staircase, the output x_q, over 8 faint level lines. Bottom: the error e = x_q − x, a sawtooth between dashed lines at ±Δ/2 = ±0.125. The whole ramp is drawn. Input 1.000, output 0.875, mean square of error ÷ Δ² 0.083.

Intermediate · 15 minYou are hereRead

Quantization and noise

Round a signal to B bits, watch the error stay within half a step, and see why each bit adds about 6 dB of SNR.

A gradient from dark to light, 256 pixels wide: stored with 8 shades after adding a little noise: fine grain and no bands. Below, the brightness of the top row against position, 0 to 255 pixels. Shades available: 8.A gradient from dark to light, 256 pixels wide: stored with 8 shades after adding a little noise: fine grain and no bands. Below, the brightness of the top row against position, 0 to 255 pixels. Shades available: 8.

Intermediate · 15 minYou are hereRead

Dither

Add a little noise before rounding and see why the error stops following the signal, why triangular noise keeps the hiss steady, and what it costs.

Oversampling ratio 16: 16 slices each hold 1/16 of the error's power. The first slice is the band we keep; the rest are removed by the digital low-pass. Noise in the band −12.04 dB, total noise 0.00 dB.Oversampling ratio 16: 16 slices each hold 1/16 of the error's power. The first slice is the band we keep; the rest are removed by the digital low-pass. Noise in the band −12.04 dB, total noise 0.00 dB.

Advanced · 22 minYou are hereRead

Oversampling and noise shaping

See why sampling faster gains 3.01 dB per doubling, and how feeding the error back pushes it up in frequency, where a filter removes it.

Phasorium

Account

Sign inWith Google, GitHub or your email

Subjects

Site

Look