📄 acm.m
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -