Dsp lecture vol 1 introduction
Transcript of Dsp lecture vol 1 introduction
DSP LecturesETE 315
Prof. A.H.M. Asadul Huq, Ph.D.http://asadul.drivehq.com/students.htm
April 13, 2023 A.H. 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
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
Advantage Vs. Disadvantages
Disadvantages • Speed and Cost ??? • Design Time • Finite Wordlength
April 13, 2023 A.H. 4
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
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
Application AreasInstrumentation/ Control • Noise Reduction • Data Compression Space • Space Photograph Enhancement (Hubble etc.) • Interplanetary Probes Medical • Ultrasound
ECG
April 13, 2023 A.H. 7
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
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
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
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
Effect of sampling period
04/13/23 23:24 A.H. 12
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
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
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]
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
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
Fold Speech?
Original voice
April 13, 2023 A.H. 18
Folded voice
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]
Key DSP Operations
There are 5 basic DSP operations• Convolution• Correlation• Filtering• Transformation• Modulation
April 13, 2023 A.H. 20
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
)()(
)()*()(
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 )()()(
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)
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)
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
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.
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
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
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
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
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.
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
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