correstimate.m

来自「基于AR模型的现代谱估计」· M 代码 · 共 21 行

M
21
字号
function r=correstimate(x,y)

%CORRESTIMATE(x,y) estimate the inter correlation of signal x and y;
%Use the following function estimation method:
%       1 N-m-1
%  R(m)=-  {<{ x(n)y'(n+m)
%       N  n=0

if(length(x)~=length(y)) 
    error('The input vector x and y must have the same length');
end
N=length(x);
r=zeros(1,N);
temp=0;
for m=0:N-1
    for n=0:(N-m-1)
        temp=temp+x(n+1)*conj(y(n+m+1));
    end
    r(m+1)=temp/N;
    temp=0;
end

⌨️ 快捷键说明

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