21
Pulse Coded Modulation (PCM) In this section we will look at the process of converting an analog signal to be digitally transmitted into a digital format. To transmit digitally we only have a discrete set of symbols that can be sent at a fixed rate. Hence before we can send the signal we need to quantize it in time and amplitude. A process of achieving this quantization is PCM. A general criterion is that the digitally modulated transmitted signal can be demodulated and converted back into an analog form with a tolerable amount of distortion. Generally the specification of “tolerable” is very subjective. For example consider voice quality requirements of a wireless phone. Given distortion tolerance, the objective is generally to optimize the encoding such that a minimum bit rate is consumed with the application. Typical structure Analog Signal source sampling Clock 1/T ADC Baseband encoding To baseband modulator 4 Steps Sampling continuous signal in time (discretize in time) Sampling in amplitude (discretize in amplitude) Remove redundancy Encode to match communication channel Topics to cover in this section How is an analog signal sampled (sampling theory) Quantization (ADC implementations, quantization noise) Companders PCM modulators/demodulators Differential PCM Delta modulation PCM partA.doc 1

Pulse Coded Modulation (PCM)

Embed Size (px)

Citation preview

Page 1: Pulse Coded Modulation (PCM)

Pulse Coded Modulation (PCM) In this section we will look at the process of converting an analog signal to be digitally transmitted into a digital format. To transmit digitally we only have a discrete set of symbols that can be sent at a fixed rate. Hence before we can send the signal we need to quantize it in time and amplitude. A process of achieving this quantization is PCM. A general criterion is that the digitally modulated transmitted signal can be demodulated and converted back into an analog form with a tolerable amount of distortion. Generally the specification of “tolerable” is very subjective. For example consider voice quality requirements of a wireless phone. Given distortion tolerance, the objective is generally to optimize the encoding such that a minimum bit rate is consumed with the application. Typical structure

Analog Signal source

sampling

Clock 1/T

ADC Basebandencoding

To baseband modulator

4 Steps

• Sampling continuous signal in time (discretize in time) • Sampling in amplitude (discretize in amplitude) • Remove redundancy • Encode to match communication channel

Topics to cover in this section

• How is an analog signal sampled (sampling theory) • Quantization (ADC implementations, quantization noise) • Companders • PCM modulators/demodulators • Differential PCM • Delta modulation

PCM partA.doc 1

Page 2: Pulse Coded Modulation (PCM)

Sampling Theory and implementation of sampling device Basic question – given an analog signal x(t), take samples of x(nTs) at regular intervals of Ts resulting in Xs. How can x(t) be reconstructed from this vector of samples Xs? What are the conditions for sampling? How can we quantify the distortion? If x(t) is bandlimited, then in an abstract sense it will only have a countable number of degrees of freedom. If the number of samples of x(t) were taken to equal the number of degrees of freedom then x(t) is completely characterized by the set of samples. Example of a sinusoidal signal If we are told that x(t) is a pure sinusoidal signal then there are three degrees of freedom remaining to totally characterize x(t) namely, amplitude, frequency and phase offset. I could take three samples of x(t) and synthesize x(t) for all t from this. Example of a band limited signal Another example would be band-limited signal segment with a two sided bandwidth of B and a time duration of T. (In a strict sense, a signal cannot both be time and band limited and hence this assertion can only be approximately true)

-B/2 0 B/2 f

As will be derived, such a signal has BT degrees of freedom. Hence a sample size of BT is required to totally characterize such a signal. If we want to achieve a certain SNR in the reconstruction of the sampled signal then we will have N bits required per sample. Hence the signal pulse consumes NBT bits of information. This can be reduced by considering the structural redundancy of the signal.

PCM partA.doc 2

Page 3: Pulse Coded Modulation (PCM)

Vocoder for telecommunication application Voice has structure (redundancy) such that BT samples would not be required. A generic vocoder structure used in wireless applications has the following structure

20 msec epoch of a voice signal

White Noise generator

Programmable linear filter

Compare sound perception

Parameter adjust

Output parameter set for this 20 msec segment of voice

P

