Professional Documents
Culture Documents
2 Basics DSP AV Z Filters Noise
2 Basics DSP AV Z Filters Noise
Vassilis Anastassopoulos
Electronics Laboratory, Physics Department,
University of Patras
2/31
z-Transform
N 1
X (k ) x(n) e
2
nk
N
n 0
Time to frequency
N 1
X ( z ) x(n) z n
n 0
Transformation tool is
e j e j 2k / N
With amplitude
changing(?) with time
z e j e j
z-Transform
For z=ej i.e. =1 we work on the
unit circle
-z
N 1
X ( z ) x(n) z n
n 0
z=R+jI
|z|=1
The quantity X(z) must exist with finite value on the unit circle i.e. must
posses spectrum with which we can describe a signal or a system.
4/31
z-Transform convergence
We are interested in those values of z for which X(z) converges.
This region should contain the unit circle.
Why is it so?
|a|
N 1
N 1
n 0
n 0
ROC
5/31
z-Transform example
Which is the z-transform and the ROC of a discrete time sequence
x(n)=an for n0 and a<1 ?
x(n)
|a|
2
a3
a4
R
ROC
n
N 1
X ( z ) x(n) z
n 0
a z
n 0
n n
(az 1 )n
n 0
X ( z)
1
1 az 1
za
6/31
Poles: X(z)=
Zeros: X(z)=0
|a|
R
ROC
5
3
1
X ( z )
x( n)z n z 1 3z 2 5z 3 3z 4 z 5
For stable, causal digital systems the region of convergence includes the
Unit Circle so that the system possesses spectrum
7/31
X ( z)
k ( z z1 )( z z2 )( z z N )
( z p1 )( z p2 ) ( z pN )
Those values of z (zi) that make the nominator zero are called zeros.
While the poles are the values of z (pi) that make the denominator zero
and thus X(z) diverges.
For stable, causal digital systems the region of convergence includes the
Unit Circle so that the system possesses spectrum
H (e
jT
) H ( z ) z e jT
h( n)z
z e jT
h( n)e jT
8/31
Inverse z-Transform
A simple way to evaluate the signal from the X(z) is to perform the
division
1 2 z 1 z 2
X(z)
1 z 1 0.356 z 2
X ( z ) 1 3z 1 36439
.
z 2 2.5756 z 3
The signal is x(0)=1, x(1)=3, x(2)=3.6439, x(3)=2.5756
9/31
z-Transform properties
Linearity
Delay or Shift
Convolution
x1 ( n ) X1 ( z )
x2 ( n) X 2 ( z )
ax1 ( n ) bx 2 ( n ) aX1 ( z ) bX 2 ( z )
x(n) X ( z )
x ( n m) z m X ( z )
y( n )
h( k )x( n k )
Y( z ) H( z ) X ( z )
10/31
k 0
k 1
y( n ) a k x( n k ) bk y( n k )
x(n)
Ts
a0
x(n-1)
a1
Ts
x(n-2)
x(n-+1)
a2
Ts
a-1
x(n-)
y(n)
H ( z)
b
b-1
b2
b1
k
a
z
k
k 0
N
1 bk z k
k 1
y(n-)
Ts
y(n-+1)
y(n-2)
Ts
y(n-1)
Ts
11/31
y( n ) a k x( n k ) bk y( n k )
k 0
k 1
Interchange
z y (n ) z ak x(n k ) z bk y (n k ) summations
n 0
n 0
k 0
n 0
k 1
n
k 0
n 0
k 1
n 0
Y ( z ) ak X ( z k ) bkY ( z k )
k 0
Shift property
k 1
Y( z ) ak z
k 0
X ( z ) bk z k Y ( z )
Common factors
k 1
Y ( z ) X ( z ) ak z Y ( z ) bk z k
k 0
k 1
12/31
Y ( z ) Y ( z ) bk z
k 1
X ( z ) ak z k
Common factors
k 0
Y ( z )(1 bk z ) X ( z ) ak z k
k
k 1
x(n)
k 0
Ts
a0
Y ( z)
X ( z)
a z
k 0
N
x(n-1)
a1
Ts
x(n-2)
x(n-+1)
a2
a-1
H ( z)
y(n)
Frequency
b
b-1
b2
b1
k 1
y(n-)
Ts
y(n-+1)
y(n-2)
Ts
y(n-1)
Ts
y( n ) a k x( n k ) bk y( n k )
k 0
x(n-)
1 bk z k
N
Ts
Time
k 1
13/31
Application
Find the impulse response h(n) and the input-output relationship of the filter
described by
1 z 1
H(z)
1 0.5z 1
Examine the stability of the filter and find its frequency response.
Solution
Y( z)
1 z 1
H(z)
1
X ( z ) 1 0.5z
1
z-1
x(n)
1
-1
Z 1
Y ( z ) 0.5Y ( z ) z X ( z ) X ( z ) z
y ( n ) 0.5 y ( n 1) x ( n ) x ( n 1)
y ( n ) x ( n ) x ( n 1) 0.5 y ( n 1)
y(n)
-0.5
z-1
h(n) is obtained from the terms of the polynomial which results after the division
(1 z 1 ) / (1 0.5z 1 ) 1 15
. z 1 0.75z 2 0.375z 3
14/31
Application
1 z 1
H(z)
1 0.5z 1
Im
Stable
|z|=1
1
Re
4.5
1.8
1.6
3.5
1.4
1.2
Phase
Magnitude
Frequency response
using MATLAB
2.5
0.8
1.5
0.6
0.4
0.5
0.2
0.1
0.2
0.3
Frequency
0.4
0.1
0.2
0.3
Frequency
0.4
15/31
or Fs/2
0
Re
1 z 1
H(z)
1 0.5z 1
The region from 0 to corresponds to the region 0Fs/2 of the Frequency response
16/31
Digital Filters
They are characterized by their
Impulse Response h(n), their
Transfer Function H(z) and their
Frequency Response H().
They can have memory, high
accuracy and no drift with time and
temperature.
They can possess linear phase.
17/31
k 0
k 1
y( n ) a( k ) x( n k ) bk y( n k )
H(z)
ak z k
x(n)
k 0
M
1 bk z k
k 1
Ts
a0
x(n-1)
a1
Ts
x(n-2)
x(n-+1)
a2
Ts
aN-1
aN
y(n)
+
b
y(n-)
b-1
Ts
y(n-+1)
b2
y(n-2)
x(n-)
b1
Ts
y(n-1)
Ts
18/31
k 0
k 0
y( n ) h( k ) x( n k ) a( k ) x( n k )
N
H ( z ) ak z
k 0
x(n)
a0
h(0)
Ts
x(n-1)
a1
h(1)
FIR
h( k ) z k
k 0
Ts
x(n-2)
a2
h(2)
x(n-+2)
a-2
h(-2)
Ts
x(n-+1)
a-1
h(-1)
y(n)
Stable
Linear phase
19/31
0.5
k 0
h(1)=h(10)=-0.04506
h(2)=h(9)=0.06916
h(3)=h(8)=-0.0553
h(4)=h(7)=-.06342
-1
-2
0.1
0.2 0.3
Frequency
-3
0.4
1.5
k
Magnitude FIR
H ( z ) h( k ) z
Phase IIR
11
0.5
0.1
0.2 0.3
Frequency
0.4
0.1
0.2 0.3
Frequency
0.4
Phase FIR
a1=0.927,
b1=-0.674
Magnitude IIR
a0=0.498,
a2=0.498,
b2=-0.363.
1.5
0.1
0.2 0.3
Frequency
0.4
2
0
-2
-4
h(5)=h(4)=0.5789
20/31
Fs/2
Fs/4
|z|=1
1
-Fs/2
3Fs/4
21/31
IIR Filter Design - position poles and zeros on the unit circle
Design a band-pass filter with the following specifications
Sampling frequency 1000Hz, full rejection at dc and 500 Hz, Narrow pass-band at
250 Hz, 20Hz 3dBs bandwidth.
18
Im
16
14
|z|=1
1
Magnitude
12
10
8
Re
6
4
2
0
0.1
0.2
0.3
Frequency
0.4
IIR Filter Design - position poles and zeros on the unit circle
x(n)
Im
z-2
|z|=1
1
y(n)
0.87
Re
z-2
y( n) x( n) x( n 2) 0.877969 y( n 2)
r 1 (bw / Fs ) 1 (20 / 1000) 0.937
( z 1)( z 1)
z2 1
1 z 2
H(z)
2
j / 2
j / 2
( z re
)( z re
) z 0.877969 1 0.877969 z 2
18
16
1.5
14
12
10
Phase
Magnitude
0.5
0
-0.5
6
-1
-1.5
2
0
0.1
0.2
0.3
Frequency
0.4
-2
0.1
0.2
0.3
Frequency
0.4
23/31
FIR filters
N
k 0
k 0
y( n ) h( k ) x( n k ) a( k ) x( n k )
x(n)
a0
h(0)
Ts
x(n-1)
a1
h(1)
Ts
H ( z ) ak z
k 0
x(n-2)
a2
h(2)
Stable
Linear phase
x(n-+2)
a-2
h(-2)
Ts
h( k ) z k
k 0
x(n-+1)
a-1
h(-1)
y(n)
Design Methods
Optimal filters
Windows method
Sampling frequency
24/31
Band-pass
High-pass
|()|
|()|
|()|
0 c1 c2
()
()
j
0
-j
0
Differentiator
Hilbert Transformer
25/31
1
jn
H
(
)
e
d
D
2
1 c jn
e d
2 c
2 f sin( n c )
c
n c
hD ( n )
c / 2
h( n )
1 sin( n / 2)
2 ( n / 2)
26/31
0.5
hD(n)
...
-
-/2
/2
...
Ts
|Ht()|
0.5
ht(n)
Gibbs phenomenon
-
-8
|W()|
0
1
w(n)
Hamming Window
-8
wR (n )
a (1 a ) cos(
0
2n
)
N
0.5 h(n)
|H()|
1
-8
27/31
28/31
0
-10
-20
-40
-60
-80
-30
Magnitude
-20
-40
100
200
300
Frequency
400
500
100
200
300
Frequency
400
500
-50
Phase
-60
-70
-80
-90
100
200
300
Frequency
400
-5
500
0.4
IR
Windows: 61 Coefficients
Parks and McClellan method: 46
and equiripple
0.2
0
-0.2
10
15
20
25
Time
30
35
40
45
29/31
( ) a
( ) b a
Condition
h( n) h( N n 1)
H ( ) h( k )e jkT
k 0
h(0)(e
j 3T
3*180o
5*180o
If you shift in time one signal, then you have to shift the other signals the
same amount of time in order the final wave remains unchanged.
For faster signals the same time interval means larger phase difference.
Proportional to the frequency of the signals. -
31/31