# A Controlled-Environment Quality Assessment of Android GNSS Raw Measurements
## 2 GNSS Positioning and Basic Performance of Android Smartphones
### Pseudorange Measurements in GNSS Receivers  
Positioning and navigation addressed by radio-navigation technologies, and in particular by GNSSs, concerns the solution to a problem called trilateration to determine time and space co-ordinates of a receiver with regard to a specific reference frame. The location of a GNSS receiver is, hence, expressed in Cartesian co-ordinates within a reference system such as the Earth-Centered Earth-Fixed (ECEF) frame, according to the addressed application. A generic positioning state can be defined as:  
\[\begin{bmatrix}\mathbf{x}(t_{n})\\ b(t_{n})\end{bmatrix}=\begin{bmatrix}x(t_{n})&y(t_{n})&z(t_{n})&b(t_{n})\end{bmatrix}^{T}, \tag{1}\]  
where \(b(t_{n})\) is a biased term due to the clock misalignment of the receiver with regard to the reference time scale of the considered satellite constellation (e.g., GPS, Galileo, GLONASS, Beidou).  
In order to estimate the terms in Reference (1), range measurements from GNSS satellites are collected to solve for the correspondent trilateration problem. Code-based pseudoranges are estimated by the receiver through the measurement of the time-of-flight of the signals from each visible satellite (\(i\in(1,2,...,N)\)) collected as a measurements vector \(\hat{\rho}(t_{n})=\left[\hat{\rho}^{1}(t_{n})\quad\hat{\rho}^{2}(t_{n})\quad \ldots\quad\hat{\rho}^{N}(t_{n})\right]^{T}\). The generic pseudorange measurement, \(\hat{\rho}^{i}(t_{n})\), is typically observed as a random variable due to the nondeterministic impairments affecting the signal (e.g., ionospheric, tropospheric, ephemeris, and relativistic errors) [13]. A raw pseudorange measurement can be defined as:  
\[\hat{\rho}^{i}(t_{n})=||\mathbf{x}(t_{n})-\mathbf{x}_{i}(t_{n})||+c\cdot b(t_{ n})+\Sigma_{\rho}(t_{n}), \tag{2}\]  
where \(\Sigma_{\rho}(t_{n})\) collects all the error contributions affecting the measurement, while the clock bias term, \(b(t_{n})\), is multiplied by the speed of light and is common to all the measurements. Once bias corrections are applied, a corrected pseudorange measurement can be defined as:  
\[\rho^{i}(t_{n})=||\mathbf{x}(t_{n})-\mathbf{x}_{i}(t_{n})||+c\cdot b(t_{n})+ \xi_{\rho}(t_{n}). \tag{3}\]  
Error term \(\xi_{\rho}(t_{n})\) is the User Equivalent Range Error (UERE) that models the independent residual error term left after the corrections [14].  
A Position, Velocity, and Time (PVT) solution can be solved by an iterative Weighted Least-Squares (WLS) approach. At each iteration, the linearized system of the equation can be expressed in vector notation as:  
\[\begin{bmatrix}\Delta\hat{\mathbf{x}}(t_{n})\\ \Delta\hat{b}(t_{n})\end{bmatrix}=(\mathbf{H}^{T}\mathbf{W}\mathbf{H})^{-1}\mathbf{H}^{T}\mathbf{W} \Delta\mathbf{\rho}(t_{n}), \tag{4}\]  
where \(\mathbf{H}\) is an \(N\times 4\) Jacobian matrix referred as the observation matrix or directional cosine matrix, obtained from the known co-ordinates of the observed satellites. \(\mathbf{W}\) is referred as the weighting matrix and it aims at optimizing estimation by exploiting the different qualities of the retrieved pseudorange measurements. There are different techniques to determine the weights. For example, the inverse of the variance of each pseudorange measurement can also be used as other metrics related to the quality of the incoming signals, as explained in the following. With \(b(t_{n})\) being estimated through Equation (4), it can be subtracted from Equation (2) to obtain the final estimate of satellite-to-receiver range \(\bar{r}^{i}=\rho^{i}(t_{n})-c\cdot b(t_{n})\).