Calculates the frequency domain derivative.
A series or table, the data to differentiate.
Optional. An integer, the derivative order. Defaults to 1, first derivative.
A series or array.
W1: demean(integ(gnorm(1000, 1)))
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.
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))
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.
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:
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.