%
%  w08modes.m -- djm, 22 june 2005
%

N = 16;

dx = 2*pi/N;  x = -pi:dx:pi;
omegaJ = exp(-i*dx*[0:N]);

figure(1);  clf;  hold on
for k = 1:N
    mode = omegaJ.^(k-1);
    plot(x,k+real(mode)/4,'b')
    plot(x,k+real(mode)/4,'ko')
end
axis([-pi pi 0 N+1])
set(gca,'ytick',[1:1:N],'ygrid','on')
title('\bf fourier modes, real part')
xlabel('\bf x_j')
ylabel('\bf \omega_N^{(j-1)(k-1)}')

figure(2);  clf;  hold on
for k = 1:N
    mode = omegaJ.^(k-1);
    plot(x,k+imag(mode)/4,'b')
    plot(x,k+imag(mode)/4,'ko')
end
axis([-pi pi 0 N+1])
set(gca,'ytick',[1:1:N],'ygrid','on')
title('\bf fourier modes, imag part')
xlabel('\bf x_j')
ylabel('\bf \omega_N^{(j-1)(k-1)}')