A new mathematical analysis of the probability of detection in cognitive radio over fading channels

Cognitive radio (CR) enriches wireless technology systems by harnessing spectrum white spaces. Such systems require continuous and reliable sensing to provide high-quality service to their users and to minimize the interference they may cause to legacy networks. As the simplicity of implementation of energy detectors and their incoherent requirements make them an ideal candidate for this type of application, this work provides a further mathematical analysis to the probability of detection over different fading channels. We derive a tight closed-form expression for the probability of detection over Nakagami channels. In addition, we introduce an accurate recursive algorithm to compute the probability of detection for an odd degree of freedom over additive white Gaussian noise channels, which has been overlooked in the literature so far. Finally, we present the simulation results which concur with the numerical results and which are also a perfect match with the mathematical expressions derived.


Introduction
The rapid increase of wireless systems and applications raises spectrum demand. However, not all bands of the spectrum are fully utilized at specific times or at specific geographic locations. The Federal Communication Commission (FCC) reported that some of these bands (e.g., unlicensed bands at 2.4 and 5 Ghz) are overcrowded, while others (e.g., licensed bands such as the ultra-high frequency (UHF) band) are inefficiently used. Therefore, technology is emerging to reduce the spectrum scarcity issue by fully utilizing the unused portion of the spectrum. For example, IEEE 802.22 [1] proposes reusing the television (TV) UHF band without causing any interference to TV receivers. Another considers a cellular communication system that utilizes the wireless local area network system (cf. [2]). Researchers often refer to this technology as cognitive radio (CR) systems.
As the main objective of CR systems is the spectrum efficient utilization, an accurate design for a cognitive radio network (CRN) working under a licensed primary network (PN) needs to be considered. While the CRN may have its own frequency band of operation, it can also utilize the white spaces or spectrum holes in frequency bands of the PN to increase its performance and to provide a higher quality of service to its users. As a result, it is considered to be a secondary network relative to the primary network. One of the major challenge of CRN is spectrum sensing, i.e., a highly reliable sensing function must be implemented in the CRN's terminals. This arises from the fact that the CR receiver sensitivity must be as high as possible to detect the presence or absence of a primary user (PU) signal and to invoke other functions in the CR device which also depend mainly on sensing functionality. For example, in order to detect a primary signal, the CR system must have a sensitivity as much as 20 to 30 dB higher than that of the primary system [3]. Therefore, the core of CR systems is the spectrum sensing algorithm which determines the validity of a transmission opportunity.
In this paper, our study is limited to the energy sensing method [4][5][6][7]. In particular, for a local spectrum sensing scenario, i.e., the sensing is accomplished by a single cognitive radio. This detection method can be applied http://jwcn.eurasipjournals.com/content/2013/1/159 to any signal type with fewer computational requirements and a simpler implementation. Although several research papers have investigated the detection process using energy detector over a variety of fading channels (cf. [8][9][10][11][12][13]), the expressions derived for the probability of detection and the probability of false alarms were mainly evaluated for even degrees of freedom (e.g., [14,Eq. 10]). Therefore, we provide an algorithm to compute the detection probability in the case of odd degrees of freedom based on the suboptimal energy detector. Moreover, as spectrum sensing must detect a very low signal-to-noise ratio (SNR), which in turn requires a high degree of precision, the previously derived expressions mainly depend on the number of terms in the summation to get highly accurate results. In addition, they are numerically difficult and depend on other functions while their implementation is also susceptible to truncation errors. Therefore, closed-form expressions for the detection probability are derived. We summarize our contributions as follows: • We provide a highly accurate recursive algorithm to compute the probability of detection for odd degrees of freedom. It should be noted that the mathematical derivation shows the steps of the algorithm when evaluating the detection probability in case of odd degrees of freedom, i.e., it is an algorithm rather than a mathematical derivation. An example of the algorithm importance is the Marcum function in Matlab which accepts only integer values in its third argument. Therefore, when the number of degrees of freedom is odd, the third argument is no longer accepted and the Marcum function cannot be used to evaluate the detection probability in this case. However, our algorithm solves this problem. • We derive a closed-form expression over a Nakagamim fading channel. Here, we use closed form in the sense that no summation and no integration are required. The accuracy of the closed form is very close to the previously reported expressions in which summation and integration are used to get highly accurate results. Our new expressions show how the ratio of the Nakagami parameter m and the average signal-to-noise ratio which affects the receiver operation characteristics (ROC) curves. • We compare the derived expressions to the reported expressions in [14,15] in which summation and integration are used. We also compare our derived expressions to other recently reported expressions, e.g., [16,17], and we show that our new derived expressions can be used with no limitations. Moreover, the derived expressions are more accurate than the recently reported ones with less or almost the same computational complexity.
We also compare our simulation results with the analytical evaluation of the derived expressions.
The rest of the paper is organized as follows. In Section 2, the energy detector, system model, and the derivation of the recursive algorithm are introduced. We derive closed-form expressions for Nakagami channels in Section 3. Simulation and numerical results are introduced in Section 4, and we conclude our paper in Section 5.

Energy sensing model
The sensing process consists of two stages and is controlled by signals from the upper layers to sense a specific bandwidth B, as shown in Figure 1. In the first stage, the received signal x(t) is filtered to the bandwidth of interest B to reject band noise and adjacent signals. It is then amplified using a low noise amplifier and is downconverted to an intermediate frequency. In the second stage, the received signal is sampled and quantized using an A/D converter. Next, a square-law device and an integrator with sensing interval T measures the received signal energy. Finally, the output of the integrator, represented by the test statistic Y, is compared to a predetermined threshold λ to determine the existence (H 1 ) or absence (H 0 ) of a PU.
The existence or absence of a PU signal can be modeled as a binary hypotheses problem as originally proposed by [18,19] and later followed by most researchers [20,21]. This model differentiates between two hypotheses defined as: where s[ n] is the primary user signal component which is assumed to be an unknown deterministic signal, and w[ n] is the noise component which is assumed to be an additive white Gaussian noise (AWGN) with zero mean and variance σ 2 . h is the channel coefficient which is assumed to be constant during the period of observation, i.e., for N samples, H 0 is the hypothesis test when noise only is present and H 1 is the hypothesis test when both noise and signal are present. We also assume that the noise samples are independent and identically distributed, and they are independent of the signal samples. The suboptimal energy detector is defined as: Then, the distribution of the decision variable Y will be central chi-square χ 2 N under H 0 and noncentral chi- that to reduce the overuse of notations, we distinguish between central and noncentral chi-square by the symbol (∼). Thus, using this notation, the distribution can be expressed as [22]: and its probability density function can be written as: where the noncentrality parameter ζ = N i=1 μ 2 i , and μ i is the mean of the ith Gaussian random variable of test Y. I r (.) is the rth-modified Bessel function of the first kind, which has a series representation [23]: Evaluating test Y by the decision device, which is shown in Figure 1, may result in two types of errors. We define the notation P(H i , H j ) to distinguish between these errors. When the decision device decides H 1 but H 0 is true, denoted as P(H 1 ; H 0 ), this is called the probability of a false alarm (P fa ). When the device decides P(H 0 , H 1 ), this represents the probability of misdetection (P md ). The complementary to P md is the probability of detection ). The performance of the energy detector can be characterized by the probability of detection in a low SNR regime. An alternative performance metric is the ROC curves which are generated by plotting P md vs P fa . Following the shorthand notation mentioned previously, the probability of detection and probability of a false alarm can be computed as:

Probability of detection and false alarm under AWGN channels
To derive the probability of false alarm using the righttail probability of the central chi-squared density function Q χ 2 N , we define γ as γ = h 2 ζ σ 2 . a Substituting t = y/σ 2 and further integrating the probability density function in (3) under H 0 results in: The same approach can be used to derive the probability of detection using the right tail of the noncentral chisquared probability density function under H 1 . By letting t = y/σ 2 , the probability of detection is given by: We can rewrite (9) using ( [25], Eq 2.45) for an even number of degrees of freedom as: where λ = λ/σ 2 , and Q m (., .) is the mth generalized Marcum Q function which is given by: (11) which is the same result as in [5].
For an odd number of degrees of freedom (10) cannot be directly evaluated. Therefore, we introduce an algorithm to solve this problem. To do so, we use the series expansion of the modified Bessel function defined in (4) and rewrite (9) as: The second term of (12) represents the right-tail probability of a central chi-square with l = N + 2k degrees of freedom. As a result, for N odd, l = N + 2k is also odd. Thus, (12) can be rewritten using (8) for the odd case which results in (13) and g(λ , l) can be rewritten as: http://jwcn.eurasipjournals.com/content/2013/1/159 (15) can also be reduced to where the initialization starts with G χ 2

Probability of detection and false alarms under Nakagami fading channels
To capture all different types of fading, the parameters of the Nakagami distribution can be adjusted to fit a variety of fading processes. If we defineγ = E[ h 2 ] ζ /σ 2 as the average signal-to-noise ratio, where E(.) denotes the expectation operator, then the probability distribution of γ will be given as: To compute the probability of detection, this must be averaged over the probability density function of the instantaneous value of γ , i.e., it can be written as: Then, substituting (17) into (18) results in: where in the second step, we substitute x = √ γ and η 2 = 2m γ , and in the last step, we substitute 2 (m) m γ m with α. Different combinations of m and N/2 lead to different results for the integration defined in the last step. In the following, the probability of detection is evaluated over both Rayleigh and Nakagami fading channels.

Special case: Rayleigh fading
In the case of Raleigh fading, we set m = 1 and use ( [25], Eq B.53). Then the probability of detection can be written as: where u = N/2.

Nakagami fading
In the case of Nakagami fading, we further simplify the expression in (19) using the series representation of the Marcum Q function [26], which is given by: where L k j is the generalized Laguerre polynomial of degree j and order k. The absolute convergence of the series in (21) has been shown to be absolutely bounded by: Then, substituting (22) into (19) results in (23). Next, by changing the variable M = 2m−1, and further integrating, the first term of (23) can be reduced to: The second term of (23) can be further reduced to: while the third term can be reduced as: Then, the probability of detection under a Nakagami fading channel is the result of (24), (25), and (26) which can be written as: It is clear from (27) how changing various parameters affect the detection process. The new derived expression reveals the fact that the ratio of parameter m to parameter γ is an important consideration when evaluating the probability of detection over Nakagami fading channels. For example, at lowγ < 2 dB and when the degree of freedom u is fixed, the Nakagami parameter m has only a minor effect on the detection process. That means no matter how much m increases, the probability of detection stays almost the same. However, at highγ > 15 dB, increasing m will greatly improve the probability of detection. This will be discussed further in the simulation section.
Another expression for the probability of detection over Nakagmai fading channels can easily be derived by rewriting the right-hand side of (21) as: where we use the notation γ * (., .) to represent the lower incomplete gamma function. Equation (28) is the wellknown canonical representation of the uth order generalized Marcum Q function. Then, with the help of (18) and using ∞ k=0 (a/2) k / k! = exp(a/2) and after simple mathematical manipulation as shown in (24)(25)(26), the probability of detection over Nakagami fading channels can be approximated as: where β = [2m/ (2m +γ )].

