• 大小: 830KB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2021-06-01
  • 语言: 其他
  • 标签: chan  taylor  AOA  

资源简介

对于做定位的人来说,是个基础并且很好的资源

资源截图

代码片段和文件信息

%Chan定位算法
clear;clc;
C = 300000000; % 光速(米每秒)
R = 1000;      % 小区半径(米)
Rn = R/1000;   %(km)
x_delta = 0;
y_delta = 0;
e = 0;
% stda = 0.01;
% 蜂窝系统各基站坐标
X1 = 0;
Y1 = 0;
X2 = R*(1+sqrt(3)/2);
Y2 = 0;
X3 = R*(sqrt(3)/2);
Y3 = R*(-3/2);
X4 = R*(-sqrt(3)/2);
Y4 = R*(-3/2);
X5 = R*(-1-(sqrt(3)/2));
Y5 = 0;
X6 = R*(-sqrt(3)/2);
Y6 = R*(3/2);
X7 = R*(sqrt(3)/2);
Y7 = R*(3/2);

% KM = XM^2 + YM^2
K1 = Ka(X1Y1);
K2 = Ka(X2Y2);
K3 = Ka(X3Y3);
K4 = Ka(X4Y4);
K5 = Ka(X5Y5);
K6 = Ka(X6Y6);
K7 = Ka(X7Y7);
% XM_1 = XM - X1;YM_1 = YM - X1
X2_1 = Xab(X2X1);
Y2_1 = Xab(Y2Y1);
X3_1 = Xab(X3X1);
Y3_1 = Xab(Y3Y1);
X4_1 = Xab(X4X1);
Y4_1 = Xab(Y4Y1);
X5_1 = Xab(X5X1);
Y5_1 = Xab(Y5Y1);
X6_1 = Xab(X6X1);
Y6_1 = Xab(Y6Y1);
X7_1 = Xab(X7X1);
Y7_1 = Xab(Y7Y1);
% 随机产生MS的位置(x,y)
 u = rand(1);
 y = (R/2)*(1-sqrt(u))
 v = (sqrt(3)*((R/2)-y))*rand(1);
 x = sqrt(3)*y + v
% x = 300;
% y = 800;
% 计算MS到各基站的距离
R1 = distance(X1Y1xy);
R2 = distance(X2Y2xy);
R3 = distance(X3Y3xy);
R4 = distance(X4Y4xy);
R5 = distance(X5Y5xy);
R6 = distance(X6Y6xy);
R7 = distance(X7Y7xy);

num = 5;
PPP=1000;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Chan算法
    for i = 1:num
        sgma = i*30;
        for ss = 1:PPP
            % RM_1为带误差的距离差
            R2_1 = Rab(R2R1) + gngauss(sgma);
            T2_1(ss) = R2_1/C;
            R3_1 = Rab(R3R1) + gngauss(sgma);
            T3_1(ss) = R3_1/C;
            R4_1 = Rab(R4R1) + gngauss(sgma);
            T4_1(ss) = R4_1/C;
            R5_1 = Rab(R5R1) + gngauss(sgma);
            T5_1(ss) = R5_1/C;
            R6_1 = Rab(R6R1) + gngauss(sgma);
            T6_1(ss) = R6_1/C;
            R7_1 = Rab(R7R1) + gngauss(sgma);
            T7_1(ss) = R7_1/C;
        end
        % 各TDOA测量值的方差
        T2_1_fangcha = var(T2_1);
        T3_1_fangcha = var(T3_1);
        T4_1_fangcha = var(T4_1);
        T5_1_fangcha = var(T5_1);
        T6_1_fangcha = var(T6_1);
        T7_1_fangcha = var(T7_1); 
        
        for k = 1:PPP
            % 假设MS到BSi的距离与MS到BS1的距离差为:R2_1=Ri-R1产生的误差方差为sgma,TDOA(时间差)为:Ti_1=Ri_1/C
            sgma = i*30;
            R2_1 = Rab(R2R1) + gngauss(sgma);
            T2_1 = R2_1/C;
            R3_1 = Rab(R3R1) + gngauss(sgma);
            T3_1 = R3_1/C;
            R4_1 = Rab(R4R1) + gngauss(sgma);
            T4_1 = R4_1/C;
            R5_1 = Rab(R5R1) + gngauss(sgma);
            T5_1 = R5_1/C;
            R6_1 = Rab(R6R1) + gngauss(sgma);
            T6_1 = R6_1/C;
            R7_1 = Rab(R7R1) + gngauss(sgma);
            T7_1 = R7_1/C;
            h = 1/2*[HH(R2_1X2Y2X1Y1);HH(R3_1X3Y3X1Y1);HH(R4_1X4Y4X1Y1);HH(R5_1X5Y5X1Y1);HH(R6_1X6Y6X1Y1);HH(R7_1X7Y7X1Y1)];
            Ga = -[X2_1Y2_1R2_1;X3_1Y3_1R3_1;X4_1Y4_1R4_1;X5_1Y5_1R5_1;X6_1Y6_1R6_1;X7_1Y7_1R7_1];
            EQ = diag([T2_1_fangcha;T3_1_fangcha;T4_1_fangcha;T5_1_fangcha;T6_1_fangcha;T7_

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

     文件       4617  2011-08-10 10:24  Fang_Taylor_Chan\Chan.asv

     文件       4617  2011-08-10 10:26  Fang_Taylor_Chan\Chan.m

     文件      15512  2011-05-08 19:01  Fang_Taylor_Chan\chanpk.m

     文件       8697  2011-05-08 19:01  Fang_Taylor_Chan\Chan_Taylor_Fang4PK.m

     文件      12227  2011-05-08 19:01  Fang_Taylor_Chan\Chan_Taylor_Fang4PK_COST.m

     文件       8773  2011-05-08 19:01  Fang_Taylor_Chan\Chan_Taylor_Fang5PK.m

     文件      12298  2011-05-08 19:01  Fang_Taylor_Chan\Chan_Taylor_Fang5PK_COST.m

     文件       8890  2011-05-08 19:01  Fang_Taylor_Chan\Chan_Taylor_Fang6PK.m

     文件      12327  2011-05-08 19:01  Fang_Taylor_Chan\Chan_Taylor_Fang6PK_COST.m

     文件       8962  2011-05-08 19:01  Fang_Taylor_Chan\Chan_Taylor_Fang7PK.m

     文件      12057  2011-05-08 19:01  Fang_Taylor_Chan\Chan_Taylor_Fang7PK_COST.m

     文件         72  2011-05-08 19:01  Fang_Taylor_Chan\distance.m

     文件       2137  2011-05-26 21:09  Fang_Taylor_Chan\Fang.asv

     文件       2137  2011-05-26 21:09  Fang_Taylor_Chan\Fang.m

     文件        789  2011-05-08 19:01  Fang_Taylor_Chan\gngauss.m

     文件        189  2011-05-08 19:01  Fang_Taylor_Chan\GT3.m

     文件        268  2011-05-08 19:01  Fang_Taylor_Chan\GT4.m

     文件        347  2011-05-08 19:01  Fang_Taylor_Chan\GT5.m

     文件        426  2011-05-08 19:01  Fang_Taylor_Chan\GT6.m

     文件        505  2011-05-08 19:01  Fang_Taylor_Chan\GT7.m

     文件         73  2011-05-08 19:01  Fang_Taylor_Chan\HH.m

     文件         43  2011-05-08 19:01  Fang_Taylor_Chan\Ka.m

     文件      95712  2011-05-08 19:01  Fang_Taylor_Chan\matlab_4bsPK.mat

     文件     104280  2011-05-08 19:01  Fang_Taylor_Chan\matlab_4bsPK_COST.mat

     文件      96248  2011-05-08 19:01  Fang_Taylor_Chan\matlab_5bsPK.mat

     文件     104960  2011-05-08 19:01  Fang_Taylor_Chan\matlab_5bsPK_COST.mat

     文件      96824  2011-05-08 19:01  Fang_Taylor_Chan\matlab_6bsPK.mat

     文件     105680  2011-05-08 19:01  Fang_Taylor_Chan\matlab_6bsPK_COST.mat

     文件      97448  2011-05-08 19:01  Fang_Taylor_Chan\matlab_7bsPK.mat

     文件     106448  2011-05-08 19:01  Fang_Taylor_Chan\matlab_7bsPK_COST.mat

............此处省略11个文件信息

评论

共有 条评论