## 3 Algorithm and Methods
### Path-Loss Model with MVF  
In the ideal free space, the propagation of signal between the transmitter and receiver conforms to Friss model:  
\[P_{r}(d)=\frac{P_{t}G_{t}G_{r}\lambda^{2}}{\left(4\pi d\right)^{2}} \tag{7}\]  
where \(P_{r}\) and \(P_{t}\) are the power of receiving antenna and transmitting antenna in mW, \(G_{r}\) and \(G_{t}\) are the gain of receiving antenna and transmitting antenna. \(d\) is distance between the transmitter and receiver, and \(\lambda\) is wavelength. The power in Equation (8) is expressed in dBm and the reference distance \(d_{0}\) is introduced:  
\[P_{r}(d)=-10\text{log}_{10}\bigg{(}\frac{d}{d_{0}}\bigg{)}^{2}+P_{r}(d_{0}) \tag{8}\]  
where \(P_{r}(d_{0})\) is the receiving antenna power when the distance between the transmitter and receiver is \(d_{0}\).  
Multipath propagation is ubiquitous in indoor positioning environment, and logarithmic path-loss model with path-loss exponent is more suitable, which is expressed as:  
\[P_{r}(d)=-10\alpha\text{log}_{10}\bigg{(}\frac{d}{d_{0}}\bigg{)}+P_{r}(d_{0}) \tag{9}\]  
where \(\alpha\) represents the path-loss exponent, and its value varies with the environment.  
In the offline stage, the secondary synchronization signal data are captured by UE at each reference point, and the noise of the data is removed by [PERSON] filter algorithm. The filtered RSRP in MVF is associated with the distance to train the logarithmic path-loss model:  
\[\text{RSRP}(d)=-10\alpha\text{log}_{10}\bigg{(}\frac{d}{d_{0}}\bigg{)}+C \tag{10}\]  
where \(d_{0}\) is the reference distance, which is set to one meter in this paper, and \(C\) is the average RSRP value at \(d_{0}\).  
In online stage, we easily obtain the distance between the test point and the base station:  
\[d^{{}^{\prime}}=d_{0}\times 10^{\frac{C-\text{RSRP}}{\text{HR}}} \tag{11}\]  
where \(d^{{}^{\prime}}\) represents the distance between the test point and the base station.  
The RSRP measurement in MVF will be affected by multipath propagation to varying degrees. If all reference points in the room are used to train the path-loss model, the positioning accuracy will be reduced. Therefore, we need to find a criterion to filter out those points in a severe multipath environment. According to 3 GPP TS 38.215, RSRP, RSRQ and RSSI satisfy the following equation:  
\[\text{RSRQ}=\frac{N\times\text{RSRP}}{\text{RSSI}} \tag{12}\]  
where \(N\) represents the number of resource blocks in the RSSI measurement bandwidth of the carrier. \(N\) relates the three measurements and reflects the degree that one point is affected by multipath, which will be verified in the experiment section.  
We calculate the \(N\) value of the reference point by Equation (12). If the \(N\) value of the point satisfies the criterion expressed in Equation (13), the point is in a slight multipath environment:  
\[|N-N_{0}|\leq\eta \tag{13}\]  
where \(N_{0}\) is the theoretical true value of \(N\), and usually \(N_{0}=20\) for SSS plus demodulation reference signal (DMRS) of physical broadcast channel (PBCH). \(\eta\) is a threshold varying with different environments. The greater the deviation of \(N\) from \(N_{0}\), the greater the point is affected by multipath. We will choose the point less affected by multipath to train the path-loss model.