Design and Optimization of Enhanced Magnitude and Phase Response IIR Full-Band Digital Differentiator and Integrator Using the Cuckoo Search Algorithm

Design of full-band infinite impulse response (IIR) digital differentiator (DD) and digital integrator (DI) based on the Lk-norm and the min-max optimality criteria have been demonstrated in literature. However, the designed IIR DDs and DIs using these criteria do not have linear phase or have unsatisfactory magnitude response. In this paper, a novel approach to design, optimize and improve the magnitude response and the linearity of the phase response of IIR DD and DI using the cuckoo search (CS) optimization algorithm is proposed. The proposed approach is based on a varied Lk-norm where $k$ linearly increases with the number of the frequency samples between the values 1 and 2. The design and optimization of DDs and DIs are carried out using the CS optimization method due to its simplicity, efficiency, and robustness in solving general multidimensional optimization problems. The performance of the designed DDs and DIs using the proposed approach is compared with designs based on different criteria and algorithms available in literature. The comparison shows that the designed DDs and DIs based on the proposed approach have better phase responses and better or at least comparable magnitude responses compared to those of DDs and DIs designed using other methods in the literature.


I. INTRODUCTION
Digital differentiator (DD) and digital integrator (DI) have been used in many engineering applications [1]- [5].
The frequency response of an ideal DD and ideal DI are given in (1) and (2), respectively.
H DD e jω = jω, |ω| < π (1) The parameter ω represents the angular frequency measured in radians per sample. The ideal DD and DI can be approximated as a finite impulse response (FIR) or an infinite impulse response (IIR) digital system. FIR digital system has attractive properties such as inherent stability and linear phase response. But FIR system usually has higher order compared The associate editor coordinating the review of this manuscript and approving it for publication was Khursheed Aurangzeb. to its IIR counterpart system, which makes IIR system more attractive for real time applications. However, IIR digital system does not have linear phase response. Furthermore, the stability requirement of any digital system makes the design of IIR digital system more difficult compared to FIR digital system. Thus, depending on the application, the required properties of the digital system normally drives the choice of the type of the digital system. Many analytical approaches to design DD and DI with some desired characteristics have been proposed and demonstrated in [1]- [16]. The use of evolutionary and swarm intelligence algorithms to design and optimize the performance of DDs and DIs has been reported in [17]- [26]. For examples, the design of DD and DI is demonstrated using genetic algorithm (GA) in [17], simulated annealing (SA), GA, and modified Fletcher and Powell (FP) optimization in [18], particle swarm optimization (PSO) in [19]. The design of FIR fractional order differentiator using cuckoo search algorithm is presented in [20]. The use of harmony search (HS) algorithm and bat algorithm (BA) to design DDs and DIs is reported in [21] and [22], respectively. In [23], the hybrid flower pollination algorithm (HFPA) is used to design wideband DDs and DIs. Design of FIR DD based on the L1 optimality criterion using the BA and the PSO is demonstrated in [24]. Wideband IIR DD and DI are designed using the salp swarm algorithm (SSA) in [25], [26]. In addition, the design of low pass DD has been considered in [16], [27]- [36].
The designed IIR DDs and DIs in [17]- [19], [21]- [23], [25], [26] do not have linear phase over the entire frequency band and their magnitude response can be further optimized to improve the overall performance.
The main purpose of this paper is to report a new approach and extend our work in [48]- [52] and explore the performance of the CS algorithm in the design and optimization of IIR DDs and DIs in comparison with other methods. The use of the CS algorithm to optimize the design of the IIR DD and DI is driven by our previous personal experience in using the CS in solving antenna array design problems [48]- [52] and the attractive properties such as its simplicity, efficiency, and robustness in solving general multidimensional optimization problems.
In this paper, the performance of the designed DD and DI is improved by introducing a new objective function combined with using the powerful CS algorithm to search for the DD and DI parameters that result in the optimal design. The objective function used in this work is based on a varying L k -norm, where k is linearly varied with frequency between the values 1 and 2. It is found that increasing k with frequency helps in getting more linear phase response. To verify the usefulness and the validity of the current approach, we design second, third and fourth order IIR DDs and DIs and compare our results with designs achieved using other techniques available in the literature. The comparison shows that the designed DDs and DIs based on the proposed approach have better phase response and better or at least comparable magnitude response compared with DDs and DIs designed using other methods and algorithms.
The rest of this paper is organized as follows. In Section 2, the formulation of the DD and DI filter design problem as an optimization problem is presented. Section 3 briefly describes the CS algorithm and its implementation to solve the design problem. Numerical examples and discussion are given in Section 4. Finally, the conclusion of this paper is given in Section 5

II. PROBLEM FORMULATION
In this section, the design of IIR DD and DI is formulated as an optimization problem. Starting with the general frequency response of an N th order IIR system given in (3), the design of DD and DI is completed by finding the coefficients (b i , a i , 0 ≤ i ≤ N ) in equation (3) to approximate the magnitude of the frequency response in equations (1) and (2), respectively. Therefore, the DD and DI design problem can be typically formulated as an optimization problem with a suitable objective function based on the magnitude response of the ideal DD and DI.
Combining both the phase response and the magnitude response in the objective function was reported in [17], [33], [34]. The use of this approach does not significantly improve the overall performance of the designed DD and DI. Furthermore, most objective functions formulated in the literature for the design of DD and DI are related to the magnitude response of the ideal DD and DI and are based on the L k -norm with values of k = 1 or k = 2. Therefore, in this work, we propose a new objective function based only on the magnitude response to improve both the magnitude and phase responses of the designed DD and DI. Most formulated objective functions reported in literature can be expressed as a function of the absolute magnitude error (AME) defined in (4). The AME is the absolute difference between the magnitude responses of the ideal DD ( H DD e jω ) or the ideal DI ( H DI e jω ) and the approximate ( H e jω ) DD or DI evaluated at L uniformly distributed samples in the frequency interval 0 ≤ ω ≤ π Usually, L = 512 is used in such applications.
The designed IIR DD and DI with objective functions based on the L k -norm with values of k = 1 or k = 2 results in a non-linear phase response and or not good enough magnitude response which could add distortion or reduce the quality of the processed signal by the DD or DI. In addition, some methods in literature [18], [22] obtain the design of DI by just inverting the transfer function of the optimized DD which most probably does not guarantee optimum design for the DI and could lead to unstable DI. Therefore, there is a need for an IIR DD and DI with better phase and magnitude responses.
The main contribution of this paper is introducing a new objective function that improves the linearity of the phase response and the magnitude response of the designed IIR DD and DI. The proposed objective function is based on a varied L k -norm as given in (5).
Here, the value of the power k of the AME is changed linearly with the frequency sample number between 1 and 2 according to: where s represents the sample number and L is the total number of samples (in this work, L = 512). Therefore, the first frequency sample of the AME (at ω = 0) is raised to power 1 and the last frequency sample of the AME (at = π) is raised to power 2. Increasing k in this manner implicitly puts more emphasis on the AME as the frequency increases to reduce the possibility of improper processing of the input signal by the designed DD or DI which is frequency dependent as ideally described in (1) and (2). It is worth mentioning that we have tried changing the value of k in an exponential and quadratic form but no significant improvement has been noticed. Therefore, we adopted this simple linear form as described above. Our future research will be directed towards finding analytical relationship between the effect of changing k and the linearity of the phase response.
In literature, different objective (fitness) functions have been proposed to design DDs. For example, in [19], the objective function is formulated as: and in [21], the objective function is formulated as: Then one of the optimization algorithms such as the GA, SA, FP and HS was used to find the best coefficients (b i , a i , 0 ≤ i ≤ N ) of the approximate frequency response H e jω . In this work, the CS algorithm is used to find the coefficients of the approximate frequency response that give the best minimum value of the proposed formulated objective function in (5). During the search run by the CS algorithm to find the coefficients that minimize the objective function, stability of the DD and DI is also considered. For this purpose, all poles should be inside the unit circle (i.e., |d i | < 1, where d i , 1 ≤ i ≤ N , are the poles of the system). Therefore, a penalty value, P is used in the objective function in (5) to guarantee the stability of the designed IIR DD and DI). In this work, a value of P = 1000 is used whenever any of the poles is outside the unit circle, otherwise P = 0.

III. THE CUCKOO SEARCH ALGORITHM
The CS algorithm is a metaheuristic global optimization method developed by Yang and Deb in 2009 [37] that is based on the breeding behavior of some cuckoo species that lay their own eggs in the nests of other host birds. If the hosting bird discovers an alien egg (with a probability of p a ), it will either throw the egg out or simply abandon the nest. This means that the number of nests will degrade with generations, therefore, it is assumed that the hosting bird that abandoned his nest will build a new nest in a new location, and thus, keeping number of nests fixed with generations and adding diversity to the CS algorithm by the new nest location (solution searching area). We should mention here that this paper is not intended to be an exhaustive review of the CS algorithm; more details about the CS algorithm can be found in [37]- [62]. An important step in the CS algorithm is the development of a suitable objective (fitness or cost) function for the optimization problem. The fitness function can be single-objective or multi-objective, and can be constrained or unconstrained, depending on the optimization problem at hand. Previously in [48]- [51], we studied the performance of the CS algorithm in the design of Linear, Elliptical, and Circular Antenna Arrays (LAAs, EAAs, and CAAs) where therein we showed the excellent performance of the CS algorithm in comparison to other optimization methods applied to the same problems. Driven by this performance, we utilized the CS algorithm in the design and optimization of IIR DDs.
The CS algorithm starts at iteration t = 0 by placing the nest population randomly in the search space. Afterwards, the nest locations (which represent potential solutions to the optimization problem) are updated with time iterations t > 0 using: where X t stands for the nest location (potential solution) in the current iteration, S t is the step size of the random walk, and α > 0 is a scaling factor typically between 0.001 and 0.01, depending on the largest value of the optimization parameters in the solution space. In [37]- [39], it is suggested that the search capability of the CS algorithm is enhanced if the random walk is implemented using a step size S t drawn from a L'evy distribution. The CS algorithm is used to search for the system coefficients (b i , a i , 0 ≤ i ≤ N ) of the IIR system that result in the best value of the objective function in equation (5). The dimension of the optimization problem, M , is the number of the system coefficients (b i , a i , 0 ≤ i ≤ N ) which is given by M = 2N + 2 where N is the system's order. Each nest location in the M -dimensional space represents a candidate solution for the IIR DD design problem.
The main steps in our implementation of the CS algorithm are summarized as follows: Step 1: The objective function is defined and a population of K candidate solutions (randomly initialized) is produced. The population size K is fixed throughout the algorithm.
Step 2: The objective function is evaluated for all candidate solutions in the current population, and the solutions are ranked.
Step 3: A fraction (p a ) of low rank solutions (nest locations) are abandoned and new solutions (nest locations) are randomly generated in the solution space. The solutions are ranked again.
Step 4: A new population is produced by applying the update equation (6).   Step 5: The termination criterion is checked and if it is not met, then repeat from step 2. Here, a maximum number of iterations is used as the termination criterion.
We used the parameters shown in Table 1 for the implementation of the CS algorithm on MATLAB TM [63] using a system with Intel I Core I i7, CPU with 2.67 GHz and 4 GB of RAM.

IV. DESIGN EXAMPLES AND DISCUSSION
In this section, we present the results of sample design examples of second, third and fourth order IIR DDs and DIs using the CS algorithm based on the proposed new VOLUME 10, 2022   objective function. To validate the proposed approach, we compare the performance of the designed DDs and DIs with designs of DDs and DIs in the published literature using other techniques and algorithms. Specifically, we compared with SA (simulated annealing) [18],   GA (genetic algorithm) [18], FP (Fletcher and Powell) [18], PSO (particle swarm optimization) [19], HS (harmony search) [21], BA (bat algorithm) [22], HFPA (hybrid flower pollination algorithm) [23] and SSA (salp swarm algorithm) [26]. The comparison is made based on the magnitude   response and the phase response of the designed DDs and DIs. For the magnitude response, the AME mean value and the squared AME mean are considered for comparison purposes. On the other hand, for the phase response, the average group delay value is used as a measure of the linearity of the phase response of the designed DDs and DIs.

