A Comparison of Particle Swarm Optimization with Craziness based Particle Swarm Optimization for the Design of Low Pass Digital FIR Filter

DOI : 10.17577/IJERTCONV4IS15007

Download Full-Text PDF Cite this Publication

Text Only Version

A Comparison of Particle Swarm Optimization with Craziness based Particle Swarm Optimization for the Design of Low Pass Digital FIR Filter

Gagandeep Kaur

Department of Electronics and Communication Engineering

Giani Zail Singh PTU Campus, Bathinda

Mohandeep Singh

Department of Electronics and Communication Engineering

Giani Zail Singh PTU Campus, Bathinda

Balraj Singh

Department of Electronics and Communication Engineering

Giani Zail Singh PTU Campus, Bathinda

Darshan Singh Sidhu Govt Polytechnic College, Bathinda

AbstractThis paper demonstrates the design of digital low pass FIR (finite impulse response) filter with particle swarm optimization and its advanced version called as craziness based particle swarm optimization. Craziness based particle swarm optimization (CRPSO) purposes a new definition for position and velocity update originated from particle swarm optimization. CRPSO has adopted special features like craziness factor, abrupt change of velocity so the solution quality is improved. In the design process, the filter length, pass band and stop band frequencies are specified. Digital low pass FIR filter has been designed using both the original particle swarm optimization and craziness based particle swarm optimization. The simulation results obtained prove the superiority of the CRPSO algorithm over the well established PSO algorithm for the design of higher order filter design.

