Digital Signal Processing Reference
In-Depth Information
In terms of the quantization step, we get
y ¼ 0:519
0:286 D ¼ 2:1 D and binary code ¼ 110
Based on Figure 11.1 , the recovered signal is
y q ¼ 2 D ¼ 0:572
and the expander gives
x q ¼j5j max signð0:572Þ ð1 þ 255Þ j0:572j 1
255
¼ 0:448 volt
Finally, the quantization error is given by
e q ¼ 0:448 0:5 ¼0:052 volt
As we can see, with 3 bits per sample, the stronger signal is encoded with more quantization error, while the weak
signal is encoded with less quantization error.
In the following simulation, we apply a 5-bit m -law compander with m ¼ 255 in order to quantize
and encode the speech data used in the last section. Figure 11.6 is a block diagram of compression and
decompression.
x
y q
x q
y
µ -law
compressor
µ
5-bit code
midtread
quantizer
µ -law
expander
µ
=255
=255
FIGURE 11.6
The 5-bit midtread uniform quantizer with
m ¼ 255 used for simulation.
Figure 11.7 shows the original speech data, the quantized speech data using m -law compression,
and the quantization error for comparisons. The quantized speech wave is very close to the original
speech wave. From the plots in Figure 11.7 , we can observe that the amplitude of the quantization error
changes according to the amplitude of the speech being quantized. More quantization error is intro-
duced when the amplitude of speech data is larger; on the other hand, a smaller quantization error is
produced when the amplitude of speech data is smaller.
Compared with the quantized speech using the linear quantizer shown in Figure 11.2 , the
decompressed signal using the m -law compander looks and sounds much better, since the quantized
signal can better track the original large amplitude signal and original small amplitude signal as well.
The MATLAB implementation is shown in Program 11.2 in Section 11.7.
11.2.2 Digital
-Law Companding
In many multimedia applications, the analog signal is first sampled and then it is digitized into a linear
PCM code with a larger number of bits per sample. Digital m -law companding further compresses the
linear PCM code using the compressed PCM code with a smaller number of bits per sample without
losing sound quality. The block diagram of a digital m -law compressor and expander is shown in
Figure 11.8 .
m
 
Search WWH ::




Custom Search