1 Introduction

Digital filters are extensively accepted in many applications due to their superior performance, less area requirement during implementation, ease in implementation with adaptive programmability and exact reproduction capability. In past few decades extensive research is reported by practitioners in the area of designing and implementation of digital differentiator and integrator, due to their applications in various fields like signal processing for linear and nonlinear system identification [18, 35], digital image processing to extract edges in an image [25, 26, 32], biomedical signal processing to detect R-peaks in electrocardiogram (ECG) signal [19,20,21], control engineering for disturbance rejection [13], radar to measure position and acceleration [29] and many more. The main function of the differentiator is to determine the time derivative of a signal to extract information regarding rapid transients. For differentiator applications in real time and their practical implementation, it is desirable that they have a wide band frequency response and minimum group delay with low order to save hardware cost. Digital differentiators are mainly of two types FIR and IIR and further FIR differentiators can be either type III or type IV. Type III are antisymmetric having odd length impulse response while type IV are symmetric with even length response. Type IV are considered better because their frequency response is defined over full range of frequency and meet design requirement well compare to type III [34]. Differentiators act like high pass filter, their magnitude response amplifies high frequency component present in input signal. Approximation and interpolation-based methods are the two conventional approaches to design 1-D and 2-D integrator and differentiators. Taylor series approximation [17] have been used for differentiator design, and it approaches the ideal frequency response closely but with increased filter order. Tseng et al. [36, 37] designed 2-D digital filter and considered 16 type of cases as per symmetry and anti-symmetry in both directions as per the length of filter, used fractional derivative constraint and gradient search optimization. This technique used Lagrange multiplier and least square method to determine odd symmetric filter coefficients. They also proposed an idea of using hyperbolic sine and cosine functions to design digital log differentiator, with an advantage of less storage space requirement for storing filter coefficients than traditional approaches. Still there were challenges in approximating the ideal frequency response of the differentiator as close as possible.

Many real time problems are solved by natures inspired meta-heuristic optimization algorithms [10, 14, 15, 24, 41,42,43,44] published in last two decades. Initially wide research was done in designing 1-D digital differentiator and integrators [6, 11] later shifted to the designing and implementation of 2-dimensional systems. Upadhyay et al. [38] designed recursive wideband differentiator and integrator by optimizing the location of poles and zeroes. Kumar et al. [22, 23] in 2014 designed fractional order differentiator using radial basis function and window to truncate coefficients to approximate the fractional order derivative for a digital signal. Error fitness function was reduced with improved frequency response characteristics. Interior search algorithm was also proposed with integral square error fitness function to design digital differentiator with only one control parameter and higher convergence rate was achieved. Yadav et al. [12] used particle swarm optimization (PSO), genetic algorithm (GA) and hybrid PSO-GA optimization to design fractional order differentiator by reducing error fitness function amplitude. In 2016 Aggarwal et al. [1, 3,4,5] designed 2-D digital differentiator using cuckoo search algorithm and L1 error fitness function with quadrantally odd symmetric properties and further also used fractional derivative constraint to design optimal 2-D FIR filter. Chang [7] implemented the design of 2-D fractional differentiator using differential evolution algorithm with an excellent searching ability. Wulf et al. [39] designed efficient low pass FIR differentiator suitable for biomedical signal processing with reduced filter order using Fourier series of triangular function. Mahata et al. [27, 28] implemented the design of wideband digital FIR differentiator and integrator using Harmony search algorithm and later also applied hybrid flower pollination algorithm and particle swarm optimization to design digital wide band differentiator and integrator. It improved the quality of solution, convergence rate and reduce the time to optimize the system. Mohan et al. [30] designed fractional digital differentiator with hybrid shuffled frog leaping algorithm and the proposed technique efficiently removed the noise from ECG signal with good stability and convergence speed. Suman Yadav et al. [40] proposed vortex search optimization to design 2-D FIR filters and reduced error fitness function value and execution time to optimize the filter. Aggarwal et al. [2] utilized hybrid combination of Bat algorithm and Particle Swarm optimization algorithm to design 5th-, 7th- and 11th-order FIR differentiator using the L1-method and contributed superior simulation results in contrast with traditional approaches of designing digital differentiator.

