无迹卡尔曼滤波算法.docx

无迹卡尔曼滤波算法.docx

ID:59186423

大小:13.84 KB

页数:5页

时间:2020-09-10

无迹卡尔曼滤波算法.docx_第1页
无迹卡尔曼滤波算法.docx_第2页
无迹卡尔曼滤波算法.docx_第3页
无迹卡尔曼滤波算法.docx_第4页
无迹卡尔曼滤波算法.docx_第5页
资源描述:

《无迹卡尔曼滤波算法.docx》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、%该文件用于编写无迹卡尔曼滤波算法及其测试%注解:主要子程序包括:轨迹发生器、系统方程%    测量方程、UKF滤波器%作者:Jiangfeng%日期:2012.4.16%---------------------------------------functionUKFmain%------------------清屏----------------closeall;clearall;clc;tic;globalQfn;            %定义全局变量%------------------初始化--

2、------------stater0=[220;1;55;-0.5];    %标准系统初值state0=[200;1.3;50;-0.3];    %测量状态初值%--------系统滤波初始化  p=[0.005000;00.00500;  000.0050;0000.005];  %状态误差协方差初值                    n=4;T=3;Qf=[T^2/20;0T;T^2/20;0T];%--------------------------------------stater=st

3、ater0;state=state0;xc=state;staterout=[];stateout=[];xcout=[];errorout=[];tout=[];t0=1;h=1;tf=1000;      %仿真时间设置%---------------滤波算法----------------fort=t0:h:tf  [state,stater,yc]=track(state,stater);%轨迹发生器:标准轨迹和输出  [xc,p]=UKFfiter(@systemfun,@measurefun,x

4、c,yc,p);  error=xc-stater;          %滤波处理后的误差  staterout=[staterout,stater];  stateout=[stateout,state];  errorout=[errorout,error];  xcout=[xcout,xc];    tout=[tout,t];end %---------------状态信息图像---------------figure;plot(tout,xcout(1,:),'r',tout,staterout

5、(1,:),'g',...    tout,stateout(1,:),'black');legend('滤波后','真实值','无滤波');gridon;xlabel('时间t(s)');ylabel('系统状态A');title('无迹卡尔曼滤波');figure;plot(tout,xcout(2,:),'r',tout,staterout(2,:),'g',...    tout,stateout(2,:),'black');gridon;legend('滤波后','真实值','无滤波');xlab

6、el('时间t(s)');ylabel('系统状态B');title('无迹卡尔曼滤波');figure;plot(tout,xcout(3,:),'r',tout,staterout(3,:),'g',...    tout,stateout(3,:),'black');gridon;legend('滤波后','真实值','无滤波');xlabel('时间t(s)');ylabel('系统状态C');title('无迹卡尔曼滤波');figure;plot(tout,xcout(4,:),'r',tout

7、,staterout(4,:),'g',...    tout,stateout(4,:),'black');gridon;legend('滤波后','真实值','无滤波');xlabel('时间t(s)');ylabel('系统状态D');title('无迹卡尔曼滤波');figure;plot(tout,errorout(1,:),'r',tout,errorout(2,:),'g',...    tout,errorout(3,:),'black',tout,errorout(4,:),'b');gr

8、idon;legend('A','B','C','D');xlabel('时间t(s)');ylabel('滤波后的状态误差');title('无迹卡尔曼滤波误差');%---------------------------------------------toc;  %计算仿真程序运行时间endfunction[state,stater,yout]=track(state0,stater0)%--------

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。