FDERIV

Purpose:

Calculates the frequency domain derivative.

Syntax:

FDERIV(series, n)

series

-

A series or table, the data to differentiate.

n

-

Optional. An integer, the derivative order. Defaults to 1, first derivative.

Returns:

A series or array.

Example:

W1: demean(integ(gnorm(1000, 1)))

W2: finteg(w1)

W2: deriv(w1)

W3: fderiv(w1)

 

W1 contains zero mean synthesized data that is frequency domain integrated W2.  W3 contains a standard time domain derivative of W1.  W3 contains the derivative as performed in the frequency domain to recover W1.

Example:

n = 1000;

x = extract(linspace(0, 2*pi, n), 1, n-1);

W1: cos(x + 2*cos(3*x))

W2: -sin(x + 2*cos(3*x)) * (1-6*sin(3*x))

W3: fderiv(W1)

W4: abs(W2 - W3)

 

W1 contains 999 samples of the periodic function:

 

 

W2 contains the analytic derivative of W1

 

 

W3 computes the frequency domain derivative and W4 displays the difference between the analytic and the calculated result. In this case, the difference is negligible.

Remarks:

FDERIV performs integration in the frequency domain using the following Fourier transform relation:

 

 

where X(f) is the Fourier transfrom of the time domain series and f is the frequency range of the transform.

 

The derivative calculation is transformed back into the time domain.

 

To view the result in the frequency domain, try:

 

spectrum(fderiv(s))

 

fderiv(s, n) computes the nth order derivative with:

 

X(f) (i 2πf )n

 

See DERIV for a time-domain implementation of the derivative.

 

See FINTEG for an implementation of frequency domain integration.

See Also:

DERIV

FFT

FINTEG

INTEG

LDERIV

RDERIV