0% found this document useful (0 votes)
116 views41 pages

Signals and Systems: Lecture 9: Infinite Impulse Response Filters

The document discusses infinite impulse response (IIR) filters, specifically a first-order low-pass IIR filter. It covers the difference equation that defines IIR filters, the transfer function, properties of a first-order filter including its stability condition. It also outlines designing IIR filters by first designing a continuous-time Butterworth filter and then transforming it to discrete-time using the bilinear transform.

Uploaded by

Nguyễn Tài
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
116 views41 pages

Signals and Systems: Lecture 9: Infinite Impulse Response Filters

The document discusses infinite impulse response (IIR) filters, specifically a first-order low-pass IIR filter. It covers the difference equation that defines IIR filters, the transfer function, properties of a first-order filter including its stability condition. It also outlines designing IIR filters by first designing a continuous-time Butterworth filter and then transforming it to discrete-time using the bilinear transform.

Uploaded by

Nguyễn Tài
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 41

Signals and Systems

Lecture 9: Infinite Impulse Response Filters

Dr. Guillaume Ducard

Fall 2018

based on materials from: Prof. Dr. Raffaello D’Andrea

Institute for Dynamic Systems and Control

ETH Zurich, Switzerland

G. Ducard 1 / 41
Outline

1 Infinite Impulse Response Filters


IIR filter : difference equation
Transfer function

2 First-Order Low-Pass Filter


Definition
Properties
Design considerations
Connection to CT systems

3 IIR Filter Design


Methodology
CT Butterworth filter design
Bilinear transform
G. Ducard 2 / 41
Infinite Impulse Response Filters
IIR filter : difference equation
First-Order Low-Pass Filter
Transfer function
IIR Filter Design

Outline

1 Infinite Impulse Response Filters


IIR filter : difference equation
Transfer function

2 First-Order Low-Pass Filter


Definition
Properties
Design considerations
Connection to CT systems

3 IIR Filter Design


Methodology
CT Butterworth filter design
Bilinear transform
G. Ducard 3 / 41
Infinite Impulse Response Filters
IIR filter : difference equation
First-Order Low-Pass Filter
Transfer function
IIR Filter Design

IIR: Difference equation

The class of causal infinite impulse response (IIR) filters can be


captured by the difference equation
M
X −1 N
X −1
y[n] = bk u[n − k] − ak y[n − k],
k=0 k=1

Characteristics :
M input coefficients bk ∈ R,
N − 1 output coefficients ak ∈ R.
filter order: is given by max(M − 1, N − 1) and corresponds
to the number of delay elements an implementation of the
filter would require;
it is also the size of the state in a state-space description
of the system. G. Ducard 4 / 41
Infinite Impulse Response Filters
IIR filter : difference equation
First-Order Low-Pass Filter
Transfer function
IIR Filter Design

FIR vs. IIR

Key differences :
1 the output of a causal IIR filter is dependent on both the filter’s input
and on previous outputs (if one or more coefficients ak are non-zero).
2 Dependence on previous output(s) generally implies that the impulse
response has infinite length (hence the name: IIR filter).
3 IIR filters are not necessarily stable: the stability depends on the
coefficients ak .

Advantages of IIR filters :


1 they usually meet filter specifications with a lower filter order,
2 this corresponds to lower computation and storage cost compared to FIR
filters.

G. Ducard 5 / 41
Infinite Impulse Response Filters
IIR filter : difference equation
First-Order Low-Pass Filter
Transfer function
IIR Filter Design

Outline

1 Infinite Impulse Response Filters


IIR filter : difference equation
Transfer function

2 First-Order Low-Pass Filter


Definition
Properties
Design considerations
Connection to CT systems

3 IIR Filter Design


Methodology
CT Butterworth filter design
Bilinear transform
G. Ducard 6 / 41
Infinite Impulse Response Filters
IIR filter : difference equation
First-Order Low-Pass Filter
Transfer function
IIR Filter Design

IIR filter : transfer function


Transfer function and frequency response calculated from difference equation:
MP−1 MP−1
bk z −k bk e −jΩk
jΩ
k=0 z=e k=0
H(z) = N−1
−−−−→ H(Ω) = N−1
P P
1+ ak z −k 1+ ak e−jΩk
k=1 k=1

