chongdiebaoliu.m
来自「用Matlab实现重叠保留法计算循环卷积的程序实例」· M 代码 · 共 28 行
M
28 行
function y=chongdiebaoliu(h,x,N)
M=length(h);
x_l=length(x);
if M>x_l||M==x_l||N<M
disp('ERROR!');
else
N_ceil=ceil(x_l/(N-M+1));%ceil(A) rounds the elements of A to the nearest integers
%greater than or equal to A. For complex A,
%the imaginary and real parts are rounded independently.
y0=[zeros(1,M-1),x,zeros(1,N*N)];
y1=zeros(1,N);
y=zeros(1,x_l+M-1);
y_tem_0=zeros(1,N_ceil*(N-M+2));
for i=1:N_ceil+N-1
for j=1:N
tem=(i-1)*(N-M+1)+j;
y1(1,j)=y0(1,tem);
end
y_tem=circonv(h,y1,N);%进行环卷积运
for j=1:N-M+1
tem=(i-1)*(N-M+1)+j;
y_tem_0(1,tem)=y_tem(1,j+M-1);
end
end
for i=1:x_l+M-1
y(1,i)=y_tem_0(1,i);
end
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?