% !TEX root = ../toptesi-scudo-example.tex
% !TEX encoding = UTF-8 Unicode
%*****************************************************************
%*********************** Fourth chapter ***************************
%*****************************************************************

%%%%% CHAPTER 4. Android Smartphones Based GNSS %%%%%
\chapter{Android Smartphones Based GNSS}\label{AndroidSmartpohnes_Based_GNSS}

% ********************** Define Graphics Path ********************
    \graphicspath{{Chapter6/}}
%
\par In this chapter a detailed analysis of the performance of GNSS receivers on Android smartphones is provided. The evolution of positioning in smartphones is described and the performances of different smartphones are seen, both in a real environment and in an anechoic chamber environment. Analysis of the results of Android GNSS raw measurements under a completely controlled environment as carried out within the anechoic chamber, had not documented before. Comparisons of position measurements between the anechoic chamber and a real environment reveal the nuances behind the large errors seen in GNSS-only Android positioning solutions. Understanding and mitigating them is vital toward the push to achieve higher performance through such devices. Through the work towards the analysis of android raw measurements several value additions have been made to the open source Google Matlab toolbox \cite{insideGNSSGoogleTool} including multi-constellation, multi-frequency implementation, navigation data demodulation, smoothing and filtering algorithms.

%
\section{Evolution of Positioning in Android Smartphones}\label{Evolution_of_Positioning_in_Android_Smartphones}

\par To support and encourage the rapid innovation trend in GNSS, in 2016 Google made available raw GNSS measurements retrieved from the enabled GNSS chipset for mobile devices. The measurements can be retrieved from the on-board GNSS chipset through Android Application Programming Interface (API) 24 on devices running Android 7+ equipped with enabled chips, thus boosting the improvement of their positioning and navigation performance.
Starting from the availability of raw code pseudoranges and Doppler measurements, developers implemented a bunch of precise positioning algorithms based on such consumer grade GNSS receivers \cite{zhang2018quality, wang2018pedestrian}.
Among these implementations, for instance, Doppler filtering and augmentation have been investigated in \cite{privat2018innovative} to reach sub-meter accuracy. By exploiting carrier-phase observations on the enabled models, it is also possible to smooth code-based pseudorange measurements and reach decimeter-level accuracy without phase ambiguity resolution, as successfully proposed in \cite{realini2017precise}. The recent push to achieve precise positioning from Android smartphones thanks to the availability of their raw measurements has been also boosted by the release of a white paper from the European GNSS Agency (GSA) \cite{gsa2018using}. This allows for a clearer reference of the hardware performances of the devices helping in a more effective integration with other sensors and analysis of multiple GNSS constellations among many other applications. The aforementioned effective examples of improved positioning and navigation capabilities suggest valuable implementations of affordable smartphones GNSS hardware in different contexts.

\par Signal impairments such as multipath, have been seen as the major deterrent in achieving accurate positioning affecting the Carrier to Noise Power Density Ratio ($C/N_0$) up to 10 dB in certain Android devices, largely extending ambiguity resolution time periods and causing cycle slips~\cite{riley2018positioning}.
The problem of cycle slips however, is mostly attributed to the presence of a power saving function known as \textit{duty cycling}, a mode in which the GNSS chip is active only for a fraction of each second \cite{linty2014performance}. While code measurements are unaffected by interrupted signal tracking, the continuity of phase measurements is not achieved, resulting in cycle slips, which make any carrier-phase based processing unusable \cite{humphreys2016feasibility}.
Duty cycle implementation is different in each Android phone and not explicitly declared by the manufacturer, which makes it difficult to distinguish from bad measurements. The option of switching duty cycle off has been implemented in latest Android releases (P),  but wasn't available at the time of conducting this work.

\par To quantify the effects caused by signal impairments in a real environment, it is important to first determine the results of an ideal condition.
In this work, differently from previous performance assessments \cite{dabove2017positioning}, the performances of positioning algorithms based on raw GNSS measurements is investigated in a controlled environment: an anechoic chamber.
The study allowed to determine the quality of the measurements without the presence of multipath and external spurious signals.
The test were performed by means of record and replay technique \cite{cristodaro2018benefits} applied to simulated GNSS signals by means of an IFEN\texttrademark NavX hardware signal generator and constellation simulator. Positioning solutions were evaluated with different carrier-smoothing algorithms to reach high precision and verify the performance of the navigation solutions obtained.

%Afterwards, Section \ref{sec:methodology} describes the two key methodologies employed in the work to assess the quality of measurements in a controlled environment: the carrier smoothing technique and the use of an anechoic chamber.
%Section \ref{sec:results} reports all results and carefully compares the different scenarios.


\section{Performance Analysis of Android GNSS Raw Data}\label{Performance_Analysis_of_Android_GNSSRawData}

\par Following the release of raw GNSS measurements in Android smartphones, it became possible to directly compute pseudoranges and in turn to solve the trilateration problem employing advanced and customized techniques \cite{gsa2018using}. Raw GNSS data can be obtained from any supported phone through the GnssLogger App released by Google, or similar apps available. Subsequently, raw data can be post-processed by implementing a custom software or through the official Google tool. In this work, the GnssLogger App and the Google 'gps-measurement-tools-master' MATLAB open source Toolbox, both available from Android Developers website \cite{gCoGnss} have been used.
The post-processing tool has been forked and upgraded to account for ionospheric and tropospheric delay corrections and to compute carrier smoothed solutions.

\subsection{Real Environment Tests}

\par The raw GNSS data used in this section were collected during a dedicated campaign at Politecnico di Torino premises, on October 19, 2018.
10 minutes of raw GNSS data were stored using the GnssLogger App. L1 C/A signals from GPS constellation were considered.
Three different devices have been used:
\begin{itemize}%[leftmargin=*,labelsep=4mm]
\item Xiaomi MI 8 (single frequency mode) running Android 8, later on denoted {\textbf{MI 8}}
\item	Samsung Galaxy S8 (Exynos 8895) running Android 8, later on denoted {\textbf{S8}}
\item	Huawei P10 running Android 8, later on denoted {\textbf{P10}}
\end{itemize}

\par The position of the phones and of the geo-referenced point are shown in the picture of Figure~\ref{fig:DIATItest}. 
The geo-referenced point is used as reference position for the computation of the error. It has to be noted that although being a roof-top location, an incomplete open-sky view is available, due to some higher buildings in the near surrounding. Some known sky obstructions, as well as some multipath reflections are expected to affect the quality of the data collected.

\begin{figure*}[!hbt]
\centering
\includegraphics[width=0.90\textwidth]{DIATItest.jpg}
\caption{Set-up of the data campaign carried out using smartphones.  The screw indicates the geo-referenced known point.}
\label{fig:DIATItest}
\end{figure*}

%\begin{figure}[H]
%\centering
%\includegraphics[width=0.6\linewidth]{figures/DIATItest_lr}
%\caption{Set-up of the data campaign carried out using smartphones. The screw indicates the geo-referenced known point.}
%\label{fig:DIATItest}
%\end{figure}

\par The GNSS signal strength is commonly evaluated through the $C/N_0$, defined as the ratio between the carrier power ($C$) and the noise power density ($N_0$) \cite{misra2006global}.
The $C/N_0$ is a good indicator of the quality of the signal and of the hardware components of the receiver, such as the antenna \cite{borio2018huber}.
The $C/N_0$ of three GPS satellites, common to all the three devices, was observed: Pseudo Random Noise (PRN) number 18 with the highest elevation ($67^\circ$), PRN number 20 with the lowest elevation ($4^\circ$) and PRN number 14 at a medium elevation ($31^\circ$).
Figure~\ref{fig:basicCNOcomparison} displays the comparison between the $C/N_0$ as measured from the three different devices.
The quality of S8 and MI 8 devices is comparable, at least for the closer satellites, while the P10 device performs worse in all cases.
In the case of PRN 18, the three measurements differ by almost 5 dB.
Furthermore, the S8 shows a more stable $C/N_0$ estimate.
The MI 8 on the contrary has the highest sensitivity, being able to gather measurements from a weaker signal, i.e.~the farthest satellite, with more continuity and stability.

\begin{figure*}[!hbt]
\centering
\includegraphics[width=0.90\textwidth]{basicCNOcomparison.pdf}
\caption{Comparison of the $C/N_0$ of three different satellites (low, medium and high-elevated PRNs), as estimated by the three different devices.}
\label{fig:basicCNOcomparison}
\end{figure*}

%\begin{figure}[H]
%\centering
%\includegraphics[width=0.8\linewidth]{figures/basicCNOcomparison}
%\caption{Comparison of the $C/N_0$ of three different satellites (low, medium and high-elevated PRNs), as estimated by the three different devices.}
%\label{fig:basicCNOcomparison}
%\end{figure}   

