Skip to main content
Scientific Reports logoLink to Scientific Reports
. 2023 May 12;13:7768. doi: 10.1038/s41598-023-33319-4

A smart approach to EMG envelope extraction and powerful denoising for human–machine interfaces

Daniele Esposito 1, Jessica Centracchio 1,, Paolo Bifulco 1, Emilio Andreozzi 1
PMCID: PMC10181995  PMID: 37173364

Abstract

Electromyography (EMG) is widely used in human–machine interfaces (HMIs) to measure muscle contraction by computing the EMG envelope. However, EMG is largely affected by powerline interference and motion artifacts. Boards that directly provide EMG envelope, without denoising the raw signal, are often unreliable and hinder HMIs performance. Sophisticated filtering provides high performance but is not viable when power and computational resources must be optimized. This study investigates the application of feed-forward comb (FFC) filters to remove both powerline interferences and motion artifacts from raw EMG. FFC filter and EMG envelope extractor can be implemented without computing any multiplication. This approach is particularly suitable for very low-cost, low-power platforms. The performance of the FFC filter was first demonstrated offline by corrupting clean EMG signals with powerline noise and motion artifacts. The correlation coefficients of the filtered signals envelopes and the true envelopes were greater than 0.98 and 0.94 for EMG corrupted by powerline noise and motion artifacts, respectively. Further tests on real, highly noisy EMG signals confirmed these achievements. Finally, the real-time operation of the proposed approach was successfully tested by implementation on a simple Arduino Uno board.

Subject terms: Biomedical engineering, Data processing

Introduction

Electromyography (EMG)1 is one of the most used techniques to realize human–machine interfaces (HMIs)2,3 and assistive device control. EMG allows measuring the contraction of muscles by recording their electrical activity. This is usually performed via skin electrodes, so called surface EMG (sEMG). sEMG signal amplitude is a few millivolts and its power spectrum is mainly concentrated in 10–250 Hz band1,4. The EMG signal is rich in information, but only concise information on whether the muscle is active and/or the level of muscular contraction is usually of interest for HMI applications. To this aim, the EMG signal envelope is commonly used, rather than the raw signal. The combination of raw EMG signal rectification and low pass filtering is referred to as the EMG Linear Envelope (EMG-LE)1. The envelope of an EMG signal can also be estimated by computing the local root mean square (RMS) value of the raw EMG via a moving window. EMG-LE gives a measure of the local signal power and can be computed either via analog or digital processing5.

To date, many electronic boards are available for EMG signal acquisition, which can be interfaced with microcontroller boards to easily implement HMIs2. These EMG boards usually provide the EMG-LE to substantially reduce the required sampling rate (by at least one order of magnitude) compared to that required for acquisition of raw EMG signals (at least 1 kHz). However, sEMG signals are affected by various noises, the main ones being powerline interference (PLI) and motion artifacts, which can seriously impair the quality of the EMG-LE signals provided by such boards.

PLI is an electromagnetic interference that is caused by the capacitive or inductive coupling between EMG electrodes and the powerline in the surrounding environment610. In both cases, PLI makes a 50 Hz or 60 Hz sinewave (depending on the national regulations) and higher harmonics appear superimposed to the actual EMG signal. The PLI signal in EMG recordings can be much larger than the actual EMG signal, and its amplitude can vary over time.

Motion artifacts in EMG recordings are unavoidable, because they come from body motion, increase of muscle cross-section, and the resulting slippage of various tissues and skin layers11. The two main sources of motion artifacts in sEMG are the mechanical disturbance of the electrode charge layer, due to relative motion between the electrode and the underlying skin, and the deformation of the skin under the electrodes, which makes the potentials between skin layers change when skin is deformed or stretched8,12. The latter is much more difficult to attenuate, except by strongly abrading or puncturing the skin, which is not feasible in most practical cases.

According to the International Society of Electrophysiology and Kinesiology standards, the frequency band of the diagnostic EMG signal ranges from 5–10 Hz up to 400–500 Hz7. Motion artifacts are generally confined to very low frequencies, typically below 20–30 Hz1,13,14. The spectrum of powerline interference should be concentrated at the powerline frequency (e.g., 60 Hz in Japan and almost all American continent, 50 Hz in Europe, Asia, Africa, Australia and some South American countries) but, due to non-linear loads increasingly used in modern equipment, higher harmonics of the fundamental powerline frequency are also present8. Figure 1 shows a qualitative sketch of sEMG and noise signals in the time domain, along with their power spectra in the frequency domain.

Figure 1.

Figure 1

Qualitative sketch of sEMG signal, powerline interference and motion artifacts in time and frequency domains.

Most of the above-mentioned EMG boards providing EMG-LE signals directly, usually do not allow reducing the powerline interference nor the motion artifacts, which must be filtered before extracting the envelope, to obtain suitable EMG-LE signals. Consequently, these EMG boards often end-up providing noisy and uncertain envelope signals that cause malfunctioning of HMI applications, especially when the users are in environments with strong powerline electromagnetic fields, and when they perform large movements15. For this reason, some EMG boards also provide the raw EMG signal, in addition to the envelope signal.

In literature, many studies describe rather sophisticated methods to reduce EMG noises, which are usually based on digital filters16,17, neural networks (NN)18, wavelets19, ensemble empirical mode decomposition (EEMD)20, canonical correlation analysis (CCA)21, among many others. Many of these methods are currently not suitable for real-time operation. This is often due to heavy computational burdens that pose strong limitations, especially in the case of wearable or portable HMI applications, which are based on battery-powered devices. In fact, these devices are usually equipped with resource-limited computing platforms to achieve very low-power operation and thus cannot support demanding calculations. However, there has recently been an increasing interest in developing small neural networks, and in general processing algorithms that operate in real time, which are particularly optimized for embedded systems based on microcontrollers or programmable hardware (e.g., Field Programmable Gate Arrays, System-on-Chip), within the paradigm of edge computing.

