Efficient AoA-Based Wireless Indoor Localization for Hospital Outpatients Using Mobile Devices

The motivation of this work is to help outpatients find their corresponding departments or clinics, thus, it needs to provide indoor positioning services with a room-level accuracy. Unlike wireless outdoor localization that is dominated by the global positioning system (GPS), wireless indoor localization is still an open issue. Many different schemes are being developed to meet the increasing demand for indoor localization services. In this paper, we investigated the AoA-based wireless indoor localization for outpatients’ wayfinding in a hospital, where Wi-Fi access points (APs) are deployed, in line, on the ceiling. The target position can be determined by a mobile device, like a smartphone, through an efficient geometric calculation with two known APs coordinates and the angles of the incident radios. All possible positions in which the target may appear have been comprehensively investigated, and the corresponding solutions were proven to be the same. Experimental results show that localization error was less than 2.5 m, about 80% of the time, which can satisfy the outpatients’ requirements for wayfinding.


Introduction
With the popularity of mobile devices, such as smartphones, smartwatches, tablets, as well as some wearable devices, wireless localization has spawned numerous location-based services (LBS) to facilitate our daily life in the fields of emergency services, navigation, healthcare, geofence, social networking, entertainment/gaming, asset tracking, etc. [1][2][3][4][5][6]. For example, smartphone users can easily plan their trips using Google Maps and order a nearby taxi. The accurate location is mainly provided by the global positioning system (GPS). However, GPS signal is degraded too severely to be received in indoor environments. Many methods have been developed to meet the increasing demand for indoor LBS applications [7][8][9]. These wireless indoor localization methods and systems can be roughly divided into two main categories: range-based schemes and range-free schemes.
Range-based schemes first measure the distances between the target and at least three reference points, and then determine the target's position by triangulation or trilateration, using the least square method. The distances are indirectly measured by interpreting some physical parameters obtained from wireless signals, such as time of flight (ToF), time of arrival (ToA), time difference of arrival (TDoA), and received signal strength indication (RSSI) [10][11][12][13][14][15][16]. ToF, ToA, and TDoA are very sensitive to timing error, thus, relying on highly synchronized timers. Furthermore, they usually need work under line of sight (LOS) conditions to get accurate ranging. RSSI is used to figure out the distance between the transmitter and the receiver with log-normal distance path loss (LDPL) model [17]. However, indoor RSSI is subject to temporal and spatial fluctuations because of the multipath effect, usually providing a The rest of this paper is organized as follows. First, Section 2 reviews the related work. Then, Section 3 introduces the design method and localization algorithm, in detail. Section 4 gives the experimental results. Finally, Section 5 concludes this work and discusses future work.

