Upload
others
View
6
Download
0
Embed Size (px)
Citation preview
Page 1 of 15
Chapter 10: Design of Digital Filters - IIR
With an understanding of sampling, rudimentary filter operations in the z domain, the Fourier series and transform the topic of filter design can be addresses.
Filters to discuss
finite impulse response infinite impulse response
Important characteristics: order/length/complexity, magnitude response, phase response, group delay, filter region or type, passband/transition band/stopband,
Matlab Support: http://www.mathworks.com/help/signal/ug/iir-filter-design.html
Infinite Impulse Response Filters
zeros and poles significantly lower order than FIR feedback implementation methods to translate from analog Laplace-domain to digital z-domain filters can be used
N
k
kk
M
k
kk
za
zb
zH
0
0
NN
NN
MM
MM
zazazaa
zbzbzbb
zA
zBzH
1
11
10
11
110
Typically, 10 a
N
kk
jw
M
kk
jw
N
kk
M
kk
MN
ez
e
e
d
p
z
zz
d
pzH jw
1
1
0
0
1
1
0
0
k
N
1kk
jwM
1k0
0ez zeMNw
d
pzH jw
jwez
g dz
zHdz
dw
wdw
lnRe
Page 2 of 15
10.3 Design of IIR Filters from Analog Filters
There are multiple methods to “approximate” the performance of analog filters in the digital domain.
A
A
BB
sasasasa
sbsbsbbsH
3
32
21
2210
1
D
D
P
zdzdzdzd
zpzpzppzH
3
32
21
1
32
21
10
1
IIR Filter Design Approach
(1) Convert the digital filter specification into an analog filter specification
(2) Determine the analog filter transfer function
(3) Transform the analog filter into a digital filter
How to accomplish step (3)
Convert from Laplace Domain to Z Domain using a zero order hold (Dorf). Proakis describes this as “Design by Approximation of the Derivatives (10.3.1)
Impulse Invariance Method: (Proakis 10.3.2) Make the digital filter matched the time sampled impulse response http://en.wikipedia.org/wiki/Impulse_invariance
Bilinear Transformation: (Proakis 10.3.3) Use an approximate mapping from the s-plane to the z-plane using a complex variable transformation http://en.wikipedia.org/wiki/Bilinear_transform
Page 3 of 15
10.3.1 IIR Filter Design by Approximation of Derivatives
Approximate derivatives by first order approximations As the sampling rates become significantly higher than Nyquist, the approximation
greatly improves.
The first order derivative approximation
T
TnyTny
dt
dy
Tnt
1
With “s” a derivative operator, set
T
zzYsYs
11
or T
zs
11
In addition the second derivative can be approximated as
TT
TnyTny
T
TnyTny
dt
yd
Tnt
211
2
2
22
2 212
T
TnyTnyTny
dt
yd
Tnt
or
21
2
212 121
T
z
T
zzs
To generalize, we substitute k
k
T
zs
11
Therefore we set
T
zs
a sHzH 11
Page 4 of 15
Mapping a value from the s-plane into the z-plane would be performed as 11 zTs
Tsz
1
1
For a sinusoidal signal in the s-plane where js
22 11
1
1
1
T
Tj
TTjz
This is a different mapping than previously discussed where Tsz exp In this mapping.
0z
T
1
2
1
2
1
11
1
11
122
j
TT
TTj
TT
z
0 1z
T
1
2
1
2
1
11
1
11
122
j
TT
TTj
TT
z
0z
The mapping places the s-domain LHP into a circle centered at ½ in the z-domain!
See example 10.3.1 in text for math/Matlab example.
Page 5 of 15
10.3.2 IIR Filter Design by Impulse Invariance
The impulse response is one method of characterizing the response of a system transfer function or filter. If it is an accurate representation, the digitization of the impulse response should generate a possible solution to the analog to digital conversion process. That is
,1,0, nTnhnh Based on sampling the continuous time signal xa(t) with spectrim Xa(F) at a sample rate Fs, we previously defined (section 6.1)
sk
sas F
FfwhereFkfXFfX
,
Setting the digital filters frequency response as
k
sas FkfHFfH
or in terms of T
k
a T
kH
TTH
21
If we generalize this formula based on the s to z domain mapping Tsz exp
k
aTsz T
kjsH
TzH
21exp
This maintains the mapping previously discussed where wjrTjTTsz expexpexp
and the mapping shown below
Page 6 of 15
Under the assumption that the transfer function in the s-domain can be described as
N
k k
ka ps
csH
1
the partial fraction expansion defines the impulse response
0,exp1
tfortpcthN
kkka
Discretizing
0,exp1
nforTnpcTnhnhN
kkka
The z-domain filter response is then
0 1
expn
nN
kkk zTnpczH
Manipulating, as always,
N
k n
n
kk zTpczH1
1exp
and for a stable system (poles less than zero)
N
k kk zTp
czH1
1exp1
1
the poles in the z-domain are Tpz kk exp
See example 10.3.3 in text for math example.
Page 7 of 15
10.3.3 IIR Filter Design by Bilinear Transformation
The most popular method of conversion is the bilinear transform
1
1
1
12
z
z
Ts
And
1
1
1
11
z
z
Tsa sHzH
This works well for w=0 and w=, but is warped in between these frequencies. To observe the “warping”,
wjrz exp and js
For
1
12
z
z
Ts
1exp
1exp2
wjr
wjr
Ts
wrr
wrj
wrr
r
Twjs
cos21
sin2
cos21
1222
2
Therefore,
wrr
r
T cos21
122
2
wrr
wr
T cos21
sin222
When taken on the “jw” axis, r=1 and
2
tan2
cos1
sin2 w
Tw
w
T
or
2
atan2T
w
Page 8 of 15
Graphically the warping appears as
If desired, the digital filter specification can be “pre-warped” before defining the analog filter. This would allow the bilinear transformed filter to more closely match the desired characteristics.
Prewarping allows the adjustment of the frequency relationship at one frequency point. At this point, the desired mapping will be 1.
See Example 10.3.4 for a numerical example without warping
Page 9 of 15
Prewarping
If we want the “translation” to be correct at a specific reference frequencies we can take.
2tan
2
2tan
2
refref w
T
w
T
Then the mapping becomes
2tan
2tan
w
wref
ref
And the transformation from s to z becomes
1
1
2tan
z
z
ws
ref
ref
See Example 10.3.4 for a numerical example with warping
Selecting a generic Warping Factor
As a consequence, the filter generation is often performed based on a fixed sample rate for T at T=2 and then the filter is frequency translated based on the desired sample rate. Notice that at T=2, the original mapping becomes
1
1
1
12
z
z
z
z
Ts
Page 10 of 15
10.3.4 Characteristics of Commonly Used Analog Filters
Butterworth (no ripple, all poles)
Chebyshev type 1 (ripple in passband, all poles)
Chebyshev type 2 (ripple in stop band, poles and zeros)
Elliptic or Cauer (ripple in passband and stopband, poles and zeros)
10.3.5 Examples of Filters Using Bilinear Transforms
So, what algorithm do you think Matlab uses when generating the digital version of a filter?
A prewarped bilinear transform makes sense. The prewarping must occur at the passband frequency for the low-pass segment of the filter.
Page 11 of 15
10.4 Frequency Transformation
10.4.1 Analog Transformation
For a transfer function in s, there are multiple “transformations” that can transform the defined function into various alternate forms.
For a prototype low pass filter, all the following can be performed:
Convert a prototype lowpass filter to a new lowpass filter with a different bandedge.
ssp
p
'
Transformation
sHsHsH
p
ppLPFp '
Convert a prototype lowpass filter to a highpass filter.
ss pp '
Transformation
sHsHsH pp
pHPFp
'
Convert a prototype lowpass filter to a bandpass filter.
1','
p
p
p forss
uu
uu
s
ss
2
Transformation
sHsHsH
p
ppLPFp '
uu
uuLPFBPFLPF s
sHsHsH
2
or
Page 12 of 15
Transformation
uu
uuppBPFp s
sHsHsH
2
1
Convert a prototype lowpass filter to a bandstop filter.
1','
p
p
p forss
uu
uu
s
ss
2
Transformation
sHsHsH
p
ppLPFp '
uu
uuLPFBSFLPF s
sHsHsH
2
or
Transformation
uu
uuppBSFp s
sHsHsH
21
Page 13 of 15
MATLAB Implementations
lp2lp.m
Lowpass to lowpass analog filter transformation. [NUMT,DENT] = lp2lp(NUM,DEN,Wo) transforms the lowpass filter prototype NUM(s)/DEN(s) with unity cutoff frequency of 1 rad/sec to a lowpass filter with cutoff frequency Wo (rad/sec). [AT,BT,CT,DT] = lp2lp(A,B,C,D,Wo) does the same when the filter is described in state-space form.
lp2hp.m
lp2hp Lowpass to highpass analog filter transformation. [NUMT,DENT] = lp2hp(NUM,DEN,Wo) transforms the lowpass filter prototype NUM(s)/DEN(s) with unity cutoff frequency to a highpass filter with cutoff frequency Wo. [AT,BT,CT,DT] = lp2hp(A,B,C,D,Wo) does the same when the filter is described in state-space form.
lp2bp.m
lp2bp Lowpass to bandpass analog filter transformation. [NUMT,DENT] = lp2bp(NUM,DEN,Wo,Bw) transforms the lowpass filter prototype NUM(s)/DEN(s) with unity cutoff frequency to a bandpass filter with center frequency Wo and bandwidth Bw. [AT,BT,CT,DT] = lp2bp(A,B,C,D,Wo,Bw) does the same when the filter is described in state-space form.
lp2bs.m
lp2bs Lowpass to bandstop analog filter transformation. [NUMT,DENT] = lp2bs(NUM,DEN,Wo,Bw) transforms the lowpass filter prototype NUM(s)/DEN(s) with unity cutoff frequency to a bandstop filter with center frequency Wo and bandwidth Bw. [AT,BT,CT,DT] = lp2bs(A,B,C,D,Wo,Bw) does the same when the filter is described in state-space form.
Page 14 of 15
10.4.2 Digital Transformations
See Table 10.8 on p. 733.
While possible, it may be easier to “reconstruct” the digital filter using the appropriate MATLAB application!
Page 15 of 15
MATLAB Implementations
firlp2hp Convert FIR lowpass filter to Type I FIR highpass filter
firlp2lp Convert FIR Type I lowpass to FIR Type 1 lowpass with inverse bandwidth
iirbpc2bpc
Transform IIR complex bandpass filter to IIR complex bandpass filter with different characteristics
iirlp2bp Transform IIR lowpass filter to IIR bandpass filter
iirlp2bpc IIR lowpass to complex bandpass transformation
iirlp2bs Transform IIR lowpass filter to IIR bandstop filter
iirlp2bsc Transform IIR lowpass filter to IIR complex bandstop filter
iirlp2hp Transform lowpass IIR filter to highpass filter
iirlp2lp Transform lowpass IIR filter to different lowpass filter
iirlp2mb Transform IIR lowpass filter to IIR M-band filter
iirlp2mbc Transform IIR lowpass filter to IIR complex M-band filter
iirlp2xc Transform IIR lowpass filter to IIR complex N-point filter
iirlp2xn Transform IIR lowpass filter to IIR real N-point filter
iirpowcomp Power complementary IIR filter