Fingerprinting-Based Indoor Localization Using Interpolated Preprocessed CSI Phases and Bayesian Tracking

Indoor positioning using Wi-Fi signals is an economic technique. Its drawback is that multipath propagation distorts these signals, leading to an inaccurate localization. An approach to improve the positioning accuracy consists of using fingerprints based on channel state information (CSI). Following this line, we propose a new positioning method which consists of three stages. In the first stage, which is run during initialization, we build a model for the fingerprints of the environment in which we do localization. This model permits obtaining a precise interpolation of fingerprints at positions where a fingerprint measurement is not available. In the second stage, we use this model to obtain a preliminary position estimate based only on the fingerprint measured at the receiver’s location. Finally, in the third stage, we combine this preliminary estimation with the dynamical model of the receiver’s motion to obtain the final estimation. We compare the localization accuracy of the proposed method with other rival methods in two scenarios, namely, when fingerprints used for localization are similar to those used for initialization, and when they differ due to alterations in the environment. Our experiments show that the proposed method outperforms its rivals in both scenarios.


Introduction
The global positioning system (GPS) permits solving the positioning problem in a reliable manner. However, this approach is limited to outdoor environments, since GPS signals do not reach indoor receivers. A number of techniques are available for indoor positioning systems [1,2]. These techniques include the use of ultra-wideband signals [3][4][5], Wi-Fi signals [6][7][8], bluetooth signals [9,10], radio-frequency identification [11][12][13], odometry measurements [14], etc. However, the accuracy of positioning systems based on these techniques is severely affected by the multipath propagation of signals. Therefore, obtaining a high-precision and reliable indoor positioning method has become the main research problem in various location-based services.
A popular technique consists of using Wi-Fi signals for indoor positioning. The main reason for doing so is the widespread and low cost of these signals in comparison with other alternatives, e.g., Zigbee, Bluetooth, ultrasound, ultra-wideband, etc. There are two main approaches for indoor positioning using Wi-Fi signals, namely, geometric mapping and fingerprinting [6]. Geometric mapping is based on the estimation of geometric parameters, such as distance or angles with respect to certain reference points [15,16]. The problem with this approach is, as we mentioned earlier, the irregularities in the signals caused by multipath effects. To go around this, the fingerprint approach builds a database of certain features obtained from the received Wi-Fi signals, depicting a unique pattern based on its location. The positioning problem then becomes one of finding the best match for the signal received at an unknown location from the information available within the database.
For an indoor positioning system, which kind of signal feature is selected as a fingerprint is critical, as it must faithfully represent its location. A popular choice for this feature is a vector of received signal strength indicators (RSSIs) from multiple Wi-Fi access points (APs) [17,18]. Then, the position is estimated as the one from the database with the highest similarity score with the fingerprint of the received signal. The disadvantage of this method is that each location is only matched to one within the database. To solve this, Youssef [19] estimates the position by building its conditional probability given the available measurements. A theoretical backing for this approach is given by the fact that RSSI measurements can be approximately considered normally distributed with negligible accuracy loss [20].
The advantages of using RSSI as fingerprints are its simplicity and low computational requirements. However, since the database only stores signal features at a finite number of points, the accuracy drops significantly at other points. This is because RSSI does not contain all the information available in the Wi-Fi signal, which could be used to improve the positioning accuracy. The whole available information appears in the channel state information (CSI). This is a complex vector whose entries represent the gain (amplitude and phase) of each subcarrier of the OFDM channel [6]. In [21], CSI was used to propose the fine-grained indoor localization (FILA) method. In this method, the fingerprint is chosen to be the square sum of CSI amplitudes. A popular choice of fingerprint consists of using the real vector formed by the amplitudes of each subcarrier [22][23][24]. However, the instability of CSI amplitudes limit the accuracy achievable with this kind of fingerprints. In an attempt to go around this, inter-subcarrier phase differences are used as fingerprints in [25]. A drawback of this approach is that CSI phases are highly sensitive to hardware imperfections. To cope with this, a phase calibration method was proposed in [26] to compensate for hardware effects.
Regardless of the choice of fingerprint, two approaches are available for estimating the position. The first one consists in dividing the area into regions, and using a classifier, based on machine learning techniques, to decide the region at which the receiver is located. In [27], this is done using a neural network, and in [28], a random forest model. A drawback of these methods is that the positioning accuracy is determined by the regions' size.
The second positioning approach aims at solving the above limitation by interpolating a position from those available within the fingerprint database. In [21], this is done using Pearson correlation coefficients between the measured fingerprints at the unknown location and the fingerprints from the database. In [26], this is done using a three-hidden-layer deep network, a deep autoencoder is used in [29,30], a deep convolutional neural networks in [31] and a k-nearest neighbor average in [25]. Nevertheless, a common problem with these methods is that their inaccuracy is still significant at locations outside the database.
For moving targets, the above positioning techniques are used for carrying out a Bayesian tracking task, which uses, at each sample time, all available measurements to provide a position estimate [32,33]. The case in which positioning is based on Wi-Fi signals, the information provided by these signals are often combined (fused) with certain extra information, such as infra-red motion sensors [34], inertial sensors [35], orientation sensors and landmarks [36].
In this work, a new fingerprint method for indoor positioning and Bayesian tracking is proposed, based on CSI. Following [26], we also calibrate phases. However, instead of using them as fingerprints, we use their differences with respect to the first subcarrier. We do so because these phase differences change more smoothly than absolute phases as we move along a straight line. This largely simplifies the task of interpolating fingerprints at locations outside the database. To do the interpolation, we construct a model of the room's fingerprints, i.e., a function mapping positions within the room to fingerprints. We do so using a Gaussian kernel expansion. Using this model, the positioning task is split into two steps. In the first one, we obtain a preliminary estimate of the position using only the fingerprint measured by the receiver. To this end, we use the maximum likelihood criterion. In the second stage, we combine this preliminary estimation with a dynamic model of the receiver's motion, to obtain the final estimation. We do so using a Bayesian tracking technique. The most popular among these techniques are extended Kalman filtering and particle filtering. The advantage of the former is its computational efficiency. However, since it is based on linearizing a non-linear model, it is often inaccurate to the extent that it can lead to the instability of the estimate. Particle filtering, on the other hand, can be made arbitrarily accurate. However, its computational complexity makes it often unfeasible for real-time applications. In order to obtain a reliable and numerically efficient Bayesian tracking implementation, we use a recently proposed technique called maximum likelihood Kalman filtering [37]. It uses the maximum likelihood estimate obtained in the first step, guarantees the stability of the estimate and is asymptotically optimal as the dimension of the fingerprint vector tends to infinity [37]. To summarize, the contribution of our paper is to effectively combine the use of phase information, its calibration and phase differences for fingerprints, and to apply Gaussian kernel modeling and maximum likelihood Kalman filtering for positioning. The resulting algorithm is shown, via experiments, to have more accurate position estimates, in comparison with other available algorithms, at locations outside the database.
The rest of this paper is organized as follows. In Section 2 we describe how we build fingerprints. In Section 3 we formulate the positioning problem. The proposed localization method is introduced in Section 4. Experimental results are given in Section 5 and concluding remarks in Section 6.

