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

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

?? kal.m

?? program tutorial of kalman filter using matlab 7.1
?? M
字號:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Kalman filter intuitive tutorial %
% (c) Alex Blekhman, (end of) 2006 %
% Contact: ablekhman at gmail.com  %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The problem: Predict the position and velocity of a moving train 2 seconds ahead,
% having noisy measurements of its positions along the previous 10 seconds (10 samples a second). 

% Ground truth: The train is initially located at the point x = 0 and moves
% along the X axis with constant velocity V = 10m/sec, so the motion equation of the train is X =
% X0 + V*t. Easy to see that the position of the train after 12 seconds
% will be x = 120m, and this is what we will try to find.

% Approach: We measure (sample) the position of the train every dt = 0.1 seconds. But,
% because of imperfect apparature, weather etc., our measurements are
% noisy, so the instantaneous velocity, derived from 2 consecutive position
% measurements (remember, we measure only position) is innacurate. We will
% use Kalman filter as we need an accurate and smooth estimate for the velocity in
% order to predict train's position in the future.

% We assume that the measurement noise is normally distributed, with mean 0 and
% standard deviation SIGMA
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  

close all
clear all
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Ground truth %%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Set true trajectory 
Nsamples=100;
dt = .1;
t=0:dt:dt*Nsamples;
Vtrue = 10;

% Xtrue is a vector of true positions of the train 
Xinitial = 0;
Xtrue = Xinitial + Vtrue * t;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Motion equations %%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Previous state (initial guess): Our guess is that the train starts at 0 with velocity
% that equals to 50% of the real velocity
Xk_prev = [0; 
    .5*Vtrue];

% Current state estimate
Xk=[];

% Motion equation: Xk = Phi*Xk_prev + Noise, that is Xk(n) = Xk(n-1) + Vk(n-1) * dt
% Of course, V is not measured, but it is estimated
% Phi represents the dynamics of the system: it is the motion equation
Phi = [1 dt;
       0  1];

% The error matrix (or the confidence matrix): P states whether we should 
% give more weight to the new measurement or to the model estimate 
sigma_model = 1;
% P = sigma^2*G*G';
P = [sigma_model^2             0;
                 0 sigma_model^2];

% Q is the process noise covariance. It represents the amount of
% uncertainty in the model. In our case, we arbitrarily assume that the model is perfect (no
% acceleration allowed for the train, or in other words - any acceleration is considered to be a noise)
Q = [0 0;
     0 0];

% M is the measurement matrix. 
% We measure X, so M(1) = 1
% We do not measure V, so M(2)= 0
M = [1 0];

% R is the measurement noise covariance. Generally R and sigma_meas can
% vary between samples. 
sigma_meas = 1; % 1 m/sec
R = sigma_meas^2;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Kalman iteration %%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Buffers for later display
Xk_buffer = zeros(2,Nsamples+1);
Xk_buffer(:,1) = Xk_prev;
Z_buffer = zeros(1,Nsamples+1);

for k=1:Nsamples
    
    % Z is the measurement vector. In our
    % case, Z = TrueData + RandomGaussianNoise
    Z = Xtrue(k+1)+sigma_meas*randn;
    Z_buffer(k+1) = Z;
    
    % Kalman iteration
    P1 = Phi*P*Phi' + Q;
    S = M*P1*M' + R;
    
    % K is Kalman gain. If K is large, more weight goes to the measurement.
    % If K is low, more weight goes to the model prediction.
    K = P1*M'*inv(S);
    P = P1 - K*M*P1;
    
    Xk = Phi*Xk_prev + K*(Z-M*Phi*Xk_prev);
    Xk_buffer(:,k+1) = Xk;
    
    % For the next iteration
    Xk_prev = Xk; 
end;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Plot resulting graphs %%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Position analysis %%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

figure;
plot(t,Xtrue,'g');
hold on;
plot(t,Z_buffer,'c');
plot(t,Xk_buffer(1,:),'m');
title('Position estimation results');
xlabel('Time (s)');
ylabel('Position (m)');
legend('True position','Measurements','Kalman estimated displacement');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Velocity analysis %%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% The instantaneous velocity as derived from 2 consecutive position
% measurements
InstantaneousVelocity = [0 (Z_buffer(2:Nsamples+1)-Z_buffer(1:Nsamples))/dt];

% The instantaneous velocity as derived from running average with a window
% of 5 samples from instantaneous velocity
WindowSize = 5;
InstantaneousVelocityRunningAverage = filter(ones(1,WindowSize)/WindowSize,1,InstantaneousVelocity);

