PULSE CODE
MODULATION
Signal-to-
Quantization Noise
Ratio
Signal-to-Quantization Noise Ratio (SQR / SNR)
❖ Measure of quality showing the relationship between the
quantized signal voltage and maximum Qe.
SQR depends
on the signal
voltage
(varying)
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
Signal-to-Quantization Noise Ratio (SQR)
❖ Expressed as average signal power to average noise power,
Normalized (same R’s)
R = resistance (Ω)
v = rms signal voltage (V)
q = quantization interval (V)
v2/R = average signal power (W)
(q2/12)/R = average Qe power (W)
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
Signal-to-Quantization Noise Ratio (SQR)
❖ For an N-bit quantizer
N = number of bits
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
Signal-to-Quantization Noise Ratio (SQR)
Example: Given an audio signal represented as
i. determine the SQR when quantized by 10-bit sign-
magnitude PCM
ii. Number of bits needed to achieve SQR = 40 dB
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
Signal-to-Quantization Noise Ratio (SQR)
Example: Given an audio signal represented as
i. determine the SQR when quantized by 10-bit sign-
magnitude PCM
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
Signal-to-Quantization Noise Ratio (SQR)
Example: Given an audio signal represented as
ii. Number of bits needed to achieve SQR = 40 dB
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
Linear vs Nonlinear PCM Codes
Linear (uniform) codes
❖ Resolution/step size is the same
❖ SQR is less for low signal level
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
Linear vs Nonlinear PCM Codes
Nonlinear (non-uniform) codes
❖ More codes at low signal level
❖ Resolution increases with
amplitude
❖ DR is increased
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
Linear vs Nonlinear PCM Codes
Why use nonlinear PCM codes?
❖ Many signals such as voice have a
non-linear distribution
❖ Follows logarithmic characteristic
Difficult to design nonlinear
quantizers.
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
Midtread vs Midrise Quantization
Midtread Midrise
Quantization Quantization
❖ Minimized small-signal noise ❖ More sensitive to noise
❖ Zero is a quantization value at low signal levels
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
Midtread vs Midrise Quantizing
Midtread Midrise
Quantization Quantization
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
CODING METHODS
Pulse Code Modulation
PAM
Analog Signal PCM Code
BPF S/H Quantizer Encoder
Signal 10110001…
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
Level-at-a-Time Coding
❖ Quantized PAM signal is compared to a ramp (sawtooth)
every sampling time.
❖ Binary counter increments from 0 to 2n levels.
❖ If Vramp ≥ VPAM, counter contains PCM code.
❖ Requires very fast clocks.
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
Digit-at-a-Time Coding
❖ Every digit of the PCM code is determined every sampling
time
❖ Employed Successive Approximation Register (SAR) ADC
❖ Requires relatively slower clocks
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
Word-at-a-Time Coding
❖ Uses Flash ADC’s where entire PCM word is determined
every sampling time
❖ Fastest encoding but impractical for applications requiring
high resolution.
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
COMPANDING
Companding
❖ Nonlinear quantizers are difficult to design
❖ Speech signals are naturally nonlinear with low-level
signals occurring more frequent
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
Companding
❖ How do we implement this?
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
Companding
❖ Process of compressing and expanding the analog signal
prior to sampling and linear quantization
❖ High-level analog signals are compressed (lower gain)
prior to transmission and expanded (higher gain) in the
receiver
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
Companding
PAM
Signal Encoder
Analog Analog PCM Code
BPF S/H Quantizer (ADC + PS
Signal Compressor 10110001…
Converter)
Decoder
Reconstructed Analog PCM Code
BPF LPF (SP Converter +
Signal Expander 10110001…
DAC)
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
Companding
μ-Law Companding
❖ Used in USA and Japan
Vmax = maximum analog input
Vin = instantaneous input voltage level
μ = degree of compression
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
Companding μ-Law companding
No compression
μ=0
❖ μ = 255 for USA and Japan
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
Companding μ-Law companding
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
Companding
A-Law companding
❖ Used in Europe and rest of world
❖ Slightly flatter SQR than μ-law
❖ Inferior to μ-law for small-voltage
inputs (idle channel noise)
❖ A = 87.6 for Europe Vmax = maximum analog input
Vin = instantaneous input voltage level
A = degree of compression
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
Companding A-Law Companding
No compression
A=1
❖ μ = 87.6 for Europe
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
Example:
For μ = 255,
(a) find Vout, AV(comp), and the dynamic range for the following input
voltages: Vin = 4 (Vmax), 3, 2, 1.
(b) find the needed AV(expand) at the receiver to recover the signals.
(c) Repeat using A law for A = 87.6
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
DIGITAL
COMPANDING
Digital Companding
❖ Digital compression in the transmitter after the encoder,
and digital expansion in the receiver before the decoder
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
Digital Companding
PAM
Signal Encoder
Analog Digital Compressed
BPF S/H Quantizer (ADC + PS
Signal Compressor PCM Code
Converter)
Decoder
Reconstructed Digital Compressed
BPF LPF (SP Converter +
Signal Expander PCM Code
DAC)
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
Digital Companding:
12-Bit Linear to 8-Bit Compressed PCM Code
16 combinations of ABCD
Correction here!
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
Digital Companding
❖ Segment 0 and 1 has no compression with 16 codes (combinations of 1’s and 0’s)
❖ Segment 2 has 32 codes → compression ratio: 2
❖ Segment 3 has 64 codes → compression ratio: 4
❖ Segment 7 has 1024 codes → compression ratio: 64
❖ Subsegment → combinations of ABCD (16 of them)
❖ Code → combinations of X’s
❖ Segment 0 and 1 → 16 subsegments
❖ Segment 2 → 16 subsegments with 2 codes each
❖ Segment 3 → 16 subsegments with 4 codes each
❖ Segment 7 → 16 subsegments with 64 codes each
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
Digital Companding Encoding Algorithm
❖ Sign Bit:
❖ directly copy to compressed code
❖ Segment Number:
❖ count number of leading 0’s in the 11-
bit magnitude part
❖ Subtract number from 7 (7 – #zeros)
❖ Convert to 3-bit binary
❖ Interval/Subsegment:
❖ LSB of 8-bit compressed code
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
Digital Companding Decoding Algorithm
❖ Segment Identifier:
❖ Convert to decimal, subtract
from 7, result is the leading
zeros, followed by “1”.
❖ Truncated Bits (X’s):
❖ MSB → “1”
❖ remaining bits → “0”
Shortcut Tip: insert 1’s before and after ABCD.
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
Digital Companding Algorithm
Example: Determine the 12-bit linear code, 8-bit compressed PCM
code, decoded 12-bit code, Qe, and compression error for a resolution
of 0.01V for the following sampled voltage values: 0.053V, -0.318V,
10.234V.
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
Vocoders (Voice Coders)
❖ Special encoders/decoders used to digitize and transmit human
voice.
❖ Encodes the minimum amount of speech information necessary to
reproduce a perceptible message with fewer bits
❖ Used in limited bandwidth applications
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
Vocoders (Voice Coders)
❖ Channel Vocoder:
❖ First developed by Homer Dudley
in 1928.
❖ BPF (200 Hz BW) are used to
separate the speech waveform
(~200 Hz to 3.2kHz) into
narrower sub-bands.
❖ Sub-bands are rectified, filtered
and digitally encoded
❖ Poor quality, synthetic sounding
speech, operates at 2 ~ 2.4 kbps
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
Vocoders (Voice Coders)
❖ Formant Vocoder:
❖ Formant – peak frequencies of audio signal, amplified by shape of vocal
tract
❖ Theoretically, there are infinite formants, but only 4~5 are relevant (not
spread throughout the spectrum)
❖ First lowest 2 formants → responsible for vowels
❖ 3 formants up → color of our voice
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
Vocoders (Voice Coders)
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
Vocoders (Voice Coders)
❖ Formant Vocoder:
❖ Determines the location of 3 to 4 formants plus the pitch and encodes
these formants only.
❖ Can operate at lower bit rates, 1kbps
❖ Difficulty in tracking the formants
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE
Vocoders (Voice Coders)
❖ Linear Predictive Coders (LCP):
❖ Extracts significant portions of speech from time-domain waveform of
signal
❖ Produces time-varying modal of human vocal tract
❖ Provides more natural sounding
❖ Widely used in speech coding and speech synthesis
❖ Operates at 1.2 ~ 2.4 kbps
ECE106 Modulation and Coding Techniques SE Maestre, ECE, MSEE