arls.m

来自「Introduction to Statistical and Adaptive」· M 代码 · 共 38 行

M
38
字号
function [a,e,V,FPE]=arls(x,p)

% function [a,e,V,FPE]=arls(x,p)
% All-Pole (AR) modeling using No-Windowing
% Linear least-squares
% Model parameters [1 a1...ap V]
% V=input signal variance.
% FPE=Akaike's final prediction error criterion
%
% Programmed by: Dimitris Manolakis, 10/1/93
%
%-----------------------------------------------------------
% Copyright 2000, by Dimitris G. Manolakis, Vinay K. Ingle,
% and Stephen M. Kogon.  For use with the book
% "Statistical and Adaptive Signal Processing"
% McGraw-Hill Higher Education.
%-----------------------------------------------------------



Lx=length(x);
R=zeros(p,p);
d=zeros(p,1);
for n=p+1:Lx
   z=[-x(n-p:n-1)']';
   R=R+z*z';
   d=d+x(n)*z;
end

c=R\d;
a=[1 flipud(c(1:p))']';

e=filter(a,1,x);
for n=1:p e(n)=0; end;

V=(e'*e)/(Lx-p);
FPE=V*(1+p/Lx)/(1-p/Lx);

⌨️ 快捷键说明

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