Joint Resource Allocation of Spectrum Sensing and Energy Harvesting in an Energy-Harvesting-Based Cognitive Sensor Network

The cognitive sensor (CS) can transmit data to the control center in the same spectrum that is licensed to the primary user (PU) when the absence of the PU is detected by spectrum sensing. However, the battery energy of the CS is limited due to its small size, deployment in atrocious environments and long-term working. In this paper, an energy-harvesting-based CS is described, which senses the PU together with collecting the radio frequency energy to supply data transmission. In order to improve the transmission performance of the CS, we have proposed the joint resource allocation of spectrum sensing and energy harvesting in the cases of a single energy-harvesting-based CS and an energy-harvesting-based cognitive sensor network (CSN), respectively. Based on the proposed frame structure, we have formulated the resource allocation as a class of joint optimization problems, which seek to maximize the transmission rate of the CS by jointly optimizing sensing time, harvesting time and the numbers of sensing nodes and harvesting nodes. Using the half searching method and the alternating direction optimization, we have achieved the sub-optimal solution by converting the joint optimization problem into several convex sub-optimization problems. The simulation results have indicated the predominance of the proposed energy-harvesting-based CS and CSN models.


Introduction
The cognitive sensor (CS), based on cognitive radio, has been proposed to transmit the sensing data using the idle spectrum licensed to the primary user (PU), when the PU is shortly absent. However, the CS must sense the absence of the PU by performing spectrum sensing before accessing the licensed spectrum [1,2]. During the transmission, the CS should sense the PU periodically. Once the presence of the PU is detected, the CS must vacate the licensed spectrum in order to avoid causing any harmful interference to the PU [3]. The spectrum sensing performance is reflected by false alarm probability and detection probability. The spectrum utilization improves with lower false alarm probability while the interference decreases with higher detection probability [4,5].
Energy detection has been proposed as an effective spectrum sensing method when the prior information of the detected signal is hard to obtain. However, energy detection performance may be degraded when the channel path between the PU and the CS is in severe fading or shadowing [6,7]. Hence, cooperative spectrum sensing has been proposed to improve the spectrum sensing performance for a cognitive sensor network (CSN), which allows multiple CSs to sense the PU collaboratively and uses a control center to combine the detection results of these CSs to make a final decision [8].
In [9], periodical cooperative spectrum sensing is proposed, where the sensing period is optimized to improve the spectrum utilization and reduce the interference. In [10], it has been proven that there is a sensing-throughput tradeoff in cognitive radio, i.e., there is an optimal sensing time that maximizes the transmission throughput.
Since the CS has limited battery energy due to its small size, deployment in atrocious environments and long-term working, its transmission performance is often restricted. Recently, energy harvesting has been proposed to collect and store the renewable radio frequency (RF) energies of the environmental signal sources. By deploying a rectifying circuit, the RF energy can be converted to the electrical power for supplying the transmission of a wireless communication system [11][12][13][14]. In a CSN, the CS may harvest the RF energy of the PU signal to improve transmission power when the PU is present in the channel [15][16][17]. In [18], an optimal energy-harvesting-based cooperative spectrum sensing model is proposed, which seeks to maximize the spectrum access probability of the CSN by jointly optimizing the sensing parameters such as sensing time and sensing node. However, the optimization of energy harvesting parameters such as harvesting time and harvesting node is not considered. Both sensing parameter and harvesting parameter have deep impacts on the transmission performance. In [19], energy-harvesting-aided spectrum sensing and data transmission is proposed, which minimizes the energy consumption by jointly allocating transmission time, transmission power and channels. However, the resources of spectrum sensing and data transmission are allocated independently in different sensors.
In this paper, a joint resource allocation of spectrum sensing and energy harvesting for an energy-harvesting-based CSN has been proposed, where spectrum sensing, energy harvesting and data transmission are synthetically considered in one CS. The contributions of the paper are listed as follows: • We have investigated an energy-harvesting-based CSN model, which divides the CSs into two groups, one for sensing the PU cooperatively and the other one for harvesting the RF energy collaboratively. The harvested energy is used to increase the transmission energy of the CSN. Through considering spectrum sensing, energy harvesting and data transmission comprehensively, the transmission rate of the CS is improved while the sensing performance is guaranteed.

•
We have investigated the joint resource optimization of sensing time, harvesting time and the numbers of sensing nodes and harvesting nodes. We have formulated the resource allocations of a single CS and CSN as two joint optimization problems, respectively. These optimization problems seek to maximize the transmission rate by obtaining a tradeoff between spectrum sensing and energy harvesting.
The rest of the paper is organized as follows. In Section 2, a single energy-harvesting-based CS together with its frame structure is described, and the joint time allocation of spectrum sensing and energy harvesting is performed. In Section 3, an energy-harvesting-based cooperative CSN including network structure and frame structure is presented, and the joint time-and-node allocation of spectrum sensing and energy harvesting is analyzed. The simulations and discussions are provided in Section 4. Finally, the conclusions are drawn in Section 5.

Resource Allocation in Single Cognitive Sensor
The CSN is proposed based on the IEEE 802.22 defined as the cognitive radio wireless regional area network standard. In IEEE 802.22, the idle spectrum can be unused licensed channels over a given area, which can be reused by the CR network; however, if the spectrum availability changes, the 802.22 network must adapt quickly so as not to cause harmful interference to the licensed transmissions [20]. Thus, in the CSN, a CS may share the same spectrum with a PU in order to improve the spectrum utilization, but the CS cannot bring any interference to the PU when the PU is working. In this paper, the CS can only use the idle spectrum to transmit data when the PU is absent in the spectrum, however, the CS has to vacate the spectrum when the PU is present again, as shown in Figure 1. Thus, the CS can use the idle spectrum as a secondary user, who has to sense the absence of the PU before accessing the potentially idle spectrum. The limited energy of the CS may restrict the transmission performance especially when forwarding image or video data. In this section, the CS can harvest the RF energy of the outside signal sources before transmitting data, then the harvested energy is used to increase the transmission energy in order to guarantee the transmission quality.

Energy-Harvesting-Based Cognitive Sensor
We assume the CS performs spectrum sensing, energy harvesting and data transmission periodically. Thus, as shown in Figure 2, the frame structure of the CS is divided into three time slots: spectrum sensing slot, energy harvesting slot and data transmission slot. The CS senses the PU by energy detection in the spectrum sensing slot, while harvesting the RF energy in the energy harvesting slot. If the absence of the PU has been detected, the CS will forward data in the data transmission slot, otherwise the CS will stop communicating in the current frame and sense the PU again in the following frame. We suppose that the frame duration is T, the time length of the spectrum sensing slot is τ and the time length of the energy harvesting slot is ε. Then the time length of the data transmission slot is T d = T − τ − ε. Energy detection has been proposed as an effective spectrum sensing method, which can obtain an accurate detection result without needing any priori information of the detected signal. In the spectrum sensing slot, the CS uses energy detection to detect the presence of the PU. As shown in Figure 3, the energy detection process is described as follows. Firstly, We pass the received detected signal y through a band-pass filter to select an appropriate sensing frequency and sample' /the received signal as y(k) using the sampling frequency f s within the sensing time τ; then, we get the frequency domain value of y(k) as Y(k) through the Fast Fourier Transformation (FFT) and obtain the energy statistic of the detected signal as Φ(Y) by averaging the squared amplitude of Y(k); finally, the energy statistic Φ(Y) is compared with a threshold λ. If Y ≥ λ, the presence of the PU, denoted by H 1 , is decided, otherwise, the absence of the PU, denoted by H 0 , is determined. The probabilities of H 0 and H 1 are assumed to be P(H 0 ) and P(H 1 ), respectively. Thus, the detected signal is processed as a binary hypothesis problem as follows where s(k) is the sampled PU signal with the power p s , n(k) is the sampled Gaussian noise with the variance σ 2 n , h(k) is the channel gain between the PU and the CS, and M = τ f s is the number of the sampling nodes. We suppose Y(k) for k = 1, 2, ..., M are the FFT values of y(k) for k = 1, 2, ..., M. The energy statistic of the detected signal is given by where N (a, b) denotes the Gaussian distribution with mean a and variance b, γ = p s h 2 /σ 2 n is the PU signal to noise ratio (PSNR). By comparing Φ(Y) to a presettled decision threshold λ, the false alarm probability and detection probability of energy detection, related with sensing time and decision threshold, are given as [21] where the function Q(x) is described as When the absence of the PU is detected accurately, the CS can transmit data effectively in the channel with the probability (1 − P f )P(H 0 ). However, when the PU is present but the absence of the PU is detected falsely, the CS will also transmit data in the channel but cause harmful interference to the PU with the probability (1 − P d )P(H 1 ). The interference power p int must be less than the maximal interference power I max suffered by the PU, as follows where p t is the transmission power produced by the original energy. Then we can get the lower limit of detection probability as From (4) and (5), λ can be obtained with the given P low d , then P f can be denoted by P low d as follows In the energy harvesting slot, the CS harvests the RF energy of the outside signal sources including the PU signal and the noise. As shown in Figure 4, the RF energy harvesting process is described as follows. We filter out the out-of-band electromagnetic radiation to the received signal through a band-pass filter, then convert the RF output of the filter to the DC signal by a rectifying circuit, and finally obtain the DC power by filtering out the harmonic and fundamental signals from the DC signal with a low-pass filter. However, some energy may be leaked to the surrounding environment due to the circuit electromagnetism compatibility, so we assume the energy harvesting efficiency is 0 < µ < 1. Noting that the PU appears with the probability P(H 1 ), the harvested energy of the CS within harvesting time ε is given by E h is stored in a rechargeable battery and used to supply the transmission energy in the data transmission slot, thus the transmission power of the CS can be improved. Supposing τ T and ε T, the transmission power increment, related with ε, is given by  The transmission time of the CS within a frame is T − τ − ε, and the transmission probability of the CS is 1 − P f (τ) P(H 0 ). The transmission rate of the CS is calculated from the Shannon-Hartley theorem as W log 1 + (p t +∆p(ε))g 2 σ 2 n , where W is the bandwidth, and g is the channel gain between the CS and the control center. Thus, the average transmission rate of the CS is given by For simplification, we assume W = 1 kHz, which can be ignored in the following deductions.

Joint Time Resource Allocation
We seek to maximize the average transmission rate of the CS by jointly optimizing the spectrum sensing time and the energy harvesting time, subject to the constraint that the detection probability is above its lower limit, as follows Since Q(x) is a monotonously decreasing function, from (4) and (5) both P f and P d decrease with the increasing of λ. Thus, to maximize R, P f should be decreased as low as possible, which indicates λ should be increased until P d achieves its lower limit, i.e., P d = p low d . According to (9), the objective function of (13a) is rewritten as follows Since (13) is a multi-parameter optimization problem, which is hard to be solved directly, we use alternating direction optimization (ADO) to obtain the sub-optimal solution [22]. Fixing ε, the optimization problem (13) converts to the sub-optimization problem about τ as follows n can be seen as three constants with fixed ε. To solve (15), we give the following Theorem 1. (15) is a convex optimization problem about τ, i.e., there is a certain τ * ∈ [0, T 0 ] that makes R(τ * ) achieve the maximum.

Theorem 1. The problem
Proof of Theorem 1. We calculate the first-order and secondary-order partial derivatives of P f (τ) in τ as follows By letting P f ≤ 0.5, we have A + γ τ f s ≥ 0. Then from (16) and (17), we get ∇P f < 0 and ∇ 2 P f > 0, respectively. We also get ∇P f → −∞ with τ → 0. We calculate the first-order and secondary-order partial derivatives of R(τ) in τ as Since 0 ≤ Q(x) ≤ 1, from (18) we have which indicates there is a τ * ∈ [0, T 0 ] that makes ∇R(τ * ) = 0. From (19), ∇ 2 R < 0 can be obtained with ∇P f < 0 and ∇ 2 P f > 0, which indicates that ∇R(τ) is a monotonously decreasing function. Hence, τ * is the unique value that makes R(τ * ) achieve the maximum.

Algorithm 1
Half searching algorithm for τ *
Then fixing τ, the optimization problem (13) converts to the sub-optimization problem about ε as follows T are seen as three constants with fixed τ. To solve (21), we give the following Theorem 2. (21) is a convex optimization problem about ε, i.e., there is a certain ε * ∈ [0, T 1 ] that makes R(τ * ) achieve the maximum.
Similarly, we can get ε * by the half searching algorithm with the Algorithm 1. Then we use the ADO to solve the optimization problem (13) by repeating to optimize τ and ε alternatively by fixing one of these two parameters. The jointly optimal solution can be obtained until both τ and ε are convergent. The joint optimization of sensing time and harvesting time is shown in the Algorithm 2.

Resource Allocation in Cooperative Cognitive Sensor Network
We consider a cooperative CSN consisting of N CSs and one control center. In the cooperative CSN, all the CSs will sense the PU and harvest the RF energy cooperatively; the control center manages the CSs and decides the available idle spectrum. Once the absence of the PU is detected, the CSN will access the spectrum to perform communications.

Energy-Harvesting-Based Cooperative Cognitive Sensor Network
We divide the N CSs into two groups. One group, namely the spectrum sensing group, senses the PU cooperatively, while the other group, namely the energy harvesting group, harvests the RF energy collaboratively, as shown in Figure 5. The frame structure of the CSN is divided into two time slots: sensing-and-harvesting slot and data transmission slot, as shown in Figure 6. In the sensing-and-harvesting slot, the spectrum sensing group and the energy harvesting group work simultaneously. If the absence of the PU is detected, the CSN will transmit data in the licensed spectrum with both the battery energy and the harvested energy.
The CSs in the sensing group perform cooperative spectrum sensing to improve the sensing performance. In the cooperative spectrum sensing, every CS senses the PU from the energy detection link and makes a local one-bit decision such as 0 (denoting H 0 ) or 1 (denoting H 1 ), then all the one-bit decisions are sent to the control center through the sensing reporting link, which are combined to get a final decision on the presence of the PU by "OR Rule" or "AND Rule" [23]. While the CSs in the harvesting group perform cooperative energy harvesting to collect the RF energy of the PU signal through the energy harvesting link. All the energy harvesting information is sent to the control center through the harvesting reporting link, which is used to allocate the harvested energy to each CS. The interactive sensing information and harvesting information is broadcasted to all the CSs by the control center. The CSs in the harvesting group will achieve the spectrum utilization state by receiving the broadcasted sensing information. Once the decision on the absence of the PU is achieved, each CS may have a chance to access the idle spectrum. To avoid causing harmful interference to each other, multiple CSs may transmit data by time division multiple access (TDMA) or frequency division multiple access (FDMA) in the data transmission slot. In the TDMA, the communication time is divided into several frames and each frame is further divided into several time slots, each CS transmits data in the allocated time slot periodically; while in the FDMA, the frequency band is divided into several subbands, each CS transmits data in the allocated subband, as shown in Figure 7.   The CS may have lower energy detection performance due to the channel fading or shadowing, however, by cooperative spectrum sensing, the detection performance in the fading channel can be improved by achieving sensing assistances from the other CSs. In OR-rule combination, the presence of the PU is finally decided if one CS has detected the presence of the PU. Thus, the OR-rule cooperative spectrum sensing can achieve higher detection probability compared with the single spectrum sensing. The false alarm probability and the detection probability of cooperative spectrum sensing are given as where L is the number of the CSs in the spectrum sensing group, P f ,i and P d,i are the probabilities of false alarm and detection of CS i, respectively. From (4) and (5), Ω f can be denoted by fixing Ω d = P low d as follows where τ o is the time length of the sensing-and-harvesting slot.
The number of the CSs in the energy harvesting group is N − L; the overall harvested energy of N − L CSs from the energy harvesting link is given as Hence, the total transmission power increment is given by Since the original transmission power of every CS is p t , the total transmission power of the CSN after energy harvesting is Np t + (N − L)Dτ o . Since the time length of the data transmission slot is given by T − τ o , according to the theorem that 1 x i , we can get the upper limit of the average overall transmission rate of the CSN as follows

