Вы находитесь на странице: 1из 32

Design of IIR Filters

Infinite Impulse Response Filters


• IIR filters have infinite-duration impulse responses.
• The primary advantage of IIR filters is that they meet a given set of
specifications with a much lower filter order.
• Although IIR filters have nonlinear phase, a non-causal, zero-phase
filtering approach (via the filtfilt function), which eliminates the
nonlinear phase distortion of an IIR filter.
Classical IIR Filters

• The classical IIR filters:


Butterworth Filter,
Chebyshev Filter (Types I and Type II),
Elliptic, and
Bessel Filter
All approximate the ideal “brick wall” filter in different ways.
Approaches to IIR filter design
• There are two approaches:
• The main problem with these approaches is that we have no control
over the phase characteristics of the IIR filter.
• Hence IIR filter designs will be treated as magnitude-only designs.
CHARACTERISTICS OF PROTOTYPE ANALOG FILTERS

• Three prototypes widely used in practice are:


• Butterworth lowpass,
• Chebyshev lowpass (Type I and II), and
• Elliptic lowpass
BUTTERWORTH LOWPASS FILTERS
• This filter is characterized by the
property that its magnitude
response is flat in both passband
and stopband.
• This filter is characterized by the
property that its magnitude
response is flat in both passband
and stopband.
• The magnitude-squared response
of an Nth-order lowpass filter is
given by
2
1
𝐻𝑎 (𝑗𝛺) =
𝛺 2𝑁
1+
𝛺𝑐
• From this plot, we can observe the following properties:
• at Ω = 0, |Ha(j0)|2 = 1 for all N.
• at Ω = Ωc, |Ha(jΩc)|2 = 1 / 2 for all N, which implies a 3 dB
attenuation at Ωc.
• |Ha(jΩ)|2 is a monotonically decreasing function of Ω.
Ha(jΩ)|2 approaches an ideal lowpass filter as N →∞.
• |Ha(jΩ)|2 is maximally flat at Ω = 0 since derivatives of all orders exist
and are equal to zero.
• To determine the system function Ha(s), we have

2ቚ
1 𝑗𝛺 2𝑁
𝐻𝑎 𝑠 𝐻𝑎 −𝑠 = 𝐻𝑎 𝑗𝛺 = 2𝑁 = 2𝑁 2𝑁
𝛺=𝑠ൗ𝑗 𝑠 𝑠 + 𝑗𝛺𝑐
1+
𝑗𝛺𝑐

• The roots of the denominator polynomial (or poles of Ha(s)Ha(−s)) are


given by
𝟏 𝝅
𝒋𝟐𝑵 𝟐𝒌+𝑵+𝟏
• 𝒑𝒌 = −𝟏 𝟐𝑵 𝒋𝜴 = 𝜴𝒄 𝒆 , 𝒌 = 𝟎, 𝟏, 𝟐, … . , 𝟐𝑵 − 𝟏
• there are 2N poles of Ha(s)Ha(−s), which are equally distributed on a
circle of radius Ωc with angular spacing of π/N radians
𝒌𝝅
𝒋𝑵
• for N odd the poles are given by pk = 𝜴𝒄 𝒆 , k= 0, 1, . . . , 2N −1
𝝅 𝒌𝝅
𝒋(𝟐𝑵+ 𝑵 )
• for N even the poles are given by pk = 𝜴𝒄 𝒆 , k = 0, 1, . . . ,2N −
1
• the poles are symmetrically located with respect to the jΩ axis
• a pole never falls on the imaginary axis, and falls on the real axis only
if N is odd.
• A stable and causal filter Ha(s) can now be specified by selecting poles
in the left half-plane, and Ha(s) can be written in the form
𝛺𝑐𝑁
𝐻𝑎 𝑠 =
ς𝐿𝐻𝑃 𝑝𝑜𝑙𝑒𝑠 𝑠 − 𝑝𝑘
Design Equations
• The analog lowpass filter is specified by the parameters Ωp, Ap, Ωs, and As.
• The essence of the design in the case of Butterworth filter is to obtain the
order N and the cutoff frequency Ωc, given the specifications
2 1
• At 𝛺 = 𝛺𝑝 , −10 log10 𝐻𝑎 (𝑗𝛺) = 𝐴𝑝 Or −10 log10 𝛺 2𝑁
= 𝐴𝑝
𝑝
1+
𝛺𝑐

