Upload
others
View
6
Download
0
Embed Size (px)
Citation preview
1
DIGITAL SIGNAL PROCESSING
2
General information
Professor: Mihnea UDREA– B209– [email protected]
Grading:– Laboratory: 15%– Project: 15%– Tests: 20%– Final exam : 50%– Course quiz: ±10%
Web: www.electronica.pub.ro MOODLE
3
1. Introduction
Discrete Time Signals and Systems
4
Analog signal processing systems
5
Digital signal processing systems
6
periodically sampling a continous time signal at time intervals nTs.
1.1 Discrete-Time Signals
tA
-A
( )ax t
nA
-A
0 1 2 3 4 5 10
( )x n
Ts 2Ts…………nTs
a Sx n x nT
Ts sampling period1
ss
FT
sampling frequency
s a sn
x nT x t t nT
7
Basic signals
1 , 00 , 0
nu n
n
n
1
-4 -3 -2 -1 0 1 2 3 4
( )u nThe discrete unit step
n
1
-4 -3 -2 -1 0 1 2 3 4
( )n
1 , 00 , 0
nn
n
The discrete impulse
Periodical signals
A discrete signal is N samples periodical if:N Z x n x n N n Z
8
The discrete-time sinusoid
f0 – normalised frequency
ω0 – angular normalised frequency
00 0 S
S
Ff F TF
0 0 02ST f
tA
-AT0
0 0sinax t A t 0 02 F
0 0sina Sx n x nT A n
nA
-A
0 1 2 3 4 5 10
00 0 2S
S
Ft nT nF
The discrete-time sinusoid
x(n) is N samples periodical if there exist integers N and k:
9
sin 0.2x n A n
nA
-A
0 1 2 3 4 5 10
N=10, k=1
F0= 1 kHz; FS= 10 kHz 00 2 0.2
S
FF
0 022N k kN
The discrete-time sinusoid
x(n) is N samples periodical if there exist integers N and k:
10N=20, k=3
F0= 1.5 kHz; FS= 10 kHz 01.5 32 210 20
0 022N k kN
sin 0.3x n A n
nA
-A
0 1 2 3 4 20
11
The discrete-time signal energy
2def
nE x n
2a S a S
nE T x nT
21lim2 1
N
N n NP x n
N
1a
S
E ET
The average power
12
Frequency analysis of discrete-time signals
0
x(t)
Ts 2Ts 3Ts nTs
0 t
d(t)
0 t
d(t - nTs)
nTs
s s sn n
x nT x t t nT x t t nT
13
Frequency analysis of discrete-time signals
12s s
nx nT x t t nT
1 12 a s s a s
sk kX X k X k
T
Denote:
sx nT X
ax t X
22s ss
FT
s sn
x nT x t t nT
14
1
Ω
Xa(Ω)
0 ΩM-ΩM Ωs 2Ωs-Ωs-2Ωs
X(Ω)1/Ts
Ω0 ΩM-ΩM Ωs 2Ωs-Ωs-2Ωs
1/Ts
Ωs
-Ωs/2 Ωs/2
aliasing
Conditions:1) |Xa(Ω)|=0, for |Ω|>ΩM
2) Ωs 2ΩM
Sampling Theorem (Nyquist)
1a s
s kX X k
T
15
F
X(F)
0 FM-FM Fs 2Fs-Fs-2Fs
The minimum sampling rate is achieved forΩs = 2ΩM Fs = 2FM = Nyquist rate (Nyquist frequency)
f
X(f)
0 0.5-0.5 1 2-1-2
- normalized frequencys
FfF
16
ω
X(ω)
0 π-π 2π 4π-2π-4π
f
X(f)
0 0.5-0.5 1 2-1-2
2 2s
FfF
2π(Ωs)
1(Fs)
[ ; ) , [ 0.5;0.5) f (basic interval)
17
Frequency analysis of discrete-time signals
n
nX z Z x n x n z
Z transform:
1 112
n
C
x n Z X z X z z dzj
,D z z R R R R
Im{z}
Re{z}R- R+
Most important properties:
kx n X z x n k z X z
1 2 1 2x n x n X z X z 18
Frequency analysis of discrete-time signals
0
n
n nX z Z x n x n z
Z transform:a) signal with left limited support
particular case: 00,x n n n
D z z R
Im{z}
Re{z}R-
0supp ,x n n
0 0n
19
Frequency analysis of discrete-time signals
0n
n
nX z Z x n x n z
Z transform:b) signal with right limited support
00,x n n n
D z z R
Im{z}
Re{z}R+
0supp ,x n n
20
Frequency analysis of discrete-time signals
Z transform:A bilateral sequence can be decomposed:
x n x n x n
( ), 00 else
x n nx n
( ), 00 else
x n nx n
D z z R D z z R
D D D z R z R
21
Frequency analysis of discrete-time signals
Z transform:Let:and:Then:and:
D z R z R
1' 'X z Z x n X z
'x n x n
X z Z x n
1 1'D z zR R
1' n n
n nX z x n z x n z X z
1 1z R zR
1 1z R zR
22
Frequency analysis of discrete-time signals
Discrete time Fourier transform (DTFT):
DTFTj jn
nX e x n e x n
1 IDTFT2
j jn jx n X e e d X e n
2 2s
FfF
Discrete Fourier transform (DFT): sup 0, 1x n N
1
0DFT
Nnk
Nn
X k x n k x n W
1
0
1IDFTN
nkN
kx n X k n X k W
N
2jN
NW e
2k k
N
23
Frequency analysis of discrete-time signals
X z jX e jz e X k
2k k
N
n
nX z x n z
j jn
nX e x n e
21
0
N j nkN
nX k x n e
Z transform
DTFT
DFT
24
Frequency analysis of discrete-time signals
012…k………N-1
X k
k
jX e X k
2k k
N
-3π -2π -π 0 π 2π 3π
jX e
ω
Discrete time Fourier transform (DTFT):
Discrete Fourier transform (DFT):
2 , 0, , 1k k NN
Example: The rectangular window
Is defined by: 1, 0, 1( )
0, in restD
n Nw n
1
-2 -1 0 1 2 ...... N-1 N N+1 n
( )Dw n
1
10
1( )1
NNn
Dn
zW z zz
The spectrum is:
12
sin1 2( ) 11 sin2
NjN jjD j
NeW e ee
0 ( )DW
25
The rectangular window frequency characteristic
jDW e
2 20 2 2N N
N
26
Frequency analysis of discrete-time signals
N
0sinx n A n
n
-π -ω0 0 ω0 π 2π-ω0 2π 2π+ω0
jX e
ω
jDW e
0 π 2π2N
ω
-π -ω0 0 ω0 π 2π-ω0 2π 2π+ω0
j jDX e W e
ω
( )u n u n N
DTFT
Windowing effect
27
Frequency analysis of discrete-time signals
N
0sinx n A n
n
0 1 2 3 4 5 6 7 8 9 10 11
k
( )u n u n N
X k
02 4N
jX e X k2
k kN
jDW e
0 π 2π2N
ω
DTFT DFT
0 ω0 π 2π-ω0 2π2N 2
k kN
ω
28
Frequency analysis of discrete-time signals
0 1 2 3 4 5 6 7 8 9 10 11
k
X k
0 ω0 π 2π-ω0 2π2N
02 4.8N
jX e X k2
k kN
2k k
N
jDW e
0 π 2π2N
ω
N
0sinx n A n
n
( )u n u n N
DTFT DFT
Spectral leakage
29 30
1.2 Discrete-time Systems
Linear systems satisfy the superpositionprinciple:
y n T x ny(n)x(n)
T { }
1 1 2 2 1 1 2 2 1 1 2 2T a x n a x n a T x n a T x n a y n a y n
The impulse response: h n T n
k
x n x k n k
k
x k T n k
kT n k h n
y n T x n k
T x k n k
k
kx k h n
31
Discrete-time systems
Time invariant systems have the following property:
y n T x n y n k T x n k k Z
kh n T n k h n k k
y n x k h n k
Discrete time linear convolution:
1 2 1 2 1 2k
x x n x n x n x k x n k
y n h x n x h n x(n)h(n)
32
Discrete-time systemsCauzal systems.
LTI cauzal systems: 0, 0h n n
0n n 0pentrua bx n x n n n
0pentrua by n y n n n
Stable systems – the impulse response has to be absolutely sumable.
k
h k
33
LTIS difference equation: 0 0
N M
k kk k
y n k x n k
0 1
M N
k kk k
y n b x n k a y n k
If denote:0 0
0
kka
0
kkb
FIR finite impulse response system (N = 0):
0
M
kk
y n b x n k
x n n 1
, [0, ]0 , in rest
Mn
kk
b n Mh n b n k
IIR infinite impulse response (N > 0).
0ka
34
LTIS transfer function
h(n)y(n)x(n)
impulse response
y n x n h n
H(z)Y(z)X(z)
Y z X z H z
system function
Similar analysis with Fourier transform:
H z jH e jz e j j jY e X e H e
H z Z h n
35
LTIS transfer function
0 1
M N
k kk k
y n b x n k a y n k
Assume a LTIS having the difference equation:
0 1
M Nk k
k kk k
Y z b X z z a Y z z
0
1
( )( ) ( )1
Mk
kk
Nk
kk
b zY z B zH zX z A za z
Applying the Z transform:
( )
( )
k
k
Zx n k X z zZy n k Y z z
36
LTIS transfer function
zk – the system zeros:
pk – the system poles:
N – the system order (number of poles).
1
0 11
1
...( )( ) 1 ...
MM
NN
b b z b zB zH zA z a z a z
1 1 1
0 0 11 1 1
0 1
1 1 ... 1( )( ) 1 1 ... 1
M
N
b z z z z z zB zH zA z p z p z p z
0kH z
kH p
Stable systems – the poles must be less than 1 (in absolute value).
1kp
37
LTIS transfer function
IIR systems:
FIR system: 1
0 10
...M
k Mk M
kH z b z b b z b z
0ka
0
1
( )( ) 1
Mk
kk
Nk
kk
b zB zH zA z a z
0( ) ( )
M
kk
h n b n k
1( )k
k kZb z b n k
0
( )M
k
kH z h k z
( ) kh k b
-1 0 1 2 3 4 5 6 7 n
h(n) M=6
38
Example: The moving average filter
The mean of a length N signal:What if signal length is infinite?Use frames (windows) of last N samples
1
0
1 ( )N
nm x n
N
x(n–N+1) x(n–N+2) x(n–N+3) - - - x(n) x(n+1) x(n+2) - - -
1
0
1 ( )N
nk
m x n kN
nm1nm
2nm
0 50 100 150 200 250 300 350 400-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8Noisy signal
39
The moving average filter
Denoising a signal:1
0
1( ) ( )M
km n x n k
N
0 50 100 150 200 250 300 350 400-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8N=4
original signaldenoised signal
0 50 100 150 200 250 300 350 400-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8N=20
original signaldenoised signal
40
The moving average filter
The MA is a FIR filter of length Nthe impulse response:
1
0
1( ) ( )N
MAk
h n n kN
0 1 2 3 4 5 6 7 8 n
hMA(n) N=8
1/N
41
The moving average filter
The MA is a FIR filter of length Nthe impulse response:
1
0
1 / , 0, 11( ) ( )0, in rest
N
MAk
N n Nh n n k
N
0 1 2 3 4 5 6 7 8 n
hMA(n) N=8
1/N
1( ) ( )MA Dh n w nN
1
10
1 1 1( )1
NNn
MAn
zH z zN N z
The moving average filter
jMAH e
2 20 2 2N N
1
42
43
The moving average filter
The moving average filter output
1( ) ( ) ( 1) ... ( 1)MAy n x n x n x n NN
1 1( ) ( 1) ... ( 1)x n x n x n NN N
1( 1) ( )MAy n x n NN
1 1( ) ( 1) ( ) ( )MA MAy n y n x n x n NN N
44
The moving average filter
The recursive equation
Corresponds to Z transform
1 1( ) ( 1) ( ) ( )y n y n x n x n NN N
1 1( ) 1 ( ) 1 NY z z X z zN
1( ) 1 1( )( ) 1
NY z zH zX z N z
45
LTIS analysis in the frequency domain
The system transfer function:
j jk
kH e h k e
arg jj H e jj j jH e H e e H e e
j jH e H e
Systems having a real h(n):
46
cos1 12 2
j jn j jn
x n A n
A e e A e e
( )
( )
2
2
j j j jn
j j j jn
Ay n e H e e e
A e H e e e
2
j n j njAy n H e e e
cosjy n A H e n
h(n)y(n)x(n)
LTIS analysis in the frequency domain
47
jH e
cosjy n A H e n
is the filter gain and represents the magnitude–frequency characteristic;
is the phase delay of the system and represents the phase–frequency characteristic;
The time group delay: dd
LTIS analysis in the frequency domain
h(n)y(n)x(n)