Audio Dithering
Dither adds a small controlled noise signal before quantization to avoid signal-dependent rounding distortion.
A quiet fade can become rough when rounded to an integer grid. Its amplitude may move smoothly through small values, but the output jumps repeatedly between a few available levels. The pattern of those jumps can follow the waveform, producing distortion rather than an innocuous background noise.
Dither deliberately randomizes the rounding decision. The added noise is small and controlled; its purpose is to stop quantization error from tracing the signal's structure.
Start with a value the grid cannot hold
Use a deliberately coarse grid with steps of one unit. Ordinary rounding sends +0.2 to 0 every time. A waveform whose samples stay between −0.5 and +0.5 can collapse entirely to zeros on that grid.
Now add a random value before rounding. Occasionally, +0.2 plus the noise crosses a threshold and becomes another output level. The individual output remains an integer; over repeated trials its behavior can preserve information about where +0.2 lay between the levels.
One common non-subtractive choice is triangular-probability-density dither (TPDF). It can be formed from the sum of two independent uniform random values, each between −0.5 and +0.5 quantizer steps. Their sum spans −1 to +1 step, with values near zero more likely than values near the extremes.
For the +0.2 input on our unit-step grid, ideal TPDF and round-to-nearest give:
| Quantized output | Probability |
|---|---|
| −1 | 4.5% |
| 0 | 71.0% |
| +1 | 24.5% |
The expected output is (−1 × 0.045) + (0 × 0.71) + (1 × 0.245) = +0.2. This follows from the triangular distribution's areas beyond the rounding thresholds.
The table is a statistical demonstration, not an instruction to average adjacent audio samples or use such coarse precision for playback. Audio samples vary with time. Proper dither controls the quantizer's error statistics at those successive values, allowing very quiet signal behavior to remain encoded among the noise.
The trade is distortion for a controlled noise floor
Dither does not make every rounded sample accurate. The added noise and quantization still produce error. What improves is the relationship between that error and the signal: quiet tones and fades stop controlling a repeating rounding pattern.
The distribution, level, and quantizer behavior matter. Arbitrary hiss added at an unrelated level is not equivalent to a designed dither process. The usual TPDF choice removes input-dependent behavior in the first two error moments for an ideal non-overloading uniform quantizer. Other choices make other tradeoffs.
At normal 16-bit or 24-bit steps, the demonstration's one-unit excursions become correspondingly small. That is why the mechanism can improve low-level behavior without intentionally adding a loud sound.
Put it at the precision reduction
Suppose a processor has mixed audio and adjusted gain using float. Its output can contain fractional values between 16-bit integer levels even if the input originally came from a 16-bit recording. Reducing this processed result to a 16-bit output creates a new quantization step; that is a useful place to consider dither.
Copying unchanged integer samples to another file does not perform such a rounding operation. Adding dither to that copy would alter samples unnecessarily. Likewise, widening integer storage while retaining all original values does not need dither.
Repeated processing and integer reduction can repeatedly add noise or distortion. A sensible pipeline preserves working precision during the operations, then chooses the necessary final conversion. The actual Emby player, server conversion, or operating-system output decides where those stages occur; a resampler's list of available dither methods does not tell us which was selected for a session.
Noise shaping changes where error lies
Noise shaping uses feedback around quantization to redistribute error energy across frequency. It can reduce error in one band while raising it elsewhere. It is a separate design choice from creating suitable dither statistics, and it does not remove all error.
This helps interpret a comparison between output methods: listen for both quiet-signal distortion and noise character. A smooth fade, a lower in-band noise level, and unchanged individual samples are different outcomes. Dither is aimed at the first; lossless copying at the last.