1 Introduction

Cognitive radio networks (CRN) have attracted great attention as a solution to the problem of spectrum scarcity. A cognitive radio is a transceiver which automatically detects available channels in a wireless spectrum and accordingly changes its transmission or reception parameters so more wireless operators may run concurrently in a given spectrum band at a given place. This process is also known as dynamic spectrum management [1]. Two main approaches have been developed for cognitive radio so far regarding the method in which a secondary user accesses the licensed spectrum. With opportunistic spectrum access techniques, CRN can be granted access of spectrum secondarily, i.e., as long as it can guarantee no interference to any primary user (PU) who is using this spectrum at this time in this location. This means that cognitive radios have to periodically sense the spectrum to detect the primary user’s activity. They have to vacate the channel immediately whenever PU activity is detected [2] through spectrum sharing (SS) based on which the secondary users coexist with the primary users under the condition of protecting the latter from harmful interference [2, 3]. Recent development in this front is a hybrid technique which improves the throughput of the abovementioned methods. The sensing-throughput trade off problem becomes very significant when the hybrid approach is used to improve the throughput of spectrum sharing cognitive radio networks since the primary signals under detection are very weak and may therefore lead high sensing times that would have a detrimental effect on their achievable throughput.

In this paper, we focus on throughput maximization of spectrum sharing cognitive radio networks. So, we incorporate a set of cooperative relay networks in between the secondary user transmitter and receiver to improve the system throughput. To increase the robustness against multipath fading, parallel relay transmission has been used. In this topology, signals propagate through multiple relay paths in the same hop, and destination combines the signals received with the help of various combining schemes. It provides power gain and diversity gain simultaneously. The best available relay channel is chosen depending on the position of the primary user for data transmission by the receiver and a feedback is sent to the transmitter.

This is analyzed in more detail in Section 2. In addition, we study the problem of maximizing ergodic throughput and outage capacity of the proposed cognitive system under average transmit and interference power constraints in Sections 3 and 4. Section 5 provides the numerical results and their discussions. Finally, Section 6 presents the conclusions.

2 Proposed cooperative spectrum sharing scheme

In this section, we first describe the system model used in this paper and then propose a cooperative spectrum sharing in the single secondary user network.

2.1 A. System model

We consider the system model as depicted in Fig. 1, where the cognitive user (Su_Tx) is detecting the primary user (Pu_Tx) via the best cooperative relay, r B, which is selected among a set of all candidates denoted by {R1, R2, …,Rn}. The channels are assumed to be ergodic, stationary, and known at the secondary users with probability density function (PDF) f s1(s1), f s2(s2), and so on, respectively, whereas the noise is assumed to be circularly symmetric complex Gaussian with mean zero and variance σ 2 n , namely CN(0, σ 2 n ). Our results serve as upper bounds for the achievable rate of practical cognitive radio systems as in [2] and [4]. In the beginning, an initial spectrum sensing is performed to determine the status of the frequency band. Based on spectrum sensing decision, the secondary user transmits information using a higher transmit power, P 0, if the primary user is detected to be inactive and the secondary user transmits using a lower transmit power, P 1, otherwise. The candidate relay transmits with the same power as the secondary user. The transmit power of the primary user is P s.

Fig. 1
figure 1

System model

2.2 B. Data formulation of the received signal

Without any loss of generality, let s be the primary user indicator, namely s = 1 implies the presence of the primary user and s = 0 implies its absence. The secondary user detector decides

$$ \begin{array}{l}{\mathrm{H}}_1:s=1\hfill \\ {}{\mathrm{H}}_2:s=0\hfill \end{array} $$
(1)

as the two hypotheses.

The secondary user communicates with the receiver in two sub-slots. In sub-slot one, the primary user transmits to the primary user’s receiver, and the secondary user transmits to the best relay r B. The received signal at the best relay is given by

$$ {y}_{\mathrm{b}}=\mathrm{s}\sqrt{P_{\mathrm{s}}}\ {h}_{\mathrm{PB}}{X}_{\mathrm{p}}+X+{n}_{\mathrm{b}}, $$
(2)

where the first term corresponds to the signal received from the primary user, X p represents the transmitted vector from the primary user, and X denotes the received signal from the secondary user. Finally, n b denotes the additive noise. In the absence of the primary user, the secondary user’s signal is given by

$$ X=\sqrt{P_o}{h}_{\mathrm{s}\mathrm{b}}{X}_{\mathrm{s}}, $$
(3)

where h sb is the instantaneous channel power gain and X s is the transmitted vector from the secondary user. In the presence of the primary user, the secondary user signal is given by

$$ X=\sqrt{P_1}{h}_{\mathrm{s}\mathrm{b}}{X}_{\mathrm{s}}. $$
(4)

During the second sub-slot, primary user uses the same power as the first sub-slot. The retransmitted signal [5] of r B is given by

$$ Y={h}_{b,D} PX+s{\displaystyle \sum_i{\beta}_i{h}_{P,i}\sqrt{P_s}}{h}_{P,B}{X}_P\kern0.5em {h}_{\mathrm{P},\mathrm{B}}{X}_{\mathrm{p}}+{\displaystyle \sum_{i\ne b}{\omega}_iX,} $$
(5)

where the second and third terms refer to the interference signal from other relays, and ω i and β i are scaling factors to normalize the power of the received signal.

3 Transmission rate of the proposed system

In the proposed cognitive radio system, the secondary users adapt their transmit power at the end of each frame based on the decision of spectrum sensing and transmit using higher power, P 0, when the frequency band is detected to be idle, and lower power, P 1, when it is detected to be active. The instantaneous transmission rates can be obtained by Shannon’s capacity equation given below [6]

$$ C=B{ \log}_2\left(1+\mathrm{SNR}\right), $$

where C is the capacity, B is the bandwidth, and SNR is the signal-to-noise ratio of the link. The term log2 (1 + SNR) is the data transmission rate. Hence, the transmission rate for the given system model when the frequency band is idle can be given as