\par The comparison can be made also in terms of positioning solution errors.
The position solutions obtained running the Google Toolbox \cite{insideGNSSGoogleTool} are considered after the addition of atmospheric corrections to the toolbox by the authors. For this the Klobuchar ionospheric model using broadcast ephemeris and the Hopfield troposphere model have been implemented.
For a fair comparison, a common subset of satellites has been selected for all the smartphones, including GPS signals with PRN 1, 10, 11, 14, 18, 22, 27, 32.
Even though the data collection was performed simultaneously and at the same location, it is not possible to ensure that all satellites are always in tracking state for all the smartphones and thus to guarantee perfectly equal conditions. However, the appearance and disappearance of some of them is something to be expected considering the different hardware and is indeed very representative of a realistic situation.
For the sake of fairness, all signals which are in tracking state for at least one epoch in all smartphones are considered. Furthermore, PRN 20 was excluded from the analysis given its very low quality, also shown in Figure \ref{fig:basicCNOcomparison}.
Excluding a few outliers, the Horizontal Dilution Of Precision (HDOP) always ranges between the excellent values of 1.1 and 1.3 for all smartphones, with a common slight increasing trend. The impact of the HDOP can then be considered negligible.

\par Figure~\ref{fig:BasicPvtcomparison} compares the horizontal positioning solutions of the three devices and of the reference control point obtained by means of iterative Weighted Least Squares (WLS) approach. %provide equation link after introduction is done
The triangle indicates the average position of the three different models, while the colored points represent all the position solutions along the 10-minutes test.
The covariance ellipses are also depicted by considering the 1-$\sigma$ and 2-$\sigma$ confidence interval of the horizontal joint distribution of the positioning solutions. It can be clearly seen that the Xiaomi MI 8 device outperforms the others, both in terms of accuracy and precision, by almost one order of magnitude.
This is clearer in Figure \ref{fig:BasicNorthEastdiff}, which shows the differences of the North and East coordinates of the devices from the true coordinates.
Mi 8 measurements are at the same time more stable and more accurate, while P10 and S8 measurements lead to errors up to tens of meters.
A significant bias in the North direction is clearly visible on P10 and S8 devices.


\begin{figure*}[!hbt]
\centering
\includegraphics[width=0.90\textwidth]{BasicPvtcomparison.pdf}
\caption{Comparison of the PVT (WLS), as estimated by the three different devices, in a real environment. The true reference position is shown on top, along with the average, the 1-$\sigma$ and the 2-$\sigma$ ellipses for all the three smartphones are shown on top.}
\label{fig:BasicPvtcomparison}
\end{figure*}

%\begin{figure}[H]
%\centering
%\includegraphics[width=0.6\linewidth]{figures/BasicPvtcomparison}
%\caption{Comparison of the PVT (WLS), as estimated by the three different devices, in a real environment. The true reference position is shown on top, along with the average, the 1-$\sigma$ and the 2-$\sigma$ ellipses for all the three smartphones are shown on top.}
%\label{fig:BasicPvtcomparison}
%\end{figure}

\begin{figure}[!hbt]
\centering
  \begin{subfigure}[b]{0.48\textwidth}\includegraphics[width=\textwidth]{BasicNorthdiff.pdf}\caption{North direction}
  \end{subfigure}
  \begin{subfigure}[b]{0.48\textwidth} \includegraphics[width=\textwidth]{BasicEastdiff.pdf}
\caption{East direction}
  \end{subfigure}
  \caption{Errors with respect to the reference position for all the three smartphones under test, in a real environment.}
  \label{fig:BasicNorthEastdiff}
\end{figure}

% \begin{figure}[ht!]
% \centering
%  \subfloat[North direction]
%   {\includegraphics[width=0.45\textwidth]{figures/BasicNorthdiff}%
%   }
%  \subfloat[East direction]
%   {\includegraphics[width=0.45\textwidth]{figures/BasicEastdiff}%
%   }
% \hfill
%   \caption{Errors with respect to the reference position for all the three smartphones under test, in a real environment.}
%   \label{fig:BasicNorthEastdiff}
% \end{figure}

\par Table~\ref{tab:summaryRealData} reports summary data which show the Huawei P10 having the worst performance while the Samsung S8 seems to be slightly better. The MI8 outperforms all the others devices, confirming that the quality of recent GNSS chipsets is higher and in general improving with time.
The vertical positioning performance is poorer compared to the horizontal performance in all the devices.
Indeed, the algorithms used to remove the atmospheric biases are based on empirical models, able to remove in average the 50\% of the delay and thus a residual uncompensated delay might affect the results.
% new values correct {$-17.2\pm37.1$, $-15.8\pm33.1$ and $-7.0\pm7.5$}

