No history yet

Introduction to Dithering

The Art of Adding Noise

When we convert an analog signal, like a sound wave or a continuous color gradient, into a digital format, we perform a process called quantization. Think of it as rounding. We take an infinitely smooth signal and force it into a finite number of discrete steps. This process isn't perfect and introduces a small amount of error, known as quantization error.

Imagine you have to represent every color in a photograph using only 16 specific shades. You'd have to round each of the millions of original colors to the nearest one in your limited palette. This rounding creates predictable, often ugly patterns. In images, this might look like banding, where smooth gradients become distinct stripes of color. In audio, it can create a harsh, metallic distortion, especially during quiet passages.

Quantization error is the predictable pattern of mistakes introduced when a smooth signal is forced into discrete digital steps.

So, how do we fix an error caused by simplification? It sounds strange, but the solution is to add a little bit of chaos. This is called dithering.

dithering

noun

The process of intentionally adding a low level of random noise to a signal before quantization.

Dithering works by randomizing the quantization error. Instead of the rounding errors creating a repeating, correlated pattern, the added noise makes the errors random and uncorrelated with the original signal. Our brains are very good at picking out patterns, which is why quantization error is so distracting. But we are much better at ignoring random, low-level noise.

The result is that the harsh distortion or visible banding is replaced by a soft, barely perceptible hiss or fine grain. The noise floor rises slightly, but the trade-off is a much more natural-sounding or looking result. The added noise effectively helps the quantized signal better represent the original analog signal over time.

An Accidental Discovery

The concept of dithering has roots in early aviation and computing. During World War II, engineers working on mechanical computers for bombers noticed that the computers were more accurate when the plane was in flight than when it was on the ground. The vibrations from the plane's engines were just enough to overcome the static friction in the computer's moving parts, allowing them to move more freely and settle on more accurate results.

This principle was later applied to digital signal processing. Early digital audio engineers in the 1980s faced challenges with the limited bit-depth of their equipment. The 16-bit standard for CDs was a huge leap, but converting professional recordings made at higher resolutions down to 16 bits introduced audible quantization artifacts. By adding a small, carefully controlled amount of noise before the conversion, they could smooth over these errors, preserving the perceived quality of the recording.

The key is that the added noise is not just any random static. It's specifically designed for the task. The most common type of dither noise has a uniform probability distribution, meaning every possible value within a small range is equally likely to occur. The amplitude of this noise is typically very small, on the scale of the smallest possible step in the digital signal (the least significant bit).

By adding this specific type of noise, the system is no longer forced to round to the nearest available step in a predictable way. Instead, it's nudged randomly, sometimes rounding up when it would have rounded down, and vice versa. This breaks up the repetitive patterns of error and diffuses them into a much more palatable form of noise.