1 Introduction

In ‘Google I/O of 2016,’ the Global Navigation Satellite Systems (GNSSs) raw data (including pseudorange, phase and Doppler) is released to developers from smart devices with Android-N operating system (European GNSS Agency 2017). The availability of raw data provides more opportunities in the booming location-based service (LBS) markets, allowing the users to carry out their positioning campaigns with flexible positioning modes in terms of their specific accuracy demands (Banville and Diggelen 2016). For instance, one can implement the pseudorange-based single point positioning (Shin et al. 2017; Geng et al. 2018; Robustelli et al. 2019), phase-based real-time kinematic (RTK) (Realini et al. 2017; Darugna et al. 2019; Li and Geng 2019) or precise point positioning (PPP) (Gill et al. 2017; Elmezayen and El-Rabbany, 2019; Wu et al. 2019; Aggrey et al. 2019; Psychas et al. 2019) for the meter- to centimeter-accuracy LBS. With the growing demands for smartphone precise positioning, the researchers started to focus more on phase-based precise positioning techniques (European GNSS Agency 2019; Darugna et al., 2019; Zangenehnejad and Gao, 2021). The correct integer ambiguity resolution (IAR) is the key issue to achieving precise positioning with carrier phase observations. In a short-baseline positioning mode where the atmospheric biases are basically eliminated, the success of IAR depends mainly on two factors. One is the integer property of ambiguity that is a prerequisite for IAR, while the other is the data quality that affects the ambiguity precision (Amiri-Simkooei et al. 2016; Li 2016).

For the phase observations in smartphones, the integer property of ambiguity has been investigated for the different smartphone chips with embedded or external antennas. In the case of embedded antennas, the IAR is rather difficult or even impossible for some brands of smartphones, for instance, Nexus9, Huawei P10 and Galaxy S5 (Pirazzi et al. 2017; Realini et al. 2017; Håkansson 2019). The reason is that their ambiguity fractions are time-variant dramatically from satellite to satellite. However, for Huawei Mate20X and P30 as well as Xiaomi Mi8 (Mi8), their ambiguities are of integer nature at some frequency signals, like GPS L1 frequency (Wanninger and Heßelbarth 2020; Darugna et al. 2020). In the case of external antennas, the results from Geng and Li (2019) showed that with the Android system the constant offsets exist in the ambiguities for Nexus9 and Mi8, and thus their ambiguities can be fixed if these offsets are pre-calibrated. Moreover, they found that such property of constant offsets is not available for Mate20. Note, the above analyses for the integer property of ambiguity were mainly based on a given mobile operating system. In fact, the power-saving modes differ from the mobile operating systems (Linty et al. 2014; Humphreys et al. 2016), which may affect the smartphone chip to process the received GNSS signals. This leaves a question that whether the mobile operating system affects the integer property of ambiguity. In addition, with release of new chips of Huawei Kirin980, Huawei Mate20, Mate20X and P30 are all updated by these new chips. As a result, it is interesting to understand the ambiguity fixation for updated Huawei smartphones.

Regarding GNSS data quality, the previous studies indicated that the embedded antenna of smartphones is the key factor. The linearly polarized antennas and low-cost GNSS chipsets are generally used in smartphones (Zhang et al. 2013), which together derive the GNSS signals featured by the lower and highly variated carrier-to-noise density ratio (C/N0) (Siddakatte et al. 2017; Humphreys et al. 2016), the non-uniform signal strengths and low C/N0 at high elevations (Geng et al. 2018; Zhang et al. 2018a; Pesyna Jr et al. 2014), the high noise in the order of tens of meters and frequent outliers for pseudoranges (Kirkko-Jaakkola et al. 2015), as well as the Duty-cycle (Laurichesse et al. 2017; Gogoi et al. 2019; Banville and Diggelen 2016). However, the existing studies mainly concentrated on the data quality and its impacts on IAR at a given attitude. In fact, the smartphone attitude would frequently change in real applications. Since the smartphone antennas are generally omnidirectional rather than hemispherical, it is insufficient to understand the data quality of smartphones only at a given attitude. Instead, one needs to accurately understand the data quality at different attitudes so as to improve the IAR for smartphone positioning.

Different from the existing studies where only the smartphone brands are analyzed for IAR, this paper will address three factors hindering the smartphone IAR and thus the precise positioning, including the mobile operating systems and smartphone attitudes besides the smartphone brands. We comprehensively analyze their effects on the integer nature of ambiguities and data quality. The observations from the smartphones of Mate20 and Mi8 with embedded and external antennas and the geodetic receivers with external antennas are comparably analyzed.

The rest of the paper is organized as follows. The formulae of estimating smartphone observation precisions are formulated in Sect. 2. The experiment setup and datasets used in the paper are explained in Sect. 3. How the ambiguity integer property (specified by the stability of ambiguity fractions) and data quality (specified by the data availability and data gap rate, C/N0 values, and observation precisions) are affected by the smartphone brands, operating systems and attitudes are carefully addressed in Sects. 4 and 5, respectively. Two kinematic experiments are carried out in Sect. 6 to numerically demonstrate the performance of IAR and positioning for different smartphone brands with embedded and external antennas, respectively. Finally, the research findings and some concluding remarks are summarized in Sect. 7.

2 Formulae of precision estimation

To study the integer property and noise characteristics of the observations from a smartphone, we will form the short baseline between a geodetic-grade receiver and a smartphone. For the between-receiver short baseline single-differenced (SD) observations, the systematic errors, e.g., satellite orbit and clock errors, satellite hardware delays and atmospheric effects, can be basically eliminated. Then, the single-epoch, SD observation equations on frequency j read (Li 2016)

$$ \begin{aligned}{\varvec{\varPhi}}_{j} & = {\varvec{Bb}} + {\varvec{e}}_{s} \delta t_{j} + \lambda_{j} {\varvec{a}}_{j} + \lambda_{j} {\varvec{e}}_{s} \varphi_{j} + \varepsilon_{{{\varvec{\varPhi}}_{j} }} \\ {\varvec{P}}_{j} & = {\varvec{Bb}} + {\varvec{e}}_{s} dt_{j} + \varepsilon_{{{\varvec{P}}_{j} }} \\ \end{aligned} $$
(1)

where \({\varvec{\varPhi}}_{j}\) is the SD observation vector of s satellites for phase on frequency j, and Pj for code has the same structure as \({\varvec{\varPhi}}_{j}\). B is the design matrix to the baseline vector b. aj is the SD ambiguity vector with wavelength λj. φj is the SD initial phase bias of receiver. δtj and dtj are the SD receiver clock errors for phase and code. \(\varepsilon_{{{\varvec{\varPhi}}_{j} }}\) and \(\varepsilon_{{{\varvec{P}}_{j} }}\) contain the measurement noise and multipath for the SD phase and code, respectively. The symbol es is the s-column vector with all elements of ones.

Obviously, the parameters δtj and φj are fully dependent, and they are further dependent on parameter aj with rank-deficiency of 1. In terms of Li (2016), the full-rank single-epoch SD observation equations of phase and code on frequency j read

$$ \left[ {\begin{array}{*{20}c} {{\varvec{\varPhi}}_{j} } \\ {{\varvec{P}}_{j} } \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} {\varvec{B}} & {\lambda_{j}{\varvec{\varLambda}}} & {{\varvec{e}}_{s} } & 0 \\ {\varvec{B}} & 0 & 0 & {{\varvec{e}}_{s} } \\ \end{array} } \right]\left[ {\begin{array}{*{20}c} {\varvec{b}} \\ {{\varvec{a}}_{j} } \\ {\delta t_{j} } \\ {dt_{j} } \\ \end{array} } \right] + \left[ {\begin{array}{*{20}c} {\varepsilon_{{{\varvec{\varPhi}}_{j} }} } \\ {\varepsilon_{{{\varvec{P}}_{j} }} } \\ \end{array} } \right] $$
(2)

where \({\varvec{\varLambda}}= \left[ {0_{{\left( {s - 1} \right) \times 1}} ,{\varvec{I}}_{s - 1} } \right]^{{\text{T}}}\). Importantly, δtj is the nominated phase receiver clock error redefined as \(\delta t_{j} = \delta t_{j} + \lambda_{j} \varphi_{j} + \lambda_{j} a_{j}^{1}\), which includes the receiver initial phase biases and the pivot ambiguity.

\({\varvec{a}}_{j} = \left[ {\begin{array}{*{20}c} { - {\varvec{e}}_{s - 1} } & {{\varvec{I}}_{s - 1} } \\ \end{array} } \right]{\varvec{a}}_{j}\) is the vector of double-differenced (DD) ambiguities, which must be integers for the geodetic-grade receivers. However, it is not the case for phase observations of some smartphones. In such a case, the DD ambiguity can be deemed as a lumped variable of an integer and a real-valued between-satellite DD phase bias. As a result, the DD phase bias in aj is responsible for smartphone IAR.

To analyze the stochastic characteristics of smartphone observations, we must first recover their noises. To be specific, once the DD ambiguities are correctly fixed by calibrating their phase biases (elaborated in Sect. 4), and the baseline is precisely known externally, Eq. (2) is written as:

$$ \left[ {\begin{array}{*{20}c} {\overline{\user2{\Phi }}_{j} } \\ {\overline{\user2{P}}_{j} } \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} {{\varvec{e}}_{s} } & 0 \\ 0 & {{\varvec{e}}_{s} } \\ \end{array} } \right]\left[ {\begin{array}{*{20}c} {\delta t_{j} } \\ {dt_{j} } \\ \end{array} } \right] + \left[ {\begin{array}{*{20}c} {\varepsilon_{{{\varvec{\varPhi}}_{j} }} } \\ {\varepsilon_{{{\varvec{P}}_{j} }} } \\ \end{array} } \right] $$
(3)

where \(\overline{\user2{\Phi }}_{j}\) and \(\overline{\user2{P}}_{j}\) indicate the phase and code observations corrected with baseline and integer ambiguities. After single-epoch least-squares adjustment, the SD phase and code residuals are mainly affected by random noises and multipath. For smartphones with external antennas, the standard deviation (STD) of code and phase observations at frequency j can be estimated by

$$ \sigma_{{{\varvec{O}}_{j} }} = \sqrt {\frac{{{\varvec{v}}_{{{\varvec{O}}_{j} }}^{T} {\varvec{v}}_{{{\varvec{O}}_{j} }} }}{{2\left( {s - 1} \right)}}} $$
(4)

where vj is the residual vector at frequency j. O stands for the code or phase observations. Note that (4) has a prerequisite that the baseline is precisely known. However, for smartphones with embedded antennas, the antenna phase center cannot be precisely measured and its variation is unclear. Therefore, a triple-difference in time-domain is applied to calculate the precisions of phase and code observations. The SD phase or code observations on frequency j at adjacent epochs k, k + 1, k + 2 and k + 3 are denoted as \(\overline{\user2{O}}_{j,k}\), \(\overline{\user2{O}}_{j,k + 1}\), \(\overline{\user2{O}}_{j,k + 2}\) and \(\overline{\user2{O}}_{j,k + 3}\), respectively. First, the between-epoch single-difference equations for SD observations read

$$ \left\{ {\begin{array}{*{20}l} {\overline{\user2{O}}_{j,1} = \overline{\user2{O}}_{j,k + 1} - \overline{\user2{O}}_{j,k} } \hfill \\ {\overline{\user2{O}}_{j,2} = \overline{\user2{O}}_{j,k + 2} - \overline{\user2{O}}_{j,k + 1} } \hfill \\ {\overline{\user2{O}}_{j,3} = \overline{\user2{O}}_{j,k + 3} - \overline{\user2{O}}_{j,k + 2} } \hfill \\ \end{array} } \right. $$
(5)

Then, the between-epoch double-difference equations for SD observations read

$$ \left\{ {\begin{array}{*{20}l} {\overline{\user2{O}}_{j,12} = \overline{\user2{O}}_{j,k + 2} - 2\overline{\user2{O}}_{j,k + 1} + \overline{\user2{O}}_{j,k} } \hfill \\ {\overline{\user2{O}}_{j,23} = \overline{\user2{O}}_{j,k + 3} - 2\overline{\user2{O}}_{j,k + 2} + \overline{\user2{O}}_{j,k + 1} } \hfill \\ \end{array} } \right. $$
(6)

Finally, the between-epoch triple-difference equation for SD observations is formulated as (Li et al. 2010)

$$ \tilde{O}_{j,k} = \overline{\user2{O}}_{j,k + 3} - 3\overline{\user2{O}}_{j,k + 2} + 3\overline{\user2{O}}_{j,k + 1} - \overline{\user2{O}}_{j,k} $$
(7)

where \(\left( {\dddot \cdot } \right)\) denotes the between-epoch triple-difference operator. In case of a short time duration (e.g., several minutes) where the satellite elevations are hardly changed, it is adequate to assume that the observation STDs are constant for each satellite. Let the STD of un-difference code or phase observation as \(\sigma_{{{\varvec{O}}_{j} }}\), it follows by using error propagation law in case of ignoring the time-correlations as

$$ {\varvec{\sigma}}_{{\tilde{O}_{j,k} }}^{2} = 2{\varvec{\sigma}}_{{{\varvec{o}}_{j} }}^{2} + 9 \times 2{\varvec{\sigma}}_{{{\varvec{o}}_{j} }}^{2} + 9 \times 2{\varvec{\sigma}}_{{{\varvec{o}}_{j} }}^{2} + 2{\varvec{\sigma}}_{{{\varvec{o}}_{j} }}^{2} = 40{\varvec{\sigma}}_{{{\varvec{o}}_{j} }}^{2} $$
(8)

By using the observations of total K triple-difference epochs, the STD of un-difference code or phase observation is estimated as

$$ \sigma_{{{\varvec{O}}_{j} }} = \sqrt {\frac{{\mathop \sum \nolimits_{k = 1}^{K} \tilde{O}_{j,k}^{T} \tilde{O}_{j,k} }}{40K}} $$
(9)

For more details, one can also refer to Leick et al. (2015).

3 Data description

The static datasets were collected on the rooftop of a building at Tongji campus, and were employed to elucidate the impacts of smartphone brands, operating systems and attitudes on IAR. As shown in Fig. 1, two smartphones, Mate20 and Mi8, were placed next to each other in upward, horizontal and downward attitudes, respectively. Away from them by approximately 1 m, another Mate20 was located with an external SinoGNSS AT340 geodetic antenna powered by the Mate20 smartphone via a splitter. Through two outlets of the splitter, the L1 and L5 signals are transmitted to each of their own feeding points in the embedded antenna. In addition, two types of GNSS receivers, Trimble Alloy and u-blox ZED-F9T, are used, of which the u-blox ZED-F9T is a representative of the low-cost receivers. The u-blox ZED-F9T receiver tracks the L1 and L2 signals of GPS and the B1I and B2I signals of BeiDou Navigation Satellite Systems (BDS), while the smartphones track L1 and L5 signals of GPS and B1I signals of BDS. Thus in analysis of data quality, only GPS L1 signals and BDS B1I signals of u-blox are used for comparison; But in analysis of IAR, the dual-frequency GPS and BDS signals of u-blox are used. The detailed information of smartphones and receivers is presented in Table 1. The observation duration of static datasets for each attitude is in Table 2.

Fig. 1
figure 1

Layout of three smartphones and two receivers (top) and real observation environment (bottom) for collecting static datasets

Table 1 The information of data collecting devices
Table 2 Details of static datasets where the Trimble Alloy is used as a reference for all devices

In the following, we define a combination set (denoted by U–T) that includes L1, B1I and E1 observations of u-blox, and L5 and E5a observations of Trimble, to comprehensively compare with dual-frequency smartphone signals. Figure 2 shows the total number of tracked satellites, and the corresponding geometric dilutions of precision, i.e., PDOP, for all devices.

Fig. 2
figure 2

Total number of tracked satellites (top) and their associated PDOP values (bottom) for static data with a cutoff elevation of 15° by using Mate20, Mi8, u-blox ZED-F9T and Trimble Alloy, respectively

The data quality of Mi8 observations is analyzed for comparison with Mate20. The GNSS chip of Huawei Kirin980 is embedded in Mate20 while the Broadcom BCM47755 in Mi8. The smartphones are updated with the Android P operating system to provide observations and navigation messages of GPS, Galileo, QZSS and BDS. We developed an Android app Tongji GNSS RINEX Logger (TJGRL) to extract the observations with a sampling interval of 1 s through an application programming interface (API) provided by Android developers. It has been extensively tested by cooperating with Huawei Company and is freely available to the third parties upon required for academic usage at this stage. TJGRL can store the data in both RINEX 3.04 format (IGS/RTCM 2018) and raw log format (European GNSS Agency 2017). The indicator of cycle slip pertained to the phase observation is set to 1 when the duty cycle occurs.

4 Integer properties of phase ambiguities

In this section, we investigate the effects of smartphone brands and operating systems on ambiguity fixation. To suppress the multipath effects, the embedded antenna is replaced by an external geodetic-grade antenna. The ambiguity property of Mate20 is analyzed, and for Mi8 one can refer to Geng and Li (2019). Note that the operating system of Mate20 used in this study is EMUI 9.0.1. For the ultra-short baselines, the baseline-corrected DD phase observations can fully reflect the receiver-inherent phase offsets and variations besides the multipath and random noises. To be specific, the DD ambiguities are estimated epoch by epoch for the smartphone observations with an external antenna, and the fractional parts of those DD ambiguities are separated through a rounding operation. Since the reference station is a geodetic receiver without any phase offsets, the offsets of DD ambiguities are attributed to the smartphone observations.

4.1 Temporal properties of ambiguity fractions

Figure 3 presents the time-series and histograms for the fractions of baseline-corrected DD phase observations between Alloy receiver and Mate20 with operating system EMUI 9.0.1. Obviously, the fractions have constant offsets for all satellite systems, and the offsets differ from satellite systems and frequency bands. For example, the offset is about 0.5 cycles for L1/L5 signals of GPS and QZSS, while −0.5 cycles for B1/E1 signals of BDS and Galileo. With stable ambiguity offsets of Mate20, the IAR is expected if these offsets are corrected. Considering the result from Geng and Li (2019) that the ambiguity fractions of Mate20 with EMUI 9.0 vary dramatically over time such that the ambiguities cannot be fixed, we conclude that the operating system is responsible for the time stability of ambiguity fractions. From this point of view, we can say that Huawei has solved the variations of ambiguity fractions for their smartphone GNSS chipsets in the operating system EMUI 9.0.1. In addition, Geng and Li (2019) showed that ambiguity fixation is expected for Mi8, which further confirms that the integer nature of ambiguity depends highly on the operating systems and smartphone brands.

Fig. 3
figure 3

Time series and histograms for the fractions of baseline-corrected DD phase observations between Trimble receiver and Mate20

To show the efficiency of offset corrections, we first correct the DD observations with their corresponding offsets. We calculated the mean offsets for each frequency of each system over the entire observation period using the single-epoch offset estimates. The estimated mean offsets are as follows: 0.5 cycles for GPS L1/L5 and QZSS L1, −0.5 cycles for BDS B1 and Galileo E1, 0.7 cycles for QZSS L5, and −0.4 cycles, for Galileo E5a, respectively. By using these offsets, we correct the ambiguity fractions in Fig. 3, the updated histogram is shown in Fig. 4. Clear, the offset-corrected fractions are of zero-mean with magnitudes of ± 0.3 cycles for all frequencies. For the Mate20 observations with an embedded antenna, we also apply their ambiguities by using the estimated offsets, the histogram of corrected fractions is shown in Fig. 4 as well. The results indicate that the ambiguity fractions with embedded antenna are of zero-mean for all frequencies but their magnitudes are larger than those with the external antenna.

Fig. 4
figure 4

Fraction histograms of baseline-corrected DD observations corrected with offsets for Mate20 with embedded (rows 1–4) or external (rows 5–8) antenna

4.2 Offset-calibrated IAR

After pre-calibrating the DD phase observations of Mate20 by using the mean offsets, in this section we investigate the IAR performance of different smartphone brands with embedded antennas. To make a comparison, the IAR performance of the smartphone with an external antenna and the survey-grade receiver are examined. Since the phase center of an embedded antenna cannot be precisely measured, we use the antenna reference point (ARP) as a truth benchmark to gauge their relative positions.

Multi-frequency multi-system real-time kinematic (MRTK) software developed by the GNSS group in Tongji University is used for IAR, which is able to process the data of each GNSS system or their combinations with the sequential least squares and extended Kalman filter (EKF) algorithms. In this study, we employ the EKF algorithm, where an elevation-dependent weighting function is applied (Li et al. 2017). The float ambiguities are continuously estimated and they are tried to be fixed at each epoch by using the Partial ambiguity resolution (PAR) strategy (Nardo et al. 2016) where the ambiguities with tracking duration of shorter than 30 epochs are excluded for fixing. Furthermore, an ambiguity-fixed epoch is obtained only when at least three ambiguities are successfully fixed (Teunissen 1995) and the ratio is larger than the threshold of 3.0 (Euler and Schaffrin 1990). Once the ambiguity-fixed epoch is reached, the time-to-first-fix (TTFF) is obtained. The fixing rate is defined as the proportion of the number of ambiguity-fixed epochs relative to the number of total epochs.

Figure 5 and Table 3 show the ambiguity fixing rate and positioning results of static datasets for Mate20 and Mi8 with embedded antennas, where RMS stands for the root mean square accuracy. Besides the positioning errors, the cumulative distribution function (CDF) of 3D positioning errors is illustrated as well. To compare, the results of u-blox ZED-F9T and Mate20 with external antenna are shown in Fig. 6 and Table 4. The ambiguity fixing rate of Mate20 with embedded antenna is 98.6%, which is higher than that of Mi8 by 9.2%. While if the external antenna is applied, the fixing rate can be further improved to 99.7% and the TTFF is shortened from 40 to 35 epochs. Regarding positioning results, the 3D positioning errors in the confidence of 95% are 3 cm and 5 cm for Mate20 and Mi8 with an embedded antenna, respectively. The results of u-blox are better. Its fixing rate reaches 100% with the TTFF of 30 epochs and the 3D errors of 2 cm in the confidence of 95%. From these results, the external antenna is an important factor to improve the IAR of smartphone.

Fig. 5
figure 5

Positioning errors and their 3D CDFs for Mate20 (left) and Mi8 (right) with embedded antennas

Table 3 Positioning and IAR statistics of Mate20 and Mi8 with embedded antennas in upward attitude
Fig. 6
figure 6

Positioning errors and their CDFs for Mate20 (left) and u-blox ZED-F9T (right) with external antennas

Table 4 Positioning and IAR statistics of Mate20 and u-blox ZED-F9T with external antennas

The average number of satellites presented in Tables 3 and 4 indicates that the smartphone with an external antenna can track more satellites, which gives a quick understanding why the external antennas can obtain better results than embedded antennas, respectively. In fact, the high quality of phase observations with external antenna is even more important for better IAR and positioning. The ambiguity-fixed phase residuals of Mi8 and u-blox are given in Fig. 7. By comparing with Fig. 4, the phase residuals of Mate20 are smaller than those of Mi8, thus the ambiguity fixing rate is higher for Mate20. However, the phase residuals of Mate20 with external antenna are larger than those of u-blox, the ambiguity fixing rate is lower for Mate20. Therefore, we concluded that the external antenna affects the data quality and then the IAR.

Fig. 7
figure 7

DD phase residuals of the ambiguity-fixed solutions for Mi8 (rows 1–4) and u-blox ZED-F9T (rows 5–7)

5 Data quality and its effects under different attitudes

In this section, we examine the effects of the smartphone attitude on the observation noises and then on the IAR. Three indicators are defined to reflect the data quality at the different attitudes: (1) the data availability and data gap rate; (2) the relationship between C/N0 values and the satellite elevations; (3) the code and phase precisions with embedded and external antennas.

5.1 Data availability and data gap rate

The Data Availability Rate (DAR) is defined as the proportion of number of real tracking satellites (NRTS), na, to the number of theoretical tracking satellites, nt, at a given epoch, i.e., DAR = na/nt, where the theoretical tracking satellites are defined as the satellites with elevations calculated by broadcast ephemeris higher than 0°. DAR can overall reflect the signal acquisition ability of smartphone chips.

The DAR results of Mate20 and Mi8 are shown in Table 5. In general, with an embedded antenna, the DAR of Mate20 is larger than Mi8, but both smaller than using an external antenna. The DAR of U-T is larger than Mate20 with an embedded antenna, but they are comparable if the external antenna is applied. Regarding Mate20 with an embedded antenna, when the antenna faces upwards or downwards, the DAR of L1/E1 is 92.5% on average, larger than that of L5/E5a, while when the antenna is horizontal, the DAR of L1/E1 is 87.3% on average. For Mi8 with an embedded antenna, the DAR of L1/E1 is 81.8% on average, larger than that of L5/E5a at different attitudes. It can be seen that the DAR gets minimal when the embedded antenna of Mi8 is placed downward and when the embedded antenna of Mate20 is horizontal. In addition, with an embedded antenna, the difference of DAR between different attitudes is smaller for Mate20 than for Mi8. An explanation for this phenomenon can be found in some studies (Yong et al. 2021). Netthonglang et al. (2019) and Darugna et al. (2019) demonstrated the discrepancy between the antenna phase centers of Mi8 and Mate20. The antenna phase center of Mate20 is closer to the geometric center than Mi8, thus the data quality of Mate20 seems less attitude dependent. This is in agreement with our results. In summary, although the embedded antenna is omnidirectional, the number of tracking satellites varies dramatically with the antenna attitudes. The upward attitude is generally conducive to the observation reception.

Table 5 The data availability of Mate20, Mi8 and U-T

For precise positioning, the continuous phase observations are rather important. Once a new ambiguity is introduced, it often needs a certain period of continuous phase observations to make its float solution converge. If the frequent interruptions occur, they will badly hamper or even be useless to the success of IAR (Li et al. 2017; Li 2018). Therefore, to address the quality of phase data related to this issue, we define another indicator of Data Gap Rate (DGR). As shown in Fig. 8, given a threshold es (i.e., minimum continuous tracking epochs), for instance, es = 30 s, if the number of continuous epochs, ed, for a satellite that is smaller than this threshold, the phase observations of these ed epochs are considered useless for ambiguity resolution and they are taken as an interruption. Then, the DGR is defined as the ratio of the number of interrupted epochs ed to the total number of epochs et, i.e., DGR = ed/et. Figure 9 shows the DGR results of Mate20, Mi8 and U-T for different thresholds es. The DGR gets larger for larger es. With es = 30 s, the DGRs of dual-frequency observations are 19.1, 23.7, and 35.7% on average for Mate20 with an embedded antenna in upward, horizontal, and downward directions, while they are 34.1, 46.1 and 35.9% for Mi8 with an embedded antenna. The DGR is maximum when the embedded antenna of Mi8 is placed downward and when the embedded antenna of Mate20 is horizontal. This implies that the tracking ability of phase observations varies between smartphones with different attitudes. However, with an external antenna, the DGRs of Mate20 dual-frequency observations are reduced to 7.4, 7.4, 7.6 and 7.6% for es = 30, 60, 300 and 600 s, while they are nearly zero for U-T. From the above results we can conclude that, in addition to the effect of the smartphone antenna, the attitude of the smartphone does affect the continuity of the phase observations.

Fig. 8
figure 8

Graphical illustration of DGR definition with BI1 phase observations of C01 satellite as an example. The green line denotes the availability of phase observations

Fig. 9
figure 9

DGR results for different frequency phase observations of Mate20, Mi8 and U-T with different attitudes and different thresholds of es, where the embedded antenna is used for Mi8 and external antennas are used for receivers, while both embedded and external antennas are used for Mate20

5.2 Elevation-dependent C/N0 values

The C/N0 is defined as the ratio of the signal power to the noise power in 1-Hz bandwidth (Bilich and Larson 2007), which reflects the quality of received signals from the energy aspect. In this section, we calculate the mean C/N0 values in an interval of 5° for each frequency observation with different attitudes. Figure 10 shows these mean C/N0 results with respect to satellite elevations for Mate20, Mi8 and U-T, respectively. The positive elevation-dependence is apparent for U–T receivers. For smartphones with either embedded or external antenna, the dependence is not clear and some fluctuations exist. Moreover, the C/N0 values of Mate20 with an external antenna are about 7 dB larger than those with an embedded antenna, and close to the U–T values. The reason is that the linearly polarized GNSS antennas employed in smartphones cannot compensate for the 3 dB signal power loss caused by polarization mismatch (Zhang et al. 2013). In addition, we found that for the Mate20 and Mi8 with embedded antennas, the effects of attitude variations on C/N0 are up to 4 dB and 11 dB, respectively, in all GNSS systems. The observations with lower C/N0 may be outliers, which affects the IAR and positioning (Zhang et al. 2018c). Therefore, the effect of smartphone attitude on C/N0 values and thereby on the ambiguity resolution must be carefully considered in the actual data processing.

Fig. 10
figure 10

The C/N0 values as a function of satellite elevations for U-T and Mate20 with external antennas (rows 1–2), Mate20 (rows 3–5) and Mi8 both with embedded antenna (rows 6–8)

5.3 Observation precisions

For test devices with external antennas, such as u-blox, Trimble Alloy and Mate20, the precisions of GNSS observations were evaluated based on the ultra-short baselines with precisely known baseline coordinates (Amiri-Simkooei and Tiberius 2007; Li 2016; Zhang et al. 2018b), as shown in (4). Moreover, we quantified the precisions of smartphone observations with embedded antennas using a triple-difference method in the time-domain, as shown in (9). Note that the time-independent assumption is applied in (9). This is because this correlation can only cause a limited impact on the observation precision (1–2 mm) for all conditions in our experiments. Such small difference can hardly affect the cm-level positioning accuracy, and therefore the assumption of time-independent observations employed in (9) is acceptable.

The code and phase STDs of Mate20 and Mi8 are presented in Table 6. The STDs of embedded antennas are generally similar for the different attitudes. When the external antenna is used, due to its high gain and low noise, the code STDs become smaller. For the B1/E1 signals of two smartphones, the code and phase STDs of BDS and Galileo satellites are smaller than those of GPS and QZSS satellites. However, the code and phase STDs of all frequencies in smartphones are larger than those of U–T. For the L5/E5a signals of two smartphones, the code STDs of all systems are significantly smaller than those of the L1/E1 signals. This shows that the L5/E5a signals have advantages in signal modulation and better anti-multipath ability in different scenes. To verify this point, the probabilities of the code outliers as a function of C/N0 values are calculated for the different smartphone attitudes, as shown in Fig. 11. Here the code outlier is defined for the observation with its residual being three times larger than its STD. It is well known that the larger C/N0 value has generally a smaller noise influence (Zhang et al. 2018c). From Fig. 11, we can see that the probability of code outliers decreases with the increase in C/N0 values. When the C/N0 value is larger than 30 dB Hz, the probability of L1/E1 code outliers seems slightly higher than that of L5/E5a signals. It means that L5/E5a signals have the better anti-multipath capability in a smartphone. The code outliers occur more frequently when the observations have C/N0 values smaller than 30 dB Hz for two smartphones, which gives experience in real data processing for setting the minimum C/N0 threshold in the actual data processing.

Table 6 The STDs of code and phase observations for Mate20 and Mi8. The unit is the meter for code and cycle for phase, respectively
Fig. 11
figure 11

Probability of the code outliers as a function of C/N0 values for Mi8 and Mate20

5.4 IAR under different attitudes

The previous results show that the data quality differs from the smartphone attitudes, in this section, we will further study the effects of attitudes on the IAR. In terms of the afore-analysis, the code observations with C/N0-values lower than 30 dB Hz would be outliers with high probability. Thus the observations only with C/N0 values larger than 30 dB Hz are used. In addition, considering the effect of DGR on ambiguity fixation, the ambiguities with a tracking time shorter than 30 epochs will not be fixed in the data processing. Finally, the offsets obtained in Sect. 4 will be used for ambiguity fraction calibration for Mate20.

Figure 12 and Table 7 show the positioning results of statistic datasets for Mate20 and Mi8 in three antenna attitudes (i.e., upward, horizontal and downward). In general, the positioning performance of Mate20 is overall better than Mi8. The 3D errors of Mate20 are all smaller than 10 cm by 95% for three antenna attitudes, and even smaller than 5 cm for upward and downward attitudes. For Mi8, the 3D errors are in centimeters only for upward attitude, and reach 0.2 m and 0.4 m for downward and horizontal attitudes, respectively. The ambiguity fixing rates of Mate20 are larger than those of Mi8 with much shorter TTFF for all antenna attitudes. Moreover, the results of upward attitude are best with the highest accuracies, largest fix-rates and shortest TTFF for both Mate20 and Mi8. Then, the results of downward attitude are better than those of horizontal attitude. Therefore, the antenna attitude is indeed an important factor for smartphone positioning with an embedded antenna.

Fig. 12
figure 12

Number of tracked satellites, positioning errors and their CDFs for Mate20 (left) and Mi8 (right) with embedded antennas

Table 7 Positioning statistics of Mate20 and Mi8 with different antenna attitudes

6 Kinematic positioning

The IAR and positioning have been investigated for smartphones with embedded antennas under different attitudes by using static data. However, most real smartphone positioning applications are in kinematic situations. In this section, we analyze the IAR and positioning of smartphones at upward attitude in two real kinematic experiments, aiming to provide the reference of quantitative accuracy for mass-market users. Table 8 summarizes the error characteristics and corresponding processing strategies for smartphones in real data processing.

Table 8 The error characteristics and corresponding processing strategies for smartphones

Two kinematic datasets were collected on the playground of Tongji campus (denoted by Kin#1) and on the highway of Shanghai city (denoted by Kin#2), as shown in Fig. 13. Note that for two kinematic experiments, the embedded antennas of the Mate20 and Mi8 face upwards. In Kin#1 dataset, all smartphones with embedded antennas were equipped on a kart and a Trimble receiver is used for comparison purposes. In Kin#2, two Mate20 smartphones were placed inside the windshield. A splitter was applied to separate the radio frequency signals from an external SinoGNSS AT340 antenna into a SinoGNSST30 receiver and one of two smartphones. In other words, one smartphone used an external geodetic antenna sharing with a geodetic receiver, while the other used its own embedded antenna. Table 9 presents the experiment details. Kin#1 suffers from the semi-shielding surroundings by trees and buildings, while Kin#2 includes the open sky and semi-shielding surroundings. To identify the motion complexity, the varying velocities are included with the maximum speed of 7 km/h and 85 km/h for two experiments, respectively, as shown in Fig. 14. In the following analysis, the epochs with ambiguity-fixed solutions from Trimble in Kin#1 and SinoGNSST30 receivers in Kin#2 are used as the true values to evaluate the solutions of smartphones.

Fig. 13
figure 13

Setup of two kinematic experiments. Kin#1 (top) collects data on the playground of Tongji campus with an equipped kart, while Kin#2 (bottom) on the highway of Shanghai city with a car. The green dots in the trajectory indicate the ambiguity-fixed solutions provided by Trimble in Kin#1 and SinoGNSST30 in Kin#2, while the yellow dots in the trajectory indicate the ambiguity-floated solutions

Table 9 Observation information of two kinematic tests
Fig. 14
figure 14

The velocity information of Kin#1 (left) and Kin#2 (right)

For Kin#1, the ambiguity fixing rate and positioning statistics of Mate20 and Mi8 are shown in Fig. 15 and Table 10, respectively. The RMS accuracies of Mate20 and Mi8 are all smaller than 5 cm in three directions, and their ambiguity fixing rates of them are all above 90%. It means that with Mate20 and Mi8 smartphones the centimeter-level location-based services are achievable in such an environment. The TTFF of Mate20 is more than 2 times shorter than Mi8. The CDF results of positioning errors indicate smaller errors for Mate20 compared to Mi8. In conclusion, centimeter-accuracy positioning can be achieved in a semi-shaded environment using a smartphone with an embedded antenna placed upwards.

Fig. 15
figure 15

Positioning errors and their CDFs of 2D and 3D errors for Mate20 (left) and Mi8 (right) in Kin#1

Table 10 Positioning statistics for Mate20 and Mi8 both with embedded antennas in Kin#1

For Kin#2, the positioning errors and statistics of Mate20 with embedded or external antennas are shown in Fig. 16 and Table 11, respectively. Compared to Kin#1, the C/N0 values with embedded antenna are 7.2 dB Hz lower for L1/B1/E1 signals and 2.3 dB Hz lower for L5/E5a signals in Kin#2 due to the effect of the car front windshield. When the external antenna is used, the C/N0-values are significantly improved. In such a high-dynamic and obstruction environment, the ambiguity fixing rates are reduced by 62.1% for embedded antenna and still by 22.6% even for external antenna. In general, only the meter-level accuracy can be obtained in such a complicated city environment with an embedded antenna. The horizontal 2D errors are about 1.3 m and 3D errors 2.4 m in a percentage of 95%. However, once the external antenna is used, the accuracies of each coordinate component are improved to as high as centimeters, and the 3D and horizontal errors are about 20 cm and 10 cm by 95%, respectively. Such accurate positioning is very promising, allowing the variety of high-precision location-based services in the city environment, for instance, the vehicular-lane accurate positioning for intelligent transportation.

Fig. 16
figure 16

Positioning errors and their CDFs for Mate20 with embedded (left) or external (right) antenna in Kin#2

Table 11 Positioning statistics of Mate20 with embedded and external antennas in Kin#2

7 Concluding remarks

This contribution investigated three factors hindering smartphone IAR, including the smartphone brands, operating systems and smartphone attitudes. The success of IAR and positioning capability were assessed by using static and kinematic datasets. During the whole analysis, the geodetic-grade antenna was used to evaluate the impacts brought by the smartphone antennas. The research findings are summarized as follows.

  1. 1.

    The embedded antenna of smartphone is an important factor affecting the data quality. The data gap rates of Mate20 are larger than 20% and can be reduced to about 7% once the external antenna is applied. The C/N0 values are about 35 dB Hz and smaller by 7 dB Hz than the external antenna.

  2. 2.

    The antenna attitude also affects the data quality and ambiguity fixing rate. The upward attitude for both Mate20 and Mi8 achieves the best data quality with the smallest data gaps and largest data availability and then the highest ambiguity fixing rate.

  3. 3.

    The integer properties of phase ambiguities are related not only to smartphone brands but also to mobile operating systems. The phase ambiguities of Mate20 under Android 9.0.1 can be successfully fixed once the frequency-related constant offsets are properly calibrated. The fixing rate exceeds 90% in static scenarios and is higher than that of Mi8.

  4. 4.

    For a static dataset with an open-sky environment, the centimeter-accurate positioning solutions are achievable with 3D positioning errors smaller than 10 cm by 95%; while for city-environment with complicated obstructions, only the meter-level accuracy is obtained, which however can be significantly improved to centimeter to decimeter-level with positioning errors are smaller than 0.22 m by 95% if an external antenna is employed instead of embedded antenna. Such results are promising to satisfy a lot of location-based services, such as the vehicular-lane accurate positioning for intelligent transportation.