Related Work
AoA can be estimated by finding the maximum or minimum signal strength, during the rotation of a directional or a non-ideal omnidirectional monopole antenna [35][36][37][38], or when measuring the phase difference of received signals in an antenna array [39][40][41][42].
For the directional antenna, it needs an additional mechanical unit to rotate, and takes a long period of time to sample the 360 • data [43]. So, it is impractical to be equipped in a handheld platform, such as smartphones, smartwatches, tablets, and so on. Zhang et al. proposed an alternative approach to emulate the functionality of a directional antenna, and developed an outdoor AP localization system, called Borealis [44]. In Borealis, a user holds a smartphone in the hand and rotates the body by 360 • , a group of RSSI data is recorded and further processed to estimate the AP direction. Borealis produces 30 • angular error in simple LOS environment, up to 50 • in complex LOS, and 65 • in NLOS environments. SpinLoc adopts a similar localization principle as Borealis, except that it replaces the RSSI by the CSI for indoor scenarios [45]. SpinLoc can produce a median error of 20 • , offering localization accuracies in order of 6.5 m, with 4 Aps, and up to 5 m, with more APs. Jiang et al.
proposed an AoA Localization with RSSI Difference (ALRD) system to estimate the AoA by comparing the RSSI values, about the target, received from two perpendicularly-oriented directional antennas, at the beacon nodes [37]. ALRD has an average localization error of 1.24 m at the CDF (Cumulative Distribution Function) = 50% in a 10 × 10 m indoor area. Although the ALRD need not rotate the directional antennas to collect data, it has to rebuild a new fingerprint database of the RSSI values when the target changes.
Antenna array is another common approach to estimate the AoA, by measuring the phase difference between the received signals of the two antennas. The phase difference is caused by the time difference of the signal that arrives in the different antennas, and is essentially determined by the incident angle of the incoming signal. Amundson et al. employed radio interferometric technique to determine the bearing from an anchor node, with an antenna array, to a distant target node, achieving an accuracy of about 3 • [39]. Based on the above radio interferometric AoA estimation, Amundson et al. designed a localization and navigation system, called the TripNav, which could provide an average position and heading accuracy of 0.95 m and 4.75 • , when traveling indoor at a speed of 1 m/s [23]. However, it requires an accurate time synchronization between the anchor node and the target node, on the order of microseconds. Chen et al. designed a low-cost and flexible antenna array for the AoA estimation, using modular, commercial-off-the-shelf, software-defined radios (SDRs) [42]. The prototype system still needs an additional clock module to synchronize the connected SDRs, for measuring the phase difference of arrival (PDoA), and offers a localization error less than 3 m, in the open field test. In the indoor location system, called the ArrayTrack, a custom FPGA (Field Programmable Gate Array) hardware with sixteen antennas was designed, and a multi-path suppression algorithm, named MUSIC (Multiple Signal Classification), was applied for the AoA estimation [40]. ArrayTrack can pinpoint forty-one clients, over an indoor office environment, to within 0.23 m median accuracy. Tzur et al. used a commercial Intel 5300 Wi-Fi NIC (Network Interface Card) with two receiving antennas to develop a practical method for identifying the AoA of a Wi-Fi AP [46]. In a realistic indoor environment, they are able to acquire the AoA, with a median error of 8-15 • . SpotFi uses a single NIC with three antennas, combining the CSI values across the subcarriers and the antennas to jointly estimate both the AoA and the ToA of each path [47]. The joint estimation procedure enables the SpotFi to provide a similar AoA accuracy that is comparable to systems that require twice as many antennas. Under the LoS conditions, SpotFi can achieve a median error of 5 • . Gjengset et al. used multiple NICs and automatic calibration to achieve a median location accuracy of 0.9 m [41].

Methodology
In this section, we first introduce the basic idea of our method. And then we give the detailed description of all possible cases in which the target will appear with regards to the Wi-Fi APs. Finally, we show how to deal with the case in which a target can be accessed by several pairs of APs.

AoA-Based Localization with Two Known APs
We plot Figure 1 to interpret the AoA-based localization with two known APs. For the convenience of description, all positions and angles in this paper are expressed in the two-dimensional Cartesian coordinate system. And the AoA value is defined to be positive if it is counter-clockwise and negative otherwise. In order to avoid confusion, we further define that the AoA specifically refers to the angle of incidence at which the radio signal travels from the transmitter to the receiver, along a straight line. As shown in Figure 1, two Wi-Fi APs are located at (x 1 , y 1 ) and (x 2 , y 2 ), labelled as AP 1 and AP 2 , respectively. Without the loss of generality, let x 1 = x 2 and y 1 = y 2 , here. An arbitrary mobile target, labelled as T, is needed to be localized, by determining its coordinates (x, y) with the two known APs and the corresponding AoAs. From the standpoint of the target, the AoAs related to AP 1 and AP 2 are θ 1 and θ 2 , respectively, but if the AoAs are measured by AP 1 and AP 2 , they will be α 1 and α 2 .
As stated above, the undetermined coordinates (x, y) of target T can be formulated by the following tangent functions The solution to Equation (1) is It is easily observed in Figure 1 that two pairs of the AoAs, named as α 1 and α 2 , θ 1 , and θ 2 , have the following relations: Considering the periodicity of the tangent function, we can rewrite the solution to Equation (1) by replacing θ 1 and θ 2 with α 1 and α 2 If APs are installed in a line, the solution will have a more concise form. For example, when the APs are in the same row, which means y 1 = y 2 , solutions in Equation (4) will be simplified as Unlike the least-squares solution, by using a complex matrix equation in Reference [48], the solutions in Equations (2), (4), and (5) show that our method can efficiently figure out the target's position, through some relatively simple trigonometric calculations.

