(New page: 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 ...) |
(No difference)
|
Latest revision as of 11:03, 1 July 2009
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