Digital Signal Processing Filter Design by Using PSO
Digital Signal Processing Filter Design by Using PSO
In the filter design, you are encouraged to partly make use of SCILAB/ MATLAB or any
equivalent open source software as available. You are encouraged to contact the Computer
Centre/ the PC Laboratory in the Department of Electrical Engineering for more information on
open source software available in the Institute. It is not mandatory to use any package, of course!
You could write a small C program / high level language program as well.
For designing the IIR and FIR filters, you are NOT permitted to use “filter design” commands
directly. Neither is you permitted to carry out the whole design simply by using a filter design
package. You may use basic SCILAB/ MATLAB statements relating to matrix operations,
window function generation, and so on. You may write small programs in MATLAB. Your final
design submission must be as follows, in an electronic file to be uploaded appropriately as per
instructions from Teaching Associates, in the ‘Filter Design Assignment Forum’ on the Course
Moodle Page:
3. The corresponding analog filter specifications for the same type of analog filter using the
bilinear transformation.
As it is tedious to write/type out coefficients and data by hand each time, you are welcome to
include a printout or electronic write-out of results/ data from a computer program/ SCILAB/
MATLAB program wherever appropriate. Further, you must demonstrate the frequency
response of the filter that you have designed in MATLAB/ any other means. The
demonstration must be made to a Teaching Associate for this course. The evaluation scheme will
be displayed on the course web-page in due course. The report is due to be submitted at least
one week prior to the semester-end examination in this course.
The Filter Specifications:
We wish to build a series of discrete time filters, as described below, to extract specific
bands of this analog signal, or to suppress specific parts of the analog signal.
(i) For all filters, the passband AND stopband tolerances are 0.15 in magnitude.
That is, the filter magnitude response (note: NOT magnitude squared) must
lie between 1.15 and 0.85 in the passband; and between 0 and 0.15 in the
stopband.
(ii) For bandpass filters, the transition band is 2 kHz on either side of the
passband. For bandstop filters, the transition band is 2 kHz on either side of
the stopband.
(iii) When realized as an IIR Filter, all these filters have a monotonic stopband.
(For FIR Filters, of course, we do not have a choice of the nature of stopband /
passband).
q(m) = greatest integer strictly less than 0.1m. For example, q(5) = 0,
q(30) = 2 r(m) = m – 10q(m). For example, r(5) = 5, r(30) = 10
BL(m) = 4 + 0.9 q(m) + 2 r(m). For example, BL(30) = 4 + 0.9 (2) + 2 (10)
= 25.8 BH(m) = B L(m) + 10.
For the FIR Filter, use the Kaiser window as stated above.
Matlab Calculations:
m = 120 - 75 = 45, =) q(m) = 4 & r(m) = 5
PSO Technique:
I. Un-normalized discrete time lter speci cations:
Sampling frequency = 100
KHz Equiripple passband
Passband: 16.8 kHz to 26.8 kHz
Stopband: 0 kHz to 14.8 kHz & 28.8 kHz to 50 kHz
Transition band: 14.8 kHz to 16.8 kHz & 26.8 kHz to 28.8 kHz
Passband magnitude response: 0.85 to 1.15
Stopband magnitude response: 0 to 0.15
II. Normalized digital lter speci cations:
Equiripple passband
Passband: 0.336 to 0.536
Stopband: 0 to 0.296 & 0.576 to
Transition band: 0.296 to 0.336 & 0.536 to 0.576
Passband magnitude response: 0.85 to 1.15
Stopband magnitude response: 0 to 0.15
III. Corresponding analog lter speci cations:
Using the bilinear transformation to map the normalized frequencies from the discrete
domain to the analog domain,
!
= tan( 2 ) (1)
Equiripple passband
Passband: 0.5829 to 1.12
Stopband: 0 to 0.5016 & 1.2726 to 1
Transition band: 0.5016 to 0.5829 & 1.12 to 1.2726
Passband magnitude response: 0.85 to 1.15
Stopband magnitude response: 0 to 0.15
IV. The frequency transformation to be employed
To convert these bandpass analog lter speci cations to low pass analog lter speci cations, we need to employ
the frequency transform,
2 2
= 0
LB
Where the bandpass is inter frequency and L is the frequency of the equivalent low pass
inter.0 and B are the parameters with the following value,
p
0 = p1 p2
B = p2 p1
Where the p1 and p2 are the frequencies of the passband. In increasing order so that B is
positive. In our case p1=0:5829 p2=1:12, which gives 0=0:808 and B=0.5371.
V. The frequency transformed low pass analog lter speci cations:
Under the above frequency transformation, the edge frequencies of passband and stopband
get mapped as follows:
L
+
0
) )
0:5016 (= s1 1:4894 (= Ls1
) )
0:5829 (= p1 1 (= Lp
) )
1:12 (= p2 1 (= Lp
) )
1:2726 (= s2 1:4142 (= Ls2
+1 +1
Therefore, the speci cations of the low pass lter are as follows:
Equiripple passband
Passband: 0 to 1
Stopband: 1.4142 (= min (Ls1; Ls2))
Passband magnitude response: 0.85 to 1.15
Stopband magnitude response: 0 to 0.15