Waveform Coding
Dr. R. Krishnamurthy
December 26, 2016
I Waveform coding schemes are designed to reproduce the
waveform at the destination with little distortion as possible.
I In these techniques, no attention is paid to the mechanism
that produces the waveform;
I All attentions are directed at reproducing the source output at
the destination with high fidelity.
I The structure of the source plays no role in the desogn of
waveform coders and only properties of the waveform affect
the design
I Thus, waveform coders are robust and can be used with a
variety of sources as long as the waveforms produced by the
sources have certain similarities.
I In this lecture, we study some basic waveform coding methods
that are widely applied to a variety of sources.
Pulse Code Modulation (PCM)
I PCM is the most useful and widely used of all the pulse
modulations (i.e., PWM, PPM, PAM, PCM).
I PCM is the simplest and oldest waveform coding scheme.
I PCM basically is a tool for converting an analog signal into a
digital signal (A/D conversion).
I An analog signal is characterized by an amplitude that can
take on any value over a continuous range.
I This means that it can take an infinite number of values.
I On the other hand, digital signal is characterized by an
amplitude that can take only a finite number of values.
A pulse code modulator consist of three basic sections:
1. a sampler
2. a quantizer and
3. an encoder
A functional block diagram of a PCM system is shown below.
Figure: Block diagram of a PCM System
In PCM, we make the following assumptions:
1. The waveform (signal) is bandlimited with a maximum
frequency of W . This is done by including the low-pass filter
prior to the sampling. It has been done merely to prevent
aliasing of the signal.
2. The signal is of finite amplitude. In other words, there exist a
maximum amplitude xmax such that for all t, we have
|x(t)| ≤ xmax .
3. The quantization is done with a large number of quantization
levels N, which is a power of 2 (N = 2ν ).
PCM COntd...
Sampler:
I The waveform entering the sampler is a bandlimited waveform
with the bandwidth of W .
I Usually, there exist a filter (low-pass) with bandwidth W prior
to the sampler to prevent any components beyond W from
entering the sampler.
I This filter is called the presampling filter or anti-alias filter.
I Therefore, it excludes frequencies greater than W before
sampling.
I To ensure perfect reconstruction of the message signal at the
receiver, the sampling is done at a rate higher than the
Nyquist rate. This allows some guard band as well.
PCM Contd...
Quantizer:
I The sampled values then enter a scalar quantizer.
I The quantizer is either a uniform quantizer, which results in a
unifrom PCM, or a nonuniform quantizer.
I The choice of the quantizer is based on the characteristics of
the source output.
I
PCM Contd...
Encoding:
I The output of the quantizer is then encoded into a binary
sequence of length ν, where N = 2ν is the number of
quantization levels.
Uniform PCM
I In uniform PCM, we assume that the quantizer is a uniform
quantizer.
I Since the range of the input samples is [−xmax , +xmax ] and
the number of quantization levels is N.
I The length of each quantization region is given by
2xmax xmax
∆= = ν−1 . (1)
N 2
I The quantized values in uniform PCM are chosen to be the
midpoints of the quantization regions.
I Therefore, the error x̃ = x − Q(x) is random variable.
I This random variable takes values in the interval [− ∆ ∆
2 , + 2 ].
I In ordinary PCM applications, the number of levels (N) is
usually high and the range of variations of the input signal
(amplitude variations xmax ) is small.
I This means that the length of each quantization region ∆ is
small.
I Under these assumptions, in each quantization region, the
error X̃ = X − Q(X ) can be approximated by a uniformly
distributed random variable on [− ∆ ∆
2 , + 2 ].
I In other words,
1
∆, −∆2 ≤ x̃ ≤
∆
2,
f (x̃) =
0, otherwise.
I The distortion introduced by quantization (quantization noise)
is therefore
Z +∆
2 1 ∆2 x2 x2
2
E [X̃ ] = x̃ 2 d x̃ = = max2 = maxν (2)
−∆ ∆
2
12 3N 3×4
where ν is the number of bits/source sample and we have
employed Equation (1)
The signal-to-quantization noise ratio then becomes
PX PX 3 × 4ν PX
SQNR = ¯ = 2 = 2
(3)
X˜2 xmax /3 × 4ν xmax
where PX is the power in each sample.
In the case where X (t) is a wide-sense stationary process, PX can
be found using any of the following relations:
PX = RX (τ )τ = 0 (4)
Z ∞
= SX (f )df (5)
−∞
Z ∞
= x 2 fX (s)dx (6)
−∞
(7)
I 2
Note that since xmax is the maximum possible value for X , we
2 2 .
always have PX E [X ] ≤ xmax
PX PX
I This means that 2
xmax
< 1 (usually 2
xmax
1);
I Hence, 3N 2 = 3 × 4ν is an upper bound to the SQNR in
uniform PCM.
I This also means that SQNR in uniform PCM deteriorates as
the dynamic range of the source increases because an increase
in the dynamic range of the source results in a decrease in
PX
x2
.
max
Expressing SQNR in decibels, we obtain
PX
SQNR ≈ 10 log10 2
+ 6ν + 4.8 (8)
xmax
I We can see that each extra bit (increase in ν by one)
increases the SQNR by 6 dB.
I This is a very useful strategy for estimating how many extra
bits are required to achieve a desired SQNR.
Example
What is the resulting SQNR for a signal uniformly distributed on
[-1, 1], when uniform PCM with 256 level is employed?
R1
We have PX = −1 21 x 2 dx = 31 .
Therefore, using xmax = 1 and ν log2 256 = 8
we have
1
3 × 4ν PX 3 × 48 ×
SQNR = 2
= 3
= 48 = 65536 ≈ 48.16dB.
xmax 1
BW requirements of a PCM System
I If a signal has bandwidth of W , then the minimum number of
samples for perfect reconstruction of the signal is given by the
sampling theorem.
I It is equal to 2W samples/second.
I If some guardband is required, then the number of samples
per second is fs , which is more than 2W (i.e.,fs > 2W ).
I for each sample, ν bits are used; therefore, a total of νfs
bits/sec are required for transmission of the PCM signal.
I In the case of sampling at the Nyquist rate, this is equal to
2νW bits/sec.
I The minimum bandwidth requirement for binary transmission
of R bits/sec (more precisely, R pulses/sec) is R2 .
I Therefore, the minimum bandwidth requirement of a PCM
system is
νfs
BWreq = , (9)
2
I In the case of sampling at the Nyquist rate, gives the absolute
minimum bandwidth requirement as
BWreq = νW . (10)
I This means that a PCM system expands the bandwidth of the
original signal by a factor of at least ν.
Nonuniform PCM
I As long as the statistics of the input signals are close to the
uniform distribution, uniform PCM works fine.
I However, in coding of certain signals such as speech, the
input distribution is far from uniformly distributed.
I For a speech waveform, in particular, there exist a higher
probability for smaller amplitudes and a lower probability for
larger amplitudes.
I Therefore, it makes sense to design to design a quantizer with
more quantization regions at lower amplitudes and fewer
quantization regions at larger amplitudes.
I The resulting quantizer will be a nonuniform quantizer that
has quantization regions of various sizes.
I The usual method for performing nonuniform quantization1 is
to first to pass the sample through a nonlinear element that
compresses the large amplitudes (reduces the dynamic range
of the signal) and then performs uniform quantization on the
output.
I At the receiving end, the inverse (expansion) of this nonlinear
operation is applied to obtain the sampled value.
I This technique is called companding (compressing-expanding)
1
Sometimes, the term nonlinear quantization is used. This is misleading,
because all quantization schemes, uniform or nonuniform, are nonlinear.
A block diagram of this system is shown below.
I There are two types of companders that are widely used for
speech coding.
1. The µ law2 .
2. The A law3 .
I
2
The µ-law is used for signal compression; this compression law is used in
the United States, Canada, and Japan.
3
In Europe, the A-law is used for signal compression;
The µ-Law Compander
I The µ-law compander employs the logrithmic function at the
transmitting side, |x| ≤ 1:
log(1 + µ|x|)
g (x) = sgn(x) (11)
log(1 + µ)
I The parameter µ controls the amount of compression and
expansion.
I The standard PCM system in the united states and Canada
employs a compressor with µ = 255 followed by a uniform
quantizer with 8 bits/sample.
I Use of a compander in this system improves the performance
of the system by about 24 dB.
I The following figure illustrates the µ-law compander
characteristics for µ = 0, 5 and 255.
I
I The second widely used logarithmic compressor is the A-law
compander.
I The characteristics of this compander are given by
1 + log A|x|
g (x) = sgn(x) (12)
1 + log A
I The performance of this compander is comparable to the
performance of the µ-law compander.
Differential Pulse Code Modulation
I In a PCM system, after sampling the information signal, each
sample is quantized independently using a scalar quantizer.
I This means that previous sample values have no effect on the
quantization of the new samples.
I However, when a band limited random process is sampled at
the Nyquist rate or faster, the sampled values are usually
correlated random variables.
I The exception is the case when the spectrum of the process is
flat within its bandwidth.
I This means that the previous samples give some information
about the next sample;
I Thus, this information can be employed to improve the
performance of the PCM system.
I For instance, if the previous sample values were small, and
there is a high probability that the next sample value will be
small as well.
I Then it is not necessary to quantize a wide range of values to
achieve a good performance.
I In the simplest form of differential pulse code modulation
(DPCM), the difference between two adjacent samples is
quantized.
I Because two adjacent samples are highly correlated, their
difference has small variations;
I Therefore, to achieve a certain level of performance, fewer
levels (and therefore fewer bits) are required to quantize it.
I This means that DPCM can achieve performance levels at
lower bit rates than PCM.
The following figure shows a block diagram of this simple DPCM
scheme.
I As seen in the figure, the input to the quantizer is not simply
Xn − Xn−1 but rather Xn − Y b0 .
n−1
I We will see that Yb 0 is closely related to Xn−1 , and this
n−1
choice has an advantage because the accumulation of
quantization noise is prevented.
I The input to the quantizer Yn is quantized by a scalar
quantizer (uniform or nonuniform) to produce Ybn .
Using the relations
b0
Yn = Xn − Y (13)
n−1
and
bn + Y
Yn0 = Y b0 (14)
n−1
we obtain the quantization error between the input and the output
of the quantizer as
bn − Yn = Y
Y bn − (Xn − Y
b0 ) (15)
n−1
b b
= Yn − Xn + Y 0
(16)
n−1
= b0
Y − Xn . (17)
n
At the receiving end, we have
bn = Y
X bn + X
b0 (18)
n−1
Comparing equation (14) and Equation (18) we see that Y b 0 and
n
bn satisfy the same difference equation with the same excitation
X
function (Ybn ).
I Therefore, if the initial conditions of Y bn are chosen to
b 0 and X
n
be the same, they will be equal.
I For instance, if we let Yb0 = X b 0 = 0, then all n will have
1 1
b =X
Y 0 bn . Substituting this in Equation (??), we obtain
n
bn − Yn = X
Y bn − Xn (19)
I This (Equation (19)) shows that the quantization error
between Xn and its reproduction Xbn is the same as the
quantization error between the input and the output of the
quantizer.
I However, the range of variations of Yn is usually much smaller
than that of Xn ;
I Therefore, Yn can be quantized with fewer bits.
I
I
I
I
I
I
I
I
I
PCM: Example 1
I The audio signal bandwidth is about 15 KHz.
I However, for speech, subjective tests show that signal
articulation (intelligibility) is not affected if all the
components above 3400 Hz are suppressed4 .
I Since the objective in telephone communication is
intelligibility rather than high fidelity5 , the components above
3400 Hz are eliminated by low-pass filter.
4
Components below 300 Hz may also suppressed without affecting the
articulation
5
high fidelity = hi fi systems. Equipment for playing recorded music that
produces high quality stereo sound.
I The resulting signal is then sampled at 8000 samples per
second (8 KHz).
I This rate is intentionally kept higher than the Nyquist rate of
6.8 KHz.
I So that realizable filters can be applied for signal
reconstruction.
I Each sample is finally quantized into 256 levels (L = 256),
which requires a group of eight binary pulses to encode each
sample (28 = 256).
I Thus, a telephone signal requires 8 × 8000 = 64, 000 binary
samples per second.
PCM: Compact Disc
I The compact disc (CD) is a more recent application of PCM.
I This is a high-fidelity situation requiring the audio signal
bandwidth to be 20 KHz.
I Although the Nyquist sampling rate is only 40 KHz, the
actual sampling rate of 44.1 KHz is used for the reason
mentioned earlier.
I The signal is quantized into a rather large numver
(L = 65536) of quantization levels, each of which is
represented by 16 bits to reduce the quantizing error.
I The binary-coded samples (1.4 million bits/s) are then
recorded on the compact disc.
I