1 Introduction

With the rapid development of wireless communication technology, more and more applications, such as Internet of Things, wireless sensor networks, mobile ad hoc network, Internet of Vehicles, and so on, put forward wide range of requirement for abundant available wireless bandwidth [1]. As a spectrum sharing technology, Cognitive Radio (CR) enables cognitive users (SUs) to make use of dynamic spectrum access to operate opportunistically in the authorized frequency band without interfering with the licensed users [2]. Cooperative spectrum sensing with multi cognitive users can improve the low detection performance caused by channel fading or shadow effect. However, it also may lead to poor detection accuracy due to poor channel conditions of individual users. Through spectrum sensing to detect the spectrum hole of the primary user, cognitive users can access the idle spectrum intelligently and dynamically, which improves the utilization of spectrum resources. However, in the actual cognitive radio networks, uncertain factors such as shadow effect and multipath fading have a serious impact on the spectrum sensing reliability of a single SU. Cooperative spectrum sensing (CSS) is regarded as the key method to solve the above problems, the cooperative behavior of multi SUs can effectively make up for the limitations of single cognitive user in the sensing process [3].

In the traditional energy detection method, the algorithm is relatively simple to implement, and the contribution of each SU to the final fusion results is taken as equal. But in fact, the channel characteristics from different SUs may not be similar [4]. For the SUs with better Signal-to-Noise Ratio (SNR), the accuracy of the detection results will be obtained. On the contrary, the poor detection performance of cooperative SUs with low SNR will inevitably affect the final fusion result [5]. Therefore, some cooperative sensing detection methods does not fully consider the differences of SUs' sensing performance, which easily leads to the low detection performance of the whole system. Thus, the SUs will not fully utilize the spectrum resources for data transmission. In this paper, an optimal linear weighted cooperative spectrum sensing for clustered-based cognitive radio networks is proposed. In this scheme, different weight values will be assigned for cooperative nodes according to the SNR of cognitive users and the historical sensing accuracy [6]. In addition, the cognitive users can be clustered, and the users with the better channel characteristics will be selected as cluster heads for gathering the local sensing information.

The key contributions of this work are:

  1. 1.

    A literature survey about various existing cooperative spectrum sensing scheme, and analyze their advantages and disadvantages.

  2. 2.

    An effective cluster-based cooperative spectrum sensing scheme is proposed.

  3. 3.

    An optimal linear weighted cooperative spectrum sensing algorithm for clustered-based cognitive radio networks is proposed.

  4. 4.

    The performance of the proposed algorithm is analyzed and compared with Hybrid SDF-HDF Cluster-based fusion scheme and Fuzzy C-means clustering CSS.

The remainder of the paper is organized as follows. Section 2 reviews the related works. Section 3 presents the system model and the proposed method. The simulations and analysis are provided in Sect. 4, and the conclusions are presented in Sect. 5.

2 Related work

Cognitive radio technology can significantly improve the spectrum utilization by detecting the spectrum hole by the cognitive user and choose opportunistic access to the primary user (PU) without using the authorized frequency band. It is an important technology to solve the shortage of spectrum resources. Due to the limitations of single user’s local sensing, cooperative sensing method with multi cognitive users has been more and more studied. Comparatively, cooperative spectrum sensing demonstrates better advantages than single user’s spectrum sensing, which aims at the problem of hidden terminal and channel fading.

Accurate sensing of idle frequency bands is a prerequisite for effective use of licensed spectrum resources. Usually, the SUs can only acquire limited prior knowledge about authorized user, and energy detection (ED) method based on Neyman–Pearson criterion is widely applied. To reduce the amount of samples, Leonard et al. [7] proposed sequential energy detector method. Han et al. [8] designed a combination mechanism to utilize the sporadic sampling values, which can evaluate the PU’s state according to the sequential probability ratio detection and the preset threshold value. Yilmaz et al. [9] investigated the temporal correlation of the samples and proposed the autoregressive model to approximate the PU’s signal. In order to improve the sensing accuracy, Do et al. [10] analyzed the characteristics of hard-combination and soft-combination for sensing results fusion and proposed a soft-hard combination method based on Likelihood Ratio Test theory. Aiming to save the limited bandwidth of the control channel, Fu et al. [11] designed a quantization-based soft fusion scheme, which makes the SUs convert the observation statistics into multi-bit data.

The spatial diversity of the sensing nodes with different geographical location can improve spectrum sensing performance and detection efficiency. It can use spatial diversity gain to improve the correlation of sensing information, and solve the problems of multipath fading, shadow fading and hidden terminal. To improve the energy efficiency of CSS, Peng et al. [12] introduced a optimal cooperative nodes selection scheme with modulation constellation size. To alleviate the environmental interference, Manish et al. [13] evaluated the cooperative SU’s reliability according to the historical decisions and proposed an optimal weight assignment mechanism for CSS. Shin et al. [14] analyzed the characteristics of PU’s location and signal power, and proposed a spatio-temporal correlation CSS mechanism to minimize the average delay for forwarding sensing data. By selecting non-correlated SUs to operate in CSS, Caso et al. [15] proposed a data fusion schemes based on the sensing node’s spatio-temporal correlation to maximize the bandwidth utilization and minimize the energy consumption. Wu et al. [16] proposed a linear weighted CSS framework in a spatio-temporal sensing window to improve the energy detection performance.

3 Methods

3.1 System model

To reduce the error probability of decision fusion and improve the performance of spectrum sensing, this paper proposes a cluster-based cooperative spectrum sensing scheme. It is assumed that the channel state between cognitive radio and fusion center is known to cognitive radio [17]. It is necessary to estimate the channel state before the SU sends sensing data in each intervals. In addition, in the node’s clustering structure, the nearest cognitive users should be selected as the member nodes in the same cluster, and the channel state between them can be approximately considered to be ideal [18, 19].The fusion results of each cluster will finally sent to the fusion center (FC) by cluster heads (CHs) for fusion, and the FC uses OR fusion method for processing [20, 21].

Considering that a FC or base station and \(N\) cognitive users participate in cooperative spectrum sensing. The SUs will be organized into \(K\) clusters, and there are \(K_{c}\) cognitive users in the \(c\)-th cluster. The energy detection method is applied, and the spectrum the sensing samples of \(i\)-th SU in \(c\)-th cluster at \(m\)-th sampling slot can be expressed as [22, 23]:

$$r_{ci} (m) = \left\{ {\begin{array}{*{20}l} {n_{ci} (m)} \hfill & {H_{0} } \hfill \\ {h_{ci} s_{ci} (m) + n_{ci} (m)} \hfill & {H_{1} } \hfill \\ \end{array} } \right.$$
(1)

where \(s_{ci} (m)\) is the sampling value of the PU’s signal received by the SU, \(h_{ci}\) and \(n_{ci} (m)\) represent the channel gain and channel noise from the SU to the PU, respectively. The noise is assumed to be additive, white and Gaussian (AWGN) with zero-mean and known variance \(\sigma_{n,ci}^{2}\), i. e., \(n_{ci} (m)\sim{\mathcal{N}}\left( {0,\sigma_{n,ci}^{2} } \right)\).

3.2 Cooperative spectrum sensing

Let \(\tau\) be the sensing time of the SU and \(f_{{\text{s}}}\) be the sampling frequency, then after the sum of \(M = \tau f_{{\text{s}}}\) samples, the test statistics of the \(j\)-th SU in the \(c\)-th cluster can be expressed as:

$$R_{ci} = \frac{1}{M}\sum\limits_{m = 1}^{M} {\left| {r_{ci} (m)} \right|^{2} }$$
(2)

Under the hypothesis \(H_{0}\), the probability density function of \(R_{ci}\) obeys the central chi square distribution with \(2M\) degree of freedom. Otherwise, under the hypothesis \(H_{1}\), the probability density function of \(R_{ci}\) will obey the non-central chi square distribution with \(2M\) degree of freedom.

When the value of \(M\) is large enough, the test statistic can be approximated as Gaussian. By applying the central limit theorem [24, 25], the test statistic can be defined as follows:

$$R_{ci} \sim\left\{ {\begin{array}{*{20}l} {{\mathcal{N}}\left( {M\sigma_{n,ci}^{2} ,2M\sigma_{n,ci}^{4} } \right),} \hfill & {H_{0} } \hfill \\ {{\mathcal{N}}\left( {(M + \gamma_{i} )\sigma_{n,ci}^{2} ,2(M + 2\gamma_{i} )\sigma_{n,ci}^{4} } \right),} \hfill & {H_{1} } \hfill \\ \end{array} } \right.$$
(3)

All member nodes will send their observations to the CH of the corresponding cluster [26, 27]. Considering that the geographical distance between the nodes in the cluster and the cluster head is relatively close, the noise between the cognitive user and the cluster head is ignored. Suppose that the cluster head of the \(c\)-th cluster assign different weight values to its member node’ received observation. Then, the weight vector of the cluster can be expressed as \(W_{c} = [w_{1} ,w_{2} , \ldots ,w_{{K_{c} }} ]^{T}\), and the sum of the test statistics of all member nodes in the cluster can also obey the normal distribution by:

$$R_{c} \sim\left\{ {\begin{array}{*{20}l} {{\mathcal{N}}\left( {\sum\limits_{i = 1}^{{K_{c} }} {w_{i} M\sigma_{n,ci}^{2} } ,\sum\limits_{i = 1}^{{K_{c} }} {2w_{i,j} M\sigma_{n,ci}^{4} } } \right),} \hfill & {H_{0} } \hfill \\ {{\mathcal{N}}\left( {\sum\limits_{i = 1}^{{K_{c} }} {w_{i} M\left( {1 + \gamma_{i} } \right)\sigma_{n,ci}^{2} } ,\sum\limits_{i = 1}^{{K_{c} }} {2w_{i} M\left( {1 + 2\gamma_{i} } \right)\sigma_{n,ci}^{4} } } \right),} \hfill & {H_{1} } \hfill \\ \end{array} } \right.$$
(4)

The weight vector can reflect the contribution of individual SU to the final fusion results, and two factors are taken into account: SNR and error rate of each member node [28, 29]. If a SU's SNR is high, it should be assigned a larger weight value for better channel communication quality. In contrast, for the SU being suffering deep fading or shadow effect, its weight value for fusion results should be reduced so as to shorten the negative effect on the final decision [30, 31].

In addition, the historical error rate of member nodes should also be considered seriously [32]. Suppose that in the previous round \(t\), the number of times that the number of sensing result of \(i\)-th SU being consistent with the actual PU’s state is \(u(t)\), and the number of inconsistent results is \(v(t)\). Then, the error rate factor can be defined as:

$$g_{ci} (t) = \exp \left[ {\frac{{v_{ci} (t)}}{{u_{ci} (t) + v_{ci} (t)}}} \right]$$
(5)

By considering the above factors, the weighting coefficient is defined as:

$$w_{i} = \frac{{g_{ci} (t)\gamma_{i} }}{{\sqrt {\sum\limits_{i = 1}^{{K_{c} }} {\left( {g_{ci} (t)\gamma_{i} } \right)_{{}}^{2} } } }}$$
(6)

where \(\gamma_{i}\) represents the signal-to-noise ratio of the \(i\)-th SU.

Assuming that the energy detection threshold of \(c\)-th cluster is \(\lambda_{c}\), the threshold is substituted into the equation of detection probability. Then, the detection probability and false alarm probability of \(c\)-th cluster can be obtained as following:

$$P_{f,c} = Q\left( {\frac{{\lambda_{c} - \sum\limits_{i = 1}^{{K_{c} }} {Mw_{i}^{{}} \sigma_{n,ci}^{2} } }}{{\sqrt {\sum\limits_{i = 1}^{M} {2M\sigma_{n,ci}^{4} w_{i}^{2} } } }}} \right)$$
(7)
$$P_{d,c} = Q\left( {\frac{{Q^{ - 1} \left( {P_{f} } \right)\sqrt {\sum\limits_{i = 1}^{{K_{c} }} {\left( {2M\sigma_{n,ci}^{2} + \gamma_{i}^{2} } \right)w_{i}^{2} } } - \sum\limits_{i = 1}^{{K_{c} }} {M\gamma_{i} \sigma_{n,ci}^{2} w_{i} } }}{{\sqrt {\sum\limits_{i = 1}^{{K_{c} }} {2M\left( {1 + 2\gamma_{i} } \right)\sigma_{n,ci}^{4} w_{i}^{2} + \gamma_{i}^{2} w_{i}^{2} } } }}} \right)$$
(8)

where \(Q(x) = \frac{1}{{\sqrt {2\pi } }}\int_{x}^{\infty } {\exp \left( { - \frac{{t^{2} }}{2}} \right)dt}\).

3.3 Clustering formation

During the clustering formation, \(C\) CHs from \(N\) SUs should be selected primarily. The selection of candidate CHs should meet the following requirements: the candidate nodes should be closer to the FC, and the candidate nodes are also be closer to other SUs. Then, the residual SUs are equally divided into several clusters formed into \(C\) clusters according to the process of clustering formation. If the distance between the cooperative SUs in a cluster is far, relatively small number of members in a single cluster will be. It will result in low performance of cooperative spectrum sensing of the cluster, and the decision result of the cluster may be inaccurate. Thus, the main idea of clustering is to organize the adjacent SUs into a same cluster.

The cluster-based cooperative spectrum sensing can be divided into two parts: spectrum sensing and intra cluster data fusion [33, 34]. All SUs in each cluster need to sense the PU’s signal independently [35, 36]. Then, the CH receives the sensing observations from all member nodes in the cluster, and decides the authorized user’s state. Compared with the typical cooperative spectrum sensing, the clustered-based cooperative spectrum sensing can make more reasonable use of the spatial diversity of nodes in different geographical locations, and reduce the error of decision information sent by SUs to the FC as much as possible. For simplicity, we define the Euclidean distance \({\text{dis}}\left( {s_{i} ,s_{j} } \right)\) between \(i\)-th node and \(j\)-th node, and assumes that the number of nodes in each cluster is an integer. The specific steps of clustering process are as follows:

  • Step 1: The distance from all SUs to the FC is calculated, and the \(2C\) SUs with the shortest distance will be selected as candidate CHs;

  • Step 2: The distance between those candidate CHs and the centroid degree of all cooperative SUs is will be estimated. The optimal nodes with the smallest distance are added into the CHs set \(\{ {\text{CH}}_{1} ,{\text{CH}}_{2} , \ldots ,{\text{CH}}_{C} \}\), and the number of optimal nodes is \(C\);

  • Step 3: Initialize the member nodes set of the clusters, cluster center \(\hat{m}_{c}\) and the number of nodes in the cluster as \(K_{c}\). The total number of residual SUs is denoted as \(N_{{{\text{res}}}} = N - C\).

  • Step 4: Calculate the distance between the SUs from residual nodes set and cluster centroid. For a SU, if it satisifies with \(c = \arg \min \{ {\text{dis}}(s_{i} ,{\text{CH}}_{c} )\}\), the node should be joined into \(c\)-th cluster and the cluster centroid will be updated. Then, the number of member nodes in \(c\)-th cluster plus one, i. e., \(K_{c} = K_{c} + 1\) and the total number of residual SUs will be decreased by \(N_{{{\text{res}}}} = N_{{{\text{res}}}} - 1\);

  • Step 5: If \(K_{c} = \frac{N - C}{C}\), it shows that the \(c\)-th cluster is at full length, and subsequent nodes are no longer joined into the cluster;

  • Step 6: if \(N_{{{\text{res}}}} > 0\), return to step 4 and continue execution;

  • Step 7: The distance from all SUs in each cluster to the FC is calculated, and the nearest SU can be determined as the CH. The CH assigns ID to each member node, and the formation of cluster ends.

4 Results and discussion

In this section, we conduct Monte Carlo simulations to evaluate the performance of the proposed algorithm. During the simulations, we assume that the number of SUs is varied from 10 to 40 and the number of samples is equal to 100. To reveal the spectrum sensing performance, we define the error probability as \(P_{{{\text{error}},c}} = P(H_{1} )(1 - P_{d,c} ) + P(H_{0} )P_{f,c}\), which can be calculated by the summation of miss detection probability and false alarm probability. \(P(H_{1} )\) and \(P(H_{0} )\) represent the probabilities of the idle and the busy state of the PU respectively and \(P(H_{1} ) = P(H_{0} ) = 0.5\). Furthermore, we compare the performance of proposed algorithm with typical cluster-based CSS methods, including Hybrid SDF-HDF Cluster-based fusion scheme [37] and Fuzzy C-means clustering CSS [38] in aspects of detection probability and average error probability. Besides, the equal weighted decision fusion scheme of the proposed cluster-based CSS is also investigated.

First, the comparisons of detection probability are conducted to evaluate the effect among above methods. Figures 1 and 2 show the detection probability of above methods and it can be observed that the detection probability of our proposed method is significantly higher than other methods, even under low SNR circumstances. It can be seen from Figs. 1, 2 that under the same false alarm probability, our proposed method can effectively improve the detection probability of the system. The reason is that the cluster formation can optimize the collection of cooperative sensing nodes and ensure the quality of sensing channel based on the selection of cooperative nodes with high SNR. Therefore, the error rate of the report received by the CH will be very small and it effectively improves the detection accuracy of the whole system. In addition, the mechanism of intra-cluster weighting assignment can effectively regulate the weight of SUs in decision-making according to their SNR, which can reduce the negative effect of SUs with poor sensing performance on the final decision-making.

Fig. 1
figure 1

Comparison of detection probability under different probability of false alarm (N = 20, SNR =  − 10 dB)

Fig. 2
figure 2

Comparison of detection probability under different probability of false alarm (N = 20, SNR =  − 18 dB)

In addition, the average error probability of those methods is compared. Figure 3 shows the comparison of average error probability under different SNR. It shows that good channel quality can reduce the error probability. In contrast, our proposed method can obtain lower error probability than other methods under the condition of low SNR. The reason is that our proposed method can organize the SUs with good channel quality for cooperative spectrum sensing. By assigning lower weight value for data fusion, the poor detection performance of individual SUs can be restrained effectively.

Fig. 3
figure 3

Comparison of average error probability under different SNR

Figure 4 shows the change of average error probability with the number of SUs. It can be seen that the average error probability of our proposed method is significantly lower than that of other methods. Especially when the number of SUs is increasing, the superiority becomes more obvious. The increase of the number of SUs will improve the false alarm probability and reduce the channel utilization rate of cognitive radio. By assigning different weights for the SUs according to the SNR and historical sensing results, it can dynamically adjust the contribution of each SU to the overall decision-making in the intra-cluster fusion stage. Therefore, our proposed method can effectively improve the accuracy of the final fusion decision, which has a good effect on reducing the global error probability.

Fig. 4
figure 4

Comparison of average error probability under different number of SUs

Through the above different experimental scenarios, it can be observed that the proposed algorithm has obvious advantages in detection probability and average error probability.

5 Conclusions

In this paper, an optimal linear weighted cooperative spectrum sensing for clustered-based cognitive radio networks is proposed. In this scheme, different weight values will be assigned for cooperative nodes according to the SNR of cognitive users and the historical sensing accuracy. In addition, the cognitive users can be clustered, and the users with the better channel characteristics will be selected as cluster heads for gathering the local sensing information. Simulation results show that the proposed scheme can obtain better sensing performance, improve the detection probability and reduce the error probability. In the future research process, we will consider more experimental scenarios and platforms to fully verify the effectiveness and feasibility of the proposed cooperative spectrum sensing scheme.