S88 of 56
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

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?

Name it

PCM

Sample at fs≥2W, quantize each sample to L=2n levels, send n bits per sample:

Rb=nfs,BT≥Rb2 (binary, ideal Nyquist pulses)

Uniform quantization

Step Δ over a range ±Xmax, error uniform with variance Δ2/12. For a sine of amplitude A:

SNR=6.02n+1.76+20log⁡AXmax dB

Each added bit buys 6 dB; each dB of lower signal level costs a dB.

Companding

A μ-law compressor y=sgn(x)ln⁡(1+μ|x|/Xmax)ln⁡(1+μ) before a uniform quantizer (and the inverse expander after) spaces the levels roughly logarithmically. For large μ and a signal of rms σ,

SNR≈6.02n+4.77−20log⁡ln⁡(1+μ)−10log⁡[1+(Xmaxμσ)2+3Xmaxμσ]

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 fs. The staircase can rise at most δfs per second; a sine Asin⁡2πft overloads when 2πfA>δfs. 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
  1. Uniform. 49.9 dB at full scale and 9.9 dB at −40 dB: SNR=6.02×8+1.76=49.9dB
  2. μ-law constant term. C=48.2+4.8−14.9=38.1dB
  3. μ-law at full scale. The bracket is 1.0096: SNR=38.1−10log⁡1.0096=38.0dB
  4. μ-law at −40 dB. Now Xmax/(μσ) = 0.555 and the bracket is 2.27: SNR=38.1−10log⁡2.27=34.5dB
  5. 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
  1. Staircase slope. The staircase can climb 0.1×64000=6400V/s
  2. Sine slope. A 1 kHz sine of amplitude A has a maximum slope of 2π×1000×A
  3. Largest amplitude. Keep the sine's slope within the staircase's: A≤64006283V=1.02V 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
  1. Bit rate. R=16×44100×2=1.4112Mb/s of audio data, before error correction.
  2. Full-scale sine. SNR=6.02×16+1.76=98.1dB
  3. At −20 dBFS. 98.1−20=78.1dB
  4. 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°.

Explain why

Why does companding keep the quantization SNR nearly constant across signal levels?

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.