

Fs = 8000;
n = 1:100;
f1 = 500;
f2 = 1500;
f3 = 5000;
x1 = cos((2*pi*f1/Fs).*n);
x2 = cos((2*pi*f2/Fs).*n);
x3 = cos((2*pi*f3/Fs).*n);

x = x1+x2+x3;
if 0
hold on;
plot(n,x1,'r');
pause;
plot(n,x2,'g');
pause;
plot(n,x3,'k');
pause;
close all;
plot(n,x);
end

y = fft(x);
ya = abs(y);
stem(1:100,ya);


