Pulse code modulation and quantisation

PCM samples, quantises and encodes an analog signal: Nyquist rate, step size, quantisation noise, SQNR of 6.02n + 1.76 dB, bit rate and companding.

Drafted with Aria, reviewed by the AiCanCode.org team. Spotted an error? Use Give Feedback at the bottom of the page.

Why it matters

Pulse code modulation (PCM) is how an analog quantity — a voice, a thermocouple voltage, a pressure reading — becomes a stream of bits. Telephone networks, digital audio, data-acquisition systems and every ADC in an instrument rely on the same three steps: sample, quantise, encode. The sampling rate and number of bits decide the bit rate, the bandwidth needed and the accuracy you can claim.

Key ideas

Sampling. A signal band-limited to W Hz is completely described by samples taken at f_s ≥ 2W (the Nyquist sampling theorem); 2W is the Nyquist rate. Sampling creates copies of the spectrum at multiples of f_s. If f_s < 2W the copies overlap and high frequencies fold back as false low frequencies (aliasing), which no later processing can undo. A low-pass anti-aliasing filter is therefore placed before the sampler, and in practice f_s is set above 2W (for telephony W = 3.4 kHz, f_s = 8 kHz) so that a realisable filter with a finite transition band can be used. Practical flat-top (sample-and-hold) sampling adds an aperture effect, a sinc-shaped droop that the reconstruction filter can equalise.

Quantisation. Each sample is rounded to one of L discrete levels. For a uniform quantiser covering a peak-to-peak range of 2V_m, the step size is Δ = 2V_m/L. The quantisation error lies between −Δ/2 and +Δ/2, so the maximum error is Δ/2. If the error is uniformly distributed, its mean-square value (the quantisation noise power) is Δ²/12.

Encoding. With n bits per sample, L = 2ⁿ levels. The codes are then transmitted as pulses (NRZ, RZ, Manchester and so on), and the receiver regenerates them, which is the key advantage of PCM: repeaters can rebuild clean pulses, so noise does not accumulate along the link as long as each hop's bit errors stay rare.

Signal-to-quantisation-noise ratio (SQNR). For a full-scale sinusoid of amplitude V_m, signal power is V_m²/2 and noise is Δ²/12, giving SQNR = 1.5 × 2²ⁿ = 1.5·L², i.e. SQNR(dB) ≈ 6.02n + 1.76. Every extra bit adds about 6 dB and doubles the number of levels. For a signal uniformly distributed over the full range, SQNR = L² (6.02n dB). If the input uses only part of the range, SQNR falls dB-for-dB with the backoff.

Bit rate and bandwidth. R_b = n·f_s bits per second. The minimum transmission bandwidth with ideal Nyquist pulse shaping is B = R_b/2; with raised-cosine pulses of roll-off α it is R_b(1 + α)/2. The SQNR therefore grows exponentially with bandwidth (6 dB per extra bit, i.e. per extra f_s/2 of bandwidth) — a far better exchange than FM's quadratic one.

Non-uniform quantisation (companding). Speech has a large dynamic range and spends most time at low amplitude. Compressing the signal before a uniform quantiser and expanding it after decoding gives nearly constant SQNR over a wide range of input levels. The μ-law (μ = 255, North America and Japan) and A-law (A = 87.6, Europe and India) standards with 8 bits give 64 kbit/s telephone channels.

Related schemes. Differential PCM (DPCM) quantises the difference between a sample and its prediction, saving bits for correlated signals. Delta modulation (DM) uses 1 bit per sample at a high rate; it suffers slope overload if the step δ is too small (avoid with δ·f_s ≥ 2πf_m·A_m for a tone) and granular noise if δ is too large.

Formulas

f_s ≥ 2W f_s sampling rate (samples/s), W highest message frequency (Hz).

L = 2ⁿ, Δ = 2V_m/L = (V_max − V_min)/L n bits per sample, L levels, Δ step size (V), V_m peak amplitude (V).

|e_q|max = Δ/2, N_q = Δ²/12 e_q quantisation error (V), N_q mean-square quantisation noise (V², i.e. power into 1 Ω).

SQNR = 1.5·L², SQNR(dB) ≈ 6.02n + 1.76 (full-scale sinusoid, uniform quantiser)

R_b = n·f_s R_b bit rate (bit/s).

B_min = R_b/2, B = R_b(1 + α)/2 B transmission bandwidth (Hz), α raised-cosine roll-off (0 to 1).

δ·f_s ≥ 2πf_m·A_m Delta modulation slope-overload condition; δ step (V), A_m tone amplitude (V), f_m tone frequency (Hz).

Worked examples

Example 1 (standard). Telephone speech band-limited to 3.4 kHz is sampled at 8 kHz and encoded with 8 bits. The quantiser range is ±1 V. Find the bit rate, step size, maximum quantisation error and SQNR for a full-scale tone.

  1. R_b = n·f_s = 8 × 8000 = 64 000 bit/s = 64 kbit/s.
  2. L = 2⁸ = 256; Δ = 2V_m/L = 2/256 = 7.81 mV.
  3. |e_q|max = Δ/2 = 3.91 mV.
  4. SQNR = 6.02 × 8 + 1.76 = 49.9 dB. Answer: 64 kbit/s, Δ = 7.81 mV, max error 3.91 mV, SQNR ≈ 49.9 dB.

Example 2 (GATE level). A sinusoidal sensor signal band-limited to 4 kHz is sampled at 25% above the Nyquist rate. The SQNR must be at least 40 dB. Find the minimum number of bits, the bit rate and the minimum transmission bandwidth.

  1. Nyquist rate = 2 × 4 = 8 kHz, so f_s = 1.25 × 8 = 10 kHz.
  2. 6.02n + 1.76 ≥ 40 → n ≥ (40 − 1.76)/6.02 = 6.35, so n = 7 (giving 43.9 dB).
  3. R_b = 7 × 10 000 = 70 kbit/s.
  4. B_min = R_b/2 = 35 kHz. Answer: n = 7 bits, R_b = 70 kbit/s, B_min = 35 kHz.

Example 3 (bits versus SQNR). By how much does SQNR change if a 12-bit ADC is replaced by a 16-bit one?

  1. Each bit adds 6.02 dB: 4 × 6.02 = 24.1 dB.
  2. A 12-bit converter gives 6.02 × 12 + 1.76 = 74.0 dB; 16-bit gives 98.1 dB. Answer: about 24 dB better (74.0 dB → 98.1 dB) for a full-scale tone.

Common mistakes

  • Quoting the step size Δ as the maximum quantisation error. Rounding gives a maximum error of Δ/2.
  • Using 6.02n + 1.76 dB for any signal. It holds for a full-scale sinusoid; other signals and partial-range inputs give less.
  • Rounding n down. If 6.35 bits are needed, 7 bits are required.
  • Forgetting the anti-aliasing filter, or thinking oversampling alone removes aliasing of out-of-band noise.
  • Confusing the number of levels L with the number of bits n (L = 2ⁿ, not 2n).
  • Using R_b as the bandwidth. Minimum bandwidth is R_b/2 for ideal Nyquist signalling.

For GATE IN

  • Nyquist rate, aliasing frequency and sampling of band-pass or product signals.
  • Bits, step size, SQNR and bit rate numericals; minimum bandwidth with or without roll-off.
  • ADC resolution and accuracy questions in data acquisition (LSB = full scale/2ⁿ).
  • Delta modulation slope overload, companding concepts and DPCM advantages.

Quick check

  1. A signal has W = 5 kHz. What is the Nyquist rate?
  2. How many bits give 1024 levels?
  3. What SQNR does a 10-bit quantiser give for a full-scale sinusoid?
  4. A 6-bit PCM signal is sampled at 10 kHz. What is the minimum transmission bandwidth? Answers: 1. 10 kHz. 2. 10 bits. 3. ≈ 62 dB. 4. 30 kHz.

