You are on page 1of 36

Pulse Code Modulation

EE 442 – Spring Semester


Lecture 9

Analog signal

Pulse Amplitude Modulation

Pulse Width Modulation

Pulse Position Modulation


Pulse Code Modulation
(3-bit coding)

1
Advantages of Digital Over Analog For Communications

1. Digital is more robust than analog to noise and interference†


2. Digital is more viable to using regenerative repeaters
3. Digital hardware more flexible by using microprocessors and VLSI
4. Can be coded to yield extremely low error rates with error correction
5. Easier to multiplex several digital signals than analog signals
6. Digital is more efficient in trading off SNR for bandwidth
7. Digital signals are easily encrypted for security purposes
8. Digital signal storage is easier, cheaper and more efficient
9. Reproduction of digital data is more reliable without deterioration
10. Cost is coming down in digital systems faster than in analog systems
and DSP algorithms are growing in power and flexibility
† Analog signals vary continuously and their value is affected by all levels of noise.

2
Analog to Digital Conversion Process (ADC)
Three Step Process

amplitude

amplitude

amplitude
•• • •
0100101101011001
time • time 1110101010101000
time
• 0100011000100011
• •
• • 0101001111010101
• •
•• • 1110110111010001

 ❖ 
Sample Quantize Encode
Analog Digital
Signal Captured Quantized Signal
Sampled Data Sampled
Sampling Values Quantizing Data Encoding
selects the chooses the assigns binary
data points amplitude numbers to
we use to Discrete values used Now have those Now have the
Analog signal create the time values: to encode discrete amplitude digital
is continuous digital data few amplitudes Values in values data which
in time & from analog both time & is the final
amplitude signal amplitude result

Note: “Discrete time” corresponds to the timing of the sampling.

3
Next Topic – Pulse Code Modulation
Pulse-code modulation (PCM) is used to digitally represent
sampled analog signals. It is the standard form of digital audio
in computers, CDs, digital telephony and other digital audio
applications. The amplitude of the analog signal is sampled at
uniform intervals and each sample is quantized to its nearest
value within a predetermined range of digital levels.

Four-bit coding
(16 discrete levels)

4
Second Step – Quantization I
Quantization is the process of changing a continuous-amplitude
signal into on with discrete amplitudes.
mp
m(t) Quantized samples of mq(t)
Allowed quantization levels

2m p
==

L

m p L = 16 levels  4 bits

Maximum value = |mp|


5
Four-Bit Binary Pulse Code (Example)

Table 5.1 on page 249

To communicate
sampled values, we
send a sequence of bits
that represents the
quantized value.
For 16 quantization levels,
4 bits are required.
PCM can use a
binary
representation of
value.
The PSTN uses PCM

6
Quantization II

We start with a sampled signal {call it m(t)} and now we want to quantize it.

The quantized amplitude is limited to a range, say from –mp to +mp.


(Note: the range of m(t) may extend beyond (-mp, mp) in some cases.)

Divide the range (-mp, mp) into L uniformly spaced intervals. The number
intervals is L and the separation between quantized levels is
2 mp

L
The kth sample point of m(t) is designated as m(kTS) and is assigned a value
equal to the midpoint between two adjacent levels. Define:

m(kTS) = kth sample’s value, and


mq(kTS) = kth quantized sample’s value.

Then the quantization error q(kTS) is equal to mq(kTS) - m(kTS)

7
Error Generated by Quantization (Quantization Noise)
Quantization noise q(t )  m(t )  mq (t )



Quantization fluctuation or “noise”


8
Quantization III
2 mp
The quantized levels are separated by 
L
The maximum error for any sample point’s quantized value is at most ½.

The “time average” mean-square quantization error is


 
2
mp2
q2  
3L2 12
Let Nq = q2. Thus Nq is proportional to the fluctuation of the error signal.
This is usually called quantization noise.

We know that m(t) = mq(t) + q(t)

The signal (or message) power S0 is proportional to the square of m(t), thus

mp2
S0   2  m2 (t ) , but if m(t ) is sinusoidal, S0 
2
Note: denotes time average
9
Quantization IV

We want a measure of the quality of received signal (that is, the ratio of
the strength of the received signal S0 relative to the strength of the error
Nq due to quantization).

This is the Signal-to-Quantization Noise Ratio (SQNR) and is given by


S0 m 2 (t )  m 2 (t ) 
SQNR    3L2  
N q  mp 2
  mp 
2

 3L2   
  2
 m (t )  1
It is usually expressed in decibels, Note:  
 mp2  2
 

 S0   3L2 
