Discrete Derivative


Derivative calculation for dicrete data series.

Description

Derivative estimation on discrete data series is implemented by the function ao/diff. This function implements several algorithms for the calculation of zero, first and second order derivative. Where with zero order derivative we intend a particular category of data smoothers [1].

Call

    b = diff(a,pl)
    [b1,b2,...,bn] = diff(a1,a2,...,an, pl);
  

Inputs

Outputs

Parameters

Key Parameter Values

'METHOD'

Value Description

'2POINT'

Two point derivative.

'3POINT'

Three point derivative.

'5POINT'

5 point derivative.

'ORDER2'

Compute derivative using a 2nd order method.

'ORDER2SMOOTH'

Compute derivative using a 2nd order method with a parabolic fit to 5 consecutive samples.

'FPS'

Calculate five points derivative using the generalized five point method described in [1]. If you call with this oprtion you may add also the parameters:

  • 'ORDER'
    Supperted values are:
    • 'ZERO' - Data smoother
    • 'FIRST' - First Derivative
    • 'SECOND' - Second Derivative
  • 'COEFF' - coefficient used for the derivative

Algorithm

Method Description

'2POINT'

Compute first derivative with two point equation according to:

'3POINT'

Compute first derivative with three point equation according to:

'5POINT'

Compute first derivative with five point equation according to:

'FPS'

Five Point Stencil is a generalized method to calculate zero, first and second order discrete derivative of a given time series. Derivative approximation, at a given time t = kT (k being an integer and T being the sampling time), is calculated by means of finite differences between the element at t with its four neighbors:

It can be demonstrated that the coefficients of the expansion can be expressed as a function of one of them [1]. This allows the construction of a family of discrete derivative estimators characterized by a good low frequency accuracy and a smoothing behavior at high frequencies (near the nyquist frequency).
Non-trivial values for the 'COEFF' parameter are:

  • Parabolic fit approximation
    These coefficients can be obtained by a parabolic fit procedure on a generic set of data [1].
    • Zeroth order -3/35
    • First order -1/5
    • Second order 1/7
  • Taylor series expansion
    These coefficients can be obtained by a series expansion of a generic set of data [1 - 3].
    • First order 1/12
    • Second order -1/12
  • PI
    This coefficient allows to define a second derivative estimator with a notch feature at the nyquist frequency [1].
    • Second order 1/4

Frequency response of first and second order estimators is reported in figures 1 and 2 respectively.

Figure 1: Frequency response of first derivative estimators.

Figure 2: Frequency response of second derivative estimators.

References

  1. L. Ferraioli, M. Hueller and S. Vitale, Discrete derivative estimation in LISA Pathfinder data reduction, Class. Quantum Grav., 7th LISA Symposium special issue.
    L. Ferraioli, M. Hueller and S. Vitale, Discrete derivative estimation in LISA Pathfinder data reduction arXiv:0903.0324v1
  2. Steven E. Koonin and Dawn C. Meredith, Computational Physics, Westview Press (1990).
  3. John H. Mathews, Computer derivations of numerical differentiation formulae, Int. J. Math. Educ. Sci. Technol., 34:2, 280 - 287.




©LTP Team