function X = ChanAlgorithm_A(BSN, MSP, ACP, Radius, Noise, ANoise)
%CHANALGORITHM 本函数用于实现无线定位中的CHAN算法
% - BSN 为基站个数,3 < BSN <= 7;
% - MSP 为移动台的初始位置, MSx, MSy均为[0,1]之间的数;
% 特别要注意服务小区与MS之间的关系,MS的位置不能越界。
% - Noise 测距误差方差。
% - R 为小区半径,单位(meter);
% - X 为移动台经算法处理后的位置.
%See also: ChanAlgorithm.m
% 参数检查:
if nargout>1,
error('Too many output arguments.');
end
if nargin ~= 6,
error('Wrong number of input arguments.');
end
% 算法开始:
BS = Radius*NetworkTop(BSN);
MS = Radius*MSP;
AC = Radius*ACP;
% 噪声功率:
% Q = eye(BSN)*Noise^2;
% % r = sqrt(MS(1)^2 + MS(2)^2);
Q = eye(BSN);
% Q(BSN,BSN) = (Radius*ANoise)^2;
% Q(BSN,BSN) = 1;
alfa0 = atan((AC(2) - MS(2))/(AC(1) - MS(1)));
alfar = alfa0 + ANoise*randn(1);
% 第一次LS:
% Ri
K1 = 0;
for i = 1: BSN,
R0(i) = sqrt((BS(1,i) - MS(1))^2 + (BS(2,i) - MS(2))^2);
end
for i = 1: BSN-1,
R(i) = R0(i+1) - R0(1) + Noise*randn(1);
K(i) = BS(1,i+1)^2 + BS(2,i+1)^2;
end
% Ga
Ga = zeros(BSN, 3);
for i = 1: BSN-1,
Ga(i,1) = -BS(1, i+1);
Ga(i,2) = -BS(2, i+1);
Ga(i,3) = -R(i);
end
Ga(BSN,1) = 0.5*tan(alfar);
Ga(BSN,2) = -0.5;
Ga(BSN,3) = 0;
% h
h = zeros(1, BSN);
for i = 1: BSN-1,
h(i) = 0.5*(R(i)^2 - K(i) + K1);
end
h(BSN) = 0.5*(AC(1)*tan(alfar) - AC(2));
% 由(14b)给出B的估计值:
Za0 = pinv(Ga'*pinv(Q)*Ga)*Ga'*pinv(Q)*h';
% 利用这个粗略估计值计算B:
B = eye(BSN);
for i = 1: BSN-1,
B(i,i) = sqrt((BS(1,i+1) - Za0(1))^2 + (BS(2,i+1) - Za0(2))^2);
end
B(BSN,BSN) = 1;
% FI:
FI = B*Q*B;
% 第一次LS结果:
Za1 = pinv(Ga'*pinv(FI)*Ga)*Ga'*pinv(FI)*h';
if Za1(3) < 0,
Za1(3) = abs(Za1(3));
end
%***************************************************************
% 第二次LS:
% 第一次LS结果的协方差:
CovZa = pinv(Ga'*pinv(FI)*Ga);
% sB:
sB = eye(3);
for i = 1: 3,
sB(i,i) = Za1(i);
end
% sFI:
sFI = 4*sB*CovZa*sB;
% sGa:
sGa = [1, 0; 0, 1; 1, 1];
% sh
sh = [Za1(1)^2; Za1(2)^2; Za1(3)^2];
% 第二次LS结果:
Za2 = pinv(sGa'*pinv(sFI)*sGa)*sGa'*pinv(sFI)*sh;
% Za = sqrt(abs(Za2));
Za = sqrt(Za2);
% 输出:
if Za1(1) < 0,
out1 = -Za(1);
else
out1 = Za(1);
end
if Za2(1) < 0,
out2 = -Za(2);
else
out2 = Za(2);
end
%
out = [out1;out2];
out = Za;
if nargout == 1,
X = out;
elseif nargout == 0,
disp(out);
end
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
Y.T.Chan在其论文中提出一种具有解析表达式解的非递归双曲线方程组解法,该算法具有计算量小,速度快,且当TDOA参数估计误差服从高斯分布的情况下,定位精度较高。 本程序借鉴Chan论文中提出的算法,基于MATLAB程序,在已知TDOA估计参数的情况下,对信号源位置进行估计。 希望能够对研究 干扰源定位、无源定位的同志提供帮助。(YTChan in his paper presents a solution with the analytical expression for the non-recursive solution of hyperbolic equations, the algorithm has calculated the amount of small, fast, and when the TDOA estimation error of Gaussian distribution in the case, positioning accuracy than high. The papers presented in the program learn fro
资源推荐
资源详情
资源评论
收起资源包目录
Chan_Algorithm.rar (11个子文件)
Chan_Algorithm
ChanAlgorithm_d.m 2KB
Chan_3BS.m 1KB
CRLB_1.m 2KB
EvChanAlgorithm.m 1KB
CRLB.m 2KB
chan4.m 1KB
ChanAlgorithm_B.m 2KB
CHANFUC.asv 2KB
ChanAlgorithm.m 2KB
ChanAlgorithm_A.m 3KB
CHANFUC.m 2KB
共 11 条
- 1
资源评论
- zhangyike09152023-03-09实在是宝藏资源、宝藏分享者!感谢大佬~
zwl2022
- 粉丝: 7
- 资源: 225
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功