B3 Iir
B3 Iir
B3 Iir
Gemma Piella
Departament de Tecnologies de la Informació i les Comunicacions
Universitat Pompeu Fabra, Barcelona, Spain
[email protected]
Contents
• IIR filters
Standard approach:
• Pole-zero placement
Pole-Zero placement
Examples: 2nd order real filters that are causal and stable
3. Transform the analog system function (by replacing the complex variable) to
the digital system function
analog digital
s-plane z-plane
H a (s ) H (z ) H ( ) = H ( z ) z =e j
Causal stable region in s-plane: poles in the left-half plane
Discretization of analog filters – freq. domain
‒ Imaginary axis (jΩ) in the s-plane mapped onto the unit circle
(|r|=1) of the z-plane
‒ A stable analog system function mapped into a stable digital
system function
z =1
s-plane z-plane
s = + j z = re j
Bilinear transformation
T: sampling period
T
H ( z ) = H a (s) | 2 1− z −1
s=
T 1+ z −1
z =1
s-plane z-plane
s = + j z = re j
Bilinear transformation
1
Example. Given an analog filter 𝐻𝑎 (𝑠) = , use the bilinear
1+𝑠
transform to obtain a digital IIR filter. Consider T=1.
1 1 + 𝑧 −1
𝐻 𝑧 = 𝐻𝑎 𝑠 | 2 1−𝑧 −1 = −1 =
𝑠=𝑇 2 1−𝑧 3 − 𝑧 −1
1+𝑧 −1 1+
𝑇 1 + 𝑧 −1
Bilinear transformation
For σ = 0,
[rad/s]
− j
2 1− e − c c
j= +
T 1 + e − j
0
normalized frequency
− − c 0 c [rad]
Then
2
= tg
T 2
T
= 2tg −1
2
Pre-warped frequency
Ω ω
ω
Standard analog filters
• Butterworth 1
H a ( ) =
2
– Flat passband
1 + ( / c )
2N
– Roll-of rate of 20N dB per decade
# poles, order
• Chebyshev
– Passband ripple (type I) or stopband ripple (type II)
– Sharper cut-off than Butterworth
• Elliptic
– Passband and stopband ripple
– Even sharper cut-off
• Bessel
– Linear phase response in the passband (thus no signal
distortion in passband)
– Wider transition band
Standard analog filters
Examples of 5th order (low-pass) filters (gain):
Standard analog filters
Butterworth
frequency response
for different orders N
What filter to choose?
YES
Linear
phase? FIR filter
NO
IIR filter
NO Narrow YES
Ripple transition High-order
OK? band? Butterworth
YES NO
Low-order
Narrowest YES Butterworth
possible Elliptic
transition?
NO
NO
Ripple Chebyshev II
in PB?
YES
NO
Ripple Chebyshev I
in SB?
YES
Elliptic
Frequency transformation
• Frequency transformation in the analog domain to obtain the desired filter type,
and then convert such analog filter into a digital filter
• Frequency transformation in the digital domain: first convert the analog low-pass
prototype into a digital low-pass prototype, and then transform such digital
prototype into the desired digital filter type
These two methods are not equivalent; they result in different filters, except
for when using the bilinear transformation, in which case the resulting filters
are the same
Frequency transformation in the analog domain
Given a prototype low-pass analog filter 𝐻𝑎,𝑛𝑜𝑟𝑚 (𝑠) with cut-off frequency Ω𝑝
(typically Ω𝑝 =1), we can obtain a low-pass, high-pass, band-pass, or band-stop
filters with a different cut-off frequency:
𝛺l )
Step by step IIR design using bilinear transf.
Ω𝑐 300 ⋅ 0.7265
𝐻𝑎 (𝑠) = 𝐻𝑎,𝑛𝑜𝑟𝑚 (𝑠)|𝑠= 𝑠 = =
Ω𝑐 𝑠 + Ω𝑐 𝑠 + 300 ⋅ 0.7265
Example
H ( z ) = H a (s) | 2 1− z −1
s=
T 1+ z −1
1 + 𝑧 −1
𝐻(𝑧) =
2.3764 − 0.3764𝑧 −1
x
Zeros: z=-1 z=-1
Poles: z=0.3764/2.3764 = 0.158
IIR filter (has
poles different
Since it is a causal filter, ROC: |z|>0.158 from 0 or ∞)
1+𝑧 −1 1 𝑧 −1
𝐻 𝑧 = 2.3764−0.3764𝑧 −1 = 2.3764−0.3764𝑧 −1 + 2.3764−0.3764𝑧 −1
1/2.3764 𝑧 −1 /2.3764
= + 1−0.3764𝑧 −1/2.3764
1−0.3764𝑧 −1 /2.3764 As expected, infinite
duration impulse response
(IIR filter) and from h(n) we
h(n)=((0.158)nu(n)+ (0.158)n-1u(n-1))/2.3764
can also see that is causal
and stable
IIR design
Standard approach:
• Pole-zero placement
Impulse invariance method
ℎ(𝑛) = ℎ𝑎 (𝑛𝑇) FT of a
sampled
signal
Then,
1 𝜔 2𝜋𝑘
𝐻(𝜔) = 𝐻𝑎 ( + )
𝑇 𝑇 𝑇
𝑘
𝜋 1 𝜔
If 𝐻𝑎 (Ω) = 0 for Ω ≥ , then 𝐻(𝜔) = 𝐻𝑎 ( ) 𝜔 ≤𝜋
𝑇 𝑇 𝑇
1
Satisfies Nyquist-Shannon sampling theorem: = 𝐹𝑠 > 2𝐹𝑚𝑎𝑥
𝑇
Otherwise, there will be aliasing
Impulse invariance method
s-plane z-plane
𝜋
𝑇
𝜋
−
𝑇
many-to-one
mapping
Exercise: how does this mapping compare to that of the bilinear transform?
Summary
• An IIR filter can provide similar magnitude response with fewer coeff., or lower
side-lobes for the same number of coeff. than a FIR filter
• Impulse invariance:
• Preserves shape of the filter ℎ𝑎 (𝑡)
ℎ(𝑛) = ℎ𝑎 (𝑛𝑇) = T • Aliasing may occur
• BEFORE seminar 3:
– Read/study the lectures notes (block 3-part II) and complement them with
bibliography. Key ideas.
– Exercise 1 of SEMINAR 3
– Exercises of QUIZZES
– Solve whatever doubt that may arise
• BEFORE seminar 4:
– Study the lectures notes and complement them with bibliography. Go into
details.
– Remainder of exercises of SEMINAR 3
– Ask any remainder doubt!
Quizzes
1
• Determine the digital equivalent of the analog electrical RC filter: H a ,norm ( s ) =
1+ s
using the bilinear transform. Consider a cut-off frequency of 1 Hz and
a sampling frequency of 4 Hz. Write the difference equation.
Solution:
1
2 2𝜋⋅
Ω𝑐 = tan 4 =8
𝑇 2
Ω𝑐 8
𝐻𝑎 𝑠 = 𝐻𝑎,𝑛𝑜𝑟𝑚 (𝑠)ቚ 𝑠 = =
𝑠=
Ω𝑐
𝑠 + Ω𝑐 𝑠 + 8
Solution:
Ω𝑐 𝑠
𝐻𝑎 𝑠 = 𝐻𝑎,𝑛𝑜𝑟𝑚 (𝑠)ቚ 1·8 = =
𝑠=
𝑠
𝑠 + Ω𝑐 𝑠 + 8
𝑦 𝑛 = 0.5𝑥 𝑛 − 0.5𝑥(𝑛 − 1)
1
• Consider the analog filter 𝐻𝑎 (𝑠) =
𝑠+3
, having the impulse response ha (t ) = e
−3t
u (t )
where u(t) is the step function. Assume T=0.1 seconds.
– Use the bilinear transform to transform the analog filter into a digital filter. Find the system
function and sketch its pole/zero diagram
– Use the impulse invariance method to obtain the impulse response h(n). Find the system
function and sketch its pole/zero diagram
– For the two digital filters obtained above, what is the difference between the frequency
responses?
• If the bilinear transform is applied to a stable analog filter, is it guaranteed that the
digital filter will be stable? Is a one-to-one mapping? Answer the same questions for
the case that the impulse invariance method is applied.
• Following scheme in slide 15, choose the suitable IIR filter if:
– We want to minimize the ripple both in the passband and the stopband
– We allow ripple in the stopband but not on the passband
⚫ Causal filter, ROC: 𝑧 > 17/23 , which includes unit circle; thus, it is stable.
– The frequency response of the first will not have aliasing. It has a zero at w=𝜋. The
frequency response of the second will have aliasing since 𝐻𝑎 𝛺 is not bandlimited to 𝜋/T
• Both the bilinear transform and the impulse invariance method preserve stability
of the filter (see slide 8 and 22). The bilinear transform is a one-to-one (bijective)
mapping, whereas the impulse invariance method is not: it is a many-to-one
mapping.
•
– Butterworth filter has a frequency response that is maximally flat in both the passband
and the stopband.
– Chebyshev Type II has no ripple in the passband and has a sharper cut-off than the
Butterworth.
• σ <0. Causal stable analog filters have poles such that σ <0. They are mapped to
the interior of the unit circle and thus the digital filter will be causal and stable as
well.
Appendix
Review
LTI systems
δ(n) h(n)
𝑧𝑛 𝑧 𝑛 𝐻(𝑧)
δ(t) ha(t)
x(t) y(t)
ha(t)
st
• Let’s consider an input signal e (s is a complex freq. parameter: s = + j )
y (t ) = x(t ) * ha (t ) = ha ( ) x(t − )d
−
= ha ( )e s ( t − ) d
−
• Ha(s) is the Laplace transform of the
= h a ( )e − s d e st
impulse response ha (t)
−
input
H a (s )
System function
The Laplace transform
The response of an LTI system with impulse response ha(t) to a complex exponential
st
input e is
y (t ) = H a ( s )e st
where s is a complex (frequency) parameter: s = + j and
∞
𝐻𝑎 (𝑠) = න ℎ𝑎 (𝑡)𝑒 −𝑠𝑡 𝑑𝑡
−∞
When s is purely imaginary (s=jΩ), this is the Fourier transform of ha(t): Ha(Ω). Thus,
the Fourier transform is the Laplace transform when s is purely imaginary:
∞
𝐻𝑎 (𝑠)ቚ = 𝐻𝑎 (Ω) = 𝐶𝑇𝐹𝑇{ℎ𝑎 (𝑡)} = න ℎ𝑎 (𝑡)𝑒 −𝑗Ω𝑡 𝑑𝑡
𝑠=𝑗Ω −∞
Relation between the s-plane and the z-plane
𝛺=0)
Relationship between the s-plane and the z-plane. The s-plane is a rectangular coordinate system with 𝜎 expressing the
distance along the real (horizontal) axis, and 𝛺 the distance along the imaginary (vertical) axis. In comparison, the z-plane
is in polar form, with r being the distance to the origin, and 𝜔 the angle measured to the positive horizontal axis. Vertical
lines in the s-plane correspond to circles in the z-plane.
Review TSiS
X (F )
x (t )
X(ω)
F
= 2
Fs
ω
-2π π 2π v