1 Introduction

Over the last decade, the exponential growth of wireless communication technologies and surge of data services have given rise to an ever-increasing demand for spectrum resources. This has resulted in scarcity of frequency spectrum, which is a limited natural resource. Interestingly, the recent study of spectrum utilization carried out by Federal Communication Commission (FCC) has indicated that most of the spectrum is underutilized in vast temporal and geographical dimensions due to the fixed spectrum allocation methodology [1, 2]. Therefore, to resolve the conflict between spectrum underutilization and spectrum scarcity problem, the “Cognitive radio” (CR) technology is considered as a viable option [3, 4]. The cognitive radio has the ability to sense the huge swath of spectrum in external radio frequency environment and adapt itself by changing its communication parameters such as transmission power, carrier frequency and bandwidth accordingly [3, 5]. In CR, the unlicensed secondary user (SU) borrows the spectrum from licensed primary user (PU) or shares the spectrum with PU networks to increase the utilization of unused spectrum without interfering with the PU [3,4,5]. To ensure this, the SU has to dynamically detect the presence of licenced users [4, 5].

The performance of a CR networks heavily depends on its ability to sense the frequency spectrum. There are various spectrum sensing techniques available in the literature such as energy detection (ED) [6,7,8,9,10,11], matched filter detection (MF) [12, 13], cyclostationary feature detection [14, 15], maximum–minimum eigenvalue detection [16, 17] and covariance-based detection [18,19,20,21,22,23] methods.

There are three different paradigms for spectrum sharing in the CR network, namely underlay, overlay and interweave [24]. In the underlay approach, the SU can always access the licensed spectrum by transmitting the signal at a very low power level so that the interference to the PU remains below the prescribed limit [25, 26]. In the overlay approach, however, SU also helps in PU’s transmission while accessing the spectrum. In this mode, PU shares the information about signal codebook and message with the SU [27, 28]. In the interweave approach, the SU exploits the unused frequency spectrum band of the licensed PU in an opportunistic fashion [27]. The covariance based spectrum sensing scheme proposed in this paper can be used with overlay and interweave approaches of spectrum sharing for cognitive radio networks.

Many spectrum-sensing methods require the information about the spectrum utilization factor of licensed user [9, 23]. Therefore, spectrum occupancy measurements are very useful in CR system design and can be utilized to increase spectrum sensing accuracy. In the literature several spectrum occupancy models are studied to estimate the behavior of PU’s spectrum utilization [29,30,31,32,33,34]. The covariance-based spectrum sensing approach proposed here also exploits the information about SNR and the spectrum occupancy by PU to obtain more reliable sensing performance.

The rest of the paper is organized as follows. Works related to spectrum sensing are reviewed in Sect. 2, and related issues are discussed. The spectrum sensing model and the conventional methods based on ED and covariance matrix are briefly described in Sect. 3. The proposed covariance-based adaptive threshold spectrum-sensing method and scheme for intelligent selection of threshold are presented in Sect. 4. The simulation results of the proposed scheme and a comparison with ED and existing covariance-based approaches are presented in Sect. 5. Finally, overall findings of this study are concluded in Sect. 6.

2 Related work

The spectrum sensing is a vital component in CR networks. Recently, various spectrum-sensing methods have been proposed in the literature [7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23]. Among these methods, the energy detection [7,8,9,10,11] is widely used as it does not require prior knowledge of PU’s signal characteristics and is also easy to implement. However, as shown by several studies [35, 36], its performance severely degrades at low SNR and is not robust to noise uncertainty. In order to improve the performance at low SNR, authors discussed a spectrum-sensing algorithm in [10], which is based on three consecutive events. This algorithm, named as three-event ED (3EED), takes the decision in one sensing event, considering also the event immediately before and the one immediately after it. It exploits the knowledge of duty cycle of the PU’s activity for tracking the changes in the PU’s state. However, this scheme is not able to address the problem of noise uncertainty. Also, these methods require an estimate of noise power [7, 9, 10], which in practice, is very challenging to obtain [35]. The matched filtering (MF)-based scheme [12, 13] can perform well at low SNR and with noise uncertainty but requires prior information of licensed user. Similarly, the cyclostationary detection method [14, 15] needs the knowledge of the PU’s cyclic frequency. Therefore, both MF and cyclostationary-based detection methods are not suitable for blind spectrum sensing. To overcome the problem of noise uncertainty, the maximum eigenvalue detection method [16, 17] and covariance-based method [18,19,20,21,22,23] have been proposed. The covariance-based spectrum sensing methods use the statistical covariance of signal and noise, which are usually different. This property is exploited to decide whether PU is present or not [18,19,20,21,22]. Among other schemes based on this principle, the weighted-covariance-based spectrum sensing [22] exploits the spatial/temporal correlation of PU signal. The graph-theory based detection scheme is discussed in [23], which maps received data to the graph-related data sheets and examines the corresponding adjacency matrix and associated matrix converting the problem of spectrum sensing into classical problem of graph theory. The performance of all these existing covariance-based spectrum sensing methods degrade at low SNR, as they do not consider other factors such as signal to noise ratio and spectrum utilization ratio of PU.

In every spectrum sensing scheme, the decision about the presence or absence of a licensed user is based on a threshold, which is computed by using some test statistic. Most of the spectrum sensing techniques consider a constant false alarm rate to obtain a suitable value of threshold for decision making. The performance of spectrum sensing greatly depends upon the value of threshold used in the sensing scheme. The conventional spectrum sensing methods use a fixed threshold [7, 10, 18, 21], which does not ensure sufficient protection to PU. Also, the performance of these methods severely deteriorates at low SNR. It is very difficult to achieve pre specified values of both probability of detection and probability of false alarm with a single value of threshold [37]. To address this issue a number of adaptive threshold-based techniques have been introduced [8, 9]. In [25] an optimal threshold is obtained through tradeoff between probability of detection and probability of false alarm by employing a weighted function. Sobron et al. [8] have discussed an adaptive spectrum sensing scheme using a cost function that consists of the aggregate information about absence or presence of PUs.

These schemes exhibit an improved performance at low SNR due to adaptive nature of the threshold employed. However, in case of noise uncertainty, the performance severely deteriorates [36]. Although the conventional covariance-based method can effectively address the problem of noise uncertainty, its performance at low SNR is not good [20, 21]. Therefore, the work presented in this paper attempts to develop a spectrum sensing algorithm, which can effectively overcome the challenges of noise uncertainty as well as that of low SNR. To achieve this goal, the proposed method named as covariance-based adaptive threshold (CAT) utilizes the information about PU’s activity and SNR. The spectrum utilization factor of licensed user is obtained using the statistical spectrum occupancy model presented in [34] that employs first and second order parameters derived from statistical characteristic of frequency spectrum, and predicts spectrum occupancy with high accuracy. Further, the overall probability of decision error is minimized to obtain the adaptive threshold, which ensures better performance at low SNR. The proposed scheme is also robust against noise uncertainty as the test statistics used in the scheme are based on signal covariance like other conventional covariance-based spectrum sensing scheme.

The proposed work of CAT scheme is further extended to provide sufficient protection to PU along with minimization of decision error. The new scheme, named as covariance-based adaptive threshold with intelligent selection (CAT-IS), intelligently selects the decision threshold from a set of three values of threshold obtained using three different criteria, namely constant false alarm rate (CFAR), constant detection rate (CDR) and the proposed CAT. The threshold obtained using CDR criterion is best suited to provide sufficient protection to licensed user. The threshold obtained under CFAR criterion ensures the maximum utilization of spectrum by SU for given value of CFAR. The threshold obtained by CAT scheme achieves minimum probability of decision error. The proposed CAT-IS scheme varies the number of samples used in sensing to achieve the goal of minimization of decision error with sufficient protection to PU.

3 Spectrum sensing preliminaries

In this section, first of all, the commonly used spectrum sensing model is described. Then, a brief review of commonly used ED and covariance-based spectrum sensing technique is presented. Also, the notation adopted in this paper is described in Table 1.

Table 1 Notation adopted in this paper

3.1 Spectrum sensing model

Let the frequency band to be sensed by the SU be centred at frequency \( f_{c} \) having a bandwidth W. The received signal can be expressed as the following hypotheses [8, 13, 18]:

$$ H_{0} :x(n) = \eta (n) $$
(1)
$$ H_{1} :x(n) = s(n) + \eta (n) $$
(2)

where \( x(n) \) is the sample of signal received by the SU, \( s(n) \) is the sample of PU’s transmitted signal with zero mean and variance \( \sigma_{s}^{2} \), and \( \eta (n) \) is additive white Gaussian noise (AWGN). The noise samples are assumed to be independent and identically distributed (IID) with zero mean and variance \( \sigma_{\eta }^{2} \). Thus, the signal to noise ratio (SNR) is \( \xi = {{\sigma_{s}^{2} } \mathord{\left/ {\vphantom {{\sigma_{s}^{2} } {\sigma_{\eta }^{2} }}} \right. \kern-0pt} {\sigma_{\eta }^{2} }} \).

The hypothesis \( H_{0} \) indicates that the PU is absent whereas the hypothesis \( H_{1} \) represents that PU is present. The performance of spectrum sensing can be measured in terms of probability of detection \( (P_{d} ) \) i.e. a busy frequency band is detected to be busy, and probability of false alarm \( (P_{f} ) \) that an idle frequency band is detected to be busy. To achieve the maximum throughput of SU, \( P_{f} \) should be as small as possible, whereas to provide protection to PU, \( P_{d} \) should be high [37].

3.2 Energy based spectrum sensing

In ED-based spectrum sensing, following test statistic is used [6,7,8,9,10,11]:

$$ T(x) = \frac{1}{N}\sum\limits_{n = 1}^{N} {\left| {x(n)} \right|^{2} } $$
(3)

where N is the number of samples used in test statistic.

The test statistic \( T(x) \) of (3) has the Chi square distribution. However, when \( N \) is large, it can be approximated by Gaussian distribution using the central limit theorem [6, 7]. In conventional energy based spectrum sensing for a given value of probability of false alarm, the threshold \( \lambda \) can be expressed as described in [7, 24,25,26,27,28] by:

$$ \lambda = \sigma_{\eta }^{2} \left( {\sqrt {\frac{2}{N}} Q^{ - 1} (P_{f} ) + 1} \right) $$
(4)

where \( P_{f} \) is probability of false alarm and the \( Q \)-function is described as: \( Q(z) = \int\limits_{z}^{\infty } {\frac{1}{{\sqrt {2\pi } }}e^{{ - \frac{{x^{2} }}{2}}} dx} \).

3.3 Covariance-based spectrum sensing method

The signal received at SU has the following covariance matrix [18,19,20,21]:

$$ R_{x} (N_{s} ) = \left[ {\begin{array}{*{20}c} {g(0)} & {g(1)} & \ldots & {g(L - 1)} \\ {g^{*} (1)} & {g(0)} & \ldots & {g(L - 2)} \\ \begin{aligned} \vdots \hfill \\ \vdots \hfill \\ \end{aligned} & \begin{aligned} \vdots \hfill \\ \vdots \hfill \\ \end{aligned} & \begin{aligned} \ldots \hfill \\ \ldots \hfill \\ \end{aligned} & \begin{aligned} \vdots \hfill \\ \vdots \hfill \\ \end{aligned} \\ {g^{*} (L - 1)} & {g^{*} (L - 2)} & \ldots & {g(0)} \\ \end{array} } \right] $$
(5)

