close all clear all clc T = 0.01; tx = -20:T:20; x = sinc(tx); tg = -20:T:20; g = sinc(tg); y = T*conv(x,g); ty = tx(1)+tg(1):T:tx(end)+tg(end); y2 = sinc(ty); figure subplot(2,2,1) plot(tx,x) grid xlabel('t') ylabel('x(t)') subplot(2,2,2) plot(tg,g) grid xlabel('t') ylabel('g(t)') subplot(2,1,2) plot(ty,y,ty,y2) grid xlabel('t') ylabel('y(t)=x*g(t)') legend('via MatLab','true signal') sgtitle('continuous-time convolution') % printing figure in png format set(gcf,'PaperUnits','inches','PaperPosition',[0 0 6 4.5]) print -dpng homework1.png -r100