SQNRdB  10  log 10    10  log 10  
 Nq   2 
 

Conclusion:
To reduce the quantization error relative to the message signal level, use
smaller quantization steps .
10
The Dilemma of Strong Signals versus Weak Signals

Strong Signal Weak Signal

(a) Linear encoding (b) With non-linear encoding


Companding
Note different encoding levels on each side.

11
Use Compression and Expansion → Companding

Compression Restoration
(m) m(t)
m(t) m(t)

http://www.slideshare.net/91pratham/unit-ipcmvsh 12
Companding Laws

A-Law Companding (Europe) -Law Companding (North America)


Output (y/ymax)

Output (y/ymax)
Input (m/mp) Input (m/mp)

A  m m 1
y   for 0   1  m m
1  log e A  mp  mp A y log e  1   for 0  1
log e (1   )  m  mp
A   Am  1 m  p 
y  1  log e   for  1
1  log e A   mp   A mp
 

13
Flattening of the S/N Ratio Using the -Law

For optimal S0/Nq ratio in North America  = 255 is used.


An approximately constant S0/Nq ratio is the most desirable.

 S0 
 
 Nq 
 
(8 bits)

Relative signal power S0 (dB)

14
Transmission Bandwidth

In binary PCM, we have a group of n bits corresponding to L levels with n


bits. Thus,
L = 2n or n = log2(L)
Signal m(t) is band-limited to B Hz which requires 2B samples per second.

For 2nB elements of information, we must transfer 2nB bits/second. Thus,


the minimum bandwidth BT needed to transmit 2nB bits/second is

BT = nB Hz

Practically speaking, usually we choose the transmission bandwidth to be


a little higher than the minimum bandwidth required.

15
Example

Problem: A band-limited signal m(t) of 3 kHz bandwidth is sampled at rate of


33⅓ % higher than the Nyquist rate. The maximum allowable error in the
sample amplitude (i.e., the maximum quantization error) is 0.5% of the peak
amplitude mp. Assume binary encoding. Find the minimum bandwidth of the
channel to transmit the encoded binary signal.

Solution:
The Nyquist rate is RN = 2 x 3000 Hz = 6000 Hz (samples/second), but the actual
rate is 33⅓ % higher, so that is 6000 Hz + (⅓ x 6000) = 8000 Hz.

The quantization step is  and the maximum quantization error is plus/minus


/2. Hence, we can write
 mp 0.5
  mp  L  200
2 L 100
For binary coding, L, must be a power of two; therefore, knowing that L = 27 =
128 and 28 = 256, we must choose n = 8 to guarantee better than a 0.5% error.

16
Example Continued

Solution (continued):
Having chosen n = 8 to guarantee < 0.5% error, to find the bandwidth required
we start with

Total number of bits per second C = 8 bits  8000 Hz


= 64,000 bits/second

However, we know we can transmit 2 bits/Hz of bandwidth¶, so it requires a


bandwidth BT of
BT = C/2 = 32,000 Hz = 32 kHz

If 24 such signals are multiplexed onto a single line (known as a T1 Line in the
Bell telephone system), then

CT1 = 24 x 64 kb/s = 1.536 Mb/s, and the bandwidth is 768 kHz 


A maximum of 2B independent elements of information per second can be
transmitted, error-free, over a noiseless channel of bandwidth B Hz.
17
Exponential Increase of the Output SNR (S/N Ratio)

We start with the SNR (signal-to-noise ratio) equation from slide 10 above:

S0  m 2 (t ) 
 3  L2 denotes time average
Nq  mp2 
 
The number of levels L can be expressed as L2 = 22n where n = log2(L) and is
the number of bits to generate L levels. The SNR can now be expressed as
S0  m 2 (t )  2 n
 mp2   
 3  2
Nq  
Using the expression for bandwidth, BT = nB, then we arrive at
S0  m 2 (t )  2 B /B
 3 2 T
Nq  mp2 
 
Taking the logarithm gives
 S0   S0    m 2 (t ) 
   10 log 10    10 log 10  3     10  2 n log 10  2     6n  dB
 Nq   Nq    mp2 
  dB     

18
SNR Example

Given a sinusoidal modulating signal m(t) of amplitude Am into a


load resistance R = 1 ohm, find the signal-to-quantization noise ratio
(sometimes called SNR):
Am2
Pave  and set mmax  Am
2
Setting mmax = Am

S0  m 2 (t )   3P  3
 3  (2)2 n   2ave  (2)2 n    (2)2 n
Nq  mp2   mmax  2
 

L n SNR

 S0  32 5 31.8 dB
