Skip to main content

Spectrum sensing in cognitive radio networks: threshold optimization and analysis


Cognitive radio is a technology developed for the effective use of radio spectrum sources. The spectrum sensing function plays a key role in the performance of cognitive radio networks. In this study, a new threshold determination method based on online learning algorithm is proposed to increase the spectrum sensing performance of spectrum sensing methods and to minimize the total error probability. The online learning algorithm looks for the optimum decision threshold, which is the most important parameter to decide the presence or absence of the primary user, using historical detection data. Energy detection- and matched filter-based spectrum sensing methods are discussed in detail. The performance of the proposed algorithm was tested over non-fading and different fading channels for low signal-to-noise ratio regime with noise uncertainty. In the conclusion of the simulation studies, improvement in spectrum sensing performance according to optimal threshold selection was observed.


Wireless communication systems are undergoing rapid development to meet the changing demands and needs of people. The increase in wireless applications and services made it essential to address the spectrum scarcity problem. Measurements made by the Federal Communications Commission (FCC) of the United States telecommunications authority have shown that licensed bands are not used at a rate of up to 90%. The results of the measurement were published by the FCC Spectrum Policy Task Force group in the report entitled “FCC Report of the Spectrum Efficiency Working Group” [1]. In recent years, a lot of research has been done on the effective use of these spectrum bands which are either empty or are not used at full capacities. One of the notable concepts in the researches is the cognitive radio concept, introduced by Mitola in 1999 [2]. CR is a software-based technology that detects the electromagnetic environment in which it operates, detects unused frequency bands, and adapts the radio working parameters to broadcast in these bands [3]. CR is a key technology that enables the limited and inefficiently used frequency bands to be used more efficiently with an opportunistic approach. Communication performance and continuity in cognitive radio networks are highly dependent on whether the spectrum sensing function is performed correctly.

Spectrum sensing is a critical issue of cognitive radio technology because of the shadowing, fading, and time-varying natures of wireless channels. To sense limited or unused frequency bands, different methods for spectrum sensing have been proposed in the literature like matched filtering [4, 5], cyclostationary-based sensing [6,7,8], waveform-based sensing [9], wavelet-based sensing [10], eigenvalue-based sensing [11, 12], and energy detection sensing [13,14,15]. Matched filtering detection methods with shorter detection periods are preferred if certain signal information is known, such as bandwidth, operating frequency, modulation type and grade, pulse shape, and frame structure of the primary user [16, 17]. The detection performance of this method largely depends on the channel response. To overcome this, it requires perfect timing and synchronization in both physical and medium access control layers. This situation increases the complexity of calculation. Cyclostationary detection is a method for detecting primary user transmissions by exploiting the cyclostationarity features of the received signals [18,19,20]. It exploits the periodicity in the received primary signal to identify the presence of primary users. In this way, the detector can distinguish primary user signals, secondary user signals or interference. However, the performance of this detection method depends on a sufficient number of samples, which increases the computational complexity. Waveform-based sensing is only applicable to systems with known signal patterns. Such patterns include preambles, midambles, regularly transmitted pilot patterns, and spreading sequences [21]. A preamble is a known sequence transmitted before each burst and a midamble is transmitted in the middle of a burst or slot. In the case of a known model, the spectrum detection function is performed by associating the received signal with a copy of itself. Wavelet transform is a powerful method for analyzing singularities and edges. In the wavelet-based spectrum sensing method, the frequency bands of interest are usually decomposed as a train of consecutive frequency subbands [22]. By using wavelet transform, irregularities in these bands are detected and the spectrum is decided whether it is full or empty. Eigenvalue-based spectrum sensing does not require much prior knowledge about the primary user signals and noise power [23,24,25]. The concept of this detection technique is presented in 2007 [26]. In the eigenvalue-based spectrum sensing methods, the decision threshold has been obtained based on random matrix theory to make a hypothesis testing. In order to determine the presence or absence of the primary user signal, the decision threshold is compared with the test statistic formed using the ratio of the maximum or average eigenvalue to the minimum eigenvalue. Nevertheless, having a high operational complexity is a disadvantage of this method. Similarly, if the information of the primary users is not known precisely, energy detection-based methods with low mathematical and hardware complexities are preferred [27, 28].

Energy detection is a spectrum sensing technique based on measuring the received signal energy and deciding on the presence or absence of the primary user by comparing the received energy level with a threshold. The threshold function calculation depends on noise power. Numerous studies have been carried out in the literature to obtain the optimal threshold expression and to improve spectrum sensing performance [29,30,31,32,33,34]. In [29], the authors proposed a new method for adaptive threshold selection in multiband detection. Estimating the threshold is performed by using the functions of the first and second statistics of the received signal. In [30], the Wigner–Ville distribution is used to improve detection performance at a low SNR. In this case, a better decision threshold is defined by reducing the effects of the cross-correlation terms. In [31], using Gauss–Hettite integration, analytical expressions of detection, and mean-field probabilities on compound Nakagami-m and log-normal fading channels were obtained, and detection performance was investigated. Also, an optimized threshold expression was obtained to increase spectrum sensing performance. In [32], an energy detector, using an adaptive dual threshold, is proposed for solving the detection problem. In [33], the authors proposed an adaptive threshold detection algorithm based on an image binarization technique. Here, the dynamic threshold is estimated based on previous repetition decision statistics, parameters such as SNR, number of instances, and detection probabilities. In [34], a dynamic threshold detection scheme was proposed depending on the noise level present in the received signal. For the measurement of the noise level, a blind technique based was used on the sample covariance matrix values of the received signal.

