# Hybrid TOA/RSS Range-Based Localization with Self-Calibration in Asynchronous Wireless Networks
## 3 Proposed Localization Algorithm with Self-Calibration
### Hybrid TOA/RSS Range-Based Localization
First, we observe that the estimator \(\hat{d}_{i,b}\) provided in Equation (34) is only a function of the edges of the interval \([A,B]\), which are thus two design parameters that can regulate the algorithm performance. Second, it is interesting to notice that \(W_{0}(y)\) grows as slow as \(\log y-\log\log y\); therefore, the Lambert W-function can be efficiently computed by resorting to a look-up table that stores its values only in correspondence of integer arguments, without any appreciable difference in the obtained results. This nice property makes the hybrid estimator amenable to practical implementation even on low-cost nodes where only few kilobytes of memory are available for storage of local data. The final positioning step will be performed by exploiting the \(N\) distance estimates \(\hat{d}_{i,b}\), \(i\,=\,1,\ldots,N\) obtained by the blind node during the previous ranging phase. More precisely, we can set up the following system of nonlinear equations:  
\[ \begin{cases}\hat{d}_{1,b}=\|\mathbf{x}_{1}-\mathbf{x}_{b}\|+n_{1,b}\\ \hat{d}_{2,b}=\|\mathbf{x}_{2}-\mathbf{x}_{b}\|+n_{2,b}\\ \vdots\\ \hat{d}_{N,b}=\|\mathbf{x}_{N}-\mathbf{x}_{b}\|+n_{N,b}\end{cases} , \tag{37}\]  
where \(n_{i,b}\) denotes the generic error associated to the range estimation process. As it can be noticed, all the equations in Model (37) depend on the sole unknown blind position \(\mathbf{x}_{b}\). To solve such a system, we consider a simpler variant of the ILS procedure applied to Equation (26), but without offsets in the range equations. In particular, we first differentiate the range equations to obtain the linearized system:  
\[\delta d_{i,b}=\frac{(x_{i}-x_{b})\delta x_{b}+(y_{i}-y_{b})\delta y_{b}}{ \sqrt{(x_{i}-x_{b})^{2}+(y_{i}-y_{b})^{2}}}\qquad i=1,\ldots,N, \tag{38}\]  
where \(\delta x_{b}\) and \(\delta y_{b}\) are regarded as the sole unknowns, while now we set the initial guess for \(x_{b}\) and \(y_{b}\) equal to the coarse estimate \(\mathbf{\hat{x}}_{b}=[\hat{x}_{b}\ \hat{y}_{b}]^{T}\) as obtained in the last step of the calibration phase. The LS solution of Equation (37) can be then computed as:  
\[ \begin{bmatrix}\delta x_{b}\\ \delta y_{b}\end{bmatrix} = \begin{bmatrix}\frac{x_{1}-x_{b}}{d_{1,b}}&\frac{y_{1 }-y_{b}}{d_{1,b}}\\ \frac{x_{2}-x_{b}}{d_{2,b}}&\frac{y_{2}-y_{b}}{d_{2,b}}\\ \vdots&\vdots\\ \frac{x_{N}-x_{b}}{d_{N,b}}&\frac{y_{N}-y_{b}}{d_{N,b}}\end{bmatrix} ^{\dagger} \begin{bmatrix}\delta d_{1,b}\\ \delta d_{2,b}\\ \vdots\\ \delta d_{N,b}\end{bmatrix} , \tag{39}\]  
and is used to update the current estimate \([x_{b}\ y_{b}]^{T}\). In this case, the algorithm computes the difference \(\Delta_{i}\) between the estimated ranges \(\hat{d}_{i,b}\) and the predicted ranges \(d_{i,b}\) calculated on the basis of the current guess \([x_{b}+\delta x_{b}\ \ y_{b}+\delta y_{b}]^{T}\). Then, \(\delta d_{i,b}\) is set equal to \(\Delta_{i}\) for the next iteration. Again, the algorithm stops when the error \(\sqrt{\delta x_{b}^{2}+\delta y_{b}^{2}}\) falls below a predefined threshold or when a maximum number of iterations has been exceeded. As already discussed above, the ILS algorithm is robust against local minima and exhibits fast convergence. In other words, it can be considered a valid alternative to optimization routines (unfeasible for problem in Equation (8)) and, at the same time, a much lighter solution compared to a two-dimensional grid search.