Module
3
Quantization and
Coding
Version 2, ECE IIT, Kharagpur
Lesson
12
Logarithmic Pulse Code
Modulation (Log PCM)
and Companding
Version 2, ECE IIT, Kharagpur
After reading this lesson, you will learn about:
¾ Reason for logarithmic PCM;
¾ A-law and μ–law Companding;
In a linear or uniform quantizer, as discussed earlier, the quantization error in the
k-th sample is
ek = x (t) – xq (kTs) 3.12.1
and the maximum error magnitude in a quantized sample is,
δ
Max e k = 3.12.2
2
So, if x (t) itself is small in amplitude and such small amplitudes are more probable in the
input signal than amplitudes closer to ‘± V’, it may be guessed that the quantization noise
of such an input signal will be significant compared to the power of x (t). This implies
that SQNR of usually low signal will be poor and unacceptable. In a practical PCM
codec, it is often desired to design the quantizer such that the SQNR is almost
independent of the amplitude distribution of the analog input signal x (t).
This is achieved by using a non-uniform quantizer. A non-uniform quantizer
ensures smaller quantization error for small amplitude of the input signal and relatively
larger step size when the input signal amplitude is large. The transfer characteristic of a
non – uniform quantizer has been shown in Fig 3.12.1. A non-uniform quantizer can be
considered to be equivalent to an amplitude pre-distortion process [denoted by y = c (x)
in Fig 3.12.2] followed by a uniform quantizer with a fixed step size ‘δ’. We now briefly
discuss about the characteristics of this pre-distortion or ‘compression’ function y = c (x).
Fig 3.12.1 Transfer characteristic of a non-uniform quantizer
Version 2, ECE IIT, Kharagpur
x (t) Pre-distortion Uniform x (t) Non-uniform
y = c (x) Quantizer Quantizer
Fig. 3.12.2 An equivalent form of a non-uniform quantizer
Mathematically, c (x) should be a monotonically increasing function of ‘x’ with
odd symmetry Fig 3.12.3. The monotonic property ensures that c-1 (x) exists over the
range of ‘x(t)’ and is unique with respect to c (x) i.e., c ( x ) × c −1 ( x ) = 1 .
o/p
amplitude
+V
y=c(x)
-V +V
i/p amplitude
-V
Fig 3.6
Fig. 3.12.3 A desired transfer characteristic for non-linear quantization process
Remember that the operation of c-1 (x) is necessary in the PCM decoder to get
back the original signal undistorted. The property of odd symmetry i.e., c (-x) = - c (x)
simply takes care of the full range ‘± V’ of x (t). The range ‘± V’ of x (t) further implies
the following:
c (x) = + V , for x = +V;
=0, for x = 0;
=-V, for x = - V; 3.12.3
Let the k-th step size of the equivalent non-linear quantizer be ‘δk’ and the
number of signal intervals be ‘M’. Further let the k-th representation level after
quantization when the input signal lies between ‘xk’ and ‘xk+1’ be ‘yk’ where
1
( )
y k = 2 x k + x k +1 , k = 0,1,…..,(M-1) 3.12.4
The corresponding quantization error ‘ek’ is
ek = x – yk ; xk < x ≤ xk+1
Version 2, ECE IIT, Kharagpur
dc ( x )
Now observe from Fig 3.12.3 that ‘δk’ should be small if ‘ ’ i.e., the slope of
dx
y = c (x) is large.
In view of this, let us make the following simple approximation on c (x):
dc ( x ) 2V 1
, k = 0,1,……,(M-1) 3.12.5
dx M δk
and δ k = x k +1 − x k , k = 0,1,…….,(M-1)
2V
Note that, ‘ ’ is the fixed step size of the uniform quantizer Fig. 3.12.2.
M
Let us now assume that the input signal is zero mean and its pdf p(x) is
symmetric about zero. Further for large number of intervals we may assume that in each
interval Ik, k = 0,1,…..,(M-1), the p(x) is constant. So if the input signal x (t) is between
xk and xk+1, i.e.,
xk < x ≤ xk+1 ,
p ( x) p (y ) k
So, the probability that x lies in the k-th interval Ik,
I k = p k P r ( x k < x ≤ x k +1) = p ( y k )δ k 3.12.6
M −1
where, ∑ P r ( x k < x ≤ x k +1) = 1
0
2
Now, the mean square quantization error e can be determined as follows:
+V
∫ ( x − y k ) p ( x )dx
2
2
e =
−V
∑ ∫ ( x− y k )
M −1 x k +1
( y ) dx
2
= p
k
k =0 xk
∫ ( x − y k ) dx
M −1 pk x k +1 2
= ∑
k =0 δ k x
k
= ∑ k ⎢( x k +1− y ) − ( x k − y ) ⎥
M −1 p
1⎡ 3 3⎤
k =0 δ k 3 ⎣
k k ⎦
⎧ 3 3⎫
M −1 ⎛ p ⎞
⎪⎡ 1 ⎤ ⎡ 1 ⎤⎪
= ∑ ⎜ k ⎟ ⎨ x k +1− ( x k + x k +1) − x k − ( x k + x k +1) ⎬
1
⎟ ⎢ ⎥⎦ ⎢⎣ ⎥⎦ ⎪
⎝ δ k ⎠ ⎪⎩ ⎣
k =0 3 ⎜ 2 2 ⎭
Version 2, ECE IIT, Kharagpur
1 M −1 p k 1 3 1 M −1
∑ ∑p
3 k =0 δ k 4 δ k 12 k =0 kδ
2
= = k
3.12.7
Now substituting
⎡ dc( x ) ⎤
−1
2V
δk M ⎢ ⎥
⎣ dx ⎦
in the above expression, we get an approximate expression for mean square error as
⎡ dc( x ) ⎤
−2
2 M −1
e = 3V 2 ∑ p k ⎢
2
M k =0 ⎣ dx ⎥⎦
3.12.8
The above expression implies that the mean square error due to non-uniform quantization
can be expressed in terms of the continuous variable x, -V< x < +V, and having a pdf
p (x) as below:
⎡ dc( x ) ⎤
−2
2 +V
e 3V 2 ∫ p ( x )⎢
2
⎥ dx 3.12.9
M −V ⎣ dx ⎦
Now, we can have an expression of SQNR for a non-uniform quantizer as:
+V
∫ x p ( x ) dx
2
⎛ 2⎞
SQNR ⎜ 3M ⎟ −V
3.12.10
⎡ dc( x ) ⎤
⎜ 2 ⎟ −2
⎝ V ⎠ +V
∫ p ( x) ⎢ ⎥ dx
−V
⎣ dx ⎦
The above expression is important as it gives a clue to the desired form of the
compression function y = c(x) such that the SQNR can be made largely independent of
the pdf of x (t).
It is easy to see that a desired condition is:
dc ( x ) K
= where –V < x < +V and K is a positive constant.
dx x
⎛x⎞
i.e., c ( x ) = V + K ln ⎜ ⎟ for x > 0 3.12.11
⎝V ⎠
and c (x) = - c (x) 3.12.12
Version 2, ECE IIT, Kharagpur
Note:
Let us observe that c (x) → ± ∞ as x → 0 from other side. Hence the above c(x) is not
realizable in practice. Further, as stated earlier, the compression function c (x) must pass
through the origin, i.e., c (x) = 0, for x = 0. This requirement is forced in a compression
function in practical systems.
There are two popular standards for non-linear quantization known as
(a) The µ - law companding
(b) The A – law companding.
The µ - law has been popular in the US, Japan, Canada and a few other countries while
the A - law is largely followed in Europe and most other countries, including India,
adopting ITU-T standards.
The compression function c (x) for µ - law companding is (Fig. 3.12.4 and Fig.
3.12.5):
⎛ μ x⎞
ln ⎜1 +
c( x ) ⎝ V ⎟⎠ x
= , 0 ≤ ≤ 1.0 3.12.13
V ln (1 + μ ) V
‘µ’ is a constant here. The typical value of µ lies between 0 and 255. µ = 0 corresponds
to linear quantization.
Fig. 3.12.4 μ-law companding characteristics(mu = 100)
Version 2, ECE IIT, Kharagpur
Fig. 3.12.5 μ-law companding characteristics (mu = 0, 100, 255)
The compression function c (x) for A - law companding is (Fig. 3.12.6):
x
c( x ) A
V x 1
= , 0≤ ≤
V 1 + ln A V A
⎛ x⎞
1 + ln ⎜ A ⎟
= ⎝ V ⎠ , 1 x
≤ ≤ 1.0 3.12.14
1 + ln A A V
‘A’ is a constant here and the typical value used in practical systems is 87.5.
Fig. 3.12.6 A-law companding characteristics (A = 0, 87.5, 100, 255)
For telephone grade speech signal with 8-bits per sample and 8-Kilo samples per
second, a typical SQNR of 38.4 dB is achieved in practice.
As approximately logarithmic compression function is used for linear
quantization, a PCM scheme with non-uniform quantization scheme is also referred as
“Log PCM” or “Logarithmic PCM” scheme.
Version 2, ECE IIT, Kharagpur
Problems
Q3.12.1) Consider Eq. 3.12.13 and sketch the compression of c (x) for µ = 50 and V =
2.0V
Q3.12.2) Sketch the compression function c (x) for A - law companding (Eq.3.12.14)
when V = 1V and A = 50.
Q3.12.3) Comment on the effectiveness of a non-linear quantizer when the peak
amplitude of a signal is known to be considerably smaller than the maximum
permissible voltage V.
Version 2, ECE IIT, Kharagpur