These meta-heuristic techniques as discussed above have drawbacks such as premature convergence, requires a lot of parameter to be tuned with complex nature, higher execution time and not able to achieve global optimum solution due to stagnation in local optima. So, to overcome the above disadvantages, proposed research designed digital differentiator that employ vortex search optimization (VSO) [8, 31]. Its capability to solve these critical problems depends on its searching behaviour that includes an exclusive step size adjustment strategy which helps it to maintain effective balance in exploration and exploitation.

VSO is based on vortical flow of stirred fluid, excellent in exploration and exploitation of the search space. The unique technique of step size adjustment strategy helps it to reach a global optimum solution without stucking in multiple local optimal solution with least execution time. This algorithm has been also used for the optimization of analog filter group delay, in wireless sensor network by deploying the sensor nodes in their best optimal position and for optimization of the fore part of KCS container ship [9, 16, 33]. In these problems, it outperforms the other algorithm such as Particle swarm optimization, artificial bee colony and harmony search algorithms. It do not require a lot of parameters except the number of iteration, number of candidate solution and the upper and lower limit of the problem identified. Filter coefficients are optimized by going through various trials by setting different values of control parameters. To prove its superiority, it has been compared with various other optimization techniques such as cuckoo search optimization, particle swarm optimization and genetic algorithm and offer these advantages as mentioned below:

  • VSO algorithm provides least overshoot at the edges in frequency response.

  • Lower execution time in obtaining global optimum solution.

  • Least magnitude error with sharp transition from pass band to stop band.

  • VSO is simple to implement, computationally efficient as compare to population based optimization hence it is a good choice for the real time life problems.

In this paper a digital differentiator of order 14*14 is designed using optimization algorithms VSO, by evaluating the impulse response of 2-D digital differentiator in such a way that it approximates the ideal magnitude response of 2-D digital differentiator as much as possible. Its simulation results that includes magnitude and phase response are compared to cuckoo search (CS) algorithm, particle swarm optimization (PSO) and real coded genetic algorithm (RCGA) over full frequency bands. It is observed from the experimental result that the VSO based 2-D differentiator results in least magnitude error and execution time compared to other techniques.

Rest of the paper is organized as follows: Section 2 describes vortex search optimization algorithm, its mathematical equations and strategy followed to avoid local optimal solution. It also includes the design formulation of 2-D FIR differentiator. Section 3 includes results simulation and analysis. Section 4 concludes the paper and section 5 presents references.

2 Vortex search algorithm

Vortex search optimization technique is recently proposed meta-heuristic algorithm and based on vortical flow of stirred fluids. For a 2-D optimization problem, a vortex pattern can be created using a number of nested circles with reduced radius. Every possible solution to the problem is said to be individual solution whereas combination of solutions is termed as population. To achieve the global optimum output, solutions are updated in every iteration. To design 2-D differentiator, system coefficients are assumed to be candidate solution Cs in algorithm, best differentiator coefficients are the optimized candidate solution with minimum error fitness function. Flow chart to design a FIR 2-D digital differentiator based on VSO is given in Fig. 1.

Fig. 1
figure 1

Searching pattern of vortex search algorithm [8]

2.1 Mathematical description of VSO algorithm

  1. Step 1.

    Outer most circle of the vortex is centered in the search space with an initial centre and radius defined below in Eqs. (1) and (2):

$$ initial\ centre\ \left(\mu \right)=\frac{uppe{r}_{limit}+ lowe{r}_{limit}}{2} $$
(1)
$$ initial\ radius\ \left(\sigma \right)=\frac{uppe{r}_{limit}- lowe{r}_{limit}}{2} $$
(2)

upperlimit, lowerlimit are the limits of solutions within range [−1 1] in two dimensional space. Outer circle is centered in such a way so as to maximize the coverage of search space with initial radius (σ) and initial centre (μ)

  1. Step 2.

    All the candidate solutions are distributed in two-dimensional search space of the vortex using Gaussian distribution function.

  2. Step 3.

    Candidate solutions are not allowed to move outside the range specified in step 1. Error fitness value is computed for each candidate solution. A solution with least error fitness function value is selected and taken as best solution.

  3. Step 4.

    Best solution from previous step is taken as the centre to create second vortex and its radius will be reduced using inverse incomplete gamma function in Eq. (3) given below:

$$ {r}_t={r}_0.\frac{1}{x}. gammaincinv\left(x,{b}_t\right) $$
(3)
$$ \gamma \left(x,b\right)={\int}_0^x{e}^{-t}\ {t}^{b-1}\ dt\kern1em b>0 $$
(4)

Here x = 0.1, [0 1]. The parameter b of the VSO algorithm in Eq. (4) determines the resolution of the search space, its value can be equally sampled within the defined range and therefore resolution can be adjusted. At each iteration the value of b can be taken as:

$$ {b}_t={b}_0-\frac{t}{\mathit{\operatorname{Max}}\ Iteration} $$

b0 = 1 to ensure the coverage of the search space, t is the current iteration and Max Iteration are the total number of iteration taken.

  1. Step 5.

    Now the process is again repeated to introduce candidate solution in this second next inner vortex circle. Best candidate solution is selected with minimum error fitness function, which replaces the current best solution taken as the centre of next circle with reduced radius and this process comes to an end in two cases either the searching criteria is fulfilled or the maximum number of iterations N is over.

  2. Step 6.

    Radius reducing process is known as step size adjustment technique. It initiates with exploration and then transforms into exploitation. As value of radius decreases in each step, it needs to be tuned to the searching style.

  3. Step 7.

    Optimum solution provided by VSO is the centre of innermost circle with minimum radius shown in Fig. 1.

2.2 Two-dimensional fir differentiator design

2.2.1 Frequency response of 2-D digtal differentiator

Linear phase FIR differentiator transfer function is given by:

$$ A\left({z}_1,{z}_2\right)={z}_1^{-{L}_1}\ {z}_2^{-{L}_2}\ {\sum}_{l_1=-{L}_1}^{L_1}{\sum}_{l_2=-{L}_2}^{L_2}a\left({l}_1,{l}_2\right){z}_1^{-{l}_1}\ {z}_2^{-{l}_2} $$
(5)

A(z1, z2) defines the transfer function of a two-dimensional linear phase FIR system in Eq. (5). L1 and L2 are the length in both the directions. a(l1, l2) is a matrix that represents the impulse response of the system. The objective is to determine the value of a(l1, l2) and approximating the ideal magnitude response of the designed FIR system. Whereas \( {z}_1={e}^{j{\omega}_1} \), \( {z}_2={e}^{j{\omega}_2} \) and ω1, ω2 are the frequency in both the directions.

$$ -\pi \le {\omega}_1,{\omega}_2\le \pi $$

Impulse response needs to follow certain condition to be quadrantally odd symmetric [39] given below in Eq. (6).

$$ a\left({l}_1,{l}_2\right)=-a\left(-{l}_1,{l}_2\right)=-a\left({l}_1,-{l}_2\right)=a\left(-{l}_1,-{l}_2\right) $$
(6)

The impulse response defined in Eq. (1) is a matrix of order (2L1 + 1) × (2L2 + 1) with a condition in Eq. (7)

$$ a\left({l}_1,0\right)=0;a\left(0,{l}_2\right)=0 $$
(7)

Frequency response of 2-D FIR differentiator is given by Eq. (8):

$$ A\left({e}^{j{\omega}_1},{e}^{j{\omega}_2}\right)={e}^{-j{\omega}_1{L}_1}{e}^{-j{\omega}_1{L}_2}{(j)}^2\hat{A}\left({\omega}_1,{\omega}_2\right) $$
(8)

\( \hat{A}\left({\omega}_1,{\omega}_2\right) \) is the amplitude response given by Eq. (9)

$$ {\displaystyle \begin{array}{c}\hat{A}\left({\omega}_1,{\omega}_2\right)={\sum}_{l_1=-{L}_1}^{L_1}{\sum}_{l_2=-{L}_2}^{L_2}b\left({l}_1,{l}_2\right)\sin {l}_1{\omega}_1\sin {l}_2{\omega}_2\\ {}b\left({l}_1,{l}_2\right)=4a\left({l}_1,{l}_2\right)\end{array}} $$
(9)

Frequency response of Ideal 2-D digital differentiator having linear phase represented in Eq. (10):

$$ {\displaystyle \begin{array}{c}P\left({e}^{j{\omega}_1},{e}^{j{\omega}_2}\right)={(j)}^2{\omega}_1,{\omega}_2\\ {}-\pi \le {\omega}_1,{\omega}_2\le \pi \end{array}} $$
(10)

