1 Introduction

In recent years, with the commercialization of the global positioning system (GPS), location-based services, such as tracking vehicles, ships, and cargo, have been widely used in daily life. A GPS that utilizes satellites and base stations provides a location service within a 1-m error range and is conveniently used in the outdoor environment. However, owing to its weak signal penetration rate in terms of obstacles, GPS is affected by frequent non-signal-shaded areas, such as tunnels, indoor areas, and spaces between buildings, compared to other wireless communications. Accordingly, several studies on additional positioning technologies have been conducted. A representative technology among them is a Wi-Fi fingerprinting-based method. The fingerprinting technique using the received signal strength indicator (RSSI) of the access point (AP) estimates the target location by comparing a measured signal at each position with already stored positions in the RSSI database. Extensive preparation work is required to develop a single database, as well as multiple databases, even for a narrow area. In particular, because positions are estimated based on the positions stored in the database, errors between real and estimated positions are unavoidable [1,2,3]. However, because an additional AP installation is not required, it can be combined with smartphones, which provides more convenient access to services other than TOA and vision, etc. [4,5,6,7,8,9]. Kriz et al. [10] proposed an algorithm that improves the position accuracy of the Wi-Fi fingerprint algorithm by fusing BLE. This algorithm was implemented as an auxiliary device by BLE for indoor positioning based on Android. This method uses reference points which are position values stored in the fingerprint database, so it is difficult to improve the resolution of the position.

In addition, Lohan et al. [11] compared and analyzed differences and similarities between wireless local area network (WLAN) and Bluetooth low energy (BLE) through signal strength models in the indoor environment. This method aimed to test the floor positioning using basic positioning algorithm models and was implemented to include only a corridor space; moreover, it focused on survey experiments of devices rather than technology fusion.

Bozkurt et al. [12] proposed a method of integrating various sensors used in the fingerprinting method into a single database which was developed using various sensor signals, such as Wi-Fi, BLE, and magnetic fields. However, this database requires considerable information to be acquired from several sensors to support smart devices. Furthermore, these systems are very complicated because a variety of sensor types are involved.

The positioning error corrections occur on account of wireless signal noise caused primarily by environmental factors rather than technical issues. Consequently, several studies have attempted to improve the accuracy through shortening the time required to construct a database, or by providing efficient algorithms [13,14,15,16].

Recently, BLE is widely used in the field of indoor localization [17]. The BLE beacons have the following advantages: small size, light weight, low cost, power saving and are supported by smart devices. Although BLE has the potential to become a dominant wireless localization technology, it should be installed tightly because the signal strength is weak compared to Wi-Fi [18].

Therefore, it is necessary to research a variety of methods that can remove unnecessary database and update AP signal in accordance with changes in the ambient environment.

In this paper, a modified fingerprint algorithm based on Wi-Fi and Bluetooth low energy applied to the log-distance path loss model is proposed to reduce the database and increase the accuracy of positioning.

The proposed algorithm, instead of estimating the target location by consulting a preconstructed database, employs environmental variables to which the log-distance path loss model is applied. To develop a database, irregular AP signals are filtered by utilizing the Hausdorff distance. Optimum path loss coefficients are extracted through the log-distance path loss model in accordance with each location. Thus, the constructed database estimates positions utilizing path loss coefficient rather than by employing existing comparison-based estimation. It can thereby increase the resolution of positioning and decrease errors compared to an existing fingerprint method.

2 Related Theories

2.1 The Wi-Fi Based Fingerprinting

The fingerprinting is divided into two phases: a training phase, which involves collecting RSSI signals of APs and creating a database, and a positioning phase, which involves estimation of actual positions in real-time. Although it is divided into two phases, most of the time involved for implementing the fingerprinting is incurred during the training phase.

The training phase is conducted as follows. First, the area for fingerprint positioning is selected, and then Wi-Fi signals present in the area are measured and collected through the Wi-Fi receiver. If there is a Wi-Fi shaded area, this shaded area can be minimized through the installation of additional Wi-Fi APs. After this process, a database for storing Wi-Fi signals according to the reference points set at predetermined intervals. The predetermined intervals of reference points are generally set between 2 and 3 m depending on the structure of area and the Wi-Fi installation environment such as density, signal strength, obstacles, etc.

