1 Introduction

Traditional wireless networks are regulated by fixed spectrum allocation policies to operate in certain timeframes, over certain frequency bands, and within certain geographical regions. This regulation results in situations in which some radio bands are overcrowded while other bands remain moderately or rarely occupied. In order to improve spectrum utilization, cognitive radio (CR) technology has been proposed as a potential communication paradigm [1]. When the licensed spectrum holders (primary users) are sensed as inactive, the secondary users can operate in the licensed spectrum, if they do not interfere with the primary user. Since primary users should be carefully protected from interference due to secondary users’ operation, spectrum sensing has become an essential function of cognitive radio devices [2]. If a secondary user suffers from shadowing or heavy fading, the sensed signal tends to be weak while the primary user is transmitting, leading to incorrect decisions. To address these problems while maintaining sensing simplicity, cooperative sensing schemes that fuse the sensing results of multiple secondary users, have been proposed [3, 4]. The authors of [5] showed that cooperative sensing can reduce the detection time of the primary user and increase the overall agility. In addition, cooperative spectrum sensing effectively alleviates the impact of incorrect individual decisions on throughput by exploiting the spatial diversity of the secondary users. How to choose proper secondary users for cooperation was investigated in [6]. The authors of [7] studied the design of sensing slot duration to maximize secondary users’ throughput under certain constraints.