\begin{table}[H]
\caption{Statistics of the positioning solutions obtained from smartphones in a real environment.}
\label{tab:summaryRealData}
\centering
\begin{tabular}{@{}ccccccccc@{}}
\toprule
\textbf{Device} &\textbf{CEP (m)} & \multicolumn{1}{c}{\textbf{\begin{tabular}[c]{@{}c@{}}Horizontal \\ RMSE (m)\end{tabular}}} & {\begin{tabular}[c]{@{}c@{}}\textbf{North (m)} \\ $\mu \pm \sigma$ \end{tabular}}  & {\begin{tabular}[c]{@{}c@{}}\textbf{East (m)} \\ $\mu \pm \sigma$ \end{tabular}}      & {\begin{tabular}[c]{@{}c@{}}\textbf{Height (m)} \\ $\mu \pm \sigma$ \end{tabular}}   \\ \midrule
 Huawei P10     & $15.1$ &  $10.6$  & $ 10.4 \pm 12.1 $  & $1.7 \pm 8.9 $ & $-10.0 \pm 37.1 $   \\
 Samsung S8     & $11.4$ &  $ 6.2$  & $ -6.0 \pm 11.1 $  & $1.8 \pm 9.6 $ & $-8.1 \pm 33.1 $   \\
 Xiaomi MI 8    & $3.8$  &  $ 3.3$  & $  3.2 \pm  2.6 $  & $0.8 \pm 2.1 $ & $ 0.0 \pm 7.5 $   \\
 \bottomrule
\end{tabular}
\end{table}

\par The limitations of GNSS code pseudoranges are evident in the results. To draw interesting conclusions it is then necessary to improve the quality of code measurements. On one side, the large noise of code measurements is a limit to high accuracy LBSs in smartphones, in some cases also preventing the possibility to benchmark the real capabilities of smartphones chipsets.
A possible solution is given by signal processing techniques based on measurements smoothing, as described in Section~\ref{sec:Smoothing}.

Furthermore, for professional receivers, open-sky environment is a good scenario, while for mass-market devices, typically equipped with low quality antennas and oscillators, it might still represent a challenging environment.
This motivates the need to perform measurements in a controlled environment such as an anechoic chamber. % as described in Section~\ref{sec:AnechoicChamber}. 

\subsubsection{Smoothing of Code Pseudoranges}\label{sec:Smoothing}

\par Code measurements are unambiguous but noisy; on the contrary, carrier phase measurements are much more precise, but inherently ambiguous and the process to solve for the integer ambiguity is non affordable by mass-market receivers \cite{misra2006global}.
An intermediate solution is based on the combination of code and carrier phase measurements through a process denoted carrier smoothing filtering \cite{petovello2015can, linty2018effects}. The basic code and carrier phase pseudoranges have already been defined in equations \ref{basic_pseudorange} and carrier phase \ref{basic_carrierphase}. For the purposes of this section, let $\rho(t)$ and $\Theta(t)$ be the code and carrier pseudorange respectively. The smoothed pseudorange, at epoch $t_n$ can then be defined by the following finite difference equation:

\begin{linenomath*}
\begin{equation}
\bar{\rho}(t_n) = \frac{1}{L} \rho(t_n) + \frac{L-1}{L} \left[ \bar{\rho}(t_{n-1}) + \Theta(t_n) - \Theta(t_{n-1}) \right]
\end{equation}
\end{linenomath*}
where $L$ is a weight coefficient and $\Theta(t_n) - \Theta(t_{n-1})$, called the \textit{delta pseudorange} added, is obtained by differencing subsequent epochs. As long as no carrier cycle slips occur, the integer ambiguity term is constant and disappears thanks to the difference operation.
\par While the noise term of the code measurement $\rho(t_n)$ is at meter-level, the noise term of the carrier phase measurement $\Theta(t_n)$ is at centimeter-level. Furthermore, if the two measurement epochs are close enough to each other, in the order of a few seconds, the ionospheric delay term can be considered constant and thus disappears in the delta pseudorange. The parameter $L$ controls the weight of the code and carrier contributions. A higher $L$ assures a lower noise variance, but introduces a bias in the smoothed code pseudorange due to the different sign of the ionospheric delay in code and phase measurements, known as code-carrier divergence. Carrier smoothing is indeed a valuable technique to improve the accuracy of the positioning solution in smartphones, which cannot employ pure carrier phase measurements.

\begin{figure}[H]
\centering
\includegraphics[width=\linewidth,trim={2cm 0 2cm 0},clip]{RawVsSmoothed_combined.eps}
\caption{Example of 2nd order derivative of the raw and carrier-smoothed pseudorange measurements for a single GPS satellite and related positioning solutions.}
\label{fig:RawVsSmoothed}
\end{figure}

