Indoor Localization with Wi-Fi Fine Timing Measurements Through Range Filtering and Fingerprinting Methods

Wi-Fi technology has been thoroughly studied for indoor localization. This is mainly due to the existing infrastructure inside buildings for wireless connectivity and the uptake of mobile devices where Wi-Fi location-dependent measurements, e.g., timing and signal strength readings, are readily available to determine the user location. To enhance the accuracy of Wi-Fi solutions, a two-way ranging approach was recently introduced into the IEEE 802.11 standard for the provision of Fine Timing Measurements (FTM). Such measurements enable a more reliable estimation of the distance between FTM-capable Wi-Fi access points and user-carried devices; thus, promising to deliver meter-level location accuracy. In this work, we propose two novel solutions that leverage FTM and follow different approaches, which have not been investigated in the literature. The first solution is based on an Unscented Kalman Filter (UKF) algorithm to process FTM ranging measurements, while the second solution relies on an FTM fingerprinting method. Experimental results using real-life data collected in a typical office environment demonstrate the effectiveness of both solutions, while the FTM fingerprinting approach demonstrated 1.12m and 2.13m localization errors for the 67-th and 95-th percentiles, respectively. This is a two to three times improvement over the traditional Wi-Fi signal strength fingerprinting approach and the UKF ranging algorithm.

Abstract-Wi-Fi technology has been thoroughly studied for indoor localization. This is mainly due to the existing infrastructure inside buildings for wireless connectivity and the uptake of mobile devices where Wi-Fi location-dependent measurements, e.g., timing and signal strength readings, are readily available to determine the user location. To enhance the accuracy of Wi-Fi solutions, a two-way ranging approach was recently introduced into the IEEE 802.11 standard for the provision of Fine Timing Measurements (FTM). Such measurements enable a more reliable estimation of the distance between FTM-capable Wi-Fi access points and user-carried devices; thus, promising to deliver meterlevel location accuracy. In this work, we propose two novel solutions that leverage FTM and follow different approaches, which have not been investigated in the literature. The first solution is based on an Unscented Kalman Filter (UKF) algorithm to process FTM ranging measurements, while the second solution relies on an FTM fingerprinting method. Experimental results using reallife data collected in a typical office environment demonstrate the effectiveness of both solutions, while the FTM fingerprinting approach demonstrated 1.12m and 2.13m localization errors for the 67-th and 95-th percentiles, respectively. This is a two to three times improvement over the traditional Wi-Fi signal strength fingerprinting approach and the UKF ranging algorithm.

I. INTRODUCTION
The ever-increasing demand for location awareness and accurate positioning information in GPS-deprived indoor environments, such as airports and shopping malls, is driving innovation in the area of localization technologies. The ubiquity of Wi-Fi infrastructure inside buildings, along with the need for mobile Internet connectivity and the market penetration of smartphones equipped with Wi-Fi circuitry, inevitably led to the use of Wi-Fi as a viable solution for the provision of reliable location information [1].

