+ All Categories
Home > Documents > Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally...

Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally...

Date post: 09-Dec-2018
Category:
Upload: dinhdat
View: 242 times
Download: 2 times
Share this document with a friend
36
Pulse Code Modulation EE 442 – Spring Semester Lecture 9 1 Analog signal Pulse Amplitude Modulation Pulse Width Modulation Pulse Position Modulation Pulse Code Modulation (3-bit coding)
Transcript
Page 1: Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally represent sampled analog signals. It is the standard form of digital audio in computers,

Pulse Code ModulationEE 442 – Spring Semester

Lecture 9

1

Analog signal

Pulse Amplitude Modulation

Pulse Width Modulation

Pulse Position Modulation

Pulse Code Modulation(3-bit coding)

Page 2: Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally represent sampled analog signals. It is the standard form of digital audio in computers,

2

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.

Advantages of Digital Over Analog For Communications

Page 3: Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally represent sampled analog signals. It is the standard form of digital audio in computers,

Analog to Digital Conversion Process (ADC)

3

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

Sample Quantize EncodeAnalogSignal Captured

Sampled DataValues

QuantizedSampled

Data

DigitalSignal

Analog signal is continuous

in time & amplitude

Discretetime values:

few amplitudesfrom analog

signal

Now havediscreteValues in

both time &amplitude

Now have thedigital

data whichis the final

result

Samplingselects the data pointswe use tocreate the

digital data

Quantizingchooses theamplitude

values usedto encode

Encodingassigns binary

numbers tothose

amplitudevalues

time

amp

litu

de

01001011010110011110101010101000010001100010001101010011110101011110110111010001

time

amp

litu

de

• • •

••

••

timeamp

litu

de

Three Step Process

Page 4: Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally represent sampled analog signals. It is the standard form of digital audio in computers,

4

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)

Page 5: Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally represent sampled analog signals. It is the standard form of digital audio in computers,

5

Second Step – Quantization I

Quantization is the process of changing a continuous-amplitudesignal into on with discrete amplitudes.

L = 16 levels 4 bits

=

Quantized samples of mq(t)m(t)

t

= 2 pm

L

pm

pm

Allo

wed

qu

anti

zati

on

leve

ls

Maximum value = |mp|

Page 6: Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally represent sampled analog signals. It is the standard form of digital audio in computers,

Four-Bit Binary Pulse Code (Example)

6

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

Table 5.1 on page 249

Page 7: Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally represent sampled analog signals. It is the standard form of digital audio in computers,

7

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

The kth sample point of m(t) is designated as m(kTS) and is assigned a valueequal to the midpoint between two adjacent levels. Define:

m(kTS) = kth sample’s value, andmq(kTS) = kth quantized sample’s value.

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

2 pm

L

Page 8: Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally represent sampled analog signals. It is the standard form of digital audio in computers,

8

Error Generated by Quantization (Quantization Noise)

Quantization fluctuation or “noise”

Quantization noise ( ) ( ) ( )qq t m t m t

Page 9: Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally represent sampled analog signals. It is the standard form of digital audio in computers,

9

Quantization III

The quantized levels are separated by

The maximum error for any sample point’s quantized value is at most ½.

The “time average” mean-square quantization error is

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

2 pm

L

22

2

23 12

pmq

L

2

2 20 0( ) , but if ( ) is sinusoidal,

2

pmS m t m t S

Note: denotes time average

Page 10: Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally represent sampled analog signals. It is the standard form of digital audio in computers,

10

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 errorNq due to quantization).

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

It is usually expressed in decibels,

2 2

2022

2

( ) ( )3

3q pp

m t m tSSQNR L

N mm

L

Conclusion:

To reduce the quantization error relative to the message signal level, usesmaller quantization steps .

20

10 10

310 log 10 log

2dB

q

S LSQNR

N

2

2

( ) 1Note:

2p

m t

m

Page 11: Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally represent sampled analog signals. It is the standard form of digital audio in computers,

11

The Dilemma of Strong Signals versus Weak Signals

Strong Signal Weak Signal

Note different encoding levels on each side.

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

Companding

Page 12: Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally represent sampled analog signals. It is the standard form of digital audio in computers,

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