\par Figure~\ref{fig:RawVsSmoothed} reports a comparison of raw pseudorange measurements and the correspondent smoothed version. The related positioning solution is obtained over 30 min of data. The error with respect to the true position, in East-North coordinates, is plotted on the right. The positioning obtained by exploiting code-based measurements is compared to the solution obtained exploiting carrier smoothing. The smoothing weight $L$ was set to $100$. The accuracy of the results improves by about one order of magnitude when smoothing is enabled. However, the carrier-smoothing measurements are valid as long as the phase measurements are stable and not affected by carrier cycle slips. Impairments on the signal carrier phase can cause cycle slips, errors of one full cycle made by the receiver tracking loop in estimating the phase of the signal. Cycle slip, although being irrelevant for code-based measurements and for the purpose of estimating the carrier Doppler frequency, lead to errors in phase-based and carrier smoothed measurements, and consequently to a degraded positioning performance.
%xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

\subsection{Anechoic Chamber Environment Tests}

\par An anechoic chamber is a testing facility designed to completely absorb Radio Frequency (RF) waves, thanks to the particular shape and material of the walls. Therefore, it can be used to simulate ideal propagation condition. Being isolated from the surroundings, the chamber also reduces the impact of external RF impairments. In addition, the signals transmitted inside are not propagated through the walls, thus avoiding any jamming or spoofing situation while re-playing a GNSS signal.
The anechoic chamber of the Department of Electronics and Telecommunications (DET) of Politecnico di Torino has been used for the test. 
Different Android devices and the GNSS antenna transmitting simulated GNSS signals are clearly visible in the left pictures reported in Figure~\ref{fig:AnechoicChamberSetup}.

\begin{figure}[H]
\centering
\includegraphics[width=0.9\linewidth]{AnechoicChamberSetup.png}
\caption{Anechoic chamber setup: on the left side the receivers are shown, in face-up orientation; on the right side, the transmitting GNSS antenna is shown.}
\label{fig:AnechoicChamberSetup}
\end{figure}   

\par The transmission and reception of GNSS signals was pursued according to the \textit{Record and Replay} paradigm \cite{cristodaro2018benefits}.
A block scheme of the set-up is shown in Figure~\ref{fig:BlockScheme}.
The original transmitted GNSS signals was obtained in a controlled setup as well, exploiting an IFEN\texttrademark NavX professional constellation and hardware signal generator, simulating a static position according to a set of given coordinates.
L1 C/A signals from all the visible satellites belonging to GPS constellation were simulated at RF and then digitized by means of a front-end, connected to the simulator through a wired link.
No receiving antenna was used for the record step, thus avoiding multipath effects due to RF propagation.
Signals were recorded as digitalized raw samples by means of Ettus Research\texttrademark Universal Software Radio Peripheral (USRP) N210 front-end, equipped with a RFX OS364-13 Oven Controlled Crystal Oscillator (OCXO).
The signal acquisition was performed at 5 Msps, at Intermediate Frequency (IF), and at 8 bit/sample for In-phase and Quadrature components to guarantee an adequate replication of the stream.
Binary files were hence stored on an external memory, and then replayed through a second USRP used in transmitting mode, directly in the anechoic chamber.
The system was equipped with a Rubidium atomic clock, to provide a precise timing for the digital to analog conversion of the samples.
Analog signals emitted by the USRP were amplified by a Low Noise Amplifier (LNA) to feed a passive Novatel hemispherical antenna, installed in the anechoic chamber for the transmitting test.
The devices were located on a support aligned to the main axis of the nominal pattern of the transmitting antenna inside the anechoic chamber.
The patch was connected to a u-Blox EVK-M8QCAM benchmark receiver, used to verify the adequacy of power calibration of the transmitting front-end and the actual visibility of the simulated signals (Figure \ref{fig:skyplotAndDOP}).

\begin{figure}[H]
\centering
\includegraphics[width=0.95\linewidth]{BlockScheme.pdf}
\caption{Record and Replay equipment and configuration for controlled experiments.}
\label{fig:BlockScheme}
\end{figure}   

 \begin{figure}[ht!]
 \centering
  \subfloat[Skyplot of simulated satellites]
   {\includegraphics[width=0.40\linewidth]{skyplotCommonSats.pdf}%
   }
  \subfloat[Number of visible satellites and HDOP]
   {\includegraphics[width=0.6\textwidth]{commonDOPplot.eps}%
   }
 \hfill
   \caption{Simulated satellite constellations and related HDOP for record and replay experimental scenarios.}
   \label{fig:skyplotAndDOP}
 \end{figure}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\subsubsection{Results}\label{sec:results}