The energy detection method is widely used for its simplicity in calculation and ease of application. However, the spectrum sensing performance of the energy detector is severely affected by destructive channel effects such as shadowing and fading, and noise. To minimize the negative effects caused by noise uncertainty and communication channel, the cooperative spectrum sensing model is defined in the literature [35, 36]. In [35], the researchers proposed a fuzzy logic-based perception format for collaborative energy detection, based on the new reliability factors for local spectrum sensing. The fuzzy logic process consists of three stages. These are the ordering of blurring, the run-in motor, and the clearing phase. The performance of the nodes is compared with the performance of the other nodes to try to make the most accurate predictions. When these processes are performed, the reliability factor is defined by using the SNR, detection differences, and threshold, and the detection performance is measured. In [36], energy detector parameters are optimized for the best detection performance. Simulation studies have been carried out on fading channels about the optimal threshold, several cognitive radio users, and the number of antennas.

In recent years, hybrid models in which two or more detection schemes are used together have been developed to improve spectrum sensing performance in a cognitive radio network. Artificial intelligence and machine learning algorithms (MLA) are widely used in hybrid models [37,38,39,40]. In [37], a learning algorithm based on artificial neural networks (ANN) is used to detect the presence/absence of primary users in a cognitive radio environment. In [38], the authors proposed a collaborative spectrum sensing (CSS) scheme based on machine learning techniques. Supervised [e.g., support vector machine (SVM) and weighted K-nearest neighbor (KNN)], and unsupervised [e.g., K-means clustering and Gaussian mixture model (GMM)] classification techniques are used for CSS. In [39], the authors proposed a sensing method based on machine learning for solving the spectrum sensing problem. This method is dependent on signal characteristics and the clustering algorithm that is used for classification. The received signals are classified by using the k-means clustering algorithm. Class parameters, eigenvalues, and covariance were determined, and the performance of the proposed algorithm was investigated. Using the MLA, it is stated that the error probability decreased and the detection performance increased. In [40], the researchers proposed a new decision threshold model based on an online learning algorithm to increase the probability of detection and decrease the probability of total detection.

In this paper, we proposed a new threshold expression based on online learning algorithm to overcome the spectrum sensing problem and improve detection accuracy. Statistical error analysis was performed by using data on detection, miss detection, and false alarm parameters used in spectrum sensing performance measurement. The proposed new method consists of two stages. In the first stage, a hypothesis test is created and analyzed depending on the noise threshold. In the second stage, the threshold expression that minimizes the total error probability with the help of an online learning algorithm is redefined. The detection performance of the proposed method was investigated on AWGN, Rayleigh, Rician, Nakagami-m, and Weibull fading channels and presented comparatively with the traditional method suggested in the literature.

The rest of this paper is organized as follows: Sect. 2 considers the theoretical aspects of energy-based spectrum sensing. Optimal thresholds are presented with a sufficient optimality condition in Sect. 2.2. In Sect. 3, the optimal threshold expression is redefined and formulated by using the proposed online learning algorithm. Simulation results are discussed in Sect. 4, and finally, the paper is concluded in Sect. 5.

Related work

System model

Spectrum sensing is one of the most important components of cognitive radio networks. Spectrum sensing enables a cognitive radio to have information about its environment and spectrum availability. The most widely used spectrum sensing methods are energy detection and matched filter detection.

Energy detection

Energy detection is the most widely used method since it has low complexity and it does not require prior information about of the primary signals. In the energy detection process, the spectrum occupancy decision is based only on the threshold obtained depending on the noise. The threshold is compared with the perceived energy, and it is decided whether the primary user is present or not. It aims essentially to decide between two states: primary user signal is absent, denoted by \(H_{0}\), or primary user signal is present, denoted by \(H_{1}\). The decision of energy detector is the test of the following hypothesis:

$$\begin{array}{*{20}l} {H_{0} :Y\left( n \right) = W\left( n \right), } \hfill & {{\text{:Primary}}\;{\text{ user }}\;{\text{absent}}} \hfill \\ {H_{1} :Y\left( n \right) = S\left( n \right) + W\left( n \right), } \hfill & {{\text{:Primary}}\;{\text{ user }}\;{\text{present}}} \hfill \\ \end{array}$$

where \(Y\left( n \right)\) is the signal received by the secondary user, \(S\left( n \right)\) is the primary user’s transmitted signal, and \(W\left( n \right)\) is the additive white Gaussian noise (AWGN) with zero mean. Figure 1 shows the basic block diagram of the energy detection.

Fig. 1
figure 1

Block diagram of energy detector

In an energy detector, the received signal is first pre-filtered by an ideal band pass filter which has bandwidth “W.” The filtered signal is then passed through A/D converter. Output of the A/D converter is then squared and integrated over a predefined time interval. The resultant signal is used to formulate a test statistic. The test statistic can be formulated as shown in Eq. 2.

$$T = \mathop \sum \limits_{n = 0}^{N} \left| {Y\left( n \right)} \right|^{2}$$

where \(n = 0,1,2,3, \ldots ,N\), which represents the number of samples (detection period). If \(N\) sample numbers are sufficient, the T statistic distribution, according to the central limit theorem, is Gaussian distribution [41]. The binary hypothesis test is redefined as follows:

$$\begin{array}{*{20}l} {H_{0} : } \hfill & { T\sim {\text{Normal}}\left( {N\sigma_{n}^{2} + N2\sigma_{s}^{4} } \right)} \hfill \\ {H_{1} :} \hfill & {T\sim {\text{Normal}}\left( {\left( {\sigma_{n}^{2} + \sigma_{s}^{2} } \right),2N\left( {\sigma_{n}^{2} + \sigma_{s}^{2} } \right)^{2} } \right) } \hfill \\ \end{array}$$

where \(\sigma_{n}^{2}\) and \(\sigma_{s}^{2}\) are the noise variance and signal variance, respectively.

The test statistic (\(T)\) is compared with the threshold (\(\lambda )\) to make the final decision on whether the primary signal is present or not. The performance of the energy detector is characterized by using three parameters presented based on test statistics under the binary hypothesis. According to [42], the probabilities of detection \(P_{d}\), false alarm \(P_{fa}\), and miss detection (\(P_{m} = 1 - P_{d} )\) are given by,

$$P_{d} = P\left( {T > \lambda /H_{1} } \right) = Q\left( {\frac{{\lambda - N\left( {\sigma_{n}^{2} + \sigma_{s}^{2} } \right)}}{{\sqrt {2N\left( {\sigma_{n}^{2} + \sigma_{s}^{2} } \right)^{2} } }}} \right)$$
$$P_{fa} = P\left( {T > \lambda /H_{0} } \right) = Q\left( {\frac{{\lambda - N\sigma_{n}^{2} }}{{\sqrt {2N\sigma_{n}^{4} } }}} \right)$$

where \(Q\left( . \right)\) is the complementary distribution function of standard Gaussian. Q-function \(Q\left( x \right)\) is expressed as follows:

$$Q\left( x \right) = \frac{1}{{\sqrt {2\pi } }}\mathop \smallint \limits_{x}^{\infty } \exp \left( { - \frac{{y^{2} }}{2}} \right)dy.$$

Matched filter detection

Matching filter technique is widely used in spectrum sensing as it is a good filtering technique that maximizes the SNR. When an unknown signal matched the known signal, it is assumed that PU is present in the spectrum. The whole process of the matched filter is shown in Fig. 2 [43].

Fig. 2
figure 2

Block diagram of matched filter detection

The operation of matched filter detection is expressed as:

$$y\left( n \right) = \mathop \sum \limits_{l = - \infty }^{\infty } h\left( {n - l} \right)s\left( l \right)$$

where \(y\left( n \right)\) is the received signal, \(s\left( l \right)\) is the unknown signal, and \(h\left( {n - l} \right)\) is the impulse response of the matched filter which matches with the known signal for maximizing the output SNR. \(P_{d}\) and \(P_{fa}\) can be given in Eqs. (8) and (9) which depend upon threshold [44].

$$P_{d} = Q\left( {\frac{\lambda - E}{{\sqrt {E\sigma_{n}^{2} } }}} \right)$$
$$P_{fa} = Q\left( {\frac{\lambda }{{\sqrt {E\sigma_{n}^{2} } }}} \right)$$

where \(E\) is the PU signal energy. The detection threshold is given in Eq. 10 as a function of PU signal energy and noise variance.

$$\lambda = Q^{ - 1} \left( {P_{fa} } \right)\sqrt {E\sigma_{n}^{2} }.$$

Threshold detection model

The performance of energy sensing-based methods is largely dependent on the previously defined threshold expression [45, 46]. A threshold is required to decide whether the target signal is absent or present. This threshold determines all spectrum sensing performance metrics. The sensing performance of the energy detector is measured according to two metrics. The performance metrics \(P_{d}\) and \(P_{fa}\) over AWGN channels can be defined as [47, 48]:

$$P_{d} = \frac{1}{2}erfc\frac{{\lambda - \mu_{1} }}{{\sqrt 2 \sigma_{1} }}$$
$$P_{fa} = \frac{1}{2}erfc\frac{{\lambda - \mu_{0} }}{{\sqrt 2 \sigma_{0} }}$$

where erfc is the complementary error function. It then follows that the mean and the variance of the test statistic could be represented as shown in Eqs. 13 to 16.

$$\mu_{0} = N\sigma_{n}$$
$$\mu_{1} = N\sigma_{n}^{2} \left( {\gamma + 1} \right)^{2}$$
$$\sigma_{0}^{2} = 2N\sigma_{n}^{4}$$
$$\sigma_{1}^{2} = 2N\sigma_{n}^{4} \left( {\gamma + 1} \right)^{2}.$$

The probability of miss detection would be given as,

$$P_{m} = 1 - P_{d}.$$

The balance between \(P_{fa}\) and \(P_{m}\) should be considered when determining the threshold for the energy detector. \(P_{d}\) should be maximized, while \(P_{fa}\) should be minimized. This is called the constant false alarm rate (CFAR) detection scheme. \(P_{m}\) can be set to a minimum value, or \(P_{fa}\) can be reduced to a minimum by fixing \(P_{d}\) to a maximum value. In practice, the threshold is normally chosen to meet a certain \(P_{fa}\), in situations where only the noise power needs to be known. Depending on the balance between \(P_{d}\) and \(P_{fa}\), \(\lambda\) for a certain \(P_{fa}\) value is derived as:

$$\lambda = Q^{ - 1} \left( {P_{fa} } \right)\sqrt {2N} + \left( N \right)\sigma_{n} { }$$

where \(Q^{ - 1} \left( . \right)\) is the inverse function of \(Q\left( . \right)\).

Due to this threshold at low SNR, the detection performance is greatly reduced. What is important here is to improve the low SNR perception performance. For this reason, the optimal threshold expression is defined by using the total error probability,\(P_{e}\), which is dependent on \(P_{fa}\) and \(P_{m} .\) The total error probability is the sum of \(P_{fa}\) and \(P_{m}\) weights. \(P_{e}\) can be given as

$$P_{e} = PH_{0} P_{fa} + PH_{1} P_{m}$$

where \(PH_{1}\) and \(PH_{0}\) represent the probabilities of primary user presence and absence, respectively. The minimization problem can be represented as

$$\lambda = {\text{argmin}}_{\lambda } \left( {PH_{0} P_{fa} + PH_{1} P_{m} } \right).$$

The threshold can be obtained by satisfying the following conditions [46]:

$$\frac{{\partial P_{fa} }}{\partial \lambda } + \frac{{\partial P_{m} }}{\partial \lambda } = 0$$
$$\frac{{\partial^{2} P_{e} }}{{\partial \lambda^{2} }} < 0.$$