10  log 10     1.76  6n  dB
 Nq  64 6 37.8 dB
 
128 7 43.8 dB
256 8 49.8 dB

19
Bell System’s T1 Carrier System (1962)

The T-carrier is a member of the group of carrier systems developed by AT&T


Bell Laboratories for digital transmission of multiplexed telephone calls using
Pulse Code Modulation and Time Division Multiplexing.

The first version, the Transmission System 1 (T1), was introduced in 1962 in
the Bell System, and could transmit up to 24 telephone calls simultaneously
over a single transmission line consisting of copper wire.

193 bit frame – 122 sec/frame

1.544 Mbit/s data rates

20
T1 Carrier – Time Division Multiplexing

21
Comparison of T-Carrier (North America) and E-Carrier (Europe)

Carrier Level T-Carrier Data Rates E-Carrier Data Rates


Zero-level 64 kbits/s (DS-0) 64 kbits/s

First-level 1.544 Mbits/s (DS-1) 2.048 Mbits/s (E1)


T1 – 24 channels 32 user channels
Second-level 6.312 Mbits/s (DS-2) 8.448 Mbits/s (E2)
T2 – 96 channels 128 channels
Third-level 44.736 Mbits/s (DS3) 34.368 Mbits/s (E3)
T3 – 672 channels 512 channels
Fourth-level 274.176 Mbits/s (DS4) 139.264 Mbits/s (E4)
T4 – 4032 channels 2048 channels
Fifth-level 400.352 Mbits/s (DS5) 565.148 Mbits/s (E5)
T5 – 5760 channels 8192 channels

22
Worked PCM Example

We are given a signal m(t) = 2cos(2250 t) as a single-tone signal input.


(a) Find the SNR with 8-bit PCM.
For 8-bit encoding, L = 2n where n = 8, therefore, the number of levels = 256.
The amplitude Am of the sinusoidal waveform means that mp = 2 volts. The
total signal swing possible (- mp to + mp) will be 2mp = 4 volts, therefore,
the average signal power is Pave = [(Am)2/2] = [22/2] = 2 watts. (See slide 19)
The interval  = [2mp/L] = 4 volts/256 levels = 1.5625  10-2 volt. (See slide 19)
Now we can find the SNR (signal-to-quantized noise ratio) (See side 18)

Using for the quantization noise Nq = [2/12], and taking Pave = 2 W, the
SNR is given by
 S   Pave   2   24 
 
    12   98, 304
 N q   N q    2   (1.5625  10 2 )2 
   
SNRdB  10  log 10  98, 304   49.93 dB 

23
Worked Example for PCM (continued)

We are given a signal m(t) = 2cos(2250 t) as the signal input.


(b) If the minimum SNR is to be at least 36 dB, how many bits n are needed
to encode the signal (i.e., find n)? Other parameters such as signal power remain
the same as in part (a) on previous slide.

Note that 36 dB is numerically equivalent to 3,981.


Remembering that the interval is  = [2mp /L] and 2mp = 4 volts.
2 mp 4 4
3, 981   ;  2
  0.001005 and   0.0317 volt
2  2
3981
Therefore, we can determine the number of levels L and then find n.
2 mp 4
L   31.5
 0.0317

The lowest integer number of bits n that will give at least 31.5 levels is n = 5
because 25 = 32 levels. So the answer is 5 bits.

24
Differential Pulse Code Modulation (DPCM)

PCM is not really efficient because it generates so many bits taking up a lot
of bandwidth. Can we improve on this? YES.

Suppose we have a slowly varying signal m(t), then we exploit this by


using the difference between two adjacent samples. This will form the basis
of differential pulse code modulation (DPCM).

Let m[k] be the kth sample reading of signal m(t).

Then we can express the difference between two adjacent samples as

d[k] = m[k] – m[k-1]

Principle: Instead of transmitting m[k], we transmit d[k].

25
Differential Pulse Code Modulation (continued)

At the receiver knowing d[k] and the previous value of m[k-1] allows us to
construct the value of m[k].
How do we benefit from doing this?

The difference of successive samples almost always is much smaller than


the full range of the sample values of m(t) (full range covers -mp to +mp).
We use this fact to improve upon the efficiency of PCM by requiring
fewer bits.

Furthermore, we can make use of the estimate of m[k], denoted by mest[k].


We use previous sample values of m(t) to make this estimate.

Suppose mest[k] is the estimate of the kth sample, then the difference d[k]
is defined by
d[k] = m[k] – mest[k]

and it is the difference d[k] that is transmitted.

26
Differential Pulse Code Modulation (continued)