While Wi-Fi Received Signal
This work is done jointly in the LuxTurrim5G+ project funded by Business Finland (https://www.luxturrim5g.com/) and the KIOS CoE project supported by the European Union's H2020 research and innovation programme under grant agreement No 739551 and from the Republic of Cyprus through the Directorate General for European Programmes, Coordination and Development. Strength (RSS) measurements have been widely explored for smartphone-based indoor localization [2], recently Wi-Fi vendors are incorporating localization assisting technologies into their devices, both Wi-Fi Access Points (AP) and smartphones, to improve the location accuracy. Interestingly, one of the most promising technologies utilizes the IEEE 802.11-2016 standardized Fine Timing Measurement (FTM) protocol [3].
The FTM protocol allows a proprietary firmware, running in an IEEE 802.11-2016 Wi-Fi card, to derive the Round-Trip Time (RTT), between a Wi-Fi AP and a User Device (UD), e.g., commercial smartphone, and subsequently to compute the distance between those two devices. The RTT is computed based on the timestamp difference between a dedicated FTM transmitted message and its received acknowledgement message (ACK). The FTM process is initiated by a UD after sending an FTM request to an FTM-enabled Wi-Fi AP. The RTT reading is then converted to a ranging (i.e., distance) measurement between two communicating Wi-Fi devices. Subsequently, multiple ranging measurements from Wi-Fi APs in the vicinity can be used to determine the location of the UD, e.g., through standard multilateration positioning algorithms that localize the UD at the intersection of multiple circles each one centered at the location of the corresponding Wi-Fi AP [1]. Considering the improvements in clock resolution of IEEE 802.11-2016 Wi-Fi modules, the Wi-Fi Alliance claims that meter-level ranging accuracy is feasible [4], [5].
Several existing works report high accuracy in FTM-based localization. In most cases, a calibration process is typically applied as a pre-processing step to alleviate the effect of Non-Line-Of-Sight (NLOS) conditions that introduce bias to the measured FTM ranges as opposed to Line-Of-Sight (LOS), while multilateration algorithms are then applied to localize the UD with calibrated FTM ranges. However, to achieve meterlevel accuracy, FTM ranges need to be combined with smartphone sensory data (e.g., accelerometer) and/or Wi-Fi RSS measurements, and some times further processing is applied by means of Bayesian filtering approaches including the Kalman filter, Extended Kalman Filter (EKF), and particle filter (see 978-1-7281-4490-0/20/$31.00 © 2020 IEEE Section II for an extensive literature review). Nonetheless, the well-known Unscented Kalman Filter (UKF) algorithm has not been studied (instead of the EKF algorithm), while the widelyused fingerprinting methods [6] have not been used before with FTM ranges.
To this end, the contribution of this work towards improving the accuracy of Wi-Fi FTM-based localization is three-fold. • We present an UKF approach that processes FTM ranges to determine user location, while preliminary results were reported in [7]. The UKF has not been investigated in this context before, even though existing studies report that the UKF outperforms the EKF in other localization scenarios [8], [9]. • We introduce another localization solution that relies on fingerprints of FTM ranging values. To our knowledge, this is the first work that explores the potential of FTM fingerprinting for indoor localization. • We conduct an experimental evaluation and comparison of the proposed FTM-based localization solutions using real-life data collected in a typical office environment. The rest of the paper is structured as follows. Section II overviews the related works that leverage FTM measurements for indoor localization. Section III presents the proposed FTMbased solutions, namely the UKF ranging and the fingerprinting approaches. Section IV describes the experimental setup and the measurement equipment. Section V evaluates the performance of the proposed solutions using experimental data. Finally, Section VI provides concluding remarks and outlines directions for future work.

II. BACKGROUND & RELATED WORK
Work in this paper addresses indoor mobile phone localisation. To this extent, literature review looks into relevant work, in indoor spaces, to assess positioning accuracy.
Authors in [10] aimed at combining data from Wi-Fi FTM and multiple mobile phone sensors, using a Kalman filter, to form a robust dead reckoning localization algorithm. In that work, as in other cases [4], [5] an initial calibration of Wi-Fi FTM data was performed to minimize the impact of clock deviation and multipath noise. Experimental evaluation included three indoor tests: 1) Multi-pattern-based dead reckoning using multiple sensors, 2) Wi-Fi FTM-based ranging, and 3) integrated FTM and dead reckoning localization using Kalman filter. Position estimates, out of the integrated algorithm, were the most accurate and stable, even in different walking modes, reaching a positioning accuracy of 2 m. In a similar work, a Particle Filter (PF) was used to merge the Pedestrian Dead Reckoning (PDR) with Wi-Fi FTM to overcome the deficiencies of these methods when they are used as standalone solutions [11]. In an indoor experimental study, the PF approach outperformed both FTM and PDR when those were used individually. The PF localization accuracy reached 1 m in 86.7% of the cases when the terminal was moving [11]. In either case, merging FTM with dead reckoning is advantageous as it helps to minimize errors accumulated by multiple sensors over time.
Authors in [4] evaluated Wi-Fi FTM-based ranging and localization algorithms using signals at two different bandwidths (BW), i.e., at 40 MHz for 2.4 GHz signals and at 80 MHz for 5 GHz signals. Calibration measurements along with spatial filtering were used to remove ranging outliers, which allowed a set of "corrected" distances. Indoor localization tests, using trilateration, concluded that corrected distances at higher BW, result in more accurate position estimates. The median error was 3.5 m, in contrast to the lower BW signals with a 4.2 m median error. Localization accuracy depends on the number of APs used, the density of the network, and used BW. The higher BW (i.e., 80 MHz) results in more accurate position estimates, especially in multipath-rich environments. Yet another study looked into FTM-based localization with a varying BW at 40 MHz and 80 MHz [12]. In this case, an EKF was used to locate a Wi-Fi device in an indoor space. Nonetheless, results are presented only for the 80 MHz BW and in this case errors were within 5 m for all tests [12].
A smartphone positioning method based on a hybrid Wi-Fi FTM and RSS ranging was introduced in [5]. The study included analysis of three multilateration ranging methods: 1) Wi-Fi FTM RTT, 2) RSS, and 3) fusion of RSS and FTM RTT using a Kalman filter. Evaluation of all three methods, using calibrated RSS and RTT data, in an indoor space, revealed that the fusion ranging method outperformed the other methods with an average accuracy, in a stationary arrangement at 0.443 m and 0.713 m for a moving device.
In a comparison between multilateration using fusion of ranges, and fingerprinting using signals from non FTM Wi-Fi APs, multilateration was by 57.98% more accurate on average. Similar results were observed in [13], where an offline process was used to differentiate between LOS and NLOS signals during real-time localization. Ranges from NLOS signals were removed from the Least Square (LS) algorithm, thus allowing for more accurate position estimates with an average error of 0.935 m. Following the same principle, work in [14] used only LOS ranges to improve the Weighted Least Squares (WLS) accuracy with an average localization error at 2.3 m.
Our work differs from the above state-of-the-art as we investigate the use of the UKF, instead of the EKF, algorithm to process FTM ranges and explore FTM fingerprinting.