In most of the existing cooperative spectrum sensing schemes [5–[7], a fully cooperative scenario is assumed: all secondary users voluntarily contribute to sensing and fuse their detection results to a fusion center (FC) to make a final decision. According to [8], it is not necessary for all secondary users to cooperate in the network to achieve the optimum performance. Instead, only the secondary users with the highest signal-to-noise ratio (SNR) received from the primary user are participated in spectrum sensing.

Another issue is the sensor nodes which are employed for spectrum sensing, operate under limited energy budgets. Typically, they are powered through batteries, which must be either replaced or recharged (e.g., using solar power) when depleted. For some nodes, neither option is possible, that is, they will simply be discarded once their energy source is depleted.

In [9], the secondary users are classified into two groups: the sensing nodes which participate in spectrum sensing and the transmitting nodes which send their data to the FC. However, minimizing the energy consumption is not considered for nodes.

The author in [10] proposed a sensing-throughput tradeoff problem under a cooperative sensing scenario which is formulated to find a pair of sensing time and k value in k—out-of N fusion rule that maximize the secondary users’ throughput subject to sufficient protection that is provided to the primary user. In [11], minimizing energy consumption with constraints on the detection performance is proposed while the SNR is the same for all sensors. However, this is not a real assumption and is only applied to simplify the problem.

In our paper, we consider a different SNR for each sensor that is according to the real situation due to the different distance between each node and the primary user. We propose an energy efficient cooperative spectrum sensing by determining the sensing nodes and the sensors which participate in data transmitting. The constraint on this problem is the global probability of detection, global probability of false alarm and the minimum required throughput. The higher probability of detection means the less interference with the primary user transmission while the less probability of false alarm leads to higher opportunity to use the idle channel.

For solving our problem, we use the convex optimization method. After obtaining the optimality conditions based on Karush–Kuhn–Tucker (KKT) conditions, an iterative algorithm is proposed to search the sensing nodes for spectrum sensing and the data transmitting nodes in order to improve throughput.

The rest of the paper is organized as follows. In Sect. 2, we describe the system model and obtain the global probability of detection and the global probability of false alarm for our problem. Expression of the sensor selection problem is also derived in this section. In Sect. 3, we analyze how to solve the problem using the analytical algorithms. In Sect. 4, our algorithms for selection of sensing and transmitting nodes are proposed. In sub-section A, the ellipsoid search method is stated for solving the problem. We present numerical and simulation results to show the energy savings obtained by the proposed scheme in Sect. 5. Conclusions are drawn in Sect. 6.

2 System Model

In a cognitive radio system, when the sensors are sensing the channel, the sampled received signal of the nodes has two hypotheses. When the primary user is present denoted by H1 and when the primary user is inactive denoted by H0. Then the received signal at the jth sensor, rj[k], can be written as

$$ r_{j} \left[ k \right] = \left\{ {\begin{array}{*{20}l} {h_{j} s\left[ k \right] + n_{j} \left[ k \right]} \hfill & {\quad {\text{if}}\; H_{1} } \hfill \\ {n_{j} \left[ k \right]} \hfill & {\quad {\text{if}} \; H_{0} } \hfill \\ \end{array} } \right. $$
(1)

h j is the channel gain between the primary user and the jth sensor which is defined as follows

$$ h_{j} = 10^{{\frac{{ - L_{j} }}{20}}} \cdot {\text{g}}_{j} $$
(2)

where g j is a complex Gaussian random process with zero mean and unit variance accounting for Raleigh fading and L j has two components

$$ L_{j} = 20\log \left( {\frac{{d_{{p_{j} }} 4\pi f_{c} }}{C}} \right) + n_{j} $$
(3)

where the first part is path loss component based on free space path loss (FPL) model which involves \( d_{{p_{j} }} \) that is the distance of the jth node from primary user, f c is the carrier frequency that is denoted to be 2.4 GHz and C is the speed of light. The second part is a real Gaussian random variable with zero mean and standard deviation 3 according to large scale log-normal shadowing [12].

s[k] is the signal of the primary user which is assumed to be deterministic while nj[k] is a Gaussian (i.i.d) random noise with zero mean and variance \( \sigma_{n}^{2} \). We assume δ is the sensing time and fs is the sampling frequency of the received signal from the primary user. δ and fs are the same for all sensors. δ is a multiple of 1/fs thus, the number of samples is δfs. N cognitive sensors and a fusion center (FC) is considered in our paper as it is shown in Fig. 1. The energy detector is used to sense the licensed spectrum. Therefore, we have

Fig. 1
figure 1

Cooperative spectrum sensing and data transmitting configuration

$$ E_{j} = \sum\limits_{k = 1}^{{\delta f_{s} }} {r_{j} [k]^{2} } { \gtrless }_{{H_{0} }}^{{H_{1} }} \varepsilon :\left\{ {\begin{array}{*{20}c} {D_{j} = 0\quad {\text{if}} H_{0} } \\ {D_{j} = 1\quad {\text{if}} H_{1} } \\ \end{array} } \right. $$
(4)

where r j [k] are the samples of the received power. E j is the test statics and ϵ is the energy detection threshold. D j  = 0 shows the channel is idle while D j  = 1 determines the activity of the channel. Under H 0, E j is a random variable whose probability density function (PDF) is a central Chi square distribution with 2δf s degrees of freedom and under H 1, E j has a non-central Chi square distribution with 2δf s degrees of freedom and a non-centrality parameter 2γ j , where γ j is the SNR for the jth sensor, respectively. Then, the probability of false alarm for the jth sensor is given by [9]

$$ P_{{f_{j} }} = P\left( {E_{j} > \in |H_{0} } \right) = \frac{{\varGamma \left( {\delta f_{s} ,\frac{ \in }{2}} \right)}}{{\varGamma \left( {\delta f_{s} } \right)}} $$
(5)

where Γ(a, b) is the incomplete gamma function given by \( \varGamma \left( {a,b} \right) = \int\limits_{b}^{\infty } {t^{a - 1} } e^{ - t} dt \) and Γ(a) is the gamma function. The probability of detection for each node is stated as follows [9]

$$ P_{{d_{j} }} = P\left( {E_{j} > \varepsilon |H_{1} } \right) = Q_{{\delta f_{s} }} \left( {\sqrt {2\gamma_{j} } ,\sqrt \in } \right) $$
(6)

where Q m (ab) is the generalized Marcum Q-function, \( Q_{m} \left( {a,b} \right) = \frac{1}{{a^{m - 1} }}\int\limits_{b}^{\infty } {t^{m} e^{{ - \left( {\frac{{t^{2} + a^{2} }}{2}} \right)}} I_{m - 1} \left( {at} \right)dt} \), in which \( I_{m - 1} \left( \cdot \right) \) is the modified Bessel function of the first kind and order m − 1.

The sensing nodes sense the spectrum and send their results to the FC to make a final decision using a fusion rule. In our paper, OR rule combines the local decision of the nodes. Therefore, the final probability of detection and the final probability of false alarm are written as follows

$$ P_{d} = 1 - \mathop \prod \limits_{j = 1}^{N} \left( {1 - P_{{d_{j} }} } \right) $$
(7)
$$ P_{f} = 1 - \mathop \prod \limits_{j = 1}^{N} \left( {1 - P_{{f_{j} }} } \right) $$
(8)

According to [13], ρ j is considered as an assignment index for each sensor to show that the node senses the spectrum or not. Therefore, (7) and (8) are modified and we have

$$ P_{d} = 1 - \mathop \prod \limits_{j = 1}^{N} \left( {1 - \rho_{j} P_{{d_{j} }} } \right) $$
(9)
$$ P_{f} = 1 - \mathop \prod \limits_{j = 1}^{N} \left( {1 - \rho_{j} P_{{f_{j} }} } \right) $$
(10)

ρ j can be 0 or 1. ‘1’ indicates that the node participates for sensing while ‘0’ denotes not sensing the spectrum.

Here, some nodes sense the spectrum while the other nodes may transmit their data and some nodes will be idle. Therefore, the total energy consumption can be obtained as

$$ C_{T} = \sum\limits_{j = 1}^{N} {\rho_{j} \left( {C_{{s_{j} }} + C_{tj} } \right) + \zeta_{j} \left( {C_{tj} } \right)} $$
(11)

where ζ j is the assignment index for transmitting sensors and ζ j  ∊ {0, 1}. It is noticed that one node cannot sense the spectrum and transmit data simultaneously.\( C_{{s_{j} }} \) is the energy consumption for sensing which is the same for all sensors and C tj is the energy consumption for sending the results or data to the FC. C tj is used to derive the radio electronics and the power amplification. It should be noted that the power attenuation depends on the distance between the transmitter and receiver, and in order to satisfy a given receiver sensitivity level, power amplification will be required, then C tj is as follows [11]

$$ C_{tj} \left( {d_{j} } \right) = C_{t - elec} + e_{amp} d_{j}^{2} $$
(12)

where C telec is the transmitter electronics energy and e amp is the required amplification and d j is the distance between the jth node and FC.

The instantaneous transmission rate of the jth sensor, denoted by r 0,j for the case of the absence of the primary user (H 0) and by r 1,j for the case of the presence of the primary user (H 1) is given by [14]

$$ r_{0,j} = \log_{2} \left( {1 + \frac{{P_{s,j} }}{{\sigma_{n}^{2} }}} \right) $$
(13)
$$ r_{1,j} = \log_{2} \left( {1 + \frac{{P_{s,j} }}{{\sigma_{n}^{2} + P_{p,j} }}} \right) $$
(14)

where P s,j is the received power at the FC from the jth transmitter sensor while P p,j is the power that the FC receives from the primary user. However, the fact is that spectrum sensing is not a perfect function. This is due to the limitations of the spectrum sensing techniques and the nature of wireless communications that include phenomena such as shadowing and fading. Therefore, the primary user could either be miss-detected or a false alarm may occur. As a result, two different cases can be distinguished regarding the sensing decision (present or absent) and the actual status of the primary user (active or idle). Therefore, the total average throughput can be formulated as

$$ T = \sum\limits_{j = 1}^{N} {\zeta_{j} \left( {P(H_{0} )\left( {1 - P_{f} } \right)r_{0,j} + P\left( {H_{1} } \right)\left( {1 - P_{d} } \right)r_{1,j} } \right)} $$
(15)

where P(H 0) denotes the probability that the primary user is idle while P(H 1) denotes the probability that the primary user is active. In order to find the minimum total energy consumption, we define the following problem

$$ \begin{array}{*{20}l} {{}_{{\rho_{{j,\zeta_{j} }} }}^{\hbox{min} } } \hfill & {C_{T} = \mathop \sum \limits_{j = 1}^{N} \rho_{j} \left( {C_{{s_{j} }} + C_{tj} } \right) + \zeta_{j} \left( {C_{tj} } \right)} \hfill \\ {} \hfill & {s.t.\quad P_{f} \le \alpha } \hfill \\ {} \hfill & {P_{d} \ge \beta } \hfill \\ {} \hfill & {T \ge th} \hfill \\ {} \hfill & {\rho_{j} \in \left\{ {0,1} \right\}\quad \forall j} \hfill \\ {} \hfill & {\zeta_{j} \in \left\{ {0,1} \right\}\quad \forall j} \hfill \\ {} \hfill & {\rho_{j} \zeta_{j} = 0} \hfill \\ \end{array} $$
(16)

where th is the minimum required total throughput for the network. The last constraint shows that one sensor cannot be the sensing node and transmitting node simultaneously. The maximum number of sensing nodes can be obtained using (10) because P f is an increasing function of ρ j and it is independent from ζ j . Therefore, we have

$$ n \le \frac{{\ln \left( {1 - \alpha } \right)}}{{\ln \left( {1 - P_{{f_{j} }} } \right)}} = M $$
(17)

where M is the maximum number of sensing nodes and \( n = \sum\nolimits_{j = 1}^{N} {\rho_{j} } \) is the number of nodes participating in spectrum sensing.

3 Problem Analysis

One solution for (16) is an exhaustive search algorithm. In this algorithm, all possible n candidates for sensing and N − n candidates for data transmitting are tested and the state that minimizes the energy consumption while satisfies the constraints is selected as the optimum solution. But this algorithm has the high complexity with the order of O(N!). Therefore, we search for the algorithms with lower complexity. Since ρ j and ζ j are discrete parameters, (16) is NP-complete. Therefore, in order to transform the problem to more tractable form, ρ j and ζ j are considered as continuous parameters between ‘0’and ‘1’. After solving the problem, ρ j and ζ j are mapped to discrete space again. Now, we rewrite the problem as follows

$$ \begin{array}{*{20}l} {{}_{{\rho_{{j,\zeta_{j} }} }}^{\hbox{min} } } \hfill & {C_{T} = \sum\limits_{j = 1}^{N} {\rho_{j} \left( {C_{{s_{j} }} + C_{tj} } \right) + \zeta_{j} \left( {C_{tj} } \right)} } \hfill & {} \hfill \\ {s.t.} \hfill & { \sum\limits_{j = 1}^{N} {\rho_{j} \le M} } \hfill & {(18 - 1)} \hfill \\ {} \hfill & {P_{d} \ge \beta } \hfill & {(18 - 2)} \hfill \\ {} \hfill & {T \ge th} \hfill & {(18 - 3)} \hfill \\ {} \hfill & {\rho_{j} \in \left[ {0,1} \right]\quad \forall j} \hfill & {} \hfill \\ {} \hfill & {\zeta_{j} \in \left[ {0,1} \right]\quad \forall j} \hfill & {} \hfill \\ {} \hfill & {\rho_{j} \zeta_{j} = 0} \hfill & {} \hfill \\ \end{array} $$

In fact, we search the feasible points which satisfy the constraints in the problem. The set of all feasible points is called the feasible set or the constraint set. Now, we should find the algorithms that obtain the minimum objective function in their feasible set. Also, it is noticed that, sometimes, the feasible set is empty; i.e., there is no answer for the problem. In the problem above, the objective function and the constraints except (18-2) are convex with respect to ρ j . Although (18) is not a standard convex optimization problem, we can still exploit the convex optimization methods to find ρ j s. Therefore, the Lagrangian function and Karush–Kuhn–Tucker (KKT) conditions are considered to determine the priority of the nodes for spectrum sensing and transmitting data. So, we have [15]

$$ L = \sum\limits_{j = 1}^{N} {\rho_{j} \left( {C_{{s_{j} }} + C_{tj} } \right) + \zeta_{j} \left( {C_{tj} } \right) - \mu \left( {T - th} \right) - \lambda \left( {P_{d} - \beta } \right) + \eta \left( {\mathop \sum \limits_{j = 1}^{N} \rho_{j} - M} \right)} $$
(19)

η, λ and μ are the Lagrangian multipliers for (18-1), (18-2) and (18-3) constraints, respectively. We remove the last constraint in (18), but in node selection, we take into account that one node cannot sense and send data, simultaneously. From KKT conditions, we have

$$ \frac{\partial L}{{\partial \rho_{j} }} = \left( {C_{s} + C_{tj} } \right) + \eta - \lambda P_{{d_{j} }} = 0\quad \forall j \in \left\{ {0, 1, 2, \ldots ,N} \right\} $$
(20)

and

$$ \frac{\partial L}{{\partial \zeta_{j} }} = - \mu \left( {P\left( {H_{0} } \right)\left( {1 - P_{f} } \right)r_{0,j} + P\left( {H_{1} } \right)\left( {1 - P_{d} } \right)r_{1,j} } \right) + C_{tj} = 0\quad \forall j \in \left\{ {0,1,2, \ldots ,N} \right\} $$
(21)

According to (20) and (21), the priority of the nodes for spectrum sensing and data transmitting is determined according to the following formulas

$$ {\text{Cost\_}}s\left( j \right) = C_{s} + C_{tj} - \lambda P_{{d_{j} }} $$
(22)
$$ {\text{Cost\_}}t\left( j \right) = - \mu \left( {P\left( {H_{0} } \right)\left( {1 - P_{f} } \right)r_{0,j} + P\left( {H_{1} } \right)\left( {1 - P_{d} } \right)r_{1,j} } \right) + C_{tj} $$
(23)

Proof

See “Appendix”.

Therefore, the nodes with less cost function according to (22) and (23) have the higher priority for spectrum sensing and data transmitting, respectively. Also, complimentary slackness conditions imply that [15]

$$ \left\{ {\begin{array}{*{20}l} {\lambda (p_{d} - \beta ) = 0 \to } \hfill & {\left\{ {\begin{array}{*{20}l} {\lambda = 0,} \hfill & {P_{d} > \beta } \hfill \\ {\lambda \ne 0,} \hfill & {P_{d} = \beta } \hfill \\ \end{array} } \right.} \hfill & {\begin{array}{*{20}l} {(24 - 1)} \hfill \\ {(24 - 2)} \hfill \\ \end{array} } \hfill \\ {\eta \left( {\sum {\rho_{j} - M} } \right) = 0 \to } \hfill & {\left\{ {\begin{array}{*{20}l} {\eta = 0,} \hfill & {\sum {\rho_{j} < M} } \hfill \\ {\eta \ne 0,} \hfill & {\sum {\rho_{j} = M} } \hfill \\ \end{array} } \right.} \hfill & {\begin{array}{*{20}l} {(24 - 3)} \hfill \\ {(24 - 4)} \hfill \\ \end{array} } \hfill \\ {\mu (T - th) = 0 \to } \hfill & {\left\{ {\begin{array}{*{20}l} {\mu = 0,} \hfill & {T > th} \hfill \\ {\mu \ne 0,} \hfill & {T = th} \hfill \\ \end{array} } \right.} \hfill & {\begin{array}{*{20}l} {(24 - 5)} \hfill \\ {(24 - 6)} \hfill \\ \end{array} } \hfill \\ \end{array} } \right. $$

It can be proved that (24-2) is the optimal condition, because, P d , P f and CT are the increasing functions of ρ j s. Therefore, if (24-1) becomes the optimal condition, ρ j s can be decreased so that P d  = β is satisfied. Under this reduction, there are smaller P f and C T which leads to more desirable answer. Therefore, λ ≠ 0 is the true condition in (24-2). In addition, T = th is the optimal condition, because C T is an increasing function of ζ j s. Therefore, reducing ζ j leads us to the minimum energy consumption while the minimum required throughput is obtained. Each of (24-3) and (24-4) can be optimal given the problem condition. According to the problem, if less sensing nodes satisfy the detection performance, then (24-3) is the optimal condition, otherwise, (24-4) is true.

4 Proposed Algorithms for Sensing Nodes Selection and Data Transmitting Nodes

In this section, we propose two algorithms to minimize the energy consumption while satisfying the detection performance and the minimum required throughput constraints by determining the sensing nodes and the data transmitting sensors. We need the algorithms to search the solutions which can satisfy the optimality conditions [(20)-(24-6)]. In fact, the priority of nodes for spectrum sensing and data transmitting are determined according to (22) and (23). Since one node cannot sense and transmit data simultaneously, therefore, there is a competition between the sensing node selection and the transmitting node selection. Based on this competition, we propose two algorithms:

  • Minimizing energy and satisfying the minimum throughput algorithm (MESMTA): In this algorithm, we use an iterative algorithm to find the sensing nodes and transmitting nodes which minimize the energy consumption and satisfy the throughput constraint. In each iteration which μ and λ are updated, the sensing nodes are selected first based on (22) and then according to (23), the nodes for data transmitting are obtained. The iterative algorithm is the ellipsoid search method, one of the best methods in the two dimension search [15].

  • Satisfying the minimum throughput and minimizing energy algorithm (SMTMEA): This algorithm is similar to MESMTA; the difference is that, at first, the transmitting nodes are selected based on (23) so that the throughput constraint is satisfied, then, the sensing nodes are determined until the probability of detection constraint is maintained.

4.1 The Ellipsoid Search Method

In order to satisfy (24-1)–(24-6), the optimal values of λ and μ are chosen to fulfill the (18-2) and (18-3), respectively. For this purpose, we use ellipsoid method. In fact, if there is any answer in the corresponding area, the ellipsoid method can find it. The complexity order of this method is O(N). Note that L(μ, λ, η) in (19) is convex and a gradient-type search is guaranteed to converge to the global optimum. However, the main difficulty is that, L(μ, λ, η) is not necessarily differentiable. Thus, it does not always have a gradient and it is possible to search according to subgradient. The vector g is the subgradient of L(μ, λ, η) at optimum λ and μ, if the following condition is satisfied [15, 16],

$$ \left[ {L\left( {\mu ,\lambda^{\prime } ,\eta } \right),L\left( {\mu^{\prime } ,\lambda ,\eta } \right) \ge \left[ {L\left( {\mu ,\lambda ,\eta } \right),L\left( {\mu ,\lambda ,\eta } \right)} \right] + g^{T} } \right[\left( {\lambda^{\prime } - \lambda } \right), \left( {\mu^{\prime } - \mu } \right)]\quad \forall \lambda^{\prime } ,\mu^{\prime } $$
(25)

Ellipsoid method is a simple algorithm to find query points. Therefore, this iterative algorithm is one of the best candidates for multi-dimensional search. The details of this algorithm can be found in [15].

We use this algorithm to find the optimal sensing and data transmitting nodes. For MESMTA algorithm, in each iteration for updating μ and λ, the cost function in (22) is computed for each sensor and sorted in ascending order. Therefore, the nodes with the lowest cost functions are selected for spectrum sensing until the detection performance constraint is satisfied. Note that the number of selecting nodes is less than M. After sensing nodes selection, from the remaining nodes, the sensors with minimum cost function in (23) are determined for data transmitting until the throughput constraint is maintained. Then, total energy consumption is obtained. Note that μ and λ are updated by the ellipsoid search method. The pseudo code for this algorithm is shown below:

figure c

5 Numerical and Simulation Results

For simulation, a sensor network in which the number of sensors varies from five to fifty nodes is considered. Sensor nodes are distributed randomly with uniform distribution in the square field with the length of 1000 m. FC is located in the center of the square. Primary user is located randomly in this square. Simulation results are shown for α = 0.1 and β = 0.9. th = 2 is set as the threshold for the total throughput while the detection threshold is the coefficient of the noise power. The channel model between FC and each node is similar to (2). Considering the fact that the typical circuit power consumption of ZigBee is approximately 40 mW, the energy consumed for listening is approximately 40 nJ. The processing energy related to the signal processing part in the transmit mode for a data rate of 250 kb/s, a voltage of 2.1 V, and current of 17.4 mA is approximately 150 nJ/bit. Since we use one bit per decision, the sensing energy of each cognitive sensor is C s  = 190 nJ [17, 18]. Assuming a data rate of 250 kb/s and a transmit power of 20 mW, C t-elec  = 80 nJ. The e amp to satisfy a receiver sensitivity of −90 dBm is 40.4 pJ/m2. Simulation results are averaged over 1000 independent simulation runs. The proposed algorithms are compared with the following algorithms in simulation:

  • MPDA & MEA algorithms combination: Maximum probability of detection (MPDA) is the algorithm in which, sensors are sorted according to their \( P_{{d_{j} }} \)s in descending order. Therefore, the nodes with the maximum \( P_{{d_{j} }} \) are selected for spectrum sensing, so that the number of selected nodes is less than M and \( P_{d} > \beta \) constraint is satisfied. However, Minimum Energy algorithm (MEA) is the algorithm in which, sensors are sorted in ascending order according to their distances from the FC and nodes with minimum distances are selected for data transmitting until the constraint on T is satisfied. With combination of these algorithms, MPDA is used for selecting the sensing nodes and MEA is applied for determining the nodes which transmit their data to the FC [13].

  • Random algorithm (RA): In this algorithm, sensors are randomly selected for spectrum sensing and transmitting data until the constraint on P d and T are satisfied, respectively. The number of selected sensing nodes is less than M.

Figure 2 shows the successful percent of finding the solution versus different dimensions of environment. This metric for every algorithm shows the ability of the algorithms in finding the answer when the problem constraints (i.e., the constraints on the global probability of detection and the network throughput) are satisfied. In the other words, in some scenarios it is possible that the feasible set of the problem becomes empty and in such cases there is no solution for the problem. This metric shows the ability of the algorithms in finding a solution in the feasible set of the problem. SMTMEA has the maximum percent of finding the solution while the other algorithms have lower percentage in finding the solution in the feasible set. RA has the minimum percentage in finding the solution; it shows that the random selection of sensors cannot satisfy the detection and throughput constraints simultaneously. In all algorithms, this metric decreases by increasing the dimensions of the environment; the reason is that, the distance of each node from the primary user is increased; therefore, probability of detection for each node is reduced and more nodes should sense the spectrum until the probability of detection constraint is satisfied while it is not possible in some cases due to constraint (18-1). In addition, by increasing the dimensions of the environment, the distance between each sensor from FC increases and therefore, the total throughput decreases. In this simulation, total number of nodes equals to 30.

Fig. 2
figure 2

Successful percent of finding the solution for different environments

In Fig. 3, the energy consumption for all algorithms versus different dimensions is shown when all algorithms find a solution in the feasible set. SMTMEA has the minimum energy consumption compared to MESMTA, MPDA&MEA and RA algorithms. When the dimensions of the environment become larger, in all algorithms the energy consumption increases; because more nodes need to sense the spectrum and more nodes must transmit their data to the FC for satisfaction of (18-3). In addition, in large environments, distance between sensors and primary users and distance between sensors and FC increase considerably so that more energy must be consumed to satisfy of the minimum sensitivity of the receivers.

Fig. 3
figure 3

Energy consumption for different environments

Figure 4 shows the average throughput for all algorithms versus different dimensions of the environment. It is clear that MESMTA, SMTMEA and MPDA&MEA satisfy the threshold constraint while RA cannot maintain the threshold constraint. All algorithms are compared when the global probability of detection constraint is satisfied.

Fig. 4
figure 4

Average throughput for different environments

Figure 5 shows the successful percent of finding the solution versus different number of the nodes. SMTMEA, MESMTA and MPDA&MEA have the maximum percent in finding the solution. When number of nodes increases, this metric for all algorithms increases, because it is possible that more nodes are located near the primary user and FC and therefore the global probability of detection and the total throughput are improved, respectively. In this scenario, the nodes are distributed in the square field with the length of 1000 m.

Fig. 5
figure 5

Successful percent of finding the solution for different total nodes

In Fig. 6, we show the energy consumption versus different number of nodes. SMTMEA algorithm consumes the minimum energy while the constraint on the total probability of detection and the network throughput is satisfied. RA has the maximum energy consumption.

Fig. 6
figure 6

Energy consumption for different total nodes

In Fig. 7, the average throughput versus different number of nodes is shown. The throughputs of our proposed algorithms are approximately the same while RA has the minimum throughput due to the random selection of the nodes. All algorithms are compared when the global probability of detection constraint is satisfied.

Fig. 7
figure 7

Average throughput for different number of nodes

Figure 8 shows the total average throughput versus different values of throughput threshold. Our proposed algorithms satisfy the throughput constraint while RA cannot obtain the minimum required throughput. Number of nodes equals to 30 and the sensors are distributed randomly with a uniform distribution in the square field with the length of 1000 m.

Fig. 8
figure 8

Average throughput for different threshold

6 Conclusions

The attenuation in the signal due to shadowing, fading or other impairments can lead to inappropriate detection of the primary signal by a single detector. Cooperative spectrum sensing is proposed as a solution to overcome the shadowing and fading effects. It is not necessary for all sensors to participate in spectrum sensing, because, increasing the number of cooperating sensors can decrease the required detector sensitivity and sensing time significantly. However, it should be considered that as the number of cooperating sensors increases, the communication overhead will also increase in terms of exchanged messages and processing overhead.

We proposed two algorithms for energy-efficient cooperative spectrum sensing in cognitive sensor networks. Using these algorithms, the sensing nodes and data transmitting sensors were determined so that the constraints on the detection performance and the minimum required throughput were satisfied. We formulated our problem and using convex optimization methods and KKT conditions, the nodes which sense the spectrum and the sensors which only transmit their data were selected. Simulation results showed that our algorithms are very effective in saving energy and improving the network throughput.