{'fraction_non_alphanumeric': 0.028173682466025852, 'fraction_numerical': 0.010316539608882996, 'mean_word_length': 5.04937343358396, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
MFPL: Multi-Frequency Phase Difference Combination Based Device-Free Localization

With the popularity of indoor wireless network, device-free indoor localization has attracted more and more attention. Unlike device-based localization where the target is required to carry an active transmitter, their frequent signal scanning consumes a large amount of energy, which is inconvenient for devices with limited energy. In this work, we propose the MFPL, device-free localization (DFL) system based on WiFi distance measurement. First, we combine multi-subcarrier characteristic of Channel State Information (CSI) with classical Fresnel reflection model to get the linear relationship between the change of the length of reflection path and the subcarrier phase difference. Then we calculate the Fresnel phase difference between subcarrier pairs with different spacing from CSI amplitude time series. Finally, we get the change of the length of the reflection path caused by target moving to achieve distance measurement and localization. Using a combination of subcarriers with different spacing to achieve distance measurement effectively broadens the maximum unambiguous distance of the system. To solve the complex non-linear problem of the intersection of two elliptic equations, we introduce Newton's method to transform the non-linear problem into a linear one. The effectiveness of our approach is verified using commodity WiFi infrastructures. The experimental results show our method achieves a median error of 0.87 m in actual indoor environment.


Introduction
Indoor localization systems play an increasingly important role in many emerging applications, such as indoor navigation, body or behavioral analysis, aged care and unobtrusive motion tracking, etc. In past few years, many solutions to indoor localization have been proposed. Most of them need to carry dedicated devices, such as mobile phones Boonsriwai et al. [Boonsriwai and Apavatjrut (2013)] and wearable devices Colombo et al. [Colombo, Fontanelli, Macii et al. (2014)], which bring inconvenience or even inflexibility to applications in some scenarios. For example, in geriatric care, mobile phones or wearable devices are usually reluctant. In anti-theft and anti-terrorism tracking We propose MFPL system, which can measure the change of the length of reflection path caused by target moving. The intuition is that CSI contains abundant subcarrier information, by establishing Fresnel phase model to solve the Fresnel phase difference between subcarriers, high precision measurement of the length of reflection path can be realized, and then the position of target can be determined. To summarize, we have made the following contributions in this work: (1) A distance measurement method based on multi-frequency subcarrier phase difference enlarges the maximum unambiguous distance of the system and improves the distance measurement accuracy.
(2) Empirical mode decomposition (EMD) method is used to realize adaptive de-noising of subcarrier data stream. And Newton's method is introduced to solve the non-linear iterative problem of the intersection of elliptic equations. (3) We conduct comprehensive field studies to evaluate the performance of MFPL.
Experimental results show that using two receivers MFPL achieves a median localization error of 0.87 m in actual indoor environment. The rest of the paper is organized as follows. Section 2 gives the related work. Section 3 describes the system design. Section 4 validates system's performance with the experimental evaluations. The conclusion is drawn in Section 5.

Related work
In this work, we use commodity WiFi infrastructures to achieve distance tracking and target localization. We will discuss the related work in following two groups: distance measurement based on path loss model and distance measurement based on precise time measurement.

Distance measurement based on path loss model
The distance measurement method based on path propagation model is a typical distance measurement method, which is represented by RSSI-based propagation loss model, such systems [Blumrosen, Hod, Anker et al. (2013); Hong and Ohtsuki (2015); Youssef and Agrawala (2008)] calculate the signal propagation distance by receiving RSSI values. Therefore, a precise calibration is necessary to translate power measurements into corresponding distance between each pair of nodes. However, in indoor environments, reflection, multipath propagation, and environmental noise interference may affect propagation loss, causing the result to deviate significantly from true value.

Distance measurement based on precise time measurement
Techniques that use precise time measurements typically include measurements of propagation delay differences and absolute time-of-flight (ToF) measurements, which require additional hardware and require hardware devices to synchronize time to nanoseconds. ToneTrack [Xiong, Sundaresan and Jamieson (2015)] improve time resolution by frequency agility technology. It can calculate flight time difference to obtain distance measurement results, but the implementation process is complex and requires deployment of multiple Access Point (AP). Because of the advantages of bandwidth, many early distance measurement technologies adopted UWB-based technology [Sarigiannidis, Karapistoli and Economides (2015); Tian, Wang and Salcic (2018) ;Gezici, Tian, Giannakis et al. (2005)], but the cost of a single UWB device is high and the transmission distance is limited. If we want to achieve a wide coverage system, the cost will be unbearable. Chronos [Vasisht, Kumar and Katabi (2016)] combines WiFi bandwidth with frequency hopping technology to obtain absolute ToF, while it acquires phase information at subcarrier 0, it is very difficult to implement the underlying modification technology of commodity Network Interface Card (NIC).

System design
In this section, we present detailed design of our DFL system. We first give an overview of the system architecture and then describe each major functional component in detail. As shown in Fig. 2, our system is composed of two main components, namely Preprocessing and parameter calculation. Once we get the distance measurement on multiaccess point (AP), we can locate the target by finding the intersection of multiple ellipses. We use the CSI collected by commodity NIC to measure the change in length of the reflection path caused by device-free target movement. Firstly, we introduce single frequency phase to realize distance measurement. Then, in order to improve the distance measurement accuracy and introduce statistical methods to optimize the results, we propose to use Fresnel phase difference between CSI subcarrier pairs with different spacing sizes to achieve high-precision measurement of the length of reflection path. Considering the complex noise in the original data, the EMD algorithm is employed to achieve signal de-noising.

Distance measurement based on single frequency Fresnel phase
The target appearing in free space will change the length of the reflection path formed by transceiver, and the phase of received signal will change accordingly. The signal at receiver is superposition of multipath signals in the environment [Wang, Liu, Shahzad et al. (2015)], which can be regarded as superposition of all static path signals and dynamic path signals. Then the CSI can be expressed as: π λ represents phase shift caused by the lth dynamic path change, and d P represents the set of dynamic paths. The propagation of electromagnetic signals will form an elliptical electromagnetic induction zone, also known as Fresnel zone [Bruhl, Vermeer and Kiehn (1996) ;Wu, Zhang, Xu et al. (2016)]. When target passes through the Fresnel zone in sequence, the signal power at receiver changes like a sinusoidal waveform [Wu, Zhang, Xu et al. (2016); Wang, Liu, Shahzad et al. (2015)]. Therefore, the received signal power can be expressed as: where ρ is the phase difference between static vector sum and dynamic vector sum, which also called the Fresnel phase difference. For a single subcarrier with wavelength λ , if the length of LOS path and reflection path are 0 d and d , the phase shift after propagation can be expressed as: where f is subcarrier frequency, C represents the speed of light, and γ represents the unknown phase deviation introduced by multipath propagation and ambient noise. As discussed in above formulas, the length of reflection path can be calculated when the LOS distance is known, so we have:

Distance measurement based on multi-frequency Fresnel phase difference 3.2.1 The basic principle of distance estimation
Due to the uncertainties of additional phase deviation in single-frequency Fresnel phase and the susceptibility of measurement results to interference, a distance measurement scheme based on multi-frequency Fresnel phase difference is introduced. For a more general statement, there are two subcarriers whose central subcarrier frequencies are 1 f and ( ) . When they produce same phase shift, the subcarrier with larger frequency has a shorter reflection path and the subcarrier with smaller frequency has a longer one. That is, if the target is located somewhere in space where the length of reflection path is q d , according to Eq. (3), subcarriers with different frequencies will produce different phase shifts. We define the peak sample point difference n ∆ as the sampling point difference between the peak points corresponding to the two subcarrier amplitude time series. By measuring phase difference between two different subcarriers, we can get the length of reflection path of moving target. For two subcarriers with center frequencies 1 f and 2 f , we have the Fresnel phase difference: where λ represents the wavelength corresponding to f , 12 f ∆ is the subcarrier frequency spacing. The length of reflection path q d can be estimated from phase difference observed at two frequencies: In real measurements, the phase difference ρ ∆ is a periodic function with 2π radians while measured phase value by the receiver is ρ ∆ mod ( 2π ) [Vasisht, Kumar and Katabi (2016)], causing the phase observations are wrapped within the range of [ ] 0, 2π , it yields range ambiguity problem. Thus, the true phase difference can be expressed as: = +2m where m is an unknown integer. Therefore, the distance estimate considering the phase ambiguity limit is expressed as: Obviously, when there is no range ambiguity, 2 ρ π ∆ = . At this time, we have a distance where error d represents the distance error, which can be obtained by the average of the difference between the true distance and the measured one from a large number of offline measurements.

Extracting Fresnel phase difference between subcarriers
With the multi-subcarrier characteristics of CSI, we can realize high-precision distance measurement. We find that the core of the problem is to determine Fresnel phase difference between subcarriers, so, we describe how to get Fresnel phase difference between subcarriers from the received CSI. For better description, we divide the calculation of Fresnel phase difference between subcarriers into three steps: 1) calculation of the peak sample point difference n ∆ between subcarriers; 2) calculation of time period T reflected by subcarrier waveforms; 3) determination of Fresnel phase difference between subcarriers.  In order to make sample point difference between subcarriers and corresponding period calculation result more reliable, we use the idea of sliding window to realize the segmentation of CSI amplitude time series. With the inspiration of the method of calculating the time difference between waveforms in harmonic oscillation [Barker, Candan, Hakioglu et al. (2000)], we find that peak sample point difference can be obtained by estimating the similarity of time series between subcarriers. Suppose there are time series of two subcarriers whose wavelengths are a Since subcarrier original signal ( ) , s λ ϕ and noise ( ) i i n λ are uncorrelated and noises are not related to each other, the cross-correlation function between two subcarriers can be simplified as: From the properties of cross-correlation function, when ( ) achieves the maximum value, so peak sample point difference between two signals can be obtained by peak detection of ( ) ab R ϕ ∆ . It is worth noting that the value we get here is the integer sampling point difference n ∆ of the two subcarriers, which need to be converted into a real phase difference with sampling rate s F and period T. In practical applications, we use the Fourier transform of cross-correlation function to get ( ) ab G f can be presented as: where {} ⋅  represents the Fourier transform of signal and ( ) conj ⋅ represents conjugation operation. We have been able to calculate the peak sample point difference between two subcarrier signals. Next, we need to calculate the corresponding period T of time series. We choose discrete Fourier transform (DFT) to get T. In DFT, the frequency corresponding to highest amplitude has the greatest influence on period. Therefore, it is only necessary to find the frequency corresponding to highest amplitude term after Fourier transform to obtain the period ab T . When the corresponding point difference ab n ∆ and period ab T between the two subcarriers are obtained, the corresponding Fresnel phase difference is:

Selection of subcarrier pairs
We aim to use multi-frequency Fresnel phase difference to achieve distance measurement.
Although CSI contains abundant subcarrier information and can provide us up to 30 subcarrier signals, the problem of how to select the appropriate subcarrier pairs is not so arbitrary. There are many noise and multipath interference in real indoor environment, the phase difference calculated by only one pair of subcarriers is often unreliable [Wu, Zhang, Xu et al. (2016)]. Moreover, if we can make full use of multi-subcarrier characteristics of CSI and creatively combine subcarrier pairs with different spacing, we can improve the robustness of algorithm while introducing mathematical statistics to optimize our calculation results. We clearly know that once two subcarriers are selected, a longer reflection path will result in a larger phase difference. And phase difference is only related to the spacing of two frequencies, not subcarrier itself. Therefore, once the position of moving target is fixed, there is a large phase difference between the two subcarriers with a large frequency spacing. This information enables us to choose most suitable subcarrier pairs flexibly. From Eq. (8), the maximum unambiguous distance is inversely proportional to the subcarrier frequency spacing. Selecting a suitable combination of subcarrier pairs, the range of the maximum unambiguous distance can be effectively increased, thereby satisfying the requirement of the ideal measurable distance. Among the 30 subcarriers collected in Intel 5300, the frequency spacing between adjacent subcarriers is 1.25 MHz, and the maximum frequency spacing is 1.25 29 36.25 MHz × = , if the LOS distance 0 d is determined, the range of the reflection path corresponding to 0 8.276 d + and 0 240 d + . In this work, we do not specifically discuss how to solve the unknown integer m, because we can select some combinations of subcarrier pairs according to the ideal measurable distance, so that the smallest unambiguous distance exceeds our ranging range. We can calculate the length of the reflection path within these selected combinations, and ideally the distance measurement value should be stable when the frequency spacing is determined. However, due to the measurement error and the imperfection of hardware, it is considered to introduce Kalman filter [Kalman (1960)] to optimize the phase difference measurement value under each frequency spacing, as shown in Fig. 4. And we use the distance value corresponding to the optimized median phase difference as the distance measurement result under the combination. We can now use standard linear least square method to fit the linear relationship between these phase differences and extract the slope, as shown in Fig. 5, which contains distance information of moving target.

Data sanitization
The CSI streams provided by commodity WiFi infrastructures are extremely noisy [Wang, Liu, Shahzad et al. (2015)]. Fig. 6 plots a noisy CSI stream that we collected from a subcarrier at a sampling rate of 1 kHz. The noise sources of CSI streams are mainly come from hardware imperfections and rich multipath reflections. These factors result in high amplitude impulse and burst noises in CSI streams. EMD has been introduced by Huang et al. [Huang, Shen, Long et al. (1998)] and has been successfully used in many applications in various disciplines ranging from metrology to image analysis [Duffy (2004)]. EMD method is a data analysis method suitable for non-linear and non-stationary processes. Compared with traditional timefrequency analysis methods, EMD is derived from the decomposition itself and is obtained directly from the original object. By decomposing data into a series of intrinsic mode function (IMF), it can truly realize adaptive decomposition based on the data itself.
In this work, we introduce EMD decomposition into the de-noising of CSI stream. Fig.  7(a) plots the waveforms of original signal and each order IMF after EMD decomposition. We carefully choose some IMF to achieve de-noising. We take the Fourier transform of the IMF and find that we can use the broad-spectrum properties of the RF interference spectrum to find out where the RF interference is located, and then take the average amplitude ave A and standard deviation σ of the interference IMF, when the amplitude of the interference is higher than the threshold value ave A kσ + , the amplitude of this part is set to 0, k is usually 2 to 5. Fig. 7(b) plots the signal waveforms before and after EMD decomposition on a subcarrier. The result shows that the noise in subcarrier data stream is effectively removed after EMD decomposition, and the waveform has no deviation from the time axis, which does not affect the operation of solving the peak sample point difference between subcarriers described in Section 3.2.

Target localization
Based on Fresnel phase difference distance measurement method, with only two pairs of transceivers can be arranged in the environment to determine the location of target. By finding the intersection area between two Fresnel zone rings produced by two pairs of WiFi transceivers, moving object's position can be located. On the basis of calculating the length of reflection path corresponding to target by two receivers, two sets of elliptic equations can be obtained by means of general expression of elliptic equation. If we directly find the intersection of two equations, the solving process will be very complicated, because it is a binary quadratic non-linear equation. However, in actual demand of localization, as long as the data fluctuation of location information is within a reasonable accuracy error range, it can be considered that target point has best location estimation. Fortunately, we can often transform non-linear problem into a linear one. We introduce the Newton's iteration method [Meza (2011)] to find approximate root of our non-linear equation.
Since LOS distance 0 d between each pair of transceiver is known, without loss of generality, we denote the locations of transmitter, receiver A, receiver B and target as

Algorithm 1: Target localization algorithm
Inputs：Distance measurement results at APs, LOS distance between transceivers Outputs：Location of the target for 1 10 iteration ∈ → do 3: Establish a binary quadratic equation as shown in Eq. (16) 4: Solving the partial derivatives and establishing the corresponding Jacobian matrix

Experimental evaluation
In this section, we evaluate the performance of our MFPL system for DFL. We first describe the system implementation and experimental setup. We then present detailed experimental results covering overall distance measurement performance and localization performance, as well as the comparisons with other typical systems.

Experiment methodology 4.1.1 Implementation
We employ miniPCs equipped with Intel 5300 NIC as transmitters and receivers. The transmitter has one antenna and broadcasts packets into air. The receiver also has one antenna. We install the CSI toolkit [Halperin, Hu, Sheth et al. (2011)] developed by Halperin on these miniPCs to obtain CSI information for each received packet. The CSI toolkit provides CSI information on 30 subcarriers. Consider reducing interference and obtaining fine-grained Fresnel phase difference between subcarriers in the building, our experiments are conducted in 5 GHz frequency band with 40 MHz bandwidth. Specifically, devices are set to work with monitor mode, on channel 149 at 5.745 GHz. The transmission rate of packets is set to 1 kHz. The processing computer is an ordinary Dell laptop, and processes CSI data using MATLAB.

Evaluation setup
We evaluate the performance of system from two levels, including simulation and actual measurement. In simulation experiment, we simulate target moving to evaluate the distance measurement ability of the algorithm in different directions, including 30 degrees, 45 degrees, and 60 degrees. To verify the performance of system in real environment, we choose a meeting room with a size of 9 7.7 m m × , which is a typical indoor multipath environment. In this scenario, we let a person carry a steel plate moving in a straight line from the origin along all predetermined directions to verify the actual performance of our algorithm. Fig. 8(a) shows the geometrical structure of the testbed and Fig. 8(b) shows the picture of this scene. We make people walking along those predetermined trajectories, so the ground truth is easy to get. We use the absolute difference between the measured value and the real one as an indication of error evaluation.

System performance 4.2.1 Distance measurement accuracy
We use cumulative distribution function (CDF) to show the error, Fig. 9(a) shows simulation distance measurement results under different directions. Overall, MFPL performs well in all directions. Using only a pair of transceivers, MFPL achieves 0.17 m average median error for simulation data with noise, as shown in Fig. 9(b). We can find that in group with smaller initial bistatic angles, the results climbed faster, which is consistent with the properties of classical bistatic Doppler radar [Tsao, Slamani, Varshney et al. (1997)].
(a) Simulation results (b) Distance measurement error Figure 9: Distance measurement results and corresponding errors along different directions in the simulation environment Fig. 10(a) gives the average distance measurement performance of our system. We also compare our system with the state-of-the-art DFL systems LiFS [Wang, Jiang, Xiong et al. (2016)] and DynamicMUSIC [Li, Li, Zhang et al. (2016)]. As shown in Fig. 10(b), we can see MFPL achieves 0.87 m median error, which is comparable to the other two systems. MFPL has a longer tail because of the limited number of transceivers, when target is far away from the AP, the signal-to-noise ratio (SNR) drops rapidly. Although LiFS performs slightly better, it requires at least 11 groups of transceivers. The accuracy of DynamicMUSIC is far superior to the other two, because it declares to be able to estimate the precise AoA of reflection path, more importantly, it ignores the inherent error of 0.5 m caused by human body itself.

Conclusion
In this work, we explore the use of commodity WiFi infrastructures to achieve DFL based on distance measurement. Using linear relationship between the Fresnel phase difference and the change of the length of reflection path, we obtain the length of reflection path of target by fitting the phase difference between subcarrier pairs with different spacing. The simulation result shows with only one pair of transceivers, the median distance measurement error is 0.17 m. In real indoor multipath environment of 70