# A New DGNSS Positioning Infrastructure for Android Smartphones
## 2 Background
### Standalone GNSS  
The standalone GNSS employs the navigation messages to correct some errors in Equation (1):  
\[\rho_{c}=\rho-\hat{I}-\hat{T}+\hat{B}, \tag{2}\]  
where \(\rho_{c}\) denotes the corrected pseudorange; \(\hat{I}\) and \(\hat{T}\) are the estimates of the ionospheric delay and the tropospheric delay, respectively; and \(\hat{B}\) is an estimate of the satellite clock error. For the single frequency receiver, \(\hat{I}\) is estimated using various models. One of the examples is the Klobuchar model that removes approximately 50 percent Root Mean Square (RMS) of ionospheric errors, requiring only eight parameters as a part of navigation messages [20]. Furthermore, \(\hat{B}\) in Equation (2) is estimated using the second-order polynomial, and its coefficients are contained in the navigation messages sent to receivers. The corrected pseudorange \(\rho_{c}\) in Equation (2) is a function of a number of unknowns:  
\[\rho_{c}^{i}\ =\ \sqrt{\left(x^{i}\ -\ x_{u}\right)^{2}\ +\ \left(x^{i}\ -\ y_{u}\right)^{2}\ +\ \left(x^{i}\ -\ z_{u}\right)^{2}}\ +\ b\ +\ \varepsilon_{u}^{i}, \tag{3}\]  
where \(i\) is the index for the satellite, \(i\ =\ 1,2\ldots n\), and \(n\) is the number of satellites; \((x_{u},\ y_{u},\ z_{u})\) denotes user position; \((x^{i},\ y^{i},\ z^{i})\) is the position of satellite \(i\), computed from navigation messages; \(\varepsilon_{u}^{i}\) is the residual error. In case of the single constellation GNSS, four measurements are required to determine the receiver position \((x_{u},\ y_{u},\ z_{u})\) and the receiver clock error \(b\). If the number of the satellite constellations is \(s\), then the number of unknowns is \(p\ =\ s\ +\ 3\), and at least \(p\) measurements are required to solve Equation (3) for the unknowns. The iterative least squares method is a conventional method to solve for the unknowns [1]. The first step of the method is to derive the approximate pseudorange \(\hat{\rho}_{c}^{i}\) based on the initial state: \(\mathbf{x}_{0}\ =\ \left(\hat{x}_{u},\ \hat{y}_{u},\hat{z}_{u},\ \hat{b}\right)\)  
\[\hat{\rho}_{c}^{i}\ =\ \sqrt{\left(x^{i}\ -\ \hat{x}_{u}\right)^{2}\ +\ \left(y^{i}\ -\ \hat{y}_{u}\right)^{2}\ +\ \left(z^{i}\ -\ \hat{z}_{u}\right)^{2}}\ +\ \hat{b}. \tag{4}\]  
Next, the corrected pseudorange \(\rho_{c}\) is linearized at the initial state  
\[\rho_{c}^{i}\ =\ \hat{\rho}_{c}^{i}\ +\ g^{i}\Delta x_{s}\ +\ \varepsilon_{u}^{i}, \tag{5}\]where \(g^{i}\) represents the line of sight vector to the satellite \(i\); \(\Delta x_{s}\) is a vector of \(p\) unknown parameters. Equation (5) can also be represented as follows:  
\[\Delta\rho^{i}\ =\ g^{i}\Delta x_{s}\ +\ \varepsilon^{i}, \tag{6}\]  
where \(\Delta\rho^{i}\) is the difference between the corrected pseudorange measurement and the estimated pseudorange:  
\[\Delta\rho^{i}\ =\ \rho_{c}^{i}\ -\ \rho_{c}^{i}.\]  
Having \(n\) pseudorange measurements, the linearization Equation (6) can be written in the matrix form:  
\[\Delta\rho\ =\ \mathbf{G}\Delta x_{s}\ +\ \mathbf{\varepsilon}, \tag{7}\]  
where \(\mathbf{G}\) is a \(n\,\times\,p\) design matrix; \(\mathbf{\varepsilon}\) is the vector of measurement errors. The least-squares solution of Equation (7) is given by  
\[\Delta x_{s}\ =\ (\mathbf{G}^{T}W\mathbf{G})^{-1}\mathbf{G}^{T}W\Delta\rho\ =\ (\mathbf{G}^{T}W\mathbf{G})^{-1}\mathbf{G}^{T}W(\rho\ -\ \hat{\mathbf{1}}\ -\ \hat{\mathbf{T}}\ +\ \hat{\mathbf{B}}\ -\ \hat{\rho}_{c}), \tag{8}\]  
where \(T\) represents the transpose operation of a matrix; \(W\) is the weight matrix. The user position and receiver clock are then updated based on the following equation:  
\[x_{s}\ =\ x_{0}\ +\ \Delta x_{s}, \tag{9}\]  
where the subscript s denotes the standalone GNSS. The magnitude of vector \(\Delta x_{s}\) is compared with an acceptable value \(\xi\) to determine if the iteration aborts:  
\[|\Delta x_{s}|\ <\ \xi, \tag{10}\]  
where \(\xi\) is a small value that determines if the iteration stops. If the requirement in Equation (10) is satisfied, \(x_{s}\) is regarded as the final solution.