Find Position based on signal strength (intersection area between circles)

I'm trying to estimate a position based on signal strength received from 4 Wi-Fi Access Points. I measure the signal strength from 4 access points located in each corner of a square room with 100 square meters (10x10). I recorded the signal strengths in a known position (x, y) = (9.5, 1.5) using an Android phone. Now I want to check how accurate can a multilateration method be under the circumstances. Using MATLAB, I applied a formula to calculate distance using the signal strength. The following MATLAB function shows the application of the formula:

    function [ d_vect ] = distance( RSS )
    % Calculate distance from signal strength
    result = (27.55 - (20 * log10(2400)) + abs(RSS)) / 20;

    d_vect = power(10, result);

    end

The input RSS is a vector with the four signal strengths measured in the test point (x,y) = (9.5, 1.5). The RSS vector looks like this:

    RSS =

    -57.6000
    -60.4000
    -44.7000
    -54.4000

and the resultant vector with all the estimated distances to each access points looks like this:

   d_vect =

   7.5386
   10.4061
   1.7072
   5.2154

Now I want to estimate my position based on these distances and the access points position in order to find the error between the estimated position and the known position (9.5, 1.5). I want to find the intersection area (In order to estimate a position) between four circles where each access point is the center of one of the circles and the distance is the radius of the circle.

I want to find the grey area as shown in this image : http://www.biologycorner.com/resources/venn4.gif


If you want an alternative way of estimating the location without estimating the intersection of circles you can use trilateration. It is a common technique in navigation (eg GPS) to estimate a position given a set of distance measurements.

Also, if you wanted the area because you also need an estimate of the uncertainty of the position I would recommend solving the trilateration problem using least squares which will easily give you an estimate of the parameters involved and an error propagation to yield an uncertainty of the location.


So basically you need to intersect 4 circles. There can be many approaches to it, and there are two that will generate the exact intersection area.

First approach is to start with one circle, intersect it with the second circle, then intersect the resulting area with the third circle and so on. that is, on each step you know current intersection area, and you intersect it with a new circle. The intersection area will always be a region bounded by circle arcs, so to intersect it with a new circle you walk along the boundary of the area and check whether each bounding arc intersects with a new circle. If it does, then you leave only the part of the arc that lies inside a new circle, remember that you should continue with an arc from a new circle, and continue traversing the boundary until you find the next intersection.

Another approach that seems to result in a worse time complexity, but in your case of 4 circles this will not be important, is to find all the intersection points of two circles and choose only those points that are of interest for you, that is which lie inside all other circles. These points will be the corners of your area, and then it is rather easy to reconstruct the area. After googling a bit, I have even found a live demo of this approach.


I found an answear that solved perfectly the question. It is explained in detail in this link:

https://gis.stackexchange.com/questions/40660/trilateration-algorithm-for-n-amount-of-points

I also developed some MATLAB code for the problem. Here it goes:

Estimate distances from the Access Points:

function [ d_vect ] = distance( RSS )
    result = (27.55 - (20 * log10(2400)) + abs(RSS)) / 20;
    d_vect = power(10, result);
end

The trilateration function:

function [] = trilat( X, d, real1, real2 )
cla
circles(X(1), X(5), d(1), 'edgecolor', [0 0 0],'facecolor', 'none','linewidth',4); %AP1 - black
circles(X(2), X(6), d(2), 'edgecolor', [0 1 0],'facecolor', 'none','linewidth',4); %AP2 - green
circles(X(3), X(7), d(3), 'edgecolor', [0 1 1],'facecolor', 'none','linewidth',4); %AP3 - cyan 
circles(X(4), X(8), d(4), 'edgecolor', [1 1 0],'facecolor', 'none','linewidth',4); %AP4 - yellow
axis([0 10 0 10])
hold on
tbl = table(X, d);
d = d.^2;
weights = d.^(-1);
weights = transpose(weights);
beta0 = [5, 5];
modelfun = @(b,X)(abs(b(1)-X(:,1)).^2+abs(b(2)-X(:,2)).^2).^(1/2);
mdl = fitnlm(tbl,modelfun,beta0, 'Weights', weights);
b = mdl.Coefficients{1:2,{'Estimate'}}
scatter(b(1), b(2), 70, [0 0 1], 'filled')
scatter(real1, real2, 70, [1 0 0], 'filled')
hold off

end

Where,

X: matrix with APs coordinates

d: distance estimation vector

real1: real position x

real2: real position y

链接地址: http://www.djcxy.com/p/84918.html

上一篇: 使用时差的信号三角测量(TDOA)

下一篇: 根据信号强度查找位置(圆圈之间的交叉区域)