2 1
• At 𝛺 = 𝛺𝑠 , −10 log10 𝐻𝑎 (𝑗𝛺) = 𝐴𝑠 Or −10 log10 𝛺𝑠 2𝑁
= 𝐴𝑠
1+
𝛺𝑐
Solving these two equations for N and Ωc, we have

𝑙𝑜𝑔10 10𝐴𝑝Τ10 − 1 ൗ 10𝐴𝑠 Τ10 − 1


𝑁=
2𝑙𝑜𝑔10 𝛺𝑝 Τ𝛺𝑠
• In general, N will not be an integer. Since we want N to be an integer,
we must choose
𝑙𝑜𝑔10 10𝐴𝑝Τ10 − 1 ൗ 10𝐴𝑠Τ10 − 1
𝑁=
2𝑙𝑜𝑔10 𝛺𝑝 Τ𝛺𝑠
where the operation 𝑥 means “choose the smallest integer larger
than x”—for example, 4.5 = 5.
• Since the actual N chosen is larger than required, specifications can
be either met or exceeded either at Ωp or at Ωs. To satisfy the
specifications exactly at Ωp,
𝛺𝑝
𝛺𝑐 = 2𝑁
10𝐴𝑝 Τ10 −1

• or, to satisfy the specifications exactly at Ωs,


𝛺𝑠
𝛺𝑐 = 2𝑁
10𝐴𝑠Τ10 − 1
Butterworth Prototype Filter
Parameter Expression
Order 𝑙𝑜𝑔10 10𝐴𝑝 Τ10 − 1 ൗ 10𝐴𝑠Τ10 − 1
𝑁=
2𝑙𝑜𝑔10 𝛺𝑝 Τ𝛺𝑠
𝛺𝑝
𝛺𝑐 =
2𝑁
Cut-off frequency 10𝐴𝑝 Τ10 − 1
𝛺𝑠
𝛺𝑐 = 2𝑁
10𝐴𝑠Τ10 − 1
𝝅 𝒌𝝅
Poles for N even 𝒋(𝟐𝑵+ 𝑵 )
p k = 𝜴𝒄 𝒆 , k = 0, 1, . . . ,2N − 1

𝝅 𝒌𝝅
Poles for N odd 𝒋(𝟐𝑵+ 𝑵 )
p k = 𝜴𝒄 𝒆 , k = 0, 1, . . . ,2N − 1

Transfer function 𝛺𝑐𝑁


𝐻𝑎 𝑠 =
ς𝐿𝐻𝑃 𝑝𝑜𝑙𝑒𝑠 𝑠 − 𝑝𝑘
CHEBYSHEV LOWPASS FILTERS
• There are two types of Chebyshev filters.
• The Chebyshev- type I filters have equiripple response in the passband.
• The Chebyshev-II filters have equiripple response in the stopband. Butterworth filters
have monotonic response in both bands.
• By choosing a filter that has an equiripple rather than a monotonic behavior, we can
obtain a lower-order filter.
• The magnitude-squared response of a Chebyshev-type I filter is
2
1
𝐻𝑎 (𝑗𝛺) =
2 2 𝛺
1 + 𝜖 𝐶𝑁
𝛺𝑐
• where N is the order of the filter, 𝜖 is the passband ripple factor, which is related to Ap
and CN (x) is the Nth-order Chebyshev polynomial given by:
cos 𝑁 cos −1 𝑥 , 0 ≤ 𝑥 ≤ 1
𝐶𝑁 𝑥 = ൝
𝑐𝑜𝑠ℎ cosh−1 𝑥 , 1 ≤ 𝑥 ≤ ∞
𝛺
Where 𝑥 =
𝛺𝑐
• The equiripple response of the
Chebyshev filters is due to this
polynomial CN(x). Its key
properties are:
(a) for 0 <x<1, CN(x) oscillates
between −1 and 1, and
(b) for 1 < x < ∞, CN(x) increases
monotonically to ∞.
There are two possible shapes
of|Ha(jΩ)|2, one for N odd and
one for N even
• From these two response plots we observe the following properties:
At 𝑥 = 0 (𝑜𝑟 𝛺 = 0); 𝐻𝑎 (𝑗0) 2 = 1 𝑓𝑜𝑟 𝑁 = 𝑜𝑑𝑑
2
1
𝐻𝑎 (𝑗0) = 2
𝑓𝑜𝑟 𝑁 = 𝑒𝑣𝑒𝑛
1+𝜖
2 1
At 𝑥 = 1 (𝑜𝑟 𝛺 = 𝛺𝑐 ); 𝐻𝑎 (𝑗1) = 2 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑁
1+𝜖
2
For 0 ≤ 𝑥 ≤ 1 (𝑜𝑟 0 ≤ 𝛺 ≤ 𝛺𝑐 ); 𝐻𝑎 (𝑗𝑥) oscillates between 1 and
1
1+𝜖2
For 𝑥 > 1 (𝑜𝑟 𝛺 > 𝛺𝑐 ); 𝐻𝑎 (𝑗𝑥) 2 decreases monotonically to 0.
2 1
At 𝑥 = (𝛺𝑟 ); 𝐻𝑎 (𝑗𝑥) = 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑁
𝐴2
• If Ap is the gain at passband frequency Ωp and As is the gain at
stopband frequencies Ωs,
1
1Τ𝐴2
𝑠 −1
2
cosh−1
1Τ𝐴2
𝑝 −1
• The order of the filter N =
Ω𝑠
cosh−1
Ω𝑝
• If αp is the gain in dB at passband frequency Ωp and αs is the gain in
dB at stopband frequencies Ωs,
1
100.1𝛼𝑠 ,𝑑𝐵 −1 2
cosh−1 0.1𝛼𝑝 ,𝑑𝐵
• The order of the filter N = 10 −1

cosh−1
Ω𝑠
Ω𝑝
• The poles are given by pk = σk + jΩk, k =0,...,N−1 are the (left half-
poles)
𝜋 2𝑘+1 𝜋
𝜎𝑘 = 𝑎𝛺𝑐 cos +
2 2𝑁
𝜋 2𝑘+1 𝜋
ቑ 𝑘 = 0, … . , 𝑁 − 1
𝛺𝑘 = 𝑏𝛺𝑐 sin +
2 2𝑁
where
1 𝑁 𝑁 1 𝑁 𝑁 1 1
𝑎= 𝜇− 1Τ𝜇 , 𝑏 = 𝜇+ 1Τ𝜇 and 𝜇 = + 1 +
2 2 𝜖 𝜖2
• The roots fall on an ellipse with major axis bΩc and minor axis aΩc.
• The system function is given by
𝐾
𝐻𝑎 𝑠 =
ς𝑘 𝑠 − 𝑝𝑘
Where K is a normalizing factor chosen to make

1 ; 𝑁 𝑜𝑑𝑑
𝐻𝑎 𝑗0 = ൞ 1 𝑁 𝑒𝑣𝑒𝑛
;
1 + 𝜖2
• If Ap is the gain at passband frequency Ωp and As is the gain at
stopband frequencies Ωs,
1
1Τ𝐴2
𝑠 −1
2
cosh−1
1Τ𝐴2
𝑝 −1
• The order of the filter N =
Ω𝑠
cosh−1
Ω𝑝
• If αp is the gain in dB at passband frequency Ωp and αs is the gain in
dB at stopband frequencies Ωs,
1
100.1𝛼𝑠 ,𝑑𝐵 −1 2
cosh−1 0.1𝛼𝑝 ,𝑑𝐵
• The order of the filter N = 10 −1

cosh−1
Ω𝑠
Ω𝑝
Chebyshev Prototype Filter
Parameter Expression
1
Order 2
1Τ𝐴𝑠 −1 2 1
cosh−1 10 0.1𝛼𝑠 ,𝑑𝐵 −1 2
1Τ𝐴2
𝑝 −1 cosh−1 0.1𝛼𝑝 ,𝑑𝐵
10 −1
N= OR N =
cosh−1
Ω𝑠 cosh−1
Ω𝑠
Ω𝑝 Ω𝑝
Cut-off frequency 𝛺𝑝 𝛺𝑠
𝛺𝑐 = 2𝑁
or 𝛺𝑐 = 2𝑁
10𝐴𝑝 Τ10 −1 10𝐴𝑠 Τ10 −1

