In ODF, the source node sends data to the destination node according to two modes, DT or DF. Assuming a frame of normalized duration *T*_{
f
}= 1, we can compute the achievable rate of ODF as [3]

{C}_{\text{ODF}}\left(\tau \right)=\text{max}\left\{{C}_{\text{DT}},{C}_{\text{DF}}\left(\tau \right)\right\},

(2)

where *C*_{DT} and *C*_{DF}(*τ*), respectively, denote the capacity of DT and the achievable rate of DF [2]. These are given by

{C}_{\text{DT}}={C}_{S,D}

(3)

In (3) and (4), *C*_{S,D}, *C*_{S,R} and *C*_{R,D} denote the capacities of the links S–D, S–R, and R–D, respectively. Assuming the system model of “PLC system model” section, they are given by [22]

\begin{array}{ll}\phantom{\rule{6pt}{0ex}}{C}_{x,y}=& \frac{1}{\mathit{\text{MT}}}\sum _{k\in {\mathbb{K}}_{\text{on}}}\mathrm{lo}{g}_{2}\left(1+{\mathit{\text{SNR}}}_{x,y}^{\left(k\right)}\right),\\ \{x,y\}\in \left\{\{S,D\};\{S,R\};\{R,D\}\right\},\end{array}

(5)

where

\mathit{\text{SN}}{R}_{x,y}^{\left(k\right)}={P}_{x,\text{mode}}^{\left(k\right)}\frac{|{H}_{x,y}^{\left(k\right)}{|}^{2}}{{P}_{w,y}^{\left(k\right)}}={P}_{x,\text{mode}}^{\left(k\right)}{\eta}_{x,y}^{\left(k\right)},

(6)

is the signal-to-noise ratio (SNR) in sub-channel *k* for the link *x*–*y*, *T* is the sampling period, and {\eta}_{x,y}^{\left(k\right)} denotes the normalized SNR for the link *x*–*y* in sub-channel *k*. Furthermore, in (4), **P**_{
S
,
DF
} and **P**_{
R
,
DF
} denote the vectors (with \left|{\mathbb{K}}_{\text{on}}\right| elements) of the sub-channel powers at the source and at the relay node, respectively. As it will be clear in the following, it is convenient to express the arguments of the minimization in (4) through the functions *f*_{1} and *f*_{2}.

To simplify the notation, in (5), we do not explicitly show the dependance of the capacity from the transmitted power distribution, which will be done if needed in the following. We notice that an SNR gap can be used in (5) to take into account that practical coding and modulation schemes are used, e.g., the HPAV broadband PLC system employs turbo codes that allow for having an SNR gap of less than 3 dB versus capacity (5) [23]. Furthermore, in (5), we have implicitly assumed perfect channel state information, this is because in this study we want to investigate theoretical performances. However, in this respect, we notice that PLC channels can be considered time invariant over the duration of several OFDM symbols, which allows accurate SNR estimation. It should also be noted that our analysis is in terms of achievable rate that corresponds to the definition of delay-limited capacity according to [3, 24]. This capacity formulation is appropriate especially for delay sensitive applications as voice and video where long delays cannot be tolerated. In this respect, sufficiently long codes can achieve the instantaneous capacity defined in (4) and (5) since the PLC channel can be assumed constant for a long period of time. Channel variations are due to topology changes. In practice moderate long codes, that introduce tolerable delay, should come close to the theoretical limit.

From (2)–(4), it is interesting to note that a necessary condition not to use the direct link is *C*_{S,D}< min{*C*_{S,R},*C*_{R,D}}. In the remaining cases, to see whether the communication follows the DT or the DF mode, we need to compute *C*_{DT}, *C*_{DF}(*τ*) and compare them as in (2) to determine the largest. We also note that (2)–(4) already take into account the case in which the destination cannot listen to the source, i.e., \left|{H}_{S,D}^{\left(k\right)}\right|=0∀k\in {\mathbb{K}}_{\text{on}}.