Channel State Information
In an OFDM system, the signal received from a multipath channel can be described as where r = [r 1 , · · · , r L ] ∈ C L and s = [s 1 , · · · , s L ] ∈ C L represent the received and transmitted signal vectors, respectively, L is the number of subcarriers, n is additive noise, C = diag(c) ∈ C L×L is the channel frequency response (CFR) matrix, with c = [c 1 , · · · , c L ] and c m denoting the channel's gain at the m-th subcarrier. We call vector c the CSI. According to the 802.11n protocol, this vector is used to recover s from r by equalizing the channel distortion caused by multipaths. Hence, the CSI c is readily available in every OFDM receiver.

Phase Information
The CSI value c m , at each subcarrier m = 1, · · · , L, is a complex number. Most CSI-based fingerprint methods choose amplitudes |c m | as their fingerprints. However, Sen et al. [38] proposed a linear calibration method for the (raw) phase information ∠c m . As we show below, the calibrated phases so obtained are more stable than amplitudes, in the sense that they incur smaller changes between consecutive measurements. We summarize this calibration method below.
We assume that raw CSI measurements c have certain packet-by-packet random phase shifts due to synchronization errors at the receiver. More precisely, let θ m = ∠c m denote the raw phase of the m-th subcarrier and φ m denote the ideal phase that we would have received if there were no random phase shifts. We then have where q denotes the unknown center frequency shift and ∆t denotes the delay due to both, packet detection delay (PDD) and sampling frequency offset (SFO). By l m , we denote the m-th entry of the subcarrier index vector l, and, as above, L is the number of subcarriers. For example, in the 20 MHz bandwidth 802.11n protocol, L = 56 and l = [−28, −27, ..., −2, −1, 1, 2, ..., 27,28] .
In order to compensate for the effects of random phase shifts, we use with Figure 1 illustrates the effect of phase calibration. On the left, we see 100 raw measurements of the CSI at subcarrier m = 1, and on the right, the same CSI measurements with calibrated phases. We see how, after calibration, phases are more stable than amplitudes.

