资源简介
基于TOA(到达时间法)测距的定位算法程序
代码片段和文件信息
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 基于TOA的目标定位算法
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function TOAEstimate
Length=100;
Width=100;
Node_number=3;
for i=1:Node_number
Node(i).x=Width*rand;
Node(i).y=Length*rand;
Node(i).D=Node(i).x^2+Node(i).y^2;
end
Target.x=Width*rand;
Target.y=Length*rand;
BroadcastPacket=0;
ultrasonicV=340;
sendData(BroadcastPacket);
delaytime=10;
delay(delaytime);
sendUltraPlus();
uT=[];
for i=1:Node_number
recvUltraPlus();
[d]=DIST(Node(i)Target);
uT(i)=GetTimeLength(d);
end
Zd=[];
for i=1:Node_number
Zd(i)=uT(i)*ultrasonicV;
end
H=[];b=[];
for i=2:Node_number
H=[H;2*(Node(i).x-Node(1).x)2*(Node(i).y-Node(1).y)];
b=[b;Zd(1)^2-Zd(i)^2+Node(i).D-Node(1).D];
end
Estimate=inv(H‘*H)*H‘*b;
Est_Target.x=Estimate(1);Est_Target.y=Estimate(2);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure
hold on;box on;axis([0 120 0 120]); % 输出图形的框架
for i=1:Node_number
h1=plot(Node(i).xNode(i).y‘ko‘‘MarkerFace‘‘g‘‘MarkerSize‘10);
text(Node(i).x+2Node(i).y[‘Node ‘num2str(i)]);
end
h2=plot(Target.xTarget.y‘k^‘‘MarkerFace‘‘b‘‘MarkerSize‘10);
h3=plot(Est_Target.xEst_Target.y‘ks‘‘MarkerFace‘‘r‘‘MarkerSize‘10);
line([Target.xEst_Target.x][Target.yEst_Target.y]‘Color‘‘k‘);
legend([h1h2h3]‘Observation Station‘‘Target Postion‘‘Estimate Postion‘);
[Error_Dist]=DIST(Est_TargetTarget);
xlabel([‘error=‘num2str(Error_Dist)‘m‘]);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [dist]=DIST(AB)
dist=sqrt((A.x-B.x)^2+(A.y-B.y)^2);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function time=GetTimeLength(d)
ultrasonicV=340;
time=d/ultrasonicV;
Q=5e-6;
time=time+sqrt(Q)*randn;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function sendData(BroadcastData)
disp(‘The TargetNode send wireless data success !\n‘)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function sendUltraPlus()
disp(‘The TargetNode send ultrasonic plus success !\n‘)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function recvUltraPlus()
disp(‘The ObserNode receive ultrasonic plus success !\n‘)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function delay(delaytime)
disp(‘System delay for sometime!\n‘)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2012-10-24 08:56 TOAEstimate\
文件 2509 2012-08-19 10:13 TOAEstimate\TOAEstimate.m
- 上一篇:单载波频域均衡
- 下一篇:Lucy-Richardson
相关资源
- 基于Matlab的最大熵模糊图像复原算法
- KITTI雷达点云与图像数据融合matlab源码
- matlab 解码 NMEA0183格式GGA数据
- 一个有关飞机的模板匹配的跟踪的m
- 基于MATLAB的电弧模型仿真
- PRI信号分选
- Matlab论文:基于Matlab的二进制数字调
- 802.11协议吞吐量随节点数性能仿真
- matlab图片rgb转yuv,存.yuv文件 播放器
- Duda模式分类Pattern Classification MATLAB 代
- dijkstra算法的matlab实现31274
- 随机路径生成函数matlab
- matlab语音信号处理工具箱
- matlab2013激活文件
- matlab实现游程编码
- 暗通道先验+引导滤波MATLAB代码
- 边缘检测中的canny算法及其matlab实现
- 通过达曼光栅生成点阵的matlab程序.
- MATLAB核函数算法
- 求控制系统的性能指标MptrtsFAI,matl
- matlab 求DTFT
- 逆变器重复控制算法MATLAB仿真
- MATLAB R2014b 许可协议文件
- matlab读取comtrade格式的程序
- 基于Matlab的RC一阶电路仿真
- Las点云数据读取代码
- 雷达回波加天线方向图模拟程序
- MATLAB 2017b 安装文件及其破解文件百度
- Matlab实现音频降噪
- matlab实现导航卫星系统中计算多普勒
评论
共有 条评论