This study presents a simple and elegant solution for real-time, noise free EMG-LE extraction with extremely low computational complexity. A feed-forward comb (FFC) filter22 removes both powerline interference and motion artifacts, while subsequent rectification and averaging provide the EMG-LE, without using a single multiplication.

Although the FFC filter is well-known in literature, its use for EMG denoising has never been investigated thoroughly. Probably, this has been due to the fact that the frequency response of the FFC filter causes substantial distortion to the EMG spectrum. Nevertheless, this study demonstrates that the FFC filter is effective for PLI and motion artifacts removal and preserves very well the morphology of the EMG-LE. Considering that this performance can be obtained at the cost of a single sum computation, as compared to other filtering approaches for noise removal, it follows that this solution offers great computational advantages for HMI applications. In fact, it can be easily implemented on very resource-constrained platforms developed for low-power applications, or used to save computational resources for more demanding tasks.

Methods

Feed-forward comb filter

The FFC filter operation is based on adding a delayed version of the input signal to itself, so as to produce constructive and destructive interference. The destructive interference mechanism is precisely that used to cut off a specific frequency component, along with its harmonics. The general difference equation of the FFC filter can be expressed as follows:

yk=xk+αxk-N, 1

where x is the input signal, N is the delay expressed in number of samples, and α is a parameter that regulates some aspects of the filter behaviour. In particular, when α is equal to ± 1, the minima of the FFC amplitude response are equal to zero, so they become nulls of the amplitude response. This choice is used to cancel out specific frequency components, such as the fundamental frequency of powerline interference and its harmonics.

The following equations report the expressions of the FFC amplitude responses for α = ± 1:

Hfn=2sin(πNfn),α=-1, 2
Hfn=2cos(πNfn),α=1, 3

where fn is the normalized frequency, i.e. the absolute frequency f divided by the sampling frequency fs. The nulls of the amplitude responses in Eqs. (2) and (3) are reported in the following Eqs. (4) and (5), respectively:

fnull=kfsN,kZ, 4
fnull=fs2N+kfsN=1+2kfs2N,kZ. 5

The amplitude response in Eq. (2) has nulls for frequency values that are integer multiples of fs/N, while the amplitude response in Eq. (3) has nulls for odd integer multiples of fs/(2N). For this reason, the choice of α = − 1 is the one that allows removing the fundamental frequency of powerline noise interference and all its harmonics (both odd and even). Indeed, by choosing N equal to fs/fpli, with fpli being the fundamental frequency to be cancelled, the nulls of the amplitude response would correspond to all integer multiples of fpli. On the contrary, by choosing α = 1, one would need to set N equal to fs/(2fpli) to make the first null to correspond to fpli and all other nulls to odd multiples of fpli, which leaves even multiples of fpli practically unaltered, thus resulting in poor PLI removal performances.

The difference equation of the specific FFC filter that was used in this study is reported below:

yk=xk-xk-N. 6

Considering 50 Hz as the fundamental powerline interference frequency and assuming a sampling frequency of 1000 Hz, N must be set equal to 20. The amplitude response of the FFC filter with N = 20 is depicted in Fig. 2, where it could be observed that the nulls correspond to 0 Hz, 50 Hz and its integer multiples.

Figure 2.

Figure 2

Amplitude response of the FFC filter with N = 20 and fs = 1000 Hz. The − 3 dB line is depicted as a red horizontal dashed line, while the black vertical dashed lines correspond to the cut-off frequencies.

It is worth noting that the FFC filter has a zero DC gain with a high-pass behaviour at low frequencies. The − 3 dB cut-off frequencies can be computed as follows:

H(fn3dB)Hmax=12sinπNfn3dB=12fn3dB=14N+kN34N+kN,f3dB=14+kfsN=14+kfpli=12.5Hz+k·50Hz34+kfsN=34+kfpli=37.5Hz+k·50Hz. 7

The FFC filter has two main effects: it operates as a comb filter for the removal of powerline interference and filters out the DC and near-DC components, where the power spectra of motion artifacts and baseline oscillations are mainly concentrated (below 20–30 Hz4). These aspects are very important for the extraction of the EMG-LE, which is usually computed by cascading a full-wave rectification (absolute value or power functions with even exponents) and a low-pass filtering (usually at 5-10 Hz for HMI applications)3,7,23. Indeed, both powerline interference and motion artifacts may severely corrupt the EMG-LE signal, and must be filtered out upstream of the actual envelope computation. Figure 3 shows an example of these issues (the EMG-LE signals were computed by cascading a full-wave rectification and a low-pass filtering at 5 Hz).

Figure 3.

Figure 3

(a) Noiseless EMG signal with superimposed EMG-LE; EMG signal corrupted by (b) variable amplitude powerline interference, (c) baseline oscillations, (d) both, with corrupted EMG-LE and true EMG-LE; (e) EMG signal processed with FFC filter, recovered EMG-LE, true EMG-LE.

In most low-cost, low-power platforms for HMI implementation, a unipolar A/D converter is commonly used, so the digitized EMG signal exhibits only positive values and cannot be directly fed to the full-wave rectification stage24,25. In fact, the true reference voltage must first be determined and subtracted from the just digitized EMG, in order to recover the positive and negative values of the EMG. This is not always a straightforward operation, as unpredictable offset voltages may appear at the output of EMG measurement devices, which result in improper compensation of reference voltage. The zero DC gain of the FFC filter offers a simple and elegant solution to this problem, by providing a zero-mean EMG signal that is suitable for EMG-LE extraction.

It is worth noticing that the FFC filter rejects frequency bands of fpli/2 width, centered around the powerline interference components k·fpli, thus distorting the original EMG signal. However, it will be shown below that for the sole purpose of extracting the EMG-LE, such distortions are not of concern in practice.

In summary, the FFC filter has two main advantages: (a) it ensures the joint removal of powerline interference (with harmonics), offset voltages and motion artifacts/baseline oscillations, thus providing a pre-processed EMG signal that is suitable for EMG-LE extraction; (b) it has an extremely simple computation, that, in fact, requires only a single subtraction, thus resulting in an almost negligible computational burden even for resource-constrained platforms.

Offline tests on noisy EMG signals

A quantitative assessment of the FFC filter performance was carried out by corrupting a noiseless real EMG signal with a simulated powerline interference, both with flat amplitude and with amplitude modulation. All signal processing operations were performed in MATLAB® R2017b (The MathWorks, Inc., 1 Apple Hill Drive, Natick, Massachusetts, 01760, USA). The noiseless EMG signal was extracted from a dataset acquired in a previous study26. No measurements were carried out during this study. The sEMG signals had been recorded at sampling frequency of 1 kHz from forearm muscles.

The powerline interference was simulated by using amplitudes and phases of the 50 Hz component and its harmonics up to 500 Hz, which had been extracted from a measurement of real powerline interference obtained with the same experimental set-up. An amplitude modulated powerline interference was also designed by using a slow sinewave as the modulating signal. The simulated noise was then added with increasing amplitudes to the noiseless EMG signal, so as to obtain SNR values between 0.05 and 10. The noisy EMG signals thus obtained were processed with the FFC filter. The linear envelopes of the noiseless, noisy and filtered EMG signals were computed by means of a full-wave rectification (absolute value operation) and a low-pass filtering at 5 Hz via a moving average (MA) on 88 samples (with a sampling frequency of 1000 Hz, a MA filter with N = 88 samples has a cut-off frequency of 5 Hz). The block diagram illustrating the various filtering stages is presented in Fig. 4.

Figure 4.

Figure 4

Block flow diagram of the various filtering stages applied on the raw EMG signal.

Moreover, the cross-correlation between the noiseless EMG-LE signal and each noisy and filtered EMG-LE signal was computed by considering the whole length. Then, the maximum of the cross-correlation was located, the corresponding lag was used to re-align the signals, and the Pearson’s correlation coefficient was determined. The trends of the correlation coefficients with the SNR were finally compared.

A further quantitative assessment of the FFC filter performances was carried out by corrupting the same noiseless EMG signal with real motion artifacts. Signals chunks including only motion artifacts were extracted from the dataset26. The noiseless EMG signal was then corrupted by motion artifacts signals with increasing amplitudes, so as to obtain SNR values between 0.05 and 10. The corrupted EMG signals were processed with the FFC filter. Finally, the linear envelopes of the noiseless, corrupted and filtered EMG signals and the Pearson’s correlation coefficients between the noiseless EMG-LE signal and each corrupted and filtered EMG-LE signal were computed via the same procedures. The trends of the correlation coefficients with the SNR were finally compared.

Noisy EMG signals with powerline interference and motion artifacts were extracted from the same dataset to further test the performance of the FFC filter on actual noisy data.

Performance comparison with other denoising algorithms

The performance of the FFC filter was compared with two denoising approaches proposed in literature27,28. The first approach operates in the frequency domain and mainly consists of Fast Fourier Transform (FFT) computation, cancellation of spectral coefficients corresponding to the harmonics of the powerline frequency and to the main spectral content of motion artifacts at low frequencies, and finally inverse FFT computation. This FFT-based approach was designed with the aim of reducing as much as possible the number of samples for FFT computation, to reduce the computational burden per sample in a sliding window application, or the computational delay in a block processing application. However, since the number of samples determines the frequency resolution of the FFT, a maximum resolution value of 25 Hz was set, which for EMG signals sampled at 1 kHz was achieved by computing the FFT on 40 samples, in order to be able to precisely cancel the spectral coefficients corresponding to the harmonics of the powerline frequency (50 Hz) and those corresponding to the 0–25 Hz range for motion artifacts removal. The second approach, referred to as FilterDxN, operates in the time domain and is essentially a high quality factor comb filter with integer coefficients, properly tuned to exhibit zeros at the harmonics of the powerline frequency. The FilterDxN features two parameters, namely N and D. As per indication of the original publication, N was set to 17, while D was set to the ratio of the sampling frequency (1000 Hz) and the powerline frequency (50 Hz), which in this study was equal to 20. Therefore, a Filter20x17 was actually considered for the tests. The two algorithms were tested both for PLI and motion artifacts removal, via the same methodologies adopted for the performance assessment of the FFC filter, previously described in the “Offline tests on noisy EMG signals” section. In particular, the tests on PLI with constant and modulated amplitude were performed by considering only the lowest SNR (0.05), because all algorithms showed stable performance at varying SNR. The performance on motion artifacts removal, instead, were assessed for all SNR values. Moreover, the computational and memory resources requirements were evaluated and compared for all the considered algorithms.

Real-time tests on noisy EMG signals

