当前位置:网站首页>Particle filter PF -- Application in maneuvering target tracking (particle filter vs extended Kalman filter)
Particle filter PF -- Application in maneuvering target tracking (particle filter vs extended Kalman filter)
2022-06-26 15:25:00 【Skull II】
Particle filtering PF—— Application in maneuvering target tracking ( Particle filtering VS Extended Kalman filter )
For the blog tracking code and problem discussion, you can contact :WX:ZB823618313
For the code and discussion of other tracking and positioning problems, you can also contact
Particle filtering PF—— Application in target tracking
- Particle filtering PF—— Application in maneuvering target tracking ( Particle filtering VS Extended Kalman filter )
Originality is not easy. , Please give a compliment to all the big guys passing by
One 、 Problem description ( Description of discrete-time nonlinear systems )
Consider the general nonlinear system model ,
x k = f ( x k − 1 , w k − 1 ) z k = h ( x k , v k ) (1) x_k=f(x_{k-1},w_{k-1}) \\ z_k=h(x_k,v_k ) \tag{1} xk=f(xk−1,wk−1)zk=h(xk,vk)(1)
among x k x_k xk by k k k Target state vector at time . z k z_k zk by k k k Time measurement vector ( Sensor data ). The controller is not considered here u k u_k uk. w k {w_k} wk and v k {v_k} vk They are process noise sequence and measurement noise sequence , And suppose w k w_k wk and v k v_k vk Zero mean Gaussian white noise , The variances are Q k Q_k Qk and R k R_k Rk The Gaussian white noise of , namely w k ∼ ( 0 , Q k ) w_k\sim(0,Q_k) wk∼(0,Qk), v k ∼ ( 0 , R k ) v_k\sim(0,R_k) vk∼(0,Rk), And satisfy the following relationship ( Linear Gaussian hypothesis ) by :
E [ w i v j ′ ] = 0 E [ w i w j ′ ] = 0 i ≠ j E [ v i v j ′ ] = 0 i ≠ j \begin{aligned} E[w_iv_j'] &=0\\ E[w_iw_j'] &=0\quad i\neq j \\ E[v_iv_j'] &=0\quad i\neq j \end{aligned} E[wivj′]E[wiwj′]E[vivj′]=0=0i=j=0i=j
Two 、 Particle filtering PF
The core idea : Is to use a group of random samples with corresponding weights ( The particle ) To represent the posterior distribution of States . The basic idea of this method is to select an importance probability density and random sampling from it , Get some random samples with corresponding weights , Adjust the weight based on the state observation . And the position of the particles , These samples are then used to approximate the state posterior distribution , Finally, the weighted sum of these samples is taken as the estimated value of the state . Particle filter is not constrained by the linear and Gaussian assumptions of the system model , The state probability density is described in the form of sample rather than function , So that it does not need too many constraints on the probability distribution of state variables , So it is widely used in nonlinear non Gaussian dynamic systems . For all that , At present, the computation of particle filter is still too large 、 Key problems such as particle degradation need to be solved .
Usually, a priori distribution is chosen as the importance density function 、 namely
q ( x k ∣ x k − 1 ( i ) , z k ) = p ( x k ∣ x k − 1 ( i ) ) q(x_k |x_{k-1}^{(i)}, z_{k})=p(x_k |x_{k-1}^{(i)}) q(xk∣xk−1(i),zk)=p(xk∣xk−1(i))
The importance weight of this function is
w k ( i ) = w k − 1 ( i ) p ( z k ∣ x k ( i ) ) w_k^{(i)}=w_{k-1}^{(i)}p(z_k |x_{k}^{(i)}) wk(i)=wk−1(i)p(zk∣xk(i))
Again w k ( i ) w_k^{(i)} wk(i) Normalization is required to obtain w ~ k ( i ) \tilde{w}_k^{(i)} w~k(i).
The standard particle filter algorithm steps are :
Particle filtering PF:
Step 1: according to p ( x 0 ) p(x_{0}) p(x0) Sampling to get N N N A particle x 0 ( i ) ∼ p ( x 0 ) x_0^{(i)} \sim p(x_{0}) x0(i)∼p(x0)
For i = 2 : N i=2:N i=2:N
Step 2: The new particle generated from the state transition function is :$ x k ( i ) ∼ p ( x k ∣ x k − 1 ( i ) ) x_k^{(i)} \sim p(x_{k} |x_{k-1}^{(i)}) xk(i)∼p(xk∣xk−1(i))
Step 3: Calculate the importance weight : w k ( i ) = w k − 1 ( i ) p ( z k ∣ x k ( i ) ) w_k^{(i)}=w_{k-1}^{(i)}p(z_k |x_{k}^{(i)}) wk(i)=wk−1(i)p(zk∣xk(i))
Step 4: Normalized importance weight : w ~ k ( i ) = w k ( i ) ∑ j = 1 N w k ( j ) \tilde{w}_k^{(i)}=\frac{w_k^{(i)}}{\sum_{j=1}^Nw_k^{(j)}} w~k(i)=∑j=1Nwk(j)wk(i)
Step 5: Resample particles using resample method ( Take system resampling as an example )
Step 6: obtain k k k A posteriori state estimation of time :
E [ x ^ k ] = ∑ i = 1 N x k ( i ) w ~ k ( i ) E[\hat{x}_{k}]= \sum_{i=1}^Nx_{k}^{(i)}\tilde{w}_k^{(i)} E[x^k]=i=1∑Nxk(i)w~k(i)
End For
Particle filtering PF Algorithm structure diagram
Algorithm : System resampling (systematic resampling)
For i = 1 : N i=1:N i=1:N
Step 1: Initialize the cumulative probability density function CDF: c 1 = 0 c_1=0 c1=0
For i = 2 : N i=2:N i=2:N
Step 2: structure CDF: c i = c i − 1 + w k ( i ) c_i=c_{i-1}+w_k^{(i)} ci=ci−1+wk(i)
Step 3: from CDF Start at the bottom of : i = 1 i=1 i=1
Step 4: Sampling starting point : u 1 = U [ 0 , 1 / N ] u_1=\mathcal{U}[0,1/N] u1=U[0,1/N]
End For
For j = 1 : N j=1:N j=1:N
Step 5: Along the CDF Move : u j = u 1 + ( j − 1 ) / N u_j=u_{1}+(j-1)/N uj=u1+(j−1)/N
Step 6: While u j > c i u_j>c_i uj>ci
i = i + 1 i=i+1 i=i+1
End While
Step 7: Assignment particle : x k ( j ) = x k ( i ) x_k^{(j)}=x_k^{(i)} xk(j)=xk(i)
Step 8: Assignment weight : w k ( j ) = 1 / N w_k^{(j)}=1/N wk(j)=1/N
Step 9: Assign parent : i ( j ) = i i^{(j)}=i i(j)=i
End For
3、 ... and 、 Simulation scenario : 3D radar target tracking
3.1 Simulation scenario ( Three dimensional spiral rising maneuvering target )
Target model
Consider a three-dimensional uniform turning moving target :
x k + 1 = F k x k + G k w k x_{k+1}=F_kx_k+G _kw_k xk+1=Fkxk+Gkwk
Where the state vector x k = [ x k , x ˙ k , y k , y ˙ k , z k , z ˙ k ] ′ x_k=[x_k,\dot{x}_k,y_k,\dot{y}_k,z_k,\dot{z}_k]' xk=[xk,x˙k,yk,y˙k,zk,z˙k]′; The noise is w k = [ w x , w y , w z ] ′ w_k=[w_x,w_y,w_z]' wk=[wx,wy,wz]′;
The target trajectory is a three-dimensional uniform turning motion model
path of particle : Spiral rise
If it is a nonlinear target , Then the state transition matrix F k F_k Fk Replace with Jacobian matrix . In order not to be general, the linear model is used for simulation . It mainly deals with target tracking , The problem of nonlinear filtering in radar measurement .
Radar measurement model
In the three-dimensional case , Radar measurements are range and angle
r k m = r k + r ~ k b k m = b k + b ~ k e k m = e k + e ~ k {r}_k^m=r_k+\tilde{r}_k\\ b^m_k=b_k+\tilde{b}_k\\ e^m_k=e_k+\tilde{e}_k rkm=rk+r~kbkm=bk+b~kekm=ek+e~k
among
r k = ( x k − x 0 ) + ( y k − y 0 ) 2 ) b k = tan − 1 y k − y 0 x k − x 0 e k = tan − 1 z k − z 0 ( x k − x 0 ) 2 + ( y k − y 0 ) 2 r_k=\sqrt{(x_k-x_0)^+(y_k-y_0)^2)}\\ b_k=\tan^{-1}{\frac{y_k-y_0}{x_k-x_0}}\\ e_k=\tan^{-1}{\frac{z_k-z_0}{\sqrt{(x_k-x_0)^2+(y_k-y_0)^2}}}\\ rk=(xk−x0)+(yk−y0)2)bk=tan−1xk−x0yk−y0ek=tan−1(xk−x0)2+(yk−y0)2zk−z0
[ x 0 , y 0 , z 0 ] [x_0,y_0,z_0] [x0,y0,z0] Is radar coordinates , The general situation is 0. Radar measurement is z k = [ r k , b k , e k ] ′ z_k=[r_k,b_k,e_k]' zk=[rk,bk,ek]′. The radar measurement variance is
R k = cov ( v k ) = [ σ r 2 0 0 0 σ b 2 0 0 0 σ e 2 ] R_k=\text{cov}(v_k)=\begin{bmatrix}\sigma_r^2 & 0 &0\\0 & \sigma_b^2 &0\\0&0& \sigma_e^2 \end{bmatrix} Rk=cov(vk)=⎣⎡σr2000σb2000σe2⎦⎤ And σ r = 20 m \sigma_r=20m σr=20m, σ b = 20 m r a d \sigma_b=20mrad σb=20mrad, σ e = 15 m r a d \sigma_e=15mrad σe=15mrad.
Performance indicators
RMSE(Root mean-squared error): Montacarlo times M = 500 M=500 M=500, x ^ k ∣ k i \hat{x}_{k|k}^i x^k∣ki For the first time i i i The estimation obtained from this simulation .
RMSE ( x ^ ) = 1 M ∑ i = 1 M ( x k − x ^ k ∣ k i ) ( x k − x ^ k ∣ k i ) ′ \text{RMSE}(\hat{x})=\sqrt{\frac{1}{M}\sum_{i=1}^{M}(\mathbf{x}_k-\hat{\mathbf{x}}_{k|k}^i)(\mathbf{x}_k-\hat{\mathbf{x}}_{k|k}^i)'} RMSE(x^)=M1i=1∑M(xk−x^k∣ki)(xk−x^k∣ki)′
Position RMSE ( x ^ ) = 1 M ∑ i = 1 M ( x k − x ^ k ∣ k i ) 2 + ( y k − y ^ k ∣ k i ) 2 + ( z k − z ^ k ∣ k i ) 2 \text{Position RMSE}(\hat{x})=\sqrt{\frac{1}{M}\sum_{i=1}^{M}(x_k-\hat{x}_{k|k}^i)^2+(y_k-\hat{y}_{k|k}^i)^2+(z_k-\hat{z}_{k|k}^i)^2} Position RMSE(x^)=M1i=1∑M(xk−x^k∣ki)2+(yk−y^k∣ki)2+(zk−z^k∣ki)2
Velocity RMSE ( x ^ ) = 1 M ∑ i = 1 M ( x ˙ k − x ˙ ^ k ∣ k i ) 2 + ( y ˙ k − y ˙ ^ k ∣ k i ) 2 + ( z ˙ k − z ˙ ^ k ∣ k i ) 2 \text{Velocity RMSE}(\hat{x})=\sqrt{\frac{1}{M}\sum_{i=1}^{M}(\dot{x}_k-\hat{\dot{x}}_{k|k}^i)^2+(\dot{y}_k-\hat{\dot{y}}_{k|k}^i)^2+(\dot{z}_k-\hat{\dot{z}}_{k|k}^i)^2} Velocity RMSE(x^)=M1i=1∑M(x˙k−x˙^k∣ki)2+(y˙k−y˙^k∣ki)2+(z˙k−z˙^k∣ki)2
ANEES(average normalized estimation error square), n n n Is the state dimension , P k ∣ k i \mathbf{P}_{k|k}^i Pk∣ki For the first time i i i The estimated covariance of the output of the secondary simulation filter
ANEES ( x ^ ) = 1 M n ∑ i = 1 M ( x k − x ^ k ∣ k i ) ′ ( P k ∣ k i ) − 1 ( x k − x ^ k ∣ k i ) \text{ANEES}(\hat{x})=\frac{1}{Mn}\sum_{i=1}^{M}(\mathbf{x}_k-\hat{\mathbf{x}}_{k|k}^i)'(\mathbf{P}_{k|k}^i)^{-1} (\mathbf{x}_k-\hat{\mathbf{x}}_{k|k}^i) ANEES(x^)=Mn1i=1∑M(xk−x^k∣ki)′(Pk∣ki)−1(xk−x^k∣ki)
3.2 Track track
3D track :
3.3 Tracking error
Four 、 Part of the code
For the blog tracking code and problem discussion, you can contact :WX:ZB823618313
For the code and discussion of other tracking and positioning problems, you can also contact
Code : System resampling (systematic resampling)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The system reacquires the appearance function
% Input parameters :weight Is the weight corresponding to the original data
% Output parameters :outIndex It's based on weight Filter and copy results
function outIndex = systematicR(weight);
N=length(weight);
N_children=zeros(1,N);
label=zeros(1,N);
label=1:1:N;
s=1/N;
auxw=0;
auxl=0;
li=0;
T=s*rand(1);
j=1;
Q=0;
i=0;
u=rand(1,N);
while (T<1)
if (Q>T)
T=T+s;
N_children(1,li)=N_children(1,li)+1;
else
i=fix((N-j+1)*u(1,j))+j;
auxw=weight(1,i);
li=label(1,i);
Q=Q+auxw;
weight(1,i)=weight(1,j);
label(1,i)=label(1,j);
j=j+1;
end
end
index=1;
for i=1:N
if (N_children(1,i)>0)
for j=index:index+N_children(1,i)-1
outIndex(j) = i;
end;
end;
index= index+N_children(1,i);
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
边栏推荐
- Principle of TCP reset attack
- R language uses GLM function to build Poisson logarithm linear regression model, processes three-dimensional contingency table data to build saturation model, uses step function to realize stepwise re
- 功能:crypto-js加密解密
- 一键分析硬件/IO/全国网络性能脚本(强推)
- 一篇博客彻底掌握:粒子滤波 particle filter (PF) 的理论及实践(matlab版)
- 2022北京石景山区专精特新中小企业申报流程,补贴10-20万
- MySQL数据库基本SQL语句教程之高级操作
- The R language cartools package divides data, the scale function scales data, and the KNN function of the class package constructs a k-nearest neighbor classifier
- Redis-集群
- vue中缓存页面 keepAlive使用
猜你喜欢
Vsomeip3 dual computer communication file configuration
Halcon C # sets the form font and adaptively displays pictures
面试高频 | 你追我赶的Flink双流join
IDEA本地代理后,无法下载插件
sqlite加载csv文件,并做数据分析
Bank of Beijing x Huawei: network intelligent operation and maintenance tamps the base of digital transformation service
1. accounting basis -- several major elements of accounting (general accounting theory, accounting subjects and accounts)
【TcaplusDB知识库】TcaplusDB单据受理-创建游戏区介绍
【TcaplusDB知识库】TcaplusDB运维单据介绍
[tcapulusdb knowledge base] tcapulusdb system user group introduction
随机推荐
Pod scheduling of kubernetes
【ceph】cephfs的锁 笔记
Idea shortcut key
Unity C # e-learning (10) -- unitywebrequest (2)
Advanced operation of MySQL database basic SQL statement tutorial
JS之简易deepCopy(简介递归)
R language GLM function logistic regression model, using epidisplay package logistic The display function obtains the summary statistical information of the model (initial and adjusted odds ratio and
Talk about the recent situation of several students from Tsinghua University
券商经理给的开户二维码安全吗?找谁可以开户啊?
Execution of commands in the cluster
shell脚本多进程并发写法实例(高阶修炼)
[tcapulusdb knowledge base] Introduction to tcapulusdb general documents
乐鑫 AWS IoT ExpressLink 模组达到通用可用性
The intersect function in the dplyr package of R language obtains the data lines that exist in both dataframes and the data lines that cross the two dataframes
Unity C# 网络学习(八)——WWW
打新债注册开户安全吗,有没有什么风险?
[tcapulusdb knowledge base] tcapulusdb doc acceptance - transaction execution introduction
Pytoch deep learning code skills
Secure JSON protocol
Bank of Beijing x Huawei: network intelligent operation and maintenance tamps the base of digital transformation service