A Cognitive Radio Spectrum Sensing Method for an OFDM Signal Based on Deep Learning and Cycle Spectrum

. In a cognitive radio network (CRN), spectrum sensing is an important prerequisite for improving the utilization of spectrum resources. In this paper, we propose a novel spectrum sensing method based on deep learning and cycle spectrum, which applies the advantage of the convolutional neural network (CNN) in an image to the spectrum sensing of an orthogonal frequency division multiplex (OFDM) signal. Firstly, we analyze the cyclic autocorrelation of an OFDM signal and the cyclic spectrum obtained by the time domain smoothing fast Fourier transformation (FFT) accumulation algorithm (FAM), and the cyclic spectrum is normalized to gray scale processing to form a cyclic autocorrelation gray scale image. Then, we learn the deep features of layer-by-layer extraction by the improved CNN classic LeNet-5 model. Finally, we input the test set to verify the trained CNN model. Simulation experiments show that this method can complete the spectrum sensing task by taking advantage of the cycle spectrum, which has better spectrum sensing performance for OFDM signals under a low signal-noise ratio (SNR) than traditional methods.


Introduction
The emergence of the fifth-generation mobile communication network (5G) [1] has greatly promoted the development of broadband wireless communication [2], and orthogonal frequency division multiplex (OFDM) is one of the popular physical transmission technologies for wireless communication [3,4]. Many of its characteristics meet the requirements of cognitive radio (CR) [5][6][7]. Therefore, OFDM is the preferred technology for CR communication.
As the core technology of the cognitive radio network (CRN), spectrum sensing can improve spectrum utilization and alleviate spectrum resources [8][9][10]. Traditional spectrum sensing is mainly done by mathematical methods of signal processing, including energy detection [11], matched filter detection [12], and cyclostationary feature detection [13]. [14] proposed a spectrum sensing method based on correlation detection, the correlation of cyclic prefix (CP) was used in OFDM, and the sampled data was subjected to correlation operation. In [15], the signal and noise were estimated simultaneously by the time domain correlation function, and the estimated threshold was continuously adjusted by the estimated value to complete the spectrum sensing of an OFDM signal. In [16], the received autocorrelation function was estimated at each OFDM symbol of its symbol period, and then, the multivariate statistical theory was used to calculate the judgment amount and the decision threshold. Finally, the judgment amount and the decision threshold were compared to obtain the judgment result. In the face of complex wireless network communication environments, these methods cannot meet the needs of spectrum sensing. In [17], focusing on classifying different OFDM signals, authors proposed a two-step detection and identification method. However, this method is not combined with the deep learning model, and the spectrum sensing performance is general.
The contributions of this paper are summarized as follows: (i) We analyze the cyclic autocorrelation of an OFDM signal, using the time domain smoothing fast Fourier transformation (FFT) accumulation algorithm (FAM) to achieve cyclic spectrum and transforming the spectrum sensing problem into an image processing and recognition problem (ii) We convert the cyclic spectrum into a gray scale image, transforming the spectral perception problem into an image processing problem (iii) We adopt an improved CNN based on LeNet-5 to generate a spectrum sensing model to complete spectrum sensing The remainder of the paper is organized as follows. Section 2 introduces the related work. Section 3 analyzes the cyclic autocorrelation of an OFDM signal, and cyclic spectrum is obtained by the FAM algorithm, which is converted to a gray scale image. Section 4 presents the OFDM spectrum sensing model designs based on the improved CNN classical structure LeNet-5. Section 5 carries out simulation experiments and performance evaluation on the proposed new method. In the end, we conclude this article in Section 6.