In “Rate improvements with ODF” and “Power saving with ODF” sections, we will, respectively, deal with the power allocation for achievable rate improvements and power saving of ODF.

### Rate improvements with ODF

From (2), we note that the achievable rate of ODF is a function of both the transmitted power distribution and the time slot allocation. In order to maximize it, when the DT is used, we only need to optimally allocate the power among the sub-channels of the source node. To the contrary, when the DF mode is used, we need to optimally allocate the power and the time slot of the source and relay.

Assuming that the network nodes have to satisfy a PSD mask constraint, it is known that the sub-channel power allocation that maximizes the capacity for a point-to-point communication corresponds to the one given by the PSD constraint itself [25]. This can simply be proven by observing that the capacity formula (5) monotonically increases with the sub-channel allocated power. Therefore, for both ODF transmission modes, we set {P}_{x,\text{mode}}^{\left(k\right)}=\overline{P}, with *x* ∈ {*S* *R*}, and k\in {\mathbb{K}}_{\text{on}}. Now, to maximize the ODF achievable rate (2), we only need to compute the optimal time slot duration that can be found maximizing (4), i.e.,

{\tau}_{\mathit{\text{mr}}}^{\ast}=\underset{\tau \in \left[0,1\right]}{argmax}\left\{{C}_{\text{DF}}\left(\tau \right)\right\},

(7)

where we have used the subscripts *mr* to indicate that {\tau}_{\mathit{\text{mr}}}^{\ast} is the time slot duration that maximizes the achievable rate. To solve (7), we observe that once the power transmitted by the source and the destination nodes is set, the arguments of the minimization in (4) are linear functions of *τ*. Assuming that *C*_{S,R}≥ *C*_{S,D}, the optimal time slot duration (0 ≤ *τ* ≤ 1) is given by the intersection {f}_{1}\left({\tau}_{\mathit{\text{mr}}}^{\ast},{\mathbf{P}}_{\mathbf{S},\mathbf{\text{DF}}}\right)={f}_{2}\left({\tau}_{\mathit{\text{mr}}}^{\ast},{\mathbf{P}}_{\mathbf{S},\mathbf{\text{DF}}},{\mathbf{P}}_{\mathbf{R},\mathbf{\text{DF}}}\right), with {P}_{S,\mathit{\text{DF}}}^{\left(k\right)}={P}_{R,\mathit{\text{DF}}}^{\left(k\right)}=\overline{P}\forall \phantom{\rule{2.77695pt}{0ex}}k\in \phantom{\rule{2.77695pt}{0ex}}{\mathbb{K}}_{\text{on}}.

### Power saving with ODF

In this section, we consider the use of ODF for power saving and coverage extension. As discussed in the previous section, in ODF the relay is used when the DF achievable rate is higher than that of DT. Now, let us suppose that the relay is used and we want to achieve a given target rate under a PSD constraint. Then, we can have three cases. The first case is when the target rate is reachable either using DT or DF. In such a case, since the DF achievable rate is higher than that of DT, the amount of power saved lowering the rate of DF to the target value will be higher than that saved lowering the rate of DT to the target value. The second case is when only the DT rate is lower than the target rate. In this case, the use of the relay can increase the network coverage. The third case is when the achievable rate of both modes is lower than the target rate so that the use of the relay increases the achieved rate possibly toward the target.

To compute the power necessary by ODF to achieve a target rate *R* when the communication is subject to a PSD constraint, we can solve the problem

{P}_{\text{ODF}}=\text{min}\left\{{P}_{\text{DT}},{P}_{\text{DF}}\right\},

(8)

where *P*_{DT} and *P*_{DF}, respectively, denote the minimum power required by the DT and DF modes to achieve a rate *R* under a PSD constraint. Therefore, *P*_{DT} is the solution to the problem

