A Hybrid Method to Improve the BLE-Based Indoor Positioning in a Dense Bluetooth Environment

Indoor positioning using Bluetooth Low Energy (BLE) beacons has attracted considerable attention after the release of the BLE protocol. A number of efforts have been exerted to improve the performance of BLE-based indoor positioning. However, few studies pay attention to the BLE-based indoor positioning in a dense Bluetooth environment, where the propagation of BLE signals become more complex and more fluctuant. In this paper, we draw attention to the problems resulting from the dense Bluetooth environment, and it turns out that the dense Bluetooth environment would result in a high received signal strength indication (RSSI) variation and a longtime interval collection of BLE. Hence, to mitigate the effects of the dense Bluetooth environment, we propose a hybrid method fusing sliding-window filtering, trilateration, dead reckoning and the Kalman filtering method to improve the performance of the BLE indoor positioning. The Kalman filter is exploited to merge the trilateration and dead reckoning. Extensive experiments in a real implementation are conducted to examine the performance of three approaches: trilateration, dead reckoning and the fusion method. The implementation results proved that the fusion method was the most effective method to improve the positioning accuracy and timeliness in a dense Bluetooth environment. The positioning root-mean-square error (RMSE) calculation results have showed that the hybrid method can achieve a real-time positioning and reduce error of indoor positioning.


Introduction
Until now, the GPS-based positioning system has successfully solved the outdoor localization and navigation problems. However, people spend more than 80% to 90% of their time indoors. It is estimated that the indoor positioning market will grow to $4.4 billion by 2019 with strong demand in healthcare, retail, hospitality, travel and other sectors [1]. GPS, which has revolutionized outdoors localization, has proven ineffective for indoor environments due to the lack of signal coverage. Hence, several alternative approaches for indoor positioning systems were applied: Wi-Fi based positioning systems [2], Bluetooth Low Energy (BLE) based positioning systems [3], Radio Frequency Identification (RFID)-based positioning systems [4], Ultra-Wide Band (UWB)-based positioning systems [5], Visible Light Communication (VLC)-based positioning systems [6], sensors-aided positioning systems [7,8]. These methods are based on different information sources like wireless communication technologies or sensor measurements. However, each of them has disadvantages, such as low precision, unreliability, high complexity or high hardware cost. For example, the Wi-Fi-based solutions have limitations due to the limited numbers of access points (APs) and their inflexibility in deployment, resulting in poor accuracy, from 5 to 15 m. In the case of RFID-based solutions, it has the best accuracy among all the technologies (error below 0.1 m) and needs no battery within its lifetime, but the short range It is important and urgent to develop a BLE-based indoor positioning solution suitable for dense Bluetooth environments.
In this work, a hybrid approach of BLE-based indoor positioning using a set of pre-deployed BLE beacons and smart mobile devices was proposed for achieving high accuracy in a real implementation of a dense Bluetooth environment. Numerous exiting indoor localization methods, namely trilateration and PDR, were applied. Moreover, Kalman filtering was adopted as a position fusion algorithm to improve accuracy, which integrates the advantage of trilateration and PDR and relives their weaknesses as well. Finally, the method to a real implementation of dense Bluetooth environment was applied and the practicability was verified.
The remainder of this paper is divided into six parts as follows. Section 2 defines the problem resulting from the dense Bluetooth environment and the overview of our BLE-based indoor positioning system. Section 3 elucidates the BLE propagation model and the trilateration algorithm. Section 4 investigates the PDR method, followed by the proposed hybrid approach with Kalman filtering to improve the accuracy in a dense Bluetooth environment in Section 5. Section 6 illustrates the use of the hybrid approach in a real implementation of high dense environment and verifies the practicability of the method. Finally, Section 7 draws the conclusions.

Overview
In this section, the problem arising from dense Bluetooth environments is defined and the overview of the solution to the problem is proposed.

