Skip to content

Instantly share code, notes, and snippets.

@samstewart
Created October 6, 2016 18:50
Show Gist options
  • Save samstewart/91525e7262fe251116819d293a1a99da to your computer and use it in GitHub Desktop.
Save samstewart/91525e7262fe251116819d293a1a99da to your computer and use it in GitHub Desktop.
Plots the Fourier modes with K sample points.
% simple script that allows one to plot the Fourier modes. % The modes should be given in Terry Tao's notation so that
% u = \sum_{i = 1}^N exp(2 \pi n xi) \hat{u}_n
% For example, cos would be given as [0 1/2]
function plot_fourier_modes(K, modes)
plot(fourier_linspace(0, 2*pi, 2*K + 1), ifft(full_fourier_spectrum(K, modes))); grid on;
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment