Unit 6
Unit 6
Unit 6
Contents
7.1
7.2
7.3
7.4
7.5
7.6
7.7
7.8
Page No.
Concept of Filtering
7-2
Design Techniques FIR Filter
7-3
Design of Optimal Linear Phase FIR Filters
7-4
Properties of Commonly used Windows
7-5
Solved Problems on Windowing method
7-11
Design of IIR Filters using Approximation of Derivatives
7-16
Impulse Invariant Method
7-18
Bi-linear Transform Filter (BLT)
7-29
7.9 Comparison between Impulse Invariance and Bilinear Transformation Method
7-31
7.10
Solved Problems using BLT
7-31
7.11
Basic Filter Approximations
7-38
7.12
Frequency Transformations
7-43
7.13
Comparison between IIR and FIR Filters
7-48
introduction :
The basic function of digital filter is to, eliminate the noise and to extract the signal of interlay
from other signals. A digital filter is a basic device used in digital signal processing.
There are several techniques available to design the digital filters. But generally while desig a
digital filter; first an analog filter is designed and then it is converted into the corresponding dir._ filter.
Before studying digital filters, we will study some fundamental things related to analog filtering.
This is necessary because, generally digital filters are designed using analog filters.
Some parameters related to analog filters :
1. Pass band : It passes certain range of frequencies. In the pass band, attenuation is zero.
2. Stop band : It suppresses certain range of frequencies. In the stop band, attenuation is infantry.
3. Cut-off frequency : This is the frequency which seperates pass band and stop band.
7.1
Concept of Filtering :
Analog filters are designed using analog components like resistors (R), inductors (L) and I
capacitors (C). While digital filters are implemented using difference equation.
The digital filters described by differential equations can be implemented using software like C
or assembly language. We can easily change the algorithm; so we can easily change the filter
characteristics according to our requirement.
Basically there are two types of filters as follows :
1.
2.
1. Many input signals can be filtered by one digital filter without replacing the hardware.
2. Digital filters have characteristic like linear phase response. Such characteristic is not possible s
obtain in case of analog filters.
3. The performance of digital filters, does not vary with environmental parameters. But re
environmental parameters like temperature, humidity etc., change the values of components ::
case of analog filters. So it is required to calibrate analog filters periodically.
4. In case of digital filters; since the filtering is done with the help of digital computer, both filtered
and unfiltered data can be saved for further use.
5. Unlike analog filters; the digital filters are portable.
6. From unit to unit the performance of digital filters is repeatable.
7. The digital filters are highly flexible.
8. Using VLSI technology; the hardware of digital filters can be reduced. Similarly the parry
consumption can be reduced.
9. Digital filters can be used at very low frequencies, for example in Biomedical applications.
10.
In case of analog filters; maintenance is frequently required. But for digital filters it is not
required.
Speed limitation :
In case of digital filters, ADC and DAC are used. So the speed of digital filter depends on the
conversion time of ADC and the settling time of DAC. Similarly the speed of operation of digital
filter depends on the speed of digital processor. Thus the bandwidth of input signal processed is
limited by ADC and DAC. In real time applications, the bandwidth of digital filter is much lower
than analog filters.
2.
3.
7.2
FIR stands for Finite Impulse Response. FIR filters are called as non-recursive filters because
they do not use the feedback. Before studying the design of FIR filters; we will discuss one important
characteristic of FIR filter.
...(1.2.4)
Expandi
ng
Equation
(7.2.1)
we get,
y(n) =
b0x(n) +
b1x(n-l)
+ .... +
bM_1x(n-M+
1)
...(7.2.5
Using
Equation
(7.2.4)
we get,
y(n) =
h(0)x(n)
+
h(l)x(nl ) +.....................
+ h(M-1 )
x ( h - M +l)........
...(7.2.6
H
er
e
h
(0
),
h
(
1)
...
ar
e
co
ns
ta
nt
s
th
at
m
ea
ns
th
ey
ar
e
bo
un
de
d.
N
o
w
fr
o
m
E
qu
ati
on
(7
.2.
6)
;
th
e
ou
tp
ut
wi
ll
be
bo
un
de
d
if
w
e
ap
pl
y
bo
un
de
d
in
pu
t.
T
ha
t
m
ea
ns
fo
r
ev
er
y
bo
un
de
d
in
pu
t;
th
e
ou
tp
ut
of
FI
R
fil
te
r
is
b
o
u
n
de
d.
T
h
us
FI
R
fil
te
rs
ar
e
in
he
re
nt
ly
st
ab
le.
7.
2.
2
FI
R
Fi
lt
e
r
s
a
r
e
Li
n
e
a
r
P
h
a
s
e
Fi
lt
e
r
s
(
M
a
g
ni
t
u
d
e
a
n
d
P
h
a
s
e
R
e
s
p
o
n
s
e)
:
W
e
wi
ll
di
sc
us
s
th
e
sy
m
m
etr
y
an
d
an
tis
y
m
m
etr
y
of
FI
R
fil
ter
s.
T
he
se
co
nd
iti
on
s
ar
e
rel
at
ed
K
th
ei
r
un
it
sa
m
pl
e
re
sp
on
se
h
(n
).
The
unit
sample
respon
se of
FIR
filter is
symme
tric if it
satisfie
s the
conditi
on.
h(n) =
h ( M - l - n ) ........
n = 0,l.................
M-1...................
...(7.2.7
Here M
=
Number
of
samples;
so if M
= 8 we
get,
Forn = 0
=>h(0)
= h( 8- l
-0) = h
(7) For
n=1
=> h (1 )
=h(81 - 1) =
h ( 6)
etc. If h
( n) is
symmetr
ic then,
the filter
is
symmetr
ic. Now
unit
sample
response
of FIR
filter is
antisym
metric if
it satisfies
the
condition
,
h(n) =
-h(M-ln), n =
0,l....M-l
...(7.2.8
If this
condition
is
satisfied
then the
filter is
antisym
metric
Now the
phase of
FIR filter
is given
by,
This equation
shows
that the
phase of
FIR
filter is
piecewis
e linear.
Thus for
the
symmet
ric and
antisym
metric
FIR
filters;
the
conditi
on for
linear
phase
is,
h ( n ) = ;J
)
7.
3
D
e
si
g
n
of
O
pt
i
m
al
Li
n
e
ar
P
h
a
s
e
FI
R
Fi
lt
er
s
:
D
iff
ere
nt
typ
es
of
wi
nd
ow
s
are
us
ed
to
de
sig
n
FI
R
filt
er.
Fir
st
we
wil
l
dis
cu
ss
the
de
sig
n
of
FI
R
filt
er
usi
ng
rec
tan
gul
ar
wi
nd
ow
.
Th
e
rec
tan
gul
ar
wi
nd
ow
is
as
sh
ow
n
in
Fi
g.
7.3
.1(
a).
It is denoted by WR (n). Its magnitude is 1 for the range, n = 0 to M - 1. Now let h d ( n ) be the
impulse response having infinite duration. If hd (n) is multiplied by WR (n) then a finite impulse
response is obtained as shown in Fig. 7.3.1(b). That means we will get only limited pulse of hd (n); not
all (oo) pulse. Since we are truncating the input sequence by using a window, this process is called as
truncation process. Since the shape of window function is rectangular; it is called as rectangular
window.
7.4
We will consider that the range of each window is from - Q to Q. Here Q is positive integer
number. (1)
Hamming window :
Hamming window function is pvea by.
Hanning window function is also called as Raised-cosine window. The function is denoted by,
Keter rigs. /.4.1(a), (b) and (c) to have a look to the spectrum.
Magnitude of first side-lobe level is - 31 dB relative to maximum value.
(3)
Triangular function is like tapering the rectangular window sequence linearly from the middl to
the ends. Triangular window function can be given by
If we compare hanning window with triangular then hanning window function is smoother at the
ends. Smoother ends reduces sidelobe level, while broaden middle section.
4)
In blackman window function, we will find one more additional term in comparision with amming
and hanning window. Because of additional cosine term, sidelobs are reduced further.
Window function for blackman can be given by ,
Where I0 (x) is modified bessel function of the first kind and zero order. The tradeoff berw*
main lobe width and side lobe level can be adjusted by varying parameter a.
Here a is independent variable.
6 can be expressed as
...(7.4.1)
The frequency response of filter is obtained by taking Fourier transform of Equation (7.4.1).
.-. H(co) = F T { h d ( n ) - W R ( n ) }
.-. H((0) = Hd(co)*WR(o)
...(7.4.2)
This shows that the frequency response of FIR filter is equal to the convolution of desired
frequency response, Hd ( GO) and the Fourier transform of window function.
Now the desired frequency response of low pass FIR is shown in Fig. 7.4.1(a); while the frequency
response of FIR filter obtained because of windowing is shown in Fig. 7.4.1(b).
The sidelobes are present in the frequency response of window function. Because of the-: sidelobes;
the ringing is observed in the frequency response of FIR filter. This ringing is predominant present near the
bandedge and it is known as Gibb's phenomenon.
Now the question arises, why the side lobes are present in the frequency response of wind
function ? This is because of the sudden discontinuities in the window function. Observe the magnitude
response of rectangular window. In this case, the discontinuity is very abrupt. Therefore the sidelobes
are of larger amplitude. Thus the ringing effect is maximum in case of rectangular window.
Because of this reason; other window functions are developed which will not have the abrupt
discontinuities. That means the window function will change more gradually in the time domain.
The windowing method requires minimum amount of computational effort; so window method M
simple to implement.
For the given window; the maximum amplitude of ripple in the filter response is fixed. Thus e
stopband attenuation is fixed in the given window.
Disadvantages:
1. The designing of FIR filters using windows is not flexible.
1. The frequency response of FIR filter shows the convolution of spectrum of window function and
desired frequency response. Because of this; the pass band and stop band edge frequencies
caroche* be precisely specified.
2. In many applications the expression for the desired filter response will be too complicated.
2.
Take inverse Fourier transform (IFT) of Hd (co) to obtain hd (n) Decide the length of FIR filter. 4.
3.
7.5
Ex. 7.5.1 :
Design a linear phase FIR low pass filter of length seven with cut-off frequency 1 rad/sec
using rectangular window.
Soln.:
Step I: The desired frequency response Hd (co) for the low pass FIR filter is given by,
Step III:
Here we have to make use of rectangular window of the order 7. We have for rectangular
Equation (8) gives unit impulse response of FIR filter. Making use of Equation (7), we can obtair the
values of hd (n) and h (n) as shown in the Table P. 7.5.1.
Table P. 7.5.1
...en
step III:
Here we
have to
make
use of
rectangu
lar
window
of the
order 7.
We
have for
rectangu
la
window
,
(forn =
0toM-l
n
fF
T
R
fi
lt
er
M
ak
in
gu
se
of
E
qu
ati
on
(7
),
w
ec
an
ob
ta
E
qu
ati
on
(8
)g
iv
es
un
it
im
pu
ls
e"
^T
T
h^
T
i
the
values
of hd(n)
andh(n)
as
shown
m the
TableP.
7.5.2.
Making use of these equations we can obtain the values of h ( n) as shown in Table P. 7.5.3.
Table P. 7.5.3
7.6
Consider an analog differentiator with transfer function Ha (s). The function of analot
differentiator is to take the derivative of analog input signal. Let x (t) be the input signal applied to
analog differentiator. Then its output can be written as,
...(7.6.1
Since the output is the differentiation of input, then from Fig. 7.6.1(a) we can write,
...(7.6.2)
...(7.6.3) ...
(7.6.4)
will obtain the transfer function of analog filter.
Equation (7.6.4) gives the transfer function of analog filter.
...(7.6.9)
Now as Q varies from - to + , the corresponding locus of points in Z plane is a circle of radius ^ and its
centre at Z = T. This mapping is shown in Fig. 7.6.1(b).
L.H.S. of s plane is mapped onto the points inside the circle in Z plane having radius = ~z and
centre at Z = r.
(ii)
R.H.S. of a plane is mapped onto the points outside the circle in Z plane,
(hi)
7.7
In this method, the design starts from the specifications of analog filter. Here we have to replant
analog filter by digital filter. This is achieved if impulse response of digital filter resembles the sampler
version of impulse response of analog filter. If impulse response of both, analog and digital filter
matches then, both filters perform in a similar manner.
Before studying this method we will list out the different notations, we are going to
use. h (t) = Impulse response in time domain Ha ( s ) = Transfer function of
analog filter; here V is Laplace operator
h (n Ts)
...(7.7.1)
Here Ak - Ax, A2 ... AN are the coefficients of partial fraction expansion.
and Pk = Pj, P2 ... PN are the poles.
Here V is the laplace operator. So we can obtain impulse response of analog filter, h (t) from H a( s) by taking
...(7.7.2)
Now unit impulse response for discrete structure is obtained by sampling h ( t ). That means, h (n) can be
...(7.7.3)
Here Ts is the sampling time.
The system transfer function of digital filter is denoted by H ( Z ). It is obtained by taking Z - transform of h
(n ). According to the definition of Z - transform for causal system,
...(7.7.4)
...(7.7.5)
...(7.7.6)
This
is the
requir
ed
transf
er
functi
on of
digita
l
filter.
Thus
comparing
Equations
(7.7.1) and
(7.7.6), we
can say that
the transfer
function of
digital filter
is obtained
from the
transfer
function of
analoa filter
bv doing the
transformati
on.
Equat
ion (7.5.7)
shows, how
the poles
from analog
domain are
transferred
into the dig
domain. This
transformati
on of poles
is called as
mapping of
poles.
7.7.1
R
el
ati
o
ns
hi
p
of
Spl
a
n
e
to
Zpl
a
n
e
(
M
a
p
pi
n
g
b
et
w
e
e
n
Spl
a
n
e
a
n
d
Zpl
a
n
e)
:
We
know that
the poles of
analog filters
are located
at s = Pk.
Now from
Equation
(7.7.7) we
cm say that
the poles of
digital filter,
H (Z) are
located at,
Z
=
ek
s
...
(7.
7.8
*,
This
equat
ion
indic
ates
that
the
poles
of
analo
g
filter
at s =
Pk are
transf
orme
d into
the
pole?
I
k
digital filter
at Z = e
. Thus the
relationship
between
laplace ( V
domain) and
Z domain is
giv-
sTs
H
e
r
e
P
k
a
n
d
T
s
i
s
t
h
e
s
a
m
p
l
i
n
g
t
i
m
e
.
N
o
w
'
s
'
i
s
t
h
e
l
a
p
l
a
c
e
o
p
e
r
a
t
o
r
a
n
d
i
t
i
s
e
x
p
r
e
s
s
e
d
a
s
,
s =
a+
jQ
...
(7.7.
H
H
e
r
e
a
=
A
t
t
e
n
u
a
t
i
o
n
f
a
c
t
o
r
a
n
d
Q
.
=
A
n
a
l
o
g
f
r
e
q
u
e
n
c
y
W
e
k
n
o
w
t
h
e
'
Z
'
c
a
n
b
e
e
x
p
r
e
s
s
e
d
i
n
p
o
l
a
r
f
o
r
m
a
s
,
Here
'r' is
magn
itude
and
'co' is
the
digita
l
frequ
ency.
...(7.7.12)
Separating real and imaginary parts of Equation (7.7.12) we get,
...(7.7.13) ...
(7.7.14)
Now we will find the relationship between s plane and Z plane. Basically plot in 's'-domain
means, a is plotted on X-axis and jQ) is plotted on Y- axis. And Z-domain representation means real Z is
plotted on X- axis and imaginary Z is plotted on Y-axis.
Now consider Equation (7.7.13), it is
(i)
If o < 0, then r is equal to reciprocal of 'e' raise to some constant. Thus range of r will be 0 to 1.
p.. '.;.. ........... ............. ......... .........,.. . ............... ... . , . , . . . , ; .
...(7.7.15)
Now o < 0 means negative values of a. That is L.H.S. of s plane. We know that 'r' is the radius of
circle is Z plane.
So '0 < r < 1' indicates interior part of unit circle. Thus we can conclude that,
L.H.S. of V plane is mapped inside the unit circle.
(in
Tf n = 0 then r = e = 1
Now a = 0 indicates jQ, axis and r = 1 indicates unit circle. Thus, jQ axis in 's' plane is mapped on
the unit circle.
(iii)
If a > 0 then, r is equal to 'e' raise to some constant. That means r > 1.
Now a > 0 indicates R.H.S. of 's' plane and 'r' > 1 indicates exterior part of unit circle. Thus, R.H.S.
of's' plane is mapped outside the unit circle.
Combining all conditions; this mapping is shown in Fig. 7.7.1.
this range also; '' maps from - n to n. Thus mapping from analog frequency 'Q,' to digffl frequency 'co' is
many to one. This mapping is not one to one. (2) Analog filters are not band limited so there will be
aliasing due to the sampling process. Because of this aliasing, the frequency response of resulting digital
filter will not be identical tc t original frequency response of analog filter.
7.7.2
Ex. 7.7.1 :
To convert each term into positive powers of Z ; multiplying numerator and denominator of each
term by Z we get,
Ex. 7.7.2 :
Consider a causal continuous time system with impulse response hc(f) and the systefunction
u/\
s+a
Hc(s) = 7------?zrzcv
' (s + a) + b
Use impulse invariance to determine H (z) for a discrete time system such that h(n) =
hc(nT).
7.8
In case of impulse invariance method, we have studied that the mapping is many to one. So this
method is not suitable to design high-pass filter and band reject filter.
In case of bilinear transformation; the mapping is one to one from s domain to the Z domain. So
there is no aliasing effect. The limitations of impulse invariance method are overcome by using BLT
method.
(ii)
When r = 1 then a = 0
Now r = 1 means unit circle and a = 0 means jQ axis. Thus this condition indicates that the jQ axis
maps on the unit circle.
(iii)
This mapping is similar to the mapping in impulse invariance method.But in impulse invariance
method mapping is valid only for poles ; while in bilinear transformation, mapping is valid for poles as
well as zeros.
5. 7.8.1
The mapping is non-linear and because of this; frequency warping effect takes place.
7.______7.9
9.__________________________________________________________________________ 7
1.
...(1)
(2)
10.
Ex. 7.10.1: An analog filter has the following transfer function H (s) = ^rpf- Using bilinear
11.
transformation technique, determine the transfer function of digital filter H (Z) and
also write the difference equation of digital filter.
12.
13.
14.
3.
15.
4.
16.
Ex. 7.10.3 : Design a single pole low pass digital filter with a 3 dB bandwidth of 0.2 n by use
of bilinear transformation applied to the analog filter.
17.
18.
19.
20.
(I)
21.
22.
23.
5.
25.
24.
...(5)
This is the required transfer function for digital filter. Note that there is a single pole
at P, = 0.509.
26.
Now in the problem frequency of digital filter is given which is co c = 0.2 n and
bandwidth is 3 dB. We will check the frequency response. The frequency response of digital filter is
6.
27. ...(6)
28.
Ex. 7.10.4 :
29.
30.
at cor = 5
Obtain the system transfer function of digital filter using BLT which is resonant
31.
7.
32.
8.
9.
33.
Ex. 7.10.6: The analog transfer function of low pass filter is, H ( s ) = ^T^ and its temdwidt- = 1
rad/sec.
34. Design the digital filter using BLT method whose cut-off frequency is 20 jt and samp -;
time is 0.0167 sec; by considering the warping effect.
35.
36.
10.
Design a digital low pass MR filter to approximate the following transfer function.
38.
-4
39.
40.
Using the bilinear transformation method, obtain the transfer function H(Z) of
digital filter assuming 3 dB cut-off frequency of 150 Hz and sampling frequency of 1.28
KHz.
43.
44.
11.
45._____________________________________________________________ 7
.11
46.
We have studied that the digital IIR filters are designed from the analog filters. Many
times it is necessary to approximate the characteristics of analog filter. This approximation is required
because the practical characteristic of a filter is not identical to the ideal characteristics. There are three
different types of approximation techniques as follows :
1.
2.
3.
47.
48.
A typical characteristic of a butterworth low pass filter is as shown in Fig. 7.11.1. This type of
response is called as butterworth response because its main characteristic is that the passband is
maximally flat. That means there are no variations (ripples) in the passband. Now the magnitude squared
response of low pass butterworth filter is given bv.
12.
49. ...(7.11.1
50.
13.
52. Oc =
53. Q. -
54. 1 + e =
55.
1+8 =
56. 6 =
57. 8 =
58. N =
59.
We know that, in case of low pass filter the frequencies will pass upto the value of cutoff frequency (Qc). This is called as pass band. After that the frequencies are attenuated. This is called as
stop band. Ideal characteristic is shown by dotted line in Fig. 7.11.2. Ideally, at the value of cut-off
frequency (lc) the frequencies should be stopped. But in practical cases this is not happening.
60.
Now the order of filter is denoted by 'N'. Roughly we can say order of filter means,
the number of stages used in the design of analog filter. As the order of filter 'N' increases, the response
of filter is more close to the ideal response as shown in Fig. 7.11.2.
61.
17.
62.
The magnitude response is nearly constant (equal to 1) at lower frequencies. That means pa band
is maximally flat.
2. There are no ripples in the pass band and stop band.
3. The maximum gain occurs at Q. = 0 and it is | H (0) | = 1.
4. The magnitude response is monotonically decreasing.
64.
1.
2.
66.
1.
67.
These filters are all pole filters. In the passband, these filters show equiripple
behaviour and the> have monotonic characteristics in the stopband.
68.
The filter characteristics for odd and even values of N are shown in Fig.
18.
...(7.11.3
70.
71.
72.
With
CN + 1(x)
...(7.11.4)
C0 (x) = 1 and Q
Table 7.11.1
76.
77.
The major difference between butterworth and chebyshev filter is that the poles of
butterworth filter lie on the circle, while the poles of chebyshev filter lie on ellipse.
78.
2.
79.
This filter contains zeros as well as poles. The characteristic of such filters for even
and odd values of N is shown in Fig. 7.11.4. The magnitude squared response is given by,
80.
81.
Qs = Stopband
frequency; Qp = Passband
frequency
83.
20.
87.
21.
90.
91.
94.
95.
96.
1.
stopband ripple
and S,
101ogi0(l +e )
where 8j
stopband ripple
A/1 + S2
of elliptic filters :
Elliptic filter is more efficient because it provides the smallest order filter for given set of
specifications.
97.
98.
99._________________________________________________________________________
Uptill now we have studied the design of low pass filter only. Now if it is asked to
design other filter like high pass, band pass or band reject filter then we have to use the frequency
transformation.
101.
If the cut-off frequency of LPF is equal to 1 that means if Qc = 1 then, it is called as
normalized
102.
filter. To design the other types of filters; first the system function of normalized LPF is
obtained. Then using frequency transformation we can get the system function of the required filter. The
following formulae are used for the frequency transformation.
103.
104.
1.
105.
106.
2.
107.
108.
Suppose we have to design HPF with cutoff frequency 2HP then use,
109.. i............'. '...................i
I
110.
111.
3.
112.
Suppose we have to design bandpass filter with higher cutoff frequency Qu and lower
cut-off frequency 2[ then use the transformation.
24.
113.
114.
4.
115.
Suppose we have to design notch filter with higher cut-off frequency 2U and lower
cutoff frequency 2, then use the transformation,
116.
117.
118.
Note :
These formulae are applicable for analog frequency transformation. Similarly, we
can
transform <
inc..
119. transformation.
120.
Ex. 7.12.1 : Design the digital high pass filter for cut-off frequency of 30 Hz and
sampling frequency y 150 Hz using BLT.
121.
122.
123.
124.
For the bilinear transformation we have,
25.
126.
127.
26.
128.
...(1)
129.
Part C : Use frequency transformation :
130.
We have.
Now using frequency transformation to obtain transfer function of analog high pass filter.
27.
131.
...(2)
132.
133.
134.
135.
139.
140.
Ex. 7.12.2 : Design the second order low pass digital filter of Butterworth type
using BLT for the specifications given below:
136.
137.
138.
Soln.: Given,
141.
28.
142.
2
144.
145.____________________________________________________ 7.13
147.
Q. 1
148.
Q. 2
149.
Q. 3
150.
Q. 4
151.
Q. 5
152.
Q. 6
153.
Q. 7
154.
Q. 8
What are the different types of windows used for FIR filters.
Comparison