Analysis of different digital filters for received signal strength indicator
IN4252_Smart_Phone_Sensing
1. Second Report
IN4254 Smart Phone Sensing
27 May, 2014
Lie Yen Cheung
1358219
L.Y.Cheung-1@student.tudelft.nl
Hong Huang
4281942
H.Huang-3@student.tudelft.nl
In this report we describe how we use Bayesian Inference
for localization in our application. First we explain how re-
ceived signal strength (RSS) data is being gathered and how
these data is processed. Then we describe how the radiomap
can be constructed using Bayesian Inference. Moreover, the
evaluation is also being explained briefly in this report and
finally we discuss problems we have encountered in the last
few weeks.
1. DATA COLLECTION
In order to collect RSS data from the ninth floor of EWI, we
implemented a simple program which makes use of the Wifi-
Manager class1
provided by Android. This program writes
every observable access point (AP) to a file together with
the measured signal strength. We divided the floor plan of
into several grids in order to gather RSS in each of the grid
shown in Figure 1. In each grid we gather about 300 mea-
surement points by walking in a ”S” curve through the grid
for about three minutes. For each grid we collected the RSS
and plotted all the available AP according with their signal
strength into a graph. Figure 2 shows an example the AP
distribution of grid 1.
Figure 1: The grids on the floor plan.
1
http://developer.android.com/reference/android/net/wifi
/WifiManager.html
Figure 2: AP Distribution of grid 1. In grid 1
18 different access point can be measures. The x
axis presents the measurement point and the y axis
presents the RSS value.
2. DATA PROCESSING
After gathering all RSS data for each grid, we started doing
some filtering to remove some ”noisy” data from the dataset.
First, we removed all data from AP provided less than 200
RSS data points, because we only want to take the strongest
AP from each cell into consideration. Second, we sorted for
each grid the remaining AP on the highest averaged RSS
value, to see which AP provides the strongest RSS. Further-
more we used alpha trimmer[3] filter2
to filter each dataset
with α = 0.2, because this could improve the outcome our
test results.
3. RADIO MAP
After filtering we determined for each grid: the average RSS
per access point, radio map containing the RSS frequency
per AP (Figure 3, 5 are cells which are similiar while Figure
5, 6 are cells which are different) and frequency probabil-
ity per AP per RSS (Figure 4). For each grid we choose the
strongest access points and for each of these AP we use Mat-
lab3
to estimate the parameters and confidence intervals for
normal data. Afterwards, we created several histograms to
represent the estimated values, Figure 7 and 8 show an ex-
ample the histograms of the strongest APs of grid 6. Based
2
http://www.librow.com/articles/article-7
3
http://www.mathworks.nl/help/stats/normfit.html
2. on the estimated parameters, we can determine the proba-
bility mass function (pmf) for each grid, which can be used
for creating the radio map.
Figure 3: Radio map for grid 6, RSS frequency per
AP. On the x axis the RSS values are presented,
while on the y axis the access points are presented
and sorted on the highest average RSS.
Figure 4: Frequency probability per AP per RSS for
the strongest APs of grid 6.
4. LOCALIZATION METHOD
In our application we use Bayesian Inference[4][5] for local-
ization. Bayesian inference is a method of inference in which
Bayes’ rule is used to update the probability estimate for a
hypothesis as additional evidence is acquired. The equa-
tion(1) shows the Bayes rule we used with the probability
that I am in cell I given that i got an RSS measurement r
from access point j.
p(celli/rssj
r
) = p(celli) p(rssj
r
/celli) / p(rssj
r
) (1)
4.1 Gaussian probability distribution and
cumulative distribution function
Gi,j(v) =
v+0.5
v−0.5
e−(x−µi,j )/(2σ2
i,j )
σij
√
2π
(2)
Gi,j(v) is a discretization of a Gaussian probability distri-
bution[4] with µi,j and standard deviation σij. P((bj, v)|si)
adds a null hypothesis and normalizes the resulting distri-
bution. β is small constant used to represent the probability
of observing an artifact and Ni,j is normalizer such that
255
v=0
P((bj, v)|si) = 1 (3)
To obtain the probability that you are in a certain grid given
a WiFi level v, we need to calculate the integral for interval
[v −0.5, v +0.5]. This is calculated using trapezoidal rule[1].
b
a
f(x) ≈
h
2
(f(xk+1) + f(xk)) (4)
=
b − a
2N
(f(x1)+2f(x2)+2f(x3)+...+2f(xn)+f(xn+1)) (5)
Here we choose 100 as N, v + 0.5 as b and v − 0.5 as a.
5. EVALUATION
After testing our application based on the trained data, the
outcome of the results were not as precise as we expected
it to be. About 60% of the time our application determines
correctly in which grid it is, based on sensing the RSS and
comparing them with the trained data. However, in several
cases it appears that our application points to a grid near
the actual grid, thus in the ”room next door”. A reason for
this appearance might be that the original access point has
been moved, which leads to another observable RSS range of
the AP. Another possible reason is the interference of object,
for example sensing RSS while the door of the room is open.
This could also lead to different observable RSS of an access
point. Moreover signal variance could also an important
role, because it is not guaranteed that what works now will
also work tomorrow.
6. DISCUSSION
Now that we have tested this, we will continue working to
improve the outcomes. One thing that we could do is gath-
ering new RSS (at night/different days) and combine it with
our current trained data to improve the accuracy of deter-
mining the correct location. Thus we use multipath fading[2]
to overcome absorption effect that could cause problems.
Moreover we could extent the table containing the average
RSS per grid in order to have a larger dataset to train the
data for more access points. Another option to improve the
accuracy would be modeling variance and use least squares
fit to find the optimal c1 and c2 for the linear function, where
i is the signal strength:
c(i) = c1 ∗ i − c2 (6)
3. Figure 5: Radio map for grid 4, RSS frequency per
AP. On the x axis the RSS values are presented,
while on the y axis the access points are presented
and sorted on the highest average RSS.
7. REFERENCES
[1] K. E. Atkinson. An introduction to numerical analysis.
John Wiley & Sons, 2008.
[2] P. Bahl and V. N. Padmanabhan. Radar: An
in-building rf-based user location and tracking system.
In INFOCOM 2000. Nineteenth Annual Joint
Conference of the IEEE Computer and
Communications Societies. Proceedings. IEEE,
volume 2, pages 775–784. Ieee, 2000.
[3] J. Bednar and T. Watt. Alpha-trimmed means and
their relationship to median filters. Acoustics, Speech
and Signal Processing, IEEE Transactions on,
32(1):145–153, 1984.
[4] A. Haeberlen, E. Flannery, A. M. Ladd, A. Rudys,
D. S. Wallach, and L. E. Kavraki. Practical robust
localization over large-scale 802.11 wireless networks. In
Proceedings of the 10th annual international conference
on Mobile computing and networking, pages 70–84.
ACM, 2004.
[5] M. Youssef, A. Youssef, C. Rieger, U. Shankar, and
A. Agrawala. Pinpoint: An asynchronous time-based
location determination system. In Proceedings of the
4th international conference on Mobile systems,
applications and services, pages 165–176. ACM, 2006.
Figure 6: Radio map for grid 15, RSS frequency per
AP. On the x axis the RSS values are presented,
while on the y axis the access points are presented
and sorted on the highest average RSS.
Figure 7: histograms for AP mfold-dlink
00:26:5a:a9:99:46 (Grid 6)
Figure 8: histograms for AP tudelft-dastud
00:1b:90:76:d3:f4 (Grid 6).