EE 445S Real-Time Digital Signal Processing Lab

photohomoeopathAI and Robotics

Nov 24, 2013 (3 years and 8 months ago)

84 views

EE 445S Real
-
Time Digital

Signal Processing Lab



Fall
2013

Lab 3

IIR Filters

Chao Jia

Debarati Kundu

Andrew Mark



2

Outline


IIR Filters DF
-
I and Implementation


IIR Filter DF
-
II and Implementation


IIR Filter SOS and Implementation

3

IIR Filters


IIR

Filters

can

be

represented

as





Its

time

domain

equivalent

is




This

is

called

“Direct

Form”

since

the

multiplier

coefficients

in

the

difference

equation

are

precisely

the

coefficients

of

the

transfer

function
.






M
=
k
k
k
N
=
k
k
k
Y(z)z
a
X(z)z
b
=
Y[z]
1
0





M
=
k
k
N
=
k
k
k]
y[n
a
k]
x[n
b
=
y[n]
1
0
M
M
2
N
N
2
1
z
a
+
+
z
a
+
z
a
z
b
+
+
z
b
+
z
b
+
b
=
X[z]
Y[z]
=
H[z]









2
1
1
2
1
0
1
4

IIR Filters DF
-
I Implementation






M
=
k
k
N
=
k
k
k]
y[n
a
k]
x[n
b
=
y[n]
1
0

Compute

y[n]



Update

state

variables



x
[
n

N
]
=x
[
n

N+
1
]
x
[
n

N+
1
]
=x
[
n

N+
2
]
.
.
.
.
x
[
n

1
]
=x
[
n
]
y
[
n

M
]
=y
[
n

M+
1
]
y
[
n

M+
1
]
=y
[
n

M+
2
]
.
.
.
.
y
[
n

1
]
=y
[
n
]
5

IIR Filters DF
-
II Implementation


Compute

v[n]



Compute

y[n]



Update

state

variables








N
=
k
k
k]
v[n
a
x[n]
=
v[n]
1


N
=
k
k
0
k]
v[n
b
+
v[n]
b
=
y[n]
1
v
[
n

N
]
=v
[
n

N+
1
]
v
[
n

N+
1
]
=v
[
n

N+
2
]
.
.
.
.
v
[
n

1
]
=v
[
n
]
6

IIR Filters SOS Implementation








A

cascade

of

second

order

sections

(SOS)
.


Each

section

is

just

a

second

order

IIR

filter,

also

called

as

biquad
.



6
-

7

Discrete
-
Time IIR Biquad


For poles at


, where is the pole
radius (
r

< 1 for stability), with
y

=

2
a
:



Real poles:


Q

= ½



h[n] =
C
0

a
n

u
[
n
] +
C
1

n a
n

u
[
n
]

Poles on unit circle:





(oscillatory response)

Example: To maintain stability (given a 16
-
bit fixed
-
point digital
signal processor with 40
-
bit accumulators),
Q
max

~ 40

Q=

(
1
+r
2
)
2

y
2
2
(
1

r
2
)
where
1
2

Q<

2
2
+b
a
r=
Filter design programs often use
r
as approximation of quality factor



Q

j
re
jb
a



6
-

8

IIR Filter Implementation


Classical IIR filter designs


Filter of order
n

will have
n
/2 conjugate poles if
n

is even or
one real pole and (
n
-
1)/2 conjugate poles if
n

is odd


Response is very sensitive to perturbations in pole locations



Rule
-
of
-
thumb for implementing IIR filter


Decompose IIR filter into second
-
order sections (
biquads
)


Cascade
biquads

from input to output in order of ascending
quality factors

9

IIR Filters SOS Implementation


The

fdatool

in

Matlab

automatically

breaks

the

IIR

filter

into

biquads
.

Same

coefficients

are

used

as

DF
-
I

and

DF
-
II
.


For

M

biquads
,

you

also

get

M+
1

scaling

factors
.

Typically

scale
M+
1

=

1


Implementation

is

like





Use

either

DF
-
I

or

DF
-
II

to

implement

each

biquad
.


Each

biquad

has

its

own

state

variables
.

DO

NOT

MIX

THE

STATE

VARIABLES

OF

BIQUADS
.






Scale
1

Biquad
1

Scale
2

Biquad
2



Scale
M

Biquad
M

Scale
M+1