$$ \begin{array}{l}{R}_{01}={ \log}_2\left(1+\frac{P_0{h}_{s,1}}{\sigma_n^2}\right),\hfill \\ {}{R}_{02}={ \log}_2\left(1+\frac{P_0{h}_{s,2}}{\sigma_n^2}\right),\hfill \end{array} $$

and so on for the nth relay is given by

$$ {R}_{0n}={ \log}_2\left(1+\frac{P_0{h}_{s,n}}{\sigma_n^2}\right). $$
(6)

Here, R 01 is the transmission rate of the first relay, R02 is the transmission rate of the second relay, and so on, when the primary user is idle. Further, P 0 is the power of the secondary user when the primary user is idle and σ 2 n is the received noise power. When the frequency band is active, the transmission rate at different relays are given as

$$ {R}_{11}={ \log}_2\left(1+\frac{P_1{h}_{s,1}}{\sigma_n^2+{\sigma}_p^2}\right),{R}_{12}={ \log}_2\left(1+\frac{P_1{h}_{s,2}}{\sigma_n^2+{\sigma}_p^2}\right), $$

and so on for the nth relay

$$ {R}_{1n}={ \log}_2\left(1+\frac{P_1{h}_{s,n}}{\sigma_n^2+{\sigma}_p^2}\right). $$
(7)

Here, R 11 is the transmission rate of the first relay, R 12 is the transmission rate of the second relay, and so on, when primary user is active. Further, P 1 is the power adapted by the secondary user when primary user is active and σ 2 p is the received power from the primary user.

3.1 A. Best relay selection for transmission

Noting that the channel state information (CSI) of the channel from each candidate, R i , to the primary user is denoted as h pi (k), the candidate relay (r B) with the best SNR is selected as the best relay

$$ \begin{array}{l}{r}_{\mathrm{B}}= \arg \max {\left|{h}_{\mathrm{pi}}(k)\right|}^2\gamma, \kern0.5em \mathrm{where}\ \gamma =\frac{P}{\sigma_n^2}\mathrm{a}\mathrm{nd}\ \gamma \kern0.5em \mathrm{is}\ \mathrm{a}\ \mathrm{constant}.\hfill \\ {}\kern0.5em i=1,2,\dots n\hfill \end{array} $$
(8)

Hence, (8) reduces to

$$ \begin{array}{l}{r}_{\mathrm{B}}= \arg \max {\left|{h}_{\mathrm{pi}}(k)\right|}^2.\hfill \\ {}\mathrm{i}=1,2,\dots n\hfill \end{array} $$
(9)

The whole implementation can be divided into two sub-slots: In the first sub-slot, (2k − 1), the best relay r B receives signal from both primary user and the cognitive user, and in the second sub-slot 2k, r B relays its received signal to the secondary user detector.

However, considering the fact that perfect spectrum sensing may not be achievable in practice, it is important to consider a more realistic scenario of imperfect spectrum sensing where the actual status of the primary users may be falsely detected. Therefore, four different cases of instantaneous transmission rates from the secondary user to the best relay can be considered based on the actual status of the primary user (active/idle) as follows [7]:

$$ {R}_{00B}={ \log}_2\left(1+\frac{P_0{h}_{s,B}}{\sigma_n^2}\right),{R}_{01B}={ \log}_2\left(1+\frac{P_1{h}_{s,B}}{\sigma_n^2}\right),{R_1}_{0B}={ \log}_2\left(1+\frac{P_0{h}_{s,B}}{\sigma_n^2+{\sigma}_p^2}\right),{R_{11}}_B={ \log}_2\left(1+\frac{P_1{h}_{s,B}}{\sigma_n^2+{\sigma}_p^2}\right). $$
(10)

Now, the transmission rate from the best selected relay to the secondary user receiver in the absence of the primary user can be written as

$$ {R}_{Bd0}={ \log}_2\left(1+\frac{P_0{h}_{B,d}}{\sigma_n^2}\right), $$
(11)

and in presence of the primary user, (11) can be written as

$$ {R}_{Bd1}={ \log}_2\left(1+\frac{P_1{h}_{B,d}}{\sigma_n^2+{\sigma}_p^2}\right). $$
(12)

Hence, the transmission rate of the entire system can be written as

$$ R=\frac{\left({R}_{s,B}\kern0.1em {R}_{B,d}\right)}{\left({R}_{s,B}+{R}_{B,d}\right)}. $$
(13)

The equivalent SNR of the system in absence of primary user can be calculated as

$$ {\mathrm{SNR}}_{\mathrm{eq}0}=\frac{\frac{P_0{h}_{s,B}}{\sigma_{n^2}}\frac{P_0{h}_{B,d}}{\sigma_{n^2}}}{\frac{P_0{h}_{s,B}}{\sigma_{n^2}}+\frac{P_0{h}_{B,d}}{\sigma_{n^2}}+C}. $$
(14)

For high SNR, C = 0. Hence, (14) reduces to

$$ {\mathrm{SNR}}_{\mathrm{eq}0}=\frac{\frac{P_0{h}_{s,B}}{\sigma_{n^2}}\frac{P_0{h}_{B,d}}{\sigma_{n^2}}}{\frac{P_0{h}_{s,B}}{\sigma_{n^2}}+\frac{P_0{h}_{B,d}}{\sigma_{n^2}}}. $$
(15)

The equivalent SNR of the system in presence of primary user can be calculated as

$$ {\mathrm{SNR}}_{\mathrm{eq}1}=\frac{\frac{P_1{h}_{s,B}}{\sigma_{n^2}+{\sigma}_{P^2}}\frac{P_1{h}_{B,d}}{\sigma_{n^2}+{\sigma}_{P^2}}}{\frac{P_1{h}_{s,B}}{\sigma_{n^2}+{\sigma}_{P^2}}+\frac{P_1{h}_{B,d}}{\sigma_{n^2}+{\sigma}_{P^2}}+C}. $$
(16)

