S8 · Lesson 8 · Pulse-code modulation
Turning analog messages into bits, PCM bit rates and bandwidth, uniform quantization noise, companding with the μ-law, and delta modulation's slope overload
The telephone network went digital in the 1960s with a simple recipe: sample speech 8,000 times a second, round each sample to one of 256 levels, and send the eight-bit codes. Pulse-code modulation turned every voice into 64 kb/s, which could be regenerated perfectly at every repeater instead of accumulating noise. The rounding is the price, and speech makes it awkward: quiet talkers would drown in the quantization noise of a uniform quantizer sized for loud ones. Companding fixes that by spacing the levels logarithmically, giving nearly the same SNR across a 40 dB range of loudness.
- Quantization SNR against the input level (a sine, in dB relative to full scale) for a uniform n-bit quantizer (dashed) and a μ-law companded one (solid).
- The uniform quantizer loses a dB of SNR for every dB the signal drops: at −40 dB an 8-bit quantizer gives only 9.9 dB.
- The μ-law quantizer (μ = 255) gives 38 dB at full scale and still 34.5 dB at −40 dB, trading a little peak SNR for a flat response across levels.
Predict
A telephone channel uses 8-bit PCM at 8 kHz. What bit rate does that need, and what's the least bandwidth that can carry it as binary pulses?
8 bits × 8000 samples/s = 64 kb/s. Binary pulses need at least of bandwidth (the Nyquist minimum, lesson 9), so 32 kHz, eight times the 4 kHz the analog voice occupied. Digital transmission pays in bandwidth for its immunity to noise accumulation.
Name it
PCM
Sample at , quantize each sample to levels, send n bits per sample:
Uniform quantization
Step Δ over a range ±, error uniform with variance . For a sine of amplitude A:
Each added bit buys 6 dB; each dB of lower signal level costs a dB.
Companding
A μ-law compressor before a uniform quantizer (and the inverse expander after) spaces the levels roughly logarithmically. For large μ and a signal of rms σ,
nearly independent of σ over a wide range. North American telephony uses μ = 255; Europe uses the similar A-law.
Delta modulation
Sending one bit per sample, up or down by a step δ, at a high rate . The staircase can rise at most per second; a sine overloads when . Too small a δ causes slope overload; too large a δ causes granular noise. Adaptive step sizes (CVSD) balance the two.
Worked example
Compare 8-bit uniform and μ-law (μ = 255) quantization for a full-scale sine and one 40 dB lower.
Show the solution
- Uniform. 49.9 dB at full scale and 9.9 dB at −40 dB:
- μ-law constant term.
- μ-law at full scale. The bracket is 1.0096:
- μ-law at −40 dB. Now = 0.555 and the bracket is 2.27:
- The trade. Companding gives up 12 dB at the top to gain 25 dB at the bottom.
Answer uniform quantization gives 49.9 dB at full scale and 9.9 dB at −40 dB; μ-law gives 38.0 dB and 34.5 dB.
Worked example
A delta modulator runs at 64 kHz with a step of 0.1 V. What's the largest 1 kHz sine it can follow without slope overload?
Show the solution
- Staircase slope. The staircase can climb
- Sine slope. A 1 kHz sine of amplitude A has a maximum slope of
- Largest amplitude. Keep the sine's slope within the staircase's: Higher frequencies or amplitudes overload, and the staircase falls behind the signal.
Answer a 1 kHz sine of up to 1.02 V amplitude.
Worked example
Compact disc audio is 16-bit stereo PCM at 44.1 kHz. What bit rate does it need, and what SNR does a full-scale sine get, and one at −20 dBFS?
Show the solution
- Bit rate. of audio data, before error correction.
- Full-scale sine.
- At −20 dBFS.
- Quiet passages. They lose a decibel of SNR for every decibel of level, which is why mastering engineers keep levels high and why μ-law telephony uses companding instead.
Answer 1.4112 Mb/s, with an SNR of 98.1 dB at full scale and 78.1 dB at −20 dBFS.
Check
A PCM system samples at 8 kHz with 12 bits per sample. What bit rate does it need?
Write units the way you normally would: 1.5 kb/s, 1500 b/s and 0.0015 Mb/s are the same answer.
Check
A uniform 8-bit quantizer receives a sine at −6 dB relative to full scale. What's its SNR?
Check
What's the level-independent SNR term of a μ-law quantizer with n = 8 bits and μ = 87.6?
Check
What's the least bandwidth that can carry 12-bit PCM at 8 kHz as binary pulses?
Write units the way you normally would: 1.5 kHz, 1500 Hz and 0.0015 MHz are the same answer.
Check
How many bits must a uniform quantizer have to give at least 60 dB SNR for a full-scale sine?
Check
A delta modulator has step 0.02 V at 32 kHz. What's the largest 4 kHz sine it can track without slope overload?
Write units the way you normally would: 1.5 V, 1500 mV and 0.0015 kV are the same answer.
Check
PCM audio uses 16 bits at 8 kHz on 6 channel(s).
(a)
What bit rate does it need?
Write units the way you normally would: 1.5 Mb/s, 1500 kb/s and 0.0015 Gb/s are the same answer.
(b)
What is the least bandwidth that can carry it as binary pulses?
Check
A uniform n-bit quantizer receives a sine at A dB relative to full scale; separately, a delta modulator has step d at rate s.
Step 1
What SNR does the PCM quantizer give?
Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.
Step 2
What is the delta modulator's fastest slope?
Step 3
What is the largest sine at frequency f it can follow?
Explain why
Why does companding keep the quantization SNR nearly constant across signal levels?
A uniform quantizer has the same step size everywhere, so its noise power is fixed, and a quiet signal sees a much worse ratio than a loud one. A compressor with a logarithmic curve spreads small amplitudes across many quantizer levels and squeezes large ones into few, so after expansion the effective step size is roughly proportional to the signal's own amplitude. The error is then roughly a fixed fraction of the signal rather than a fixed absolute size, which makes the signal-to-noise ratio nearly independent of level. The cost is a somewhat lower SNR for full-scale signals, an acceptable trade for speech, whose level varies over 40 dB between talkers and syllables.
Practice
Keep practicing
10 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.