资源简介

基于matlab的平方根容积卡尔曼滤波SCKF程序,是一种较好的非线性滤波方法,希望促进大家的理解。

资源截图

代码片段和文件信息

function Basic5_SCKF

clear all;
close all;

x=0;%初始状态 
xhat=0;%初始估计值
P=2;%初始估计方差
Q=1;%过程状态协方差 
R=1;%测量噪声协方差
T=100;%模拟长度 
xArr=[x];%真实值数组
xhatArr=[xhat];%估计值数组

S=chol(P)‘;
c=sqrt(1)*[1-1];
for k=1:T 
    %模拟系统 
    x=0.5*x+25*x/(1+x^2)+8*cos(1.2*(k-1)); 
    y=(x^2/20)+sqrt(R)*randn;
    %选取采样点
    for i=1:2
        xc(i)=S*c(i)+xhat;
    end
    %采样点权值
    w=1/2;
    %预测值
    for i=1:2
        xminus(i)=0.5*xc(i)+25*xc(i)/(1+xc(i)^2)+8*cos(1.2*(k-1));
    end
    %预测的均值和方差
    xmean=0;
    for i=1:2
        xmean=xmean+w*xminus(i);
    end
    Sq=chol(Q)‘;
    Tria_X=1/sqrt(2)*[xminus(1)-xmeanxminus(2)-xmean];
    Tria=[Tria_XSq];
    [~Sx]=qr(Tria‘0);
    Sx=Sx‘;
    %选取采样点
    for i=1:2
        xcc(i)=Sx*c(i)+xmean;
    end
    T

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1693  2015-05-04 21:19  SCKF.m

----------- ---------  ---------- -----  ----

                 1693                    1


评论

共有 条评论