r***@gmail.com
2006-01-08 15:20:00 UTC
以下是我寫的程式但是都跑不出來
題目是h[n]=1/4(u[n]-u[n-3])和x[n]=u[n]-u[n-10]做convolution
function Out = convolution(a,b)
h=0.25*ones(1,a);
x=ones(1,b);
c=zeros(1,a b-1);
for (k = 1:a b-1)
c(k)=0;
for (j = 1:b)
if (i>j) & (i-j)<a
c(k) = c(k) h(j)*x(a b-k)
end
end
題目是h[n]=1/4(u[n]-u[n-3])和x[n]=u[n]-u[n-10]做convolution
function Out = convolution(a,b)
h=0.25*ones(1,a);
x=ones(1,b);
c=zeros(1,a b-1);
for (k = 1:a b-1)
c(k)=0;
for (j = 1:b)
if (i>j) & (i-j)<a
c(k) = c(k) h(j)*x(a b-k)
end
end