\par Controlled tests of 10 minute intervals were carried out in the anechoic chamber using the following devices:
\begin{itemize}
\item	Huawei P10 smartphone
\item	Huawei P10 Plus smartphone
\item   HTC Nexus 9 tablet
\end{itemize}
Raw GNSS data were collected by means of the Google GnssLogger App and post-processed using the Google Toolbox.

\subsubsection{Analysis of raw measurements}\label{sec:rawmeasresults}

\par The satellites visibility in all the devices was comparable and raw measurements of 7 GPS L1 signals which were visible throughout the observation period were processed. As an example Figure~\ref{fig:CNo} plots the $C/N_0$ values of GPS PRN 3 for all the Android devices under test.
A similar trend is seen that for all the other visible PRNs.
The $C/N_0$ of both Huawei models is more stable, with standard deviations (STDs) of around 0.08 dB, with respect to the Nexus 9, with around 0.14 dB STD. Nevertheless, the values are 3 dB lower than the latter. Interestingly, the Nexus 9 $C/N_0$ values are also a close match to the reference benchmark receiver. The cause of slight spike in $C/N_0$ value around 320 seconds in the Huawei devices could not be determined and could be due to a manufacturer setting. 

\begin{figure}[H]
\centering
\includegraphics[width=0.9\linewidth]{CNo.pdf}
\caption{$C/N_0$ comparison between Android devices in a controlled environment.}
\label{fig:CNo}
\end{figure}

\par It was seen that on the Huawei models, after $t^*=210$ seconds of the start of logging, the raw measurements deteriorates considerably.
The STDs of the $C/N_0$ before and after this were around 0.04 dB and 0.09 dB respectively.
This deterioration causes a significant difference in measurements.
On observing no change in the \texttt{HardwareClockDiscontinuityCount} parameter (which gives the count of the receiver clock discontinuities \cite{gsa2018using}) of the Google Toolbox output during the entire observation period, it can be assumed that even though the primary TCXO clock is running, the GNSS tracking chipset is turned off. 

\par Figure~\ref{fig:ADRstate_and_pr_ANECHOIC} plots the detrended code pseudorange deviation (lower panel) compared with the \texttt{AccumulatedDeltaRangeState} parameter for GPS PRN 23 (upper panel).
Such a flag indicates whether the range measurements is reset or there is a cycle slip due to a loss of lock \cite{gsa2018using}.
The quality between the code and carrier pseudoranges is compared by calculating their de-trended STDs. For short time spans, de-trended pseudorange measurements can be considered as an ergodic process and are obtained through second order differentiation  \cite{riley2018positioning}.
From the figure, it is seen that there is a failure to achieve ambiguity fix in the Huawei models after $t^*$, but there are no cycle slips before this mark. The pseudorange noise remains within 2 meters for all the PRNs before duty cycle occurs. In the Nexus 9, there are no cycle slips during the 10 minute interval tested and the noise remains within 4 meters. This was observed in all the other available PRNs.
The continuity of high variability detrended pseudorange is due to the switching of clocks when duty cycle occurs \cite{gsa2018using}.
The de-trended code and carrier phase pseudorange STDs of the Huawei devices before the power saving function are within 3 meters and 12 millimeters respectively whereas for the Nexus 9 it is within 6 meters and 13 millimeters. In comparison, the de-trended benchmark receiver code pseudorange STDs are within 1.5 meters.

\begin{figure}[H]
\centering
\includegraphics[width=0.9\linewidth]{ADRstate_and_pr_ANECHOIC.pdf}
\caption{Effect of cycle slips in a controlled environment (PRN 23).}
\label{fig:ADRstate_and_pr_ANECHOIC}
\end{figure}

