Fast Two-Step Energy Detection for Spectrum Sensing

Spectrum sensing is one of the key tasks in cognitive radio. This paper proposes a fast two-step energy detection (FED) algorithm for spectrum sensing via improving the sampling process of conventional energy detection (CED).The algorithm adaptively selects N-point or 2N-point sampling by comparing its observed energy with prefixed double thresholds, and thereby is superior in sampling time and detection speed. Moreover, under the constraint of constant false alarm, this paper optimizes the thresholds from maximizing detection probability point of view. Theoretical analyses and simulation results show that, compared with CED, the proposed FED can achieve significant gain in detection speed at the expense of slight accuracy loss. Specifically, within high signal-to-noise ratio regions, as much as 25% of samples can be reduced.


Introduction
With the rapid growth of wireless communications, the issue of spectrum resource scarcity has been causing deep concern.Cognitive radio (CR) is considered as an efficient approach to solve this problem via opportunistic spectrum access [1,2].In CR systems, the secondary user (SU) is not allowed to access the licensed spectrum that is being occupied by a primary user (PU).Otherwise, if no active PU is found, the vacant spectrum can be utilized [3].Therefore, the task to detect whether the target PU is present or not, namely, spectrum sensing, is of great significance for CR.
Three classic spectrum sensing technologies are matched filter detection (MFD), cyclostationary feature detection (CFD), and energy detection (ED).MFD is viewed as the most accurate method but requires detailed prior knowledge of PU signal [4].CFD performs reliably even with very low signal-to-noise ratio (SNR), while its computational complexity is a bottleneck [5].Compared with them, ED does not require any prior information and consumes little calculation [6] and thereby is widely applied to detect PU.
ED suffers from server performance degradation at low SNR [6].To improve its performance, [7][8][9] present some ED-CFD hybrid schemes that firstly perform ED to search for PU and then reuse the observations to conduct CFD if target PU is not detected by ED.These schemes can achieve better performance under awful noise conditions, while their complexity is high because of CFD.To solve this problem, [10][11][12] consider performing ED twice to avoid CFD.In [10], two thresholds are preset and decisions are made directly in case that the observed energy is either large enough or small enough.Otherwise, the second ED is implemented additionally.This method can improve detection accuracy to some extent but is sensitive to noise uncertainty.An adaptive double-threshold energy detection (AED) method is proposed in [11], which adjusts its thresholds according to SNR to combat noise uncertainty.It should be pointed out that these methods are all committed to improve detection accuracy, while ignoring the importance of detection time.Reference [12] investigates the detection accuracy of AED and analyzes its detection time, indicating that the former is improved at the cost of the latter.Since long detection time impairs system throughput and agility [13], it is necessary to dig into the issue of fast ED.
As is known, the whole detection comprises sampling and calculation processes.Due to the reasons that calculation in ED is rather simple and time required by this process can be neglected, given certain sampling frequency, detection time of ED is mainly determined by its sampling number [14].In this paper, a fast two-step ED (FED) scheme is proposed via improving the sampling process of conventional energy detection (CED) and reducing its sampling number.This new scheme can achieve great gain in detection speed at the expense of slight accuracy loss.The rest of our paper is organized as follows.CED is briefly introduced in Section 2. In Section 3, FED is discussed and its performance is analyzed.A method to determine the optimal thresholds is also provided.Simulation results are presented in Section 4 and conclusions are drawn in Section 5.

Conventional Energy Detection
In CED, whether a target PU is present is determined by comparing the received energy with the preset thresholds, which can be modeled as a binary hypothesis described as where () represents the received signal at SU's receiver; () and () denote the PU signal and the additive noise, respectively;  1 and  0 stand for the hypotheses of PU's presence and absence, respectively.In this case, the test statistic of CED is given by where  denotes the received energy and  means the sampling number.Assume the noise is AWGN with zero mean and unit variance and PU transmits constant-power signal.Since  is usually very large,  approximately follows Gaussian distributions [15]: where  is the received SNR measured by SU.
In CED, SU can make decisions on whether PU is present or not ( 1 or  0 ) as follows: where  is the preset decision threshold.The detection accuracy of CED is usually evaluated in terms of two metrics, namely, the false alarm probability (  ) and the detection probability (  ): where ( |  0 ) and ( |  1 ) are the conditional probability density functions of  under hypotheses  0 and  1 , respectively.According to (3), we can rewrite the probabilities as where is the -function.As for the detection time, since the time required for calculation is negligible, it is mainly determined by the sampling number: where   is the sampling frequency.In the rest of this paper, we will discuss the sampling number  instead of the detection time   for simplicity.

Fast Two-Step Energy Detection
3.1.Algorithm Description.FED is proposed based on CED.Assume 2 samples are collected to calculate energy in CED ( = 2).We equally divide the samples into two parts, as illustrated in Figure 1(b).By comparing its observed energy with the preset thresholds, FED adaptively chooses -point or 2-point sampling.
The algorithm of FED is detailed as follows: two thresholds  1 and  2 ( 1 >  2 ) are preset initially.At the first step,  samples are gathered to measure the received energy  1 .If  1 is high enough and greater than  1 , hypothesis  1 will be accepted directly.Otherwise, the second step will be performed: At the second step, other  samples will be collected to calculate the received energy  2 .If the average value of  1 and  2 is greater than  2 ,  1 will be accepted.Otherwise,  0 will be accepted:

