## 3 Data Processing and Analysis for Smartphone Real-Time Kinematic (RTK) Positioning
### Data Processing for Smartphone RTK Positioning  
#### 3.1.1 Stochastic Model and Cycle-Slip Detection  
Satellite elevation is conventionally used to determine stochastic models in GNSS data processing. However, [PERSON] et al. [6] found that the accuracy of GNSS observations in smartphones is more correlated with C/N0 than with elevation. Thus, it is more reasonable to use C/N0 to determine the stochastic model. The conventional elevation model and C/N0 model SIGMA-\(\varepsilon\)[24] are, respectively, formulated as follows:  
\[\sigma_{g}^{2}=a_{0}^{2}+\frac{b_{0}^{2}}{\sin^{2}(el)}, \tag{4}\]  
\[\sigma_{S}^{2}=C_{i}\cdot 10^{-\frac{\text{CN0}}{\text{CN0}}}, \tag{5}\]  
where \(\sigma_{g}^{2}\) is the observation variance for the elevation model, \(el\) is the satellite elevation, \(a_{0}\), \(b_{0}\) and \(C_{i}\) are model coefficients, \(\sigma_{S}^{2}\) is the observation variance for the C/N0 model, and CN0 is the C/N0 value. Considering the differences in C/N0 ranges for different frequencies in the smartphone signals, if the C/N0 model is used directly, the L5/E5a frequency weight may be lower than the L1/E1 frequency weight, being contrary to the smaller noise of L5/E5a observations. Therefore, based on the C/N0 stochastic model proposed in [25], we set different thresholds for different frequencies in the model to reduce the impact of differences in dual-frequency C/N0. As the reference station is a geodetic receiver, it uses an elevation model. According to the law of error propagation, the variance of the single-difference observation should be the sum of the variances of the two stations:  
\[\sigma_{S_{L}}^{2}=\left\{ \begin{array}{lcl}a_{0}^{2}\cdot 10^{-(\frac{\text{CN0 -CN0}_{\text{MAX}}}{\text{10}})}&,&\text{CN0}<\text{CN0}_{\text{MAX}}\\ a_{0}^{2}&,&\text{CN0}\geq\text{CN0}_{\text{MAX}}\end{array} \right., \tag{6}\]  
\[{\sigma_{L}}^{2}=\sigma_{g}^{2}+\sigma_{S_{L}}^{2}, \tag{7}\]  
where \(\sigma_{S_{L}}^{2}\) is the observation variance of the smartphone signals, \(L\) denotes the frequency band, \({\sigma_{L}}^{2}\) is the variance of the single-difference observation, and \(\text{CN0}_{\text{MAX}}\) is the maximum C/N0 in the corresponding band. For comparison, we set two types of \(\text{CN0}_{\text{MAX}}\) values for the two frequencies: unified \(\text{CN0}_{\text{MAX}}\) and individual \(\text{CN0}_{\text{MAX}}\). We call the corresponding models unified-CNM model and individual-CNM model. For the unified-CNM model, \(\text{CN0}_{\text{MAX}}\) is set to 40 dB-Hz for all frequencies. For the individual-CNM model, \(\text{CN0}_{\text{MAX}}\) is set to 45 dB-Hz for band L1/G1/B1/E1 and 35 dB-Hz for band L5/E5a according to the statistical values reported above. The positioning performance of the elevation model and the C/N0 models, namely, SIGMA-\(\epsilon\), unified-CNM, and individual-CNM, are evaluated in Section 3.2. Here, we briefly analyse the feasibility of the three C/N0 models. Taking G26 as an example, the variance ratios of bands L1 and L5 (i.e., \(\sigma_{S_{\text{L1}}}^{2}/\sigma_{S_{\text{L5}}}^{2}\)) for the three C/N0 models are shown in Figure 6. For the SIGMA-\(\epsilon\) model, the observation variance in band L1 is lower than that in band L5 (factor of 0-0.4). On the other hand, the observation noise in band L1 is higher than that in band L5 for the Xiaomi Mi 8 measurements [8,22]. Therefore, the SIGMA-\(\epsilon\) model may set counterproductive weights when using bands L1 and L5 simultaneously. For the unified-CNM model, most ratios are lower than 1, while few are higher than 1, which may not lead to optimality. For the individual-CNM model, approximately 67.2% of the ratios are higher or equal to 1, being more promising for optimisation. For cycle-slip detection in data processing, we mainly use the loss-of-lock indicator, Doppler, and code-phase combination methods for joint detection. In addition, we adopt a geometry-free method for dual-frequency observations. The code-phase combination method is greatly affected by the pseudo-range noise.