% This is the exammple provided by
% Oystein Olsen 08.Dec.2005
%
nn = [0:499];           %
ns = [0:10:499];        %
xx = ones(1,64);        %
XX = fft(xx,500);       % Create 500 points FFT of the signal xx
plot(nn,abs(XX)),grid   % DTFT (magnitude). Frequency almost continuous (500)
hold on;                % Next line: DFT (magnitude). Just 50 samples of freq.
stem(ns,abs(XX(ns+1)),'filled')
pause;
hold off;
f0 = 0.1;                % The freq. of the complex exp.
wind = [0:32];
cc = exp(j*2*pi*f0*wind); % 500 samples of a complex exponential
CC = fft(cc,500);         % Create 500 points FFT of the signal cc
plot(nn, abs(CC)),grid    %

