Revision as of 11:03, 1 July 2009 by Zhang205 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

function y = myconv(x,h)

Lx=length(x); Lh=length(h);

X=[x zeros(1,Lh-1)];

H=[h zeros(1,Lx-1)];

n = Lx + Lh -1; % Length of the output signal

y=zeros(1,n); % initial y

for i=1:n

   for(j=1:i)
       y(i)=y(i)+X(j)*H(i-j+1);
   end

end


stem(y) % make it like a discrete signal

Alumni Liaison

Prof. Math. Ohio State and Associate Dean
Outstanding Alumnus Purdue Math 2008

Jeff McNeal