% generate the wavenumbers
k=-nx/2:nx/2-1;
% take the Fourier transform, then shift the wavenumbers
cy=fftshift(fft(y));
