function [ y ] = convolve(x, h) % This function convolves two input vectors x and h % This function will use the summation of x sub k * h sub t-k a = length(x); b = length(h); bins = a+b-1; y = zeros(1,bins); % output is this number of bins all initialized to 0 for i = 0:bins for j = 0:bins if ((i-j+1)>0 && (i-j+1)<=b && (j+1)<=a) y(i+1) = y(i+1) + x(j+1).*h(i-j+1); end end end end