Which is better, spectral differentiation or quotient finite differences?

293 Views Asked by At

If I have a periodic function, as an array of values, and I want to calculate numerically it's derivative I can use 2 methods, the first one is to use discrete fourier transform and perform the multiplication as in https://math.mit.edu/~stevenj/fft-deriv.pdf. The second one is to use an aproximation by finite differences as $f_i'=\frac{f_{i+1}-f{i}}{h}$. I want to know which one would perform better in practice and why, can you suggest me literature where I can find such information?

1

There are 1 best solutions below

0
On BEST ANSWER

If you have an analytic periodic function, trigonometric interpolation on equidistant nodes converges exponentially with the number of nodes (because a periodic function can be expressed as a fourier series. If the functions is n-times differentiable, you have algebraic convergence with rate n. The FFT is (only) a nice trick to compute this interpolant very fast.

The finite difference approximation instead is only linear in $h$.

Unless your function is nasty, you'll get more accurate results (asymptotically, but essentially also in practice) with the FFT than with the finite difference approximation.

You can read more about trigonometric interpolation here.