Date post: | 28-Dec-2015 |
Category: |
Documents |
Upload: | baldric-hicks |
View: | 219 times |
Download: | 0 times |
z Transformz Transform
X z x n z n
n
( ) ( )
When the transform is identical to DFT
(11)
X z x n z
X e x n e x n e
n
z en
j j n
n
j kn N
n
j k
k k
( ) ( )
( ) ( ) ( ) /
2
z e j k
z Transformz Transform
(12)
X z x n z
X e x n e x n e
n
z en
j j n
n
Nj kn N
n
N
j k
k k
( ) ( )
( ) ( ) ( ) /
0
12
0
1
The sequence x(n) is non-zero within [0,N-1], hence
The transform is identical to DFT
Some basic properties of z TransformSome basic properties of z Transform
H z h n z n
n1( ) ( )
1. Basic definition1. Basic definition
h n ah n bh n H z aH z bH z( ) ( ) ( ) ( ) ( ) ( ) 1 2 1 2
2. Linearity2. Linearity
x n k z X zk( ) ( )
3. Delay3. Delay
y n h n x n Y z H z X z( ) ( ) ( ) ( ) ( ) ( )
4. Convolution4. Convolution
Essential properties of z TransformEssential properties of z Transform
x n z z X z x n z X z
x n z x n
( ) ( ) ( ) ( )
( ) ( )
1 1 1
1
1
1
and
5. Multiplication by ‘z-1’5. Multiplication by ‘z-1’
x n X z( ) ( )
6. Relation between X(z) and X(-z)6. Relation between X(z) and X(-z)
( ) ( ) ( ) 1 n x n X z
x n X z( ) ( )
7. Relation between X(z) and X(z-1)7. Relation between X(z) and X(z-1)
x n X z( ) ( ) 1
Why z Transform?Why z Transform?
1. z transform can be used to calculate DFT.
2. Filter architecture can be deduced directly from the transfer function in the z domain.
Specify filter characteristics(LP, HP, BP...)
Determine transfer
function H(z)
Determine filter sturcture
Filter structure can be inferred from H(z)
Figure 21
y (n) = ak y(n-k) +
k=1
Mbk x(n-k)
k= -NF
NF
(13)
Generalised finite order LTI system
Making use of the delay property, equation (4) can be rewritten as
x n z x n( ) ( ) 1 1
y (n) = ak z-k y(n) +
k=1
Mbk z-k
x(n)k= -NF
NF
(14)
y (n) = ak z-k y(n) +
k=1
Mbk z-k
x(n)k= -NF
NF
(14)
z
b-NF
z-1
bNF
b0 + +
z-1
a1
z-1
aM
x(n) y(n)
Figure 22
y (n) = ak z-k y(n) +
k=1
Mbk z-k
x(n)k= -NF
NF
(14)
z transform
Y (z) = ak z-k Y(z) +
k=1
Mbk z-k
X(z)k= -NF
NF
(15)
Note the similarity between the time and z domain
Digital Filter DesignDigital Filter Design
Specify filter characteristics(LP, HP, BP...)
Determine transfer
function H(z)
Construct filter sturcture
Y (z) = ak z-k Y(z) +
k=1
Mbk z-k
X(z)k= -NF
NF
Rarrange H(z) to the form
Figure 21
Example ( ) =
( )
( )
1- cos
cos
0
0
H zY z
X z
r z
r z r z
1
1 2 21 2
(z) cos ( ) - cos0 0Y r Y z z r Y z z X z r X z z 2 1 2 2 1 ( ) ( ) ( )
(z) ( ) - 1Y a Y z z a Y z z b X z b X z z 1
12
20
1( ) ( ) ( )
z-1
b1
b0 + +
z-1
a1
z-1
a2
x(n) y(n)
Figure 23
Poles and Zeros of Transfer FunctionPoles and Zeros of Transfer Function
(z)H
b z
a z
kk N
Nk
kk
Mk
F
P
11
Az
c z
d z
Nk
k
N N
kk
MF
P F
1
1
1
1
1
1
= (16)
Poles and zeros are values of ‘z’ which results in H(z) = infinity and zero, respectively
H(z) can be divided into 3 groups for NF > 0 :
Az N F 1 1
1
c zkk
N NP F 1 1
1
d zkk
M
1. 2. 3.
Poles and Zeros of Transfer FunctionPoles and Zeros of Transfer Function
Gourp 1 Az N F NF poles at z = and NF zeros at z = 0
Gourp 2 a zero at z = ck and a pole at z = 0 for each term from k=1 to NP+NF
1 1
1
c zkk
N NP F
Gourp 3 a zero at z = 0 and a pole at z = dk for each term from k=1 to M
1 1
1
d zkk
M
Example ( ) =H z z z1
311
( ) =H z Az c z c z1 111
21
The transfer function can be expressed as
= 1
3 and A c
jc
j, ,1 2
1 3
2
1 3
2
Term Group Pole Zero
z 1 0 2 0 c1
1 11 c z
2 0 c2 1 21 c z
Is a filter useful?Is a filter useful?
A filter transfer function H(z) is only useful if :
1. It is stable
2. It is finite
Stability of Transfer FunctionStability of Transfer Function
Given a system with unit-sample response
h(n) = [h(0), h(1), ....., h(N-1)] with z transform given by
H(z).
The system is stable if ( )k=-
h k
Finite sequence is generally stable as the absolute sum of finite sample values is always finite
(17)
Example ( ) = 1
0
h n
for n
otherwise
0
( )k=-
h kk
10
The system is unstable
Stability of Transfer FunctionStability of Transfer Function
H z
b z
a z
kk
k N
N
kk
k
MF
P
11
Generalized LTI transfer function
b zkk
k N
N
F
P
The numerator is < for finite NP and NF
1
11
a zk
k
k
MThe denominator can lead to unstability
Stability of Transfer FunctionStability of Transfer Function
Stability of a digital system depends on the pole locations that are contained in
k
kk
M
d z1 11
M
k
kk za
zH
1
1
1
after partial fraction decomposition
M
k
nkk
M
kk nudnh)n(h
11
It can be easily shown that
Stability of Transfer FunctionStability of Transfer Function
M
k
nkk
M
kk nudnh)n(h
11
For a stable system,
h n d u nkn
k kn
n
0 0
k kn
n
d0
For finite summation result, |dk| < 1.
Stability of Transfer FunctionStability of Transfer Function
For a stable system,
h n d u nkn
k kn
n
0 0
k kn
n
d0
For finite summation result, |dk| < 1.
dk are the poles of H’(z)
M
k
nkk
M
kk nudnh)n(h
11
Stability of Transfer FunctionStability of Transfer Function
For a stable system,
h n d u nkn
k kn
n
0 0
k kn
n
d0
For finite summation result, |dk| < 1.
dk are the poles of H’(z)
|dk| < 1 means that the poles of a stable system must lies within the unit circle in the z plane.
M
k
nkk
M
kk nudnh)n(h
11
Region of Convergence (ROC) of Transfer FunctionRegion of Convergence (ROC) of Transfer Function
A transfer function H(z) is only useful if it is finite, i.e.,
H z h n z n
n
Two classes of digital filters
y (n) = ak y(n-k) +
k=1
Mbk x(n-k)
k= -NF
NF
(13)
The generalised finite order LTI system
1. Finite Impulse Response (FIR) Filter
2. Infinite Impulse Response (IIR) Filter
formulates an IIR filter
Two classes of digital filters
y (n) = bk x(n-k)k= 0
N-1(18)
When ak = 0 for all values of k,
formulates an FIR filter
h(n) = [h(0), h(1), ....., h(N-1)] = [b0, b1, .......bN-1]
As N is finite, according to eqn. (17), FIR filter is inherently stable
FIR filters
z-1 z-1 z-1
h(N-1)
x(n)
y(n)
Figure 24
h(2)h(1)h(0)
H z h k z
h z h z h N
z
k
Nk
N N
N
0
1
1 2
1
0 1 1..... (19)
FIR filters
Finite Impulse Response (FIR) Filter can guarantee linear phase
With linear phase, all input sinsuoidal components are delayed by the same amount. Consider
x n X z x n k X z z k
x n k X e ej j k In the frequency domain,
Phase delay for frequency = k
Phase Distortion - example
x n cos n cos n1 0 02( ) Given:
Y e H e X e X e ej j j j jk
According to previous analysis,
y n cos n k cos n k( ) ( ) ( ) 0 02
y n x n h n( ) ( ) ( ) 1
and
H e ej j( )
x n k X e ej j k
(a linear phase X-function)
(Same signal as before, only delay added to each sample)
Phase Distortion - example
x n cos n cos n1 0 02( ) Given:
y n cos n cos n( )
0 04
2
y n x n h n( ) ( ) ( ) 1
and
H efor
forj( )
/
/
4
0 3 2
3 20
0
y(n) is not the same as x1(n)
(a non-linear phase X-function)
Analogue Transfer Function H(s)
Inverse Fourier Transform h(t)
Sample Impulse Response h[n]
Corresponding Transfer Function H(z)
H(z) = H(s)?
h(t)
t
Analogue filter: y(t) = x(t) * h(t)
Y(s) = X(s)H(s)
Analogue filter: y(t) = x(t) * h(t)
Y(s) = X(s)H(s)
as
sH
1
Given
Applying inverse Laplace Transform
ateth
h(t)
t
1 unit
Digital filter: Sampled and Digitized x(t) and h(t)
x(t) -> x(n) , h(t) -> h(n)
y(n) = x(n) * h(n)
Y(z) = X(z)H(z)
h(t)
t
1 unit
H z h n z n
( )0
If h(t) is sampled at unit interval, we have
h(t)
t
1 unit
H e h n ej jn
( )0
e ean jn
0
1
1 e ea j
h(t) = e-an for t > 0
However, h(t) is sampled at interval of TS instead of the following,
h(t)
t
1 unit
0
0
)(
)(
m
njj
n
n
enheH
znhzH
Does sampling rate affects the above transfer function?
If h(t) is sampled at interval of TS,
h(t)
t
TS unit
1. h(n) will be replace with h(nTS) 2. Frequency will be scaled by 1/TS
Answer this question by computing the transfer function again based on the new sampling rate
If h(t) is sampled at interval of TS,
h(t)
t
TS unit
1. h(n) will be replace with h(nTS) 2. Frequency will be scaled by 1/TS
0
// )(n
TjnS
Tj SS enTheH
If h(t) is sampled at interval of TS,
h(t)
t
TS unit
1. h(n) will be replace with h(nTS) 2. Frequency will be scaled by 1/TS
0
// )(n
TjnS
Tj SS enTheH
0
''
)(n
jnS
j enTheH
If h(t) is sampled at interval of TS,
h(t)
tTS unit
1. h(n) will be replace with h(nTS) 2. Frequency will be scaled by 1/TS
0
// )(n
TjnS
Tj SS enTheH
0
''
)(n
jnS
j enTheH
0
'
)(n
nS znThzH
The transfer function has similar form as before, may not need to re-compute the transfer function again.
Given (sampling period of 1 unit)
0n
nz)n(hzH
If sampling period changes to TS , then
0
'
)(n
nS znThzH
Suppose dtethjH tjAA
0
0
'
)(n
nS znThzH
If the analogue unit response is sampled by a period TS ,
Represents the analogue transfer function.
Is the digital response similar to the analogue response?
Suppose dtethjH tjAA
0
If the analogue unit response is sampled by a period TS ,
Represents the analogue transfer function.
Digital and Analogue responses are equal if the maximum frequency of the signal is restricted to
k
SSATj TkjTjHeH S )/2/(/
ST
M
(otherwise the images start to overlap each other)
(a single spectrum becomes an infinite string of replicas)
Given
1
1 e eaTjTS S
STjeH /
'
'
1
1
jaT
j
eeeH
S
11
1
ze
zHSaT
jaj
eeeH
1
1 11
1
ze
zHa
Given a desire response HD(), find hD(n)
h n H e e dD Dj j n( ) ( )
1
2
Applying inverse Fourier Transform, we have,
(20)
Noted that: n is extended to These kind of filter is not available in practice
with n being infinite and assuming Impulse Invariant, the digital transfer function will be identical to the Analogue ones.
In practice, the FIR structure in figure 24 cannot be infinite, hence n is restricted by a window function wR(n)
2/1-Nn1)/2-N-
for
nhnwnh DRN (21)
jR
jD
jN eWeHeH (22)
circular convolution
Rectangular Window
Hanning Window
Hamming Window
Blackman Window
1
2cos5.05.0
N
nnw
otherwise
Nnnw
0
2/11
1
2cos46.054.0
N
nnw
1
4cos08.0
1
2cos5.042.0
N
n
N
nnw
Analogue Transfer Function H(s)
Inverse Fourier Transform h(t)
Sample Impulse Response h[n]
Apply window function w[n]h[n]
Modified Transfer Function H’(z)
Assume Impulse Invariant
Consider a low pass response H(s)
|H ()|
c-c 0 -
Without window
c-c 0 -
|H ()|
With window
Side lobes
1. Side lobes decreases stop band attenuation A
c-c 0 -
|H ()|
A
Window A (dB)
Rectangular 21
Hanning 44
Hamming 55
Blackman 75
2. Window determines the length of the FIR filter
Consider a Low Pass Frequency Response
P0
|H ()|
S
Desired Pass Band Edge Frequency
Stop Band Edge Frequency
Transition Width (TW)
Actual Pass Band Edge Frequency
Relations between the Window, Filter length and A
z-1 z-1 z-1
h(N-1)
x(n)
y(n)
h(2)h(1)h(0)
N
75Blackman
55Hamming
44Hanning
21Rectangular
A (dB)Window
TW
f s91.0
TW
f s32.3
TW
f s44.3
TW
f s98.5
fs is the sampling frequency
|HD()|1
c-c 0 -
Figure 25
H efor
oDj c
1
0
therwise c
An ideal LPF
h n e d e dDj n j n( )
1
21
1
2
n
nsin c
n -n
Figure 26
Due to windowing, the pass band edge frequency will be shifted to higher frequency end.
Usually the revised pass band edge is taken to be the middle point of the Transition Region, i.e. 2
TWc
hD(n) will be revised as n
nsin
Next select the window that complies with the stop band attenuation A.
Determine the length of the filter N from fS and TW
The Prolate Spheroidal Wave Sequence (Slepian 1978)
The Prolate sequence is a real sequence of lengh N+1 and unit energy.
Aims at mininizing ripple energy
2jeV
0
Optimal energy concentration at low frequency
Assuming the sequence is casual and of length N+1, i.e.,
N
n
nznvzV0
deV j
S
2
Since the sequence is unit energy, we have
110
2
0
2 d
eVnv jN
Compute the energy contained in the sequence
Define an objective function to denote the pass band energy as
deV j
2
0
Maximizing is equivalent to minimizing the stop band energy
i.e., Optimal energy concentration at low frequency
jj eneV evT
veve !* jjjjj eeeVeVeV 2
Let TNvvvv .....v 210 TNzzzz .....e 211
vRv
ddeV j
0
T2
0
R is a (N+1)x(N+1) matrix with the (m,n) element equals to
nmjnme nmj sincos
0T vQv
Splitting R() into real and imaginary parts as
QPR j
Nnmmn nm
nmdnmp
,
sincos 00
vPv T
Each entry in
vvvv
dP
dR
deV j
0
T
0
T2
0We have
is real, hence
and
dP0
Maximization based on Rayleigh’s principle
1 kk vPv
econveniencfor dropping TT PvvvPv
The objective function is maximized if v is the eigenvector corresponding to the maximum eigenvalue of P.
This can be found by the “power method” which is an ilterative process starting with an arbitrary value for v0.
vvvvPvv TTT
maxmax
Search for v in a vast space!
Step 1 0 kSet
Step 2 kvCompute P
Step 3 kk vves eigenvaluthe set ofFind P :
Step 4 kgenvaluemaximum eiFind :
Step 5 kkk PvvCompute /1
Step 6 2 1 StepGotokk ,
Method does not guarantee the best (optimal) solution and depends on the initial choice of vk
Better optimization methods:
Simulated Annealing. Binary Genetic Algorithm. Real Coded Genetic Algorithm. Particle Swarm Optimization.
0v
kv
Stuck in comfort zone!
Drive to higher value, but not the other way round
maxvBest position, needs to leave the comfort zone first
x
Optimal window does not imply optimal filter.
nN
n
znhzH
0
A LPF is optimized if the passband and stopband error are minimum. Consider a linear phase FIR filter. N is even and h(n)=h(N-n)
R
Mjj HeeH
cbcos/
TNM
nnR nbH
2
0
The amplitude response is:
and
Pbbbccb TTTjS
ddeHE
ss
2
The stopband energy is
bcbc Tj
RHeH 22
dnmp
s
mn coscos
The m,n entry of P is
ES should be zero, otherwise it will become the “stopband error”.
cbcbb 1TTT
The stopband error is
TTRH bcb 00
d
where
EP
T
TP
0
11 ccQ
Qb,b
The error energy at passband =
The pass band should be flat from DC onwards as
RbbQbbbPb TTT 1
Which can be rewritten as
PS EE 1
QPR 1
Where
An objective function can now be defined as
The minimum value corresponding to the eigenvector of R with the minimum eigenvalue.
However the transfer functions of FIR filters are restricted in certain form (as shown below). IIR filters are more flexible and have a counterpart in analog filters.
FIR filters are to design, optimize, and implement. It is also possible to select different window functions to adjust the stop band attenuation.
H z h k z
h z h z h N
z
k
Nk
N N
N
0
1
1 2
1
0 1 1.....
Eqn. (19) shows that the transfer function of FIR filters are restricted in certain form. IIR filters are more flexible and have a counterpart in analog filters.
Time signal Filter Output
Analog Transfer Function
Digital Transfer Function
DigitalFilter Output
Figure 27
Stability of filtersAssigning poles at s=-a to H(s) and s=a to H(-s) results in a stable system, i.e.,
H sa s
1
General form of Transfer Function
H s
s z s z s z s z
s p s p s p s p
i N
j N
1 2
1 2
.... ....
.... ....(25)
Stability of filtersAssigning poles at s=-a to H(s) and s=a to H(-s) results in a stable system, i.e.,
H sa s
1
A pole at s = -pj results in a -20db per decade drop at f = pi
A zero at s = -zi results in a +20db per decade rise at f = zj
H s
s z s z s z s z
s p s p s p s p
i N
j N
1 2
1 2
.... ....
.... ....
General form of Transfer Function
(25)
f
db p1 z1 z2 p2
Figure 28
Img
Re
z plane
j
s plane
z=1z=-1
TS
TS
s=0
The problem is obvious: define on the unit circleis limited, extends to infinity!
fs
20
fs
16
2fs
16
4fs
16
3fs
16
5fs
16
6fs
16
7fs
16
fs
160
2fs
16
3fs
16
7fs
16
6fs
16
5fs
16
4fs
16
- Digital Frequency - Analogue Frequency
For a digital N point sampling lattice, the maximum frequency it can represent is fs/2 (i.e. 1/2TS or rads/s)
The frequency resolution is 2/N
N=16
extends to infinity!
fs
20
fs
16
2fs
16
4fs
16
3fs
16
5fs
16
6fs
16
7fs
16
fs
160
2fs
16
3fs
16
7fs
16
6fs
16
5fs
16
4fs
16
- Digital Frequency - Analogue Frequency
For a digital N point sampling lattice, the maximum frequency it can represent is fs/2 (i.e. 1/2TS or rads/s)
The frequency resolution is 2/N
N=16fs
16 2fs
16
3fs
16
4fs
16
fs
2= /TS
extends to infinity!
fs
20
fs
16
2fs
16
4fs
16
3fs
16
5fs
16
6fs
16
7fs
16
fs
160
2fs
16
3fs
16
7fs
16
6fs
16
5fs
16
4fs
16
- Digital Frequency - Analogue Frequency
For a digital N point sampling lattice, the maximum frequency it can represent is fs/2 (i.e. 1/2TS or rads/s)
The frequency resolution is 2/N
N=16fs
16 2fs
16
3fs
16
4fs
16
fs
2
9fs
16
10fs
16?
extends to infinity!