\begin{array}{l}\phantom{\rule{4pt}{0ex}}{P}_{\text{DT}}=\text{min}\sum _{k\in {\mathbb{K}}_{\text{on}}}{P}_{S,\text{DT}}^{\left(k\right)}\phantom{\rule{2em}{0ex}}\\ \text{s.t.}\phantom{\rule{1em}{0ex}}& {C}_{S,D}=R,\phantom{\rule{2em}{0ex}}\\ 0\le {P}_{S,\text{DT}}^{\left(k\right)}\le \overline{P}\phantom{\rule{1em}{0ex}}\forall \phantom{\rule{1em}{0ex}}k\in {\mathbb{K}}_{\text{on}},\phantom{\rule{2em}{0ex}}\end{array}

(9)

while *P*_{DF} is the solution to the problem

\begin{array}{l}{P}_{\text{DF}}=\text{min}\sum _{k\in {\mathbb{K}}_{\text{on}}}\tau {P}_{S,\text{DF}}^{\left(k\right)}+(1-\tau ){P}_{R,\text{DF}}^{\left(k\right)}\phantom{\rule{2em}{0ex}}\\ \text{s.t.}\phantom{\rule{1em}{0ex}}& {C}_{\text{DF}}\left(\tau \right)=\text{min}\left\{\tau {C}_{S,R},\tau {C}_{S,D}+(1\phantom{\rule{0.3em}{0ex}}-\phantom{\rule{0.3em}{0ex}}\tau ){C}_{R,D}\right\}=R,\phantom{\rule{2em}{0ex}}\\ 0\le \tau \le 1,\phantom{\rule{2em}{0ex}}\\ 0\le {P}_{S,\text{DF}}^{\left(k\right)}\le \overline{P},\phantom{\rule{2em}{0ex}}\\ 0\le {P}_{R,\text{DF}}^{\left(k\right)}\le \overline{P},\phantom{\rule{1em}{0ex}}\forall \phantom{\rule{1em}{0ex}}k\in {\mathbb{K}}_{\text{on}}.\phantom{\rule{2em}{0ex}}\end{array}

(10)

Starting from (9), we note that its objective and its inequality constraint functions are convex, but its equality constraint is not an affine function. Therefore, (9) is not in general a convex problem ([26], pp. 136–137). Nevertheless, we note that the equivalent problem (see [26], p. 67) for the definition of equivalent problems), obtained considering the change of variables {P}_{S,\text{DT}}^{\left(k\right)}=({2}^{{b}_{S,\text{DT}}^{\left(k\right)}}-1)/{\eta}_{S,D}^{\left(k\right)}, where {b}_{S,\text{DT}}^{\left(k\right)}=\mathrm{lo}{g}_{2}\left(1+{P}_{S,\text{DT}}^{\left(k\right)}{\eta}_{S,D}^{\left(k\right)}\right), is a convex optimization problem. The solution to the equivalent problem (assuming that it exists^{a}) it is well known and it can be found imposing the KKT conditions (cf. e.g., [25]). Hence, the solution to the original problem (9) can simply be found applying the inverse change of variables to the solution of the equivalent problem, and it is equal to

{P}_{S,\text{DT}}^{\left(k\right)}={P}_{S,\text{DT}}^{\left(k\right)}\left(\nu \right)={\left[\nu -1/{\eta}_{S,D}^{\left(k\right)}\right]}_{0}^{\overline{P}},

(11)

where

{\left[x\right]}_{a}^{b}=\left\{\begin{array}{ll}b,& x\ge b\\ x,& a<x<b\\ a,& x\le a,\end{array}\right.

(12)

and *ν* is equal to the solution of the equality constraint of (9), i.e.,

\sum _{k\in {\mathbb{K}}_{\text{on}}}\mathrm{lo}{g}_{2}\left(1+{P}_{S,\text{DT}}^{\left(k\right)}(\nu ){\eta}_{S,D}^{\left(k\right)}\right)=\mathit{\text{MRT}}.

(13)

It is interesting to note that when a non-uniform PSD mask has to be satisfied, the solution to problem (9) remains the same as in (11), provided that the maximum allowable power in each sub-channel is set equal to the corresponding power constraint [25].

Now, turning our attention to problem (10), we note that it is more difficult to solve than problem (9) inasmuch its objective function is not in general convex. This can be proved observing that the Hessian associated to its objective function, for a given *k*, is neither semidefinite positive nor semidefinite negative, consequently, the Sylvester’s criterion [27] does not give any information regarding convexity.

In “Optimal DF power allocation” section, we discuss the optimal solution to problem (10). Then, in “Simplified algorithm for DF power allocation” section, we propose a feasible algorithm that gives a sub-optimal solution.

#### Optimal DF power allocation

To find the optimal solution to (10), we observe that for a given value of *τ*, problem (10) can be split into two convex sub-problems. The first sub-problem is obtained when *C*_{DF}(*τ*) = *τ* *C*_{S,R} and it reads

\begin{array}{l}{P}_{\text{DF}1}\left(\tau \right)=\text{min}\sum _{k\in {\mathbb{K}}_{\text{on}}}\tau {P}_{S,\text{DF}1}^{\left(k\right)}+(1-\tau ){P}_{R,\text{DF}1}^{\left(k\right)}\phantom{\rule{2em}{0ex}}\\ \text{s.t.}\phantom{\rule{1em}{0ex}}& \tau {C}_{S,R}=R,\phantom{\rule{2em}{0ex}}\\ \tau {C}_{S,D}+(1-\tau ){C}_{R,D}\ge R,\phantom{\rule{2em}{0ex}}\\ 0\le {P}_{S,\text{DF}1}^{\left(k\right)}\le \overline{P},\phantom{\rule{2em}{0ex}}\\ 0\le {P}_{R,\text{DF}1}^{\left(k\right)}\le \overline{P},\phantom{\rule{1em}{0ex}}\forall \phantom{\rule{1em}{0ex}}k\in {\mathbb{K}}_{\text{on}}.\phantom{\rule{2em}{0ex}}\end{array}

(14)

In (14), we have used the subscript 1 to indicate the first sub-problem. Replacing in (14) {P}_{S,\text{DF}1}^{\left(k\right)}=({2}^{{b}_{S,\text{DF}1}^{\left(k\right)}}-1)/{\eta}_{S,R}^{\left(k\right)} and {P}_{R,\text{DF}1}^{\left(k\right)}=({2}^{{b}_{R,\text{DF}1}^{\left(k\right)}}-1)/{\eta}_{R,D}^{\left(k\right)}, we obtain an equivalent convex optimization problem, whose variables are {b}_{S,\text{DF}1}^{\left(k\right)} and {b}_{R,\text{DF}1}^{\left(k\right)}, with k\in {\mathbb{K}}_{\text{on}}.

The second sub-problem is obtained when *C*_{DF}(*τ*) = *τ* *C*_{S,D} + (1−*τ*)*C*_{R,D}and it reads

\begin{array}{l}{P}_{\text{DF}2}\left(\tau \right)=\text{min}\sum _{k\in {\mathbb{K}}_{\text{on}}}\tau {P}_{S,\text{DF}2}^{\left(k\right)}+(1-\tau ){P}_{R,\text{DF}2}^{\left(k\right)}\phantom{\rule{2em}{0ex}}\\ \text{s.t.}\phantom{\rule{1em}{0ex}}& \tau {C}_{S,D}+(1-\tau ){C}_{R,D}=R,\phantom{\rule{2em}{0ex}}\\ \tau {C}_{S,R}\ge R,\phantom{\rule{2em}{0ex}}\\ 0\le {P}_{S,\text{DF}2}^{\left(k\right)}\le \overline{P},\phantom{\rule{2em}{0ex}}\\ 0\le {P}_{R,\text{DF}2}^{\left(k\right)}\le \overline{P},\phantom{\rule{1em}{0ex}}\forall \phantom{\rule{1em}{0ex}}k\in {\mathbb{K}}_{\text{on}}.\phantom{\rule{2em}{0ex}}\end{array}

(15)

Similar to (14), it is possible to obtain a problem that is equivalent to (15) and that is convex. It can be found with the change of variables {P}_{S,\text{DF}2}^{\left(k\right)}=({2}^{{b}_{S,\text{DF}2}^{\left(k\right)}}-1)/{\eta}_{S,D}^{\left(k\right)} and {P}_{R,\text{DF}2}^{\left(k\right)}=({2}^{{b}_{R,\text{DF}2}^{\left(k\right)}}-1)/{\eta}_{R,D}^{\left(k\right)}.

Since both problems (14) and (15) can be reduced to convex problems, their solution^{a} can be found imposing the KKT conditions to the equivalent problems ([26], pp. 243–244) and [28]. Although we here omit the proof, it can be shown that the solution to the KKT conditions requires an iterative procedure. Consequently, its complexity is not less than that of conventional methods used for solving inequality constrained minimization problems, e.g., the interior-point method ([26], chapter 11). Therefore, for the numerical results, we use the interior-point method. It should be noted that interior-point methods are in general complex, especially when the dimension of the problem is large.

Now, to compute the optimal DF power allocation, for each value of *τ*, we can compute *P*_{DF}(*τ*) = min{*P*_{DF1}(*τ*),*P*_{DF2}(*τ*)}. Therefore, the optimal slot duration for *minimum power* can be found as

{\tau}_{\mathit{\text{mp}}}^{\ast}={\text{min}}_{\tau \in \left[0,1\right]}{P}_{\text{DF}}\left(\tau \right),

(16)

and the minimum power required by DF to reach the rate *R* is the one corresponding to {P}_{\text{DF}}^{\ast}={P}_{\text{DF}}\left({\tau}_{\mathit{\text{mp}}}^{\ast}\right). Finally, we recall that to compute the power required by ODF to reach the rate *R* under the PSD mask constraint, we can replace {P}_{\text{DF}}^{\ast} and (11) in (8).

#### Simplified algorithm for DF power allocation

To reduce complexity, we propose a simplified solution based on the following algorithm. We assume the optimal time slot duration {\tau}_{\mathit{\text{mp}}}^{\ast} equal to the one computed in (7), i.e., {\tau}_{\mathit{\text{mp}}}^{\ast}={\tau}_{\mathit{\text{mr}}}^{\ast}, where we have considered the achievable rate maximization under a PSD constraint. Furthermore, we impose the constraint that for {\tau}_{\mathit{\text{mp}}}^{\ast} the arguments of the minimization in the second line of (10) are equal to *R*. Under these assumptions, (10) can be divided into two sub-problems where the first allows us to compute the power distribution of the source node independently from the power distribution of the relay node. Once we know the power distribution of the source, we can compute the power distribution of the relay solving the second sub-problem. Figure 4 illustrates the proposed algorithm. Practically, we first find the source power distribution that allows the linear function of *τ*, *f*_{1}(*τ*,**P**_{S,DF}), to pass through the origin of the axes and the point *p* specified by the pair \{{\tau}_{\mathit{\text{mp}}}^{\ast},R\}. Then, maintaining this power distribution at the source node, we compute the power distribution at the relay node that allows the function *f*_{2}(*τ*,**P**_{
S
,
DF
},**P**_{
R
,
DF
}) to pass through the points *p* and the one specified by the pair {1,*C*_{S,D}}.

In particular, the power distribution at the source can be computed solving the following sub-problem of (10)

\begin{array}{l}{P}_{S,\text{DF}}=\text{min}\sum _{k\in {\mathbb{K}}_{\text{on}}}{P}_{S,\text{DF}}^{\left(k\right)}\phantom{\rule{2em}{0ex}}\\ \text{s.t.}\phantom{\rule{1em}{0ex}}& {\tau}_{\mathit{\text{mp}}}^{\ast}{C}_{S,R}=R,\phantom{\rule{2em}{0ex}}\\ 0\le {P}_{S,\text{DF}}^{\left(k\right)}\le \overline{P}\phantom{\rule{1em}{0ex}}\forall \phantom{\rule{1em}{0ex}}k\in {\mathbb{K}}_{\text{on}}.\phantom{\rule{2em}{0ex}}\end{array}

(17)

Problem (17) can be solved similar to^{a} (9). The solution is

{P}_{S,\text{DF}}^{\left(k\right)}={P}_{S,\text{DF}}^{\left(k\right)}\left(\nu \right)={\left[\nu -1/{\eta}_{S,R}^{\left(k\right)}\right]}_{0}^{\overline{P}},

(18)

where *ν* is given by the solution of the second line of (17), i.e.,

\sum _{k\in {\mathbb{K}}_{\text{on}}}\mathrm{lo}{g}_{2}\left(1+{P}_{S,\text{DF}}^{\left(k\right)}(\nu ){\eta}_{S,R}^{\left(k\right)}\right)=\frac{\mathit{\text{MRT}}}{{\tau}_{\mathit{\text{mp}}}^{\ast}}.

(19)

Once the “optimal” power distribution for the source node in DF mode has been computed, it can be used to compute the capacity of the S–D link, namely *C*_{S,D}in DF mode. Therefore, we can find the “optimal” power distribution for the relay node solving the following sub-problem of (10)

\begin{array}{l}{P}_{R,\text{DF}}=\text{min}\sum _{k\in {\mathbb{K}}_{\text{on}}}{P}_{R,\text{DF}}^{\left(k\right)}\phantom{\rule{2em}{0ex}}\\ \text{s.t.}\phantom{\rule{1em}{0ex}}& {C}_{R,D}=\widehat{R},\phantom{\rule{2em}{0ex}}\\ 0\le {P}_{R,\text{DF}}^{\left(k\right)}\le \overline{P}\phantom{\rule{1em}{0ex}}\forall \phantom{\rule{1em}{0ex}}k\in {\mathbb{K}}_{\text{on}}.\phantom{\rule{2em}{0ex}}\end{array}

(20)

whose solution^{a} is

{P}_{R,\text{DF}}^{\left(k\right)}={P}_{R,\text{DF}}^{\left(k\right)}\left(\nu \right)={\left[\nu -1/{\eta}_{R,D}^{\left(k\right)}\right]}_{0}^{\overline{P}},

(21)

with *ν* given by the solution of the second line of (20), i.e.,

\sum _{k\in {\mathbb{K}}_{\text{on}}}\mathrm{lo}{g}_{2}\left(1+{P}_{R,\text{DF}}^{\left(k\right)}(\nu ){\eta}_{R,D}^{\left(k\right)}\right)=M\widehat{R}T,

(22)

where \widehat{R}=(R-{\tau}_{\mathit{\text{mp}}}^{\ast}{C}_{S,D})/(1-{\tau}_{\mathit{\text{mp}}}^{\ast}), and {C}_{S,D}=1/\left(\mathit{\text{MT}}\right)\phantom{\rule{1em}{0ex}}\sum _{k\in {\mathbb{K}}_{\text{on}}}\mathrm{lo}{g}_{2}(1+{P}_{S,\mathit{\text{DF}}}^{\left(k\right)}{\gamma}_{S,D}^{\left(k\right)}).

The power needed by the DF mode to reach the rate *R* under the PSD constraint \overline{P} is

{P}_{\text{DF}}={\tau}_{\mathit{\text{mp}}}^{\ast}{P}_{S,\text{DF}}+(1-{\tau}_{\mathit{\text{mp}}}^{\ast}){P}_{R,\text{DF}}.

(23)

Therefore, we solve (8) using (11) and (23). Clearly, there are cases where a solution to the power minimization problem under a target rate and a PSD constraint does not exist. In particular, when only DT or DF admits a solution, the algorithm will choose the mode for which the solution exists. When the solution does not exist for both DT and DF, the algorithm will choose the mode that achieves the highest rate.

Finally, from (11), (18), and (21) we note that the power allocation for the source node in both DT and DF modes, and for the relay node in DF mode, follows a typical water-filling shape, where the maximum allowable power in each sub-channel is limited by the power constraint. Therefore, to solve {(11), (13)}, {(18), (19)}, {(21), and (22)} we can use conventional algorithms for solving power allocation problems when a sub-channel power constraint is imposed [25].