32
CE 40763 Digital Signal Processing Fall 1992 Waveform Coding Hossein Sameti Department of Computer Engineering Sharif University of Technology

CE 40763 Digital Signal Processing Fall 1992 Waveform Coding Hossein Sameti Department of Computer Engineering Sharif University of Technology

Embed Size (px)

Citation preview

Page 1: CE 40763 Digital Signal Processing Fall 1992 Waveform Coding Hossein Sameti Department of Computer Engineering Sharif University of Technology

CE 40763

Digital Signal Processing

Fall 1992

Waveform Coding

Hossein Sameti

Department of Computer Engineering

Sharif University of Technology

Page 2: CE 40763 Digital Signal Processing Fall 1992 Waveform Coding Hossein Sameti Department of Computer Engineering Sharif University of Technology

2

PCM & DPCM & DM

Page 3: CE 40763 Digital Signal Processing Fall 1992 Waveform Coding Hossein Sameti Department of Computer Engineering Sharif University of Technology

3

Pulse-Code Modulation (PCM) : In PCM each sample of the signal is

quantized to one of the amplitude levels, where B is the number of bits used to represent each sample.The rate from the source is bps.

The quantized waveform is modeled as :

q(n) represent the quantization error, Which we treat as an additive noise.

B2

sBF

)()()(~ nqnsns

Page 4: CE 40763 Digital Signal Processing Fall 1992 Waveform Coding Hossein Sameti Department of Computer Engineering Sharif University of Technology

4

Pulse-Code Modulation (PCM) :The quantization noise is characterized as a

realization of a stationary random process q in which each of the random variables q(n) has uniform pdf.

Where the step size of the quantizer is 22

q

B 2

2

/1

2

Page 5: CE 40763 Digital Signal Processing Fall 1992 Waveform Coding Hossein Sameti Department of Computer Engineering Sharif University of Technology

5

Pulse-Code Modulation (PCM) : If :maximum amplitude of signal,

The mean square value of the quantization error is :

Measure in dB, The mean square value of the noise is :

B

A

2max

maxA

122

A

12

Δ|(n)q

1

(n)dqqΔ

1 (n)q

2B

2max

2Δ/2

Δ/23

Δ/2

Δ/2

22

.dB 8.10612

2log10

12log10

2

10

2

10

BB

Page 6: CE 40763 Digital Signal Processing Fall 1992 Waveform Coding Hossein Sameti Department of Computer Engineering Sharif University of Technology

6

Pulse-Code Modulation (PCM) : The quantization noise decreases by 6 dB/bit. If the headroom factor is h, then

The signal to noise (S/N) ratio is given by

(Amax=1)

In dB, this is

hh

AX

B

rms

2max

2

2

2

22

1212/

SNRh

X

N

S Brms

hBh

B

102

2

10dB log208.106212

log10SNR

Page 7: CE 40763 Digital Signal Processing Fall 1992 Waveform Coding Hossein Sameti Department of Computer Engineering Sharif University of Technology

7

Pulse-Code Modulation (PCM) : Example :

We require an S/N ratio of 60 dB and that a headroom factor of 4 is acceptable. Then the required word length is :

60=10.8 + 6B – 20

If we sample at 8 KHZ, then PCM require

bit 112.10 B

4log10

bit/s. 8800011 8 k

Page 8: CE 40763 Digital Signal Processing Fall 1992 Waveform Coding Hossein Sameti Department of Computer Engineering Sharif University of Technology

8

Pulse-Code Modulation (PCM) : A nonuniform quantizer characteristic is

usually obtained by passing the signal through a nonlinear device that compress the signal amplitude, follow by a uniform quantizer.

Compressor A/D D/A Expander

Compander

(Compressor-Expander)

Page 9: CE 40763 Digital Signal Processing Fall 1992 Waveform Coding Hossein Sameti Department of Computer Engineering Sharif University of Technology

Companding: Compression and Expanding

9

Original Signal

After Compressing, Before Expanding

Page 10: CE 40763 Digital Signal Processing Fall 1992 Waveform Coding Hossein Sameti Department of Computer Engineering Sharif University of Technology

10

Companding A logarithmic compressor employed in

North American telecommunications systems has input-output magnitude characteristic of the form

is a parameter that is selected to give the desired compression characteristic.

)1log(

|)|1log(||

sy

Page 11: CE 40763 Digital Signal Processing Fall 1992 Waveform Coding Hossein Sameti Department of Computer Engineering Sharif University of Technology

Companding

11

Page 12: CE 40763 Digital Signal Processing Fall 1992 Waveform Coding Hossein Sameti Department of Computer Engineering Sharif University of Technology

12

Companding The logarithmic compressor used in

European telecommunications system is called A-law and is defined as

A

sAy

log1

|)|1log(||

Page 13: CE 40763 Digital Signal Processing Fall 1992 Waveform Coding Hossein Sameti Department of Computer Engineering Sharif University of Technology

Companding

13

Page 14: CE 40763 Digital Signal Processing Fall 1992 Waveform Coding Hossein Sameti Department of Computer Engineering Sharif University of Technology

14

DPCM : A Sampled sequence u(m), m=0 to m=n-1.

Let be the value of the reproduced (decoded) sequence.

),...2(~),1(~ nunu

Page 15: CE 40763 Digital Signal Processing Fall 1992 Waveform Coding Hossein Sameti Department of Computer Engineering Sharif University of Technology

15

DPCM: At m=n, when u(n) arrives, a quantify ,

an estimate of u(n), is predicted from the previously decoded samples i.e.,

”prediction rule” Prediction error:

)(~ nu

),...2(~),1(~ nunu

),...);2(~),1(~()(~ nununu

)(~)()( nunune

:(.)

Page 16: CE 40763 Digital Signal Processing Fall 1992 Waveform Coding Hossein Sameti Department of Computer Engineering Sharif University of Technology

16

DPCM : If is the quantized value of e(n), then

the reproduced value of u(n) is:

Note:

)(~ ne

)(~)(~)(~ nenunu

)(in error on Quantizati The :)(

)(~)(

))(~)(~())()(~()(~)(

)()(~)(

nenq

nene

nenunenununu

nenunu

Page 17: CE 40763 Digital Signal Processing Fall 1992 Waveform Coding Hossein Sameti Department of Computer Engineering Sharif University of Technology

17

DPCM CODEC:

)(~ nu

)(~ nuΣ Quantizer

Σ

ΣCommunication

Channel

PredictorPredictor

)(nu )(ne )(~ ne

)(~ nu

)(~ nu

)(~ ne

Coder Decoder

Page 18: CE 40763 Digital Signal Processing Fall 1992 Waveform Coding Hossein Sameti Department of Computer Engineering Sharif University of Technology

18

DPCM: Remarks:

The pointwise coding error in the input sequence is exactly equal to q(n), the quantization error in e(n).

With a reasonable predictor the mean sequare value of the differential signal e(n) is much smaller than that of u(n).

Page 19: CE 40763 Digital Signal Processing Fall 1992 Waveform Coding Hossein Sameti Department of Computer Engineering Sharif University of Technology

19

DPCM: Conclusion:

For the same mean square quantization error, e(n) requires fewer quantization bits than u(n).

The number of bits required for transmission has been reduced while the quantization error is kept the same.

Page 20: CE 40763 Digital Signal Processing Fall 1992 Waveform Coding Hossein Sameti Department of Computer Engineering Sharif University of Technology

20

DPCM modified by the addition of linearly filtered error sequence

)(~ nu

)(~ nuΣ Quantizer

Σ

CommunicationChannel

Linear filter

)(nu )(ne )(~ ne

)(~ nu

)(~ nu

)(~ ne

Coder Decoder

(i)} a{

Linear filter

(i)} b{

Σ

Linear filter

(i)} a{

Linear filter

(i)} b{

Σ

Σ

Page 21: CE 40763 Digital Signal Processing Fall 1992 Waveform Coding Hossein Sameti Department of Computer Engineering Sharif University of Technology

21

Adaptive PCM and Adaptive DPCM

Speech signals are quasi-stationary in nature

The variance and the autocorrelation function of the source output vary

slowly with time.

PCM and DPCM assume that the source output is stationary.

The efficiency and performance of these encoders can be improved

by adaptation to the slowly time-variant statistics of the speech

signal.

Adaptive quantizer

feedforward

feedbackward

Page 22: CE 40763 Digital Signal Processing Fall 1992 Waveform Coding Hossein Sameti Department of Computer Engineering Sharif University of Technology

22

Example of quantizer with an adaptive step size

∆ 2∆ 3∆-∆-2∆-3∆

∆/2

3∆/2

5∆/2

7∆/2

-∆/2

-3∆/2

-5∆/2

-7∆/2

M (1)

M (2)

M (3)

M (4)

M (1)

M (2)

M (3)

M (4)

000

001

010

011 0

100

101

110

111 Previous Output

Multiplier

Page 23: CE 40763 Digital Signal Processing Fall 1992 Waveform Coding Hossein Sameti Department of Computer Engineering Sharif University of Technology

23

ADPCM with adaptation of the predictor

)(~ nu

)(~ nuΣ Quantizer

Σ

ΣCommunicationChannel

PredictorPredictor

)(nu )(ne )(~ ne

)(~ nu)(~ ne

Coder Decoder

DecoderEncoder

Step-sizeadaptation

Predictoradaptation

Page 24: CE 40763 Digital Signal Processing Fall 1992 Waveform Coding Hossein Sameti Department of Computer Engineering Sharif University of Technology

24

Delta Modulation : (DM) Predictor : one-step delay function

Quantizer : 1-bit quantizer

)1(~)()(

)1(~)(~

nunune

nunu

Page 25: CE 40763 Digital Signal Processing Fall 1992 Waveform Coding Hossein Sameti Department of Computer Engineering Sharif University of Technology

25

Delta Modulation : (DM) Primary Limitation of DM

Slope overload : large jump region

Max. slope = (step size)X(sampling freq.)

Granularity Noise : almost constant region

Instability to channel noise

Page 26: CE 40763 Digital Signal Processing Fall 1992 Waveform Coding Hossein Sameti Department of Computer Engineering Sharif University of Technology

26

DM:

Unit Delay

Unit Delay

Integrator

)(nu )(ne )(~ ne

)(~ nu)(~ nu

)(~ ne )(~ nu

)(~ nu

Coder

Decoder

Page 27: CE 40763 Digital Signal Processing Fall 1992 Waveform Coding Hossein Sameti Department of Computer Engineering Sharif University of Technology

27

DM:

Step size effect : Step Size (i) slope overload

(sampling frequency ) (ii) granular Noise

Page 28: CE 40763 Digital Signal Processing Fall 1992 Waveform Coding Hossein Sameti Department of Computer Engineering Sharif University of Technology

28

Adaptive DM:

1kX

1kE1ks

Adaptive Function

Unit DelaykX 1k

Storedk mink ,E,

11

min1min

min11

11

|| if

|| if ]2

[||

][sgn

kkk

kk

kk

kkk

kKk

XX

E

EE

XSE

This adaptive approach simultaneously minimizes the effects of both slope overload and granular noise

Page 29: CE 40763 Digital Signal Processing Fall 1992 Waveform Coding Hossein Sameti Department of Computer Engineering Sharif University of Technology

29

Vector Quantization (VQ)

Page 30: CE 40763 Digital Signal Processing Fall 1992 Waveform Coding Hossein Sameti Department of Computer Engineering Sharif University of Technology

30

Vector Quantization : Quantization is the process of

approximating continuous amplitude signals by discrete symbols.

Partitioning of

two-dimensional

Space into 16 cells.

Page 31: CE 40763 Digital Signal Processing Fall 1992 Waveform Coding Hossein Sameti Department of Computer Engineering Sharif University of Technology

31

Vector Quantization : The LBG algorithm first computes a 1-

vector codebook, then uses a splitting algorithm on the codeword to obtain the initial 2-vector codebook, and continue the splitting process until the desired M-vector codebook is obtained.

This algorithm is known as the LBG algorithm proposed by Linde, Buzo and Gray.

Page 32: CE 40763 Digital Signal Processing Fall 1992 Waveform Coding Hossein Sameti Department of Computer Engineering Sharif University of Technology

32

Vector Quantization : The LBG Algorithm :

Step 1: Set M (number of partitions or cells)=1.Find the centroid of all the training data.

Step 2: Split M into 2M partitions by splitting each current codeword by finding two points that are far apart in each partition using a heuristic method, and use these two points as the new centroids for the new 2M codebook. Now set M=2M.

Step 3: Now use a iterative algorithm to reach the best set of centroids for the new codebook.

Step 4: if M equals the VQ codebook size require, STOP; otherwise go to Step 2.