Resource Allocation in an OFDM-Based Cognitive Radio System
P.Vishnu Vardhan (2011A3PS169G) and K.Gautham Reddy(2011A8PS364G)
Abstract— The problem of subcarrier, bit and

power allocation for an OFDM based cognitive
radio system in which one or more spectrum
holes exist between multiple primary user (PU)
frequency bands is studied. The cognitive radio
user is able to use any portion of the frequency
band as long as it does not Interfere unduly with
the PUs’ transmissions. We formulate the
resource allocation as a multidimensional
knapsack problem and propose a lowcomplexity, water filling algorithm to solve it.
The proposed algorithm is simple to implement
and optimal solution can be obtained by using
this method.
Index Terms —Cognitive radio, OFDM, resource

allocation, Water filling algorithm.
I. INTRODUCTION
IN many jurisdictions, there is a scarcity of unallocated
frequency bands below 6 GHz. At the same time, studies have
found that the utilization of a large portion of the allocated
(licensed) bands is very low. It has been suggested that one
promising approach to solving the spectrum shortage crisis is to
use cognitive radio (CR) technology. In a CR system, cognitive
radio users (CRUs) are allowed to use licensed bands as long as
the (licensed) primary users (PUs) are not unduly affected.
OFDM is an attractive modulation candidate for CRUs. The
subcarrier, bit and power (resource) allocation optimization
problem for OFDM has been studied
In the literature. However, for CR systems in which
the PUs do not use OFDM, the mutual interference (MI)
Between the PUs and the CRUs has to be considered.
This MI is not taken into account in most of the existing
Resource allocation algorithms for OFDM. The MI

is considered assuming that there is only one PU.
In this Letter, we study the resource allocation problem
for an OFDM-based CR system in which one or more
spectrum holes exist among the multiple PU frequency
bands. The CRU can use any portion of the band as long as
the resulting interference power is kept below the
acceptable threshold for each PU receiver. We formulate
the resource allocation optimization as a multidimensional
0-1 knapsack problem (MDKP) and propose a lowcomplexity solution.
II. SYSTEM MODEL
Consider a CR system, with bandwidth W, in which the
PUs are not active all the time at all locations. For simplicity
and clarity of explanation, we focus on the case of a single CRU
using OFDM. The proposed approach can be extended to
situations in which there may be more than one CRU.
There are M OFDM subbands available to the CRU. The
nominal bandwidth of subband m, m = {1, 2. . . M} ranges from
fc + (m − 1) Δf to fc + mΔf. The subbands (or sub channels)
are modelled in discrete-time, with the time varying gain for
sub channel m from the CRU transmitter to its receiver
denoted by√ . It is assumed that the power gains {gm} are
outcomes of independent, identically distributed (i.i.d.) random
variables (rv’s), and that there is no interference among the
subchannels. The power gains for subchannel m from the CRU
transmitter to PU l’s receiver and from PU l’s transmitter to the
CRU receiver are denoted by
and
respectively.
Suppose that there are L PUs in the system, with PU
l’s nominal bandwidth ranging from
to
The baseband power spectral density (PSD) of PU l’s
Signal is
. The maximum interference power that PU l
Can tolerate is . Since the PUs may not use OFDM, it is
necessary to consider possible MI between the CRU and the
PUs. The interference power generated by PU l to the mth
OFDM subchannel at the CRU receiver is

=∫
(

(
)

(

( )
The number of bits per OFDM symbol, , which can be
supported for the CRU on sub channel m is given by

(

(

)

)

is a SNR gap parameter which indicates how far
the system is operating from capacity,
is the CRU
transmit power,
is the noise power and
is the
interference from the PUs given by
where

III. THE PROPOSED RESOURCE ALLOCATION
ALGORITHM

∑

(

(

∑

≤

( )

(

)

S

)

)
)

(

,

(∑

)

) and β are the Lagrange multipliers

The Karush-Kuhn Tucker (KKT) conditions can be written as
follows
(
(

0
0
0

(∑
(∑

(2)
(3)

In (2), S is the CRU power limit, in (3)
is the interference
power injected by the CRU signal in sub band m into PU l’s
nominal band and is given by

)

(∑

β

∑

)

(

Max ∑
≤

(

( ) is the baseband PSD of the OFDM signal in
Where
sub band m when
,
number of bits per OFDM
symbol which can be
Supported for the CRU on sub channel m is given by

Where
Our objective is to maximize the overall rate achievable by the
CRU, while keeping the interference to the PUs below the
specified thresholds
{ , l = 1, 2, 3 …L}. The problem can thus be formulated as

∑

)

The problem stated above is an optimization problem we write
the Lagrangian of our above stated problem as

∑

Subject to

(

=∫

=

(

)
)
(

)=0

)

)

(

)

)

∑

By equating the above equation to zero we get

(

∑

Since
So the solution can be written as

)

(

as
)
(

(

For

=

(

)

∑
)

)

(

= [

)

∑

OR

(

]

otherwise

The above optimal solution for the optimization problem has a
high computational complexity so we propose a low complexity
algorithm

(

≤

We get
∑

Max ∑

)

By substituting the above equation in

∑
0

(

)

(

)

*

(

(

( )

)

)

(

∑

+

)

)

Subject to
*

∑

)

+

≤

∑

≤

S

Denotes the set of subcarriers belonging to the l Th PU band
By following the same procedure like the before problem, the
solution of the above problem is given as

=

(

∑

[

(

(

)

)

]

If the interference constraint is ignored then the above problem
will assume the water filling interpretation

=

*

(

)

+

If the total power constraint is ignored in the above problem we
get the solution as

In the above solution if
also satisfies the power
constraint,then it is our required solution. So in order to find
the optimal solution first we find
by the above method with
only interference constraint.

If the above solution also satisfies the power constraint along
with interference constraint, then the solution has been found
and is equal to the maximum power that can be allocated to
each subcarrier, i.e.
Otherwise, the available power budget should be distributed
among the subcarriers giving that the power allocated to each
subcarrier is lower than or equal to the maximum power that
can be allocated to each subcarrier
This problem can be solved by water filling algorithm
So by using the already obtained equation

=

*

We will find the water filling λ.

(

)

+
Calculate Tm=Γ( + )/gm for all m and arrange it in the
descending order
And Tn is the sorting index
Tsum= ΣTm for all m
If S is the CRU power limit then
λ =(Tsum+S)/no of subcarriers
n=1
while Tn> λ
Tsum = Tsum-Tn
λ =(Tsum+S)/(no of subcarriers-that particular subcarrier)
n=n+1
end
(WF)= *λ –Tm]+ for all m
Given the initial waterfilling solution, the channels that violate
the maximum power
for any particular sub channel (i.e.
(WF)> ) are determined and upper bounded with
. The
power allotted to that sub channel is subtracted from the total
transmit power S and the above algorithm is carried out for
subcarriers that did not violate the maximum power
in the
last step. This procedure is repeated until the allocated power
(W.F) doesn’t violate the maximum power
in any of the
subcarriers in the new iteration. So from this results rm is
determined for each case and the required graphs are plotted.

IV. Simulation results
The matlab code uses water filling algorithm to solve the
given problem. In the above code the interference power is
assumed constant as we are getting error with the quad
function. We are not able to obtain the graphs as there is
some error in the code which is causing the code to go for
infinite iterations that we could not rectify.
V. Conclusions
A low-complexity water filling algorithm has been
proposed for allocating resources in a OFDM-based CR
system. The algorithm maximizes the overall bit rate
achievable by the CRU, while keeping interference to PUs
within tolerable limits

REFERENCES
1) Yonghong Zhang and Cyril Leung,”Resource Allocation in an OFDM-Based
Cognitive Radio System”.
2) Musbah Shaat and Faouzi Bader,”Computationally Efficient Power Allocation
Algorithm in Multicarrier Based Cognitive Radio Networks: OFDM and FBMC
systems”
Resource allocation in OFDM based cognitive radio system

