acm.m

来自「MATLAB programs for Durbin s MA」· M 代码 · 共 24 行

M
24
字号
function [a,err] = acm(x,p)
%ACM	Find an all-pole model using the autocorrelation method
%----
%Syntax is: [a,err] = acm(x,p) 
%
%	The input sequence x is modeled as the unit sample response of
%	a filter having a system function of the form
%		H(z) = b(0)/A(z) 
%	where the coefficients of A(z) are contained in the vector
%		a=[1, a(1), ... a(p)]
%	The input p defines the number of poles in the model.
%	The modeling error is returned in err.
%	The numerator b(0) is typically set equal to the square
%	root of err.
%
x   = x(:);
N   = length(x);
if p>=length(x), error('Model order too large'), end
X   = convm(x,p+1);
Xq  = X(1:N+p-1,1:p);
a   = [1;-Xq\X(2:N+p,1)];
err = abs(X(1:N+p,1)'*X*a);
end

⌨️ 快捷键说明

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