A list,

Chan algorithm is a very good trick of TDOA positioning method. But many methods, when viewed from an academic point of view, take on a strange aura. TDOA, the time differnces of arrival,

Chan algorithm 1 is a non-recursive hyperbolic solution with analytical expression solutions. Its main characteristic is that when the measurement error follows the ideal Gaussian distribution, its positioning accuracy is high and the calculation is small, and the algorithm accuracy can be improved by increasing the number of base stations. The derivation of the algorithm is based on the gaussian random variable with zero mean measurement error, and the performance of the algorithm will be significantly reduced for the measured values with large errors in the actual environment, such as the environment with non-line-of-sight error. Chan algorithm can be divided into two types: only three BS and more than three BS.























Ii. Source code

Function X = ChanAlgorithm(BSN, MSP, Radius, Noise) % ChanAlgorithm This function is used to implement the CHAN algorithm of wireless location % -bsn is the number of base stations,3 < BSN <= 7; % -msp is the initial position of the mobile station, MSx and MSy are [0.1]; Pay special attention to the relationship between the service cell and MS, the location of MS should not be out of bounds. % -noise Range error variance. % -r is the cell radius, unit (meter); %See also: ChanAlgorithm. M %if  nargout>1,
    error('Too many output arguments.');
end
if nargin<2 | nargin>4,
    error('Wrong number of input arguments.'); End % Algorithm start: BS = Radius*NetworkTop(BSN); MS = Radius*MSP; % Noise power: Q = eye(BSN- 1); % first 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
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

% h
for i = 1: BSN- 1,
    h(i) = 0.5*(R(i)^2- K(i) + K1); End % by (14b) gives an estimate of B: Za0 = inv(Ga'*inv(Q)*Ga)*Ga'*inv(Q)*h'; % Use this rough estimate to calculate B: B = eye(BSN)- 1);
for i = 1: BSN- 1,
    B(i,i) = sqrt((BS(1,i+1) - Za0(1)) ^2 + (BS(2,i+1) - Za0(2)) ^2); end % FI: FI = B*Q*B; % First LS result: Za1 = inv(Ga)'*inv(FI)*Ga)*Ga'*inv(FI)*h';

if Za1(3)The < 0,Za1(3) = abs(Za1(3));
%     Za1(3) = 0; End % * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * % LS: % LS results for the first time the covariance: CovZa = inv (Ga'*inv(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]; % second LS result: Za2 = inv(sGa)'*inv(sFI)*sGa)*sGa'*inv(sFI)*sh;

% Za = sqrt(abs(Za2));

Za = sqrt(Za2); % Output: %if Za1(1) < 0,
%     out1 = -Za(1);
% else
%     out1 = Za(1);
% end
% if Za2(1) < 0,
%     out2 = -Za(2);
% else
%     out2 = Za(2);
% end
Copy the code

3. Operation results

Fourth, note

Version: 2014 a