Topic 8: Filter Design: IIR: ELEN E4810: Digital Signal Processing
Topic 8: Filter Design: IIR: ELEN E4810: Digital Signal Processing
Topic 8:
Filter Design: IIR
1. Filter Design Specifications
2. Analog Filter Design
3. Digital Filters from Analog Prototypes
Solution
performance G(z)
Analysis constraints Design Implement
transfer
function
magnitude response FIR/IIR platform
phase response subtype structure
cost/complexity order ...
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
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
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
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
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
N=6
r = 3 dB
A = 40 dB
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);
|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!
i.e. = tan ( 2 )
(CT)
= 2 tan 1
PB ripples,
SB monotonic
Chebyshev I
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...
tan (2 ) = 1 (2 )
1+ tan
<0:
expand LF