Joint optimization of detection threshold and resource allocation in infrastructure-based multi-band cognitive radio networks

Consider an infrastructure-based multi-band cognitive radio network (CRN) where secondary users (SUs) opportunistically access a set of sub-carriers when sensed as idle. The carrier sensing threshold which affects the access opportunities of SUs is conventionally regarded as static and treated independently from the resource allocation in the model. In this article, we study jointly the optimization of detection threshold and resource allocation with the goal of maximizing the total downlink capacity of SUs in such CRNs. The optimization problem is formulated considering three sets of variables, i.e., detection threshold, sub-carrier assignment and power allocation, with constraints on the PUs’ rate loss and the power budget of the CR base station. Two schemes, referred to as offline and online algorithms respectively, are proposed to solve the optimization problem. While the offline algorithm finds the global optimal solution with high complexity, the online algorithm provides a close-to-optimal solution with much lower complexity and realtime capability. The performance of the proposed schemes is evaluated by extensive simulations and compared with the conventional static threshold selection algorithm specified in the IEEE 802.22 standard.


Introduction
The rapid development of new wireless devices and services has lead to a growing demand for radio spectrum, making the problem of spectrum shortage more serious. Indeed, the problem of spectrum scarcity is the result of, or is exacerbated by, the traditional static spectrum allocation policies, which assign spectrum bands to license holders on a long-term basis over large geographical regions [1][2][3]. Consequently, the concept of cognitive radio (CR) has emerged as a promising technology to realize dynamic spectrum access and solve the problem of spectrum scarcity.
In a CR network (CRN), secondary (unlicensed) users (SUs) may coexist with primary (licensed) users (PUs) of a primary radio network (PRN) in two ways: spectrum underlay which means that SUs may operate under the noise floor of PUs, or spectrum overlay which allows SUs operate only when the spectrum allocated to PUs is sensed as idle [4]. The PRN that we are interested in uses a set of licensed non-overlapping orthogonal frequency sub-carriers for communication between primary base stations (P-BS) and PUs. We envisage that the PRN is underutilized and more revenue can be obtained by deploying CRNs, which opportunistically utilize the temporarily underutilized frequency sub-carriers available at the PRN and provide service to SUs. In this article, we focus on spectrum overlay and consider an infrastructurebased CRN, in which there exists a central entity or CR base station (CR-BS) that controls and coordinates the spectrum allocation and access of SUs [1,5].
Resource allocation in CRN is an important issue for improving the SUs' performance and has been widely investigated (see for example [6][7][8] and the references therein). However, these studies focus solely on capacity optimization for SUs based on the assumption of perfect spectrum sensing of the PUs' activities. How the choice of spectrum sensing techniques and sensing parameters, such as detection threshold and sensing time, may affect the performance of SUs remains as an open question.
Spectrum sensing is of significant importance for CR systems. Among various spectrum sensing techniques, http://jwcn.eurasipjournals.com/content/2012/1/334 energy detection is the most common approach due to its simplicity and low latency (in the order of several tens of microseconds [9]). A decision on whether a specific spectrum band is occupied by a PU or not can be taken by comparing the received energy with a pre-determined detection threshold. The detection thresholds for some primary systems have been specified by the IEEE 802.22 standard [10]. However, these fixed and identical detection thresholds are not adequate for multi-band CRNs, since different sub-carriers may suffer from different fading. Thus, the precise operation of the energy detection technique may require distinct detection thresholds on each sub-carrier in order to accurately detect PUs' activities.
Moreover, due to imperfect spectrum sensing, the selection of detection threshold may affect two parameters associated with energy detection: missed-detection probability (MDP) and false alarm probability (FAP) [11,12]. More specifically, as the detection threshold decreases, the MDP decreases while the FAP increases. From the perspective of PUs, the lower the MDP is, the better the PUs are protected. However, from the SUs' perspective, the higher the FAP, the lower the achievable capacity, because fewer sub-carriers are detected as idle and can be utilized by SUs. On the other hand, the capacity of SUs also depends closely on the resource allocation scheme deployed, typically in the form of a sub-carrier assignment and power allocation (SAPA) scheme. Therefore, in order to maximize the capacity of SUs while adequately protecting PUs' activities, it is crucial to jointly consider the selection of the detection threshold and the SAPA scheme.
In this article, we study the joint optimization of detection threshold and SAPA scheme with the goal of maximizing the total downlink capacity of SUs in such an infrastructure-based CRN. The optimization problem is formulated considering three sets of variables, i.e., detection threshold, SAPA, with constraints on PUs' rate loss and the power budget of the CR-BS. We propose two algorithms, referred to as offline and online respectively to solve this problem. Extensive simulation results demonstrate that our proposed algorithms outperform the conventional uniform detection threshold (UDT) selection algorithms significantly. In brief, the contributions of this article are twofold.
(1) We formulate the joint optimization problem with three sets of variables, including detection threshold, SAPA, with the objective of maximizing the total capacity of SUs, subject to the constraints on the PUs' rate loss and the power budget of the CR-BS. Different from the conventional way of using interference power as the constraint to protect PUs, our scheme instead bounds the PUs' rate loss caused by SUs' activities due to a non-zero MDP.
(2) We propose two algorithms, one offline and another online, to solve the optimization problem. The offline algorithm finds the global optimal solution with high computation complexity, but it is difficult to implement in practice. The online algorithm iteratively optimizes the detection threshold and SAPA with sub-optimal performance, with much lower computation complexity.
The remainder of this article is organized as follows. In Section 2, we review some studies that are related to this article. The system model is described in Section 3. Section 4 formulates the joint optimization problem. Then the offline and online algorithms are proposed in Sections 5 and 6, respectively. The computation complexity is analyzed in Section 7, followed by the simulation results and discussions in Section 8. Finally the article is concluded in Section 9.