figure;
plot(t,ones(size(t))*Vtrue,'m');
hold on;
plot(t,InstantaneousVelocity,'g');
plot(t,InstantaneousVelocityRunningAverage,'c');
plot(t,Xk_buffer(2,:),'k');
title('Velocity estimation results');
xlabel('Time (s)');
ylabel('Velocity (m/s)');
legend('True velocity','Estimated velocity by raw consecutive samples','Estimated velocity by running average','Estimated velocity by Kalman filter');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Extrapolation 20 samples ahead %%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

SamplesIntoTheFuture = 20;
Nlast = 10; % samples

% We take the last Nlast = 10 samples, and for each of these samples we try to see what would be the
% estimated position of the train at sample number Nsamples + SamplesIntoTheFuture
% if we took the position and the velocity that was known at that sample

TruePositionInTheFuture = Xinitial + (Nsamples + SamplesIntoTheFuture) * Vtrue * dt;

ProjectedPositionByRunningAverage = Xk_buffer(1,(Nsamples+1-Nlast):(Nsamples+1)) + ...
    ((SamplesIntoTheFuture+Nlast):-1:SamplesIntoTheFuture) .* dt .* InstantaneousVelocityRunningAverage((Nsamples+1-Nlast):(Nsamples+1));

ProjectedPositionByKalmanFilter = Xk_buffer(1,(Nsamples+1-Nlast):(Nsamples+1)) + ...
    ((SamplesIntoTheFuture+Nlast):-1:SamplesIntoTheFuture) .* dt .* Xk_buffer(2,(Nsamples+1-Nlast):(Nsamples+1));

figure;
plot(((Nsamples+1-Nlast):(Nsamples+1))*dt,ones(size(1:11))*TruePositionInTheFuture,'m');
hold on;
plot(((Nsamples+1-Nlast):(Nsamples+1))*dt,ProjectedPositionByRunningAverage,'c');
plot(((Nsamples+1-Nlast):(Nsamples+1))*dt,ProjectedPositionByKalmanFilter,'k');
title(['Extrapolation 20 samples ahead (at t = ' num2str((Nsamples + SamplesIntoTheFuture) * dt) ')']);
xlabel('Time of sample used for extrapolation (s)');
ylabel('Expected position (m)');
legend('True position','Estimated position by running average','Estimated position by Kalman filter');

% Note: In this example, we might have increased WindowSize to smoothen
% InstantaneousVelocityRunningAverage. But, as in real conditions the
% velocity of the tracked object is not constant, this will lead to poor
% results in the general case.

