Copyright ? 2001,S,K,Mitra
1
Simple Digital Filters
? Later in the course we shall review various
methods of designing frequency-selective
filters satisfying prescribed specifications
? We now describe several low-order FIR
and IIR digital filters with reasonable
selective frequency responses that often are
satisfactory in a number of applications
Copyright ? 2001,S,K,Mitra
2
Simple FIR Digital Filters
? FIR digital filters considered here have
integer-valued impulse response coefficients
? These filters are employed in a number of
practical applications,primarily because of
their simplicity,which makes them amenable
to inexpensive hardware implementations
Copyright ? 2001,S,K,Mitra
3
Simple FIR Digital Filters
Lowpass FIR Digital Filters
? The simplest lowpass FIR digital filter is the
2-point moving-average filter given by
? The above transfer function has a zero at
and a pole at z = 0
? Note that here the pole vector has a unity
magnitude for all values of w
z
zzzH
2
11 1
2
10 ???? ? )()(
1??z
Copyright ? 2001,S,K,Mitra
4
Simple FIR Digital Filters
? On the other hand,as w increases from 0 to
p,the magnitude of the zero vector
decreases from a value of 2,the diameter of
the unit circle,to 0
? Hence,the magnitude response is
a monotonically decreasing function of w
from w = 0 to w = p
|)(| 0 wjeH
Copyright ? 2001,S,K,Mitra
5
Simple FIR Digital Filters
? The maximum value of the magnitude
function is 1 at w = 0,and the minimum
value is 0 at w = p,i.e.,
? The frequency response of the above filter
is given by
01 000 ?? |)(|,|)(| pjj eHeH
)2/c o s ()( 2/0 w? w?w jj eeH
Copyright ? 2001,S,K,Mitra
6
Simple FIR Digital Filters
? The magnitude response
can be seen to be a monotonically
decreasing function of w
)2/c o s (|)(| 0 w?wjeH
0 0.2 0.4 0.6 0.8 1
0
0.2
0.4
0.6
0.8
1
w / p
M
a
gni
t
ude
F i r s t - or de r F I R l ow pa s s f i l t e r
Copyright ? 2001,S,K,Mitra
7
Simple FIR Digital Filters
? The frequency at which
is of practical interest since here the gain
in dB is given by
since the dc gain
cw?w
)(21)( 000 jj eHeH c ?w
)( cwG
dB32l o g20)(l o g20 10010 ???? jeH
)( cwG )(l o g20 10 cjeH w?
0200 010 ?? )(lo g)( jeHG
Copyright ? 2001,S,K,Mitra
8
Simple FIR Digital Filters
? Thus,the gain G(w) at is approximately
3 dB less than the gain at w = 0
? As a result,is called the 3-dB cutoff
frequency
? To determine the value of we set
which yields
cw?w
cw
cw
2/p?w c
21
220 )2/(c o s|)(| ?w?w cj ceH
Copyright ? 2001,S,K,Mitra
9
Simple FIR Digital Filters
? The 3-dB cutoff frequency can be
considered as the passband edge frequency
? As a result,for the filter the passband
width is approximately p/2
? The stopband is from p/2 to p
? Note,has a zero at or w = p,
which is in the stopband of the filter
cw
)(zH 0
)(zH 0 1??z
Copyright ? 2001,S,K,Mitra
10
Simple FIR Digital Filters
? A cascade of the simple FIR filters
results in an improved lowpass frequency
response as illustrated below for a cascade
of 3 sections
)()( 1210 1 ??? zzH
0 0.2 0.4 0.6 0.8 1
0
0.2
0.4
0.6
0.8
1
w / p
M
a
gni
t
ude
F i r s t - or de r F I R l ow pa s s f i l t e r c a s c a de
Copyright ? 2001,S,K,Mitra
11
Simple FIR Digital Filters
? The 3-dB cutoff frequency of a cascade of M
sections is given by
? For M = 3,the above yields
? Thus,the cascade of first-order sections
yields a sharper magnitude response but at
the expense of a decrease in the width of the
passband
)2(c o s2 2/11 Mc ???w
p?w 302.0c
Copyright ? 2001,S,K,Mitra
12
Simple FIR Digital Filters
? A better approximation to the ideal lowpass
filter is given by a higher-order moving-
average filter
? Signals with rapid fluctuations in sample
values are generally associated with high-
frequency components
? These high-frequency components are
essentially removed by an moving-average
filter resulting in a smoother output
waveform
Copyright ? 2001,S,K,Mitra
13
Simple FIR Digital Filters
Highpass FIR Digital Filters
? The simplest highpass FIR filter is obtained
from the simplest lowpass FIR filter by
replacing z with
? This results in
)()( 1211 1 ??? zzH
z?
Copyright ? 2001,S,K,Mitra
14
Simple FIR Digital Filters
? Corresponding frequency response is given
by
whose magnitude response is plotted below
)2/s i n ()( 2/1 w? w?w jj ejeH
0 0.2 0.4 0.6 0.8 1
0
0.2
0.4
0.6
0.8
1
w / p
M
a
gni
t
ude
F i r s t - or de r F I R hi ghpa s s f i l t e r
Copyright ? 2001,S,K,Mitra
15
Simple FIR Digital Filters
? The monotonically increasing behavior of
the magnitude function can again be
demonstrated by examining the pole-zero
pattern of the transfer function
? The highpass transfer function has a
zero at z = 1 or w = 0 which is in the
stopband of the filter
)(zH1
)(zH1
Copyright ? 2001,S,K,Mitra
16
Simple FIR Digital Filters
? Improved highpass magnitude response can
again be obtained by cascading several
sections of the first-order highpass filter
? Alternately,a higher-order highpass filter of
the form
is obtained by replacing z with in the
transfer function of a moving average filter
z?
nMn n
M zzH
???? ?? 1011 1 )()(
Copyright ? 2001,S,K,Mitra
17
Simple FIR Digital Filters
? An application of the FIR highpass filters is
in moving-target-indicator (MTI) radars
? In these radars,interfering signals,called
clutters,are generated from fixed objects in
the path of the radar beam
? The clutter,generated mainly from ground
echoes and weather returns,has frequency
components near zero frequency (dc)
Copyright ? 2001,S,K,Mitra
18
Simple FIR Digital Filters
? The clutter can be removed by filtering the
radar return signal through a two-pulse
canceler,which is the first-order FIR
highpass filter
? For a more effective removal it may be
necessary to use a three-pulse canceler
obtained by cascading two two-pulse
cancelers
)()( 1211 1 ??? zzH
Copyright ? 2001,S,K,Mitra
19
Simple IIR Digital Filters
Lowpass IIR Digital Filters
? A first-order causal lowpass IIR digital filter
has a transfer function given by
where |a| < 1 for stability
? The above transfer function has a zero at
i.e.,at w = p which is in the stopband
???
?
???
?
a?
?a??
?
?
1
1
1
1
2
1)(
z
zzH
LP
1??z
Copyright ? 2001,S,K,Mitra
20
Simple IIR Digital Filters
? has a real pole at z = a
? As w increases from 0 to p,the magnitude of
the zero vector decreases from a value of 2 to
0,whereas,for a positive value of a,the
magnitude of the pole vector increases from a
value of to
? The maximum value of the magnitude
function is 1 at w = 0,and the minimum value
is 0 at w = p
a?1 a?1
)( zH LP
Copyright ? 2001,S,K,Mitra
21
Simple IIR Digital Filters
? i.e.,and
? Therefore,is a monotonically
decreasing function of w from w = 0 to w = p
as indicated below
0| ( ) | 1 | ( ) | 0jjL P L PH e H e p??
|)(| wjLP eH
0 0.2 0.4 0.6 0.8 1
0
0.2
0.4
0.6
0.8
1
w / p
M
a
gni
t
ude
a = 0.8
a = 0.7
a = 0.5
10
-2
10
-1
10
0
- 20
- 15
- 10
-5
0
w / p
G
a
i
n,dB
a = 0.8
a = 0.7
a = 0.5
Copyright ? 2001,S,K,Mitra
22
Simple IIR Digital Filters
? The squared magnitude function is given by
? The derivative of with respect
to w is given by
)c o s21(2
)c o s1()1(|)(|
2
2
2
wa?a?
w?a??wj
LP eH
2|)(| wjLP eH
2 2 2
22
| ( )| ( 1 ) ( 1 ) sin
2( 1 2 c o s )
j
LPd H e
d
w a a w
w a w a
? ? ??
??
Copyright ? 2001,S,K,Mitra
23
Simple IIR Digital Filters
in the range
verifying again the monotonically decreasing
behavior of the magnitude function
? To determine the 3-dB cutoff frequency
we set
in the expression for the square magnitude
function resulting in
0/|)(| 2 ?ww deHd jLP p?w?0
2
1|)(| 2 ?w cj
LP eH
Copyright ? 2001,S,K,Mitra
24
Simple IIR Digital Filters
or
which yields
? The above quadratic equation can be solved
for a yielding two solutions
2
1
)c o s21(2
)c o s1()1(
2
2
?
wa?a?
w?a?
c
c
cc wa?a??w?a? c o s21)c o s1()1( 22
21
2c o s
a?
a?w
c
Copyright ? 2001,S,K,Mitra
25
Simple IIR Digital Filters
? The solution resulting in a stable transfer
function is given by
? It follows from
that is a BR function for |a| < 1
)c o s21(2
)c o s1()1(|)(|
2
2
2
wa?a?
w?a??wj
LP eH
)( zH LP
)( zH LP
c
c
w
w??a
c os
si n1
Copyright ? 2001,S,K,Mitra
26
Simple IIR Digital Filters
Highpass IIR Digital Filters
? A first-order causal highpass IIR digital filter
has a transfer function given by
where |a| < 1 for stability
? The above transfer function has a zero at z = 1
i.e.,at w = 0 which is in the stopband
???
?
???
?
?
???
?
?
1
1
1
1
2
1
z
zzH
HP a
a)(
Copyright ? 2001,S,K,Mitra
27
Simple IIR Digital Filters
? Its 3-dB cutoff frequency is given by
which is the same as that of
? Magnitude and gain responses of
are shown below
cc ww??a c o s/)s in1(
cw
)( zH LP
)( zH HP
10
-2
10
-1
10
0
- 20
- 15
- 10
-5
0
w / p
G
a
i
n,dB
a = 0.8
a = 0.7
a = 0.5
0 0, 2 0, 4 0, 6 0, 8 1
0
0, 2
0, 4
0, 6
0, 8
1
w / p
M
a
g
n
i
t
u
d
e
a = 0, 8
a = 0, 7
a = 0, 5
Copyright ? 2001,S,K,Mitra
28
Simple IIR Digital Filters
? is a BR function for |a| < 1
? Example - Design a first-order highpass
digital filter with a 3-dB cutoff frequency of
0.8p
? Now,and
? Therefore
)( zH HP
5 8 7 7 8 5.0)8.0s in ()s in ( ?p?w c
8 0 9 0 2.0)8.0c o s ( ??p
5 0 9 5 2 4 5.0c o s/)s in1( ??ww??a cc
Copyright ? 2001,S,K,Mitra
29
Simple IIR Digital Filters
? Therefore,
???
?
???
?
?
??
?
?
1
1
509524501
12452380
z
z
.
.
???
?
???
?
?
???
?
?
1
1
1
1
2
1
z
zzH
HP a
a)(
Copyright ? 2001,S,K,Mitra
30
Simple IIR Digital Filters
Bandpass IIR Digital Filters
? A 2nd-order bandpass digital transfer
function is given by
? Its squared magnitude function is
???
?
???
?
a?a???
?a??
??
?
21
2
)1(1
1
2
1)(
zz
zzH
BP
2)( wj
BP eH
]2c o s2c o s)1(2)1(1[2
)2c o s1()1(
2222
2
wa?wa???a?a???
w?a??
Copyright ? 2001,S,K,Mitra
31
Simple IIR Digital Filters
? goes to zero at w = 0 and w = p
? It assumes a maximum value of 1 at,
called the center frequency of the bandpass
filter,where
? The frequencies and where
becomes 1/2 are called the 3-dB cutoff
frequencies
2|)(| wjBP eH
2|)(| wjBP eH
ow?w
)(c o s 1 ??w ?o
1cw 2cw
Copyright ? 2001,S,K,Mitra
32
Simple IIR Digital Filters
? The difference between the two cutoff
frequencies,assuming is called
the 3-dB bandwidth and is given by
? The transfer function is a BR
function if |a| < 1 and |?| < 1
12 cc w?w
)( zH BP
112 c o s ??w?w? ccwB ?
?
??
?
?
a?
a
21
2
Copyright ? 2001,S,K,Mitra
33
Simple IIR Digital Filters
? Plots of are shown below |)(| wjBP eH
0 0.2 0.4 0.6 0.8 1
0
0.2
0.4
0.6
0.8
1
w / p
M
a
gni
t
ude
? = 0.34
a = 0.8
a = 0.5
a = 0.2
0 0.2 0.4 0.6 0.8 1
0
0.2
0.4
0.6
0.8
1
w / p
M
a
gni
t
ude
a = 0.6
? = 0.8
? = 0.5
? = 0.2
Copyright ? 2001,S,K,Mitra
34
Simple IIR Digital Filters
? Example - Design a 2nd order bandpass
digital filter with center frequency at 0.4p
and a 3-dB bandwidth of 0.1p
? Here
and
? The solution of the above equation yields,
a = 1.376382 and a = 0.72654253
9 5 1 0 5 6 5.0)1.0c o s ()c o s (
1
2
2 ?p??a?
a
wB
3 0 9 0 1 7.0)4.0c o s ()c o s ( ?p?w?? o
Copyright ? 2001,S,K,Mitra
35
Simple IIR Digital Filters
? The corresponding transfer functions are
and
? The poles of are at z = 0.3671712
and have a magnitude > 1
?
1 1 4 2 5 6 3 61,j
21
2
3 7 6 3 817 3 4 3 4 2 401
11 8 8 1 90
??
?
??
???
zz
zzH
BP,..)('
21
2
7 2 6 5 4 2 5 305 3 3 5 3 101
11 3 6 7 30
??
?
??
??
zz
zzH
BP,..)("
)(' zH BP
Copyright ? 2001,S,K,Mitra
36
Simple IIR Digital Filters
? Thus,the poles of are outside the
unit circle making the transfer function
unstable
? On the other hand,the poles of are
at z = and have a
magnitude of 0.8523746
? Hence is BIBO stable
? Later we outline a simpler stability test
)(' zH BP
)(" zH BP
8 0 9 5 5 4 602 6 6 7 6 5 50,,j?
)(" zH BP
Copyright ? 2001,S,K,Mitra
37
Simple IIR Digital Filters
? Figures below show the plots of the
magnitude function and the group delay of
)(" zH BP
0 0.2 0.4 0.6 0.8 1
0
0.2
0.4
0.6
0.8
1
w / p
M
a
gni
t
ude
0 0.2 0.4 0.6 0.8 1
-1
0
1
2
3
4
5
6
7
w / p
G
r
oup
de
l
a
y,s
a
m
pl
e
s
Copyright ? 2001,S,K,Mitra
38
Simple IIR Digital Filters
Bandstop IIR Digital Filters
? A 2nd-order bandstop digital filter has a
transfer function given by
? The transfer function is a BR
function if |a| < 1 and |?| < 1
???
?
???
?
a?a???
???a??
??
??
21
21
)1(1
21
2
1)(
zz
zzzH
BS
)( zH BS
Copyright ? 2001,S,K,Mitra
39
Simple IIR Digital Filters
? Its magnitude response is plotted below
0 0.2 0.4 0.6 0.8 1
0
0.2
0.4
0.6
0.8
1
w / p
M
a
gni
t
ude
a = 0.8
a = 0.5
a = 0.2
0 0.2 0.4 0.6 0.8 1
0
0.2
0.4
0.6
0.8
1
w / p
M
a
gni
t
ude
? = 0.8
? = 0.5
? = 0.2
Copyright ? 2001,S,K,Mitra
40
Simple IIR Digital Filters
? Here,the magnitude function takes the
maximum value of 1 at w = 0 and w = p
? It goes to 0 at,where,called the
notch frequency,is given by
? The digital transfer function is more
commonly called a notch filter
ow?w ow
)(c o s 1 ??w ?o
)( zH BS
Copyright ? 2001,S,K,Mitra
41
Simple IIR Digital Filters
? The frequencies and where
becomes 1/2 are called the 3-dB cutoff
frequencies
? The difference between the two cutoff
frequencies,assuming is called
the 3-dB notch bandwidth and is given by
2|)(| wjBS eH1cw 2cw
12 cc w?w
112 c o s ??w?w? ccwB ?
?
??
?
?
a?
a
21
2
Copyright ? 2001,S,K,Mitra
42
Simple IIR Digital Filters
Higher-Order IIR Digital Filters
? By cascading the simple digital filters
discussed so far,we can implement digital
filters with sharper magnitude responses
? Consider a cascade of K first-order lowpass
sections characterized by the transfer
function
???
?
???
?
a?
?a??
?
?
1
1
1
1
2
1)(
z
zzH
LP
Copyright ? 2001,S,K,Mitra
43
Simple IIR Digital Filters
? The overall structure has a transfer function
given by
? The corresponding squared-magnitude
function is given by
K
LP
z
zzG
??
?
?
??
?
?
a?
??a??
?
?
1
1
1
1
2
1)(
K
j
LP eG ?
?
?
?
?
?
wa?a?
w?a??w
)c o s21(2
)c o s1()1(|)(|
2
2
2
Copyright ? 2001,S,K,Mitra
44
Simple IIR Digital Filters
? To determine the relation between its 3-dB
cutoff frequency and the parameter a,
we set
which when solved for a,yields for a stable
,
cw
2
1
)c o s21(2
)c o s1()1(
2
2
??
?
?
?
?
?
wa?a?
w?a?
K
c
c
)( zG LP
c
cc
C
CCC
w??
?w?w???a
c o s1
2sinc o s)1(1 2
Copyright ? 2001,S,K,Mitra
45
Simple IIR Digital Filters
where
? It should be noted that the expression for a
given earlier reduces to
for K = 1
KKC /)( 12 ??
c
c
w
w??a
c os
si n1
Copyright ? 2001,S,K,Mitra
46
Simple IIR Digital Filters
? Example - Design a lowpass filter with a 3-
dB cutoff frequency at using a
single first-order section and a cascade of 4
first-order sections,and compare their gain
responses
? For the single first-order lowpass filter we
have
p?w 4.0c
1 5 8 4.0)4.0c o s( )4.0si n (1c o ssi n1 ?p p??w w??a
c
c
Copyright ? 2001,S,K,Mitra
47
Simple IIR Digital Filters
? For the cascade of 4 first-order sections,we
substitute K = 4 and get
? Next we compute
6 8 1 8122 4141,/)(/)( ??? ?? KKC
c
cc
C
CCC
w??
?w?w???a
c o s1
2sinc o s)1(1 2
)4.0c o s(6818.11
)6818.1()6818.1(2)4.0sin ()4.0c o s()6818.11(1 2
p??
?p?p???
2510,??
Copyright ? 2001,S,K,Mitra
48
Simple IIR Digital Filters
? The gain responses of the two filters are
shown below
? As can be seen,cascading has resulted in a
sharper roll-off in the gain response
10
-2
10
-1
10
0
- 20
- 15
- 10
-5
0
w / p
G
a
i
n,dB
K =4
K =1
Passband details
10
-2
10
-1
10
0
-4
-2
0
w / p
G
a
i
n,dB
K =1
K =4