SS Notes
Complete PCM encoding process — sampling, quantization, encoding, and the standard digital audio representation used in CDs and telephony.
Introduction
Pulse Code Modulation is the standard method for digitally representing analog signals. Every CD you have ever listened to, every phone call transmitted over a digital network, and every WAV file on your computer uses PCM encoding. It is the most straightforward form of analog-to-digital conversion: sample the analog signal at regular intervals, quantize each sample to the nearest discrete level, and represent that level as a binary number. The resulting stream of binary codes is the PCM signal.
PCM was invented by Alec Reeves in 1937 and became the foundation of digital telecommunications when AT&T deployed the T1 carrier system in 1962. Today, PCM underlies virtually all digital audio and serves as the reference against which more sophisticated coding methods (MP3, AAC, FLAC) are compared.
The Three Steps of PCM
PCM encoding involves three sequential operations applied to the analog input signal:
Step 1: Sampling
The continuous-time analog signal $x(t)$ is sampled at a uniform rate $f_s$, producing a discrete-time sequence:
$$x[n] = x(nT_s), \quad n = 0, 1, 2, \ldots$$
The sampling rate must satisfy the Nyquist criterion: $f_s > 2f_{max}$. An anti-aliasing low-pass filter is applied before sampling to ensure no frequency components above $f_s/2$ exist in the input.
Step 2: Quantization
Each sample value (which can take any real value within the signal's dynamic range) is mapped to the nearest level from a finite set of $L$ discrete levels:
$$x_q[n] = Q(x[n])$$
For uniform quantization with $L$ levels spanning the range $[-V_{max}, V_{max}]$: $$\Delta = \frac{2V_{max}}{L}$$
where $\Delta$ is the quantization step size. The quantization error (difference between the actual and quantized value) satisfies $|e[n]| \leq \Delta/2$.
Step 3: Binary Encoding
Each quantized level is assigned a unique binary code word of $B$ bits:
$$B = \lceil\log_2 L\rceil$$
For $B$ bits, we can represent $L = 2^B$ distinct levels. Common choices:
- 8 bits: 256 levels (telephone quality)
- 16 bits: 65,536 levels (CD quality)
- 24 bits: 16,777,216 levels (professional audio)
PCM Bit Rate
The bit rate of a PCM system is:
$$R = f_s \times B \text{ bits/second}$$
Standard PCM Parameters
| Application | $f_s$ | Bits | Channels | Bit Rate |
|---|---|---|---|---|
| Telephone (G.711) | 8 kHz | 8 | 1 | 64 kbps |
| CD Audio | 44.1 kHz | 16 | 2 | 1,411 kbps |
| DVD Audio | 96 kHz | 24 | 2 | 4,608 kbps |
| Professional Studio | 192 kHz | 24 | 2 | 9,216 kbps |
The CD audio bit rate of 1.411 Mbps for two channels represents 10.1 MB per minute of uncompressed stereo audio.
Signal-to-Quantization-Noise Ratio (SQNR)
For uniform PCM with $B$ bits and a full-scale sinusoidal input:
$$\text{SQNR}_{dB} = 6.02B + 1.76 \text{ dB}$$
This fundamental formula shows that each additional bit improves the SQNR by approximately 6 dB (equivalently, doubles the precision). For common bit depths:
- 8 bits: SQNR ≈ 49.9 dB
- 16 bits: SQNR ≈ 98.1 dB
- 24 bits: SQNR ≈ 146.2 dB
Derivation
The quantization error is modeled as uniform random noise with power: $$P_{noise} = \frac{\Delta^2}{12}$$
For a full-scale sinusoid with peak $V_{max}$, the signal power is: $$P_{signal} = \frac{V_{max}^2}{2}$$
With $\Delta = 2V_{max}/2^B$: $$\text{SQNR} = \frac{P_{signal}}{P_{noise}} = \frac{V_{max}^2/2}{(2V_{max}/2^B)^2/12} = \frac{3}{2} \cdot 2^{2B}$$
Converting to decibels: $10\log_{10}(3/2 \cdot 2^{2B}) = 10\log_{10}(3/2) + 20B\log_{10}(2) = 1.76 + 6.02B$ dB.
Non-Uniform Quantization: Companding
For signals with large dynamic range (like speech, which varies from whispers to shouts), uniform quantization wastes bits. Companding (compressing-expanding) uses non-uniform step sizes — smaller steps for quiet sounds and larger steps for loud sounds.
mu-Law Companding (North America, Japan)
$$y = \frac{\ln(1 + \mu|x|)}{\ln(1 + \mu)} \cdot \text{sgn}(x), \quad \mu = 255$$
A-Law Companding (Europe)
$$y = \begin{cases} \frac{A|x|}{1+\ln A}\text{sgn}(x), & |x| < 1/A \\ \frac{1+\ln(A|x|)}{1+\ln A}\text{sgn}(x), & 1/A \leq |x| \leq 1 \end{cases}$$
with $A = 87.6$. Both methods effectively provide about 13-bit equivalent quality using only 8 bits for speech signals.
PCM Encoding Formats
Signed magnitude: One bit for sign, remaining for magnitude. Simple but has two representations of zero.
Two's complement: The standard for digital audio. Range: $-2^{B-1}$ to $2^{B-1}-1$.
Offset binary: Adds $2^{B-1}$ to the two's complement value. Range: 0 to $2^B - 1$.
PCM Transmission and Storage
In transmission, PCM bits are serialized into a continuous bitstream. Frame synchronization words mark the boundaries between samples. In T1/E1 telephony:
- T1: 24 channels × 8 bits × 8000 frames/sec + framing = 1.544 Mbps
- E1: 32 channels × 8 bits × 8000 frames/sec = 2.048 Mbps
In storage (WAV/AIFF files), PCM samples are stored sequentially with a header describing the format parameters.
Advantages and Limitations
Advantages:
- Simple, well-understood encoding/decoding process
- No inter-sample dependencies (each sample is independent)
- Robust to channel errors (one bit error corrupts only one sample)
- Universal standard — highest compatibility
Limitations:
- High bit rate (no compression)
- Uniform quantization wastes bits for low-amplitude content
- Quantization noise is signal-independent (perceptible during quiet passages)
Key Takeaways
- PCM converts analog signals through three steps: sampling → quantization → binary encoding
- Bit rate = sampling rate × bits per sample × number of channels
- SQNR improves by 6.02 dB per additional bit: $\text{SQNR} = 6.02B + 1.76$ dB
- CD audio: 44.1 kHz, 16-bit, stereo = 1.411 Mbps
- Companding (mu-law, A-law) provides non-uniform quantization for speech efficiency
- PCM is the reference standard; all lossy codecs are evaluated against PCM quality
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for Pulse Code Modulation (PCM) — Signals & Systems.
Interview Use
Prepare one clear explanation, one practical example, and one common mistake for this Signals & Systems topic.
Search Terms
signal-systems, signals & systems, signal, systems, sampling, pulse, code, modulation
Related Signals & Systems Topics