The goal of IIR filter design : find coefficients ak and bk such that the filter
meets given specifications and is stable.
IIR filter design :
often employs established continuous-time (CT) filter design methods, for
example Butterworth filter design,
and then transforms the resulting CT filter into DT.

In this lecture, we introduce:


1 the concepts underlying IIR filters;

2 how to design a CT Butterworth filter; and finally,

3 how to convert a CT filter into DT using the bilinear transform.


G. Ducard 7 / 41
Definition
Infinite Impulse Response Filters
Properties
First-Order Low-Pass Filter
Design considerations
IIR Filter Design
Connection to CT systems

Outline

1 Infinite Impulse Response Filters


IIR filter : difference equation
Transfer function

2 First-Order Low-Pass Filter


Definition
Properties
Design considerations
Connection to CT systems

3 IIR Filter Design


Methodology
CT Butterworth filter design
Bilinear transform
G. Ducard 8 / 41
Definition
Infinite Impulse Response Filters
Properties
First-Order Low-Pass Filter
Design considerations
IIR Filter Design
Connection to CT systems

IIR 1st order low-pass filter

Consider the causal, first-order, low-pass IIR filter, which has the
difference equation

y[n] = α y[n − 1] + (1 − α) u[n],


where 0 ≤ α < 1.

Intuition :
For α 6= 0, this is an infinite impulse response filter.
If α = 0 the output is equal to the input and no filtering
occurs.
As α → 1, the output becomes increasingly constant.

G. Ducard 9 / 41
Definition
Infinite Impulse Response Filters
Properties
First-Order Low-Pass Filter
Design considerations
IIR Filter Design
Connection to CT systems

IIR 1st order low-pass filter

Transfer function
1−α
H(z) = .
1 − α z −1

Stability discussion:
The filter has a single pole at z = α.
It immediately follows that the filter is stable if 0 ≤ α < 1.

Frequency response
1−α
H (Ω) = .
1 − α e−jΩ

G. Ducard 10 / 41
Definition
Infinite Impulse Response Filters
Properties
First-Order Low-Pass Filter
Design considerations
IIR Filter Design
Connection to CT systems

Outline

1 Infinite Impulse Response Filters


IIR filter : difference equation
Transfer function

2 First-Order Low-Pass Filter


Definition
Properties
Design considerations
Connection to CT systems

3 IIR Filter Design


Methodology
CT Butterworth filter design
Bilinear transform
G. Ducard 11 / 41
Definition
Infinite Impulse Response Filters
Properties
First-Order Low-Pass Filter
Design considerations
IIR Filter Design
Connection to CT systems

IIR 1st order low-pass filter : behavior


