Improved Detection Performance of Energy Detector by Optimization of Threshold Using BPSO Algorithm for Cognitive Radio Networks

Cognitive Radio (CR) offers solution to effectively utilize the unused portions of the licensed spectrum by secondary users (SU) on a condition that it will not cause any harmful or no interference to primary users (PU). Spectrum sensing has been identified as a key enabling technique to ensure that SU will not interfere with PU activities. For CR technology, there exist different types of detectors. Energy detector (ED) is one among them as it is easy to implement. The determination of threshold value for an ED which gives the lowest probability of sensing error (i.e., probability of false alarm and probability of miss-detection) in CR still remained an open issue till now. In this paper, we have proposed Binary Particle Swarm Optimization (BPSO) algorithm for the optimization of threshold value of ED which satisfies the lowest sensing error criterion and enhance the detection performance of ED. Our MATLAB simulations show the validity of our proposed algorithm.


Introduction
With the rapid advent of wireless devices using the spectrum resources, the scarcity of spectrum is felt over the past few years.Cognitive Radio (CR) (1,2) has been proposed as a promising solution to the underutilized spectrum of primary users (PU) to secondary users (SU) on a condition that it will not intervene the PU's activity.According to the survey conducted by Federal Communication Commission (FCC), only 25% of the spectrum gets utilized by the PU and most of the time the spectrum remains underutilized (3) .These underutilized spectrums can be utilized by the SU when PUs is not using it with the help of CR technology.
There are several spectrum sensing techniques available as of now.Among several spectrum sensing techniques such as the matched filter detection and the cyclostationary feature detection; energy detection (ED) is the most popular method employed for spectrum sensing.Measuring only received signal power; the ED is a non-coherent detection device with low implementation complexity and works just by measuring the received signal power and comparing with certain threshold to ascertain whether the PU is present or not.All these spectrum sensing techniques are well documented in the literature (4) .
Basically, there exist two kinds of detection errors in spectrum sensing (i.e., miss-detection error and false-alarm error) in spectrum sensing, which degrade the sensing performance severely.However, the threshold of detecting a PU should take into consideration detection errors minimization which includes minimum interference on PU and high spectrum utilization.The determination of threshold value for an ED is still an open issue.The conventional way of setting the threshold of an ED is to fix the false alarm probability of the ED to a desired value and then finding the threshold which may not be the optimum value for the threshold of ED.
In this paper, we have proposed a new idea of optimizing the threshold of an ED using Binary Particle Swarm Optimization (BPSO) algorithm (5) .There is a significant improvement of the detection performance of and ED with the optimized threshold using BPSO algorithm as compared to the conventional method of setting the threshold for the ED.
The rest of the paper is organized as follows.In Section II, system model, basics of ED are briefly introduced and problem formulation is explained.Threshold optimization with BPSO algorithm is introduced in Section III.Simulation result is presented in Section IV and finally conclusion and future work is in drawn in Section V.

System Model
The main goal of CR is to correctly identify the presence and absence of PU and allows the SUs to utilize the unused spectrum, if it is not used by licensed PUs.Under binary hypothesis testing, we consider the occurrence of two input events in observing signal x i in some observation interval denoted by (6) where i = 1, 2, 3….N is the number of samples.H 0 represents the hypothesis that the observation vector consists of noise.H 1 represents the hypothesis that the observation vector consists of noise and signal.The noise component n i is assumed to be Additive White Gaussian random variable which is independent and identically-distributed (i.i.d) with zero mean normal distribution with variance  and s i is the signal.

Energy Detector (ED)
The ED is non-coherent detector which detects the presence of signals by simply squaring its energy and comparing that energy around the carrier frequency with certain threshold.The decision threshold of ED is shown in Fig. 1.The ED consists of a quadrature receiver with y I and y Q representing samples from In-phase and Quadrature branch respectively as shown in Fig. 2. The samples after passing the squaring device, output of the integrator is denoted by (7) where r(t) is input signal, N 0 is noise spectral density.
Within observed sensing period, test statistic of ED can be approximated as Y ED = y I + y Q .At the observation time t, decision variable Y ED will be compared to a detection  .Threshold value is set to meet the target probability of false alarm p fa according to the noise power.In the case of p fa , the detector classifies the channel as busy when the actual channel is free.Probability of detection (p d ) is the probability of correctly detecting the presence of PU when the actual channel is in busy state.The expression for p fa and p d can be given as (7) 2 1 , 2 , where F x is cumulative distribution function (CDF) of standard chi-square random variable with k degree of freedom.

(
), , where Q is generalized Marcum-Q function, u is the time-bandwidth factor.Probability of miss detection (p m ) can also be identified in ED. p m is the probability that the ED can miss to detect the presence of PU. p m can be given as 1,

ED
ED md pp  (5)   Generally, there exist two kinds of detection errors i.e., miss-detection error p m and false-alarm error p fa , which degrade the sensing performance of ED critically (8) .If the total error rate p e , is the sum of the probability of false alarm p fa and the probability of missed detection p m .Thus, the total error rate is given by ,

