TFM: Design and evaluation of electromyography signal processing techniques using resource-constrained devices

On July 15, 2020, the master student Pablo Sarabia Ortiz read and defended his master thesis entitled “Design and evaluation of electromyography signal processing techniques using resource-constrained devices”. This master thesis is enclosed in the current B105 Electronic Systems Lab research topic of acquiring and processing electromyography (EMG) signals on the human body to achieve a wearable health device based on EMG signals.

Surface electromyographic (sEMG) is an acquisition technique based on recording muscles potential over the skin. sEMG based devices have a wide range of application: early diagnose and treatment of neurodegenerative diseases, tracking of daily activities, rehabilitation, and adaptive training.  sEMG signals are complex and present different challenges like great amount of data, complex signals, and significant variations between subjects and days. For most of these applications is required to identify and classify the gestures or movements that the user is doing. This classification is a task that requires great amount of resources (memory and CPU). This thesis is focused in understanding the sEMG signal characteristics and designing a classifier for hand gestures, by using the custom acquisition board.

Picture of the hardware used for sEMG acquisition. On the left the electrodes, on top of the image a preamplifier and on the bottom right corner the stack of PCBs composed of the microcontroller and the ADC.
Picture of the hardware used for sEMG acquisition. On the left the electrodes, on top of the image a preamplifier and on the bottom right corner the stack of PCBs composed of the microcontroller and the ADC.

First, a quantitative analysis of the sEMG data was carried out by using parallel factor analysis (PARAFAC). The dataset used was NINAPRO, because it contains numerous different hand gestures performed by different subjects in different days. This PARAFAC analysis showed that is possible to reduce the number of channels from 16 to 4 without significant loss of information, as shown in the figure below. It also showed that most of the information is under the 350 Hz range. PARAFAC proved to be an interesting method for choosing the most significant channels in the dataset.

Process followed to do the PARAFAC analysis of the data from the NINAPRO dataset.
Process followed to do the PARAFAC analysis of the data from the NINAPRO dataset.

Second, an acquisition system to log the data to the computer was established. This acquisition system had 4 channels at a sampling rate of 500 Hz each. The data once logged was formatted and stored using MATLAB. Eight different gestures were performed, as shown in the figure. Then a support vector (SVM) machine classifier was trained obtaining an 99% accuracy in cross validation.

Table with all the gestures recorded for the master thesis.
Table with all the gestures recorded for the master thesis.

Third, a two level three variables factorial design was carried out to model the influence of the design variables in three features of the classifier (execution time, memory footprint and accuracy). The three design variables studied were: codification of the SVM, data precision (float32 or float64) and length of the sample. The results shown that float64 should never be used, and that there is always a tradeoff between classifier accuracy versus the memory footprint and speed of the classifier. It was also identified the memory footprint as the bottleneck for the use of the classifier in a resource-constrained device. It was achieved a reduction of 1/14 of the original memory footprint and a speedup of 233 times, however accuracy of the classifier lowered to 85%.

TFG: Design and development of synchronization protocols for wireless EMG devices

Clock Synchronization

Electromyography is the technique used to check the health of muscles and the nerve cells that control them. Muscle data is normally collected through non-intrusive surface electrodes, which are placed on the skin. One of the problems that this technique has traditionally presented is the number of wires that are needed to connect the electrodes to the device that processes the information.

In the B105 Electronic Systems Lab there is a line of research focused on the development of a platform that removes these wires. The proposed solution is a platform with wireless sensors that allows the collection of EMG data.
The design and development of the synchronization and data transfer protocols are essential and will be covered in this project. This work is a fundamental piece along with the detection of EMG signals, the encapsulation of the device and the representation of the data to create a final wireless EMG product.

In this project the objective is to design and develop at least one synchronization protocol and one data transfer protocol that allow the specific activities of an EMG platform to be carried out. A previous study of the EMG technique, as well as the available hardware and software have been conducted. Subsequently, two synchronization protocols and one data transfer protocol have been designed and implemented.

Finally, tests have been carried out to evaluate the operation of the protocols, verifying that they work properly.

TFM: Low-resource electronic system design for motion detection based on surface electromyography (SEMG)

There are certain electronic devices that use surface electromyography signals for many purposes such as for muscle rehabilitation or to control a hand prosthetic, among others. But most of them use powerful microprocessors and external computers, making them expensive, and having a large power consumption.

    Therefore, these devices are only available for a narrow group of people when in reality a great amount of them are in need of them. They need to be fast, cheaper and have low power consumption. For those reasons, the elaboration of this project is encouraged.

The goal of this project is to design and implement a system that recognize different gestures and identifies them, calculates the muscle’s force, and detects the muscle’s activation time (when it goes from rest to being activated), through the implementation of low resources. This will have a positive impact on its cost, its power, and its autonomy.

Block diagram of the system

    C language has been used as the programming tool for this project due to the possibility of high-level programming. As for the hardware, microprocessors Cortex®-M4 and Cortex®-M0 have been used. The decision of implementing the program in both was to demonstrate that the same results can be achieved with both a more powerful processor and a less powerful one. Each microprocessor is integrated in a STM32 board, which also has a user button that by pressing it, it calibrates the system. So, anyone can obtain accurate results.

For this project, SEMG signals data was provided by the University of California at Berkeley. The data was taken from five different subjects wearing a bracelet with a 4×16 array of surface electrodes (64 channels). They performed 21 different hand gestures throughout many experiments involving resting position, different effort levels, and replacement of the surface electrodes.

4×16 array of electrodes

By reading the data and calculating a group set of features, it was possible to successfully achieve gesture recognition with the base subject, and through calibration with the rest of the subjects. It was also conceivable to measure the muscle’s force and detect its activation time.

Regarding the power consumption, the system implemented with the Cortex®-M4 microprocessor consumes about 90mA when active and the one with the Cortex®-M0 consumes about 83mA at 3.3V. Therefore, it has been proven that both systems are low power due to the use of low resources, but the M0 microprocessor consumes less. As for the time response of the program, it was measured the Cortex®-M4 takes 208.3 seconds total to read and process the data whereas the Cortex®-M0 takes 320.3 seconds.

For the proper creation of a complete system, a device was designed by integrating the data acquisition, the microprocessor, a transceiver for communication with other devices, the user’s interface (button), and its power supply.