On the performance of bi-directional cognitive radio system with network coding at the physical layer

Recently, a variant of network coding at the physical layer named wireless network coding (WNC) has gained much attention due to it’s simplicity and capacity improvement of a bi-directional link. In this paper, we design and analyze a bi-directional cognitive radio (CR) system with multiple pairs based on WNC while taking into account the imperfect spectrum sensing and interference from/to the CR system. In addition, we design a resource allocation framework consisting of a subcarrier allocation strategy with different priority assignments and optimal power allocation algorithm. We show that the quality of service within the CR system highly depends on a proper design of the spectrum sensing process to minimize the probability of missed detection, while the spectrum efficiency of the CR system increases with the number of pairs within the system to which we assign priorities.


Introduction
A limited frequency spectrum is becoming a major problem to accommodate demands of new broadband wireless Internet services such as video streaming, video conferencing, and network gaming. Governmental agencies regulate and assign available radio spectrum based on fixed assignment policy. However, this does not guarantee that the allocated spectrum is efficiently utilized (the utilization of spectrum variates from 15% to 85% [1]). To solve this problem, a cognitive radio (CR) was proposed [2], where the spectrum not used by primary users (PUs) is allocated to secondary users (SUs).
Recently, relay-assisted communication has been regarded as the promising solution to improve the throughput of the CR system [3,4]. A bi-directional CR system [5,6] with multi-antenna relay was presented to improve the spectrum efficiency while keeping the interference towards the PUs in tolerable limits in the case of frequency flat fading channels. However, heavy computational load (at relay) and a limited number of SUs (i.e., two) make the bi-directional CR system with multiantenna relay impractical. Moreover, the interference *Correspondence: amir.ligata@ipsa-institut.com 1 Communication Department, IPSA Institute, Sarajevo 71000, Bosnia and Herzegovina Full list of author information is available at the end of the article from the PUs towards the SUs and imperfect spectrum sensing, which may severely affect the performance of the CR system, have not been considered in [5,6]. Therefore, more efficient bi-directional protocols for the CR system should be investigated.
To further improve the network capacity of a bidirectional link, a variant of network coding at physical layer (i.e., wireless network coding (WNC)) has been proposed [7]. Bi-directional multiple-antenna relaying with physical layer network coding has been studied [8][9][10][11], while distributed Alamouti space-time coding for singleantenna two-way relay networks has been proposed in [12]. In WNC protocol, the transmission is done in two orthogonal time stages. During the first stage (i.e., multiple-access phase), both users simultaneously transmit towards the relay, while during the second stage (i.e., broadcast phase), the relay forwards the received signal back to the users with amplify-and-forward protocol. Thus, a simple implementation of WNC protocol in addition to the capacity improvements makes the application of WNC to the CR system with multiple SU pairs worth investigating.
In this work, we design and analyze a bi-directional CR system with multiple SU pairs enabled by WNC while assuming imperfect spectrum sensing and interference from/to the CR system. We consider multiple SU pairs http://jwcn.eurasipjournals.com/content/2013/1/242 in the CR system to address the interference issues and resource allocation problem for different system scales. Firstly, we analyze the information rate of the CR system with multiple pairs and then theoretically evaluate the interference towards the PUs caused by simultaneous access of multiple SU pairs in the CR system. Secondly, we derive the closed-form symbol error rate (SER) and outage probability. Finally, resource allocation strategy (i.e., subcarrier and power allocation) for the bidirectional CR system with multiple SU pairs is developed with and without priority assignment. We design an optimal power allocation algorithm upon different priority assignment protocols so that the CR resources are efficiently utilized under restrictions towards the primary system (PS). Our theoretical results confirm the effectiveness of the bi-directional CR system employing WNC protocol with multiple SU pairs. The rest of the paper is organized as follows: In Section 2, we present a network model, while a performance analysis is provided in Section 3. In Section 4, resource allocation strategy for the CR system with multiple SU pairs is developed. Numerical results and discussions are presented in Section 5. Conclusion is set out in Section 6.

