I provide you my own code and it's plots below. Hope you
understand it.
Plots for this code is provided below using SUBPLOT
%x (n) N1-18 yl-l.3 ones (1,N1); N2-30-NI; y2-2.3*ones (1,N2) x-cat (2,yl,y2): len 0:1:79 subplot (3, 1, 1) ; %plotting x (n) stem (len,x) xlabel ( ylabel('x (n) title ('Input signal-1.3u (n) +u (n-18) ' grid on 14 15 %h (n) Mi-15; hl-zeros (1,MI); M2=80-MI ; 19 h2--2*ones (l,M2) 20 h-cat (2,hl, h2) 21 - subplot (3, 1,2) ; %plotting h (n) stem (len, h) xlabel ( 23 24 ylabel ('h(n) ') title ( 'Impulse response 2u (n-15)) grid on
m-length (x); 28 n=length (h) ; 30 y-x, zeros (1,n)) ; H= [h, zeros (1, m) ] ; 32 for i1:m+n-l 34 for j=1 : m 35 if (i-j+1>0) 36- yli,-y (1 ) + (x (j)"E(1-j+1)); 37- end end 39 end subplot (3,1,3) plotting y (n) stem (y) ylabel ('Y[n]') xlabel ('->n' title ('Convolution of Two Signals without conv function') 45 grid on
input signal#1.3u(n)+u(n-18) 909999999 9999999999999299999929 10 20 30 40 70 Impulse response -u(n-15) 0.5 1.5 10 20 30 40 70 Convolution of Two Signals without conv function 100 40 120 160 20 60 80 100 140