ED
ED ED e fa m p p p  (6)   And the average of total error rate is given by , 2

Problem Formulation
In ED, if the received signal is greater than threshold λ then the presence of PU is detected else the ED will predict that PU is absent.However, setting a particular threshold for decision making process in ED still remains a challenging issue.The detection performance of the ED is highly dependent of the threshold value.At a particular threshold, the probability of detection p d should be as high as possible and probability of false alarm p fa should be as low as possible, such that the difference of p dp fa i.e., p diff = p d -p fa should be maximum.Similarly, for the optimum performance of the ED at optimal threshold, the sensing error i.e., average of total error rate as indicated in Eq. 7 should be minimized.
Several researches have been done for the optimization of threshold of ED. (9) proposed a method for non-convex threshold optimization using differential evolution.The differential equation involved in differential evolution is hard to get into closed form to obtain a feasible solution. (10)also proposed the optimization of threshold of ED using 1 D Particle Swarm Optimization (PSO) algorithm.Same global threshold is used in the detection of PUs which is also not a feasible solution for the optimum performance of ED.
In order to avoid aforementioned problem, in this paper we have proposed a BPSO algorithm for the optimization of threshold of ED which will increase the detection performance of ED.

Optimization of Threshold of ED With BPSO Algorithm
BPSO is a population based, stochastic optimization technique, which is modelled after the flocking and swarming behavior in birds and fishes.In BPSO, each particle is a solution to the optimization problem and these candidate solutions are referred to as swarm of particles.As opposed to other population based algorithms, BPSO maintains a static population whose particles are adjusted according to the new discoveries about the space.We can see the unique behaviour of BPSO where each particle in a population moves towards the best optimal solution depending upon its past experiences as well as its neighbours.The fitness function determines the performance of each particle.BPSO is governed by basic equations representing the position and velocity of each particle at a given time which are forced to take values between 0 and 1 (4) .The position and velocity of a particle are updated at each time step until a termination condition is reached.The search process is stopped automatically once the predetermined output or the maximum number of iterations are achieved.In such a manner the particles update their position and move towards an optimum value.
The same BPSO algorithm is applied for threshold adaptation by replacing the positions of the particles with the threshold value of the SUs.The threshold value decided by swarm in previous step (gbest) and the threshold value found out by the secondary users in previous step (pbest) are taken under consideration.In order to initialize the threshold of the secondary users, the threshold found out by them at the beginning are treated as initial values.The optimization process of threshold of ED can be stated as minimize ( , ) We have re-written the velocity and position update equation which can be given as ( 1) where w is the inertia weight of the particle, c 1 and c 2 are the cognitive and social coefficients respectively, while r 1 and r 2 are random numbers in the range [0,1].Finally the velocity and position of each particle using the BPSO algorithm can be updated as (5) ()

( ( ))
1 1, ( ( )) () 0, By using the sigmoid function, the value of bit for next position of λ is 1.This condition will occur if the random number is less than the value of sigmoid function of the velocity at the current iteration and vice versa.

Simulation Results
Our simulation was conducted in MATLAB to investigate the detection performance of our detector with the optimized threshold as discussed using BPSO in the previous section.AWGN is imposed on the original signal x i either for H 0 or H 1 condition.
Fig. 3 shows the simulation graph of total probability of error verses threshold.Here the threshold is uniformly distributed.A SNR of 3dB and time bandwidth factor u=10 is considered for simulation.It can be clearly seen from Fig. 3 that there lies an optimal threshold value of ED such that the total sensing error is minimum only at a particular threshold.Thus, we need to find optimum threshold for our ED such that the detection performance of our ED is increased.
Fig. 4 shows the simulation graph of SNR versus probability of detection for ED.To evaluate the performance of threshold optimization using BPSO algorithm, we set A=0.2, B=0.1 in Eq. 8. SNR is varied from -18dB to -6dB.The BPSO parameter are set as w=[0.8,0.4], swarm size=30, number of iterations =1000.From Fig. 4, it is clear that ED using optimized threshold by BPSO algorithm shows significant increase in detection performance than that of conventional ED using uniformly distributed threshold.

Conclusions and Future Work
The conventional way of determining the threshold of ED is to set the probability of false alarm and get the threshold value which may not be optimal in terms of detection performance of the ED.In this paper, we presented a new idea of optimizing the threshold of an Energy Detector (ED) using Binary Particle Swarm Optimization (BPSO) algorithm.The threshold optimization is carried out dynamically in our proposed method.With the use of BPSO algorithm, we can get the optimum threshold at which the detection probability of ED is high and total sensing error (i.e., probability of miss detection + probability of false alarm) is low.For future work, we will extend the BPSO algorithm for the distributed cooperative spectrum sensing to increase the detection performance of ED in such scenario.Also, the computational complexity of our proposed algorithm will be considered.

Fig. 1
Fig.1 Decision threshold of energy detector

Fig. 3 Fig. 4
Fig. 3 Simulation of total probability of error V/s Threshold