# Connected Objects Geo-Localization Based on SS-RSRP of 5G Networks
## 3 Distance Estimation  
The initial phase of the proposed solution is to simulate a realistic RSS environment using Matlab. The model setup deploys the log-normal shadowing model as presented in (2). All parameters are set using empirical observations and Gaussian noises \(\Phi_{dBm}(d)\) and \(\Xi_{dBm}(d,t)\). The MC position is supposed well known fixed at (0,0) and any estimated distance will be calculated based on (\(l_{2}\)) norm. Each environment has its own empirical path loss constants \(n\) as in (2). Hence it will be crucial to extrapolate correct \(n\) values as described. The \(n\) value is obtained by setting the derivative of the following mean square error estimate \(J(n)=\Sigma_{i=1}^{k}(-PL_{d_{0}}-\chi_{\sigma}-10n\log 10(\frac{d_{i}}{d_{0}}))^{2}\) to zero, \(\frac{\partial J(n)}{\partial n}=0\). The Algorithm 1 describes the initial phase for a realistic RSS environment, measured at the receive antenna, where \(P_{t}\) denotes the transmit power (dBm) of the transmitter, \(d_{0}\) is the reference distance \(d_{0}(m)\), \(Pd_{0}\) is the received power at the distance \(d_{0}\) and \(PL_{d_{0}}=P_{t}-Pd_{0}\) is the path loss at the reference distance. The Algorithm 1 will serve to generate a realistic RSS value to be used in the next estimation phase as described in Algorithm 2. The Algorithm 2 summarizes the needed steps to estimate the distance between two COs. The COs are supposed to be in move while deploying a 5G NR radio access network. ```
1:Phase I: Initialization
2:CO\({}_{\text{position}}=(x_{1},y_{1})\)\(\triangleright\) Initial position of the first CO
3:MC\({}_{\text{position}}=(0,0)\)\(\triangleright\) Initial position of the MC
4:Estimate \(n\) value using \(\frac{\partial(n)}{\partial n}=0\)
5:Set values of \(P_{d_{0}},Pd_{0},PL_{d_{0}}\)
6:\(d_{\text{dm}}(n)=rand(x,y)\)\(\triangleright\) Std. deviation of Shadowing in spatial domain (x,y)
7:\(\Xi_{\text{dm}}(d,t)=rand(x)\)\(\triangleright\) Std. deviation of Gaussian noise in temporal domain
8:Phase II: Generates real RSS value
9:for\(n\) in 0 to limit; do
10:for\(n\) in 1 to limit; do
11:if\((x,y)=(0,0)\)then
12:elseif\((x,y)=(n,y)\)then
13:elseif\((x,y)=(x_{1},y_{1})\)then
14:\(\text{rss}(x,y)=P_{t}\)
15:else
16:\(\text{rss}(x,y)=\)\(P_{t}-PL_{d_{0}}-10n\log 10(\frac{\sqrt{(\chi_{1}^{2}+y_{1}^{2})}}{d_{0}})-\Phi_{ \text{dBm}}(d)-\Xi_{\text{dBm}}(d,t)\)
17:endif
18:endfor
19:endfor
```  
**Algorithm 1** Simulation of a realistic RSS environment ```
1:for\(i\) in \(1\) to \(q\)do
2: RSSI\({}^{i}\) values acquisition using Algorithm 1
3:\(\widehat{\text{SS}}_{\text{RSRP}}{}^{j}[\text{dBm}]=\text{RSSI}^{i}[\text{dBm}]+10 \log 10(\frac{n_{e}}{N})\)\(\triangleright\) SS-RSRP Estimation as in (12)
4:\(\hat{\theta_{i}}=\sqrt{(\frac{70\pi}{180})^{2}(\widehat{\text{SS}}_{\text{RSRP}} {}^{j}-P_{E}^{i})}\)\(\triangleright\) Angle estimation as in (14)
5:\(\hat{d}_{i}=d_{0}10^{-\frac{\text{RSSI}^{i}-\text{RSSI}^{i}+\hat{\pi}_{i}}{10}}\)\(\triangleright\) Frontal distance estimation as in (14)
6:endfor
7:for\(j\) in \(1\) to \(p\)do
8:\(\widehat{\text{SS}}_{\text{RSRP}}{}^{j}[\text{dBm}]=\text{RSSI}^{j}[\text{dBm }]+10\log 10(\frac{n_{e}}{N})\)\(\triangleright\) SS-RSRP Estimation as in (12)
9:\(\hat{\theta_{j}}=\sqrt{(\frac{70\pi}{180})^{2}(\widehat{\text{SS}}_{\text{RSRP} }{}^{j}-P_{E}^{i})}\)\(\triangleright\) Angle estimation as in (14)
10:\(\hat{d}_{j}=d_{0}10^{-\frac{\text{RSSI}^{i}-\text{RSSI}^{i}+\hat{\pi}_{j}}{10}}\)\(\triangleright\) Frontal distance estimation as in (14)
11:endfor
12:for\(i\) in \(1\) to \(q\)do
13:for\(j\) in \(1\) to \(p\)do
14:\(D_{ij}=d_{i}^{2}+d_{j}^{2}-2d_{i}d_{j}\cos(\alpha_{ij})\)\(\triangleright\) Mutual distance estimation as in (16)
15:endfor
16:endfor
```

**Algorithm 2** Distance Estimation in 5G NR

## 4 Numerical Results and Validation

We consider a 5G NR transmission system whose parameters, taken by 5G Release 15 [28], are listed in Table 1. To obtain all the numerical results shown in the next of this section, 10,000 independent realizations were simulated.