\subsubsection{Positioning Solutions}\label{sec:PosSol_Anechoic}
\par The positioning solutions were first obtained by directly post-processing the raw measurements through the WLS algorithm in the GNSS Toolbox without implementing atmospheric corrections.
Figure~\ref{fig:S2PlotComparison_Smoot} displays the horizontal 2-dimensional position solutions of the devices with the true position at the origin in the absence (panel \textbf{(a)}) and in the presence of carrier smoothing (panel \textbf{(b)}, while panel \textbf{(c)} is an enlargement of \textbf{(b)}).
Looking at the left sided unsmoothed scatter, there appears to be a bias. This is clearer on the smoothed solution on the right side.
Precision improves for the solution with smoothing as expected, however with a slight decrease in the accuracy as seen from the figure and from Table~\ref{tab:statisticsAnechoic}.
There is also a deviation visible in the smoothed solution of the Huawei devices which was not clear before.

 \begin{figure}[ht!]
 \centering
  \subfloat[Smoothing OFF.]
   {\includegraphics[width=0.32\textwidth]{S2PlotComparison_SmootOFF.pdf}%
   \label{fig:Prn15effectNO}}.
  \subfloat[Smoothing ON with weight $L=50$.]
   {\includegraphics[width=0.32\textwidth]{S2PlotComparison_SmootON.pdf}}%
  \subfloat[Smoothing ON (enlargment).]
   {\includegraphics[width=0.32\textwidth]{S2PlotComparison_SmootON_zoom.pdf}}%
 \caption{Position comparison between devices, in a controlled environment.}
\label{fig:S2PlotComparison_Smoot}
 \end{figure}

\begin{table}[H]
\caption{Statistics of the positioning solutions obtained from smartphones inside the anechoic chamber.}
\label{tab:statisticsAnechoic}
\resizebox{0.99\textwidth}{!}{%
\centering
\begin{tabular}{@{}lcccccc@{}}
\toprule
& \multicolumn{3}{c}{\textbf{Smoothing OFF}} & \multicolumn{3}{c}{\textbf{Smoothing ON}} \\
\midrule
 \textbf{Device} & {\begin{tabular}[c]{@{}c@{}}\textbf{North (m)} \\ $\mu \pm \sigma$ \end{tabular}}  & {\begin{tabular}[c]{@{}c@{}}\textbf{East (m)} \\ $\mu \pm \sigma$ \end{tabular}}      & {\begin{tabular}[c]{@{}c@{}}\textbf{Height (m)} \\ $\mu \pm \sigma$ \end{tabular}} & {\begin{tabular}[c]{@{}c@{}}\textbf{North (m)} \\ $\mu \pm \sigma$ \end{tabular}}  & {\begin{tabular}[c]{@{}c@{}}\textbf{East (m)} \\ $\mu \pm \sigma$ \end{tabular}}      & {\begin{tabular}[c]{@{}c@{}}\textbf{Height (m)} \\ $\mu \pm \sigma$ \end{tabular}}   \\
\midrule
 Huawei P10     & $-3.0\pm2.1$ & $-1.3\pm1.0$ & $-20.1\pm3.4$ & $-2.9\pm0.5$ & $-1.4\pm0.5$ & $-20.2\pm0.6$ \\
 Huawei P10 Plus & $-2.9\pm2.2$ & $-1.2\pm1.0$ & $-20.1\pm3.2$ & $-2.9\pm0.5$ & $-1.3\pm0.5$ & $-19.9\pm0.7$ \\
 Nexus 9 & $-2.8\pm4.8$ & $-1.4\pm2.4$ & $-20.2\pm7.5$ & $-2.8\pm0.4$ & $-1.4\pm0.3$ & $-20.2\pm0.6$ \\
 \bottomrule
\end{tabular}%
}
\end{table}

\par To explore further, Figure~\ref{fig:NorthEastDifferenceA} is reported to see the solutions against time and it is seen that there is an event around $t^*$ after which the stability of the Huawei devices worsens.
This coincides with the duty cycle effect seen in the raw measurements and the comparison of the raw measurements with the positions can be seen in Figure~\ref{fig:huaweiEffect}.
From the figure, it can be established that this event is limited to the Huawei devices and not due to any instability of the signal coming in, as there is no effect seen on the $C/N_0$ or the Nexus 9 device.
Table~\ref{tab:statisticsAnechoic2} details the error and precision before and after the event in the devices and it has to be noted that the North direction is affected the most, as seen from the figures above as well. The big changes in mean and standard deviation of the Huawei devices is evident when compared to the Nexus 9.

\begin{figure}[ht!]
 \centering
  \subfloat[North.]
   {\includegraphics[width=0.49\textwidth]{NorthDifferenceA.pdf}%
   \label{fig:NorthDifferenceA}}.
  \subfloat[East.]
   {\includegraphics[width=0.49\textwidth]{EastDifferenceA.pdf}%
   }
 \caption{Position comparison between devices in a controlled environment.}
 \label{fig:NorthEastDifferenceA}
 \end{figure}


\begin{figure}[H]
\centering
\includegraphics[width=0.9\linewidth]{huaweiEffect.pdf}
\caption{PRN 23 (closest) measurements in the controlled environment, highlighting the change around $t^*=210$ s.}
\label{fig:huaweiEffect}
\end{figure}