The real time performance of the proposed approach was assessed via the following test scene. An arbitrary waveform generator (GW Instek AFG-2005, Good Will Instrument Co., Ltd., No.7-1, Jhongsing Road., Tucheng Dist., New Taipei City 236, Taiwan) was used to output voltage signals from real recordings of noisy EMG signals (previously acquired in Ref.26), so as to resemble a real scenario. The output voltage of the generator was fed to an off-the-shelf EMG sensor board “MyoWare Muscle Sensor”29, in order to amplify the EMG signals. The amplified signals, provided as an analog output on the “Raw EMG signal” pin of the “Myoware Muscle Sensor” board (pin 7), were fed to an analog input of an Arduino UNO board. At this stage, the raw EMG signals were first digitized at 1 kHz, using the on-board analog-to-digital converter (10-bit resolution), and then processed in real time via the proposed methodology. The open-source library TimerOne30 was used to ensure a precise sampling time. The EMG processing performed by the Arduino UNO board consisted of the FFC filtering for PLI and motion artifacts removal, signal rectification, and low-pass filtering at about 4 Hz, by using a MA filter with a window size of 128 samples to eventually obtain the EMG-LE. Each new sample of the EMG-LE was released at a rate of about 8 Hz and sent to a personal computer via a Bluetooth serial interface (HC-0531), connected to the Arduino UNO board. The full Arduino code is available as Supplementary Material.

It is worth noticing that other commercial EMG sensors, such as Seed EMG detector24 or Gravity EMG sensor25, do not offer a specific port for raw EMG output, rather providing only the EMG envelope. For this reason, such sensors are not compatible with the proposed methodology. The correct execution of the algorithm strictly requires a precise uniform sampling, ensured by the TimerOne library. Indeed, adding simple idle cycles to sample the raw EMG signal would result in nonuniform sampling and impair correct filter operation. In addition, by only changing the sampling frequency of the raw EMG signal (e.g., from 1000 to 1200 Hz), the algorithm could be easily adjusted for the removal of 60 Hz (and higher harmonics) powerline interference, as well as motion artifacts. Other parameters, such as the number of FFC filter coefficients (N = 20) and the width of the MA filter window (128 samples) for linear envelope computation, can remain unchanged. The use of a window size that is a power of 2 allows replacing the division required in the MA filter by a simple bit shifting, which has a negligible computational cost. Table 1 summarizes the algorithm specifications for 50 Hz or 60 Hz powerline frequencies.

Table 1.

Parameters setting for 50 Hz or 60 Hz powerline interference.

Parameters for 50 Hz PLI Parameters for 60 Hz PLI
Raw EMG sampling frequency 1000 Hz 1200 Hz
Number of FFC filter coefficients 20 20
Lower cut-off frequency of FFC filter ≈ 12 Hz ≈ 15 Hz
Number of samples of MA filter window for EMG-LE computing 128 128
Upper cut-off frequency of MA filter for EMG-LE computing ≈ 4 Hz ≈ 5 Hz
Data output frequency from the Arduino Bluetooth serial port ≈ 8 Hz ≈ 9 Hz

Results

Offline tests on noisy EMG signals

Figure 5 shows the noiseless EMG signal (top panels), the noisy signals (central panels) with SNR equal to 2 (both with flat amplitude and amplitude modulated noise) and the related filtered signals (bottom panels). It could be observed that the original EMG signals were efficiently recovered from both the very noisy EMG signals.

Figure 5.

Figure 5

Top panels: noiseless EMG signal; central panels: noisy EMG signals obtained by corrupting the noiseless EMG signal with flat amplitude powerline noise (left) and amplitude modulated power-line noise (right); bottom panels: signals obtained by applying the FFC filter to the noisy EMG signal with flat amplitude (left) and amplitude modulated (right) powerline noise.

This result is confirmed by the Pearson’s correlation coefficients scored by the filtered EMG-LE signals with respect to the corresponding noiseless EMG-LE signals, which turned out to be in excess of 0.98 for all values of the SNR (ranging from 0.05 to 10), as reported in Fig. 6. The same figure also depicts the correlation coefficients of the noisy EMG-LE with respect to the corresponding noiseless EMG-LE signals. It is worth noticing that for a SNR of 7, the correlation coefficients of the noisy signals already dropped below 0.9, and for a SNR of 2 (the same SNR value of the signals depicted in Fig. 5) correlation coefficients as low as 0.51 and 0.36 were obtained, respectively, for EMG signals corrupted by flat amplitude and amplitude modulated powerline interference.

Figure 6.

Figure 6

Pearson’s correlation coefficients of noisy and filtered EMG-LE with respect to noiseless EMG-LE. Solid lines refer to the EMG signal corrupted with flat amplitude powerline interference (yellow line) and the related filtered signal (blue line); dashed lines refer to the EMG signal corrupted with amplitude modulated powerline interference (purple line) and the related filtered signal (orange line).

Figure 7 shows the noiseless EMG signal in the top panel, the EMG signal corrupted by motion artifacts with SNR equal to 2 in the central panel, and the related filtered signal in the bottom panel. Once again, the FFC filter successfully recovered the original EMG signal from its corrupted version. Indeed, the FFC filter provided Pearson’s correlation coefficients in excess of 0.94 for SNR values ranging from 1 to 10 (see Fig. 8). For lower SNR values, the correlation coefficients exhibited a rather brisk drop, while still maintaining a correlation gain in excess of 2 for SNR values down to 0.2. Regarding the corrupted EMG signals, it could be observed that for a SNR of 7, the correlation coefficients already dropped below 0.8, and for a SNR of 2 (the same SNR value of the signals depicted in Fig. 7) a correlation coefficient as low as 0.22 was obtained.

Figure 7.

Figure 7

Top panel: noiseless EMG signal; central panel: EMG signal corrupted with motion artifacts (SNR = 2); bottom panel: filtered signal obtained by applying the FFC filter to the corrupted EMG signal depicted in the central panel.

Figure 8.

Figure 8

Pearson’s correlation coefficients of EMG-LE of signals corrupted by motion artifacts (red line) and related filtered signals (blue line) with respect to noiseless EMG-LE.

Figure 9 shows the results achieved by the FFC filter on actual noisy EMG signals affected by amplitude modulated powerline interference (top panel) and motion artifacts (bottom panel). In Fig. 9a it could be observed how the amplitude variations of the powerline interference in the noisy EMG (in blue) resulted in spurious contraction peaks in the related EMG-LE (in red), and how they were effectively removed by the FFC filter in the processed EMG (in yellow) and the related EMG-LE (in green). Figure 9b demonstrates the capability of the FFC filter to remove the baseline oscillations due to motion artifacts, which likewise resulted in spurious contraction peaks in the noisy EMG-LE.

Figure 9.

Figure 9

Results obtained on EMG corrupted by: (a) powerline interference; (b) motion artifacts. The noisy EMG is reported in blue, its linear envelope in red. The filtered EMG in yellow and its linear envelope in green.

Performance comparison with other denoising algorithms

The results obtained for the EMG signals corrupted by PLI with SNR equal to 0.05, both with constant and modulated amplitude, are outlined in Table 2. The Filter20x17 provided roughly a 1% increase in Pearson’s correlation coefficient between the filtered and the noiseless EMG-LE as compared to the FFC filter, while the FFT-based approach provided a slightly lower performance.

Table 2.

Pearson’s correlation coefficients between the noiseless EMG-LE and the EMG-LE obtained by filtering noisy EMG signals with SNR = 0.05 via the considered algorithms.

Algorithm PLI (constant amplitude) PLI (modulated amplitude)
FFC 0.9857 0.9855
Filter20 × 17 0.9948 0.9946
FFT-based filter 0.9819 0.9817

The results obtained for EMG signals corrupted by motion artifacts (SNR ranging from 0.05 to 10) and processed via the compared algorithms are shown in Fig. 10. In particular, Fig. 10a depicts the Pearson’s correlation coefficients computed between the filtered EMG-LE signals and the noiseless EMG-LE reference, while Fig. 10b depicts the differences between the correlation coefficients obtained via the FFC algorithm and those obtained via the Filter20x17 and the FFT-based approach. The results show that for lower SNR values (SNR < 2) the FFC substantially outperforms the Filter20x17, by providing up to 35% increases in correlation coefficients, while for higher SNR values (SNR > 2) the Filter20x17 provides slight increases (< 1 %) in correlation coefficients with respect to the FFC filter. The FFT-based approach provides slightly lower performance as compared to the FFC for all SNR values.

Figure 10.

Figure 10

Results obtained on EMG corrupted by motion artifacts with SNR ranging from 0.05 to 10, and then processed via the FFC filter, the Filter20x17, and the FFT-based approach. (a) Pearson’s correlation coefficient between the noiseless and the filtered EMG-LE for the three compared algorithms; (b) differences between the correlation coefficients achieved via the FFC filter and those achieve via the Filter20x17 and the FFT-based approach.

The computational and memory resource requirements of the analyzed algorithms were outlined in Table 3, from which one can observe that the FFC filter features both the lowest computational burden, requiring the computation of only one sum and no multiplications, and the lowest memory storage of 20 input signal samples. The Filter20x17 requires the highest memory storage of 321 input signal samples, while the FFT-based filter presents the highest computational burden of at least 106 additions and 106 multiplications.

Table 3.

Computational and memory resource requirements of the compared algorithms.

Algorithm Additions Multiplications Divisions Memory storage (samples)
FFC 1 0 0 20
Filter20 × 17 17 0 1 321
FFT-based filter  > 106  > 106 0 40

Discussion

The algorithm presented in this study has the significant advantage of removing both powerline interference and motion artifacts on sEMG recordings in real time, as well as providing the EMG linear envelope with an extremely low computational load. It can be used to remove both 50 or 60 Hz PLI (and higher harmonics) by changing only the sampling frequency of the raw EMG signal. In addition, once the raw EMG signal is digitized and the FFC filter is applied, the EMG-LE is calculated using a rectification and a moving average low-pass filter.

Different tests were performed on EMG signals, artificially corrupted by powerline interference and motion artifacts, and proved the capacity of the FFC filter to effectively remove such noises. The proposed filter was capable of providing extremely accurate estimates of the noiseless EMG envelopes. Indeed, the Pearson’s correlation coefficients computed between the filtered and the true linear envelopes were always greater than 0.98, even for signals corrupted by PLI with SNR values as low as 0.05. Similar results were obtained for EMG signals corrupted by motion artifacts, with correlation coefficients in excess of 0.94, even for SNR values low as 1.

The FFC filter was further compared with two approaches previously proposed in literature, namely FilterDxN and an FFT-based approach, both in terms of quality of the filtered EMG-LE signals obtained, and in terms of computational and memory resource requirements. The results showed that both the FilterDxN and the FFT-based approach have substantially higher computational and memory resource requirements as compared to the FFC filter, which, in addition, always outperforms the FFT-based approach in terms of filtering efficacy, and also outperforms the FilterDxN on EMG signals that are heavily corrupted by motion artifacts while providing comparable performances for higher SNRs and for PLI removal. For these reasons, the FFC filter appears to be preferrable over the compared approaches for the purpose of reliable EMG-LE extraction, as it ensures, at the same time, substantially improved filtering efficacy and computational efficiency.