Problem Description
Despite the fact that the Bluetooth Classic and the BLE have a different number of channels (Bluetooth Classic has 79 channels and BLE has 40 channels) [19], a smartphone will listen to all Bluetooth Classic and BLE signals during the scanning period indiscriminatingly. This fact poses a troublesome situation for BLE positioning in a dense Bluetooth environment, which needs the specific BLE signals to calculate the position of the target. Additionally, a lot of the unwanted and distracted Bluetooth signals in the environment will affect the scanning of the wanted and specific BLE signals. In order to measure the effect of the dense Bluetooth environment, the RSSI value and the scanning time interval of the BLE were measured respectively in the dense environment (with 10 Bluetooth Classic sources and three BLE sources) and sparse environment (without any other Bluetooth sources) within a 10-min continuous scanning time and a constant distance of 1.0 m from the BLE module. The RSSI value and the scanning time interval are shown in the Figure 1 and Table 1. Bluetooth environment. It is important and urgent to develop a BLE-based indoor positioning solution suitable for dense Bluetooth environments. In this work, a hybrid approach of BLE-based indoor positioning using a set of pre-deployed BLE beacons and smart mobile devices was proposed for achieving high accuracy in a real implementation of a dense Bluetooth environment. Numerous exiting indoor localization methods, namely trilateration and PDR, were applied. Moreover, Kalman filtering was adopted as a position fusion algorithm to improve accuracy, which integrates the advantage of trilateration and PDR and relives their weaknesses as well. Finally, the method to a real implementation of dense Bluetooth environment was applied and the practicability was verified.
The remainder of this paper is divided into six parts as follows. Section 2 defines the problem resulting from the dense Bluetooth environment and the overview of our BLE-based indoor positioning system. Section 3 elucidates the BLE propagation model and the trilateration algorithm. Section 4 investigates the PDR method, followed by the proposed hybrid approach with Kalman filtering to improve the accuracy in a dense Bluetooth environment in Section 5. Section 6 illustrates the use of the hybrid approach in a real implementation of high dense environment and verifies the practicability of the method. Finally, Section 7 draws the conclusions.

Overview
In this section, the problem arising from dense Bluetooth environments is defined and the overview of the solution to the problem is proposed.

Problem Description
Despite the fact that the Bluetooth Classic and the BLE have a different number of channels (Bluetooth Classic has 79 channels and BLE has 40 channels) [19], a smartphone will listen to all Bluetooth Classic and BLE signals during the scanning period indiscriminatingly. This fact poses a troublesome situation for BLE positioning in a dense Bluetooth environment, which needs the specific BLE signals to calculate the position of the target. Additionally, a lot of the unwanted and distracted Bluetooth signals in the environment will affect the scanning of the wanted and specific BLE signals. In order to measure the effect of the dense Bluetooth environment, the RSSI value and the scanning time interval of the BLE were measured respectively in the dense environment (with 10 Bluetooth Classic sources and three BLE sources) and sparse environment (without any other Bluetooth sources) within a 10-min continuous scanning time and a constant distance of 1.0 m from the BLE module. The RSSI value and the scanning time interval are shown in the Figure 1 and Table 1.   The result shows that within 10 min the smartphone received the target BLE signal 93 times in a dense environment, but 1109 times in a sparse environment. The significant difference was also reflected in the scanning time interval, with an average 6.652 s time interval in a dense environment and an average 0.542 s time interval in a sparse environment. Besides, longer scanning time interval variation was observed in a dense environment than that in a sparse environment. Although the average RSSI values of both situations showed little difference, the RSSI standard deviation and the difference between the maximum value and the minimum value in both cases are significantly different.
All of the results revealed that a high Bluetooth density of the environment would lead to a high RSSI variation and a long collection time interval of BLE. The high RSSI variation will result in an unreliable distance estimation and a low accuracy of positioning. Additionally, a long-time interval collection of BLE will lead to poor timeliness of positioning.

Overview of Solution
As mentioned above, the high RSSI variation and long scanning interval stand against obtaining an accurate indoor positioning. Therefore, a hybrid approach overcoming the problem in the dense Bluetooth environment was proposed, as shown in Figure 2. Several BLE beacons were fixed in specific positions in the ceiling with a distance of 4 to 6 m between every two beacons. Every BLE beacon was broadcasting their Mac address, RSSI, major, minor, etc. During the positioning, a mobile device was scanning the BLE advertisements to locate itself by triangulation algorithm and activating its embedded sensors to locate itself by dead reckoning. The RSSI values of BLE were collected to compute the location of the mobile device by triangulation algorithm. Due to the high RSSI variation and a long collection interval of BLE resulting from the dense Bluetooth environment, the indoor positioning system was divided into two positioning phases. During the short interval, the dead reckoning was used to determine the location of the mobile device. However, the triangulation algorithm was exploited to correct the deviation of the dead reckoning caused by accumulative sensing errors in the long interval. To achieve that, a Kalman filter was used as a fusion center to merge the two obtained positions from the two algorithms.  The result shows that within 10 min the smartphone received the target BLE signal 93 times in a dense environment, but 1109 times in a sparse environment. The significant difference was also reflected in the scanning time interval, with an average 6.652 s time interval in a dense environment and an average 0.542 s time interval in a sparse environment. Besides, longer scanning time interval variation was observed in a dense environment than that in a sparse environment. Although the average RSSI values of both situations showed little difference, the RSSI standard deviation and the difference between the maximum value and the minimum value in both cases are significantly different.
All of the results revealed that a high Bluetooth density of the environment would lead to a high RSSI variation and a long collection time interval of BLE. The high RSSI variation will result in an unreliable distance estimation and a low accuracy of positioning. Additionally, a long-time interval collection of BLE will lead to poor timeliness of positioning.

