Quantization as amplitude discretization
After , which discretizes a signal in time, we are left with a series of samples. The amplitude of each sample can still take on any value from a continuous range. Quantization is the process of discretizing these amplitudes.
Quantization maps a large, often infinite, set of input values to a finite set of output values. It rounds or approximates each sample to the nearest member of a predefined set of quantization levels. The resulting code can represent only the selected levels with a finite number of bits.
The Mechanism of Quantization
Quantization has two operations: divide the amplitude range into intervals, then assign each sample to a level.
- Dividing the Range: The selected input range is divided into a finite number of quantization intervals. Each interval has a width called the quantization step size ().
- Rounding and Assignment: The amplitude of each sample is mapped to the nearest available level. For example, a 2.7 V sample maps to 2.5 V when the neighboring levels are 2.5 V and 3.0 V. A value exactly halfway between levels, such as 2.75 V in this example, is resolved by the specified tie-breaking rule. Samples in one interval receive the same quantization level.
Quantization error and quantization noise
Quantization replaces a sample with an approximation, so the quantization error is the difference between the input sample and its quantized value. Under the usual uniform-quantizer model, this error is treated as quantization noise.
- Magnitude of Error: For a uniform quantizer, the error from round-to-nearest is bounded by half the quantization step size (). If the error is modeled as uniformly distributed and uncorrelated with the signal, its RMS value is .
- Impact on Signal Quality: The error appears as an additional signal component. More levels reduce the step size and the ideal quantization contribution, which improves the ideal .
Resolution: Bits per Sample
After quantization, each discrete level is represented by a binary code. The number of bits per sample determines the conversion resolution and the number of available codes.
Here is the number of quantization levels and is the number of bits per sample. For an ideal converter with input range from to , one LSB is the step size:
This uses the usual convention in which the full-scale span is divided into code intervals. Other endpoint conventions can shift code centers and change how the endpoints are treated.
Bit Depth in Practice
- 12-bit PCM example: A 12-bit uniform PCM representation provides quantization levels. At 8000 samples/s, an uncompressed stream would have a data rate of 96 kbit/s (8000 samples/s × 12 bits/sample).
- G.711 telephony PCM: ITU-T G.711 encodes each sample into an 8-bit companded codeword using A-law or μ-law. This provides codewords and a bit rate of 64 kbit/s (8000 samples/s × 8 bits/sample) for one voice channel.
- High-resolution audio: CD audio uses 16 bits per sample, giving possible codes. Professional recording also uses 24-bit samples to increase the available dynamic range and reduce the relative quantization noise.
Bit-depth trade-off
More bits per sample reduce the ideal quantization step and noise, but increase the data rate, transmission bandwidth, and storage required for the same sampling frequency.