where \( N_{s} \) denotes the number of samples used for computation of sample covariance matrix. The element \( g(l) \) of the covariance matrix \( R_{x} (N_{s} ) \) is computed as:

$$ g(l) = \frac{1}{{N_{s} }}\sum\limits_{m = 0}^{{N_{s} - 1}} {x(m)x^{*} (m - l)} $$
(6)

with \( l = 0,1, \ldots ,L - 1 \); where \( L \) represents the smoothing factor [18, 20, 21].

The threshold used in the covariance absolute value (CAV) spectrum sensing scheme [18], is defined as:

$$ \gamma = \frac{{1 + (L - 1)\sqrt {\frac{2}{{N_{s} \pi }}} }}{{1 - Q^{ - 1} (P_{f} )\sqrt {\frac{2}{{N_{s} }}} }} $$
(7)

4 Proposed method for intelligent selection of threshold for covariance-based spectrum sensing

The performance of spectrum sensing in a cognitive radio system is characterized by \( P_{d} \) and \( P_{f} \). The conventional spectrum sensing methods use a fixed threshold which can be based on constant false alarm rate (CFAR) or on constant detection rate (CDR). If the cognitive radio network is to be designed to ensure PU’s safety, the CDR method is best suited and a high value of the target detection probability is chosen for threshold calculation. The higher the target \( P_{d} \), higher the protection to PU from SU transmission. Whereas, if design priority of CR network is to maximize the spectrum efficiency of the secondary user, the CFAR method is used and the target \( P_{f} \) is kept very small. The lesser the value of target \( P_{f} \), more the chances of spectrum band being utilized by the SU. In addition to above two techniques, threshold can also be obtained by minimizing the overall probability of error. In this paper, an adaptive threshold is derived and an algorithm of intelligent selection of threshold is presented. The adaptive threshold based on minimization of overall probability of error can take into account both \( P_{d} \) and \( P_{f} \) to ensure that the interest of both PU and SU are taken care of. The derivation of proposed adaptive threshold based on this criteria is presented in part B of this section. It has been observed that the value of \( P_{d} \) in this method degrades at low SNR.

In order to overcome this problem, an intelligent selection of threshold is proposed, which selects the optimum value of threshold from the three possible values of threshold based on above criteria. This method effectively maintain the desirable value of \( P_{d} \) with minimum value of overall probability of error.

4.1 Computation of thresholds for covariance-based CFAR and CDR schemes

Let the auto-correlation matrix of the signal received at SU be expressed as:

$$ R_{x} (N_{s} ) = R_{s} (N_{s} ) + R_{\eta } (N_{s} ) $$
(8)

where \( R_{x} (N_{s} ) \), \( R_{s} (N_{s} ) \) and \( R_{\eta } (N_{s} ) \) represent the autocorrelation matrices of the received signal at SU, signal transmitted by the licensed user, and noise, respectively.

It is assumed that the noise is additive white Gaussian with zero mean and \( \sigma_{\eta }^{2} \) variance, hence Eq. (8) can be expressed as:

$$ R_{x} (N_{s} ) = R_{s} (N_{s} ) + \sigma_{\eta }^{2} I_{L} $$
(9)

where \( I_{L} \) is an identity matrix of size \( L \times L \).

Then, if PU’s transmitted signal \( s(n) \) is absent i.e. \( R_{s} (N_{s} ) = 0 \), the off-diagonal elements of \( R_{x} (N_{s} ) \) are all nulls. Whereas, if signal \( s(n) \) is present and signal samples are correlated, \( R_{x} (N_{s} ) \) will have significant values of off-diagonal elements.

In this method following test statistics are computed:

$$ T_{1} (N_{s} ) = \frac{1}{L}\sum\limits_{i = 1}^{L} {\sum\limits_{j = 1}^{L} {\left| {r_{ij} (N_{s} )} \right|} } $$
(10)

and

$$ T_{2} (N_{s} ) = \frac{1}{L}\sum\limits_{i = 1}^{L} {\left| {r_{ij} (N_{s} )} \right|} $$
(11)

Here, \( r_{ij} (N_{s} ) \) represents the element of matrix \( R_{x} (N_{s} ) \) at the \( ith \) row and \( jth \) column. Therefore, if there is no signal \( {{T_{1} (N_{s} )} \mathord{\left/ {\vphantom {{T_{1} (N_{s} )} {T_{2} (N_{s} ) = 1}}} \right. \kern-0pt} {T_{2} (N_{s} ) = 1}} \); and in the presence of signal \( {{T_{1} (N_{s} )} \mathord{\left/ {\vphantom {{T_{1} (N_{s} )} {T_{2} (N_{s} ) > 1}}} \right. \kern-0pt} {T_{2} (N_{s} ) > 1}} \). Thus, the ratio \( {{T_{1} (N_{s} )} \mathord{\left/ {\vphantom {{T_{1} (N_{s} )} {T_{2} (N_{s} )}}} \right. \kern-0pt} {T_{2} (N_{s} )}} \) forms the test statistic \( T(N_{s} ) \), to detect the presence of signal in CFAR and CDR based methods as explained below.

  1. 1.

    In CFAR based scheme, the threshold is computed for the specified value of \( P_{f} \). The \( P_{f} \) under the hypothesis \( H_{0} \), it can be expressed as:

$$ P_{f} = P(T_{1} (N_{s} ) \ge \gamma_{{P_{f} }} T_{2} (N_{s} )) $$
(12)

Now the associated threshold \( \gamma_{{P_{f} }} \) is obtained in [14] as:

$$ \gamma_{{P_{f} }} = \frac{{1 + (L - 1)\sqrt {\frac{2}{{N_{s} \pi }}} }}{{1 - Q^{ - 1} (P_{f} )\sqrt {\frac{2}{{N_{s} }}} }} $$
(13)
  1. 2.

    If the CR network is designed to guarantee the PU’s safety against the interference of SU by using the CDR method with certain target detection probability, then under hypothesis \( H_{1} \), it can be expressed as:

$$ P_{d} = P(T_{1} (N_{s} ) \ge \gamma_{{P_{d} }} T_{2} (N_{s} )) $$
(14)

For a very large number of samples \( N_{s} \) and a low SNR, probability of detection \( (P_{d} ) \) can be obtained as shown in [18] by the following expression:

$$ P_{d} = 1 - Q\left( {\frac{{\frac{1}{{\gamma_{{P_{d} }} }} + \frac{{\varUpsilon_{L} \xi }}{{\gamma_{{P_{d} }} (\xi + 1)}} - 1}}{{\sqrt {{2 \mathord{\left/ {\vphantom {2 {N_{s} }}} \right. \kern-0pt} {N_{s} }}} }}} \right) $$
(15)

where \( \varUpsilon_{L} \triangleq \frac{2}{L}\sum\limits_{l = 1}^{L - 1} {(L - 1)\left| {\alpha_{l} } \right|} \), is the overall correlation strength among the consecutive L samples and \( \alpha_{l} \) is the normalized correlation among the signal samples, expressed as: \( \alpha_{l} = {{E\left[ {s(n)s(n - l)} \right]} \mathord{\left/ {\vphantom {{E\left[ {s(n)s(n - l)} \right]} {\sigma_{s}^{2} }}} \right. \kern-0pt} {\sigma_{s}^{2} }}. \)

For the present case, the expression (15) can be utilized to compute the threshold \( (\gamma_{{P_{d} }} ) \) which can ensure a given probability of detection as given below:

$$ \gamma_{{P_{d} }} = \frac{{1 + \frac{{\varUpsilon_{L} \xi }}{(\xi + 1)}}}{{\sqrt {\frac{{N_{s} }}{2}} Q^{ - 1} (1 - P_{d} ) + 1}} $$
(16)

4.2 Proposed adaptive threshold based on minimization of overall probability of error

The tradeoff between \( P_{d} \) and \( P_{f} \) can be exploited to derive an adaptive threshold for spectrum sensing which minimizes the overall probability of decision error \( (P_{e} ) \). For this purpose, the following expression is used:

$$ \hbox{min} (P_{e} (\gamma )) = \hbox{min} \left\{ {P(H_{0} )P_{f} + P(H_{1} )(1 - P_{d} )} \right\} $$
(17)

where the probabilities \( P(H_{0} ) \) and \( P(H_{1} ) \), respectively, indicate the absence and presence of PU. The argument in (17) includes two types of errors: (1) deciding \( H_{1} \) in place of \( H_{0} \) (2) deciding \( H_{0} \) instead of \( H_{1} \). The adaptive threshold can be obtained by minimizing the following objective function.

$$ P_{e} (\gamma ) = (1 - \alpha )P_{f} + \alpha (1 - P_{d} ) $$
(18)

Substitution of \( P_{f} \) and \( P_{d} \) from (13) and (15) into (18) yields:

$$ \begin{aligned} P_{e} (\gamma ) = & (1 - \alpha )\left( {1 - Q\left( {\frac{{\frac{1}{\gamma }\left( {1 + (L - 1)\sqrt {\frac{2}{{N_{s} \pi }}} } \right) - 1}}{{\sqrt {\frac{2}{{N_{s} }}} }}} \right)} \right) \\ & \quad \quad \quad \quad \quad \; + \alpha Q\left( {\frac{{\frac{1}{\gamma } + \frac{{\varUpsilon_{L} \xi }}{\gamma (\xi + 1)} - 1}}{{\sqrt {{2 \mathord{\left/ {\vphantom {2 {N_{s} }}} \right. \kern-0pt} {N_{s} }}} }}} \right) \\ \end{aligned} $$
(19)

Let \( U = \frac{{\frac{1}{\gamma }\left( {1 + (L - 1)\sqrt {\frac{2}{{N_{s} \pi }}} } \right) - 1}}{{\sqrt {\frac{2}{{N_{s} }}} }} \) and \( V = \frac{{\frac{1}{\gamma } + \frac{{\varUpsilon_{L} \xi }}{\gamma (\xi + 1)} - 1}}{{\sqrt {{2 \mathord{\left/ {\vphantom {2 {N_{s} }}} \right. \kern-0pt} {N_{s} }}} }} \) Then

$$ P_{e} (\gamma ) = \frac{(\alpha - 1)}{\sqrt \pi }\int_{{\frac{U}{\sqrt 2 }}}^{\infty } {e^{{ - z^{2} }} dz} + \frac{\alpha }{\sqrt \pi }\int_{{\frac{V}{\sqrt 2 }}}^{\infty } {e^{{ - z^{2} }} dz} + 1 - \alpha $$
(20)

For a known value of \( \alpha \), the total decision error probability \( P_{e} (\gamma ) \) is a convex function of threshold \( \gamma \).

The probability of error in (19) can be minimized by setting the derivative equal to zero, which leads to the following expression:

$$ \begin{aligned} \gamma^{2} \ln \left[ {\frac{(1 - \alpha )}{\alpha }\frac{{1 + (L - 1)\sqrt {\frac{2}{{N_{s} \pi }}} }}{{1 + \frac{{\varUpsilon_{L} \xi }}{(\xi + 1)}}}} \right]\frac{4}{{N_{s} }} \hfill \\ +\, \gamma \left[ { - 2(L - 1)\sqrt {\frac{2}{{N_{s} \pi }}} + \frac{{2\varUpsilon_{L} \xi }}{(\xi + 1)}} \right] \hfill \\ - \left[ {(L - 1)^{2} \frac{2}{{N_{s} \pi }} + 2(L - 1)\sqrt {\frac{2}{{N_{s} \pi }}} } \right. \hfill \\ \left. { - \frac{{\varUpsilon_{L}^{2} \xi^{2} }}{{(\xi + 1)^{2} }} - \frac{{2\varUpsilon_{L} \xi }}{(\xi + 1)}} \right] = 0 \hfill \\ \end{aligned} $$
(21)

