?? overlapadd.m
字號:
function [yn] = overlapadd(xn,hn,M)
N = length(hn);
N1 = length(xn);
p = N1/M;
x = zeros(1,M);
y = zeros(p+1,M);
z = zeros(p+1,N1+M-1);
%split input xn into M points segment and store in matrix y
for k = [0:1:p-1]
x = xn(M*k+1:M*(k+1));
y(k+1,:) = x;
end
%handle the leaving elements of xn and add zeros to satisfy
%each segment with M points
if N1>M*(k+1)
l = 1;
for i = [M*(k+1)+1:N1]
y(k+2,l) = xn(i);
l = l+1;
end
end
%conv hn and new input then shift and store the result in a new matrix z
b=0;
for j = [1:p+1]
z(j,b*M+1:b*M+N+M-1) = conv(y(j,:),hn);
b=b+1;
end
%add each row of z so the last row will be the final result
for j = [1:p]
z(j+1,:) = z(j,:)+z(j+1,:)
end
yn = z(j+1,:)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -