⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bierman.m

📁 Kalman Filtering Theory and Practice, Using MATLAB
💻 M
字号:
function [x,U,D] = bierman(z,R,H,xin,Uin,Din)
%
% Matlab implementation of the
% Bierman ``square root filtering without square roots''
%
% From the diskette included with
% M. S. Grewal, L. R. Weill and A. P. Andrews
% Global Positioning Systems, Inertial Navigation and Integration
% John Wiley & Sons, 2000.
%
% INPUTS:
%  z    measurement (SCALAR)
%  R    variance of measurement error
%  H    measurement sensitivity (row) vector
%  xin  a priori estimate of state vector
%  Uin  unit upper triangular factor of covariance matrix of a priori state uncertainty
%  Din  diagonal factor of covariance matrix of a priori state uncertainty
% OUTPUTS:
%  x    a posteriori estimate of state vector
%  U    upper triangular UD factor of a posteriori state uncertainty covariance
%  D    diagonal UD factor of a posteriori state uncertainty covariance
%
x     = xin;      % Store inputs into outputs, 
U     = Uin;      % because algorithm does in-place
D     = Din;      % (destructive) calculation of outputs.
a     = U'*H';    % a is not modified, but
b     = D*a;      % b is modified to become unscaled Kalman gain.
dz    = z - H*xin;
alpha = R;
gamma = 1/alpha;
  for j=1:length(xin),
  beta   = alpha;
  alpha  = alpha + a(j)*b(j);
  lambda = -a(j)*gamma;
  gamma  = 1/alpha;
  D(j,j) = beta*gamma*D(j,j);
    for i=1:j-1,
    beta   = U(i,j);
    U(i,j) = beta + b(i)*lambda;
    b(i)   = b(i) + b(j)*beta;
    end;
  end
dzs = gamma*dz;  % apply scaling to innovations
x   = x + dzs*b; % multiply by unscaled Kalman gain
return;

⌨️ 快捷键说明

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