Phase Differences
The calibrated phase is stable at a fixed position. However, it changes drastically from one position to another. This occurs because, theoretically, for a subcarrier at 2.4 GHz, the phase goes through an entire cycle in a wavelength distance (about 12.5 cm). This is much shorter than the distance between positions used to build the fingerprint database. To go around this, instead of using the compensated phases φ m , m = 1, · · · , L, we use their differences ψ m = φ m+1 − φ 1 , m = 1, · · · , L − 1, with respect to the first component, and unwrap them so as to avoid that jumps |ψ m+1 − ψ m |, m = 1, · · · , L − 2, are bigger than or equal to π. This is equivalent to consider that the frequency of the first subcarrier is zero, and the frequencies of each other subcarriers are 312.5 KHz, 625 KHz,..., 20 MHz. Then, the smallest wavelength among these subcarriers becomes (300 × 10 6 m/s)/(20 × 10 6 Hz) = 15 m. Figure 2, shows how phase differences change more consistently than plain phases in a sequence of three points, arranged in a straight line, 0.5 m away from each other.
We use y m , m = 1, · · · , L − 1, to denote the resulting unwrapped calibrated phase differences (UCPDs), and use them as fingerprints for indoor localization.

Problem Description
We consider a room (R 2 ) having A Wi-Fi access points (APs) with B antennas. At time t ∈ N, a receiver, having D antennas, is located at x(t) ∈ R 2 , within the room. The OFDM channel establishing the communication between each AP and each receiver's antenna, has L, subcarriers, whose frequencies are f m ∈ R, m = 1, · · · , L. The UCPD of the m-th subcarrier of the channel from AP a antenna b to receiver antenna d is denoted by y L−1 (t) ∈ R L−1 be the set of all UCPDs of the same channel, y (a,b) (t) = y (a,b,1) (t), · · · , y (a,b,D) (t) be the set of all UCPDs from AP a antenna b and y (t) = y (1,1) (t), · · · , y (A,1) (t), ..., y (1,B) (t), · · · , y (A,B) (t) be the set of all UCPDs. The fingerprint at x(t) is given by y(t) ∈ R N , with N = (L − 1)ABD.
We assume that x(t) and y(t) are generated by the following model: where the state ξ(t) = x (t),ẋ (t) contains the position and velocity of the receiver at time t, F ∈ R 4×4 is the state-transition matrix, w(t) ∼ N (0, Q) is the process noise, ι(t) ∼ N (0, R) is the measurement noise, w(t) and ι(t) are white and jointly independent, and J = [I, 0] , with I being the identity matrix, is a selection matrix such that Jξ(t) = x(t).
We assume that matrices F and Q, as well as the fingerprints y(t) are known. On the other hand, matrix R and the map  : R 2 → R N are not known.