Related work
Previous studies on joint optimization of detection threshold and resource allocation mainly concentrate on evaluating the impact of sensing time or detection threshold on SUs' performance, without considering the design of the SAPA scheme. In [13], a sensing-throughput tradeoff is achieved by searching the optimal sensing time that maximizes SUs' throughput. In [14], an optimization problem is formulated to maximize the ergodic capacity of SUs over transmission power and sensing time, by assuming a constant detection threshold.
To obtain optimized detection threshold, most of the related studies focus on the performance of the energy detector. For instance, they aim at minimizing the MDP and the FAP, but the performance of SUs is barely considered. In [15], the trade-off between transmission power and detection threshold is studied. However, the focus of their work is on how to reduce interference caused to PUs rather than on the optimization of SUs' capacity. In [16], an adaptive detection threshold algorithm is proposed to minimize the impairments caused by wireless channel and non-stationary noise. The detection performance is evaluated in multi-channel CRNs that perform opportunistic access.
So far, little work has been done on joint optimization of detection threshold and resource allocation in multi-band CRNs. In [17], a joint optimal power allocation (OPA) and detection threshold scheme is proposed to maximize SUs' capacity in spectrum sharing CRNs. In [18], the sensing threshold is determined to optimize two different sensing objectives: weighted network total capacity and the more traditional Bayesian cost, by exploiting location information. However, these two schemes are not designed for multi-band CRNs. In [19], a joint cross-layer http://jwcn.eurasipjournals.com/content/2012/1/334 scheduling and sensing framework is designed to optimize average weighted SUs' capacity, by adapting SAPA across SUs (under a constraint on average interference to PUs). However, this framework assumes fixed sensing parameters such as the MDP and the FAP when optimizing SUs' capacity.

