Joint Power Control and Spectrum Allocation for Cognitive Radio with Qos Constraint

Spectrum sharing with quality of service (QoS) requirement and power constraint on cognitive users is studied. The objective is to maximize the system throughput. This problem is modeled as a mixed integer nonlinear programming problem and then transformed to a continuous nonlinear programming problem through eliminating integer variables. We propose the joint power control and spectrum allocation algorithm based on particle swarm optimization to obtain the global optimal solution. Simulation results show that the proposed method can achieve higher system throughput and spectrum utilization under the constraints of transmit power and QoS requirement.


Introduction
The spectrum of the wireless networks is generally regulated by governments via a fixed spectrum assignment policy.However, in recent years, the demand for wireless spectrum use has been growing dramatically with the rapid development of the telecommunication industry, which has caused scarcity in the available spectrum bands.Furthermore, the underutilization of the licensed spectrum bands makes the situation even worse [1].Cognitive radio [2], with the ability to sense unused bands and adjust transmission parameters accordingly, is an excellent candidate for improving spectrum utilization.In cognitive radio networks, the cognitive (unlicensed) user needs to detect the presence of the primary (licensed) users as quickly as possible and dynamically changes the system parameters, such as transmit power level, so as to best utilize the valuable spectrum [3].
There are two kinds of spectrum sharing method: spectrum overlay and spectrum underlay.The researches of underlay spectrum limit the transmit power of the cognitive users and make sure that the interference temperature does not exceed certain threshold [4].The related works on spectrum sharing schemes under interference temperature mainly include [5][6][7].[5] regards the capacity of one cognitive link as an optimization problem with constraints in interference temperature and studies the optimal power allocation strategies.[6] studies the problem of channel selection in multi-hop cognitive mesh networks, but power allocation is not considered.With the assump-tion that the primary users will always occupy the spectrum, these approaches can sufficiently increase the spectrum efficiency.[7] studies the joint of power control and random access under interference temperature, the optimization problem is transformed to a convex optimization problem.However, each cognitive user should be aware of the interference with the primary users and requires some kind of communications between the cognitive users and the primary users.
Previous works (such as [7]) on conventional OFDM systems are based on an implicit assumption that all the OFDM sub-carriers are fixed and always available.But in practice, the under-utilized spectrum which can be utilized by the secondary users varies over time, this is because the primary users can access to their spectrum unrestricted.
In this paper, we consider an overlay cognitive system, where multiple cognitive users coexist with multiple primary users and the availability of spectrum might not be contiguous because it is used by primary users.The multi-carrier system which dynamically operates in non-contiguous frequency bands and enabled by cognition technology is referred to as NC-OFDM [8].The flexibility offered by NC-OFDM based CR can be employed to devise spectrum sharing schemes and provides QoS requirements by jointly considering variations in spectrum availability.We integrate the transmit power constraint and fairness of spectrum allocation in this paper.The optimization objective is to maximize the system throughput subject to maximize peak power constraints and minimum QoS requirement on individual cognitive user.The QoS constraint is characterized by the minimum transmission rate requirement.To balance the power and QoS constraints, and further to efficiently and fairly utilize spectrum, transmit power and spectrum allocation must be determined by coordination among cognitive users.
The rest of this paper is organized as follows.The problem formulation and transformation are presented in Section 2. In Section 3, we propose the power and spectrum allocation algorithm based on particle swarm optimization.Section 4 includes simulation results and analysis.Conclusions are drawn in Section 5.

