-
大小: 2KB文件类型: .rar金币: 1下载: 0 次发布日期: 2021-05-13
- 语言: Matlab
- 标签: tdoa chan-taylor
资源简介
用MATLAB编写,4个基站的基于TDOA的Chan-Taylor混合加权算法定位。最普通的Chan-Taylor算法,将Chan算法计算出来的估计值作为Taylor级数展开法的迭代初始值带入,之后合理设置Chan算法和Taylor级数展开法的加权系数来提高精度。采取循环采样5000次,基站位置,标签节点位置,系统噪声标准差都已经预设置好,可以根据要求自己修改。本代码使用的衡量指标是累积分布函数CDF,也可以自己改成均方误差RMSE。下载后可以直接运行。可以用于TDOA定位算法的改进或者比较或者UWB定位都可以。
代码片段和文件信息
function chantaylor()
chantaylorCDFjs = [0000000000000000];
M = 4;
for i=1:5000
Chantms = [510];
Chantx=Chantms(1);
Chanty=Chantms(2);
Chantc=3*10^8;
ChantX=[00-45-4504545];
ChantY=[051.9625.98-25.98-59.16-25.9825.98];
Chantbasestx=ChantX(1:M);
Chantbasesty=ChantY(1:M);
ChantN=length(Chantbasestx);
%ChantStandarddeviation=[0.10.20.30.40.50.60.70.80.911.11.21.31.41.51.61.71.81.92];
ChantStandarddeviation = 1;
Chantri1=[];
Chantxi1=[];
Chantyi1=[];
Chantk=[];
Chanth=[];
ChantGa=[];
chantaylorBSN = M;
chantaylorBS=[00-45-4504545;051.9625.98-25.98-59.16-25.9825.98];
chantaylornoise = 1;
chantaylorQ = eye(chantaylorBSN-1);
chanjqxsr = 0;
chanjqxs = 0;
chantaylorjqxsr = 0;
chantaylorjqhxfz = 0;
chantaylordwwc = [00.20.40.60.811.21.41.61.822.22.42.62.83];
for i=2:ChantN
Chantxi1(i-1)=Chantbasestx(i)-Chantbasestx(1);
Chantyi1(i-1)=Chantbasesty(i)-Chantbasesty(1);
end
for i=1:ChantN
Chantk(i)=(Chantbasestx(i))^2+(Chantbasesty(i))^2;
end
for j0=1:length(chantaylordwwc)
for i=2:ChantN
Chantri1(i-1)=sqrt((Chantbasestx(i)-Chantx)^2+(Chantbasesty(i)-Chanty)^2)- sqrt((Chantbasestx(1)-Chantx)^2+(Chantbasesty(1)-Chanty)^2)-ChantStandarddeviation*randn(1);
end
for i=2:ChantN
Chanth(i-1)=0.5*((Chantri1(i-1))^2-Chantk(i)+Chantk(1));
end
for i=1:3
for j=2:ChantN
switch i
case 1
ChantGa(j-1i)=-Chantxi1(j-1);
case 2
ChantGa(j-1i)=-Chantyi1(j-1);
case 3
ChantGa(j-1i)=-Chantri1(j-1);
end
end
end
ChantQ=zeros(ChantN-1ChantN-1);
for i=1:ChantN-1
ChantQ(ii)=(ChantStandarddeviation)^2;
end
ChantZa=inv(ChantGa‘*inv(ChantQ)*ChantGa)*ChantGa‘*inv(ChantQ)*Chanth‘;
ChantB1=[];
for i=1:ChantN-1
ChantB1(ii)=sqrt((Chantbasestx(i+1)-ChantZa(1))^2+(Chantbasesty(i+1)-ChantZa(2))^2);
end
ChantP1=Chantc^2*ChantB1*ChantQ*ChantB1;
ChantZa1=inv(ChantGa‘*inv(ChantP1)*ChantGa)*ChantGa‘*inv(ChantP1)*Chanth‘;
ChantC=inv(ChantGa‘*inv(ChantQ)*ChantGa);
Chanth1=[(ChantZa1(1)-Chantbasestx(1))^2;(ChantZa1(2)-Chantbasesty(1))^2;(ChantZa1(3))^2];
ChantGa1=[10;01;11];
Chantr1=sqrt((Chantbasestx(1)-ChantZa1(1))^2+(Chantbasesty(1)-ChantZa1(2))^2);
ChantB2=[ChantZa1(1)-Chantbasestx(1)00;0ChantZa1(2)-Chantbasesty(1)0;00Chantr1];
ChantP2=4*ChantB2*ChantC*ChantB2;
ChantZa2=inv(ChantGa1‘*inv(ChantP2)*ChantGa1)*ChantGa1‘*inv(ChantP2)*Chanth1;
Chantms0=sqrt(ChantZa2)+[Chantbasestx(1);Chantbasesty(1)];
chantaylorMS = [Chantms0(1)Chantms0(2)];
chantayloriEP = chantaylorMS;
chantaylorx = 0;
chantaylory = 0;
chantayloraaa = 10;
chantaylorbbb = 10;
for i = 1: chantaylorBSN
chantaylorMeaDist(i)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 5905 2020-10-15 10:41 chantaylor.m
----------- --------- ---------- ----- ----
5905 1
- 上一篇:matlab整流电路
- 下一篇:模糊C均值聚类算法
评论
共有 条评论