From Eqs. (12, 17) on differentiating \(P_{fa}\) and \(P_{m}\) are given as follows:

$$\frac{{\partial P_{fa} }}{\partial \lambda } = - \frac{1}{{\sqrt {2\pi } \sigma_{0} }}e^{{ - \left( {\frac{{\left( {\lambda - {\upmu }_{0} } \right)^{2} }}{{\sqrt 2 \sigma_{0} }}} \right)}}$$
$$\frac{{\partial P_{m} }}{\partial \lambda } = - \frac{1}{{\sqrt {2\pi } \sigma_{1} }}e^{{ - \left( {\frac{{\left( {\lambda - {\upmu }_{1} } \right)^{2} }}{{\sqrt 2 \sigma_{1} }}} \right)}}.$$

Using Eqs. 21, 22, 23, and 24, the threshold expression is redefined as follows:

$$\lambda = \frac{{ - b + \sqrt {b^{2} - ac} }}{a}$$


$$a = \sigma_{1}^{2} - \sigma_{0}^{2}$$
$$b = \sigma_{0}^{2} \mu_{1} - \sigma_{1}^{2} \mu_{0}$$
$$c = \sigma_{1}^{2} \mu_{0} - \sigma_{0}^{2} \mu_{1} - \frac{{2\sigma_{1}^{2} \sigma_{0}^{2} }}{{\ln \left( {\frac{{\sigma_{1} }}{{\sigma_{0} }}} \right)}}.$$

Proposed adaptive threshold optimization model

In cognitive radio systems, the detection performance of the energy detector depends on the high accuracy selection of the threshold expression. When developing spectrum sensing models, it is aimed that the noise and primary user signals are fully distinguished. Developed models are generally evaluated based on parameters such as accuracy and correct positive rate. However, the actual performance can be analyzed by using backwardly artificially generated estimates in the measurements. In this section, a new threshold expression model based on online learning algorithm is presented to improve spectrum sensing performance in cognitive radio networks.

The fundamental nature of spectrum sensing is a defined binary hypothesis testing problem that depends on the threshold expression. This relationship is illustrated in Fig. 3. This shows the expected distribution of a difference between two groups under \(H_{0}\) [true negative (TN)] and \(H_{1}\) [true positive (TP)]. It is clear that if we increase the type I error rate [false positive (FP) or false alarm], we reduce the type II error rate [false negative (FN) or missed detection], and vice versa. Changes in the accuracy of \(H_{0}\) and \(H_{1}\) hypotheses cause changes in the total error probability. Therefore, there is a very delicate balance between the possibility of miss detection and the possibility of false detection. To maintain and analyze the balance between these two, two classes are created by classifying the negative and positive data as shown in Fig. 3. Critical thresholds are determined for these classes, creating a gray area. Then, with the help of an online learning algorithm, the steps to be applied to obtain the most appropriate threshold in the gray area are given as follows:

Fig. 3
figure 3

Statistical distribution curves related to classes

Stage 1: data collection and pre-processing

The Gauss distribution curves of \(H_{1}\) (signal present) and \(H_{0}\) (signal absent) are obtained by using the threshold expression in Eq. 25. Two classes are constructed by classifying the negative and positive data, as shown in Fig. 3. Type I and II error parameters and correct perception parameters are analyzed. Critical thresholds are determined for these classes, creating a gray area.

  1. 1

    Each \(\left( {N_{i} , P_{i} } \right)\) value is determined, and classes are created.

  2. 2

    Critical thresholds expressions of the two classes are defined (\(\lambda_{N} ,\lambda_{P} ).\)

  3. 3

    Subclasses are created within the remaining gray area between two thresholds \(\left( {X_{1,2,} , \ldots ,X_{n} } \right).\).

The data in the gray area, defined as R in Fig. 3, were subclassified using the k-mean algorithm (k = 4). The classes created are graded according to their performance levels, considering type I and II errors.

Stage 2: computation on the dataset

