circonvt.m

来自「matlab的一些基础程序」· M 代码 · 共 21 行

M
21
字号
function [y]=circonvt(x1,x2,N)
%[y]=cirshftt(x,m,N)
%y=output sequence containing the
if length(x1)>N 
   error('N must be >= the length of x1')
end
%check for length of x2
if length(x2)>N 
   error('N must be >= the length of x2')
end

x1=[x1 zeros(1,N-length(x1))];
x2=[x2 zeros(1,N-length(x2))];
m=[0:1:N-1];
x2=x2(mod(-m,N)+1);
H=zeros(N,N); 
for n=1:1:N;
   H(n,:)=cirshftt(x2,n-1,N);
end;
y=x1*H';

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?