Mathmatics Model
In this paper, we consider a cognitive base station to multi cognitive users in wireless networks with rapid changes of spectrum opportunities.When the spectrum opportunities vary quickly, the cognitive users should frequently update the spectrum availably to avoid interference with the primary user.The cognitive base station balances the cognitive users' transmit power and spectrum to efficiently and fairly utilize spectrum.
Consider OFDM based CR system with a total bandwidth of B Hz and M primary users, each primary user with a bandwidth / ), assume that m B is less than the coherent bandwidth of the wireless channel, so that the channel response on each is flat.At the same time, there are N cognitive users in this system.At different location and time t, cognitive users have different available spectrum resource information because of the primary users' transmission activities.Define this available spectrum resource information as , ( ) where , ( ) {0,1} is the maximum peak transmit power constraint of user n.We assume that the time variation of the wireless channel is stationary and slow enough, so that the cognitive users are able to perfectly estimate their local channels state information (CSI) on each channel and the cognitive base station knows all the CSI.Based on this CSI, cognitive base station balances the power and spectrum allocation to maximize the system throughput.Let , ( ) {0,1} We assume that the network is under additive white Gaussian noise.We use M-ary quadrature amplitude modulation (MQAM) and then the maximum transmit rate of cognitive user n in channel m is given by: log ( 1) log( 5) ( ) where req BER is an SNR gap parameter which indicates how far the system is operating from capacity, 2 ( ) t  is the interference power.
The objective is to maximize the cognitive system throughput since power per user is finite in this system, every cognitive user has its own peak power constraint In practice, cognitive user transmission rate requirement is required no less than a certain threshold 0 n r .It is defined as the QoS constraint of each cognitive user and expressed as x t  , the transmit power must be zero.The base station should optimize the spectrum allocation matrix X and power matrix P. In this problem, , ( ) x t is an element of X and , ( ) {0,1} .
Due to the discrete nature of channel and continuous nature of power, this optimization problem is a mixed integer nonlinear programming problem (MINLP).The difficulties in solving this MINLP problem come from the conflicting constraint sets, and coupled control variables.In [7] and many other works, they relax the binary valued constraint on the integer variable and replace it by a continuous variable.While this method causes inaccuracy of the algorithms and it can not find the optimal solution.In this paper, we first transform the MINLP problem to a continuous nonlinear programming (NLP) problem by introducing variable transformation, then we solve this problem by particle swarm optimization algorithm.
We substitute the variable , ( ) x t and , ( ) ) so the variable , ( ) ) Then the optimization problem is transformed as the following problem P1: P1.
( ) 1.5 ( ) ( ) ( ) log ( 1) log( 5) ( ) In P1, one continuous variable ' , ( ) p t replaces the integer variable and the continuous variable, this substitution reduces the solution space dramatically.In addition, the new model is suitable for heuristic and search algorithms.

Power and Spectrum Allocation Algorithm Based on PSO
The particle swarm algorithm (PSO) is a swarm intelligence optimization algorithm modeled on the flight characteristics of birds [9,10].In PSO, each solution is a 'bird' in the flock and is referred to as a 'particle', each particle has a position vector and velocity vector.The location of particles is the solution of optimization problem, the performance of each particle depends on the value of optimization objective's fitness function.Velocity vector used to determine particle velocity.
The following notation is needed in PSO.The number of particles in the population is denoted as Q .Let [ , ,..., ] be the global best solution obtained from the population at iteration k.
The evoluationary process of the PSO is as follows: where 1 c and 2 c are two positive constants named learning factors or acceleration coefficients, 1 u and 2 u are uniform random numbers distributed in the range [0, 1], and  is an inertia weight employed to control the impact of the previous history of velocities on the current velocity.Note that Equation 12) specifies that the velocity of a particle at iteration k is determined by the previous velocity of the particle, the cognition part, and the social part.
In the PSO-based spectrum and power allocation algorithm, each particle's position vector specifies a possible spectrum and power allocation scheme.The penalty function is used to solve the constrained optimization problem.Ordinary penalty function only calculates the total violation of individuals, but does not make full use of the violation information of the infeasible solutions.We use the penalty function which is not only depends on the number of constraint violations but also on the degree of constraint violations.The performance of this method is better than that using the ordinary penalty function [11].As a result of the different scales in constraints, it is possible that some certain constraints play a dominant role in the total constraints and other constraints may not reflect their degree of constraint violations.In addition, the objective function and the violations of constraint functions may be in different scales, so we normalize the objective function and constraint functions to solve this problem.
We use the following fitness function to evaluate the particle: where _ sum viol represents the total amount of the constraint violations and _ num viol represents the number of the constraint violations.If any user n in particle ' p violates the transmission rate constraint (9) or power constraint (10), the _ num viol of ' p will plus 0.5 0 0 0 0 0.3 0 0 0 0 0.4 0 ' 0 0.5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [0.5,0,0.3,0,0.4,0.5,0,0,0] ( ') max(0, ( ')) ( ') max(0, ( ')) ( ) is the system throughput of the In the proposed PSO-based power and spectrum allocation algorithm, a particle specifies a possible power and spectrum allocation assignment.As ' , 0 n m p  when , ( ) 0 n m L t  , if we use one bit to encode every element in ' p , there will be a lot of redundancy in the particle.We encode only those elements which may take the value 1, i.e., ' , n m p where ( , ) n m satisfies , ( ) 1 n m L t  .As a consequence, the length of the coding string is equal to the number of elements equal to 1 in L. Figure 1 illustrates the structure of an example particle, where 5 N  , 6 M  .Note that encoding all the elements needs 30 bits, while encoding only the elements with underline only needs 9 bits.In order to evaluate the fitness of the particle, we need to map the particle to the assignment matrix ' p , as the arrows show in Figure 1.
The value of every bit in the particle is randomly generated at the initial population and this coding scheme reduces the searching space of the optimization problem efficiently.
The proposed PSO-based power and spectrum as-signment algorithm proceeds as follows: Step 1: cognitive user gets the available spectrum resource information matrix L and channel information matrix , n m G , then transmits these information to the cognitive base station.
Step 2: set 0 k  , and randomly generate k id y and Step 3: map is the dth element with , ( ) 1 Step 4: compute the fitness value of each particle in the population according to Equation 14), set , where b is the index of the particle which has the highest fitness value.
Step 5: set 1 k k   , and update k id v according to Equation 12).If Step 6: update k id y according to Equation 13) and map k id y to ' , n m p .
Step 7: compute the fitness value of each particle in the population.For particle i, if it's fitness value is greater than the fitness value of

Simulation Result and Analysis
To evaluate the proposed algorithm, simulations were performed for the OFDM based CR system.The bandwidth of the OFDM system is 6 B  MHz, which is li- primary users, every primary user's transmission uses one channel and the available spectrum resource information matrix L is generated randomly.The number of cognitive users is 10 N  .The required bit error rate of each transmission is supposed to be .For simplicity, each cognitive link's average channel gain is chosen randomly within (0, 0.01) and the interference power is 0.5 mW.
The parameters for the PSO are and max 4 V  , and PSO would be terminated after 3000 iterations.
Figure 2 and Figure 3  respectively.The QoS requirement of each user is set to 1500bps,2500bps and 3500bps respectively.As can be observed in Figure 2 and Figure 3, after about 2500 iterations, the proposed algorithm achieves the optimal solution.Further more, the system throughput doesn't increase with the transmission rate requirement increase, this is because the system throughput is also constrained by users' transmit power.In addition, the peak transmit power provides allocation fairness.
In principle cognitive users with high channel gains are taking more channels, but the more channels they take, the more power will be consumed.Then other users with weaker channel gains and more available power can take the rest channels to transmit and further increase the system throughput.
Figure 4 shows the convergence process of the proposed algorithm with same transmission rate requirements 0 2000 r  bps under different peak transmit power constraints max n P .The peak transmit power is set to 2W, 2.5W and 3W respectively.We can clearly see that the system throughput is increasing as the peak transmits power increases.
Figure 5 shows that the system throughput is fluctuating at different time.The peak transmits power constraints are max 2 n P  and QoS requirement of each user is set to 2500bps.At different time t, the CR system has different available spectrum information and channel state information because of the activities of primary users.Sometimes the primary users are not active, so the cognitive users have more available spectrum resource and the channel gains are better.As a result, the system through is higher than some situations which primary users are active.Figure 6 shows the convergence processes of the proposed algorithm's performance and the Lagrange algorithm in [7].The peak transmits power constraints are max 2 n P  and QoS requirement of each user is set to 2500bps.We can see that the proposed algorithm has higher system throughput and faster convergence speed than the lagrange algorithm.

Conclusions
We model the power control and spectrum allocation problem as a mixed integer nonlinear optimization problem.This MINLP problem is difficult to find the optimal solution, so we transform the MINLP problem to an NLP problem.Then we use a coding scheme and PSO-based power control and spectrum allocation algorithm to solve the NLP problem.Simulations show that the proposed model provides the fairness of the assignment and the proposed algorithm performs better than the Lagrange algorithm.
indicate whether the spectrum is allocated to the cognitive user at time t.If , ( ) 1 n m x t  , the mth channel is assigned to the nth cognitive user, otherwise , ( ) 0 n m x t  .Each channel can be used by one cognitive user at any given time t, or the mth channel has not been allocated to the nth cognitive user , ( ) 0 n m of particle i (1 i Q   ) at iteration k, where D is the number of dimensions to represent a particle and k id y is the dth (1 d D   ) dimension of the position of particle i.Note that k i y is treated as a potential solution of the optimization problem.The velocity of particle i at iteration k is denoted as 1 2 particle 'p in time slot t. ' p is an N by M matrix representing the power and channel allocation, if ' m is assigned to the cognitive user n,

Figure 2 .Figure 3 .
Figure 2. Convergence of proposed algorithm under different QoS constraints( max 1.5 n P 

Figure 4 .Figure 5 .
Figure 4. Convergence of proposed algorithm under different transmit power constraints

Figure 6 .
Figure 6.Convergence of proposed algorithm and lagrange algorithm particle in the swarm is assigned a fitness value indicating the merit of this particle such that the swarm evolution is navigated by best solutions.Let k