System model
We consider the downlink transmission of an infrastructure-based CRN, where a CR-BS co-exists in the vicinity of a P-BS and there are a number of SUs and PUs covered by both of them. The CR-BS is regarded as the control center for the secondary system. The available band of the primary system is divided into N orthogonal sub-carriers, for which we assume frequency flat fading. There are K SUs which utilize the sub-carriers in an overlay way, e.g., either when PUs are absent and no false alarm is generated, or when PUs are present but they are not detected.
The CR-BS downlink is partitioned into time slots and each slot consists of a sensing period and a data transmission period [13]. The uninterrupted activity periods of the PUs are much longer than a single SU time slot. During the sensing period, each SU performs spectrum sensing and reports a set of pre-processed energy measurements to the CR-BS. The reporting to the CR-BS may be done, for example, via a control channel. Based on the sensing information received from the involved SUs, the CR-BS can make a decision on whether a sub-carrier is occupied by a PU or not. Note that the sensing results are not always reliable due to channel fading and imprecise energy detection.
For downlink transmission shown in Figure 1, four types of instantaneous channel fading gains are considered in our scenario: (i) between the P-BS and a PU for subcarrier n, denoted as h pu n ; (ii) between the P-BS and SU k for sub-carrier n, denoted as h ps k,n ; (iii) between the CR-BS and a PU, denoted as h cp n and (iv) between the CR-BS and SU k, denoted as h cs k,n . We model the channel gains as independent, identically distributed Rayleigh random variables and assume that they are known at the CR-BS [13,19,20]. It is further assumed that the instantaneous channel fading gains of all links change so slowly that they can be regarded as constant during each transmission slot. In practice, h cs k,n and h ps k,n can be obtained by SU k. The SU can estimate the channel gain and then send feedback to the CR-BS using existing channel estimation and feedback mechanisms. Similarly, h pu n and h cp k,n can be obtained by each PU. However, in this case, cooperation between the primary and secondary systems is required, so that h pu n and h cp k,n are made available to the CR-BS, for instance through a signaling link between the P-BS and the CR-BS. Alternatively, as suggested in [20], certain type of dedicated measurement devices may be employed, like cooperative sensors deployed in the vicinity of the PUs which report required information to the CR-BS.
Based on the instantaneous channel power gains and sensing results, the CR-BS makes a decision on the channel occupancy status of each sub-carrier and SAPA. The decisions are broadcast to the SUs through the downlink control channel. Note that in this article, we focus on the design of detection threshold and SAPA, and the sensing time is set as fixed through all slots. Thus, the data transmission period is considered only when formulating the optimization problem for the sake of simplicity.

Energy detection based spectrum sensing
The simultaneous spectrum sensing over multiple subcarriers is performed by using a set of multi-band joint detectors, as proposed in [21]. At each SU, N signal samples corresponding to N sub-carriers are obtained using N independent energy detectors.
Let us assume that the received signal for SU k on subcarrier n has the following form: where s n (l) is the sample of the PUs' signal transmitted on sub-carrier n, which is assumed to be randomly and independently drawn from phase shift keying (PSK) constellations. Note that s n (l) = 0 when there is no transmission by PUs. z k,n (l) is the additive white gaussian noise (AWGN) sample with variance δ 2 . l is the sample index. For subcarrier n, each SU computes first the test statistic as the average energy of the received signal using L consecutive samples, denoted by T k,n (y k,n ) = 1 L L−1 l=0 |y k,n (l)| 2 . Then, http://jwcn.eurasipjournals.com/content/2012/1/334 the pre-processed sensing statistics are reported to the CR-BS from all SUs. The decision metric for sub-carrier n at the CR-BS can be written as: Denote by λ =[ λ 1 , λ 2 . . . , λ N ] the detection threshold vector on all sub-carriers. The decision on the occupancy of sub-carrier n can be obtained by comparing the decision metric T G n against the detection threshold λ n . This is equivalent to distinguishing between the following two hypotheses: Specifically, if T G n > λ n , then hypothesis H 1 is true; otherwise hypothesis H 0 holds. Denote by P fa n and P md n the FAP and the MDP on sub-carrier n, respectively. According to the central limit theorem, for a large number of samples L, T G n is approximately normally distributed. The FAP and the MDP on sub-carrier n can then be expressed as follows, respectively [17]: where Q(.) is the complementary distribution of a standard Gaussian random variable and γ n =γ n K k=1 |h ps k,n | 2 /K.γ n = p pu /δ 2 denotes the average signal to noise ratio (SNR) of PUs on sub-carrier n, where p pu is the transmission power of PU on sub-carrier n.
As mentioned earlier, the SUs will utilize sub-carrier n under two possible circumstances: when the sub-carrier is idle and no false alarm is generated, or when the subcarrier is occupied but the occupancy is not detected. Similar to what is widely used in the literature [22,23], we assume that the sub-carriers are occupied by the PUs according to an ON/OFF model. Let us denote by π 0 the prior probability that PUs are absent on a specific subcarrier and by π 1 = 1 − π 0 the prior probability that they are active. Then, the two circumstances described above happen with probabilities (1 − P fa n )π 0 and P md n π 1 , respectively.

Optimization problem formulation
Define, respectively a power allocation matrix by P = {p k,n ≥ 0|k ∈ {1, 2, . . . , K}, n ∈ {1, 2, . . . , N}} and a subcarrier assignment matrix by ρ = {ρ k,n ∈ {0, 1}|k ∈ {1, 2, . . . , K}, n ∈ {1, 2, . . . , N}}. For simplicity, we assume that each sub-carrier can only be assigned to one SU. Then, we have ρ k,n = 1 when sub-carrier n has been assigned to SU k, and ρ k,n = 0 otherwise. Let R 0 k,n = C p k,n |h cs k,n | 2 , 0 be the data rate of SU k on sub-carrier n when PUs are absent, where p k,n is the transmission power of SU k on sub-carrier n. Note that where δ 2 denotes the AWGN noise variance. Throughout the context we use (6) as a normalized capacity expression to represent both the theoretical Shannon capacity and the achieved data rate, i.e., protocol overhead is ignored. Similarly, we use R 1 k,n = C p k,n |h cs k,n | 2 , p pu |h ps k,n | 2 to represent the data rate of SU k on sub-carrier n when PUs are present, where p pu |h ps k,n | 2 is the interference power of the P-BS measured at SU k.
Denote by R(λ, P, ρ) the total capacity for all SUs. Then we have, In order to formulate the joint detection threshold and resource allocation problem, the following system constraints must be taken into consideration: • CR-BS power budget constraint: Let P T denote the maximum transmission power of the CR-BS, the total power allocated on all sub-carriers must be less than or equal to P T . That is: • PUs' rate loss constraint: Similar to [20], in order to protect the transmission of the PUs, we impose an upper bound on PUs' rate loss, a which is caused by unexpected SU transmissions. Let R max pu,n = C p pu |h pu n | 2 , 0 be the maximum data rate http://jwcn.eurasipjournals.com/content/2012/1/334 that the PUs can achieve on sub-carrier n. Denote by R md pu,n = C p pu |h pu n | 2 , p k,n |h cp k,n | 2 the achievable data rate of the PUs on sub-carrier n when SU k is also transmitting. Let R be the maximum rate loss that the PUs can tolerate on each sub-carrier. Then, the SU transmission on sub-carrier n is allowed only when the following constraint is satisfied: The goal of our system design is to maximize the total downlink capacity of SUs as defined in (7) while satisfying the constraints discussed above. More precisely, the optimization problem, referred to hereafter as (P1), is formulated as follows: where constraints C4 and C5 take into account the fact that each sub-carrier can only be assigned to one SU.
However, (P1) is a mixed integer programming problem including three sets of variables (λ, P, ρ) to be optimized, and it is computationally complex to solve. Moreover, Constraint C2 is non-convex, making (P1) non-convex. In the following, we propose two algorithms named as the offline and online algorithms to solve (P1). In the offline algorithm, an exhaustive search based on a large number of detection thresholds is done to optimize the SAPA. Then, the optimal solution is found among the candidate detection thresholds. In the online algorithm, a sub-optimal solution is obtained iteratively. We show later that this algorithm converges after a few iterations.

The offline algorithm to solve (P1)
The main idea of the offline algorithm is to solve (P1) by fixing one of the three variables, λ, with a set of known values. This is based on the observation that if the detection threshold vector λ is given, then P fa n and P md n can be easily calculated by (4) and (5), respectively. Thus (P1) is shrunk to a SAPA optimization problem with only two variables, P and ρ, for any given λ. We can then obtain the global optimal solution by selecting the best λ value.
Denote by P fa n (λ n ) and P md n (λ n ) the MDP and the FAP for a given λ, respectively. (P1) can be re-formulated as a SAPA optimization problem, referred to as (P2), as follows: In the rest of this section, we propose two algorithms, one optimal and another sub-optimal, to solve the SAPA optimization problem, (P2).

The optimal algorithm to solve the SAPA problem
According to [24], the duality gap of the SAPA problem in multi-band networks is nearly zero when the number of sub-carriers is sufficiently large. Thus, the dual decomposition method can be used to solve (P2) when λ is given. In order to make (P2) tractable, we first transform constraint C2 of (P2) into a convex form. Redefine R = ηR max pu,n , where 0 ≤ η ≤ 1. η can be interpreted as the fraction of PUs' rate loss. Using the following proposition, we can transform the PUs' rate loss constraint into a maximum power allocation constraint. Proposition 1. For a given set of detection thresholds λ, if η < P md n (λ n ), the PUs' rate loss constraint on each sub-carrier is equivalent to a maximum power allocation constraint on each sub-carrier. The power budget on each sub-carrier is given by: Hence, constraint C2 of (P2) is satisfied if K k=1 ρ k,n p k,n < P max n , ∀n. If η ≥ P md n (λ n ), the PUs' rate loss constraint is equivalent to K k=1 ρ k,n p k,n ≥ 0, ∀n. http://jwcn.eurasipjournals.com/content/2012/1/334 Proof. Please refer to Appendix 1. Using Proposition 1, the Lagrangian function of (P2) becomes: where μ and β =[ β 1 , . . . , β N ] are the Lagrange multipliers corresponding to constraints C1 and C2 in (P2). Note that constraints C3, C4 and C5 are not taken into account in the Lagrangian function. However, these constraints will be satisfied in the dual domain when solving the problem, as shown later.
The Lagrangian dual function corresponding to (P2) is defined by: Therefore, the dual optimization problem corresponding to (P2) is given by: Note that the Lagrangian function, L(P, μ, β), is linear in (μ, β) for a fixed P, and g(μ, β) is the maximum one of these linear functions. Therefore, the dual optimization problem (14) is convex. Furthermore, the Lagrangian dual function is decomposed into N independent optimization problems, which is: where: Since each sub-carrier can be assigned to only one SU, (16) actually indicates a rule for allocating sub-carriers, which is to search the SU that maximizes (16) for a specific sub-carrier. To solve (P2), a two step iterative process is needed. First, each sub-carrier is allocated to the corresponding SU according to (16). Second, the Lagrangian multipliers are updated. The iterative process continues until convergence is achieved.
then the OPAp k,n is the unique positive root of the cubic equation: Proof. Please refer to Appendix 2.
Using Lemma 1, the Lagrangian multipliers are updated as follows: where ξ j μ and ξ j β n are the appropriate positive step-size sequences, and j is the iteration index.
Since p k,n must always satisfy 0 ≤ p k,n ≤ min(P T , P max n ), we can obtain the upper bound of μ and β n by letting p k,n = 0, that is: The initial value of (μ, β) could therefore be selected from these areas shown above. After obtaining the optimal Lagrangian multipliers, denoted as (μ * , β * ), the OPA can be obtained as p * k,n = p k,n (μ * , β * ). Then, using (16), the optimal sub-carrier assignment is determined. The pseudo-code for the optimal SAPA algorithm is described in Algorithm 1.

Sub-optimal SAPA algorithm
The optimal SAPA algorithm presented above jointly optimizes the SAPA, but it is computationally costly (its complexity is analyzed in Section 7). Generalizing the proof given in [26] for multi-band CRN, the maximum capacity in the downlink can be obtained when each sub-carrier http://jwcn.eurasipjournals.com/content/2012/1/334 is assigned to the user that has the best channel gain. However, this sub-carrier assignment is not optimal in the CRN, as we need to consider the constraint on PUs' rate loss for each sub-carrier. Based on this consideration, a low-complexity but yet effective sub-optimal SAPA scheme is proposed here.
More specifically, the optimization problem (P2) is divided into two parts, which are sub-optimal sub-carrier assignment (SSA) and OPA. Once sub-carriers have been assigned to users, the OPA can be obtained using (18) and (20). The details of the sub-optimal SAPA are given in Algorithm 2. 1) Find a pair of (n * , k * ) such that:

The online algorithm to solve (P1)
The computational cost of the offline solution presented in Section 5 is quite high as an exhaustive search over a large number of candidate detection thresholds λ must be done, which makes it unfeasible for online deployment. Note that the number of λ is also a function of granularity between any two consecutive λ values. In this section, we propose a new algorithm named as iterative optimization of detection threshold and throughput (IODTT) to solve (P1). Unlike the offline algorithm, the IODTT algorithm finds the sub-optimal detection thresholds (SDTs) and SAPA iteratively, thus it can be used online. In Section 8, we show through simulations that the algorithm converges after a small number of iterations. The core idea of the IODTT algorithm is to divide (P1) into two sub-problems, and then solve the two subproblems iteratively. At the ith iteration, the SDTs, λ (i) , are obtained by solving the first sub-problem. Using λ (i) , the second sub-problem SAPA {P (i) , ρ (i) } is solved using either the optimal SAPA algorithm or the sub-optimal SAPA algorithm proposed in Section 5. The iteration process stops once convergence is achieved.

Sub-optimal detection threshold determination
Given an initial value for the sub-carrier and power allocations (P (0) , ρ (0) ), the optimization problem to determine SDTs is formulated as the maximization of the average total SU capacity while keeping the PUs' rate loss upper bounded. The first sub-problem, denoted by (P3), can then be formulated as: where k,n |h cs k,n | 2 , p pu |h ps k,n | 2 are the total data rates on sub-carrier n given (P (0) , ρ (0) ), when the PUs are absent and present, respectively. Furthermore, since Q(x) is a monotonically decreasing function of x, we can transform (P3) into a linear programming problem, which is expressed as: where Now the optimization problem is translated into a linear problem, as shown in (26) and it can be solved using the interior-point method or other numerical search algorithms.

The IODTT algorithm
Given the SDTs, λ (i) , obtained at the ith iteration of (P3), (P1) is equivalent to (P2). Then, it can be correspondingly http://jwcn.eurasipjournals.com/content/2012/1/334 solved using either the optimal or the sub-optimal SAPA algorithms presented in Section 5. In other words, (P1) is split into a set of (P2)s and it can be iteratively solved using the results from (P3). However, the solution obtained may not always be globally optimum.
To give more details, we outline the IODTT algorithm in Algorithm 3. In our execution of the algorithm, a typical value for the convergence condition φ is configured as φ = 0.01. But it can also be configured as other values, depending on the execution time requirement of the system. Given that the objective function shown in (10) is non-decreasing at each iteration, we can obtain that: where i means the index of iteration. Since P and λ are upper bounded, convergence is guaranteed. An important property of the IODTT algorithm is its insensitivity to the initial value P (0) and ρ (0) , as shown by the simulation results presented in Section 8.

Complexity analysis
For the offline solution, the complexity depends on the size of the region where possible detection thresholds are sought, the calculation of the SAPA, and the granularity of the thresholds. For the optimal SAPA, the number of iterations required to obtain the ε-optimal Lagrangian multipliers (μ * , β * ), i.e., g(μ, β) − g(μ * , β * ) < ε, is in the order of O 1 ε 2 [25]. In each iteration, the computation of (16) requires K comparisons for each of N subcarriers. Thus the total complexity of the optimal SAPA is O NK ε 2 . For the sub-optimal SAPA algorithm, the complexity of the SSA is O 4NK+K−3K 2 2 , thus the total complexity of the sub-optimal SAPA is O 4(N+1)K−3K 2 2 + 1 ε 2 . The complexity of the sub-optimal SAPA is much lower than that of the optimal SAPA when the number of the SUs is large and ε is small. Assuming that for each sub-carrier the same detection threshold value is used, and there are m possible detection thresholds to search, then the total computation complexity of the offline solution is O mNK ε 2 when using the optimal SAPA and O m 4(N+1)K−3K 2 2 + 1 ε 2 when using the sub-optimal SAPA. If sub-carriers have different detection thresholds, the computation complexity will be prohibitively high in both cases.
The computation complexity of the IODTT algorithm is related to the number of iterations and the calculation of the detection threshold and SAPA. Since (26) is a linear programming problem, the computation complexity required to determine the detection thresholds is in the order of O(N 1.5 ) [27], where N is the total number of subcarriers. Denote the number of iterations required for the convergence as r. The total computation complexity of the IODTT algorithm is O r 4(N+1)K−3K 2 2 + 1 ε 2 + N 1.5 when the sub-optimal SAPA is employed. With our parameter configuration presented below in Section 8, the average number of iterations required for convergence is found to be 4 < E[ r] < 6.

Numerical evaluation
To evaluate the performance of the proposed algorithms, we perform extensive simulations using a custom-built MATLAB simulator. For simplicity, we consider a multiband CRN with K = 2 SUs and 2 PUs, and the variance of the AWGN is normalized to 1. We assume that the channel gains, e.g., h pu n , h cs k,n , h ps k,n and h cp k,n , are independent, identically distributed Rayleigh random variables with average channel power gains equaling to 0.4, 0.4, 0.1 and 0.1 respectively. The number of sub-carriers is N = 8 and the number of samples is L = 100. The PUs activity factor is assumed to be small, as π 1 = 0.3. Note that the proposed algorithms also apply to more realistic scenarios with larger numbers of SUs/PUs and sub-carriers. The reason that we configure the system with these comparatively small values is to run our simulations faster according to the complexity analysis in Section 7. Meanwhile, these values are also very representative when evaluating the proposed algorithms according to [21].
To run the offline and online algorithms, the initial value of detection threshold should be properly selected. For the offline algorithm, in order to determine the initial detection threshold vector λ, we set a set of candidates for FAP or MDP, e.g. FAP ∈[ 10 −6 , 10 −5 , . . . , 10 0 ]. Once the values of FAP or MDP are determined, the initial detection threshold is determined. This method for selecting the initial detection threshold has been widely used in [13,15,28]. For the online algorithm, since we iteratively find the best values of λ and (P, ρ), the sub-carrier assignment ρ and power allocation P are determined by random sub-carrier assignment and equal power allocation. The initial λ value can be obtained according to (26). The performance of the offline and online IODTT algorithms is compared with the performance of two benchmark schemes [10,19]. The first scheme [10] maximizes the average total capacity of the SUs based on both the optimal and sub-optimal SAPA algorithms, using a UDT, and it is similar to the approach specified in the 802.22 standard. The computation complexity of this scheme is very low, since no iterations are required to determine the capacity of the CRN. However, its solution is not optimal. As another benchmark reference to the IODTT algorithm, the second scheme [19] selects an average detection threshold (ADT) by taking the linear average among all SDTs. Using the single ADT, the MDP and the FAP can be obtained on each sub-carrier, and then both the optimal SAPA and the sub-optimal SAPA algorithms are used to solve it. The complexity of the second scheme is equal to that of our algorithm. For comparison convenience, the algorithm configuration and the corresponding complexity level of all the algorithms considered in our study are summarized in Table 1. In the table, OFLO/OFLS stand for offline algorithm with optimal/suboptimal SAPA, ONLO/ONLS stand for online algorithm with optimal/suboptimal SAPA, ADTO/ADTS stand for optimal/suboptimal SAPA with the ADT, and UDTO/UDTS stand for optimal/suboptimal SAPA with uniform detection threshold, respectively.
The evolution of the SUs' average total capacity R tot = E [R(λ, P, ρ)] with respect to different parameters are investigated. Each value in the curves corresponds to an average of 500 independent channel realizations. For each This table lists the algorithm configuration and the corresponding complexity level of all algorithms.
value, we have also determined the confident interval with a confidence level of 95%. As these intervals are very small, they are displayed for illustration purpose only in Figures  2 and 3. Let us first analyze the optimality of total capacity using the offline algorithm. Figures 2, 3, 4 and 5 show that an optimal detection threshold λ * that maximizes R tot exists indeed for optimization problem (P2), no matter whether the optimal or the sub-optimal SAPA algorithm is employed. To keep the computational complexity in the offline algorithm manageable, we used the same detection threshold value for all sub-carriers. Figures 2 and 4 further depict the impact of the power budget, P T of the CR-BS, on the optimal detection thresholds, λ * , for the optimal and the sub-optimal SAPA algorithms respectively. Two operating regions for λ are identified as λ * ∈[ 0.9, 1.04] and λ * ∈[ 1.05, 1.1].
In the first region, an increase in P T leads to a significant increase in R tot . Clearly, a small value of λ leads to a high FAP and a low MDP, and consequently the number of sub-carriers available for SU transmission is small. For a constant λ, if we increase P T , R tot increases. On the other hand, for a constant R tot , λ increases significantly as P T decreases. This is because as P T decreases, the PUs will be less affected by the SUs, and then a higher MDP or a lower FAP can provide more transmission opportunities for the SUs. The higher the P T , the more sensitive the R tot with respect to λ. To achieve the peak R tot at a reduced power level, it is required to increase λ. In the second region with λ * ∈[ 1.05, 1.1], R tot is insensitive to P T , i.e., for a constant λ, different values of P T achieve the same R tot . This result is expected, because as λ increases, the MDP increases, and then the constraint on power budget becomes insignificant.
In Figures 3 and 5, the impact of the PUs' rate loss fraction, η, on the optimal detection threshold, λ * , is evaluated. Similar to the analysis of Figures 2 and 4 above, two regions for λ are identified. In the first region, e.g., [ 0.90, 0.95], R tot is insensitive to η for a constant λ. Clearly, for small values of λ, the MDP is small, meaning that all PU activities will be correctly detected. Then the PUs' rate loss will be negligible. Consequently, R tot will not improve appreciably for different values of the PUs' rate loss constraint η. In the second region, e.g., [ 0.96, 1.1], as λ increases, the MDP increases and the FAP decreases, and η has higher impact on the perfomathrmance of R tot . The reasons for this behavior are twofold. Firstly, for a constant λ, if we increase η, then R tot will increase in approximately the same proportion. This can be explained because that the higher the PUs' rate loss we allow, the more power can be allocated to the SUs' transmission. Secondly, for a constant R tot , if we decrease η, then λ will decrease in approximately the same proportion. Again, this is because that by decreasing the PUs' rate loss, the MDP must decrease in order to detect the PU activities more precisely, leading to a reduction of λ. Now we give a performance comparison of various algorithms in Figures 6 and 7. Figure 6 shows the variation of 0  R tot with P T , while keeping η = 0.1%, for the different algorithms studied. As observed, R tot increases monotonically for all algorithms as P T increases. Clearly, the proposed algorithms outperform the conventional UDTO and UDTS schemes, as the later ones select a relatively low detection threshold to ensure that the rate loss of the PUs will not exceed a certain value. Among the evaluated algorithms, OFLO shows the best performance, but at the same time it requires the highest computational complexity. On the other hand, the R tot achieved by the online algorithms ONLO and ONLS, is only 8.8 and 21.5% lower than their online counterparts OFLO and OFLS, but require a much lower computational complexity. In addition, this difference diminishes as P T increases, and when P T is sufficiently high, the ONLO algorithm is able to achieve the same performance as OFLO does. It can be also noted that ONLO and ONLO outperform ADTO and ADTS significantly. Figure 7 shows the variation of R tot with η, while keeping P T = 10 W. The performance relationship among the different algorithms exhibits the same trend as we may observe in Figure 6. However, it is worth mentioning that the performance difference between OFLO and ONLO becomes marginal in this case, compared with that in Figure 6. Again, our proposed algorithms outperform UDTO and UDTS. Note that UDTO and UDTS are insensitive to η as they select a low detection threshold to achieve a low MDP, which prevents the SUs from sharing the resources with the PUs. In addition, selecting a low detection threshold leads to a high FAP, which further exacerbates the reduction of available resources for the SUs. Finally, the convergence of the IODTT algorithm is analyzed. Figure 8 depicts typical evolutions of the convergence process for four random channel realizations (ChRe), where the curves show Norm i P and Norm i λ at the ith iteration, respectively. Note that Norm i P = P n and Norm i λ = λ are the Euclidean norms of vectors P n and λ. P n denotes the power allocated on each sub-carrier, which is calculated by P × ρ. The curves provide heuristic evidence of the fast convergence of the IODTT algorithm (4 to 6 iterations).

Conclusions
In this article, we study the joint optimization of detection threshold and resource allocation in infrastructurebased multi-band CRN. The optimization problem has been formulated to maximize the total downlink capacity of SUs, considering three sets of variables, i.e., detection threshold, SAPA, with constraints on the PUs' rate loss and the power budget of the CR-BS. Two schemes, referred to as offine and online algorithms respectively, are proposed to solve the optimization problem. The offline algorithm is able to achieve global optimization however with prohibitively high computation complexity. The online algorithm, on the other hand, is able to achieve close-to-optimal performance with realtime operations. Lastly, we have shown through extensive simulations that by jointly optimizing the detection threshold together with the SAPA strategies, the downlink capacity of CRN can be improved significantly, outperforming the traditional static detection threshold based algorithms. Define f 2 (p * k,n ) = p * k,n + 1 α k,n = 1−P fa n (λ n )+P md n (λ n ) (μ+β n ) ln 2−f 1 (p * k,n ) , and note that f 2 (p * k,n ) is a decreasing function of p * k,n . For p * k,n ≥ 0, the maximum value of f 2 (p * k,n ) is: f max 2 (0) = 1−P fa n (λ n )+P md n (λ n ) (μ+β n ) ln 2−f 1 (0) , and the minimum value of f 2 (p * k,n ) is: f min 2 (∞) = 1−P fa n (λ n )+P md n (λ n ) (μ+β n ) ln 2 . As shown in Figure 9, assuming 1 α k,n < 1−P fa n (λ n )+P md n (λ n ) (μ+β n ) ln 2−f 1 (0) , p * k,n is the point of intersection between the curves of f 2 (p * k,n ) = p * k,n + 1 α k,n and f 2 (p * k,n ) = 1−P fa n (λ n )+P md n (λ n ) (μ+β n ) ln 2−f 1 (p * k,n ) .