PULSE-CODE MODULATION
12.1 PULSE-CODE MODULATION
Pulse-code modulation is a method for quantizing an analog signal for the purpose of transmitting or storing the signal in digital form. PCM is widely used for speech transmission in telephone communications and for telemetry systems that employ radio transmission. We shall concentrate our attention on the application of PCM to speech signal processing.
Chapter 12
APPLICATIONS IN COMMUNICATIONS
Speech signals transmitted over telephone channels are usually limited in bandwidth to the frequency range below 4 kHz. Hence the Nyquist rate for sampling such a signal is less than 8 kHz. In PCM the analog speech signal is sampled at the nominal rate of 8 kHz (samples per second), and
each sample is quantized to one of 2 b levels, and represented digitally by
a sequence of b bits. Thus the bit rate required to transmit the digitized speech signal is 8000 b bits per second.
The quantization process may be modeled mathematically as
(12.1) where ˜ s(n) represents the quantized value of s(n), and q(n) represents the
˜ s(n) = s(n) + q(n)
quantization error, which we treat as an additive noise. Assuming that a uniform quantizer is used and the number of levels is sufficiently large, the quantization noise is well characterized statistically by the uniform probability density function,
, − ∆ ≤ q≤ ∆
p(q) =
where the step size of the quantizer is ∆ = 2 −b . The mean square value of the quantization error is
Measured in decibels, the mean square value of the noise is
= −6b − 10.8 dB (12.4)
We observe that the quantization noise decreases by 6 dB/bit used in the quantizer. High-quality speech requires a minimum of 12 bits per sample and hence a bit rate of 96,000 bits per second (bps).
Speech signals have the characteristic that small signal amplitudes occur more frequently than large signal amplitudes. However, a uniform quantizer provides the same spacing between successive levels through- out the entire dynamic range of the signal. A better approach is to use
a nonuniform quantizer, which provides more closely spaced levels at the low signal amplitudes and more widely spaced levels at the large signal amplitudes. For a nonuniform quantizer with b bits, the resulting quan- tization error has a mean square value that is smaller than that given by (12.4). A nonuniform quantizer characteristic is usually obtained by passing the signal through a nonlinear device that compresses the signal amplitude, followed by a uniform quantizer. For example, a logarithmic compressor employed in U.S. and Canadian telecommunications systems,
Pulse-Code Modulation 609
called a µ-law compressor, has an input-output magnitude characteristic of the form
ln (1 + µ|s|)
y=
sgn(s); |s| ≤ 1, |y| ≤ 1
ln(1 + µ)
where s is the normalized input, y is the normalized output, sgn (·) is the sign function, and µ is a parameter that is selected to give the desired compression characteristic.
In the encoding of speech waveforms the value of µ = 255 has been adopted as a standard in the U.S. and Canada. This value results in about
a 24 dB reduction in the quantization noise power relative to uniform quantization. Consequently, an 8-bit quantizer used in conjunction with
a µ = 255 logarithmic compressor produces the same quality speech as a 12-bit uniform quantizer with no compression. Thus the compressed PCM speech signal has a bit rate of 64,000 bps.
The logarithmic compressor standard used in European telecommu- nication systems is called A-law and is defined as
⎧ ⎪ 1 + ln(A|s|)
⎨ 1 ⎪ sgn(s),
⎪ ⎪ A|s| ⎩
sgn(s),
0 ≤ |s| ≤ 1
1 + ln A
where A is chosen as 87.56. Although (12.5) and (12.6) are different nonlinear functions, the two compression characteristics are very similar. Figure 12.1 illustrates these two compression functions. Note their strong similarity.
FIGURE 12.1 Comparison of µ-law and A-law nonlinearities
Chapter 12
APPLICATIONS IN COMMUNICATIONS
In the reconstruction of the signal from the quantized values, the decoder employs an inverse logarithmic relation to expand the signal amplitude. For example, in µ-law the inverse relation is given by
The combined compressor-expander pair is termed a compander.
12.1.1 PROJECT 12.1: PCM The purpose of this project is to gain an understanding of PCM compres- sion (linear-to-logarithmic) and PCM expansion (logarithmic-to-linear). Write the following three MATLAB functions for this project:
1. a µ-law compressor function to implement (12.5) that accepts a zero- mean normalized (|s| ≤ 1) signal and produces a compressed zero-mean signal with µ as a free parameter that can be specified,
2. a quantizer function that accepts a zero-mean input and produces an integer output after b-bit quantization that can be specified, and
3. a µ-law expander to implement (12.7) that accepts an integer input and produces a zero-mean output for a specified µ parameter.
For simulation purposes generate a large number of samples (10,000 or more) of the following sequences: (a) a sawtooth sequence, (b) an expo- nential pulse train sequence, (c) a sinusoidal sequence, and (d) a random sequence with small variance. Care must be taken to generate nonperiodic sequences by choosing their normalized frequencies as irrational numbers (i.e., sample values should not repeat). For example, a sinusoidal sequence can be generated using
s(n) = 0.5 sin(n/33),
0 ≤ n ≤ 10,000
From our discussions in Chapter 2, this sequence is nonperiodic, yet it has a periodic envelope. Other sequences can also be generated in a sim- ilar fashion. Process these signals through the above µ-law compressor, quantizer, and expander functions as shown in Figure 12.2, and compute
FIGURE 12.2 PCM project
Differential PCM (DPCM) 611
the signal-to-quantization noise ratio (SQNR) in dB as
n =1 s (n)
SQNR = 10 log
10 ( N
n =1 (s(n) − s q (n))
For different b-bit quantizers, systematically determine the value of µ that maximizes the SQNR. Also plot the input and output waveforms and comment on the results.