Fourier spectral differentiation matrices. Computes the m'th derivative Fourier spectral differentiation matrix on grid with N equispaced points in [0,2pi).
N - size of differentiation matrix m - derivative order
x - equispaced points 0, 2pi/N, 4pi/N, ... , (N-1)2pi/N DM - m-th order differentiation matrix
Explicit formulas are used to compute the matrices for m=1 and m=2. A discrete Fourier approach is employed for m>2. The program computes the first column and first row and then uses the toeplitz command to create the matrix.
For m=1 and 2 the code implements a "flipping trick" to improve accuracy suggested in http://dx.doi.org/10.1137/0916073
Version 2.1, authors: S.C. Reddy, J.A.C. Weideman