An Adaptive-Bounds Band-Pass Moving-Average Filter to Increase Precision on Distance Estimation from Bluetooth RSSI

  • Diego Ordóñez-Camacho
  • Edwin Cabrera-Goyes
Conference paper
Part of the Advances in Intelligent Systems and Computing book series (AISC, volume 721)


Estimating distance from RSSI is not a straightforward task, especially when using consumer devices. The signal presents large levels of noise, and it is heavily affected by the conditions of the environment and by the devices themselves. In this paper we characterize experimentally different conditions of this noise, then we propose a filter to reduce it and to smooth and stabilize the signal; finally, we apply the filter to our test environment and validate its data. The experimental results showed that the filter has notorious benefits on precision when estimating distance from RSSI signal.


RSSI Bluetooth Signal filter Indoor positioning system 

1 Introduction

The Global Positioning System (GPS) is the most widely used technique for localization [1]. It presents, nevertheless, substantial problems indoors, becoming almost useless [2].

Indoor Positioning Systems (IPS) are designed for determining location where no GPS lock is possible [3]. Radio Frequency (RF) emitters can be used to broadcast a signal. Receivers capture the signal and process it to estimate the distance from the emitter. Gathering the signal from at least three emitters, it is possible for a receiver to infer its position [4, 5].

Calculating the distance from RF signals involves at least two conditions: the position of the emitters must be well known by the receivers, and the signal strength must decay through distance. Signal strength decay is intrinsic on RF communications systems like WiFi or Bluetooth [6].

Bluetooth seems to be pervasive nowadays; it is present even in household appliances. Moreover, people have Bluetooth in their smartphones. Because of the availability and reasonable price of second-hand Android consumer devices, they are a good candidate for building experimental positioning systems [7].

When Android Bluetooth devices are set as discoverable, they emit a signal that can be captured by receivers set into discovery mode. Then, it is possible to extract information about the emitter, like name, address and the Received Signal Strength Indicator (RSSI). RSSI is a value in the theoretical range from 0 dBm to −100 dBm, that decreases as the distance between emitter and receiver increases [8].

Estimating distance from RSSI is not a straightforward task. The signal is heavily affected by the conditions of the environment and by the devices themselves. Minor variations produce different readings and, even under similar conditions, the signal itself is noisy and unstable [9]. Previous studies have shown, nevertheless, that filters can have a positive effect on RSSI signal quality, and therefore on distance estimation [10].

1.1 Related Work

The field of IPS has been studied for some years already, and there has been a boom recently, probably with the advent of the Internet of things. We present some up-to-date related work, considering mainly its relevance regarding signal filters.

Using Bluetooth Low Energy beacons, Heo and Kwon [11] use smartphones as receivers and propose a compensated gyroscope sensor algorithm to clear noise. Onofre et al. [12] use Fuzzy Logic to deal with the accuracy problem. Kuxdorf et al. [13] implement a bi-directional mechanism using both, the emitter and the receiver to calibrate the signal. Jadidi et al. [14] use Gaussian Processes classification to learn decision regions, accepting measurements that are consistent with this model.

On ZigBee networks, Zong-zuo and Gai-zhi [15] study how Kalman filters can improve RSSI accuracy. Aykaç et al. [16] work with particle filters. Lin et al. [17] propose a modified least squares iterated method to reduce errors and optimize the relationship between reference and destination nodes, making positioning results closer to the actual location of the node.

On WiFi networks, Luo et al. [18] propose a data distribution-based fingerprinting to reduce error on distance estimation. Pyda et al. [19] introduce a secure localization protocol, and Xue et al. [20] use a variable number of maximum RSSI measures, to tackle the multipath interference. Finally, Nagaraju et al. [21] use a single anchor node with sector antenna, that estimates the distance of the target node pertaining to a particular sector, with an included interference avoidance mechanism.

1.2 Contributions

This paper delves into the problem of noise and instability. Based on the presented background, we provide the following contributions:
  • An experimental characterization of RSSI signal noise and stability on Android consumer devices, and its relationship with distance.

  • An Adaptive-Bounds Band-Pass Moving-Average (AbBpMa) Filter is proposed, justified and defined.

  • The benefits of the approach are shown experimentally, and data to validate the improvement on distance estimation precision is presented.

In the remainder of the paper we present, in Sect. 2, the main characteristics of the RSSI noise and instability. In Sect. 3, the proposed filter is described. In Sect. 4, the effects of the filter on distance estimation are justified. Finally, in Sect. 5, conclusions are drawn and future work is suggested.

2 Noise on Bluetooth RSSI Measurements

To measure noise and stability on Bluetooth RSSI, we designed several experiments, all of them considering only Android consumer devices. The most relevant experiment, used throughout the paper (unless explicitly noted), consisted of 1715 signal samples, captured across a distance range of 1 m to 27 m, with 1 m intervals. Data was sent by two emitters, an I8190 (S3) and a p500h(LG), and captured by two receivers, an F5121 (SX) and a N9000 (N3). There were no obstacles between emitters and receivers, and the experiment took place on a corridor, reported as a high noise environment [18].

Strength of RSSI signal is supposed to decrease as distance between emitter and receiver increases. It can be shown experimentally, as seen in Fig. 1, that if we gather enough data and calculate a linear regression, this is the case. It can also be seen, nevertheless, that measurements are not stable. We have a variance (\(\sigma ^2\)) of 56.79 in average, with a Relative Absolute Error (RAE) of 72.45 %, as calculated against a linear regression with a 10-fold cross validation. The difference in signal strength, for any distance, varies from 18 dBm to 34 dBm.
Fig. 1.

Dispersion on RSSI measurements

Moreover, different Bluetooth devices present different amplitude signatures, as seen on Fig. 2. For the same distances, with the same emitter, two different receivers have a difference in amplitude of 12.9 dBm on average; it is also possible to see that the difference is not stable across the distance, ranging from 0.3 dBm to 24.7 dBm.
Fig. 2.

Amplitude signature for two different receivers, an S5830 and a D6503, across a range of 0 m to 1 m

Finally, it is relevant to understand if noise in the signal depends on distance. As we saw, different devices provide different readings. In Fig. 3 we can see how error behaves with respect to distance. x axis presents distance, and y axis presents the error with respect to the regression line. The density chart shows that in the middle of the distance range, at around 15 m, error amplitude decreases; we can see, nevertheless, that at the same distance error is more dense. On both extremes of the chart the error can be considered equally high. An small increment in amplitude on the close range, is compensated with more density on the far range. This last fact contradicts what we expected when being close to the emitter, especially considering the already seen relationship between RSSI and distance. We can only conclude that the noise is present across the whole distance range in similar proportions, and that we should treat it identically, ruling out the small differences.
Fig. 3.

Errors with respect to a regression line

3 An Adaptive-Bounds Band-Pass Moving-Average Filter

Raw RSSI signal is not reliable, especially when using smartphones [11]. Even when several measurements are taken from the same position and with the same equipment, values differ significantly in amplitude. This circumstance leads us to think that a plausible solution could be to apply a filter to smooth the signal and remove extreme values. Considering that the signal strength naturally changes with distance, the filter ought to adapt itself, changing its bounds according to signal conditions over time.

Smoothing the signal can be achieved with a moving-average filter, easy to implement and fast to execute. Dealing with extreme values, considering that signal jumps both, to the high and to the low amplitude, can be possible thanks to a band-pass filter. Finally, given that the cut-off values of the band-pass filter cannot remain static, an adaptive-bounds mechanism should be conceived. Bounds must smoothly shift up and down, responding to signal strength variations as distance changes.

The filter is defined in Eqs. 1 to 4. In (1) we calculate the lower bound for the \(n^{th}\) input of the band-pass filter. f[n] represents the must recent n values filtered by the band-pass stage. \(\alpha \) is a small constant allowing to admit values slightly smaller than the minimum calculated by min; this allows the bound to better adapt to sustained decrease in signal input. In (2) we calculate the upper bound of the filter, with similar semantics to \(lb_{(n)}\), where \(\beta \) is equivalent to \(\alpha \) for the upper bound. Then, in (3), we apply the filter to the \(n^{th}\) element of the raw RSSI input represented by raw(n), considering the lower and upper bounds. Finally, in (4), we calculate the final average value for the input.
$$\begin{aligned} lb_{(n)} = \frac{min( f_{[n]} )}{1 + \alpha } \end{aligned}$$
$$\begin{aligned} ub_{(n)} = max( f_{[n]} ) * (1 + \beta ) \end{aligned}$$
$$\begin{aligned} f(n)= {\left\{ \begin{array}{ll} lb_{(n-1)}, &{} \text {if } raw(n)\le lb_{(n-1)}\\ ub_{(n-1)}, &{} \text {if } raw(n)\ge ub_{(n-1)}\\ raw(n), &{} \text {otherwise} \end{array}\right. } \end{aligned}$$
$$\begin{aligned} \bar{f}_{(n)} = \frac{1}{n} \sum f[n] \end{aligned}$$
The presented filter have three parameters that can be calibrated to adapt it to the conditions of the signal:
  • n, the window size that defines how many raw values will be used to calculate the filtered value;

  • \(\alpha \), the constant allowing the lower bound to adapt to a decreasing strength of the signal;

  • \(\beta \), the constant allowing the upper bound to adapt to an increasing strength of the signal.

4 Improving Precision on Distance Estimation

To calibrate the filter we used a small dataset. RSSI was captured, as the receiver was progressively going from 0 m to 5 m. We used a window \(n=5\), recommended on a previous study [22]. The lower and upper bounds constants where set to \(\alpha = 0.015\) and \(\beta = 0.013\) that preserve the slope of a regression line, thus preserving the RSSI - distance relationship found on the raw data. Figure 4 shows the difference between raw (black) and filtered (red) data. The slopes difference is 0.001 only, but \(R^2\) improves dramatically, going from 0.08 to 0.45.
Fig. 4.

Filtered versus raw RSSI data, on a 0.5 m–5 m range, with \(n=5\), \(\alpha = 0.015\) and \(\beta = 0.013\), between a D855 receiver and a S5830 emitter

Then, we applied the filter to the large dataset presented on Sect. 2. We can see on Fig. 5 the filtered dataset (red dots), superimposed to the raw dataset (gray dots). Signal peaks have been reduced, and data is now more dense. Global variance fell from 56.79 to 43.95. More important, the distance estimation by linear regression has been improved as well, with a RAE reducing from \(72.45\,\%\) to \(67.27\,\%\). After a 10 times 10-fold cross validation, we found that the difference is significant (\(t = 10.296, p < 2.2e^{-16}\)).
Fig. 5.

Dispersion data from the large dataset, filtered

As shown in Sect. 2, different devices provide different RSSI signatures. Some combinations of emitter-receiver can be particularly noisy, as we can see on the first row of Table 1, with an error reduction of only 1.23 %. The other device combinations present less noise, and RAE can be reduced, thanks to the filter, by up to 20.51 %.
Table 1.

Improvements in Relative Absolute Error between raw and filtered RSSI. Different combinations of devices























5 Conclusions and Future Work

In this paper we analyzed noise and instability on RSSI signal, when using Android consumer devices as emitter and receiver nodes on an IPS. We confirmed that the RSSI signal strength is inversely related to distance, and we found that noise presence is not dependent on the distance between intervening nodes. It was also shown that different devices present different patterns of signal amplitude.

We proposed the Adaptive-Bounds Band-Pass Moving-Average Filter. The filter first smooths the signal by averaging signal values on a moving window; then it cuts extreme values thanks to a band-pass filter. Last, it adapts to natural variations of the signal with an adaptive-bounds mechanism.

Finally, we calibrated the filter parameters preserving the relationship between signal strength and distance, and applied it to the experimental data. Both, global variance and relative absolute error, experienced a significant reduction, showing that the filter has notorious benefits on distance estimation.

Future work considers experimenting in different environments to confirm the best filter parameters, coupling the filter with positioning techniques and personalized mapping mechanisms, and conceiving an integrated system with interfaces for different kinds of representations.


  1. 1.
    Moser, V., Barišić, I., Rajle, D., Dimter, S.: Comparison of different survey methods data accuracy for road design and construction. In: Proceedings of the International Conference on Road and Rail Infrastructure CETRA (2016)Google Scholar
  2. 2.
    Lu, M., Chen, W., Shen, X., Lam, H.-C., Liu, J.: Positioning and tracking construction vehicles in highly dense urban areas and building construction sites. Autom. Constr. 16, 647–656 (2007)CrossRefGoogle Scholar
  3. 3.
    Mainetti, L., Patrono, L., Sergi, I.: A survey on indoor positioning systems. In: 2014 22nd International Conference on Software, Telecommunications and Computer Networks (SoftCOM), pp. 111–120. IEEE (2014)Google Scholar
  4. 4.
    An, K., Xie, S., Ouyang, Y.: Reliable sensor location for object positioning and surveillance via trilateration. Transp. Res. Procedia. 23, 228–245 (2017)CrossRefGoogle Scholar
  5. 5.
    Rusli, M.E., Ali, M., Jamil, N., Din, M.M.: An Improved Indoor Positioning Algorithm Based on RSSI-Trilateration Technique for Internet of Things (IOT). In: 2016 International Conference on Computer and Communication Engineering (ICCCE), pp. 72–77. IEEE (2016)Google Scholar
  6. 6.
    Hara, S., Zhao, D., Yanagihara, K., Taketsugu, J., Fukui, K., Fukunaga, S., Kitayama, K.: Propagation characteristics of IEEE 802.15. 4 radio signal and their application for location estimation. In: 2005 IEEE 61st Vehicular Technology Conference, VTC 2005-Spring, pp. 97–101. IEEE (2005)Google Scholar
  7. 7.
    Piyare, R.: Internet of Things: ubiquitous home control and monitoring system using android based smart phone. Int. J. Internet Things. 2, 5–11 (2013)Google Scholar
  8. 8.
    IEEE Standard for Information technology-Telecommunications and information exchange between systems Local and metropolitan area networks-Specific requirements Part 11: Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) Specifications. IEEE Std 80211–2012 Revis. IEEE Std 80211–2007. 1–2793 (2012)Google Scholar
  9. 9.
    Wu, R.-H., Lee, Y.-H., Tseng, H.-W., Jan, Y.-G., Chuang, M.-H.: Study of characteristics of RSSI signal. In: 2008 IEEE International Conference on Industrial Technology, ICIT 2008, pp. 1–3. IEEE (2008)Google Scholar
  10. 10.
    Bellavista, P., Corradi, A., Giannelli, C.: Evaluating filtering strategies for decentralized handover prediction in the wireless internet. In: 11th IEEE Symposium on Computers and Communications, ISCC 2006, Proceedings, pp. 167–174. IEEE (2006)Google Scholar
  11. 11.
    Heo, J., Kwon, Y.: Improved indoor positioning system using BLE beacons and a compensated gyroscope sensor. In: Intelligent Robotics and Applications, pp. 69–76. Springer, Cham (2017)Google Scholar
  12. 12.
    Onofre, S., Caseiro, B., Pimentão, J.P., Sousa, P.: Using fuzzy logic to improve BLE indoor positioning system. In: Technological Innovation for Cyber-Physical Systems, pp. 169–177. Springer, Cham (2016)Google Scholar
  13. 13.
    Kuxdorf-Alkirata, N., Werthwein, T., Heinemann, A., Brückmann, D.: A self-calibrating bidirectional indoor localization system. In: 2017 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 3276–3280 (2017)Google Scholar
  14. 14.
    Jadidi, M.G., Patel, M., Miro, J.V.: Gaussian processes online observation classification for RSSI-based low-cost indoor positioning systems. In: 2017 IEEE International Conference on Robotics and Automation (ICRA), pp. 6269–6275 (2017)Google Scholar
  15. 15.
    Yu, Z., Guo, G.: Improvement of positioning technology based on RSSI in ZigBee networks. Wirel. Pers. Commun. 95, 1943–1962 (2017)CrossRefGoogle Scholar
  16. 16.
    Aykaç, M., Erçelebi, E., Aldin, N.B.: ZigBee-based indoor localization system with the personal dynamic positioning method and modified particle filter estimation. Analog Integr. Circuits Signal Process. 92, 263–279 (2017)CrossRefGoogle Scholar
  17. 17.
    Lin, K.H., Lu, C.C., Chen, H.M., Li, H.F., Chuang, C.F.: A modified least squares iteration for indoor positioning system. In: 2017 IEEE International Conference on Consumer Electronics - Taiwan (ICCE-TW), pp. 109–110 (2017)Google Scholar
  18. 18.
    Luo, Q., Yan, X., Li, J., Peng, Y., Tang, Y., Wang, J., Wang, D.: DEDF: lightweight WSN distance estimation using RSSI data distribution-based fingerprinting. Neural Comput. Appl. 27, 1567–1575 (2016)CrossRefGoogle Scholar
  19. 19.
    Pyda, J., Prokop, W., Rusinek, D., Ksiezopolski, B.: Secure and reliable localization in wireless sensor network based on RSSI mapping. In: Computer Networks, pp. 55–69. Springer, Cham (2017)Google Scholar
  20. 20.
    Xue, W., Qiu, W., Hua, X., Yu, K.: Improved Wi-Fi RSSI measurement for indoor localization. IEEE Sens. J. 17, 2224–2230 (2017)CrossRefGoogle Scholar
  21. 21.
    Nagaraju, S., Gudino, L.J., Kadam, B.V., Ookalkar, R., Udeshi, S.: RSSI based indoor localization with interference avoidance for Wireless Sensor Networks using anchor node with sector antennas. In: 2016 International Conference on Wireless Communications, Signal Processing and Networking (WiSPNET), pp. 2233–2237 (2016)Google Scholar
  22. 22.
    Ordóñez-Camacho, D., Cabrera-Goyes, E.: Towards a Bluetooth Indoor Positioning System with Android Consumer Devices. To be Presented at the International Conference on Information Systems and Computer Sciences, INCISCOS (2017)Google Scholar

Copyright information

© Springer International Publishing AG 2018

Authors and Affiliations

  1. 1.Computer Science DepartmentUniversidad Tecnológica EquinoccialQuitoEcuador

Personalised recommendations