A Modular Spectrum Sensing System Based on PSO-SVM

In the cognitive radio system, spectrum sensing for detecting the presence of primary users in a licensed spectrum is a fundamental problem. Energy detection is the most popular spectrum sensing scheme used to differentiate the case where the primary user's signal is present from the case where there is only noise. In fact, the nature of spectrum sensing can be taken as a binary classification problem, and energy detection is a linear classifier. If the signal-to-noise ratio (SNR) of the received signal is low, and the number of received signal samples for sensing is small, the binary classification problem is linearly inseparable. In this situation the performance of energy detection will decrease seriously. In this paper, a novel approach for obtaining a nonlinear threshold based on support vector machine with particle swarm optimization (PSO-SVM) to replace the linear threshold used in traditional energy detection is proposed. Simulations demonstrate that the performance of the proposed algorithm is much better than that of traditional energy detection.


Introduction
Based on the conventional fixed spectrum allocation policy, most available radio spectra have been assigned to registered users, which lead to a serious waste of spectrum utilization. In fact, recent reports from Federal Communications Commission (FCC) have shown that only 30% of the allocated spectrum in US is fully utilized [1]. Cognitive radio, which enables secondary users to utilize the OPEN ACCESS spectrum when primary users are not occupying it, has been proposed as a promising technology to improve spectrum utilization efficiency [2][3][4], and has three essential components: (1) Spectrum sensing: the secondary users sense the radio spectrum environment within their operating range to detect the frequency bands which are not occupied by primary users; (2) Dynamic spectrum management: cognitive radio networks dynamically select the best available bands for communication; (3) Adaptive communications: a cognitive radio device can configure its transmission parameters (e.g., carrier frequency, transmission power) to opportunistically make best use of the ever changing available spectrum [5].
Spectrum sensing is a fundamental task for cognitive radio. However, there are several factors that make spectrum sensing practically challenging (e.g., low signal-to-noise ratio (SNR) of primary users, noise uncertainty, multipath fading). Several sensing methods have been proposed, including likelihood ratio test (LRT) [6][7][8], energy detection method [9,10], match filtering (MF) method [11], cyclostationary detection method [12,13] and the statistical covariances-based method [14]. Each of them has its own advantages and disadvantages, e.g., LRT is proven to be optimal, but it requires exact channel information and distributions of the primary signal and noise. The MF-based method needs perfect knowledge of the channel responses from primary users to the receiver and accurate synchronization (otherwise, its performance will dramatically be reduced) [15], it may not be possible if the primary users do not cooperate with the secondary users. The cyclostationary detection method requires the cyclic frequencies of the primary users, which may not be realistic for many spectrum reuse applications. Furthermore it needs high computation capabilities. The energy detection method does not require any primary signal information and it is robust to unknown dispersed channels and fading, but if the SNR of the received signal is low, the number of received signal samples is small and the power of noise is estimated inaccurately, the energy detection performance will decrease seriously [11]. The covariances-based method also does not require any prior information, but its computation complexity is also high [14].
As mentioned one drawback of the traditional energy detection is that if the SNR of received signal is low and the number of the received signal samples is small the corresponding performance may decrease seriously. In order to overcome this drawback a novel method with the purpose of obtaining a nonlinear threshold for energy detection based on PSO-SVM is proposed in this paper. The proposed method focuses on one single point and one antenna scenario, which can be divided into Offline module and Online module. In the Offline module, the proposed system generates two classes of training samples, one for the simulated situation that both signal and noise exist simultaneously while another case is for noise only. The normalized energy of these two classes of training samples is used as the classification feature to train the PSO-SVM. After each training step, a decision function is generated. In the Online module, the decision functions obtained in the Offline module are used as the nonlinear thresholds for energy detection to verify if the primary user is present. The experimental results show that the receiver operating characteristic (ROC) curve of proposed approach is much better than traditional energy detection. The rest of this paper is organized as follows: the PSO-SVM is introduced in Section 2. In Section 3 determination of threshold and theoretical analysis are proposed. Simulation results are given in Section 4. Conclusions are finally drawn in Section 5.

