亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ekfm.m

?? Kalman filter that can be simulated under windws
?? M
字號:
function [xhat_data,Pmat]=ekfm(kalmfilex,kalmfiley,linfile,xbar,...
                P0,q,r,u,y,timeidx,optpar)
% EKFM
%  This function is an implementation of the conventional
%  extended Kalman filter (EKF).
%  It is implemented to handle multiple observation streams.
%  The filter estimates the states for nonlinear systems written in
%  the general form:
%               x(k+1) = f[x(k),u(k),v(k)]
%               y1(k)  = g1[x(k),w1(k)]
%                        :
%               yn(k)  = gn[x(k),wn(k)]
%   where 'x' is the state vector, 'u' is a possible input, and 'v' and 'w'
%   are (white) noise sources.
%
% Call:
%   [xhat,Pmat]=ekfm(xfunc,yfunc,linfunc,x0,P0,q,r,u,y,tidx,optpar) 
%
% Input:
%   xfunc   - Name of function containing the state equations.
%   yfunc   - Cell array specifying the names of the functions 
%             containing the output equations.
%   linfunc - Function containing linearization procedure.
%   x0      - Initial state vector.
%   P0      - Initial covariance matrix (symmetric, nonnegative definite).
%   q       - Covariance matrices for process noise.
%   r       - Cell array containing the measurement noise cov. matrices. 
%   u       - Input signal. Dimension is [samples x inputs].
%             Use [] if there are no inputs.
%   y       - Cell array containing the output signals. 
%             Dimension of each stream is [observations x outputs-in-stream].
%   tidx    - Cell array containing vector with time stamps (in samples) 
%             for the observations in y.
%   optpar  - Data structure containing optional parameters:
%             .init : Initial parameters for 'xfile', 'yfile', and
%                     'linfile' (use an arbitrary format).
%
% Output:
%   xhat    - State estimates. Dimension is [samples+1 x states].
%   Pmat    - Matrix where each row contains the upper triangular elements
%             of the covariance matrix estimates. The dimension is 
%             [samples+1 x 0.5*states*(states+1)]. The individual covariance 
%             matrices can later be extracted with MAT2COV.
%
% The user must write the three functions 'xfunc', 'yfunc', and 'linfunc' 
% containing state update, output equation, and linearization. The 
% function containing the state update should have the header 
% (the function name is arbitrary):
%       function x=my_xfile(x,u,v)
%
% the functions containing output equations must have the header
%       function y=my_yfile(x,w)
%
% while the function containing the linearization must have the header
%      function [M,N]=my_linfile(x,u,vw,flag)
% flag=0: Linearization of the state equation
% flag=i: Linerization of the output equation no. i (i=1...n).
%  
% In all three cases, an initialization of constant parameters can be 
% made using the parameter 'optpar.init'. This parameter is passed through
% x if the functions are called with only one parameter.
% 
% Written by Magnus Norgaard
% LastEditDate: Nov. 9, 2001

% >>>>>>>>>>>>>>>>>>>>>>>>>>> INITIALIZATIONS <<<<<<<<<<<<<<<<<<<<<<<<<<
nx           = size(P0,1); % # of states
nv           = size(q,1);  % # of process noise sources
if isempty(xbar),          % Set to x0=0 if not specified 
  xbar = zeros(nx,1);
elseif length(xbar)~=nx,
  error('Dimension mismatch between x0 and P0');
end
streams    = length(y);
if ~(iscell(kalmfiley) & iscell(r) & iscell(timeidx) & iscell(y))
  error('"yfunc", "r", "tidx", and "y" must be cell array');
elseif (streams~=length(r) | streams~=length(timeidx) | ...
                                 streams~=length(kalmfiley))
  error('"yfunc", "r", "tidx", and "y" must have same number of cells');
end
ny         = 0;                % Total number of observations
lastsample = 0;                % Number of sample containing last observation
idx1 = zeros(streams,1);       % Index to start of each stream in ybar
idx2 = zeros(streams,1);       % Index to end of each stream in ybar
for n=1:streams,               % Wrap information about observation stream 
  obs(n).yfunc = kalmfiley{n}; % into data structure
  obs(n).y     = y{n};
  obs(n).tidx  = timeidx{n};
  obs(n).ny    = size(obs(n).y,2);
  obs(n).nobs  = size(obs(n).y,1);
  obs(n).r     = r{n};
  obs(n).nw    = size(obs(n).r,1);
  if (obs(n).nobs~=size(obs(n).tidx,1)),
    error('Dimension mismatch between y and tidx');
  end
  ny = ny + obs(n).ny;
  if obs(n).tidx(end)>lastsample,
     lastsample=obs(n).tidx(end);
  end
  idx1(n) = ny - obs(n).ny + 1;
  idx2(n) = ny;
end
if isempty(u),             % No inputs
  nu = 0; samples = lastsample; uk1 = [];
else
  [samples,nu] = size(u);  % # of samples and inputs
end