III. POSITIONING ALGORITHMS A. Unscented Kalman Filter (UKF)
Kalman filter is a state estimation method widely used in navigation. In this work, we use an unscented Kalman filter, which is suitable for nonlinear problems such as localization with ranging measurements. The filter implemented in this work for smartphone localization has a state vector x of position and velocity: x The process model of the filter is based on the assumption of constant velocity during an estimation period. Therefore, the x and y positions at time step k are given by: These equations are implemented in the state transition matrix In this constant velocity filter, acceleration is considered as noise. We use a piece-wise white noise model as a discrete presentation of the process noise. The model gives us the process noise matrix while σ 2 v is the assumed variance in each component of the velocity during the time period.
At the startup of the filter, the position states x and y are initialized with the coordinates of the closest Wi-Fi AP in the first set of range measurements, while the velocity states v x and v y are initialized to zero. The error covariance matrix P = diag(σ 2 x , σ 2 v , σ 2 y , σ 2 v ) has the state variances (uncertainties) in the diagonal, and the off-diagonal covariance elements are set to zero.
In the prediction phase of the Kalman filter, the states and their uncertainties are predicted one time step ahead. In the case of a UKF, sigma points X and their weights W m , W c , for mean and covariance, are generated. The sigma points are passed through the state transition function f (x, ∆t) = Fx, which produces a set of transformed sigma points Y = f (X, ∆t). The resulting sigma points are then used to compute the predicted states and covariances by using the unscented transformation: In the measurement update phase, we input a set of n FTM range measurements to the filter in the measurement vector z. The measurements have a level of uncertainty to them, which is defined in the measurement noise covariance matrix R = diag n (σ 2 1 , σ 2 2 , . . . , σ 2 n ) based on calibration measurements. The measurement model is nonlinear, since the calculation of Euclidean distance between the current position state and the AP coordinates includes a square root. This is done with the measurement function, which transforms the sigma points to correspond to the set of range measurements: Next, the mean and covariance of the converted sigma points are calculated as The rest of the measurement update phase proceeds with the following computations: The updated state vectorx is the output of the filter that provides the refined position of the smartphone.