The set of parameters is transmitted and used in the receiver the synthesize the voice. Hence the size of the parameter vector is commensurate with the degrees of freedom of the 20 msec segment of voice signal. Actually the size of P is smaller than the DOF of the signal and the eventual synthesized output will be somewhat distorted. The object is to dispense with parameters that the human hearing is not particularly sensitive to. Example of a picture – bitmapping contains significant redundancy. Can be compressed without loosing quality. Sampling Process (Haykin 3.2) Consider g(t) as the input signal that we want to sample at a rate of 1/Ts. That is we want an array of samples [g(0),g(Ts), g(2Ts),g(3Ts),…] Consider the circuit to generate a single sample approximately equal to g(0)given below:

PCM partA.doc 3

Page 4: Pulse Coded Modulation (PCM)

g(t) X

-Ta/2 0 Ta/2 t

1/Ta

integration over time

ADC approximation of g(0)

The operation is summarized as

)0()(1 2/

2/

gdttgT

quana

a

T

Ta

where quan() denotes the quantization operation of the ADC. Clearly the narrower the sampling pulse the more accurate the output estimate of g(0). More accurately, the smaller TaB is where B is the bandwidth of g(t), the more accurate the sample. In the limiting case,T the sampling pulse approaches a dirac delta function δ(t). 0→a

Mathematically, assuming this ideal sampling, the sampling waveform for the uniform sampling rate of 1/Ts is denoted as s(t) and given as

∑∞

−∞=

−=n

snTtts )()( δ

At the output of the multiplier of then the ideal sampled version of g(t) is given as

∑∑∞

−∞=

−∞=

−=−==n

ssn

s nTtnTgnTttgtstgtg )()()()()()()( δδδ

where the second step takes into consideration that the delta function is zero everywhere except at nTs.

PCM partA.doc 4

Page 5: Pulse Coded Modulation (PCM)

0 1 2 3 4 5 6 t/Ts

g(t)

g(nTs)δ(t-nTs)

To describe the sampling process we will consider the product waveform of

)()()( tstgtg =δ As s(t) is a periodic waveform we will use the periodic version of the Fourier transform as

∑∞

−∞=

=n

Tntj sencts /2)()( π

where the coefficients are

s

T

T

Tntj

s Tdtet

Tnc

s

s

s1)(1)(

2/

2/

/2∫−

− == πδ

and the spectrum of s(t) denoted as S(f) is given as

∑∞

−∞=

−=m

ss

TmfT

fS )/(1)( δ

As multiplication in the time domain is equivalent to convolution in the frequency domain we can consider the sampling process from the frequency domain as:

∑∞

−∞=

−=⊗=m

ss mffGffSfGfG )()()()(δ

PCM partA.doc 5

Page 6: Pulse Coded Modulation (PCM)

where

ss T

f 1=

The spectrums for G(f) and Gδ(f) are pictured below:

Gδ(f)

G(f)

-W 0 W f

- 3W - 2W -W 0 W 2W 3W f

G(0)

fsG(0)

To reconstruct G(f) from Gδ(f) all that is needed is a reconstruction filter, Hr(f) which passes only the first lobe from –W<f<W.

-W 0 W f

1/2W

Hr(f)

that is

=

Wfrect

WfH r 22

1)(

where the normalization of 1/2W is due to

PCM partA.doc 6

Page 7: Pulse Coded Modulation (PCM)

WT

ncs

21)( ==

The output of the reconstruction filter, denoted by gr(t) is given as

∫∫∞

∞−

∞−

=== )()()(21)( 22 tgdfefGdfefGW

tg ftjftjr

ππδ

In summary, under the conditions:

1) G(f) = 0 for |f|>W 2) fs=2W

G(f) can be recovered exactly from Gδ(f) with an ideal LPF, Hr(f), as shown. Reconstruction from the time domain perspective

∑∞

−∞=

−=n

