Keywords

1 Introduction

With the various advancements in the transformation of digital signal, filters based on the digital techniques are gaining much more importance instead of analog filters. Digital filtrate is a system that uses digital signal as input and provides digital signal as output after filtering. These are categorized into two: FIR and IIR filters reliant to size of its impulse. Each filter possesses its own advantages and disadvantages. Designing parameters for FIR filter, which are to be considered during the designing of filters, are mentioned as: select band frequency, reject band frequency, ripples, fading, filter coefficients, filter order, etc. [1,2,3,4]. FIR filter has numerous advantages over IIR filter which leads to its popularity among the researchers. The implementation of FIR filter is much simpler as it requires no feedback. By making the coefficients of the filter to be symmetrical, linear phase response can be achieved; thus, it allows consistent group delay [5]. Filter designing involves determining the filter coefficients and filter order which satisfy the required filter stipulations, for example, the frequencies of select band and reject band, select band and reject band width, and select band and reject band ripples as well as attenuation. The FIR filters feasibly be projected using various techniques as an illustration window design technique [6,7,8,9], frequency sampling [6, 10] weighted least squares design [6], and Parks–McClellan method (equiripple or optimal method) [2, 11]. Traditionally, windows method is the most common of all these. But, in case of windows method, a fabricator will have to be negotiable between one or two parameters.

So, optimization techniques gained a lot of interest of the candidate researchers to design the filter with appropriate design conditions such as evolutionary optimization techniques. Previously, the swarm-based optimization techniques and genetic algorithms (GA) were used to implement FIR filter design such as particle-based optimization (PSO). Various techniques in particular Parks–McClellan method, genetic algorithm (GA) [12, 13], particle swarm optimization (PSO) [12, 14, 15], differential evolution (DE) optimization [16,17,18], teaching–learning-based optimization (TLBO) [19,20,21] seemed to be exerted for the projection procedure of FIR filters. Yang proposed an innovative evolutionary optimization technique identified to be Bat algorithm [22]. Severino et al. designed a FIR filter by the usage of PSO and Bat techniques [23]. It is being used in almost every field such as optimization [22, 24], filter designing [23], image processing [25, 26], data mining, feature selection, fuzzy logic [27, 28], artificial neural networks [29, 30], and many more. SOA [31] mimes the doings of individual hunt populace to resolve actual optimization issues. It works on the basis of human searching to reach at the desired optimum solution. A group of humans known as population are taken. Each individual in this are known as seekers. Each seeker has its own center position, search radius, trust degree, and search direction according to which it updates its position. Seeker optimization finds its use in almost every field of study especially in engineering and technology and are successfully implemented in various problems such as in [32] SOA method has also been used for optimal reactive power dispatch problem. In [33], it has been used for designing IIR filter, and as per the literature review, it is not been used much for optimizing FIR filter parameters.

In the current paper, comparison is done between the seeker, Bat and PSO optimization algorithms to design the FIR filter. The simulation results based on this design are presented here. The article is organized as per the aforementioned manner. Module 1 presents the introduction. Module 2 describes the FIR filter model. In module 3, filter design using optimization technique is discussed. In module 4, outcome of the simulative environment is presented. Finally, module 5 concludes the paper.

2 Optimization Algorithms for FIR Filter

The major aim in the present study is to project an optimal digital FIR filter with better design considerations with the use of seeker optimization technique. The symmetrical nature of the coefficients requires only half of the coefficients to be optimized which are then combined to form N + 1 count of coefficients. Various parameters that are considered during the optimum filter designing are pass band and stop band frequencies (wp and ws), flat pass band, highest reject band attenuation, pass band and stop band ripples (\(\delta_p\) and \(\delta_s\)), and short transition width.

Error function/fitness function/objective function is the major parameter to be considered in all optimization algorithms. While designing the filter, coefficients are changing the values in a manner with the purpose of the minimization of error function. The Parks–McClellan algorithm uses the weighted approximate error for FIR filter design as presented in (1).

$$E\left( w \right) = M\left( w \right)\left[ {K\left( {w_k } \right) - K_i \left( {w_k } \right)} \right]$$
(1)

\(K\left( {w_k } \right)\) illustrates the frequency output of desired filter, and \(\left( {K_i \left( {w_k } \right)} \right)\) symbolizes the frequency output of actual filter. M (w) represents the weighting function. Fixed proportion of \(\delta_p /\delta_s\) is the key disadvantage of PM technique. An umpteen number of error equations have been and are being used in variant researches as given in [34,35,36]. The Lp standard approximation error is indicated as:

$${\text{Error}} = \left\{ {\mathop \sum \limits_{i = 0}^k \left[ {\left| {\left| {K_d \left( {w_k } \right)} \right| - \left| {K_i \left( {w_k } \right)} \right|} \right|} \right]^p } \right\}^\frac{1}{p}$$
(2)

Minimum value of the error equation will be interpreted as the optimum one. A new set of coefficients will be generated using the optimal value of fitness function. By individually specifying the required values for \(\delta_p\) and \(\delta_s\), flexibility in the error equation may further be improved by specifying the error equation as presented in [3]

$$J_1 = {}_{w \le w_p }^{\max } \left( {\left| {E\left( w \right)} \right| - \delta_p } \right) + {}_{w \ge w_s }^{\max } \left( {\left| {E\left( w \right)} \right| - \delta_s } \right)$$
(3)

2.1 PSO Algorithm

PSO algorithm is a swarm-dependent technique based upon the swarm of birds or school of fish that follow the path by learning from their fellow mates. Kennedy and Eberhart [14] established it in 1995. It has the advantage of not getting trapped in the local optimal solution but solves the problem at a global approach [15]. Every individual varies their parameters in accordance with the group of individuals (known as swarm), especially position which has two values—personal or local best (pbest) and group (global) best (gbest). Each particle modifies the location and velocity of its own in consonance with the following equations.

$${\text{Ve}}_j^{\left( {g + 1} \right)} = w* {\text{Ve}}_j^g + C_1 * r_1 *\left( {{\text{pbest}}_j^g - S_j^g } \right) + C_2 * r_2 *\left( {{\text{gbest}}^g - S_j^g } \right)$$
(4)

\({\text{Ve}}_j^g\) symbolizes the jth particle vectors velocity at gth iteration; w states weighting factor; C1 and C2 are the cognitive functions known as positive weighting functions; r1 and r2 represent the random values in within 0 and 1; \(S_j^g\) is the occurant position of jth particle vector h(n) at gth iteration; \({\text{pbest}}_j^g\) represents the local best of the jth particle at the gth iteration; \({\text{gbest}}^g\) represents the global best of the entire group at the gth iteration.

The position is updated in correspondence to the undermentioned equations:

$$X_j^{\left( {g + 1} \right)} = { }X_j^g + { }V_j^{\left( {g + 1} \right)}$$
(5)

2.2 Bat Optimization Algorithm

Bat optimization is a search algorithm depending upon the behavior of bats and their echolocation capability. It is proposed by Yang [22] and works according to the search behavior of bats for their food. It senses the distance using echolocation property and takes advantage of frequency equation. To utilize this algorithm for any optimization problem, initialized values for velocity, position, minimum frequency, wavelength, and loudness (speech intensity) values are set to find out the target.

Bat Motion and Variations of Loudness and Pulse Rates

Each bat has its initialized velocity vi, position pi, and pulse frequency qi in a solution space.

$$q_i = q_{\min } + \left( {q_{\max } - \, q_{\min } } \right)\beta$$
(6)

where qmax and qmin are maximal and minimal emission frequencies which are assigned a value uniformly. Initially, value of a frequency is haphazardly assigned for each bat and is drawn consistently from [qmax, qmin]. The values for the vector β ∈ [0, 1] are considered to be the random value taken from a uniform distribution.

The new velocity position \(v_i^t\) and position \(z_i^t\) of the bats are updated at every time step t in accordance with the velocity and position equations as follows:

$$v_i^t = \, v_i^{t - 1} + \, \left( {z_i^{t - 1} -- \, z*} \right)f$$
(7)

where z* states the present best position (result) globally that is taken after the comparison of the entire solutions of n count of bats.

