The Analysis of Closed-form Solution for Energy Detector Dynamic Threshold Adaptation in Cognitive Radio

Spectrum sensing is the most important process in cognitive radio in order to ensure interference avoidance to primary users. For optimal performance of cognitive radio, it is substantial to monitor and promptly react to dynamic changes in its operating environment. In this paper, energy detector based spectrum sensing is considered. Under the assumption that detected signal can be modelled according to an autoregressive model, noise variance is estimated from that noisy signal, as well as primary user signal power. A closed-form solution for optimal decision threshold in dynamic electromagnetic environment is proposed and analyzed.


Introduction
Based on one of popular definitions [1], cognitive radio (CR) is an intelligent wireless communication system that is aware of its ambient environment.This CR will learn from the environment and adapt its internal states to statistical variations in the existing RF stimuli by adjusting the transmission parameters (frequency band, modulation mode and transmit power) in real-time.Sensing function and ability to promptly modify its transmission parameters are unique features and challenges of cognitive radio implementation [2], [3].
Various methods have been proposed for spectrum sensing in CR, which include matched filter, cyclostationary detection, and energy detection [4].Matched filter and cyclostationary detection are coherent detection techniques, with better detection performance than non-coherent energy detection.However, coherent detectors require a priori knowledge about the signal of the primary users (PU) [5].
Matched filter [6] is the optimal detection technique since it maximizes the signal to noise ratio (SNR), but requires demodulation parameters of the PU signal.Cyclostationary detector [7] can detect very weak signals on the basis of their cyclic features, but information about the cyclic characteristics is needed.Non-coherent energy detector [8] is based on comparison of the detected signal energy with the decision threshold.This method does not require any knowledge about the PU signal, and has low implementation complexity compared to matched filter and cyclostationary detection.In addition, the energy detection can provide lower sensing time than the other methods (in the high SNR environments) and can be applied for wideband sensing.On the other hand, the energy detector has many disadvantages such as high sensitivity of the threshold level to variations of the noise level, high sensing time in the low SNR environments, it cannot distinguish primary and secondary user signals as well as signals and noise, and cannot detect spread spectrum signals.Despite the numerous drawbacks, energy detection is the most popular and the most studied technique among all spectrum sensing methods.
The most important process that affects performance of energy detectors is the threshold selection.Various double threshold methods [9], [10] are proposed to improve the threshold selection process.Cooperative sensing with multiple CRs is suggested in [11], while in [12] spectrum utilization factor is applied to minimize the total error sensing probability.One solution to improve the performance of the energy detector is to make use of time reversal technique, what was analyzed in ultra-wideband systems [13].Application of the energy detector method for spectrum sensing with the use of random sampling is evaluated in a comparison with the uniform sampling case in [14].Exact closed-form expression for the optimal detection threshold for different receiver diversity systems was derived in [15].Improved reliability with multiple threshold values determination by using fuzzy entropy maximization was suggested in [16].In [17], authors propose an algorithm for energy detection threshold adaptation assuming that the noise power is completely known at the cognitive user.Also, many algorithms use a fixed decision threshold to distinguish PU signals from the noise.For example, an experimental threshold is set in [8] by measuring the noise power.However, in practical systems, the noise power fluctuates due to the temperature changes, ambient interference, and it is difficult to guarantee the detection probability and the false alarm probability with the fixed threshold setting.
In order to achieve better performance and to improve reliability of detection, CR as environment-aware system should dynamically adapt the decision threshold according to the changes in the environment.In [18], energy-based spectrum sensing in dynamic scenarios is studied and an iterative gradient-based algorithm for sensing the threshold adaptation is proposed.The iterative approach is often impractical, since it requires an initial estimate to ensure global convergence.Also, iterative approach can be computationally inefficient.On the other hand, closed-form solution provides optimal decision threshold in a single step and does not require initial estimate values, resulting in a lower spectrum sensing time.Also, closed-form solution is more efficient from the viewpoint of arithmetical operations, which improves general performance of the cognitive radio spectrum sensing process.This motivated the work presented in this paper, which studies energybased spectrum sensing in dynamic scenarios, and proposes and analyses a closed-form algorithm for the sensing threshold adaptation, assuming that the noise power is not known at the cognitive user.
The paper is organized as follows: System model and general problem description are presented in Sec. 2. Noise and PU signal variance estimation are given in Sec. 3. Threshold determination and analysis of closed-form solution are presented in Sec. 4. Simulation results are shown in Sec. 5.The main conclusion of the work is given in Sec. 6.