Overview of Solution
As mentioned above, the high RSSI variation and long scanning interval stand against obtaining an accurate indoor positioning. Therefore, a hybrid approach overcoming the problem in the dense Bluetooth environment was proposed, as shown in Figure 2. Several BLE beacons were fixed in specific positions in the ceiling with a distance of 4 to 6 m between every two beacons. Every BLE beacon was broadcasting their Mac address, RSSI, major, minor, etc. During the positioning, a mobile device was scanning the BLE advertisements to locate itself by triangulation algorithm and activating its embedded sensors to locate itself by dead reckoning. The RSSI values of BLE were collected to compute the location of the mobile device by triangulation algorithm. Due to the high RSSI variation and a long collection interval of BLE resulting from the dense Bluetooth environment, the indoor positioning system was divided into two positioning phases. During the short interval, the dead reckoning was used to determine the location of the mobile device. However, the triangulation algorithm was exploited to correct the deviation of the dead reckoning caused by accumulative sensing errors in the long interval. To achieve that, a Kalman filter was used as a fusion center to merge the two obtained positions from the two algorithms.

Trilateration Positioning Method
In this section, the BLE propagation model and the BLE-based triangulation method are investigated. Due to the issues of high RSSI variation in the dense Bluetooth environment, a RSSI smoothing method is described first. Then, a BLE propagation model is presented to estimate the distance from the BLE modules in the dense Bluetooth environment.

RSSI Smoothing Method
A more accurate distance estimation between mobile device and BLE beacon is the key to position calculation with triangulation algorithm, which relies on a low RSSI variation. Therefore, it is necessary to smoothen the RSSI signal before the application of triangulation algorithm. A moving average filter was used to smoothen the received RSSI signals as follows: (1) The real-time received RSSI signals and the smoothed RSSI signals are shown in Figure 3. The real-time RSSI signals varied a lot at a constant distance of 1.0 m away from the BLE beacon due to the dense Bluetooth environment. It turned out that the moving average filter reduced the RSSI fluctuation effectively. As a result, a moving average filter was applied for all following RSSI filtering in this work.

Trilateration Positioning Method
In this section, the BLE propagation model and the BLE-based triangulation method are investigated. Due to the issues of high RSSI variation in the dense Bluetooth environment, a RSSI smoothing method is described first. Then, a BLE propagation model is presented to estimate the distance from the BLE modules in the dense Bluetooth environment.

RSSI Smoothing Method
A more accurate distance estimation between mobile device and BLE beacon is the key to position calculation with triangulation algorithm, which relies on a low RSSI variation. Therefore, it is necessary to smoothen the RSSI signal before the application of triangulation algorithm. A moving average filter was used to smoothen the received RSSI signals as follows: (1) The real-time received RSSI signals and the smoothed RSSI signals are shown in Figure 3. The real-time RSSI signals varied a lot at a constant distance of 1.0 m away from the BLE beacon due to the dense Bluetooth environment. It turned out that the moving average filter reduced the RSSI fluctuation effectively. As a result, a moving average filter was applied for all following RSSI filtering in this work.

BLE Propagation Model
The RSSI value decreases with the distance increase away from the BLE beacon and the environment will affect the propagation of the BLE signal, where the RSSI is highly affected by multipath and fading phenomena. The most used model to model the relationship between measured RSSI and corresponding distances is the log-distance path loss model as follows [20]: where RSSI(d0) is the RSSI reference value measured at the distance d0. The parameter n is the path loss exponent, indicating the rate of increasing path loss related to the distance. The d represents the actual distance to the beacon, while RSSI(d) is the measured RSSI value at the distance of d. The Xσ represents a Gaussian random variable, with zero mean, caused by shadow fading [21]. In this work, d0 was set to 1 m, and the RSSI(d0) was the measured RSSI value at a distance of 1 m to the BLE beacon. Since the experiment environment had no large obstacles, shadow fading was not expected, and Xσ was set to zero. To get the BLE propagation model, the RSSI values of three BLE

