You are on page 1of 21

Lecture 7 - IIR Filters

James Barnes (James.Barnes@colostate.edu)

Spring 2014

Colorado State University Dept of Electrical and Computer Engineering ECE423 – 1 / 21


Outline

1. IIR Filter Representations – Difference Equations, h[n], H(z)


2. IIR Filter Topologies

Lecture 8
1. IIR Filter Design Overview
2. REVIEW Analog → Digital Filter Design via Impulse Invariance
3. NEW Analog → Digital Filter Design via Bilinear Transformation
4. Pre-warping
5. Low-pass to High-pass Frequency Transformation

Colorado State University Dept of Electrical and Computer Engineering ECE423 – 2 / 21


❖ Outline
IIR Filter
Representations –
Difference Equations,
h[n], H(z)
❖ Review - Digital
Computer Wiring
Diagram
❖ IIR Filter is an LTI
System
❖ IIR Transfer Function
❖ Product Form of
Transfer Function
IIR Filter Representations – Difference
❖ Time Domain
Representation Equations, h[n], H(z)
❖ Time Domain
Representations (cont’d)
❖ Frequency Response

IIR Filter Topologies

Colorado State University Dept of Electrical and Computer Engineering ECE423 – 3 / 21


Review - Digital Computer Wiring Diagram

Colorado State University Dept of Electrical and Computer Engineering ECE423 – 4 / 21


IIR Filter is an LTI System

An IIR filter is one class of linear time-invariant system. We can represent the
function of the filter as a difference equation:

X
N X
M
y[n] = − ak y[n − k] + bk x[n − k] (1)
k=1 k=0

The first sum represents the ”Auto-Regressive” or IIR part and the second sum
represents the ”Moving Average” or FIR part. In general, a filter can have either
or both parts.

Recalling that y[n − k] = z −k y[k], we can write (1) as

X
N X
M
{1 + ak z −k }{y[n]} = { bk z −k }{x[n]} (2)
k=1 k=0

Colorado State University Dept of Electrical and Computer Engineering ECE423 – 5 / 21


IIR Transfer Function

Equation (2) has the form

A(z){y[n]} = B(z){x[n]} (3)


Taking the z-transform of the sequences x[n] and y[n] in (3), we get

A(z)Y (z) = B(z)X(z) (4)

or
A(z)H(z) = B(z). (5)
Therefore
PM−k
B(z) k=0 bk z
H(z) = = PN . (6)
A(z) 1 + k=1 ak z −k

Therefore, by choosing ak and bk , we determine the filter frequency response.

Colorado State University Dept of Electrical and Computer Engineering ECE423 – 6 / 21


Product Form of Transfer Function

Another form of the transfer function we will use is the factored or product form:
QM −1
k=1 (1 − zk z )
H(z) = b0 QN , (7)
−1
k=1 (1 − pk z )
where zk and pk are the pole and zero locations. Since we are concerned with
systems having a real impulse response h[n], the poles and zeros either be real
or occur in complex conjugate pairs.

Recall that for a filter to have linear phase, H(z) must satisfy

H(z) = ±z −N H(z −1 ). (8)


For an IIR filter to satisfy the linear phase condition, both the poles and zeros
would need to have mirror images outside the unit circle of the z-plane. However,
poles outside the unit circle ⇒ unstable. Therefore, a causal, stable IIR cannot
have linear phase.

Colorado State University Dept of Electrical and Computer Engineering ECE423 – 7 / 21


Time Domain Representation

Taking the inverse z-transform of (4) , we get the standard convolution sum form

X
N X
M
ak y[n − k] = bk x[n − k]. (9)
k=0 k=0

But using the fact that x[n] = δ[n] ⇒ y[n] = h[n], (10) can be written

X
N X
M
ak h[n − k] = bk δ[n − k]. (10)
k=0 k=0

Colorado State University Dept of Electrical and Computer Engineering ECE423 – 8 / 21


Time Domain Representations (cont’d)

Assuming causality (h[n]=0 for n<0), (9) can be expanded to a series of


equations. Recalling that a0 = 1, the equations are

h[0] = b0 ,
h[1] = b1 − a1 h[0],
... ... ...
h[M ] = bM − a1 h[M − 1] − . . . − aN h[M − N ],
h[M + 1] = −a1 h[M ] − a2 h[M − 1] − . . . − aN −1 h[M − N ] − aN h[M − N − 1].

Note that even though h[n] has a finite length, the impulse response can have an
”infinite” duration because of the recursive nature of the equation for y[n].

Colorado State University Dept of Electrical and Computer Engineering ECE423 – 9 / 21


Frequency Response

The frequency response is given by



PM
−jωk
jω B(e ) k=0 bk e
H(z = e ) = jω
= PN , (11)
A(e ) 1 + k=1 ak e −jωk

where ω = 2πF/Fs is the relative frequency in radians/sample.

For comparison, the frequency response of an equivalent analog LTI system is


given by
PM k
k=0 βk s
H(s) = PN k
(12)
1+ k=1 αk s

Colorado State University Dept of Electrical and Computer Engineering ECE423 – 10 / 21


❖ Outline
IIR Filter
Representations –
Difference Equations,
h[n], H(z)

IIR Filter Topologies


