0% found this document useful (0 votes)
31 views

Topic 8: Filter Design: IIR: ELEN E4810: Digital Signal Processing

This document discusses filter design, specifically IIR filter design. It begins by outlining the filter design process and key performance constraints like passband ripple, stopband attenuation, and transition bandwidth. It then compares FIR and IIR filters, noting that IIR filters are typically lower order but may be unstable. The document proposes designing IIR filters using analog prototypes, and discusses common analog filter types like Butterworth and Chebyshev filters. Butterworth filters are maximally flat, while Chebyshev filters allow ripple in the passband to improve other performance metrics. Examples are given to demonstrate the design process.
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)
31 views

Topic 8: Filter Design: IIR: ELEN E4810: Digital Signal Processing

This document discusses filter design, specifically IIR filter design. It begins by outlining the filter design process and key performance constraints like passband ripple, stopband attenuation, and transition bandwidth. It then compares FIR and IIR filters, noting that IIR filters are typically lower order but may be unstable. The document proposes designing IIR filters using analog prototypes, and discusses common analog filter types like Butterworth and Chebyshev filters. Butterworth filters are maximally flat, while Chebyshev filters allow ripple in the passband to improve other performance metrics. Examples are given to demonstrate the design process.
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/ 45

ELEN E4810: Digital Signal Processing

Topic 8:
Filter Design: IIR
1. Filter Design Specifications
2. Analog Filter Design
3. Digital Filters from Analog Prototypes

Dan Ellis 2007-11-08 1


1. Filter Design Specifications
The filter design process:
Problem

Solution
performance G(z)
Analysis constraints Design Implement
transfer
function
magnitude response FIR/IIR platform
phase response subtype structure
cost/complexity order ...

Dan Ellis 2007-11-08 2


Performance Constraints
.. in terms of magnitude response:

Dan Ellis 2007-11-08 3


Performance Constraints
Best filter:
smallest
Passband Ripple
narrowest
Transition Band
greatest
Minimum SB Attenuation
improving one usually worsens others
But: increasing filter order (i.e. cost)
improves all three measures

Dan Ellis 2007-11-08 4


Passband Ripple

PB ripple
parameter
Assume peak passband gain = 1
then minimum passband gain = 1
1+ 2
Or, ripple max = 20 log10 1+ 2
dB
Dan Ellis 2007-11-08 5
Stopband Ripple

SB ripple
parameter
Peak passband gain is A larger than
peak stopband gain
Hence, minimum stopband attenuation

s = 20 log10 A1 = 20 log10 A dB
Dan Ellis 2007-11-08 6
Filter Type Choice: FIR vs. IIR
FIR IIR
No feedback Feedback
(just zeros) (poles & zeros)
Always stable May be unstable

Can be Difficult to control


linear phase phase
BUT High order Typ. < 1/10th
(20-2000) order of FIR (4-20)
Unrelated to Derive from
continuous- analog prototype
time filtering

Dan Ellis 2007-11-08 7


FIR vs. IIR
If you care about computational cost
use low-complexity IIR
(computation no object Lin Phs FIR)
If you care about phase response
use linear-phase FIR
(phase unimportant go with simple IIR)

Dan Ellis 2007-11-08 8


IIR Filter Design
IIR filters are directly related to
analog filters (continuous time)
via a mapping of H(s) (CT) to H(z) (DT) that
preserves many properties
Analog filter design is sophisticated
signal processing research since 1940s

Design IIR filters via analog prototype


hence, need to learn some CT filter design

Dan Ellis 2007-11-08 9


2. Analog Filter Design
Decades of analysis of transistor-based
filters sophisticated, well understood
Basic choices:

ripples vs. flatness in stop and/or passband


more ripples narrower transition band

Family PB SB
Butterworth flat flat
Chebyshev I ripples flat
Chebyshev II flat ripples
Elliptical ripples ripples
Dan Ellis 2007-11-08 10
CT Transfer Functions
Analog systems: s-transform (Laplace)
Continuous-time Discrete-time

Transform H a (s) = ha (t )e st
dt H d (z ) = hd [n] z n
Frequency
response
H a ( j) Hd e( )j