Detection Accuracy Analysis.
Let  1 and  2 denote the false alarm probabilities at the first and the second steps of FED and  1 and  2 represent the corresponding detection probabilities at two steps, respectively.Then we have ) , ) . ( Note that  is the sampling number of each step.
According to the algorithm, final false alarm probability and final detection probability of FED, namely,   and   , can be formulated as Substituting (10) into (11), we get ) . (12)

Optimization of Double Thresholds.
As shown in (12), detection accuracy is closely related to  1 and  2 .In this subsection, we deduce the optimal double thresholds via maximizing   for a given   .The optimization problem can be described as Subject to: where  is the predetermined false alarm probability.This conditional extreme value model can be solved by Lagrange multiplier method.Define the following: Then the Lagrange function is where  is a constant.Rewriting   ( 1 ,  2 ) and ( 1 ,  2 ) with the error function erf() = 1 − 2( √ 2), we can get Taking the first-order partial derivative of ( 17) with respect to  1 and  2 , respectively, and combining ( 18) and ( 19) to eliminate , we can get the relationship between  1 and  2 : Moreover, based on ( 14), another equation can be obtained as Consequently, given the parameters , , and , the optimal  1 and  2 can be deduced according to (20) and (21).Based on these two thresholds, we can maximize detection probability subject to certain false alarm probability.

Average Sampling Number
Analysis.The proposed FED scheme adaptively chooses -point or 2-point sampling.Let  0 and  1 represent the prior probabilities of hypotheses  0 and  1 , respectively.Then the average sampling number of FED can be expressed as Without loss of generality, assume  0 =  1 = 0.5 in this paper.Then we have Since 0 <  1 +  1 < 1 [16], the bounds of average sampling number in FED are given by Note that CED always performs 2-point sampling.So FED certainly collects fewer samples and is faster than CED.In addition, as much as 25% of samples and detection time can be reduced at most compared with CED.

Simulation Results
In this section, simulation results are provided to verify the FED algorithm and its theoretical conclusions.Figures 2 and 3 show final false alarm probability and detection probability of FED algorithm versus  2 , respectively.Simulation settings are  0 = 0.5,  = −5 dB,  = 100 [17], and  = 0.1, 0.05, 0.01.For any given  2 , corresponding  1 is obtained according to (21).As shown in Figure 2, final false alarm probability is always equal to .In other words, a pair of thresholds satisfying (21) ensures that the constraint on false alarm probability is met.In Figure 3, the optimal  2 (115.0,118.3, 124.6), which is derived from ( 20) and ( 21), is marked on the -axis.Since final detection probability achieves maximum values with the optimal  2 as expected, the effectiveness of ( 20) and ( 21) is certainly verified.In order to evaluate the performances of CED and FED, Figure 4 plots their detection probabilities and average sampling numbers versus SNR under different false alarm constraints  = 0.1, 0.05, 0.01 with  0 = 0.5 and  = 100.According to the top subfigure of Figure 4, in spite of the fact that detection probability of FED is slightly lower, two detection probability curves almost coincide, indicating that detection accuracy of CED and FED is approximately the same.As shown in the bottom subfigure of Figure 4, CED consistently takes 200-point sampling, while the sampling number of FED is between 150 and 200.Since its sampling number is reduced, FED requires less sampling time and completes the detection faster.
In Figure 5, the average sampling number of CED and FED is detailedly compared under different  to highlight the superiority of the latter.It can be seen from this figure that, no matter how  changes, the sample number of CED is always 2 and that of FED varies from 1.5 to 2, which agrees well with (24).Specifically, in the scenarios with high SNR (SU is close to the PU transmitter), 0.5 samples are reduced and as much as 25% of detection time can be saved.
To demonstrate the effect of  0 on detection performance, Figure 6 plots detection probabilities as well as average sampling numbers of CED and FED versus SNR under different prior probabilities  0 = 0.1, 0.5, 0.9.According to the top subfigure of Figure 6, detection probabilities of these two algorithms are little affected by  0 , while in the bottom subfigure of Figure 6, we can see that the sample number of CED is always 2 and that of FED increases as  0 increases.The reason is that higher  0 means larger possibility of PU's absence, and FED prefers taking 2-point sampling when PU is absent.

Conclusions
A FED scheme for spectrum sensing is proposed via improving the sampling process of CED.Detection accuracy of this new scheme is analyzed.Moreover, we deal with the optimization problem and provide a method to deduce its optimal double thresholds.The average sampling number of FED is also discussed.We prove that, compared with CED,

Figure 1 :
Figure 1: Sampling process of CED and FED.

5 numberFigure 4 :
Figure 4: Performance of CED and FED versus  under different .

Figure 5 :Figure 6 :
Figure 5: Comparison of average sampling number under different .