Equation (21) can be written as:

$$ \gamma^{2} A + \gamma B + C = 0 $$
(22)

where

$$ \begin{aligned} A = & \ln \left[ {\frac{(1 - \alpha )}{\alpha }\frac{{1 + (L - 1)\sqrt {\frac{2}{{N_{s} \pi }}} }}{{1 + \frac{{\varUpsilon_{L} \xi }}{(\xi + 1)}}}} \right]\frac{4}{{N_{s} }}, \\ B = & \left[ { - 2(L - 1)\sqrt {\frac{2}{{N_{s} \pi }}} + \frac{{2\gamma_{L} \xi }}{(\xi + 1)}} \right]\quad {\text{and}} \\ C = & - \left[ {(L - 1)^{2} \frac{2}{{N_{s} \pi }} + 2(L - 1)\sqrt {\frac{2}{{N_{s} \pi }}} } \right. \\ & \quad \left. { - \frac{{\gamma_{L}^{2} \xi^{2} }}{{(\xi + 1)^{2} }} - \frac{{2\gamma_{L} \xi }}{(\xi + 1)}} \right] \\ \end{aligned} $$
(23)

Let

$$ \begin{aligned} a = \left[ {(L - 1)\sqrt {\frac{2}{{N_{s} \pi }}} - \frac{{\gamma_{L} \xi }}{(\xi + 1)}} \right]\quad {\text{and}} \hfill \\ b = \left[ {(L - 1)\sqrt {\frac{2}{{N_{s} \pi }}} + \frac{{\gamma_{L} \xi }}{(\xi + 1)} + 2} \right] \hfill \\ \end{aligned} $$
(24)

Then, it is easily observed that: \( B = - 2a \) and \( C = - ab \).

Now, Eq. (22) can be expressed as:

$$ \gamma^{2} A - 2a\gamma - ab = 0 $$
(25)

The solution of Eq. (25) can be given as:

$$ \gamma_{1} = \frac{a}{A}\left[ { - 1 + \sqrt {\left( {1 + \frac{Ab}{a}} \right)} } \right]\quad {\text{and}}\quad \gamma_{2} = \frac{a}{A}\left[ { - 1 - \sqrt {\left( {1 + \frac{Ab}{a}} \right)} } \right] $$

The value of \( \gamma \), selected to represent the threshold is positive i.e. \( \gamma = \gamma_{1} \) and is described by:

$$ \begin{aligned} \gamma_{e} = & \left[ {\frac{{\left( {(L - 1)\sqrt {\frac{2}{{N_{s} \pi }}} - \frac{{\varUpsilon_{L} \xi }}{(\xi + 1)}} \right)}}{{\ln \left[ {\frac{(1 - \alpha )}{\alpha }\frac{{1 + (L - 1)\sqrt {\frac{2}{{N_{s} \pi }}} }}{{1 + \frac{{\varUpsilon_{L} \xi }}{(\xi + 1)}}}} \right]\frac{4}{{N_{s} }}}}} \right] \\ & \left[ { - 1 + \left( {1 + \frac{{\left( {(L - 1)\sqrt {\frac{2}{{N_{s} \pi }}} + \frac{{\varUpsilon_{L} \xi }}{(\xi + 1)} + 2} \right)}}{{\left( {(L - 1)\sqrt {\frac{2}{{N_{s} \pi }}} - \frac{{\varUpsilon_{L} \xi }}{(\xi + 1)}} \right)}}} \right.} \right. \\ & \left. {\left. {\ln \left[ {\frac{(1 - \alpha )}{\alpha }\frac{{1 + (L - 1)\sqrt {\frac{2}{{N_{s} \pi }}} }}{{1 + \frac{{\varUpsilon_{L} \xi }}{(\xi + 1)}}}} \right]\frac{4}{{N_{s} }}} \right)^{0.5} } \right] \\ \end{aligned} $$
(26)

where \( \varUpsilon_{L} \) represents the overall correlation strength among the consecutive L samples.

The parameter \( \Upsilon _{L} \) can be obtained by using the test statistics \( T_{1} (N_{s} ) \) and \( T_{2} (N_{s} ) \). Under hypothesis \( H_{1} \), \( \varUpsilon_{L} \) can be obtained from off-diagonal elements of the \( R_{x} (N_{s} ) \). It can be observed that

$$ \mathop {\lim }\limits_{{N_{s} \to \infty }} E\left( {T_{1} (N_{s} ) - T_{2} (N_{s} )} \right) = \frac{{2\sigma_{s}^{2} }}{L}\sum\limits_{l = 1}^{L - 1} {(L - 1)\left| {\alpha_{l} } \right|} $$
(27)

where \( \alpha_{l} \) denotes the correlation among signal samples.

Therefore, the overall correlation strength among the consecutive \( L \) samples can be estimated at SU as:

$$ \varUpsilon_{L} = \frac{{T_{1} \left( N \right) - T_{2} \left( N \right)}}{{SNR\sigma_{\eta }^{2} }} $$
(28)

where \( \varUpsilon_{L} \) is computed by using \( N \) samples, which also includes the samples of the previous sampling intervals. Thus, \( N > > N_{s} \).

4.3 Proposed scheme of intelligent selection of threshold

The performance of the scheme based on the adaptive threshold introduced in part B can be further improved by adopting an intelligent strategy for the selection of a threshold, which takes into consideration the strengths of methods based on CFAR and CDR principles. The proposed scheme ensures sufficient protection to PU as well as minimizes the probability of overall decision error. For reliable spectrum sensing, the threshold \( (\gamma ) \) should be selected in such a way that probability of false alarm \( P_{f} (\gamma ) \) is below a given specified value \( P_{f}^{th} \) and the probability of detection \( P_{d} (\gamma ) \) is above a given specified value \( P_{d}^{th} \). Since \( P_{d} (\gamma ) \) and \( P_{f} (\gamma ) \) both decrease with increase in threshold \( \gamma \), the above requirements translate into the following conditions:

$$ \gamma \le \gamma_{d}^{*} \quad {\text{and}}\quad \gamma \ge \gamma_{f}^{*} $$
(29)

where \( \gamma_{d}^{*} \) and \( \gamma_{f}^{*} \) denote values of threshold required to satisfy the given values of probability of detection \( (P_{d}^{th} ) \) and probability of false alarm \( (P_{f}^{th} ) \), respectively. That is,

$$ P_{d} \left( {\gamma_{d}^{*} } \right) = P_{d}^{th} \quad {\text{and}}\quad P_{f} \left( {\gamma_{f}^{*} } \right) = P_{f}^{th} $$
(30)

If \( \gamma_{d}^{*} \ge \gamma_{f}^{*} \), then any value of \( \gamma \) which lies in the interval \( \left[ {\gamma_{f}^{*} ,\gamma_{d}^{*} } \right] \) can satisfy the requirements of probability of detection and probability of false alarm. If \( \gamma_{d}^{*} \le \gamma_{f}^{*} \), then there is no feasible value of \( \gamma \), which can satisfy both these requirements. However, in this case a suitable threshold can still be selected if the condition \( \gamma_{d}^{*} \ge \gamma_{e} \) is satisfied. Under this condition the choice of threshold as \( \gamma_{e} \), can ensure sufficient protection to PU and minimizes the probability of overall error, which in turn implies reduction of \( P_{f} \) also.

The process of selection of optimum threshold is shown in the in the following flow chart:

Thus, in the proposed scheme, first of all, the threshold \( \gamma_{f}^{*} \), \( \gamma_{d}^{*} \) and \( \gamma_{e} \) are computed using (13), (16) and (26), respectively for a given sample size \( N_{s} \). Then \( \gamma_{d}^{*} \ge \gamma_{f}^{*} \) is true and \( \gamma_{e} \) lies in the interval \( \left[ {\gamma_{f}^{*} ,\gamma_{d}^{*} } \right] \), the choice of threshold as \( \gamma_{e} \) will satisfy the given requirement of \( P_{d}^{th} \) and \( P_{f}^{th} \). If the condition \( \gamma_{d}^{*} \ge \gamma_{f}^{*} \) is not satisfied or if \( \gamma_{e} \) does not lie in the interval \( \left[ {\gamma_{f}^{*} ,\gamma_{d}^{*} } \right] \) than the condition \( \gamma_{d}^{*} \ge \gamma_{e} \) is evaluated and if found true, the threshold can still be selected as \( \gamma_{e} \). It can be noted that in this case the given requirement of \( P_{f}^{th} \) is not satisfied. However, the protection of PU is ensured with minimum value of \( P_{f} \) through minimization of overall probability of decision error. When the condition \( \gamma_{d}^{*} \ge \gamma_{e} \) is also not found true, there is a need to increase the sample size by including some new samples through re-sensing. For example, the number of sample may be increased to \( 2N_{s} \) by combining the samples of previous intervals. By increasing the sample size the conditions \( \gamma_{d}^{*} \ge \gamma_{f}^{*} \); \( \gamma_{d}^{*} \ge \gamma_{e} \) or both may be satisfied so that the selection of an appropriate threshold becomes feasible.

Therefore, for reliable spectrum sensing the condition \( \gamma_{d}^{*} \ge \gamma_{e} \) should be satisfied, where both \( \gamma_{d}^{*} \) and \( \gamma_{e} \) are function of number of samples \( (N_{s} ) \). The minimum number of samples required for reliable spectrum sensing is the value of \( N_{s} \) that satisfies \( \gamma_{d}^{*} = \gamma_{e} \). That can be easily obtained using (15) and (26) by employing some numerical technique.

4.4 Proposed covariance-based spectrum sensing using Intelligent Selection of Threshold

The algorithm of the proposed scheme for spectrum sensing named as covariance based adaptive threshold with intelligent selection (CAT-IS) is summarized below:

Step 1 Choose the smoothing factor \( L \) and the number of samples \( (N_{s} ) \)

Step 2 Compute the autocorrelation of received signal using Eq. (6) and form the sample covariance matrix using (5)

Step 3 Compute the test statistics

$$ T_{1} (N_{s} ) = \frac{1}{L}\sum\limits_{i = 1}^{L} {\sum\limits_{j = 1}^{L} {\left| {r_{ij} (N_{s} )} \right|} } \quad {\text{and}}\quad T_{2} (N_{s} ) = \frac{1}{L}\sum\limits_{i = 1}^{L} {\left| {r_{ij} (N_{s} )} \right|} $$

where \( r_{ij} (N_{s} ) \) represent the elements of the sample covariance matrix \( R_{x} (N_{s} ) \)

Step 4 Obtain the overall correlation strength \( (\varUpsilon_{L} ) \) among the consecutive \( L \) samples by using (28) and, using a period of 30 sensing intervals

Step 5 Calculate the optimal decision threshold \( \gamma^{*} \) for specified spectrum utilization ratio \( \alpha \) using flowchart given in Fig. 1

Fig. 1
figure 1

Flow chart for the proposed scheme of intelligent selection of threshold

Step 6 Obtain the test statistic

$$ T(N_{s} ) = \frac{{T_{1} (N_{s} )}}{{T_{2} (N_{s} )}} $$
(31)

Step 7 Take the sensing decision as:

$$ D = \left\{ {\begin{array}{*{20}c} 1 & {T(N_{s} ) \ge \gamma^{*} } \\ 0 & {T(N_{s} ) < \gamma^{*} } \\ \end{array} } \right. $$
(32)

Here, the sensing decision \( D = 0 \) implies that the PU is not present, whereas sensing decision \( D = 1 \) indicates that PU is present.

In general, the computational complexity of any covariance-based spectrum-sensing method is higher than that of ED-based method. It can be easily observed that in the covariance-based spectrum sensing scheme computation of autocorrelation matrix involves \( LN_{s} + L^{2} \) multiplications and additions. However, in the proposed spectrum sensing approach when the condition \( \gamma_{d}^{*} \ge \gamma_{e} \); is not satisfied then the number of samples is increased as:

$$ N_{s}^{new} = N_{s} + \Delta N_{s} $$
(33)

where \( N_{s}^{new} \) is the updated number of samples after re-sensing and \( \Delta N_{s} \) represents the increase in the number of samples. The covariance matrix of received signal is updated as:

$$ R_{x} \left( {N_{s}^{new} } \right) = \theta R_{x} \left( {N_{s} } \right) + \left( {1 - \theta } \right)R_{x} \left( {\Delta N_{s} } \right) $$
(34)

where \( \theta = N_{s} /\left( {N_{s} + \Delta N_{s} } \right) \)

In addition to the covariance matrix, the proposed scheme also compares the thresholds for optimal selection. However, the computational efforts required for this are not significant in comparison with efforts required for computation of covariance matrix. The computational complexity increases as \( O\left( {N_{s} } \right) \) in both the existing covariance-based technique and the present approach.

It can also be noted that the number of samples \( N_{s} \) is kept fixed in [18], whereas in the present approach it varies with SNR. At low SNR, the present scheme requires larger number of samples than in the existing scheme. Whereas, at high SNR it is less than that used by the existing covariance-based method. Thus, the overall computational complexity of the proposed method is same as that of [18].

5 Simulation results and discussions

In this section, simulation results are presented to demonstrate the performance of the proposed covariance based adaptive threshold (CAT) spectrum sensing method and the covariance based adaptive threshold with intelligent selection (CAT-IS) spectrum sensing scheme. For comparison, existing schemes viz conventional ED-based spectrum sensing method, 3EED-based scheme and covariance absolute value (CAV)-based [18] spectrum sensing methods are also simulated.

The CR system model is simulated using MATLAB 8.1 and for performance analysis results are obtained by averaging 1000 Monte-Carlo runs. The statistical spectrum occupancy model presented in [34] is employed to estimate the PU’s activity, which is varied in the range of 10–80%. The technique of [34], which estimates the utilization factor of PU, provides good accuracy (~91%) of spectrum prediction. The number of samples \( (N_{s} ) \) in a sensing interval, used in the simulation is 15,000 and smoothing factor is chosen is \( L = 5 \). The maximum allowable probability of false alarm and minimum allowable probability of detection is fixed at 0.1 and 0.9, respectively.

The variation of threshold value with SNR for proposed covariance-based adaptive threshold (CAT) scheme under different values of spectrum utilization factor \( (\alpha ) \) is shown in Fig. 2 for \( N_{s} = 10,000 \). From this figure, it is observed that the threshold varies with SNR to minimize the decision error probability whereas the threshold of existing CAV method is constant. Figure 2 is magnified into Fig. 3 to capture the variation of threshold at low SNR. It is noted that as the utilization ratio of PU increases, it requires smaller value of adaptive threshold to achieve the reliable spectrum detection, and vice versa. This is not possible in a fixed threshold-based scheme such as CAV method [18].

Fig. 2
figure 2

Threshold value \( (\gamma ) \) versus SNR with different spectrum utilization factor of PU

Fig. 3
figure 3

Magnified version of Fig. 2 at low SNR

The variation of the thresholds \( \gamma_{f}^{*} ,\gamma_{d}^{*} \) and \( \gamma_{e} \) with SNR is shown in Fig. 4 for \( N_{s} = 25,000 \). From this figure, it is observed that the value of threshold \( \gamma_{e} \), in covariance-based adaptive threshold (CAT) method, varies with SNR to minimize the decision error probability in the same way as threshold in CDR based method \( (\gamma_{d}^{*} ) \) varies with SNR to satisfy the requirement of given probability of detection i.e.\( P_{d}^{th} = 0.9 \); whereas the threshold \( \gamma_{f}^{*} \) of existing CFAR-based scheme [18] is constant.

Fig. 4
figure 4

Threshold value \( (\gamma ) \) versus SNR

Figure 4 is magnified in Fig. 5 to clearly observe the variation of thresholds at low SNR. It is noted that the condition \( \gamma_{e} \in \left[ {\gamma_{f}^{*} ,\gamma_{d}^{*} } \right] \) is satisfied at \( \xi \ge - 14.5dB \) with sample size of 25,000. At \( \xi < - 19.5dB \) it is observed that \( \gamma_{d}^{*} < \gamma_{e} \), indicates that the optimal threshold does not exist. However, spectrum sensing can still be performed in reliable manner to minimize the error in spectrum sensing and achieve a given value of probability of detection if the number of samples is further increased either through re-sensing or by increasing the sampling frequency.

Fig. 5
figure 5

Magnified version of Fig. 3 at low SNR

Figure 6 shows the variation of threshold values with number of samples for CDR-based scheme and CAT-based proposed method at \( SNR = - 16dB \). The minimum number of samples required for reliable spectrum sensing may be obtained from the intersection of curves of CDR and CAT-based thresholds. For examples, the minimum number of samples required at \( SNR = - 16dB \) is 5500, as shown by Fig. 6. The variation of optimum number of samples required for reliable spectrum sensing with signal to noise ratio is shown in Fig. 7. It can be observed that as the SNR increases fewer samples can provide reliable spectrum sensing.

Fig. 6
figure 6

Threshold value \( (\gamma ) \) versus Number of samples

Fig. 7
figure 7

Required optimum no. of samples for reliable spectrum sensing \( (N_{s} ) \) versus Signal to noise ratio

Figure 8 shows the plot of probability of detection with SNR. From this figure, it is observed that proposed covariance-based adaptive threshold (CAT) scheme performs better than existing CAV method as well as ED-based schemes in absence of any noise uncertainty. The probability of detection is further improved when the threshold is selected in an intelligent manner by using the proposed CAT-IS scheme, especially at low SNR \( (\xi < - 14dB) \).

Fig. 8
figure 8

Probability of detection \( (P_{d} ) \) versus SNR

For example, the proposed CAT-IS technique achieves a value of \( P_{d} \) at SNR = −16.5 dB as 0.954 under the interweave paradigm. Whereas, CAT, CAV, 3EED and ED-based schemes achieve the \( P_{d} \) as 0.911, 0.809, 0.7154 and 0.688, respectively. In order to demonstrate the applicability of the proposed techniques under overlay approach the CAT-IS scheme is also implemented using this approach as a typical example. The CAT-IS technique performs better in overlay approach than interweave as in overlay approach PU shares the information about signal codebook and message with the SU [20,21,22]. This improves the accuracy of the parameters such as PU’s utilization factor and correlation factor of PU’s transmitted signal used in the proposed technique. A similar improvement in the performance of CAT scheme may also obtained under overlay approach of spectrum sharing.

In practice the estimated noise power may be different than the actual noise power, therefore some uncertainty is involved in the estimation of noise. If the estimated noise power is assumed to be \( \hat{\sigma }_{\eta }^{2} = \beta \sigma_{\eta }^{2} \), then the noise uncertainty factor [35, 36] is defined as:

$$ B = \hbox{max} \{ 10\log_{10} \beta \} dB $$
(33)

where, it is assumed that \( \beta \) is uniformly distributed in an interval of \( \left[ { - B,B} \right] \). In literature, it is assumed that the noise uncertainty factor of 1 dB to 2 dB is normally observed in practice.

For a noise uncertainty of 2 dB, the variation of \( P_{d} \) with SNR is plotted in Fig. 9. From this figure, it can be observed that at high SNR (SNR > −18 dB) the performance of ED-based method deteriorates most in comparison with other methods under noise uncertainty. However, at low SNR (SNR < −12 dB) the probability of detection remains almost constant \( \left( {P_{d} \approx 0.5} \right) \) for ED-based method. In the proposed CAT scheme, the adaptive nature of threshold significantly improves the performance of conventional covariance based (CAV) method especially at low SNR. The proposed CAT and CAT-IS both perform better than CAV and ED schemes at low SNR. When interweave approach is used the better performance of CAT-IS scheme is attributed to appropriate selection of number of samples. When overlay approach is used, the performance of CAT-IS significantly improves in case of noise uncertainty also.

Fig. 9
figure 9

Probability of detection (\( P_{d} \)) versus SNR, with 2 dB noise uncertainty

Figure 10 shows the variation of probability of error \( (P_{e} ) \) with SNR for noise uncertainty of 2 dB. This figure reveals that the performance of ED-based spectrum sensing schemes severely deteriorates under noise uncertainty. The CAT-IS scheme outperforms all other schemes. The best performance is observed when the overlay approach is used due to availability of accurate information about correlation factor and PU’s spectrum utilization ratio.

Fig. 10
figure 10

Probability of error (\( P_{e} \)) versus SNR, with noise uncertainty of 2 dB

In general, the proposed covariance based adaptive threshold spectrum sensing (CAT) scheme performs significantly better than the existing covariance-based method (CAV) at low SNR even under noise uncertainty, and its performance is much better than ED-based spectrum sensing. This is due to the ability of the proposed algorithm to effectively utilize the information available in terms of spectrum utilization ratio of PU and SNR. Also, the performance of CAT scheme is further improved in CAT-IS method, as threshold is chosen in an intelligent manner by appropriately selecting the number of samples.

As discussed in Sect. 4, the proposed method has similar computational complexity as that of [18]. This fact is also verified by the simulation time required for implementation of these two methods. For example, at \( SNR = - 16dB \) the simulation time required for proposed scheme is 38% lesser than that required by [18]. Whereas, at \( SNR = - 19dB \) the proposed method requires 29% more simulation time than that required by the CAV-based spectrum sensing scheme. It is therefore, expected that during the practical implementation also the delay incurred by the proposed method will be similar to that in case of [18]. Thus, it can be concluded that the improvement in the performance is achieved by the proposed method without any increase in computational complexity or delay.

6 Conclusion

In this paper, a scheme for spectrum sensing using an intelligent selection of threshold is presented. The selection process employs three different criteria, namely CFAR, CDR and overall probability of error. First, an adaptive threshold that minimizes the total decision error probability is derived. The closed form expression of the adaptive threshold is based on the statistical covariance matrix of the received signal and varies with spectrum utilization of PU and SNR. The proposed covariance based adaptive threshold (CAT) spectrum sensing scheme significantly improves the performance of existing covariance-based technique and effectively overcomes the problem of noise uncertainty of ED-based spectrum sensing scheme.

Second, to further improve the performance of the spectrum sensing technique, two other thresholds based on CFAR and CDR criteria are also included in the selection process along with the adaptive threshold. The resulting covariance based adaptive threshold with intelligent selection of threshold (CAT-IS) scheme effectively enhances the performance of CAT technique especially at low SNR and maintains the given probability of detection. The proposed spectrum sensing schemes have computational complexity similar to that of existing CAV method. The applicability of the proposed technique is demonstrated under both interweave and overlay approaches of spectrum sharing. Simulation results have shown that the CAT-IS scheme yields the maximum probability of detection and minimizes probability of overall decision error when compared with existing CAV, conventional ED, 3EED and CAT-based spectrum sensing methods.