2-D FIR differentiator designing is considered to be an optimization problem. In computing coefficients a, such that difference between the \( \hat{A}\left({\omega}_1,{\omega}_2\right) \) and the ideal response P(ω1, ω2) is minimized using optimization. Finite impulse response of 2-D digital differentiator follows anti-symmetric property.

The error fitness function is defined as:

$$ \overset{\sim }{E}=\sum \limits_{\omega_1}{\sum}_{\omega_2}\left|\hat{A}\left({\omega}_1,{\omega}_2\right)-P\left({\omega}_1,{\omega}_2\right)\right| $$
(11)

Here, L1 error fitness function is selected instead of least square and minimax to design the 2-D differentiator as it gives a flat response in pass band and stop band of magnitude response. Also it yields minimum overshoot at the band edges with sharp transition. Eq (11) represents the absolute difference between the magnitude response of designed and the ideal differentiator. As the value of error reduces, more the frequency response of the system approaches the ideal response.

2.3 Methodology to design 2-d differentiator using VSO

2.3.1 Steps to design 2-D differentiator using employed algorithm

  1. Step 1.

    Set the initial value of center and radius of outermost vortex as μ and σ.

  2. Step 2.

    Randomly generate candidate solutions as Cs, initialize maximum number of iterations N, dimension of differentiator coefficient matrix as (2L1 + 1) × (2L2 + 1) . Each candidate solution represents a matrix having dimension of differentiator coefficients.

  3. Step 3.

    Create a vortex over search space and candidate solutions are randomly distributed over this vortex using gaussian distribution.

  4. Step 4.

    Evaluate error fitness function in Eq. (11) for each candidate solution. Select the candidate solution with minimum error fitness value. Draw the next circle with this candidate solution as the center and radius is reduced inverse incomplete gamma function as in Eq. (3).

  5. Step 5.

    Repeat step 3 and 4 till a candidate solution is obtained with minimum fitness function value, or the maximum number of iterations is over.

  6. Step 6.

    This particular candidate solution with minimum fitness function value represents the optimal 2-D differentiator coefficient.

3 Results and simulations

In this section simulated results are presented and analyzed to design a two-dimensional differentiator based on VSO as shown in Fig. 2 and same are compared with recently published algorithms such as CSA, PSO and RCGA. In order to keep fairness in comparison, common parameters for all the algorithms are taken same such as number of iteration, lower and upper limit of the solution coefficients, order of the filter and the range of frequency. Solution is taken after a minimum fitness value is achieved The range for the 2-D frequency components ω1, ω2 lies between [−π, π]. VSO requires least numbers of parameters to be controlled or tuned as given in Table 1. The upper and lower limits for the differentiator coefficients are taken as −1 and 1 and length of coefficient matrix is taken as 15 × 15. The magnitude and phase response for the ideal differentiator is depicted in Figs. 3 and 4. For an ideal differentiator, frequency response is directly proportional to the frequency, while the phase response is constant for all the frequency as shown in Fig. 4. Number of possible solutions are taken as 55, its value is different for all algorithms to which VSO is compared. Parameters need to be tuned to get global optimized solution, selected after many trials by making variation in their magnitude but within specified limits, are mentioned in Table 1. There is no method available in literature to choose exact parameters value, their value can vary with different set of problem.

Fig. 2
figure 2

Flow chart for 2-D differentiator design based on VSO

Table 1 Controlling parameters defined for various algorithm
Fig. 3
figure 3

Magnitude response of 2-D Ideal digital FIR differentiator

Fig. 4
figure 4

Phase response of 2-D Ideal digital FIR differentiator

Optimized coefficients are determined using VSO algorithm is reported in Table 2, on the basis of these coefficients, magnitude response and phase response obtained for 2-D differentiator is shown in Figs. 5 and 6, respectively. These simulations are done using MATLAB with Intel core i5 7th Generation, 2.70 Ghz, 8GB RAM. The purpose is to get a matrix of order (2L1 + 1) × (2L2 + 1) having quadrantally odd symmetric coefficients to design a linear phase FIR 2-D differentiator. The optimized coefficients of the matrix depend on the exploration and exploitation ability in the search space, as well as parameters selected for optimization technique. To compare the results obtained, three more optimization algorithms are used such as CSA, PSO and RCGA.

Table 2 Optimized Coefficient 2-D FIR DD with order 15 × 15
Fig. 5
figure 5

Magnitude Response of 2-D FIR differentiator designed based on VSO

Fig. 6
figure 6

