Maximally flat differentiators through WLS Taylor decomposition

12
Digital Signal Processing 21 (2011) 183–194 Contents lists available at ScienceDirect Digital Signal Processing www.elsevier.com/locate/dsp Maximally flat differentiators through WLS Taylor decomposition José Antonio de la O Serna , Miguel Angel Platas-Garza State University of Nuevo León (UANL), San Nicolas, Nuevo León, Mexico article info abstract Article history: Available online 1 July 2010 Keywords: Digital differentiator bank Linear phase filter bank Maximally flat differentiator Spectral fit Taylor expansion Least squares Biorthogonal expansion Windows Interpolation Instantaneous derivative estimates of a signal are obtained using the wighted least square (WLS) approximation of a Taylor (WLST) signal model, using classical windows as weighting factors. The WLST approximation in time corresponds to a Taylor approximation at the origin of the windowed signal spectrum. And the successive application of the WLST approximation leads to a filter bank whose frequency responses approach the set of ideal differentiator gains on the baseband, providing maximally flat differentiators on that band. Examples of these differentiator banks are designed with the Rectangular, Kaiser and Hamming windows, and their frequency and impulse responses are illustrated. Due to the strong symmetry of the signal model, this method achieves linear phase filter banks with equal delay for all the derivative estimates, which are very useful in applications where synchronized derivative of a bandlimited signal are desired. © 2010 Elsevier Inc. All rights reserved. 1. Introduction Digital differentiators are very useful in many applications. Derivative estimates are needed for controlling or monitoring dynamic systems. One of the best known differentiator design method is the minimax relative error [1] based on the Chebyshev approximation [2] to the ideal differentiator gain. An FIR filter is obtained with the program written by Parks and McClellan [3], implementing the Chebyshev criterion with the Remez exchange algorithm [4]. This method produces oscillating approximation errors. A complete description can be found in [5, Sect. 10.2.5]. Most of the digital differentiators proposed in the literature allude to the first derivative. Differentiators based in finite difference methods are very sensitive to noise and unable to estimate with enough accuracy high order derivatives. This explains why maximally flat lowpass [8] or equiripple [9–12] digital differentiators have been proposed to estimate the first derivative. Unlike the design of only one differentiator, the methodology proposed in this paper allow to design FIR differentiator banks with maximally flat gains on the passband and small gains on the stopband. The method is based on the weighted least square (WLS) approximation of a Taylor signal model (WLST) to a signal in a short period of time. Derivatives are then estimated at the center of this time interval. The differentiator bank provides synchronized derivative in a state vector. The stopband gains are reduced by using classical windows to weight the error of the WLS solution. We present the filter banks obtained with the Kaiser and Hamming window. This method does not correspond to the classical design method of finite impulse response (FIR) filters using windows. Instead of only reshaping the impulse response by windowing, the WLS solution also modifies the coefficients of the Gram matrix. It is demonstrated that the WLST method, simultaneously fits the time and spectral signal representations to the input signal and its spectrum respectively, and in turn adapts the achieved digital differentiator gains to the corresponding ideal frequency responses around the zero frequency, producing maximally flat filters in the baseband. * Corresponding author. E-mail address: [email protected] (J.A. de la O Serna). 1051-2004/$ – see front matter © 2010 Elsevier Inc. All rights reserved. doi:10.1016/j.dsp.2010.06.007

Transcript of Maximally flat differentiators through WLS Taylor decomposition

Digital Signal Processing 21 (2011) 183–194

Contents lists available at ScienceDirect

Digital Signal Processing

www.elsevier.com/locate/dsp

Maximally flat differentiators through WLS Taylor decomposition

José Antonio de la O Serna ∗, Miguel Angel Platas-Garza

State University of Nuevo León (UANL), San Nicolas, Nuevo León, Mexico

a r t i c l e i n f o a b s t r a c t

Article history:Available online 1 July 2010

Keywords:Digital differentiator bankLinear phase filter bankMaximally flat differentiatorSpectral fitTaylor expansionLeast squaresBiorthogonal expansionWindowsInterpolation

Instantaneous derivative estimates of a signal are obtained using the wighted leastsquare (WLS) approximation of a Taylor (WLST) signal model, using classical windows asweighting factors. The WLST approximation in time corresponds to a Taylor approximationat the origin of the windowed signal spectrum. And the successive application of theWLST approximation leads to a filter bank whose frequency responses approach the set ofideal differentiator gains on the baseband, providing maximally flat differentiators on thatband. Examples of these differentiator banks are designed with the Rectangular, Kaiser andHamming windows, and their frequency and impulse responses are illustrated. Due to thestrong symmetry of the signal model, this method achieves linear phase filter banks withequal delay for all the derivative estimates, which are very useful in applications wheresynchronized derivative of a bandlimited signal are desired.

© 2010 Elsevier Inc. All rights reserved.

1. Introduction

