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

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

?? ekfm.m

?? 卡爾曼濾波
?? 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一区二区三区免费野_久草精品视频
精品亚洲国内自在自线福利| www国产精品av| 亚洲精品国产精华液| 丰满白嫩尤物一区二区| 久久亚洲一区二区三区明星换脸 | 中文字幕在线免费不卡| 国产成人夜色高潮福利影视| 久久伊人中文字幕| 国产jizzjizz一区二区| 国产精品久久久久影院| 97久久超碰国产精品电影| 亚洲欧洲无码一区二区三区| 成人性生交大片免费看中文网站| 国产日产欧美精品一区二区三区| jlzzjlzz亚洲日本少妇| 亚洲高清不卡在线观看| 精品国产电影一区二区| 99精品欧美一区二区三区综合在线| 国产精品久久久久一区| 欧美日韩国产综合视频在线观看| 日韩高清不卡一区| 国产精品久久久久毛片软件| 欧美性猛交xxxx黑人交| 韩国av一区二区三区四区| 亚洲欧美在线视频观看| 欧美一区二区三区在线视频| 国产精品一区三区| 美女在线观看视频一区二区| 中文字幕二三区不卡| 欧美军同video69gay| a在线播放不卡| 久久精品国产99国产| 亚洲一线二线三线视频| 国产亚洲短视频| 精品成人一区二区三区| 777精品伊人久久久久大香线蕉| 成人av综合在线| 国产精品一区二区久久精品爱涩 | 最好看的中文字幕久久| 国产亚洲欧美色| 精品sm在线观看| www久久精品| 国产亚洲一区二区在线观看| 精品少妇一区二区| 欧美成人精品1314www| 日韩欧美国产精品一区| 制服丝袜亚洲网站| 欧美精品久久久久久久多人混战| 欧美在线观看禁18| 精品视频1区2区| 日韩欧美一级精品久久| 日韩一区二区精品| 亚洲激情网站免费观看| 亚洲成人久久影院| 免费成人小视频| 国产一区欧美二区| 不卡电影一区二区三区| 欧美体内she精高潮| 日韩精品一区二区三区中文不卡| 欧美日韩国产另类不卡| 精品欧美乱码久久久久久| 日本一区二区在线不卡| 亚洲一区二区美女| 国产一区二区三区免费看| 成人黄色电影在线| 欧美在线观看你懂的| 久久这里只有精品6| 亚洲你懂的在线视频| 青青草精品视频| 白白色 亚洲乱淫| 欧美一区二区三区不卡| 中文字幕一区av| 韩国在线一区二区| 日本久久一区二区三区| 久久久精品国产免费观看同学| 亚洲男人的天堂在线aⅴ视频| 日产国产欧美视频一区精品| 成人av电影在线观看| 精品国产一二三| 午夜精品在线看| 色婷婷av一区二区三区gif| 精品国精品自拍自在线| 日韩精品一卡二卡三卡四卡无卡| 国产白丝精品91爽爽久久| 91精品国产丝袜白色高跟鞋| 亚洲乱码精品一二三四区日韩在线| 国产一区二区三区在线观看精品 | 国产乱子伦视频一区二区三区| 欧美日韩一区二区三区免费看| 国产精品动漫网站| av不卡免费电影| 国产精品福利一区| 成人av在线资源| 亚洲人一二三区| 色视频一区二区| 亚洲黄网站在线观看| 一本久久综合亚洲鲁鲁五月天| 国产精品区一区二区三| 懂色av中文一区二区三区| 久久久久免费观看| 成人丝袜视频网| 亚洲综合在线视频| 91麻豆精品国产91久久久使用方法| 亚洲线精品一区二区三区八戒| 欧美视频一区在线观看| 免费的成人av| 中文字幕av不卡| 在线欧美小视频| 久久激五月天综合精品| 国产精品区一区二区三区| 色综合久久88色综合天天| 日韩国产在线一| 中文字幕在线观看不卡视频| 精品视频在线视频| 国产在线观看免费一区| 亚洲男同性视频| 欧美成人一区二区三区| 波波电影院一区二区三区| 亚洲综合在线五月| 国产精品不卡视频| 日韩精品自拍偷拍| 欧美亚洲日本一区| 不卡免费追剧大全电视剧网站| 午夜亚洲福利老司机| 国产精品乱人伦| 欧美成人三级在线| 欧美伦理电影网| 欧美这里有精品| 成人福利电影精品一区二区在线观看| 一区二区三区在线视频免费| 久久奇米777| 日韩欧美国产wwwww| 久久久99精品免费观看不卡| 欧美日韩国产不卡| 欧美性大战久久久久久久蜜臀| 国产69精品久久777的优势| 另类小说图片综合网| 日韩av在线发布| 日韩电影一区二区三区| 亚洲图片一区二区| 亚洲电影在线免费观看| 伊人色综合久久天天人手人婷| 欧美韩国日本不卡| 中文字幕人成不卡一区| 亚洲欧洲日产国产综合网| 国产精品无码永久免费888| 精品国产一区二区三区久久影院| 日韩手机在线导航| 久久综合视频网| 欧美激情艳妇裸体舞| 亚洲柠檬福利资源导航| 亚欧色一区w666天堂| 丝袜美腿一区二区三区| 极品美女销魂一区二区三区免费| 久久国产精品无码网站| 成人丝袜视频网| 欧美美女一区二区三区| 精品久久国产97色综合| 国产欧美日韩精品一区| 亚洲同性同志一二三专区| 午夜精品久久久久久久久久| 视频一区免费在线观看| 极品美女销魂一区二区三区免费 | 亚洲成人一二三| 国产一区在线观看视频| 色综合欧美在线| 精品国产乱码久久久久久浪潮| 中文字幕av一区二区三区高| 亚瑟在线精品视频| 成人a区在线观看| 日韩精品一区二区三区swag| 亚洲精品欧美激情| 国产成人免费视| 日韩视频免费观看高清完整版| 国产精品日韩成人| 美腿丝袜亚洲色图| 欧美日韩免费一区二区三区| 亚洲国产精品ⅴa在线观看| 日本aⅴ亚洲精品中文乱码| 在线精品视频小说1| 亚洲人午夜精品天堂一二香蕉| 国产一区二区精品久久99| 3atv在线一区二区三区| 亚洲电影第三页| 在线免费一区三区| 亚洲美女在线一区| 91在线视频播放地址| 亚洲少妇30p| 韩国成人精品a∨在线观看| 日韩欧美一级二级三级久久久| 亚洲国产综合人成综合网站| 91免费版pro下载短视频| 中文字幕一区二区三区乱码在线| 国产成人鲁色资源国产91色综| 亚洲精品一区二区三区影院| 七七婷婷婷婷精品国产| 欧美电影免费观看高清完整版| 久久综合综合久久综合| 国产午夜亚洲精品理论片色戒| 国产乱淫av一区二区三区 |