SVM
In this subsection, a brief introduction to SVM, proposed by Vapnik [16], is given.
where ⋅ is inner product. The aim of SVM is to find the hyper-plane which makes the samples with the same label on the same side of the hyper-plane. The quantity 2 1 w is the margin, and optimal separating hyper-plane (OSH) is the separating hyper-plane which maximizes the margin. The larger the margin, the better the generalization is expected [17]. To search the maximum γ, quadratic programming is usually used, leading to: according to Equation (2), a hyper-plane 0 with the largest margin can be obtained. For equality constraints in Equation (2), they can be modified to unconstrained by integrating positive Lagrange multipliers, leading to: to minimize ( ) According to Equation (3) and Equation (5), it is obvious that thus the quadratic programming problem in Equation (3) can be converted to: subject to: the third constraint condition in Equation (7) is the Karush-Kuhn-Tucker (KKT) condition [18]. There is a Lagrange multiplier a i for each training sample, the training samples for which a i > 0 are called "support vectors", lying on one of the two hyper-planes: . The training samples will only appear in the form of inner products between vectors.
In the nonlinear case, the approach adapted to noisy data is to make a soft margin. We introduce the slack variables 0, 1, 2, , The generalized OSH is the solution of minimizing: subject to Equation ( In the nonlinear SVM, a kernel function is introduced to map the initial data into a feature space with a high dimension. In the new space, the data should be linearly separable. Then Equation (6) can be converted to: subject to Equation (7), and 0 x is the kernel function. As one of the most popular kernel functions, the RBF kernel function is considered in this paper, and it takes the following form: where g is kernel parameter, and denoting the width of kernel function. If g is too big, the SVM may outfit the training data, and a too small g may make SVM algorithm not flexible enough for complex function approximation. By solving Equation (10) we can obtain the minimum ⋅ w w : where * w , * i α are the solution of Equation (10). Then the decision function is: where x is a test sample with an unknown label y. Noting that * w only depend on the training samples , a unique decision function will be obtained by solving Equation (10).

Particle Swarm Optimization
The parameters C and g need to be set to solve Equation (10). However, in a practical situation it is difficult to set these two parameters properly. In this subsection, we integrate a PSO (particle swarm optimization) method to adaptively set C and g.
Particle Swarm Optimization (PSO) is inspired by the social behavior of birds, birds in a swarm preying on food and cooperation with each other to search for the optimal position to obtain the food. In a PSO optimal problem, there are a group of individuals, each individual is called a "particle", which may be a potential solution. Suppose that the solution space of optimization problem is D dimensions. The i-th particle is ( ) , the optimal position for itself is ,…p iD ) and its speed move to this position is ( ) , the optimal swarm position is P g = (p g1 , p g2 , p g3 ,…p gD ), iteration to find the optimal position is given by: where t id x and t id v are the d-th location and speed component of i-th particle at the t-th iteration, 1 c and 2 c are two positive coefficients, 1 r and 2 r are the random number selected from 0 to 1, ϖ is the flexible coefficient of t id v . The second part of Equation (12) is called "cognitive" part which is the optimization of the particle itself, and the third part of Equation (12) is the "swarm part", which is the cooperation with other particles. In addition, a boundary for each particle should be set as[ In the process of the iteration, if the parameter of particle is out of the range, they are replaced by the boundary value. For the optimization of the error penalty parameter C and kernel parameter g, each particle is set as ( , ) C g , and a three cross validation is used to estimate the performance of each ( , ) C g , training data is separated into three parts, one part is considered as the validation set and the remaining two parts are for training . Our earlier work has validated this PSO algorithm [19].

Threshold Determination and Theoretical Analysis
Common notation as summarized in Table 1 is used throughout this section.

Basic Conception of Energy Detection
In this subsection we introduce the general model for spectrum sensing, then review the energy detection scheme and analyze the relationship between the probability of false alarm and probability of detection.
Suppose that we are interested in the frequency band with carrier frequency f c , bandwidth W and the received signal is sampled at sampling frequency f s , respectively. When the primary user is active, the discrete received signal at the secondary user is given by [5]: where ( ) z n is under hypothesis 1 H . When the primary user is inactive, the received signal is given by: and this case is referred to the hypothesis 0 H . In this paper we only focus on one single point and one antenna spectrum sensing scenario, thus for simplicity we make the following assumptions [5]: if the number of signal samples s N is small, the probability of false alarm f P for a predefined threshold ε is given by: Pr | Pr The far right-hand side of Equation (20)  , extensive tables exist for the chi-square distribution, but the non-central chi-square has not been as extensively tabulated.
In this paper, we use approximations proposed by Patnaik [20] to replace the non-central chi-square with a central chi-square having a different number of degrees of freedom and a modified threshold level, If the non-central chi-square variable has 2 s N degrees of freedom and non-centrality parameter λ , define a modified number of degrees of freedom D and a threshold divisor G given by: = > = > (23) As mentioned above, when the probability of false alarm f P and the number of samples s N is set, we can obtain a unique value of threshold ε, it equals to a linear classifier in binary classification problem. But if the SNR λ is low while the number of signal samples s N is small, the corresponding spectrum sensing problem is linearly inseparable, and the traditional energy detection can not classify this linearly inseparable problem efficiently.

Nonlinear Threshold System
To overcome the drawbacks of traditional energy detection mentioned above, the authors here propose a method in purpose of obtaining nonlinearly threshold based on PSO-SVM. The system process encompasses two distinct modules i.e., Offline and Online, which are clearly illustrated by the Figure 1.
while the average geometric distance from variables of ' 0 T class to separating hyper-plane is given by: The process to obtain a non-linear threshold is shown in Table 2, and some of typical training results of ( )  Table 3 and Figure 2. Table 2. The process to obtain a non-linear threshold.    Table 3.
The result of spectrum sensing is given by:

Comparison with Traditional Energy Detection
Energy detection is the basic sensing method, which was first proposed in [9] and further studied in [5,10]. It does not need any information of the signal to be detected and is robust to unknown dispersive channels. Energy detection compares the normalized average power of the actual received signal plus noise ' 1000 O [16].
As the price of getting the full list of decision functions, the training times are huge. Therefore the overall computational complexity of the offline module is extremely high. However, in a real spectrum sensing situation, we only take care of the computational complexity in the Online module. The computational complexity of traditional Energy detection needs about s N multiplications and additions. Hence, the computational complexity of the proposed methods is about 1 s N + multiplications and additions, which is competitive with traditional Energy Detection.

Results and Discussion
In this section, we use the decision functions stored in the Offline module as the nonlinear thresholds to simulate the probability of detection d P in the Online module. In Figure 3 we compare the receiver operating characteristic curve of the proposed method and traditional energy detection for actual SNR 0dB λ = and number of signal samples 5 s N = . If the SNR of the actual received signal is low and the number of signal samples is small e.g., 0 dB λ = and 5 s N = , the corresponding spectrum sensing problem based on energy detection is a linearly inseparable binary classification problem. Traditional energy detection with a predefined threshold is a linear classifier, it cannot solve linearly inseparable problem efficiently. But the proposed method is a nonlinear classifier based on PSO-SVM, which can solve linearly inseparable problem efficiently. As shown in Figure 3, the performance of the proposed method is much better than traditional energy detection. Although the actual SNR λ increases to 5 dB but the number of signal samples 5 s N = is small, which means the corresponding spectrum sensing problem based on energy detection is still linearly inseparable. Therefore, as shown in Figure 4, the performance of proposed method is dramatically better than the traditional energy detection method. , the corresponding performance of the proposed method is still better than energy detection. This is because although the number of sensing samples is large i.e., 1000, but actual SNR λ is low, thus the corresponding spectrum sensing problem is linearly inseparable, however the proposed method can classify linearly inseparable problem efficiently. As shown in Figure 5, at 20 dB λ = − the proposed method is almost three times better than traditional energy detection. With the λ increases the spectrum sensing problem coverage to linearly separable, and the difference of performance between the proposed method and the traditional energy detection also decreases.

Conclusions
In this paper, a novel modular spectrum sensing method for cognitive radio based on PSO-SVM is proposed. It comprises two distinct modules, i.e., Offline and Online. In the Offline module, the decision functions with associated probabilities of false alarm are obtained. In the Online module, the primary user is detected by using the decision functions obtained in the Offline module.
The proposed method actually is independent from the traditional detection method, a nonlinear decision is exploited to replace the linear threshold, which drastically improves the performance of detection without increasing the computational complexity in Online phase. The approach can be used for various signal detection applications without a priori knowledge of signals and channels. Simulations have been carried to evaluate the performance of the proposed method. It has been shown that the proposed approach is more effective than the traditional energy detection approach in hostile environments. More specifically, when the received signal samples are lacking and SNR is low, the approach proposed in this paper can give a reliable performance, while the traditional energy detection approach is hypodynamic.
In our future research work, we will try to apply the proposed method to enhance more sophisticated detection algorithm which uses predefined linear threshold (e.g., the method proposed in [14]). More specifically, secondary users are located with detected radio map thereby deploying space-time spectrum sensing. And the specific signal pattern from the primary user can be recognized by analyzing the signal detected.