Professional Documents
Culture Documents
*
Department of Circuit Theory, CTU Prague, Technicka 2,
166 27 Prague, Czech Republic
e-mail: premysl.ziska@seznam.cz, laipert@feld.cvut.cz
Abstract: A simple method of the IIR filter design using the standard genetic algorithm is
described in the paper. This genetic algorithm was programmed in the Matlab
environment. Using this method, it can be proposed even filter with lower order of the
transfer function, which satisfies requirements for magnitude frequency response, than is
order of the transfer function which was proposed using the standard approximation
methods. Genetic algorithm is able to find a solution of the task successfully. For
realization in a digital signal processor with fixed point number representation, a filter
coefficients quantization process must be included to the design procedure. This novel
technique is presented on application examples of digital IIR filters design, which were
simulated in DSP TMS320C54x software simulator. The magnitude frequency response
of the proposed IIR filter is shown in the enclosed graphical output of the simulation in
the Matlab environment and the simulation in DSP TMS320C54x software simulator.
Copyright © 2004 IFAC
Keywords: standard genetic algorithms, digital IIR filter, digital signal processors,
magnitude frequency response
Fig. 1. Block diagram of the genetic algorithm This process is repeated until an acceptable solution
has been found or a preselect number of generations
1. Generation of the initial population. This has been performed.
population is generated as NP x D matrix, where
NP is number of members of the population and
D is number of unknown variables in the solved 3. APPLICATION TASK
task. Each element of the matrix is generated as
a random number with uniform probability The ability of this method to the digital IIR filter
distribution in the form: design will be presented on the solution of the two
following examples. It is required to propose the
(1) digital IIR filter with requirements on magnitude
xi , j min r (max min)
frequency response specification defined in tolerance
band and to implement the proposed filters on digital
where i = 1...NP, j =1...D and range of the signal processor. A cascade structure is an optimum
variables is (min..max). technique to implement practical applications on the
2. The selection mechanism. This algorithm uses a digital signal processor, because coefficients of the
tournament selection. Two members of the filter must be quantized, see (Davídek, et al., 2000).
population are chosen randomly and their values This structure has low sensitivity of the IIR filter
of the objective function are compared. A magnitude frequency response relatively to the
member which has lower value of the objective quantization of coefficients. Moreover, it is usually
function is chosen. The selected member is requested to implement the cascade structure
inserted into the new population. The selection applying minimal memory and computing time
mechanism runs till the necessary number of requirements. Therefore, a certain structure is usually
members for creating the new population is not used which is defined as a product of the second
found. order transfer functions so called “biquadratic”
3. Crossovering. For this algorithm an arithmetical sections in the form:
crossover operator was used, which can be
defined in the form: N N
b0i b1i z 1 b2i z 2
x r x 1 r y (2)
H ( z)
i
H i ( z) 1 a
i 1 1i z 1 a 2i z 2
(5)
a
38
a p H dB ˆ k 0
Fig. 3. The magnitude frequency response 2
H1 p H dB ˆ k if
specification (11)
0 otherwise
k 0
76
H H dB ˆ k a s 0
The magnitude frequency response specification can 2
H2 dB ˆ k a s if
(12)
be satisfied using digital IIR filter with 6th order 0 otherwise
k 51
transfer function proposed by applying the Cauer
a
128
a p H dB ˆ k 0
2
approximation. However, for presentation of method H3 p H dB ˆ k if
(13)
ability, here will be proposed digital IIR filter with k 90
0 otherwise
4th order transfer function. Its transfer function is
defined in the form:
where ap is loss in passband and as is loss in stopband
and the magnitude frequency response is calculated
1 z
2
K 1
r1i e j1i 1 z 1 r1i e j1i by the term:
i 1 (6)
H ( z)
H dB ˆ 20 log10 H z z e j ˆ (14)
1 z
2
1
r2i e j2i 1 z 1 r2i e j 2i
i 1
where the variable ̂ means normalized frequency:
At this point, the quantization of the filter
coefficients must be taken into account during the ̂ T (15)
design process.
where T is the sampling interval.
The vector xopt, for which the objective function F(x) software simulator by the procedure described above,
= 0, is the wanted solution of the digital IIR filter in this figure.
design problem.
3.3 Results
The transfer function of the proposed filter is in the Fig. 4. Resultant magnitude frequency response of
form: the proposed filter
4
From the figure is seen, that real magnitude
b z i
i
frequency response fully corresponds with ideal
H ( z) i 0 (16) magnitude frequency response.
4
1 a z
i 1
i
i
1 z 1 z
2
There can be seen an ideal magnitude frequency 1 j 2 i 1 j 2 i
r2i e r2i e
response, which was achieved as a result of the IIR
i 1
filter simulation in the Matlab environment and a real
magnitude frequency response, which was achieved
from simulation in the C54x’ signal processor
However, here the quantization of the filter 3.6 Results
coefficients must be taken into account during the
design process. The optimization task stated above was solved using
the initial settings: NP=500, Pc=0.8, Pm=0.1, range of
Then, the transfer function of the cascade structure of the variables was: x1, x2, x3, x4, x9 (0..1), x5, x6, x7,
the proposed IIR filter with the quantized coefficients x8 (0..ʌ). The algorithm found the following values
is defined in the form: after 2303 generations:
2
b0i b1i z 1 b2i z 2 x1 = r11 = 0.86677813070 x5 = 11 = 1.74421558660
H ( z) 1 a z 1
a 2i z 2
(19) x2 = r12 = 0.94835726973
x3 = r21 = 0.99631710757
x6 = 12 = 3.13608290789
i 1 1i x7 = 21 = 2.29294972241
x4 = r22 = 0.99730014573 x8 = 22 = 2.40250807160
x9 = K = 0.076597625551
Hence, the cascade filter coefficients must be
calculated at first and then these coefficients ak,i, bk,i
must be modified by the terms: The transfer function of the proposed filter has form:
a k ,i
round a k ,i 2 k 1 bk ,i
round bk ,i 2 k 1 4
b z i
i
k 1 k 1 (20)
2 2 H ( z) i 0 (26)
4
1 a z
i 1
i
i
4. ACKNOWLEDGEMENT
5. CONCLUSION
REFERENCES
Davídek, V., Laipert, M. and M. Vlþek (2000).
Analog and digital filters (in Czech: Analogové
a þíslicové filtry), ýVUT, Praha.
Martinek, P. and J. Vondras (2001). New Approach
to Filters and Group Delay Equaliser Transfer
Function Design. In: ICECS 2001 - The 8th
IEEE International Conference on Electronics,
Circuits and Systems. vol. 1, pp. 70. ICECS
2001. St. Julian’s.
Martinek, P. and J. Vondras (2002). Multi-criterion
Filter Design via Differential Evolution Method