## 3 Algorithm and Methods  
### Construction of 5G Observation Image  
Suppose there are a total of \(B\) reference and test points in the positioning area, and the UE captures \(C\) sampling data packets at each point. We express the MVF as the following 5G observation matrix:  
\[M_{b}=\left[\begin{array}{cccc}V_{1}^{1}&V_{1}^{2}&V_{3}^{1}&V_{4}^{1}\\ V_{1}^{2}&V_{2}^{2}&V_{3}^{2}&V_{4}^{2}\\ \ldots&\ldots&\ldots&\ldots&\ldots\\ V_{1}^{C}&V_{2}^{C}&V_{3}^{C}&V_{4}^{C}\end{array}\right],b=1,2,3,\ldots B,c= 1,2,3,\ldots,C \tag{1}\]  
where \(b\) is the index of point while \(B\) is total number of points, and \(c\) is the index of data packets while \(C\) is total number of data packets. The columns represent four radio signal measurements RSRP, RSRQ, RSSI and SINR, respectively, which is expressed as \(V_{1},~{}V_{2},~{}V_{3},~{}V_{4}\), and different rows represent the measurements at different sampling times.  
The original observation matrix needs to be enhanced when the training samples are not sufficient. Traditional data enhancement methods, such as image inversion and scaling [25], will damage the information contained in the feature for positioning. Instead, we use sliding window with small sliding step to enhance the data set to prevent the potential over fitting problem.  
As shown in the Figure 2, the observation matrix and sliding window are expressed as two different matrices. We use a heat map to represent the observation matrix and the color of heat map varies with the measurements. The sliding window matrix is expressed as a rectangle with a red border. CNN usually solves the problem of image classification, which means the traditional fingerprinting database is converted into image before convolution operation. The sliding window slides down the observation matrix to build the observation image. Applying CNN on a time-series of measurements is also expected to reduce the noise and randomness present in separate measurement, and hence improve the positioning accuracy.  
Suppose the sliding window has a size of \(T\times 4\left(T\leq C\right)\), and we group \(T\) sampling of the observation matrix to reconstruct a \(T\times 4\) matrix, which we call 5G observation image:  
\[I_{b}=\left[\begin{array}{cccc}V_{1}^{1}&V_{2}^{1}&V_{3}^{1}&V_{4}^{1}\\ V_{1}^{2}&V_{2}^{2}&V_{3}^{2}&V_{4}^{2}\\ \cdots&\cdots&\cdots&\cdots\\ V_{1}^{t}&V_{2}^{t}&V_{3}^{t}&V_{4}^{t}\end{array}\right],t=1,2,3,\ldots,T,b=1,2,3,\ldots B \tag{2}\]  
where \(t\) is the index of sampling while \(T\) is total row number of the observation image. Therefore, each point will have at least \(C/T\) observation images. The observation images collected at the same point are regarded as samples from the same category for training CNN.  
We set \(T\) to 16, so the size of the observation image is \(16\times 4\). If \(T\) is small, the observation image is too short to capture the time-domain correlation between sample eigenvalues. The larger the sliding window step size is, the less the observation images used for training and the lower the positioning accuracy. The smaller the sliding window step size is, the more the observation images used for training and the longer the training time. Consider a trade-off between the training time and positioning accuracy, we choose the step size of 8, which is half the length of the image.