Lecture 11: Pulse Code Modulation

advertisement
Pulse Code Modulation
ES442 – Spring 2016
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.
Reading: Lathi & Ding; Section 6.2.1 on pages 321 and 322.
2
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 range of digital steps.
Four-bit coding
(16 levels)
3












Sample
Analog
Signal
Sampling
Analog signal
is continuous
in time &
amplitude
selects the
data points
we use to
create the
digital data
time



time
amplitude
time
amplitude
amplitude
Analog to Digital Conversion Process




Quantize
Encode
Captured
Quantized
Sampled Data
Sampled
Values
Data
Quantizing
Discrete
time values:
few amplitudes
from analog
signal
chooses the
amplitude
values used
to encode
Now have
discrete
Values in
both time &
amplitude
0100101101011001
1110101010101000
0100011000100011
0101001111010101
1110110111010001
Digital
Signal
Encoding
assigns binary
numbers to
those
amplitude
values
Now have the
digital
data which
is the final
result
Note: “Discrete time” corresponds to the timing of the sampling.
4
Second Step – Quantization I
The process of assigning quantization levels
= 
16 levels – 4 bits
5
Natural Binary Pulse Code (Example)
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
Figure 1.5 (page 8) of
Lathi & Ding
6
Second Step – 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
 
kth
2 mp
L
The
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
m(kTS) = kth quantized sample’s value.
Then the quantization error q(kTS) is equal to m(kTS) - m(kTS)
Section 6.2.2 on Quantizing evaluates the parameter q(t).
7
Error Generated by Quantization

Quantization fluctuation or noise
8
Second Step – Quantization III
The quantized levels are separated by  
2 mp
L
The maximum error for any sample point’s quantized value is at most ½.
It is shown in Lathi and Ding that the “time average” mean square error
from quantization is
2
2
m




p
q2  2 
3L
12
Let Nq equal q2. Nq is proportional to the fluctuation of the error signal.
This is sometimes quantization noise.
This means that m(t) = m(t) + q(t)
The signal (message) power S0 is proportional to the square of m(t), thus
S0  m2 (t )
9
Second Step – 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).
 2 
S0
m 2 (t )
2 m (t )

 3L 

This is given by the ratio
 mp2 
N q  mp2



 2L2 


Conclusion:
To keep the quantization error small relative to the message signal level,
use smaller quantization steps .
10
The Dilemma of Strong Signals versus Weak Signals
Strong Signal
(a) Linear encoding
Weak Signal
(b) With non-linear encoding
Note different encoding levels on each side.
11
Use Compression and Expansion → Companding
Compression
(m)
Restoration
m(t)
m(t)
m(t)
http://www.slideshare.net/91pratham/unit-ipcmvsh
12
Companding Laws
-Law Companding (North America)
Output (y/ymax)
Output (y/ymax)
A-Law Companding (Europe)
Input (m/mp)
Input (m/mp)
y
 m
A


1  log e A  mp 
y

 Am 
A
 1  log e 

 mp  
1  log e A 


for 0 
m 1

mp A
for
1 m

1
A mp

m
1
y
log e  1 



log e (1   )
m
p 

for 0 
m
1
mp
Lathi & Ding
Section 6.2.3
pp. 325-328
13
For Flattening the S/N Ratio Using the -Law
For optimal S/N ratio in North America  = 255 is used.
An approximately constant S/N ratio is the most desirable.
 S0

 Nq





Lathi & Ding
Figure 6.18
p. 328
(8 bits)
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 6.2 (Lathi & Ding, page 329)
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
2
L 100
 L  200
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 6.2 Continued (Lathi & Ding, page 329)
Solution (continued):
Having chosen n = 8 to guarantee 0.5% error, to find the bandwidth required
we note that
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 on a single line (known as a T1 Line in the
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:
 m 2 (t )  2
S0
 3
L
 mp2 
Nq


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
 m 2 (t )  2 n
S0
 3
2
 mp2 
Nq


Using the expression for bandwidth, BT = nB, then we arrive at
 m2 (t )  2 BT /B
S0
 3
2
2 


Nq
 mp 
Taking the logarithm gives
 S0

 Nq


 S0
  10 log 10 

 Nq
dB

  m 2 (t )  

  2n log 10  2     6n  dB
  10 log 10  3 
2 



  mp  

18
SNR Example
Given a full 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):
Setting mmax = Am
Am2
Pave 
2
and set mmax  Am
 m2 (t )  2 n  3Pave  2 n  3  2 n
S0
 3
 (2)   2  (2)    (2)
 mp2 
Nq
2
 mmax 


 S0
10 log 10 
 Nq


   1.76  6n  dB


L
n
SNR
32
5
31.8 dB
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
Lathi & Ding
Figure 6.20
p. 333
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)
T1 – 24 channels
2.048 Mbits/s (E1)
32 user channels
Second-level
6.312 Mbits/s (DS-2)
T2 – 96 channels
8.448 Mbits/s (E2)
128 channels
Third-level
44.736 Mbits/s (DS3)
T3 – 672 channels
34.368 Mbits/s (E3)
512 channels
Fourth-level
274.176 Mbits/s (DS4)
T4 – 4032 channels
139.264 Mbits/s (E4)
2048 channels
Fifth-level
400.352 Mbits/s (DS5)
T5 – 5760 channels
565.148 Mbits/s (E5)
8192 channels
22
Worked Example for PCM
We are given a signal m(t) = 2cos(2250 t) as the 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.625  10-2 volt. (See slide 16)
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

 98, 304


   12
 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.
3, 981 
2mp
 2

4
4
2
;



 0.001005 and   0.0317 volt
2

3981
Therefore, we can determine the number of levels L, and then n.
L
2mp


4
 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. How can we improve this?
Suppose we have slowly varying signal m(t), then we can exploit this by
using the difference in two adjacent samples. This will form the basis of
differential pulse code modulation (DPCM).
Let m[k] be the kth sample of signal m(t).
Then we can express the difference between adjacent samples as
d[k] = m[k] – m[k-1]
Instead of transmitting m[k], we instead transmit d[k].
Lathi & Ding, Section 6.5, pp. 341-344
25
Differential Pulse Code Modulation (continued)
At the receiver knowing d[k] and previous values m[k] allows us to
reconstruct 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.
In addition, we make use of the estimate of m[k], denoted by m[k].
We use previous sample values of m(t) to make this estimate.
Suppose m[k] is the estimate of the kth sample, then the difference d[k]
is given by
d[k] = m[k] –m[k]
and it is the difference d[k] that is transmitted.
Lathi & Ding, Section 6.5, pp. 341-344
26
Differential Pulse Code Modulation (continued)
At the receiver we determine the estimate m[k] from previous sample
values, and then generate m[k] by adding the received d[k] values to the
estimate m[k]. Thus the reconstruction of the samples is done iteratively.
Lathi & Ding, Section 6.5, pp. 341-344
27
Digression: How To Do Signal Prediction
Starting with a Taylor series,
dm(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.
In handling the derivatives, we write
Thus,
m( kTS )  m( kTS  TS )
d
 m( kTS ) 
dt
TS
 m[ k ]  m[ k  1] 
m[ k  1]  m[ k ]  TS 

T
S


m[ k  1]  2m[ k ]  m[ k  1]
So we get an approximation of the (k+1)th sample, m[k+1], from the two
prior samples.
28
Signal Prediction (continued)
But we can do better than this. In general,
m[ k ]  a1m[ k  1]  a2 m[ k  2]  . . .  aN m[ k  N ]  m[ k ]
The set of {ai} are the prediction 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 m[k].
For first-order prediction, m[k] = m[k-1] .
The next slide shows how to implement this prediction of m[k].
29
Linear Predictor Implemented With Transversal Filter
m[ k ]  a1m[ k  1]  a2 m[ k  2]  . . .  aN m[ k  N ]
Input
m[k]
Delay
TS
Delay
TS
a1
Delay
TS
a2
...
Delay
TS
a3
Delay
TS
Lathi & Ding
Figure 6.27
p. 343
aN

Output m[k]
Transversal filter is a tapped delay line (with required weights {ai} )
30
DPCM Transmitter
Input
m[k]
Lathi & Ding
Figure 6.28(a)
p. 344
+

Output
dq[k]
d[k]
Quantizer
+
mq[k]
+

Predictor
mq[k]
d[ k ]  m[ k ]  mq [ k ] and is quantized to yield,
dq [ k ]  d[ k ]  q[ k ] where q[ k ] is the quantization error
The predictor output m[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
dq[k]
Lathi & Ding
Figure 6.28(a)
p. 344
+
Output
mq[k]

+
mq[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 – an example
is that the AT&T telephone system can sometimes operate at 32 kbits/s
(or even 24 kbits/s) when using DPCM. [The telephone system was initially
designed to use a 64 kbits/s 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
 which minimizes dq[k]. When
dq[k] fluctuates around large positive
or negative values, the prediction
error is large and  needs to
increase, but when dq[k] fluctuates
around zero (small values), then 
needs to decrease.
m[k]
+

Adaptive
Quantizer
dq[k]
To
Channel
nth order
Predictor
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
Download