40
IIR Filter design (cf. Shenoi, 2006) The transfer function of the IIR filter is given by Its frequency responses are (where w is the normalized frequency ranging in [−π, π].

IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing

Embed Size (px)

Citation preview

Page 1: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing

IIR Filter design(cf. Shenoi, 2006)

The transfer function of the IIR filter is given by

Its frequency responses are (where w is the normalized frequency ranging in [−π, π].

Page 2: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing

When a and b are real, the magnitude response |H(ejw)| is an even function, and the phase response θ(jw) is an odd function.

Very often it is convenient to compute and plot the log magnitude of |H(ejw)| as

measured in dB.Linear phase:

Consider the ideal delay system. The impulse response is

and the frequency response is

210 |)(|log10 jweH

][][ did nnnh −= δ

djwnjwid eeH −=][

Page 3: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing

In this case, the magnitude and phase responses are

and

Hence, when time domain is a constant delay, it causes the frequency a “linear phase distortion.”

Sometimes we hope the filter response is linear phase, i.e., the phase response is linear with w.Eg. an ideal lowpass filter with linear phase (i.e., ideal low-pass but the output is delayed by nd samples in the time domain)

However, linear phase is difficult to achieve by using IIR filters, but it can be easily designed by using FIR filters.

1|][| =jwid eH

π<−=∠ || ][ wwneH djw

id

⎪⎩

⎪⎨⎧

<<<

=−

πwwwwe

eHc

cjwn

jwlp

d

,0,

|][|

Page 4: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing

Group delay: A convenient measure of the linearity of the phase is the group delay.

For the IIR filter, the group delay is

where

and

)]}([{)]([)( jwjw eHdwdeHgrdw ∠−==τ (unit: samples)

Page 5: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing

Since the state-of-the-arts of analog IIR filter is more advanced, the design of discrete-time IIR filter is usually an approximation of the analog one.

Three approximation criteria commonly used:The Butterworth approximationThe Chebyshev (minimax) approximation

Analog filtersrepresented by Laplace transform H(s).Substituting s=jw, we obtain its frequency response

(in terms of continuous Fourier transform).

Page 6: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing

where |H(jw)| and φ(jw) can be found by

Page 7: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing

Maximally Flat and Butterworth ApproximationMagnitude response of an ideal low-pass analog filter

showing the tolerances:

passband: [0, wp], transition band:[wp, ws], stopband: [ws, ∞]passband tolerance: δp, stopband tolerance: δs.

Page 8: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing

Butterworth response (or maximally flat magnitude response):

and now we have

Page 9: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing

Magnitude responses of Butterworth lowpass filters

normalized passband

Page 10: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing

D2n and n are the parameters of the Butterworth filter, where n is the order of this filter.

If, for example, the magnitude at the passband frequency Ωp, is , which means that the log magnitude required is −3dB, then we choose D2n = 1.

If the magnitude at the passband frequency Ω = Ωp = 1 is required to be 1 − δp, then we choose D2n, normally denoted by ε2, such that

If the magnitude at the bandwith Ω = Ωp = 1 is given as −Ap dB, the values ε2 is computed by

2/1

Page 11: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing

We get the formula

Let us consider the common case of a Butterworth filter with a log magnitude of −3dB at the bandwith of Ωp = 1 to develop the design procedure of Butterworth lowpassfilter. In this case, we use the function for the prototype filter, in the form

Page 12: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing

This satisfies the following properties:

Page 13: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing

Design theory of Butterworth lowpass filters

Let us consider the design of Butterworth lowpass filter for which (1) the frequency Ωp at which the magnitude is 3DB below the maximum value at Ω=0, and (2) the magnitude at another frequency Ωs in the stopband are specified. Since we only know that but want to infer H(ejΩ). Let us consider the relationship that

|H(ejΩ)|2 = H(ejΩ)H(−ejΩ).

We denote Ω = p/j, so

)1/(1|)(| 22 njH Ω+=Ω

Page 14: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing

There are n poles satisfying the following equations:

This gives us the 2n poles of H(p)H(−p), which are

and

In general,

These poles have a magnitude of one, and the angle between adjacent poles is equal to π/n.There are n poles in the left half plane and n poles in the right plane.

Note that for a continuous-time linear system, it is stable iff all poles lie in the left half plane.

Page 15: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing

Note that, for every pole of H(p) at p=pa, that lies in the left half-plane, there is a pole of H(−p) at p=−pa that lies in the right half-plane.Because of this property, we identify n poles that are in the left half of the p planes as the poles of H(p) so that it is a stable transfer function.The poles that are in the left half of the p plane are given by

When we have found these n poles, we construct the denominator polynomial D(p) of the prototype filter from H(p) = 1/D(p) from

Page 16: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing

Pole locations of Butterworth low-pass filters of orders n=6

Page 17: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing

The only unknown parameter at this stage of design is the order n of the filter function H(p). This is calculated using the specification that at the stopband frequency Ωs, the log magnitude is required to be no more than −As dB.

So we choose n as an integer satisfying

The pairs of poles from left and right half-planes can be found by the polynomial in the denominator D(p),

Their coefficients can be computed recursively from

where d0=1. The polynomial is referred to as Butterworth polynomials.

Page 18: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing
Page 19: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing

Chebyshev 1 Approximation:The Chebyshev 1 approximation for an ideal lowpass filter has equal-valued ripples in the passband . It is known as minimax approximation and also known as the equirippleapproximation.

The magnitude squared function of Chebyshevapproximation:

where Cn(Ω) is the Chebyshev polynomial of degree n. It is defined by

Page 20: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing

For n = 2, 3, 4, 5, these polynomials are

Page 21: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing

Chebyshev II Approximation: (or inverse Chebyshevfilters)Maximally flat at w=0; decreases monotonically as the frequency increases and has an equiripple response in the stopband.

The magnitude square function of the inverse Chebyshevlow pass filter: |H(jΩ)|2 =

Page 22: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing

Chebyshev I

Chebyshev II

Page 23: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing

Discrete-time IIR filterThe procedure used for designing discrete-time IIR filters employ different transformations of the form s = f(z) to transform H(s) into H(z).

Two methods:Impulse invarianceBilinear Transform

Please see the copy of book chapters (Oppenheim 1999, Section 7.1)

Page 24: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing

General concept on digital filter design (cf. D. Ellis, ColumbiaUniversity)

Page 25: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing
Page 26: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing

Discrete-time FIR filters

Page 27: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing

Discrete-time FIR filters

Page 28: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing

Linear Phase Discrete-time FIR filtersNow we consider the special types of FIR filters in

which the impulse response h[n] are assumed to be symmetric or antisymmetric.

Since the order of the polynomial in each of these two types can be either odd or even, we have four types of filters with different properties.

Linear phase FIR filters:Type 1: The coefficients are symmetric, i.e., h[n] = h[N−n], and the order N is even.

Page 29: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing
Page 30: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing
Page 31: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing
Page 32: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing

Linear phase response

Page 33: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing

Linear phase FIR filters:

Type II: The coefficients are symmetric, i.e., h[n] = h[N−n], and the order N is odd.

Page 34: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing

Linear phase FIR filters:

Type III: The coefficients are antisymmetric, i.e., h[n] = − h[N−n], and the order N is even.

Page 35: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing

Linear phase FIR filters:

Type IV: The coefficients are antisymmetric, i.e., h[n] = − h[N−n], and the order N is odd.

Page 36: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing
Page 37: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing
Page 38: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing

Fourier Series Method Modified by WindowsLet us consider the magnitude response of the ideal lowpass filter to be HLP(ejw), in which the cutoff frequency is given as wc. Its inverse Fourier transform (i.e., the impulse response of the ideal low pass filter) is:

Page 39: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing

We choose the following finite series to approximate HLP(ejw):Since {e−jnw} form an set of orthonormal bases, CLP[n] is the the least squared solution.The approximation error is

As M increases, the number of ripples in the passband(and the stopband) increases while the width between the frequencies at which the the maximum error occurs in the passband (0≤w≤wc) and in the stopband (wc≤w<π) decreases.

Page 40: IIR Filter design - 國立臺灣大學 · PDF fileIIR Filter design (cf. Shenoi, 2006) ... 2n and n are the parameters of the Butterworth filter, ... The procedure used for designing

Gibbs phenomenon: as M increases, the maximum deviation from the ideal value decreases except near the point of discontinuity, where the error remains the same, however large the value M we choose. (i.e., as M increases, the maximum amplitude of the oscillation does not approchzero)