% Note: K is a measure of the convergence of the filter, so are P(1,1) and
% P(2,2). When the model is good and the data is consistent with the model,
% these should converge to 0.


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99久久精品久久久久久清纯| 成人动漫视频在线| 国产高清精品在线| 欧美亚洲动漫精品| 国产视频一区不卡| 欧美a一区二区| 91美女片黄在线观看91美女| 精品久久久久久久人人人人传媒| 一区二区三区电影在线播| 国产麻豆视频一区| 欧美精品 国产精品| 亚洲免费高清视频在线| 丁香亚洲综合激情啪啪综合| 精品久久久久av影院| 亚洲午夜国产一区99re久久| 成人激情开心网| 久久精品网站免费观看| 另类小说色综合网站| 欧美日韩性生活| 亚洲va韩国va欧美va| 色婷婷激情综合| 亚洲三级久久久| 成人v精品蜜桃久久一区| 国产欧美日韩在线| 国产一区二区三区四区五区入口 | 国产亚洲人成网站| 韩国在线一区二区| 欧美va在线播放| 美洲天堂一区二卡三卡四卡视频| 欧美日韩国产高清一区二区三区 | 麻豆精品精品国产自在97香蕉| 欧美精品丝袜久久久中文字幕| 亚洲妇熟xx妇色黄| 欧美浪妇xxxx高跟鞋交| 日韩精品亚洲一区二区三区免费| 欧美日韩日本视频| 日韩中文字幕区一区有砖一区 | 亚洲精品免费视频| 色网站国产精品| 亚洲最色的网站| 欧美视频中文一区二区三区在线观看| 亚洲成人av一区二区三区| 欧美日本在线播放| 精品一区二区三区香蕉蜜桃| 久久精品一区二区三区不卡牛牛| 国产成人精品免费网站| 亚洲欧美中日韩| 欧美午夜一区二区| 爽好久久久欧美精品| 日韩一区二区三区视频在线| 韩国av一区二区三区四区| 久久久美女毛片| 成av人片一区二区| 亚洲影院理伦片| 欧美xxxxxxxx| 极品尤物av久久免费看| 欧美一级黄色大片| 国产美女在线观看一区| 中文字幕乱码日本亚洲一区二区| av不卡一区二区三区| 一区二区三区久久| 日韩免费观看2025年上映的电影 | 日韩欧美国产一二三区| 国产一区二区成人久久免费影院| 1区2区3区欧美| 欧美喷潮久久久xxxxx| 精品一区二区三区免费播放 | 日韩黄色小视频| 精品人在线二区三区| 99麻豆久久久国产精品免费 | 高清shemale亚洲人妖| 亚洲国产日韩综合久久精品| 日韩一区二区三区在线视频| 风间由美一区二区三区在线观看 | 久久成人av少妇免费| 中文欧美字幕免费| 欧美精品三级日韩久久| 国产成人午夜高潮毛片| 亚洲成人激情综合网| 亚洲国产精品成人综合| 日韩一区二区三区精品视频| 99riav久久精品riav| 韩国理伦片一区二区三区在线播放| 亚洲美女在线国产| 国产视频一区二区在线| 91麻豆精品国产91| 色又黄又爽网站www久久| 国产专区欧美精品| 日本一区中文字幕| 成人国产免费视频| 亚洲午夜在线观看视频在线| 中文字幕一区二区三| 精品国产欧美一区二区| 欧美一区二区三区免费| 色菇凉天天综合网| eeuss鲁片一区二区三区 | 丝袜诱惑制服诱惑色一区在线观看 | 日韩色在线观看| www.亚洲色图.com| 国内精品国产成人| 日韩成人精品视频| 亚洲资源中文字幕| 国产精品久久久久久亚洲伦| 6080亚洲精品一区二区| 一本色道久久综合狠狠躁的推荐| 青青草伊人久久| 日韩va欧美va亚洲va久久| 亚洲一区中文在线| 亚洲精品一区二区三区四区高清| 成人免费视频国产在线观看| 午夜精品福利一区二区蜜股av| 一区二区中文字幕在线| 中文av字幕一区| 国产欧美一区二区在线观看| 日韩一区二区麻豆国产| 欧美肥大bbwbbw高潮| 在线视频一区二区免费| 国产精品亚洲视频| 国产黄色精品网站| 久久精品国产精品青草| 亚洲一区二区三区小说| 亚洲精品视频在线看| 国产精品成人午夜| 欧美一区二区三区白人| 精品伦理精品一区| 精品久久人人做人人爰| 精品国产免费人成电影在线观看四季 | 一本久久精品一区二区| 国产精品乱人伦一区二区| 欧美日韩一区 二区 三区 久久精品| 99麻豆久久久国产精品免费优播| 成人午夜私人影院| 成人sese在线| 一本大道久久a久久综合婷婷 | 久久精品日韩一区二区三区| 欧美日韩一区二区欧美激情| 日韩欧美国产一区在线观看| 精品毛片乱码1区2区3区| 久久综合色天天久久综合图片| 久久久久久9999| 国产日韩欧美电影| 国产日本一区二区| 一区二区欧美视频| 香蕉加勒比综合久久| 日本va欧美va精品| 国产成人av电影在线| 韩国成人精品a∨在线观看| 99r精品视频| 欧美日韩国产系列| 欧美zozozo| 中文字幕国产一区| 一区二区免费看| 国产精品综合av一区二区国产馆| 成人激情动漫在线观看| 欧洲激情一区二区| 欧美精品一区二区在线观看| 欧美经典三级视频一区二区三区| 亚洲成av人在线观看| 狠狠色丁香久久婷婷综| 不卡电影一区二区三区| 欧美午夜精品久久久| 精品日韩欧美一区二区| 亚洲国产精品精华液2区45| 日韩vs国产vs欧美| 成人激情图片网| 正在播放亚洲一区| 国产三级欧美三级日产三级99 | 国产偷国产偷精品高清尤物| 亚洲欧美另类综合偷拍| 久久精品国产澳门| 91亚洲精品一区二区乱码| 色哟哟亚洲精品| 国产欧美日韩精品a在线观看| 亚洲蜜臀av乱码久久精品| 黄色资源网久久资源365| 91色porny在线视频| 日韩欧美激情在线| 婷婷综合五月天| 97精品久久久午夜一区二区三区 | 美女爽到高潮91| 99久久精品免费精品国产| 日韩精品一区二区三区swag| 亚洲美女在线一区| 日本视频中文字幕一区二区三区| 91亚洲午夜精品久久久久久| 精品成人一区二区三区四区| 亚洲小说春色综合另类电影| 成人在线综合网站| 欧美人伦禁忌dvd放荡欲情| 亚洲精品亚洲人成人网在线播放| 国产一区二区三区黄视频| 欧美性做爰猛烈叫床潮| 亚洲欧洲美洲综合色网| 午夜精品久久久| 欧美精品第一页| 亚洲成人www| 欧美日韩综合在线| 一区二区三区四区av| 色综合久久中文字幕综合网| 国产性做久久久久久|