Code:
n = 0:9; x = n+1; h = [1,0,-1]; N = 6; y = Ovrlpsav (x,h,n), NH = 0:1:length (h) -1;ny = 0:1:length (y) -1;%%---------------------------------------------------- -------------percent START a%%-----------------------------------------------------------------figure (' Numbertitle ', ' off ', ' Name ', ' Exameple5.19 ') set (GCF, ' Color ', ' white '); Subplot (3,1,1); Stem (n,x); Title (' Sequence x (n) '); %axis ([0,5,0,5]); Xlabel (' n '); Ylabel (' x (n) '); Grid On;subplot (3,1,2); Stem (nh,h); Title (' Impulse sequence h (n) '); %axis ([0,5,0,5]); Xlabel (' n '); Ylabel (' H (n) '); Grid On;subplot (3,1,3); Stem (ny,y); Title (' Linear convolution sequence x3 (n) '); %axis ([0,10,-3,5]); Xlabel (' n '); Ylabel (' Y (n) '); Grid on;%%-----------------------------------------------------------------percent END a%%------------------ -----------------------------------------------
Operation Result:
DSP using MATLAB example Example5.19