# Convolutional Neural Network (CNN)-Based Frame Synchronization Method
## 4 Simulation Results  
The performance of the proposed frame synchronizer is examined through computer simulation. Two preamble lengths (\(L=500\) and \(L=1000\)) are considered. The preambles are pseudo-random sequences. Usually, the longer preamble results in better frame synchronization performance. For the training the proposed CNN, a total of \(100,000\) sets of the received signal are generated. The SNR of each training set is randomly selected between \(-30\) dB and \(30\) dB, and the packet arrival time is also randomly selected in the time window from 0 to 9999, i.e., \(W=10,000\). The learning rate is \(0.001\) and an optimization algorithm is an adaptive moment estimation (ADAM). The proposed CNN is learned for 80 epochs, i.e., \(500,000\) training signals are reused 80 times. After successful training, the proposed CNN can find the any packet arrival time in the range of 0 to 9999; therefore, the additional training does not required for different transmission delays. For frame synchronization performance evaluation, test signals are generated under AWGN channel environments with \(SNR=-30\) dB, \(-28\) dB, \(-28\) dB, \(\ldots\), \(28\) dB, \(30\) dB, and at each SNR, \(100,000\) test signals are generated with random packet arrival times. As the performance evaluation signals are generated independently with the training signals, the two sets of data do not overlap. The CNN training and performance evaluation are performed by using MATLAB 2020a. To use useful functions on deep learning, a Deep Learning Toolbox is also required. To accelerate training speed, a graphic process unit (GPU) GTX1080 Ti with compute unified device architecture (CUDA) 10.0 is used. To training the CNN, a trainNetwork function is used. The input of trainNetwork is training input signals, designed neural network, and optimization parameters. The output of trainNetwork is the trained parameters of CNN. For performance evaluation of the trained CNN, a predict function is used. The input of the predict function is the trained CNN parameters and the input signals for the performance test. Table 2 summarizes the simulation software environments. \begin{table}
\begin{tabular}{c l} \hline \hline
**Tools and Software** & **Environments** \\ \hline Operation system & Windows 10 \\ Simulation tool & MATLAB 2020a \\ MATLAB toolbox & Deep Learning Toolbox \\ GPU & GTX1080 Ti with CUDA 10.0 \\ Function for training & trainNetwork \\ Function for test & predict \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Simulation software environments. The learning curves of the proposed CNN were shown across the number of epochs for the loss and training accuracy in Figure 6a,b, respectively. To train the CNN, the cross entropy is used for the loss function, defined as  
\[V=-\sum_{t_{0}=0}^{9999}p\left(\hat{t}_{0}\right)\log q\left(\hat{t}_{0}\right), \tag{6}\]  
where \(\hat{t}_{0}\) is packet arrival time, \(q(\hat{t}_{0})\) is the softmax output in Figure 5, and \(p(\hat{t}_{0})\) is the ideal probability, i.e.,  
\[p\left(\hat{t}_{0}\right)= \begin{cases}1,&\hat{t}_{0}=t_{0},\\ 0,&\hat{t}_{0}\
eq t_{0}.\end{cases}  \tag{7}\]  
The loss in Figure 6a represents \(V\) in (6), and the accuracy in Figure 6b is the ratio of the correctly estimated cases among total \(500,000\) training signals. From the results, it was evidently shown that the proposed CNN accurately converges at approximately 50 epochs. Figure 7 shows the FDPs of the proposed CNN-based and the conventional correlation-based synchronization methods [6; 8; 10] in AWGN channels. From the results, we observe that the proposed CNN-based technique outperforms the conventional correlation-based method regardless of the preamble length, and a longer preamble provides better FDP. Concretely, the proposed method shows 2 dB gain over the conventional method, regardless of the preamble length, and the preambles with length 1000 achieve 3 dB better than that with length 500. Figure 8 shows the FDPs for flat fading channels with \(L=500\).