Quantization is the step in analog-to-digital conversion that maps a continuous-valued signal to one with discrete values. After sampling has produced a sequence of real numbers , quantization rounds each sample to the nearest level in a finite set.
A typical 8-bit quantizer chooses 256 evenly-spaced allowed levels between the signal’s minimum and maximum, and replaces each with the index (0 to 255) of the nearest level. With 256 levels you need bits per sample, hence “8-bit audio.”
Quantization is irreversible. The value between two levels is lost — replaced by the level. This introduces quantization error, the difference between the true sample and the level it got rounded to. For a uniform quantizer with step size , the error is bounded by and is usually modeled as additive uniform noise.
In the analog-to-digital pipeline
Three operations get us from a continuous-time continuous-value signal to a bit stream:
- Sampling — pick values at . See Sampling.
- Quantization — round each sample to one of finitely many levels.
- Encoding — represent each level as a string of bits.
The three steps happen in that order. After step 1 we have a discrete-time, continuous-value signal; after step 2 it is discrete-time, discrete-value; after step 3 it is a sequence of bits, ready to ship through a digital channel.
Why we accept the loss
Unlike aliasing (which corrupts information by overlapping spectra), quantization error is bounded and predictable. Doubling the number of bits per sample halves the step size and quarters the noise power. For a 16-bit audio sample, the quantization noise is roughly 96 dB below the signal — inaudible to the human ear. For a 24-bit sample, even more so.
So quantization noise is something we choose — we trade bits-per-sample for noise floor — whereas aliasing is something we have to prevent. Anti-alias filtering happens before sampling; quantization noise is locked in at sample time.
For non-uniform signals, non-uniform quantizers (e.g. μ-law, A-law in telephony) put more levels where the signal spends more time, reducing perceived noise without increasing bit rate.