FPGA based Synthesize of PSO Algorithm and its Area-Performance Analysis

Digital filters are the most significant part of signal processing that are used in enormous applications such as speech recognition, acoustic, adaptive equalization, and noise and interference reduction. It would be of great benefit to implement adaptive FIR filter because of self-optimization property, linearity and frequency stability. Designing FIR filter involves multi-modal optimization problems whereas conservative gradient optimization technique is not useful to design the filter. Hence, Particle Swarm Optimization (PSO) algorithm is more flexible and optimization technique based on population of particles in search space and alternative approach for linear phase FIR filter design. PSO improves the solution characteristic by giving a novel method for updating swarm’s position and velocity vector. Set of optimized filter coefficients will be generated by PSO algorithm. In this paper, PSO based FIR Low pass filter is efficiently designed in MATLAB and further Xilinx System Generator tool is used to efficiently design, synthesize and implement FIR filter in FPGA using SPARTEN 3E kit. For an example specifications, output of PSO algorithm is obtained that is set of optimized coefficients whose response is approximating to the ideal response. Hence, functional verification of the proposed algorithm has been performed and the error between obtained filter and ideal filter is minimized successfully. This work demonstrates the effectiveness of the PSO algorithms in parallel processing environment as compared to the Remez Exchange algorithm. Keywords—Particle swarm optimization (PSO); Remez Exchange Algorithm; FPGA implementation; FIR filter


I. INTRODUCTION
Digital filters enable us to pass some frequencies unaltered, while totally blocking others.Generally digital filters consist of two types; finite Impulse response (FIR) and infinite Impulse Response (IIR).An exactly linear phase response can be generated by FIR Filter and no any phase distortion or noise present in the output signal which is required in wide verity of telecommunication applications i.e. echo cancellation, noise and interface reduction, speech or image encoding.Different techniques are accessible for design the FIR filter.Window method is most frequently used tool but this method is not much capable to efficiently control the of frequency response in several bands of frequency [1].Remez Exchange Algorithm or Parks-McClellan (PM) algorithm is ordinary method for designing FIR filter but this method has some limitation of high pass band ripples and computational complexity [2], [3].It is good to design filter using optimization algorithm because of less mean squire error between desired response and actual response [3].Optimization is not new techniques while numerous efforts have been already made for optimum design.Like Genetic Algorithm [3], Particle Swam Optimization algorithm [4], Differential Evolution [5], Artificial Bee Colony [6] are implemented for filer design.These methods showed themselves fairly effective by providing better control of performance constraints in addition to high stopband attenuation.Genetic Algorithms gives the effective result for local optimum but not successful in fining global optimum, PSO technique is able to solve problem [7].Software based PSO algorithm increases the run time because of iterative process, additional processing time and storage is needed for FIR filter implementation [8].PSO gives the better solutions over GA, processing time of one iteration of PSO algorithm gives higher process speed for optimization problems rather than genetic algorithm [8].Implementation of digital filers based on FPGA which is flexible, low power, low cast and area sufficient provide better performance and superior to traditional approach [9].
Designing FIR low pass filter using traditional methods require more coefficients if sharp cutoff or no phase distortion is required and actual response (Ω) is not more approximating to desired frequency response (Ω) within a given specification in magnitude and phase [11], [12].In recent past, one of the alternatives to this approach reported is short word length DSP systems [13], [14] in which sigma-delta modulation is a key element.However, in this research paper we have attempted to present the PSO based FIR filter designed in MATLAB; output of PSO is set of optimized coefficients whose response is approximating to the ideal response.Main objective is to efficient design, synthesize and functional verification of the optimized and original FIR low pass filter using Xilinx System Generator and implement in FPGA through hardware co-simulation, and to perform www.ijacsa.thesai.orgcomparative analysis between both.This work will culminate with development of single-bit ternary PSO algorithm.

II. FIR FILTER DESIGN IN MATLAB USING PSO ALGORITHM
In this section, PSO based FIR Low pass filer design and its implementation in MATLAB is discussed.

A. FIR Low Pass Filter Design
FIR filters are non-recursive filters and only depends upon past input information never on past output information [10].Designed filter frequency response is given as: where h[n] shows filter's impulse response, N is order is filter with N+1 length.Ideal response of Low Pass filter is defined as; where shows cutoff frequency of LP filter.Here obtained filter is designed by Remez Exchange Algorithm, this algorithm provides so many ripples in stop band, for sharp cutoff more coefficients are required.PSO algorithm is used to overcome this problem by minimizing the error between Remez and Ideal filter.The error equation is;

𝐻 (
) is the ideal frequency response and  ( ) is frequency response of the approximate filter.

B. Particle Swarm Optimization (PSO) Algorithm
PSO is the optimization technique used to determine the search space for specified problem to find the setting or constraint that essential to maximize the specific object [15].This global optimization technique was, first introduced by J. Kennedy and R. C. Eberhart in 1995, based on common behavior of fish schooling or bird flocking [16].PSO algorithm can solve optimization-based problems, in this research PSO is used to optimize the FIR filter coefficients to minimize the error.PSO algorithm is iterative process and initialized with population consist of N particles and every particle initialized to random position.For each iteration the error fitness function is used to measure the fitness value of each particle i in the search space.Then velocity vector is calculated which influenced by the particles individual experience as well as the experience of its neighbors.Velocity vector is further used to update the particles position which defines the filter coefficients.The velocity update equation for particle is given as: And position updating equation is:  Superscripts t and t+1 represent the index of preceding and subsequent iterations, is inertia coefficient, and are considered as uniformly distributed random numbers, and is cognitive acceleration term and social acceleration term and and are particle best position and swarm best position.

