- See How audio is represented on computers for context, but it’s a useful quantization scheme when we have few bits to allocate to each sample.
Uniform quantization is wasteful perceptually:
- Human hearing is roughly logarithmic in amplitude.
- We care more about resolution at low amplitudes than at high amplitudes.
Idea of μ-law / A-law:
Apply a nonlinear compressor before quantization, so that:
- Quiet values are spread out → more quantization levels → less noise.
- Loud values are squashed → fewer levels → more noise, but less audible.
For μ-law (used in North American telephony; :
For , the compressor is:
Then you quantize F(x) uniformly to 8 bits (256 levels).
So the effective mapping is:
On decode, you do the inverse:

So μ-law doesn’t change the fact that audio is a sequence of discrete-time samples; it just uses a smarter nonlinear mapping from amplitude → code.