Problem 1.
Based on the above model and assumptions, our goal is to estimate, at each t ∈ N, the receiver's location x(t).

Proposed Positioning Method
The proposed method is formed by three stages. The first one is called initialization. In this stage, we estimate the fingerprint model  : R 2 → R N . The second one (static positioning), uses the estimated model and the output Equation (5) to obtain a first estimatex(t) of the receiver's location x(t), at time t ∈ N, given the fingerprint y(t). In the third stage (dynamic positioning), the estimated locatioň x(t) obtained in the second stage is combined with the dynamic motion model (4) to obtain the final estimationx(t) of x(t).

Fingerprint Modeling
The goal of this stage is to obtain estimates of both, the map h : R 2 → R N and the matrix R ∈ R N×N . To do so, we rely on a collection of points p i ∈ R 2 , i = 1, · · · , I, at each of which K measurements g i,k ∈ R N , k = 1, · · · , K of the fingerprint are available. The ground truth of each p i is known.
It follows from (5) that with ι i,k ∼ N (0, Q) being jointly independent. Letḡ i = 1 K ∑ K k=1 g i,k . We then havē Sinceῑ i ∼ N 0, 1 K Q , for large K we can do the following approximation We can then obtain an estimate of  by approxmating h(p) using a Gaussian kernel expansion of the form where α = [α 1 , · · · , α I ] . Following [39], we choose γ = 1 2 I 1/3 . Then, using (8), we estimate α as followsα Finally, in order to obtain an estimateR of R, we dô

Dynamic Positioning
We aim to use a Bayesian tracking method to estimate ξ(t) based on the model (4), (12), and then obtaining x(t) from the estimated value of ξ(t). In principle, this could be done using the typical approaches for Bayesian tracking, namely, extended Kalman filtering (EKF) and particle filtering (PF). However, since EKF is based on linearizing the non-linear measurement Equation (5), its result is inaccurate and it often causes instability of the estimate. On the other hand, while this problem can be solved using PF, which can be made arbitrarily accurate by using enough particles, the number of required particles makes this method impractical for real-time applications. In order to obtain an accurate and numerically tractable Bayesian tracking implementation, we use a method called maximum likelihood Kalman filter [37]. We summarize it below.

Update
In this case, we assume that ξ(t)|Y(t − 1) ∼ N (µ(t|t − 1), Σ(t|t − 1)), with µ(t|t − 1) and Σ(t|t − 1) known. We aim to compute µ(t|t) and Σ(t|t) such that ξ(t)|Y(t) ∼ N (µ(t|t), Σ(t|t)). In this case, we cannot do a typical Kalman filtering step, because the measurement equation is nonlinear. To go around this, we use the estimatex(t) obtained by the static positioning method described in Section 4.2. More precisely, we compute where with ∇ 2 L t (x) denoting the Hessian of L t evaluated at x (recall thatx(t) is computed from (13)).

