# A Crowd Cooperative Spectrum Sensing Algorithm Using a Non-Ideal Channel
## 3 Utility Optimal Algorithm  
The base station first releases information about the channel to be sensed, the correct reward \(k\) and incorrect reward \(k^{\prime}\) for the SUs. The SUs optimize the sensing time and signal transmission power to obtain the optimal utility expectation of the SUs according to the utility expectation formula. If the utility expectation is greater than 0, the SU would execute the sensing and send its sensing result to the base station. After the data fusion, the base station will offer the rewards to SUs in accordance with  
Figure 1: System scenario. the correctness of the decision received, if the result of SU \(i\) is the same with the result of the fusion decision, SU \(i\) can get the correct reward \(k\), otherwise the reward is \(k^{\prime}\). The reward expectation of SU \(i\) is given by:  
\[\text{re}_{i}=k\cdot p_{i}^{rc}+k^{\prime}\cdot p_{i}^{rin}. \tag{9}\]  
The utility expectation of SU \(i\) can be expressed by:  
\[utility_{i} = \text{re}_{i}-c\cdot t_{i}-c_{s}\cdot s_{i} \tag{10}\] \[= k\Big{\{}[p(u_{1})p_{i}+p(u_{0})(1-p_{f})](1-p_{e})+[p(u_{1})(1-p _{i})\] \[+p(u_{0})p_{f}]p_{e}\Big{\}}+k^{\prime}\Big{\{}[p(u_{1})p_{i}+p(u_{0 })(1-p_{f})]p_{e}+\] \[[p(u_{1})(1-p_{i})+p(u_{0})p_{i}](1-p_{e})\big{\}}-c\cdot t_{i}-c_ {s}\cdot s_{i}\]  
where \(s_{i}\) indicates the signal transmission power of SU \(i\). \(c\) and \(c_{s}\) represent the cost of unit sensing time and the cost of unit transmission power, respectively. In order to improve the efficiency of spectrum sensing, a SU will not take part in the spectrum sensing if the detection probability is less than 0.5, because the sensing result does not have reference value. Hence a SU will take part in the spectrum sensing when the detection probability is greater than 0.5. It is known from the properties of Q function that if the detection probability is greater than 0.5, the argument of the Q function in (2) is less than 0, i.e.,  
\[\frac{Q^{-1}(p_{f})-\sqrt{t_{i}f_{s}}\gamma_{i}}{\sqrt{2\gamma_{i}+1}}<0. \tag{11}\]  
The goal of this paper is that the SU can obtain the optimal utilities by optimizing the sensing time and the transmission power, and the optimization problem can be expressed as follows:  
\[P1: \min_{\{t_{i},s_{i}\}}\ (-utility_{i}) \tag{12}\] \[s.t. -t_{i}+\frac{1}{f_{s}}\cdot(\frac{Q^{-1}(p_{f})}{\gamma_{i}})^{2}<0,\] (13) \[-s_{i}<0, \tag{14}\]  
where the constraint condition (13) is derived from (11), and (14) indicates that the transmission power of the SU is greater than 0. As long as the optimization problem is proved to be a convex optimization problem, the optimal sensing time and transmission power can be obtained through the KKT conditions [23]. **Proposition 1**. : _Optimization problem \(P1\) is a convex optimization problem._  
The proof is given in Appendix A. Set \(X_{i}=(t_{i},s_{i})\), and \(h_{k}(X_{i})<0,k=1,2\) represents 2 constraints on convex optimization problem. We define the Lagrangian equation as follows:  
\[\text{re}_{i}=k\cdot p_{i}^{rc}+k^{\prime}\cdot p_{i}^{rin}. \tag{9}\]0  
Thus, the KKT condition for the convex optimization problem is given by:  
\[\text{re}_{i}=k\cdot p_{i}^{rc}+k^{\prime}\cdot p_{i}^{rin}. \tag{9}\]1  
\[\text{re}_{i}=k\cdot p_{i}^{rc}+k^{\prime}\cdot p_{i}^{rin}. \tag{9}\]2\[\text{re}_{i}=k\cdot p_{i}^{rc}+k^{\prime}\cdot p_{i}^{rin}. \tag{9}\]3  
According to (15), we can get \(\mu_{k}=0,k=1,2\). Hence (14) can be expressed by:  
\[\left\{ \begin{array}{c}\frac{\partial(utility_{i})}{\partial t_{i}}=\frac{1} {2}(k-k^{\prime})(1-2p_{c})[\frac{\gamma_{i}}{2\sqrt{4\pi}r_{i}+2\pi}(t_{i}f_ {s})^{-1/2}e^{-m^{2}/2}k\cdot b_{i}-\frac{c_{i}}{f_{s}}]-c=0\\ \frac{\partial(utility_{i})}{\partial s_{i}}=-\frac{1}{n}(k-k^{\prime})(p_{i}- p_{f})e^{-s_{i}/n}-c_{s}=0\end{array} \right.. \tag{18}\]  
The optimal sensing time and emission power can be obtained by solving Equation (17).