ss nTtnTgtg )()()( δδ

Let output reconstructed signal be gr(t) such that

)()()( thtgtg rr ⊗= δ where hr(t) is the impulse response of the reconstruction filter Hr(f).

)2(sin)(22

1)( tWcthWfrect

WfH rr =⇔

=

Consequently

( )∫∞

∞−

−= λλλδ dtWcgtgr )(2sin)()(

Substituting in the expression for the time sampled function

PCM partA.doc 7

Page 8: Pulse Coded Modulation (PCM)

( )∫ ∑∞

∞−

−∞=

−−= λλλδ dtWcnTnTgtg sn

sr )(2sin)()()(

Moving the integral operator

( )∫∑∞

∞−

−∞=

−−= λλλδ dtWcnTnTgtg sn

sr )(2sin)()()(

which becomes

( ))(2sin)()( sn

sr nTtWcnTgtg −= ∑∞

−∞=

Hence sinc(2Wt) is the interpolation function as illustrated below:

-3Ts -2Ts Ts 0 Ts 2Ts 3Ts t

g(nTs) g(t)

Note reconstruction interpolation function

( ))(2sin snTtWc − Example A signal has a PSD of

PCM partA.doc 8

Page 9: Pulse Coded Modulation (PCM)

)()( fTAtrfS = and is sampled by

∑∞

−∞=

−=

n

nTttx3

)( δ

Plot the sampled PSD. Determine the periodic FT of x(t) as

Tdtetx

Tmc

T

T

ftj 3)(3)(6/

6/

2∫−

− == π

∑∞

−∞=

−=

m TmfmcfX 3)()( δ

-4/T -3/T -2/T -1/T 0 1/T 2/T 3/T 4/T f

A9/T2

Example What is the Nyquist rate for the signal g(t)=sinc(200t)?

=

2002001)( frectfG

which extends from –100 Hz to 100 Hz and hence the maximum frequency is 100 Hz and the sampling rate has to be greater than 200 Hz. Example What is the Nyquist rate for the signal g(t)=sinc2(200t)?

PCM partA.doc 9

Page 10: Pulse Coded Modulation (PCM)

=

2002001

2002001)( frectfrectfG

G(f) extends from –200 Hz to 200 Hz and therefore the minimum sampling rate is 400 Hz. Example What is the Nyquist rate for the signal g(t)=sinc2(200t) + sinc(200t)? Maximum frequency component of G(f) is still 200 Hz such that the sampling rate required is a minimum of 400 Hz. Example Consider ideal sampling of a signal

)2cos(2)cos()( tttx += by the sampling signal

∑∞

−∞=

−=

n

ntts2

3)( δ

resulting in an output signal y(t). That is y(t)=x(t)s(t) Determine the periodic fourier transform of s(t) Now the sampling waveform is given as

∑∞

−∞=

−=

n

ntts2

3)( δ

The spectrum of a periodic train of delta functions has the form of

∑∞

−∞=

−=

m sn T

mfafS δ)(

where Ts is the sampling period. The coefficients are given as

PCM partA.doc 10

Page 11: Pulse Coded Modulation (PCM)

63)(31 2/

2/

2 === ∫−

s

T

T

ftj

sn T

dtetT

as

s

πδ

Hence

( )∑∞

−∞=

−=m

mffS 26)( δ

Plot the spectrum of the sampled signal y(t). The plot the spectrum of x(t) as given below.

1/2 1/2 1 1

-1/π -1/2π 0 1/2π 1/π f

Convolving this with the spectrum of the sampling signal we obtain

3 3 6 6

-1/π -1/2π 0 1/2π 1/π 2-1/π 2-1/2π 2 2+1/2π 2+1/π f

3 3 6 6

Note it repeats every period of 2. What is the minimum sampling frequency to avoid aliasing? The maximum frequency component of x(t) is 1/π hence the minimum sampling frequency to avoid aliasing is 2/π. What is the average power of x(t)?

25

22

21 22

=+=xP

PCM partA.doc 11

Page 12: Pulse Coded Modulation (PCM)

If the sampling frequency was reduced to 1/2, what would the aliasing components in y(t) be that fall within the signal bandwidth of x(t)? Signal bandwidth of x(t) is 1/π =0.3183.Consider the compoentnes from the cluster centered at the sampling frequency of fs=1/2.

Note that 34.021

21

=−=π

f Outside of interval

and 1817.0121

=−=π

f inside of interval

Hence there is a total to two aliasing components that fall in band at with amplitude of 6.

1817.0±=f

Practical Signal Sampling Devices Clearly we cannot realize an ideal sampling function with zero aperture time as described earlier. Practical sampling circuits have a finite aperture time which will effect the reconstruction process. A practical sampling circuit:

s(t)

g(t)

Ts

ADC y(t)

Switch closed y(t) tracks g(t). Switch open y(t) holds constant level set when the switch made its transition from closed to open. ADC digitizes signal Integrate and Dump Sampling Integration process helps reduce noise but has a low pass effect

PCM partA.doc 12

Page 13: Pulse Coded Modulation (PCM)

C

g(t)

ADC

SW1

SW2

R

Similar to the previous sampling circuit except:

• SW2 discharges capacitor after each sample • RC time constant is long such that circuit behaves approximately as a pure

integrator The track and hold circuit will be investigated in detail in Project 1. Low pass nature of the sampling waveform - periodic frequency response as required but the harmonics drop off with frequency. Example A signal g(t) is multiplied by a periodic train of rectangular pulses p(t) each of unit area and duration T. The pulse repetition frequency is fs=1/Ts. Find the spectrum of

)()()( tptgts =

∑∞

−∞=

=n

tnfjn

sectp π2)( and ∫−

−=2/

2/

2)(1 s

s

s

T

T

tfj

sn dtetp

Tπc

)(sin)(sin11 2/

2/

2 TnfcfTnfcT

dteTT

c ssss

T

T

tfj

sn

s === ∫−

− π

Consequently

∑∞

−∞=

=n

tnfjss

seTnfcftp π2)(sin)(

∑∞

−∞=

=n

tnfjss

seTnfcftgts π2)(sin)()(

Apply the Fourier transform to each term of the summation to obtain

PCM partA.doc 13

Page 14: Pulse Coded Modulation (PCM)

∫ ∑∞

∞−

−∞

−∞=

= dteeTnfcftgfS ftj

n

tnfjss

s ππ 22)(sin)()(

( ) ∑∫∑

−∞=

∞−

−−∞

−∞=

−==n

ssstffnj

nss TnfcfnffGdtetgTnfcffS s )(sin)()()(sin)( 2π

-4/T -3/T -2/T -1/T 0 1/T 2/T 3/T 4/T f

fs

fssinc(fsT)

Quantization Noise Typical transfer characteristic of an ADC

Numerical representation (digitized output value)

Input voltage

Ideal mapping Saturation

distortion

Granularity distoriton

Granularity distortion + saturation distortion = quantization noise Quantization noise as a function of input signal

PCM partA.doc 14

Page 15: Pulse Coded Modulation (PCM)

lower saturation voltage

upper saturation voltage

ADC step size, resolution or granularity

Typically the signal rms is sufficiently large that the quantization noise is small and can be regarded as a noise source that is independent of the input analog signal. We can also generally assume that the supporting electronics will have some form of automatic gain control such that the ADC is not saturated. Hence, typically we only have to be concerned with the granularity noise. Let D be the step size of the ADC, then the pdf of the quantization noise will be uniform from –D/2 to D/2. Let q represent the random variable of the quantization noise then

)/(1)( DqrectD

qPq =

The noise power this represents is determined as

∫ ∫∞

∞− −

===2/

2/

222

12)(

D

Dq

DdqDqdqqPqP

Example SNR of a sinusoidal signal after quantization

N bit quantizer covering –1 to 1 volts Assume input sinusoidal signal has a peak of 1 volt. Ideal quantization as the signal utilizes full scale of the ADC without saturation. Step size: D = 2/2N Input power: ½ Quantization Noise: D2/12

PCM partA.doc 15

Page 16: Pulse Coded Modulation (PCM)

( )222

2222

2666

12

21

===

= N

NDD

SNR

For a 4 bit quantizer, SNR = 6(26)= 26 dB Example Gaussian Input In many practical cased the input signal into the quantizer is approximately gaussian. Hence saturation cannot be avoided. Given a gaussian signal into a uniform step size quantizer whaqt should the rms level be relative to the full scale o fthe ADC for maximum SNR? The gaussian input samples have a probability density function of

2

2

222

1)( σ

πσ

x

x exp−

=

Assume that the ADC limits at +-1v. The probability of saturation is

dxePx

sat2

2

2

1 212 σ

σπ

−∞

∫=

Let Qsat represent the power of the distortion component during saturation.

dxexQx

sat2

2

2

1

2

21)1(2 σ

σπ

−∞

∫ −=

Let Q be the total power of the distortion component

12)1(

2DPQQ satsat −+=

where D=21-N. Finally the SNR output of the quantizer is

PCM partA.doc 16

Page 17: Pulse Coded Modulation (PCM)

QSNR

2σ=

Plot of the SNR for the 4 bit quantizer is shown below. Not the maximum SNR is about 19 dB for σ=0.4.

Note: dBfs = dB relative to full scale Hence dBfs => 20log(σ/1) as full scale is 1 volt for this example. For the 4 bit ADC

• Gaussian input - maximum SNR achievable was 20 dB

• Sinusoidal input – full scale input SNR 26 dB Consequently SNR depends on the “pdf” of the input signal. PDF of voice is of course important in communication systems

PCM partA.doc 17

Page 18: Pulse Coded Modulation (PCM)

Linear amplitude

Probability Density Of amplitude

Hence bigger SNR is obtainable if the ADC uses nonlinear quantization steps. ie we want higher density of levels for low amplitudes Companders In the previous examples it was shown that the maximum SNR for a gaussian signal in a 4 bit quantizer was bout 19 dB while for a sinusoidal signal it was 26 dB. Consequently the quantization depends on the pdf of the input signal amplitude. Instead of using uniform quantization it is better to use non-uniform quantization with finer quantization steps at lower amplitudes.

V input

V output

This is equivalent to compressing the signal prior to quantization Note that the eventual DAC must undo the compression and hence it expands the signals

PCM partA.doc 18

Page 19: Pulse Coded Modulation (PCM)

COMPANDER = COMpression-exPANDER GADC(Vin) GDAC(Vin) = G0 = >constant Compression curve used in North American telecommunication systems is given by the µ−law:

)()1ln(

||1lnmax

max xsignx

x

yyµ

µ

+

+

=

µ=0 -> linear curve µ=255 -> standard in NA

compression linear

input

output

Europe uses a different compression characteristic but similar idea. Physical Implementation Direct implementation of ADC with variable step size is difficult Instead do one of two methods

• Digitize x(t) with an ADC with a uniform step size but with the step size set to the smallest required of the compander scheme. Follow the ADC with a nonlinear digital mapping which also reduces the number of bits before transmission

• Compress the input analog signal according the desired compression curve. Then

digitize with a uniform step size ADC.

PCM partA.doc 19

Page 20: Pulse Coded Modulation (PCM)

NonlinearMapping M to N bitsN<M

ADC M bits uniform sampling

x(t) N bits out

analog nonlinear compression transfer function

x(t) N bits out ADCN bits uniform sampling

EXAMPLE An ADC has an input voltage range of –1 to 1 volt. A singl input into the ADC, x(t), is a Gaussian random process with N(0.5,2).

a) What is the probability that a particular sample of x(t) exceeds 1 volt?

-1 -0.5 0 0.5 1 x

PCM partA.doc 20

Page 21: Pulse Coded Modulation (PCM)

=>2

5.01)1Pr( Qx

b) What is the probability thte x(t) is less than –1 volts?

−−

=−>2

5.01)1Pr( Qx

Desired answer is

+

=

−−

−=−<2

5.012

5.011)1Pr( QQx

c) What is the probability that the ADC is saturated

+

+

=>+−<=2

5.012

5.01)1Pr()1Pr()Pr( QQxxsaturated

d) What is the percentage of time that the ADC is saturated? Pr(saturated) x 100%

Example A PCM system has uniform quantizer followed by a 7 bit encoder. The bit rate of the system is equal to 50e6b/s. What is the maximum message bandwidth that can be sent? Let the message bandwidth be W which is sampled at the Nyquist rate with R bits per sample.

The bit period is then WRR

Tsb 2

11==T

Hence the bit rate 65021 eWRTb

==

Hence Hzee 657.314

650=W

PCM partA.doc 21