Nov 26, 2001 ... EE518 Digital Signal Processing. University of Washington. Autumn 2001. Dept.
of Electrical Engineering. Lecture 16: Filter Design: Impulse ...
EE518 Digital Signal Processing Autumn 2001
University of Washington Dept. of Electrical Engineering
Lecture 16: Filter Design: Impulse Invariance and Bilinear Transform Nov 26, 2001 Prof: J. Bilmes
TA: Mingzhou Song
16.1 Introduction to Filter Design Filter design is the most important practical application of this course. – Filter, any modification of the signal according to design specifications. – Frequency selectivity – Causal filters (real time without delay) – Note ideal filters are not realizable. We can’t have perfect magnitude response. For example, the ideal low pass filter is not realizable because it requires infinite length sinc function. We would like causal filters: – IIR ok – FIR sometimes even better Ex: typical way to specify low pass filter Design specifications for a low pass filter is shown in Fig 16.1.
|H(e jω )| Transition
1 + δ1 1 − δ1 PSfrag replacements
Stopband
Passband
δ2 ωp
ωs
π
Figure 16.1: Low pass filter design specifications.
16-1
ω
16-2
In the low pass filter, δ1 is the tolerance at the pass band, δ2 is the tolerance at the stop band. In transition band, we do not care too much about what happens. The quantitative relationship for the maganitude response within the pass band and stop band are given as follows: 1 − δ1 ≤ |H(e jω | ≤ 1 + δ1 , jω
|H(e | ≤ δ2 ,
|ω| ≤ ω p ωs ≤ ω p ≤ π
where δ1 and δ2 are usually small positive numbers, e.g., δ1 can be 10−6 or 10−9 . Usually discrete time filter designis done in terms of normalized discrete time. Normalization in time by T is equivalent to normalization in frequency by 1/T . So in frequency domain, π/T is normalized to π. Or even sometimes for plotting, frquency is further normalized by π and a normalized 1 corresponds to π in radians. Note: – If we use linear phase systems, we can just specify magnitude response, which will produce a system with only a delay and is easy to deal with. – If we use IIR system, we might have to deal with phase. There are two different design procedures: 1) start with continuous time filter and then map it to a discrete time filter. So we can use analog techniques to do filter design. 2) use new techniques to design filter directly in discrete time.
16.2 Design of Discrete Time Filter from Continuous Time Filter We can apply transform technique to obtain H(z) and h[n] for discrete time fiters from Hc (s) and hc (t) as shown below: Hc (s) hc (t)
Transform Techniques
H(z) h[n]
Recall Laplace transfrom, a generalization of Fourier transform, is defined as X(s) =
Z ∞
−∞
x(t)e−st dt
(16.1)
Plugging jΩ into X(s) we get Fourier transform X( jΩ). Here is a summary of three continuous time low pass filters. Butterworth Filters The magnitude response of Butterworth filters are in the following form |Hc ( jΩ)| =
1 1 + (Ω/Ωc )2N
as shown in Fig 16.2 Properties: 1) N-th order filter has first (2N − 1) derivatives of |Hc ( jΩ)|. The derivatives are zero at Ω = 0.
(16.2)
16-3
1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0
0
5
10
15
20 f (Hz)
25
30
35
40
Figure 16.2: Magnitude response of Butterworth filters. 2) monotonic in stop and pass band. 3) It is hard to control where approximately the tolerance will be. 4) Error reduces as N increases, but the filter is harder to implement. Chebychev Filters The magnitude response of Chebychev filters is |Hc ( jΩ)| = where
1 1 + ε2VN2 (ω/ωc )
(16.3)
VN (x) = cos(N cos−1 x)
Note VN (x) can be described by the following initial values and recurrence equation: N = 0,
V0 (x) = 1
N = 1,
V1 (x) = cos(cos−1 x) = x
N = 2, V2 (x) = cos(N cos−1 x) = 2x2 − 1 VN+1 (x) = 2xVN (x) −VN−1 (x) The magnitude response of Chebychev filter is shown in Fig 16.3. Properties: 1) equiripple in passband (resp. stop band) and monotonic in the stop band (resp. pass band) for type I (resp type II) filters. 2) better for design to have error distributed over pass band or stop band by equiripple and can often lower N which leads to simpler implementation. Elliptic Filters The magnitude response of Elliptic filters is |Hc ( jΩ)| =
1 1 + ε2VN2 (Ω)
(16.4)
16-4
1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0
0
5
10
15
20 f (Hz)
25
30
35
40
Figure 16.3: Magnitude response of Chebychev filters. where VN (Ω) is a Jacobian elliptic function. The magnitude response of elliptic filter is shown in Fig 16.4. 1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0
0
5
10
15
20 f (Hz)
25
30
35
40
Figure 16.4: Magnitude response of elliptic filters. Error distribute over both pass band and stop band. This is as best as can be done for given Ω p , δ1 , δ2 , and transitive region (Ω p to Ωs ).
16.2.1
Impulse Invariance
Sampling the continuous time impulse response with sampling period Td , we obtain h[n] = Td hc (nTd ) Then H(e jω ) =
∞
∑
k=−∞
If Hc ( jΩ) = 0 for |Ω| ≥ π/Td ,
Hc ( j
ω 2π + j k) Td Td
H(e jω ) = Hc ( jω/T d)
|ω| ≤ π
16-5
Will aliasing occur for the previous Hc ( jΩ)? Yes. Consider Butterworth filter. But if order of filter N is high enough, aliasing will be small enough to be acceptable, i.e., within our tolerance δ2 . Question: Can we control aliasing by changing Td , the sampling period? Choose cut-off frequency ωc in discrete time. Transform to Ωc = ωc /Td . Larger Td needs a continuous filter with larger Ωc and wider frequency spread, so Td doesn’t control aliasing. Aliasing can is controlled by order N and types of filters. Question: How to choose Td ? Choose Td so that relevant details of hc (t) is captured. Continuous to Discrete-Time in terms of Laplace to z-Transform If a causal LTI system has
N
Hc (s) =
Ak
∑ s − sk
k=1
then the impulse response is hc (t) = By impulse response,
0 ∑Nk=1 Ak esk t
t 0 → |z| > 1
Hence, a causal and stable continuous time system will be mapped to a causal and stable discrete-time system. 3) jΩ is mapped to unit circle. Why? z=
1 + (Td /2)s 1 + σ(Td /2) + jΩ(Td /2) = 1 − (Td /2)s 1 − σ(Td /2) − jΩ(Td /2)
When σ = 0, z=
1 + jΩ(Td /2) 1 − jΩ(Td /2)
which says
|z| = 1
Why is unit circle spanned? σ + jΩ = s =
2 2 1 − e− jω = j tan(ω/2) Td 1 + e− jω Td
So we have 2 tan(ω/2) Td σ =0
Ω=
Therefore
ω = 2 tan−1 (ΩTd /2)
which is shown in Fig 16.5 π
PSfrag replacements
ω
0 −π Figure 16.5: ω − Ω plot for bilinear transform. An example is shown in Fig 7.8 (O&S, pg 452). Some of the bilinear transform mapping relationships are shown in Fig 16.6. Points: 1) 2) 3)
σ < 0 ←→ |z| < 1 σ > 0 ←→ |z| > 1 jΩ ←→ e jω
Ω
16-7
jΩ s-plane 2/Td
−4/Td
0
−2/Td
1/Td
2/Td
4/Td
σ
−2/Td
z-plane
|z| = 1
replacements
−1/Td
−3
−2
0
1
−1
Figure 16.6: Bilinear mapping between s-plane and z-plane.
2
3
16-8
4) real axis mappling – the black “x” at z = −1 comes from s = ±∞ and s = ± j∞. – the red “x” at z = 1 comes from s = 0. – as s goes from −∞ to 0, z goes from −1 to 1. z = 0 at s = −2/Td (light green “x”). – as s goes from 0 to 2/Td , z goes from 1 to ∞. – as s goes from 2/Td to ∞, z goes from −∞ to −1. 5) the yellow line moves up, smaller yellow circles. 6) the pink line moves down, smaller pink circles. 7) light blue circle bigger than red circle (|z| = 1) is vertical line between σ = 0 and σ = 2/Td . 8) dark blue circle (on the left) is vertical s-plane line. Other notes: – this produces both frequency warping and phase warping, i.e., linear phase in continuous time maps to non-linear phase in discrete time. – the technique is particularly good idealized functions that are piecewise constant such as high-pass filters (HPF), low-pass filters (LPF), band-pass filters (BPF), etc., since they are easy to analyze in terms of the endpoints where the responses change.