Pxbar = P0;                % A priori estimate = initial covariance
xhat_data = zeros(samples+1,nx); % Matrix for storing state estimates
Pmat      = zeros(samples+1,0.5*nx*(nx+1)); % Matrix for storing cov. matrices
pidx      = find(tril(reshape(1:nx*nx,nx,nx))); % Index in P
ybar      = zeros(ny,1);
yidx  = ones(streams,1);   % Index into y-vectors 


% ----- Initialize state+output equations and linearization -----
if nargin<11,              % No optional parameters passed
   optpar = [];
end
if isfield(optpar,'init')  % Parameters for m-functions
   initpar = optpar.init;
else
   initpar = [];
end
vmean = zeros(nv,1);       % Mean of process noise
for n=1:streams,           % Mean of measurement noise
   obs(n).wmean = zeros(obs(n).nw,1);
end

feval(kalmfilex,initpar);      % Initialize state equation
for n=1:streams,
   feval(obs(n).yfunc,initpar);% Initialize output equations
end
feval(linfile,initpar);        % Initialize linearization

counter = 0;                   % Counts the progress of the filtering session
waithandle=waitbar(0,'Filtering in progress'); % Initialize waitbar

% >>>>>>>>>>>>>>>>>>>>>>>>>>>>>> FILTERING <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
for k=0:samples,

  % --- Measurement update (a posteriori update) ---
  for n=1:streams,
    ybar(idx1(n):idx2(n)) = feval(obs(n).yfunc,xbar,obs(n).wmean);
    if (k<=obs(n).tidx(end) & obs(n).tidx(yidx(n))==k),
    
      % Linearization
      [C,G] = feval(linfile,xbar,[],obs(n).wmean,n);

      % Kalman gain
      if isempty(G),                      
         K = Pxbar*C'/(C*Pxbar*C'+obs(n).r); % Noise enters directly
      else
         K = Pxbar*C'/(C*Pxbar*C'+G*obs(n).r*G');% General update
      end

      % A posteriori covariance
      Pxbar = Pxbar-K*C*Pxbar;
      
      % State estimate
      xbar = xbar + K*[obs(n).y(yidx(n),:)'-ybar(idx1(n):idx2(n))];      
      yidx(n) = yidx(n) + 1;              % Update index in time vector
    end
  end
  xhat = xbar;
  Px   = Pxbar;
  
  % --- Time update (a'priori update) of state and covariance ---
  if k<samples,
    if nu>0 uk1 = u(k+1,:)'; end
    xbar=feval(kalmfilex,xhat,uk1,vmean);    % State update
    [A,F] = feval(linfile,xhat,uk1,vmean,0); % Linearization
    if isempty(F),                     % Covariance update
       Pxbar = A*Px*A' + q;            % Noise enters directly
    else
       Pxbar = A*Px*A' + F*q*F';       % General update
    end
  end
  
  % --- Store results ---
  xhat_data(k+1,:) = xhat';
  Pmat(k+1,:)      = Px(pidx)';
   
  % --- How much longer? ---
  if (counter+0.01<= k/samples),
     counter = k/samples;
     waitbar(k/samples,waithandle);  % Update waitbar
  end
end
close(waithandle);                   % Close waitbar window

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕乱码亚洲精品一区| 欧美怡红院视频| 精品久久人人做人人爰| 日韩和欧美一区二区| 在线不卡欧美精品一区二区三区| 一区二区三区在线视频观看 | 中文字幕欧美日本乱码一线二线| 国产一区二区福利视频| 国产亚洲成年网址在线观看| 成人小视频免费在线观看| 国产精品久久夜| 91色九色蝌蚪| 亚洲一区二区三区四区在线观看| 欧美日韩在线亚洲一区蜜芽| 免费观看91视频大全| 精品国产一区a| 成人在线视频一区| 亚洲免费看黄网站| 91精品午夜视频| 精品一区二区日韩| 国产精品天美传媒沈樵| 欧美性色欧美a在线播放| 三级欧美韩日大片在线看| 亚洲一区二区三区四区的| 欧美一区二区私人影院日本| 国产一区视频网站| 亚洲三级在线播放| 欧美日韩aaaaaa| 国产乱人伦偷精品视频免下载 | 一区二区中文视频| 欧美色偷偷大香| 国产一二精品视频| 亚洲精品久久久蜜桃| 欧美一区二区三区公司| 懂色av一区二区夜夜嗨| 亚洲国产精品尤物yw在线观看| 欧美成人r级一区二区三区| 成人丝袜高跟foot| 性做久久久久久久免费看| 久久色在线视频| 欧美午夜宅男影院| 国产成人综合自拍| 日韩影视精彩在线| 国产精品区一区二区三区| 91精品在线麻豆| 9久草视频在线视频精品| 青青草国产精品97视觉盛宴| 亚洲人一二三区| www成人在线观看| 欧美日韩成人综合在线一区二区| 成人一区二区三区中文字幕| 日韩电影在线免费| 亚洲欧美在线高清| 久久综合五月天婷婷伊人| 在线亚洲精品福利网址导航| 国产成人免费视频网站| 热久久一区二区| 一区二区三区中文字幕电影 | 国产精品国产精品国产专区不蜜 | 2023国产精品视频| 69成人精品免费视频| 色欲综合视频天天天| 国产精品一品二品| 精品中文字幕一区二区小辣椒| 一区二区三国产精华液| 国产精品久久久久精k8| 久久久久久久久久久久电影| 日韩免费在线观看| 91精品国产一区二区三区| 91久久精品日日躁夜夜躁欧美| 成人精品gif动图一区| 国产在线一区观看| 国产在线精品一区二区| 看电影不卡的网站| 日韩av不卡在线观看| 亚洲一区av在线| **欧美大码日韩| 国产精品午夜电影| 中文在线一区二区| 中文字幕第一区二区| 久久久久久久久久久久久久久99 | 国产精品视频麻豆| 国产精品久久看| 中文字幕欧美日韩一区| 中文字幕欧美日本乱码一线二线| 国产欧美日韩精品在线| 国产日韩欧美麻豆| 奇米影视7777精品一区二区| 日本不卡不码高清免费观看| 免费高清在线一区| 九一久久久久久| 狠狠色伊人亚洲综合成人| 国模少妇一区二区三区| 国产精品456| 不卡视频在线看| 91蜜桃婷婷狠狠久久综合9色| 91免费在线视频观看| 欧美亚洲综合久久| 欧美一区午夜视频在线观看| 精品国产伦理网| 国产清纯在线一区二区www| 亚洲欧洲日韩一区二区三区| 亚洲乱码中文字幕| 午夜精品久久久久| 久草在线在线精品观看| 国产91丝袜在线播放| 一本久久a久久免费精品不卡| 欧美在线观看一二区| 日韩一区二区在线播放| 国产欧美日本一区二区三区| 亚洲欧美经典视频| 蜜桃视频在线观看一区| 成人精品国产免费网站| 欧美伊人精品成人久久综合97| 欧美一区二区三区视频| 日本一区二区三区四区 | 欧美午夜精品久久久久久超碰| 91精品国产综合久久国产大片| 久久久久久久久99精品| 亚洲激情欧美激情| 韩国午夜理伦三级不卡影院| www.亚洲人| 欧美一区二区日韩| 中文字幕亚洲成人| 奇米色一区二区三区四区| 成人性生交大合| 日韩一区二区电影在线| 国产精品成人免费精品自在线观看| 亚洲成人福利片| 国产不卡高清在线观看视频| 欧美老女人第四色| 国产精品国产三级国产普通话蜜臀| 香蕉成人伊视频在线观看| 成人午夜精品在线| 制服丝袜亚洲网站| 亚洲柠檬福利资源导航| 国产中文字幕一区| 666欧美在线视频| ...xxx性欧美| 国产福利一区二区| 日韩欧美一区二区视频| 亚洲男人天堂av| 国产suv一区二区三区88区| 一区免费观看视频| 国产精品12区| 日韩一区二区麻豆国产| 亚洲天堂网中文字| 国产精品系列在线观看| 日韩一卡二卡三卡国产欧美| 亚洲综合色区另类av| 91免费版pro下载短视频| 国产人久久人人人人爽| 久久91精品久久久久久秒播| 欧美一区日韩一区| 人人精品人人爱| 欧美一区二区三级| 日本亚洲电影天堂| 欧美精品乱码久久久久久| 亚洲成va人在线观看| 91久久国产最好的精华液| 一区二区三区日韩在线观看| 成人激情动漫在线观看| 久久久99久久| 国产呦精品一区二区三区网站| 精品少妇一区二区三区视频免付费 | 一区二区三区四区蜜桃| 91蜜桃传媒精品久久久一区二区| 国产欧美日产一区| 国产成人av影院| 日韩精品一区二区三区老鸭窝| 亚洲午夜久久久久| 色94色欧美sute亚洲线路二| 一区二区三区日韩| 97久久精品人人爽人人爽蜜臀| 国产亚洲欧美一级| 亚洲欧洲www| 日本韩国欧美一区二区三区| 国产精品动漫网站| 99久久免费精品| 尤物av一区二区| 色狠狠av一区二区三区| 亚洲欧洲成人精品av97| 国产成+人+日韩+欧美+亚洲| 国产精品欧美极品| 国产成人a级片| 国产精品狼人久久影院观看方式| 99精品视频中文字幕| 国产精品色噜噜| av不卡在线观看| 精品成人在线观看| 国产一区二区不卡| 国产欧美日本一区二区三区| 精品午夜一区二区三区在线观看| 欧美激情综合在线| av欧美精品.com| 国产蜜臀av在线一区二区三区| 99re6这里只有精品视频在线观看| 亚洲天天做日日做天天谢日日欢| 一本到高清视频免费精品| 欧美bbbbb|