Digital differentiators are very useful in many applications. Derivative estimates are needed for controlling or monitoringdynamic systems. One of the best known differentiator design method is the minimax relative error [1] based on theChebyshev approximation [2] to the ideal differentiator gain. An FIR filter is obtained with the program written by Parksand McClellan [3], implementing the Chebyshev criterion with the Remez exchange algorithm [4]. This method producesoscillating approximation errors. A complete description can be found in [5, Sect. 10.2.5]. Most of the digital differentiatorsproposed in the literature allude to the first derivative. Differentiators based in finite difference methods are very sensitiveto noise and unable to estimate with enough accuracy high order derivatives. This explains why maximally flat lowpass [8]or equiripple [9–12] digital differentiators have been proposed to estimate the first derivative.

Unlike the design of only one differentiator, the methodology proposed in this paper allow to design FIR differentiatorbanks with maximally flat gains on the passband and small gains on the stopband. The method is based on the weightedleast square (WLS) approximation of a Taylor signal model (WLST) to a signal in a short period of time. Derivatives are thenestimated at the center of this time interval. The differentiator bank provides synchronized derivative in a state vector.

The stopband gains are reduced by using classical windows to weight the error of the WLS solution. We present the filterbanks obtained with the Kaiser and Hamming window. This method does not correspond to the classical design method offinite impulse response (FIR) filters using windows. Instead of only reshaping the impulse response by windowing, the WLSsolution also modifies the coefficients of the Gram matrix. It is demonstrated that the WLST method, simultaneously fits thetime and spectral signal representations to the input signal and its spectrum respectively, and in turn adapts the achieveddigital differentiator gains to the corresponding ideal frequency responses around the zero frequency, producing maximallyflat filters in the baseband.

* Corresponding author.E-mail address: [email protected] (J.A. de la O Serna).

1051-2004/$ – see front matter © 2010 Elsevier Inc. All rights reserved.doi:10.1016/j.dsp.2010.06.007

184 J.A. de la O Serna, M.A. Platas-Garza / Digital Signal Processing 21 (2011) 183–194

The orthogonalization inherent to the WLST method achieves beautiful symmetric structures in time and frequency do-mains. It approaches the signal spectrum with its κth-order Taylor polynomial at ω = 0, and consequently with maximallyflat error. It also approaches the first κ derivatives of the window spectrum with their corresponding κth-order Taylor poly-nomials, (and maximally flat error) at ω = 0. It is shown that the frequency responses of the differentiator bank are buildwith linear combinations of the window spectrum and its derivatives. This explains the widening effect on the passbandand the sidelobe level reduction when a non-rectangular window is applied. Since the first κ terms of the Taylor series ofthe first window spectrum derivatives are exactly matched, the frequency responses of the filter bank will be given by asuccession of Taylor series in which the first κth-order Taylor polynomial at ω = 0 will have only one nonzero term: theone corresponding to each ideal differentiator. The rest of the Taylor series will be the remainder of the κth-order Taylorpolynomial which is maximally flat. Therefore the filter bank contains a succession of maximally flat differentiators [6].

Maximally flat filters are also proposed in [7] but they use the Newton backward interpolation formula with thebackward difference operator. This operator is widely used in numerical analysis but it is very sensitive to noise. Otherdifferentiators obtained by least squares (LS) in the literature are full band and equiripple [10,11], those obtained usingTaylor series [12] estimate the derivatives with central difference approximations, which are essentially finite-differenceequations in which the estimates are obtained at the center of the inter-sample interval. Finally, those obtained in [13] areIIR with non-constant group delay, they have linear magnitude responses on wider bands, and their gain returns smoothlyto zero at a half of the sampling frequency. But again, they refer to the design of an unique order differentiator. The WLSTmethod presented in this paper was developed working on dynamic phasor (or complex envelope) estimation, for whichpassband filters are needed [14]. An example of this application is shown at the end.

The paper is developed as follows. In the first section, the WLS algorithm is formulated for a Taylor approximationusing classical windows as weighting factors, and frequency and impulse responses obtained with the Rectangular andKaiser windows are shown. Then, the lowpass filter bank design is developed in the continuous case in order to provethat the WLS solution is a simultaneous time-frequency approximation, and why the obtained differentiators are maximallyflat on the baseband. Finally, the theoretical baseband differentiator frequency response obtained with the Rectangular andHamming window are illustrated. The paper illustrates the beautiful time-frequency symmetric structures produced by theWLS Taylor approximation. For bandlimited signals with spectra constrained within the bandwidth or band-edge frequency(under the ideal differentiator gains), the procedure can be considered as a digital Taylor transform, or a new signal (state)sampling method.

2. Preliminaries

We start assuming a bandlimited input signal s(t) that can be approached by a κth-order Taylor polynomial:

sκ (t) = s(0) + s′(0)t + s′′(0)t2

2! + · · · + s(κ)(0)tκ

