% CT-FT demo, Nov 2005
%
disp('Let x(t)=exp(-t)u(t)');
w=0:pi/20:6*pi; % frequency vector
X=1./(1+j*w); % FT of x(t)
%
disp('Let h(t) be a rect. pulse of height 1/2 from 0 to 2');
H=sin(w)./w.*exp(-j*w);
%
figure(1)
plot(w,abs(X),w,abs(H),w,abs(X.*H))
set(gca,'FontSize',14)
q=legend('|X(jw)|','|H(jw)|','|Y(jw)|');
set(q,'FontSize',14)
title('Linear Plot','FontSize',14)
xlabel('\omega','FontSize',14);
grid on
%
figure(2)
w=logspace(-1,3,500);
X=1./(1+j*w); % FT of x(t)
H=sin(w)./w.*exp(-j*w);
loglog(w,abs(X),w,abs(H),w,abs(X.*H))
set(gca,'FontSize',14)
title('Doubly Logarithmic Plot','FontSize',14);
xlabel('\omega','FontSize',14)
grid