For low SNR, C = 1. Hence (16) reduces to

$$ {\mathrm{SNR}}_{\mathrm{eq}1}=\frac{\frac{P_1{h}_{s,B}}{\sigma_{n^2}+{\sigma}_{P^2}},\frac{P_1{h}_{B,d}}{\sigma_{n^2}+{\sigma}_{P^2}}}{\frac{P_1{h}_{s,B}}{\sigma_{n^2}+{\sigma}_{P^2}}+\frac{P_1{h}_{B,d}}{\sigma_{n^2}+{\sigma}_{P^2}}+1}. $$
(17)

3.2 B. Ergodic capacity of the proposed scheme

We first obtain the optimal power allocation for the proposed system subject to long-term power constraints (Fig. 2). Let \( \gamma =\frac{P\left|{h}^2\right|}{\sigma_n^2} \) denote the instantaneous received SNR without power adaptation, where h is the scalar fading coefficient, and let f (γ) denote the PDF of γ. Let P (γ) denote the power policy of the input signal and is a function of the transmitted SNR, the decision whether the primary user is present (P 1) or absent (P 0), probability of detection (P d), and probability of false alarm (P fa). Then, the received SNR with power adaptation is \( \frac{P\left(\gamma \right)}{\overline{P}} \), and the ergodic capacity is [8]

$$ C={E}_{\gamma}\left[1+{ \log}_2\left(1+\frac{P\left(\gamma \right)}{\overline{P}}\right)\right]. $$
(18)
Fig. 2
figure 2

Flowchart for optimal power allocation

In order to keep the long-term power budget and effectively protect the primary users from harmful interference, the average (over all fading states) transmit and interference power constraint that can be formulated is considered. It should be taken into account that the transmitted power from the secondary user can take a higher value if the primary user is detected to be idle, i.e., not present and the transmitted power should take lower values if the primary user is detected to be active, i.e. present. The interference power that can be tolerated by the primary user depends on the instantaneous power gain of the primary user and the signal power from the secondary user. Hence, the corresponding power policy can be written as follows:

$$ E\left\{P\left({\mathrm{H}}_0\right)\ \left(\ 1-{P}_{\mathrm{fa}}\right){\mathrm{SNR}}_{\mathrm{eq}0}+P\left({H}_0\right){P}_{\mathrm{fa}}{\mathrm{SNR}}_{\mathrm{eq}1}+P\left({H}_1\right)\ \left(\ 1-{P}_d\right){\mathrm{SNR}}_{\mathrm{eq}0}\left.+P\left({H}_1\right){P}_{\mathrm{d}}{\mathrm{SNR}}_{\mathrm{eq}1}\right\}\le {P}_{\mathrm{av},}\right. $$
(19)
$$ E\left\{P\left({\mathrm{H}}_1\right)\left(1-{P}_{\mathrm{d}}\right){h}_{\mathrm{s},\mathrm{D}}\ {\mathrm{SNR}}_{\mathrm{eq}0}+P\left({\mathrm{H}}_1\right){P}_{\mathrm{d}}{h}_{\mathrm{s},\mathrm{D}\ }{\mathrm{SNR}}_{\mathrm{eq}1}\right\}\le {\varGamma}_1, $$
(20)
$$ E\left\{P\left({\mathrm{H}}_1\right)\left(1-{P}_{\mathrm{d}}\right){h}_{\mathrm{B},\mathrm{D}\ }{\mathrm{SNR}}_{\mathrm{eq}0}+P\left({\mathrm{H}}_1\right){P}_{\mathrm{d}}{h}_{\mathrm{B},\mathrm{D}\ }{\mathrm{SNR}}_{\mathrm{eq}1}\right\}\le {\varGamma}_2, $$
(21)

where P(H0) = probability that the frequency band is idle,

P(H1) = probability that the frequency band is active,

P d = detection probability,

P fa = false alarm probability,

P av = maximum average transmit power of the secondary users,

Γ 1 = maximum average interference power caused by the secondary user transmitter, and

Γ 2 = maximum average interference power caused by the candidate relay.

Finally, the optimization problem that maximizes the Ergodic throughput [9] of the proposed spectrum sharing cognitive radio system under joint average transmit and interference power constraints can be formulated as follows:

$$ \begin{array}{l}\mathrm{maximize}\kern0.5em C=E\left\{P\left({\ \mathrm{H}}_1\right)\ {P}_{\mathrm{d}}{R}_{11\mathrm{B}}+P\left({\ \mathrm{H}}_0\right)\ {P}_{\mathrm{fa}}{R}_{01\mathrm{B}}+P\left({\ \mathrm{H}}_1\right)\left(\ 1-{P}_{\mathrm{d}}\right)\ {R}_{10\mathrm{B}}\right.\hfill \\ {}\left\{{{}^{\mathrm{SNR}}}_{\mathrm{eq}0}{{}^{,\mathrm{SNR}}}_{\mathrm{eq}1}\right\}\kern9.6em \left.+P\left({\ \mathrm{H}}_0\right)\ \left(\ 1-{P}_{\mathrm{fa}}\right)\ {R}_{00\mathrm{B}}+{R}_{\mathrm{Bd}}\right\},\hfill \end{array} $$
(22)

where SNReq0 ≥ 0, SNReq1 ≥ 0.

