TOA_LS.m
资源名称:TOA_uwb.rar [点击查看]
上传用户:doryuen
上传日期:2013-10-30
资源大小:23k
文件大小:1k
源码类别:
通讯/手机编程
开发平台:
Matlab
- function [ex,ey, cost]=TOA_LS(radius,bx,by,d)
- % estimate the position by TOA Least Square technology
- % source:
- % IEEE signal processing magazine,July 2005
- % "network-based wireless location"
- % input
- % radius : radius of the home cell
- % bx : x coordinate of base staionts
- % by : y coordinate of base staionts
- % d : distance to each base staions
- % output
- % ex : x coordinate of estimation position
- % ey : y coordinate of estimation position
- % written by Tang Hong, email: tanghongdlut@yahoo.com.cn
- % 2006.11.07
- % the coordinate of the first base station must be (0,0),
- % i.e. bx(1)=0; by(1)=0
- L=length(bx);
- H(1:L-1,2)=0;
- b(1:L-1,1)=0;
- for k=2:L;
- H(k-1,:)=[bx(k)-bx(1) by(k)-by(1)];
- b(k-1)=0.5*(bx(k)^2+by(k)^2-(bx(1)^2+by(1)^2)-d(k)^2+d(1)^2);
- end
- E=inv((H'*H))*H'*b;
- % E=inv((H'*H)+0.1*eye(2,2))*H'*b;
- ex=E(1);
- ey=E(2);
- cost=(H*E-b)'*(H*E-b);