Low - frequency signals remain unaltered since
1−α
H(Ω = 0) = = 1.
1 − αe−j0
The magnitude response is:
1−α
|H (Ω)| = q .
(1 − α cos Ω)2 + α2 sin2 Ω
Furthermore, one can show that the magnitude is monotonically non-increasing:
d|H(Ω)|
≤ 0, for 0 ≤ Ω ≤ π.
dΩ
The phase is
Always negative
 z }| { 
−α sin Ω
∠H(Ω) = arctan , for 0 ≤ Ω ≤ π.
1 − α cos Ω
| {z }
Always positive

Therefore
π
− < ∠H(Ω) ≤ 0.
2 G. Ducard 12 / 41
Definition
Infinite Impulse Response Filters
Properties
First-Order Low-Pass Filter
Design considerations
IIR Filter Design
Connection to CT systems

A plot of the magnitude and phase response follows:


1 α = 0.3
α = 0.5
α = 0.8
|H(Ω)|

α = 0.9

0.5


0
0 π/2 π

0
∠H(Ω)


−π/2
0 π/2 π
G. Ducard 13 / 41
Definition
Infinite Impulse Response Filters
Properties
First-Order Low-Pass Filter
Design considerations
IIR Filter Design
Connection to CT systems

Outline

1 Infinite Impulse Response Filters


IIR filter : difference equation
Transfer function

2 First-Order Low-Pass Filter


Definition
Properties
Design considerations
Connection to CT systems

3 IIR Filter Design


Methodology
CT Butterworth filter design
Bilinear transform
G. Ducard 14 / 41
Definition
Infinite Impulse Response Filters
Properties
First-Order Low-Pass Filter
Design considerations
IIR Filter Design
Connection to CT systems

Choice of parameter α
To choose n , let :
Ts be the sampling time,
and T0 be the desired time for the continuous process to decay to e−1 ,
i.e., T0 = n Ts .
T
T0 1 − s
n= ⇒ α = e− n = e T0 ,
Ts
we assume that T0 is an integer multiple of Ts (if this is not the case, n may be rounded).

Example :

sampling time Ts = 0.01 s


chosen decay time T0 = 1 s,

α = exp(−0.01) ≈ 0.99.

Usually, T0 is large relative to Ts and we may use a first-order approximation


to obtain
Ts
α≈1− .
T0 G. Ducard 15 / 41
Definition
Infinite Impulse Response Filters
Properties
First-Order Low-Pass Filter
Design considerations
IIR Filter Design
Connection to CT systems

Outline

1 Infinite Impulse Response Filters


IIR filter : difference equation
Transfer function

2 First-Order Low-Pass Filter


Definition
Properties
Design considerations
Connection to CT systems

3 IIR Filter Design


Methodology
CT Butterworth filter design
Bilinear transform
G. Ducard 16 / 41
Definition
Infinite Impulse Response Filters
Properties
First-Order Low-Pass Filter
Design considerations
IIR Filter Design
Connection to CT systems

A connection to CT systems can be made: In CT, the transfer function of a


first-order low-pass filter is given by
1
H(s) = .
τs + 1
The differential equation for the output is
1
ẏ(t) = − (y(t) − u(t)) . (1)
τ
Assuming u(t) = 0 for t ≥ 0, we obtain the time-domain system response
t
y(t) = y(0)e− τ .
Choosing y(0) = 1, we obtain the system response:

e−1
t
τ

Therefore, the time to reach e−1 is τ . G. Ducard 17 / 41


Definition
Infinite Impulse Response Filters
Properties
First-Order Low-Pass Filter
Design considerations
IIR Filter Design
Connection to CT systems

Another connection to CT can be made by discretizing


1
ẏ(t) = − (y(t) − u(t))
τ
assuming the input u is constant over a sample period Ts , i.e. a zero-order
hold device is used:
   1 1 
ẏ −τ τ y
= 0 ≤ t < Ts ,
u̇ 0 0 u
which we solve using the matrix exponential and obtain
   Ts Ts    " Ts T
# 
y(Ts− ) −τ y(0) − τ − τs y(0)
= exp τ = e 1 − e .

u(Ts ) 0 0 u(0) 0 1 u(0)

As discussed in Lecture 1, this solution is valid on any time interval because the
system is time invariant. Substituting the decay time T0 for the time constant
τ , the resulting difference equation becomes
T T
− Ts − Ts
y[n] = e 0 y[n − 1] + (1 − e 0 )u[n − 1] = αy[n − 1] + (1 − α)u[n − 1]
which closely resembles the first-order, low-pass IIR filter, except that the input
is delayed by one sample. G. Ducard 18 / 41
Infinite Impulse Response Filters Methodology
First-Order Low-Pass Filter CT Butterworth filter design
IIR Filter Design Bilinear transform

Outline

1 Infinite Impulse Response Filters


IIR filter : difference equation
Transfer function

2 First-Order Low-Pass Filter


Definition
Properties
Design considerations
Connection to CT systems

3 IIR Filter Design


Methodology
CT Butterworth filter design
Bilinear transform
G. Ducard 19 / 41
Infinite Impulse Response Filters Methodology
First-Order Low-Pass Filter CT Butterworth filter design
IIR Filter Design Bilinear transform

IIR filter design

FIR filter design only makes sense in DT.


In contrast,
1 IIR filters are often designed in CT using an established
method, for example
a Butterworth,
or Chebyshev method.
2 they are then converted to DT using the bilinear transform
(sometimes also called Tustin method).

We will see in the following section,


the bilinear transform has properties that make it a useful tool
for the above design procedure.

G. Ducard 20 / 41
Infinite Impulse Response Filters Methodology
First-Order Low-Pass Filter CT Butterworth filter design
IIR Filter Design Bilinear transform

Outline

1 Infinite Impulse Response Filters


IIR filter : difference equation
Transfer function

2 First-Order Low-Pass Filter


Definition
Properties
Design considerations
Connection to CT systems

3 IIR Filter Design


Methodology
CT Butterworth filter design
Bilinear transform
G. Ducard 21 / 41
Infinite Impulse Response Filters Methodology
First-Order Low-Pass Filter CT Butterworth filter design
IIR Filter Design Bilinear transform

CT design: Butterworth filter


It is a general purpose low-pass filter. The starting point is the desired
frequency response, with corner frequency 1 rad/sec:
1
R(ω) = √ ,
1 + ω 2K
where K is the order of the filter.
0

−40
|R(ω)| (dB)

−80

−120 K=2
K=3
K=8
−160
10−2 10−1 100 101 102
ω
G. Ducard 22 / 41
Infinite Impulse Response Filters Methodology
First-Order Low-Pass Filter CT Butterworth filter design
IIR Filter Design Bilinear transform

Butterworth filter design: properties


This frequency response has two very desirable properties:
1 it has no ripples,
2 and is maximally flat.

1 1
R(ω) = √ = (1 + ω 2K )− 2 ,
1+ω 2K

First, let us calculate the derivative dR/dω.


1 3
dR(ω)/dω = − (1 + ω 2K )− 2 2Kω 2K−1
2
= −KR3 ω 2K−1 ≤ 0 for all ω ≥ 0.

Conclusion
This means that the Butterworth filter has no ripples.
In other words, all derivatives of R up to 2K − 1 are 0 at 0 and the filter is said
to be maximally flat.
G. Ducard 23 / 41
Infinite Impulse Response Filters Methodology
First-Order Low-Pass Filter CT Butterworth filter design
IIR Filter Design Bilinear transform

Transfer function
Let H(s) be the transfer function of a filter with frequency response R(ω).
We then have that

|H(jω)|2 = R(ω)2 = (1 + ω 2K )−1 .

The only stable transfer function that achieves this is

1
H(s) = K
,
Q
(s − sk )
k=1

j(2k+K−1)π
where sk = e 2K , k = 1, . . . , K.

Filters with a transfer function of this structure are known as Butterworth


filters.

G. Ducard 24 / 41
Infinite Impulse Response Filters Methodology
First-Order Low-Pass Filter CT Butterworth filter design
IIR Filter Design Bilinear transform

Second-order Butterworth low-pass filter

Consider one of the most common Butterworth filters: a


second-order (K = 2) low-pass. We have,

−1 + j
s1 = ej3π/4 = √ , (135◦ )
2
−1 − j
s2 = ej5π/4 = √ , (225◦ )
2
which results in the transfer function
1 1
H(s) = 1−j 1+j
= √ .
(s + √ )(s + √ ) s2 + 2s + 1
2 2

G. Ducard 25 / 41
Infinite Impulse Response Filters Methodology
First-Order Low-Pass Filter CT Butterworth filter design
IIR Filter Design Bilinear transform

Second-order Butterworth low-pass filter


The poles of the CT filter lie on the unit circle in the s-plane (not to be
confused with the z-plane) and are represented by the black crosses below.
Remark: The gray crosses represent the poles of H(−s) and are useful to visualize the pole-placement pattern.

Im(s)
K =2

135◦

Re(s)

−135◦

G. Ducard 26 / 41
Infinite Impulse Response Filters Methodology
First-Order Low-Pass Filter CT Butterworth filter design
IIR Filter Design Bilinear transform

Third-order Butterworth low-pass filter


If, instead, a third-order low-pass filter is chosen (K = 3), the pole plot looks
as follows:

Im(s)
K=3

120◦

Re(s)

−120◦

G. Ducard 27 / 41
Infinite Impulse Response Filters Methodology
First-Order Low-Pass Filter CT Butterworth filter design
IIR Filter Design Bilinear transform

Corner frequency specification

The design method introduced above assumed a corner frequency


of 1 rad/sec. However, other corner frequencies ωc can be chosen.

In that case, we proceed with the following change of


variable
s
s→ .
ωc

For example, the second order filter becomes

ωc 2
H(s) = √ ,
s2 + 2ωc s + ωc 2
which has the same response
√ as a mass-spring-damper system with
sub-critical damping 1/ 2 and natural frequency ωc .
G. Ducard 28 / 41
Infinite Impulse Response Filters Methodology
First-Order Low-Pass Filter CT Butterworth filter design
IIR Filter Design Bilinear transform

Outline

1 Infinite Impulse Response Filters


IIR filter : difference equation
Transfer function

2 First-Order Low-Pass Filter


Definition
Properties
Design considerations
Connection to CT systems

3 IIR Filter Design


Methodology
CT Butterworth filter design
Bilinear transform
G. Ducard 29 / 41
Infinite Impulse Response Filters Methodology
First-Order Low-Pass Filter CT Butterworth filter design
IIR Filter Design Bilinear transform

Bilinear transform or Tustin’s method

Once a CT filter has been designed, ⇒ the bilinear transform (also


known as Tustin’s method) can be used to convert it into a DT
filter.
The bilinear transform uses the substitution that
 
2 z−1
s= ,
Ts z + 1
where Ts is the sampling time.

G. Ducard 30 / 41
Infinite Impulse Response Filters Methodology
First-Order Low-Pass Filter CT Butterworth filter design
IIR Filter Design Bilinear transform

Bilinear transform or Tustin’s method


Recall that z can be given the interpretation of a DT shift operator. If

Y (z) = zU (z),

then
y[n] = u[n + 1].
sTs
Similarly, in CT, e can be given the interpretation of a time shift operator. If

Y (s) = esTs U (s)

where Y (s) and U (s) are the Laplace transform of y(t) and u(t), respectively,
then
y(t) = u(t + Ts ).
Therefore, the two operators are equivalent:

z = esTs .

G. Ducard 31 / 41
Infinite Impulse Response Filters Methodology
First-Order Low-Pass Filter CT Butterworth filter design
IIR Filter Design Bilinear transform

Bilinear transform or Tustin’s method


A rational approximation for the relation between z and s will map a rational
CT transfer function to a rational DT transfer function. This is equivalent to
converting differential equations to difference equations. We therefore use the
approximation
Ts
sTs es 2 1 + s T2s
e = ≈ ,
e−s 2
Ts
1 − s T2s
which is valid if sTs is small. We call
1 + s T2s
z=
1 − s T2s

the bilinear transform. The inverse is


 
2 z−1
s=
Ts z+1
and is straightforward to verify by substitution.

G. Ducard 32 / 41
Infinite Impulse Response Filters Methodology
First-Order Low-Pass Filter CT Butterworth filter design
IIR Filter Design Bilinear transform

DC- CT mapping
We now evaluate the bilinear transform along the imaginary axis of the s-plane;
that is, let s = jω. Using the bilinear transform, this point maps to

1 + jω T2s
z= .
1 − jω T2s

Note that
1 + jω Ts
2
|z| = = 1.
1 − jω T2s

Conclusion
The bilinear transform therefore maps the imaginary axis of the s-plane to the
unit circle in the z-plane.

G. Ducard 33 / 41
Infinite Impulse Response Filters Methodology
First-Order Low-Pass Filter CT Butterworth filter design
IIR Filter Design Bilinear transform

DC- CT mapping
We therefore write
1 + jω T2s
z = ejΩ = ,
1 − jω T2s
and calculate the mapping of a CT frequency ω to a DT frequency Ω as:
∠ejΩ = ∠(1 + jω T2s ) − ∠(1 − jω T2s )
Ω = arctan(ω T2s ) − arctan(−ω T2s )
= 2 arctan(ω T2s ).

Conclusion
The frequency response of the CT system at ω (the CT transfer function
evaluated on the imaginary axis at s = jω)
directly corresponds to
the frequency response of the resulting DT system at Ω = 2 arctan(ω T2s ) (the
DT transfer function evaluated on the unit circle at z = ejΩ ).

This is a desirable property, as we will later see. G. Ducard 34 / 41


Infinite Impulse Response Filters Methodology
First-Order Low-Pass Filter CT Butterworth filter design
IIR Filter Design Bilinear transform

DC- CT mapping
For small ωTs , the DT frequency is approximately Ω ≈ 2(ω T2s ) = ωTs . This is
also evident when we plot the mapping of CT frequencies to DT frequencies for
z = esTs and the bilinear transform:

Ω Ω = ωTs
π Ω = 2 arctan(ωTs /2)

2
π/2

ω
0
0 2/Ts π/Ts

Note how Ω asymptotically converges to π as ω → ∞: The bilinear transform


compresses the imaginary axis of the s-plane onto the unit circle. G. Ducard 35 / 41
Infinite Impulse Response Filters Methodology
First-Order Low-Pass Filter CT Butterworth filter design
IIR Filter Design Bilinear transform

Frequency warping
The underlying nonlinear relation between ω and Ω is called frequency warping.
A few common values are:

ω=0 ⇒ Ω=0
ω=∞ ⇒ Ω=π
2 π
ω= ⇒ Ω=
Ts 2
jΩ
s = jω ⇒ z = e .

Other points are:


2 2
z=0⇒s=− , z=∞⇒s= .
Ts Ts
G. Ducard 36 / 41
Infinite Impulse Response Filters Methodology
First-Order Low-Pass Filter CT Butterworth filter design
IIR Filter Design Bilinear transform

Region of stability mapping


Stable poles in the continuous domain are mapped to stable poles in the
discrete domain:
s-domain z-domain

This is desirable, as it means that a stable CT filter is transformed into a stable


DT filter.

Summary
The bilinear transform preserves stability and maps the imaginary axis in the
s-plane to the unit circle in the z-plane by compressing the CT frequencies
−∞ < ω < ∞ to DT frequencies −π < Ω < π.
G. Ducard 37 / 41
Infinite Impulse Response Filters Methodology
First-Order Low-Pass Filter CT Butterworth filter design
IIR Filter Design Bilinear transform

Example: Converting a CT first-order low-pass filter

Consider the CT low-pass filter with time constant τ


1
H(s) = .
τs + 1

Using the bilinear transform, we obtain

1 1 − α 1 + z −1
H(z) =   =
1 + τ T2s z−1 1 − αz −1 2
z+1

with
Ts
1− 2τ
α= Ts
.
1+ 2τ

G. Ducard 38 / 41
Infinite Impulse Response Filters Methodology
First-Order Low-Pass Filter CT Butterworth filter design
IIR Filter Design Bilinear transform

Example: Converting a CT first-order low-pass filter


Ts Ts
For small values of τ
, α ≈1− τ
, as before.

Let us compare different discretization methods:

Method Transfer function Filter parameter


Ts
1−α
Direct H(z) = 1−αz −1
α = e− τ (decay time τ )
− Tτs
−1
(1−α)z
Sample and Hold H(z) = 1−αz −1
α=e (time constant τ )
−1
(1−α)( 1+z2 ) 1− T s
Bilinear H(z) = α= 2τ
(time constant τ )
1−αz 1+ T
−1 s

G. Ducard 39 / 41
Infinite Impulse Response Filters Methodology
First-Order Low-Pass Filter CT Butterworth filter design
IIR Filter Design Bilinear transform

Example: Converting a CT first-order low-pass filter

A nice property of the bilinear transform, for this example: is that

H(z = −1) = 0

This corresponds to
z = −1 = e−jπ
which is the highest possible DT frequency .

Remark: Observe that the CT first-order low-pass has


lim H(s) = 0
s→j∞

Conclusion :
the frequency responses at the highest possible frequencies are the same for the
CT and the DT system when using the bilinear transform.
⇒ It follows that their high-frequency behavior is similar, which is one of the
advantages of the bilinear transform. G. Ducard 40 / 41
Infinite Impulse Response Filters Methodology
First-Order Low-Pass Filter CT Butterworth filter design
IIR Filter Design Bilinear transform

Example: Converting a CT first-order low-pass filter


This can be seen by looking at the frequency response plots of the resulting
filters for Ts = 1 and τ = 2:

1 Continuous-time
Bilinear transform
|H(Ω)|

ZOH
0.5 Direct

90
∠H(Ω)

0
−90

0 π/2 π
G. Ducard 41 / 41

You might also like