κ ! , for − T

2� t � T

2, (1)

about t = 0 over a short time interval. If the Taylor signal model is sufficiently accurate on that short interval, then thesignal expansion basis is almost complete, and therefore a very accurate estimate of the derivatives at the center of theinterval can be obtained by applying the LS algorithm.

The κth approximation to the discrete bandlimited signal about the center of the �th time interval can be written inmatrix form:

sκ,� = Bκσ κ,� (2)

or in more detail:⎛⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎝

sκ (−Nh)...

sκ (−n)...

sκ (0)...

sκ (n)...

sκ (Nh)

⎞⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎠

=

⎛⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎝

1 (− 12 ) (− 1

2 )2 · · · (− 12 )κ

......

......

...

1 (− n2Nh

) (− n2Nh

)2 · · · (− n2Nh

......

......

...

1 0 0 · · · 0...

......

......

1 ( n2Nh

) ( n2Nh

)2 · · · ( n2Nh

......

......

...

1 ( 12 ) ( 1

2 )2 · · · ( 12 )κ

⎞⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎠

⎛⎜⎜⎜⎜⎝

σ0σ1σ2...

σκ

⎞⎟⎟⎟⎟⎠

. (3)

Assuming that the signal is sampled at N samples per time interval of size T , with N odd of the form N = 2Nh + 1,so that a sample at t = 0 is included, where the Taylor error is zero. Note that the elements of the basis in Bκ are of theform 1,n,n2, . . . ,nκ , n ∈ [−Nh, Nh], and are not orthogonal. Finally, the coefficients σk are related to the derivatives of thebaseband signal σk = T ks(k)(0)/k!, for k = 0,1, . . . , κ .

J.A. de la O Serna, M.A. Platas-Garza / Digital Signal Processing 21 (2011) 183–194 185

The Taylor error for the κth approximation, is given by:

eκ = s − Bκσ κ (4)

and the best estimates of σ κ in the least squares (LS) sense are given by

σ κ = (BT

κ Bκ

)−1BT

κ s (5)

where T is the transpose operator. Normal equations in (5) provide then the best LS Taylor approximation (LST) to thesignal s.

For a given time interval, the Taylor error can be reduced by increasing the order κ of the approximated polynomial. Itis also known that the Taylor error is expansive, i.e. its size increases through the extremes of the time interval. Thereforean effective way to reduce it at the extremities of the interval is to temperate it with a window. Then (4) becomes

W eκ = W s − W Bκσ κ (6)

where

W =

⎛⎜⎜⎝

w1 0 · · · 00 w2...

. . ....

0 · · · w N

⎞⎟⎟⎠ . (7)

The WLS solution of (6) will be [15] now:

σ κWLS = (BT

κ W T W Bκ

)−1BT

κ W T W s. (8)

Note in (8) that the WLS solution consists in modifying the basis vectors as well as the signal with the weights in W .Eqs. (2) and (8) form a biorthogonal expansion, since the rows of the pseudoinverse

B+W ,κ = (

BTκ W T W Bκ

)−1BT

κ W T W (9)

are orthonormal to the vectors in Bκ , forming a biorthogonal basis pair.The solution in (8) minimizes the following error criterion:

J W = eTκ W T W eκ (10)

if and only if

BTκ W T W Bκ > 0. (11)

But it W T W is positive definite, then the former condition is relaxed to:

BTκ Bκ > 0. (12)

As we know from [16] if an analytical signal is approached by a κth-order Taylor polynomial, the approximation is good aslong as we stay inside a neighborhood around the point at which the signal was approached, in which the lower order termsare dominant. Therefore, if more weight is given to the errors close to the center, then better estimates of the lower degreecoefficients can be expected, because they are dominant in that central neighborhood. And by disregarding the errors nearto the extremes of the interval, worst estimates of the higher degree coefficients can be expected, but it does not matterbecause they are not considered in our model. In addition, the mitigation of the expansive error at the extremities of thetime interval eliminates the discontinuities that provoke high sidelobe level in its frequency response.

Even if in what follows the squared weights ω2n in W T W are defined by classical windows, it is important to emphasize

that the solution in (8) is not the same as the traditional design method of finite impulse response (FIR) filters usingwindows [5, p. 664]. If the pseudoinverse matrix B+

κ = (BTκ Bκ )−1 B T

κ contains the impulse response of the original filters,the windowed filters in [5] will be given by B+

κ W T W , which does not correspond to the one in (8), because in this solutionthe grammian matrix is also modified by the squared weights (BT

κ W T W Bκ ).Finally, concerning the computational burden, note in (8) that the impulse response of the differentiators can be calcu-

lated at once in the (κ + 1)× N matrix B+W ,κ , which depends only on the Taylor signal model and the applied window, and

stored in memory.

3. Frequency and time response of the filters

The frequency response of the estimation filters is very useful for assessing their behavior in terms of the signalfrequency content, in particular their behavior before noise. Fig. 1 shows the frequency responses of the first three dif-ferentiators obtained with the LS algorithms, with progressive orders of approximation κ = 2,4,6, and 8. Note that idealgains are achieved on the baseband, and that the bandwidth increases with the approximation order. Odd (even) orders donot modify the frequency response of the precedent even (odd) differentiator, as it will be explained in Section 4. Finally,

186 J.A. de la O Serna, M.A. Platas-Garza / Digital Signal Processing 21 (2011) 183–194

Fig. 1. Differentiator frequency response obtained with LS for different Taylor polynomial orders, κ = 2,4,6, and 8.

Fig. 2. Differentiator WLS frequency response using Kaiser (α = 8) window with different Taylor polynomial orders, κ = 2,4,6, and 8.

note that the stopband of the filter inherits the high sidelobe level of the rectangular window. The idea of using windowingin WLS is to temperate the discontinuities at the extremes of the rectangular window. The frequency responses when aKaiser window (α = 8) is applied to mitigate the error, are shown in Fig. 2. It is apparent that the window reduces the side-lobe level, preserving the ideal differentiator gains in the baseband, but widening the transition band as it was expected.Signal Taylor decomposition will be achieved provided the input signal spectrum be constrained to an interval under theideal differentiator gains.

Fig. 3 illustrates the impulse responses of the differentiators in Fig. 2. According to (8), all of them are κth-order Taylorpolynomials windowed by the squared weighting factors. The set of impulse responses are the rows in the pseudoinversematrix, and are orthonormal to the set of Taylor terms in Bκ , defining the dual basis of the signal expansion. Note that as

J.A. de la O Serna, M.A. Platas-Garza / Digital Signal Processing 21 (2011) 183–194 187

Fig. 3. Differentiator WLS impulse responses using Kaiser (α = 8) window with different Taylor polynomial orders, κ = 2,4,6, and 8.

the order κ of the Taylor polynomial increases, the impulse responses contract in accordance with the spectral dilation ofthe frequency responses. The window also contributes in this concentration effect of κ .

4. Maximally flat differentiators

The former results deserve an explanation. Why the WLS approximation of the Taylor signal model achieves so interestingspectral structures as those illustrated in the former section? An interesting feature of the WLST algorithm is that theapproximation to a time function corresponds to a Taylor approximation to its spectrum. This result is well known [17] inspectral estimation with autoregressive moving-average models and is a consequence of the Parseval’s formula [18]. A recentpaper with many references can be found in [19]. In what follows the proof for our deterministic application is provided.

4.1. WLS Taylor approximation to the time function

Let f (t) be a time function and fκ (t) its κth Taylor polynomial at t = 0:

fκ (t) = f (0) + f ′(0)t + f ′′(0)t2

2! + · · · + f (κ)(0)tκ

κ ! , (13)

and let w(t) be a window defined on the time interval (− T2 , T

2 ), the windowed approximation error to the time function inthat interval will be

w(t)eκ (t) = w(t)(

f (t) − fκ (t)) = f w(t) − w(t) fκ (t). (14)

In vectorial notation we have

w(t) fκ (t) = [w(t) t w(t) · · · tκ w(t)

]ϕ(0) = T ϕ(0) (15)

where ϕ(0) = [ f (0) f ′(0) f ′′(0)/2! · · · f (κ)(0)/κ ! ]T . Consequently the normal equations leading to the WLS optimalapproximation (14) will be given by

T T T ϕ(0) = T T f w . (16)

For each row r = 0,1, . . . , κ we haveκ∑

k=0

⟨tr w(t), tk w(t)

⟩ f (k)(0)

k! = ⟨tr w(t), w(t) f (t)

⟩(17)

or

κ∑k=0

f (k)(0)

k!

T /2∫tk+rq(t)dt =

T /2∫tr p(t)dt (18)

−T /2 −T /2

188 J.A. de la O Serna, M.A. Platas-Garza / Digital Signal Processing 21 (2011) 183–194

where q(t) = |w(t)|2 and p(t) = q(t) f (t). In matrix form we have:

⎛⎜⎜⎜⎜⎝

Q0 Q1 · · · Qκ

Q1 Q2 · · · Qκ+1Q2 Q3 · · · Qκ+2...

.... . .

...

Qκ Qκ+1 · · · Q2κ

⎞⎟⎟⎟⎟⎠

⎛⎜⎜⎜⎜⎜⎜⎝

f (0)

f ′(0)/1!f ′′(0)/2!

...

f (κ)(0)κ !

⎞⎟⎟⎟⎟⎟⎟⎠

=

⎛⎜⎜⎜⎜⎝

P0P1P2...

⎞⎟⎟⎟⎟⎠ (19)

where Qk and Pk are the kth moment of q(t) and p(t), respectively (see Appendix A, or [20]). Note that each row at theleft side of the normal equations in (19) corresponds to the r moment of the estimated Taylor polynomial pκ (t) = q(t) f κ (t)which is matched to the r moment of p(t) at the right side. So the orthogonal condition of the optimal solution requiresthe equalization up to the κ moment of both time functions. This is equivalent to the cancellation of the first κ momentsof the residual weighted error q(t)eκ (t).

The matrix at the left side of (19) is a Hankel matrix, with zeros every other line perpendicular to the main diagonalsince the odd moments of q(t) are null; so the whole matrix is determined by the elements of its diagonal (even moments).This symmetric structure explains why the frequency responses of the achieved differentiators change every two orders:even (odd) differentiators change every even (odd) order κ , and can also be explained by the fact that odd order Taylorpolynomials are orthogonal to those of even order.

In what follows, we show that the moment fitting in time domain is equivalent to derivative fitting in the spectral sideat ω = 0. And the fitting of the first κ spectral derivatives in turn corresponds to the approximation of a κth-order Taylorpolynomial to the spectrum of the windowed function P (ω) at ω = 0, with maximally flat error at that point.

4.2. Maximally flat spectral error

Theorem 4.1. Let Eκ (ω) = P (ω)− Pκ (ω) the spectral error of the WLST approximation obtained from (19). We maintain that Eκ (ω)

is maximally flat about ω = 0.

Proof. Let p(t) = q(t) f (t) the wighted function and pκ = q(t) fκ (t) its weighted estimated κth Taylor polynomial. TheirFourier transform are P (ω) and

Pκ (ω) =κ∑

k=0

f (k)(0)

k!∫

R

tkq(t)e− jωt dt =κ∑

k=0

f (k)(0)

k! jk Q (k)(ω). (20)

We need to show that

E(r)κ (ω) = P (r)(ω) − P (r)

κ (ω) = 0, r = 0, . . . , κ (21)

at ω = 0. The r derivative with respect to ω of P (ω) is

P (r)(ω) = (− j)r

∞∫−∞

tk p(t)e− jωt dt (22)

and of P (r)κ (ω)

P (r)κ (ω) =

κ∑k=0

f (k)(0)

k! jk Q (k+r)(ω). (23)

At ω = 0, using (A.2) of Appendix A, we have

P (r)(0) = (− j)r Pr (24)

and

P (r)κ (0) = (− j)r

κ∑k=0

f (k)(0)

k! Qk+r . (25)

Finally, substituting (24) and (25) in (21) we obtain the normal equations in (19). �So, according to (21), the WLST approximation at t = 0 corresponds to a Taylor approximation to the signal spectrum

P (ω) at ω = 0, with maximally flat spectral error as for any Taylor approximation. The cancellation of the derivatives ofthe spectral error at ω = 0 means that low frequencies are excluded from the spectral error, then the WLST approximation

J.A. de la O Serna, M.A. Platas-Garza / Digital Signal Processing 21 (2011) 183–194 189

processes the error as a highpass filter. As more and more Taylor terms are included into the subspace, this exclusionband widens. In the next subsections, we will show that WLST method can be considered as a filter bank composed bydifferentiators with frequency responses close to the ideal differentiator gains about ω = 0. The spectral approximationerror will be again maximally flat at that point for all the differentiators.

4.3. Simultaneous Taylor spectral fitting to derivatives of the window spectrum

Now we consider the successive solution of the normal equations when the time function is translated f (t + τ ) over thetime interval. This corresponds to instantaneous estimations centered at the time instance τ . This assumption leads us toconsidering the successive estimates of the WLS Taylor model approximation as the output of a filter bank. The frequencyresponse of the achieved filters in the pseudoinverse matrix can be found by applying the estimation process to translatesof the input signal f (t) = e jωt .

Proposition 4.1. The consecutive WLST approximation to a time signal approximates a κ th Taylor polynomial to each one of the first κderivatives of the complex conjugate of the window spectrum Q (r)(ω), r = 0, . . . , κ .

Proof. The frequency response of the elements at the right side of the normal equations T T f w in (16) can be obtained atany instant τ as:

Pr(τ ) =T /2∫

−T /2

trq(t) f (t + τ )dt, r = 0,1, . . . , κ. (26)

Taking into account that q(t)F←→ Q (ω), we have

Pr(τ ) = (− j)r Q (r)(ω)e jωτ (27)

and then the vector with the corresponding frequency responses is given by:

P(ω) =

⎛⎜⎜⎜⎜⎜⎝

Q (ω)

(− j) Q ′(ω)

(− j)2 Q ′′(ω)...

(− j)κ Q (κ)(ω)

⎞⎟⎟⎟⎟⎟⎠ . (28)

The transfer functions of the left side of the normal equations (T T T )ϕ(τ ) in (16) are:

Pκ (ω) =

⎛⎜⎜⎜⎜⎝

Q0 Q1 Q2 · · · Qκ

Q1 Q2 Q3 · · · Qκ+1Q2 Q3 Q4 · · · Qκ+2...

......

. . ....

Qκ Qκ+1 Qκ+2 · · · Q2κ

⎞⎟⎟⎟⎟⎠

⎛⎜⎜⎜⎜⎜⎝

1jω

( jω)2

2!...

( jω)κ

κ !

⎞⎟⎟⎟⎟⎟⎠ . (29)

Then by equalizing both sides of the normal equations we have

P(ω) = Pκ (ω). (30)

By extracting the imaginary scalar factors from the left side, it can be seen that each element r of the right side correspondsto the κth Taylor polynomial at ω = 0 of the isolated spectral function at the left side Q (r)(ω) (see Appendix A). �

Defining the vector Rκ (ω) with the corresponding remainders of Pκ (ω) we have

P(ω) = Pκ (ω) + Rκ (ω). (31)

This expression shows clearly that the condition imposed by the normal equations to the optimal solution in (30) consistssimply in discarding the Taylor remainders Rκ (ω) in (31). And consequently the elements in the remainder vector are onceagain maximally flat at ω = 0.

190 J.A. de la O Serna, M.A. Platas-Garza / Digital Signal Processing 21 (2011) 183–194

4.4. Maximally flat differentiators

Theorem 4.2. The frequency responses of the filter bank provided by the WLST approximation estimates correspond to maximally flatdifferentiators with ideal gains about ω = 0.

Proof. The output of the filter bank of the continuous WLS Taylor approximation is:

ϕ(τ ) = (T T T

)−1T T f w(τ ), (32)

so the frequency responses of the filter bank will be:

H(ω) = (T T T

)−1P(ω) =

⎛⎜⎜⎜⎜⎜⎜⎝

1jω

( jω)2

2!...

( jω)κ

κ !

⎞⎟⎟⎟⎟⎟⎟⎠

+ (T T T

)−1Rκ (ω) (33)

which corresponds to a series of differentiator ideal gains plus a linear combination of the Taylor remainders in (31). Weknow from (31) that these remainders are maximally flat at ω = 0, and so will be any linear combination of them as theone in the right term of (33). Therefore the filter bank has maximally flat differentiators [6] about ω = 0. �

Note in (33) that the transfer functions of the filter bank are built with linear combinations of the derivatives of thewindow spectrum in P(ω) (28). The ideal gains result from the terms of the Taylor polynomials in Pκ (ω) satisfying thenormal equations, and the differences from their remainders, which are maximally flat at zero frequency. Each filter hasthen a frequency response very close to the corresponding differentiator ideal gain about ω = 0 (where the remainderis maximally flat). The inverse of the Gram matrix in (29) inherits the zeros every two lines perpendicular to the maindiagonal. That is why the linear combinations of the even (odd) order differentiators contain only even (odd) derivativesof the window spectrum, resulting in real (imaginary) transfer functions, and consequently the impulse responses alternatebetween symmetric and antisymmetric for even and odd orders respectively, see Figs. 1, 2, 3.

According to (33), each transfer function can be separated in two terms: a filter with the ideal differentiator gain on thefull-band and a highpass filter, formed with the linear combination of the Taylor remainders. Then, estimates will be of theform

ϕ(k)(τ ) = f (k)(τ )

k! + rk(τ ) ∗ f (τ ) (34)

where rk(t) is the impulse response of the linear combination of the Taylor remainders in the kth row. If the spectrum off (t) is bandlimited and its spectrum is over the flat (null) gain of the highpass filters, the error will be very small and theestimates will be measurements of the derivatives. Conversely, if the signal spectrum overflows the flat band, the estimateswill contain considerable error.

4.5. Rectangular window

The implicit window in the LS solution is the rectangular window. Fig. 4 shows the frequency response of the filtersobtained with the rectangular window. Note that on the baseband |u| < 0.3 the gains are constant, linear and quadratic,corresponding to the ideal gains of the first three differentiators. If the spectrum of the input signal is bandlimited insidethat band, then the errors will be insignificant, which in turn means that the time signal segment is smooth enough as tobe approached with enough accuracy by a second order Taylor polynomial.

4.6. Hamming window

The frequency responses of the filters provided by the WLST solution with the Hamming window are illustrated in Fig. 5.A wider passband and smaller sidelobes are obtained.

Finally the gain difference (R(u)) between the frequency response D(u) of the achieved filter and the ideal differentiatorunitary (P0(u) = 1) and linear (P1(u) = 2πu) gains using rectangular and Hamming windows is shown in Fig. 6. Note thatboth differences correspond to the typical shape of a Lagrange remainder of the Taylor approximation, indicating maximallyflat intervals about ω = 0. It is apparent also that they correspond to high pass filters.

5. Examples

A case of instantaneous derivative estimation and signal reconstruction by interpolation is shown in Fig. 7. In the firstfigure, estimates (LS, κ = 3) of the signal s(t) = 1 − e−t/2 cos(t) and first two derivatives are obtained at each sample, sliding

J.A. de la O Serna, M.A. Platas-Garza / Digital Signal Processing 21 (2011) 183–194 191

Fig. 4. Frequency responses of zero (continuous line), first (dashed line), and second (dashed narrow line) order differentiators obtained with the rectangularwindow.

Fig. 5. Frequency responses of zero (continuous line), first (dashed line), and second (dashed narrow line) order differentiators obtained with the Hammingwindow.

the window one sample at a time. The estimates are shown in dotted lines in order to see how close they are to thetheoretical values in the continuous lines. At the bottom, signal reconstruction by interpolation is shown. The interpolationis done over unitary intervals with the estimates taken at the center. The illustrated estimates are obtained with the LS aswell as the WLS (Kaiser, α = 8) methods with κ = 3.

Another case is taken from the field. Fig. 8 illustrates the current signal of a power swing after a major disturbance in apower system at 50 Hz. The signal, sampled at 20 samples per cycle, is shown by the dotted line at the top. Instantaneousestimates taken from two-cycle long filters formed with the rectangular window are shown: its amplitude (continuous line)and its derivative (dashed line), also at the top; and its phase (continuous line) and frequency offset (dashed line) withrespect to 50 Hz at the bottom. In this case the lowpass differentiator bank was translated at the fundamental frequency

192 J.A. de la O Serna, M.A. Platas-Garza / Digital Signal Processing 21 (2011) 183–194

Fig. 6. Taylor remainders for the ideal unitary and linear gains of the zeroth and first differentiators obtained with the Rectangular and Hamming window.

Fig. 7. At the top, derivatives and instantaneous estimates of s(t) = 1 − e−t/2 cos(t), and at the bottom, signal reconstruction (interpolation) with LS andWLS estimates taken at the center of each unitary interval.

(forming a bandpass filter bank) [14]. Note that these estimates are good enough even when the frequency offset is verylarge, as in the low amplitude intervals (±10) Hz. Smooth frequency (phase derivative) estimates, as those achieved by thismethod, are rare. Normally, frequency estimates obtained from phase estimates through finite difference equations containperceptible noise.

In both examples, the Taylor approximation is very good. Note that in both cases all the signal segments under a slidingwindow are enough smooth as to be substituted with high accuracy by a Taylor polynomial of low order at each win-dow position. Such segments are then contained in the Taylor subspace, and consequently the quadratic error of the WLSapproximation is also very small. The smoother the signal segment, the better are the estimates. Error heightens when dis-

J.A. de la O Serna, M.A. Platas-Garza / Digital Signal Processing 21 (2011) 183–194 193

Fig. 8. At the top, amplitude (continuous line) and derivative (dash line) instantaneous estimates of a swing current (in dots) in a power system at 50 Hz.At the bottom, the instantaneous phase (continuous line) and frequency (dashed line) of the same signal.

continuities or transients occur in the observation interval. In this case, signal spectrum widens overflowing the frequencyband with maximally flat gains.

6. Conclusions

A general method for designing linear-phase maximally-flat differentiators was presented. It comes from the WLS ap-proximation of a Taylor signal model. The WLST method approximates simultaneously time and frequency representationsof the windowed function. It also approximates the ideal differentiator transfer functions with maximally flat functions onthe passband. The estimates of the derivatives are very good (measurements), provided the spectrum of the input signal fallsunder the ideal differentiator gains. Moreover, outband noise sensitivity is significantly reduced by windowing the error. Themethod estimates at once the signal and its first κ derivatives, with a linear phase FIR filter bank, having constant groupdelay, providing synchronized instantaneous derivative estimates.

Acknowledgments

The authors would like to thank the State University of Nuevo León for the support to the Paicyt Project IT-257-09:Maximally-flat differentiator banks and classical observers.

Appendix A

The Taylor expansion of a frequency response Q (ω) about ω = 0 is given by

Q κ (ω) = Q (0) + Q ′(0)ω + Q ′′(0)ω2

2! + · · · + Q (κ)(0)ωκ

κ ! . (A.1)

For k = 0,1, . . . , κ and Q (ω) we have

Q (k)(0) = (− j)k Qk, (A.2)

where Qk is the kth moment of q(t):

Qk =∞∫

−∞tkq(t)dt. (A.3)

Then, in terms of the moments of q(t), we also have:

Q κ (ω) = Q0 + Q1(− jω) + Q2(− jω)2

+ · · · + Qκ(− jω)κ

, (A.4)

2! κ !

194 J.A. de la O Serna, M.A. Platas-Garza / Digital Signal Processing 21 (2011) 183–194

and hence:

Q κ (ω) = Q0 + Q1( jω) + Q2( jω)2

2! + · · · + Qκ( jω)κ

κ ! . (A.5)

The Taylor error (or remainder)

Eκ (ω) = Q (ω) − Q κ (ω) (A.6)

is maximally flat about ω = 0, i.e. its first κ derivatives are null at ω = 0.

References

[1] L. Rabiner, R.W. Schaefer, On the behavior of minimax relative error fir digital differentiators, Bell Syst. Tech. J. 53 (February 1974) 363–394.[2] T.W. Parks, J.H. McClellan, Chebyshev approximation for nonrecursive digital filters with linear phase, IEEE Trans. Circuit Theory 19 (March 1972)

189–194.[3] T.W. Parks, J.H. McClellan, A program for the design of linear phase finite impulse response digital filters, IEEE Trans. Audio Electroacoust. 20 (August

1972) 195–199.[4] L. Rabiner, J.H.T.M. Parks, Fir digital filter design techniques using weighted Chebyshev approximation, Proc. IEEE 63 (April 1975) 595–610.[5] J.G. Proakis, D.G. Manolakis, Digital Signal Processing, 4th ed., Prentice Hall, Upper Saddle River, NJ, 2007.[6] S. Samadi, H. Iwakura, A. Nishihara, Multiplierless and hierarchical structures for maximally flat half-band filters, IEEE Trans. Circuits Syst. II 46 (9)

(September 1999) 1225–1230, p. 1226.[7] S. Samadi, O. Ahmad, M. Swamy, Complete characterization of systems for simultaneous lagrangian upsampling and fractional-sample delaying, IEEE

Trans. Circuits Syst. I 52 (3) (March 2005) 656–667, p. 658.[8] I. Selesnick, Maximally flat low-pass digital differentiators, IEEE Trans. Circuits Syst. II 49 (3) (March 2002) 219–223, p. 219.[9] I.R. Khan, M. Okuda, Finite-impulse-response digital differentiators for midband frequencies based on maximal linearity constraints, IEEE Trans. Circuits

Syst. II 54 (3) (March 2007) 242–246, p. 243.[10] Y. Jou, Least-squares design of digital differentiators using neural networks with closed-form derivations, IEEE Trans. Signal Process. 12 (11) (November

2005) 760–763, p. 760.[11] S. Sunder, R. Ramchandran, Design of equiripple nonrecursive digital differentiators and Hilbert transformers using a weighted least-squares technique,

IEEE Trans. Signal Process. 42 (9) (September 1994) 2504–2509.[12] I. Khan, M. Okuda, R. Ohba, Higher degree FIR digital differentiators based on Taylor series, in: The 2004 47th Midwest Symposium on Circuits and

Systems, vol. 2, July 2004, pp. 57–60.[13] M.A. Al-Alaoui, Linear phase low-pass IIR digital differentiators, IEEE Trans. Signal Process. 2 (February 2007) 697–706.[14] M.A. Platas, J.A. de la O Serna, Dynamic phasor and frequency estimates through maximally flat differentiators, IEEE Trans. Instrum. Meas. 59 (7) (July

2010) 1803–1811.[15] D.C. Lay, Linear Algebra and its Applications, Addison Wesley, New York, 2006, Ch. 6.8.[16] H.K. Khalil, Nonlinear Systems, 2nd ed., Prentice Hall, 1996.[17] M.H. Hayes, Statistical Digital Signal Processing and Modeling, Wiley, New York, 1996, Ch. 4, Sections 7.2–7.4.[18] M. Vetterli, J. Kovacevic, Wavelets and Subband Coding, 4th ed., Prentice Hall, Upper Saddle River, NJ, 1995, p. 40.[19] M. Jachan, G. Matz, F. Hlawatsch, Time-frequency ARMA models and parameter estimators for underspread nonstationary random process, IEEE Trans.

Signal Process. 55 (9) (September 2007) 4366–4381.[20] A. Papoulis, Signal Analysis, McGraw–Hill, New York, 1977, p. 62.

José Antonio de la O Serna was born in San Pedro, Coahuila, Mexico in 1953. He received his Ph.D. degree from Telecom, Paris, France,in 1982. In 1987 he joined the Ph.D. program in electrical engineering at the University of Nuevo León (UANL), where he was a memberof the Doctoral Committee. Currently he is research professor at the UANL, Monterrey, Mexico. He was also a Professor at MonterreyInstitute of Technology from 1982 to 1986. From 1988 to 1993, he was with the Electrical Department at the Polytechnic School inYaoundé, Cameroon. Mr. de la O Serna is a member of the Mexican Research System and Senior Member of IEEE.

Miguel Ángel Platas-Garza was born in Monterrey, Nuevo León, Mexico in 1984. He received the B.S. and M.S. degrees from theUniversity of Nuevo León (UANL) in 2005 and 2008. Currently he is pursuing the Ph.D. degree in Electrical Engineering at the Departmentof Electrical Engineering of the same university.