Introduction

The development of Functional Electrical Stimulation(FES) system has allowed it to be widely applied in stroke and hemiparetic patients nowadays [14]. Electrical stimulation was applied in clinical use by Liberson, Homlmquest et al. [5]. They proposed an electrical stimulation system to solve the problem of drop-foot when patients are walking. The name of FES was proposed by Moe and Post [6] in 1962. Many researches adopt FES training to increase grabbing and gripping ability for hand rehabilitation [79], which is also used in lower limbs to gain gait and balance capacity [10, 11]. FES can enhance the effect of rehabilitation and activate patients’ muscle system, also effectively improve their conditions. Many studies have proved that electrical stimulation treatment is beneficial for stroke and hemiparetic patients [1214].

Electromyogram (EMG) is a physiological signal which can be used in clinical research to observe muscle contraction. It can be analyzed in time domain and frequency domain. Time domain is used to calculate muscle force output [15, 16], and frequency domain is used to analyze the fatigue extent of muscle [17, 18]. Currently some researches use EMG signal as a control signal, which uses muscle force as the control signal [19], or use EMG to analyze proceeding conditions of muscle[20]. Present researches which combine EMG and FES can divide into 3 aspects: (1) EMG signal is used as the control signal of FES, but during the whole period of electrical stimulation output, the EMG signal wouldn’t be detected. Therefore, the system is simpler because it doesn’t need to solve interference problems during electrical stimulation [19, 21]. (2) Electrical stimulation (ES) and EMG acquisition are placed in different muscle parts, so EMG is not interfered by ES output. Thus, the system can continue recording EMG data [22]. (3) FES and EMG are placed in the same muscles. EMG is a nonlinear analog signal, therefore, the signal processing procedure and filter selected becomes importance.

Hybrid EMG signals are produced because the muscle contraction during ES is a combination of different EMG signal sources - Stimulus Artifact (SA), volitional EMG signal and ES-induced EMG signal (stimulus EMG signal) [23]. A SA signal is created by electrical stimulation output, which is much larger than EMG signal. Volitional EMG signal is produced by muscle force output, and stimulus EMG signal comes from extra muscle contraction produced by electrically stimulated muscles.

The measuring of volitional EMG needs to eliminate the SA and the stimulus EMG. The most common method to eliminate the stimulus EMG is the comb filter [23, 24], and the SA can be effectively removed by using a blocking window [25] because in hybrid EMG signals, the ES-induced component has regular pattern [25]. Thus, the comb filter uses the last cycle signal to subtract with the next cycle, and the stimulus EMG is removed. The performance of measuring volitional EMG in a blocking window and comb filter combine system is effective [23]. In addition, there are researches that propose different operation processing methods for EMG signal acquisition, such as Gram-Schmidt filters [25] and SSAICF [26], but most researches adopt fixed electrical stimulation output intensity to analyze EMG accurately.

Few of the existed EMG signal acquisition and processing systems can simultaneously provide ES and process EMG signal. In most studies, hybrid EMG signals are off-line calculated. If the biofeedback system need to process in real-time, the entire system design has to include real-time signal acquisition, real-time signal processing, control signal feedback, etc. It is hard to design a system which can process EMG signal during electrical stimulation in real-time because separating volitional EMG signal and stimulus EMG signal involves many problems, such as the effect of ES interference, or signal processing and filtering issues. Currently, for the hybrid EMG signals, different system architectures and processing methods have been proposed for signal analysis [2326], and the analysis results of these methods are also quite different.

This study aimed to provide a real-time hybrid EMG signal acquisition and processing method. A hardware system was applied and a hybrid EMG signal separating system that functions during electrical stimulation was proposed. The system can effectively separate volitional EMG signal and stimulus EMG signal during electrical stimulation in real-time. The separated signal, according to different applications, can be processed to evaluate muscle condition and the muscle force produced under different intensity of ES.

System architecture

The system architecture is shown in the Fig. 1 , which mainly involves five parts: (1) Electrical stimulator module (2) EMG signal acquisition module (3) Microprocessor control module (4) EMG signal separation processing module (FPGA) (5) Verification and storage module.

Fig. 1
figure 1

System architecture

Electrical stimulator module

The study used existed ES output circuit board (Raising Technology Co., BMS-Pro), which can produce bi-phasic output and adjust three main parameters: intensity, frequency and width. The signals of positive and negative wave (Ch_P and Ch_N) from the ES circuit board were transmitted back to the microprocessor control module. In this research, ES output frequency was 25 Hz, width was 300 μs, and intensity was 0-30mA shown in Fig. 2 .

Fig. 2
figure 2

Electrical stimulation output waveform

To avoid interfering with other hardware components, an isolating circuit was designed and placed in the transmitting passage of Ch_P and Ch_N before the microprocessor control module. The isolating circuit used an opto-isolator to isolate the ES circuit board from other hardware circuits.

4-ch EMG signal acquisition module