❖ IIR Filter Topologies –
Summary
❖ Direct Type I
❖ Direct Type II
❖ Transposed Type II
❖ Numerical Effects IIR Filter Topologies
❖ Pole/Zero Quantization
Effects
❖ Pole/Zero Quantization
- Relation to Roundoff
Error
❖ P/Z Quantization -
Relation to Roundoff
Error(II)
❖ Biquad Section
❖ Pole/Zero Quantization
for Coupled-Form
Realization of 2-Pole
Section

Colorado State University Dept of Electrical and Computer Engineering ECE423 – 11 / 21


IIR Filter Topologies – Summary

IIR filter topologies can be classified as


● Direct Type I or Type II
● Transposed
In addition, filters can be either monolithic or built from cascades of smaller
(typically second order) sections

Colorado State University Dept of Electrical and Computer Engineering ECE423 – 12 / 21


Direct Type I

1
H(z) = H1 (z)H2 (z) = B(z) (13)
A(z)

x[n] b[0] v[n] y[n]


+ +

z -1 b[1] - a[1]
z -1 Properties
s [1]
+ +
● Memory cells: M+N+1
z -1 b[2] - a[2]
z -1 ● Mpy/Add ops: M+N+1
+ +

b[M-1] - a[N-1]
+ +

z -1 b[M] - a[N]
z -1
s [N]

Colorado State University Dept of Electrical and Computer Engineering ECE423 – 13 / 21


Direct Type II

1
H(z) = H2 (z)H1 (z) = B(z) (14)
A(z)

x[n] v[n] b[0] y[n]


+ +

z -1
- a[1] b[1] Properties
s1[n]
+ +
● Memory cells: Greater of [M,N]
z -1 ● Mpy/Add ops: M+N+1
- a[2] b[2]
s2[n]
+ +

- a[N-1] b[N-1]
sN-1[n]
+ +

z -1
- a[N] b[N]
sN[n]

Colorado State University Dept of Electrical and Computer Engineering ECE423 – 14 / 21


Transposed Type II

Transposition Theorem: reverse direction of all signal flow paths, exchange input
and output, and the filter function is unchanged

x[n] b[0] y[n]


+
s1[n]

z -1
Properties
b[1] - a[1]
+ ● Memory cells: Greater of [M,N]
s2[n] ● Mpy/Add ops: M+N+1
z -1 ● Fewer adders, but 3 inputs
b[2] - a[2]
+

sN[n]

z -1
b[N] - a[N]

Colorado State University Dept of Electrical and Computer Engineering ECE423 – 15 / 21


Numerical Effects

Fixed point arithmetic (and to a lesser extent floating point) can cause deviations
from ideal behavior because of
● Round-off error in computing sum-of-products expressions
● Arithmetic overflow in computing SOP expressions
● Arithmetic overflow in filter tap coefficients in adaptive filters
● ”Quantization” of pole and zero locations due to finite precision leading to
different frequency dependence than design target.

Colorado State University Dept of Electrical and Computer Engineering ECE423 – 16 / 21


Pole/Zero Quantization Effects

Pole and Zero locations are determined from the ak and bk values. Because of
finite precision in fixed-point arithmetic, placement is constrained to a grid of
points. Example for a 2-pole system, using 4 bit precision

Colorado State University Dept of Electrical and Computer Engineering ECE423 – 17 / 21


Pole/Zero Quantization - Relation to
Roundoff Error
Consider case of ”pole-only” system, with H(z) = 1/A(z) :
1 1
H(z) = PN = QN . (15)
1+ k=1 ak z −k k=1 (1 − pk z −k )
But because of roundoff error,

a¯k = ak + ∆ak, (16)


where a¯k is the quantized value and ak is the ”infinite precision” desired value.

If △pi is the error in pole location pi due to quantization, we can compute △pi
from the expression

X
N
∂pi
△pi = △ak . (17)
∂ak
k=1

Colorado State University Dept of Electrical and Computer Engineering ECE423 – 18 / 21


P/Z Quantization - Relation to Roundoff
Error(II)
But the derivative in (17) can be evaluated as

∂pi (∂A(z)/∂ak )z=pi


= . (18)
∂ak (∂A(z)/∂z)z=pi
Evaluating the numerator and denominator, we get

X
N
pN −k
i
△pi = − QN . (19)
k=1 l=1,l6=i (pi − pl )
Because of the product term in the denominator, the error term can get large for
poles which are close together. The error can be minimized by breaking up the
filter into sections with poles as far apart as possible.

Typically, the filter is broken up into sections of second-order sections, where the
poles and zeros are chosen to be complex conjugates. These wil not be close
together, and the error will be minimized.

Colorado State University Dept of Electrical and Computer Engineering ECE423 – 19 / 21


Biquad Section

x[n]
G 1  b[1,1]z 1  b[2,1]z 2 1  b[1, k ]z 1  b[2, k ]z 2 1  b[1, N s ]z 1  b[2, N s ]z 2 y[n]
1  a[1,1]z 1
 a[2,1]z 2 … 1  a[1, k ]z 1
 a[2, k ]z 2 … 1  a[1, N s ]z 1  a[2, N s ]z  2

Colorado State University Dept of Electrical and Computer Engineering ECE423 – 20 / 21


Pole/Zero Quantization for Coupled-Form
Realization of 2-Pole Section
There is also a realization which will at least distribute the pole locations evenly
in the z-plane. This is the coupled-form. The data below are for a two-pole
system with 4 bit coefficient precision as before.

Colorado State University Dept of Electrical and Computer Engineering ECE423 – 21 / 21

You might also like