## 3 Data Processing and Analysis for Smartphone Real-Time Kinematic (RTK) Positioning
### Data Processing for Smartphone RTK Positioning
#### 3.1.2 Partial Ambiguity Resolution  
Parameter estimation allows the coordinates (i.e., baseline vector), the ambiguity floating-point solution, and its covariance matrix to be obtained. Then, the integer value \begin{table}
\begin{tabular}{l l} \hline \hline \multicolumn{1}{c}{**Parameter**} & \multicolumn{1}{c}{**Value**} \\ \hline Mode & Kinematic \\ Cut-off elevation & 10\({}^{\circ}\) \\ C/N0 threshold & 20 dB-Hz \\  & elevation + C/N0 \\ Stochastic model & Carrier-phase noise \((a_{0},b_{0})\): 0.003 m \\  & Code-carrier error ratio: 300:1 \\ Cycle-slip detection & Loss-of-lock indicator/Doppler/code-carrier combination \\ Ambiguity resolution mode & Continuous/ fix-and-hold + partial ambiguity resolution \\ Minimum lock to fix ambiguity & 5 \\ C/N0 threshold to fix ambiguity & 30 dB-Hz \\ Ratio threshold to fix ambiguity & 3.0 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Parameter settings for real-time kinematic (RTK) positioning. Figure 6: Variance ratio of bands G26 L1 and L5 for C/N0 stochastic models. of the float ambiguity must be determined to obtain the fixed-coordinate solution with resolved ambiguity. Correct ambiguity resolution is the basis for centimetre-level positioning accuracy [12]. However, the carrier phase acquired by a smartphone is noisy and sensitive to cycle slips, and the float ambiguity shows a poor integer solution [26]. When using the conventional method to fix all the float ambiguities, it may be difficult to pass the ratio test, resulting in the failure of ambiguity resolution. Hence, we only select the part of float ambiguities that have higher accuracy for resolution to improve both the fixing rate and positioning accuracy. This algorithm is called partial ambiguity resolution [19] and is described below. First, we use the least-squares method or a Kalman filter to obtain float baseline \(\hat{a}\) and ambiguity solutions \(\hat{b}\), resulting in the following variance-covariance matrix:  
\[Q=\left[ \begin{array}{cc}Q_{\hat{a}}&Q_{\hat{a}\hat{b}}\\ Q_{\hat{b}\hat{a}}&Q_{\hat{b}}\end{array} \right], \tag{8}\]  
where \(Q_{\hat{a}}\) is the variance matrix of \(\hat{a}\), \(Q_{\hat{b}}\) is the variance matrix of \(\hat{b}\), and \(Q_{\hat{a}\hat{b}}\) and \(Q_{\hat{b}\hat{a}}\) are the covariance matrices of \(\hat{a}\) and \(\hat{b}\). Then, let all the ambiguity vectors be given by \(\hat{b}=[b_{1},b_{2},\cdots,b_{n}]\) and the partial fixed-ambiguity vector be \(\hat{b}_{p}=[b_{1},b_{2},\cdots,b_{ns}]\), whose variance matrix is \(Q_{\hat{b}_{p}}\). The remaining unfixed-ambiguity vector is \(\hat{b}_{f}=[b_{n-ns},b_{n-ns+1},\cdots,b_{n}]\). Next, the integer values of \(\hat{b}_{p}\) are searched using least-squares ambiguity decorrelation adjustment (LAMBDA) [27] to obtain fixed solutions \(\overset{\sim}{b}_{p}\). The baseline solutions can be directly updated according to the correlation between the float baseline vector and fixed ambiguities (i.e., \(Q_{\hat{a}\hat{b}_{p}}\)):  
\[\overset{\sim}{a}=\hat{a}-Q_{\hat{a}\hat{b}_{p}}Q_{\hat{b}_{p}}^{-1}(\hat{b}_{ p}-\overset{\sim}{b}_{p}), \tag{9}\]  
\[Q_{\overset{\sim}{a}}=Q_{\hat{a}}-Q_{\hat{a}\hat{b}_{p}}Q_{\hat{b}_{p}}^{-1}Q_{ \hat{b}_{p}\hat{a}}. \tag{10}\]  
unfixed ambiguity \(\hat{b}_{f}\) can be omitted from the update [19]. Finally, the fixed solutions are obtained. The key to the aforementioned algorithm is to select candidate ambiguity subsets. Therefore, we use the original ambiguity variance and C/N0, that is, LAMBDA is first applied to fix all the float ambiguities whose C/N0 values are greater than a threshold. Then, if the ratio test is passed, the fixed solutions are directly obtained. Otherwise, the ambiguity with the largest variance is excluded, and the remaining ambiguities are fixed again following the procedure above. Next, iterative calculations are performed until the ratio test passes or the number of remaining ambiguities is less than four.