# 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  
In this section, we propose a two-step localization algorithm based on hybrid TOA/RSS range measurements between the blind node and all the anchors in the network. We first address the problem of range estimation by resorting to an adaptive variant of the hybrid estimator derived in [44]. Differently from such a previous work, in which all the parameters are assumed to be known, in this paper we consider the more realistic case where the model parameters have been estimated \"on the field\" according to the self-calibration procedure described in Section 3.1. Moreover, we explicitly address the problem of nodes synchronization by including the clock offsets in all the considered models, as opposed to [44] where nodes are assumed to be perfectly synchronized. To formalize the hybrid range estimation problem, we recast the ML formulation in Equation (8) as a function of the sole unknown distances \(d_{i,b}=\|x_{i}-x_{b}\|\), \(i=1,\ldots,N\), i.e.,  
\[\hat{d}_{i,b}=\operatorname*{arg\,min}_{d_{i,b}}L^{\prime}(r_{i,b},t_{i,b}|d_{ i,b}), \tag{29}\]with \(L^{\prime}(\cdot)\) an equivalent transformation of the negative log-likelihood, i.e.,  
\[L^{\prime}(r_{i,b},t_{i,b}|d_{i,b})=(r_{i,b}-\hat{P}_{0}+10\hat{a}\log_{10}d_{i,b })^{2}\phi_{t}^{2}+\left(t_{i,b}-\frac{d_{i,b}}{c}-\hat{t}_{b}+\hat{t}_{i} \right)^{2}\phi_{r}^{2}, \tag{30}\]  
where we replaced the unknown TOA/RSS model parameters with their estimates obtained in the preliminary calibration phase. The hybrid TOA/RSS ML estimator is then obtained by imposing the first-order optimality condition:  
\[\frac{\partial L^{\prime}(r_{i,b},t_{i,b}|d_{i,b})}{\partial d_{i,b}}=0, \tag{31}\]  
which yields:  
\[\frac{\phi_{t}^{2}}{d_{i,b}}(r_{i,b}-\hat{P}_{0}+\hat{a}\log d_{i,b})\hat{a}- \frac{\phi_{r}^{2}}{c}\left(t_{i,b}-\frac{d_{i,b}}{c}-\hat{t}_{b}+\hat{t}_{i} \right)=0, \tag{32}\]  
where we introduced \(\hat{a}=\frac{10\hat{a}}{\log 10}\) to simplify the notation. Similarly to Equation (9), Equation (32) still does not admit any closed-form solution in \(d_{i,b}\). We can re-arrange Equation (32) as:  
\[\log d_{i,b}=-\frac{\hat{\gamma}^{2}}{\hat{a}^{2}}d_{i,b}^{2}+\frac{\hat{ \gamma}^{2}c(t_{i,b}-\hat{t}_{b}+\hat{t}_{i})}{\hat{a}^{2}}d_{i,b}-\frac{r_{ i,b}-\hat{P}_{0}}{\hat{a}}, \tag{33}\]  
where \(\hat{\gamma}=\frac{\phi_{r}}{c\hat{t}_{i}}\). It can be noticed that the right-hand side of the above equation is quadratic in the unknown \(d_{i,b}\). Following the same idea of [44], we relax such a quadratic function to an affine function of the form \(md_{i,b}+q\), with \(m\) and \(q\) unknown parameters to be determined from a simple linear regression. Denoting with \(m^{*}\) and \(q^{*}\) the optimal (in the ordinary LS sense) values resulting from the linear fitting, it follows that Equation (33) reduces to:  
\[\log d_{i,b}=m^{*}d_{i,b}+q^{*}. \tag{34}\]  
Based on the above relaxation, the closed-form expression of the hybrid TOA/RSS range estimator for \(m^{*}<0\) is given by:  
\[\hat{d}_{i,b}=\frac{1}{\phi}W_{0}(\phi\mathrm{e}^{\eta}), \tag{35}\]  
where \(W_{0}(\cdot)\) denotes the principal branch of the Lambert W-function [59] and, in turn,  
\[\phi=\frac{\hat{\gamma}^{2}}{\hat{a}^{2}}\left[c(\hat{t}_{b}-\hat{t}_{i}-t_{ i,b})+\delta\right],\qquad\eta=\frac{\hat{\gamma}^{2}}{\hat{a}^{2}}\left[ \frac{\hat{a}}{\hat{\gamma}^{2}}(\hat{P}_{0}-r_{i,b})+\tilde{\delta}\right], \tag{36}\]  
with \(\delta=A+B\) and \(\tilde{\delta}=\frac{A^{2}+B^{2}}{2}\ -\ \frac{(B-A)^{2}}{3}\), where \(A\) and \(B\) are design parameters representing the extrema of the interval \([A,B]\) used for the linear regression. The expression of the hybrid estimator for the case of \(m^{*}>0\) requires only minor modifications; for the sake of conciseness, we omit it here and refer the interested reader to [44] for further details. A few comments are now in order.