The proposed method provided excellent results also on real noisy EMG signals. Considering that the MyoWare board does not filter out the noises, its analog EMG-LE output would have provided very inaccurate estimates of muscle activity (see Fig. 3). This largely explains the practical problems encountered by many users of EMG sensor boards. The real-time performance of the FFC filter was confirmed by the effective implementation on the Arduino UNO board. Indeed, the design of a processing scheme with no multiplications and a rather small number of sums allowed its implementation on a simple and low-cost microcontroller like the Atmel ATmega328 equipped on the Arduino UNO board.

It is worth mentioning that the proposed filter cannot be used as a noise suppressor for other biopotentials such as electroencephalogram (EEG) and electrocardiogram (ECG). Indeed, the fundamental components of these signals would be unavoidably cancelled or distorted due to the high-pass cut-off, which is at about 12 Hz for 50 Hz PLI (about 15 Hz for 60 Hz PLI). The use of the proposed filter is also not recommended for the acquisition of EMG signals for diagnostic purposes. Although the high-pass cut-off at 12 Hz is recommended in many EMG applications, the FFC filter exhibits stop-bands at multiples of the powerline frequency that are too wide and cause distortions of the EMG signal14. This behaviour does not ensure that the FFC filter sufficiently preserves morphology of EMG signal components (i.e. motor unit action potential trains); nonetheless, this study showed that the FFC filter almost perfectly preserves the envelope of EMG signals. Moreover, the FFC filter is expected to provide lower performances in the removal of particularly brisk motion artifacts, as they would present with significant spectral power densities within the pass-bands of the filter. The performance of the FFC filter should be assessed on a larger cohort of cases, which may include EMG signals acquired from more subjects, in different conditions (e.g., fatigue), and performing different physical activities (e.g., running, playing sports).

As shown in a recent survey2, EMG-based HMIs are the most popular among those that exploit biopotentials as control signals. However, EMG recording presents well-known issues, such as need for stable electrode placement and skin preparation, degradation of wet electrodes contact when conductive gel dries out, degraded SNR that results from the use of dry electrodes12, susceptibility to electromagnetic interferences (e.g., PLI), motion artifacts, crosstalk with other biopotentials (e.g., EMG signals from near muscles, ECG, etc.). A further common issue of EMG is that electrodes applied to the skin expose the subjects to a higher risk of electrical shock6,3234. This risk could be removed/reduced by using battery-operated devices and wireless connections35.

It is useful to highlight that, in order to overcome many of the EMG limitations, alternative methods such as Force-myography (FMG) are becoming increasingly popular to monitor muscle activity2,36 and control HMIs (e.g., hand prostheses3740, exoskeletons41, gesture recognition devices42). FMG is currently the best alternative to EMG linear envelope43 exploits morphological changes in muscles during contraction by using force/pressure sensors, which have also been useful to detect respiration and mechanical heart activity4446. Moreover, the FMG presents various advantages over the EMG: no need for electrodes, i.e. no electrical risk; much simpler processing, since the FMG signal can be used as it is and has a strong similarity with EMG-LE47; less susceptibility to electromagnetic interference. However, while well-established standards for EMG measurements are available (e.g., SENIAM7), clear guidelines to achieve accurate FMG measurements on specific muscles have not been provided yet.

It is interesting to note that integration of EMG and FMG improves classification of human intent and control of powered prosthetic devices, as compared to EMG alone48. Such integration would require an increased computational demand, because both EMG and FMG signals would need to be processed. The extremely low computational burden of the FFC filter would certainly help to reduce the computational burden of reliable EMG-LE extraction, thus favoring the development of these new kind of HMIs on very resource-constrained platforms developed for low-power applications.

In conclusion, although new emerging techniques are becoming more and more widespread and show comparable or even superior performances compared to EMG, this technique is still the current gold standard to monitor muscle activity4,14. Consequently, it is still useful to investigate new EMG signal filtering techniques that can increase its performance, especially in HMI applications14,4951.

Supplementary Information

Author contributions

Conceptualization, D.E., E.A., P.B.; methodology, D.E., E.A., J.C., P.B.; formal analysis, E.A.; investigation, D.E., E.A., J.C., P.B.; visualization D.E., E.A., J.C.; software, D.E; data curation, D.E., E.A., J.C.; writing—original draft preparation, review and editing, D.E., E.A., J.C., P.B. All authors have read and agreed to the published version of the manuscript.

Data availability

The data presented in this study are available on request from the corresponding author.

Competing interests

The authors declare no competing interests.

Footnotes

Publisher's note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Supplementary Information

The online version contains supplementary material available at 10.1038/s41598-023-33319-4.

