% % Example 10.4 and Figures 10.6, 10.7, and 10.8 % t=0:0.01:7 x=t.*exp(-t) % modulated signal and its plot % Figure 10.6, wc=20 wc=20; xmod=x.*cos(wc*t) figure (1) plot(t,xmod,t,x,'--') xlabel('time in seconds') ylabel('modulated and original signals') grid print -deps fig10_6.eps % modulated signal and its plot % Figure 10.7, wc=2 wc=2; xmod=x.*cos(wc*t) figure (2) plot(t,xmod,t,x,'--') xlabel('time in seconds') ylabel('modulated and original signals') grid print -deps fig10_7.eps % % spectrum of the original signal % % Figure 10.8 % w=0:0.01:wc num=1 den=[1 2 1] X=freqs(num,den,w) magX=abs(X) figure (3) plot(w,magX) xlabel('angular frequency in rad/sec') ylabel('magnitude spectrum of x(t)') grid print -deps fig10_8.eps