Yutao Liu et al.: Joint power and spectrum allocation algorithm in cognitive radio networks 693
max
p
i,j
U =
N
i=1
U
i
=
N
i=1
M
i
j=1
B
M
log
2
(1 + K
i
· γ
i,j
)
s.t.
M
i
j=1
p
i,j
P
i
,p
i,j
0, ∀i ∈ N
σ
2
+ p
j
H
j,0
I
j
, ∀j ∈ M and j is on
(5)
where p
j
is the cognitive user’s total transmission power
in the jth subcarrier, and H
j,0
is the channel gain from the
cognitive user’s transmitter to the primary base station in
subcarrier j.
Because each subcarrier can support only one cogni-
tive user besides the primary users, the spectrum sharing
problems come down to: the cognitive users appropriately
allocate transmission power to the subcarriers which they
obtained in order to optimize the utilities. Next, we first
overview the water-filling theorem, and then propose a
novel one-user water-filling algorithm to solve the power
allocation problem for the cognitive users.
For the ith cognitive user, assume its subcarrier set is
{1, 2,...,M
i
}, from (4) we can obtain the transmission
power in each subcarrier.
p
i,j
=min
I
j
− σ
2
H
j,0
,
μ − h
−1
i,j
+
(6)
where the first item in the bracket denotes the interfer-
ence constraint for primary users, (x)
+
=max(x, 0).
μ = λ
−1
B/(M · ln 2) is the water-level, λ is the Lagrange
multiplier, and h
i,j
= K
i
H
i,j
/σ
2
denotes the ith user’s
gain-to-noise ratio in the jth subcarrier.
3.2 Water-filling algorithm
Thus, the optimal transmission rate for the cognitive users
can be obtained by power water-filling (or water-pouring),
as we can see in Fig. 1. When h
−1
i,j
is smaller, the cor-
responding transmission power assigned to this subcarrier
is higher; as h
−1
i,j
increases, the transmission power is re-
duced simultaneously. Especially when h
−1
i,j
μ, because
Fig. 1 Water-filling theor em
of the poor channel state, it will assign no transmission
power in the jth subcarrier, i.e., the cognitive user does
not transmit signals in this subcarrier. Distinguish from
the traditio nal water-filling theorem , the interference con-
straint for the primary users should be taken into account
(e.g., subcarrier 2 and 4 in Fig. 1), i.e., the transmission
power should not exceed (I
j
− σ
2
)/H
j,0
in subcarrier j
when the primary user is on.
Obviously, when the utility for the ith user is optimal,
M
i
j=1
p
i,j
= P
i
, from ( 6) we can see that p
i,j
is a function of
the water-level μ, so the constraint can be expressed as
f(μ)=
M
i
j=1
p
i,j
− P
i
=
M
i
j=1
min
I
j
− σ
2
H
j,0
,
μ − h
−1
i,j
+
− P
i
(7)
where f is a monotonic increasing function of variable
μ (subject to the interference constraint, the monotonicity
can not be strict in some subcarriers). Therefore, we can
obtain μ from (7), in this way, we propose a novel one-user
water-filling algorithm as shown in Table 1.
Table 1 The one-user water-filling algorithm
Input: M
i
, H
i,j
,H
j,0
∀j ∈ M
i
,BER
i
, σ
2
and f.
(i) Initialization: obtain the gain-to-noise ratio h
i,j
= K
i
H
i,j
/σ
2
.
(ii) Sort the subcarriers such that {h
−1
i,j
} is in increasing order,
i.e., h
−1
i,j
h
−1
i,j+1
for any j ∈{1,...,M
i
− 1}.
(iii) Set μ = h
−1
i,M
i
and obtain the function value about f according
to (7). If f(h
−1
i,M
i
) > 0,setM
i
= M
i
− 1 and return to step
(iii), otherwise, set x = M
i
andgotostep(iv).
(iv) Set num = x +1, and then search the water-level
μ ∈ (h
−1
i,x
,h
−1
i,x+1
) according to f(μ)=0.Ifμ<h
−1
i,x+1
,
set num = x and obtain the final μ.
(v) Obtain the transmission power transmission power strategies
according to (6).
Output: power allocation strategies p
i,j
and the number of allocated
subcarriers num.
Next, we’ll demonstrate the effectiveness of the one-
user water-filling algorithm. Assume the number of sub-
carriers the user actually used is
˜
M
i
,since{h
−1
i,j
} is in-
creasing in j,weget
μ − h
−1
i,j
>0, 1 j
˜
M
i
0,
˜
M
i
<j M
j
⇔ h
−1
i,
˜
M
i
<μ h
−1
i,
˜
M
i
+1
(8)
where
h
−1
i,
˜
M
i
+1
→ +∞
when
˜
M
i
= M
i
.
Since f(h
−1
i,M
i
+1
) > 0 and f is a monotonic increasing
function, the object for the algorithm is to find suitable