Here, the optimization problem for capacity can be solved using the Lagrangian cost function where the average transmitter power and the interference power can be used as two constraints. The Lagrangian cost function from the secondary user to the candidate relay with respect to the transmitted SNRs SNReq0 and SNReq1 is given by [10] \( \begin{array}{l}L\left({\mathrm{SNR}}_{\mathrm{eq}0},{\mathrm{SNR}}_{\mathrm{eq}1},\lambda, \mu \right)=E\ \left[P\left({\mathrm{H}}_1\right){P}_{\mathrm{d}}\ {R}_{11\mathrm{B}}+P\left({\mathrm{H}}_0\right)\ {P}_{\mathrm{fa}\ }{R}_{01\mathrm{B}}+P\right({\mathrm{H}}_1\left)\ \right(1-{P}_{\mathrm{d}}\left){R}_{10\mathrm{B}}+P\right({\mathrm{H}}_0\left)\right(1-\\ {}{P}_{\mathrm{fa}}\left){R}_{00\mathrm{B}}\right]-\lambda E\left[P\left({\mathrm{H}}_0\right)\left(1-{P}_{\mathrm{fa}}\right){\mathrm{SNR}}_{\mathrm{eq}0}+P\right({\mathrm{H}}_0\left)\ {P}_{\mathrm{fa}}\ {\mathrm{SNR}}_{\mathrm{eq}1}+P\right({\mathrm{H}}_1\left)\right(1-{P}_{\mathrm{d}}\left){\mathrm{SNR}}_{\mathrm{eq}0}+P\right({\mathrm{H}}_1\Big)\ {P}_{\mathrm{d}}\\ {}{\mathrm{SNR}}_{\mathrm{eq}1}\Big]+\lambda {P}_{\mathrm{av}}-\mu E\left[P\left({\mathrm{H}}_1\right)\ \left(1-{P}_{\mathrm{d}}\right)\ {h}_{\mathrm{s},\mathrm{D}}{\mathrm{SNR}}_{\mathrm{eq}0}+P\left({\mathrm{H}}_1\right)\ {P}_{\mathrm{d}}\ {h}_{\mathrm{s},\mathrm{D}}\ {\mathrm{SNR}}_{\mathrm{eq}1}\right]+\mu {\varGamma}_1,\end{array} \)

where the dual function can be obtained as

$$ \begin{array}{c}\hfill d\left(\lambda, \mu \right)= \sup L\left({\mathrm{SNR}}_{\mathrm{eq}0},{\mathrm{SNR}}_{\mathrm{eq}1},\lambda, \mu \right).\hfill \\ {}\hfill 0<{\mathrm{SNR}}_{e\mathrm{q}1}<{\mathrm{SNR}}_{e\mathrm{q}0}<{P}_{\mathrm{av}}\hfill \end{array} $$
(24)

After forming their Lagrangian functions and applying the Karush Kuhn Tucker conditions, the optimal SNRs SNReqo and SNReq1 for a given λ, μ are given by [6, 11]

$$ {\mathrm{SNR}}_{\mathrm{eq}0}=\frac{\frac{ \max \left(0,\left[\frac{A_o+{\varDelta}_o^{0.5}}{2}\right]\right){h}_{s,B}}{\sigma_{n^2}}\frac{ \max \left(0,\left[\frac{A_o+{\varDelta}_o^{0.5}}{2}\right]\right){h}_{B,d}}{\sigma_{n^2}}}{\frac{ \max \left(0,\left[\frac{A_o+{\varDelta}_o^{0.5}}{2}\right]\right){h}_{s,B}}{\sigma_{n^2}}+\frac{ \max \left(0,\left[\frac{A_o+{\varDelta}_o^{0.5}}{2}\right]\right){h}_{B,d}}{\sigma_{n^2}}} $$

and

$$ {\mathrm{SNR}}_{\mathrm{eq}1}=\frac{\frac{ \max \left(0,\left[\frac{A_1+{\varDelta}_1^{0.5}}{2}\right]\right){h}_{s,B}}{\sigma_{n^2}+{\sigma}_{P^2}},\frac{ \max \left(0,\left[\frac{A_1+{\varDelta}_1^{0.5}}{2}\right]\right){h}_{B,d}}{\sigma_{n^2}+{\sigma}_{P^2}}}{\frac{ \max \left(0,\left[\frac{A_1+{\varDelta}_1^{0.5}}{2}\right]\right){h}_{s,B}}{\sigma_{n^2}+{\sigma}_{P^2}}+\frac{ \max \left(0,\left[\frac{A_1+{\varDelta}_1^{0.5}}{2}\right]\right){h}_{B,d}}{\sigma_{n^2}+{\sigma}_{P^2}}+1}, $$
(25)

where

$$ {A}_0=\frac{{ \log}_2(e)\left({\alpha}_o+{\beta}_o\right)}{\lambda \left({\alpha}_o+{\beta}_o\right)+\mu {\beta}_o{h}_{s,D}}-\frac{\left(2{\sigma}_n^2+{\sigma}_p^2\right)}{h_{s,B}}, $$
(26)
$$ {A}_1=\frac{{ \log}_2(e)\left({\alpha}_1+{\beta}_1\right)}{\lambda \left({\alpha}_1+{\beta}_1\right)+\mu {\beta}_1{h}_{s,D}}-\frac{\left(2{\sigma}_n^2+{\sigma}_p^2\right)}{h_{s,B}}, $$
(27)
$$ {\varDelta}_0={A}_0^2-\frac{4}{h_{s,B}}\left[\frac{\sigma_n^2+{\sigma}_p^2}{h_{s,B}{\sigma}_n^{-2}}-\frac{{ \log}_2(e){\alpha}_o\left({\sigma}_n^2+{\sigma}_p^2\right)+{\beta}_o{\sigma}_n^2}{\lambda \left({\alpha}_o+{\beta}_o\right)+\mu {\beta}_o{h}_{s,D}}\right], $$
(28)

and

$$ {\varDelta}_1={A}_1^2-\frac{4}{h_{s,B}}\left[\frac{\sigma_n^2+{\sigma}_p^2}{h_{s,B}{\sigma}_n^{-2}}-\frac{{ \log}_2(e){\alpha}_1\left({\sigma}_n^2+{\sigma}_p^2\right)+{\beta}_1{\sigma}_n^2}{\lambda \left({\alpha}_1+{\beta}_1\right)+\mu {\beta}_1{h}_{s,D}}\right]\kern0.5em . $$
(29)

