📄 acf2pacf.m
字号:
function [PACF,PHI,PE]= acf2pacf(ACF,E0);
% This function will be refused in future versions
% Use [tmp,PACF]=DURLEV(E0*[1 ACF]) instead;
%
% Partial Autocorrelation function
% [PACF] = acf2pacf(ACF);
% converts ACF to PACF
%
% Input: ACF Autocorrelation function
% Output: PACF partitial autocorrelation function
% (According to Haykin 1986 is it the PARCOR coeefficient or refection coefficient GAMMA)
% PHI AR-Parametermatrix
% PE Power of Error process depending on model order
% Version 2.32
% last revision 27.04.1998
% Copyright (c) 1997, 1998 by Alois Schloegl
% e-mail: a.schloegl@ieee.org
%This library is free software; you can redistribute it and/or
%modify it under the terms of the GNU Library General Public
%License as published by the Free Software Foundation; either
%version 2 of the License, or (at your option) any later version.
%
%This library is distributed in the hope that it will be useful,
%but WITHOUT ANY WARRANTY; without even the implied warranty of
%MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
%Library General Public License for more details.
%
%You should have received a copy of the GNU Library General Public
%License along with this library; if not, write to the
%Free Software Foundation, Inc., 59 Temple Place - Suite 330,
%Boston, MA 02111-1307, USA.
% Check Input
[nr,nc]=size(ACF);
if (nr~=1) & (nc~=1)
error('ARP must be vector');
end;
if nr~=1, ACF=ACF.'; nc=nr;
end;
% Start
N=nc;
PHI=zeros(N,N);
PHI(1,1) = ACF(1);
PE=zeros(1,N);
PE(1)=ACF(1);
PE(1)=E0;
PE(2)=ACF(1)*E0;
for K=1:N-1,
G=(ACF(K+1)-PHI(K,1:K)*ACF(K:-1:1)')/(1-PHI(K,1:K)*ACF(1:K)');
PHI(K+1,1:K)=PHI(K,1:K)-G*PHI(K,K:-1:1);
PHI(K+1,K+1)=G;
PE(K+2)=PE(K+1)*(1-G*G');
end;
PACF = diag(PHI)';
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -