# A Wi-Fi FTM-Based Indoor Positioning Method with LOS/NLOS Identification
## 3 The Proposed Indoor Localization Method
### The Identification Model of LOS/NLOS  
Figure 3 shows the ranging results (the red solid line and the dotted line) and RSSIs (the blue solid line and the dotted line) collected at different distances from FTs under both NLOS and LOS conditions. Here, we have placed Wi-Fi devices in an open corridor and in a closed room, then collected RSSIs and ranging results at 1 m intervals in the corridor. The sampling time was 30 s, the sampling frequency was 5 Hz, and the sampling device was a Pixel 3 mobile phone. The solid line denotes the results from a corridor and the dotted line denotes the results from a closed room. It can be seen that the LOS and NLOS ranging results are similar at any distance, but the RSSIs are quite different. This is due to the principle of electromagnetic wave propagation. RSSIs mainly reflect the amplitude of the electromagnetic wave. When electromagnetic waves travel through walls, some particles will not pass through walls, and the amplitude will significantly reduce, such that the RSSI will also be reduced [38]. The ranging results mainly reflect the time of propagation. When the electromagnetic waves pass through the wall, their speed will decrease. However, due to the small thickness of the wall and the high electromagnetic velocity, the impact on the time of propagation and ranging result is small. Under such conditions, the ranging results are not obvious when compared with those of an RSSI. The LOS/NLOS identification model was designed based on this phenomenon.  
According to Section 2.2, the attenuation of the RSSIs was greatly affected by the conductivity of obstacles. In the complex indoor environment, it is difficult to model the relationship between the distance and RSSI. Therefore, differing from the literature [24; 25; 40], where two models have been  
Figure 3: Ranging results and the received signal strength indicators (RSSIs) of line-of-sight (LOS/NLOS) signals.  
Figure 2: Flow chart of the proposed positioning method. RSSIs, received signal strength indicators; NLOS, non-line-of-sight; LOS, line-of-sight; MT, mobile terminal.  
built under LOS and NLOS conditions, respectively, this paper's identification model was built in the line-of-sight condition, which could output probability with a large difference according to the condition of the signal.  
Most existing works [41; 42; 43] use a Gaussian distribution to model the randomness of RSSI, and consequently, in this paper, a Gaussian model was established to calculate the probability of LOS by Equation (5), as shown in Figure 4. The parameters of the model were determined by ranging results, and the inputs of the model were the RSSIs of the FTs. According to the maximum likelihood method, \(\mu\) is the mean of the RSSI and \(\sigma\) is the variance of the RSSI in Equations (6) and (7), where \(RSSI_{d}^{i}\) is the RSSI collected at the distance d; N is the number of RSSI collected. The determination of \(\mu\) and \(\sigma\) is described below in detail. After the parameters were determined, the probability could be determined by inputting the RSSI into the Gaussian model. Then, the probability was compared with the threshold \(\theta\). If the probability is greater than the threshold, the current signal is a LOS signal, and if it is less than, it is not.  
\[P_{LOS}(RSSI)=\frac{A}{\sqrt{2\pi}\sigma}*exp\left(-\frac{\left(RSSI-\mu\right) ^{2}}{2\sigma^{2}}\right) \tag{5}\]  
\[\mu=\frac{1}{N}\sum_{i=1}^{N}RSSI_{d}^{(i)} \tag{6}\]  
\[\sigma^{2}=\frac{1}{N}\sum_{i=1}^{N}\left(RSSI_{d}^{(i)}-\overline{RSSI_{d}} \right)^{2} \tag{7}\]