psd_autocorrelation.m

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

M
19
字号
function [ap_corr, en_corr] = psd_autocorrelation(xn, p);
%[ap_corr, en_corr] = psd_autocorrelation(xn, p) use the atuocorrelation
%method to estimate the psd of signal xn with a p phase AR model
%ap_corr is the AR coiefficients
%en_corr is the deviation estimated
rxx=correstimate(xn,xn); %caculate the  autocorrelation fo signal xn
%caculate the autocorrelation matrix Rxx;
Rxx=zeros(p);
Rxd=zeros(p,1);
for i=1:p
    for j=1:p
        Rxx(i,j)=rxx(abs(i-j)+1);
    end
    Rxd(i)=rxx(i+1);
end
% caculate the AR coeffcients ap1...app
%Wn = linspace(0,pi,1024);
ap_corr = -(inv(Rxx))*Rxd;
en_corr = rxx(1)+Rxd'*ap_corr;

⌨️ 快捷键说明

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