Unified Filter Order Estimate for Minimax-Designed Linear-Phase FIR Wideband and Lowpass Digital Differentiators

Digital differentiators enable the computation of the derivative of a continuous-time signal at discrete time instances, and they are used in many signal processing applications. This paper derives a unified filter order estimate for digital differentiators that are realized with linear-phase finite-length impulse response filters and designed in the minimax sense. The estimate is useful at the high-level system design when assessing the implementation complexity and it enables fewer designs when finding the minimal filter order required to satisfy a prescribed tolerable approximation error. The proposed unified estimate covers both wideband and lowpass differentiators of integer degrees up to ten. Furthermore, degree-individual filter order estimates are derived which improve and extend previous results. The performance of both the unified and degree-individual order estimates is evaluated through simulation examples and compared with previous estimates.


Introduction
The design of digital differentiators is of importance as various degrees of signal derivatives are required in many mixed/digital signal systems, such as control systems, biomedical engineering, radar systems, as well as other signal/image processing systems [1,5,6,14,17,19,23,28,38]. In, for example, Farrow structure-based fractional-delay filters, differentiators of different degrees are employed as sub-filters [3,8,15] and degrees between one and nine have been reported [2,4,12,13,25,28,36,37].In [13], the second-to tenth-degree differentiators are used to calculate the geometric moments of the image in optical systems for classification.In [36] and [37], the Wilczynski's method needs an eighth-degree derivative to describe the shape of the objects.In [25], the second, fourth, and sixth derivatives of the near-infrared spectra are calculated for resolution enhancement in spectral analysis.Moreover, digital differentiators are often utilized when calibrating channel mismatches in time-interleaved analog-to-digital converters to efficiently approximate the timing or frequency response mismatch errors [11,16,29,31].
This paper considers filter order estimates for digital differentiators that are realized with linear-phase finite-length impulse response (FIR) filters and designed in the minimax sense. 1 There are two main motivations for deriving such estimates.Firstly, such estimates can be used for high-level system design as it enables implementation complexity evaluation without actually designing the differentiators.Secondly, the design of minimax-optimal differentiators is based on iterative optimization techniques which require a substantial amount of processing time [30].Filter order estimates can then give a good initial guess of the minimal filter order required which reduces the number of designs (and thus time) required to find the actual minimal filter order.
There are some filter order estimates available for linear-phase FIR filters, in particular for frequency selective filters, frequency response equalizers, and low-degree differentiators [9,26,27,32,33].In [26,27], estimates for differentiators with degrees 1-4 were reported, but they have some shortcomings.Firstly, those estimates are degree-individual, which means that they are considered and derived separately for each individual degree (say K ) and the constants of the estimates change with K .Secondly, only estimates up to the fourth degree (K ≤ 4) were presented in [26,27], and those estimates are not accurate for higher degrees (K > 4).Thirdly, the estimates in [26,27] are only suitable for the wideband case where the differentiators are designed without stopband attenuation constraints [7,20].However, in some applications, lowpass differentiators are required to suppress the high-frequency spurs and noise components outside the signal band (passband) [24,34].

Contribution
To overcome the shortcomings discussed above, this paper derives a unified filter order estimate for digital differentiators that are realized with linear-phase FIR filters and designed in the minimax sense.The estimate covers both wideband and lowpass differentiators of any integer degree up to the 10th degree. 2 In contrast to the estimates in [26,27], where each degree K requires an individual formula, the estimate provided here is unified.This means that one basic formula is derived which is a function of the degree K and covers both the wideband and lowpass differentiators.Thereby, the total number of constants needed for the estimation is substantially reduced when using the unified estimate instead of degree-individual estimates.In addition, compared with [26,27], more accurate individual estimates for each K are derived in the paper.These estimates also serve as references when evaluating the accuracy of the unified estimate.
To the best of the authors knowledge, [26,27] are the most recent relevant references that can be found in the literature.Other order estimates for linear-phase FIR filters, such as frequency selective filters in [9] and more recent frequency response equalizers [32,33], are not applicable for order estimation of digital differentiators, and therefore not relevant to compare with in this paper.