Figure 1 shows the structure of a database consisting only of RSSI and SSID according to the reference point. At each reference point, various Wi-Fi information such as the SSID, RSSI, and MAC of the APs is acquired through the Wi-Fi receiver. Among these information, RSSI is often used to estimate the position with a constant intensity value that varies with the distance between the transmitter and the receiver. Therefore, the algorithms [19] that remove the APs of the database and the interpolation techniques that use an inverse distance weighting algorithm [20] are proposed using these characteristics of RSSI.

Fig. 1
figure 1

Configuration of the database according to the reference points

Based on the database generated by these various methods, the position of the user is estimated in real time at the positioning phase. In this phase, the position of the user is discriminated by comparing and analyzing the Wi-Fi signal measured in real time with the database. At this time, a number of deterministic or probabilistic models [21, 22] have been used for position identification.

2.2 Log-Distance Path Loss Model

The strength of wireless signals is inversely proportional to the distance to reception and transmission. This attenuation follows the log-distance path loss model as shown in Eq. (1).

$$P\left( r \right) = P\left( {r_{0} } \right) - 10nlog\left( {\frac{r}{{r_{0} }}} \right)$$
(1)

where \(r\) is the distance between the AP and moving object, \(r_{0}\) is the reference distance, and \(n\) is the path loss coefficient. Path loss coefficient \(n\) is a constant that is determined by surrounding communication and physical environments. An error occurs between the measured signal values and the ideal log-distance path loss model on account of various environmental noises. This error is a major cause of location positioning errors [23,24,25,26].

3 Proposed Radio Map Algorithm

Figure 2 shows the flow chart of the proposed Wi-Fi fingerprint consisting of Training and Positioning Phase. All Wi-Fi and BLE signals are scanned using smartphones in BLE and Wi-Fi installed area. Locations are estimated according to the Wi-Fi and BLE circumstances. The first measured signal estimated by SSID (Service Set Identifier) and RSSI of BLE is location information to estimate the region of interests. However, because BLE can be a risk of discharge due to the use of independent power and long operation, the proposed algorithm is effectively applied according to the changes of the signal reception circumstances. In case several BLE and Wi-Fi signals are simultaneously received, two strongest BLE or Wi-Fi signals among them are extracted to estimate locations.

Fig. 2
figure 2

Flow chart of the proposed positioning estimation

The BLE has the advantage that it is easy to minimize and specify the positioning area of the users because it has a narrow transmission range than Wi-Fi. So, it can minimize the shaded area where the location is not recognizable because it is easy to install in any space. Therefore, we propose a new fingerprint fusion of BLE and Wi-Fi. In the Training phase, which is the database building step, we applied the Hausdorff distance algorithm to preprocess all collected BLE and Wi-Fi signals.

The applied Hausdorff distance is effectively removed outliers because it is relatively simple to operate compared to existing database preprocessing methods such as SVM and Chi-squared test, and is more sensitive than other similarity discrimination algorithms (Euclidean distance, Mahalanobis Distance). The Hausdorff distance algorithm applied to remove irregular AP signals from all measured Wi-Fi and BLE signals at the reference points is as follows [27].

$$h\left( {A,B} \right) = \mathop {\hbox{max} }\limits_{a \in A} \left\{ {\mathop {\hbox{min} }\limits_{b \in B} \left\{ {d\left( {a,b} \right)} \right\}} \right\}$$
(2)
$$h\left( {B,A} \right) = \mathop {\hbox{max} }\limits_{b \in B} \left\{ {\mathop {\hbox{min} }\limits_{a \in A} \left\{ {d\left( {b,a} \right)} \right\}} \right\}$$
(3)

where each of A and B is a set of signal strength according to the measured distance, each of a and b is arbitrary points in the AP RSSI graphs of A and B, and \(d\left( {b,a} \right)\) refers to the Euclidean distance between a and b. Here, the Hausdorff distance between A and B using Eq. (2), which is based on A, and Eq. (3), which is based on B, can be defined as shown in Eq. (4).