B. Fingerprinting
In the following, we formulate the fingerprinting approach and present the positioning method using RSS and FTM range measurements, respectively.
Traditionally, fingerprinting consists of two phases, namely the offline (training) and the online (localization) phases. In the offline phase, we consider a set of predefined reference locations {L : i = (x i , y i ), i = 1, . . . , l} on a grid that spans the area of interest to collect measurement values from n APs. A reference fingerprint r i = [r i1 , . . . , r in ] associated with location i , is a vector of RSS samples and r ij denotes the RSS value related to the j-th AP. Similarly, a reference fingerprint . . , f in ] is a vector of FTM range samples and f ij denotes the FTM range value related to the j-th AP. Usually, r i and f i are averaged over multiple fingerprints collected at i to alleviate the effect of noise in RSS and FTM measurements, as well as outlier values. The reference fingerprints are stored in a database known as the radiomap. In the online phase, we exploit the data in the radiomap to obtain a location estimate , given a newly observed fingerprint of RSS values s = [s 1 , . . . , s n ] or FTM range values q = [q 1 , . . . , q n ] measured at the unknown user location , using a fingerprinting algorithm.
In this work, we employ the well-known Weighted K-Nearest Neighbor (WKNN) fingerprinting method [15], which computes as the weighted average of the K reference locations i whose RSS (FTM) fingerprints r i (f i ) have the lower distance from the observed fingerprint s (q) in the n-dimensional RSS (FTM) signal space. The WKNN method is formally given by: where w i are non-negative weights calculated as w i = 1/d i and d i denotes the distance between the observed RSS (FTM) fingerprint s (q) and the corresponding RSS (FTM) fingerprint in the radiomap r i (f i ). Essentially, the reference locations i are ordered in increasing value according to d i and the K locations with lower distance are used in eq. 15. The value of K has an impact on the achieved positioning accuracy; choosing a low value may lead to high positioning errors in case of outlier values or if the fingerprints at far locations are similar, while choosing a high value may degrade accuracy as more locations that are not close to the actual user location will be considered.
Regarding the distance function d i , there are different options and for the RSS values we apply the Euclidean distance while for FTM range fingerprints the vectors f i and q with the corresponding values f ij , and q j are used instead. As explained later in Section V, the measurement equipment is capable to take multiple RSS and FTM range measurements from the surrounding Wi-Fi APs at each time step. For RSS values only the mean RSS value is reported, while for FTM range measurements both the mean and standard deviation values are reported. Thus, in this work, we assume that the FTM fingerprints are multivariate Gaussian random variables, i.e., f i ∼ N(f i , Σ f i ) and q ∼ N(q, Σ q ) wheref i andq are the mean value fingerprints for the reference and observed fingerprints, while Σ f i = diag n (σ f ij ) and Σ q = diag n (σ q j ) are the n×n diagonal covariance matrices with standard deviations σ f ij and σ q j for the reference and observed fingerprints, respectively. To this end, distance functions that consider second order statistics can be used to derive the distance between FTM fingerprints. In this work, we employ the Bhattacharyya distance [16] and Kullback-Leibler divergence measure [17] given by: where | · | denotes the determinant of the matrix, tr(·) is the trace of the matrix, n is the dimension of the FTM fingerprints (i.e., number of Wi-Fi APs), and Σ = 1/2(Σ f i + Σ q ).

IV. EXPERIMENTAL SETUP
We collected FTM data in an office environment using an experimental setup with five FTM-enabled Wi-Fi APs, one FTM-capable Android smartphone, and a mobile robot platform for moving the smartphone during data collection. The trial site, the FTM equipment, the measurement collection process and datasets are described in the following.

A. Trial Site
We conducted the data collection campaign in an office building at the Nokia Campus in Espoo, Finland. The measurement area extended over multiple rooms, including a corridor and a lounge, as shown in Fig. 1, while the total area is 310 m 2 . The rooms and open space were furnished, causing both shadowing regions and multipath effects to the signals.

B. FTM Equipment
Five pieces of Compulab FTM Responder (FTMR) APs were installed around the trial site (Fig. 1). FTMR is a compact Linux computer with an Intel Dual Band Wireless AC8260 card that supports FTM. The FTMRs were configured to operate as Wi-Fi APs in the 5 GHz band with 80 MHz channel BW and omnidirectional antennas, with the default transmit power setting. We used a commercial Google Pixel 2 XL smartphone as the initiator of FTM sessions.

