ECE503: Digital Filter Design: D. Richard Brown III
ECE503: Digital Filter Design: D. Richard Brown III
WPI
26-March-2012
Lecture 9 Topics
Within the broad topic of digital filter design, we are going to focus on
the design of LTI IIR discrete-time filters from continuous-time filters.
h̄(t) h[n]
continuous-time discrete-time
H̄(s) H̄(Ω) H(ω) H(z)
1. Impulse invariance
2. Bilinear Transform
3. Specification of filter characteristics
4. Frequency transformation of lowpass IIR filters
Motivation/Applications
Chapter 10 of your textbook covers the design of DT FIR filters (we will
not be covering this). Our focus on DT IIR filter design is motivated by
the following facts:
1. All practical LTI CT systems are IIR.
2. To meet a given set of filter specifications, the order of an IIR filter
that meets the specifications is typically much lower than the order of
an FIR filter that meets the same specifications. Hence the
computational complexity of DT IIR filters is typically much less than
DT FIR filters that meet the same specifications.
Impulse Invariance
Given a causal LTI CT system impulse response h̄(t), we can write the DT
impulse response
% CT system 1
% H(s) = 1/(s-a) CT
a = -0.5; h[n]
0.9 Matlab impulse response of H(z)
tfinal = 20;
ctnum = 1;
0.8
ctden = [1 -a];
ctsys = tf(ctnum,ctden);
[y,t] = impulse(ctsys,tfinal); 0.7
plot(t,y,’r’)
impulse response 0.6
% DT system
T = 0.5; 0.5
alpha = exp(a*T);
dtnum = [1 0]; 0.4
dtden = [1 -alpha];
dtsys = tf(dtnum,dtden,T); 0.3
[dty,dtt] = impulse(dtsys,tfinal);
hold on
0.2
n=0:length(dtt)-1;
plot(dtt,alpha.^n,’b+’);
0.1
stem(dtt,dty);
hold off
xlabel(’time’); 0
0 2 4 6 8 10 12 14 16 18 20
ylabel(’impulse response’); time
legend(’CT’,’h[n]’,’Matlab impulse response of H(z)’);
% step responses 5
% note these results are consistent with CT
% the final value theorems Matlab step response of H(z)
4.5
[ys,ts] = step(ctsys,tfinal);
[dtys,dtts] = step(dtsys,tfinal);
4
figure(2)
plot(ts,ys,’r’)
hold on 3.5
stem(dtts,dtys);
hold off 3
step response
xlabel(’time’);
ylabel(’step response’); 2.5
legend(’CT’,’Matlab step response of H(z)’);
2
1.5
0.5
0
0 2 4 6 8 10 12 14 16 18 20
time
In general, you can pick a particular input and match the response of the
DT system to the response of the CT system for that input. But the
response to other inputs will be different.
WPI D. Richard Brown III 26-March-2012 9 / 33
ECE503: Digital Filter Design
where each ak is distinct (no repeated roots). Using linearity, we can write
N
!
X
ak t
h̄(t) = bk e µ(t).
k=1
1
When we sample this at rate FT = T , we get the DT impulse response
N
! N
!
X X
h[n] = b k e ak T n µ[n] = ak T n
bk (e ) µ[n]
k=1 k=1
which has z-transform
N
X bk
H(z) =
1 − eak T z −1
k=1
with ROC extending outward from the largest magnitude pole.
WPI D. Richard Brown III 26-March-2012 10 / 33
ECE503: Digital Filter Design
% CT system 1
% H(s) = b1/(s-a1)+b2/(s-a1)^2 CT
a1 = -0.5; h[n]
Matlab impulse response of H(z)
b1 = 1;
b2 = -2; 0.5
tfinal = 20;
ctnum = b1*[1 -a1]+[0 b2];
ctden = [1 -2*a1 a1^2];
ctsys = tf(ctnum,ctden);
impulse response
0
[y,t] = impulse(ctsys,tfinal);
plot(t,y,’r’)
% DT system
−0.5
T = 0.5;
alpha = exp(a*T);
dtnum = b1*[1 -alpha 0]+b2*T*alpha*[0 1 0];
dtden = [1 -2*alpha alpha^2];
−1
dtsys = tf(dtnum,dtden,T);
[dty,dtt] = impulse(dtsys,tfinal);
hold on
n=0:length(dtt)-1;
plot(dtt,b1*alpha.^n+b2*T*n.*alpha.^n,’b+’); −1.50 2 4 6 8 10 12 14 16 18 20
stem(dtt,dty); time
hold off
xlabel(’time’);
ylabel(’impulse response’);
legend(’CT’,’h[n]’,’Matlab impulse response of H(z)’);
Remarks:
◮ If H̄(Ω) is bandlimited such that H̄(Ω) ≈ 0 for all Ω ≥ Tπ , then there will be
negligible overlap in the sum of shifted spectra and
1 ω
H(ω) ≈ H̄ for |ω| ≤ π
T T
Hence, the DT system designed via impulse invariance accurately emulates
the CT system’s frequency response (and can be scaled if desired).
◮ If H̄(Ω) is not bandlimited, e.g. H̄(Ω) is a notch filter, there will be aliasing
and the resulting DT system’s frequency response is not likely to be an
accurate emulation of the CT system’s frequency response.
WPI D. Richard Brown III 26-March-2012 13 / 33
ECE503: Digital Filter Design
|H(ω)|
1
1 − δ1
δ2
ω
ωp ωs π
We start with the desired specifications of the DT filter. For this example,
we will use ωp = 0.2π, ωs = 0.3π, 1 − δ1 = 0.89125, and δ2 = 0.17783.
WPI D. Richard Brown III 26-March-2012 14 / 33
ECE503: Digital Filter Design
We will use the Butterworth filter approach in this example. Some facts
about Butterworth CT lowpass filters (from Appendix A.2):
1
|H̄(Ω)|2 = 2N
Ω
1+ Ωc
[⋆ ⋆ ⋆ details on board ⋆ ⋆ ⋆]
−10
−20
magnitude response
−30
−40
−50
−60
−70
−80
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
normalized frequency (times π)
Bilinear Transform
Idea: Given a causal stable LTI CT filter H̄(s), we simply substitute
2 1 − z −1
s=
T 1 + z −1
to get H(z).
Remark: This substitution is based on converting H̄(s) to a differential equation,
performing trapezoidal numerical integration with step size T to get a difference
equation, and then converting the difference equation to a transfer function H(z).
One appeal of the bilinear transform is that we have a direct method to go from
H̄(s) to H(z) that always works without going through the time-domain.
Your textbook shows:
◮ This is a one-to-one mapping between points in the s-plane and z-plane.
◮ Points in the left-half (right-half) s-plane are mapped to points inside
(outside) the unit circle on the z-plane.
◮ There is no aliasing even if H̄(s) is not bandlimited.
WPI D. Richard Brown III 26-March-2012 19 / 33
ECE503: Digital Filter Design
1
=
2 1−z −1
T 1+z −1
−a
T (1 + z −1 )
=
2(1 − z −1 ) − aT (1 + z −1 )
T (1 + z −1 )
=
(2 − aT ) − (2 + aT )z −1
β(1 + z −1 )
=
1 − αz −1
This is quite different than the H(z) we computed via impulse invariance.
WPI D. Richard Brown III 26-March-2012 20 / 33
ECE503: Digital Filter Design
magnitude response
impulse response
0.6 3
0.4 2
0.2 1
0 0
0 5 10 15 20 0 0.5 1 1.5 2
time frequency (Hz)
Note the impulse invariant magnitude response is not scaled to match the
CTFT. Even if it were, it should be clear there is some aliasing here.
WPI D. Richard Brown III 26-March-2012 21 / 33
ECE503: Digital Filter Design
Given a causal stable LTI CT filter H̄(s), we can compute H(z) with via
the bilinear transform. What is the relationship between H̄(Ω) and H(ω)?
Recall that H̄(Ω) = H̄(s)|s=jΩ and H(ω) = H(z)|z=ejω . Substituting
these into the bilinear transform formula, we get
2 1 − e−jω
jΩ =
T 1 + e−jω
!
2 ejω/2 − e−jω/2
=
T ejω/2 + e−jω/2
1 jω/2 − e−jω/2 )
!
2j 2j (e
= 1 jω/2
T 2 (e + e−jω/2 )
2j
= tan(ω/2)
T
2
Hence Ω = T tan(ω/2) or ω = 2 tan−1 (ΩT /2).
WPI D. Richard Brown III 26-March-2012 22 / 33
ECE503: Digital Filter Design
0.8
0.6
0.4
0.2
ω (times π)
−0.2
−0.4
−0.6
−0.8
−1
−4 −3 −2 −1 0 1 2 3 4
ΩT (times π)
The good news is that we don’t have to worry about aliasing. The bad
news is that we have to account for frequency warping when we start from
a discrete-time filter specification.
Procedure:
1. Convert the DT filter specifications to CT filter specifications
including prewarping the band edge frequencies
2. Design a CT IIR filter to meet the specifications
3. Transform the CT filter to a DT filter via the bilinear transform
Steps:
1. Convert DT filter specs to CT filter specs (including pre-warping
frequencies).
2. Determine the required filter order N and CT cutoff frequency Ωc .
3. Determine H̄(s).
4. Determine H(z) via impulse invariance.
[⋆ ⋆ ⋆ details on board ⋆ ⋆ ⋆]
−10
−20
magnitude response
−30
−40
−50
−60
−70
−80
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
normalized frequency (times π)
−2
−4
magnitude response
−6
−8
−10
−12
−14
−16
−18
0.14 0.16 0.18 0.2 0.22 0.24 0.26 0.28 0.3 0.32 0.34
normalized frequency (times π)
prewarp
DT frequency design CT
lowpass filter bilinear transform H(z)
specifications
to CT
If you want a different type of filter, e.g. bandpass, there are two options:
convert CT
discrete-time prototype
filter specifications lowpass filter to bilinear transform H(z)
desired filter type
convert CT (Appendix B)
prewarp frequency specs
DT frequency design prototype
to a prototype CT lowpass filter
specifications CT lowpass convert DT prototype
to CT filter (Appendix B) bilinear transform lowpass filter to desired
to get prototype filter type via H(z)
DT lowpass filter spectral transformation
(table 9.1)
% prewarp frequencies
omega = [0.3 0.45 0.65 0.75]*pi;
Omega_prewarped = (2/T)*tan(omega/2);
−10
magnitude response
−20
−30
−40
−50
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
normalized frequency (times π)
Conclusions