Design and Optimization of IIR Digital Filters with ... - Semantic Scholar

55 downloads 607 Views 818KB Size Report
optimization to the design of stable IIR digital filters with non- standard amplitude .... particle in the search space among all positions obtained so far. At the beginning the .... Machine Learning, Addison-Wesley Publishing Company Inc, 1989.
Design and Optimization of IIR Digital Filters with Non-Standard Characteristics Using Particle Swarm Optimization Algorithm Adam Slowik

Michal Bialko

Department of Electronics and Computer Science Technical University of Koszalin Sniadeckich 2 Street 75-453 Koszalin, POLAND e-mail: [email protected]

Department of Electronics and Computer Science Technical University of Koszalin Sniadeckich 2 Street 75-453 Koszalin, POLAND

Abstract— In the paper an application of a particle swarm optimization to the design of stable IIR digital filters with nonstandard amplitude characteristics is presented. Particle swarm algorithms are newly elaborated technique for optimization of multi-modal functions, as for example functions describing the problem of calculation of an optimal set of transfer function coefficients in which the gradient algorithms can easily stick at local extreme. Design of IIR digital filters with non-standard amplitude characteristics which considerably differ from typical Butterworth, Chebyshev, and Cauer approximations, is possible using presented method. The IIR digital filter with linearly falling amplitude characteristics is designed with the use of proposed method. The filter is stable and fulfill all prescribed design assumptions.

have been published [7, 8]. In this paper the design method of IIR digital filters with non-standard amplitude characteristics based on particle swarm algorithm is presented. The presented method named PSO-IIRF (Particle Swarm Optimization for Infinite Impulse Response Filter) is described in section four of this paper, and using it, the IIR digital filter with linearly falling amplitude characteristics is designed. II. IIR D IGITAL F ILTER The transfer function in z domain of the designed IIR digital filter is described as follows:

I. I NTRODUCTION The design of digital filters with non-standard characteristics is a complex problem. The function describing this problem is a multi-modal function, so the gradient optimization methods can easily stick at local extremes [1]. The techniques of global optimization, such as for example particle swarm algorithms are used to avoid this situation [2, 3]. These algorithms are relatively new techniques of multi-modal function optimization [4], in which application of crossover and mutation operators (as in genetic algorithms) are not required. Each potential solution, called particle, is moving toward actual optimum in the solution space. Fulfilling of the design assumptions such as for example: values of pass-band and stop-band frequency ranges, value of pass-band ripple, and value of stop-band attenuation is the main aim during digital filter design [5]. When digital filters with standard amplitude characteristics are designed [6], it is possible to use existing standard approximations as for example: Butterworth, Chebyshev or Cauer. However the problem is more complicated, when filter is supposed to possess a nonstandard amplitude characteristics as for example in amplitude or phase equalizers, since then the standard approximations are useless. The particle swarm algorithms open the new field in global optimization methods, hence up to this date only a few papers with their application to the design of digital filters

1-4244-1378-8/07/$25.00 ©2007 IEEE.

162

H (z) =

b0 + b1 · z −1 + b2 · z −2 + ... + bn · z −n 1 − (a1 · z −1 + a2 · z −2 + ... + an · z −n )

(1)

The main objective of presented method is searching a such set of filter transfer function coefficients b0 , b1 , b2 , ..., bn , a1 , a2 , ..., an (n is the filter order) assuring that obtained filter fulfill all initial design assumptions and is stable (all poles of the transfer function are located inside the unit circle in the z plane). III. PARTICLE S WARM O PTIMIZATION A LGORITHM The PSO (Particle Swarm Optimization) algorithm [2, 3, 4] has many common features with evolutionary computing techniques [9, 10, 11]. The PSO algorithm is also operating on randomly created population of potential solutions, and is searching the optimal solution by creating subsequent generations of solutions. However, genetic operators such as crossover and mutation are not used in this algorithm. In the PSO algorithm the potential solutions (called also the particles) are moving to the actual (dynamically changed) optimum in the solution space. Each particle is keeping in its memory the best position Pbest together with value of objective function. The another ”tracked” value is Lbest , which represents the best value of objective function obtained by any particle at a given cycle of algorithm in the neighbourhood of

