# Optimizing the Use of RTKLIB for Smartphone-Based GNSS Measurements
## 2 Strategies
### Changes to RTKLIB Settings  
In addition to the RTKLIB code changes, configuration settings can be adjusted to better align with the expected data input, as well as leverage the code changes made [22]. As a starting point, a config file was used from a previous experiment made with some less challenging smartphone observations [23]. This previous experiment worked with data collected by a Xiaomi Mi8 phone and includes additional changes from the f9p_ppk.conf file provided with the demo5 code not discussed in this section, as they are minor and were specifically tuned to that dataset. The important configuration settings used to produce the results presented will be broken down based on whether they were settings for the processing, adjustments to the outputs, or changes made to the statistics. A summary of the changes with respect to the default f9p_ppk.conf demo5 b34e code is provided in Table 1.  
Several changes were made to better accommodate the Google data and perform some simple filtering. First, the positioning mode was set to kinematic, as that is the type of data Google provides for the challenge, and only the GPS, GLONASS, and Galileo constellations were selected for use, as the SLAC station observations used only contain these. Leveraging the ability of the code to use GPS L5 and Galileo E5a, these frequencies were enabled, along with the L1 and L2 frequencies. Settings that were retained from \begin{table}
\begin{tabular}{c} \hline Positioning mode: static -\textgreater{} kinematic \\ \hline GNSS constellations: disable BeiDou \\ \hline Enable L5/E5 frequency: L1 + L2/E5b -> L1 + L2/E5b + L5/E5a \\ \hline Filter Type: Combined -> Combined—no phase reset \\ \hline SNR Mask L1/L5 (dB-Hz): 35/0 -> 24/24 \\ \hline Integer Ambiguity Res: on -> off \\ \hline Cycle Slip Threshold: Geometry-Free: 0.05 -> 0.10 \\ \hline Cycle Slip Threshold: Doppler: N/A -> 5.0 \\ \hline Innov (m): 2 -> 1 \\ \hline Time Format: hns -> tow \\ \hline Phase Error Ratio L5: 300 ->100 \\ \hline Carrier Phase Bias: 0.0001 -> 0.01 cycles \\ \hline \end{tabular}
\end{table} 
Table 1: Summary of changes to the demo5 b34 eRTKlib code default settings file f9p_ppk.conf. the previous smartphone experiment to filter out some of the lowest quality observations included a 15 degree elevation mask, and a 24 dB-Hz C/N\({}_{0}\) filter. Although this level of C/N\({}_{0}\) is low for decent carrier phase measurements, as RTKLIB does not support separate thresholds for carrier and code, this value was selected to preserve the acceptable code measurements. Furthermore, this threshold was not an assessment of absolute signal quality, but a means to exclude the tail of the distribution. In addition, this is a higher threshold compared to the 20 dB-Hz used by Google in their code-only positioning for the baseline solutions. The solution was run in combined no phase reset mode, which includes running the Kalman filter over the data in both the forward direction and the backwards direction, then combining the results without resetting the ambiguity estimates between the two directions. Continuing with more settings, first, the ambiguity resolution was disabled, as errors within the dataset were too large to resolve consistently, resulting in false fixes and degrading overall solution quality. With the doppler slip now enabled in the RTKLIB code, it could be used, along with geometry-free detection and outlier detection, to identify slips in the carrier. The geometry-free slip threshold was 0.05 m by default, but this was deemed too small to account for the larger errors present in the datasets, so the value was increased to 0.1 m. The doppler slip threshold was set to 5 Hz. The final changes made to the RTKLIB configuration file revolved around the output and the statistics of those outputs. The output configuration showed no changes, other than to change the time format, which was switched to \"www ssss GPST\", which is much closer to the format Google expects in the submitted results.