This study designed a 4-channel EMG acquisition circuit to measure EMG signal. The EMG signal acquisition circuit was designed in a way that allows it to switch between different gain factors, including 20, 40, 100 and 200. Also, to reduce signal noise, a Low Pass Filter (LPF) with 955Hz cutoff frequency was applied along with a High Pass Filter (HPF) with 100 Hz [27] cutoff frequency.

To allow microprocessor control module to read complete signal, negative wave should be excluded from EMG signal. Therefore a level-shift circuit was applied to increase the level from 0V to 2.5V. In this way the overall EMG signal were adjusted to positive potential.

Microprocessor control module

The main processing core dsPIC 30f5011 was used to control all the peripheral circuit connections, as shown in Fig. 1. The processing core involved a 16-ch A/D convertor to receive 4-ch EMG analog signal. Each EMG channel was 10-bit digital value, and the sample rate was 2k Hz. Then the digital value and control signal of 4-ch EMG signal were transmitted to the EMG signal separation processing module.

When receiving EMG signal, blocking window can be simultaneously applied to remove Stimulation Artifact(SA). When the electrical stimulator module received Ch_P and Ch_N signal, it stopped receiving EMG signal and output ES ON signal to the EMG signal separation processing module and FPGA, which means that the microprocessor did not output any signal during stimulation pulse output. This can avoid the potential signal processing error in the EMG signal separation processing module. The blocking time can be adjust between 300 μs ∼ 5ms.

Moreover, to check whether the EMG signal converted by the A/D convertor diverged from the acquired raw EMG signal or not, another D/A convertor device (TLV5630) was applied for signal verification. D/A control signal was also controlled by Microchip dsPIC 30f5011, which can achieve real-time verification. In other words, when EMG signal was input and converted to digital value, the D/A convertor can instantly convert the digital value to analog signal.

EMG signal separation processing module (FPGA)

The EMG signal separation processing module applied Altera EP2C5T144 FPGA device for all the EMG signal data processing. First, the value of each channel from the received 4-ch EMG signal had to be analyzed for comb filter processing as well as volitional and stimulus EMG signal separation. When there was no ES output (ES ON=0), the module transmitted the acquired raw EMG signal to volitional EMG output.

Since ES output has a fixed periodicity, comb filter was applied to process the periodic signal and separate volitional EMG signal from unprocessed hybrid EMG signal. As shown in Fig. 3, comb filter helps to filter stimulus EMG signal out from hybrid EMG signal to obtain volitional EMG signal. Then hybrid EMG signal subtracts volitional EMG signal through a subtractor to obtain stimulus EMG signal [23].

Fig. 3
figure 3

Signal separating process

To separate volitional EMG signal from stimulus EMG signal, we applied multi-band-reject comb filter [23]:

$$ H(Z)=\frac{\left( 1-Z^{(-X)}\right)}{\sqrt{2}} $$
(1)

X: EMG signal sample rate and ES sample rate adjustment. Here, X=80. H(Z): Filtered EMG signal. Z : EMG signal value.

Verification and storage module

D/A convertor device (TLV5630) was applied for signal verification, in which two parts were designed: (1) The acquired EMG signal was converted to digital value through the microprocessor, and then the D/A convertor was simultaneously applied to convert the signal back to analog signal for output. (2) To make sure that the FPGA can accurately decode the EMG digital signal of each channel, the FPGA was synchronized with the D/A convertor to convert decoded signal back to analog signal. Signals output from the above two parts can be compared with raw signal input to ensure the accuracy of digital signal. The converted analog can be applied in oscilloscope, Data Acquistion (DAQ) and other comparison and storage devices for related research or subsequent signal processing.

Performance metrics

To evaluate the accuracy of volitional EMG in hardware real-time comb filter isolation system, we applied the LabVIEW DAQ for the calculation. We used a sample rate of 8k Hz, so the result of evaluation could be more precise. To demonstrate the system performance, signals will transform in to frequency domain with Fast Fourier Transform (FFT) (2) and power spectral density (PSD) envelop (3) [28], then calculate the correlation coefficient (4) between the EMG signal without the ES, the hybrid EMG signal, and the comb filter volitional EMG. In the time domain, the cross correlation method (5) was used to show the delayed time, by obtain the peak value shifting in the x-axis [29].

PSD formula:

$$ EMG(f)=F\left\{EMG(t)\right\}= {\int}_{\!\!\!\!-\infty}^{\infty} EMG(t)e^{-j2\pi f}dt $$
(2)
$$ PSD=\left|F\left\{EMG(t)\right\}\right|^{2} $$
(3)

Correlation coefficient formula: r is the correlation coefficient, x and y is the compare singals.

$$ r=\frac{n\left( \sum xy\right)-\left( \sum x\right)\left( \sum y\right)}{\sqrt{\left[n\sum x^{2}-\left( \sum x\right)^{2}\right] \left[n\sum y^{2}-\left( \sum y\right)^{2}\right]}} $$
(4)

