Dsp lecture vol 1 introduction

33
DSP Lectures ETE 315 Prof. A.H.M. Asadul Huq, Ph.D. http://asadul.drivehq.com/students.htm [email protected] May 21, 2022 A.H. 1 INTRODUCTION
  • Upload

    -
  • Category

    Documents

  • view

    270
  • download

    14

Transcript of Dsp lecture vol 1 introduction

Page 1: Dsp lecture vol 1 introduction

DSP LecturesETE 315

Prof. A.H.M. Asadul Huq, Ph.D.http://asadul.drivehq.com/students.htm

[email protected]

April 13, 2023 A.H. 1

INTRODUCTION

Page 2: Dsp lecture vol 1 introduction

INTRODUCTIONWhat is a Signal? Any variable that carries or contains some kind of

information that can be conveyed, displayed or manipulated. • Analogue - Continuous • Digital - Discrete, Digitized, Quantized

• Primary use of DSP - Reduce interference, noise and other undesirable

components acquired in data.

April 13, 2023 A.H. 2

Page 3: Dsp lecture vol 1 introduction

Advantage Vs. Disadvantages Advantages of Digital Systems • Guaranteed Accuracy • Perfect Reproducibility • Non-variant with Temperature and Age • Greater Flexibility • Superior Performance • Most modern data is already in digital format

April 13, 2023 A.H. 3

Page 4: Dsp lecture vol 1 introduction

Advantage Vs. Disadvantages

Disadvantages • Speed and Cost ??? • Design Time • Finite Wordlength

April 13, 2023 A.H. 4

Page 5: Dsp lecture vol 1 introduction

Application AreasImage Processing • Pattern Recognition • Computer/ Robotic Vision Commercial • Movie Special Effects • Video Conferencing Telecommunications • Echo Cancellation • Data Communications

April 13, 2023 A.H. 5

Page 6: Dsp lecture vol 1 introduction

Application Areas Speech/ Audio • Speech Recognition• Text to Speech Military • Radar/ Sonar Processing • Missile Guidance Consumer Applications • Mobile Phones • HDTV

April 13, 2023 A.H. 6

Page 7: Dsp lecture vol 1 introduction

Application AreasInstrumentation/ Control • Noise Reduction • Data Compression Space • Space Photograph Enhancement (Hubble etc.) • Interplanetary Probes Medical • Ultrasound

ECG

April 13, 2023 A.H. 7

Page 8: Dsp lecture vol 1 introduction

Basic Elements of DSP System

Digital Signal

Processor

A/D Converter

D/A ConverterAnalog

Input Signal

Analog Output Signal

Digital Input

Signal

Digital Output Signal

Fig. 1.3 [Proa]. Block diagram of a DSP System

04/13/23 23:24 A.H.8

Page 9: Dsp lecture vol 1 introduction

Characteristics of Practical Digital Signal

For a signal to be completely representable and storable in a digital system-

• Discrete-Time• Discrete-Valued• Finite duration• Finite number of discrete values

04/13/23 23:24 A.H. 9

Page 10: Dsp lecture vol 1 introduction

Basic Parts of an A/D Converter [Proa P. 22]

Analog Input

Band Limiting

FilterSampler Quantizer

Analog to Digital Converter

Sampling Clock

A B D E

11000100..

Coder

C

Fig. Proa 1.14 (modified) Block diagram of A/D Converter

• Sampling: Convertd C-T signal into D-T signal by taking “samples” of the C-T signal at D-T instants. At the point D we obtain x(nTs)=x(n). Ts is called sampling interval

• Quantization: Converts C-V D-T signal into D-V D-T signal (Digital signal xq at the point E). Diff between x(n) and xq(n) is called quantization error [See more in Proakis 33].

04/13/23 23:24 A.H.10

Page 11: Dsp lecture vol 1 introduction

Coding and Sampling TheoryCoding: Converts xq(n) in to binary sequence

• Sampling Theorem:If the frequency component in a signal is fmax , then the signal should be sampled at the rate of at least 2fmax for the samples to describe the signal completely. –

fs >= 2fmax

[See more in Proakis P.30]

04/13/23 23:24 A.H.

11

Page 12: Dsp lecture vol 1 introduction

Effect of sampling period

04/13/23 23:24 A.H. 12

Page 13: Dsp lecture vol 1 introduction

