Pulse Code Modulation: Quantization Noise, SQNR and Bit Rate

Pulse code modulation (PCM) is the standard way to turn an analog signal into bits. Digital telephone exchanges, audio CDs, WAV files and every microcontroller ADC reading are all PCM in some form. The process has three steps: sample the signal, round each sample to one of a finite set of levels, and represent that level as a binary code word.

The rounding step introduces an error called quantization noise. This tutorial shows how to calculate it, how it sets the signal-to-quantization-noise ratio (SQNR), and how the number of bits drives the bit rate and bandwidth.

The Three Steps of PCM

Analog in -> [Low-pass filter] -> [Sampler] -> [Quantizer] -> [Encoder] -> bits out
                anti-alias        fs > 2 fmax    L levels      n bits/sample
  1. Sampling: take values at rate fs, above twice the highest signal frequency (see the sampling theorem article).
  2. Quantization: round each sample to the nearest of L = 2^n allowed levels.
  3. Encoding: write the level number as an n-bit binary word, often in offset binary or two's complement.

Step Size and Quantization Error

For a uniform quantizer covering a full-scale range Vfs (peak-to-peak) with n bits:

Number of levels:  L = 2^n
Step size:         delta = Vfs / 2^n      (often written Vfs / L)
Maximum error:     +/- delta / 2

Quantization noise power (error uniformly spread over one step):
Nq = delta^2 / 12
RMS quantization noise = delta / sqrt(12)

Worked Example: 12-bit ADC on a 3.3 V Microcontroller

Vfs   = 3.3 V, n = 12  ->  L = 4096
delta = 3.3 / 4096 = 0.806 mV
Max error = +/- 0.403 mV
RMS noise = 0.806 mV / 3.464 = 0.233 mV

This is the ideal figure. A real ADC also has thermal noise, reference noise and non-linearity, so its effective number of bits (ENOB) is lower than 12. The datasheet usually quotes ENOB or SINAD for that reason.

Signal-to-Quantization-Noise Ratio

For a full-scale sine wave of peak amplitude A = Vfs/2, the signal power is A^2/2. Dividing by delta^2/12 and simplifying gives the most quoted rule in data conversion:

SQNR = (3/2) x 2^(2n)
SQNR(dB) = 6.02 n + 1.76      (full-scale sine input)

Each extra bit adds about 6 dB.
Bits nLevelsIdeal SQNR (sine)Typical use
825649.9 dBTelephone PCM (with companding), simple sensors
10102462.0 dBArduino Uno ADC
12409674.0 dBSTM32 and ESP32 ADCs
166553698.1 dBAudio CD
2416.7 million146.2 dBStudio converters (actual performance is noise-limited)

The formula assumes the signal uses the whole range. If the input only swings over one tenth of full scale, you lose 20 dB of SQNR. That is why matching the signal level to the ADC range, using gain or a suitable reference, matters as much as the number of bits.

Worked Example: How Many Bits Do I Need?

A designer needs at least 40 dB SQNR for a full-scale sine.

6.02 n + 1.76 >= 40
n >= (40 - 1.76) / 6.02 = 6.35
Choose n = 7 bits (SQNR = 43.9 dB)

Bit Rate and Transmission Bandwidth

Bit rate:  Rb = n x fs           (bits per second)

Minimum baseband bandwidth (Nyquist, ideal pulses):
B_min = Rb / 2
With raised-cosine pulses of roll-off alpha:
B = (Rb / 2) x (1 + alpha)

Worked Example 1: Telephone Channel

fs = 8 kHz, n = 8 bits
Rb = 8 x 8000 = 64,000 bit/s = 64 kbit/s
B_min = 32 kHz

Compare with the 3.1 kHz analog channel: PCM needs about 10x
the bandwidth, but it can be regenerated at every repeater.

Worked Example 2: CD Audio

fs = 44.1 kHz, n = 16 bits, 2 channels
Rb = 44100 x 16 x 2 = 1,411,200 bit/s = 1.41 Mbit/s
One minute = 1.4112e6 x 60 / 8 = 10.6 MB

Here you see the core PCM trade-off: every extra bit improves SQNR by 6 dB but raises the bit rate, and therefore the bandwidth, by a factor of (n+1)/n.

Non-Uniform Quantization and Companding

Speech has many quiet passages and few loud peaks. With uniform steps, quiet sounds get poor SQNR. Companding compresses the signal before a uniform quantizer, giving small signals finer steps, then expands it at the receiver. Telephone networks use two standards defined in ITU-T G.711: A-law (A = 87.6) in Europe and India, and mu-law (mu = 255) in North America and Japan. With only 8 bits, companded PCM gives roughly the same perceived quality for speech as about 12 to 13 bits of uniform PCM, and keeps SQNR nearly constant over a wide range of input levels.

Common Mistakes

  • Using peak instead of peak-to-peak range when computing step size.
  • Applying 6.02n + 1.76 to signals that do not reach full scale, or to non-sine signals without adjusting.
  • Confusing bit rate with baud rate. In binary PCM they are equal; with multi-level line codes they are not.
  • Assuming more bits always help. Below the analog noise floor of the front end, extra bits only digitise noise.

Summary

PCM samples, quantizes to 2^n levels and encodes each level in n bits. Step size is Vfs/2^n, quantization noise power is delta^2/12, and the ideal SQNR for a full-scale sine is 6.02n + 1.76 dB. The bit rate is n times fs, so a telephone channel needs 64 kbit/s and stereo CD audio 1.41 Mbit/s. Companding improves quiet-signal quality without adding bits. Next we look at how those bits are put onto a carrier using digital modulation.