# On Optimal Cooperative Sensing with Energy Detection in Cognitive Radio
## 2 System Model
### Energy Detection and Sensing Performance Metrics  
Let \(\tau\) be a continuous value denoting sensing duration. Under the absence of PU (hypothesis \(\mathcal{H}_{0}\)), the received signal at a sensing node is given by  
\[r(t)=n(t),\]  
where \(n(t)\) is the noise power at time \(t\). Under the presence of PU (hypothesis \(\mathcal{H}_{1}\)), we have  
\[r(t)=h(t)\cdot s(t)+n(t),\]  
where \(s(t)\) is the received PU signal and \(h(t)\) is the channel gain at time \(t\). We assume that \(n(t)\) is white Gaussian noise with two-sided power spectral density \(N_{0}\) (\(AS\) I), and sensing duration \(\tau\) is short so that the channel can be assumed to be static (\(AS\) II). According to [8], the test statistic using energy detection is given by  
\[T=\frac{1}{N_{0}}\int_{0}^{\tau}|r(t)|^{2}dt.\]  
Let \(\gamma\) be the received SNR given by \(\gamma=\frac{p}{N_{0}B}\), where \(P\) denotes the received power of PU at a sensing node, and \(B\) is the channel bandwidth. Under the assumptions of \(AS\) I and \(AS\) II, the received energy of PU signal is simply \(P\tau\). When PU is absent, \(T\) has the central chi-square distribution with the degrees of freedom equal to \(2\tau B\). When PU is present, \(T\) has the non-central chi-square distribution with \(2\tau B\) degrees of freedom and non-centrality parameter \(\delta=\frac{P\tau}{N_{0}}\) equal to \(\gamma\tau B\). Based on the central limit theorem (CLT), when \(2\tau B\) is more than \(250\), \(T\) under two conditions can be considered as Gaussian random variables [8]. \[T\sim\left\{ \begin{array}{ll}&\mathcal{N}\big{(}2\tau B,4\tau B\big{)},\quad \quad\quad\quad\quad\quad\quad\quad\quad\quad\text{under }\mathcal{H}_{0},\\ &\mathcal{N}\big{(}2\tau B+\gamma\tau B,4\tau B+4\gamma\tau B\big{)},\quad \text{under }\mathcal{H}_{1},\end{array} \right. \tag{1}\]  
where \(\mathcal{N}\left(m,\sigma^{2}\right)\) represents the normal distribution with the mean \(m\) and the variance \(\sigma^{2}\). From now on, we assume that \(2\tau B\) is large enough so that the CLT condition is met, and thus \(T\) is a Gaussian random variable. Suppose that we have \(N\) cooperative sensing nodes using energy detection. Let \(\epsilon_{i}\) be the detection threshold and \(P_{i}^{d}\) be the probability of detection, i.e., \(P_{i}^{d}=P\left(Y\geq\epsilon_{i}|\mathcal{H}_{1}\right)\) at a sensing node \(i\in\{1,\cdots,N\}\)[11; 13]. Then, we have  
\[P_{i}^{d}(\epsilon_{i},\gamma_{i},\tau,B)=\mathcal{Q}\left(\frac{\epsilon_{i} -\big{(}2\tau B+\gamma_{i}\tau B\big{)}}{\sqrt{4\tau B+4\gamma_{i}\tau B}} \right), \tag{2}\]  
where  
\[\mathcal{Q}(t)=\frac{1}{\sqrt{2\pi}}\int_{t}^{\infty}\exp\left(\frac{-u^{2}}{ 2}\right)du. \tag{3}\]  
Let \(P_{i}^{f}\) denote the probability of false alarm, i.e., \(P_{i}^{f}=P\left(Y\geq\epsilon_{i}|\mathcal{H}_{0}\right)\) at a sensing node \(i\in\{1,\cdots,N\}\)[11; 13], and we have  
\[P_{i}^{f}(\epsilon_{i},\tau,B)=\mathcal{Q}\left(\frac{\epsilon_{i}-2\tau B}{ \sqrt{4\tau B}}\right). \tag{4}\]  
We notice that there is no PU signal present under \(\mathcal{H}_{0}\), and then \(P_{i}^{f}\) is independent of \(\gamma_{i}\). However, when \(h(t)\) is varying due to shadowing/fading, \(P_{i}^{d}\) gives the detection probability conditioned on theinstantaneous SNR \(\gamma_{i}\). In this case, the average detection probability can be derived by averaging (2) over fading statistics. \[\tilde{P}_{i}^{d}=\int\mathcal{Q}\left(\frac{\epsilon_{i}-\left(2\tau B+\gamma_{i }\tau B\right)}{\sqrt{4\tau B+4\gamma_{i}\tau B}}\right)f_{\gamma}(\gamma_{i})d \gamma_{i}, \tag{5}\]  
where \(f_{\gamma}(\gamma_{i})\) is the probability distribution function (PDF) of SNR under fading/shadowing and its mean value is \(\gamma_{i}\)[25]. In addition to the aforementioned probabilities, the probability of miss detection is \(P_{i}^{m}=1-\ P_{i}^{d}\), and the probability of correct rejection is \(P_{i}^{c}=1-P_{i}^{f}\) at a sensing node \(i\in\{1,\cdots,N\}\). During cooperative sensing, a PU is assumed to be either present or absent.