considered particle. In the special case when all population is assumed as a neighbourhood of a given particle, then the best value in its neighbourhood is the best value Gbest obtained for all population. The idea of optimization with the use of PSO algorithm is based on changes of velocity (acceleration) for each particle moving toward position Pbest and position Lbest (for global version of the algorithm the particles are accelerated toward direction Pbest and Gbest respectively). The acceleration is randomly modified independently for each direction. The PSO algorithm has been successfully applied to many different disciplines of science during last years. It has been shown in paper [4], that the PSO algorithm is leading to better results in a shorter time compared to other evolutionary algorithms. IV. T HE PSO-IIRF M ETHOD The elaborated PSO-IIRF method leading to gradual improvement of designed filter parameters (lower deviation of characteristics from idealized case) consists of eight following steps: In the first step the initial population P containing M particles is randomly created. Each particle Pi (i ∈ [1; M ]) consists of vectors: X, Pbest , Lbest and V. These vectors are composed of D elements (D - search space dimension equal to number of variables in optimized task). The X vector determines the current position of the particle Pi in the D dimensional search space, and is also a potential solution of the given problem. The designed filter coefficients are coded in vector X according to the following order: X = [b0 b1 b2 ... bn a1 a2 ... an ]

(2)

The Pbest vector determines the best position of the given particle in the search space among all positions obtained so far. At the beginning the vector X is assigned to the Pbest vector. The Lbest vector, assigned to the particle Pi , determines the best position of another particle among Ne nearest neighbours of particle Pi found until now. The V vector represents the values of particle velocities in each of D directions in the search space. The values of Lbest vector, and the values of V vector are equal to zero at the start of the algorithm. In the case when during the run of the algorithm the return (jump) to the first step from the seventh step is occurred, then the particle Gbest is assigned to the randomly chosen particle Pi . In the second step the value of fitness of each particle to the objective function COST(.) is evaluated (this function is described in section five of this article; the value of this function is minimized by the algorithm). In the case when computed value of the objective function for data stored in the X vector, is lower than the best value found so far for given particle (written down in the Pbest vector), then the X vector is assigned to the Pbest vector. In the third step the best particle among its Ne nearest neighbours is determined for each particle Pi (neighbourhood

163

of particles is determined according to the similarity of objective function value corresponding to them), and its position is remembered in the Lbest vector. In the fourth step velocities in each of D directions are computed for each particle Pi according to the formula [4]: V [j] = γ · V [j] + γ · c1 · r1,j · (Pbest [j] − X [j]) +

(3)

+γ · c2 · r2,j · (Lbest [j] − X [j]) where: j - 1, 2, ..., D; γ - the scaling coefficient (in this paper is assumed γ = 0.729); c1 and c2 - learning coefficients, usually the value of c1 is equal to value of c2 , and are from range [0; 4], in this paper c1 = c2 = 0.3 is assumed; r1,j , r2,j - random real numbers with uniform distribution from range [0; 1]. In the fifth step, the X vector determining particle position in D-dimensional search space is actualized for each particle Pi . The actualization is done with the use of the velocity vector V according to the formula: X [j] = X [j] + r3,j · V [j]

(4)

