1 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.Footnote 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 \le 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].

1.1 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.Footnote 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.

1.2 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.

2 Minimax Design of Linear-Phase FIR Differentiators

The desired frequency response of a Kth-degree digital differentiator is [21]

$$\begin{aligned} D_K \left( j \omega T \right) = e^{-j \omega T N/2}\left( j\omega T \right) ^K, \quad \omega T \in (-\pi , \pi ). \end{aligned}$$
(1)

The design problem is now to determine the impulse response, h(n), of an Nth-order linear-phase FIR filter with the frequency response

$$\begin{aligned} H\left( e^{j\omega T} \right) =\sum _{n=0}^{N}{h(n) e^{-j\omega T n}} \end{aligned}$$
(2)

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

$$\begin{aligned} D_K \left( j \omega T \right) = {\left\{ \begin{array}{ll} je^{-j \omega T N/2} \times D_{K\text {R}} \left( \omega T \right) , &{}\text {Odd}~K \\ e^{-j \omega T N/2} \times D_{K\text {R}} \left( \omega T \right) , &{}\text {Even}~K, \end{array}\right. } \end{aligned}$$
(3)

where \(D_{K\text {R}} \left( \omega T \right) \) denotes the real-valued zero-phase component of \(D_K \left( j \omega T \right) \), as given by

$$\begin{aligned} D_{K\text {R}} \left( \omega T \right) = {\left\{ \begin{array}{ll} (-1)^{(K-1)/2}(\omega T)^K, &{}\text {Odd}~K \\ (-1)^{K/2}(\omega T)^K, &{}\text {Even}~K. \end{array}\right. } \end{aligned}$$
(4)

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 \(\pm \pi /2\) radians, corresponding to \(j\times \text {sgn} \{D_{K\text {R}} \left( \omega T \right) \}\) 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 \(\pm \pi \) 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 linear-phase 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, \(\delta _p\) and \(\omega _c T\) denote the passband ripple (allowed differentiator approximation error) and cutoff (passband) edge, respectively. In addition, for the lowpass class, \(\delta _s\) denotes the stopband ripple and \(\varDelta _{\omega }\) 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 \(\omega _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.

Fig. 1
figure 1

Illustration of specifications for the two classes of differentiators. a First-degree wideband differentiator (\(K=1\)). b Second-degree lowpass differentiator (\(K=2\))

2.1 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

$$\begin{aligned} |E_{\text {WB}}\left( \omega T \right) |= |H_\text {R}\left( {\omega T}\right) -D_{K\text {R}}\left( \omega T\right) |\le \delta _p,\,\omega T \in \left[ 0,\omega _c T\right] . \end{aligned}$$
(5)

Here \(H_\text {R}\left( \omega T\right) \) represents the zero-phase frequency response of \(H\left( e^{j\omega T} \right) \) [10, 35], which can be used in the design since \(|H_\text {R} \left( \omega T\right) |=|H\left( e^{j\omega T} \right) |\).

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\left( n \right) \) and \(\delta \) to

$$\begin{aligned}&{\textbf {minimize}} \quad \ \delta \nonumber \\&{\textbf {subject to}}\quad |E_\text {WB}\left( \omega T \right) |\le \delta \end{aligned}$$
(6)

on \(\omega T \in \left[ 0,\omega _c T\right] \). If \(\delta > \delta _p\) (\(\delta < \delta _p\)) after the optimization, one increases (decreases) the filter order and redesign the differentiator until satisfying \(\delta \le \delta _p\) with the minimum filter order.

2.2 Minimax Design for Lowpass Differentiators

For the lowpass differentiator, both passband and stopband constraints are imposed, and the additional transition band \(\Delta _\omega \) is present, which means that the specification is

$$\begin{aligned}&|H_\text {R}\left( {\omega T}\right) -D_{K\text {R}}\left( \omega T\right) |\le \delta _p, \quad \omega T \in [0,\omega _c T] \nonumber \\&|H_\text {R}\left( {\omega T}\right) |\le \delta _s, \quad \omega T \in [\omega _c T + \Delta _\omega ,\pi ]. \end{aligned}$$
(7)

Compared with (5), the additional constraint \(|H_\text {R}\left( {\omega T}\right) |\le \delta _s\) in the band \([\omega _c T + \Delta _\omega ,\pi ]\) can effectively attenuate the high-frequency spurs and noise components outside the signal band.

Similarly, one can design the lowpass differentiator as:

$$\begin{aligned}&{\textbf {minimize}} \quad \ \delta \nonumber \\&{\textbf {subject to}} \quad |E_\text {LP}\left( \omega T \right) |\le \delta \end{aligned}$$
(8)

on \(\omega T \in \left[ 0,\omega _c T \right] \cup [\omega _c T + \Delta _\omega ,\pi ]\), where \(E_\text {LP}\left( \omega T \right) \) is the weighted error function given by

$$\begin{aligned} E_\text {LP}\left( \omega T\right) = W(\omega T) \left[ H_\text {R}\left( {\omega T}\right) -D_{K\text {R}}\left( \omega T\right) \right] \end{aligned}$$
(9)

and

$$\begin{aligned} W(\omega T) = {\left\{ \begin{array}{ll} 1, &{} \omega T \in [0,\omega _c T]\\ \delta _p/\delta _s, &{} \omega T \in [\omega _c T + \Delta _\omega ,\pi ]. \end{array}\right. } \end{aligned}$$
(10)

As for the design of the wideband differentiator, we increase or decrease the filter order until \(\delta \le \delta _p\) is fulfilled after the optimization with minimal filter order.

3 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 \in [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.

3.1 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 \(\omega T\). For digital FIR filter designs, about 500–1000 grid points of \(\omega 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

$$\begin{aligned} N_\text {est} = A \times \frac{ \left[ -\log _{10}(B \times \Upsilon (\delta ,K,\omega _c T))\right] ^C}{ \left( \Gamma (\omega T) \right) ^{1+\left( D+E\times \omega _c T\right) /\log _{10}(\Upsilon (\delta ,K,\omega _c T))}}, \end{aligned}$$
(11)

which depends on the functions \(\Upsilon \) and \(\Gamma \). It is observed that \(\Upsilon \) is mainly dependent on the ripples \(\delta \), the degree of the differentiator, and the passband edge \(\omega _c T\) for the lowpass differentiators. Here, \(\Upsilon (\delta ,K,\omega _c T)\) is given by

$$\begin{aligned} \Upsilon (\delta ,K,\omega _c T)= {\left\{ \begin{array}{ll} \frac{\delta _p}{{10}^{\frac{B(K-1)}{2}}}, &{}\text {Wideband, odd}\ K \\ \frac{\delta _p}{{10}^{\frac{B(K-2)}{2}}}, &{}\text {Wideband, even}\ K \\ \frac{\delta _p \delta _s}{{100}^{\frac{B(K-1)\omega _c T}{2}}} \times {{2}^{\frac{B(K-1)\omega _c T}{2}}}, &{}\text {Lowpass, odd} \ K\\ \frac{\delta _p \delta _s}{{100}^{\frac{B(K-2)\omega _c T}{2}}} \times {{2}^{\frac{B(K-2)\omega _c T}{2}}}, &{}\text {Lowpass, even} \ K. \end{array}\right. } \end{aligned}$$
(12)

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 \(\Upsilon (\delta , K, \omega _c T)\).

Further, \(\Gamma (\omega T)\) is a function of \(\omega T\). To be specific, it is found that for the wideband differentiators, \(\Gamma (\omega T)\) is proportional to the width of the don’t-care band, i.e., \(\pi - \omega _c T\), whereas for the lowpass differentiators, it is proportional to the transition bandwidth \(\Delta _\omega \). Thus, the \(\Gamma (\omega T)\) is given as

$$\begin{aligned} \Gamma (\omega T)= {\left\{ \begin{array}{ll} \pi -\omega _c T, &{}\text {Wideband} \\ \varDelta _{\omega }, &{}\text {Lowpass}. \end{array}\right. } \end{aligned}$$
(13)

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\ne 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 \(\omega T=\pi \), 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 \(\omega _c T\). This explains the term \(E\times \omega _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 \(\delta _p\), \(\delta _s\), \(\omega _c T\), and \(\Delta _\omega \) 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 \(\delta _p, \delta _s \in [0.00001,0.1]\)) [9, 22]. Furthermore, we consider transition bandwidths within \(\varDelta _\omega \in \left[ 0.05\pi ,0.15\pi \right] \).Footnote 3 Finally, the passband edge is assumed to be within \(\omega _c T \in \left[ 0.5\pi ,0.98\pi \right] \)Footnote 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

$$\begin{aligned}&{\textbf {minimize}} \quad \varepsilon \nonumber \\&{\textbf {subject to}} \ |N_\text {est} ( {\delta _p^{(i)}}, {\omega _c^{(j)} T}, K ) - N_\text {min} ( {\delta _p^{(i)}}, {\omega _c^{(j)} T}, K ) |< \varepsilon \nonumber \\&\forall \, i \in \left[ 1,2,...,I\right] , j \in \left[ 1,2,...,J\right] , \text {and}~K \in [1,2,...,10] \end{aligned}$$
(14)

where \({\delta _p^{(i)}}\) and \({\omega _c^{(j)} T}\) are discretized into I and J grid points, respectively. Here \(N_\text {min} \big ( {\delta _p^{(i)}}, {\omega _c^{(j)} T}, K \big )\) is the required minimal order for the set of values of \({\delta _p}^{(i)}\), \({\omega _c^{(j)} T}\), and K, whereas \(N_\text {est} \big ( {\delta _p^{(i)}}, {\omega _c^{(j)} T}, K \big )\) is computed using (11). Similarly, for the lowpass differentiators, we adopt the same minimax optimization principle, but here with \({\delta _p}\), \({\delta _s}\), \({\omega _c T}\), and \({\Delta _\omega }\) 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 \(\varepsilon \). 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.

Table 1 Constants for unified estimate in (11)

From the results, it is noted that the estimated order \(N_\text {est}\) is inversely related to ripples \({\delta _p}\) and \({\delta _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_\text {est}\) is here inversely related (approximately proportional) to the width of the don’t-care band, i.e., \(\pi - \omega _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_\text {est}\) is inversely related (approximately proportional) to the transition bandwidth \(\Delta _\omega \).

3.2 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 \in [1,10]\). In [27], only the cases \(K \in [1,4]\) were treated. Moreover, the degree-individual 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

$$\begin{aligned} N_\text {est,ind}^\text {(WB)} = A \times \frac{ \left[ -\log _{10}(B \times \delta _p)\right] ^C}{ \left( \pi -\omega _c T \right) ^{1+D/\log _{10}(\delta _p)}}, \end{aligned}$$
(15)

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 \in [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).

Table 2 Constants for individual estimation of wideband differentiators in (15)

3.3 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

$$\begin{aligned} N_\text {est,ind}^\text {(LP)} = A \times \frac{ \left[ -\log _{10}(B \times \Upsilon (\delta ,\omega _c T))\right] ^C}{ \left( \Delta _\omega \right) ^{1+(D+E \times \omega _c T)/\log _{10}(\Upsilon (\delta ,\omega _c T))}}, \end{aligned}$$
(16)

where

$$\begin{aligned} \Upsilon (\delta ,\omega _c T)= \frac{\delta _p \delta _s}{{100}^{B \times \omega _c T}} \times {2}^{B \times \omega _c T}. \end{aligned}$$
(17)

Again, minimax optimization as in (14) is then used for computing the constants for each individual K. The resulting constants are given in Table 3 for \(K \in [1,10]\).

Table 3 Constants for individual estimation of lowpass differentiators in (16)

4 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.

4.1 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_\text {est}\), and then carry out redesigns with increased or decreased filter orders until the minimal order \(N_\text {min}\) is found.

Example 1

For the wideband case, we consider a fourth-degree differentiator (\(K=4\)) with a passband edge at \(\omega _c T=0.8\pi \) and a passband ripple of \(\delta _p=0.0001\), i.e., \(-80\) dB. By using the estimates in (11) and the constants given in Table 1, we compute \(N_\text {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_\text {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(\omega T) |=(\omega 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 \(\delta _p=0.001\) (\(-60\) dB) and \(\delta _s=0.01\) (\(-40\) dB). The passband covers \(\left[ 0,0.8\pi \right] \) and the transition bandwidth is \(\varDelta _\omega =0.1\pi \). According to (11) and Table 1, \(N_\text {est}\) equals 109.71 for Type III and Type IV differentiators. Here we use a Type IV filter and obtain the minimal required order of 111 with a passband ripple of \(-61.43\) dB and a stopband ripple of \(-41.43\) dB, as illustrated in Fig. 2b. Based on the above two design cases, it is seen that the proposed unified order estimate can provide an initial value 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.

Fig. 2
figure 2

Frequency response and approximation errors of the differentiators in Example 1. a Wideband differentiator (\(K=4\)). b Lowpass differentiator (\(K=5\))

Example 2

To further verify the proposed unified order estimate for wideband differentiators, we consider numerous designs with values of \(\delta _p\) and \(\omega _c T\) in their ranges \(\delta _p \in [0.00001,0.01]\) and \(\omega _c T \in \left[ 0.5\pi ,0.98\pi \right] \). 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_\text {est}\) matches well with required minimal order \(N_\text {min}\), which demonstrates the accuracy of the proposed unified order estimate over wide ranges of \(\delta _p\) and \(\omega _c T\). The estimation errors (\(|N_\text {est} - N_\text {min} |\)) are depicted in the corresponding subplots. Moreover, it is seen that with an increase of \(\omega _c T\) (decrease of \(\delta _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 \(\omega T=\pi \), which means that their magnitude responses decays from \((\omega _c T)^K\) to zero between the frequencies \(\omega _c T\) and \(\pi \). 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.

Fig. 3
figure 3

Estimation results for the first-degree (\(K=1\)) wideband differentiators with various \(\delta _p\) and \(\omega _c T\) in Example 2. a Using Type III FIR filter. b Using Type IV FIR filter

Fig. 4
figure 4

Results for the second-degree (\(K=2\)) wideband differentiators with various \(\delta _p\) and \(\omega _c T\) in Example 2. a Type I FIR filter. b Type II FIR filter

Example 3

We also design and verify the higher-degree differentiators for various specifications to demonstrate the versatility of the proposed unified estimate. Figure 5a 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 \(\delta _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 \(\delta _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 \(\delta _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.

Fig. 5
figure 5

Results for high-degree wideband differentiators in Example 3. a Type III filters for odd \(K=3,5,7,9\) and \(\delta _p=0.01\). b Type I filters for even \(K=4,6,8,10\) and \(\delta _p=0.001\)

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 \(\varDelta _{\omega }\) and different degrees K are adopted. In Fig. 6a, we set the passband edge to \(\omega _c T=0.6 \pi \), and the passband and stopband ripples to \(\delta _p=\delta _s=0.01\) (\(-40\) dB). In Fig. 6b, we change the passband edge to \(\omega _c T=0.8 \pi \) 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 \(\omega _c T = 0.8 \pi \), \(\delta _s=0.001\), and \(\varDelta _{\omega } = 0.1 \pi \). Figures 6 and 7 demonstrate the accuracy of the proposed unified estimate for the lowpass differentiators as well.

Fig. 6
figure 6

Estimation results for lowpass differentiators with various transition bandwidth \(\varDelta _{\omega }\) 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
figure 7

Estimation results for lowpass differentiators with various passband ripples \(\delta _p\) and degrees K in Example 4

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 \(\delta _p\), \(\delta _s\), \(\omega _c T\), \(\varDelta _{\omega }\), as well as K.

4.2 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 (\(\text {RMSE}\)), computed over P designs, whereas the other is the maximum error value (\({E_\text {max}}\)) among the same designs. Thus,

$$\begin{aligned} {\left\{ \begin{array}{ll} \text {RMSE} = \sqrt{\frac{1}{P}\sum _{i=1}^P{\left( N_\text {est}\left( i \right) -N_\text {min}\left( i \right) \right) ^2}}\\ {E_\text {max}} = \underset{i}{\max }|N_\text {est}\left( i \right) -N_\text {min}\left( i \right) |,~~ i\in \left[ 1, 2,..., P \right] . \end{array}\right. } \end{aligned}$$
(18)

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 \le 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 \(\text {RMSE}\) and \({E_\text {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 \(\text {RMSE}\) and \({E_\text {max}}\) metrics than the estimates in [26, 27],Footnote 5 and the results are extended to cover \(K \in [1,10]\) for both wideband and lowpass differentiators, whereas in [26, 27], only the cases for wideband differentiators with \(K \in [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_\text {max}}\) for \(K=1\) with Type III filter and \(\text {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 \in [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,\ldots , 10]\), and the results show that the accuracy of the unified order estimate is maintained when K increases.

Table 4 Comparison of estimation accuracy

5 Conclusions

In this paper, a unified order estimate was proposed for minimax-designed linear-phase 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 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,Footnote 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 \(\omega T=\pi \) (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.