Listen to original sound at Fs = 8000 Hz in Normal Tempo [Wave-1]Listen to the sound at reduced Fs = 2000 Hz in Normal Tempo [Wave-2]Listen to the sound at Fs = 2000 Hz in fast tempo [Wave-3]. Listen to the sound at Fs = 8000 Hz in SLOW tempo

04/13/23 23:24 A.H. 13

Wave-1

Wave-2

Wave-3

Page 14: Dsp lecture vol 1 introduction

Simple Manipulations of D-T Signals [52]

Types of manipulations-• Transformation of independent variables (time index).

- Shifting: Delay, Advance• Modification of dependent variable (amplitude values).

AdditionMultiplicationAmplitude scaling

April 13, 2023 A.H. 14

Page 15: Dsp lecture vol 1 introduction

Shift Operation – • Shifting of a signal x(n) is moving of the signal along n

index. In the shifting process, the independent variable n is replaced by n-k.

• Shift equation: y(n) = x(n-k), k is an integer • 2 types of shift operations - – Right shift – k is positive [Delay]– Left shift – k is negative [Advance]

April 13, 2023 A.H. 15

Shift by kx(n) y(n)=x(n-k)

Shifting [P.52]

Page 16: Dsp lecture vol 1 introduction

Shift Example [P. 53]

• [a] x(n) = [-1 0 1 2 3 4 4 4 4 4]• [b] x(n-3) = [-1 0 1 2 3 4 4 4 4 4] [Delayed]• [c] x(n+2) = [-1 0 1 2 3 4 4 4 4 4] [Advanced]

April 13, 2023 A.H. 16

Page 17: Dsp lecture vol 1 introduction

Fold

In this operation each sample of x(n) flips around n=0.

Folding equation: y(n) = x(-n)Note:• Operation of Folding AND Shifting of a signal are not

commutativei.e., TD{ FD[ (x) ] } ≠ FD{ TD[ (x) ] }.(See Proa 53 for proof)

April 13, 2023 A.H. 17

Page 18: Dsp lecture vol 1 introduction

Fold Speech?

Original voice

April 13, 2023 A.H. 18

Folded voice

Page 19: Dsp lecture vol 1 introduction

Fold and Shift Example

April 13, 2023 A.H. 19

• [a] x(n) = [2 2 2 0 1 2 3 4]• [b] x(-n) = [ 4 3 2 1 0 2 2 2 ] [Folded]• [c] x(-n+2) = [ 4 3 2 1 0 2 2 2 ] [Folded and right

Shifted]

Page 20: Dsp lecture vol 1 introduction

Key DSP Operations

There are 5 basic DSP operations• Convolution• Correlation• Filtering• Transformation• Modulation

April 13, 2023 A.H. 20

Page 21: Dsp lecture vol 1 introduction

Convolution

• Definition:Given 2 finite length sequences, x(n) and h(n), their linear convolution is

April 13, 2023 A.H. 21

• Where the symbol [*] is used to denote convolution

k

knhkx