Here,

$$ \begin{array}{ll}{\alpha}_0=P\left({\mathrm{H}}_0\right)\left(1-{P}_{\mathrm{fa}}\right),\hfill & {\alpha}_1=P\left({\mathrm{H}}_0\right){P}_{\mathrm{fa},}\hfill \\ {}{\beta}_0=P\left({\mathrm{H}}_1\right)\left(1-{P}_{\mathrm{d}}\right),\hfill & {\beta}_1=P\left({\mathrm{H}}_1\right){P}_{\mathrm{d}.}\hfill \end{array} $$

An approximate expression for the probability of detection over AWGN channels was presented in [12]. Here, exact closed-form expressions for both detection probability and the probability of a false alarm are defined as P d = P(y > λ|H1) and P fa = P(y > λ|H 0), respectively, where λ is the decision threshold. Based on the statistics of y, Pfa can be evaluated as

$$ {P}_{\mathrm{fa}}=\varGamma \left(N/2,\lambda /2{\sigma}^2\right), $$
(30)

where Γ is the incomplete gamma function [13]. From the CDF of y, P d can be evaluated as

$$ {P}_{\mathrm{d}}={Q}_N\left(\sqrt{\frac{\alpha {\gamma}_t}{\sigma^2}},\sqrt{\frac{\lambda }{\sigma^2}}\right). $$
(31)

The average interference power from the candidate relay to the secondary user receiver can be written as follows:

$$ {\varGamma}_2=E\left[P\left({\mathrm{H}}_1\right)\left(1-{P}_{\mathrm{d}}\right){h}_{\mathrm{B},\mathrm{D}}{\mathrm{SNR}}_{\mathrm{eq}0}+P\left({\mathrm{H}}_1\right){P}_{\mathrm{d}}{h}_{\mathrm{B},\mathrm{D}}{\mathrm{SNR}}_{\mathrm{eq}1}\right]={\displaystyle \underset{\frac{h_{B,D}}{h_{B,d}}\le \frac{\gamma_0}{\sigma^2}}{\iint }P\left({H}_1\right)}\left(1-{P}_{\mathrm{d}}\right)\alpha \frac{h_{B,D}}{h_{B,d}}f\left({D}_S\right)g\left({D}_P\right)\mathrm{d}{D}_S\mathrm{d}{D}_P+{\displaystyle \underset{\frac{h_{B,D}}{h_{B,d}}\le \frac{\gamma_1}{\sigma^2}}{\iint }P\Big({H}_1}\left){P}_{\mathrm{d}}\alpha \frac{h_{B,D}}{h_{B,d}}f\right({D}_S\left)g\right({D}_P\Big)\mathrm{d}{D}_S\mathrm{d}{D}_P. $$
(32)

For Rayleigh fading coefficients h B,D and h B,d , it can be easily shown that the random variable \( u=\frac{h_{B,D}}{h_{B,d}} \) follows a log-logistic distribution given by f u (u) = 1/(1 + u)2 [14]. Thus, (32) can be written as

$$ {\varGamma}_2={\displaystyle \underset{0}{\overset{\frac{\gamma_o}{\sigma^2}}{\int }}P\left({\mathrm{H}}_1\right)\left(1-{P}_{\mathrm{d}}\right)\alpha \frac{u}{{\left(u+1\right)}^2}\mathrm{d}u}+{\displaystyle \underset{0}{\overset{\frac{\gamma_1}{\sigma^2}}{\int }}P\left({\mathrm{H}}_1\right){P}_{\mathrm{d}}\alpha \frac{u}{{\left(u+1\right)}^2}\mathrm{d}u}. $$
(33)

By change of variables t = 1 + u, dt = du, (33) can be written as

$$ {\varGamma}_2={\displaystyle \underset{0}{\overset{\frac{\gamma_0}{\sigma^2}}{\int }}P\left({\mathrm{H}}_1\right)\left(1-{P}_{\mathrm{d}}\right)\alpha \frac{1}{t}\mathrm{d}t}-{\displaystyle \underset{0}{\overset{\frac{\gamma_0}{\sigma^2}}{\int }}P\left({\mathrm{H}}_1\right)\left(1-{P}_{\mathrm{d}}\right)\alpha \frac{1}{t^2}\mathrm{d}t}+{\displaystyle \underset{0}{\overset{\frac{\gamma_1}{\sigma^2}}{\int }}P\left({\mathrm{H}}_1\right){P}_{\mathrm{d}}\alpha \frac{1}{t}\mathrm{d}t}-{\displaystyle \underset{0}{\overset{\frac{\gamma_1}{\sigma^2}}{\int }}P\left({\mathrm{H}}_1\right){P}_{\mathrm{d}}\alpha \frac{1}{t^2}\mathrm{d}t}{\varGamma}_2=P\left({\mathrm{H}}_1\right)\alpha \left\{\left(1-{P}_{\mathrm{d}}\right)\left[ \log \left(1+\frac{\gamma_0}{\sigma^2}\right)-\frac{\gamma_0}{\gamma_0+{\sigma}^2}\right]+{P}_{\mathrm{d}}\left[ \log \left(1+\frac{\gamma_1}{\sigma^2}\right)-\frac{\gamma_1}{\gamma_1+{\sigma}^2}\right]\right\}, $$
(34)

where γ 0 and γ 1 are the cut-off threshold for the secondary user receiver. Further,

$$ \begin{array}{c}\hfill {\varGamma}_2=P\left({\mathrm{H}}_1\right)\alpha \left\{\left(1-{P}_{\mathrm{d}}\right)\left[ \log \left(1+\frac{\gamma_0}{\sigma^2}\right)-\frac{\gamma_0}{\gamma_0+{\sigma}^2}\right]+{P}_{\mathrm{d}}\left[ \log \left(1+\frac{\gamma_1}{\sigma^2}\right)-\frac{\gamma_1}{\gamma_1+{\sigma}^2}\right]\right\},\hfill \\ {}\hfill {R}_{Bd}={ \log}_2\left(1+\frac{P_{\mathrm{av}}}{\varGamma_2}\right).\hfill \end{array} $$
(35)

3.3 C. Optimal power allocation

In order to determine the optimal power allocation strategy, the optimal values of Lagrangian multipliers, λ and μ, that minimize the dual function d (λ, μ) need to be found. The ellipsoid method [13] is used here to find the optimal solution which requires the sub-gradient of the dual function d (λ, μ). The latter is given by the following algorithm: Finally, the case is considered when the power from the primary users is not known at the secondary transmitter. In this case, by considering single noise power, σ 2, at all times, the optimization problem can be formulated as follows:

$$ \underset{\left\{{\mathrm{SNR}}_{\mathrm{eq}0},{\mathrm{SNR}}_{\mathrm{eq}1}\right\}}{ \max \kern0.5em C}=E\left\{\left({\alpha}_{\mathrm{o}}+{\beta}_{\mathrm{o}}\right){ \log}_2\left(1+\frac{h_{s,D}}{\sigma^2}{\mathrm{SNR}}_{\mathrm{eq}0}\right)+\left({\alpha}_1+{\beta}_1\right){ \log}_2\left(1+\frac{h_{s,D}}{\sigma^2}{\mathrm{SNR}}_{\mathrm{eq}1}\right)+{ \log}_2\left(1+\frac{P_{\mathrm{av}}}{\varGamma_2}\right)\right\} $$
(36)

4 Outage capacity of the proposed scheme

The Ergodic capacity studied in the previous section is an effective metric for fast fading channels or delay-insensitive applications [15], where a block of information can experience different fading states of the channel during transmission, whereas for slow fading channels or delay-sensitive applications, such as voice and video transmission, the outage capacity [16, 17] comprises a more appropriate metric for the capacity of the system due to the fact that only a cross-section of the channel characteristics is experienced during the transmission period of a block of information. The outage capacity, C out, is defined as the highest transmission rate that can be achieved by a communication system while keeping the probability of outage under a maximum value.

In this section, we study outage capacity of the proposed spectrum sharing a cognitive radio system and derive a power allocation strategy for a combination of different constraints on the outage capacity that include average transmit power constraints and average interference power constraints. More specifically, we will consider, as in [18], the truncated channel inversion with fixed rate (TIFR) technique, where the secondary transmitter uses the CSI to invert the channel fading, in order to achieve a constant SNR at the secondary receiver during the periods when the channels fade above a certain “cut-off” value [19]. This adaptive transmission scheme offers the advantage of non-zero achievable rates for a target outage probability \( {P}_{\mathrm{out}}={\overline{P}}_{\mathrm{out}} \), even when the fading is extremely severe such as in Rayleigh fading cases where a constant transmission rate cannot be achieved under all fading states of the channel.

As mentioned in the beginning of this section, in the TIFR technique, the secondary transmitter inverts the channel fading in order to achieve a constant rate at the secondary receiver when the channel fading is higher than a “cut-off” threshold. We define here this cut-off threshold by θ 0 when the primary users are detected to be idle and by θ 1 when the primary users are detected to be active. The respective transmit powers of the secondary user are given by