Error analysis is performed to further increase the success level of successful classes with the help of the data obtained during data collection and pre-processing. As a result of the analysis, weight, error, and improvement coefficients are defined as follows:

  1. 1

    Weights are defined for each subclass. \(\left( {w_{t} } \right)\).

  2. 2

    Averages of weights are found. It is expressed as shown in Eq. 29;

    $$w_{t} = \frac{{w_{t,i} }}{{\mathop \sum \limits_{i = 0}^{N} w_{t,i} }}.$$
  3. 3

    The data are classified and the total error rate is obtained. It can be represented as shown in Eqs. 30 and 31.

    $$E_{T} = \varepsilon_{t} = \min \mathop \sum \limits_{i = 0}^{N} w_{t} c_{i}$$
    $$c_{i} = \left\{ {\begin{array}{*{20}c} {0,} & {h_{t} \left( {H_{i} ,X_{i} ,Y_{i} ,P_{i} } \right) = y_{i} } \\ {1,} & {h_{t} \left( {H_{i} ,X_{i} ,Y_{i} ,P_{i} } \right) \ne y_{i} } \\ \end{array} } \right..$$
  4. 4

    Incorrect positive error (H1/incorrect detection) is expressed in Eq. 32 as follows:

    $$E_{FP} = \mathop \sum \limits_{i = 0}^{p} w_{t,i} c_{i}.$$
  5. 5

    Incorrect negative error (H0/incorrect detection) is expressed in 33.

    $$E_{FN} = \mathop \sum \limits_{i = 0}^{N} w_{t,i} c_{i}.$$
  6. 6

    Classification probabilities and ratios can be formulated as follows, respectively:

    $$P_{{{\text{FP}}}} = \frac{{E_{{{\text{FP}}}} }}{{E_{{\text{T}}} }}$$
    $$P_{{{\text{FN}}}} = \frac{{E_{{{\text{FN}}}} }}{{E_{{\text{T}}} }}$$
    $${\text{TPR}} = \frac{{{\text{TP}}}}{{{\text{TP}} + {\text{FN}}}}$$
    $${\text{TNR}} = \frac{{{\text{TN}}}}{{{\text{TN}} + {\text{FP}}}}.$$
  7. 7

    Mathews correlation coefficient can be represented as shown in Eq. 38.

    $${\text{MCC}} = \frac{{{\text{TP}}*{\text{TN}} - {\text{FP}}*{\text{FN}}}}{{\sqrt {\left( {{\text{TP}} + {\text{FP}}} \right)\left( {{\text{TP}} + {\text{FN}}} \right)\left( {{\text{TN}} + {\text{FP}}} \right)\left( {{\text{TN}} + {\text{FN}}} \right)} }}.$$
  8. 8

    Improvement coefficient (\(p_{i}\)) can be formulated by Eq. 39 as follows:

    $$p_{i} = \left[ {\log \left( {\frac{{1 - \varepsilon_{t} }}{{\varepsilon_{t} }}} \right)} \right]\left( {\frac{{1 - P_{{{\text{FN}}}} }}{{P_{{{\text{FP}}}} }}} \right)*{\text{MCC}}.$$

Stage 3: training phase

We are provided with a training dataset \(\left( {X_{i} , Y_{i} } \right),\) \(i = 1,2,3, \ldots ,N\) where \(X_{i}\) represents an n-dimensional continuous-valued vector and \(Y_{i}\) {0,1} represents the corresponding class label with “0” for normal and “1” for an anomaly. The proposed method has two steps: (1) training and (2) testing. During training, the k-means-based anomaly detection method is first applied to partition the training space into k disjoint clusters \(C_{1} ,C_{2} ,C_{3} , \ldots ,C_{N}\). Then, the decision tree is trained with the instances in each k-means cluster. The k-means method ensures that each training instance is associated with only one cluster. However, if there are any subgroups or overlaps within a cluster, the decision tree trained on that cluster refines the decision boundaries by partitioning the instances with a set of if–then rules over the feature space. In the testing phase, we have two subdivided phases: (1) the selection phase and (2) the classification phase. In the selection phase, the Euclidean distance is calculated for each test sample and the closest cluster is found. The decision tree for the closest cluster is calculated. In the classification phase, the data are separated according to the detection successes. Finally, in this phase, the threshold will learn from the best learner in class. Learner modification is expressed as,

$$\lambda_{i}^{{{\text{new}}}} = \lambda + p_{i} \left[ {\frac{{\min \left( {{\text{energy}}_{i} } \right) + \max \left( {{\text{energy}}_{i} } \right)}}{2}} \right].$$

Stage 4: learner phase

In this phase, by comparing the advantages and disadvantages between the other two learners, the learners \(\lambda_{i}^{{{\text{new}}}}\) will learn from their advantages which draw on the idea of the differential evolution algorithm. Randomly select two learners \(\lambda_{i}\) and \(\lambda_{j}\), where \(i \ne j\). Learner modification is expressed as

$$\lambda_{i}^{{{\text{new}}}} = \lambda_{i}^{{{\text{old}}}} + {\text{rand}}\left( a \right)*\left( {\lambda_{i} - \lambda_{j} } \right)\quad {\text{if}}\;P_{i} > P_{j}$$
$$\lambda_{i}^{{{\text{new}}}} = \lambda_{i}^{{{\text{old}}}} + {\text{rand}}\left( a \right)*\left( {\lambda_{j} - \lambda_{i} } \right)\quad {\text{if}}\;P_{i} < P_{j }$$

where \({\text{rand}}\left( a \right)\) is a uniformly distributed random number between “0” and “1.” Accept \(\lambda_{i}^{{{\text{new}}}}\) if it gives an optimum threshold.

Simulation results

In this section, numerical results are presented to verify the effectiveness of our proposed algorithm. Spectrum sensing performance can be characterized by using the receiver operating characteristic (ROC) curve in cognitive radio networks. ROC curves are generated by plotting either detection probability versus false alarm probability or missed detection probability versus false alarm probability. Detection probability and false alarm probability depend on the threshold, number of samples, fading parameters, number of diversity branches, and average SNR. The sensing performance of the proposed algorithm has been analyzed on different fading channels using energy-based detection and matched filter detection techniques. In Figs. 4, 5, 6, 7, 8, 9, 10, 11, 12, and 13, simulation results are provided to compare our (an online learning algorithm) threshold selection with a conventional (dynamic) threshold selection (calculated from \(P_{fa}\) = 0.1).

Fig. 4
figure 4

ROC (\(P_{d}\) vs \(P_{fa}\)) of energy detector sensing under AWGN channel

Fig. 5
figure 5

ROC (\(P_{d}\) vs \(P_{fa}\)) of Energy detector sensing under Rayleigh fading channel

Fig. 6
figure 6

ROC (\(P_{d}\) vs \(P_{fa}\)) of energy detector sensing under Nakagami-m fading channel (m = 3)

Fig. 7
figure 7

ROC (\(P_{d}\) vs \(P_{fa}\)) of energy detector sensing under Rician fading channel (K = 5)

Fig. 8
figure 8

ROC (\(P_{d}\) vs \(P_{fa}\)) of energy detector sensing under Weibull fading channel (a = 3)

Fig. 9
figure 9

ROC (\(P_{d}\) vs \(P_{fa}\)) of matched filter detection sensing under AWGN channel

Fig. 10
figure 10

ROC (\(P_{d}\) vs \(P_{fa}\)) of Matched filter detection sensing under Rayleigh fading channel

Fig. 11
figure 11

ROC (\(P_{d}\) vs \(P_{fa}\)) of matched filter detection sensing under Nakagami-m fading channel (m = 3)

Fig. 12
figure 12

ROC (\(P_{d}\) vs \(P_{fa}\)) of matched filter detection sensing under Rician fading channel (K = 5)

Fig. 13
figure 13

ROC (\(P_{d}\) vs \(P_{fa}\)) of matched filter detection sensing under Weibull fading channel (a = 3)

Because the performance of energy-based technique mainly depends on SNR, two different SNR values (-5 and -10 dB) are considered. Figure 4 shows the ROC curve for the AWGN channel. As can be seen, the performance of the proposed algorithm for different SNR scenarios is higher than those of conventional algorithm: dynamic threshold (-5 dB): \(P_{d}\) = 0.6371; online learning threshold (-5 dB): \(P_{d}\) = 0.6509; dynamic threshold (-10 dB): \(P_{d}\) = 0.3915; online learning threshold (-10 dB): \(P_{d}\) = 0.4025. Figures 5, 6, 7, and 8 illustrate the ROC curves for Rayleigh, Nakagami-m, Rician, and Weibull channels, respectively. When the graphs are examined, it is seen that the detection performance of cognitive radio increases with the proposed method. Besides, detection probability is less in Rayleigh fading channel when compared to the AWGN channel and other fading channels. This situation is shown in Fig. 5. In Fig. 7, we can see that the performance of the energy detector in the Rician fading channel is better than in the other channels (Rician factor K = 5).

Figure 8 shows that, for energy detection in the Weibull fading channels, ROC curves move to the upper left corner with the proposed method, confirming better overall detection performance.

In Figs. 9, 10, 11, 12, and 13, the evaluation of the performance of the matched filter detection technique is carried out by plotting Pd versus Pfa and ROC curves for the AWGN, Rayleigh, Nakagami-m, Rician, and Weibull channels conditions. Figure 9 shows the comparison of the performance of the proposed scheme and the dynamic threshold selection method and verifies the accuracy of the theoretical expressions for the matched filter technique over a non-fading AWGN channel.

Figure 10 shows the ROC curve in the Rayleigh fading channel. It is observed that when compared to AWGN, Rayleigh fading has less detection probability due to fading. Spectrum sensing performance is dependent on SNR. As the SNR increases, the probability of detection is improved.

Figures 11, 12, and 13 show the ROC curves over Nakagami-m, Rician, and Weibull fading channels, respectively.

When comparing the detection probability of all these fading channels (AWGN, Rayleigh, Nakagami-m, Rician and Weibull), it is clear that the Rician fading channel has the best detection performance. It is also seen that the performance of the matched filter detector is affected by the average SNR values.

It is clearly seen that the detection performance of the online learning algorithm-based decision threshold method and the detection performance of the dynamic decision threshold determination method are better for different SNR values on different fading channels. This is because conventional methods offer a strict threshold model. The proposed method in this study has made the threshold expression flexible. Furthermore, with the proposed online learning algorithm-based threshold expression model, the spectrum sensing performance of cognitive radio networks has been made more sensitive to changes in communication channels.


In this study, a new threshold expression model based on online learning algorithm is presented to increase spectrum sensing accuracy in cognitive radio networks. Detection, false detection, and false alarm probabilities have been comprehensively analyzed statistically, and the optimum decision threshold expression has been redefined to minimize the possibility of decision error. Numerical results obtained from simulations on AWGN and different fading channels (Rayleigh, Nakagami-m, Rician, and Weibull) are presented to show the performance of the proposed algorithm and compare it with the dynamic decision threshold determination method. The proposed sensing scheme has significantly improved the detection performance of the energy detection- and matched filter-based spectrum sensing under low SNR conditions.

In future studies, we aim to apply and verify the performance of the proposed algorithm on different spectrum sensing methods. Also, we will focus on the optimization of some expressions used in the algorithm to reduce mathematical complexity and improve detection time.

Availability of data and materials

The datasets used and/or analyzed during the current study are available from the corresponding author on reasonable request.



Analog-to-digital converter


Artificial neural networks


Additive white Gaussian noise


Band pass filter


Constant false alarm rate


Cognitive radio


Collaborative spectrum sensing


Federal communications commission


False negative


False positive


K-nearest neighbor


Machine learning algorithms


Receiver operating characteristic


Signal-to-noise ratio


Support vector machine


True negative


True positive


  1. FCC, Federal Communications Commission Spectrum Policy Task Force, Report of the Spectrum Efficiency Working Group. Technical report. USA (2002)

  2. J. Mitola, G.A. Maguire, Cognitive radio: making software radios more personal. IEEE Pers. Commun. Mag. 6(4), 13–18 (1999).

    Article  Google Scholar 

  3. J. Mitola, Cognitive Radio: An integrated agent architecture for software-defined radio. Ph.D. dissertation, KTH Royal Institute of Technology, (Swedan, 2000)

  4. J. Proakis, M. Salehi, Digital Communications, 5th edn. (McGraw-Hill, Boston, 2007).

    Google Scholar 

  5. R. Tandra, A. Sahai, Fundamental limits on detection in low SNR under noise uncertainty, in 2005 International Conference on Wireless Networks, Communications and Mobile Computing (13–16 June 2005), pp. 464–469.

  6. P. Urriza, E. Rebeiz, D. Cabric, Multiple antenna cyclostationary spectrum sensing based on the cyclic correlation significance test. IEEE J. Sel. Areas Commun. 31(11), 2185–2195 (2013).

    Article  MATH  Google Scholar 

  7. H. Sadeghi, P. Azmi, H. Arezumand, Cyclostationarity-based soft cooperative spectrum sensing for cognitive radio networks. IET Commun. 6(1), 29–38 (2012).

    MathSciNet  Article  MATH  Google Scholar 

  8. Y. Li, S. Jayaweera, Dynamic spectrum tracking using energy and cyclostationarity-based multi-variate non-parametric quickest detection for cognitive radios. IEEE Trans. Wirel. Commun. 12(7), 3522–3532 (2013).

    Article  Google Scholar 

  9. M. Iqbal, A. Ghafoor, Analysis of multiband joint detection framework for waveform-based sensing in cognitive radios, in 2012 IEEE Vehicular Technology Conference (VTC Fall) (3–6 September 2012), pp. 1–5.

  10. S.V.R.K. Rao, G. Singh, Wavelet-based spectrum sensing techniques in cognitive radio. Procedia Eng. (2012).

    Article  Google Scholar 

  11. Y. Zeng, C. Koh, Y.-C. Liang, Maximum eigenvalue detection: theory and application, in IEEE International Conference on Communications, ICC ’08 (19–23 May 2008), pp. 4160–4164.

  12. N. Pillay, H. Xu, Blind eigenvalue-based spectrum sensing for cognitive radio networks. IET Commun. 6(11), 1388–1396 (2012).

    MathSciNet  Article  MATH  Google Scholar 

  13. K. Ruttik, K. Koufos, R. Jantti, Detection of unknown signals in a fading environment. IEEE Commun. Lett. 13(7), 498–500 (2009).

    Article  MATH  Google Scholar 

  14. S. Herath, N. Rajatheva, C. Tellambura, Energy detection of unknown signals in fading and diversity reception. IEEE Trans. Commun. 59(9), 2443–2453 (2011).

    Article  Google Scholar 

  15. L. Lu, X. Zhou, U. Onunkwo, G. Li, Ten years of research in spectrum sensing and sharing in cognitive radio. EURASIP J. Wirel. Commun. Netw. 1–16, 28 (2012).

    Article  Google Scholar 

  16. L. Ma, Y. Li, A. Demir, Matched filtering assisted energy detection for sensing weak primary user signals, in IEEE International Conference on Acoustics, Speech, and Signal Processing(ICASSP), 25–30 March 2012, pp. 3149–3152.

  17. X. Zhang, R. Chai, F. Gao, Matched filter based spectrum sensing and power level detection for cognitive radio network, in IEEE Global Conference on Signal and Information Processing (Global SIP), Atlanta, 3–5 December 2014, pp. 1267–1270.

  18. W.A. Gardner, Exploitation of spectral redundancy in cyclostationary signals. IEEE Signal Process. Mag. 8(2), 14–36 (1991).

    Article  Google Scholar 

  19. M. Öner, F. Jondral, Air interface recognition for a software radio system exploiting cyclostationarity, in 2004 IEEE 15th International Symposium on Personal, Indoor and Mobile Radio Communications (IEEE Cat. No. 04TH8754), 5–8 September 2004, pp. 1947–1951.

  20. T.E. Bogale, L. Vandendorpe, Multi-cycle cyclostationary based spectrum sensing algorithm for OFDM signals with noise uncertainty in cognitive radio networks, in 2012 IEEE Military Communications Conference (MILCOM 2012), Orlando, FL, USA, 29 October–01 November 2012, pp. 1–6.

  21. T. Yucek, H. Arslan, A survey of spectrum sensing algorithms for cognitive radio applications. IEEE Commun. Surv. Tutor. 11(1), 116–130 (2009)

    Article  Google Scholar 

  22. T. Zhi, G. Giannakis, A wavelet approach to wideband spectrum sensing for cognitive radios, in 2006 1st International Conference on Cognitive Radio Oriented Wireless Networks and Communications, 8–10 June 2006, pp. 1–5.

  23. C.G. Tsinos, K. Berberidis, Decentralized adaptive eigenvalue-based spectrum sensing for multiantenna cognitive radio systems. IEEE Trans. Wirel. Commun. 14(3), 1703–1715 (2015).

    Article  Google Scholar 

  24. Y. Zeng, Y.-C. Liang, Eigenvalue-based spectrum sensing algorithms for cognitive radio. IEEE Trans. Commun. 57(6), 1784–1793 (2009).

    Article  Google Scholar 

  25. C.G. Tsinos, K. Berberidis, Adaptive eigenvalue-based spectrum sensing for multi-antenna cognitive radio systems, in 2013 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP-2013), 26–31 May 2013, pp. 4454–4458.

  26. Y. Zeng, C.L. Koh, Y.-C. Liang, Maximum eigenvalue detection: Theory and application, in 2008 IEEE International Conference on Communications (ICC '08), 19–23 May 2008, pp. 4160–4164.

  27. S. Atapattu, Energy Detection based cooperative spectrum sensing in cognitive radio networks. IEEE Trans. Wirel. Commun. 10(4), 1232–1241 (2011).

    Article  Google Scholar 

  28. F.F. Digham, M.S. Alouini, M.K. Simon, On the energy detection of unknown signals over fading channels. IEEE Trans. Commun. 55(1), 21–24 (2007).

    Article  Google Scholar 

  29. A. Gorcin, K.A. Qaraqe, H. Celebi, H. Arslan, An adaptive threshold method for spectrum sensing in multi-channel cognitive radio networks, in 17th International Conference on Telecommunications (ICT’10), Doha, 4–7 April 2010, pp. 425–429.

  30. W.O. Ajadi, S.M. Sani, A.M.S. Tekanyi, Estimation of an improved spectrum sensing threshold for cognitive radio using smoothed pseudo Wigner-Ville distribution. Int. J. Comput. Appl. 168(12), 30–33 (2017).

    Article  Google Scholar 

  31. K.V. Pappu, K.S. Sanjay, J. Priyanka, Performance evolution of ED-based spectrum sensing in CR over Nakagami-m/shadowed fading channel with MRC reception. Int. J. Electron. Commun. AUE 83, 512–518 (2018).

    Article  Google Scholar 

  32. A. Bagwari, G.S. Tomar, Adaptive double-threshold based energy detector for spectrum sensing in cognitive radio networks. Int. J. Electron. Lett. 1, 24–32 (2013).

    Article  Google Scholar 

  33. A. Muralidharan, P. Venkateswaran, S.G.D. Ajay, A. Prakash, M. Arora, S. Kirthiga, An adaptive threshold method for energy based spectrum sensing in cognitive radio networks, in 2015 International Conference on Control, Instrumentation, Communication and Computational Technologies (ICCICCT), Kumaracoil, 18–19 December 2015, pp. 8–11.

  34. Y. Arjoune, E.Z. Mrabet, E.H. Ghazi, A. Tamtaoui, Spectrum sensing: Enhanced energy detection technique based on noise measurement, in 2018 IEEE 8th Annual Computing and Communication Workshop and Conference (CCWC), Las Vegas 8–10 January 2018, pp. 828–834.

  35. R. Tallataf, R. Adnan, N.A. Ahmad, Reliability factors based fuzzy logic scheme for spectrum sensing. World Acad. Sci. Eng. Technol. Int. J. Inf. Commun. Eng. 12(2), 84–89 (2018).

    Article  Google Scholar 

  36. M. Ranjeet, S. Nallagonda, S. Anuradha, Optimization analysis of improved energy detection based cooperative spectrum sensing network in Nakagami-m and Weibull fading channels. J. Eng. Sci. Technol. Rev. 10(2), 114–117 (2017).

    Article  Google Scholar 

  37. J. Popoola, R. van Olst, Application of neural network for sensing primary radio signals in a cognitive radio environment, in IEEE Africon '11, Livingstone, 13–15 September 2011.

  38. K.M. Thilina, K.W. Choi, N. Saquib, E. Hossain, Machine learning techniques for cooperative spectrum sensing in cognitive radio networks. IEEE J. Sel. Areas Commun. 31(11), 2209–2221 (2013).

    Article  Google Scholar 

  39. Z. Yongwei, W. Pin, Z. Shunchao, W. Yonghua, A spectrum sensing method based on signal feature and clustering algorithm in cognitive wireless multimedia sensor networks. Adv. Multimedia (2017).

    Article  Google Scholar 

  40. K. Koçkaya, I. Develi, Optimum threshold model based on online learning algorithm for spectrum detection in cognitive radio networks, in ISAS 2018, SETSCI Conference Indexing System, Antalya, 11 April 2018, pp. 434–439 (in Turkish)

  41. H. Urkowitz, Energy detection of unknown deterministic signals, in Proceedings of the IEEE, pp. 523–531 (1967).

  42. V. Pankaj, S. Brahmjit, Threshold optimization in energy detection scheme for maximizing the spectrum utilization. Procedia Comput. Sci. 93, 191–198 (2016).

    Article  Google Scholar 

  43. S.A. Malik, M.A. Shah, A.H. Dar, A. Haq, A.U. Khan, T. Javed, S.A. Khan, Comparative analysis of primary transmitter detection based spectrum sensing techniques in cognitive radio systems. Aust. J. BasicAppl. Sci. 4(9), 4522–4531 (2010)

    Google Scholar 

  44. A.A. ElSaleh, M. Ismail, M. Akbari, M.M. Riahi, M.R. Manesh, S.A. Zavareh, Minimizing the detection error of cognitive radio networks using particle swarm optimization, in 2012 International Conference on Computer and Communication Engineering (ICCCE), Kuala Lumpur, 3–5 July 2012, pp. 877–881.

  45. Z. Xuping, P. Jianguo, Energy detection based spectrum sensing for cognitive radio, in IET Conference on Wireless, Mobile and Sensor Networks, Shanghai, 12–14 December 2007, pp. 944–977.

  46. Y.H. Lee, D.C. Oh, Energy detection based spectrum sensing for sensing error minimization in cognitive radio networks. Int. J. Commun. Netw. Inf. Secur. IJCNIS 1(1), 1–5 (2009)

    Google Scholar 

  47. A.S.B. Kozal, M. Merabti, F. Bouhafs, An improved energy detection scheme for cognitive radio networks in low SNR region, in 2012 IEEE Symposium on Computers and Communications (ISCC), Cappadocia, 1–4 July 2012, pp. 684–689.

  48. D. Raman, N.P. Singh, Improved threshold scheme for energy detection in cognitive radio under low SNR, in Association of Computer Electronics and Electrical Engineers, pp. 251–256 (2013)

Download references


This study is supported by Erciyes University Scientific Research Projects Coordination Unit (Project Number: FDK-2016-6908)


This study is supported by Erciyes University Scientific Research Projects Coordination Unit (Project Number: FDK-2016-6908).

Author information

Authors and Affiliations



K.K. has modeled and executed the research and performed system simulations. I.D. has supervised the research and enhanced the quality of the research by their valuable comments and suggestions in data analysis and discussion. K.K. and I.D. revised the equations and contributed to the writing of the manuscript. Both authors read and approved the final manuscript.

Corresponding author

Correspondence to Kenan kockaya.

Ethics declarations

Ethics approval and consent to participate

This article does not contain any studies with human participants or animals performed by any of the authors.

Consent for publication

All authors agree to submit this version and claim that no part of this manuscript has been published or submitted elsewhere.

Competing interests

The authors declare that they have no competing interests.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

kockaya, K., Develi, I. Spectrum sensing in cognitive radio networks: threshold optimization and analysis. J Wireless Com Network 2020, 255 (2020).

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI:


  • Spectrum sensing
  • Energy detection
  • Threshold
  • Machine learning algorithm
  • Online learning algorithm