BLE Propagation Model
The RSSI value decreases with the distance increase away from the BLE beacon and the environment will affect the propagation of the BLE signal, where the RSSI is highly affected by multipath and fading phenomena. The most used model to model the relationship between measured RSSI and corresponding distances is the log-distance path loss model as follows [20]: where RSSI(d 0 ) is the RSSI reference value measured at the distance d 0 . The parameter n is the path loss exponent, indicating the rate of increasing path loss related to the distance. The d represents the actual distance to the beacon, while RSSI(d) is the measured RSSI value at the distance of d. The X σ represents a Gaussian random variable, with zero mean, caused by shadow fading [21]. In this work, d 0 was set to 1 m, and the RSSI(d 0 ) was the measured RSSI value at a distance of 1 m to the BLE beacon. Since the experiment environment had no large obstacles, shadow fading was not expected, and X σ was set to zero. To get the BLE propagation model, the RSSI values of three (3) Table 2 shows the path loss exponent n of three BLE beacons in the dense Bluetooth environment and Figure 4 shows the measured RSSI values and the theoretical RSSI values from the BLE signal propagation model regarding the reference distance. The average value of n = 1.64 was used for further measurements.
(3) Table 2 shows the path loss exponent n of three BLE beacons in the dense Bluetooth environment and Figure 4 shows the measured RSSI values and the theoretical RSSI values from the BLE signal propagation model regarding the reference distance. The average value of n = 1.64 was used for further measurements.

Triangulation Method
Once we got the RSSI values of the pre-known BLE beacons, the distances to the beacons can be calculated by the BLE propagation model. Then, the position of the RSSI receiver was calculated with the method of triangulation algorithm. At least three of the reference BLE beacons with pre-known positions were required in this method. In this method, each reference beacon forms a circle around itself with the radius of the distance to the receiver theoretically and the position of the unknown receiver corresponds with the intersection of these three circles [12]. The distances in a plain between the i th known BLE beacon and the unknown receiver can be expressed by the following equation: where the coordinate (xi, yi) represents the position of the i th BLE beacon while the (x, y) is the coordinate of the receiver. Furthermore, in most cases, more than three reference beacons are available and the position of target receiver can be expressed in the form of

Triangulation Method
Once we got the RSSI values of the pre-known BLE beacons, the distances to the beacons can be calculated by the BLE propagation model. Then, the position of the RSSI receiver was calculated with the method of triangulation algorithm. At least three of the reference BLE beacons with pre-known positions were required in this method. In this method, each reference beacon forms a circle around itself with the radius of the distance to the receiver theoretically and the position of the unknown receiver corresponds with the intersection of these three circles [12]. The distances in a plain between the ith known BLE beacon and the unknown receiver can be expressed by the following equation: where the coordinate (x i , y i ) represents the position of the ith BLE beacon while the (x, y) is the coordinate of the receiver. Furthermore, in most cases, more than three reference beacons are available and the position of target receiver can be expressed in the form of with: . .
Additionally, the equation can be solved as the least-squares problems as following:

PDR Method
This section mainly investigated the dead reckoning method based on the internal sensors of a mobile device and presented the PDR algorithm based on the mobile sensors, followed by a detailed explanation of the method of detecting steps. Finally, the heading direction was analyzed. A smartphone was utilized for the following experiments.

PDR Algorithm
According to the PDR method, the accelerometer, the magnetic sensor and the gyroscope embedded in a smart phone will be combined into an inertial measurement unit to locate the position of the mobile terminal based on the following formula: where (x, y) indicates the coordinates of the mobile position, sl denotes the step length and α represents the heading angle, thus the PDR algorithm mainly consists of the gait detection, step length and heading direction. Furthermore, one person's step length was assumed as 0.70 m in this work.

Step Detection
The accelerometer embedded in the smart phone can detect the occurrence of a step [22,23]. Both of the vertical and horizontal signals of the accelerometer graph provide the number of steps taken. The measurement of the acceleration was performed, and Figure 5 shows the wave form of the average acceleration recorded during 20 steps, where the average acceleration represents the root mean square value of the acceleration force along the x-, yand z-axis.
The detection algorithm can be applied to the accelerometer graph and a number of identification methods can be used. One of the simplest ways is to identify a step through a high peak. However, due to the multiple peaks and the amplitude variation of measurements, the high peak is not reliable enough. Alternatively, an improved method uses the fact that a high peak is always followed by a low peak during a taken step [24]. Therefore, a high and low threshold were set to recognize the peaks and a step was counted at a high peak followed by a low peak. Nevertheless, an unintended movement of the mobile can result in an incorrect step count. To solve the problem, a step identification method characterized by duration time was proposed [25]. Additionally, a typical time between the high and the low peak takes about 150-400 ms, which can be the additional constraint to the step characterization. The detection algorithm can be applied to the accelerometer graph and a number of identification methods can be used. One of the simplest ways is to identify a step through a high peak. However, due to the multiple peaks and the amplitude variation of measurements, the high peak is not reliable enough. Alternatively, an improved method uses the fact that a high peak is always followed by a low peak during a taken step [24]. Therefore, a high and low threshold were set to recognize the peaks and a step was counted at a high peak followed by a low peak. Nevertheless, an unintended movement of the mobile can result in an incorrect step count. To solve the problem, a step identification method characterized by duration time was proposed [25]. Additionally, a typical time between the high and the low peak takes about 150-400 ms, which can be the additional constraint to the step characterization.
In our step detection method, the high peaks and the low peaks of the acceleration graph were identified, and a step was detected when two conditions were all met. Firstly, the difference value of high peak and adjacent low peak must exceed the set threshold. Secondly, the time between the high peak and the adjacent low peak must be between 150 and 400 ms. To find the best threshold, step measurements in different thresholds were carried out. The user walked 20 steps in each test, and the results are shown in Table 3. It turned out that the lower the threshold was, the more sensitive the step count method was. when the threshold was 3, the error rate was the lowest.

Heading Estimation
The orientation sensor was used to get the heading direction of the smart phone. To determine the accuracy of the heading, eight different heading direction tests were carried out. In each direction, 1000 single measurements were recorded. The results of the tests are shown in Table 4.  In our step detection method, the high peaks and the low peaks of the acceleration graph were identified, and a step was detected when two conditions were all met. Firstly, the difference value of high peak and adjacent low peak must exceed the set threshold. Secondly, the time between the high peak and the adjacent low peak must be between 150 and 400 ms. To find the best threshold, step measurements in different thresholds were carried out. The user walked 20 steps in each test, and the results are shown in Table 3. It turned out that the lower the threshold was, the more sensitive the step count method was. when the threshold was 3, the error rate was the lowest.

Heading Estimation
The orientation sensor was used to get the heading direction of the smart phone. To determine the accuracy of the heading, eight different heading direction tests were carried out. In each direction, 1000 single measurements were recorded. The results of the tests are shown in Table 4. The results showed that the average error is less than 2 • . The reason may be: the user took a step along the x-axis, and it was expected that the x-value is increased by 0.70 m, and the y-value did not change. If the heading measurement is measured incorrectly by 2 • , the distance error will be: It showed that a deviation of 2 • leads to only a distance error of less than 1 cm, which is acceptable for the further calculation.

Hybrid Indoor Positioning
In this section, the hybrid indoor positioning method combined with Trilateration algorithm and dead reckoning is illustrated. The hybrid positioning method centered on overcoming the high RSSI variation and a long collection time interval of BLE resulting from the dense Bluetooth environment and exploiting the advantages of Trilateration algorithm and dead reckoning, but avoiding possible disadvantages, as depicted in Figure 6. As mentioned before, the indoor positioning system was divided into two positioning phases, as shown in Figure 7. During the short interval, the dead reckoning was used to determine the location of the mobile device. However, during the long interval, the triangulation algorithm was exploited to correct the deviation of the dead reckoning caused by accumulative sensing errors. To achieve that, a Kalman filter was used as a fusion center to merge the two obtained positions from the two algorithms.
It showed that a deviation of 2° leads to only a distance error of less than 1 cm, which is acceptable for the further calculation.

Hybrid Indoor Positioning
In this section, the hybrid indoor positioning method combined with Trilateration algorithm and dead reckoning is illustrated. The hybrid positioning method centered on overcoming the high RSSI variation and a long collection time interval of BLE resulting from the dense Bluetooth environment and exploiting the advantages of Trilateration algorithm and dead reckoning, but avoiding possible disadvantages, as depicted in Figure 6. As mentioned before, the indoor positioning system was divided into two positioning phases, as shown in Figure 7. During the short interval, the dead reckoning was used to determine the location of the mobile device. However, during the long interval, the triangulation algorithm was exploited to correct the deviation of the dead reckoning caused by accumulative sensing errors. To achieve that, a Kalman filter was used as a fusion center to merge the two obtained positions from the two algorithms.

Two Positioning Phases
As mentioned above, a lot of the unwanted and distracted Bluetooth signals in the environment will affect the scanning of the wanted and specific BLE signals in a dense Bluetooth environment. Moreover, an average 6.652 s time interval was needed for one BLE signal collection in the dense environment, which means that the frequency of one BLE beacon signal collected by a phone was 0.15 Hz. In this indoor positioning system, there were eight BLE beacons distributed in the ceiling, which means that the frequency of the one of the eight beacons signals collected by a phone was 1.2 Hz. The trilateration algorithm took at least three BLE signals to calculate the position of the target and it would take at least 2.5 s to collect enough BLE signals feeding the trilateration algorithm to get the position. However, during the 2.5 s interval, one person possibly moves a long distance and the result from the trilateration algorithm loses timeliness leading to a wrong positioning estimation. Therefore, the dead reckoning will contribute to the real time positioning estimation. Dead reckoning produces highly accurate position fixes at the beginning of the measurements. Nevertheless, the dead reckoning performance continuously drops due to accumulative sensing errors. Consequently, it was necessary to divide the indoor positioning system into two positioning phases in a dense Bluetooth

Two Positioning Phases
As mentioned above, a lot of the unwanted and distracted Bluetooth signals in the environment will affect the scanning of the wanted and specific BLE signals in a dense Bluetooth environment. Moreover, an average 6.652 s time interval was needed for one BLE signal collection in the dense environment, which means that the frequency of one BLE beacon signal collected by a phone was 0.15 Hz. In this indoor positioning system, there were eight BLE beacons distributed in the ceiling, which means that the frequency of the one of the eight beacons signals collected by a phone was 1.2 Hz. The trilateration algorithm took at least three BLE signals to calculate the position of the target and it would take at least 2.5 s to collect enough BLE signals feeding the trilateration algorithm to get the position. However, during the 2.5 s interval, one person possibly moves a long distance and the result from the trilateration algorithm loses timeliness leading to a wrong positioning estimation. Therefore, the dead reckoning will contribute to the real time positioning estimation. Dead reckoning produces highly accurate position fixes at the beginning of the measurements. Nevertheless, the dead reckoning performance continuously drops due to accumulative sensing errors. Consequently, it was necessary to divide the indoor positioning system into two positioning phases in a dense Bluetooth environment. During the short interval, the dead reckoning was used to determine the location of the mobile device. During the long interval, the triangulation algorithm was exploited to correct the deviation of the dead reckoning caused by accumulative sensing errors. To get the enough BLE signals for trilateration algorithm, the long interval was set to 3 s. environment. During the short interval, the dead reckoning was used to determine the location of the mobile device. During the long interval, the triangulation algorithm was exploited to correct the deviation of the dead reckoning caused by accumulative sensing errors. To get the enough BLE signals for trilateration algorithm, the long interval was set to 3 s.

Kalman-Based Fusion
During the long interval phase, a Kalman filter was chosen to integrate the trilateration algorithm and dead reckoning [12]. In the Kalman filter, the state model is obtained from the dead reckoning method and the state equation can be expressed as: where the state vector , represents the coordinates of the target from the dead reckoning. F and B are identity matrices, and N is the total amount of counted steps during the long interval phase. While, cos , sin is the coordinate change derived from ith step. In this case, sl is the step length and is the heading direction. Therefore, the coordinate change resulting from the dead reckoning method during the long interval phase can be expressed as: The measurement model is obtained from the trilateration positioning method. The measure model can be expressed as: where ̂ , represent the coordinate of the target from the trilateration positioning, and the H is identity matrix.
Once the time interval reaches 3 seconds, the Kalman filter updates the position with a prediction and an update phase. In the prediction phase, a position can be predicted as following: where Q is the covariance of the noise from the dead reckoning method. In the update phase, the positions from the both methods can be merged as following:

Kalman-Based Fusion
During the long interval phase, a Kalman filter was chosen to integrate the trilateration algorithm and dead reckoning [12]. In the Kalman filter, the state model is obtained from the dead reckoning method and the state equation can be expressed as: where the state vectorx k = (x, y) T represents the coordinates of the target from the dead reckoning. F and B are identity matrices, and N is the total amount of counted steps during the long interval phase. While, u i = sl × (cos α i , sin α i ) T is the coordinate change derived from ith step. In this case, sl is the step length and α i is the heading direction. Therefore, the coordinate change resulting from the dead reckoning method during the long interval phase can be expressed as: The measurement model is obtained from the trilateration positioning method. The measure model can be expressed as:ẑ whereẑ k = (x k , y k ) T represent the coordinate of the target from the trilateration positioning, and the H is identity matrix. Once the time interval reaches 3 s, the Kalman filter updates the position with a prediction and an update phase. In the prediction phase, a position can be predicted as following: where Q is the covariance of the noise from the dead reckoning method. In the update phase, the positions from the both methods can be merged as following: where the K is the Kalman gain and I is identity matrix. R is the covariance of the noise from the trilateration positioning method, andx k represents the merged position. Different values for R and Q were experimentally tested, and the best results were obtained by using R = 4 and Q = 0.1.

Implementation of the Hybrid Method
In this section, the performance of the proposed hybrid method was evaluated in a dense Bluetooth environment. A mobile device was used to carry out the tests.