$$H\left( {A,B} \right) = \hbox{max} \left\{ {h\left( {A,B} \right),h\left( {B,A} \right)} \right\}$$
(4)

\(H\left( {A,B} \right)\) refers to the maximum values of \(h\left( {A,B} \right)\) and \(h\left( {B,A} \right)\). It indicates that the larger the difference of the value is, the lower the similarity of the data is. Thus, through Eq. (4), similarities between graphs are measured and abnormal graphs are filtered. This approach is intended to remove irregular signals due to structures or obstacles by filtering and to thereby minimize location errors. Signals acquired through filtering are stored in a MySQL database.

Because path loss coefficients are entered into the database, these values according to signal strength as shown in Eq. (5) are stored.

$$P^{i} = \left[ {n_{1} ,n_{2} ,n_{3} , \ldots ,n_{k} } \right]$$
(5)

where \(P^{i}\) is the set of path loss coefficient \(n\) according to the measured position \(i\).The path loss coefficients \(n\) are determined as follows

$$n\left( {P\left( r \right)} \right) = \frac{{P\left( {r_{0} } \right) - P\left( r \right)}}{{10{ \log }\left( {\frac{r}{{r_{0} }}} \right)}}$$
(6)

where \(r\) is the distance between the AP and moving object, \(r_{0}\) is the reference distance, and \(P\) is RSSI of AP. Log-distance path loss model has a high resolution for the location and simple computation than the conventional fingerprint using the method of database comparison [24].

Thus, path loss coefficients n of the distance according to the signal strength for each AP is stored as shown in Fig. 3. The X axis refers to the measured signal strength of APs; the Y axis refers to SSID of APs.

Fig. 3
figure 3

Configuration of the proposed database

Because a decreasing ratio of signal strength per distance can vary depending on the environment, a distance of the signal is set at the X axis through a mean value of decreasing collected signals. Here, when signals are converted into distances, path loss coefficients calculated by signal strength should be constant in the proposed database. This can cause additional errors due to lack of consideration of changes in signal values with regard to various noises or structures. Because the database using the proposed method is changed by path loss coefficients according to the strengths of AP signals and updates them later, the estimation errors can be minimized.

Because the measured RSSI can also significantly vary on account of signal noise and environment, even at the same location, errors are likely to occur if signal strength is determined by one time signal reception or simple mean filter use. Thus, as shown in Eq. (7), a median filter is applied to minimize the above effect despite signal variance is large, even at the same location, in order to determine the signal strength.

$$RSSI_{p} = MED\left[ {RSS_{t} ,RSS_{t + 1} ,RSS_{t + 2} , \ldots ,RSS_{t + n} } \right]$$
(7)

\(RSSI_{t}\) refers to a signal strength measured at a single AP over time, and MED refers to a median function. A path loss coefficient of the database is searched through \(RSSI_{p}\) determined by the equation. A final location is searched by restored path loss coefficient n found in the database. The restoration is converted to a distance value according to Eq. (8).

$$D(t) = e^{{\frac{{K + 10nlogd_{0} }}{10n}}} (K = P(d_{0} ) - P(d))$$
(8)

Assuming that distances to arbitrary APs, A and B receivers, are \(D_{A} \left( t \right)\) and \(D_{B} \left( t \right)\), to estimate locations, two coordinates (X, Y) are extracted as intersections through Eqs. (9) and (10) because a, b, c, and d recognize coordinates of AP locations [3].

$$\left( {X - a} \right)^{2} + \left( {Y - b} \right)^{2} = D_{A} \left( t \right)^{2}$$
(9)
$$\left( {X - c} \right)^{2} + \left( {Y - d} \right)^{2} = D_{B} \left( t \right)^{2}$$
(10)

Among two coordinates, the (X, Y) coordinate that cannot be created via the area is excluded so that only one location (X, Y) coordinate is determined. This estimated technique which can improve location accuracy can help finely subdivide a range used in existing fingerprint positioning. The extracted data is a signal produced by a distance value, which can represent a more precise location than location measured via the signal strength. This coordinate can also be used as a coordinate to verify the Wi-Fi signal collected at that particular location to update the database. It thereby responds to a wireless environment that can constantly change.

4 Experiment

4.1 Experimental Environment

The experiment space was a corridor section and laboratory room in the Engineering Building of Korea Maritime and Ocean University. The proposed algorithm estimates locations using BLEs installed between APs based on existing indoor Wi-Fi APs. Figure 4 shows the configuration of the device used in the experiment. Here, the BLE module is nRF51822 of Nordic Co., the Wi-Fi APs used are indoor Wi-Fi APs of Olleh, and nRF51822 is a multi-protocol system on chip (SoC). We mounted to it a 256 KB flash memory and 16 KB of RAM. Because it employs 5-V lithium batteries, it can be programmed for various purposes, such as measurement and control, through both BLE communication and I/O terminals over a 2.4-GHz environment. The Wi-Fi AP is a 2.4-GHz indoor AP, which can cover up to 100-m distance and simultaneously connect with up to 30 terminals.

Fig. 4
figure 4

Configuration of the experimental device

We designed indoor positioning application, which receives the RSSIs of APs and interworks with the database, of smart phone with a built-in BLE and Wi-Fi module. The reception range of the BLE is set to the experimental standard (within 13 m) considering RSSI damping ratio based on our preliminary experiment.

Figure 5 shows the two structures of indoor spaces where the experiment was conducted. A corridor of 2.3 m × 34.8 m (width × length), as well as a room of 6.4 m × 5.2 m (width × length) were selected and each of corridor and room is empty. In the corridor where the obstacles were non-existent, two BLE nodes were situated between four existing installed Wi-Fi APs at a 12-m distance from each other and a 2.6-m high wall. The BLE nodes were arranged with a constant gap. In the room, two Wi-Fi APs and one BLE were installed at each end of a side wall. The locations were typically estimated through one BLE and one Wi-Fi in the room. If a BLE was not normally operated, the locations were estimated using the above two Wi-Fi APs. If the two APs are installed in one wall, this method has advantage of minimizing the number of AP because of the possibility of bilateration.

Fig. 5
figure 5

Experimental environment

4.2 Experiment Results

Environment variable n, which is required to construct the proposed database, was set by measuring Wi-Fi and BLE wireless signals over the experimental environment. AP signals were tested. Figure 6 shows the theoretical signal attenuation of the log-distance model and the measured results over the experimental environment.

Fig. 6
figure 6

The measurement results and Log-distance model by fixed n values

The X axis refers to the distance between receivers and transmitters; the Y axis refers to signal strength. The measured values of arbitrary W-Fi APs and BLEs are shown by changing the distance between receivers and transmitters up to 20 m over the experiment space. According to existing study results, the n value was set to 2 for a free space, 2.7–3.5 for urban wireless channel environments, and 1.6–1.8 for indoor line-of-sight (LOS) environments. However, according to our experiment results, the Wi-Fi value was close to 1.8 in the short distance and 2.1 in the long distance on account of the effect of the surrounding environments. The BLE value was close to 1.4. Thus, if the same n value is applied, it is expected to have errors in accordance with the distance.

Figure 7 shows the result of eliminating irregular signals using the Hausdorff distance algorithm. The X axis refers to the distance between receivers and transmitter; the Y axis refers to signal strength. The left side of the graph shows AP signals collected using smartphones without filtering, while the right side of the graph shows the result of the Hausdorff distance algorithm being applied based on the left side signals. The filtering was conducted based on the highest frequent signal attenuation width. Through this filtering, AP4, AP5, and AP6 were removed. AP4 and AP5 existed at different spaces rather than the corridor section, and AP6 showed an irregular graph because its signals were penetrated through the ‘¬’ shape corridor section. Thus, irregular three AP signals that are not related to testing are removed.

Fig. 7
figure 7

Filtering result according to the Hausdorff distance algorithm

Figure 8 shows the measured results when the environment variables in the proposed method were applied. The X axis refers to the distance between nodes and the measuring instrument; the Y axis refers to the measured distance. The environment path loss coefficients stored in the database were extracted based on the signal strength and AP measured at the current position. Because the variance of signal values can be large during the measurement in real time, path loss coefficients were averaged. Because the most appropriate variable n with the signal strength was extracted and inputted to the database in Eq. (7), path loss coefficients could vary significantly even if the signal strength was similar.

Fig. 8
figure 8

Distance conversion measurement results through environment variables

Therefore, when the database is constructed, signal strength should be more finely segmented to increase the positioning accuracy. However, the reason for setting the distance to 1 m in this study is shown in Fig. 9. The value of the X axis shows the signal collection and installation distance gap in the database. The Y axis shows the location accuracy and the preparation time of experimental results according to the gap setup. Since the time consumption required to create the database is varied depending on various factors such as the measurement distances, measurement methods, etc., it is difficult to compare the proposed method with the existing research results. Here, experiments were conducted assuming that when the distance between reference points in database is 0.3 m, the preparation time of database is set to 1T (Time unit). The time graph displayed based on the distance gap is denoted with a blue line, while location errors are displayed with a red line. As shown in the figure, location errors rapidly decreased at 3 and 2 m; however, the decreasing trend was minimal at 1, 0.5, and 0.3 m. On the contrary, the time consumption rapidly increased. Therefore, the databases were constructed by setting the distance to 1 m, which provided the best cost-effectiveness and accuracy. The subsequent location-tracking experimental results are shown in Fig. 10 and Table 1.

Fig. 9
figure 9

The correlation of fingerprint setting factors

Fig. 10
figure 10

The positioning results between proposed algorithm and fingerprint algorithm

Table 1 Mean positioning error according to spaces

As a result of positioning using the proposed algorithm, the blue rectangle refers to the actual locations, and the red triangle denotes the measured final locations by the proposed algorithm, and green circle indicates the measured location by fingerprint algorithm. As shown in Fig. 10, the proposed algorithm is more accurate comparing with conventional fingerprint with a lot of overlapping position.

In the case of the fingerprint algorithm, the green circles, which are the result of applying the fingerprint algorithm, can only express the coordinates of the reference point because the positions of the user can be only represented by the stored positions (positions of reference point) in the database. But the proposed algorithm is capable of detailed representation and can reduce large positioning errors because it represents the distance between the AP and the receiver without any constraints of the reference point.

Table 1 shows the result of comparing the algorithms of RSSI based traditional fingerprint, the proposed algorithm with fixed path loss coefficients (n = 1.8), and the proposed algorithm in two spaces.

As shown in Fig. 10 and Table 1, the largest positioning errors are generated largely around the positions where the AP is installed since an irregular RSSI is received as the distance between the surrounding AP and the measurement position becomes longer. The experiment results using the two spaces showed that the average error was 2.063 m, which is a more accurate result by 0.695 m compared to that of the existing fingerprint measurement result of 2.758 m.

5 Conclusion

In this paper, we propose a novel log-distance path loss model based fingerprint algorithm which is different from the existing fingerprint methods using RSSI. Fingerprint, which is a typical indoor positioning algorithm used in RSSI-based BLE and Wi-Fi, is difficult to systematically represent precise positions because the position is indicated by the reference point stored in the database. In the training phase, we applied an algorithm that eliminates abnormally measured APs and minimizes the database through the Hausdorff distance algorithm. Also, we proposed a new database creation method based on the path loss coefficients of the log-distance path loss model, unlike the existing RSSI storage methods. In the positioning phase, the position is estimated by inversely transforming the log-distance path loss model based on this database. Conventional fingerprints can be represented only as reference points, but the proposed method is able to express position more precisely regardless of the point of reference because it can be expressed in distance values.

The experimental results demonstrated that location accuracy was reduced by 0.695 m from 2.758 m of the existing method to 2.063 m. Practically, it is difficult to remove the inaccurate n values and their accumulated errors are generated in the updating process using current RSSI devices with inherent errors. In the future work, we will verify the reliability of the updating data under a variety of experimental environments.