A DENOISING METHOD OF DIAPHRAGM ELECTROMYOGRAM SIGNALS BASED ON DUAL-THRESHOLD FILTER
Abstract
Diaphragmatic electromyography (EMGdi) signals can effectively reflect human respiratory process and effort, but simultaneously interfered by electrocardiogram (ECG) signals, leading to the limited application of EMGdi signals. Conventional denoising schemes for ECG cancellation from EMGdi signals are usually limited to the cases of irregular ECG signals. For this purpose, this paper proposes a denoising method of ECG signals by using a dual-threshold filter, which performs effectively in the scenarios of irregular ECG condition, such as arrhythmia. Specifically, we first employ wavelet transform to decompose EMGdi signals to wavelets of different frequencies, by which QRS complex detection is performed to determine the location of ECG signals. Then we propose to remove the ECG interference by reforming the interference range with the adjacent signals. Experimental results indicate that the proposed denoising method performs superior to the state-of-the-art schemes, especially for the cases of weak EMGdi signal scenarios.
1. Introduction
In December 2019, COVID-19 had appeared in Wuhan and spread rapidly throughout the country within few months. COVID-19 is highly infectious, whose main routes of transmission are through respiratory droplets and close contact. The virus can lead to acute pneumonia, multiple organ failure, and other diseases, which seriously threaten the life of the patients.1,2 Previous research has shown that diaphragmatic electromyography (EMGdi) signal is an effective indicator for breath monitoring, which can well reflect the inspiratory and expiratory times of respiratory center and the degree of respiratory effort.3 Moreover, the diaphragm is a vital auxiliary organ for human breathing, and the respiratory signals transmitted during its operation are not affected by lung disease and airway resistance. During treatment, EMGdi signals can be used to monitor the patient’s respiratory system. In addition, the EMGdi signals play a significant role in triggering the ventilator and adjusting it to cooperate with human breathing.4,5
The frequency range of EMGdi signals is mainly from 0.5Hz to 250Hz, where the dominant power spectrum ranges from 125Hz to 150Hz.6 As additive interference, the frequency range of electrocardiogram (ECG) signals is from 0Hz to 75Hz. Therefore, the frequency contents of ECG and EMGdi signals overlap and it is difficult to remove ECG signals from EMGdi signals using the conventional filter banks. As reported in pioneering studies, the 30-Hz high-pass fourth-order Butterworth filter and frequency-domain filter were proposed.7 They eliminate information between 10Hz and 30Hz to filter the QRS complex out, but dampen the EMG signals’ amplitude in the process. Considering that the frequency contents of ECG and EMGdi signals overlap, Christov et al.8 and Kahl and Hofmann9 applied the template subtraction method to reduce the impact of cardiac activity by subtracting a template from the EMG signals. The template is made of the QRS complex by averaging multiple QRS complexes. However, this method will cause a partial loss of EMG signals. In addition, the processing methods in the time domain include mathematical morphology, which applies the idea of image processing to signals processing and removes the waveforms with ECG signal characteristics.10,11 However, the processing methods in the time domain are not perfect. With the development of mathematical analysis, wavelet transform has become an advanced technique which combines time and frequency aspects to analyze continuous signal. With multiple resolutions, wavelet transform can describe the nonstationary characteristics of signals well, and has the advantages of flexible selection of basic functions.12,13,14 Abbaspour et al.15 proposed a method based on the combination of adaptive neuro-fuzzy inference system (ANFIS) and wavelet transform to eliminate the ECG interference in the surface EMG signals. The low-frequency component containing part of the noise can be removed by combining the wavelet transform. Luo and Yang16 proposed a stationary wavelet transform algorithm to remove the ECG interference. They constructed the threshold by Donoho contraction algorithm to eliminate the wavelet coefficients of ECG. Finally, the denoised signals are reconstructed by the processed wavelet coefficients. Wu et al.13 and Taelman et al.17 combined wavelet transform with an independent component method to remove ECG signals and artifacts in myoelectricity. Besides, wavelet transform is widely used in the processing of nonlinear and nonstationary signals. Chauhan et al.18,19,20 and van Leuteren et al.21 proposed evolutionary algorithm with adaptive wavelet mutation strategy to identify the bearing defect. Although the above-mentioned contributions were effective in normal ECG scenarios, the case of irregular ECG or weak EMGdi signals continues to be a bottleneck for the ECG cancellation from EMGdi signals.
In order to overcome this issue, we propose a denoising method for ECG cancellation from the EMGdi signals. Specifically, a dual-threshold filtering algorithm is applied, which can effectively remove the irregular ECG interference and better perform for the case of weak EMGdi signals. Based on experimental results using clinical data, it is shown that the proposed denoising scheme performs superior to the state-of-the-art methods.
2. Materials and Methods
2.1. Data acquisition
All EMGdi signals data used in this paper are obtained from pioneering clinical studies22,23 by the Guangzhou Institute of Respiratory Diseases. The investigative protocol was approved by the institutional ethics committee of Chinese State Key Laboratory of Respiratory Disease, and informed consents were obtained from all the subjects who participated. The study was registered in ClinicalTrials.gov (NCT01782768) on April 29, 2013. The signals acquisition system mainly consists of five-lead esophageal electrodes and the PowerLab medical physiological signals acquisition system of ADInstruments, Australia, with a sampling frequency of 2000Hz. The signals have been preprocessed in the acquisition process as follows: 1000 times of magnification, 1-kHz low-pass filter, 15-Hz high-pass filter, and 50-Hz stopband. This preprocessing step filters out most of the high- and low-frequency noise interferences and 50-Hz power frequency interference.24,25 We included the data of 10 patients for analysis, with an average age of (67.5±10.1) years. Figure 1 shows the samples taken from three representative clinical EMGdi signals, which are interfered by different types of ECG signals. In Fig. 1(a), the EMGdi signals interfered by ECG can be obviously seen. We defined such a type of signals as A-type signals. Clinically, however, the EMGdi signals are weak in comparison with ECG, and patients could be suffering from cardiac disease, leading to the abnormal ECG interference. We plot two typical examples as shown in Figs. 1(b) and 1(c). As a comparison with that of A-type signals, we define such clinical signals as B-type signals.

