matlab 模型参数估计值,AR模型参数估计代码 matlab里面的

满意答案

00e27ab806e4881f8254fe7ae8741834.png

xo20t

2013.04.14

00e27ab806e4881f8254fe7ae8741834.png

采纳率:45%    等级:13

已帮助:8244人

edit arburg

function varargout = arburg( x, p)

%ARBURG AR parameter estimation via Burg method.

% A = ARBURG(X,ORDER) returns the polynomial A corresponding to the AR

% parametric signal model estimate of vector X using Burg's method.

% ORDER is the model order of the AR system.

%

% [A,E] = ARBURG(...) returns the final prediction error E (the variance

% estimate of the white noise input to the AR model).

%

% [A,E,K] = ARBURG(...) returns the vector K of reflection

% coefficients (parcor coefficients).

%

% See also PBURG, ARMCOV, ARCOV, ARYULE, LPC, PRONY.

% Ref: S. Kay, MODERN SPECTRAL ESTIMATION,

% Prentice-Hall, 1988, Chapter 7

% S. Orfanidis, OPTIMUM SIGNAL PROCESSING, 2nd Ed.

% Macmillan, 1988, Chapter 5

% Author(s): D. Orofino and R. Losada

% Copyright 1988-2009 The MathWorks, Inc.

% $Revision: 1.12.4.5 $ $Date: 2009/08/11 15:47:29 $

error(nargchk(2,2,nargin,'struct'))

% Check the input data type. Single precision is not supported.

try

chkinputdatatype(x,p);

catch ME

throwAsCaller(ME);

end

validateattributes(x,{'numeric'},{'nonempty','finite','vector'},'arburg','X');

validateattributes(p,{'numeric'},{'positive','integer','scalar'},'arburg','ORDER');

if issparse(x),

error(generatemsgid('Sparse'),'Input signal cannot be sparse.')

end

if numel(x) < p+1

error(generatemsgid('InvalidDimension'),...

'The length of input vector X must at least %d.',p+1);

end

x = x(:);

N = length(x);

% Initialization

ef = x;

eb = x;

a = 1;

% Initial error

E = x'*x./N;

% Preallocate 'k' for speed.

k = zeros(1, p);

for m=1:p

% Calculate the next order reflection (parcor) coefficient

efp = ef(2:end);

ebp = eb(1:end-1);

num = -2.*ebp'*efp;

den = efp'*efp+ebp'*ebp;

k(m) = num ./ den;

% Update the forward and backward prediction errors

ef = efp + k(m)*ebp;

eb = ebp + k(m)'*efp;

% Update the AR coeff.

a=[a;0] + k(m)*[0;conj(flipud(a))];

% Update the prediction error

E(m+1) = (1 - k(m)'*k(m))*E(m);

end

a = a(:).'; % By convention all polynomials are row vectors

varargout{1} = a;

if nargout >= 2

varargout{2} = E(end);

end

if nargout >= 3

varargout{3} = k(:);

end 展开

00分享举报

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值