Use Compression and Expansion → Companding

RestorationCompression

m(t) m(t)m(t)(m)

Page 13: Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally represent sampled analog signals. It is the standard form of digital audio in computers,

13

Companding Laws

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

1log 1 0 1

log (1 )e

e p p

m my for

m m

10

1 log

11 log 1

1 log

e p p

e

e p p

A m my for

A m m A

AmA my for

A m A m

Input (m/mp)Input (m/mp)

Ou

tpu

t (

y/y m

ax)

Ou

tpu

t (

y/y m

ax)

Page 14: Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally represent sampled analog signals. It is the standard form of digital audio in computers,

14

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.

(8 bits)

0

q

S

N

Relative signal power S0 (dB)

Page 15: Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally represent sampled analog signals. It is the standard form of digital audio in computers,

15

Transmission Bandwidth

In binary PCM, we have a group of n bits corresponding to L levels with nbits. 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 bea little higher than the minimum bandwidth required.

Page 16: Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally represent sampled analog signals. It is the standard form of digital audio in computers,

16

Example

Problem: A band-limited signal m(t) of 3 kHz bandwidth is sampled at rate of33⅓ % 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 thechannel 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

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.

0.5200

2 100

p

p

mm L

L

Page 17: Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally represent sampled analog signals. It is the standard form of digital audio in computers,

17

Example Continued

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

Total number of bits per second = 8 bits 8000 Hz

= 64,000 bits/second

C

However, we know we can transmit 2 bits/Hz of bandwidth¶, so it requires abandwidth 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 theBell 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.

Page 18: Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally represent sampled analog signals. It is the standard form of digital audio in computers,

18

Exponential Increase of the Output SNR (S/N Ratio)

2

02

2( )3 2

q p

nS m t

N m

2

202

( )3

q p

m tSL

N m

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

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

Using the expression for bandwidth, BT = nB, then we arrive at

Taking the logarithm gives

2

02

2 /( )3 2 T

q p

B Bm tS

N m

2

0 010 10 102

( )10 log 10 log 3 10 2 log 2 6 dB

q q pdB

m tS Sn n

N N m

denotes time average

Page 19: Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally represent sampled analog signals. It is the standard form of digital audio in computers,

19

SNR Example

Given a sinusoidal modulating signal m(t) of amplitude Am into aload resistance R = 1 ohm, find the signal-to-quantization noise ratio(sometimes called SNR):

Setting mmax = Am

2

maxand set2m

ave m

AP m A

2

02 2

max

2 2 2( ) 3 33 (2) (2) (2)

2ave

q p

n n nm tS P

N m m

01010 log 1.76 6 dB

q

Sn

N

L n SNR

32 5 31.8 dB

64 6 37.8 dB

128 7 43.8 dB

256 8 49.8 dB

Page 20: Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally represent sampled analog signals. It is the standard form of digital audio in computers,

20

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.

1.544 Mbit/s data rates

193 bit frame – 122 sec/frame

Page 21: Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally represent sampled analog signals. It is the standard form of digital audio in computers,

21

T1 Carrier – Time Division Multiplexing

Page 22: Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally represent sampled analog signals. It is the standard form of digital audio in computers,

22

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

Page 23: Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally represent sampled analog signals. It is the standard form of digital audio in computers,

23

Worked PCM Example

We are given a signal m(t) = 2cos(2250 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. Thetotal 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, theSNR is given by

22 2

10

2 2412 98,304

(1.5625 10 )

10 log 98,304 49.93 dB

ave

q q

dB

PS

N N

SNR

Page 24: Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally represent sampled analog signals. It is the standard form of digital audio in computers,

24

Worked Example for PCM (continued)

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

(b) If the minimum SNR is to be at least 36 dB, how many bits n are neededto encode the signal (i.e., find n)? Other parameters such as signal power remainthe 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.

Therefore, we can determine the number of levels L and then find n.

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

2

2 2

2 4 43,981 ; 0.001005 and 0.0317 volt

3981

pm

2 431.5

0.0317

pmL

Page 25: Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally represent sampled analog signals. It is the standard form of digital audio in computers,

25

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].

Page 26: Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally represent sampled analog signals. It is the standard form of digital audio in computers,

26

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.

Page 27: Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally represent sampled analog signals. It is the standard form of digital audio in computers,

27

Differential Pulse Code Modulation (continued)

Receiver Concept:

At the receiver we determine the estimate mest[k] from previous samplevalues, 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?

Page 28: Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally represent sampled analog signals. It is the standard form of digital audio in computers,

28

Digression on Signal Prediction

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

2 2 3 3

2 3

( ( )) ( ( )) ( ( ))[ ] ( ) ...

2! 3!( )

[ ] ( ) for small

S SS S

S S S

d m t T d m t T d m tm t T m t T

dt dt dtdm t

m t T m t T Tdt

We denote the kth sample of m(t) by m[k], that is, m[kTS] = m[k], andm[kTS TS] = m[k 1], and so on. This is a first-order predictor.

In handling the derivatives, we write

Thus,

So we get an approximation of the (k+1)th sample, m[k+1], from the twoprior samples, namely m[k] and m[k-1].

( ) ( )

( ) S S SS

S

m kT m kT Tdm kT

dt T

[ ] [ 1][ 1] [ ]

[ 1] 2 [ ] [ 1]

S

S

m k m km k m k T

T

m k m k m k

Page 29: Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally represent sampled analog signals. It is the standard form of digital audio in computers,

29

Signal Prediction (continued)

But we can do even better than this. In general,

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].

1 2[ ] [ 1] [ 2] . . . [ ] [ ]N qm k a m k a m k a m k N m k

Page 30: Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally represent sampled analog signals. It is the standard form of digital audio in computers,

30

Linear Predictor Implemented With Transversal Filter

DelayTS

DelayTS

DelayTS

a1

Inputm[k]

a2 a3

DelayTS

. . . DelayTS

aN

Output mest[k]

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

1 2[ ] [ 1] [ 2] . . . [ ]est Nm k a m k a m k a m k N

Page 31: Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally represent sampled analog signals. It is the standard form of digital audio in computers,

31

DPCM Transmitter

[ ] [ ] [ ] and is quantized to yield,

[ ] [ ] [ ] where [ ] is the quantization errorest

q

d k m k m k

d k d k q k q k

The predictor output mest[k] is fed back to the input so the predictor inputmq[k] is given by

[ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]q q q qm k m k d k m k d k d k m k q k

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

Quantizer

Predictor

Inputm[k]

mq[k]

+

+

+

mest[k]

d[k]Outputdq[k]

Page 32: Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally represent sampled analog signals. It is the standard form of digital audio in computers,

32

DPCM Receiver

Predictor

Inputdq[k]

+

mest[k]

Outputmq[k]

+

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 quantizationnoise, q[k]. It is important to note that from the difference signal d[k] ismuch smaller that the noise associated with m[k].

Page 33: Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally represent sampled analog signals. It is the standard form of digital audio in computers,

33

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) andd(t), respectively. Assuming the same number of steps L for both, thenthe quantization step in DPCM is reduced in magnitude by dp/mp.

The quantization noise is proportional to ()2 – the quantization noisepower 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 initiallydesigned to use a 64 kbits/second data rate.]

Page 34: Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally represent sampled analog signals. It is the standard form of digital audio in computers,

34

Adaptive Differential PCM

Adaptive differential PCM (ADPCM) can further improve upon DPCM byIncorporating an adaptive quantizer (variable ) at encoding.

The quantized prediction error dq[k]is a good measure of the predictederror size – it can be used to change which minimizes dq[k]. When dq[k] fluctuates around large positiveor negative values, the prediction error is large and needs to increase, but when dq[k] fluctuates 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 bandwidthby one-half with no loss in quality.

AdaptiveQuantizer

nth orderPredictor

+

m[k]

To Channel

dq[k]

Page 35: Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally represent sampled analog signals. It is the standard form of digital audio in computers,

35

Adaptive Differential PCM Output Example

time

Page 36: Pulse Code Modulation - web.sonoma.edu · Pulse-code modulation (PCM) is used to digitally represent sampled analog signals. It is the standard form of digital audio in computers,

36

Next Topic is Delta Modulation


Recommended