# Evaluation of 5G Positioning Performance Based on UTDoA, AoA and Base-Station Selective Exclusion
## 3 Position Solution and Measurement Exclusion
### Location Solution Based on Time of Arrival  
Given the known location \(\mathbf{x}_{BS,n}\) of the \(n\)-th position among \(M_{\text{BS}}\) available BSs, the unknown 3D receiver position \(\mathbf{x}\) is solved based on the Weighted Least Squares (WLS) classical solution of the UTDoA positioning problem by using the well-known iterative Gauss-Newton (GN) method. The BSs used for positioning are the ones closer in distance with the UE, relative to a reference coordinate. It is worth noting that \(\hat{\rho}_{n}\) in (1) is a non-linear function of the user's position. However, it can be linearized using its Taylor series around a user's tentative position \(\hat{\mathbf{x}}=[\hat{x},\hat{y},\hat{z}]^{T}\). Using the tentative position, we calculate the approximate pseudo-range \(\hat{\rho}_{\text{TDoA},n}\) in (2), for \(1\leq n<M_{\text{BS}}-1\). With \(M_{\text{BS}}\geq 4\) BSs, it is possible to provide a single solution. The GN solution at the \(l\)-th iteration is:  
\[\hat{\mathbf{x}}_{l}=\hat{\mathbf{x}}_{l-1}+(\mathbf{G}_{\text{TDoA},l-1}^{T} \mathbf{W}_{\text{TDoA},l-1}^{-1}\mathbf{G}_{\text{TDoA},l-1}^{T}\mathbf{W}_{ \text{TDoA}}^{-1}(\rho(\hat{\mathbf{x}}_{l-1})-\hat{\rho}), \tag{15}\]where  
\[ \begin{split}\hat{\rho}(\hat{\mathbf{x}}_{l-1})=[\hat{\rho}_{1}( \hat{\mathbf{x}}_{l-1}),\hat{\rho}_{2}(\hat{\mathbf{x}}_{l-1}),\dots,\hat{\rho} _{M_{\text{BS}-1}}(\hat{\mathbf{x}}_{l-1})]^{T},\\ \rho_{m}(\hat{\mathbf{x}}_{l-1})=\parallel\mathbf{x}_{\text{BS},1}- \hat{\mathbf{x}}\parallel-\parallel\mathbf{x}_{\text{BS},(n+1)}-\hat{\mathbf{ x}}\parallel,for\ 1\leq n<M_{\text{BS}-1},\end{split}  \tag{16}\]  
is the vector of measured pseudo-ranges corresponding to the linearization reference position \(\hat{\mathbf{x}}\),  
\[\hat{\mathbf{\rho}}=[\rho_{\text{TDoA},1},\dots,\rho_{\text{TDoA},M_{\text{BS}-1}} ]^{T}, \tag{17}\]  
is the vector of predicted pseudo-ranges corresponding to the real receiver position \(\mathbf{x}\), \(\mathbf{W}_{\text{TDoA}}\) is the weighting matrix formed by the weighting coefficients of the TDoA observables as:  
\[\mathbf{W}_{\text{TDoA}}= \begin{bmatrix}\sigma_{1}^{2}+\sigma_{2}^{2}&\sigma_ {1}^{2}&\cdots&\sigma_{1}^{2}\\ \sigma_{1}^{2}&\sigma_{1}^{2}+\sigma_{3}^{2}&\cdots&\sigma_{1}^{2}\\ \vdots&\vdots&\ddots&\vdots\\ \sigma_{1}^{2}&\sigma_{1}^{2}&\cdots&\sigma_{1}^{2}+\sigma_{M_{\text{BS}}}^{2 }\end{bmatrix}  \tag{18}\]  
where \(\sigma_{n}^{2}\) is the variance of the \(n\)-th ranging errors and \(\mathbf{G}_{\text{TDoA}}\) is the geometry matrix defined as:  
\[\mathbf{G}_{\text{TDoA},(n,1;3)}= \begin{bmatrix}\frac{\mathbf{x}_{\text{BS},1} -\hat{\mathbf{x}}}{\parallel\mathbf{x}_{\text{BS},1}-\hat{\mathbf{x}}}- \frac{\mathbf{x}_{\text{BS},(n+1)}-\hat{\mathbf{x}}}{\parallel\mathbf{x}_{ \text{BS},(n+1)}-\hat{\mathbf{x}}\parallel}\end{bmatrix} . \tag{19}\]  
We ensure full rank of \(\mathbf{G}_{\text{TDoA}}\), which guarantees the invertibility of \(\mathbf{G}_{\text{TDoA}}^{T}\mathbf{W}_{\text{TDoA}}\mathbf{G}_{\text{TDoA}}\). The GN method often converges quickly, especially when the iteration begins with a reference position close enough to the true position. However, if the iteration begins far from the target position, convergence may be slow or may not be achieved at all. These cases are avoided and not taken into account when calculating the position. The computation position approach is applicable to RTT positioning solution as well, with some minor changes. Using (15),  
\[\hat{\rho}(\hat{\mathbf{x}}_{l-1})=[\hat{\rho}_{1}(\hat{\mathbf{x}}_{l-1}), \hat{\rho}_{2}(\hat{\mathbf{x}}_{l-1}),\dots,\hat{\rho}_{M_{\text{BS}}}(\hat{ \mathbf{x}}_{l-1})]^{T} \tag{20}\]  
is the vector of measured pseudo-ranges corresponding to the linearization reference position \(\hat{\mathbf{x}}\),  
\[ \begin{split}\rho_{n}(\hat{\mathbf{x}}_{l-1})=\parallel\mathbf{x} _{\text{BS},n}-\hat{\mathbf{x}}\parallel,for\ 1\leq n<M_{\text{BS}},\\ \hat{\mathbf{\rho}}=[\rho_{\text{RTT},1},\cdots,\rho_{\text{RTT},M_{\text{BS}}} ]^{T},\end{split}