# A New DGNSS Positioning Infrastructure for Android Smartphones
## 3 DGNSS Positioning Infrastructure
### DGNSS Based on NMEA Messages  
Android smartphones provide the standalone position (\(\mathbf{x}_{0}\ =\ (x_{s},\ y_{s},\ z_{s})\)) via the NMEA GGA message. More importantly, the NMEA GSA message provides all satellite IDs that contribute to the standalone position. The DGNSS based on NMEA messages starts from standalone position \(\mathbf{x}_{0}\ =\ (x_{s},\ y_{s},\ z_{s})\), and attempts find the position correction \(\Delta\mathbf{x}_{d}\), such that  
\[\mathbf{x}_{d}\ =\ \mathbf{x}_{0}\ +\ \Delta\mathbf{x}_{d}, \tag{14}\]  
where \(\mathbf{x}_{d}\) is the solution from the range domain DGNSS. In this subsection, we will derive \(\Delta\mathbf{x}_{d}\) using the range domain DGNSS first, and then attempt to represent \(\Delta\mathbf{x}_{d}\) with the known information. As the first step of the iterative least squares method, the approximate range between the satellite and the user can be estimated based on the standalone user position \(\mathbf{x}_{0}\ =\ (x_{s},\ y_{s},\ z_{s})\):  
\[\hat{\rho}_{c}^{i}\ =\ \sqrt{\left(x_{s}\ -\ x^{i}\right)^{2}\ +\ \left(y_{s}\ -\ y^{i}\right)^{2}\ +\ \left(z_{s}\ -\ z^{i}\right)^{2}}\ +\ \hat{b}_{u}. \tag{15}\]  
If we know the pseudorange \(\rho^{i}\), then the observable \(\Delta\rho^{i}\) is obtained as  
\[\Delta\rho^{i}\ =\ (\rho^{i}\ +\ PRC^{i})\ -\ \hat{\rho}_{c}^{i}. \tag{16}\] \begin{table}
\begin{tabular}{c c} \hline \hline
**Position** & **Content and Explanation** \\ \hline
1 & Header of GSA (the prefixes GP, GL, and BD represent GPS, Glonass and Beidou satellites, respectively) \\
2 & Mode (2D, 3D or fix not available) \\
3-14 & Satellite IDs for the position fix \\
15-17 & Dilution of Precision (DOP) values \\ \hline \hline \end{tabular}
\end{table} 
Table 1: GSA sentence content. If more than \(p\) satellites are tracked, then the least-squares position correction \(\Delta\mathbf{x}_{d}\) can be calculated, as done in (8)  
\[\Delta\mathbf{x}_{d}\ =\ \left(\mathbf{G}^{T}\mathbf{W}\mathbf{G}\right)^{-1}\mathbf{G}^{T}\mathbf{W} \Delta\mathbf{\rho}=\ \left(\mathbf{G}^{T}\mathbf{W}\mathbf{G}\right)^{-1}\mathbf{G}^{T}\mathbf{W}(\mathbf{\rho}\ +\ \mathbf{PR}\mathbf{C}\ -\mathbf{\hat{\rho}}_{c}), \tag{17}\]  
where \(\mathbf{G}\) is the design matrix, which can be calculated from the initial user position and satellite positions; \(\mathbf{\rho}\) is the pseudorange measurement, which is not available from the perspective of developers; \(\mathbf{PRC}\) represents the pseudorange corrections from the reference station. As shown in Equation (17), the range-domain DGNSS calculates \(\Delta\mathbf{x}_{d}\) based on the pseudorange measurements, which are not available to Android smartphone developers. However, we can rewrite Equation (17) as follows:  
\[\Delta\mathbf{x}_{d}\ =\ \left(\mathbf{G}^{T}\mathbf{W}\mathbf{G}\right)^{-1}\mathbf{G}^{T}\mathbf{W}[ \left(\mathbf{\rho}\ -\ \hat{\mathbf{1}}\ -\ \hat{\mathbf{T}}\ +\ \hat{\mathbf{B}}\ -\ \hat{\mathbf{\rho}}_{c}\right)\ +\ \left(\hat{\mathbf{1}}\ +\ \hat{\mathbf{T}}\ -\ \hat{\mathbf{B}}\ +\ \mathbf{PR}\mathbf{C}\right)], \tag{18}\]  
where \(\hat{\mathbf{1}}\), \(\hat{\mathbf{T}}\), and \(\hat{\mathbf{B}}\) are estimates of the ionospheric delay, the tropospheric delay, and the satellite clock error with the broadcast messages, respectively. Substituting (7) into (18) gives  
\[\Delta\mathbf{x}_{d}\ =\ \Delta\mathbf{x}_{\rm s}\ +\ \left(\mathbf{G}^{T}\mathbf{W}\mathbf{G} \right)^{-1}\mathbf{G}^{T}\mathbf{W}(\hat{\mathbf{1}}\ +\ \hat{\mathbf{T}}\ -\ \hat{\mathbf{B}}\ +\ \mathbf{PR}\mathbf{C}) \tag{19}\]  
because \(\Delta\mathbf{x}_{s}\) is a very small value (shown in Equation (10)), the position shift \(\Delta\mathbf{x}_{d}\) can be approximated as follows:  
\[\Delta\mathbf{x}_{d}\ \approx\left(\mathbf{G}^{T}\mathbf{W}\mathbf{G}\right)^{-1}\mathbf{G}^{T}\mathbf{W} (\hat{\mathbf{1}}\ +\ \hat{\mathbf{T}}\ -\ \hat{\mathbf{B}}\ +\ \mathbf{PR}\mathbf{C}) \tag{20}\]  
It can be seen from Equation (20) that the position shift can be calculated even if the pseudorange measurements are not provided.