$$z_i^t = \, z_i^{t - 1} + \, z_i^t$$
(8)

A fresh solution is bring forth locally for each bat utilizing arbitrary walk after the selection of a solution among the present best solutions.

$$z_{{\text{new}}} = \, z_{{\text{old}}} + \varepsilon L^t$$
(9)

where ε symbolizes random count selected within −1 and 1, i.e., ε ∈ [−1, 1]

$$L_i^{t + 1} = \, \alpha L_i^t$$
(10)
$$p_i^{t + 1} = \, p_i^0 \left[ {1 - \exp \left( { - \gamma t} \right)} \right]$$
(11)

assuming Li and pi as the loudness value and pulse rate and are needs to be updated in accordance with the proximity of the prey with an increase in the number of iterations. On reaching near the prey, the decrease in loudness value is seen, but on the contrary, the speed of emitted pulse rises. The values of loudness are specified as per the convenience of the problem to be solved; usually, Lo = 1 and Lmin = 0 are chosen for any problem where Lmin = 0 indicates that the search of a bat for its prey is successful and is currently not sending any pulses for further processing. α and γ are constant values, and generally, for almost all simulative analysis, these are taken to be equal, i.e., α = γ.

2.3 Seeker Optimization Algorithm

Seeker optimization (SOA) mimes the doings of individual hunt populace to resolve actual optimization problems. It works on the basis of human searching to reach at the desired optimum solution. A group of humans known as population are taken. Each individual in this are known as seekers. Each seeker has its own center position, search radius, trust degree, and search direction, and in accordance with these parameters, each seeker updates its position [31,32,33]. The final decision-making is done while considering these four parameters. Each seeker is initialized with a random value, and afterward, their positions are changed as per the following equation:

$$Z_{{\text{id}}} \left( {t + 1} \right) = Z_{{\text{id}}} \left( t \right) + \alpha_{{\text{id}}} \left( t \right)\beta_{{\text{id}}} \left( t \right)$$
(12)

where \(\alpha_{{\text{id}}} \left( t \right)\) and \(\beta_{{\text{id}}} \left( t \right)\) are the step length and search direction of the ith seeker and dth dimension or variable. \(\beta_{{\text{id}}}\) = 1 indicates that the ith seeker moves in the positive direction on the dimension, whereas \(\beta_{{\text{id}}}\) = −1 indicates its movement in negative direction and \(\beta_{{\text{id}}}\) = 0 shows that no movement of the ith seeker. Step length and search direction are updated at each iteration depending upon the following factors.

2.3.1 Filter Design Using Seeker Algorithm

For designing FIR filters, undermentioned steps are implemented:

  • Step 1: Determine the controlling parameters for FIR filter such as select band and reject band frequencies, order of filter, and select band and reject band ripples.

  • Step 2: Specify the parameters for seeker optimization such as maximum population number (np) of seeker strings, where each string has (N/2 + 1) count of filter coefficients, maximal count of loops, and initialization for the values for s number of seekers. Also, initialize the values of highest and lowest frequency and minimum and maximum value of membership degree value (µmin and µmax).

  • Step 3: Initialize the arrays for the position values.

  • Step 4: Calculate the fittingness value for any and all individuals.

  • Step 5: Upgrade the best suited location of all individuals and select adjacent individual of all seekers.

  • Step 6: Compute the hunt trajectory as well as step size for all seekers, after that amend the location of each seekers.

  • Step 7: Upgrade the location for all seekers and measure the fitness from these updated values. Update the new solutions otherwise repeat the process from step 4.

  • Step 8: Generate the filter coefficients using these updated solutions by selecting the best seeker among the entire group.

3 Results

