mcov.m

来自「solution for the Statistical modelling f」· M 代码 · 共 73 行

M
73
字号
function [a,err] = mcov(x,p)%MCOV	All-pole signal modeling using the modified covariance method.%----%USAGE	[a,err] = mcov(x,p) %%	An all-pole of order p is found for the input sequence x using%	the modified covariance method.  The model is of the form%		H(z) = b(0)/A(z) %	The coefficients of A(z) are returned in the vector%		a=[1, a(1), ... a(p)]%	and the modeling error is returned in err.%%  See also:  FCOV, COVM, and BURG%%---------------------------------------------------------------% copyright 1996, by M.H. Hayes.  For use with the book % "Statistical Digital Signal Processing and Modeling"% (John Wiley & Sons, 1996).%---------------------------------------------------------------%x   = x(:);N   = length(x);if p>=length(x), error('Model order too large'), endX   = toeplitz(x(p+1:N),flipud(x(1:p+1)));R   = X'*X;R1  = R(2:p+1,2:p+1);R2  = flipud(fliplr(R(1:p,1:p)));b1  = R(2:p+1,1);b2  = flipud(R(1:p,p+1));a   = [1 ; -(R1+R2)\(b1+b2)];err = R(1,:)*a+fliplr(R(p+1,:))*a;end;

⌨️ 快捷键说明

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