# Frame-Based Phone Classification Using EMG Signals +
## 2 Materials and Methods
### Feature Extraction  
After removing the direct-current offsets from the EMG signals and normalizing them, five time-domain (TD) features are calculated as proposed in [38]. Similar parameters with small variations have also been used in [25; 43]. The procedure to obtain these TD features is described here for clarity purposes.  
First, the signal (\(x[n]\)) is separated into two components: a low-frequency signal (\(w[n]\)) and a high-frequency signal (\(p[n]\)). To obtain the low-frequency signal, \(w[n]\), a double average of \(x[n]\) is calculated using a nine-point window:  
\[w[n]=\frac{1}{9}\sum_{k=-4}^{4}v[n+k],\quad\text{where }v[n]=\frac{1}{9}\sum_{k=-4}^{4 }x[n+k] \tag{1}\]  
Having calculated \(w[n]\), we can then obtain the high-frequency signal \(p[n]\) by subtracting \(w[n]\) from \(x[n]\):  
\[p[n]=x[n]-w[n]. \tag{2}\]  
A rectified version \(r[n]\) of the high-frequency signal is also obtained, given by:  
\[r[n]=\begin{cases}p[n],&\text{if }p[n]\geq 0\\ -p[n]&\text{if }p[n]<0\end{cases} \tag{3}\]  
Once \(w[n]\), \(p[n]\), and \(r[n]\) are obtained, the set of five time-domain features of a frame is defined as follows:  
\[TD0=[\bar{w},\bar{r},P_{w},P_{r},z] \tag{4}\]  
where:  
\[\bar{w}=\frac{1}{N}\sum_{n=0}^{N-1}w[n],\quad\bar{r}=\frac{1}{N}\sum_{n=0}^{N -1}r[n] \tag{5}\]  
\[P_{w}=\frac{1}{N}\sum_{n=0}^{N-1}|w[n]|^{2},\quad P_{r}=\frac{1}{N}\sum_{n=0}^ {N-1}|r[n]|^{2} \tag{6}\]  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Session** & **Corpus** \\ \hline  & 110 VCV combinations \\ all & 100 isolated words \\  & [PERSON] sentences 1-100 \\
101 & [PERSON] sentences 101-400 \\
102 & Sharvard sentences 401-700 \\
103 & Ahosyn sentences 1-150 \\
104 & Ahosyn sentences 151-300 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Corpus information for ReSSInt-EMG sessions.  
\[z=\sum_{n=1}^{N-1}g(p[n]p[n-1]),\quad\text{where }g(x)=\begin{cases}1&\text{if }x<0\\ 0&\text{if }x\geq 0\end{cases} \tag{7}\]  
To provide the classifier with temporal context, a stacking filter concatenates the features of \(2k+1\) adjacent frames. Specifically, the stacked feature vector of the \(j\)-th frame, denoted by \(S(f_{j},k)\), is given by:  
\[S(f_{j},k)=[f_{j-k\cdot r}f_{j-k+1},\ldots,f_{j},\ldots,f_{j+k-1\cdot r}f_{j+k}] \tag{8}\]  
Here, \(j\) is the index of the central frame (i.e., the frame intended to be classified). A stacking filter of \(k=15\) is chosen, combining a total of 31 frames.  
Finally the stacked TD0 vectors from all eight channels are combined into a single array, which serves as the input for the classifier.  
We used a window with a duration of 25 ms and a frame-shift of 5 ms to extract the EMG features. Since five TD features are calculated for each of the EMG channels, the length of the parameter vector assigned to each frame is calculated as  
\[M\cdot 5\cdot(2k+1), \tag{9}\]  
which results in 1240 features for a width of the stacking filter of \(k=15\) and \(M=8\) channels.  
To reduce the dimension of the parameter vector, we apply linear discriminant analysis (LDA) [44], as in [25; 43]. To select the optimum dimension, we analyzed the effect of the number of features on the frame-based phone classification accuracy. Figure 4 shows the average validation accuracy per number of LDA features for the first session of each speaker. Based on this graph, we chose to use 21 LDA features because the average accuracy reaches a plateau at that value. Choosing a higher number of features would result in a more complex model and a longer training time. The classifier used to search for the optimal LDA value was a neural network with a batch size of 128 and 20 epochs.