\begin{table}[H]
\caption{Statistics of the smoothed positioning solutions obtained from smartphones inside the anechoic chamber, before and after the event.}
\label{tab:statisticsAnechoic2}
\resizebox{0.99\textwidth}{!}{%
\centering
\begin{tabular}{@{}lcccccc@{}}
\toprule
& \multicolumn{3}{c}{\textbf{Before $t^*$}} & \multicolumn{3}{c}{\textbf{After $t^*$}} \\
\midrule
 \textbf{Device} & {\begin{tabular}[c]{@{}c@{}}\textbf{North (m)} \\ $\mu \pm \sigma$ \end{tabular}}  & {\begin{tabular}[c]{@{}c@{}}\textbf{East (m)} \\ $\mu \pm \sigma$ \end{tabular}}      & {\begin{tabular}[c]{@{}c@{}}\textbf{Height (m)} \\ $\mu \pm \sigma$ \end{tabular}} & {\begin{tabular}[c]{@{}c@{}}\textbf{North (m)} \\ $\mu \pm \sigma$ \end{tabular}}  & {\begin{tabular}[c]{@{}c@{}}\textbf{East (m)} \\ $\mu \pm \sigma$ \end{tabular}}      & {\begin{tabular}[c]{@{}c@{}}\textbf{Height (m)} \\ $\mu \pm \sigma$ \end{tabular}}   \\
\midrule
 Huawei P10     & $-2.6\pm0.2$ & $-1.3\pm0.1$ & $-20.2\pm0.2$ & $-3.4\pm0.6$ & $-1.3\pm0.7$ & $-20.1\pm1.1$ \\
 Huawei P10 Plus & $-2.5\pm0.2$ & $-1.3\pm0.1$ & $-20.1\pm0.1$ & $-3.6\pm0.7$ & $-1.1\pm0.8$ & $-20.1\pm1.2$ \\
 Nexus 9 & $-2.8\pm0.4$ & $-1.6\pm0.3$ & $-19.9\pm0.5$ & $-3.1\pm0.4$ & $-1,1\pm0.2$ & $-20.7\pm0.3$ \\
 \bottomrule
\end{tabular}%
}
\end{table}

In the previous Tables~\ref{tab:statisticsAnechoic} and \ref{tab:statisticsAnechoic2}, the bias in the height measurements is around 20 metres and although it is affected by the event and smoothing, it remains high. Applying ionospheric and tropospheric corrections, this reduces to around 6 metres, as a result of non-perfect correction models and generic uncompensated errors.

An important observation during the position measurement analysis was the effect of a low elevation satellite on the position solution.
There was significant deviation seen when including PRN~15 which was visible only partly during the test and this was noticed in all three devices.

Figure~\ref{fig:Prn15effect} shows the effects of such a satellite on the positioning results.
When compared to Figure~\ref{fig:Prn15effectNO}, in which PRN~15 has been excluded, it is clear that both accuracy and precision increase. 

\begin{figure}[H]
\centering
\includegraphics[width=0.75\linewidth]{Prn15effect.pdf}
\caption{Clustering effect due to the presence of a low quality signal (PRN 15), in a controlled environment.}
\label{fig:Prn15effect}
\end{figure}

During the presence of this satellite, there is a shift in mainly the North component as seen in panel \textbf{(a)} of Figure~\ref{fig:LowElevSatelliteEffect}.
Panel \textbf{(b)} depicts a similar low elevation satellite scenario of real environment measurements of P10 and it can be seen that in general such a minor shift should drown out in the noise.

On exploring further it is seen that the problem lies with the use of WLS based PVT algorithm of the Google toolbox while processing the anechoic chamber measurements.
In the toolbox, the quality of measurements is weighted based on the receiver clock uncertainty of an incoming satellite measurement \cite{insideGNSSGoogleTool}. In the anechoic setup of this work, this uncertainty is the same for all satellite measurements due to the replay paradigm through one antenna which makes the weight matrix $W$ an identity matrix in the WLS algorithm, leading to a non-optimized handling of the appearance and disappearance of signals.

\begin{figure}[H]
\centering
    \includegraphics[width=0.9\linewidth]{LowElevSatelliteEffect.pdf}
\caption{Comparison of the positioning results in the presence and in the absence of bad quality measurements.}
\label{fig:LowElevSatelliteEffect}
\end{figure}

%xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

%\section{Further Implementations}\label{Further_AndroidGNSS_Implementations}

%

\vspace{\baselineskip}