Network model
We assume that the network consists of the PS and CR systems. In PS, B PUs communicate over the primary base station as illustrated in Figure 1, while in the CR system, K SU pairs (K ≥ 1) communicate over a single-antenna CR base station (CR-BS). For the kth (k = 0 K − 1) SU pair (SU 0,k , SU 1,k ), their coverage area includes the CR-BS, but they are out of each other's coverage area as shown in Figure 1. Thus, there is no direct link between the SU 0,k and SU 1,k for k = 0 K − 1.

Radio access protocol
In conventional approach, a bi-directional communication in the CR system is done using either time division multiple access (TDMA), frequency division multiple access (FDMA), or code division multiple access (CDMA). Without adaptive or dynamic frequency reuse, TDMA and FDMA have lower spectrum efficiency in comparison with CDMA. However, the problem with CDMA is a multi-access interference which increases together with the number of SU pairs and consequently limits the system performance.
Communication protocol for the bi-directional CR system with WNC protocol, in which both SUs of the given pair access the same spectrum at the same time, is done over multiple time slots, as shown in Table 1. In the prestage, CR-BS identifies unoccupied spectrum and allocates them to the pairs of SUs. Then, in the first stage, all SUs simultaneously transmit their signals to the CR-BS, while at the second stage, the received signal at the CR-BS is broadcasted toward users using amplify-and-forward protocol. Finally, the detection is done.

Spectrum sensing
In our CR network, spectrum sensing is done periodically at CR-BS during the pre-stage. Spectrum sensing can be performed in each cycle of the communication protocol or less frequently depending on the PU traffic. We assume that the CR-BS receives information on the PS traffic mode via backhaul link from primary BS and decides how frequently spectrum sensing will be done.  The analyzed spectrum consisting of N subcarriers is a subject to energy detection approach, where the received signal energy is measured over the observation time to obtain the ith (i = 0 N − 1) subcarrier average energy O(i). The average signal energy O(i) is then compared to the predefined energy threshold λ. As a result of this test, a decision between two possible hypotheses is made: (a) H 0 if O(i) ≤ λ, denoting that the PU is not active at the ith subcarrier, and (b) H 1 if O(i) > λ, denoting that the PU is active at the ith subcarrier. Now, the set denoting the idleness of the analyzed subcarriers is obtained as ξ Because of the imperfection of spectrum sensing, some of the detected unoccupied (i.e., white) subcarriers may be used for primary transmission causing interference to the CR system. Thus, in the presented system, the performance of the energy detector is further described with the probability of missed detection by detecting the hypothesis H 0 instead of H 1 . The probability of missed detection is given by δ = Prob{H 0 |H 1 } and is closely related to the probability of the correct detection given by 1 − δ. Moreover, when multiple SU pairs access to white subcarriers, the CR system becomes more sensitive due to enhanced inter-pair interference within the CR system.
The set of all analyzed subcarriers ={i|i = 0 ∼ N −1} is divided into disjoint sets: (a) white subcarriers w and (b) occupied subcarriers o , given by w(o) = {i| ξ(i) = 1(0)} for i = 0 ∼ N−1. Finally, the communication protocol is initiated over the selected set of white subcarriers.

