• 大小: 224KB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2021-10-20
  • 语言: Matlab
  • 标签:

资源简介

分析研究了用CV模型,CA模型,Singer模型对单机动目标进行跟踪算法的matlab仿真。比较了各模型的滤波性能,得出了一些有意义的结论。

资源截图

代码片段和文件信息

clear;
clc;
T=2;
num=50; 
N0=400/T;
N1=600/T;
% N3=610/T;N4=660/T;N5=900/T;
x=zeros(N11);
y=zeros(N11);
vx=zeros(N11);
vy=zeros(N11);
x(1)=-10000;y(1)=2000;
vx(1)=15;vy(1)=0;
ax=0;ay=0;
var=100;
for i=1:N1-1
    if(i>N0-1&i<=N1-1)
        ax=-0.075;ay=0.075;
        vx(i+1)=vx(i)+ax*T;
        vy(i+1)=vy(i)+ax*T;
       
    else
        ax=0;ay=0;
        vx(i+1)=vx(i);
        vy(i+1)=vy(i);
    end
    x(i+1)=x(i)+vx(1)*T;
    y(i+1)=y(i)+vy(i)*T;
 end
rex(numN1)=0;
rey(numN1)=0;
%
for m=1:num
    nx=100*randn(N11);
    ny=100*randn(N11);
    zx=x+nx;
    zy=y+ny;
    rex(m1)=-10000;
    rey(m1)=2000;
    rex(m2)=-9960;
    rey(m2)=2000;
    ki=0;
    low=1;high=0;
    u=0;ua=0;
    e=0.8;
    xks(1)=zx(1);
    yks(1)=zy(1);
    xks(2)=zx(2);
    yks(2)=zy(2);
   o=[1T000.5*T^20;0100T0;001T00.5*T^2;00010T;000010;000001];
h=[100000;001000];
g=[T^2/40;T/20;0T^2/4;0T/2;10;01];
q=[100000;010000];
%     o=[1T00;0100;001T;0001];
%     h=[1000;0010];
%     g=[T^2/20;T0;0T^2/2;0T];
%     q=[100000;010000];
%     perr=[var^2var^2/T00;var*var/T2*var^2/(T^2)00;00var^2var^2/T;00var^2/T2*var^2/(T^2)];
perr=diag([100001000010000100001000010000]);
    vx=(zx(2)-zx(1))/2;vy=(zy(2)-zy(1))/2;
    xk=[zx(1);vx;zy(1);vy;ax;ay];
    %
    for r=3:N1

            z=[zx(r);zy(r)];
            xk1=o*xk;
            perr1=o*perr*o‘;
            k1=perr1*h‘*inv(h*perr1*h‘+q);
            xk=xk1+k1*(z-h*xk1);
            perr=(eye(6)-k1*h)*perr1;
            xks(r)=xk(11);
            yks(r)=xk(31);
            vxks(r)=xk(21);
            vyks(r)=xk(41);
            xk1s(r)=xk1(11);
            yk1s(r)=xk1(31);
            vxk1s(r)=xk1(21);
            vyks1(r)=xk1(41);
            perr11(r)=perr(11);
            perr12(r)=perr(12);
            perr22(r)=perr(22);
            rex(mr)=xks(r);
           rey(mr)=yks(r);
     end
    
end

ex=0;ey=0;
eqx=0;eqy=0;
ex1(N11)=0;ey1(N11)=0;

qx(N11)=0;qy(N11)=0;
for i=1:N1
    for j=1:num
        ex=ex+x(i)-rex(ji);
        ey=ey+y(i)-rey(ji);
         %eqx=eqx+(x(i)-rex(ji))^2;
        eqx=eqx+(x(i)-rex(ji))^2;
        eqy=eqy+(y(i)-rey(ji))^2;
    end
%     eqx/num-(ex1(i)^2)
%sqrt((double(eqx)/num-(ex1(i)^2)));
    ex1(i)=ex/num;
    ey1(i)=ey/num;
   qx(i)=sqrt((double(eqx)/num-(ex1(i)^2)));
  qy(i)=(eqy/num-(ey1(i)^2))^0.5;
    ex=0;eqx=0;ey=0;eqy=0;
    end
figure(1);
plot(xy‘k-‘zxzy‘g:‘xksyks‘r-.‘);
legend(‘true trace‘‘observation samples‘‘estimated samples‘);
figure(2);
plot(zxzy);
legend(‘observation samples‘);
figure(3)
plot(xksyks);legend(‘estimated trace‘);
figure(4);plot(xex1);legend(‘the error at x anix‘);
figure(5);plot(xqx);
legend(‘the square error at x anix‘);

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

     文件       2898  2010-06-18 22:09  仿真大作业\ca.m

     文件       3378  2010-06-18 19:39  仿真大作业\cv2.m

     文件       4441  2010-06-18 21:59  仿真大作业\singer3.m

     文件     446305  2010-06-18 22:25  仿真大作业\单模型机动目标跟踪算法的仿真研究.doc

     目录          0  2010-06-18 22:25  仿真大作业

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

               457022                    5


评论

共有 条评论

相关资源