Simulation and numerical results
A binary phase shift keying signal b with sampling frequency f s = 10f c , where f c is the carrier frequency, is used to investigate the detection probability for even/odd degrees of freedom. For the even degree of freedom with N arbitrarily chosen to be (10,20), the simulation results are compared to (10). As shown in Figure 2, it can be seen that increasing N or the SNR enhances the probability of http://jwcn.eurasipjournals.com/content detection. Therefore, this result is consistent with most of the reported results in the literature. We also notice that the simulation results coincide with the theoretical ones. Figure 3 shows the detection probability using the recursive algorithm for odd/even degrees of freedom with N = 31, 32 for comparison. As shown, the recursive algorithm perfectly matches the simulation results. Moreover, the accuracy of the recursive algorithm goes up to 15 decimal places, which is the maximum number of digits that Matlab can support. Although there is a small effect on the detection probability when we compare the even/odd cases, in practice and since most current functions deals only with even degree of freedom, this algorithm becomes more beneficial. For example, when evaluating the detection probability using the Marcum function in Matlab with N = 31 (odd), the third argument of the Marcum function will be 15.5; hence, the implemented Marcum function in Matlab cannot be used to evaluate the detection probability in this case as it accepts only integer numbers. However, our algorithm does.
To evaluate the closed-form expressions derived for Nakagami channels, an extensive simulation has been performed using the ROC. The derived expressions are evaluated and compared with the numerical integration of (18) and with the expressions reported by [14][15][16][17]. c In the odd case, the simulation is compared to the recursive formula (13,16) in AWGC, and in the even case, the simulation is compared to (10) in AWGC and to ( [14], Eq. 14). http://jwcn.eurasipjournals.com/content/2013/1/159

Comparison of the derived expressions with Equation 18
In Figure 4, we compare the derived expressions in (27) and (29) with the numerical integration of (18) for different values ofγ and m. Figure 4 also shows the effect of varying the Nakagami parameter m on the misdetection probability at low and high values ofγ which will be discussed in the following subsections.

Low value ofγ
At a low value ofγ , i.e.,γ = −10 dB, it can be seen that increasing the value of m, (m = 1, 2, 3), does not improve the misdetection probability for both derived expressions which concurs with the numerical integration of (18). We also note that (29) exactly matches (18); on the other hand, there is a minor discrepancy between (27) and (18).

High value ofγ
At a high value ofγ , i.e.,γ = 10 dB, increasing m will greatly improve the misdetection probability for both derived expressions (27 and 29), which also concurs with the numerical integration of (18) as can be seen in Figure 4. Further, we notice that at a very low false alarm probability, (29) is less accurate compared to (27). However, as the false alarm probability increases, the results for both expressions match that of the numerical integration of (18).

Comparison of the derived expressions with related works
In this subsection, we compare the new derived expressions with the previously reported expressions for high and low values ofγ and m = 1, 2, 3.