Cognitive radio access with WNC
The data-modulated symbol sequence of the jth user in the kth pair SU j,k is represented by {d j,k (i); i = 0 ∼ N − 1} for j ∈ {0, 1} and k = 0 K − 1. Subcarriers assigned to the kth pair are kept active, while the rest of the subcarriers are deactivated. Then, the modified data-modulated symbol sequence is given byd j, where v(k, i) = 1, if and only if the ith subcarrier is assigned to the kth pair (otherwise v(k, i) = 0). We avoid direct inter-pair interference by imposing that each white subcarrier can be assigned to the one pair at the time (i.e., K−1 k=0 v(k, i) ≤ 1). Subcarrier assignment based on the SUs priority is done on the MAC layer and is further elaborated in Section 4. The modified data-modulated symbol sequence is then fed to an N-point inverse fast Fourier transform (IFFT) followed by an N g -sample guard interval (GI) insertion. Finally, the corresponding signals are simultaneously transmitted by all K SU pairs over a multipath (i.e., frequency-selective) channel. We note here that at least K white subcarriers has to be detected in order to allow bi-directional communication between all K SU pairs. This condition is satisfied by choosing appropriate simulation parameters as described in Section 5.
The signal received at the ith white subcarrier in the CR-BS at the first stage can be expressed as where P j,k (i) denotes the power emitted by the jth user of the kth SU pair over the ith white subcarrier. The first and the second terms in (1) denote the useful signal component from all pairs with H m j,k (i) being the channel gain between SU j,k and CR-BS in the mth {m = 1, 2} stage and the noise introduced by the PS in the ith subcarrier (which is assumed to be zero-mean Gaussian variable having the variance σ 2 i = χδ 2 σ 2 , with χ being the real positive number). J r (i) is the sum of many random variables; each of which represents an interference term caused by PU transmission over different subcarriers. These interference terms are a function of the channel coefficients which are assumed to be zero-mean Gaussian variables. According to the central limit theorem, the resulting random variable can be approximated as zero-mean Gaussian random variable [13]. The third and the fourth terms in (1) denote the inter-pair interference in the ith subcarrier with ψ j,k (i) being the interference introduced by SU j,k in the ith white subcarrier for v(k, i) = 0 and the noise whose elements are modeled as a zero-mean Gaussian variables with the variance σ 2 . Before transmission, the signal received at CR-BS is multiplied by a normalization factor and broadcasted by the relay asR At the second stage after GI removal and N-point FFT, the signal received at the SU j,k is given by where the first and the second terms, respectively, denote the useful signal component and the noise introduced http://jwcn.eurasipjournals.com/content/2013/1/242 by the PS in the ith subcarrier during the second stage. The third and fourth terms in (2) denote the inter-pair interference during the second stage with θ j,s (i) being the interference introduced by SU j,s at the ith white subcarrier for v(s, i) = 0 and the noise whose elements are modeled as a zero-mean Gaussian variables with the variance σ 2 . SU j,k removes the self interference [14] and then one-tap frequency domain equalization (FDE) is applied to obtain the decision variables asd j, where the bar over the expression signifies the unitary complement operation (i.e., 'NOT' operation) that performs logical negation of the value under the bar.

Performance analysis
Here, we analyze and discuss the design of the bidirectional CR system based on the analytical results. We first discuss, under uniform power allocation, the information rate and interference caused by SUs towards the PS as well as a single-pair closed-form SER and outage probability. The non-uniform power allocation scenario is considered in Section 4.