$$ {\mathrm{SNR}}_{\mathrm{eq}0}\left({h}_{B,d},{h}_{B,D}\right)=\left\{\begin{array}{c}\hfill \begin{array}{cc}\hfill \frac{\alpha }{h_{B,d}},\hfill & \hfill \frac{h_{B,D}}{h_{B,d}}\le \frac{\theta_0}{\sigma^2}\hfill \end{array}\hfill \\ {}\hfill \begin{array}{cc}\hfill 0,\kern1em \hfill & \hfill \frac{h_{B,D}}{h_{B,d}}>\frac{\theta_0}{\sigma^2}\hfill \end{array}\hfill \end{array}\right.,{\mathrm{SNR}}_{\mathrm{eq}1}\left({h}_{B,d},{h}_{B,D}\right)=\left\{\begin{array}{c}\hfill \begin{array}{cc}\hfill \frac{\alpha }{h_{B,d}},\hfill & \hfill \frac{h_{B,D}}{h_{B,d}}\le \frac{\theta_1}{\sigma^2}\hfill \end{array}\hfill \\ {}\hfill \begin{array}{cc}\hfill 0,\kern1em \hfill & \hfill \frac{h_{B,D}}{h_{B,d}}>\frac{\theta_1}{\sigma^2}\hfill \end{array}\hfill \end{array}\right.. $$
(37)

The average transmit power can be written as

$$ {P}_{\mathrm{av}}=E\left({K}_{\mathrm{o}}{P}_{\mathrm{o}}+{K}_1{P}_1\right), $$
(38)

where

$$ {K}_{\mathrm{o}}=P\left({\mathrm{H}}_{\mathrm{o}}\right)\left(1-{P}_{\mathrm{fa}}\right)+P\left({\mathrm{H}}_1\right)\left(1-{P}_{\mathrm{d}}\right)\kern0.5em , $$
(39)
$$ {K}_1=P\left({\mathrm{H}}_1\right){P}_{\mathrm{fa}}+P\left({\mathrm{H}}_1\right){P}_{\mathrm{d}}. $$
(40)

Here, K 0 = probability that the primary user is absent,

K 1 = probability that the primary user is present, and

α = attenuation constant from candidate relay to SU receiver.

Solving (38), we have

$$ {P}_{\mathrm{av}}={K}_{\mathrm{o}}\alpha \log \left(1+\frac{\theta_0}{\sigma^2}\right)+{K}_1\alpha \log \left(1+\frac{\theta_1}{\sigma^2}\right)\kern0.5em . $$
(41)

The average interference power can be written as

$$ {\varGamma}_1=P\left({H}_1\right)\alpha \left\{\left(1-{P}_{\mathrm{d}}\right)\left[ \log \left(1+\frac{\theta_0}{\sigma^2}\right)-\frac{\theta_0}{\theta_o+{\sigma}^2}\right]+{P}_{\mathrm{d}}\left[ \log \left(1+\frac{\theta_1}{\sigma^2}\right)-\frac{\theta_1}{\theta_1+{\sigma}^2}\right]\right\}. $$
(42)

4.1 A. Outage probability

Outage probability is an important performance measure that is commonly used to characterize a wireless communication system. It is defined as the probability that the instantaneous end-to-end SNR falls below a threshold. Therefore, mathematically, the outage probability is given by

$$ \begin{array}{l}{P}_{\mathrm{out}}={F}_{\theta_{00}}\left({\theta}_0\right)+F{\theta}_{01}\left({\theta}_1\right)+F{\theta}_{10}\left({\theta}_0\right)+{F}_{\theta_{11}}\left({\theta}_1\right).\hfill \\ {}{\mathrm{P}}_{\mathrm{out}}=P\left[{\mathrm{SNR}}_{eq0}<{\theta}_o\right]P\left({\mathrm{H}}_0\right)\left(1-{P}_{\mathrm{fa}}\right)+P\left[{\mathrm{SNR}}_{\mathrm{eq}0}<{\theta}_1\right]P\left({\mathrm{H}}_0\right){P}_{\mathrm{fa}}+P\left[{\mathrm{SNR}}_{\mathrm{eq}1}<{\theta}_0\right]P\left({\mathrm{H}}_1\right)\left(1-{P}_{\mathrm{d}}\right)\hfill \\ {}+P\left[{\mathrm{SNR}}_{\mathrm{eq}1}<{\theta}_1\right]P\left({\mathrm{H}}_1\right){P}_{\mathrm{d}}\hfill \\ {}{P}_{\mathrm{out}}={\displaystyle \underset{0}{\overset{\frac{\theta_0}{\sigma^2}}{\int }}{K}_0} \exp \left(-{\mathrm{SNR}}_{\mathrm{eq}0}\right){\mathrm{d}\mathrm{SNR}}_{\mathrm{eq}0}+{\displaystyle \underset{0}{\overset{\frac{\theta_1}{\sigma^2}}{\int }}{K}_1} \exp \left(-{\mathrm{SNR}}_{\mathrm{eq}1}\right){\mathrm{d}\mathrm{SNR}}_{\mathrm{eq}1}+{\displaystyle \underset{\frac{\theta_o}{\sigma^2}}{\overset{\infty }{\int }}\frac{K_0}{{\left(1+u\right)}^2}}\mathrm{d}u+{\displaystyle \underset{\frac{\theta_1}{\sigma^2}}{\overset{\infty }{\int }}\frac{K_1}{{\left(1+u\right)}^2}}\mathrm{d}u\hfill \\ {}{P}_{\mathrm{out}}={K}_0-{K}_0 \exp \left(-\frac{\theta_0}{\sigma^2}\right)+{K}_1-{K}_1 \exp \left(-\frac{\theta_1}{\sigma^2}\right)+\frac{K_0{\sigma}^2}{\theta_0+{\sigma}^2}+\frac{K_1{\sigma}^2}{\theta_1+{\sigma}^2}\hfill \end{array} $$
(43)

4.2 B. Outage capacity

Finally, the outage capacity of the proposed spectrum sharing cognitive radio system under joint average transmit and interference power constraints for a target outage probability \( {P}_{\mathrm{out}}={\overline{P}}_{\mathrm{out}} \), is given by

$$ {C}_{\mathrm{out}}=\underset{\theta_0,{\theta}_1}{ \max}\left\{ \log \left(1+\frac{1}{\sigma^2}\left[\frac{ \min \left\{{V}_0\left({\theta}_0,{\theta}_1\right),{V}_1\left({\theta}_0,{\theta}_1\right)\right\},{V}_2}{ \min \left\{{V}_0\left({\theta}_0,{\theta}_1\right),{V}_1\left({\theta}_0,{\theta}_1\right)\right\}+{V}_2}\right]\right)\left(1-{\overline{P}}_{\mathrm{out}}\right)\right\}, $$
(44)

where

$$ {V}_0\left({\theta}_0,{\theta}_1\right)=\frac{P_{\mathrm{av}}}{K_0\alpha \log \left(1+\frac{\theta_0}{\sigma^2}\right)+{K}_1\alpha \log \left(1+\frac{\theta_1}{\sigma^2}\right)}\kern0.5em , $$
(45)
$$ {V}_1\left({\theta}_0,{\theta}_1\right)=\frac{\varGamma_1}{P\left({H}_1\right)\alpha \left\{\left(1-{P}_{\mathrm{d}}\right)\left[ \log \left(1+\frac{\theta_0}{\sigma^2}\right)-\frac{\theta_0}{\theta_0+{\sigma}^2}\right]+{P}_{\mathrm{d}}\left[ \log \left(1+\frac{\theta_1}{\sigma^2}\right)-\frac{\theta_1}{\theta_1+{\sigma}^2}\right]\right\}}\kern0.5em , $$
(46)
$$ {V}_2=\frac{\varGamma_2}{P\left({\mathrm{H}}_1\right)\left\{\left(1-{P}_{\mathrm{d}}\right)\left[ \log \left(1+\frac{\gamma_0}{\sigma^2}\right)-\frac{\gamma_0}{\gamma_0+{\sigma}^2}\right]+{P}_{\mathrm{d}}\left[ \log \left(1+\frac{\gamma_1}{\sigma^2}\right)-\frac{\gamma_1}{\gamma_1+{\sigma}^2}\right]\right\}}. $$
(47)

Here, the maximum value of the outage capacity can be obtained by searching numerically for the optimal values of θ 0 and θ 1.

5 Numerical results

Earlier work ([2028]) in spectrum efficiency for 4-G wireless communication systems discussed the effect of the four standard adaptation policies in the presence of spatial correlation, transmit and receive diversity work for single and multiple user scenarios. This work was followed by extensive work ([2934]) on cooperative spectrum sensing in cognitive radio networks. In this section, we present numerical results for the proposed cognitive radio system incorporating cooperative relays and compare it with the conventional spectrum sharing scheme. We adopt the energy detector [14, 15] as a method of spectrum sensing, although any spectrum sensing technique [1517] can be used under the proposed cognitive radio system. We consider Rayleigh fading channels, f s = 6 MHz, P(H0) = 0.6, σ 2 = 1, target detection probability P d = 0.9, and γ = −20 dB, where γ is the received SNR from the primary user and f s is the sampling frequency.

Figure 3 shows the power adaptation level of the secondary user depending on the received power in the absence of a primary user for different values of channel gain. From Fig. 3, it can be observed that the signal power of the secondary user reduces as the received power from the channel increases because the received power increases.

Fig. 3
figure 3

Power adaptation of secondary user in absence of primary user for different channel gains

Figure 4 shows the power adaptation level of the secondary user depending on the received power in the presence of a primary user. From Fig. 4, it can be observed that the signal power of the secondary user reduces as the received power from the channel increases, because as the received power increases, the secondary user assumes that the primary user is active and close to it. To avoid harmful interference to the primary user, the secondary user reduces its signal power.

Fig. 4
figure 4

Power adaptation of secondary user in presence of primary user for different channel gains

Figure 5 shows a comparison of the transmit power of the secondary user depending on the presence or absence of the primary user. It can be easily observed that the transmit power increases in the absence of the primary user. When the primary user is active, the secondary user halves its transmit power. Hence, it reduces the interference level to the primary user.

Fig. 5
figure 5

Power level of secondary user based on the received power of primary user for different channel gains

Figures 6 and 7 show Ergodic throughput vs. SNR graph of the secondary user. In Fig. 6, when the sensing decision finds the primary user idle, the SNR of the secondary user can be taken as high. Hence, a high throughput is obtained. But, the sensing decision is not always correct. It is observed from Fig. 6 that in the case of false alarm, a lower throughput is observed which will avoid harmful interferences. In Fig. 7, when the sensing decision finds the primary user active, the secondary user’s throughput reduces drastically to accommodate primary user transmission without fail.

Fig. 6
figure 6

Ergodic throughput vs. secondary user SNR in absence of primary user

Fig. 7
figure 7

Ergodic throughput vs. secondary user SNR in presence of primary user

Figures 8, 9, 10, and 11 emphasize the effect of the number of cooperative relays in the network. It is observed that as the number of cooperative relays increases, the throughput of the system improves. When the number of relays in a single stage approaches 20 or above, the throughput saturates. This improvement is achieved by selecting the best candidate relay for data transmission which causes least interference to the primary user and can support maximum data rate for the secondary user.

Fig. 8
figure 8

Ergodic throughput vs. SNR in absence of primary user (detection) for different no of relays

Fig. 9
figure 9

Ergodic throughput vs. SNR in presence of primary user (false alarm) for different no of relays

Fig. 10
figure 10

Ergodic throughput vs. SNR in presence of primary user (detection) for different no of relays

Fig. 11
figure 11

Ergodic throughput vs. SNR in absence of primary user (false alarm) for different number of relays

Figure 12 shows that probability of detection increases while increasing the secondary user’s SNR. It also can be observed from Fig. 12 that the performance of the system improves when the number of cooperative relays in the network increases. With an SNR of 6 dB and 6 relays in the stage, the detection probability tends to reach 1 which is very much achievable in real life environment. As the target detection probability, P d, increases, the probability of missed detection, P nd = 1 − P d decreases, and therefore the restriction on the transmit power, P 0, imposed by the average interference power constraint, when the primary users are detected to be idle, reduces. Hence, the secondary users under higher values of target detection probability, P d, can communicate using higher transmit power during the periods that the primary users are detected to be idle and as a result, the Ergodic throughput of the cognitive radio system increases.

Fig. 12
figure 12

Probability of detection vs. SNR for different no of cooperative relays in the network

Figure 13 emphasizes the negative impact on primary user transmission while a false alarm is generated. It can also be observed that interference caused by the secondary user in the maximum case is 0.1 dB which assures uninterrupted primary user transmission under any scenario.

Fig. 13
figure 13

Interference power caused to the primary user vs. false alarm probability for different values of channel attenuations

We now consider outage capacity and the capacity under TIFR transmission policy of the proposed cognitive radio system. The target outage probability under TIFR transmission policy is presented vs. the secondary user transmitted power in Fig. 14. Figure 15 shows the outage capacity of the proposed cooperative SS scheme vs. the transmit power under different average power constraints. The target outage probability is set to \( {\overline{P}}_{\mathrm{out}}=0.1 \), and maximum peak interference, Q peak, is related to the average interference constraint Γ1 by ρ = Q peak1, as shown in [35].

Fig. 14
figure 14

Outage capacity vs. transmitted power of the network for different channel gains for a TIFR transmission policy

Fig. 15
figure 15

Outage capacity vs. transmitted power of the network for different channel gains

6 Conclusions

In this paper, we proposed a sensing-enhanced spectrum sharing cognitive radio system that significantly improves the Ergodic capacity of spectrum sharing cognitive radio networks by implementing cooperative relay networks. In addition, we provided numerical results, which indicate that the proposed cognitive radio system can considerably improve ergodic capacity of spectrum sharing cognitive radio networks under perfect secondary signal cancelation. We studied outage capacity under different average transmit power and average interference power constraints. In addition, we provided numerical results which indicate that cooperative relaying enhance the performance of spectrum sharing cognitive radio networks. In our future research, we plan to extend this work for multiple primary users and for multiple stages of cooperative relay network. The obtained results adhere to the spectrum policy rules put forth in [36].