System Model
Environment with the PU as an M-quadrature amplitude modulation (16-QAM) signal is considered.Transmitted signals are passed through the channel with additive white Gaussian noise (AWGN).From the detected input signal (N number of samples), CR estimates variances of the noise and the PU signal.According to the estimated parameters, CR determines the threshold level and performs test statistic for spectrum sensing.The system model is schematically described in the block diagram of Fig. 1.
After the CR processing along with the analog to digital conversion (ADC), the received signal c(n) can be expressed as with s(n) being the active radio signal generated by the PU and (n) the AWGN, with zero mean and variance σ  2 (n).Signal s(n) can be considered as a Gaussian random process, with variance σ s 2 (n) [19].
Test statistic for the energy detector is implemented as the time average of the received signal energy with t(n) as an average power of the received CR signal at the time instant n.Binary hypothesis is performed at any given time instant n in order to estimate occupancy of the frequency band, where H 0 and H 1 denote hypothesis of the absence and the presence of the PU signal, respectively, as formulated by The decision rule is given by where γ(n) is the decision threshold determined at the time instant n.Performance of the spectrum sensing can be evaluated through the probability of detection of active PU, P d , and the probability of false alarm for presence of active PU, P fa , which is given in the terms of Q function [19] as Based on ( 6) and ( 7), performance of the spectrum sensing at any time instant n highly depends on the threshold value γ(n).Higher P d means less harmful interference to PU and less P fa means less missed transmission opportunities and therefore better spectrum utilization.Large value of P d and small value of P fa are the design goals.Improving one of these performance indicators implies degradation of the other one, so a trade-off between these two parameters is determined by γ(n).To optimize the spectrum sensing process, both P d and P fa should be considered, and they are combined into a single criterion -spectrum sensing error (SSE), ε(γ(n)) [20] as where α (0 < α <1) is a weighting factor for the probability of the false alarm relative to the probability of detection.
The goal is to minimize SSE in order to improve performance of the energy based spectrum sensing in dynamic scenarios.In this paper, we propose a closed-form solution for the optimal decision threshold γ(n) and a dynamic adaptation to time variation of the PU signal and unknown noise, causing the system to respond to the changes in the environment.

Estimation of Noise and PU Power
Under the assumption that the signal detected by CR can be modelled according to an autoregressive (AR) model of the order p, then the noise power level, which is equal to the noise variance σ  2 (n), can be estimated from the noisy AR signal [21].PU signal s(n) and the noise signal (n) are uncorrelated, thus PU signal variance σ s 2 (n) can be estimated based on the calculated variance of CR signal σ c 2 (n) as Transfer function of the p-th order AR model representation of the signal s where a j are parameters of the AR model, estimated by using the least squares procedure, and they satisfy the set of the Yule-Walker equations [22].Relation between the autocorrelation coefficients of the uncontaminated signal s(n) and the CR detected signal c(n) is given as [22]  where R s ( j) and R c ( j) represent autocorrelation coefficients of the uncontaminated signal s(n) and CR signal c(n), respectively.
Finally, from ( 11) and ( 12) the noise power estimation is given by where R ̂c ( j) is an estimate of the autocorrelation coefficients of the CR signal c(n), obtained from an overdetermined set of q > p high order Yule-Walker equations using the least squares procedure [22].

Threshold Determination and Dynamic Adaptation
Function of the SSE, specified by (8), is strictly convex function of the threshold γ(n), for given value of α.Next, let  ε(γ(n)) / γ(n) = 0 and according to ( 6), ( 7) and ( 8) a quadratic equation for the decision threshold is obtained Let us define S(n) = σ s 2 (n)/σ  2 (n) as a signal to noise ratio (SNR).Solving the quadratic equation ( 14), two normalized solutions are obtained as Determined decision threshold must be a real number, non-negative, and larger than the estimated noise variance.Accordingly, discriminant of ( 15) must be non-negative.If the discriminant in (15) is in the range [0,1], two solutions for the decision threshold are obtained.Decision threshold must be positive, so in the case that the discriminant in (15) is larger than 1, only one solution for the decision threshold is possible.If the sensing time in the process of spectrum sensing is predefined, the design goal for the CR, which is expressed through the weighting factor α, must be adjusted to the environmental conditions.
Having in mind satisfaction of the requested conditions for the decision threshold and analyzing (15), it is determined that weighting factor α must satisfy at any time instant n.In this case, determined decision threshold γ(n) as a solution of ( 15) is unique and is given by In all the other cases, the design goal (weighting factor α) should be modified and adjusted to its dynamic environment according to (16).
Finally, the proposed algorithm for the threshold determination and adaptation of the energy detector based spectrum sensing is described below: Algorithm: Threshold adaptation algorithm for the energy detector-based spectrum sensing 1: Calculate the average energy of the received CR signal using (2).
2: Calculate the unbiased estimate of the autocorrelation coefficients R s ( j).
3: Compute the AR parameters using the least squares procedure and verify whether the Yule-Walker equations ( 11) and ( 12) are satisfied.
4: Find the variance of the detected signal σ c 2 (n), and estimate the noise power σ  2 (n) from ( 13).
7: If yes, the optimal threshold value γ(n) is determined according to (17).If no, the design goal must be modified and adjusted; get back to step 6.
For application of the proposed algorithm in practice, it is important to estimate the computational burden by determining the algorithm order of complexity.The number of samples used by CR, N, directly influences the spectrum sensing time, which is directly connected to the spectrum usage efficiency of CRs, as well.Analyzing the algorithm, the order of complexity of with respect of the number of samples N is obtained as O(N), which indicates efficient implementation.It is important to note that the closed form solution always leads to the threshold value in a finite number of steps, in contrast to iterative procedures.

Simulation Results
Evaluation of the proposed dynamic spectrum sensing algorithm is performed by 1 200 Monte-Carlo simulations.Array of 1 000 16-QAM symbols [23], which are considered as the PU signals, were generated and passed through the channel with AWGN.The AWGN has unknown SNR features, and its variance should be estimated by the CR assuming AR model with the order parameters p = 2 and q = 78 [18].Weighting factor α = 0.2.
Figure 2 illustrates the dynamic adaptation of the decision threshold for various levels of SNR.From Fig. 2, the decision threshold is dynamically changing according to (17), depending on the SNR in the environment.The first 400 simulated PU signals (array of 16-QAM symbols) were exposed to AWGN, with SNR = 0 dB.For the next 400 simulations, SNR was increased for 3 dB.Finally, for the last 400 simulations, SNR was decreased for 6 dB.It should be noted that the value of the decision threshold is lower for higher SNR and vice versa.For each simulation, weighting factor α satisfied (16).

Conclusion
In this paper, an algorithm for the decision threshold determination and adaptation in energy-based spectrum sensing is proposed.The algorithm is based on the noise and the PU signal power estimation through the usage of AR model and Yule-Walker high order equations.The closed-form solution for the optimal decision threshold is proposed and analyzed.Simulation results confirmed effectiveness of the proposed method for optimizing the sensing threshold as well as the capability for dynamic adaptation according to the changes in the operating environment.Also, order of complexity of the algorithm indicates efficient implementation.