# Study of Activity Tracking through Bluetooth Low Energy-Based Network

Authors: Nasreen Mohsin; Shahram Payandeh; Derek Ho; Jean Pierre Gelinas
Journal: Journal of Sensors
 (2019)

---

## Abstract

This paper proposes a proof-of-concept, low-cost, and easily deployable Bluetooth low energy- (BLE-) based localization system which actively scans and localizes BLE beacons attached to mobile subjects in a room. Using the received signal strength (RSS) of a BLE signal and the uniqueness of BLE hardware addresses, mobile subjects can be identified and localized within the hospital room. The RSS measurement of the BLE signal from a wearable BLE beacon varies with distance to the wall-anchored BLE scanner. In order to understand and demonstrate the practicality of the relationship between RSS of a BLE beacon and the distance of a beacon from a scanner, the first part of the paper presents the analysis of the experiments conducted in a low-noise and nonreflective environment. Based on the analysis conducted in an ideal environment, the second half of the paper proposes a data-driven localization process for pinpointing the movements of the subject within the experimental room. In order to ensure higher accuracy like fingerprinting techniques and handle the increased number of BLE-anchored scanners like geometric techniques, the proposed algorithm was designed to combine the best aspects of these two techniques for better localization. The paper evaluates the effects of the number of BLE wall-mounted scanners and the number of packets on the performance of the proposed algorithm. The proposed algorithm locates the patient within the room with error less than 1.8 m. It also performs better than other classical approaches used in localization.


---

## Body

## 1. Introduction

Understanding of patients is highly dependent on the communication skills and interaction between health care workers and patients. Unfortunately, health care professionals often struggle to evaluate patient needs and physical capacity. This is especially true for cases when patients have difficulty evaluating their physical activity and underestimate their limitations [1, 2]. Hence, the addition of objective mobility sensor data has the potential to enhance the patient-clinician interaction. Estimating a patient’s mobility and exercise capacity is an important part of any preoperative clinical evaluation [3, 4].To objectively evaluate the mobility of patients, this paper presents a low-cost and easily deployable indoor localization system to locate and record the activity of patients. With the help of Bluetooth low energy (BLE) signal strength and the uniqueness of the BLE-based hardware addresses, the patient can be uniquely identified and located for tracking in home or any care giving settings.The first step in the localization process is to implement a BLE-based communication system in which critical information of patients such body stats and signal strength from a wearable beacon are collected by scanners and gateways anchored on walls of the rooms. In the deployed system, the paper provides two main contributions for localization.The first part of the paper ascertains the performance and limitations of signal strength- (RSS-) based localization in both nearly noise-free and realistic environments. Here, the paper studies the practicality of the BLE RSS-distance relationship between beacon and scanner on the performance of the localization. Based on experimental studies, the second part of the paper proposes a localization algorithm which was developed, implemented, and evaluated accordingly. The algorithm combines and uses the best parts of classic techniques such as geometric technique and fingerprinting for improved accuracy of localization within a small area such as a hospital room.The remainder of this paper is divided as follows. Section2 gives a background overview of indoor localization systems whereas Section 3 discusses various available techniques used in wireless-based indoor positioning systems. Section 4 describes the architecture of a communication system along with the hardware components used for localization. Section 5 examines the relationship between the strength of the BLE signal and the distance of the beacon from the scanner in a noise-free environment. Based on this evaluation, the localization process is proposed which is detailed in Section 6. Section 7 presents the evaluations of the proposed localization algorithm in terms of number of BLE scanners and number of BLE packets. In addition, comparative performance evaluations against other available techniques have been conducted as shown in Section 7. Furthermore, Section 8 discusses the performances of the proposed algorithm and other available techniques. Finally, Section 9 concludes the paper and mentions further improvements to be made in future works.


## 2. Background

In outdoor settings, global navigation satellite systems (GNSS) are usually employed in estimating the position of a target. However, there is an absence of such global standard in case of positioning in indoor spaces. For this reason, several research efforts have been made in deploying reliable indoor positioning systems (IPS). Localization of a device or subject in indoor spaces is one of the most important information required in several applications. Due to the widespread deployment of sensors, there has been an increased interest in acquiring and analyzing such large information.The evolution of IPS techniques has been described and updated in several surveys [5–7]. These surveys examine various IPS techniques in terms of strengths and weaknesses depending on specific applications. Reference [7] makes a distinction between “technologies” and “techniques” where technologies in IPS are specific ways in using various types of signals such as ultrasound, magnetic fields, light, and radiofrequency (RF). On the other hand, “technique” refers to basic conceptual tools which, in principle, can be applied in most of the technologies.For indoor localization, several technologies such as ultrasound and vision are being studied and developed to estimate the position of the people [8, 9]. However, RF-based localization systems [10, 11] have become very popular and suitable indoors, as they make use of the availability of the infrastructure of wireless communication. The amount of data that needs to be processed for wireless signal-based localization is computationally less expensive than that produced by more accurate sensors like RGB-D cameras or laser rangefinders. Location can be from various parameters of wireless signals, such as time of flight (ToF), angle of arrival (AoA), time difference of arrival (TDoA), or received signal strength (RSS). Nevertheless, the latter parameter is feasible in most commercial wireless technologies without hardware or software modifications. As RSS information can easily be measured with off-the-shelf equipment, it has become the basis for the most popular techniques for inferring the relative positions of nodes in the wireless network. A significant feature of radio transmission is that the signal strength decreases as the distance increases.Despite its wide popularity, RSS could yield unpredictable received power values, particularly in indoor environments where random factors such as interference, attenuation, reflectance, and fading affect the radio signal propagation, which makes RSS-based ranging quite challenging especially in small spaces [12]. Hence, this paper attempts to analyze one of the main factors, i.e., fading in a nonreflective and noise-free environment, in order to mitigate this effect and improve the relationship between signal strength and distance.


## 3. Related Works

Several works depending on wireless signal strength for indoor localization can be broadly classified based on geometric and fingerprinting techniques. Geometry techniques locate the position of the target through simple geometry and known positions of anchored devices. Given at least three anchored devices, if distance to these anchored devices can be inferred from new RSS measurements, the location of the target can be easily calculated using simple geometry techniques such as hyperbolic and circular approaches. The hyperbolic approach converts the geometric problem in linear form and solves it through a closed form of the least square method [13, 14]. On the other hand, the circular approach iteratively solves the optimization problem [15, 16] through a gradient step.Since most of the approaches assume a priori RSS-channel modelling based on estimated parameters of the channel model, the estimated model is usually a poor representation of the real RSS channel due to a limited number of measurements taken. Consequently, this challenge can be overcome either by modelling the environment adaptively or by using a more robust positioning technique against any model inaccuracies. Few previous techniques have been developed to calculate the channel model along with periodic updates during the localization process in order to minimize the errors caused by the poorly estimated propagation model [17, 18]. Although these models describe the real propagation behavior with better accuracy, they are updated from a limited set of noisy measurements which still make the estimated model imperfect. Also, the cost required for updating the channel models is very high. Hence, techniques such as weighting are used to compensate for inaccuracies in distance estimation [16, 19]. The proposed algorithm uses the weights which are inversely proportional to increasing distance estimation inaccuracies caused by the estimated RSS-distance model.The fingerprinting approach refers to techniques which first collect samples of the measurements at known locations in the environment during the training phase. In the online phase, this collected dataset is then used to predict the location of new measurements. Compared to geometric approaches, fingerprinting techniques have demonstrated higher accuracies in practice [17, 20, 21]. However, most of the techniques are used for Wi-Fi-based devices where deployment is much less, thereby the fingerprint size is small. However, due to the bureaucracy involved in using the existing Wi-Fi, devices are not easily deployable in hospitals. On the other hand, with large deployment of BLE devices, the fingerprint size would be very large at each location and the cost for matching the new fingerprint with the database would very high. Plus, the database needs to be updated over time to curb the growing errors due to a changing environment.Also, several works have focused on tracking devices which scan for signals coming from wall-mounted beacons. However, these works mainly focus on navigating the users carrying the scanning device for signals coming from a passive kind of infrastructure in indoor areas [7]. In this paper, our focus is to actively scan and locate the subjects wearing the BLE beacon which emits the signals to anchored BLE scanners. Such infrastructure is of active kind [7].Unlike other works, this paper conducts a study on the feasibility aspect on the RSS-distance relationship which is highly used in RF-based IPS. After identifying the limitations, the paper introduces an improved localization system which can be used to localize subjects within small spaces. In the proposed technique, the accuracy of localization is further improved by selecting and combining the desirable elements from both geometric and fingerprinting approaches. In most available techniques, data from the BLE beacon are usually processed in given time intervals. Such localization process is driven by time. However, there are cases when critical information from the BLE beacon may not reach the scanner within a specified window frame. Lack of such information may affect the accuracy of the localization of target. Hence, the online part of the proposed localization algorithm is driven by events depending on the amount of received data itself. The following sections of the paper will explain how the proposed technique is developed, implemented, and evaluated.


## 4. Communication Architecture of the BLE Localization System

Due to the real-time characteristics and low-power consumption in active mode, the number of Bluetooth devices has dramatically expanded in the last seven years, especially after the introduction of a newly developed energy-efficient short-range wireless communication protocol known as BLE [22]. BLE was first introduced in 2010 as a part of the Bluetooth Core specification version 4.0, with a main goal in which all the applications require low current consumption and low implementation complexity [23]. From this, several products were being introduced like iBeacon and Estimate. All these products are easily deployable and are being used in indoor localization processes [24]. In this work, a 3rd party sensor device was used which not only emits BLE packets but also includes body stats sensor data such as accelerometer in the BLE packets which is very useful in gathering critical information of patients in hospitals.Figure1 illustrates the overview of communication architecture of the proposed BLE localization system. The communication system has been designed to send data from a beacon worn by a patient or mounted on a walking aid to the central monitoring and cloud computing system via BLE fixed scanners (FS) and gateways (GW). The FS and gateway devices are anchored on the wall. The details of communication architecture can be divided into four parts as follows.Figure 1
Overview of the communication architecture of the BLE localization system.


### 4.1. Data Advertisement

The primary function of BLE in mobile beacons is to advertise information about the current state of the device for diagnostic purposes, as well as its RSS value that can be processed to provide location information. For this kind of application, a tiny square-shaped IoT module called Sensor Tile (shown in Figure2) is used which packs powerful processing capabilities leveraging an 80 MHz STM32L476JGY microcontroller and Bluetooth low-energy connectivity based on a BlueNRG-MS network processor as well as a wide spectrum of motion and environmental MEMS sensors, including a digital microphone [25]. The BlueNRG-MS component of that IoT module is a very low-power Bluetooth low energy (BLE) single-mode network processor, compliant with Bluetooth specification v4.1.Figure 2
(a) Wearable beacon and (b) Sensor Tile IoT module used as both beacon and scanner.
(a)
(b)The beacon advertises “BLE AD pkt” packets in a user-specified advertising period at a user-specified transmission power. The broadcast packets follow the specifications designed by the company. The advertising period can be set in such a way that the battery life of the beacon can be extended, and the packets are consistently collected by FS devices. Each advertisement packet “BLE AD pkt” will contain a Universal Unique Identifier (UUID) of the beacon. In order to enable time synchronization on the beacon, the beacon will advertise as connectable. When a fixed scanner (FS) scans and infers from “BLE AD pkt,” that beacon is advertising as connectable, and it will connect and update a correct time to the beacon’s current time characteristic.


### 4.2. Data Reception and Measurement

The IoT hardware used for beaconing functionality (Figure2(b)) can also be configured to function as FS device which are anchored on walls. After timestamping the received “BLE AD pkt” packet, FS measures the signal strength of the received packet from the beacon and adds that information in the “BLE Info pkt” packet along with its own UUID and the timestamp of reception. To correctly timestamp the received packet from the beacon, both mobile beacon and FS devices receive time sync packets from the gateway which in turn updates its own real-time clock (RTC) from the network time protocol (NTP) server over Wi-Fi.


### 4.3. Data Transfer

On the other side of the communication system, information collected by FS is then transmitted to a central cloud computing system through gateways. In this system, Raspberry Pi 3 Model B (shown in Figure3) is chosen to function as a GW device which is the third-generation Raspberry Pi containing both IEEE 802.11n Wi-Fi and Bluetooth BLE v 4.0 [26]. The GW device communicates with FS devices through Bluetooth and can either measure received signal directly from the beacon or receive the information of that beacon via FS. Once received, the GW device either stores the data offline or sends data to a cloud computing system through Wi-Fi. After receiving the “BLE Info pkt” packet from the FS device, the GW device also timestamps received packets, adds its ID and timestamp to the “BLE Info pkt” packet, and relays as “Wi-Fi Info pkt” packet from FS to cloud service.Figure 3
Raspberry Pi 3 Model B as gateway when sending data to cloud computing.


### 4.4. Cloud Computing

To send the “Wi-Fi Info pkt” data packet to the Amazon Web Services (AWS) Cloud database, the GW device uses Message Queuing Telemetry Transport (MQTT) protocol which is a publish-subscribe-based messaging protocol. It is designed for connections with remote locations where a “small code footprint” is required or the network bandwidth is limited [27]. The data packet is stored in a database at AWS cloud from which the localization algorithm can retrieve and process the data and determine the location of the beacon. All the known IDs and locations of the FS devices and GW devices will also be stored in the database.Along with data storage, cloud computing enables the proposed localization system in analyzing and estimating the positions of beacons based on the data retrieved from the database. Finally, the estimated position of the targeted beacon will be mapped on a web interface with the help of information containing known positions of scanners placed in rooms.


## 4.1. Data Advertisement

The primary function of BLE in mobile beacons is to advertise information about the current state of the device for diagnostic purposes, as well as its RSS value that can be processed to provide location information. For this kind of application, a tiny square-shaped IoT module called Sensor Tile (shown in Figure2) is used which packs powerful processing capabilities leveraging an 80 MHz STM32L476JGY microcontroller and Bluetooth low-energy connectivity based on a BlueNRG-MS network processor as well as a wide spectrum of motion and environmental MEMS sensors, including a digital microphone [25]. The BlueNRG-MS component of that IoT module is a very low-power Bluetooth low energy (BLE) single-mode network processor, compliant with Bluetooth specification v4.1.Figure 2
(a) Wearable beacon and (b) Sensor Tile IoT module used as both beacon and scanner.
(a)
(b)The beacon advertises “BLE AD pkt” packets in a user-specified advertising period at a user-specified transmission power. The broadcast packets follow the specifications designed by the company. The advertising period can be set in such a way that the battery life of the beacon can be extended, and the packets are consistently collected by FS devices. Each advertisement packet “BLE AD pkt” will contain a Universal Unique Identifier (UUID) of the beacon. In order to enable time synchronization on the beacon, the beacon will advertise as connectable. When a fixed scanner (FS) scans and infers from “BLE AD pkt,” that beacon is advertising as connectable, and it will connect and update a correct time to the beacon’s current time characteristic.


## 4.2. Data Reception and Measurement

The IoT hardware used for beaconing functionality (Figure2(b)) can also be configured to function as FS device which are anchored on walls. After timestamping the received “BLE AD pkt” packet, FS measures the signal strength of the received packet from the beacon and adds that information in the “BLE Info pkt” packet along with its own UUID and the timestamp of reception. To correctly timestamp the received packet from the beacon, both mobile beacon and FS devices receive time sync packets from the gateway which in turn updates its own real-time clock (RTC) from the network time protocol (NTP) server over Wi-Fi.


## 4.3. Data Transfer

On the other side of the communication system, information collected by FS is then transmitted to a central cloud computing system through gateways. In this system, Raspberry Pi 3 Model B (shown in Figure3) is chosen to function as a GW device which is the third-generation Raspberry Pi containing both IEEE 802.11n Wi-Fi and Bluetooth BLE v 4.0 [26]. The GW device communicates with FS devices through Bluetooth and can either measure received signal directly from the beacon or receive the information of that beacon via FS. Once received, the GW device either stores the data offline or sends data to a cloud computing system through Wi-Fi. After receiving the “BLE Info pkt” packet from the FS device, the GW device also timestamps received packets, adds its ID and timestamp to the “BLE Info pkt” packet, and relays as “Wi-Fi Info pkt” packet from FS to cloud service.Figure 3
Raspberry Pi 3 Model B as gateway when sending data to cloud computing.


## 4.4. Cloud Computing

To send the “Wi-Fi Info pkt” data packet to the Amazon Web Services (AWS) Cloud database, the GW device uses Message Queuing Telemetry Transport (MQTT) protocol which is a publish-subscribe-based messaging protocol. It is designed for connections with remote locations where a “small code footprint” is required or the network bandwidth is limited [27]. The data packet is stored in a database at AWS cloud from which the localization algorithm can retrieve and process the data and determine the location of the beacon. All the known IDs and locations of the FS devices and GW devices will also be stored in the database.Along with data storage, cloud computing enables the proposed localization system in analyzing and estimating the positions of beacons based on the data retrieved from the database. Finally, the estimated position of the targeted beacon will be mapped on a web interface with the help of information containing known positions of scanners placed in rooms.


## 5. Study of the Distance-RSS Relationship in an Ideal Environment

### 5.1. Path Loss Propagation Model

In both indoor and outdoor environments, the average large-scale path loss for arbitrary transmitter-receiver (T-R) separation is expressed as a function of distance as follows [28]:
(1)PLd∝dd0η,(2)PLdB=PLd0+10ηlogdd0+χg,where η is the path loss exponent which indicates the rate at which path loss increases with distance d in a particular environment. The value for η depends on the specific propagation environment, i.e., type of construction material, architecture, and location within the building. The lower the value of η, the lower the signal loss. The values of η range from 1.2 (waveguide effect) to 6. In free space, η is equal to 2.Table1 shows the path loss exponents for different environments. For realistic indoor localization of patients, η should vary from 1.6 to 4.3.Table 1
Path loss exponentsn for different environments.
Environment
Path loss exponent
Free space
2
In building (line-of-sight)
1.6-1.8
In building (obstructed)
2.7-4.3
Outdoor urban areas
2.7-3.5
Outdoor shadowed urban areas
3-5d0 is the reference distance to the transmitter, say 1 m for indoors (1 km for outdoors). χσ is a normal random variable with zero mean, reflecting the attenuation caused by flat fading. In case of no fading, this variable is 0. In case of only shadow fading or slow fading, this random variable may have Gaussian distribution with σ standard deviation in dB, resulting in log-normal distribution of the received power in watts. For this work, we consider the log-normal path loss model. Usually, PL (d0) is the calibrated and constant parameter PL1 at 1 m. Hence, Equation (2) can be modified and be simplified to
(3)PLdB=PL1+10ηlog10d+nσ,nσ~N0,σ.Path loss PL (dB) is defined [25] in the following equation:Equation (3) would result as
(4)PLdB=Txpower−RSSI=PTxdBm−PRxdBm,(5)PTxdBm−PRxdBm=PL1+10nlogd.Ifx=+10log10d, m=n, b=PL1, and y=PLdB.Equation (5) =>y=mx+b in a log-log scale graph. From the experimental RSSI values of BLE packets at varying distances, a simple polynomial curve fitting model with 1 degree can be used to derive the values for PL1 and η in a power-log distance scale graph. From that graph, these parameters can be used to determine the distance in the equation which is derived from Equation (5).
(6)d=10PTxdBm−PRxdBm−PL1/10η.


### 5.2. Experimental Analysis in an Anechoic Chamber

One of the main reasons for causing huge fluctuations in RSS values of transmitted signal from the beacon over time is the multipath propagation and interference of signals. In order to study the baseline relationship between the received signal strength (RSS) of the beacon and distance under an ideal transmission environment in which no reflections or any other additional noises of signals occur, data collection was conducted in an anechoic chamber as shown in Figure4.Figure 4
Setup of an ideal transmission environment in the anechoic chamber for BLE signal strength analysis.
(a)
Anechoic chamber
(b)
Schematic setup for signal strength analysisIn Figure4(b), the beacon transmits the BLE signal at varying transmission powers across the room to the scanner which in turn stores the measured RSS values for the analysis. Bother beacon and scanner are maintained at the same height of 1.5 m. The distance between transmitter and receiver is varied between 0.6 m and 2.07 m (due to the limited size of the room) and are controlled by the chamber system’s motors and software. At each distance and each transmission power of beacon, more than 2 minutes of samples were collected.Also, the orientation of the beacon is rotated to six orthogonal orientations w.r.t the direction of the scanner in order to understand the effects of polarity difference in RSS values. For the latter part of the work, this study of RSS-distance can be used as reference for estimating the distance of the beacon by a scanner with better accuracy in any given environment. In this environment, the range of RSS is kept between the distances of the beacon and scanner at 0~2.07 m. For instance, Figure5 displays the characteristics of RSS and more than 150 samples were recorded at each distance of 1 m and 2.07 m.Figure 5
Characteristics of RSS data transmitted at 2 dBm power over distances (a) 1 m and (b) 2 m.
(a)
d=0.6m
(b)
d=1.2mIn Figure5, RSS measurements presented obvious nonstationary characteristics over passage of time. Also, as the distance between beacon and scanner increases, the RSSI tends to fluctuate less frequently. In Sections 5.2.1–5.2.3, the paper will first examine the effects of orientation on distribution of RSS values at each distance. Based on the results from the distribution, RSS values are recorded according to the study of the overall relationship between RSS values of the signal from the BLE beacon and the varying distances between BLE beacon and scanner. The accuracy of the estimated model of RSS-distance of BLE devices will be evaluated against the actual distance. The data collection process for these three parts of Section 5.2 can be summarized into three configurations as presented in Table 2.Table 2
Dataset collection process for three experimental configurations in Section5.2.
Experimental configurations
Parameters employed in each configuration
Number of datasets
Average sample size of each dataset
Distances (m)
Transmission powers (dB)
Orientations
1
0.6-2.07
2
6 orthogonal orientations
24
200
2
0.6–2.07
2
Random
4
900
3
0.6–2.07
8, 2-8, −18
Random
16
200


#### 5.2.1. Distribution of RSS over Varying Orientations

In this section, the dataset was collected according to experimental configuration 1 from Table2. Figure 6 illustrates this dataset in the form of distribution of RSS values over varying orientations at each distance. At each distance, the scanner appears to record higher RSS values caused by certain orientations of the BLE beacon. In Figure 6, “side 1 and side 2” orientations of the beacon appear at higher RSS values at each distance whereas other orientations are spread at the lower RSS values. This measurement shift in each orientation is due to the difference in polarity between transmitter and receiver antennas. This could be useful in incorporating the effects of the direction of the BLE beacon during formation of the RSS-distance model.Figure 6
Distribution of RSS values over varying orientations at distances (a) 0.6, (b) 1.0 m, (c) 1.5 m, and (d) 2.07 m. “side 1 (orange) and side 2 (purple)” orientations of the beacon appear at higher RSS values at all distances whereas other orientations are spread at lower RSS values.
(a)
(b)
(c)
(d)However, the current hardware in the BLE device for this paper does not have configuration to detect the orientation shift. Also, in real scenarios, the beacons worn by subjects will be constantly varying its orientations. Hence, it is important to constantly and randomly change the orientation of the mobile beacon for the purpose of studying the RSS-distance relationship in the current configuration of the BLE device.


#### 5.2.2. Study of the Distance-RSS Relation over All Random Orientations

For this study, experimental configuration 2 from Table2 was implemented with each dataset containing a large sample size. On examining this dataset, the relationship between RSS-distance can be expressed as a path loss-log distance relationship by combining and reconfiguring Equations (4) and (5) as demonstrated in Section 5.1.Figure7 shows the distribution of RSS values at each distance using Tx power as 2 dBm. RSS values are expressed as path loss values under a given Tx power while taking logarithm base 10 of distances. Figure 7(a) shows the probability density (PD) over 1 dBm of path loss value and 1 log (m) of log distance. In that figure, higher probabilities of path loss (yellow values) appear to go linearly in log distance. At each log distance, the PD of path loss values appears to follow Gaussian distribution [28] as shown in Figure 7(b).Figure 7
Path loss-log distance relationship from its corresponding RSS-distance relationship. (a) 3D-normalized histogram over 1 dB and 1 log distance m. Lighter yellow colors show higher probabilities. (b) Curve of probability density (PD) over 3D histogram whend=1m and d=2.07m. (c) Curves of probability density (PD) over distance from 0.6 to 2.07 m. The path loss PD curves tend to shift toward more power loss as the distance between beacon and scanner increases. (d) Path loss-log distance log-loss scale graph. From this graph, a linear regression for Equation (5) is fitted and parameters for η and are derived as 1.9 and 65.10 dB.
(a)
(b)
(c)
(d)Figure7(c) demonstrates the shifts of fitted normal curves along the log distance. As the distance increases, the normal curve shifts towards larger path loss values. The peaks of the varying PD curves are represented by the mean of the distributions at varying distances. From the relationship between the peak of PD curves and log distances, the parameters for the RSS-distance model such as η and PL1 can be derived by fitting the peaks with a polynomial of 1 degree as shown in Figure 7(d). ηis found to be 1.9≈2 for a nonreflective ideal environment (anechoic chamber).These derived parameters are then plugged into Equation (5) to obtain and estimate the RSS-distance model as shown in Figure 8(a). Figures 8(b) and 8(c) present the evaluations of the estimated model. In both figures, the error of the model is below 0.6 m for smaller distances. In Figure 8(c), the estimation error is below 0.7 m at nearly 90% probability for lower distances. On the other hand, the estimation error for an actual distance of 2.07 m is below 1.5 m at 80% probability. Hence, it can be concluded that distance estimation error-based RSS values increase with increase in distance. This error can be used to compensate the estimated distances during localization in the real environment.Figure 8
(a) RSS-distance estimation model, (b) RMSE of the RSS-distance model with an overall error 0.876 m, and (c) error estimation probability for each distance based on the RSS-distance estimation model.
(a)
(b)
(c)


#### 5.2.3. Study of the Distance-RSS Relation over Varying Transmission Powers

The battery consumption of the BLE beacon is highly proportional to theTx power. The higher the Tx power, the higher the battery energy the BLE beacon will consume. Hence, it is important to find the trade-off between distance estimation accuracy and transmission power. In the current BLE hardware, the maximum and minimum Tx power is 8 dBM and −18 dBm, respectively. 2 and −8 dBm are also chosen to represent higher and lower Tx powers.Here, experimental configuration 3 from Table2 was performed to generate 16 different datasets for this study. In Figure 9, the RSS-distance relationships are compared with respect to increasing Tx powers. RSS-distance curves tend to shift towards lower RSS values as Tx power decreases.Figure 9
Distance-RSS-estimated curves over varyingTx power 8, 2, −8, and −18 dBm.From those curves, the distances are estimated and its RMSE errors are compared in Figure10. As concluded in Section 5.2.2, RMSE increases with increase in distance regardless of Tx power. In both Figures 10 and 11, the RSS-distance model w.r.t higher transmission power 8 dBm performs better. However, the power consumption of the BLE beacon will be very high at that Tx power level and the battery would last just a few hours. In order to reduce the cost of replacing/recharging batteries and maintain continuous tracking of BLE beacons, it is best to choose a lower Tx power level in such a way that the RSS-distance model still gives low overall RMS distance error estimation. Hence, −8 dBm Tx level is chosen for localization as its overall RSME error is 0.56 m.Figure 10
RMSE of distance estimation by all RSS-distance models based onTx powers.Figure 11
Overall RMSE distance estimation over varyingTx powers. A trade-off between Tx power and RSS-based distance estimation is required to ensure lower estimation error over low-power consumption.In summary, it is important to maintain random orientations of the BLE beacon while estimating the RSS-distance model during initial scene profiling for the localization system. At lower distances below 2 m from the fixed scanner, the estimation error of the mobile beacon’s distance is quite low. Hence, for rooms larger than 2 m in size, more than one fixed scanner is required to estimate the mobile beacon. Also, theTx power level is to be fixed in such a way to maintain the trade-off between lower-energy consumption and higher-distance estimation accuracy.


## 5.1. Path Loss Propagation Model

In both indoor and outdoor environments, the average large-scale path loss for arbitrary transmitter-receiver (T-R) separation is expressed as a function of distance as follows [28]:
(1)PLd∝dd0η,(2)PLdB=PLd0+10ηlogdd0+χg,where η is the path loss exponent which indicates the rate at which path loss increases with distance d in a particular environment. The value for η depends on the specific propagation environment, i.e., type of construction material, architecture, and location within the building. The lower the value of η, the lower the signal loss. The values of η range from 1.2 (waveguide effect) to 6. In free space, η is equal to 2.Table1 shows the path loss exponents for different environments. For realistic indoor localization of patients, η should vary from 1.6 to 4.3.Table 1
Path loss exponentsn for different environments.
Environment
Path loss exponent
Free space
2
In building (line-of-sight)
1.6-1.8
In building (obstructed)
2.7-4.3
Outdoor urban areas
2.7-3.5
Outdoor shadowed urban areas
3-5d0 is the reference distance to the transmitter, say 1 m for indoors (1 km for outdoors). χσ is a normal random variable with zero mean, reflecting the attenuation caused by flat fading. In case of no fading, this variable is 0. In case of only shadow fading or slow fading, this random variable may have Gaussian distribution with σ standard deviation in dB, resulting in log-normal distribution of the received power in watts. For this work, we consider the log-normal path loss model. Usually, PL (d0) is the calibrated and constant parameter PL1 at 1 m. Hence, Equation (2) can be modified and be simplified to
(3)PLdB=PL1+10ηlog10d+nσ,nσ~N0,σ.Path loss PL (dB) is defined [25] in the following equation:Equation (3) would result as
(4)PLdB=Txpower−RSSI=PTxdBm−PRxdBm,(5)PTxdBm−PRxdBm=PL1+10nlogd.Ifx=+10log10d, m=n, b=PL1, and y=PLdB.Equation (5) =>y=mx+b in a log-log scale graph. From the experimental RSSI values of BLE packets at varying distances, a simple polynomial curve fitting model with 1 degree can be used to derive the values for PL1 and η in a power-log distance scale graph. From that graph, these parameters can be used to determine the distance in the equation which is derived from Equation (5).
(6)d=10PTxdBm−PRxdBm−PL1/10η.


## 5.2. Experimental Analysis in an Anechoic Chamber

One of the main reasons for causing huge fluctuations in RSS values of transmitted signal from the beacon over time is the multipath propagation and interference of signals. In order to study the baseline relationship between the received signal strength (RSS) of the beacon and distance under an ideal transmission environment in which no reflections or any other additional noises of signals occur, data collection was conducted in an anechoic chamber as shown in Figure4.Figure 4
Setup of an ideal transmission environment in the anechoic chamber for BLE signal strength analysis.
(a)
Anechoic chamber
(b)
Schematic setup for signal strength analysisIn Figure4(b), the beacon transmits the BLE signal at varying transmission powers across the room to the scanner which in turn stores the measured RSS values for the analysis. Bother beacon and scanner are maintained at the same height of 1.5 m. The distance between transmitter and receiver is varied between 0.6 m and 2.07 m (due to the limited size of the room) and are controlled by the chamber system’s motors and software. At each distance and each transmission power of beacon, more than 2 minutes of samples were collected.Also, the orientation of the beacon is rotated to six orthogonal orientations w.r.t the direction of the scanner in order to understand the effects of polarity difference in RSS values. For the latter part of the work, this study of RSS-distance can be used as reference for estimating the distance of the beacon by a scanner with better accuracy in any given environment. In this environment, the range of RSS is kept between the distances of the beacon and scanner at 0~2.07 m. For instance, Figure5 displays the characteristics of RSS and more than 150 samples were recorded at each distance of 1 m and 2.07 m.Figure 5
Characteristics of RSS data transmitted at 2 dBm power over distances (a) 1 m and (b) 2 m.
(a)
d=0.6m
(b)
d=1.2mIn Figure5, RSS measurements presented obvious nonstationary characteristics over passage of time. Also, as the distance between beacon and scanner increases, the RSSI tends to fluctuate less frequently. In Sections 5.2.1–5.2.3, the paper will first examine the effects of orientation on distribution of RSS values at each distance. Based on the results from the distribution, RSS values are recorded according to the study of the overall relationship between RSS values of the signal from the BLE beacon and the varying distances between BLE beacon and scanner. The accuracy of the estimated model of RSS-distance of BLE devices will be evaluated against the actual distance. The data collection process for these three parts of Section 5.2 can be summarized into three configurations as presented in Table 2.Table 2
Dataset collection process for three experimental configurations in Section5.2.
Experimental configurations
Parameters employed in each configuration
Number of datasets
Average sample size of each dataset
Distances (m)
Transmission powers (dB)
Orientations
1
0.6-2.07
2
6 orthogonal orientations
24
200
2
0.6–2.07
2
Random
4
900
3
0.6–2.07
8, 2-8, −18
Random
16
200


### 5.2.1. Distribution of RSS over Varying Orientations

In this section, the dataset was collected according to experimental configuration 1 from Table2. Figure 6 illustrates this dataset in the form of distribution of RSS values over varying orientations at each distance. At each distance, the scanner appears to record higher RSS values caused by certain orientations of the BLE beacon. In Figure 6, “side 1 and side 2” orientations of the beacon appear at higher RSS values at each distance whereas other orientations are spread at the lower RSS values. This measurement shift in each orientation is due to the difference in polarity between transmitter and receiver antennas. This could be useful in incorporating the effects of the direction of the BLE beacon during formation of the RSS-distance model.Figure 6
Distribution of RSS values over varying orientations at distances (a) 0.6, (b) 1.0 m, (c) 1.5 m, and (d) 2.07 m. “side 1 (orange) and side 2 (purple)” orientations of the beacon appear at higher RSS values at all distances whereas other orientations are spread at lower RSS values.
(a)
(b)
(c)
(d)However, the current hardware in the BLE device for this paper does not have configuration to detect the orientation shift. Also, in real scenarios, the beacons worn by subjects will be constantly varying its orientations. Hence, it is important to constantly and randomly change the orientation of the mobile beacon for the purpose of studying the RSS-distance relationship in the current configuration of the BLE device.


### 5.2.2. Study of the Distance-RSS Relation over All Random Orientations

For this study, experimental configuration 2 from Table2 was implemented with each dataset containing a large sample size. On examining this dataset, the relationship between RSS-distance can be expressed as a path loss-log distance relationship by combining and reconfiguring Equations (4) and (5) as demonstrated in Section 5.1.Figure7 shows the distribution of RSS values at each distance using Tx power as 2 dBm. RSS values are expressed as path loss values under a given Tx power while taking logarithm base 10 of distances. Figure 7(a) shows the probability density (PD) over 1 dBm of path loss value and 1 log (m) of log distance. In that figure, higher probabilities of path loss (yellow values) appear to go linearly in log distance. At each log distance, the PD of path loss values appears to follow Gaussian distribution [28] as shown in Figure 7(b).Figure 7
Path loss-log distance relationship from its corresponding RSS-distance relationship. (a) 3D-normalized histogram over 1 dB and 1 log distance m. Lighter yellow colors show higher probabilities. (b) Curve of probability density (PD) over 3D histogram whend=1m and d=2.07m. (c) Curves of probability density (PD) over distance from 0.6 to 2.07 m. The path loss PD curves tend to shift toward more power loss as the distance between beacon and scanner increases. (d) Path loss-log distance log-loss scale graph. From this graph, a linear regression for Equation (5) is fitted and parameters for η and are derived as 1.9 and 65.10 dB.
(a)
(b)
(c)
(d)Figure7(c) demonstrates the shifts of fitted normal curves along the log distance. As the distance increases, the normal curve shifts towards larger path loss values. The peaks of the varying PD curves are represented by the mean of the distributions at varying distances. From the relationship between the peak of PD curves and log distances, the parameters for the RSS-distance model such as η and PL1 can be derived by fitting the peaks with a polynomial of 1 degree as shown in Figure 7(d). ηis found to be 1.9≈2 for a nonreflective ideal environment (anechoic chamber).These derived parameters are then plugged into Equation (5) to obtain and estimate the RSS-distance model as shown in Figure 8(a). Figures 8(b) and 8(c) present the evaluations of the estimated model. In both figures, the error of the model is below 0.6 m for smaller distances. In Figure 8(c), the estimation error is below 0.7 m at nearly 90% probability for lower distances. On the other hand, the estimation error for an actual distance of 2.07 m is below 1.5 m at 80% probability. Hence, it can be concluded that distance estimation error-based RSS values increase with increase in distance. This error can be used to compensate the estimated distances during localization in the real environment.Figure 8
(a) RSS-distance estimation model, (b) RMSE of the RSS-distance model with an overall error 0.876 m, and (c) error estimation probability for each distance based on the RSS-distance estimation model.
(a)
(b)
(c)


### 5.2.3. Study of the Distance-RSS Relation over Varying Transmission Powers

The battery consumption of the BLE beacon is highly proportional to theTx power. The higher the Tx power, the higher the battery energy the BLE beacon will consume. Hence, it is important to find the trade-off between distance estimation accuracy and transmission power. In the current BLE hardware, the maximum and minimum Tx power is 8 dBM and −18 dBm, respectively. 2 and −8 dBm are also chosen to represent higher and lower Tx powers.Here, experimental configuration 3 from Table2 was performed to generate 16 different datasets for this study. In Figure 9, the RSS-distance relationships are compared with respect to increasing Tx powers. RSS-distance curves tend to shift towards lower RSS values as Tx power decreases.Figure 9
Distance-RSS-estimated curves over varyingTx power 8, 2, −8, and −18 dBm.From those curves, the distances are estimated and its RMSE errors are compared in Figure10. As concluded in Section 5.2.2, RMSE increases with increase in distance regardless of Tx power. In both Figures 10 and 11, the RSS-distance model w.r.t higher transmission power 8 dBm performs better. However, the power consumption of the BLE beacon will be very high at that Tx power level and the battery would last just a few hours. In order to reduce the cost of replacing/recharging batteries and maintain continuous tracking of BLE beacons, it is best to choose a lower Tx power level in such a way that the RSS-distance model still gives low overall RMS distance error estimation. Hence, −8 dBm Tx level is chosen for localization as its overall RSME error is 0.56 m.Figure 10
RMSE of distance estimation by all RSS-distance models based onTx powers.Figure 11
Overall RMSE distance estimation over varyingTx powers. A trade-off between Tx power and RSS-based distance estimation is required to ensure lower estimation error over low-power consumption.In summary, it is important to maintain random orientations of the BLE beacon while estimating the RSS-distance model during initial scene profiling for the localization system. At lower distances below 2 m from the fixed scanner, the estimation error of the mobile beacon’s distance is quite low. Hence, for rooms larger than 2 m in size, more than one fixed scanner is required to estimate the mobile beacon. Also, theTx power level is to be fixed in such a way to maintain the trade-off between lower-energy consumption and higher-distance estimation accuracy.


## 5.2.1. Distribution of RSS over Varying Orientations

In this section, the dataset was collected according to experimental configuration 1 from Table2. Figure 6 illustrates this dataset in the form of distribution of RSS values over varying orientations at each distance. At each distance, the scanner appears to record higher RSS values caused by certain orientations of the BLE beacon. In Figure 6, “side 1 and side 2” orientations of the beacon appear at higher RSS values at each distance whereas other orientations are spread at the lower RSS values. This measurement shift in each orientation is due to the difference in polarity between transmitter and receiver antennas. This could be useful in incorporating the effects of the direction of the BLE beacon during formation of the RSS-distance model.Figure 6
Distribution of RSS values over varying orientations at distances (a) 0.6, (b) 1.0 m, (c) 1.5 m, and (d) 2.07 m. “side 1 (orange) and side 2 (purple)” orientations of the beacon appear at higher RSS values at all distances whereas other orientations are spread at lower RSS values.
(a)
(b)
(c)
(d)However, the current hardware in the BLE device for this paper does not have configuration to detect the orientation shift. Also, in real scenarios, the beacons worn by subjects will be constantly varying its orientations. Hence, it is important to constantly and randomly change the orientation of the mobile beacon for the purpose of studying the RSS-distance relationship in the current configuration of the BLE device.


## 5.2.2. Study of the Distance-RSS Relation over All Random Orientations

For this study, experimental configuration 2 from Table2 was implemented with each dataset containing a large sample size. On examining this dataset, the relationship between RSS-distance can be expressed as a path loss-log distance relationship by combining and reconfiguring Equations (4) and (5) as demonstrated in Section 5.1.Figure7 shows the distribution of RSS values at each distance using Tx power as 2 dBm. RSS values are expressed as path loss values under a given Tx power while taking logarithm base 10 of distances. Figure 7(a) shows the probability density (PD) over 1 dBm of path loss value and 1 log (m) of log distance. In that figure, higher probabilities of path loss (yellow values) appear to go linearly in log distance. At each log distance, the PD of path loss values appears to follow Gaussian distribution [28] as shown in Figure 7(b).Figure 7
Path loss-log distance relationship from its corresponding RSS-distance relationship. (a) 3D-normalized histogram over 1 dB and 1 log distance m. Lighter yellow colors show higher probabilities. (b) Curve of probability density (PD) over 3D histogram whend=1m and d=2.07m. (c) Curves of probability density (PD) over distance from 0.6 to 2.07 m. The path loss PD curves tend to shift toward more power loss as the distance between beacon and scanner increases. (d) Path loss-log distance log-loss scale graph. From this graph, a linear regression for Equation (5) is fitted and parameters for η and are derived as 1.9 and 65.10 dB.
(a)
(b)
(c)
(d)Figure7(c) demonstrates the shifts of fitted normal curves along the log distance. As the distance increases, the normal curve shifts towards larger path loss values. The peaks of the varying PD curves are represented by the mean of the distributions at varying distances. From the relationship between the peak of PD curves and log distances, the parameters for the RSS-distance model such as η and PL1 can be derived by fitting the peaks with a polynomial of 1 degree as shown in Figure 7(d). ηis found to be 1.9≈2 for a nonreflective ideal environment (anechoic chamber).These derived parameters are then plugged into Equation (5) to obtain and estimate the RSS-distance model as shown in Figure 8(a). Figures 8(b) and 8(c) present the evaluations of the estimated model. In both figures, the error of the model is below 0.6 m for smaller distances. In Figure 8(c), the estimation error is below 0.7 m at nearly 90% probability for lower distances. On the other hand, the estimation error for an actual distance of 2.07 m is below 1.5 m at 80% probability. Hence, it can be concluded that distance estimation error-based RSS values increase with increase in distance. This error can be used to compensate the estimated distances during localization in the real environment.Figure 8
(a) RSS-distance estimation model, (b) RMSE of the RSS-distance model with an overall error 0.876 m, and (c) error estimation probability for each distance based on the RSS-distance estimation model.
(a)
(b)
(c)


## 5.2.3. Study of the Distance-RSS Relation over Varying Transmission Powers

The battery consumption of the BLE beacon is highly proportional to theTx power. The higher the Tx power, the higher the battery energy the BLE beacon will consume. Hence, it is important to find the trade-off between distance estimation accuracy and transmission power. In the current BLE hardware, the maximum and minimum Tx power is 8 dBM and −18 dBm, respectively. 2 and −8 dBm are also chosen to represent higher and lower Tx powers.Here, experimental configuration 3 from Table2 was performed to generate 16 different datasets for this study. In Figure 9, the RSS-distance relationships are compared with respect to increasing Tx powers. RSS-distance curves tend to shift towards lower RSS values as Tx power decreases.Figure 9
Distance-RSS-estimated curves over varyingTx power 8, 2, −8, and −18 dBm.From those curves, the distances are estimated and its RMSE errors are compared in Figure10. As concluded in Section 5.2.2, RMSE increases with increase in distance regardless of Tx power. In both Figures 10 and 11, the RSS-distance model w.r.t higher transmission power 8 dBm performs better. However, the power consumption of the BLE beacon will be very high at that Tx power level and the battery would last just a few hours. In order to reduce the cost of replacing/recharging batteries and maintain continuous tracking of BLE beacons, it is best to choose a lower Tx power level in such a way that the RSS-distance model still gives low overall RMS distance error estimation. Hence, −8 dBm Tx level is chosen for localization as its overall RSME error is 0.56 m.Figure 10
RMSE of distance estimation by all RSS-distance models based onTx powers.Figure 11
Overall RMSE distance estimation over varyingTx powers. A trade-off between Tx power and RSS-based distance estimation is required to ensure lower estimation error over low-power consumption.In summary, it is important to maintain random orientations of the BLE beacon while estimating the RSS-distance model during initial scene profiling for the localization system. At lower distances below 2 m from the fixed scanner, the estimation error of the mobile beacon’s distance is quite low. Hence, for rooms larger than 2 m in size, more than one fixed scanner is required to estimate the mobile beacon. Also, theTx power level is to be fixed in such a way to maintain the trade-off between lower-energy consumption and higher-distance estimation accuracy.


## 6. Proposed Localization Algorithm

Here, we propose a localization algorithm which consists of two phases: (a) initial scene analysis and (b) online localization. The algorithm incorporates the desirable elements from both geometric and fingerprinting techniques. The RSS-distance model is estimated calculated w.r.t the given environment. The first phase of the algorithm is similar to the initial phase of the fingerprinting technique giving a better initial estimate during the online phase. Those specific grid locations in the room are clustered together w.r.t a single FS for the next phase.During the online phase, the algorithm collects RSS measurements from available FS devices till a maximum number of BLE packet threshold has been reached. After collection, the beacon’s location is estimated by grid locations associated with the highest average RSS measured by the corresponding FS device. This estimate will then be fed to a least square (LS) optimizer with weights depending on the accuracy of the estimated distances from FS devices. LS optimization from geometric techniques refines the initial estimate of the beacon’s position.


### 6.1. Experimental Setup

As part of development, implementation, and evaluation of the localization system, a testing room of size 6.87 m × 7.60 m was chosen for conducting experiments as shown in Figure12. Here, the BLE signals are affected by signal reflections and additional noises caused by objects cluttered in the testing room. Four fixed scanners were placed on sides of the testing room at a height of 1 m from the ground. All 30 reference grid points are placed 1 m apart to ensure the exact position of the beacon while conducting the analysis. The distances of all reference points to four FS were measured precisely for comparison ranging from 0.2 to 6.8 m.Figure 12
(a) Top view of the testing room with 30 reference beacon positions placed 1 m apart and four fixed scanners. (b) One of FS devices fixed on one of the walls.
(a)
(b)For the initial phase of the proposed localization, the beacon is placed on a cylindrical stand of height 1 m thereby maintaining the same elevation as fixed scanners. Another reason for measurements being collected at the height of 1 m is that it seems to be a natural position for wearables and walkers while being used by humans. At each reference grid position where the beacon is placed, four scanners measure the RSS values from the beacon in different random orientations for two minutes in order to ensure statistical repeatability. The transmission powerTx of the beacon was set to be −8 dBm to maintain the trade-off between accuracy and energy consumption as summarized in Section 5. The dataset collection for the initial scene analysis of the proposed algorithm can be summarized in Table 3.Table 3
Dataset collection summary for initial scene analysis of the proposed localization process.
No. of FS devices
No. of BLE beacons
No. of reference grid points
Distance range between each FS device and all reference grid points (m)
Tx power of beacon
Sampling time for each dataset at each reference grid point
4
1
30
0.4–7.0
−8 dB
2 minDuring the online phase, a subject holding the BLE beacon is made to stand at each specified grid while conducting performance evaluation which is detailed in Section7. While standing at those positions, the subject is asked to continuously flip or swing the beacon to ensure random orientations for statistical repeatability.


### 6.2. Initial Scene Analysis

After data collection at all 30 reference grid points, the RSS measurements collected from each reference point were sorted into four sets w.r.t fixed scanners and the RSS data was extracted for each setRSSFSi,Refj=RSSFSi,Refj,n.RSSFSi,Refj: the set of RSS readings from FS FSi at point RefjRSSFSi,Refj,n: nth RSS reading from FS FSi at point RefjAn average of RSS readings was computed and mapped for each setRSSFSi,Refj at each reference point in Figure 13. In Figure 13, RSS mean values of beacon (Tx=−8dBm) were mapped w.r.t the known reference grid location. On observation of this figure, the RSS mean values w.r.t each FSi are higher and hotter when the reference grid points are closer to that FSiFigure 13
Radio map of RSS values for fixed scanners (a)FS1, (b) FS2, (c) FS3, and (d) FS4 in clockwise direction. The higher RSS values show a red color whereas the lower values show a lighter color.
(a)
(b)
(c)
(d)Based on the radio map, the reference points, which show higher RSS values and are closer to fixed scanner, can be clustered and associated with the fixed scanner, respectively, as shown in Table4. Hence, in the given room map, we can cluster the reference points into four regions. This section is quite useful for the initial stage of online localization when the beacon can be classified based on the set of RSS values.Table 4
All 30 reference points in the room clustered into four sets w.r.t FS.
FSi,i=
Cluster 1
Cluster 2
Cluster 3
Cluster 4
Refj
1-6
7-11
12, 13, 15-17
18-30In order to further pinpoint the position of the beacon within the cluster, it is important to model the distance estimation model based on RSS values. Since the devices involved in the RSS-distance model are the same, the mean of RSS data at each reference w.r.t each FS is plotted and fitted in a power-log distance graph as shown in Figure14. In Figure 14, the parameters for Equation (5) were extracted from the graph and found to be =1.26 PL1=66.54.Figure 14
Path loss power-distance log-log scale graph. From this graph, a linear regression is fitted and parameters forη and PL1 are derived for Figure 15 (RSS-distance graph).These parameters are then plugged into Equation (5) as shown in Figure 15.Figure 15
RSS-based distance estimation model obtained from the dataset.Based on the estimated RSS-distance model, the distance error estimation was calculated w.r.t each fixed scanner as shown in Figure16. In future, the parameters of the RSS-distance model can be updated continuously by measuring RSS values from known FS devices by the GW device and comparing those values against known distances between GW devices and FS devices.Figure 16
Radio map of estimated distance errors w.r.t each fixed scanner: (a)FS1, (b) FS2, (c) FS3, (d) FS4 in a clockwise direction. The larger errors display darker red colors whereas lower errors display light-colored values.
(a)
(b)
(c)
(d)The overall error w.r.t fixed scanners areFS1=1.5133m, FS2=1.1498m, FS3=1.1390m, and FS4=1.3546m. From Figure 16, the distance estimation accuracy appears to decrease as the distance from the respective fixed scanner increases. These perturbations in distance values are caused by slow fading as shown in Equation (2). Based on Equation (2), the distance is modelled as log-normal random variable d~.
(7)d~~d⋅10N0,σ=eNlnd,σ/10η.The parameters of log-normal random variabled~ are μd=lnd and σd=σ/10η. The kth moment of a lognormal random variable is given by Ed~k=expk⋅μd+k2σ2/2 [16]. Therefore, the variance of d~ is expressed as
(8)Vard~=Ed~2−Ed~2=exp2μd⋅exp2σd2−expσd2.From Equation (8), the confidence of estimating the distance can be calculated and applied in the localization. Since distance estimation does not vary with σd2, i.e., σd2is constant, the factor exp2σd2−expσd2 can be taken out and Equation (8) can be modified as
(9)Vard~=exp2μd=exp2lnd=d2.To further illustrate this point, Figure17 shows how the estimated distances by four FS devices can be fitted with a curve from Equation (9). This variance graph can be used to calculate the weight for adjusting the accuracy of distance estimation while improving localization accuracy. By giving more weight to those measurements which have a greater accuracy, i.e., the measurements corresponding to short distances, a greater accuracy in localization result is expected.Figure 17
The variance-distance graph illustrating the relation between variance of distance estimations values from four FS devices at all reference points and Equation (9).


### 6.3. Online Localization

In most of techniques in the literature, events for localization are usually time-driven. However, there are chances that relevant information recorded by fixed scanners FS may not reach gateway GW within a specified window frame. Lack of such information may affect localization of the beacon at a critical time. Hence, the proposed online localization is data-driven based on the number of RSS values recorded and sent by any of the FS devices to the GW device. Once the number of packets sent by any FS devices reaches the set threshold MAX_NUM, the algorithm will then estimate the position of the beacon depending on the number of FS devices recorded during that event.The initial estimate of the position of the beacon can be obtained from the previously estimated position of the beacon within a specified time period Thres_Time (usually set as 1-3 s). If the time difference between the latest packet received and the latest position of the beacon exceeds Thres_Time, the initial position of the beacon can be estimated by the position of the closest point from the cluster region corresponding to the nearest FS. The FS device with the highest measured mean RSS power is chosen as the scanner to which the beacon is closest. The corresponding cluster region can be chosen as the most likely location area of the beacon.Next, within the cluster region, the distance of the beacon from the chosen FS device is estimated from the fitted model Equation (6). The estimated distance is then compared to the distances between the reference points of the region and the corresponding FS which are stored in the database. The position of a reference point from the cluster whose distance is closest to the estimated distance is chosen as the closest location estimate of the beacon within the selected cluster.If the number of FS devices recorded is two or less, this estimate will be considered as the final position of the beacon. Else, this estimate can act as initial estimation to the following optimization problem.The objective of the algorithm is to find positionx,y of the beacon which minimizes the sum of weighted squared errors in the set of distance estimations d~ifrom the position (xi,yi) of the fixed scanner FSii=1,2…N. That is, error Equation (10) is to be minimized.
(10)ε=∑i=1Nwi∗xi−x2+yi−y22−d~i,wherewi=1VARdi=1d~i2,where d~i is the estimated distance from the average RSS values measured by fixed scanner FSi. More weight wi is given the smaller estimated distance since the accuracy of estimating distance depends on the distance itself. From the previous study, the variance of estimating distance increases as the distance increases.The positionx,y of the beacon can then be calculated iteratively using any optimization algorithm. The algorithm uses limited-memory Broyden–Fletcher–Goldfarb–Shanno (L-BFGS) which is popular for parameter estimation in machine learning.The final estimated position of the beacon is then compared to previous estimated positions of the beacon. If the distance between the current estimate and the previous estimate is greater than Thres_distance (usually 3 m) within Thres_Time, the current estimate is most likely to be in error and it is best to consider the previous beacon position estimate as the current estimate. The proposed localization algorithm is summarized in Algorithm1.Algorithm 1: Proposed Localization Technique.
Input: RSSIj,FSi corresponding to FSi (j corresponds to number of RSS values recorded by FSi)
Output: x,yk position of beacon at event k
(1) The RSSI value of beacon packet is sorted into setRSSIj,FSi
(2) Ifj of sets corresponding to any nFS devices reach MAX_NUM, Go to step 8 for next Eventk=k+1.
Else, go to step 1
(3)Diff_Time=timek−timek−1
(4)AVGRSSIFSi=meanRSSIFSi
(5)dFSi=10PTxdBm−AVGRSSIFSi−PL1/10η
(6) If Diff_Time<Thresh_Time, thenx,y0k=x,yk−1
Else,x,y0k = position of closest point of cluster of the FS with mindFSii=1,2,…n
(7) Ifn>2, then continue to step 13. Else, x,yk=x,y0k and go to step 14
(8) Pass initial position estimatex,y0k, estimated distances dFSi and known positions of the corresponding FS
to L-BFGS optimizer the position of beaconx,ykfinal is calculated
(9) Ifx,yk−x,yk−1>Thresh_distanceandDiff_Time<Thresh_Time, then
x,yk=x,yk−1.
(10)x,yk of beacon is localized on the map.


## 6.1. Experimental Setup

As part of development, implementation, and evaluation of the localization system, a testing room of size 6.87 m × 7.60 m was chosen for conducting experiments as shown in Figure12. Here, the BLE signals are affected by signal reflections and additional noises caused by objects cluttered in the testing room. Four fixed scanners were placed on sides of the testing room at a height of 1 m from the ground. All 30 reference grid points are placed 1 m apart to ensure the exact position of the beacon while conducting the analysis. The distances of all reference points to four FS were measured precisely for comparison ranging from 0.2 to 6.8 m.Figure 12
(a) Top view of the testing room with 30 reference beacon positions placed 1 m apart and four fixed scanners. (b) One of FS devices fixed on one of the walls.
(a)
(b)For the initial phase of the proposed localization, the beacon is placed on a cylindrical stand of height 1 m thereby maintaining the same elevation as fixed scanners. Another reason for measurements being collected at the height of 1 m is that it seems to be a natural position for wearables and walkers while being used by humans. At each reference grid position where the beacon is placed, four scanners measure the RSS values from the beacon in different random orientations for two minutes in order to ensure statistical repeatability. The transmission powerTx of the beacon was set to be −8 dBm to maintain the trade-off between accuracy and energy consumption as summarized in Section 5. The dataset collection for the initial scene analysis of the proposed algorithm can be summarized in Table 3.Table 3
Dataset collection summary for initial scene analysis of the proposed localization process.
No. of FS devices
No. of BLE beacons
No. of reference grid points
Distance range between each FS device and all reference grid points (m)
Tx power of beacon
Sampling time for each dataset at each reference grid point
4
1
30
0.4–7.0
−8 dB
2 minDuring the online phase, a subject holding the BLE beacon is made to stand at each specified grid while conducting performance evaluation which is detailed in Section7. While standing at those positions, the subject is asked to continuously flip or swing the beacon to ensure random orientations for statistical repeatability.


## 6.2. Initial Scene Analysis

After data collection at all 30 reference grid points, the RSS measurements collected from each reference point were sorted into four sets w.r.t fixed scanners and the RSS data was extracted for each setRSSFSi,Refj=RSSFSi,Refj,n.RSSFSi,Refj: the set of RSS readings from FS FSi at point RefjRSSFSi,Refj,n: nth RSS reading from FS FSi at point RefjAn average of RSS readings was computed and mapped for each setRSSFSi,Refj at each reference point in Figure 13. In Figure 13, RSS mean values of beacon (Tx=−8dBm) were mapped w.r.t the known reference grid location. On observation of this figure, the RSS mean values w.r.t each FSi are higher and hotter when the reference grid points are closer to that FSiFigure 13
Radio map of RSS values for fixed scanners (a)FS1, (b) FS2, (c) FS3, and (d) FS4 in clockwise direction. The higher RSS values show a red color whereas the lower values show a lighter color.
(a)
(b)
(c)
(d)Based on the radio map, the reference points, which show higher RSS values and are closer to fixed scanner, can be clustered and associated with the fixed scanner, respectively, as shown in Table4. Hence, in the given room map, we can cluster the reference points into four regions. This section is quite useful for the initial stage of online localization when the beacon can be classified based on the set of RSS values.Table 4
All 30 reference points in the room clustered into four sets w.r.t FS.
FSi,i=
Cluster 1
Cluster 2
Cluster 3
Cluster 4
Refj
1-6
7-11
12, 13, 15-17
18-30In order to further pinpoint the position of the beacon within the cluster, it is important to model the distance estimation model based on RSS values. Since the devices involved in the RSS-distance model are the same, the mean of RSS data at each reference w.r.t each FS is plotted and fitted in a power-log distance graph as shown in Figure14. In Figure 14, the parameters for Equation (5) were extracted from the graph and found to be =1.26 PL1=66.54.Figure 14
Path loss power-distance log-log scale graph. From this graph, a linear regression is fitted and parameters forη and PL1 are derived for Figure 15 (RSS-distance graph).These parameters are then plugged into Equation (5) as shown in Figure 15.Figure 15
RSS-based distance estimation model obtained from the dataset.Based on the estimated RSS-distance model, the distance error estimation was calculated w.r.t each fixed scanner as shown in Figure16. In future, the parameters of the RSS-distance model can be updated continuously by measuring RSS values from known FS devices by the GW device and comparing those values against known distances between GW devices and FS devices.Figure 16
Radio map of estimated distance errors w.r.t each fixed scanner: (a)FS1, (b) FS2, (c) FS3, (d) FS4 in a clockwise direction. The larger errors display darker red colors whereas lower errors display light-colored values.
(a)
(b)
(c)
(d)The overall error w.r.t fixed scanners areFS1=1.5133m, FS2=1.1498m, FS3=1.1390m, and FS4=1.3546m. From Figure 16, the distance estimation accuracy appears to decrease as the distance from the respective fixed scanner increases. These perturbations in distance values are caused by slow fading as shown in Equation (2). Based on Equation (2), the distance is modelled as log-normal random variable d~.
(7)d~~d⋅10N0,σ=eNlnd,σ/10η.The parameters of log-normal random variabled~ are μd=lnd and σd=σ/10η. The kth moment of a lognormal random variable is given by Ed~k=expk⋅μd+k2σ2/2 [16]. Therefore, the variance of d~ is expressed as
(8)Vard~=Ed~2−Ed~2=exp2μd⋅exp2σd2−expσd2.From Equation (8), the confidence of estimating the distance can be calculated and applied in the localization. Since distance estimation does not vary with σd2, i.e., σd2is constant, the factor exp2σd2−expσd2 can be taken out and Equation (8) can be modified as
(9)Vard~=exp2μd=exp2lnd=d2.To further illustrate this point, Figure17 shows how the estimated distances by four FS devices can be fitted with a curve from Equation (9). This variance graph can be used to calculate the weight for adjusting the accuracy of distance estimation while improving localization accuracy. By giving more weight to those measurements which have a greater accuracy, i.e., the measurements corresponding to short distances, a greater accuracy in localization result is expected.Figure 17
The variance-distance graph illustrating the relation between variance of distance estimations values from four FS devices at all reference points and Equation (9).


## 6.3. Online Localization

In most of techniques in the literature, events for localization are usually time-driven. However, there are chances that relevant information recorded by fixed scanners FS may not reach gateway GW within a specified window frame. Lack of such information may affect localization of the beacon at a critical time. Hence, the proposed online localization is data-driven based on the number of RSS values recorded and sent by any of the FS devices to the GW device. Once the number of packets sent by any FS devices reaches the set threshold MAX_NUM, the algorithm will then estimate the position of the beacon depending on the number of FS devices recorded during that event.The initial estimate of the position of the beacon can be obtained from the previously estimated position of the beacon within a specified time period Thres_Time (usually set as 1-3 s). If the time difference between the latest packet received and the latest position of the beacon exceeds Thres_Time, the initial position of the beacon can be estimated by the position of the closest point from the cluster region corresponding to the nearest FS. The FS device with the highest measured mean RSS power is chosen as the scanner to which the beacon is closest. The corresponding cluster region can be chosen as the most likely location area of the beacon.Next, within the cluster region, the distance of the beacon from the chosen FS device is estimated from the fitted model Equation (6). The estimated distance is then compared to the distances between the reference points of the region and the corresponding FS which are stored in the database. The position of a reference point from the cluster whose distance is closest to the estimated distance is chosen as the closest location estimate of the beacon within the selected cluster.If the number of FS devices recorded is two or less, this estimate will be considered as the final position of the beacon. Else, this estimate can act as initial estimation to the following optimization problem.The objective of the algorithm is to find positionx,y of the beacon which minimizes the sum of weighted squared errors in the set of distance estimations d~ifrom the position (xi,yi) of the fixed scanner FSii=1,2…N. That is, error Equation (10) is to be minimized.
(10)ε=∑i=1Nwi∗xi−x2+yi−y22−d~i,wherewi=1VARdi=1d~i2,where d~i is the estimated distance from the average RSS values measured by fixed scanner FSi. More weight wi is given the smaller estimated distance since the accuracy of estimating distance depends on the distance itself. From the previous study, the variance of estimating distance increases as the distance increases.The positionx,y of the beacon can then be calculated iteratively using any optimization algorithm. The algorithm uses limited-memory Broyden–Fletcher–Goldfarb–Shanno (L-BFGS) which is popular for parameter estimation in machine learning.The final estimated position of the beacon is then compared to previous estimated positions of the beacon. If the distance between the current estimate and the previous estimate is greater than Thres_distance (usually 3 m) within Thres_Time, the current estimate is most likely to be in error and it is best to consider the previous beacon position estimate as the current estimate. The proposed localization algorithm is summarized in Algorithm1.Algorithm 1: Proposed Localization Technique.
Input: RSSIj,FSi corresponding to FSi (j corresponds to number of RSS values recorded by FSi)
Output: x,yk position of beacon at event k
(1) The RSSI value of beacon packet is sorted into setRSSIj,FSi
(2) Ifj of sets corresponding to any nFS devices reach MAX_NUM, Go to step 8 for next Eventk=k+1.
Else, go to step 1
(3)Diff_Time=timek−timek−1
(4)AVGRSSIFSi=meanRSSIFSi
(5)dFSi=10PTxdBm−AVGRSSIFSi−PL1/10η
(6) If Diff_Time<Thresh_Time, thenx,y0k=x,yk−1
Else,x,y0k = position of closest point of cluster of the FS with mindFSii=1,2,…n
(7) Ifn>2, then continue to step 13. Else, x,yk=x,y0k and go to step 14
(8) Pass initial position estimatex,y0k, estimated distances dFSi and known positions of the corresponding FS
to L-BFGS optimizer the position of beaconx,ykfinal is calculated
(9) Ifx,yk−x,yk−1>Thresh_distanceandDiff_Time<Thresh_Time, then
x,yk=x,yk−1.
(10)x,yk of beacon is localized on the map.


## 7. Experimental Analysis of Proposed Localization

To analyze the localization system, it is important to first acquire RSS measurements at known true positions. Generally, a good localization system should allocate high probabilities of estimates to areas surrounding the true location and as low as possible to farther locations given the sensor information. In this analysis section, the accuracy of the proposed localization algorithm is examined against the effects of number of sensors and the MAX_NUM threshold for the number of BLE packets captured by any FS device. The total number of packets recorded in each event is highly proportional to MAX_NUM.During data collection for evaluation (summarized in Table5), the subject carrying the BLE beacon is made to stand at six selected locations in the testing room as highlighted in Figure 18. Only one subject was used; this section only evaluates the performance of the localization algorithm. The testing of the communication system is out of scope of this paper. These six locations represent the pathways through which the subject would walk. At each specified location, 8 minutes of the beacon’s RSS data were recorded by all four FS devices while the subject randomly orients the beacon on the same spot to ensure more diversity in the dataset. This length dataset would be quite sufficient in evaluating the performance of the proposed localization algorithm.Table 5
Test summary for evaluating the performance of the proposed localization algorithm.
Test scenario
Test
No. of selected test positions
No. of FS devices for each experiment
MAX_NUM threshold values for each FS device
Window time size set for other state-of art techniques (s)
Total no. of datasets used in this test scenario
Sampling time for each dataset at each reference grid position
1
Effects of number of FS devices
6
1, 2, 3, 4
5
—
24
8 min
2
Effect of BLE packet threshold
6
4
1, 3, 5, 7, 9, 11
—
36
8 min
3
Comparison of state-of-art localization techniques
6
4
7
9
30
8 minFigure 18
Experimental room with selected locations. The subject carrying the BLE beacon was made to stand at these selected locations.Each RSS measurement from the beacon is also timestamped by measuring the FS device as mentioned in Section4.2. These timestamps would be quite useful in enabling the same datasets for state-of-art comparisons.


### 7.1. Effects of the Number of FS Devices

During the localization experiments for test scenario 1 (from Table5) at those six selected locations, FS devices are added in the experimental room to examine its effects on the accuracy of the proposed algorithm as shown in Figure 19. For each experimental configuration in Figure 20, the proposed localization algorithm processes the same datasets collected at each selected location. The threshold MAX_NUM was set at 5.Figure 19
Experimental configurations for performance evaluation of proposed localization against the effects of number of FS devices (blue triangle): (a) one scanner, (b) two scanners, (c) three scanners, and (d) four scanners.
(a)
(b)
(c)
(d)Figure 20
Accuracy error probability analysis of the proposed algorithm with varying numbers of FS devices atMAX_NUM=5.Figure20 presents the performance evaluation of the proposed algorithm for each experimental configuration with results tabulated in Table 6. The proposed localization algorithm processing data from more than three FS devices shows higher probability in estimating the location of the beacon with error less than 2.8 m.Table 6
Localization accuracy error analysis for four experimental configurations.
Number of FS devices for each experimental configuration
At 90% probability, accuracy error is below (m)
1
4.05
2
4.20
3
2.80
4
2.80The performance of the algorithm processing two FS devices appears to be low due to placement of FS in the room with respect to the selected locations. Hence, for this large experimental room (7.6 × 6.87 m), it is important to have 3 or more FS devices for beacon positioning.


### 7.2. Effect of the BLE Packet Threshold

In order to study the effect of the total number of BLE packets used for localization, the MAX_NUM threshold in the proposed algorithm is varied during the experimental analysis described in test scenario 2 at Table5. The MAX_NUM threshold is highly proportional to the total number of packets used in BLE beacon positioning. During the localization experiments at selected locations, the MAX_NUM threshold is increased to examine its effects on the accuracy of the proposed algorithm as shown in Figure 21 and Table 7. The number of FS devices used for this test scenario is four.Figure 21
Accuracy analysis of the proposed algorithm w.r.t varying MAX_NUM packet threshold scanned by four scanners.Table 7
Performance evaluation of the proposed algorithm against number of BLE packets processed by the algorithm.
MAX_NUM threshold number of packets set for localization algorithm
At 90% probability, accuracy error is below (m)
1
4.20
3
3.10
5
3.00
7
1.80
9
2.00
11
1.80When the MAX_NUM threshold is set to 1, it means that the number of BLE packets (coming from any FS devices) processed by the algorithm during position estimation is 1. With this configuration, the accuracy error would be very high which is 4.2 m.As the MAX_NUM threshold is increased to 3 and 5, there is a slight decrease in localization accuracy error. On the other hand, when the MAX_NUM threshold is set at 7, there is huge improvement in localization performance. It is observed that the localization error is less than 1.80 m in 90% of cases. Furthermore, when the MAX_NUM threshold is set above 7, there is not much further improvement in localization performance.


### 7.3. Comparison of State-of-Art Localization Techniques

In this section, the accuracy of our proposed algorithm is compared against four classic techniques used in indoor localization. The first technique estimates the position of the beacon based on the nearest FS device which is a proximity technique [29]. The second technique is based on hyperbolic technique described in [16]. The hyperbolic technique converts nonlinear error distance functions to linear form. It requires more than 3 sensors for beacon positioning. This technique is further improved in [18] with weights and then employed as a third technique for this paper.The fourth technique is based on circular technique with no weights. The circular technique optimizes the multilateration problem through gradient decent. It performs better than the hyperbolic method as it minimizes directly the distance errors [16]. It requires more than 2 scanners for beacon positioning. Our proposed technique can work with 1 or more scanners depending on the size of the room.For comparison evaluation, the dataset was collected according to test scenario 3 from Table5. At each reference grid point, each dataset of BLE packets is scanned by four FS devices. All four FS devices were used in this testing room as most of state-of-art techniques require more than 3 scanners. These datasets can be processed for beacon positioning by all four state-of-art techniques including our proposed algorithm. Such steps would ensure fair evaluation of location performance for the comparison.Figure22 shows an example of the estimation probability map generated by each approach at one of the testing points of position 4 where the estimation probability of the proposed approach is evidently much better. Usually, darker shades (higher probabilities) are near the true spot (marked in green spot) and light shades (lower probabilities) are the locations farther away from the true spot. In all four classical approaches, probabilities are found to spread over larger areas thereby making the beacon positioning less accurate with high uncertainty. On the other hand, the proposed approach generates higher probability over a very small area around the true position indicating higher accuracy with less uncertainty. In order to verify that the same likelihood occurred for the rest of the other five test positions, the same test was performed for all data points in all datasets available. The results of the evaluations for 90% of beacon position estimates for all 6 test locations are summarized in Table 8.Figure 22
Probability map over 1 m2 area of beacon positioning w.r.t true position 4 with estimation approaches: (a) nearest scanning device, (b) hyperbolic, (c) weighted hyperbolic, (d) circular, and (e) proposed algorithm. Darker red indicates higher probability whereas lighter color indicates lower probability. True locations of the test point are marked by a green dot.
(a)
(b)
(c)
(d)
(e)Table 8
Cumulative probability of beacon position estimates with respect to true locations obtained from all five localization techniques for all datasets.
Test positions in the testing room
At 90% of position estimates, cumulative accuracy error is below (m)
Nearest scanning device
Hyperbolic
Weighted hyperbolic
Circular
Proposed
4
2.40
3.20
2.40
3.90
0.50
8
2.90
2.90
2.90
2.40
1.50
15
4.20
4.50
4.20
3.2
4.50
16
3.90
3.90
3.90
3.80
1.00
24
4.50
4.50
4.60
3.40
0.40
25
4.40
4.40
4.40
4.20
1.60
Overall
3.90
3.90
3.80
3.20
1.80Figure23 displays the overall performance of the techniques for all test locations. With exception of test location 15, the performance of the proposed localization has consistently maintained the lowest cumulative error at all test locations. To our knowledge, the performance of the proposed algorithm at test location 15 may have gone down due to environmental factors such as user’s body/object attenuation of signals.Figure 23
Overall localization performance analysis of all five localization techniques.


## 7.1. Effects of the Number of FS Devices

During the localization experiments for test scenario 1 (from Table5) at those six selected locations, FS devices are added in the experimental room to examine its effects on the accuracy of the proposed algorithm as shown in Figure 19. For each experimental configuration in Figure 20, the proposed localization algorithm processes the same datasets collected at each selected location. The threshold MAX_NUM was set at 5.Figure 19
Experimental configurations for performance evaluation of proposed localization against the effects of number of FS devices (blue triangle): (a) one scanner, (b) two scanners, (c) three scanners, and (d) four scanners.
(a)
(b)
(c)
(d)Figure 20
Accuracy error probability analysis of the proposed algorithm with varying numbers of FS devices atMAX_NUM=5.Figure20 presents the performance evaluation of the proposed algorithm for each experimental configuration with results tabulated in Table 6. The proposed localization algorithm processing data from more than three FS devices shows higher probability in estimating the location of the beacon with error less than 2.8 m.Table 6
Localization accuracy error analysis for four experimental configurations.
Number of FS devices for each experimental configuration
At 90% probability, accuracy error is below (m)
1
4.05
2
4.20
3
2.80
4
2.80The performance of the algorithm processing two FS devices appears to be low due to placement of FS in the room with respect to the selected locations. Hence, for this large experimental room (7.6 × 6.87 m), it is important to have 3 or more FS devices for beacon positioning.


## 7.2. Effect of the BLE Packet Threshold

In order to study the effect of the total number of BLE packets used for localization, the MAX_NUM threshold in the proposed algorithm is varied during the experimental analysis described in test scenario 2 at Table5. The MAX_NUM threshold is highly proportional to the total number of packets used in BLE beacon positioning. During the localization experiments at selected locations, the MAX_NUM threshold is increased to examine its effects on the accuracy of the proposed algorithm as shown in Figure 21 and Table 7. The number of FS devices used for this test scenario is four.Figure 21
Accuracy analysis of the proposed algorithm w.r.t varying MAX_NUM packet threshold scanned by four scanners.Table 7
Performance evaluation of the proposed algorithm against number of BLE packets processed by the algorithm.
MAX_NUM threshold number of packets set for localization algorithm
At 90% probability, accuracy error is below (m)
1
4.20
3
3.10
5
3.00
7
1.80
9
2.00
11
1.80When the MAX_NUM threshold is set to 1, it means that the number of BLE packets (coming from any FS devices) processed by the algorithm during position estimation is 1. With this configuration, the accuracy error would be very high which is 4.2 m.As the MAX_NUM threshold is increased to 3 and 5, there is a slight decrease in localization accuracy error. On the other hand, when the MAX_NUM threshold is set at 7, there is huge improvement in localization performance. It is observed that the localization error is less than 1.80 m in 90% of cases. Furthermore, when the MAX_NUM threshold is set above 7, there is not much further improvement in localization performance.


## 7.3. Comparison of State-of-Art Localization Techniques

In this section, the accuracy of our proposed algorithm is compared against four classic techniques used in indoor localization. The first technique estimates the position of the beacon based on the nearest FS device which is a proximity technique [29]. The second technique is based on hyperbolic technique described in [16]. The hyperbolic technique converts nonlinear error distance functions to linear form. It requires more than 3 sensors for beacon positioning. This technique is further improved in [18] with weights and then employed as a third technique for this paper.The fourth technique is based on circular technique with no weights. The circular technique optimizes the multilateration problem through gradient decent. It performs better than the hyperbolic method as it minimizes directly the distance errors [16]. It requires more than 2 scanners for beacon positioning. Our proposed technique can work with 1 or more scanners depending on the size of the room.For comparison evaluation, the dataset was collected according to test scenario 3 from Table5. At each reference grid point, each dataset of BLE packets is scanned by four FS devices. All four FS devices were used in this testing room as most of state-of-art techniques require more than 3 scanners. These datasets can be processed for beacon positioning by all four state-of-art techniques including our proposed algorithm. Such steps would ensure fair evaluation of location performance for the comparison.Figure22 shows an example of the estimation probability map generated by each approach at one of the testing points of position 4 where the estimation probability of the proposed approach is evidently much better. Usually, darker shades (higher probabilities) are near the true spot (marked in green spot) and light shades (lower probabilities) are the locations farther away from the true spot. In all four classical approaches, probabilities are found to spread over larger areas thereby making the beacon positioning less accurate with high uncertainty. On the other hand, the proposed approach generates higher probability over a very small area around the true position indicating higher accuracy with less uncertainty. In order to verify that the same likelihood occurred for the rest of the other five test positions, the same test was performed for all data points in all datasets available. The results of the evaluations for 90% of beacon position estimates for all 6 test locations are summarized in Table 8.Figure 22
Probability map over 1 m2 area of beacon positioning w.r.t true position 4 with estimation approaches: (a) nearest scanning device, (b) hyperbolic, (c) weighted hyperbolic, (d) circular, and (e) proposed algorithm. Darker red indicates higher probability whereas lighter color indicates lower probability. True locations of the test point are marked by a green dot.
(a)
(b)
(c)
(d)
(e)Table 8
Cumulative probability of beacon position estimates with respect to true locations obtained from all five localization techniques for all datasets.
Test positions in the testing room
At 90% of position estimates, cumulative accuracy error is below (m)
Nearest scanning device
Hyperbolic
Weighted hyperbolic
Circular
Proposed
4
2.40
3.20
2.40
3.90
0.50
8
2.90
2.90
2.90
2.40
1.50
15
4.20
4.50
4.20
3.2
4.50
16
3.90
3.90
3.90
3.80
1.00
24
4.50
4.50
4.60
3.40
0.40
25
4.40
4.40
4.40
4.20
1.60
Overall
3.90
3.90
3.80
3.20
1.80Figure23 displays the overall performance of the techniques for all test locations. With exception of test location 15, the performance of the proposed localization has consistently maintained the lowest cumulative error at all test locations. To our knowledge, the performance of the proposed algorithm at test location 15 may have gone down due to environmental factors such as user’s body/object attenuation of signals.Figure 23
Overall localization performance analysis of all five localization techniques.


## 8. Discussions

The tests performed in the anechoic chamber were conducted in order to study the factors affecting the baseline relationship between the strength of the BLE beacon’s transmitted signal and the distance of the beacon from the scanner without the influence of reflections or additional noises which normally occur in a real environment. In Table2, the distance of the beacon from the scanner varied up to 2.07 m due to the limited size of the available anechoic chamber. Nonetheless, the motivation of our paper is to localize the position of the subject wearing a beacon within small spaces. Also, on analyzing data from this experiment, three inferences were made which could be applied in a real environment.First, the orientation of the beacon does have significant influence on the RSS-distance relationship due to the difference in polarity between transmitter and receiver as shown in Figure6. This could be useful in incorporating the effects of the direction of the BLE beacon during formation of the RSS-distance model. However, most of BLE devices including the selected hardware for this paper do not have configuration to detect the orientation shift. Moreover, the beacon worn by subjects will be constantly varying its orientation. Hence, during the initial scene analysis of our proposed algorithm or any real environment experiments on the RSS-distance relationship, it is important that the beacon should be constantly varied to ensure statistical repeatability while developing the RSS-distance model.The second inference of this anechoic chamber experiment is that the RSS-distance model estimates the distance of the beacon with higher accuracy when the beacon is placed at distances less than 2 m from the scanner (Figure7). This would be adequate in areas of size lesser than 2 m. However, in spaces with size more than 2 m, it will be quite challenging for the RSS-distance model to reliably estimate the position of the beacon. Thus, it is important that there should be more than 1 scanner placed in such spaces.Finally, theTx power level of the beacon plays a significant role in estimating the beacon position. At higher Tx levels, the RSS-distance model provides better estimation of the beacon’s position as demonstrated in Figure 10. However, the power consumption of the BLE beacon will be very high at high Tx power level thereby incurring higher costs in the maintenance of beacons in the localization system. Therefore, there should be a trade-off between low energy consumption and high accuracy of distance estimation of the RSS-distance model.The analysis of data from experiments in an ideal environment can be applied in a real environment as shown in Section6. Along with tests conducted in an ideal environment, the paper also demonstrated the development of the RSS-distance model from the tests in a real environment as part of the initial scene analysis of the proposed algorithm. Figure 16 illustrates the distance estimation error of the extracted RSS-distance model w.r.t each scanner. As the distance of the beacon from the scanner increases (up to 7 m), the RSS-distance model estimates the position of the beacon with lesser accuracy thereby reinforcing the concluded evaluation from the ideal setup. Results in Figure 17 can be used to determine weights for adjusting the accuracy of distance estimation while improving localization accuracy in the proposed algorithm.As described in Table5, three types of test evaluations are conducted to analyze the performance of the proposed algorithm. The first two tests evaluate the performance of the proposed algorithms under the effects of number of FS devices placed in a room and number of BLE beacon packets processed by the algorithm. In Table 6, the accuracy of the proposed localization technique increases as the number of FS devices in experiment configuration increases. Similarly, as the number of BLE beacon packets, i.e., MAX_NUM threshold of the proposed algorithm increases, the performance improves greatly.However, this is possible if the subject wearing a beacon is stationary for a long time. For the ambulatory subject, MAX_NUM should not be set so high so that the position of the beacon can be updated on time. Instead, more FS devices can be added to compensate for lower MAX_NUM. Hence, a trade-off is considered while designing the system so that the accuracy of localization of the beacon is higher while correctly updating the position of the beacon. This trade-off can be referred in Figure24. For the experimental room, the localization error from the proposed algorithm is low when MAX_NUM threshold=7 and the number of FS devices anchored in a room is four.Figure 24
Accuracy error analysis w.r.t the MAX_NUM threshold and number of fixed scanners.The third type of test evaluation was conducted to compare the performances of the proposed algorithm against other state-of-art localization techniques as illustrated in Table8.The nearest scanning device approach [29] helps in identifying the position of the beacon if the beacon is closest to one of the scanners. However, this does not exactly pinpoint the exact location of the beacon, especially in small spaces. Hence, this technique performs poorly as localization error is less than 4 m in 90% of beacon position estimates.In this comparative analysis, the hyperbolic approach [16] requires more than three FS devices to position a beacon. The reason for low performance of the hyperbolic approach in Table 8 is that the process in optimizing linear equations is highly susceptible to noisy RSS measurements. To compensate for inaccuracies in distance estimation caused by inaccurate models from noisy measurements, weights were introduced in the weighted hyperbolic technique. This led to a slight improvement in the localization of the beacon at all six test positions as shown in Table 8.On the other hand, the circular technique [16] solves the beacon position problem by directly optimizing the nonlinear distance equation in the form of cost minimization. This optimization solver requires the initial estimate of the beacon which is usually estimated from the proximity approach. This greatly improves the performance as shown in Table 8 and Figure 23. The circular technique appears to perform better with localization error less than 3 m with nearly 90% probability, thereby confirming the superiority of circular technique over hyperbolic technique.However, it is important that the initial estimate of the beacon position is closer to the true estimate. If the initial estimate is far from the true value, the optimization solver may not estimate the final position correctly. Therefore, in the proposed approach, the initial estimate of the beacon position is computed from the initial scene analysis which is usually employed in fingerprinting methods. The fingerprinting technique usually demonstrates a very high performance as mentioned in Section3. Using this improved initial estimate, the proposed approach further perfects the beacon’s position estimate with the help of weighted squared error optimization.Also, most of the available state-of-art techniques are usually time-driven; i.e., they depend on the window frame. One of the main disadvantages for the time-driven system is the loss of information required for beacon positioning. To overcome this challenge, the proposed algorithm is designed to be driven by data based on the threshold set for the number of BLE packets received. Finally, on comparison to other evaluated techniques, the proposed approach has performed very well with an overall lowest error less than 1.8 m in all test locations.


## 9. Conclusion and Future Work

The analysis of signal strength w.r.t distances between beacon and scanners was studied in both ideal and real environments. In the anechoic chamber, the effects of orientation of the beacon on the distribution of RSS values were studied thereby concluding the need for statistically random orientation of the beacon for RSS-distance model estimation. The accuracy of the RSS-distance estimation model depends on the distance itself. The higher the distance, the lesser the probability in correctly estimating the distance.Also, a trade-off between battery consumption and accuracy of the RSS-distance model is required while selecting theTx power of the beacon. Based on an initial study, challenges were identified and an algorithm is proposed and evaluated in three test evaluations. The first two test evaluations were conducted to determine the number of scanners and number of packets required for positioning. The trade-offs between these two parameters is required while designing the system in order to maintain the accuracy of localization in real time.The third test evaluation was performed on all state-of-art approaches for comparative study. In this evaluation, the proposed beacon localization algorithm exceeds other state-of-art approaches with error less than 1.8 m.In future works, the parameters of the RSS-distance model can be updated continuously by measuring RSS values from the signal sent by FS devices to GW devices and comparing those values against known distances between GW devices and FS devices thereby accurately updating the model with a changing environment. Furthermore, more improvements can be added to the system as the Sensor Tile device also includes an accelerometer which tells us that if the patient is in motion. This can further stabilize the localization of the beacon. Also, the analysis of the proposed communication system will be conducted in order to further improve the localization process.In the long run, the proposed system will be used to synchronize, communicate, and fuse with other patient-worn sensor data. Low-cost wearable accelerometers and other patient-worn sensors, along with sensors attached to walking aids, and environmental sensors will be used to gain a better understanding of patient mobility, which will in turn help clinicians better tailor various therapeutic interventions, with the ultimate end goal of improving overall care and patient satisfaction.



---

*Source: 6876925-2019-02-17.xml*