Related Work
The existing spectrum sensing methods mainly use the neural network as a classifier, and the data set is a complex feature statistic, and the sensing effect is not ideal [18][19][20][21]. [22] proposed multigene genetic programming-(MGGP-) based feature engineering was conducted to transform the cumulants of the received signals into highly discriminative features, and then, authors use a logistic regression classifier to achieve classification of overlapping signal modulation. [23] presented a study about the possibility of implementing approximations to the Neyman-Pearson (NP) detector with C-Support Vector Machines (C-SVM) and 2C-SVM. It was based on obtaining the functions that these learning machines approximate to after training to minimize the empirical risk, and on the possible implementation of the NP detector with these approximated functions. In [24], authors tested the application of deep neural networks to the automatic modulation classification in AWGN and flatfading channel. Three training inputs were used: (1) inphase and quadrature (I-Q) constellation points, (2) the centroids of constellation points employing the fuzzy C-means algorithm to I-Q diagrams, and (3) the high-order cumulants of received samples. The unsupervised learning from these data sets was done using the sparse autoencoders, and a supervised Soft-max classifier was employed for the classification. The above intelligent algorithms are limited to long training time and only propose applications in signal recog-nition and classification, which are not applicable in spectrum sensing.

OFDM Cyclic Autocorrelation and FAM Algorithm.
Targeting the OFDM signal model, the equivalent baseband signal can be expressed as where t ∈ ½0, T.
After OFDM signals pass through AWGN channel, the complex baseband signal is obtained as where hðtÞ represents zero mean white noise. The OFDM signal model is obtained as where G represents the total length of OFDM signal, T c represents the chip time, T s represents the effective period, pðtÞ represents the rectangular pulse, c k,l represents the l th sampling point of the kth OFDM symbol inserted into CP. The time domain expression can be followed as where N represents the effective length and D represents the length of inserted l = 0, 1, ⋯, G − 1. a k,n represents the modulated data on the nth subcarrier of the kth OFDM signal in the frequency domain, n = 0, 1, ⋯, N − 1.
In the kth OFDM symbol of the signal, the autocorrelation of the time domain data c k,l with delay sample point n τ ð0 ≤ n τ ≤ NÞ can be followed as Regardless of other interference factors, the correlation function from equation (3) is 2 International Journal of Digital Multimedia Broadcasting where τ = n τ T c . Inserting the CP introduces the correlation characteristic. It can be known from equation (6) that the OFDM signal has two cycle periods: the small period is T c and the large period is T s , and the expression can be followed as It is proved from the above that the OFDM signal has cyclic characteristics, R x ðt, τÞ has periodicity, and further R x ðt, τÞ pairs do discrete Fourier transform (DFT), the expression can be expressed as where α represents the cycle frequency.
It can be seen from the above that the OFDM signal has second-order cyclostationary characteristics. The OFDM signal has two cycles of T c and T s , and R x ðt, τÞ has periodicity. According to the nature of Fourier transform, the Fourier transform of t will appear discrete spectrum line at α = m/ T c and α = m/T s .
We implement the cyclic spectrum by FAM algorithm. The flow of the implementation steps of algorithm can be shown in Figure 1.
Through the above cyclic autocorrelation analysis, the FAM algorithm is used to simulate in simulation software, and simulation parameters are shown in Table 1.
The three-dimensional cyclic spectrum of OFDM under H 0 (H 0 : it represents the absence of OFDM signal; that is, the authorized user does not exist.) and H 1 (H 1 : it represents the presence of OFDM signal, that is, the presence of authorized users.) are obtained, as shown in Figures 2 and 3.

Spectrum Sensing
Model. The CR user discovers and utilizes opportunistically the available spectrum opportunities to access dynamically the idle licensed spectrum. According to the available spectrum opportunities of CR users, the CR spectrum perception can be defined as a binary hypothesis model as follows: The binary hypothesis model has false alarm errors P f and missed detection errors P m , which are represented by false alarm probability and missed detection probability as follows: where Y represents the decision statistic and λ represents the threshold. According to the NP criterion, in order to improve the spectrum sensing performance of CR users, it is necessary to reduce P m as much as possible under certain P f constraints. The three-dimensional cyclic spectrum is normalized and gradated, and a two-dimensional cyclic autocorrelation gray The gray value is used to represent the size of the autocorrelation value (the gray value is positively correlated with the autocorrelation value). According to the distribution of twodimensional gray map under H 0 and H 1 , it has four peaks under H 1 , which can map the spectrum perception to image processing [25].

Method
4.1. CNN Design. The spectrum sensing of OFDM signal is completed by the deep learning framework, and the implementation framework is shown in Figure 6, which is divided into a model training process and a model testing process. CNN is a model of deep learning. It has the characteristics of local connection and parameter sharing. It has strong advantages in image processing. LeNet-5 model is a classic model of CNN. We change the input of the LeNet-5 model to gray scale image of 36 * 36 and change the size of the convolution kernel and sampling window. Spectrum sensing depends on the spectrum occupancy of authorized users, changes the output to 2 neurons, and converts to binary classification; label 0 represents H 0 , and label 1 represents H 1 . An improved LeNet-5 model for spectrum sensing is shown in Figure 7.

Train and Test.
The CNN based on the improved LeNet-5 model is trained by the error back propagation (BP) algorithm. The training process of BP algorithm is divided into forward calculation of data, back propagation of error, and update of weight. δ k represents the partial derivative of input layer error for this layer, which is called sensitivity [26].
For forward calculation of data, the hidden layer output values are defined as where W H h represents the weight of layer H, X i represents the current node input, and f ð·Þ represents the current layer activation function.
The output layer output values are defined as     International Journal of Digital Multimedia Broadcasting In Tensorflow, the one-hot method is usually used for error back propagation and weight update. The cross entropy function is defined as The output layer feeds back to the reverse derivation of the fully connected layer. According to the one-hot method, only one value is 1 and the rest is 0. The cross entropy can be followed as Loss value is as follows: Let y = 1 get The output layer uses Soft-max, and the formula for the full connection layer weight update is as follows: The pooled layer feeds back to the reverse derivation of the convolutional layer, and its convolutional layer sensitivity can be followed as where * represents the dot multiplication. The convolutional layer feeds back to the reverse derivation of pooling layer, assuming that l is a pooling layer, l + 1 is a convolutional where ⊙ represents a convolution operation. The sensitivity is obtained by the above calculation, and then, weights and offsets in the CNN can be followed as After BP algorithm trains CNN, it is verified by the test set.
We take N pairs of test sets fðx 1 , y 1 Þ, ðx 2 , y 2 Þ, ⋯, ðx i , y i Þg, and the difference between the predicted value and the true value can be followed as where Y W,b ðx i Þ represents the output value of last layer of CNN model, W represents the weight, b represents the offset. Then, the accuracy of this test set is obtained as where n represents the number of tests meeting the Ω < Ω th condition. It can be seen from equation (22) that the higher accuracy, the better performance of spectrum sensing.

Experiment and Analysis
This section simulates the performance evaluation of proposed spectrum sensing method to verify its feasibility. The OFDM frame is built in simulation software, and the OFDM signal is generated by the analog transmitter.
As shown in Table 2, labels 0 and 1 denote the state of channel as idle and busy, respectively. The balance of positive and negative samples is 1 : 1. The channel setting is referenced [27]. After through the Rayleigh fading channel and the Gaussian white noise channel, the data sampled by receiving end is preprocessed according to the second section. We complete the train and test of model in TensorFlow    Table 3.

Analysis of the CNN Model.
Since the structure of CNN model will affect training and test results, the detection rate of spectrum sensing will change. By modifying the size of convolution kernel, we design five different CNN structures, the input data set remains unchanged. The different layer structure can be shown in Table 4. The CNN models of five different structures are trained under the same training set and test set as in Table 3. Under the same training times, the accuracy and total loss (cross entropy loss and regularization loss) of the training process of five different structures CNN model are statistically analyzed. The performance curve can be shown in Figures 8 and 9.
It can be seen from Figure 8 that under the maximum pooling aggregation mode, as the number of training increases, the robustness of five different CNN structures are continuously enhanced, when the number of training is 10001 (more the optimization effect of high training times will be better, but this paper only takes 10001 times and has no effect on the research problem). No. 3 and no. 4 are the best relative to other three structures, and the actual training accuracy is 0.96. Meanwhile, the total loss corresponding to No. 3 and no. 4 is the lowest as seen in Figure 9.