Receiver Concept:
At the receiver we determine the estimate mest[k] from previous sample
values, and then generate m[k] by adding the received d[k] values to the
estimate mest[k]. Thus the reconstruction of the samples is done
iteratively.

How do we carry out such an estimation?

27
Digression on Signal Prediction

Starting with a Taylor series (with time step Ts),


d(m(t )) TS2 d 2 (m(t )) TS3 d 3 (m(t ))
m[t  TS ]  m(t )  TS    ...
dt 2! dt 2 3! dt 3
dm(t )
m[t  TS ]  m(t )  TS for small TS
dt
We denote the kth sample of m(t) by m[k], that is, m[kTS] = m[k], and
m[kTS  TS] = m[k  1], and so on. This is a first-order predictor.
d m( kTS )  m( kTS  TS )
In handling the derivatives, we write  m( kTS ) 
dt TS
Thus,
 m[ k ]  m[ k  1] 
m[ k  1]  m[ k ]  TS  
 TS 
m[ k  1]  2 m[ k ]  m[ k  1]

So we get an approximation of the (k+1)th sample, m[k+1], from the two


prior samples, namely m[k] and m[k-1].

28
Signal Prediction (continued)
But we can do even better than this. In general,

m[ k ]  a1m[ k  1]  a2 m[ k  2]  . . .  aN m[ k  N ]  mq [ k ]

The set of {ai} are the predictor coefficients.


This is the predicted value of m[k]. It is an Nth order predictor.

Note that the input consists of the weighted previous samples m[k-1],
m[k-2], etc. We say that input m[k] gives output mest[k].

For a first-order prediction, mest[k] = m[k-1].

The next slide shows how to implement this prediction of m[k].

29
Linear Predictor Implemented With Transversal Filter

mest [ k ]  a1m[ k  1]  a2 m[ k  2]  . . .  aN m[ k  N ]

Input
m[k] Delay Delay Delay Delay ... Delay
TS TS TS TS TS

a1 a2 a3 aN

Output mest[k]

Transversal filter is a tapped delay line (with required weights {ai} )

30
DPCM Transmitter
Input Output
m[k] d[k] dq[k]
+
 Quantizer

+
mest[k]
+ 
mq[k]
Predictor

d[ k ]  m[ k ]  mest [ k ] and is quantized to yield,


dq [ k ]  d[ k ]  q[ k ] where q[ k ] is the quantization error

The predictor output mest[k] is fed back to the input so the predictor input
mq[k] is given by
mq [ k ]  mq [ k ]  dq [ k ]  m[ k ]  d[ k ]  dq [ k ]  m[ k ]  q[ k ]

This shows that mq[k] is the quantized version of m[k].

31
DPCM Receiver
Input Output
dq[k] + mq[k]

+
mest[k]
Predictor

The receiver’s output (which is the predictor’s input) is also the same,
mq[k] = m[k] + q[k].

Hence, we are able to receive the desired signal m[k] plus the quantization
noise, q[k]. It is important to note that from the difference signal d[k] is
much smaller that the noise associated with m[k].

32
DPCM SNR Improvement

How much better is DPCM with regard to SNR?

To determine this, define mp and dp as the peak amplitudes of m(t) and


d(t), respectively. Assuming the same number of steps L for both, then
the quantization step  in DPCM is reduced in magnitude by dp/mp.

The quantization noise is proportional to ()2 – the quantization noise


power is reduced by a factor (dp/mp)2 and the SNR is therefore increased by
(mp/dp)2.

Maintaining the same SNR, the number of bits can be reduced.


Example:
The AT&T telephone system sometimes operates at 32 kbits/s
(or even 24 kbits/s) when using DPCM. [The telephone system was initially
designed to use a 64 kbits/second data rate.]

33
Adaptive Differential PCM

Adaptive differential PCM (ADPCM) can further improve upon DPCM by


Incorporating an adaptive quantizer (variable ) at encoding.

The quantized prediction error dq[k]


is a good measure of the predicted
error size – it can be used to change m[k] dq[k]
Adaptive
 which minimizes dq[k]. When dq[k]
+
 Quantizer To
fluctuates around large positive Channel
or negative values, the prediction
error is large and  needs to nth order
increase, but when dq[k] fluctuates Predictor
around zero (small values), then 
needs to decrease.

Example: An 8-bit PCM sequence can be encoded into a 4-bit ADPCM


sequence at the same sampling rate. This reduces the channel bandwidth
by one-half with no loss in quality.

34
Adaptive Differential PCM Output Example

time

35
Next Topic is Delta Modulation

36

You might also like