Fig. 1. The EMGdi signals of clinical acquisition.
2.2. Decomposition of ECG and EMGdi signals using wavelet transform
The continuous wavelet transform can be defined as
Figure 2 shows the decomposition of EMGdi signals from ECG interference using a five-scale Haar wavelet transform, where cd1, cd2, cd3, cd4, and cd5 are high-frequency components of different scales, and ca5 is the low-frequency component on the fifth scale. Since the sampling frequency of the experimental data is 2000Hz, the frequency range of ca5 is from 0Hz to 62.5Hz, which is similar to the main frequency band of the ECG signals. According to the wavelet transform, ECG interference can be removed from the EMGdi signals.

Fig. 2. EMGdi wavelet decomposed coefficients.
2.3. ECG positioning using adaptive wavelet threshold
From Fig. 2, although most of the ECG interference can be decomposed from EMGdi signals using the fifth-scale wavelet coefficients, i.e., ca5, some residual components of ECG signals are still mixed with the EMGdi signals, as shown in cd1. In order to remove the residual interference of ECG, we propose an adaptive wavelet-aided ECG positioning scheme. Specifically, the wavelet coefficients of ca5 are employed to detect ECG signals, and then, the position of detected ECG is used to remove the residual interference from EMGdi signals in cd1. In the QRS complex, the peak of the R-wave is the largest,26 so the main task of QRS complex positioning is how to detect the position of the R-wave peak. In previous studies, QRS complex detection methods are mainly aimed at regular ECG signals. The period and R-wave amplitude of normal ECG signals are stable, and the detection is not difficult. However, abnormal ECG signals have problems such as unstable periods and large changes in R-wave peak, which bring great troubles in the removal of ECG interference from EMGdi signals. To solve the above problems, we propose the wavelet adaptive threshold method, which is the first “threshold” of the double-threshold filtering algorithm. The process is as follows:
(1) | The original signals were decomposed into five different dimensions with five-scale Haar wavelet. The five dimensions are represented by Ca(5,k), Cd(5,k), Cd(4,k), Cd(3,k), Cd(2,k), and Cd(1,k). Ca(j,k) and Cd(j,k) represent the low-frequency coefficients and high-frequency coefficients, respectively, where j represents the scale of the decomposition, and k is the position information of the wavelet coefficients. | ||||
(2) | The frequency range of the low-frequency coefficient Ca(5,k) is from 0Hz to 62.5Hz, on which the ECG signals are mainly concentrating. So the low-frequency coefficient Ca(5,k) is used to detect the QRS complex. Record the maximum value and position information between every two positive-to-negative mutation points on the wavelet coefficient. Since humans will have 1–1.6 heartbeat records per second,26 take the maximum value per second in the first five seconds as th(1), th(2), th(3), th(4), and th(5), and use the mean value of these five numbers as the initial threshold for the first five ECG positions. Starting from the sixth threshold, it is automatically updated by the unequal-weight weighted average method, and the expression can be written as th(n)={155∑x=1th(x),0<n≤5,k1th(n−2)+15k2n−1∑x=n−6th(x),n>5,(3) | ||||
(3) | Use Peakindex to express the detected peak position information collection. The Peakindex can be expressed as follows : Peakindex={P1,P2,P3,…,Pn}.(4) |

Fig. 3. (a) The no. 103 ECG signal with 1-dB SNR; and (b) QRS detection using wavelet adaptive threshold method.

Fig. 4. (a) The no. 221 ECG signal with 1-dB SNR; and (b) QRS detection using wavelet adaptive threshold method.
2.4. ECG elimination by average energy threshold
In previous studies, the processing of the interference interval is usually by truncating or shrinking the “larger” wavelet coefficients, and the wavelet coefficients less than or equal to the threshold are not processed. Zhan et al.28 applied the “larger-coefficient-truncated” method to deal with interference, and the shrinkage functions are defined as
Luo and Yang16 also adopted this method. However, this method will damage part of the EMGdi signals, because these signals and the ECG signals linearly overlap in time domain. In this paper, we propose a method for processing interference intervals with average energy threshold. First, the average energy of interference neighborhood is used as the basis of interference interval threshold. Second, the wavelet energy coefficients greater than neighborhood average energy threshold are replaced by this threshold. Finally, the wavelet energy coefficients less than this threshold will not be processed. Since the neighborhood energy of each QRS complex interference changes, the average energy threshold is also constantly changing. The steps are as follows:
(1) | The wavelet coefficients decomposed by the five-scale Haar wavelet are squared to obtain the wavelet energy coefficients of the signals. The expression can be written as PWx(j,k)=|Cx(j,k)|2,(6) | ||||
(2) | To reduce the loss of the EMGdi signals, we set a new threshold for the interference interval to smooth the interference interval. The duration of the QRS complex in healthy adults is between 0.07s and 0.10s.26 The T value is selected as the interference duration in an appropriate range according to different patient conditions. According to the characteristic of the QRS complex, the range of ECG interference is determined in the ratio of 1:1 before and after the R-wave peak. The T can be expressed as T=[Pn−0.5t×f,Pn+0.5t×f],(7) | ||||
(3) | Take 0.06-s wavelet energy coefficients on both sides of the interference interval T to find the average energy of the neighborhood of the interference interval. The average energies of the left and right neighborhoods of the Pnth interference interval can be expressed as Ar(Pn)=Pn−t1−1∑k=Pn−t1−0.06×fPWx(j,k)∕0.06×f,(8) Al(Pn)=Pn+t2+0.06×f∑k=Pn+t2+1PWx(j,k)∕0.06×f.(9) THj(Pn)=Ar(Pn)+Al(Pn).(10) newPWx(j,k)={PWx(j,k),PWx(j,k)≤THj(pn),THj(pn),PWx(j,k)>THj(pn).(11) |
3. Results and Discussion
3.1. Performance verification
We evaluated the use of our algorithm for the removal of ECG contamination from EMGdi recordings in the clinical signals. And its performance (ECG removal as well as EMGdi preservation) was compared to two previously reported algorithms, which are the wavelet-based adaptive filtering algorithm (WAF)28 and stationary wavelet transform algorithm (SWT).16 The clinical EMGdi signals with ECG interference are shown in Figs. 5(a), 6(a), and 7(a), and the processing results of wavelet-based adaptive filtering algorithm, stationary wavelet transform algorithm, and dual-threshold filtering algorithm are shown in Figs. 5(b), 6(b), 7(b); 5(c), 6(c), 7(c); and 5(d), 6(d) and 7(d), respectively. Figure 5 shows that the three methods have good performance in removing the ECG interference. Remarkably, residuals of ECG peaks often remained and the EMG signals’ amplitude dampened after applying WAF and SWT. However, that is not conducive to the subsequent use of EMGdi signals.

Fig. 5. (a) EMGdi signal overlap with ECG noise; (b) wavelet-based adaptive filtering algorithm denoising result; (c) stationary wavelet transform algorithm denoising result; and (d) dual-threshold filtering algorithm denoising result.

Fig. 6. (a) EMGdi signal overlap with ECG noise; (b) wavelet-based adaptive filtering algorithm denoising result; (c) stationary wavelet transform algorithm denoising result; and (d) dual-threshold filtering algorithm denoising result.

Fig. 7. (a) EMGdi signal overlap with ECG noise; (b) wavelet-based adaptive filtering algorithm denoising result; (c) stationary wavelet transform algorithm denoising result; and (d) dual-threshold filtering algorithm denoising result.
3.2. Results analysis
For a clinical signal, we cannot accurately obtain its real signal, thus, SRN is not useful to evaluate the efficiency of algorithms. Power spectral density (PSD) is a commonly used method to describe EMG signals,6 which can compare the relative contributions of ECG and EMGdi. In order to analyze the ECG interference removal performance of our algorithm comprehensively, two commonly used characteristic values of the power spectrum are used in the experiments,3,29 high frequency-to-low frequency ratio (H∕L) and median frequency (Fm). Here, H∕L is the ratio of power in the range of 125–150-Hz frequency band to the power in the range of 25–50-Hz frequency band. The H∕L can be expressed by
The dominant power of the ECG signals lies below 50Hz, whereas that of the EMGdi signals lies between 125Hz and 150Hz. Therefore, H∕L can effectively reflect the relative contributions of ECG and EMGdi.
The median frequency is defined as
According to the experimental results shown in Table 1, after being processed by the three algorithms, respectively, the H∕L ratios are higher than those of the original signals, indicating that most of the ECG signals in the range of 25–50-Hz frequency band have been removed. Especially, the H∕L ratio of the signals processed by the dual-threshold filtering algorithm is significantly higher than those of the other two algorithms. These results indicate that the dual-threshold filtering algorithm performs better in removing ECG interference. A comparison is also shown in Table 2. It can be seen that, even when the EMGdi signals are weak and the ECG signals are abnormal, the algorithm in this paper still has better performance in removing ECG interference.
Patient ID | Corrupted EMGdi | Wavelet-based adaptive filtering algorithm | Stationary wavelet transform algorithm | Dual-threshold filtering algorithm |
---|---|---|---|---|
H1 | 0.142 | 0.506 | 1.138 | 1.402 |
H2 | 0.247 | 0.637 | 1.089 | 1.501 |
H3 | 0.251 | 0.658 | 1.079 | 1.298 |
H4 | 0.215 | 0.598 | 1.010 | 1.167 |
H5 | 0.078 | 0.367 | 0.854 | 1.196 |
Patient ID | Corrupted EMGdi | Wavelet-based adaptive filtering algorithm | Stationary wavelet transform algorithm | Dual-threshold filtering algorithm |
---|---|---|---|---|
H6 | 0.097 | 0.135 | 0.306 | 0.732 |
H7 | 0.142 | 0.204 | 0.449 | 0.697 |
H8 | 0.072 | 0.207 | 0.393 | 0.628 |
H9 | 0.044 | 0.168 | 0.625 | 0.730 |
H10 | 0.070 | 0.349 | 0.276 | 0.688 |
From the experimental results shown in Table 3, we can see that the median frequency of the signals increases significantly after processing by the three algorithms. That means the proportion of EMGdi content of the signals has gone up. Remarkably, the experimental results of the dual-threshold filtering algorithm show the most obvious increase in the median frequency of the original signals. We can also learn from Table 4 that the algorithm we proposed still has better performance in retaining the EMGdi signals than the other two algorithms, even when the EMGdi signals are weak and the ECG signals are unsteady and irregular.
Patient ID | Corrupted EMGdi | Wavelet-based adaptive filtering algorithm | Stationary wavelet transform algorithm | Dual-threshold filtering algorithm |
---|---|---|---|---|
H1 | 30.780 | 51.514 | 73.831 | 80.704 |
H2 | 37.466 | 60.382 | 72.526 | 84.052 |
H3 | 40.034 | 62.190 | 72.579 | 82.048 |
H4 | 38.511 | 60.741 | 72.533 | 80.905 |
H5 | 27.795 | 45.413 | 70.022 | 81.452 |
Patient ID | Corrupted EMGdi | Wavelet-based adaptive filtering algorithm | Stationary wavelet transform algorithm | Dual-threshold filtering algorithm |
---|---|---|---|---|
H6 | 17.162 | 27.289 | 42.674 | 71.179 |
H7 | 18.382 | 32.379 | 52.528 | 63.631 |
H8 | 18.595 | 31.730 | 44.686 | 59.795 |
H9 | 27.295 | 44.758 | 72.007 | 73.770 |
H10 | 35.642 | 58.862 | 55.848 | 78.048 |
4. Conclusion and Further Work
In order to remove ECG interference from EMGdi signals, this paper proposed a dual-threshold filtering algorithm, which performed robustly under the condition of irregular ECG interference or weak EMGdi signals. For validations, two types of clinical irregular ECG signals were considered in experiments. Experimental results showed that the proposed denoising scheme yielded a superior solution compared to the existing methods, especially for the practical scenarios of weak EMGdi signals.
However, this study has some limitations. Specifically, by taking advantage of the adaptive threshold filtering, the detection of QRS complex entails relatively high computations, thus failing to provide a real-time process for conventional central processing unit. In future work, light-weight QRS detection scheme will be studied.
Ethical Compliance
All EMGdi signals data used in this paper are obtained from the study “Comparative Effects of Different Noninvasive Ventilation Mode on Neural Respiratory Drive in Recovering AECOPD Patients”22,23 at the Guangzhou Institute of Respiratory Diseases. The investigative protocol was approved by the institutional ethics committee of Chinese State Key Laboratory of Respiratory Disease, and informed consents were obtained from all the subjects who participated. The study was registered in ClinicalTrials.gov (NCT01782768) on April 29, 2013.
Conflict of Interest
The authors declare that there are no conflicts of interest.
Acknowledgments
This work was supported by Science and Technology Program of Guangzhou (Nos. 202002030353 and 2019050001), Science and Technology Planning Project of Guangdong Province (No. 2019A1515011940), and Industry-Academia-Research Innovation Project of Blue-Fire of Ministry of Education (No. CXZJHZ201803).