## 2 Materials and Methods
### Automata Recognizer  
An ECG signal is reduced to \(11\) slope types after it is vectored. Then, the signal sequence of slopes is treated as a sequence of alphabetic symbols that can be recognized by a finite automata recognizer. Finite automata are abstract algorithms used to recognize sequences using a process commonly known as syntactic recognition. In this process, other ECG signal parameters (e.g., voltage level and time interval) become additional inputs. Figure 5 illustrates the automata transition diagram, and Table 2 shows the transition function.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Symbol** & **Slope Range** \\ \hline Slope11 & \(slope\geq 0.007 Vpp\) \\ Slope10 & \(0.007 Vpp>slope\geq 0.0056 Vpp\) \\ Slope09 & \(0.0056 Vpp>slope\geq 0.0042 Vpp\) \\ Slope08 & \(0.0042 Vpp>slope\geq 0.0021 Vpp\) \\ Slope07 & \(0.0021 Vpp>slope\geq 0.0007 Vpp\) \\ Slope06 & \(0.0007 Vpp>slope\geq-0.0009 Vpp\) \\ Slope05 & \(-0.0009 Vpp>slope\geq-0.0022 Vpp\) \\ Slope04 & \(-0.0027 Vpp>slope\geq-0.0054 Vpp\) \\ Slope03 & \(-0.0054 Vpp>slope\geq-0.0072 Vpp\) \\ Slope02 & \(-0.0072 Vpp>slope\geq-0.009 Vpp\) \\ Slope01 & \(slope<-0.009 Vpp\) \\ \hline \hline \end{tabular}
\end{table}
Table 1: Slope ranges used to vectorize the ECG data points.  
Figure 4: Final result of the vectorization and noise-removal processes.  
The automata recognizer attempts to extract an R wave from an ECG signal. The automata remain in state N until suspecting to have detected an R wave. The automata enter the QR state once they begin to detect the high slope of an R wave. The signal slope would normally tend to decrease just after the peak of the R wave, at which point the automata enter the Ru state. The automata enter the Rd state when the slope of the signal becomes negative. The signal might oscillate between Ru and Rd near the peak of an R wave. An ECG signal will normally sharply decrease after reaching the R peak until it reaches a minimum (most negative) value, at which point the automata enter the RS state, following which they will finally switch into the Sp state, representing the acceptance of the R wave.  
The transition function shows that the slope range analyzed over the wave segment in Figure 5a is sufficient for detection. The range could be reduced to make the process even faster; however, at present, we use the abovementioned range aiming for future developments. Furthermore, reducing the range might lead to a loss of signal features that would be useful for other applications. The number of automata states can also be simplified by combining Rd and Ru into one state; however, our development of the syntactic recognition method was simplified by keeping the states separate.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Symbol** & **Function** \\ \hline a & \(slope\leq Slope10\) \\ b & \(slope=Slope11\) \\ c & \(\
eg a\) \\ d & \(\
eg(b\lor d\lor e\lor f)\) \\ e & \((0\leq slope\leq Slope10)\wedge((V_{QR}>0.02V_{pp})\lor(V_{R}>0.7V_{pp})) \wedge(t_{R}<50)\) \\ f & \((Slope01<slope<0)\wedge(t_{R}<50)\) \\ g & \(slope=Slope10\) \\ h & \(\
eg(b\lor d\lor e\lor f)\) \\ i & \(\
eg(f\lor f)\) \\ j & \((20<t_{QRS}<200)\lor(V_{RS}>0.7V_{pp})\) \\ \hline \hline \end{tabular}
\end{table}
Table 2: Automata recognizer transition functions.  
Figure 5: (**a**) Relation of the ECG signal sequence to the automata states and other ECG parameters and (**b**) the automata’s state transition diagram.