Outline
The remainder of the paper is organized as follows.Section 2 considers minimax design of linear-phase FIR differentiators.Section 3 presents the proposed unified order estimate as well as the degree-individual estimates.In Sect.4, the proposed estimates are verified through comprehensive simulations and compared with previous estimates.Section 5 concludes this paper.

Minimax Design of Linear-Phase FIR Differentiators
The desired frequency response of a K th-degree digital differentiator is [21] ( The design problem is now to determine the impulse response, h(n), of an N th-order linear-phase FIR filter with the frequency response that approximates the desired function in (1) as well as possible in the minimax sense.
For convenience when designing linear-phase FIR differentiators, the desired frequency response is rewritten as where D K R (ωT ) denotes the real-valued zero-phase component of D K ( jωT ), as given by It is seen that Type III and Type IV FIR filters [having antisymmetric impulse responses h(n) = −h(N −n)] can only be used to realize digital differentiators with odd degrees K .This is because their frequency responses have a phase shift of ±π/2 radians, corresponding to j × sgn{D K R (ωT )} in (3).Further, Type I and Type II FIR filters [having symmetric impulse responses h(n) = h(N − n)] can only be used for even degrees K , since they can only provide phase shifts of zero or ±π radians, which match the differentiator responses for even K .Since the filter coefficients satisfy the symmetry or antisymmetry condition, the resulting differentiator has an exact linearphase response [35].It is also noted that Type II and Type IV filters are of odd order and therefore have a delay that is an integer plus a half.This may not be desirable, depending on the application.One can divide the digital differentiators into two classes.The first one comprises wideband differentiators having no stopband, thus having only a don't-care band in the upper part of the Nyquist band.The second class comprises lowpass differentiators offering suppression of spurs and noise in the stopband, thus having both a don't-care band (transition band) and a stopband in the upper part of the Nyquist band. Figure 1 illustrates the design specifications for the two classes of differentiators.Here, for both classes, δ p and ω c T denote the passband ripple (allowed differentiator approximation error) and cutoff (passband) edge, respectively.In addition, for the lowpass class, δ s denotes the stopband ripple and Δ ω denotes the transition bandwidth.For a given filter order, and an allowed passband ripple, the wideband design is able to provide a wider passband, as it has no further requirements in the upper part of the Nyquist band.The price to pay is that spurs and noise with frequencies higher than ω c T , if such components are present, may not be sufficiently attenuated.To solve this problem, a lowpass filter can be cascaded before/after the wideband differentiator.However, it is more efficient to instead design a lowpass differentiator with stopband attenuation constraints as considered in this paper.

Minimax Design for Wideband Differentiators
For the wideband differentiator, there is only the passband constraint.Thus, we have the specification of an error function as Here H R (ωT ) represents the zero-phase frequency response of H e jωT [10,35], which can be used in the design since |H R (ωT In order to satisfy the specification given in (5), the design of a wideband differentiator is equivalent to solving the approximation problem: For a given integer filter order N , find the filter impulse response values (coefficients) h (n) and δ to minimize δ after the optimization, one increases (decreases) the filter order and redesign the differentiator until satisfying δ ≤ δ p with the minimum filter order.

Minimax Design for Lowpass Differentiators
For the lowpass differentiator, both passband and stopband constraints are imposed, and the additional transition band ω is present, which means that the specification is Compared with ( 5), the additional constraint |H R (ωT )| ≤ δ s in the band [ω c T + ω , π] can effectively attenuate the high-frequency spurs and noise components outside the signal band.
Similarly, one can design the lowpass differentiator as: , where E LP (ωT ) is the weighted error function given by and As for the design of the wideband differentiator, we increase or decrease the filter order until δ ≤ δ p is fulfilled after the optimization with minimal filter order.

Filter Order Estimations
In this section, we first derive the unified order estimate covering both wideband and lowpass digital differentiators for any integer value of K ∈ [1,10].Then we derive the degree-individual estimates, which have better accuracy than those in [26,27].Also recall from the discussion in Sect.1.1 that these individual estimates serve as references in the evaluation of the accuracy of the unified order estimate.

Unified Filter Order Estimate
The unified filter order estimate is derived in two steps as follows.
Step 1: In the beginning, for different values of passband edges, transition bandwidths, and ripples, we design numerous wideband and lowpass differentiators in the minimax sense as outlined in Sect. 2. Here, the linear programming problems in ( 6) and ( 8) are solved by using standard optimization methods [18].In this paper, we adopt the general-purpose linprog function in MATLAB.The optimization problem is then solved with discretized ωT .For digital FIR filter designs, about 500-1000 grid points of ωT are generally dense enough to meet the requirements [26,27,32].Based on all these designs and the estimation formulas in [26,27], we identify the basic form of the proposed unified order estimate as which depends on the functions ϒ and .It is observed that ϒ is mainly dependent on the ripples δ, the degree of the differentiator, and the passband edge ω c T for the lowpass differentiators.Here, ϒ(δ, K , ω c T ) is given by For the wideband differentiator, only the passband ripple is present, whereas for the lowpass differentiator, both passband and stopband ripples are included in the function ϒ(δ, K , ω c T ).
Further, (ωT ) is a function of ωT .To be specific, it is found that for the wideband differentiators, (ωT ) is proportional to the width of the don't-care band, i.e., π −ω c T , whereas for the lowpass differentiators, it is proportional to the transition bandwidth ω .Thus, the (ωT ) is given as This is in line with regular frequency selective FIR filters whose filter orders are inversely proportional to the transition bandwidth [9].The difference is that, here, we have the additional constant D. When D = 0, the order will depart from being inversely proportional to the don't-care or transition bandwidth.This applies in particular for wideband designs using Type I and Type IV filters.These filters do not have structural zeros at ωT = π , as opposed to Type II and Type III filters which have that.Therefore, Type I and Type IV filters can have lower orders than Type II and Type III filters for the same specification.This will be exemplified later in Sect. 4 (in particular in Example 2).
It is noted here that, for the lowpass differentiator, the order depends not only on the transition bandwidth but also the bandwidth ω c T .This explains the term E × ω c T in (11).For the wideband differentiator, this term is not needed and the constant E is then a priori set to zero when determining the other constants in Step 2 below.
Step 2: This step amounts to deriving the values of the constants in the estimate in (11) and (12).The values of A, B, C, and D, as well as E for the lowpass differentiators, are determined by discretizing the parameters δ p , δ s , ω c T , and ω in practical ranges [26,27,32] and then through curve fitting.In practice, typical values for the ripples range from −100 dBc to −20 dBc, i.e., we consider δ p , δ s ∈ [0.00001, 0.1]) [9,22].Furthermore, we consider transition bandwidths within Δ ω ∈ [0.05π, 0.15π ]. 3Finally, the passband edge is assumed to be within ω c T ∈ [0.5π, 0.98π ] 4 .It is worth pointing out that the ranges of ripples and bandwidth are wider compared to those in [26,27], implying that the proposed estimation formulas have a wider range of applicability.
Here we solve the curve fitting problem in the minimax sense as well.Therefore, in the fitting procedure, the function and its constants are determined by minimizing the maximum deviation between the estimated filter order and the required order.For the wideband differentiators, we have where δ (i)  p and ω ( j) c T are discretized into I and J grid points, respectively.Here N min δ (i)  p , ω ( j) c T , K is the required minimal order for the set of values of δ p (i) , ω ( j) c T , and K , whereas c T , K is computed using (11).Similarly, for the lowpass differentiators, we adopt the same minimax optimization principle, but here with δ p , δ s , ω c T , and ω discretized.We have used 10 grid points for the discretization.
Through the optimizations above, we obtained the optimal values for A, B, C, D, and E given in Table 1.It is noted that as solving the curve fitting problem given by ( 14) is non-convex, which means that a globally optimum solution cannot be guaranteed.To ensure a good local optimum, we use several random sets of initial values of A-E and then select the solution that yields the minimum of the fitting error ε.Recall that, due to the frequency response characteristics of linear-phase FIR filters, Type I and Type II filters are used for even K , whereas Type III and Type IV filters are used for odd K .The unified estimate is applicable to all four types as indicated in Table 1.
From the results, it is noted that the estimated order N est is inversely related to ripples δ p and δ s , as smaller ripples mean a higher design accuracy and filter order.For the wideband differentiator, a higher filter order is needed to support a wider passband, and N est is here inversely related (approximately proportional) to the width of the don't-care band, i.e., π − ω c T .For the lowpass differentiator, a more narrow transition band means a more steep droop of the frequency response, which leads to a higher filter order.In this case, N est is inversely related (approximately proportional) to the transition bandwidth ω .

Individual Order Estimates for Wideband Differentiators
The unified estimate in (11) can be applied for all values of K , and the values of A, B, C, D, and E only depend on the filter type and whether K is odd or even.In this subsection, we present individual estimates, meaning that the set of constant values is different for all values of K .Compared with the previous estimates in [27], the estimates derived here provide better accuracy, and the results are extended to cover K ∈ [1,10].In [27], only the cases K ∈ [1,4] were treated.Moreover, the degreeindividual estimates will have the same or better accuracy than unified estimates, since they are optimized individually for each value of K .Thus, they can be used as a reference to evaluate the accuracy of the proposed unified estimate in (11).This will be considered in Sect.4.2.
For the degree-individual estimates, we adopt the basic estimation formula and then use minimax optimization as in (14) to compute the constants for each individual K .Table 2 shows the resulting constants for the wideband differentiators with K ∈ [1,10].It is noted that the value of B is close to zero in some cases, but it cannot be approximated as zero because it appears inside the logarithmic function as seen in (15).

Individual Order Estimates for Lowpass Differentiators
As for the wideband differentiators, we also give the degree-individual order estimates for the lowpass differentiators.The basic estimation formula is here where Again, minimax optimization as in ( 14) is then used for computing the constants for each individual K .The resulting constants are given in Table 3for K ∈ [1,10].

Performance Evaluation and Comparison
In Sect.4.1, we first assess the proposed unified estimate through numerous designs.Then, in Sect.4.2, we compare its accuracy with the degree-individual estimates.

Validation of Unified Estimate
In order to validate the proposed unified estimate, several design cases are investigated for wideband and lowpass designs, respectively.The frequency responses and approximation errors are exemplified in a detailed design example in Example 1. Then we use various specifications for validating the proposed estimates in Examples 2 and 3 for the wideband differentiator, and in Example 4 for the lowpass differentiator.When finding the minimal filter order for each specification, we first design a differentiator of order N est , and then carry out redesigns with increased or decreased filter orders until the minimal order N min is found.
Example 1 For the wideband case, we consider a fourth-degree differentiator (K = 4) with a passband edge at ω c T = 0.8π and a passband ripple of δ p = 0.0001, i.e., −80 dB.By using the estimates in (11) and the constants given in Table 1, we compute N est as 28.78 and 38.97 for the Type I and Type II FIR filters, respectively.For minimal complexity, we choose a Type I FIR filter to design the fourth-degree wideband differentiator in the minimax sense according to Sect.2.1 with a filter order of 28, which is N est rounded to the nearest even integer.It is found that the passband ripple becomes −78.24 dB which does not meet the specification.Further, we use an order of 30 and redesign the differentiator whose frequency response is depicted in Fig. 2a.As seen, the frequency response of this differentiator matches well with the desired function |D 4 (ωT )| = (ωT ) 4 , and the approximation error within the passband is −84.61 dB which satisfies the given constraint.Thus, 30 is the minimal filter order, which is only a single even-order step of 2 from the estimated value of 28.For the lowpass case, we choose a fifth-degree differentiator (K = 5) with the required ripples δ p = 0.001 (−60 dB) and δ s = 0.01 (−40 dB).The passband covers [0, 0.8π ] and the transition bandwidth is Δ ω = 0.1π .According to (11)   that is very close to the minimal order.It is therefore useful for complexity evaluation at high-level system design and for reducing the processing time when finding the actual minimal filter orders.
Example 2 To further verify the proposed unified order estimate for wideband differentiators, we consider numerous designs with values of δ p and ω c T in their ranges δ p ∈ [0.00001, 0.01] and ω c T ∈ [0.5π, 0.98π ]. Figure 3 shows the results for the first-degree differentiator (K = 1), where the solid curves show the required minimal filter orders and the dashed curves represent the estimated orders through (11).In Fig. 4 , we compare the estimated orders with the required minimal filter orders for the second-degree differentiator (K = 2).It is observed that the estimated order N est matches well with required minimal order N min , which demonstrates the accuracy of the proposed unified order estimate over wide ranges of δ p and ω c T .The estimation errors (|N est − N min |) are depicted in the corresponding subplots.Moreover, it is seen that with an increase of ω c T (decrease of δ p ), the required filter order increases as expected.It is also seen that the Type II and Type III filters require substantially higher filter orders than the Type I and Type IV filters, respectively.This is because the Type II and Type III filters have a structural zero at ωT = π , which means that their magnitude responses decays from (ω c T ) K to zero between the frequencies ω c T and π .This resembles a regular transition band which is present for frequency selective filters as well as for the lowpass differentiators.This corresponds to small values of D in which case the filter order is close to inversely proportional to the transition (don't-care) bandwidth.

Example 3
We also design and verify the higher-degree differentiators for various specifications to demonstrate the versatility of the proposed unified estimate.Figure 5 a and b illustrates the estimation accuracy of differentiators with odd K and even K , respectively.Here, Type I and Type III filters for even-degree and odd-degree differentiators have been used, respectively (essentially the same accuracy is obtained with Type II and Type IV filters).To analyze the filter order versus K , we consider first δ p = 0.01 and various passband edges to design the odd-degree (K = 3, 5, 7, 9) differentiators.According to the curves in Fig. 5a along with the curve for δ p = 0.01 of K = 1 in Fig. 3a, it can be found that the required filter order increases as K increases, while the order difference for the same passband edge between adjacent K is approximately equal.For even degree of K = 4, 6, 8, 10, we design the differentiators with δ p = 0.001 and different passband edges, and the same trend can be observed as for odd-degree differentiators.This example demonstrates that the proposed unified estimate performs well for high-degree wideband differentiators as well.
Example 4 This example illustrates the estimation accuracy for lowpass differentiators.
The estimated orders based on (11) and the minimal required orders are depicted in Fig. 6, where various transition bandwidths Δ ω and different degrees K are adopted.In Fig. 6a, we set the passband edge to ω c T = 0.6π , and the passband and stopband ripples to δ p = δ s = 0.01 (−40 dB).In Fig. 6b, we change the passband edge to ω c T = 0.8π and maintain the same ripple requirements.In Fig. 7 , we verify the estimation performance with various passband ripple constraints, and other parameters are fixed as ω c T = 0.8π , δ s = 0.001, and Δ ω = 0.1π .Figures 6 and 7 demonstrate the accuracy of the proposed unified estimate for the lowpass differentiators as well.
Through the above four simulation examples, we evaluate the proposed unified filter order estimate for both wideband and lowpass differentiators.From the results, it is observed that the proposed unified estimate performs well under different filter types and design specifications, including δ p , δ s , ω c T , Δ ω , as well as K .

Comparison of Estimation Accuracy
In this subsection, we compare the proposed unified estimate and the individual estimates with the estimates in [26,27].For quantitative analysis of the estimation accuracy, we use two metrics.One is the root mean square error (RMSE), computed over P designs, whereas the other is the maximum error value (E max ) among the same designs.Thus, We consider 10 design cases to cover different requirements and the results are given in Table 4(recall that the estimates in [26,27] are only applicable for wideband designs with degree K ≤ 4, thus they are not applicable for any lowpass differentiators or wideband differentiators with degree of K > 4. For such cases, we use N.A. as a representation of non-availability in Table 4).In each case, a total of P = 50 differentiator designs are included to compute the RMSE and E max .
It can be seen from the first two design cases (K = 1 and K = 2) in Table 4 that the proposed individual order estimates have better accuracy in both RMSE and       E max metrics than the estimates in [26,27], 5 and the results are extended to cover K ∈ [1,10] for both wideband and lowpass differentiators, whereas in [26,27], only the cases for wideband differentiators with K ∈ [1,4] were treated.Moreover, the degree-individual estimates will have the same or better accuracy than the unified estimates, since they are optimized individually for each value of K .Therefore, the proposed degree-individual estimates can be employed as a reference to evaluate the accuracy of the proposed unified estimates.
Although the proposed unified estimate sacrifices some accuracy compared with the individual estimates, the accuracy is still competitive as the maximal difference between the two estimates is less than 3.2 over all wideband designs, and its main advantage is the versatility of the formula as it covers arbitrary values of K as well as wideband and lowpass differentiators.Compared with the individual estimates in [26,27], the overall performance (when evaluating over all designs) of the proposed unified estimate is slightly worse, as the estimates in [26,27] are optimized individually for each value of K .However, in some rare cases, such as the E max for K = 1 with Type III filter and RMSE for K = 2 with Type II filter, it is possible to obtain a better accuracy for the unified estimate.This is because the unified estimate is optimized for all degrees K ∈ [1, 10] simultaneously in the minimax sense [according to (14)], and may thus have a better accuracy for some cases.Also similar to the proposed individual estimates, the unified estimate has a total of four constants shared by all 10 degrees for wideband differentiators, which is one more coefficient than in [26,27] for one specific K .
Moreover, for the lowpass case, the unified estimate performs even better than for the wideband case.The maximal difference between the unified and individual estimates is here less than 1.7 over all designs.Finally, as given in Table 4, six of the design cases are for K = [5, 6, . . ., 10], and the results show that the accuracy of the unified order estimate is maintained when K increases.

Conclusions
In this paper, a unified order estimate was proposed for minimax-designed linearphase FIR digital differentiators of integer degrees K .Compared with the previous methods, the generality of the estimate has been improved in two ways.Firstly, we included the differentiator degree K in the proposed estimate, which avoids the use of individual sets of constants for all degrees.Further, it covers both wideband and lowpass differentiators and is applicable for degrees up to 10 (see Footnote 2).Previous estimates in [26,27] only covered wideband designs and degrees up to 4. In addition, compared with [26,27], more accurate individual estimates for each K were presented.These estimates also served as references in the evaluation of the accuracy of the unified estimate.Numerous simulation results showed the accuracy of the proposed estimates.Although the unified estimate sacrifices some accuracy compared with the individual 5 Here, we combine the two estimates for Type II/III and Type I/IV into the single formula (15).In such a way, the estimation function for each individual degree K has one more constant compared to [26,27].This is the reason for its higher estimation accuracy.estimates, it is still compatible, and its main advantage is the versatility as it covers arbitrary values of K as well as wideband and lowpass differentiators.
The focus has been on wideband and lowpass differentiators as they are the most commonly used differentiators.Further, the paper considered linear-phase FIR differentiators which do not introduce phase distortion and are efficient due to their coefficient symmetries/antisymmetries. The proposed design procedure (Step 1 and Step 2 in Sect.3.1) for obtaining order estimates can be used for other classes of differentiators, but the estimate in this paper is not directly applicable to other classes.That is, both the basic formula in (11) and the corresponding constants A-E will be different for different classes.For example, considering bandpass instead of lowpass linear-phase differentiators, additional passband and stopband edges need to be incorporated.One may also consider the highpass case, 6 but only Type I and Type IV filters can then be used since Type II and Type III filters have a structural zero at the frequency ωT = π (corresponding to half the sampling frequency).Further, considering IIR differentiators, one needs to incorporate additional parameters to assess their nonlinear phase response.It was beyond the scope of this paper to consider other classes of differentiators but they are left for future research.

Fig. 3
Fig. 3 Estimation results for the first-degree (K = 1) wideband differentiators with various δ p and ω c T in Example 2. a Using Type III FIR filter.b Using Type IV FIR filter

Fig. 4
Fig. 4 Results for the second-degree (K = 2) wideband differentiators with various δ p and ω c T in Example 2. a Type I FIR filter.b Type II FIR filter

Fig. 6
Fig. 6 Estimation results for lowpass differentiators with various transition bandwidth Δ ω and order K in Example 4. a With odd K = 1, 3, 5 and Type III filters.b With even K = 2, 4, 6 and Type II filters

Fig. 7
Fig. 7 Estimation results for lowpass differentiators with various passband ripples δ p and degrees K in Example 4

Table 4
Comparison of estimation accuracy