无损卡尔曼滤波ukf matlab程序.docx

  1. 1、本文档共4页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
无损卡尔曼滤波ukf matlab程序

ukf(无迹卡尔曼滤波)算法的matlab程序.function [x,P]=ukf(fstate,x,P,hmeas,z,Q,R)% UKF?? Unscented Kalman Filter for nonlinear dynamic systems% [x, P] = ukf(f,x,P,h,z,Q,R) returns state estimate, x and state covariance, P?% for nonlinear dynamic system (for simplicity, noises are assumed as additive):%?????????? x_k+1 = f(x_k) + w_k%?????????? z_k?? = h(x_k) + v_k% where w ~ N(0,Q) meaning w is gaussian noise with covariance Q%?????? v ~ N(0,R) meaning v is gaussian noise with covariance R% Inputs:?? f: function handle for f(x)%?????????? x: "a priori" state estimate%?????????? P: "a priori" estimated state covariance%?????????? h: fanction handle for h(x)%?????????? z: current measurement%?????????? Q: process noise covariance?%?????????? R: measurement noise covariance% Output:?? x: "a posteriori" state estimate%?????????? P: "a posteriori" state covariance%% Example:%{n=3;????? %number of stateq=0.1;??? %std of process?r=0.1;??? %std of measurementQ=q^2*eye(n); % covariance of processR=r^2;??????? % covariance of measurement?f=@(x)[x(2);x(3);0.05*x(1)*(x(2)+x(3))]; % nonlinear state equationsh=@(x)x(1);?????????????????????????????? % measurement equations=[0;0;1];??????????????????????????????? % initial statex=s+q*randn(3,1); %initial state????????? % initial state with noiseP = eye(n);?????????????????????????????? % initial state covraianceN=20;???????????????????????????????????? % total dynamic stepsxV = zeros(n,N);????????? %estmate??????? % allocate memorysV = zeros(n,N);????????? %actualzV = zeros(1,N);for k=1:Nz = h(s) + r*randn;???????????????????? % measurmentssV(:,k)= s;???????????????????????????? % save actual statezV(k) = z;???????????????????????????? % save measurment[x, P] = ukf(f,x,P,h,z,Q,R);??????????? % ekf?xV(:,k) = x;??????????????????????????? % save estimates = f(s) + q*randn(3,1);??????????????? % update process?endfor k=1:3???????????????????????????????? % plot resultssubplot(3,1,k)plot(1:N, sV(k,:), '-', 1:N, xV(k,:), '--')end%}%% By Yi Cao at Cra

文档评论(0)

zhuwenmeijiale + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

版权声明书
用户编号:7065136142000003

1亿VIP精品文档

相关文档