## 4 Spectrum Sensing in Maritime Cognitive Radio Networks
### Optimization of the Number of Samples and the \(m\)-out-of-\(n\) Rule  
It is obvious that the detection probability is increased with the increase in the number of samples in both entropy and energy detector-based local sensing. However, it has been shown that the entropy detector needs \(10,000\) samples, while the energy detector needs 18,000 samples to achieve the same detection probability [17]. It is important to find the optimal number of samples for the sea environment to achieve a better detection probability. Therefore, one of the optimization problems can be formulated as follows:  
\[Minimize:N\] \[Subject\:to:P_{d}\geq\alpha_{L} \tag{15}\] \[P_{f}\leq\beta_{L}\]  
where \(N\) is the number of samples for entropy-based detection, \(\alpha_{L}\) and \(\beta_{L}\) are the corresponding local target probability of detection and a false alarm, respectively.  
A time division multiple access (TDMA) approach is considered for reporting local decisions to the central entity/fusion center in the proposed cooperative spectrum sensing. Let \(\tau_{r1}\) be the reporting time for each SU to report its local decision to the central entity/fusion center. The total reporting time is \(\tau_{r}=n\tau_{r1}\) for a network of \(n\) SUs. The throughput of the MCRN is increased by reducing the reporting time. Moreover, nearby ships have to face spatially correlated channel conditions, because the sea state remains the same for them. Therefore, \(n\) is one of the arguments for optimization. The global probability of a false alarm, \(Q_{f}\), calculated using the local probability of a false alarm in Equation (13) is also a part of the optimization. Moreover, the global probability of detection should be greater than a given value, \(\alpha_{G}\).  
\[Find:m^{*},n^{*}\] \[Minimize:\frac{1}{Th}\] \[Subject\;to:sea\;state\leq\zeta\] \[1\leq m\leq n \tag{16}\] \[1\leq n\leq\left\lfloor\frac{T-\tau_{s}}{\tau_{r}}\right\rfloor\] \[Q_{d}\geq\alpha_{G}\] \[Q_{f}\leq\beta_{G}\]  
\(Th\) is the achievable practical throughput given in Equation (14); \(\alpha_{G}\) and \(\beta_{G}\) are the corresponding global targeted probabilities of detection and false alarms for cooperative spectrum sensing in MCRN.  
The optimization problems given in Equations (15) and (16) are not convex optimization problems. Therefore, the penalty method and numerical enumeration is used to find optimal values. A penalty function technique [25] is useful for solving constrained optimization problems. The penalty function is formulated for the constrained optimization problem given in Equation (15), and then, a simplex search method, which is an unconstrained algorithm, is applied. Using the penalty function in Equation (15), we found the augmented objective function as:  
\[\theta_{1}(\epsilon_{1})=N+\epsilon_{1}[(max\{0,\alpha_{L}-P_{d}\})^{2}+(max\{ 0,P_{f}-\beta_{L}\})^{2}] \tag{17}\]  
where \(\epsilon_{1}\) is the penalty parameter and should be greater than zero.  
Similar to the solution of Equation (15), the penalty function technique is used to solve the constrained optimization problem given in Equation(16). The constrained problem in Equation (16) can be transformed into an unconstrained one by penalizing constraints and making a single objective function. Later, by using the unconstrained optimization algorithm, the unconstrained problem can be solved. Using the penalty function in Equation (16), we found the augmented function as follows:  
\[\theta_{2}(\epsilon_{2})=\frac{1}{Th}+\epsilon_{2}[(max\{0,sea\; state-\zeta\})^{2}+\] \[(max\{0,m-n\})^{2}+(max\{0,1-m\})^{2}+(max\{0,n-\left\lfloor\frac{T- \tau_{s}}{\tau_{r}}\right\rfloor\})^{2}+ \tag{18}\] \[(max\{0,1-n\})^{2}+(max\{0,\alpha_{G}-Q_{d}\})^{2}+(max\{0,Q_{f }-\beta_{G}\})^{2}]\]  
where the penalty parameter, \(\epsilon_{2}\), should be greater than zero. The simplex search method is also applied to find optimal \(m^{*}\) and \(n^{*}\) for the unconstrained problem formulated in Equation (18).