Test Scenario
To evaluate the performance of the proposed algorithm, we conducted experiments in the middle of the office floor (the red square area), depicted in Figure 8A. The area size was 5.6 × 8.8 m 2 . There were 18 Bluetooth lights in the square area they broadcasted their Bluetooth signals incessantly resulting in a dense Bluetooth environment, as shown in Figure 8C. Eight BLE beacons were placed in the square area, depicted in Figure 8B. Each of the beacons was placed in the ceiling, at a height of 2.7 m. The tester walked with a smartphone in the test area following the predefined path. The distance between two beacons was 4 to 6 m, such that the square was entirely covered by BLE signals. Since a 2D trilateration method was applied, the vertical distance ∆h between the beacon and the mobile was required to get the horizontal distance d h between the beacon and the mobile. Hence, the horizontal distance d h in terms of measured distance d m and the vertical distance ∆h between the beacon and the mobile, as given by: where the K is the Kalman gain and I is identity matrix. R is the covariance of the noise from the trilateration positioning method, and represents the merged position. Different values for R and Q were experimentally tested, and the best results were obtained by using R = 4 and Q = 0.1.

Implementation of the Hybrid Method
In this section, the performance of the proposed hybrid method was evaluated in a dense Bluetooth environment. A mobile device was used to carry out the tests.

Test Scenario
To evaluate the performance of the proposed algorithm, we conducted experiments in the middle of the office floor (the red square area), depicted in Figure 8A. The area size was 5.6 × 8.8 m 2 . There were 18 Bluetooth lights in the square area they broadcasted their Bluetooth signals incessantly resulting in a dense Bluetooth environment, as shown in Figure 8C. Eight BLE beacons were placed in the square area, depicted in Figure 8B. Each of the beacons was placed in the ceiling, at a height of 2.7 m. The tester walked with a smartphone in the test area following the predefined path. The distance between two beacons was 4 to 6 m, such that the square was entirely covered by BLE signals. Since a 2D trilateration method was applied, the vertical distance ∆ℎ between the beacon and the mobile was required to get the horizontal distance between the beacon and the mobile. Hence, the horizontal distance in terms of measured distance and the vertical distance ∆ℎ between the beacon and the mobile, as given by: Figure 8. Layout of the test scenario.

Performance Evaluation
In this section, the performance of dead reckoning, Trilateration and Hybrid method are comprehensively evaluated. It is necessary to explain that the dead reckoning method requires the coordinate of the initial position. In each test, the person holding a smart phone continued to move along the determined path with a length of 28.8 m in the area covered by the BLE modules. In the experiment, the positioning performances of the three methods in a dense Bluetooth environment were tested.

Performance Evaluation
In this section, the performance of dead reckoning, Trilateration and Hybrid method are comprehensively evaluated. It is necessary to explain that the dead reckoning method requires the coordinate of the initial position. In each test, the person holding a smart phone continued to move along the determined path with a length of 28.8 m in the area covered by the BLE modules. In the experiment, the positioning performances of the three methods in a dense Bluetooth environment were tested.

Dead Reckoning
In the dead reckoning experiment, the magnetic sensor and accelerometer of the smart phone were mainly used for positioning. The dead reckoning method should get its initial coordinate at the beginning of the position, because it cannot calculate the initial coordinate by itself. The estimated path and actual walked path of the dead reckoning is shown in Figure 9.

Dead Reckoning
In the dead reckoning experiment, the magnetic sensor and accelerometer of the smart phone were mainly used for positioning. The dead reckoning method should get its initial coordinate at the beginning of the position, because it cannot calculate the initial coordinate by itself. The estimated path and actual walked path of the dead reckoning is shown in Figure 9. The estimated path of dead reckoning method was similar to the actual walked path. As the dead reckoning method requires initial coordinate to calculate the path, the cumulative error was increased with the increase of the estimated path, and a larger error appeared in the final location coordinate and the actual coordinate.

Trilateration
The variation of the Bluetooth signal intensity becomes larger and the scanning interval of the BLE modules become longer under a dense Bluetooth environment. It had a great influence on the positioning accuracy of trilateration method. The estimated path and actual walked path of the trilateration is shown in Figure 10.  The estimated path of dead reckoning method was similar to the actual walked path. As the dead reckoning method requires initial coordinate to calculate the path, the cumulative error was increased with the increase of the estimated path, and a larger error appeared in the final location coordinate and the actual coordinate.

Trilateration
The variation of the Bluetooth signal intensity becomes larger and the scanning interval of the BLE modules become longer under a dense Bluetooth environment. It had a great influence on the positioning accuracy of trilateration method. The estimated path and actual walked path of the trilateration is shown in Figure 10.
In the dead reckoning experiment, the magnetic sensor and accelerometer of the smart phone were mainly used for positioning. The dead reckoning method should get its initial coordinate at the beginning of the position, because it cannot calculate the initial coordinate by itself. The estimated path and actual walked path of the dead reckoning is shown in Figure 9. The estimated path of dead reckoning method was similar to the actual walked path. As the dead reckoning method requires initial coordinate to calculate the path, the cumulative error was increased with the increase of the estimated path, and a larger error appeared in the final location coordinate and the actual coordinate.