C. Designing Steps
Step I.In the very first step, specifies parameters that are required for designing FIR LP filter; Frequency of Sampling = 1kHz, W asps =0.25, W stop =0.3, Passband ripples= 0.1 and Stopband ripples = 0.01, filter order = 10 (Total no. of coefficients = 11).
Step III.Create the initial particle vectors by utilizing above parameters and calculate initial value of error fitness function for the entire population by using (3).
Step VI.Error fitness vector is being used to calculate the minimum error value and calculate pbest (individual best) and gbest (group best) from entire swarm.
Step V. Update velocity and the position (filter coefficients) according to ( 4) & ( 5), which is to be considered as particle initial vector, error fitness is calculated form updated parameters also pbest and gbest is calculated accordingly.

Step VI. If values of vector pbest and gbest considered in
Step V are improved than those calculated in Step IV, replaced the vector and no change otherwise.
Step VII.Repeat continuously from Step IV to Step VI till convergence conditions is meet (error fitness value equals minimum error fitness or reaching itmax).
In Fig. 1, frequency response of PSO, Ideal and Remez algorithm-based FIR LP filters, for swam size N = 250 and itmx=100 is shown.By increasing swarm size, ripples in stop band are reduced at great extent and with increasing the iteration PSO algorithm gives the sharp cutoff at the cost of more chip area and performance degradation.Xilinx System Generator is a programing tool used to develop efficient DSP algorithm and implement on FPGA.Due to reprogrammable capability of FPGA, implemented filter coefficients can be changed easily as per requirement [17].System generator block set is available in MATLAB Simulink and it is high level programing tool for developing high performance DSP systems in FPGA [18][19].System Generator enables the user to integrate with Simulink and it can easily generate synthesizable VHDL and Verilog code.
In this work, initially FIR Low pass filter is designed using FDA tool for the specification given outlined in designing steps.Further, PSO algorithm is applied on obtained coefficients and output of PSO is optimized coefficients whose response is approximate to ideal response.Xilinx system generator 14.7 is used for efficient direct form-I FIR low pass filter design and implemented in Spartan 3E FPGA kit through co-simulation.Simulation and Hardware Co-simulation model is shown in Fig. 2 and 3. JTAG cable shown in Fig. 2 is used for communication between Xilinx System Generator and Spartan 3E FPGA kit.System generator block set generate the of JTAG block of compatible signal for Spartan 3E kit.Resource Estimator is used to calculate the resources used by the device.It is used only when hardware is connected.Fig. 4 and 5 shows subsystem and internal structure of FIR Filter.

IV. SIMULAITON RESULTS AND DISCUSSION
Sinusoidal test signal of 125Hz frequency is generated in MATALB workspace as shown in Fig. 6 and White Gaussian Noise is added to original signal with Signal to Noise Ratio (SNR=1).Noisy signal is used as input of FIR filter.In first place, we used FIR filter model as shown in Fig. 2 with original filter coefficients, output signal of original filter is shown in Fig. 7 which contains more noise present in input signal.In Fig. 8, better output response is obtained, while we have used same model as shown in Fig. 2 but PSO optimized coefficients are employed as shown in Table I.This output signal is also taken to workspace in order to draw the spectrum as shown in Fig. 9, 10 and 11.The mean square error is computed using (3), and obtained Error = 0.3447933 when filter designed by Remez Exchange Algorithm and Error = 0.06442020 while filter designed by PSO algorithm.Area utilization is also observed using Spartan 3E kit, Table II shows area utilization of FIR filter using Spartan 3E FPGA kit.In Fig. 9, frequency spectrum of noisy signal contains 125Hz original signal frequency and SNR=1 is shown.Whereas, Fig. 10 shows the output of original filter which shows the noise is present in the filtered signal and Fig. 11 shows the output of PSO based filter which contains less noise as compared to original filter.The area utilization by the PSO algorithm in FPGA given in Table II is quite small amount as compared to the available resources of the device.In this paper, we have designed PSO based FIR filter in MATLAB that is further efficiently designed and synthesized using Xilinx System Generator in FPGA.Functional verification of the Remez Exchange Algorithm and PSO Algorithm based FIR low pass filter is performed through hardware co-simulation in Spartan 3E FPGA device.It is demonstrated that error in the PSO algorithm is successfully minimized.Area utilization of the PSO algorithm is also reported that is well below the available resources that shows much more room is available for improvement in the algorithm by increasing order of the filter.
Point to the future work is to compare this algorithm with other recursive algorithm and finally develop single-bit ternary FIR-like filter by employing these techniques.

Fig. 2 .
Fig. 2. Simulation model of direct form I FIR low pass filter.

Fig. 3 .
Fig. 3. Hardware co-simulation model of direct form I FIR low pass filter.

Fig. 4 .
Fig. 4. Internal structure of direct Form I FIR filter model.

Fig. 7 .
Fig. 7. Software simulation and hardware filtered output signal with original filte.

Fig. 8 .
Fig. 8. Software simulation and hardware filtered output signal with optimized filter.

Fig. 10 .
Fig. 10.Frequency spectrum of output signal of original filter.

Fig. 11 .
Fig. 11.Frequency spectrum of output signal of optimized filter.

TABLE II .
AREA UTILIZATION OF FIR FILTER USING SPARTAN 3E KIT