ARMA 模型的 Matlab 代码
来源:http://www.mathworks.com/matlabcentral/fileexchange/16425
%--------------------------------------------------------------------------
%
% ARMA_LAST.M
%
% This function provides an ARMA spectral estimate which is maximum
% entropy satisfying correlation constraint (number of poles)and cepstrum
% constrains (number of ceros)
%
% [sigma,outn,outd]=arma_last(xinf,np,nq)
%
% The function requires:
%
% xinf(nsam) Input signal (real valued) of nsam samples
% nq Order of the denominator (# of poles)
% np Order of the numerator (# of ceros)
%
% The function provides:
%
% outd(nq) The numerator coefficients outn(1)=1
% outn(np) The denominator coefficients outd(1)=1
% sigma The square-root of input noise power
%
% The function requires spa_corc.m to compute the autocorrealtion matrix
% estimate
%
% Miguel Angel LAGUNAS and Petre STOICA June 2007
%
%--------------------------------------------------------------------------
function [sigma,outn,outd]=arma_last(xinf,np,nq);
nsam=length(xinf);ra1=spa_corc(xinf,nq);nle=(nsam/2);
ra2=spa_corc(xinf,nle);=eig(ra2);
d1=diag(log(diag(d)));ca1=u*d1*u';clear u d1 d ra2 nsam;
for i=1:np
cuso(i)=0;
for j=1:nle-i;
cuso(i)=cuso(i)+ca1(j,i+j);
end;cuso(i)=cuso(i)/(nle);
end;
cep=(1:1:np).*cuso(1:np);clear ca1 nle cuso;
i=2;h(1)=1;
while i<np+0.5;
h(i)=0;