Im{s} Im{z}

j ej
Pole/zero Re{z}
diagram Re{s}
1
stable s-plane stable z-plane
poles poles
Dan Ellis 2007-11-08 11
Butterworth Filters
Maximally flat in pass and stop bands
Magnitude
1 filter
response (LP): H a ( j) =
2
order
( )
2N
1+ c N

<<c,
|Ha(j)|2 1
= c,
|Ha(j)|2 = 1/2
3dB point
Dan Ellis 2007-11-08 12
Butterworth Filters 6N dB/oct
rolloff
>>c, |Ha(j)|2 (c/)2

Log-log
magnitude
response

n
flat d H ( j) 2 = 0
n a
d
@ = 0 for n = 1 .. 2N-1
Dan Ellis 2007-11-08 13
Butterworth Filters
How to meet design specifications?
1 1

( ) 1+2
p 2N
1+ c Design
Equation

( )
1 1
2 1
2
A
1 log10 2
1+( )
s 2N A N
c
( )
2 log10 s
p

p
k1 = k=
A 1
2
s
=discrimination, <<1 =selectivity, < 1
Dan Ellis 2007-11-08 14
Butterworth Filters
1
H a ( j) =
2
but what is Ha(s)?
1+ (c )2 N
Traditionally, look it up in a table
calculate N normalized filter with c = 1
scale all coefficients for desired c
In fact, H ( s ) =
1 x c
Im{s}

a
i(s pi ) x Re{s}
x s 2N
j N +2 i1 = 1
where pi = c e 2N
i = 1..N x c

s-plane
Dan Ellis 2007-11-08 15
Butterworth Example
Design a Butterworth
filter with 1 dB cutoff
at 1kHz and a
minimum attenuation
of 40 dB at 5 kHz
1
1dB = 20 log10 = 0.259
2
1+ 2
9999
40dB = 20 log10 A A = 100
1 log
N 21 10 0.259
s log10 5
=5
p N = 4 3.28
Dan Ellis 2007-11-08 16
Butterworth Example
Order N = 4 will satisfy constraints;
What are c and filter coefficients?
from a table, -1dB = 0.845 when c = 1
c = 1000/0.845 = 1.184 kHz
from a table, get normalized coefficients for
N = 4, scale by 11842
Or, use Matlab:
[B,A] =
butter(N,Wc,s);
Dan Ellis 2007-11-08 17
M
Chebyshev I Filter
Equiripple in passband (flat in
stopband)
minimize maximum error
1
H a ( j) =
2

1+ 2TN2 (p )

Chebyshev
polynomial TN () =
(
cos N cos1 ) 1
of order N (
cosh N cosh 1 ) >1
Dan Ellis 2007-11-08 18
Chebyshev I Filter
cos( N cos 1 ) 1
TN () =
cosh ( N cosh )
1
>1

Dan Ellis 2007-11-08 19


Chebyshev I Filter
Design procedure:
desired passband ripple
min. stopband atten., , N :
p s

1 1 1
= =
[
A 1+ TN ( p ) 1+ 2 cosh N cosh 1 s
( )]
2 2 2 s 2
p

N
cosh 1
( A 2 1
) 1/k1, discrimination
1 s
cosh p ( ) 1/k, selectivity

Dan Ellis 2007-11-08 20


Chebyshev I Filter
What is Ha(s)?
complicated, get from a table
.. or from Matlab cheby1(N,r,Wp,s)

all-pole; can inspect them:

..like squashed-in Butterworth


Dan Ellis 2007-11-08 21
Chebyshev II Filter
Flat in passband, equiripple in stopband

1
H a ( j) =
2

constant
T ( s )
2
2 N p
1+
TN (s )
~1/TN(1/)
zeros on imaginary axis
Filter has poles and zeros (some )
Complicated pole/zero pattern

Dan Ellis 2007-11-08 22


Elliptical (Cauer) Filters
Ripples in both passband and stopband

1
H a ( j)
2
=
1+ 2 RN2 (p )
function; satisfies
RN(-1) = RN()-1 very narrow
zeros for <1 poles for >1 transition band

Complicated; not even closed form for


Dan Ellis 2007-11-08 23
Analog Filter Types Summary

N=6
r = 3 dB
A = 40 dB

Dan Ellis 2007-11-08 24


Analog Filter Transformations
All filters types shown as lowpass;
other types (highpass, bandpass..)
derived via transformations
i.e. s
= F 1
(s ) Desired alternate
response; still a
lowpass
prototype H LP (s ) H D (s ) rational polynomial

General mapping of s-plane


^
BUT keep j j;
frequency response just shuffled
Dan Ellis 2007-11-08 25
Lowpass-to-Highpass
Example transformation:
H HP (s) = H LP ( s ) s= p p
s
take prototype HLP(s) polynomial
replace s with p p
s
simplify and rearrange
^
new polynomial HHP(s)

Dan Ellis 2007-11-08 26


Lowpass-to-Highpass
What happens to frequency response?
s = j s =
p
p
p
p
j
=j ( p

p
) imaginary axis
stays on self...

=
...freq.freq.
= p
=
p
< p
<
p
LP passband HP passband
> p
>
p
LP stopband HP stopband
Frequency axes inverted
Dan Ellis 2007-11-08 27
Transformation Example
Design a Butterworth highpass filter
^
with PB edge -0.1dB @ 4 kHz (p)
^
and SB edge -40 dB @ 1 kHz (s)
Lowpass prototype: make = 1
p
p p

s = () = ()4
s
Butterworth -0.1dB @ p=1, -40dB @ s=4
1 log10 ( ) 1
A 1 2
0.1
N
2
@ 0.1dB = 10 10

2 log10 ( ) p 10
p

s
p
1+ ( c )
N =5 c = p /0.6866 = 1.4564
Dan Ellis 2007-11-08 28
Transformation Example
Im{s}
c
j N +2 l1

LPF proto has pl = c e 2N
Re{s}

c N
H LP ( s ) = N
l=1 ( s pl )
Map to HPF: H HP (s) = H LP ( s ) s= p p
s
N zeros
cN cN s N @ ^s = 0
H HP (s) = =
l=1(
N p
s
p
pl ) l=1 ( p p pl s)
N

^
new poles @ ^s = pp/pl
Dan Ellis 2007-11-08 29
Transformation Example
In Matlab: p s Rp Rs
[N,Wc]=buttord(1,4,0.1,40,'s');
[B,A] = butter(N, Wc, 's');
[U,D] = lp2hp(B,A,2*pi*4000);

Dan Ellis 2007-11-08 30


3. Analog Protos IIR Filters
Can we map high-performance CT
filters to DT domain?
Approach: transformation H (s)G(z)
a
i.e. G (z ) = H a (s ) s=F ( z )
where s = F(z) maps s-plane z-plane:
Im{s} s = F(z) Im{z}
Ha(s0) z = F-1(s) G(z0)
Every value of G(z) Re{s} Re{z}
1
is a value of Ha(s)
somewhere on the s-plane z-plane
s-plane & vice-versa
Dan Ellis 2007-11-08 31
CT to DT Transformation
Desired properties for s = F(z):
s-plane j axis z-plane unit circle
preserves frequency response values
s-plane LHHP z-plane unit circle interior
preserves
Im{s}
stability of poles
Im{z}
Im u.c. ej
j
Re{s} Re{z}
1

s-plane LHHP UCI z-plane

Dan Ellis 2007-11-08 32


Bilinear Transformation
Solution: 1

1 z Bilinear
s=
1+ z 1 Transform
1+ s unique,
Hence inverse: z =
1 s 1:1 mapping

|z| = 1 i.e.
Freq. axis? s = j z = 1+ j
1 j on unit circle
(1+ )+ j
Poles? s = + j z = (1 ) j
2 1+ 2 + 2
+ 2
z = < 0
1 2 + +
2 2
|z| < 1
Dan Ellis 2007-11-08 33
Bilinear Transformation
How can entire half-plane fit inside u.c.?

s-plane z-plane
Highly nonuniform warping!

Dan Ellis 2007-11-08 34


Bilinear Transformation
What is CT DT freq. relation ?
j j 2 j sin / 2
z = e s = 1+e j = 2 cos / 2 = j tan 2 im.axis
1e
u.circle
(DT)

i.e. = tan ( 2 )
(CT)
= 2 tan 1

infinite range of CT frequency < <


maps to finite DT freq. range < <
nonlinear; d as
d pack it all in!

Dan Ellis 2007-11-08 35


Frequency Warping
Bilinear transform makes
Ge j
( )
= H a ( j) =2 tan1 for all ,

Same gain &


phase (, A...),
in same order,
but with
warped
frequency axis

Dan Ellis 2007-11-08 36


Design Procedure
Obtain DT filter specs:
general form (LP, HP...), p , s , 1 ,1
1+ 2 A
Warp frequencies to CT:
p s

p = tan 2 s = tan 2
Old- Design analog filter for , , 1 ,1
p s 1+ 2 A
style Ha(s), CT filter polynomial
Convert to DT domain: G (z ) = H a (s ) s=1z1
1+z 1
G(z), rational polynomial in z
Implement digital filter!
Dan Ellis 2007-11-08 37
Bilinear Transform Example
DT domain requirements:
Lowpass, 1 dB ripple in PB, p = 0.4,
SB attenuation 40 dB @ s = 0.5,
attenuation increases with frequency

PB ripples,
SB monotonic
Chebyshev I

Dan Ellis 2007-11-08 38


Bilinear Transform Example
Warp to CT domain:
p
p = tan 2 = tan 0.2 = 0.7265 rad/sec
s
s = tan 2 = tan 0.25 = 1.0 rad/sec
Magnitude specs:
1 dB PB ripple
1 2 = 10 1/ 20 = 0.8913 = 0.5087
1+
40 dB SB atten.
40 / 20
A = 10
1 = 0.01 A = 100

Dan Ellis 2007-11-08 39


Bilinear Transform Example
Chebyshev I design criteria:

N
cosh (
1 A 2 1

= 7.09
) i.e. need N = 8
1 s
cosh p ( )
Design analog filter, map to DT, check:

>> N=8;
freqs(B,A) freqz(b,a)
>> wp=0.7265;
>> [B,A]=cheby1(N,1,wp,'s');
>> [b,a] = bilinear(B,A,.5);
Dan Ellis 2007-11-08 40
M
Other Filter Shapes
Example was IIR LPF from LP prototype
For other shapes (HPF, bandpass,...):

CT Bilinear
Bilinear Analog trans HD transform
warp design (s)
DT CT HLP(s)
specs specs GD
Bilinear (z)
transform GLP(z) DT
trans
Transform LPX in CT or DT domain...

Dan Ellis 2007-11-08 41


DT Spectral Transformations
Same idea as CT LPFHPF mapping,
but in z-domain:
GD (z ) = GL (z ) z=F ( z ) = GL (F (z))
To behave well, z = F (z ) should:
map u.c. u.c. (preserve G(ej) values)
map u.c. interior u.c. interior (stability)

i.e. F (z) = 1 z = 1 F (z) < 1 z < 1


( ) matches the definition of an1
in fact, F z

allpass filter ... replace delays with F ( z )


Dan Ellis 2007-11-08 42
DT Frequency Warping
Simplest mapping z = F (z ) = 1
z
z
has effect of warping frequency axis:
j
j j e
z = e z = e = j
1 ae >0:
expand HF

tan (2 ) = 1 (2 )
1+ tan

<0:
expand LF

Dan Ellis 2007-11-08 43


Another Design Example
Spec:
Bandpass, from 800-1600 Hz (SR = 8kHz)
Ripple = 1dB, min. stopband atten. = 60 dB

8th order, best transition band

Use elliptical for best performance


Full design path:

design analog LPF prototype


analog LPF BPF

CT BPF DT BPF (Bilinear)

Dan Ellis 2007-11-08 44


Another Design Example
Or, do it all in one step in Matlab:
[b,a] = ellip(8,1,60,
[800 1600]/(8000/2));

Dan Ellis 2007-11-08 45

You might also like