Keywords CRPSO, Low pass filter, Magnitude error, PSO, Ripple error


    Signal processing means operating the information bearing signals in some way to extract some useful information. These operations are held in signal processor. Signal processor may be a programmed computer or mechanical system. It is of two types: analog signal processing and digital signal processing (DSP). DSP is the processing of signals by digital means. It has various applications in the field of audio, video communication, image processing, and data acquisition etc. Digital filter designing is always a challenge in the digital signal processing. A digital filter makes the use of digital processor to perform the mathematical calculations and manipulations on the discrete values of the signal. Digital signal processing has advantages such as low sensitivity to component tolerances, fast speed and high noise immunity. Digital filter is one of the most important and powerful tools of DSP. It has become so popular just because of the extraordinary performance of the digital filters [7, 8].

    Filter improves the signal quality by extracting the required information and suppresses the unwanted signals like noise (that can be generated due to unavoidable environmental obstruction). It divides the frequency signal in two sub bands and confines the signal into particular frequency band (may be low pass, high pass, band pass or band stop) as depending upon the requirement. Depending upon the nature of signal, filters can be analog or digital. Due to number of advantages over analog filters, digital filters are used in a variety of applications such as high data rate communication systems, image processing, speech synthesis and channel equalization [5].

    Digital filters are classified as finite impulse response (FIR) and Infinite impulse response (IIR) depending upon their impulse response. Infinite impulse response filters have infinite impulse response that means unit sample response is from zero to infinity. IIR filters are known as non-linear and recursive type filters having feedback from output to input. These filters are always unstable. The IIR filters have found the application in the area where linear phase is not required. Whereas FIR filters have finite impulse response. FIR filters are inherently stable because current output of this filter is calculated from the present and past input values. These filters have exactly linear phase [9].

    There are mainly two approaches for the design of digital filters. First one is transformation approach and second is optimization technique. In transformation technique, the analog FIR filters are designed first and then transformed to the digital finite impulse response filters. Optimization basically involves the minimization or maximization of an objective function. Some of the evolutionary based optimization algorithms are genetic algorithms, simulated annealing, particle swarm optimization (PSO), seeker optimization, hybrid Taguchi genetic algorithm and differential evolution (DE) algorithms [1, 2].

    In this paper, the craziness based particle swarm optimization and particle swarm optimization are presented for the design process of digital low pass FIR filter. Particle swarm optimization is an evolutionary approach developed by Russel Eberhart. It is a population based robust and stable optimization technique. PSO has very simple calculations and results can be easily attained. But PSO algorithm has some


    1() = |Hd(i) |H(i, )||


    k 2

    2() = {(|Hd(i) |H(i, )||)






    limitations like premature convergence and stagnation. So, the

    Desired magnitude response Hd(i) of FIR filter is defines

    craziness based particle swarm optimization is purposed to overcome the limitations of original PSO algorithm. CRPSO


    ( ) 1, for i

    i = {

    i = {

    0, for


    stopband} (7)

    algorithm performs better and is used in the design of digital

    The ripple magn


    des of pass band and stop band are to

    low pass FIR filter. CRPSO algorithm tries to find out best filter coefficients so that required filter can meet the ideal specifications.


    i i

    i i

    be minimized which are denoted by 1() and 2() and ripple magnitudes are defined as [10]:

    The remaining paper is arranged as follows. In Section 2, digital low pass FIR filter design problem is formulated. Section 3 briefly discusses the PSO and CRPSO algorithms. Section 4 describes the simulation results obtained for low

    1() = max{|H(i, )|} min{|H(i, )|}

    where i passband



    2() = max{|H(i, )|}

    where i stopband.



    pass FIR digital filter using PSO and CRPSO. Finally, Section 5 concludes the paper.


    The foremost advantage of the digital FIR filter structure is that it can attain exactly linear-phase frequency response. So the phase of linear phase filters is known, the design process is reduced to real-valued approximation problems, where the filter coefficients have to be optimized with respect to the magnitude only. A digital FIR filter is characterized as follows [4]:

    Aggregating all objectives, the multi-criterion constrained optimization problem is stated as:

    1() = 1() (10a)

    2() = 2() (10b)

    3() = 1() (10c)

    4() = 2() (10d)

    In multiple-criterion controlled optimization problem for

    the design of digital FIR filter a single best possible tradeoff point can be solved as:


    () = () (11)


    () = ( ) (1)


    Table-1: Digital Low Pass FIR filters design



    where () and () are the input and output

    respectively. is the length of the filter and is the set of filter coefficients.

    The transfer function of FIR filter is symbolized by

    Filter Type

    Pass Band

    Stop Band

    Low Pass Filter

    0 0.2



    () = ()



    1. Particle Swarm Optimization

      Particle swarm optimization is a simple, flexible and

      where () is termed as system function of digital filter and it is the frequency domain representation of impulse response. () is the time domain representation of impulse response of the digital filter. T is the order of the filter. This paper presents ()as even symmetric and the order of the filter is even. The length of the () is T+1 and the number of coefficients also T+1. () Coefficients are symmetrical so the dimension of the problem is halved [12].

      The frequency response of the filter is given with the following equation [4]:

      robust population based stochastic optimization algorithm. It is based on the behavior of a swarm of birds. The bird flocking optimizes a certain objective function in multi- dimensional space. PSO also has capability to handle non- differential objective function. It is related to nature inspired technique to solve various problems [1].

      In PSO technique, firstly initialized with the random number of particles (that can be birds or agents). These particles randomly searching food in particular space and all the birds do not have any information about food. So the best method to find the food is that all other birds follow the bird to

      ( ) = ()



      which food is near. In this manner the generations are updated for optimum result. In each iteration, each particle is updated

      where () is termed as Fourier transform complex factor. A digital FIR filter has linear phase if its unit sample response satisfies the following condition.

      with his personal best value (pbest) that has achieved so far. After this global best (gbest) value is tracked with particle swarm optimization, is obtained so far by any particle in the

      () = +( 1 )


      population. After finding the pbest and gbest values, the

      The performance of digital FIR filter can be calculated

      1() and 2() approximation error of magnitude response and ripple magnitude of both pass band and stop band.

      particle update its velocity and position with the help of following two equations [13]:

      +1 = +1 1 ( ) + 2 2

      small, then both the personal and social experiences are not

      used fully. Hence the convergence speed of the technique is

      ( ) (12)

      +1 = + +1 (13)

      reduced. So, instead of using independent variable µ1 and µ2, only single variable is chosen so that when is large, (1-

      1 1

      where +1is the velocity of particle at iteration;

      is the weighting function. 1 and 2 are acceleration constants that represents weighting of stochastic acceleration expressions those drag each particle towards pbest and gbest positions. µ1 and µ2 are two random functions, both lie in the range [0, 1]; if these two parameters are large then the personal and social experiences are used in excess and

      therefore the particle driven so far from the local optimum. If both are small then social and personal experiences are not fully used, because of these the convergence speed is reduced of the algorithm. Therefore, µ1 and µ2 should be optimum.

      Corresponds to the current position of particle at

      iteration; is the personal best of particle at

      iteration; is the group best of the group at iteration [9]. The following steps are involved for implementation of


      1. Initialize a populace of particles with random positions and velocities on d dimensions in the problem space.

        1) is small and vice versa. Another parameter 2 is introduced to control the balance between global and local searches. In the birds group, there could be some rare cases that after the position is changed according to Eq. (13), a bird may not fly towards the region at which it thinks is most promising for food. Instead, it may be leading towards the area which is in opposite direction of the expected promising region. So, in the

        step that follows the direction of birds velocity should be reversed in order for it to fly back to the promising region.

        (3) is introduced for this purpose. In birds flocking, a bird often changes directions suddenly. This is illustrated by using a craziness factor and is modeled in this technique by using a craziness variable. The craziness operator is introduced in the purposed algorithm to ensure that the particle would have a predefined craziness probability to maintain the diversity of the particles. So, before updating the

        position of particle its velocity is crazed by a factor given below [6]:

        +1 = +1 + (4) (4) (17)

      2. Now evaluate the desired optimization fitness function



        a random parameter that is taken uniformly

        for each particle.

      3. Compare particles fitness assessment with particles pbest. If current value is superior to the previous pbest, then set pbest value equal to current value, and the

        her 4 is

        within the interval [0,1].

        is a random parameter and (4), (4) are defined , respectively.

        pbest location also updated with current location in d dimension space.

      4. Compare fitness assessment with the populations overall previous best. If present value is better, then

        1 4

        (4) = {0 4 >



        1 0.5

        (4) = { 1 4 < 0.5



        update gbest with current particles selection index and value.

      5. Change the velocity of the particles as per Eq. (12).

      6. Change the position of the particles as given in Eq. (13).

      7. Loop to Step 2 until a stopping criterion is met, usually an adequately good fitness or a maximum number of iterations.

      8. End [3, 11].

    2. Craziness based Particle swarm Optimization

      The global search capability of above discussed PSO algorithm is improved with the following modifications. The modified version of PSO is called as Craziness based particle swarm optimization (CRPSO) [6].

      The velocity for this case is defined as follows:

      +1 = 2 (3) + (1 2) 1 1

      where is a predefined probability of craziness. The

      following steps are involved in the CRPSO algorithm [6].

      1. Population is initialized for a swarm of np vectors. Each vector represents a solution of filter coefficients.

      2. Compute the initial cost (fitness) values of the total population.

      3. Computation of minimum fitness value, group best (gbest) and compute the personal best (pbest).

      4. Updating the velocities as per Eq.(15) and Eq.(17). Update the particles positions as per Eq.(13) as compared with previous one.

      5. Updating the pbest and gbest vectors and replace the updated particle vectors as initial particle vector for step 4.

      6. Iteration continues from step 4 till the convergence of minimum fitness values is reached. Finally, gbest is the vector of optimum filter coefficients.

        { } + (1 2) 2 (1 1) { }

      7. End


        The design objective of this paper is to obtain the optimal

        where, 1, 2, 3 are the random parameters uniformly taken from the interval [0,1] and (3) is a function defined as follows

        set of FIR filter coefficients, so as to acquire the maximum stop band attenuation, minimum ripple error.



        1 0.05

        (3) = { 1 3 > 0.05



    The two random parameters µ1 and µ2 of Eq. (12) are independent. If both the parameters are large, both the personal and social experiences are over used and the particle is driven too far away from the local optimal value. If both are

    Digital Low Pass FIR filter has been designed using particle swarm optimization and its improved version termed as craziness based particle swarm optimization. Both the

    algorithms have been executed by 100 times with 200 iterations.

        1. Selection of Order

          Initially, the order of filter has been taken as 30. To minimize the objective function value filter order has been varied from 30 to 44 in both PSO and CRPSO algorithms and best order has been selected.

          Objective Function

          Objective Function

          Fig.1 shows the objective function variations with respect to the order of filter. With the increase of filter order, objective function goes on decreasing. At filter order 42, the minimum value of objective function is obtained. After this order of filter, objective function value starts increasing. So, the order 42 has been selected.





















          30 32 34 36 38 40 42 44

          Filter Order

          30 32 34 36 38 40 42 44

          Filter Order

          Fig.1: Graph between Filter Order and Objective function

          Control parameters of CRPSO and PSO algorithms have been varied and best values have been selected. Comparison of Parameters of Particle Swarm optimization and Craziness based PSO is given in the Table-2. Magnitude errors and ripple errors have been given in the Table-3 for both the algorithms.

          Table-2: Compared Parameters of PSO and CRPSO




          Filter Order



          Population Size



          Acceleration Constants

          1.5, 2.5







          Table-3: Magnitude Errors and Ripple Errors




          Magnitude Error 1



          Magnitude Error 2



          Ripple Error 1



          Ripple Error 2



        2. Analysis of Magnitude Response and Phase Response

          This section represents the simulation results for magnitude and phase response. Simulation results are performed in MATLAB. The optimized filter coefficients obtained for low pass digital FIR filter using both the algorithm has been shown in Table-4. Fig.2 shows the magnitude response in dB of low pass digital FIR filter using CRPSO. Fig.3 shows the normalized magnitude response

          versus normalized frequency. Fig.4 shows the plots of phase response versus frequency response that is linear throughout the pass band and transition band.

          Table-4: Optimized Coefficients of the Low Pass FIR Filter of Order 42






































































          Fig.2: Magnitude Response in dB for Low Pass FIR Filter of order 42

          Table-5: Achieved values of Objective Function and Standard Deviation

          Objective Function Values



          Maximum Objective Function



          Minimum Objective Function



          Average Objective Function



          Standard Deviation



          Fig.3: Magnitude Response versus Normalized Frequency for the Filter order 42

          Fig.4: Phase versus Normalized Frequency Response for the order 42


In this paper craziness based particle swarm optimization is purposed for the design of digital low pass FIR filter. Order of the filter has been varied from 30 to 44 and it is concluded that the filter order 42 gives the minimum value of objective function. Simulation results show better performance of the purposed algorithm CRPSO over the classical PSO in terms of magnitude response, convergence speed which ensure the potential of purposed algorithm to handle the similar filter design problem.


  1. J. Kennedy and R. Eberhart, Particle Swarm Optimization in Proc. IEEE Int. Conf. on Neural Network, vol. 4, no. 5, pp. 1942-1948, 1995.

  2. Kit- sang Tang, Kim-fung Man, Sam Kwong and Zhi-feng Liu, Design and Optimization of IIR Filter Structure using Hierarchical Genetic Algorithms IEEE Transactions on industrial electronics, vol. 45, no.3, pp. 481-487, 1998.

  3. Maurice Clerc and James Kennedy, The Particle Swarm- Explosion, Stability and Convergence in a Multidimensional Complex Space IEEE Transactions on Evolutionary Computation, vol. 6, no. 1, pp. 58- 73, 2002.

  4. J.G. Prokis and D.G Manolakis, Digital Signal Processing: Principle, Algorithm and Application, New Delhi: Pearson Education, Inc., Fourth Edition, 2007.

  5. S. Chattopadhyay, S. K Sanyal and A. Chandra, Design of FIR Filter Using Differential Evolution Optimization & to study its Effect as a Pulse Shaping Filter in a QPSK Modulated System, International Journal of Computer Science and Network Security, vol. 10, no. 1, pp. 313-321, 2010.

  6. Suman umar Saha, Rajib Kar, Durbadal Mandal and S.P. Ghoshal, IIR Filter design with Craziness based Particle Swarm Optimization Technique, world Academy of Science, Engineering and Technology, vol. 5, no. 12, pp. 1052-1059.

  7. Saurabh Kumar and Onkar Chand, An Analysis of FIR Filter using Particle Swarm Optimization, International Journal of Scientific & Engineering Research, vol. 4, no. 9, pp.2691-2695, 2013.

  8. Meenu Bansal, Darshan Singh and Balraj Singh Sidhu, Optimal Design of Digital IIR Band Pass Filter using particle Swarm optimization International Journal of Advance Research in Computer Science and Software Engineering, vol.4, no. 5, pp. 1133-1139, 2014.

  9. Neha and Ajay Pal Singh, Design of Linear phase Low Pass FIR Filter using Particle Swarm Optimization Algorithm, International Journal of Computer Applications, vol. 98, no.3, pp. 40-44, 2014.

  10. Amandeep Kaur Maan, Balraj Singh and Darshan Singh, Design of High Order Digital IIR Filter using Heuristic Optimization Technique International Journal of advance research in Computer Science and Software Engineering, vol.4, no. 10, pp.1-7, 2014.

  11. S. K. Saha, R. Kar, D. Mandal and S. P. Ghoshal, "Optimal Linear Phase FIR Filter Design using Particle Swarm Optimization with Constriction Factor and Inertia Weight Approach with Wavelet Mutation", International Journal of Hybrid Intelligent Systems (IJHIS), vol. 11, No. 2, pp. 81-96, 2014.

  12. Shinam Rani and Darshan Singh Sidhu, Design of Digital Band Stop FIR Filter using Craziness Based Particle Swarm Optimization (CRPSO) Technique, International Journal of Scientific Research Engineering & Technology, vol. 4, no. 5, pp. 464-471, 2015.

  13. Amarjeet kaur Jatana and Darshan Singh Sidhu, Design of Digital FIR High Pass Filter using Particle Swarm Optimization Technique, International Journal of Scientific Research Engineering & Technology, vol. 4, no. 5, pp. 472-479, 2015.

Leave a Reply