Cross correlation formula:

$$ r_{xy}[p]= \frac{1}{N}\sum\limits_{n=0}^{N-1}X[n]Y[n-p], $$
(5)

where r x y is the cross correlation, and p is 0, 1, 2, ..., and X is the comb filter volitional EMG, Y is the Hybrid EMG signal.

System implementation and measurement

The measuring result of the implantation and signal output from the system (Fig. 4), which uses hardware architecture to achieve faster processing. Volitional EMG signal can be separated through the signal processing of SA remove and multi-band-reject comb filter, which can be applied in different condition to continue post-signal process and application control.

Fig. 4
figure 4

Real-time EMG signal acquisition and separation processing hardware system during electrical stimulation

To avoid the potential ground disturbance when using oscillator for signal measurement, differential probe was applied for all the waveform measurement. From the EMG signal acquisition in Fig. 5, it is obvious that when the muscle contracts, the EMG signal has larger amplitude, as part (a) shows, and the EMG signal stays steady when the muscle doesn’t moving, as shown in part (b).

Fig. 5
figure 5

EMG signal a EMG signal during movement b EMG signal of resting muscle

A hybrid EMG signal is displayed in Fig. 6 shows a hybrid EMG waveform during an electrical stimulation period. A SA signal is produced when the EMG signal is acquired during ES output, which is larger in several times than volitional EMG signal, so the EMG signal in this section is often ignored in calculation process. A stimulus EMG signal appears after SA signal, while volitional EMG Signal appears in every section.

Fig. 6
figure 6

Hybrid EMG waveform during electrical stimulation

The aim of the research was to isolate volitional EMG signal from hybrid EMG signal. As Fig. 7 shows, the black line is hybrid EMG signal and the grey line is volitional EMG signal. The hybrid EMG signal subtracted the isolated volitional signal to obtain the stimulus EMG signal.

Fig. 7
figure 7

The stimulus and volitional EMG signal during electrical stimulation

The increase of electrical stimulation intensified stimulus EMG signal. Figure 8 shows the measuring results of different electrical stimulation output intensities. From these figures it can be inferred that stimulus EMG signal indeed increased in accordance with the rise in electrical stimulation intensity.

Fig. 8
figure 8

The pulse in (a) is stimulus EMG signal during 5mA electrical stimulation output, the pulse in (b) is stimulus EMG signal during 11mA electrical stimulation output

In the result of signal processing, the EMG signal acquired by the 4-ch EMG signal acquisition module is similar to the signal converted by the microprocessor control module to 10-bit digital signal before the signal is converted back to an analog signal through the D/A converter. Therefore, it can be proved that 10-bit resolution is quite sufficient for 2k Hz sample rate (Fig. 9). The EMG signal separation processing module can ensure that the received and decoded EMG signal is correct (Fig. 10).

Fig. 9
figure 9

Comparison of raw EMG waveforms

Fig. 10
figure 10

Comparison of the 4-ch EMG signal at microprocessor and FPGA waveform

The result of PSD in the EMG without ES, hybrid EMG, and comb filter volitional EMG is shown in Fig. 11, which shows that the comb filter volitional EMG is more similar to the EMG without ES than hybrid EMG. In the result of PSD envelop correlation coefficient, the EMG without ES and comb filter volitional EMG is 0.90, and the EMG and comb filter is 0.87. In the time domain, the result of the cross correlation method (Fig. 12) shows that peak is in lag 2, so the delay of comb filter is 2 point. Since the sample rate is 8k Hz, therefore the delay is 250 μs.

Fig. 11
figure 11

The Power Spectral Density analysis

Fig. 12
figure 12

The cross correlation analysis of hybrid EMG and volitional EMG

Conclustion

Most of the existed EMG signals measuring and processing systems cannot acquire and process EMG signal during electrical stimulation at the same time. Some of these systems can only process signal under certain intensities of electrical stimulation. The hardware real-time hybrid EMG signal isolating system proposed in this study connects electrical stimulation system with EMG signal system, which allows it to instantly receive patients’ hybrid EMG signal and examine the force output condition of their muscles in real time. This allows the system to monitor muscle condition and the force output condition of different body parts in real-time. Moreover, this measuring device can perform accurate EMG signal acquisition and subsequent processing even under different intensities of electrical stimulation. After the acquired hybrid EMG signal was processed by the EMG signal separate processing module (FPGA), the real-time volitional EMG signal was obtained, through which users’ real force output condition can be shown without the interference of electrical stimulation. The result of PSD envelop shows that the comb filter volitional EMG in the correlate coefficient is 0.90, which is similar to the raw EMG. In addition, the cross correlation shows that this hardware system only has a 250 μs time delay. In this hardware system, it features accurate signal output and short delay, and this system hardware parts costs about 200 US dollars. Future work should focus on the ES real-time feedback control by using the separated EMG signal for improving the effect of ES rehabilitation for the stroke patients.