# A CSI Fingerprint Method for Indoor Pseudolite Positioning Based on RT-ANN
## 2 Indoor Pseudolite Fingerprint Positioning Method
### Positioning Principle  
Pseudolite observational feature fingerprint matching positioning technology is based on the correlation between the original observational information output by the receiver and the indoor physical location. Specifically, positioning is performed by using different signal responses reflected by multi-dimensional observations at different indoor locations. Figure 2 is a schematic diagram of the principle of pseudolite fingerprint positioning. The positioning process is mainly divided into two phases: offline data acquisition and online position calculation. In the offline collection phase, sample collection is performed at the reference point, the feature values of each sample parameter are extracted, and the function mapping relationship between them and the physical reference position is learned to construct a feature fingerprint database. In the online phase, the real-time observations of the receiver are input into the feature fingerprint database, and the positioning result is obtained through matching algorithm [29; 30; 31]. Figure 1: Location specificity and stability of carrier phase difference and \(C/N_{0}\). (**a**) Location specificity and stability of carrier phase difference. (**b**) Location specificity and stability of \(C/N_{0}\). Figure 2: The principle of pseudolite fingerprint positioning. (1) Offline phase  
The correspondence between location and fingerprint is established in the offline phase, as shown in Figure 3. The space area is gridded, and pseudolites are deployed around the service area to ensure that all user receivers can receive the pseudolite signal. At each grid point, the channel observations from each pseudolite receiver are obtained through data sampling over a period of time. The grid point coordinates and the corresponding CSI fingerprints form a fingerprint feature database. This process is sometimes called the labeling stage, and this fingerprint database is sometimes called a signal map. (2) Online Phase  
In the online positioning phase, we compare and calculate the CSI eigenvalues of the to-be-located point with the eigenvalues in the fingerprint database, and obtain a set of closest eigenvalue parameters in the fingerprint database to obtain the corresponding position coordinates, thereby completing the positioning of the receiver. The matching method used in this paper is the nearest neighbor selection method:  
First calculate the Euclidean distance between the feature value group \((F_{1},F_{2},\ldots,F_{n})\) of the point to be located and the reference feature value group in the fingerprint database, the details are as follows:  
\[L_{i}=\sqrt{\sum_{j=1}^{n}\bigl{|}F_{j}-F_{ij}\bigr{|}^{2}} \tag{1}\]  
where \(L_{i}\) is the Euclidean distance between the point to be located and the \(i\)th reference point in the fingerprint database. \(F_{j}\) is the eigenvalue of the \(j\)th dimension in the eigenvalue group of the point to be located, \(F_{ij}\) is the eigenvalue of the \(j\)th dimension of the \(i\)th reference point in the eigenvalue fingerprint database. \(i=1,2,\ldots,m,\ j=1,2,\ldots,n\). Then select \(k(k\geq 2)\) reference points from near to far in \(L_{i}\), the position coordinates of the point to be located can be estimated from these k reference points:  
\[(\hat{x},\hat{y})=\frac{1}{k}\sum_{i=1}^{k}(x_{i},y_{i}) \tag{2}\]  
where \((\hat{x},\hat{y})\) is the estimated coordinate of the point to be located; \((x_{i},y_{i})\) is the coordinate of the \(i\)th point in the \(k\) nearest reference points. The weighted k-nearest neighbor (WKNN) classification algorithm assigns a weight to each nearest neighbor reference point coordinate, the weight value is obtained by Gaussian transformation from the distance \(L_{i}\) between the to-be-located point and the nearest reference point:  
\[W_{ki}=ae^{\frac{(L_{i}-L_{min})^{2}}{2k^{2}}} \tag{3}\]  
Figure 3: Establishment of location fingerprint database.