Static Positioning
In this section, we will experimentally compare our proposed method with three rival methods, namely, the FILA method [21], the DeepFi method [22] (amplitude-based fingerprinting), and the PhaseFi method [26] (Phase-based fingerprinting), described in Section 1. We use TP-Link WDR4310 routers, having the OpenWrt platform installed, and working at a package rate of 100 packets per second. We obtain CSI measurements from the Atheros CSI Tool [40]. For every AP/receiving antenna pair, this tool produces a complex vector whose entries are the amplitude and phase of certain subcarriers from the IEEE 802.11n standard. More precisely, for a 20 MHz channel, values are available for 56 subcarriers; for a 40 MHz channel, values are available for 114 subcarriers. 10 bits are used to represent both, the real and imaginary parts of each subcarrier's gain. The ground truth position of the receiver is obtained using a motion capture camera, which we believe to be sufficiently reliable for our testing purposes.
We use two experimental setups. The first one is an empty room. This setup permits evaluating the positioning performance of the different methods in the ideal situation in which fingerprints used for positioning are as similar as possible to those used during the initialization stage. The setup is depicted in Figure 3, showing the wireless access point in a corner. The figure also shows the I = 70 positions (marked as initialization points) used as ground truth positions for constructing the fingerprint model. In addition, there are 26 points for testing the static and dynamic positioning algorithms. Figure 4 shows the first entry of the averaged fingerprintsḡ i at each initialization point p i , i = 1, · · · , I, together with the value yield by the estimated modelĥ(p,α).
The second setup is an office including people as well as objects like desks, chairs and lab benches. This setup permits evaluating the robustness of the different methods, in the sense of how the performance deteriorates when fingerprints differ from those used to build the model during initialization. The setup is depicted in Figure 5

Dynamic Positioning
The dynamic positioning method makes use of the state-transition Equation (4). In order to design this state equation, we use the following model where p ζ and v ζ , ζ ∈ {x, y}, denote the position and velocity, respectively, in the ζ axis. We choose T = 1 (seconds). We assume that w x , w y , ι x and ι y are mutually independent, w x ∼ w y ∼ N 0, σ 2 p , with σ 2 p = 10 −4 , and ι x ∼ ι y ∼ N 0, σ 2 ι , with σ 2 ι = 2.5 × 10 −4 . We therefore have To evaluate this performance, we moved the receiver over a trajectory that is well modeled by this equation. This trajectory is shown in red in Figures 8 and 9. Figure 8 shows the trajectory estimated by our static positioning method. Figure 9 shows the one estimated using a particle filter [41], and the one estimated by our proposed dynamic positioning method based on the maximum likelihood Kalman filter. Table 3 shows the maximum tracking errors, as well as their means, given by the three methods. We see that the proposed dynamic positioning method offers a significant accuracy improvement over its static counterpart, as well as over particle filtering. x-direction (m)

Conclusions
We proposed a new fingerprint-based method for indoor localization based on CSI. The proposed method uses unwrapped calibrated phase differences as fingerprints, and consists of three stages. In the first one (fingerprint modeling), a model of the room's fingerprints is constructed. In the second stage (static positioning) we use this model, together with the maximum likelihood criterion, to obtain a preliminary position estimate based only on the fingerprint measured at the receiver. Finally, in the third stage (dynamic positioning), we use a maximum likelihood Kalman filter to combine this preliminary estimate with a dynamic model for the receiver's motion, to obtain the final estimate. We present experimental results comparing the localization accuracy of the proposed method with that of other rival methods. This is done in two scenarios, namely, in the ideal one in which fingerprints used for localization are similar to those used for initialization, and in a more realistic scenario, in which these fingerprints differ due to alterations in the environment. Our experiments show that our method is more accurate than its rivals in both situations.
The proposed three-stage technique also applies to other types of measurements. A future research direction is to find out how much improvement this technique brings to measurements using Bluetooth and ultra-wideband signals. How to fuse different types of measurements, and how much additional improvement this may bring, will be of interest too. The maximum likelihood Kalman filter method that we use in the dynamic positioning stage is only valid if the motion model of the receiver is linear and Gaussian. However, non-linear motion models are sometimes used, particularly in robotics. An extension of the proposed method consists in modifying the dynamic localization stage so as to handle these kinds of non-linear models. While this is out of the scope of the present work, it is a future research direction as well.

Conflicts of Interest:
The authors declare no conflict of interest.