Poles pk = σk + jΩk, k =0,...,N−1 (left half-poles)


𝜋 2𝑘 + 1 𝜋
𝜎𝑘 = 𝑎𝛺𝑐 cos +
2 2𝑁
𝑘 = 0, … . , 𝑁 − 1
𝜋 2𝑘 + 1 𝜋
𝛺𝑘 = 𝑏𝛺𝑐 sin +
2 2𝑁
1 𝑁 𝑁 1 𝑁 𝑁 1 1
𝑎= 𝜇− 1Τ𝜇 , 𝑏 = 𝜇+ 1Τ𝜇 and 𝜇 = + 1 +
2 2 𝜖 𝜖2

Transfer function 1 ; 𝑁 𝑜𝑑𝑑


𝐾
𝐻𝑎 𝑠 = 𝑎𝑛𝑑 𝐻𝑎 𝑗0 = ቐ 1 𝑁 𝑒𝑣𝑒𝑛
ς𝑘 𝑠−𝑝𝑘
2
;
1+𝜖
ANALOG FREQUENCY TRANSFORMATIONS
Type of Transformation Cut off frequency Transformation
Low pass to Low pass 𝛺𝑝 s= s/𝛺𝑐
𝛺𝑐 =
2𝑁
10𝐴𝑝 Τ10 − 1

Low pass to High Pass 𝛺𝑝 s = 𝛺𝑐 /𝑠


𝛺𝑐 =
2𝑁
10𝐴𝑝 Τ10 − 1

Low pass to Band pass 𝛺𝑝 𝑠 2 +𝛺1 𝛺2


𝛺𝑐 = s= 𝛺𝑐 𝑠(𝛺 −𝛺 )
2 1
2𝑁
10𝐴𝑝 Τ10 − 1

Low pass to Band stop 𝛺𝑝 s = 𝛺𝑐


𝑠 𝛺2 −𝛺1
𝛺𝑐 = 𝑠 2 +𝛺1 𝛺2
2𝑁
10𝐴𝑝 Τ10 − 1
ANALOG-TO-DIGITAL FILTER TRANSFORMATIONS
• These transformations are complex-valued mappings and are derived
by preserving different aspects of analog and digital filters.
1. If we want to preserve the shape of the impulse response from analog to
digital filter - impulse invariance transformation.
2. If we want to convert a differential equation representation into a
corresponding difference equation representation - bilinear transformation.
3. If we want to preserve the shape of step response - step invariance.
4. The matched-z transformation, which matches the pole-zero representation.
• The most popular technique used in practice is the Bilinear
transformation, which preserves the system function representation
from analog to digital domain.
IMPULSE INVARIANCE TRANSFORMATION
• For the digital filter impulse response to look “similar” to that of a frequency-
selective analog filter, we sample ha(t) at some sampling interval T to obtain h(n);
that is,
ℎ 𝑛 = ℎ𝑎 (𝑛𝑇)
• The parameter T is chosen so that the shape of ha(t) is “captured” by the samples.
Since this is a sampling operation, the analog and digital frequencies are related
by
𝜔 = 𝛺𝑇 𝑜𝑟 𝑒 𝑗𝜔 = 𝑒 𝑗𝛺𝑇
• Since z = 𝑒 𝑗𝜔 on the unit circle and s = jΩ on the imaginary axis, we have the
following transformation from the s-plane to the z-plane:
𝑧 = 𝑒 𝑠𝑇
• The system functions H(z) and Ha(s) are related through the frequency domain
aliasing formula ∞
1 2𝜋
𝐻 𝑧 = ෍ 𝐻𝑎 𝑠 − 𝑗 𝑘
𝑇 𝑇
𝑘=−∞
S- plane to z- plane mapping

• Using σ = Re(s), we note that


• σ < 0 maps into |z| < 1 (inside of the UC)
• σ = 0 maps onto |z|=1 (on the UC)
• σ > 0 maps into |z| > 1 (outside of the UC)