Trilateration
The variation of the Bluetooth signal intensity becomes larger and the scanning interval of the BLE modules become longer under a dense Bluetooth environment. It had a great influence on the positioning accuracy of trilateration method. The estimated path and actual walked path of the trilateration is shown in Figure 10.  The estimated path of trilateration experiment was very different from the actual walked path The BLE positioning fluctuates resulting from fast fading or multipath effects in public indoor spaces. Due to the fast fading and multipath effects in the experiment environment, the trilateration method did not accurately position the actual location. The estimated path of the trilateration experiment was very different from the actual path. The experiment results showed that the trilateration method based on Bluetooth was difficult to independently complete indoor positioning with less error.

Hybrid Method
The hybrid method has the advantages of dead reckoning method and trilateration method. It can not only ensure that the estimated path has a small error with the actual walked path, but also can compensate the estimated path continuously to prevent a large cumulative error. The estimated path and actual walked path of the hybrid method is shown in Figure 11.
The BLE positioning fluctuates resulting from fast fading or multipath effects in public indoor spaces. Due to the fast fading and multipath effects in the experiment environment, the trilateration method did not accurately position the actual location. The estimated path of the trilateration experiment was very different from the actual path. The experiment results showed that the trilateration method based on Bluetooth was difficult to independently complete indoor positioning with less error.

Hybrid Method
The hybrid method has the advantages of dead reckoning method and trilateration method. It can not only ensure that the estimated path has a small error with the actual walked path, but also can compensate the estimated path continuously to prevent a large cumulative error. The estimated path and actual walked path of the hybrid method is shown in Figure 11.
The estimated path of hybrid method was basically the same as the actual walked path. Under the premise of the estimation path calculated by dead reckoning method, the Kalman-based hybrid method effectively reduces the estimated path error and achieves better positioning results. Figure 11. The estimated path and actual walked path of the hybrid method.

Positioning Root-Mean-Square Error
The positioning root-mean-square-error (RMSE) of the above three positioning methods were calculated, as shown in Equation (23) [26]. The RMSE was used to evaluate the closeness of the measurement trajectory to a true trajectory over Nstep simulation steps. The results are shown in Table 5.
where ( , is the true position coordinate at step t, ( , is the measurement position, Nstep is the number of measurements of indoor positioning.  The estimated path of hybrid method was basically the same as the actual walked path. Under the premise of the estimation path calculated by dead reckoning method, the Kalman-based hybrid method effectively reduces the estimated path error and achieves better positioning results.

Positioning Root-Mean-Square Error
The positioning root-mean-square-error (RMSE) of the above three positioning methods were calculated, as shown in Equation (23) [26]. The RMSE was used to evaluate the closeness of the measurement trajectory to a true trajectory over N step simulation steps. The results are shown in Table 5.
where (x t , y t ) is the true position coordinate at step t, (x m , y m ) is the measurement position, N step is the number of measurements of indoor positioning.

Results
According to the results of the experiment, the estimated path of dead reckoning method is similar to the actual walked path, and the dead reckoning method can realize indoor positioning without additional hardware. However, the dead reckoning method needs initial coordinates to locate, and its cumulative error increases with the length of the walking path.
The trilateration method requires BLE module as hardware support. Moreover, the individual trilateration method is easily influenced by the dense Bluetooth environment and has great influence on its positioning accuracy. Therefore, more data needs to be calculated to get more accurate positioning coordinates.
The hybrid method combines the advantages of dead reckoning method and trilateration method. The estimated path of hybrid method is basically the same as the actual walked path. The hybrid method not only has the advantages of the smooth estimated path, but also has the advantages of real-time correction of the location path, which minimizes the positioning error.

Conclusions
In this paper, the indoor positioning problems in the dense Bluetooth are mentioned. A high Bluetooth density of the environment would lead to a high RSSI variation and a long-time interval collection of BLE, which would lead to a low accuracy and a poor timeliness of positioning. To solve the problems, a hybrid method combined with trilateration algorithm and dead reckoning method was innovatively proposed based on a two-phase positioning strategy. A Kalman filter was used to integrate the trilateration algorithm and dead reckoning. A number of experiments were carried out to evaluate the accuracy and limitations of each method in a real implementation with a dense Bluetooth environment. The positioning root-mean-square error results proved that the hybrid method has improved the location accuracy and reliability in the dense Bluetooth environment.