# A Comprehensive Analysis of Smartphone GNSS Range Errors in Realistic Environments
## 2 Methodology  
To calculate the range errors for the smartphone, a collocated geodetic-grade receiver is needed as a reference, for which the range errors can be neglected compared with noisier smartphone measurements. Figure 1 illustrates the receiver sets (\(A\) and \(B\)) mounted on the car and with the tracked satellites \(m\) and \(n\). The range errors can then be generated using measurement-differenced or state-differenced methods. In the measurement-differenced method, double-differencing is conducted with raw observations from two close receivers with consideration of the antenna lever arm correction, while in the state-differenced method, the state terms such as slant ionospheric effect, zenith troposphere delay are derived using the un-combined and un-differenced Precise Point Positioning (PPP) model from the reference receiver and applied to the smartphone as \"true\" values, and then single-differenced state residuals are computed to eliminate receiver-related terms, and hence the range errors are obtained. It should be noted that, due to the differencing procedure, the calculated range errors would be enlarged correspondingly. Figure 1: Illustration of receiver suits on a car and the tracked satellites. The pseudorange measurement \(P\) on \(j\)th frequency for satellite \(m\) at receiver \(A\) can be given as Equation (1):  
\[P_{A,j}^{m}=\rho_{A}^{m}+c(dt_{A}-dt^{m})+I_{A,j}^{m}+T_{A}^{m}+b_{A,j}-b_{j}^{m }+e_{A,j}^{m} \tag{1}\]  
where \(\rho\) denotes the geometry distance between satellite and receiver, \(c\) is the speed of light, \(dt_{A}\) and \(dt^{m}\) are the clock offset for receiver \(A\) and satellite \(m\), respectively. \(I_{A,j}^{m}\) is the slant ionospheric effect in meters on \(j\)th frequency, and \(T\) is the slant troposphere effect in meters. \(b_{A,j}\) is the code hardware delay from the receiver antenna to the signal correlator, and \(b_{j}^{m}\) is the code hardware delay from the satellite signal generator to the satellite antenna. \(e_{A,j}^{m}\) is the measurement noise, which contains the range errors that need to be derived. With another receiver \(B\), the double-differenced pseudorange measurement between receiver \(A\) and \(B\) and satellite \(m\) and \(n\) on \(j\)th frequency can be given as Equation (2):  
\[\
abla\triangle P=(\rho_{A}^{m}-\rho_{A}^{n})-(\rho_{B}^{m}-\rho_{B}^{n})+ \delta I+\delta T+(\epsilon_{A}^{m}-\epsilon_{A}^{n})-(\epsilon_{B}^{m}- \epsilon_{B}^{n}) \tag{2}\]  
where the \(\
abla\) denotes the between-receiver differencing and \(\triangle\) denotes the between-satellite differencing, \(\delta I\) and \(\delta T\) are the ionosphere and troposphere residuals after double-differencing, respectively. For two close receivers whose lever arm is within several meters, the atmospheric delays can be eliminated by performing double-differencing, thus \(\delta I\) and \(\delta T\) can be ignored. With two assumptions, that \((a)\) the range errors for geodetic-grade receiver \(A\) can be ignored compared to those of smartphone \(B\)[44], and \((b)\) the satellite with the highest elevation angle which is chosen as reference satellite when performing between-satellite differencing has significant lower range errors compared to lower-elevation satellites, the measurement-differenced range errors can therefore be derived as Equation (3):  
\[rangerror=\
abla\triangle P-(\rho_{A}^{m}-\rho_{A}^{n})+(\rho_{B}^{m}-\rho_{B }^{n}) \tag{3}\]  
where the geometry distance \(\rho^{m}\) can be given as a function of receiver position \((x,y,z)\) for satellite \(m(x^{m},x^{m},z^{m})\) as Equation (4):  
\[f(x,y,z)=\rho^{m}=((x-x^{m})^{2}+(y-y^{m})^{2}+(z-z^{m})^{2})^{1/2} \tag{4}\]  
In a realistic environment, the lever arm between \(A\) and \(B\) is constant in the vehicle body coordinate system (east, north, and up), and can be transformed to epoch-wised ECEF coordinate system using the approximate position of vehicles.