All Possible Positions of the Target around the APs
In this section, we will investigate how to figure out all the possible positions of a mobile target, around the Aps, in practice. When a user holds a mobile device (such as smartphone, smartwatch, tablet, etc.) to wander in a shopping mall, workshop, or hospital, he or she will appear in any position randomly. Different positions will get different AoAs. We group these positions into normal and special situations, according to the AoAs. In a normal situation, the tangent functions of the AoAs have non-zero values, while in the special situation they have zero or infinite values.
As shown in Figure 2, the normal situation is summarized into six cases. In order to be more intuitive, let y 1 = y 2 , so that AP 1 and AP 2 are aligned in the same row.
So far, we have investigated all the six cases in a normal situation. No matter where the target locates around the two APs and no matter which pairs of the AoAs are used, the results show that the equations are essentially consistent and that solutions are the same.
Compared with the normal situation, the special situation consists of blind and pole points, as shown in Figure 3. Blind points refer to the positions in which the tangent values of the AoAs are zero. According to the properties of the tangent function, when an angle is 0 • or integer multiples of 180 • , its corresponding tangent value is zero. Thus the positions in the same row with the APs, such as Z 1 , Z 2 , and Z 3 , are the blind points.
Pole points refer to the positions in which either of the tangent values of the AoAs is infinity. Mathematically, when an angle is integer multiples of 90 • , its corresponding tangent value is infinity. Thus, the positions in the same column with either of the APs, such as P 1 , P 2 , P 3 , and P 4 , are pole points.
Obviously, any of blind points fails to constitute a triangle, along with AP 1 and AP 2 . Thus, it cannot figure out the coordinates of the blind points using the tangent functions. Users should avoid these positions when adopting the AoA-based localization algorithm. As for the pole points, it is easier to calculate the target's coordinates. Taking P 3 for example, we can directly obtain x = x 1 by measuring θ 1 = 90 • , so that we only need to figure out the vertical coordinate y. Using the tangent function, we have Thus, y = y 2 − (x 2 − x) tan θ 2 . Along with x = x 1 , we get the position of P 3 as follows

Roaming Strategy
As shown in Figure 4, the target can be accessed by the four APs. There are six combinations in total for choosing two out of four APs, which are AP 0 and AP 1 , AP 1 and AP 2 , AP 1 and AP 3 , AP 0 and AP 2 , AP 0 and AP 3 , and AP 2 and AP 3 , respectively. Although it is able to localize the target with the aid of any pair of the APs. For the sake of accuracy and efficiency, we adopt a simple but effective roaming strategy to deal with such uncertainty or collision. When there are more than two APs available for estimating the target's AoAs, the two with the highest RSSI are used. As shown in Figure 4, the four APs are supposed to be of the same model and the same configuration. It is obvious that AP 1 and AP 2 have the higher RSSI measurements for the radio from target, compared with the other combinations, because the target is much closer in distance to AP 1 and AP 2 .

Experiments and Results
In this section, we first introduce the experimental setup and then carry out the performance evaluation.

Experimental Setup
In our experiment, the AoAs were measured with Cisco Aironet TM 4800 Wi-Fi Aps (Cisco Systems Inc., San Jose, CA, USA), and were retrieved offline from the Cisco Connected Mobile Experiences (CMX) software. Aironet 4800 series APs were designed for the multiple-purpose applications, equipped with up to four radios: Flexible 2.4 GHz or 5 GHz for the Wi-Fi, dedicated 5 GHz for Wi-Fi, 2.4 GHz, and 5 GHz for the Hyperlocation, 2.4 GHz for the BLE. Hyperlocation is an enhanced location solution developed by Cisco, consisting of a few hardware instruments and software components. The workflow in Hyperlocation was: 4800 AP listened to the connected mobile devices through a circular array of sixteen antennas and created packets to record the measured phase differences; then, these packets were sent to the CMX, at a rate of about 1 packet per second per AP, via the WLC (Wireless Local Area Network Controller); finally, the CMX extracted the AoA information from the phase differences and performed the localization. It took 10-20 s to complete one localization, based on the AoA information, and provided a localization accuracy of 1-3 m, in the LOS conditions. Hyperlocation could also provide a real-time location service, relying only on the RSSI, if connected mobile device did not support the OFDM (Orthogonal Frequency Division Multiplexing) technique, but at the cost of a much poor accuracy. More details on the Aironet 4800 series AP and the Hyperlocation Solution can be found on the data sheet and the Cisco website [49,50].
Two 4800 APs were hung from a 3 m high ceiling, in an open laboratory, and an Android smartphone (Coolpad C106 Coolpad Group Limited, Shenzhen, China), with dual-band radio transceivers, supporting the IEEE 802.11a/b/g/n/ac standards) was used as the target. As shown in Figure 5, the laboratory was furnished with a few desks, chairs, and PCs to simulate a hospital waiting hall. The due east of the compass in the smartphone was defined as the positive half of the horizontal axis, and the angle was defined to be positive if it was counter-clockwise and negative, otherwise. In order to ensure the signal strength, the smartphone was connected to the 2.4 GHz Wi-Fi. When a user needed to inquire the location, via a smartphone, the user stopped walking and waited to receive the APs' coordinates and their corresponding AoA measurements. With these parameters, the smartphone pinpointed the user's current coordinates, as described in Section 3.

The Impact of the Distance and Direction
In order to investigate the impact of distance and direction on the localization accuracy, we chose a series of positions as the ground truth, which are marked with green squares in Figure 6.
As shown in Figure 6, G 1 to G 7 were located in the same direction, to the center of AP 1 and AP 2 , with a distance increasing from 10 m to 40 m. G 5 , G 8 , G 9 , and G 10 were located in the same distance to the center of AP 1 and AP 2 , and they were in symmetry, with respect to the horizontal or the vertical axis. G 11 to G 15 were random test positions.
The localization results are illustrated in Figure 6. The green squares represent the actual locations of the test positions, and the blue triangles are the estimated locations. Localization was performed for eight times, in every test position, to obtain the statistical outcome, as plotted in Figure 7. One group of the results are listed in Table 1, in which the localization error is the Euclidean distance between the estimated and the actual locations, which was obtained by the following.
where, (x E , y E ) represented the coordinates of the estimated location, and (x A , y A ) were the coordinates of the actual location.    Figure 7 shows that the localization accuracy decreased as the distance increased, despite the fact that the minimum, maximum, median, and the mean values of the location errors fluctuated. However, it is worth noting that the median and mean location errors did not increase monotonically. For example, most estimations at the distance of 15 m or 20 m, had less location errors than those at the distance of 10 m. This phenomenon was not solely caused by a measurement deviation, but mainly resulted from the ignored fact that the target and the APs were located in a three-dimensional space, rather than on a two-dimensional plane. In other words, the APs provided the AoA measurements in a three-dimensional space, which were mixture of the azimuth and elevation. In our calculations, they were regarded as the azimuth angles. From a mathematical point of view, the farther the distance between the target and APs, the smaller the error will be when the three points of different heights were approximated to be on the XOY plane.
As shown in Table 1, it was obvious that location accuracy depended on the AoAs. Another noteworthy phenomenon was that the G 5 , G 8 , G 9 , and G 10 were located, symmetrically, at the same distance to the center of the AP 1 and AP 2 , but their corresponding AoAs errors and location errors were quite different. This was mainly related to the coverage or directionality of the antenna array. Theoretically, an antenna should be isotropic with a uniform spherical coverage. In fact, no antenna could radiate radio waves, equally, in all directions. In addition, the posture that a user holds the smartphone in, to communicate with the APs and the surroundings, contributed to the deviation in the location errors.

Comparison with RSSI Range-Based Method
We repeated the localization using the RSSI range-based method in the positions G 1 to G 7 , in order to make a comparison with our proposed AoA-based method. As only two APs were employed, as described in Section 4.1, we redesigned the RSSI range-based localization scheme as follows: (1) The user held the smartphone and walked up or back toward the AP, ranging from 0 to 50 m, and recorded the measured RSSI at a step size of 0.5 m. (2) The RSSI was fitted a function of the user's distance to the AP, as illustrated in Figure 8.
(3) The user held the smartphone and stood facing the two APs in one of the positions G 1 to G 7 , and recorded the RSSI values, corresponding to the AP 1 and AP 2 . (4) The distances (R 1 and R 2 ) to AP 1 and AP 2 were retrieved, based on the function obtained in (2). (5) The user's location could be estimated by solving the following set of equations: It was obvious that the solutions to Equation (23) were the intersections of the two circles. Two circles were centered on AP 1 and AP 2 , with R 1 and R 2 as the radius, respectively. If the intersection existed, there were usually two solutions to Equation (23), except for the special situation in which there was only one solution, when the two circles were tangent to each other In order to pick the right solution from the two, the blocking effect described in References [44,45] were utilized. As the human body can significantly attenuate Wi-Fi signals (both in 2.4 GHz and 5 GHz frequencies), the RSSI values on the smartphone would vary when the user held smartphone and spun at the location. As shown in Figure 8b, when the user lay between the AP and the smartphone, the direct path was severely blocked, resulting in a large attenuation of the RSSI. With the help of the blocking effect, additional direction information with regard to the APs was obtained, to determine the right solution. Localization was also performed for eight times, in each position, to obtain the statistical result, as plotted in Figure 9, and the comparison with our proposed AoA-based method is given in Table 2.  As shown in Figure 9, a similar phenomenon, as observed in Figure 7, occurred again when the localization accuracy decreased as the distance increased, despite the fluctuating minimum, maximum, median, and mean values of the location errors, which is more intuitional in Table 2. As both localization methods were essentially based on the RSSI information measured in a LOS-dominating environment, it was to be expected that they would have an equivalent location accuracy. However, compared to the solution of the binary quadratic equations in the RSSI range-based method, our proposed AoA-based method was much more efficient, as the calculation only involved a simple tangent function and basic arithmetic operations. Furthermore, the solution was unique in our method, even if only two APs were used for positioning.

Localization Accuracy
We tested the localization accuracy of our proposed algorithm in a more general environment, where the APs were randomly placed on the ceiling and the user wandered around the APs. The results are shown in Figure 10. Figure 11 plots the cumulative distribution function (CDF) of the median localization errors.
As shown in Figure 11, for over 80% of the test positions, localization error was less than 2.5 m.

Conclusions and Discussion
In order to provide room-level localization services for hospital outpatients using their own mobile devices, this paper proposed an efficient AoA-based wireless indoor localization algorithm that uses the coordinates and the angles of the arrival, provided by commercial Wi-Fi access points, to estimate the target's position. Different from the available triangulation or trilateration localization algorithms, which utilize three or more APs and the complicated least square method, the proposed localization algorithm employs only two Aps, at a time, for positioning. All the possible positions in which the target might appear were comprehensively investigated, and the corresponding solutions were proven to be in the same form. Compared to the solution for the binary quadratic equations in the RSSI range-based method, the calculation in our proposed AoA-based method for positioning, only involves a simple tangent function and basic arithmetic operation, which could be efficiently performed on handheld mobile devices, such as smartphones. Two experiments were conducted to evaluate the feasibility and the localization performance. Experimental results showed that localization error was less than 2.5 m, about 80% of the time, in the LOS-dominating environments, which could satisfy the outpatients' needs for wayfinding, in the hospital.
However, the drawbacks were also obvious. The main disadvantage was that the infrastructure cost would be much higher to build a wireless local area network, using the Cisco 4800 series Aps, rather than deploying other conventional APs. The localization algorithm is also mainly designed for the LOS-dominating environments, which confines its application to a certain extent, in real practice. Therefore, further work could be done to improve this localization method.
First, hybrid methods could be explored to tackle the positioning in the NLOS environments. For example, the AoA might be used in conjunction with a ToF. To be more specific, the phase difference between a pair of adjacent antennas is marked with a time stamp, by taking into account the relative flight time of their received incident radio waves. The AoA, which corresponds to the minimum ToF, could be considered to be the AoA representing the LOS path.
Second, the time spent in positioning needs to be reduced for the sake of a better user experience. In other word, the user should be able to keep on walking at a normal pace during the positioning. The AoAs measurement and acquisition could be accelerated by developing specific applications to get rid of the manual operation.
Last, the APs' deployment could be optimized to eliminate the blind points. For example, the APs could be staggered in the corridors or hall. When the target happens to be collinear with the two nearest APs, one of the AP should be replaced by another that is nearby.

Conflicts of Interest:
The authors declare that there is no conflict of interests regarding the publication of this paper.