DSP: IIR Filter Design via Bilinear Transform

Digital IIR Filter Design via Bilinear Transform

D. Richard Brown III

D. Richard Brown III 1 / 12 DSP: IIR Filter Design via Bilinear Transform Basic Procedure

We assume here that we’ve already decided to use an IIR filter. The basic procedure for IIR filter design via bilinear transform is: 1. Determine the CT filter class: 1.1 Butterworth 1.2 Chebychev Type I or Type II 1.3 Elliptic 1.4 ... 2. Transform the DT filter specifications to CT (sampling period Td is arbitrary) including prewarping the band edge frequencies 2 3. Design CT filter based on the magnitude squared response |Hc(jΩ)| I Determine filter order I Determine cutoff frequency 4. Determine Hc(s) corresponding to a stable causal filter 5. Convert to DT filter H(z) via bilinear transform such that  2 1 − z−1  H(z) = Hc −1 Td 1 + z

D. Richard Brown III 2 / 12 DSP: IIR Filter Design via Bilinear Transform Bilinear Transform

Idea: Given a causal stable LTI CT filter Hc(s), we simply substitute 2 1 − z−1  s = −1 Td 1 + z to get H(z).

This substitution is based on converting Hc(s) to a differential equation, performing trapezoidal with step size Td to get a difference equation, and then converting the difference equation to a H(z).

Remarks:

I Direct method to go from Hc(s) to H(z) that always works without going through the time-domain.

I This is a one-to-one mapping between points in the s-plane and z-plane.

I Points in the left-half (right-half) s-plane are mapped to points inside (outside) the unit circle on the z-plane.

I There is no even if Hc(s) is not bandlimited.

D. Richard Brown III 3 / 12 DSP: IIR Filter Design via Bilinear Transform Bilinear Transform: Simple Example

1 Suppose you are given a causal LTI CT system with Hc(s) = s−a . We can compute H(z) straightforwardly with a little algebra:

H(z) = H (s)|  −1  c s= 2 1−z Td 1+z−1 1 = 2  1−z−1  −1 − a Td 1+z −1 Td(1 + z ) = −1 −1 2(1 − z ) − aTd(1 + z ) −1 Td(1 + z ) = −1 (2 − aTd) − (2 + aTd)z β(1 + z−1) = (bilinar transform) 1 − αz−1 This is quite different than the H(z) we computed via : 1 H(z) = (impulse invariance) 1 − eaTd z−1

D. Richard Brown III 4 / 12 DSP: IIR Filter Design via Bilinear Transform Bilinear Transform:

Given a causal stable LTI CT filter Hc(s), we can compute H(z) with via the jω bilinear transform. What is the relationship between Hc(jΩ) and H(e )? jω Recall that Hc(jΩ) = Hc(s)|s=jΩ and H(e ) = H(z)|z=ejω . Substituting these into the bilinear transform formula, we get

2 1 − e−jω  jΩ = −jω Td 1 + e 2 ejω/2 − e−jω/2  = jω/2 −jω/2 Td e + e 1 ! 2j (ejω/2 − e−jω/2) = 2j 1 jω/2 −jω/2 Td 2 (e + e ) 2j = tan(ω/2) Td

2 −1 Hence Ω = tan(ω/2) or ω = 2 tan (ΩTd/2). This nonlinear relationship is Td called “frequency warping”.

D. Richard Brown III 5 / 12 DSP: IIR Filter Design via Bilinear Transform Bilinear Transform: Frequency Warping

1

0.8

0.6

0.4

0.2 ) π

0 (times ω −0.2

−0.4

−0.6

−0.8

−1 −4 −3 −2 −1 0 1 2 3 4 ΩT (times π)

D. Richard Brown III 6 / 12 DSP: IIR Filter Design via Bilinear Transform Bilinear Transform: Consequences of Frequency Warping

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. 2 Ωp = tan(ωp/2) Td 2 Ωs = tan(ωs/2) Td

D. Richard Brown III 7 / 12 DSP: IIR Filter Design via Bilinear Transform Bilinear Transform Lowpass Design Ex.

We start with the desired specifications of the DT filter. Suppose ωp = 0.2π, ωs = 0.3π, 1 − δ1 = 0.89125, and δ2 = 0.17783.

Our first step is to convert the DT filter specs to CT filter specs via the pre-warping equations. Setting Td = 1, we can compute 2 Ωp = tan(0.2π/2) = 0.6498 Td 2 Ωs = tan(0.3π/2) = 1.0191 Td Assuming a Butterworth design, the squared magnitude response given by 1 |H (jΩ)|2 = (1) c  2N 1 + jΩ jΩc We can substitute our specs directly into (1) to write  0.6498 2N  1 2 1 + ≤ Ωc 0.89125  1.0191 2N  1 2 1 + ≥ Ωc 0.17783 D. Richard Brown III 8 / 12 DSP: IIR Filter Design via Bilinear Transform

Determine the N and Ωc We can take the previous inequalities and write them as equalities as

0.64982N  1 2 1 + = Ωc 0.89125 1.01912N  1 2 1 + = Ωc 0.17783 We have two equations and two unknowns. Solving for N, we get N = 5.305. Note that N must be an integer, so we can choose N = 6.

We now can decide whether to pick Ωc to match the passband spec (and exceed the stopband spec) or match the stopband spec (and exceed the passband spec). Since we don’t need to worry about aliasing when using bilinear transforms, we often choose the latter.

Plugging N = 6 into the second equality and solving for Ωc yields Ωc = 0.766. D. Richard Brown III 9 / 12 DSP: IIR Filter Design via Bilinear Transform Bilinear Transform Lowpass Butterworth Filter Design Ex.

The remaining steps in deriving Hc(s) are identical to those we saw when looking at impulse invariant filter design. By choosing the poles of Hc(s)Hc(−s) in the left half plane, we have 0.20238 H (s) = c (s2 + 0.3966s + 0.5871)(s2 + 1.0836s + 0.5871)(s2 + 1.4802s + 0.5871) We then substitute 2 1 − z−1  s = −1 Td 1 + z to get the final result

0.0007378(1 + z−1)6 H(z) = (1−1.2686z−1 +0.7051z−2)(1−1.0106z−1 +0.3583z−2)(1−0.9044z−1 +0.2155z−2) which can be implemented in any of the usual realization structures (direct, cascade, parallel, ...).

D. Richard Brown III 10 / 12 DSP: IIR Filter Design via Bilinear Transform Bilinear Transform Lowpass Butterworth Filter Design Ex.

10 CT Butterworth LPF DT Butterworth LPF via bilinear transform 0

−10

−20

−30

−40 magnitude response −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 π)

D. Richard Brown III 11 / 12 DSP: IIR Filter Design via Bilinear Transform Bilinear Transform Lowpass Butterworth Filter Design Ex.

2 CT Butterworth LPF DT Butterworth LPF via bilinear transform 0

−2

−4

−6

−8

−10 magnitude response

−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 π)

D. Richard Brown III 12 / 12