A simple Kalman Filtre Algorithme
2014-02-27 00:11
417 查看
Sorry, cuz there's no chinese input in lab. I just write down in English.
Kalman Filtre Algorithme has been applied in many fields. The most amazing part is the alternant iteration process between state prediction (Time update) and observation update. The core steps of a
standard Kalman Filtre Algorithme are depicited by 5 major équations (cf. http://en.wikipedia.org/wiki/Kalman_filter).
Here I just offer u the souce code of MATLAB and the result.
![](https://img-blog.csdn.net/20140227000951609)
Kalman Filtre Algorithme has been applied in many fields. The most amazing part is the alternant iteration process between state prediction (Time update) and observation update. The core steps of a
standard Kalman Filtre Algorithme are depicited by 5 major équations (cf. http://en.wikipedia.org/wiki/Kalman_filter).
Here I just offer u the souce code of MATLAB and the result.
clear all N=500; q=0.1*randn(1,N); % process white noise, return 1*N random matrix r=10*randn(1,N);% observation white noise x(1)=25; a=1; c=1; for k=2:N; x(k)=a*x(k-1)+q(k-1); end; %linear differential equation for k=1:N z(k)=c*x(k)+r(k); end; % obeservation function p(1)=10; s(1)=1; for t=2:N; Rq=cov(q(1:t)); Rr=cov(r(1:t)); % caculate covariance p1(t)=a.^2*p(t-1)+Rq; % Time update of covariance 2nd equation Kg(t)=c*p1(t)/(c.^2*p1(t)+Rr);% kalman gain s(t)=s(t-1)+Kg(t)*(z(t)-c*s(t-1));%observation update of state p(t)=p1(t)-Kg(t)*c*p1(t); % observation update of convariance end; t=1:N error=s-x;% estimate value - state value plot(t,s,'bo',t,z,'g.',t,x,'r--',t,error,'m*'); % line show kalman; dot line observation; slash line state legend('Kalman estimate','Observation','State value','error');
相关文章推荐
- struts2—from标签中 theme="simple" 用法 .
- radio取值,<s:radio name="view[%{#status.index}]" list='#{"同意":"同意","不同意":"不同意"}' theme="simple" />
- 在使用struts标签的时候最好加上theme="simple"
- struts 2.0 <s:form action = "" theme="simple"> theme ="simple"
- [Drupal] Simple steps of building a module theme
- A very simple question but it makes me very frustrated
- s:fielderror 总是出现ul 改了theme=simple也没用
- 【soj 2370】Just The Simple Fax( http://soj.me/show_problem.php?pid=2370)
- <s:form theme="simple">导致标签名显示不出来
- struts2—from标签中 theme="simple" 用法
- struts2—from标签中 theme="simple" 用法
- 卡尔曼滤波—Simple Kalman Filter for 2D tracking with OpenCV
- <s:form action="xx" namespace="xx" theme="simple"
- 实现一个简单的Form授权 How to: Implement Simple Forms Authentication
- hdu4973 A simple simulation problem.(多校第十场1003)
- YouCompleterMe 安装
- Simple Video Codec Tips
- php xmlsimpleelement 解析xml
- Simple、KMP、BM、Sunday匹配算法-效率测试
- Android development - 'missing theme error' in eclipse ide for layout xml files