Low value ofγ
In Figure 5, the new derived expressions are compared with the expressions of ( [14], Eq. 20), ( [15], Eq. 12), ( [16], Eq. 13), and ( [17], Eq. 13). It can be seen that at a very low false alarm probability, the results of the new derived expressions in (27) and (29) and all expressions in the previously mentioned references are a good match.
As the probability of false alarm increases, however, a discrepancy arises between ( [16], Eq. 13) and ( [17], Eq. 13) when compared to the new expressions and/or the work of [14,15]. Moreover, as previously shown in Figure 4, at lowγ , increasing m did not enhance the probability of misdetection. This behavior can be seen from (27) and (29) which also concurs with the work of ( [14], Eq. 20) and ( [15], Eq. 12). However, the result of ( [16], Eq. 13) has some discrepancies when the false alarm probability or the value of m increases. Moreover, the result of ( [17], Eq. 13) is not consistent with increasing m. For example, the result at the value of m = 3 is worse than the result at the value of m = 1, 2 as can be seen in Figure 5. We note also that the probability of misdetection approaches zero at the point of (1 − P fa ) for the expressions reported by [16,17]. Figure 6 shows the simulation results for all expressions when evaluated at a high value ofγ . The result of (27) is very close to that of ( [14], Eq. 20) and of ( [15] for the values of m = 2, 3. Moreover, although there are some discrepancies when evaluating (29) as compared to ( [14], Eq. 20) and ( [15], Eq. 12), at a high value of a false alarm probability, the expression (29) is a perfect match. To this end, we conclude that (29) works well at high values ofγ and when P fa > 0. Equation (13) of [16] with m=1 Equation (13) of [16] with m=2 Equation (13) of [16] with m=3 Equation (12) of [15] with m=1,2,3 Equation (20) of [14] with m=1,2,3 Equation (13) of [17] with m=1 Equation (13) of [17] with m=2 Equation (13) of [17] with m=3

Computational complexity
In the previous subsections, we discussed the accuracy of the derived expressions and compared them to the expressions in ( [14], Eq. 20) and ( [15], Eq. 12) that require summation and integration terms to get the needed accuracy. The derived expressions were also compared to the expressions of ( [16], Eq. 13) and ( [17], Eq. 13) that depend on evaluating the gamma function as does the derived expression in (29). To complete the picture, we need another performance metric that distinguishes between these expressions. To do so, a simple Matlab code was written to measure the computation time required of a central processing unit (CPU) to evaluate a point in the ROC domain. We ran the code on a computer equipped with a CPU with a speed of 3.07 GHz on which we cleared all background application processes that might run on the system. e We used 21 points of false alarm probability, i.e., (P fa = 0 : 0.05 : 1) with a step of 0.05. At each point, the code iterated 1,000 times and averaged afterward. The measured computation time of the CPU for all points used and for each expression is plotted in Figure 7. It can be seen that more computation time is required to get highly accurate results. This is evident from the evaluated points of the expressions ( [14], Eq. 20) and ( [15], Eq. 12) as they have the highest computation time. f On the other hand, the derived expression in (27) and the reported expression in ( [17], Eq. 13) have almost the same computation time. Moreover, the expression of ( [16], Eq. 13) has the lowest computation time while the expression of ( [14], Eq. 20) has the highest. The derived expressions can also be compared in terms of the number of multiplications. For example,  (13) of [16] Equation (20) of [14] Equation (12) of [15] Equation (13) of [17]  the derived expression in ( [14], Eq. 20) is based on the summation of confluent hypergeometric functions, and such functions have a computational complexity of order O log 2 (n)M (n) for n-digit precision [27], where n means computing n digits, andM(n) is the bit complexity of multiplication. However, the reported expression of ( [15],12) is based on an infinite series of gamma functions, and such functions have a computational complexity of O √ nM (n) . Using this notation, the derived expressions of (27) n)), which is also consistent with the simulation results of Figure 7, therefore, the derived expressions have a lower complexity than ( [14], Eq. 20) and ( [15], Eq. 12) and have the same computational complexity as ( [16], Eq. 13) and ( [17], Eq. 13).

Conclusions
Spectrum sensing using energy detectors under different fading channels was investigated. We derived tight closed-form expressions for the probability of detection in Nakagami channels. The closed-form expressions can easily be used for Rayleigh fading channels by setting m = 1. The results of the closed-form formula as compared with other expressions based on summation and integration terms are very close. Furthermore, the derived expression of (27) can be used for allγ ; however, there is a minor limitation of using (29) specifically at high values ofγ . Moreover, the derived expressions have a lower computational complexity compared to other expressions with only a very small loss of accuracy. In addition, we introduced an accurate recursive algorithm to compute the probability of detection for an odd number of degrees of freedom under AWGN channels. Our simulation shows that the detection process for a binary phase shift keying signal using the recursive formula perfectly coincides with the recursive algorithm.
Endnotes a In AWGN channels, there is no fading, i.e., h 2 = 1. b Different modulation schemes could be used in the simulation since the derived expression is independent of the modulation used. c For comparison purposes, we have used a value of n = 1 in the expression of [17], Eq. 13), where n represents the number of nodes cooperating in the sensing process according to [17] notations. d 'Equation (29) comes from another way of calculating the probability of detection over Nakagami fading channels in order to compare with results from the state of the art, which seemed rather optimistic for low false alarm probability, and that for high SNR cases, ' one of the anonymous reviewer's comment. e The conducted simulations show that the computed time will only be scaled by a constant factor and that the calculated computation time will not be affected if we do or do not clear the processor cache of any background application processes. f The number of terms used to calculate the summation of [15], Eq. 12) was 20.