% dft_ex.m -- Some signals to compute DFT and interpret.
% Rich Kozick

% Instructions:  Plot each time signal and compare the signal shape with 
% the DFT basis vectors. 
% Then look at the corresponding DFT coefficients and interpret them.
% Can you explain?

N = 8;
n = 0:N-1;

x1 = ones(1,N);
X1 = fft(x1);	% Compute DFT

% Example of how to plot time signal and DFT

figure(1)
plot(n,x1,'-',n,x1,'o');
figure(2)
subplot(211)
plot(real(X1),'*')
title('Real FFT')
subplot(212)
plot(imag(X1),'*')
title('Imag FFT')

% Other signals

x2 = cos(2*pi*n/N);
x3 = 5*cos(2*pi*2*n/N);
x4 = 0.2*sin(2*pi*n/N);
x5 = cos(2*pi*2*n/N + pi/3)
x6 = cos(2*pi*1.5*n/N);

% Try some of your own!
