# A CSI Fingerprint Method for Indoor Pseudolite Positioning Based on RT-ANN
## 3 Ray Tracing
### Typical Characteristic Parameters
It is more accurate to use the carrier phase difference considering the influence of the clock difference:  
\[\Delta\rho=\lambda\cdot\bigtriangleup\left(\varphi_{S}-\varphi_{R}\right)=c \cdot TDOA \tag{16}\]  
Since the actually measured carrier phase has the strongest correlation signal after demodulation, the simulated carrier phase also corresponds to the path with the strongest power; thus, Equation (16) can be written as:  
\[P_{i}=\frac{\lambda^{2}\beta}{8\pi\eta_{0}}\big{|}E_{\theta,i}g_{\theta}(\theta _{i},\phi_{i})+E_{\phi,i}g_{\phi}(\theta_{i},\phi_{i})\big{|}^{2} \tag{6}\]0  
The proposed algorithm framework and process are shown in \[P_{i}=\frac{\lambda^{2}\beta}{8\pi\eta_{0}}\big{|}E_{\theta,i}g_{\theta}(\theta _{i},\phi_{i})+E_{\phi,i}g_{\phi}(\theta_{i},\phi_{i})\big{|}^{2} \tag{6}\]1  
For accurate representation of more complex environments, the deterministic simulation parameters of the training data set are added. Since the deterministic modeling process comprehensively considers information such as the layout and material of the building, the environmental characteristics can be described more accurately. On this basis, it is considered to increase the number of hidden layers of the original neural network, so as to attain multi-level abstraction of input features, especially a fully connected Multilayer Perceptron (MLP) between different layers can obtain a more robust channel model. In addition, the forward modeling process based on deterministic computing can just eliminate random factors such as personal factors of testers, errors of the receiver itself, and errors of environmental dynamic changes. The specific implementation steps are described as follows:  
(1) CSI fingerprints collection is performed in the actual environment to obtain the measured values of carrier phase difference and \(C/N_{\theta}\) at relatively sparse test points;  
(2) Modeling the environment based on a 3D map or dimensional material information of the actual environment, and then simulated CSI information such as signal arrival power and arrival delay at relatively dense test points can be calculated by ray tracing. The density of test points can be flexibly set according to the required accuracy. (3) After the simulation data is converted by Equations (12)-(17), it is used as the input of the neural network together with the measured data. (4) The following Algorithms 1 is used for offline model training. The essence of an artificial neural network is to learn by adapting and modifying the weights of internal connections based on the input and desired output. During the learning process, the network can adjust the input parameters by choosing weights and biases with the goal of minimizing the loss function. Different from the past, the training data of this  
\[P_{i}=\frac{\lambda^{2}\beta}{8\pi\eta_{0}}\big{|}E_{\theta,i}g_{\theta}(\theta _{i},\phi_{i})+E_{\phi,i}g_{\phi}(\theta_{i},\phi_{i})\big{|}^{2} \tag{6}\]2 RT-ANN network structure. network is not only the measurement data, but also the simulation data calculated by ray tracing, which expands the sample characteristics of the dataset. The input layer contains two input eigenvectors, the corresponding measurement parameters are \(C/N_{0}\) and carrier phase, and the corresponding simulation parameters are RSS and TOA. The neural network has four hidden layers, the first hidden layer contains 30 hidden neurons, the second layer contains 20 hidden neurons, the third layer contains 10 hidden neurons, the fourth layer contains 8 hidden neurons, the output layer contains two neurons, which are the coordinates \((x,y)\) of the positioning position. During training, the algorithm's accuracy threshold and validation checks have an impact on the training process. The training process terminates once the prediction accuracy is satisfied or the error metric of the test set does not decrease within a certain number of consecutive iterations.