%Andrew Karkau
%EE416
%December 3, 2001

t=0:1/1000:2; 
w=2*pi*13;
dw=2*pi*0.75;
x1=sin(w*t);
x2=2*sin((w+dw)*t);
x3=3*sin((w-dw)*t);
x=x1+x2+x3;

figure(1);
plot(t,x);
xlabel('t');
ylabel('x(t)');

figure(2);
freqz(x);
title('Frequency Spectrum of x');

h=fir1(50,[0.014 0.034],kaiser(51,0.5));
y=conv(x,h);

figure(3);
freqz(y);
title('Frequency Spectrum of y');

f1=10;
f2=20;
m=512;
w1=exp(-j*2*pi*(f2-f1)/(m*1000));
a1=exp(j*2*pi*f1/1000);
z1=czt(y,m,w1,a1);
fz1=((0:length(z1)-1)'*(f2-f1)/length(z1))+f1;

figure(4);
plot(abs(z1));
title('czt of y');

figure(5);
plot(fz1,abs(z1));
axis([10 20 0 3000]);
title('czt of y from 10 to 20');

figure(6);
plot(fz1,abs(z1));
axis ([10 15 0 3000]);
title('czt of y from 10-15');

figure(7);
plot(fz1,abs(z1));
axis ([13 14 0 3000]);
title('czt of y from 13-14');
