You are on page 1of 5
1, Find the convolution result of the following signal using basic convolution formula : XA(n1) = [11,111] nl= [-2-1,0,1,2] X2(n2) = [1,0,0,0,0,0,0,0,0,0] n2= [-4,-3,-21,0,1,2,3,4,5] X2 is a periodic signal. Y2= X1*X2 Solution: xI=[1L11U5 : [h1,n21}-singfold(x2,n2); 2 for i=min(n1)+min(n2):1:max(n1)+max(n2) f pt [h2,n22]-sigshift_m(h1,n21 [h3,n33]-sigmulti(x 1 n1,h2,n22);, index=i-(min(n)+min(n2))+1; y(index)=sum(h3); end %t-[I:length(y)}; (=min(n1)}+min(n2):1:max(nl)+max(n2) stem(ty); function: sig function [y,n]-sigfold(x,n) y=fliplr(x); n=-fliple(n); function2: sigshift_m functionly.n}-sigshift_m(x,m,n0); n=m+n0; y=x; function3: sigmulti funetion{y.n}-sigmulti(x1 n1,x2,n2); n=min(min(n1),min(n2)):max(max(n1),max(n2)); yl=zeros(1,length(n)); y2=yl yl (find (n>=min(n1))8e(n<=max(n1))==1))=x1; y2( find ((n>=min(n2)}(n<=max(n2))==1))=x2; yoyl-ty2; O71BCTS05 2. Find the convolution of using conv function 1 [in forOsns6 | a. x{n]= nd lo else ik for —2SnS2 h{n| = f 0 else b. x= u(t) h()= eu (i), where a>O Solution: a) 1 n-[-2°6]; 9 x=[0,1/3,2/3,3/3,4/3,5/3,6/3]; ee ° n1=[0,1,2,3,4,5,6] sh ° ° b=[L.11,11] 2,-1,0,1,2] “vr ° answer=conv(x,h) al 9° -L-2:8]; stem(L.answer); > co 9 ' @ 6) r T T T 4 t=[-10:0.1:10]; x=[P=0]; sell. 4 x=double(x); a=9; heexpatt).*x; aL I a-conv(x,h); plot(a); ost. 4 i ——t — 4 ° tw 70 wo 70 “oo 0718CTS0S 3. Consider two diserete time sequences x[n] and h[n] given by x[n] = 1 for 0

You might also like