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

📄 simple_kalman_update.m

📁 IMM PDAF跟踪滤波的程序
💻 M
字号:
function [xnew, Pnew, K, loglik] = Simple_Kalman_Update(F, H, Q, R, y, x, P)
% KALMAN_UPDATE Do a one step update of the Kalman filter
% [xnew, Pnew, K, loglik] = Simple_Kalman_Update(F, H, Q, R, y, x, P)
%
% Given
%  x(:) =   E[ X | Y(1:t-1) ] and
%  P(:,:) = Var[ X(t-1) | Y(1:t-1) ],
% compute 
%  xnew(:) =   E[ X | Y(1:t-1) ] and
%  Pnew(:,:) = Var[ X(t) | Y(1:t) ],
% using
%  y(:)   - the observation at time t
%  F(:,:) - the system matrix
%  H(:,:) - the observation matrix
%  Q(:,:) - the system covariance
%  R(:,:) - the observation covariance
%

% a priori
xpred   = F*x;
Ppred   = F*P*F' + Q;

% error (innovation)
e       = y - H*xpred; 

S       = H*Ppred*H' + R;
Sinv    = inv(S);
K       = Ppred*H'*Sinv; % Kalman gain matrix

% log likelihood
loglik  = gaussian_prob(e, zeros(size(e)), S, 0); %0);

% updated
xnew    = xpred + K*e;
Pnew    = (eye(size(F)) - K*H)*Ppred;

%K

⌨️ 快捷键说明

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