📄 yuwa.m
字号:
function [arp] = yuwa(ACF);
% use DURLEV.M, this function will be refused in future versions
%
% function [arp] = yuwa(ACF);
% estimates AR(p) model parameter by solving the
% Yule-Walker equations
% ACF Autocovariance function [0..P]
% arp autoregressive model parameter
% Version 2.40
% last revision 12.05.1998
% Copyright (c) 1996-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.
[p,nc]=size(ACF);
%if p<nc ACF=ACF'; p=nc; end;
arp=durlev(ACF)';
return;
p=p-1;
if (p>195), % use higher overhead, but asymptotically faster algorithm
% Levinson-Durbin Algorithm
arp=zeros(p,1);
arp=ACF(1); % Inititialization
for K=1:p-1,
arp(K+1)=(ACF(K+1)-arp(1:K)*ACF(K:-1:1))/(1-arp(1:K)*ACF(1:K));
arp(1:K)=PHI(1:K)-arp(K+1)*arp(K:-1:1);
end;
else % use the good old \ command
arp = toeplitz(ACF(1:p))\ACF(2:p+1);
end;
return;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -