# Improving Smartphone GNSS Positioning Accuracy Using Inequality Constraints
## 3 Kalman Filter with Inequality Constraints
### Solution of Inequality Constraint
Note that we can standardize the constraint bound by \(\mu_{0}\) to simplify the calculation. Finally, we set \(\hat{\mu}\) and the \(\hat{\sigma}\) as the constrained state and its variance to update their matrices. Another essential step is to check the reliability of constrained area; in this paper, we utilize the CPD of the region after constraint operation to achieve this. There are two steps in this process; the first is to calculate the CPD using Equation (27) by replacing \(\mu_{0}\) and \(\sigma_{0}\) with the constrained parameters \(\hat{\mu}\) and \(\hat{\sigma}\). The second step is to judge whether the CPD is satisfied by these conditions. This is illustrated in Figure 6, in which \(c\) is a threshold and is set to 0.1 in this paper. If the condition cannot be satisfied, this could be due to the tight restriction, and we should enlarge the bound. In this paper, we enlarge the bound 1.5 times. Overall, the solution flowchart of the inequality constraint is expressed as follows (Algorithm 1):  
``` Input: Estimation from the conventional unconstrained Kalman filter. State: \(\hat{X}_{k}\), variance: \(\hat{Q}_{k}\). Output: Estimation of the Kalman filter with inequality constraints. Steps:
1. Transform \(\hat{X}_{k}\) and \(\hat{Q}_{k}\) into a constrained frame. Obtain the transformed expectation \(\mu_{0}\) and variance \(\sigma_{0}\



### Data Description

For algorithm verification, we utilized datasets collected from static and dynamic scenarios. The stationary datasets were collected on 16 May 2022, while the dynamic datasets were collected on 6 July 2022, with a collection time of approximately 30 min. All datasets were obtained at Southeast University in Nanjing, China. Figures 7a and 7c, respectively, display the location and trajectory of the static and dynamic data. During the experiments, two high-grade geodetic receivers, namely, CHCNAV 190, were installed in the vicinity of the smartphones, and their relative positions are shown in Figure 7b,d. The reference positions were computed using the commercial software CHC Geomatics Office (CGO), based on observations from the geodetic receivers. The reference positions achieved centimeter-level accuracy using the RTK mode, while reference velocity was calculated based on the reference position, achieving centimeter/second-level accuracy with a fixed position solution. For the collection of smartphone GNSS measurements, we utilized the Geo++ Rinex Logger Android app, setting the cut-off elevation to 10 degrees and the cut-off signal-to-noise ratio (SNR) to 25 dB-Hz. To ensure comprehensive coverage, we collected observations from GPS, BDS, and Galileo constellations. In the experiment, we employed a precise single positioning model that utilizes only pseudo-range observations, as it is generally more accessible in smartphones. The ionospheric and tropospheric delays were estimated using the Klobuchar and Saastamoinen models, respectively. Additionally, we calculated the satellite position and clock offset by employing the interpolation method with ultra-rapid precise ephemeris, which can be downloaded from [[ftp://igs.gnsswhu.cn/pub/gnss/products/mgex/](ftp://igs.gnsswhu.cn/pub/gnss/products/mgex/)]([ftp://igs.gnsswhu.cn/pub/gnss/products/mgex/](ftp://igs.gnsswhu.cn/pub/gnss/products/mgex/)) (accessed on 10 April 2023) [46]. In terms of observation noise estimation, we applied a stochastic model based on the carrier-to-noise density ratio (\(C/N_{0}\)) [43]. Figure 7: Information on dataset collection. (**a**) Collection environment of the static datasets; (**b**) relative position of smartphones and geodetic receivers in static data collection; (**c**) trajectory of dynamic car-borne dataset collection; (**d**) relative position of three smartphones in dynamic data collection. ### Accuracy Statistics

In order to assess the algorithm's computational accuracy, we employed the root mean square error (RMSE) as a statistical measure to characterize the position and velocity computation performance of different methods.