Fourier spectral method for variable-coefficient advection
= Fourier spectral method for variable-coefficient advection
For $u_t+c(x)u_x=0$ with two-periodic Fourier truncations $|n|\leq d$, let $C_{nm}=\widehat c_{n-m}$ and $D_{mm}=m$. Fourier projection gives
$$
\dot{\widehat{\mathbf u}}=-i\pi CD\widehat{\mathbf u}.
$$