C. Measurement Collection Process & Datasets
A mobile robot developed at VTT was used to provide reference locations; see Fig. 2. It acts as a platform to carry multiple measurement devices and to provide a location and timestamp for each measured sample. While being operated with a remote controller, the robot constructs a floor map from its surroundings and localizes itself on the map as a part of Simultaneous Localization And Mapping (SLAM) operation. The robot's positioning accuracy is around 5 cm. It uses a laserscanner, wheel encoders, and ultrasonic sensors for tracking, navigation, and obstacle avoidance. The robot's trajectory is refined using an Adaptive Monte Carlo Localization (AMCL) module.
An Android application was developed for performing range measurements to nearby FTMRs at 500 ms intervals. For every measurement session, the mean and standard deviation of the FTM range values (pertaining to up to 7 attempted measurements in that interval) and the mean RSS values along with the MAC address of each AP were recorded. The dataset for three rounds measured along a route starting next to AP 3 (see Fig. 1) contains 7,699 FTM ranging samples in total from all Wi-Fi APs. In a few locations four APs, instead of five, could be measured due to the walls causing severe signal attenuation. Each sample has a timestamp, the AP identifier (i.e., MAC address), the number of attempted RTT measurements, the number of successful RTT measurements, the mean value and standard deviation of the range in mm (with respect to the number of successful measurements), and the mean RSS value in dBm. The ground truth location from the robot is included in the data to give each sample a reference location for localization accuracy analysis. The coordinates of the APs are also included to be used in the UKF ranging algorithm, as fingerprinting does not require this information.

V. PERFORMANCE EVALUATION
In this section, we consider the UKF algorithm that processes FTM range measurements and the FTM fingerprinting method, and compare them against the traditional RSS fingerprinting approach. We used the data collected in round one as training data to build the corresponding radiomaps for the FTM and RSS fingerprinting methods. Data from rounds two and three were used as test data to assess the performance of these methods.
The performance metric is the positioning error p defined as the Euclidean distance between the estimated and ground truth position, i.e., location accuracy. We present results in terms of the empirical Cumulative Distribution Function (CDF) of p and report the 67 th and 95 th percentile error values, which are commonly used in the indoor positioning industry as key performance indicators.

A. Calibration of FTM Ranging Measurements for the UKF
For the UKF approach, first a calibration of the FTM ranging measurements was performed with the mobile robot by making three round trips along a straight line path in the corridor between AP 3 and AP 4 (dashed line in Fig. 1). The robot had constant LOS to the two APs, while signals from AP 2 were used to study the effects of NLOS conditions.
The calibration results indicated that both the environment and the orientation of the smartphone had an impact on the ranging accuracy. Figure 3 shows the calibration results with AP 2 in partial NLOS conditions. There is an offset (i.e., bias) between the actual distance and the estimated range. A linear regression was fitted to the results, and the equation of the regression line was utilized in a simple NLOS mitigation method with the UKF algorithm. In this method, all range  Fig. 3. Range measurements in partial NLOS conditions. measurements above 10 m were assumed NLOS measurements, thus corrected using the following formula: where d c and d m denote the corrected and measured distances based on FTM samples, respectively.

B. Fine-tuning of the Fingerprinting Method
As mentioned in Section III-B, the parameter K may affect the performance of the fingerprinting WKNN method. We adopt an empirical approach using the collected data to select the optimal value for K depending on the type of measurement (i.e., RSS or FTM), as well as the distance function. Figure 4 illustrates the mean value of p pertaining to the test data for variable K values. The error curve on the left suggests that K = 12 provides the best performance for RSS fingerprinting using the Euclidean distance in the WKNN method. Regarding FTM fingerprints, the error curves on the right indicate that the optimal values are K = 5, K = 9,  Observing the xaxis scale in the RSS and FTM curves, it is clear that the FTM fingerprinting achieves lower p ; this will be further discussed later in Section V-C.
Next, we investigate the performance of the FTM fingerprinting method using different distance functions, assuming the optimal K values obtained above. Figure 5 depicts the CDF error curves for the three distance functions. We observe that d E i attains similar accuracy as d B i and d KL i distances, even though it relies only on first order statistics, i.e., the mean value of FTM range readings. The FTM fingerprinting method that uses d B i is preferable, as it achieves slightly lower p with respect to the 95 th percentile, i.e., 2.13 m, as shown in the zoomed in CDF plot in Fig. 5.

