Chapter 8:
Infinite Impulse Response (IIR) Filters
In Ch.5, we considered digital filters with finite im-
pulse response (FIR).
Here, we extend our previous filter model by in-
cluding previous output terms to obtain an infinite
impulse response filter.
New class of systems that have infinite duration im-
pulse responses.
Involve previously computed values of the output
as well as the values of the input sequence in the
computation of the present output.
Previous output is fed back to be combined with
the input (example of feedback systems).
N
X M
X
y[n] = a` y[n − `] + bk x[n − k]
`=1 k=0
Now, we have two types of filter coefficients:
{bk } : feedforward coefficients
{a`} : feedback coefficients
What is the total number of filter coefficients?
N : order of the system
If all {a`} are zero, reduces to an FIR filter.
1
LECTURE OBJECTIVES
INFINITE IMPULSE RESPONSE FILTERS
Define IIR DIGITAL Filters
Have FEEDBACK:
FEEDBACK use PREVIOUS OUTPUTS
N M
y[n] ay[n ] bk x[n k]
1 k 0
Show how to compute the output y[n]
FIRST-ORDER CASE (N=1)
z-transform: impulse response h[n] H(z)
LOGICAL THREAD
FIND the IMPULSE RESPONSE, h[n]
INFINITELY LONG
IIR Filters H(z) h[n]z n
n 0
EXPLOIT THREE DOMAINS:
Show Relationship for IIR:
ˆ
j
h[n] H (z) H(e )
2
LECTURE OBJECTIVES
SYSTEM FUNCTION: H(z)
H(z) has POLES and ZEROS
FREQUENCY RESPONSE of IIR
Get H(z) first
jˆ
H ( e ) H ( z ) z e jˆ
THREE-DOMAIN APPROACH
h[n ] H ( z ) H (e ĵ )
3
THREE DOMAINS---FIR
z-TRANSFORM-DOMAIN
POLYNOMIALS: H(z)
{bk }
TIME-DOMAIN FREQ-DOMAIN
M M
y[n ] bk x[n k ] H ( e ) bk e jˆ k
jˆ
k 0 k 0
THREE DOMAINS---IIR
z-TRANSFORM-DOMAIN: poles & zeros
POLYNOMIALS: H(z)
use H(z) to get
freq. response ˆ
j
bk z k ze
H(z)
{a, bk }
1 az
TIME-DOMAIN FREQ-DOMAIN
M
N M
y[n ] a y[n ] bk x[n k ] bk e jˆ k
1 k 0 H ( e jˆ ) k 0
N
1 ae jˆ
1
4
• We will limit our coverage to first- and second-
order filters. One reason is that higher-order systems
can be built by cascading low-order systems, using
them as building blocks or modules.
• In Ch.5, we have shown that all causal FIR filters
are LTI. It can be argued that all IIR filters are LTI
as well (see textbook).
• IIR filters are recursive in nature and their out-
put can be calculated by iterations.
5
Quick Review: Delay by nd
y[n ] x[n nd ]
IMPULSE RESPONSE h[n ] [n nd ]
SYSTEM FUNCTION H ( z ) z nd
FREQUENCY RESPONSE H ( e jˆ ) e jˆ nd
6
ONE FEEDBACK TERM
add PREVIOUS outputs
y[n] a1 y[n 1] b0 x[n] b1 x[n 1]
FIR PART of the FILTER
PREVIOUS FEED-FORWARD
FEEDBACK
CAUSALITY
not using FUTURE OUTPUTS or INPUTS
FILTER COEFFICIENTS
add PREVIOUS outputs
y[n] 0.8y[n 1] 3x[n] 2x[n 1]
FEEDBACK COEFFICIENT SIGN CHANGE
MATLAB
yy = filter([3,-2],[1,-0.8],xx)
7
COMPUTE OUTPUT
COMPUTE y[n]
FEEDBACK DIFFERENCE EQUATION:
y[n] 0.8y[n 1] 5x[n]
NEED y[-1] to get started
y[0] 0.8y[1] 5x[0]
8
INITIAL REST CONDITIONS
y[n] = 0, for n<0
because x[n] = 0, for n<0
COMPUTE y[0]
This starts the recursion:
SAME with MORE FEEDBACK TERMS
2
y[n] a1 y[n 1] a2 y[n 2] bk x[n k]
k 0
9
COMPUTE MORE y[n]
CONTINUE THE RECURSION:
PLOT y[n]
10
IMPULSE RESPONSE
h[n]
y[n] a1 h[n
y[n 1] b0x[n]
[n]
h[n] b0 (a1 ) n u[n]
IMPULSE RESPONSE
DIFFERENCE EQUATION:
y[n] 0.8y[n 1] 3x[n]
Find h[n]
h[n] 3(0.8)n u[n]
CONVOLUTION in the TIME-DOMAIN
x[n] y[n] h[n] x[n]
h[n]
IMPULSE
RESPONSE LTI SYSTEM
11
PLOT IMPULSE RESPONSE
n n
h[n] b0 (a1 ) u[n] 3(0.8) u[n]
• Because of the feedback, the impulse response of
an IIR filter is typically of infinite duration.
• The output of an IIR filter due to a finite-length
input sequence, being a superposition of shifted and
scaled impulse responses, is generally (but not al-
ways) infinite in extent. This is in contrast to the
FIR case where a finite-length input sequence always
produces a finite-length output sequence.
• This is a system with memory, therefore, it re-
members its past output (in response to the impulsive
input at n = 0) until n = ∞.
12
H(z): z-transform of h[n]
another first-order IIR filter:
y[n] a1 y[n 1] b0 x[n] b1 x[n 1]
h[n ] b0 ( a1 )n u[n ] b1 ( a1 )n 1 u[n 1]
z 1 is a shift
b0 b1 z 1 b0 b1z 1
H(z) 1 1 1
1 a1 z 1 a1 z 1 a1 z
• To get the impulse response of the first-order sys-
tem:
y[n] = a1y[n − 1] + box[n] + b1x[n − 1]
we can start iterating the recursive equation from
scratch. However, given that all IIR filters are LTI,
there is a shorter and more clever way:
From the previous example, we know that when
b1 = 0, the impulse response is expressed by h[n] =
bo(a1)nu[n]. In the given first-order system, we have
two input terms instead of one. Using the fact that
this filter is LTI, we can get the output for the second
13
term of the input (b1x[n − 1]) and then superpose
it with the output for the first term (box[n]) of the
input.
The difference equation for the impulse response is:
h[n] = a1h[n − 1] + boδ[n] + b1δ[n − 1]
However, this equation is recursive. We need an
explicit solution for h[n]. To get this, we exploit the
fact that the filter is LTI:
bo δ[n] 7→ bo an1 u[n] (derived earlier)
bo δ[n − 1] 7→ bo an−1
1 u[n − 1] (time invariance)
b1 b1
bo δ[n − 1] 7→ bo an−1
1 u[n − 1] (scalability)
bo bo
b1 δ[n − 1] 7→ b1 an−1
1 u[n − 1] (simplifying above)
bo δ[n] + b1 δ[n − 1] 7→ bo an1 u[n] + b1 an−1
1 u[n − 1] (superpos.)
Therefore, the explicit solution for h[n] is:
bo an1 u[n] + b1 an−1
h[n] = 1 u[n − 1]
0 for n < 0
= bo for n = 0
(bo + b1a−1)an for n ≥ 1
1 1
We would get the same result by iterating from scratch.
Note that the impulse response h[n] decays exponen-
tially with rate dependent only on a1.
14
UNIT STEP RESPONSE: x[n]=u[n]
DERIVE STEP RESPONSE
15
Depending on the value of the feedback coefficient
a1, three cases can be identified:
• |a1| > 1
As n → ∞, the term an+1 1 will dominate and the
output values get larger and larger without bound.
Such a system is unstable.
• |a1| < 1
As n → ∞, the term an+1 1 will decay to zero.
The system is stable.
1 − an+1
1 bo
lim y[n] = lim bo =
n→∞ n→∞ 1 − a1 1 − a1
• |a1| = 1
two possibilities:
a1 = 1 :
y[n] = bo(n + 1) for n ≥ 0
y[n] grows without bound n → ∞.
The system is unstable.
a1 = −1 (:
bo for n even
y[n] = for n ≥ 0.
0 for n odd
The output y[n] alternates between a constant (bo)
and 0. The system is considered stable on the bor-
derline (marginally stable).
16
For example, consider the first-order filter with dif-
ference equation:
y[n] = 0.8 y[n − 1] + 3 x[n] (a1 = 0.8, bo = 3)
Since |a1| < 1, this fits into the second case above.
bo 3 3
lim y[n] = = = = 15
n→∞ 1 − a1 1 − 0.8 0.2
PLOT STEP RESPONSE
n1
y[n] 0.8y[n 1] 3u[n] y[n] 151 0.8 u[n]
We could compute the step response of the filter
using the discrete convolution sum and get the same
result (see textbook p.204).
This is a system with memory, therefore, remem-
bers its past output.
17
System Function of an IIR Filter:
Recall from Ch.7, the definition of the z transform:
X∞
X(z) = x[k]z −k
k=−∞
and that the system function H(z) is the z-transform
of the impulse response h[n] of an LTI system:
X∞
H(z) = h[k]z −k
k=−∞
Also recall the convolution property of the z
transform:
CONVOLUTION PROPERTY
convolution in the n-domain
equivalent to
multiplication in the z-domain
y[n ] h[n ] x[n ] Y ( z ) H ( z ) X ( z )
y[n ] x[n ] h[n ] MULTIPLY
M z-TRANSFORMS
h[k ] x[n k ]
k 0 FIR Filter
18
The convolution property provides an alternative
way to express the system function as:
Y (z)
H(z) =
X(z)
• The system function of an FIR filter is always a
polynomial in powers of z −1.
• The system function of an IIR filter is the ratio
of two polynomials in powers of z −1.
(rational function)
The numerator polynomial involves the feedforward
coefficients {bk } whereas the denominator polynomial
involves the feedback coefficients {a`}.
Consider the general form of the first-order differ-
ence equation with feedback:
y[n] = a1y[n − 1] + box[n] + b1x[n − 1]
Taking the z transform of both sides of the equation:
Y (z) = a1z −1Y (z) + boX(z) + b1z −1X(z)
(1 − a1z −1)Y (z) = (bo + b1z −1)X(z)
Y (z) bo + b1z −1 B(z)
−→ H(z) = = −1
=
X(z) 1 − a1z A(z)
General expression for a N th-order IIR filter:
Y (z) bo + b1z −1 + b2z −2 + . . . + bM z −M B(z)
H(z) = = −1 −2 −N
=
X(z) 1 − a1z − a2z − . . . − aN z A(z)
19
Hardware Implementation: Direct Form I
Y (z) bo + b1z −1 B(z)
H(z) = = −1
=
X(z) 1 − a1 z A(z)
−1 1 1
= (bo + b1z ) = B(z)
1 − a1z −1 A(z)
corresponding n-domain equations:
v[n] = box[n] + b1x[n − 1]
y[n] = a1y[n − 1] + v[n]
20
Hardware Implementation: Direct Form II
Recall that for cascaded LTI subsystems, we can
change the arrangement of subsystems (each of which
is LTI) without changing the overall system response.
B(z) 1 1
H(z) = = B(z) = B(z)
A(z) A(z) A(z)
(commutative property of complex multiplication)
corresponding n-domain equations:
w[n] = a1w[n − 1] + x[n]
y[n] = bow[n] + b1w[n − 1]
21
• Delay operations are implemented using mem-
ory elements in a computer.
• In the Direct Form II implementation, it is possi-
ble to save one unit-delay (memory) element by com-
bining the two unit delays into one:
• There is also a third way of implementation called
the Transposed Form, available in the textbook.
• These different implementations are of interest.
Although they all look equivalent with the same num-
ber of adders and multipliers, this is only true when
the arithmetic is perfect. On a computer with finite
precision, each calculation will involve round-off er-
rors and each implementation will behave differently.
22
Consider the impulse response h[n] = anu[n]. Tak-
ing the z transform of the impulse response:
∞
X
H(z) = h[k]z −k
k=−∞
X∞
= ak u[k]z −k
k=−∞
X∞
k −k
= a z
k=0
∞
X
−1 k 1 −1
= (az ) = if |az | < 1 or |a| < |z|
1 − az −1
k=0
The values of z on the complex z plane satisfy-
ing this condition are called region of convergence
(RoC).
important z-transform pair:
n Z1
a u[n] ←→ for |a| < |z|
1 − az −1
23
Infinite-Length Sequence: h[n]
POLYNOMIAL representation
n
H(z) h[n]z APPLIES to
n any SIGNAL
SIMPLIFY the SUMMATION
n n n n
H ( z) b (
0 1 a ) u[ n ] z b0 1 z
a
n n 0
Derivation of H(z)
Recall sum of geometric sequence:
n 1
Yields a COMPACT FORM:
r 1 r
n0
n n
H ( z ) b0 a z 1 b0 (a1 z 1 ) n
n 0 n 0
b0
if z a1
1 a1 z 1
24
First-Order Transform Pair
n b
h[n] ba u[n] H(z)
1 a z1
geometric sequence:
n n
H ( z ) b0 a z 1 b0 (a1 z 1 ) n
n 0 n 0
b0
if z a1
1 a1 z 1
H(z): z-transform of h[n]
first-order IIR filter:
y[n] a1 y[n 1] b0 x[n]
n
h[n] b0 (a1 ) u[n]
b0
H(z) 1
1 a1 z
25
For example, considering the first-order filter:
y[n] = a1y[n − 1] + box[n] + b1x[n − 1]
whose impulse response we derived earlier as:
h[n] = bo an1 u[n] + b1 an−1
1 u[n − 1]
Take the z transform of the whole equation to get:
−1
1 −1 1 b o + b 1 z
H(z) = bo +b 1 z =
1 − a1z −1 1 − a1z −1 1 − a1z −1
We have found the same result by taking the z
transform of the difference equation and solving for
Y (z)
H(z) = X(z) .
26
Table of z Transform Pairs and Properties:
∞
Z
X
x[n] ←→ X(z) = x[k] z −k
k=−∞
Z
αx1[n] + βx2[n] ←→ αX1(z) + βX2(z) ∀α, β
Z
x[n − no] ←→ z −no X(z)
Z
y[n] = x[n] ∗ h[n] = h[n] ∗ x[n] ←→ Y (z) = X(z)H(z) = H(z)X(z)
Z
δ[n] ←→ 1
Z
δ[n − no] ←→ z −no
Z 1
anu[n] ←→ for |z| > |a|
1 − az −1
27
Bounded Input Bounded Output (BIBO)
Stability:
If the output of a discrete-time system always remains
bounded (|y[n]| < My ) whenever the input to the sys-
tem is bounded (|x[n]| < Mx), such a system is called
Bounded Input Bounded Output (BIBO) sta-
ble. The finite constants Mx and My are in general
different.
The above definition of BIBO stability is applicable
to both non-LTI and LTI systems.
If a system is known to be LTI, a necessary and sufficient
condition for BIBO stability is based on its impulse
response:
X∞
|h[k]| < ∞
k=−∞
In words, the impulse response function of the LTI
system should be absolute summable.
Stability of a system can be seen at a glance from
the pole-zero plot on the z plane:
A causal LTI system with initial rest conditions
is stable if all the poles of its system function lie
strictly within the unit circle of the complex z plane.
The locations of the zeros are irrelevant for stability.
28
A stable system is one whose output does not blow
up.
• FIR systems are always stable.
(in the causal case: poles are at the origin, z = 0).
• IIR systems may or may not be stable depending
on the location of their poles.
A first-order IIR system with a single pole at z = a1
has an impulse response ∼ an1 for n ≥ 1.
The location of the pole can tell us whether h[n]
will decay or grow:
If |a1| < 1, h[n] will die out as n → ∞.
If |a1| ≥ 1, h[n] will not die out as n → ∞ but will
grow without bound.
29
STABILITY
need a1 1
Stability of LTI Systems
necessary & sufficient condition:
h[n]
n
for a first-order system:
n b
h[n] b(a) u[n] H(z)
1 az 1
b a n if a 1 pole must be
inside unit circle
n0
30
STABILITY CONDITION
ALL POLES INSIDE the UNIT CIRCLE
UNSTABLE EXAMPLE: POLE @ z=1.1
x[n] cos(0.2 n)u[n]
31
Pole-Zero Diagrams:
• A pole-zero diagram defines the system function
up to a scale factor. In other words, system func-
tions that differ by a multiplicative scale factor have
identical pole-zero diagrams.
• There may be poles and zeros at the origin (z = 0)
and at z = ∞. The upper right-hand corner of the
complex z plane is reserved for poles/zeros at z = ∞.
• If there is more than one pole/zero at a given
location, we indicate how many next to the symbol,
in parantheses.
(e.g., double zero: ◦(2), triple pole: ×(3))
• A pole and a zero at the same location cancel out.
(e.g., if the double zero and the triple pole are at the
same location, only one pole remains.)
• When all the poles and zeros are counted, they
should balance out in number, that is, the number of
poles should always equal the number of zeros.
• The closer a pole or a zero is to the unit circle,
the more effective it is on the frequency response.
If there are zeros on the unit circle, the magnitude
response function touches zero at the corresponding
frequencies.
32
DELAY PROPERTY of X(z)
DELAY in TIME <–> multiply X(z) by z-1
x[n] X(z)
x[n 1] z 1 X(z)
Proof: x[n 1]z n
x[]z (1)
n
z 1
x[]z
z 1
X(z)
z-transform of IIR Filter
DERIVE the SYSTEM FUNCTION H(z)
Use DELAY PROPERTY
y[n] a1 y[n 1] b0 x[n] b1 x[n 1]
Y (z) a1z 1Y(z) b0 X(z) b1 z1 X(z)
EASIER with DELAY PROPERTY:
33
SYSTEM FUNCTION of IIR
NOTE the FILTER COEFFICIENTS
1 1
Y (z) a1z Y(z) b0 X(z) b1 z X(z)
(1 a1 z1 )Y (z) (b0 b1 z 1 )X(z)
Y (z) b0 b1 z 1 B(z)
H(z) 1
X(z) 1 a1 z A(z)
POLES & ZEROS
ROOTS of numerator & denominator
b0 b1 z1 b0 z b1
H(z) 1 H (z)
1 a1 z z a1
b1 ZERO:
b0 z b1 0 z H(z)=0
b0
z a1 0 z a1 POLE: H(z) inf
34
SYSTEM FUNCTION
DIFFERENCE EQUATION:
y[n] 0.8y[n 1] 3x[n] 2x[n 1]
READ the FILTER COEFFS: H(z)
3 2 z 1
Y ( z ) X ( z)
1
1 0.8 z
35
EXAMPLE: Poles & Zeros
VALUE of H(z) at POLES is INFINITE
2 2 z 1
H ( z)
1 0.8 z 1
2 2( 1)
H ( z) 0 ZERO at z= -1
1 0.8( 1)
2 2( 45 ) 1 9
2 POLE at z=0.8
H ( z) 1
4
1 0.8( 5 ) 0
POLE-ZERO PLOT
ZERO at z = -1
2 2z 1
POLE at
1 0.8z1 z = 0.8
36
Exercise:
Given: 2 2z1
H(z)
1 0.8z 1
Find the Impulse Response, h[n]
Find the output, y[n] when:
x[n] cos(0.25 n)
37
UNIT CIRCLE
MAPPING between ˆ
z and
ˆ
j
ze
z1 ˆ0
z 1 ˆ
z j ˆ 12
FREQUENCY RESPONSE
EVALUATE on the UNIT CIRCLE
ˆ
j
H(e ) H(z ) z e jˆ
38
Evaluate Frequency Response
Given: 2 2z1
H(z) 1
1 0.8z
Find output, y[n], when x[n] cos(0.25 n)
Evaluate at z e j0.25
2 2( 22 j 22 ) j1.309
H(z) j 0.25 5.182e
1 0.8e
y[n] 5.182cos( 0.25 n 0.417 )
39
Evaluate Frequency Response
z 1 is ˆ 0 2 2z1 ˆ 0.25
at
1 0.8z 1
ˆ 0.25
zero at
Frequency Response Plot
jˆ 2 2e jˆ
H (e )
1 0.8e jˆ
40
3-D VIEWPOINT:
3-D VIEW
EVALUATE H(z) EVERYWHERE
WHERE is
the POLE ?
UNIT CIRCLE
12/04/20 © 2003, JH McClellan & RW Schafer 21
41
MOVIE for H(z) in 3-D
POLES to H(z) to frequency response
two poles shown
Frequency Response from H(z)
walking around the unit circle
42
43
SECOND-ORDER IIR FILTERS
TWO FEEDBACK TERMS
2
y[n] a1 y[n 1] a2 y[n 2] bk x[n k]
k 0
H(z) can have COMPLEX POLES & ZEROS
THREE-DOMAIN APPROACH
BPFs have POLES NEAR THE UNIT CIRCLE
SECOND-ORDER IIR FILTERS
Two FEEDBACK TERMS
y[n] a1 y[n 1] a2 y[n 2]
b0 x[n] b1 x[n 1] b2 x[n 2]
b0 b1z 1 b2 z 2
H(z)
1 a1z 1 a2 z 2
44
MORE POLES
Denominator is QUADRATIC
two poles: REAL
or COMPLEX CONJUGATES
b0 b1 z1 b2 z2 b0 z2 b1 z b2
H(z) 1 2 2
1 a1 z a2 z z a1 z a2
2nd-order ex: n-domain
1 0.45z1
1 0.9z1 0.81z 2
y[n] 0.9y[n 1] 0.81y[n 2] x[n] 0.45x[n 1]
aa = [ 1, -0.9, 0.81 ];
bb = [ 1, -0.45 ];
nn = -2:19;
hh = filter( bb, aa, (nn==0) );
HH = freqz( bb, aa, [-pi,pi/100:pi] );
45
Complex POLE-ZERO PLOT
1 0.45z 1
1 2
1 0.9z 0.81z
h[n]: Decays & Oscillates
“PERIOD”=6
h[n] (0.9)n cos( 3 n)u[n]
1 0.45z 1
1 0.9z 1 0.81z 2
46
3-DOMAINS MOVIE: IIR
POLE MOVES
H(z)
H()
h[n]
47
48