In this section, we present different localization strategies using the received power (in dB) at the nodes. We first consider the (centralized) ML estimate and then we propose to use a suboptimal strategy based on local distance estimate at each node. We show that the proposed localization strategy can be implemented in a fully distributed way by only local communication among neighboring nodes.

### 3.1 ML estimation

Consider the presence of a centralized unit that gathers all measurements coming from the nodes. Let r = [*r*_{1}, . . . , *r*_{
M
} ]^{T} be a vector whose components are the different measurements taken by each sensor and denote **x** = [*x*_{
t
} *y*_{
t
} ]^{T} ∈ ℝ^{2} as the target's position. The true distance between the target and the *m* th sensor can be then expressed as

{d}_{m}=\phantom{\rule{2.77695pt}{0ex}}\left|\right|\mathbf{x}-{\mathbf{c}}_{m}\left|\right|,

(2)

where **c**_{
m
} = [*x*_{
m
} *y*_{
m
} ]^{⊤} ∈ ℝ^{2} are the coordinates of node *m* with *m* = 1, . . . , *M*. The vector of measurements **r** can now be written as

\mathbf{r}=\left[\begin{array}{c}\hfill {p}_{1}-10{\alpha}_{1}\mathsf{\text{lo}}{\mathsf{\text{g}}}_{10}\left(\frac{\left|\right|\mathbf{x}-{\mathbf{c}}_{1}\left|\right|}{{d}_{0}}\right)\hfill \\ \hfill \vdots \hfill \\ \hfill {p}_{M}-10{\alpha}_{M}\mathsf{\text{lo}}{\mathsf{\text{g}}}_{10}\left(\frac{\left|\right|\mathbf{x}-{\mathbf{c}}_{M}\left|\right|}{{d}_{0}}\right)\hfill \end{array}\right]+\left[\begin{array}{c}\hfill {n}_{1}\hfill \\ \hfill \vdots \hfill \\ \hfill {n}_{M}\hfill \end{array}\right]=\mathit{\mu}\left(\mathbf{x}\right)+\mathbf{n}

(3)

where the vector \mathbf{n}~\mathcal{N}\left(\mathbf{0},\mathbf{\sum}\right) is jointly Gaussian with zero mean and covariance **∑**. It is easy to see that **r** will follow a Gaussian distribution with mean *μ*(**x**) and covariance **∑**, that is

p\left(\mathbf{r};\mathbf{x}\right)=\frac{1}{{\left(2\pi \right)}^{M/2}\sqrt{det\mathbf{\sum}}}exp\left[-1/2{\left(\mathbf{r}-\mathit{\mu}\left(\mathbf{x}\right)\right)}^{\mathsf{\text{T}}}{\mathbf{\sum}}^{-1}\left(\mathbf{r}-\mathit{\mu}\left(\mathbf{x}\right)\right)\right]

(4)

where *p*(**r** ; **x**) is the probability density function of **r** with parameter **x**. The ML estimate of the target position is then

{\widehat{\mathbf{x}}}_{\mathsf{\text{ML}}}=\underset{\mathbf{x}}{arg\; max}p\left(\mathbf{r};\mathbf{x}\right),

(5)

which is equivalent to maximizing the log of *p*(**r** ; **x**). Neglecting all terms that do not depend on **x** it is easy to see that

{\widehat{\mathbf{x}}}_{\mathsf{\text{ML}}}=\underset{\mathbf{x}}{arg\; min}\mathit{\mu}{\left(\mathbf{x}\right)}^{\mathsf{\text{T}}}{\mathbf{\sum}}^{-1}\mathit{\mu}\left(x\right)-2{\mathbf{r}}^{\mathsf{\text{T}}}{\mathbf{\sum}}^{-1}\mathit{\mu}\left(\mathbf{x}\right).

(6)

The objective to be minimized in (6) is not convex and therefore, finding the global optimum is not an easy task. In Figure 2 (left), we have an illustration of how the objective in (6) looks like for a network of 20 nodes over a normalized square area. It is clear that the function is not convex and that several local minima and saddle point may exist. Instead of dealing directly with the ML estimate we propose to use a suboptimal approach that offers a reasonable good performance and that allows for its distributed computation.

### 3.2 Practical approach

In this section, we propose to estimate the target's position based on local distance estimates computed at each node. The use of local distance estimates allows the derivation of simple and distributed estimators of the target's position. We have that, for the propagation model (1), the ML estimate of the distance between the *m* th node and the target is given by

{\widehat{d}}_{m}={d}_{0}10\left(\frac{{p}_{m}-{r}_{m}}{10{\alpha}_{m}}\right).

(7)

Taking the square at both sides of (2) and further developing, it is easy to see that the following equation must be satisfied

\begin{array}{c}\hfill {d}_{1}^{2}={\mathbf{x}}^{\mathsf{\text{T}}}\mathbf{x}-2{\mathbf{c}}_{1}^{\mathsf{\text{T}}}\mathbf{x}+\left|\right|{\mathbf{c}}_{1}|{|}^{2}\hfill \\ \hfill \vdots \hfill \\ \hfill {d}_{M}^{2}={\mathbf{x}}^{\mathsf{\text{T}}}\mathbf{x}-2{\mathbf{c}}_{M}^{\mathsf{\text{T}}}\mathbf{x}+\left|\right|{\mathbf{c}}_{M}|{|}^{2}\hfill \end{array}

(8)

Rearranging terms we can express (8) in a more compact form as

\left[\begin{array}{c}\hfill {d}_{1}^{2}-\left|\right|{\mathbf{c}}_{1}|{|}^{2}\hfill \\ \hfill \vdots \hfill \\ \hfill {d}_{M}^{2}-\left|\right|{\mathbf{c}}_{M}|{|}^{2}\hfill \end{array}\right]=\left({\mathbf{x}}^{\mathsf{\text{T}}}\mathbf{x}\right)\cdot \mathbf{1}-2\underset{\mathbf{C}}{\underset{\u23df}{\left[\begin{array}{c}\hfill {\mathbf{c}}_{1}^{\mathsf{\text{T}}}\hfill \\ \hfill \vdots \hfill \\ \hfill {\mathbf{c}}_{M}^{\mathsf{\text{T}}}\hfill \end{array}\right]}}\mathbf{x}\mathsf{\text{,}}

(9)

where **1** is a *M* × 1 vector of all ones. However, we do not have the actual distances to the target but a noisy version of them as per (7). Define the vector \mathbf{b}={\left[{\left|\right|{\mathbf{c}}_{1}\left|\right|}^{2}-{\widehat{d}}_{1}^{2},\dots ,{\left|\right|{\mathbf{c}}_{M}\left|\right|}^{2}-{\widehat{d}}_{M}^{2}\right]}^{\mathsf{\text{T}}} and the vector-valued cost function **f**(**x**): ℝ^{2} ↦ ℝ ^{M} as

\mathbf{f}\left(\mathbf{x}\right)=\left({\mathbf{x}}^{\mathsf{\text{T}}}\mathbf{x}\right)\cdot \mathbf{1}-2\mathbf{C}\mathbf{x}+\mathbf{b}.

(10)

We can then get an estimate of the target's position by minimizing the norm of (10). In order to incorporate robustness and make the localization task more applicable to realistic scenarios we propose to use a weighted version of the cost function (10). In a WSN it may happen that some of the nodes exhibit a bias in their measurements due to the presence of obstacles. Additionally, nodes do not have precise information about their own locations instead, some errors may be present. The incorporation of weights will mitigate the effects of biased nodes and uncertainties in nodes' positions. So we compute an estimate \widehat{\mathbf{x}} of the true target's position **x** as the solution to the following non-linear (weighted) least-squares problem

\widehat{\mathbf{x}}=\underset{\mathbf{x}}{minimize}\u2225\mathbf{D}\mathbf{f}\left(\mathbf{x}\right)\u2225,

(11)

where **D** = diag (*γ*_{1}, . . . , *γ*_{
M
} ) is a diagonal weighting matrix with *γ*_{
m
}**≥** 0 for all *m* = 1, . . . , *M*. A proper choice for the weights would be inversely proportional to the variance of the measurements. As we are assuming the log-normal model for the measurements it is well known that the variance of the ML estimate (7) is proportional to the square of the true distance to be estimated [2, 16]. With this consideration in mind we may choose to weight our measurements inversely proportional to the measured distance, that is {\gamma}_{m}=1/{\widehat{d}}_{m}.

This problem has been studied in [17, 18] where a distributed version of the Gauss-Newton method can be used for its solution. In this study, we present a more flexible approach that uses concepts from convex optimization theory. The proposed approach has better convergence properties and also makes it straightforward to include additional constraints to the problem that may prevent it from instabilities. In order to proceed let's write problem (11) as the following equivalent problem

\widehat{\mathbf{x}}=\underset{\mathbf{x}}{minimize}{\sum}_{m=1}^{M}{\gamma}_{m}{\left({\mathbf{x}}^{\mathsf{\text{T}}}\mathbf{x}-2{\mathbf{c}}_{m}^{\mathsf{\text{T}}}\mathbf{x}+{b}_{m}\right)}^{2}

(12)

Note that, although (11) and (12) are equivalent problems (i.e., with the same solution), they are different because in the latter case we are minimizing the squared norm of **Df**(**x**). The minimization of the squared norm is motivated by the fact that it allows a simple distributed implementation as it can be guessed from the structure of (12). The use of the objective in (12) is well motivated by the fact that we get a smoother surface at the cost of introducing some bias with respect to the ML solution (see Figure 2 (right)). However, if the bias is small, we may still get to the ML estimate by performing a local search around the solution of (12). However, in order to use convex optimization methods we need problem (12) to be convex. Unfortunately, the objective function is not convex because we are adding the squares of quadratic convex but not necessarily positive functions [11]. It would be interesting to exploit some hidden convexity of the problem so that convex optimization methods can be applied.

A possible approach to make the problem convex is to use semidefinite relaxation technique. Let **X** = **xx**^{T}and note that Tr (**X**) = ||**x**||^{2}, where Tr(*·*) is the trace operator. We can rewrite the problem as

\begin{array}{c}\underset{\mathbf{X},\mathbf{x}}{minimize}{\sum}_{m=1}^{M}{\gamma}_{m}{\left(\mathsf{\text{Tr}}\left(\mathbf{X}\right)-2{\mathbf{c}}_{m}^{\mathsf{\text{T}}}\mathbf{x}+{b}_{m}\right)}^{2}\hfill \\ \mathsf{\text{subjectto}}\mathbf{X}\mathsf{\text{=}}\mathbf{x}{\mathbf{x}}^{\mathsf{\text{T}}}\hfill \end{array}

(13)

We now have that the objective is convex as it is the composition of an affine function of **X** and **x** with a convex function [11]. However, the above problem is still non-convex due to the non-linear constraint **X** = **xx**^{T}. We can then relax the equality constraint by replacing it with a semidefinite constraint. As a result we end up with the following (convex) SDP

\begin{array}{c}\underset{\mathbf{X},\mathbf{x}}{minimize}\phantom{\rule{1em}{0ex}}{\sum}_{m=1}^{M}{\gamma}_{m}{\left(\mathsf{\text{Tr}}\left(\mathbf{X}\right)-2{\mathbf{c}}_{m}^{\mathsf{\text{T}}}\mathbf{x}+{b}_{m}\right)}^{2}\hfill \\ \mathsf{\text{subjectto}}\mathbf{X}-\mathbf{x}{\mathbf{x}}^{\mathsf{\text{T}}}\succcurlyeq 0\hfill \\ \phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\phantom{\rule{0.3em}{0ex}}\phantom{\rule{0.3em}{0ex}}\mathbf{X}\in {\mathbb{S}}_{+}^{2}\hfill \end{array}

(14)

where {\mathbb{S}}_{+}^{2} is the set of 2 *×* 2 symmetric positive semi-definite matrices. As we are allowing for a larger feasible set, the optimal value of problem (14) would provide a lower bound on the optimal value of the original problem (12). However, if the optimal solution **X*** of (14) is of rank-one, we have that the semidefinite relaxation approach is not a relaxation at all and the found solution **x*** of (14) is also optimal for (12).

It would be interesting to give conditions under which (14) provides a rank-one solution so that the obtained solution is optimal for the original problem, too. To that end let define the matrix **A** as

\mathbf{A}=\left[\begin{array}{ccc}2{\sum}_{m}{\gamma}_{m}{x}_{m}\hfill & \phantom{\rule{0.3em}{0ex}}\phantom{\rule{0.3em}{0ex}}\phantom{\rule{0.3em}{0ex}}2{\sum}_{m}{\gamma}_{m}{y}_{m}\hfill & \phantom{\rule{0.3em}{0ex}}\phantom{\rule{0.3em}{0ex}}\phantom{\rule{0.3em}{0ex}}-{\sum}_{m}{\gamma}_{m}\hfill \\ 2{\sum}_{m}{\gamma}_{m}{x}_{m}^{2}\hfill & 2{\sum}_{m}{\gamma}_{m}{y}_{m}{x}_{m}\hfill & -{\sum}_{m}{\gamma}_{m}{x}_{m}\hfill \\ 2{\sum}_{m}{\gamma}_{m}{y}_{m}{x}_{m}\hfill & \phantom{\rule{0.3em}{0ex}}\phantom{\rule{0.3em}{0ex}}\phantom{\rule{0.3em}{0ex}}2{\sum}_{m}{\gamma}_{m}{y}_{m}^{2}\hfill & -{\sum}_{m}{\gamma}_{m}{y}_{m}\hfill \end{array}\right]

(15)

and let the vector *δ* be given by

\mathit{\delta}=\left[\begin{array}{c}\hfill {\sum}_{m}{\gamma}_{m}{b}_{m}\hfill \\ \hfill {\sum}_{m}{\gamma}_{m}{b}_{m}{x}_{m}\hfill \\ \hfill {\sum}_{m}{\gamma}_{m}{b}_{m}{y}_{m}\hfill \end{array}\right]

(16)

We then define the following feasibility problem

\begin{array}{cc}\mathsf{\text{find}}\hfill & \left\{\mathbf{z}\mathsf{\text{,}}t\right\}\hfill \\ \mathsf{\text{subjectto}}\hfill & {\u2225\mathbf{z}\u2225}^{2}\le t\hfill \\ \mathbf{A}\left[\begin{array}{c}\mathbf{z}\hfill \\ t\hfill \end{array}\right]=\mathit{\delta}\hfill \end{array}

(17)

with variables **z** ∈ ℝ^{2} and *t* ∈ ℝ_{+}. The above problem is convex since it belongs to the class of second-order cone program (SOCP) [11]. Based on the feasibility problem (17) we can state the following result:

**Proposition 1**. *Assume problem (12) has at least one strictly feasible point. If problem (17) is not feasible*, *then the optimal solution* **x*** *of the semidefinite relaxed problem (14) is also optimal for the original problem (12)*.

*Proof*. See the Appendix. □

**Corollary 2**. *If matrix* **A** *is singular then, the solution* **X*** *of (14) is of rank one with* **X*** = **x*****x***^{T}*and* **x*** *is also optimal for (12)*.

*Proof*. It follows directly from Proposition 1. If **A** is singular then, problem (17) is infeasible (because matrix **A** is not invertible) so that the relaxed problem is not a relaxation at all. □

It is worth to mention that the feasibility problem (17) can be easily checked without the requirement of an optimization solver. If matrix **A** is singular then, the problem is infeasible and we are done. If however, matrix **A** is full-rank, we compute **A**^{- 1}*δ* (which is unique) and check whether it satisfies the second order cone (SOC) constraint ||**z**|| ^{2}*≤ t*. If the constraint is not met then we conclude that the problem is infeasible.