
N = 7;
L = 2*pi;
dx = L/N;
x = 0:dx:2*pi-dx;

dX = L/(200*N);
X = 0:dX:2*pi;

for k=1:15
    figure(1)
    clf
    plot(x,sin(x),'o','LineWidth',2);
    hold on
    plot(X,sin(k*X))
    axis([0,2*pi,-1,1])
    s = sprintf('sin(x) versus sin(kx) where k is %0.5g',k);
    title(s)
    figure(1)
    pause(2)
end

k=0
f = exp(i*k*x);
fft(f)
fft(f)/N
abs(fft(f))/N

for k=0:16
    f = exp(i*k*x);
    fft(f);
    fft(f)/N;
    abs(fft(f)/N)
    pause(2)
end

k=0
f = sin(k*x);
fft(f)
fft(f)/N
abs(fft(f))/N

for k=0:16
    f = sin(k*x);
    fft(f);
    fft(f)/N;
    abs(fft(f)/N)
    pause(2)
end

k=0
f = cos(k*x);
fft(f)
fft(f)/N
abs(fft(f))/N

for k=0:16
    f = cos(k*x);
    fft(f);
    fft(f)/N;
    abs(fft(f)/N)
    pause(2)
end