C. Comparison of Positioning Methods
We considered three localization methods namely 1) the conventional RSS-Euclidean fingerprinting method, 2) the FTM-Bhattacharyya range fingerprinting method and 3) UKF that processed FTM range measurements. They represent different types of measurements (e.g., RSS versus FTM fingerprinting) or different approaches to determine position (e.g., FTM fingerprinting versus UKF). The goal was to evaluate their localization accuracy in our experimental setup. Figure 6 illustrates the CDF curves of the positioning error p for the three methods. In particular, RSS fingerprinting relies on the WKNN method with the Euclidean distance d E i and K = 5, while FTM fingerprinting uses the WKNN method with the Bhattacharyya distance d B i and K = 9. The UKF and RSS fingerprinting methods achieve comparable accuracy, as the CDF curves are very close and the 67 th percentile error value is around 2.2 m. However, the UKF approach seems to be more sensitive to deviations or outliers in the FTM ranges, thus high positioning errors (i.e., p > 3 m) are more frequently observed. For instance, the 95 th percentile error values are 6.74 m and 4.07 m, respectively.
In contrast, the FTM fingerprinting method outperforms the other solutions, as shown in Figure 6 (green line). It achieves p = 1.12 m and p = 2.13 m for the 67 th and 95 th percentile errors, respectively. This is 2× and 3× better accuracy compared to the UKF algorithm.
To better understand the behaviors of the FTM fingerprinting method and UKF algorithm, the positioning errors corresponding to the test locations in Round 2 of the test route are depicted in Fig. 7. Black arrows indicate the start and end points of the test route, while red arrows indicate the direction of robot movement. The color bar reflects the positioning error that ranges from low errors (green color), i.e., p < 1 m, to high errors (red color), i.e., p > 5 m. It is evident that the majority of positioning errors using the FTM fingerprinting method are below 2 m, as shown in Fig. 7a. On the other hand, the UKF algorithm suffers from several high positioning errors and there are some segments of the route where errors exceeding 5 m prevail, e.g., bottom right and top left. In the bottom right area, all APs except AP 4 are in NLOS, which leads to significant amount of overestimated range measurements. This causes the Kalman filter to diverge from the true path. The top left area has similar conditions, with LOS only to AP 2. Also, the sudden change of direction is challenging for the constant velocity filter.

VI. CONCLUSIONS
In this work, we investigate the use of Wi-Fi FTM ranging measurements for indoor localization using two diverse approaches. The first one, builds on top of the state-of-the-art solutions and employs a UKF algorithm that processes the FTM measurements to compute location assuming an underlying user mobility model. The second one, goes beyond the state-of-theart and leverages FTM fingerprinting that demonstrated 2×-3× higher accuracy compared to RSS fingerprinting and the UKF algorithm. Future work can utilise a localisation platform, e.g., [18], developed using crowdsourced data collection, to further develop our work using FTM-based phones and APs and a server running the algorithms.
The performance of FTM fingerprinting can be enhanced when coupled with a user mobility model incorporated in a (a) WKNN method with FTM range fingerprints.
(b) UKF algorithm with FTM range measurements. Bayesian filtering algorithm. On the downside, FTM fingerprinting requires considerably more effort to build the radiomap (i.e., fingerprint database) that spans the entire area of interest, compared to the calibration process of the FTM ranging measurements performed in a much smaller area. In addition, the performance of fingerprinting may degrade in areas where fingerprints are sparsely collected or completely missing (e.g., areas that are not accessible by a robot or human collector). In contrast, the application of the UKF approach is straightforward in such cases without significant impact on accuracy.
Interestingly, while FTM fingerprinting attains overall higher accuracy compared to RSS fingerprinting, in some locations the RSS measurements provide lower localization error. Future work will explore the fusion of FTM and RSS measurements, in fingerprinting, whilst also exploring the impact of phone orientation on measurements to further enhance localisation accuracy. In addition, the creation of synthetic fingerprints (e.g., through Gaussian process regression) will be investigated to extend the applicability of fingerprinting beyond the measurement boundaries. Regarding the UKF approach, we plan to incorporate NLOS detection techniques to estimate the bias in the ranging measurements during localization and avoid the calibration overhead prior to localization.