where: r3,j - random real number from the range [0; 5]. In the sixth step a randomly created particle is inserted in the place of the worst particle (with highest value of COST(.) function) in the population. This operation improves the convergence of the proposed algorithm. In the seventh step, it is checked whether the solution, for which the value of COST(X) function equals to zero, is found. If such solution is not found then the eight step is executed. If such solution (particle) is found then this particle is assigned to the Gbest particle, the objective function COST(.) is modified by decreasing the allowed deviation values of amplitude characteristics of the designed filter, and the algorithm returns (jumps) to the first step. In the eight step, the algorithm termination condition is checked. The algorithm stops when the absolute value of the difference between the best generated particles is lower than  after t generations. The final result of PSO-IIRF algorithm operation is the vector X stored in Gbest particle. If the termination condition is not fulfilled then second step is executed. V. O BJECTIVE F UNCTION OF THE PSO-IIRF M ETHOD In order to compute the value of objective function COST(.) for any particle Pi , the FFT transform of filter coefficients ak and bk , stored in X vector (see formula 2), is performed. Having the FFT results the amplitude characteristics H(f ) [dB] of the digital filter is determined according to the following formula: H (f ) = 20 · log10



2

Hreal (f ) + Himag (f )

2

 [dB] (5)

The value of the objective function COST(.) for each particle is higher when the sum of absolute values of deviations

between constraints following from design assumptions and actual value of characteristics H(f ), obtained for particular frequencies fi is higher. The value of objective function increases additionally in the case when a given set of filter coefficients ak and bk (coded in X vector of each particle) leads to an unstable filter. In such case to the value of the COST(.) function the value of penalty is added, which is higher when more poles of the filter transfer function are located outside the unit circle in the z plane. In figure 1 the assumed areas of constraints for amplitude characteristics are shown.

COST (.) =

k  i=1

Er (fi ) +

m 

Stabi

(6)

i=1

where:

 |H(fi ) − C1 (fi )| , when H(fi ) > C1 (fi )    |H(fi ) − C2 (fi )| , when H(fi ) < C2 (fi ) Er(fi ) = 0, when H(fi ) ∈    [C2 (fi ); C1 (fi )] Stabi =

(|zi | − 1) · w + w, when |zi | ≥ 1 0, when |zi | < 1

where: m - number of poles of the transfer function, k - number of output samples from FFT transform divided by 2 (assumed k=256), w - the value of penalty (assumed w = 105 ), fi - i-th value of normalized frequency, |zi | - the absolute value of i-th pole of the transfer function in z plane. VI. D ESCRIPTION OF E XPERIMENTS

Fig. 1.

Amplitude characteristics with constraints

In figure 2 the accepted areas of constraints for poles of designed filter are shown.

Fig. 2.

Poles of transfer function H(f ) of designed filter with constraints

Taking into account constraints of figure 1 and figure 2, the objective function COST(.) can be defined as follows:

164

Proposed method has been tested by the design of the 10 order (n = 10) IIR digital filter with linearly falling amplitude characteristics (for normalized frequency f =0 the value of attenuation is equal to 0 [dB], for normalized frequency f =1 the value of attenuation is equal to 40 [dB]). At the start it is assumed that the deviation values of the attenuation characteristics from ideal case can not be higher than 10 [dB] at any frequency point. Then, during the algorithm operation the values of assumed attenuation deviations are decreased with 1 [dB] step, and after achieving the value of deviation equal to 1 [dB], the values of attenuation deviations are decreased with 0.1 [dB] step. The main purpose of the experiment is a design of 10-order digital filter with linearly falling amplitude characteristics having the lowest deviations of attenuation with respect to ideal characteristics. In the algorithm it is assumed: the number of particles M=100, dimension of solutions space D=21 (it follows from the number of filter coefficients), the neighbourhood parameter Ne=3, t=500, and =0.0001. The initial values of X vector for each particle are randomly chosen from the range [-1; 1]. In figure 3 the differences (deviations) between ideal characteristics H(f ) , and characteristics of designed filter H  (f ) obtained with the use of PSO-IIRF method after 16254 generations is presented. It can be seen from figure 3, that the deviations between ideal characteristics, and characteristics obtained by proposed method for each value of normalized frequency do not exceed 0.3 [dB]. Designed filter is stable, i.e. all poles of its transfer function are located inside unit circle in the z plane (see figure 4). In figure 5 the number of generations required to obtain a digital filter with prescribed deviations of attenuation values of its amplitude characteristics is shown. It can be seen from figure 5, that together with decrease of acceptable deviations of attenuation values, the number