A. DIGITAL DIFFERENTIATOR DESIGN EXAMPLES
The quantitative comparison of the magnitude and phase responses of designed DDs is given in Table 2. We see that the   CS-designed IIR DDs have achieved the lowest mean group delay for all orders. For the second and third order DDs, the CS-designed DDs have achieved the minimum squared AME  mean value. In addition, the mean of the AME achieved of the IIR DDs designed using the proposed approach is very close to the best value achieved by other methods for all orders. The coefficients of the designed IIR DDs using different methods are given in Table 3. Figures 1through 3 show the magnitude response of IIR DDs designed based on the proposed approach and that of other methods. Figures 4 through 6 show the AME comparison. As can be seen, the second order designed IIR DD based on the proposed approach has less AME than that of DDs designed using GA [18], PSO [19], HS [21], BA [22], HFPA [23] and approximately similar AME to that of DDs designed using the SA [18], FP [18]    and SSA [26]. For the third order, the designed IIR DD based on the proposed approach has less AME than that of DDs designed using the SA [18], FP [18], GA [18], HS [21], and HFPA [23] but similar AME to that of DD designed using the SSA [26]. And finally, the fourth order IIR DD designed based on the proposed approach has less AME than that of the DDs designed using the SA [18], GA [18], FP [18], PSO [19], HS [21], BA [22], HFPA [23] and similar AME to that of the DD designed using the SSA [26]. Figures 7 through 9 show that the phase response of the designed IIR DDs based on the proposed approach is very close to linear for the entire frequency range. On the other hand, the phase response is nonlinear especially at low frequencies for the DDs designed using the PSO [19], HS [21], the BA [22] and HFPA [23]. More clear comparison of the linearity of the phase response is shown by the group delay in Figures 10, 11, and 12. It can be seen that the linearity of the phase response of the IIR DDs designed using the proposed approach is better compared to that of IIR DDs using PSO [19], HS [21], BA [22] and the HFPA [23] and is similar to that of IIR DDs designed using the SA [18], FP [18] and SSA [26].    delay and the minimum mean of the squared AME for all orders. In addition, the second and third order DIs CS-designs achieved the minimum AME mean value. It can be also noticed that the fourth order DI designed using the BA [22] achieved the lowest AME mean value but at the expense of  very poor phase performance with a value of 3.48 samples for the average group delay. On the other hand, the fourth order DI designed using the CS has a satisfactory AME mean value and an excellent average group delay. The coefficients of the designed IIR DIs using the CS are given in Table 5. The magnitude response and the AME comparisons for the designed DIs are shown in Figures 13 through 18. It can be noticed that the designed IIR DIs based on the proposed approach has less AME than that of DIs designed using other methods for all orders. We also clearly see that the CS-designed DIs have much better (much less) AME value in the normalized frequency range of 0 ≤ ω ≤ 0.5π. The phase response of the designed DIs is shown in Figures 19, 20 and 21. It can be seen that the CS-designed DIs have better phase response linearity than that of DIs designed using the PSO [19], HS [21] and BA [22] but similar to that of DIs designed using SA [18]. However, the magnitude response of the CS-designed DIs is much better than that of DIs designed using the SA [18]. Finally, the group delay of the CS-designed DIs is shown in Figures 22 through 24 which demonstrate an excellent linear phase response for most of the frequency range.

V. CONCLUSION
A novel approach to optimize both the magnitude and phase responses of IIR DDs and DIs is proposed. The powerful CS algorithm is successfully applied to find the parameters of the optimal design of IIR full-band DDs and DIs. It is shown that the designed DDs and DIs using the proposed approach have better (more linear) phase response and satisfactory magnitude response compared to other methods. Specifically, the CS-designed DDs and DIs outperformed most of the designed DDs using other methods in literature in terms of the mean absolute group delay and the mean of the squared absolute magnitude error. Once again, the CS algorithm proved to be a powerful optimization tool that can handle sophisticated design problems. Finally, the proposed approach can be easily extended to design various types of digital filters.