## 5 Discussion  
Table 3 gives a detailed comparison of the four algorithms. For preamble-based methods, complex decision-rule methods are also included here. The values in the table represent the ranking of algorithms on that dimension. Signal energy detection is the simplest algorithm, requiring no additional information, and can work on all systems. It has the lowest computational power because it only calculates the energy within a single window. It has a decent detection rate when the threshold is set properly, but it is sensitive to noise and cannot set a fixed threshold since \(m_{n}\) directly depends on the received signal energy. Moreover, the synchronization performance is poor. The reason is that energy accumulation is a continuous process. When the packet arrives, there will be a rising edge for a period of time, and it is difficult to determine the exact start position of the signals. Double sliding window detection uses the ratio of two windows for detection, so \(m_{n}\) does not depend on the signal energy level and computational complexity is twice that of the former one. Moreover, SNR can be regarded as a reference for threshold setting. In this algorithm, there is an obvious marker point to indicate the starting position of the data packet, so the synchronization error is smaller than the previous one. In theory, the detection rate of this algorithm should be close to or better than the first method, but in experiments, we find that its performance is not as good as expected. Compared with the first one, this method has a certain improvement in synchronization, but it costs twice the power consumption, so it has not been widely used in real systems. Auto-correlation takes advantage of the 10 repetitive short symbols in the preamble, so it can only be applied to OFDM signals with STF structure. By auto-correlation calculation, the value of \(m_{n}\) is high throughout the STF period. When using a simple decision rule, its performance is similar to energy detection because the above structure is not fully utilized. \begin{table}
\begin{tabular}{c c} \hline \hline
**Packet Detection Algorithms** & **Running Time (s)** \\ \hline Signal Energy Detection & 0.95 \\ \hline Double Sliding Window & 2.32 \\ \hline Auto-correlation & 1.97 \\ \hline Cross-correlation & 3.56 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Running time for four algorithms. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**AlgorithmsDimensions** & **Detection** & **Synchronization** & **Computational** \\
**Rank** & **Rate** & **Error** & **Complexity** \\ \hline Signal Energy Detection & 3 & 6 & 1 \\ \hline Double Sliding Window & 6 & 4 & 3 \\ \hline Auto-correlation (simple) & 5 & 5 & 2 \\ \hline Auto-correlation (complex) & 2 & 3 & 4 \\ \hline Cross-correlation (simple) & 1 & 2 & 5 \\ \hline Cross-correlation (complex) & 4 & 1 & 6 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Comparison of the four algorithms in three dimensions. For the two preamble-based algorithms, comparisons are also made with different decision rules. The values in the table represent the ranking of algorithms on that dimension. When the complex rule is used, the performances of detection rate and synchronization are better, but it will bring some increase in computational complexity. Overall, this algorithm has a good trade-off between the three dimensions and is used as an example algorithm for packet detection on MATLAB. Cross-correlation takes the known short preamble as a template and calculates the correlation between the template and the received signals. \(m_{n}\) will be high only when they are matched exactly. Therefore, a more accurate matching position can be obtained and it can achieve a better synchronization performance. In this case, the decision rules need to be set properly. If the rules are too strict, the detection rate will decrease. The biggest problem with this algorithm is the high computational complexity, especially when the decision rules are complicated.