In the current module, the outcome of the codes simulated on MATLAB environment for designing an optimal FIR filter of the all four kinds of filters is presented. Filter order is kept to be 40 after comparing the different orders for the same problem. The sampling frequency is equal to fs = 1 Hz, and count of frequency samples is 512. The required guidelines of the filter to be projected using optimization techniques are taken as: δp = 0.1, δs = 0.01. The codes of all the optimization techniques are run for 100 iterations to procure the optimal output, i.e., number of iterations considered for the optimization problem = 100. For low pass and high pass filter, cut off frequency (normalized) is taken as 0.7 and 0.3, respectively. For band pass and band stop filters, lowest and highest edge frequencies (normalized) are 0.3 and 0.7. Population size for this design procedure is taken as 20. For PSO optimization, personal learning and cognitive acceleration coefficient is considered to be equal to 2. Bat parameters are taken as: Loudness is 0.5; pulse rate is 0.5; minimum and maximum frequency is 0 and 2, respectively. In case of seeker, optimization parameters are as follows: minimum and maximum membership degree is given as 0.1 and 0.4; minimum and maximum frequency is 0.2 and 0.6, respectively.

Figures 1, 2, 3, and 4 compare the magnitude responses of actual filter and the filters projected with PSO, Bat, and seeker optimization algorithms for FIR—low pass, high pass, band pass and band select filters successively.

Fig. 1
figure 1

Comparison of actual filter and filter projected with PSO, Bat, and seeker algorithm for low pass filter

Fig. 2
figure 2

Comparison of actual filter and filter projected with PSO, Bat, and seeker algorithm for high pass filter

Fig. 3
figure 3

Comparison of actual filter and filter projected with PSO, Bat, and seeker algorithm for band pass filter

Fig. 4
figure 4

Comparison of actual filter and filter projected with PSO, Bat, and seeker algorithm for band stop filter

Figures 5, 6, 7, and 8 depict a comparison of convergence profile, i.e., the error function for FIR-LP, FIR-HP, FIR-BP, FIR-BS filters consecutively.

Fig. 5
figure 5

Evaluation of convergence profile for low pass filter using PSO, Bat, and seeker

Fig. 6
figure 6

Evaluation of convergence profile for high pass filter with PSO, Bat, and seeker

Fig. 7
figure 7

Evaluation of convergence profile for band select filter using PSO, Bat, and seeker

Fig. 8
figure 8

Evaluation of convergence profile for band reject filter using PSO, Bat, and seeker

Tables 1, 2, 3, and 4 successively present the various other comparative outcomes of performance parameters of all techniques for 40th order FIR—low pass, high pass, band select, and band reject filters. Almost lowest reject band obstacle and select band ripple is achieved for seeker optimization algorithm while designing all the kinds of filters. For low pass, high pass, select band, reject band filters seeker technique presents lowermost, or near to lowest reject band ripples of 0.002051, 0.00201, 0.003426, and 0.003353, respectively. Seeker design converges to the least value of error fitness value among all techniques. For low pass, high pass, band pass and band stop filter, it converges to min error count of −2.006 in 11, 7.18 in 57, 87.9 in 58 and 84.4 in 12 iterations. Thus, it performs best among all the design approaches discussed in this works

Table 1 Analysis of comparative variables for FIR-LP filter projected with various techniques
Table 2 Analysis of comparative variables for FIR-HP filter projected with various techniques
Table 3 Analysis of comparative variables for FIR-BP filter projected with various techniques
Table 4 Analysis of comparative variables for FIR-BS filter projected with various techniques

Statistical parameters of FIR filters obtained by the projection procedure for all the variant optimization algorithms are given in Tables 5, 6, 7, and 8 successively.

Table 5 Statistical data for FIR low pass filter with variant algorithms
Table 6 Statistical data for FIR high pass filter with variant algorithms
Table 7 Statistical data for FIR band pass filter with variant algorithms
Table 8 Statistical data for FIR band reject filter with variant algorithms

4 Conclusion

In the present article, the projection procedure of FIR digital filters is presented with the aim to diminish the error function by optimizing the variant filter parameters with the use of PSO, Bat, and seeker optimization techniques. The procedure runs for 100 iterations to minimize the error function by optimizing the filter coefficients. Different types of analysis are performed on the outcomes of the codes run on MATLAB environment such as statistical analysis, analysis of convergence profile and magnitude response analysis, and comparison of the variant parameters of filters, namely ripples, attenuation, and as forth. Comparison is performed between the PSO, Bat, and seeker optimization, and seeker optimization presents the best outcomes in terms of all the criterions.