## 3 Smart Collaborative Positioning Using CD Approach
### Best Satellites Selection Algorithm in CD Process
To have good satellites, the threshold can be set at \(10^{\circ}\), i.e., exclude satellites with elevation lower than \(10^{\circ}\), even it is very common to define an elevation mask of \(5^{\circ}\). The algorithm will just choose the satellites having the best angles, i.e., which have the highest angles. This operation corresponds to Equation (19). * Assign weights to each satellite in view corresponding to both parameters, \(z_{1,k}\) for \(C/N_{0}\) and \(z_{2,k}\) for the elevation angle. * Compute the cost function according to assigned weights and select the best satellites. If the satellites selected by each RS have the same parameters by calculating the cost function, then select the satellites that make up the best GDOP among the satellites, i.e., look up the optimal geometry according to the number of available satellites. This operation corresponds to Equation (20). * Choose the best RS, which has optimal results, among the available RS which can assist the MS. The choice of the best RS can be made by comparing their statistical characteristics, i.e., the results obtained in code phase estimation from both RS. For each RS, the mean error and the standard deviation of the difference between the estimated code phase and the true code phase are compared. If all RS have the same parameters or the same costs (almost impossible in reality), choose the nearest reference station, and in the case where the RSs are at an equal distance from the MS, choose one RS randomly. Otherwise, an interesting alternative is to use two or more RS at the same time in the calculation of individual and collective detection metrics to estimate the position of the MS. The feasibility of this technique is demonstrated in [14]. * Send assistance data from the best RS or from both RS according to step 4. * Correlation as a function of code phase and Doppler estimated by SPL method with delta correction, refered to Equation (16). - Based on polar coordinates in 2 or 3 iterations
- CD metric is calculated as the sum of the best satellites chosen in steps 1, 2 and 3, while combining measurements from all RS. * Estimate the user MS position. To select the best RS having the best parameters, the decision-making process is multi-objective oriented where the cost functions help making the decision and it is modeled as:  
\[\max\{y\}=f(\overline{z})=\left[f(\overline{z}_{1,k}),f(\overline{z}_{2,k})\right] \tag{15}\]  
where \(\overline{z}_{1,k}=(z_{1,1},z_{1,2},\ldots,z_{1,k})\in Z_{1}\) corresponds to the \(C/N_{0}\) for all satellites in view; \(\overline{z}_{2,k}=(z_{2,1},z_{2,2},\ldots,z_{2,k})\in Z_{2}\) corresponds to the elevation angle for all visible satellites; and \(\overline{y}=(y_{1},y_{2},\ldots,y_{n})\in Y\) corresponds to steps 3 and 4 of the above procedure. In case we need to use more than one reference station, we can merge the measurements obtained from the different RS and then calculate the metrics for individual as follows [14]:  
\[D_{ind}\left(R_{i},\theta_{j},\Delta B_{n}\right)=\sum_{n=1}^{Rn}w_{n}\left|S_ {\delta}\left(\hat{z}_{k}^{n},\hat{f}_{d_{k}}^{n}\right)\right|^{2} \tag{16}\]where \(n\) represents the reference station number, \(R_{n}\) represents the total number of reference stations, and \(w_{n}\) represents the weight of each RS corresponding to its parameters, such as:  
\[w_{n}[\left(\begin{array}{c}C/N_{0}\right)_{k},el_{k}]=w_{n,1}[\left(C/N_{0} \right)_{k}]w_{n,2}(el_{k}) \tag{17}\]  
For \(C/N_{0}\), weighting cost is calculated as:  
\[w_{n,1}(x)=\left\{ \begin{array}{ll}10^{\frac{x-45}{x}}\left(\left(V_{f} \times 10^{\frac{x-45}{x}}-1\right)\frac{x-45}{P-45}+1\right)^{-1},&x<45\; \mathrm{dBHz}\\ 1&,\;\;x\geq 45\;\mathrm{dBHz}\end{array} \right.