Performance Comparison
Analysis of Algorithms. [22] uses logistic regression to distinguish signals, and [23] uses SVM to achieve radar signal recognition. Our method is compared with these two machine learning algorithms. The signal is set to Gaussian white noise signal and OFDM signal. Under different sample sizes (90% of the data is used for training, and 10% of the data is used for testing), we adopt the same data set, and the Performance of three algorithms are shown in Table 5.
It can be seen from Table 5 that the CNN spectrum sensing method has obvious advantages in terms of various performances compared with others. The CNN is better than other two algorithms in image classification processing. The machine learning algorithm is good, and the OFDM cyclic spectrum feature is more suitable for CNN. For the test time   The training set and test set of OFDM signals are obtained through different SNR channels in the simulation platform. The logistic regression, SVM, and deep learning OFDM (DP-OFDM) spectrum sensing model are used for training and testing, and the error threshold Ω th is adjusted to obtain the detection probability. As described in [28], a cyclic feature detection method based on compressed sensing, such as [11] proposed the energy detection method, and [15] proposed the autocorrelation detection method. Under the condition of false alarm probability P f = 0:05, the corresponding decision thresholds are set for each of the above methods, and the above methods are simulated in the simulation platform, respectively. The performance comparison of the detection probability can be shown in Figure 10.
It can be seen from Figure 10 that under the condition of P f , we propose DP-OFDM spectrum sensing method is superior to the logistic regression and SVM algorithms. The same training set and test set are used in different SNR environments, which are less affected by noise. Below −10 dB, the detection probability of CNN is better than traditional spectrum sensing algorithms, which indicates that our method has better spectrum sensing performance under low SNR. Under the condition of high SNR, the traditional spectrum sensing algorithms have obvious performance advantages, indicating that the traditional spectrum sensing algorithms still have strong advantages under high SNR. Compressed sensing-based loop feature detection is comparable to the algorithm detection performance of this paper, but the algorithm of this paper is more advantageous. The detection rate of the traditional spectrum sensing algorithm is greatly affected by SNR, especially when SNR is below −6 dB.
As can be seen from Section 2, performance indicator for improving spectrum sensing is P f . Under SNR is −12 dB, the receiver operating characteristic (ROC) curve of P d changing with P f is plotted by different detection algorithms, which can be shown in Figure 11.
It can be seen from Figure 11 that the detection probability of energy detection algorithm is the lowest. The detection probability of DP-OFDM detection method is significantly higher than traditional spectrum sensing algorithms and has a stronger advantage than the two machine learning algorithms of logistic regression and SVM. The extracted autocorrelation feature of OFDM cycle can reflect the characteristics of spectrum, which is more suitable as the input of CNN model. It also shows that CNN has more powerful learning ability than other machine learning algorithms, and spectrum sensing effect is better.

Conclusion
How to effectively improve the spectrum sensing performance in complex and variable wireless environments is a challenge. In this paper, we propose a cognitive radio spectrum sensing method for OFDM signal based on deep learning and cycle spectrum. The OFDM signal cyclic spectrum feature is used as the data set of the improved CNN model, which converts the spectrum sensing problem into an image processing problem, and can better exert the powerful learning ability of CNN. Simulation results show that this method is not only better than other machine learning methods but also has higher detection probability than traditional spectrum sensing methods under low SNR. This method also  has certain disadvantages, such as a single feature input. In short, this method has certain reference value for the application of more advanced deep learning models in the field of spectrum sensing.

hðtÞ:
Zero mean white noise G: Total length of the OFDM signal T c : Chip time T s : E ffective period pðtÞ: Rectangular pulse N: E ffective length D: Length of inserted CP n τ : Delay sample point α: Cycle frequency P f : False alarm errors P m : Missed detection errors Y: Decision statistic λ: Threshold W H h : Weight of layer H X i : Current node input f ð·Þ: Current layer activation function * : Dot multiplication ⊙ : A convolution operation Y W,b ðx i Þ: The output value of the last layer of the CNN model W: Weight b: O ffset.

Data Availability
The data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
The authors declare that there are no conflicts of interest regarding the publication of this paper.