You are on page 1of 1

To find circular convolution for two sequences of unequal length

August 2, 2012

Input:
l=input('enter the length of first sequence') for u=1:l x(u)=input('enter the elements of first seq'); end k=input('enter the length of second sequence') for e=1:k h(v)=input('enter the elements of second sequence'); end m=max(l,k) x=[x zeros(1,(m-l))] h=[h zeros(1,(m-k))] z=zeros(1,m) b(1)=h(1) for p = 1:m-1 b(p+1)=h(m-p+1) end for a=0:m-1 sum=0 for t=1:m sum=sum+x(t)*b(t) end b=circshift(b,[0,1]) z(a+1)=sum end

Output:

You might also like