Joint Time-And-Node Resource Allocation
Our goal is to maximize the average overall transmission rate of the CSN by jointly optimizing the spectrum sensing time and the number of CS nodes in the sensing group, subject to the constraint that the cooperative detection probability is above its lower limit, as follows Fixing L, the sub-optimization problem (30) converts to the optimization problem about τ o .
According to the Theorem 1, we can easily know that the function φ( n is also convex in τ o . Thus, we have Hence, the problem (30) is a convex optimization problem with fixed L. Moreover, R o (τ o ) can achieve the maximum only when Ω d = p low d . By substituting (27), the objective function (30a) is calculated as where we can also get the derivative ∇R o (τ o ). We can achieve the optimal τ o * by the half searching algorithm similarly with the Algorithm 1. Since L is an integer within 1 to N, it is not computationally complicated to get the optimal L * through the exhaustive searching as follows

Simulations and Discussions
The simulations are drawn using the Matlab Software, where the parameters are set in Table 1.

Single Cognitive Sensor Case
In this section, we consider the single CS case. The channels obey the Rayleigh distribution with the gains changed according to the presettled PSNR. Figure 8 shows the average transmission rate of the CS R with different spectrum sensing time τ and energy harvesting time ε. We can see that there is an optimal set of τ and ε that maximizes R, i.e., the maximal R = 0.2118 kbps when τ = 23 ms and ε = 11 ms.  Figure 9 shows the transmission rate vs. detection probability P d = {0.9, 0.8, 0.7, 0.6} with different spectrum sensing time. We can see that R is lower both with less and larger τ, because the false alarm probability rises to decrease the spectrum access probability (1 − P f )P(H 0 ) with less τ, while the sensing time increases to decrease the transmission time T − τ − ε with larger τ. Figure 10 indicates the transmission rate of the CS vs. detection probability with different energy harvesting time. It is seen that R is lower both with less and larger ε, because the transmission power increment p(ε) is smaller with less ε, while the transmission time is shorter with larger ε. All these have proven the correctness of the Theorems 1 and 2. We also see that R improves as P d decreases, which indicates that R can achieve the maximum only when P d equals to the lower limit P low d .   Figure 11 indicates the transmission rate of the CS vs. the proposed energy-harvesting-based CS model and the traditional CS model without energy harvesting [10]. We can see that the proposed energy-harvesting-based CS model results in a higher transmission rate than the traditional CS model, which indicates that energy harvesting can improve the transmission performance obviously.

Cognitive Sensor Network Case
In this section, we consider the CSN case. The CSN is constituted of 20 CSs and one control center, where the CSs are divided into two groups, one group for cooperative spectrum sensing and the other one for cooperative energy harvesting; the control center manages all the CSs by broadcasting the decision information. Figure 12 shows the average overall transmission rate of the CSN R o with different spectrum sensing time τ o and number of sensing CSs L. We can see that there is an optimal set of τ o and L that makes R o achieve the maximum. Figure 13 shows the transmission rate of the CSN vs. cooperative detection probability Ω d = {0.9, 0.8, 0.7, 0.6} with different number of sensing CSs. It is seen that R o is lower both with smaller and larger L, because the false alarm probability increases to reduce the spectrum access with smaller L, while the harvested energy reduces to decrease the transmission power with larger L.   Figure 14 indicates the spectrum access probability of the CSN, (1 − Ω f )P(H 0 ), vs. cooperative detection probability with different overall harvested energy E o h . We can see that the spectrum access probability decreases with the increasing of E o h . Thus, there is a tradeoff between improving the spectrum sensing and increasing the energy harvesting. In practice, we should consider improving the spectrum sensing preferentially in order to avoid causing any communication interference. Figure 15 shows the transmission rate of the CSN vs. the proposed energy-harvesting-based CSN model and the traditional CSN model without energy harvesting. We can see that the proposed model can achieve a higher transmission rate compared with the traditional model.     Figure 16 shows the energy efficiency of the CSN vs. the proposed energy-harvesting-based CSN model and the traditional CSN model without energy harvesting, with different spectrum sensing time. We can see that the proposed model can achieve higher energy efficiency due to it harvesting more RF energy as the sensing time increases. Figure 17 indicates the transmission rate of the CSN vs. the proposed energy-harvesting-based CSN model with joint resource allocation and the traditional energy-harvesting-based CSN model with fixed harvesting time 5 ms and 10 ms. It is seen that the proposed model can achieve a higher transmission rate by optimizing the energy harvesting resources.    In [17], energy harvesting is implemented only when the presence of the PU is detected, however, the noise energy can also be harvested when the PU is absent. In [18], the numbers of sensing nodes and harvesting nodes are presettled, hence, it is hard to achieve the optimal tradeoff between spectrum sensing and energy harvesting. In [19], the spectrum sensing and data transmission are implemented in different sensors; the CSs in the sensing group cannot transmit data even when the PU is absent. In the proposed model, both the energy of the PU signal and the noise can be harvested; the optimal joint resource allocation of spectrum sensing and energy harvesting is achieved to improve the transmission performance while guaranteeing the sensing performance, and all the CSs in the CSN can transmit data with TDMA or FDMA when the PU is absent. As shown in Figure 18, the proposed energy-harvesting-based CSN model can achieve higher throughput compared with the CSN models in [17][18][19]. proposed energy-harvesting-based CSN energy-harvesting-based CSN in [17] energy-harvesting-based CSN in [18] energy-harvesting-based CSN in [19] Figure 18. Transmission rate vs. energy-harvesting-based cognitive sensor network model.

Conclusions
In this paper, we have proposed the joint resource allocation of spectrum sensing and energy harvesting in a single CS and a CSN, respectively. The frame structures of energy-harvesting-based CS and CSN models are presented to allocate the communication resources. We have formulated the joint resource allocation as joint optimization problems, which seek to maximize the transmission rates of the CS and CSN by jointly optimizing the sensing time, the harvesting time and the numbers of sensing nodes and harvesting nodes. Based on the ADO, we have converted the joint optimization problem into several sub-optimization problems and proven the convex characteristics of these sub-optimization problems. From the simulation results, we have drawn the following conclusions: (1) there is an optimal set of spectrum sensing and energy harvesting parameters that maximizes the transmission rates of CS and CSN; (2) there is a tradeoff between improving spectrum sensing and increasing energy harvesting; (3) the proposed energy-harvesting-based CS and CSN models outperform the traditional models.