資源簡(jiǎn)介
基于matlab的平方根容積卡爾曼濾波SCKF程序,是一種較好的非線性濾波方法,希望促進(jìn)大家的理解。
代碼片段和文件信息
function?Basic5_SCKF
clear?all;
close?all;
x=0;%初始狀態(tài)?
xhat=0;%初始估計(jì)值
P=2;%初始估計(jì)方差
Q=1;%過程狀態(tài)協(xié)方差?
R=1;%測(cè)量噪聲協(xié)方差
T=100;%模擬長(zhǎng)度?
xArr=[x];%真實(shí)值數(shù)組
xhatArr=[xhat];%估計(jì)值數(shù)組
S=chol(P)‘;
c=sqrt(1)*[1-1];
for?k=1:T?
????%模擬系統(tǒng)?
????x=0.5*x+25*x/(1+x^2)+8*cos(1.2*(k-1));?
????y=(x^2/20)+sqrt(R)*randn;
????%選取采樣點(diǎn)
????for?i=1:2
????????xc(i)=S*c(i)+xhat;
????end
????%采樣點(diǎn)權(quán)值
????w=1/2;
????%預(yù)測(cè)值
????for?i=1:2
????????xminus(i)=0.5*xc(i)+25*xc(i)/(1+xc(i)^2)+8*cos(1.2*(k-1));
????end
????%預(yù)測(cè)的均值和方差
????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‘;
????%選取采樣點(diǎn)
????for?i=1:2
????????xcc(i)=Sx*c(i)+xmean;
????end
????T
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件???????1693??2015-05-04?21:19??SCKF.m
-----------?---------??----------?-----??----
?????????????????1693????????????????????1
評(píng)論
共有 條評(píng)論