References

  • 1.Basmajian JV, de Luca CJ. Muscles Alive: Their Functions Revealed by Electromyography. Williams & Wilkins; 1985. [Google Scholar]
  • 2.Esposito D, et al. Biosignal-based human–machine interfaces for assistance and rehabilitation: A survey. Sensors. 2021;21:6863. doi: 10.3390/s21206863. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 3.Parajuli N, et al. Real-time EMG based pattern recognition control for hand prostheses: A review on existing methods, challenges and future implementation. Sensors. 2019;19:4596. doi: 10.3390/s19204596. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 4.Konrad P. The ABC of EMG: A Practical Introduction to Kinesiological Electromyography. Noraxon Inc.; 2005. [Google Scholar]
  • 5.Esposito, D. et al. Measurement of muscle contraction timing for prosthesis control: A comparison between electromyography and force-myography. In Proc. 2020 IEEE International Symposium on Medical Measurements and Applications (MeMeA) 1–6 (2020).
  • 6.Webster JG. Medical Instrumentation Application and Design. 4. Wiley; 2009. [Google Scholar]
  • 7.Stegeman, D. & Hermens, H. Standards for Surface Electromyography: The European Project Surface EMG for Non-Invasive Assessment of Muscles (SENIAM) (2007).
  • 8.Clancy EA, Morin EL, Merletti R. Sampling, noise-reduction and amplitude estimation issues in surface electromyography. J. Electromyogr. Kinesiol. 2002;12:1–16. doi: 10.1016/s1050-6411(01)00033-5. [DOI] [PubMed] [Google Scholar]
  • 9.Jiang Y, et al. Effective biopotential signal acquisition: Comparison of different shielded drive technologies. Appl. Sci. 2018;8:276. doi: 10.3390/app8020276. [DOI] [Google Scholar]
  • 10.Andreozzi E, Gargiulo GD, Fratini A, Esposito D, Bifulco P. A contactless sensor for pacemaker pulse detection: Design hints and performance assessment. Sensors. 2018;18:2715. doi: 10.3390/s18082715. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 11.Fratini A, Cesarelli M, Bifulco P, Romano M. Relevance of motion artifact in electromyography recordings during vibration treatment. J. Electromyogr. Kinesiol. 2009;19:710–718. doi: 10.1016/j.jelekin.2008.04.005. [DOI] [PubMed] [Google Scholar]
  • 12.Gargiulo, G. et al. Dry electrode bio-potential recordings. Annu. Int. Conf. IEEE Eng. Med. Biol. Soc. 2010 6493–6496. 10.1109/IEMBS.2010.5627359 (2010). [DOI] [PubMed]
  • 13.Merletti R, Cerone GL. Tutorial. Surface EMG detection, conditioning and pre-processing: Best practices. J. Electromyogr. Kinesiol. 2020;54:102440. doi: 10.1016/j.jelekin.2020.102440. [DOI] [PubMed] [Google Scholar]
  • 14.De Luca CJ, Gilmore LD, Kuznetsov M, Roy SH. Filtering the surface EMG signal: Movement artifact and baseline noise contamination. J. Biomech. 2010;43:1573–1579. doi: 10.1016/j.jbiomech.2010.01.027. [DOI] [PubMed] [Google Scholar]
  • 15.Naik GR. Applications, Challenges, and Advancements in Electromyography Signal Processing. IGI Global; 2014. [Google Scholar]
  • 16.Strzecha K, et al. Processing of EMG signals with high impact of power line and cardiac interferences. Appl. Sci. 2021;11:4625. doi: 10.3390/app11104625. [DOI] [Google Scholar]
  • 17.Xu L, et al. Comparative review of the algorithms for removal of electrocardiographic interference from trunk electromyography. Sensors. 2020;20:4890. doi: 10.3390/s20174890. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 18.Kale SN, Dudul SV. Intelligent noise removal from EMG signal using focused time-lagged recurrent neural network. Appl. Comput. Intell. Soft Comput. 2009;2009:e129761. doi: 10.1155/2009/129761. [DOI] [Google Scholar]
  • 19.Jiang, C.-F. & Kuo, S.-L. A comparative study of wavelet denoising of surface electromyographic signals. Annu. Int. Conf. IEEE Eng. Med. Biol. Soc. 2007 1868–1871. 10.1109/IEMBS.2007.4352679 (2007). [DOI] [PubMed]
  • 20.Sun Z, et al. Surface electromyography signal denoising via EEMD and improved wavelet thresholds. MBE. 2020;17:6945–6962. doi: 10.3934/mbe.2020359. [DOI] [PubMed] [Google Scholar]
  • 21.Al Harrach M, et al. Denoising of HD-SEMG signals using canonical correlation analysis. Med. Biol. Eng. Comput. 2017;55:375–388. doi: 10.1007/s11517-016-1521-x. [DOI] [PubMed] [Google Scholar]
  • 22.Proakis JG, Manolakis DG. Digital Signal Processing. Pearson Prentice Hall; 2007. [Google Scholar]
  • 23.Medved, V. Standards for Reporting EMG Data (2000).
  • 24.Grove—EMG Detector—Seeed Wiki. https://wiki.seeedstudio.com/Grove-EMG_Detector/ (Accessed 27 January 2022).
  • 25.Gravity: Analog EMG Sensor by OYMotion—DFRobot. https://www.dfrobot.com/product-1661.html (Accessed 27 January 2022).
  • 26.Polisiero M, et al. Design and assessment of a low-cost, electromyographically controlled, prosthetic hand. Med. Devices (Auckl.) 2013;6:97–104. doi: 10.2147/MDER.S39604. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 27.Simao M, Mendes N, Gibaru O, Neto P. A review on electromyography decoding and pattern recognition for human-machine interaction. IEEE Access. 2019;7:39564–39582. doi: 10.1109/access.2019.2906584. [DOI] [Google Scholar]
  • 28.Tabakov S, Iliev I, Krasteva V. Online digital filter and QRS detector applicable in low resource ECG monitoring systems. Ann. Biomed. Eng. 2008;36(11):1805–1815. doi: 10.1007/s10439-008-9553-5. [DOI] [PubMed] [Google Scholar]
  • 29.MyoWare Muscle Sensor Kit—Learn.Sparkfun.Com. https://learn.sparkfun.com/tutorials/myoware-muscle-sensor-kit#myoware-muscle-sensor (Accessed 27 January 2022).
  • 30.TimerOne—Arduino Reference. https://www.arduino.cc/reference/en/libraries/timerone/ (Accessed 27 January 2022).
  • 31.HC-05—Bluetooth Module. https://components101.com/wireless/hc-05-bluetooth-module (Accessed 16 February 2022).
  • 32.Webster JG, Eren H. Measurement, Instrumentation, and Sensors Handbook: Electromagnetic, Optical, Radiation, Chemical, and Biomedical Measurement. CRC Press; 2017. [Google Scholar]
  • 33.Burgess RC. Electrical safety. Handb. Clin. Neurol. 2019;160:67–81. doi: 10.1016/B978-0-444-64032-1.00005-9. [DOI] [PubMed] [Google Scholar]
  • 34.Lee WR. The hazard of electrocution during patient monitoring. Postgrad. Med. J. 1970;46(536):355–359. doi: 10.1136/pgmj.46.536.355. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 35.Esposito, D., Gargiulo, G.D., Polley, C., D’Addio, G. & Bifulco, P. Improvements of a simple piezoresistive array armband for gesture recognition. In Proc. 2020 International Conference on e-Health and Bioengineering (EHB) 1–5 (2020).
  • 36.Xiao ZG, Menon C. A review of force myography research and development. Sensors. 2019;19:4557. doi: 10.3390/s19204557. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 37.Esposito D, et al. The “Federica” hand. Bioengineering. 2021;8:128. doi: 10.3390/bioengineering8090128. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 38.Esposito D, et al. Experimental study to improve “Federica” prosthetic hand and its control system. In: Henriques J, Neves N, de Carvalho P, et al., editors. Proceedings of the XV Mediterranean Conference on Medical and Biological Engineering and Computing—MEDICON 2019. Springer; 2020. pp. 586–593. [Google Scholar]
  • 39.Esposito D, et al. Study on the activation speed and the energy consumption of “Federica” prosthetic hand. In: Henriques J, Neves N, de Carvalho P, et al., editors. Proceedings of the XV Mediterranean Conference on Medical and Biological Engineering and Computing—MEDICON 2019. Springer; 2020. pp. 594–603. [Google Scholar]
  • 40.Esposito D, et al. Evaluation of grip force and energy efficiency of the “Federica” hand. Machines. 2021;9:25. doi: 10.3390/machines9020025. [DOI] [Google Scholar]
  • 41.Esposito D, et al. Design of a 3D-printed hand exoskeleton based on force-myography control for assistance and rehabilitation. Machines. 2022;10:57. doi: 10.3390/machines10010057. [DOI] [Google Scholar]
  • 42.Esposito D, et al. A piezoresistive array armband with reduced number of sensors for hand gesture recognition. Front. Neurorobot. 2020;13:114. doi: 10.3389/fnbot.2019.00114. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 43.Belyea A, Englehart K, Scheme E. FMG versus EMG: A comparison of usability for real-time pattern recognition based control. IEEE Trans. Biomed. Eng. 2019;66(11):3098–3104. doi: 10.1109/TBME.2019.2900415. [DOI] [PubMed] [Google Scholar]
  • 44.Andreozzi E, et al. Respiration monitoring via forcecardiography sensors. Sensors. 2021;21:3996. doi: 10.3390/s21123996. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 45.Andreozzi E, et al. Forcecardiography: A novel technique to measure heart mechanical vibrations onto the chest wall. Sensors. 2020;20:3885. doi: 10.3390/s20143885. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 46.Andreozzi E, Gargiulo GD, Esposito D, Bifulco P. A novel broadband forcecardiography sensor for simultaneous monitoring of respiration, infrasonic cardiac vibrations and heart sounds. Front. Physiol. 2021;12:1988. doi: 10.3389/fphys.2021.725716. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 47.Esposito D, et al. A piezoresistive sensor to measure muscle contraction and mechanomyography. Sensors. 2018;18:2553. doi: 10.3390/s18082553. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 48.Sanford J, Patterson R, Popa DO. Concurrent surface electromyography and force myography classification during times of prosthetic socket shift and user fatigue. J. Rehabil. Assist. Technol. Eng. 2017 doi: 10.1177/2055668317708731. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 49.Roland T, Amsuess S, Russold MF, Baumgartner W. Ultra-low-power digital filtering for insulated EMG sensing. Sensors. 2019;19:E959. doi: 10.3390/s19040959. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 50.Bi L, Feleke AG, Guan C. A review on EMG-based motor intention prediction of continuous human upper limb motion for human–robot collaboration. Biomed. Signal Process. Control. 2019;51:113–127. doi: 10.1016/j.bspc.2019.02.011. [DOI] [Google Scholar]
  • 51.Calado, A., Soares, F. & Matos, D. A review on commercially available anthropomorphic myoelectric prosthetic hands, pattern-recognition-based microcontrollers and sEMG sensors used for prosthetic control. In Proc. 2019 IEEE International Conference on Autonomous Robot Systems and Competitions (ICARSC) 1–6 (2019).

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Supplementary Materials

Data Availability Statement

The data presented in this study are available on request from the corresponding author.


Articles from Scientific Reports are provided here courtesy of Nature Publishing Group

RESOURCES