Resource allocation in OFDM based cognitive radio system

  • 1.
    Resource Allocation inan OFDM-Based Cognitive Radio System P.Vishnu Vardhan (2011A3PS169G) and K.Gautham Reddy(2011A8PS364G) Abstract— The problem of subcarrier, bit and power allocation for an OFDM based cognitive radio system in which one or more spectrum holes exist between multiple primary user (PU) frequency bands is studied. The cognitive radio user is able to use any portion of the frequency band as long as it does not Interfere unduly with the PUs’ transmissions. We formulate the resource allocation as a multidimensional knapsack problem and propose a lowcomplexity, water filling algorithm to solve it. The proposed algorithm is simple to implement and optimal solution can be obtained by using this method. Index Terms —Cognitive radio, OFDM, resource allocation, Water filling algorithm. I. INTRODUCTION IN many jurisdictions, there is a scarcity of unallocated frequency bands below 6 GHz. At the same time, studies have found that the utilization of a large portion of the allocated (licensed) bands is very low. It has been suggested that one promising approach to solving the spectrum shortage crisis is to use cognitive radio (CR) technology. In a CR system, cognitive radio users (CRUs) are allowed to use licensed bands as long as the (licensed) primary users (PUs) are not unduly affected. OFDM is an attractive modulation candidate for CRUs. The subcarrier, bit and power (resource) allocation optimization problem for OFDM has been studied In the literature. However, for CR systems in which the PUs do not use OFDM, the mutual interference (MI) Between the PUs and the CRUs has to be considered. This MI is not taken into account in most of the existing Resource allocation algorithms for OFDM. The MI is considered assuming that there is only one PU. In this Letter, we study the resource allocation problem for an OFDM-based CR system in which one or more spectrum holes exist among the multiple PU frequency bands. The CRU can use any portion of the band as long as the resulting interference power is kept below the acceptable threshold for each PU receiver. We formulate the resource allocation optimization as a multidimensional 0-1 knapsack problem (MDKP) and propose a lowcomplexity solution. II. SYSTEM MODEL Consider a CR system, with bandwidth W, in which the PUs are not active all the time at all locations. For simplicity and clarity of explanation, we focus on the case of a single CRU using OFDM. The proposed approach can be extended to situations in which there may be more than one CRU. There are M OFDM subbands available to the CRU. The nominal bandwidth of subband m, m = {1, 2. . . M} ranges from fc + (m − 1) Δf to fc + mΔf. The subbands (or sub channels) are modelled in discrete-time, with the time varying gain for sub channel m from the CRU transmitter to its receiver denoted by√ . It is assumed that the power gains {gm} are outcomes of independent, identically distributed (i.i.d.) random variables (rv’s), and that there is no interference among the subchannels. The power gains for subchannel m from the CRU transmitter to PU l’s receiver and from PU l’s transmitter to the CRU receiver are denoted by and respectively. Suppose that there are L PUs in the system, with PU l’s nominal bandwidth ranging from to The baseband power spectral density (PSD) of PU l’s Signal is . The maximum interference power that PU l Can tolerate is . Since the PUs may not use OFDM, it is necessary to consider possible MI between the CRU and the PUs. The interference power generated by PU l to the mth OFDM subchannel at the CRU receiver is =∫ ( ( ) ( ( )
  • 2.
    The number ofbits per OFDM symbol, , which can be supported for the CRU on sub channel m is given by ( ( ) ) is a SNR gap parameter which indicates how far the system is operating from capacity, is the CRU transmit power, is the noise power and is the interference from the PUs given by where III. THE PROPOSED RESOURCE ALLOCATION ALGORITHM ∑ ( ( ∑ ≤ ( ) ( ) S ) ) ) ( , (∑ ) ) and β are the Lagrange multipliers The Karush-Kuhn Tucker (KKT) conditions can be written as follows ( ( 0 0 0 (∑ (∑ (2) (3) In (2), S is the CRU power limit, in (3) is the interference power injected by the CRU signal in sub band m into PU l’s nominal band and is given by ) (∑ β ∑ ) ( Max ∑ ≤ ( ( ) is the baseband PSD of the OFDM signal in Where sub band m when , number of bits per OFDM symbol which can be Supported for the CRU on sub channel m is given by Where Our objective is to maximize the overall rate achievable by the CRU, while keeping the interference to the PUs below the specified thresholds { , l = 1, 2, 3 …L}. The problem can thus be formulated as ∑ ) The problem stated above is an optimization problem we write the Lagrangian of our above stated problem as ∑ Subject to ( =∫ = ( ) ) ( )=0 ) ) ( ) ) ∑ By equating the above equation to zero we get ( ∑ Since So the solution can be written as ) ( as )
  • 3.
    ( ( For = ( ) ∑ ) ) ( = [ ) ∑ OR ( ] otherwise The aboveoptimal solution for the optimization problem has a high computational complexity so we propose a low complexity algorithm ( ≤ We get ∑ Max ∑ ) By substituting the above equation in ∑ 0 ( ) ( ) * ( ( ( ) ) ) ( ∑ + ) ) Subject to * ∑ ) + ≤ ∑ ≤ S Denotes the set of subcarriers belonging to the l Th PU band By following the same procedure like the before problem, the solution of the above problem is given as = ( ∑ [ ( ( ) ) ] If the interference constraint is ignored then the above problem will assume the water filling interpretation = * ( ) + If the total power constraint is ignored in the above problem we get the solution as In the above solution if also satisfies the power constraint,then it is our required solution. So in order to find the optimal solution first we find by the above method with only interference constraint. If the above solution also satisfies the power constraint along with interference constraint, then the solution has been found and is equal to the maximum power that can be allocated to each subcarrier, i.e. Otherwise, the available power budget should be distributed among the subcarriers giving that the power allocated to each subcarrier is lower than or equal to the maximum power that can be allocated to each subcarrier This problem can be solved by water filling algorithm So by using the already obtained equation = * We will find the water filling λ. ( ) +
  • 4.
    Calculate Tm=Γ( +)/gm for all m and arrange it in the descending order And Tn is the sorting index Tsum= ΣTm for all m If S is the CRU power limit then λ =(Tsum+S)/no of subcarriers n=1 while Tn> λ Tsum = Tsum-Tn λ =(Tsum+S)/(no of subcarriers-that particular subcarrier) n=n+1 end (WF)= *λ –Tm]+ for all m Given the initial waterfilling solution, the channels that violate the maximum power for any particular sub channel (i.e. (WF)> ) are determined and upper bounded with . The power allotted to that sub channel is subtracted from the total transmit power S and the above algorithm is carried out for subcarriers that did not violate the maximum power in the last step. This procedure is repeated until the allocated power (W.F) doesn’t violate the maximum power in any of the subcarriers in the new iteration. So from this results rm is determined for each case and the required graphs are plotted. IV. Simulation results The matlab code uses water filling algorithm to solve the given problem. In the above code the interference power is assumed constant as we are getting error with the quad function. We are not able to obtain the graphs as there is some error in the code which is causing the code to go for infinite iterations that we could not rectify. V. Conclusions A low-complexity water filling algorithm has been proposed for allocating resources in a OFDM-based CR system. The algorithm maximizes the overall bit rate achievable by the CRU, while keeping interference to PUs within tolerable limits REFERENCES 1) Yonghong Zhang and Cyril Leung,”Resource Allocation in an OFDM-Based Cognitive Radio System”. 2) Musbah Shaat and Faouzi Bader,”Computationally Efficient Power Allocation Algorithm in Multicarrier Based Cognitive Radio Networks: OFDM and FBMC systems”