資源簡介
使用自己編寫的程序?qū)?shù)據(jù)進(jìn)行卷積運(yùn)算,輸入x和h兩個(gè)數(shù)據(jù)矩陣就可以進(jìn)行卷積運(yùn)算
代碼片段和文件信息
function?y=myconv(hx)?
n=length(x);??
k=length(h);??????%定義序列長度?
for?m=1:1:(n-1)???????
????A(m)=0;????????
end
for?m=n:1:n+k-1??????
????A(m)=h(m-n+1);?%給h序列添(n-1)個(gè)0?
end
B=hankel(A);
????for?i=1:1:n??????
????????C(:i)=B(:i);%抽取B矩陣中從第1列到第n列的矩陣
????end
????D=flipl
評(píng)論
共有 條評(píng)論