Fig. 3. Deviation between ideal characteristics H(f ), and characteristics H  (f ) obtained with the use of PSO-IIRF method

Fig. 5. The number of generations required to obtain a digital filter with prescribed deviations of attenuation values of its amplitude characteristics

since the expert knowledge concerning the filter design is not required. It is also worth to say that the process of evolutionary digital filter design is fundamentally different form traditional filter design process, because it is not based on designer knowledge and experience, but on the evolution process [12]. The evolutionary filter design has less constraints than the design based on designer knowledge and experience; the designers are not only limited by the technology in which the circuit (filter) will be produced, but also by own habits (routines), intelligence, imagination and creative thinking [12]. An application of evolutionary methods to filter design allows to escape from limitations characterized earlier and to obtain the access to the new possibilities. R EFERENCES

Fig. 4. Poles of transfer function of designed filter with linearly falling amplitude characteristics

of generations required to fulfill prescribed assumptions of designed digital filter is increasing. Thirteen generation are required to fulfill assumptions for digital filter with deviations of attenuation not higher than 10 [dB], for deviations equal to 1 [dB] 570 generations are required, and for deviations equal to 0.3 [dB] 8585 generations are required. It can be seen that strong increase of number of generations is required with a decrease of deviations of attenuation values. The requirements with deviations lower than 0.2 [dB] can not be fulfilled by 10-order digital filter (higher order is required). VII. C ONCLUSION It has been shown that it is possible to design digital filters with non-standard amplitude characteristics using the PSO algorithm. The designed filter fulfill all design assumptions and is stable. Higher automation of the design process of digital filter is possible with the use of PSO-IIRF method,

165

[1] S. Chen, R. H. Istepanian and B. L. Luk, Digital IIR filter design using adaptive simulated annealing, Digital Signal Processing, Vol.11, No.3, pp. 241-251, July 2001. [2] R. C. Eberhart, Kennedy J. A new optimizer using particle swarm theory, Proceedings of the Sixth International Symposium on Micromachine and Human Science, Nagoya, Japan. pp. 39-43, 1995. [3] J. Kennedy, R. C. Eberhart, Particle swarm optimization, Proceedings of IEEE International Conference on Neural Networks, Piscataway, NJ. pp. 1942-1948, 1995. [4] J. Kennedy, R. C. Eberhart, Y. Shi, Swarm intelligence, San Francisco, Morgan Kaufmann Publishers, 2001. [5] A. Slowik, M. Bialko, Evolutionary design of IIR digital filters with non-standard amplitude characetristics, 3-rd National Conference on Electronics, Kolobrzeg, June 2004, pp. 345-350, (in polish). [6] R. Lyons, Introduction to digital signal processing, WKL, Warsaw, 2000, (in polish). [7] D. J. Krusienski, W. K. Jenkins, Particle swarm optimization for adaptive IIR filter structures, Evolutionary Computation, 2004, CEC 2004, Congress on Volume 1, 19-23 June 2004, pp. 965 - 970, 2004. [8] Wei Fang, Jun Sun, Wenbo Xu, Design IIR Digital Filters Using Quantum-Behaved Particle Swarm Optimization, ICNC 2006, Xian, China, pp. 637-640, 2006. [9] D. E. Goldberg, Genetic Algorithms in Search, Optimization, and Machine Learning, Addison-Wesley Publishing Company Inc, 1989. [10] Z. Michalewicz, Genetic Algorithms + Data Structures = Evolution Programs, Springer-Verlag Berlin Heidelberg, 1992. [11] J. Arabas, Lectures on Evolutionary Algorithms WNT, 2001, (in polish). [12] J. Greene, Simulated evolution and adaptive search in engineering design, in 2nd Online Workshop on Soft Computing, 1997