Information-theoretic performance: information rate
Unlike previous works [5,6], where multiple-pair problem was not considered, here we derive the information rate of the bi-directional CR system with multiple SU pairs using WNC protocol while taking into account the probability of missed detection in spectrum sensing. In what follows, we assume that the channel remains the same throughout both phases (i.e., H j, . The decision variables after equalization can be given aŝ for k = 0 ∼ K − 1, where ϕ j,k (i) and φ j,k (i), respectively, denote the useful signal and the composite noise which is assumed to have Gaussian distribution. The mutual information rate between the sequence of uncoded input symbols {d j,k } and the output sequence {d j,k } at the SU j,k can be represented as where h(d j,k ) and h(φ j,k ), respectively, denote the differential and conditional differential entropy rates of the sequence {d j,k }, with index being left out due to the simplicity. Differential entropy rate of the Gaussian random variable X is given by and e, respectively, denote ensemble average operation and Euler's number [15]. By substituting this into (4), the average mutual information rate is obtained as where C(x) = 1 2 log 2 (1 + x) and γ j,k (i) denotes the signalto-interference plus noise ratio (SINR) calculated using (3) as where σ 2 tot = σ 2 (1 + χδ 2 ) denotes the total noise variance. We note here that the inter-pair interference within the CR system is negligible in comparison with the noise introduced from the PS, and thus, in the derivation of the SINR expression, it has been left out.

Interference analysis
We analyze the interference introduced to the PS caused by bi-directional communication of SUs enabled by WNC in the CR system. Due to the property of WNC protocol, the interference will be introduced during both phases: (a) in multiple-access phase when both SUs of the kth pair transmit over the same white subcarriers and (b) in broadcast phase when the relay transmits over all white subcarriers. We note that in this section, we assume uniform power distribution among the white subcarriers throughout both phases. In addition, due to the imperfect spectrum sensing (i.e., incorrectly detected white subcarriers), SUs may transmit over the subcarriers which are used by PUs causing direct interference to the PS.
During the multiple-access phase, interference caused by the SU's transmission over the nth white subcarrier to the lth occupied subcarrier is defined as where B and b, respectively, denote the total number of PUs and the specific PU (b = 0 B − 1). F j,k,b (l), T s , and d denote the channel gain between the SU j,k and bth PU http://jwcn.eurasipjournals.com/content/2013/1/242 in the lth subcarrier, the symbol duration, and the spectral distance between the nth white subcarrier and the lth occupied subcarrier given by d = |n − l|, in that order. During the broadcast phase, only the relay transmits and consequently the interference caused by the relay's transmission over the nth white subcarrier to lth occupied subcarrier is defined as where G r,b (l) and P r (n), respectively, denote the channel gain between the relay and the bth PU in the lth subcarrier and the power at the relay emitted over the nth white subcarrier. We note here that we have taken into account the direct interference from PUs to the CR system due to missed detection in both multiple-access and broadcast stages. This interference term is analytically encapsulated with the first integral in (7) and (8).
Finally, the total interference caused by the SUs to the occupied subcarriers during the multiple-access and broadcast phases is given by where J m (n, l) denotes the interference caused by the SU's transmission over the nth white subcarrier to the lth occupied subcarrier in the mth stage. It is important to note here that the increased probability of missed detection will have a significant impact on the interference introduced to the PS especially during the broadcast phase, due to the relay's larger covering area. However, using non-uniform power distribution at the relay, this interference can be controlled. This has been pointed out in Section 4.

Closed-form SER
We analyze the SER performance of the bi-directional CR system in which the pair of SU simultaneously access the same white subcarriers. To this end, we derive the closedform SER expressions and discuss the system design with respect to derived expressions. Without loss of generality, we assume one pair of SUs (i.e., K = 1) and a uniform power distribution across all white subcarriers (i.e., P = P r (i) = P j,k (i)). The case with non-uniform power allocation will be investigated in the following section.
The SER for M-PSK modulation is given by [16] where M γ (·) denotes the moment generating function (MGF) and g PSK = sin 2 (π/M). The MGF can be calculated as a Laplace transform of the probability density function (PDF). The SINR expression can be rewritten as where γ 1 = P|H j | 2 /σ 2 tot and γ 2 = P|H¯j| 2 /σ 2 tot with H j being the channel gain between the jth user and the relay. Let V 1 = 1/γ 1 and V 2 = 2/γ 2 ; now, their PDFs are obtained as where α 1(2) = P 1(2) /σ 2 tot with 1(2) being the variance of the channel gains modeled as zero-mean complex Gaussian variables. The PDF of the random variable Z = V 1 +V 2 is given by Using variable substitution γ j,k ≈ Z −1 , the PDF of the γ j,k can be calculated as Now, by substituting (12) into (13), we obtain and the MGF is represented as Laplace transform of Using the expression where a = α 1 , b = α 2 − α 1 + sα 1 α 2 , and c = −sα 1 α 2 . The solution to (16) can be obtained in closed form as [17] which can be further simplified by restricting our observation for the high SINR and then the coefficients can be approximated as b ≈ sα 1 α 2 and c ≈ −sα 1 α 2 , obtaining the tight approximation as Finally, substituting (18) into (10), a closed-form SER is given by We observe that the final closed-form SER expression is a function of probability of missed detection, order of modulation level, and the variances of the channel gains between the SUs and the relay.

Outage probability
An important performance metric which reflects that the CR system will not be able to support a target quality of service (QoS) (i.e., SER) is known as an outage probability. The outage probability P out at any given average received SINR is defined as the probability that the instantaneous SINR γ j,k at SU j,k is lower than the given threshold γ th and is given by P out = P{γ j,k < γ th } = F γ j,k (γ th ), where F γ j,k (γ th ) denotes the cumulative density function (CDF) of the random variable γ j,k . To obtain the CDF, first we obtain the PDFs of the random variables V i whose distribution is given by (12) and then the corresponding MGFs are calculated as (2) dv 1 (2) . (20) Using [17], the solution to a latter integral is given by where K 1 (·) denotes the first order modified Bessel function of the second kind. Due to the fact that V 1 and V 2 are independent random variables, MGF of the variable Z is given by Since γ j,k = Z −1 , the CDF of γ j,k can be expressed as x , and it can be represented as Finally, by solving (23) [17] and substituting the solution into (22), the CDF (i.e., outage probability) of the random variable γ j,k is obtained as We observe that it is a function of the probability of missed detection; as the probability of missed detection increases, so does the outage probability and vice versa. Until now, we assumed uniform power allocation for all users. Below, we present the subcarrier and power allocation for the bi-directional CR system with multiple SU pairs.

Subcarrier and power allocation
Due to the limited available CR resources, the system performance heavily relies on resource allocation, including white subcarriers' assignment among K SU pairs and optimal power allocation at relay. To this end, in this section, we design the subcarrier and power allocation for the proposed method.
We define our problem as maximizing the total throughput of the CR system using WNC protocol given the total available power budget at relay and interference http://jwcn.eurasipjournals.com/content/2013/1/242 limits towards the PS. Thus, the optimization problem can be defined as max P r (0),..., P r (N−1) where J th , P tot , and I(P r (0), . . . , P r (N − 1), respectively, denote the interference threshold, the total available power at the relay, and the total throughput of the CR system given by I (P r (0), . . . , P r (N − 1)) = 1 j=0 where γ j,k (i) = γ j,k (P r (i)) denotes the SINR given by (6). Since the solution for (25) is not possible to obtain in closed form, we resolve to the iterative numerical methods. Before engaging into this iterative algorithms, we have to allocate the white subcarriers to the pairs of SUs. We note here that the optimal solution in (25) is computationally demanding, so we consider a suboptimal solution, where subcarrier and power allocation are done independently as follows.

Subcarrier allocation
Each white subcarrier is allocated to the one SU pair at most so that the direct inter-pair interference caused by simultaneous access of all SU pairs to the same white subcarrier is avoided. We note here that a pair of users transmit/receive over the allocated subcarriers throughout both phases (i.e., multiple-access and broadcast) and that the channel conditions between SUs and the relay are known to a network manager. Here, we consider two subcarrier allocation algorithms.
First, we consider a case when all SU pairs do not have the same priority; higher priority is given to the pairs with the best (i.e., highest) channel conditions. Consequently, it is not guarantied that all pairs will be served, but only the ones with the highest channel gains so that the average sum rate per pair is maximized. We refer to this algorithm as the best subcarrier allocation algorithm (BAA), since each white subcarrier is assigned to a pair having a maximum channel gain.
On the other hand, to deal with the service fairness in the CR system, we consider to allocate subcarriers fairly to all SU pairs. Thus, here, we assume that all SU pairs have the same priority. This is the case when the same QoS is guarantied for all pairs within the CR system. We refer to this algorithm as fair subcarrier allocation algorithm (FAA), and the algorithm flow is illustrated in Algorithm 1. For each white subcarrier, we sort in descending order all K pairs in respect to their channel gains. Then, a white subcarrier is assigned to the highest ranked pair in a sorted list in a way that at any moment the maximum difference between the pair with the most and least number of total allocated subcarriers equals to one. Below, we design an optimum power allocation algorithm based on the presented subcarrier allocation algorithms to maximize the throughput of the CR system for the given CR resources.
The algorithm flow is illustrated in Algorithm 2, where C(P l r (0) , . . . , P l r (i), . . . , P l T with P l r being the relay power vector in the lth iteration given by P l r = P l r (0) , . . . , P l r (i), . . . , P l r (N − 1) , and H l the Hessian matrix in the lth iteration. Algorithm is based on the sequential quadratic programming (SQP) procedure in which the search direction is updated in each iteration by solving the quadratic programming (QP) problem. For the solution of QP problem, we have used Broyden-Fletcher-Goldfarb-Shanno (BFGS) approximation of the Hessian matrix, while step size is updated using the backtracking line search [18]. With different subcarrier allocation algorithms, we evaluate the impact of the chosen priority policy on the total throughput of the CR system in the presence of power and interference constrains. http://jwcn.eurasipjournals.com/content/2013/1/242

Initialization
Step 1: P 0 r (i) = P R /W , ∀i ε = 0.0001, H 0 = I Main loop Step 2: Calculating search direction d l Step 3: Calculate Lagrangian multiplier η l , ϑ l Solve ∂L/∂P l r = 0 ⇒ η l , ϑ l Step 4: Calculate step size α l Use Backtracking line search [18] to decrease a merit function (P l r ) = L P l r , η l , ϑ l + η l ϑ l max 0, C(P l r ) Step 5: Update P l r P l+1 Step 6: Update Hessian matrix H l+1 using BFGS (q l ) T s l go to Step 2

Numerical simulation and discussion
Using previously derived expressions, we evaluate the performance of bi-directional CR system with multiple SU pairs using WNC protocol through numerical simulation. We analyze the spectrum consisting of N = 256 subcarriers which is 80% used by the PUs. This means that in average there will be around 50 white subcarriers available for bi-directional communication in CR system. Since we consider up to K = 16 SU pairs in the CR system, there will be enough resources to allow all SU pairs to communicate. User's powers are set to 10 dBm and additive white Gaussian noise (AWGN) variance to σ 2 = 10 −5 , while the variance of the noise due to missed detection σ 2 i is determined with parameter χ (i.e., σ 2 i = χδ 2 σ 2 ). As for the channel, we assume L = 16-path Rayleigh block fading channels with normalized variances for each time phase 1 = 2 = 1 and QPSK data modulation. We note here that we have used BAA for evaluating the information rate and the total interference towards the PS.
First, we evaluate the information rate of bi-directional CR system with multiple SU pairs. The information rate as a function of the relay power and probability of missed detection and a number of SU pairs as a parameter is shown in Figure 2. We observe from the figure that for the given probability of missed detection, the information rate of the CR system may be increased as the number of SU pairs increases. In particular, for the missed detection probability of 10%, the information rate increases 0.65 bps/Hz for the relay power of 20 dBm which corresponds to increasing the SU pairs from 2 to 4. This is because the multiple-user diversity is exploited through subcarrier allocation leading to a higher information rate which is further enhanced through the increase of the total power at the relay.
Next, we evaluate the interference introduced to the PS by SUs with WNC protocol. Figure 3 shows the interference normalized per subcarrier as a function of relay power, and probability of missed detection as a parameter, where we can observe that for the relay power above 15 dBm, interference intensively increases due to the high interference introduced during the broadcast phase. Thus, the interference introduced towards the PS largely depends on the power emitted by the relay, and by proper power distribution at relay it can be controlled. Figure 4 shows the SER performance as a function of the total average power with probability of missed detection and χ as a parameter. We observe that the probability of missed detection has the highest impact for achieving the target SER given the average power of the CR system. Because of this, it is very important to carefully design the spectrum sensing process to minimize the probability of missed detection (by choosing more accurate sensing equipment and algorithms) as it is the key design parameter to control the QoS in the CR system.  Figure 5 shows the outage probability of CR system for the required γ th = 3, as a function of the total average power with probability of missed detection and χ as a parameter. We observe that the outage probability is upper bounded in the case of an ideal spectrum sensing (i.e., δ = 0), and it is even more sensitive on imperfect spectrum sensing. Consequently, the CR system may not be able to support the target QoS (i.e., SER) if the parameters related to the spectrum sensing accuracy are not properly designed. Finally, we consider non-uniform power distribution at the relay for different subcarrier allocation algorithms to keep the interference towards the PS below the defined threshold while maximizing the total throughput of the CR system. Figure 6 shows the CR system's information rate as a function of the total average relay power, where we observe inferior performance in the case of uniform priority assignment among SU pairs. This is because BAA provides a better initial conditions for power allocation procedure leading to a superior performance. Moreover, due to the intensified interference introduced to the PS during the second (i.e., broadcast) stage, increasing the power at the relay above 20 dBm does not cause corresponding improvement in information rate irrespective of the priority assignment.

Conclusion
In this paper, we designed and analyzed the bi-directional CR system with multiple SU pairs using WNC protocol while assuming imperfect spectrum sensing and interference from/to the CR system. We have shown that for achieving the target QoS, one must carefully design the spectrum sensing process to minimize the probability of missed detection. Moreover, we designed resource allocation framework for multiple pair CR system to optimize the WNC protocol and efficiently utilize the CR resources. We observed improvements of spectrum efficiency for large-scale CR system with priority assignments among different pairs.