nhnxny

)()(

)()*()(

Page 22: Dsp lecture vol 1 introduction

The process of computing Convolution

To obtain y(n0) at some instant of time, n = n0

1. Fold h(k) about k=0 to obtain h(-k)2. Shift h(-k) by n0 to the right to obtain h(n0–k)3. Multiply x(k) by h(n0 –k) to obtain the product sequence4. Sum all the elements of v to obtain y(n0)To obtain y(n) [i.e., complete convolution output] -

Repeat steps 2-4 for all time shifts

April 13, 2023 A.H. 22

k00 knhkxny )()()(

Page 23: Dsp lecture vol 1 introduction

Example of computing Convolution

Problem Proa 2.3.2Given, h(n)=[1,2,1,-1]; and x(n)=[1,2,3,1]Compute the convolution output y(n)=h(n)*x(n).

April 13, 2023 A.H. 23

h(n)x(n) y(n)=x(n)*h(n)

Page 24: Dsp lecture vol 1 introduction

Solution

April 13, 2023 A.H. 24

k

kk)x(k)h(ny(n)

-nconvolutio of formula General

}1,1,2,1{)(and}1,3,2,1{x(k)puttingNow,

kh

}12,1,1{)( get, we0=kabout h(k) folding and

kh

Now right shift h(-k) starting from n=0, multiply it with the x(k) to get the product sequence, Then, the sum of all the elements of the product sequence produces y(0)

Page 25: Dsp lecture vol 1 introduction

Solution … continued

April 13, 2023 A.H. 25

1002200

)0*1()0*3()1*2()2*1()1*0()1*0(

}0,0,1,2,1,1{}1,3,2,10,0{

}1,2,1,1{}1,3,2,1{

}1,2,1,1{)0()0()()0(0,

khandkhkxynFor

Now right shift h(-k), i.e. , calculate y(1) for n=1

Page 26: Dsp lecture vol 1 introduction

Solution …. continued

April 13, 2023 A.H. 26

Now after completing all (left and right) shifts of h(-k), we get – (i.e., For n=-1 to n=+5)

800341)0*1()1*0()3*1()2*2()1*1(

}1,2,1,1}{1,3,2,1{

}1,2,1,1{)1()1()()1(1

khandkhkxynFor

,...}0,0,1,2,3,8,8,4,1,0,0{...)(,)}(),...7(),6(),5(),4(),3(),2(

),1(,)0(),1(),2(),3(),4()...({)(

nyoryyyyyyy

yyyyyyyny

Note: Total number of elements in y(n) = N=length of y(n)=length of x(n)+length of h(n)-1. That is in this case N=4+4-1=7.

Page 27: Dsp lecture vol 1 introduction

Animation of Convolution

April 13, 2023 A.H. 27

Convolution of two square pulses: the resulting waveform is a triangular pulse. One of the functions (in this case g) is first folded about τ = 0 and then shifted by t, making it g(t − τ). The area under the resulting product gives the convolution at t. The horizontal axis is τ for f and g, and t for f*g.http://en.wikipedia.org/wiki/Convolution

Page 28: Dsp lecture vol 1 introduction

Correlation [Proa 120]

• Correlation is an operation that enables the measurement of the degree to which 2 sequences are similar

• There are 2 types of correlations -1. Crosscorrelation2. Autocorrelation

April 13, 2023 A.H. 28

Page 29: Dsp lecture vol 1 introduction

Cross-correlation

• Definition:

nxy lnynxlr )()()(

)()()( lnxnxlrn

xx

April 13, 2023 A.H. 29

Autocorrelation

• Definition

•l = … -3,-2,-1,0,1,2,3, … Here, l is lag or shift •x(n) is the reference•y(n) shifts by l samples with respect to x(n)•y(n) shifts right for +l•y(n) shifts left for -l

Page 30: Dsp lecture vol 1 introduction

Correlation example [Proa 120]

Example 2.6.1Determine the cross-correlation sequence rxy (l)

of the sequences –x(n) = {2,-1,3,7,1,2,-3}y(n) = {1,1,-1,2,-2,4,1,-2,5}

April 13, 2023 A.H. 30

Page 31: Dsp lecture vol 1 introduction

Solution to Problem

April 13, 2023 A.H. 31

Compute rxy (0), for lag l=0

For other values of l, simply shift y(n) to the right and left relative to x(n) by l units and compute rxy(l):

7

62414612

}5,2,1,4,2,2,1,1,1}{3,2,17,3,1,2{)0(

,rxy

3}- 1,- 6, 0, 19, 19,- 15, ,7 0, 33, 14,- 36, 19, 9,- 10,{

)}7(),6(),5(),4(),3(),2(),1(

)0(),1(),2(),3(),4(),5(),6(),7({

rrrrrrr

rrrrrrrrrxy

Notes: In this case range of l is 0 to 7; this means there are 2x7+1=15 elements in rxy.

Page 32: Dsp lecture vol 1 introduction

Similarities between computation of Cross-correlation and convolution of 2

sequences• Similarities are apparent• Convolution computation- fold shift multiply one

sequence with the other to get the product sequence, and then elements of the product sequence are summed to get the conv. output.

• Cross-correlation computation – Same operations except the folding one.

• rxy(l) = x(l) * y(-l) [See text]

April 13, 2023 A.H. 32

Page 33: Dsp lecture vol 1 introduction

DSP LectureINTRODUCTION

THE END

THANK YOU

This ppt may be downloaded from my web site:http://asadul.drivehq.com/students.htm

Password (email address): [email protected]

This password does not live long !

Apr 13, 2023 A.H. 33