Try answering each one aloud before you open it.

  1. 1.What is Pulse Code Modulation (PCM)?Concept

    Pulse Code Modulation (PCM) is a method used to digitally represent analog signals. In PCM, the analog input is sampled at regular intervals, quantized to a series of symbols in a digital (usually binary) form, and then encoded into a digital signal. This process involves three main steps: sampling, quantization, and encoding.

  2. 2.Explain the process of quantization in PCM.Concept

    Quantization in PCM is the process of mapping a range of analog signal values to a finite set of discrete levels. After sampling the analog signal, each sample is approximated to the nearest quantization level. This step introduces quantization error, which is the difference between the actual analog value and the quantized value. Quantization is crucial for converting the continuous range of analog values into a format suitable for digital encoding.

  3. 3.Why is sampling important in PCM?Concept

    Sampling is important in PCM because it converts a continuous-time signal into a discrete-time signal by taking periodic samples of the analog input. The sampling rate must be at least twice the highest frequency present in the signal, according to the Nyquist theorem, to accurately reconstruct the original signal without aliasing. Proper sampling ensures that the digital representation retains the essential characteristics of the analog signal.

  4. 4.What is the Nyquist rate, and why is it significant in PCM?Concept

    The Nyquist rate is the minimum sampling rate that is twice the highest frequency present in the analog signal. It is significant in PCM because sampling at or above this rate ensures that the original analog signal can be accurately reconstructed from the sampled data without aliasing. Sampling below the Nyquist rate can lead to distortion and loss of information in the reconstructed signal.

  5. 5.How does quantization error affect the quality of a PCM signal?Application

    Quantization error is the difference between the actual analog signal value and its quantized digital representation. This error introduces noise into the PCM signal, which can degrade the quality of the reconstructed analog signal. The level of quantization error depends on the number of quantization levels; more levels generally result in lower quantization error and better signal quality.

  6. 6.What happens if the sampling rate is lower than the Nyquist rate in PCM?Application

    If the sampling rate is lower than the Nyquist rate, aliasing occurs. Aliasing is a form of distortion where different signals become indistinguishable from each other when sampled. This results in a loss of information and can cause the reconstructed signal to differ significantly from the original analog signal, leading to poor signal quality.

  7. 7.Why is PCM preferred over analog modulation techniques in digital communication systems?Application

    PCM is preferred over analog modulation techniques in digital communication systems because it offers better noise immunity and signal integrity. Digital signals are less susceptible to noise and interference compared to analog signals. PCM also allows for easier multiplexing and integration with digital networks, and it supports error detection and correction techniques, enhancing the reliability of communication.

  8. 8.Calculate the bit rate of a PCM system with a sampling rate of 8 kHz and 8-bit quantization.Numerical

    To calculate the bit rate, multiply the sampling rate by the number of bits per sample. Bit rate = Sampling rate × Number of bits per sample = 8,000 samples/second × 8 bits/sample = 64,000 bits/second or 64 kbps.

  9. 9.A PCM system uses 256 quantization levels. What is the number of bits required per sample?Numerical

    The number of bits required per sample is determined by the formula: Number of bits = log₂(Number of quantization levels). For 256 quantization levels, Number of bits = log₂(256) = 8 bits.

  10. 10.Explain how signal-to-noise ratio (SNR) is related to quantization in PCM.Application

    Rounding each sample to the nearest of L = 2ⁿ levels adds an error of at most ±Δ/2, which behaves like noise of mean-square value Δ²/12. For a full-scale sinusoid the signal-to-quantisation-noise ratio is 1.5·L², i.e. about 6.02n + 1.76 dB, so each extra bit adds about 6 dB. The figure falls for signals that do not use the full range, which is why speech uses μ-law or A-law companding to keep SQNR roughly constant over a wide range of levels.

Finished this topic? Mark it so your progress, study plan and readiness keep up.

Stuck on something here?