Phase response of 2-D FIR differentiator designed based on VSO

Due to linear phase characteristics of the FIR differentiator, it provides the constant delay to the input signal that is best suitable for the real time application.

Figure 7 represents the magnitude response of the digital 2-D differentiators obtained using CSA. CSA is based on the parasitic behaviour of cuckoo birds which lay their eggs in host bird nest. It uses the levy flight concept to enhance its searching ability with random walk to attain global optimum solution.

Fig. 7
figure 7

Magnitude Response of 2-D FIR differentiator designed based on CSA [5]

Figure 8 shows the frequency response of 2-D digital FIR differentiator obtained using PSO. PSO basically works by moving candidate solutions (particles) in search space guided by simple mathematical formulas. Initially it has its own best position and velocity of the swarm. Particles are iteratively updated toward better positiontill they attain a global solution.

Fig. 8
figure 8

Magnitude Response of 2-D FIR differentiator designed based on PSO [5]

Magnitude response of 2-D differentiator shown in Fig. 9 is obtained using RCGA. RCGA implements selection, crossover and mutation operators in series framework. It follows survival to the fittest and achieve optimal solution. Analysis of the result for all the algorithms obtained from their magnitude response is further divided in to two parts:

  1. 1.

    Comparison with the existing methods

  2. 2.

    Execution Time

Fig. 9
figure 9

Magnitude Response of 2-D FIR differentiator designed based on RCGA [5]

It is clear from the Table 3. that VSO based designed 2-D digital FIR 2-D differentiator has got least magnitude error, that is 0.1456 which approximates the ideal magnitude response of ideal 2-D digital differentiator in an efficient manner as compare to CSA, PSO and RCGA algorithms. It can be seen that CSA has magnitude error 0.1678, PSO got 0.9561 and RCGA has 1.3169. VSO is superior to other algorithms in terms of mean of the absolute error for all iterations. It has got least value which is a desirable characteristic for designing. VSO converges to a lower value of magnitude error as compare to other algorithms. Performance depends on the accuracy of the selection of initial parameters for all techniques.

Table 3 Statistical analysis of 2-D digital differentiator design

The value of mean absolute error and standard deviation are finalized after taking 100 simulation trials. It can be clearly concluded that VSO has got least mean absolute error 1.3612, whereas CSA has been reported with 1.7238, PSO based 2-D differentiator has 2.2148 and RCGA got 2.7625. The inference is that employed algorithm yields the best result.

From Table 4, it can be depicted that time taken to execute the code or to attain the optimized coefficients for designing is minimum for VSO. This proves its fast convergence speed with excellent exploration and exploitation searching ability. Time taken to execute the code for VSO based differentiator is 19.85, whereas for CSA it is 24.44, PSO 28.54 and RCGA 35.76. The lesser time taken by VSO to run the code also proves that it requires less number of calculations to be performed. Hence it is computationally efficient. So, it can be concluded that VSO is preferable choice to design 2-D digital differentiator.

Table 4 Execution time for different design techniques

3.1 Average error rate

It is defined as the sum of difference between optimal value at particular instance and the average of optimal values obtained for all iterations as in Eq. (12).

$$ Error\ rate=\sum \limits_{i=1}^n\frac{optimal\ fitness\ value(i)- average\ fittness\ value}{optimal\ fitness\ value(i)} $$
(12)

Here n is the total number of iteration. It is measured for VSO algorithm in designing 2-D differentiator, its value is 0.0040. Average error rate is very low for this algorithm. Hence it proves to be an efficient technique.

4 Conclusion

This paper proposed a FIR 2D digital differentiator design methodology, an approach based on vortex search optimization (VSO) algorithm. The proposed FIR 2D digital differentiator design method effectively employ the quadrantally odd symmetric properties of the differentiator response. L1 error objective function is articulated to solve the FIR 2D digital differentiator design problem. The VSO based design is turn out as simple to implement to achieve the desired differentiator design specifications due to a smaller number of parameters tuning. Furthermore, the performance of the proposed FIR 2D digital differentiator is compared to cuckoo search algorithm (CSA), particle swarm optimization (PSO) and real coded genetic algorithm (RCGA) methodology. As a result, this approach design 2D digital differentiator with better quality of coefficients, exploration strategy and execution time than the other reported methods. In future the same algorithm can be used to design 2-D Hilbert transformer.