• All semi-infinite strips of width 2π/T map


into |z| < 1. Thus this mapping is not
unique but a many-to-one mapping.

• Since the entire left half of the s-plane


maps into the unit circle, a causal and
stable analog filter maps into a causal and
stable digital filter.
DESIGN PROCEDURE
Given the digital lowpass filter specifications ωp, ωs, Ap, and As,
The steps required for this prdesigning the digital filter are :
𝜔𝑝 𝜔𝑠
• Choose T and determine the analog frequencies 𝛺𝑝 = 𝑎𝑛𝑑 𝛺𝑠 =
𝑇 𝑇
• Design an analog filter Ha(s) using the specifications Ωp,Ωs, Ap, and As.
This can be done using any one of the two (Butterworth, Chebyshev)
prototypes.
𝑁 𝑅𝑘
• Using partial fraction expansion, expand Ha(s) into 𝐻𝑎 (𝑠) = 𝑘=1
σ
𝑠−𝑝𝑘
• Now transform analog poles {pk} into digital poles {epkT} to obtain the
digital filter:
𝑁
𝑅𝑘
𝐻(𝑧) = ෍
1 − 𝑒 𝑝𝑘𝑇 𝑧 −1
𝑘=1
BILINEAR TRANSFORMATION:
2 1−𝑧 −1
• In this transformation the mapping function is given by 𝑠 =
𝑇 1+𝑧 −1
where T is a parameter.
𝑇 𝑇
• When cleared of fractions, we obtain 𝑠𝑧 + 𝑠 −𝑧+1=0
2 2
a linear in each variable if the other is fixed, or bilinear in s and z.
• The complex plane mapping under bilinear transformation is:
• From the figure we have the following
observations:
• Using s = σ + jΩ, we obtain

𝜎𝑇 𝛺𝑇 𝜎𝑇 𝛺𝑇
• 𝑧 = 1+ +𝑗 ൗ 1− −𝑗
2 2 2 2

𝜎𝑇 𝛺𝑇
1+ 2 +𝑗 2
• For 𝜎 < 0 ⟹ 𝑧 = 𝜎𝑇 𝛺𝑇 <1
1− −𝑗2 2

𝜎𝑇 𝛺𝑇
1+ 2 +𝑗 2
• For 𝜎 = 0 ⟹ 𝑧 = 𝜎𝑇 𝛺𝑇 =1
1− 2 −𝑗 2

𝜎𝑇 𝛺𝑇
1+ +𝑗
• For 𝜎 > 0 ⟹ 𝑧 = 2
𝜎𝑇 𝛺𝑇
2
>1
1− 2 −𝑗 2
• The entire left half-plane maps into the inside of the unit circle. A
stable transformation.
• The imaginary axis maps onto the unit circle in a one-to-one fashion.
Hence there is no aliasing in the frequency domain.
• Substituting σ =0,we obtain
𝛺𝑇 𝛺𝑇
𝑧 = 1+𝑗 ൘ 1−𝑗 = 𝑒 𝑗𝜔
2 2
• since the magnitude is 1. Solving for ω as a function of Ω, we obtain
−1 𝛺𝑇 2 𝜔
𝜔= 2 tan or 𝛺 = tan
2 𝑇 2
• This shows that Ω is nonlinearly related to (or warped into) ω but that
there is no aliasing. Hence we say that ω is prewarped into Ω.
DESIGN PROCEDURE
Given digital filter specifications ωp, ωs, Ap and As, the design steps are
the following:
• Choose a value for T. This is arbitrary, and we may set T = 1.
• Prewarp the cutoff frequencies ωp and ωs; that is, calculate Ωp and
Ωs using:
2 𝜔𝑝 2 𝜔𝑠
𝛺𝑝 = tan and 𝛺𝑠 = tan
𝑇 2 𝑇 2
• Design an analog filter Ha(s) to meet the specifications Ωp, Ωs, Ap,
and As.
2 1−𝑧 −1
• Set 𝐻 𝑧 = 𝐻𝑎 and simplify to obtain H(z) as a rational
𝑇 1+𝑧 −1
function in z−1.

Вам также может понравиться