# Adaptive Feature Extraction of Motor Imagery EEG with Optimal Wavelet Packets and SE-Isomap
## 4 Experimental Research
### Time-Frequency Analysis with WPD  
#### 4.3.1 Selection of the Optimal Wavelet Packet Basis Function  
WPD has been widely used in non-stationary signal processing. The multi-scale decomposition and time-frequency domain localization are implemented by using the scale and displacement operations, and the time-frequency resolution of a signal is effectively improved. Meanwhile, the specific time-frequency domain information is easily obtained [20]. It is noticeable that the analysis result is affected by the wavelet packet basis function [22], because the part of the signal whose wave form is similar to one of the selected basis function will be amplified. However, there are no reliable and effective methods to guide us to choose the basis function; therefore, the optimal wavelet packet basis function will be determined according to the classification effect through experiments. Here, several basis functions, including Symlets, Coiflets, Haar and Daubechies, which are similar to MI-EEG signal, are selected, and the proposed method is applied to extract the features of MI-EEG. The parameter setting is \(d=16\) and \(\sigma=11\) in SE-isomap, and the KNN classifier (parameter setting: \(k=7\)) is adopted to identify the features and evaluate the suitability of basis functions. The average classification accuracy with 10-fold cross-validation is shown in Table 1.  
As can be seen from Table 1, the classification result of the db4 basis function is significantly better than others; therefore, db4 is selected as the best wavelet basis function for the following research. In fact, among different types of basis functions, the Daubechies family is known for its orthogonality property and efficient filter implementation [27]. db4 was found to be the most appropriate basis for \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Basis Function** & **sym6** & **sym10** & **coif4** & **coif2** & **Haar** & **db4** & **db5** \\ \hline
**Accuracy (\%)** & 81.7 & 82.4 & 87.2 & 88.3 & 90.1 & 92.7 & 89.8 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Classification accuracy with different basis functions. Figure 4: Average instantaneous power spectrum. (**a**) Left hand imagination, (**b**) Right hand imagination. analysis of EEG data since the lower order wavelets of the family was too coarse to represent EEG spike properly, and the higher one cannot represent the spiky form of the EEG signal [28]. Additionally, the accuracy resulting from the Haar basis function also shows a comparable performance, and it is necessary to analyze the differences of the results between the Haar and db4 basic function statistically. In the following, a two-sample \(t\)-test is applied to identify whether there is a significant difference when they are used for MI-EEG feature extraction. Suppose that \(M_{\text{Haar}}\) and \(M_{\text{db4}}\) stand for the mean value of the 10-fold cross-validation's accuracies from the Haar and db4 basic function, respectively, \(S_{\text{Haar}}^{2}\) and \(S_{\text{db4}}^{2}\) denote the variance, and \(n_{\text{Haar}}\) and \(n_{\text{db4}}\) represent the number of the results. Then, the \(t\)-test statistic can be calculated as:  
\[t=\frac{M_{\text{db4}}-M_{\text{haar}}}{\sqrt{\frac{(n_{\text{db4}}-1)S_{\text{ db4}}^{2}+(n_{\text{haar}}-1)S_{\text{haar}}^{2}}{n_{\text{db4}}+n_{\text{haar}}-2} \Big{(}\frac{1}{n_{\text{db4}}}+\frac{1}{n_{\text{haar}}}\Big{)}}} \tag{24}\]  
Assume that the null hypothesis is \(H_{0}\): the results of Haar and db4 come from independent random samples from normal distributions with equal means; the alternative hypothesis is \(H_{1}\): the results of Haar and db4 come from populations with unequal means. The significance level was chosen as \(\alpha=0.05\). The decision rule is to reject \(H_{0}\), if:  
\[p=P\{t>t_{\alpha}(n_{\text{haar}}+n_{\text{db4}}-2)\}\leq 0.05 \tag{25}\]  
After being calculated, the \(p\)-value is equal to 0.0131, which is less than 0.05; therefore, the null hypothesis is rejected at the 0.05 significance level.