Next Article in Journal
Design of an IoT-Based Remote Learning System for Medical Skill Training in the Age of COVID-19: Focusing on CPR Skill Training
Next Article in Special Issue
Transformer-Based Multilingual Speech Emotion Recognition Using Data Augmentation and Feature Fusion
Previous Article in Journal
Numerical Study on the Effect of Deposit Layer on the Minimum Wall Thickness of Boiler Water Tube under Different Operating Conditions
Previous Article in Special Issue
Estimation of the Underlying F0 Range of a Speaker from the Spectral Features of a Brief Speech Input
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Dual-Adaptive Approach Based on Discrete Cosine Transform for Removal of ECG Baseline Wander

1
Department of Information Management, National Taipei University of Business, Taipei 100025, Taiwan
2
School of Accounting and Finance Beijing Institute of Technology, Zhuhai 519085, China
3
Department of Finance, Chihlee University of Technology, New Taipei City 220, Taiwan
*
Author to whom correspondence should be addressed.
Appl. Sci. 2022, 12(17), 8839; https://doi.org/10.3390/app12178839
Submission received: 19 May 2022 / Revised: 28 August 2022 / Accepted: 30 August 2022 / Published: 2 September 2022
(This article belongs to the Special Issue Machine Learning for Language and Signal Processing)

Abstract

:
Removal of baseline wander (BW) is an important preprocessing step before manually or automatically interpreting electrocardiogram (ECG) records. It is a challenging issue to fully remove BW while preserving original clinical information because BW is usually mingled with low-frequency ECG components. A dual-adaptive approach based on discrete cosine transform (DCT) is presented in this study. Firstly, the cardiac fundamental frequency (CFF) of ECGs is accurately calculated through DCT domain analysis. Secondly, DCT coefficients of ECGs, whose frequencies are below CFF, are used to construct an amplitude vector in which the optimal cut-point between BW and ECGs is distinctly reflected. Finally, a new filtering technique based on DCT is exploited to suppress BW with its cutoff frequency adjusted to the optimal cut-point. The proposed method is applied to both real ECG records and simulated ECGs with its results compared to those of three previous methods published in the literature. The experimental results show that substantial improvements in performance can be achieved when adopting this dual-adaptive approach.

1. Introduction

With the development of computing technology, computer-aided diagnosis of cardiovascular diseases based on electrocardiograms (ECGs) has emerged as a popular area of research [1,2,3]. However, the ECG signal is prone to being contaminated with artifacts because it is captured and externally recorded by skin electrodes. Baseline wander (BW) is a type of low-frequency artifact in ECG which may stem from respiration and body movements. Removal of BW is an important step in the preprocessing stage of the ECG signal.
However, the spectrum of BW usually overlaps with those of low-frequency ECG components such as the T-wave, P-wave, and ST segment. Removal of BW can cause distortions to these components which contain important clinical information. For example, the ST segment is a typical measurement for the diagnosis of ST-elevation myocardial infarction (STEMI) [4,5], while microvolt T-wave alternans (MTWA) has a strong association with the increased risk of ventricular tachyarrhythmias [6]. Therefore, it is desirable that any algorithm used for BW removal can fully eliminate BW and also preserve the original clinical information.
In the past three decades, many approaches have been reported in the literature to address this issue. In general, these methods can be categorized as follows: linear filtering methods, nonlinear filtering methods, curve-fitting methods, and transform-reconstruction methods.
Linear filters, whose output is a linear function of the input, mainly contain two types: finite impulse response (FIR) filters and infinite impulse response (IIR) filters. FIR filters are normally preferred because of their linear phase characteristics [7], but a major drawback of these methods is that their cutoff frequencies are time-invariant. Nonlinear filters such as weighted median filters (WMFs) [8] and morphological filters [9,10] are receiving increasing attention when ECGs and BW spectra overlap. However, the WMF-based method has a high computation cost because samples within its sliding window need to be maintained in sorted order all the time. Whereas, the methods based on morphological filters must design a proper structuring element for morphological operators.
Curve fitting is another nonlinear approach for BW correction. Cubic splines, polynomial, and rational functions are used to fit the BW after PR-segments have been determined [11,12] while [13] suggest that when the magnitude of BW is small, it is better to approximate by linear functions. However, the two biggest hurdles associated with curve-fitting methods are the extraneous frequency components brought into the ECG signal and the characteristic-segment detection requirement.
Transform-reconstruction methods, as their name suggests, contain two steps. Firstly, the transformation of the raw ECG signal into a transform domain in which the coefficients corresponding to BW are eliminated. Secondly, the reconstruction of the output signal, which is BW corrected, from the residual coefficients. Methods based on principal component analysis (PCA), independent component analysis (ICA) [14], wavelet transform (WT) [15,16,17], and discrete cosine transform (DCT) [18] fall into this category. WT-based methods assume that BW can be captured by the coarse approximation cAj of level j. Therefore, how to choose the proper level, j, emerges as a crucial problem [19]. DCT is used for the estimation of BW by making the higher-order DCT coefficients zeroes [20]. This method has proven to be effective since it can be regarded as a linear-phase low-pass filter. However, the cut-point between BW and the inherent ECG components is determined simply by detecting the peak in the Fourier spectrum.
In this paper, an improved DCT-based method is proposed, which adopts a dual-adaptive scheme to search for the optimal cut-point between BW and inherent ECG components before conducting BW removal. The remainder of the paper is organized as follows. Section 2 briefly introduces the theoretical background of DCT and then proposes the dual-adaptive scheme. Experimental results are illustrated in Section 3. Finally, Section 4 concludes the article.

2. Methods

2.1. Theoretical Backgrounds of Discrete Cosine Transform

DCT was first defined and implemented by using fast Fourier transform (FFT) in 1974 [21]. It was often used in feature extraction [22] to generate better classification. Equations (1) and (2) reveal DCT and inverse discrete cosine transform (IDCT), respectively.
y k = w k n = 1 N x n cos π 2 n 1 k 1 / 2 N ,   k = 1 , 2 , , N
x n = k = 1 N w k y k cos π 2 n 1 k 1 / 2 N ,   n = 1 , 2 , , N
w h e r e   w k = 1 / N   i f   k = 1 2 / N   i f   2 k n
N is the length of both time-domain data x and DCT-domain data y. Given the sampling frequency F s , the frequency difference between two adjacent DCT coefficients is F s / 2 N Hz. Equation (4) describes the correlation between the frequency and the DCT-index.
k = ( N × f ) / ( F s / 2 )
where f is the corresponding frequency of DCT-index k.
The properties of DCT are exploited to suppress electromyogram interference on ECGs [23]. A DCT algorithm can also be useful to extract the morphological characteristics from ECG signals and generate the coefficients in the preprocessing stage [24].

2.2. The Proposed Dual-Adaptive Scheme

It has been repeatedly emphasized that the determination of the cut-point between BW and inherent ECG components is of great importance in order to fully eliminate BW and preserve the original clinical information. To illustrate this, a 20 s ECG (Figure 1a) from the PTB Diagnostic Database [25] was considered. There were 30 heartbeat occurrences in the 20 s ECG signal. We then calculated the cardiac fundamental frequency (CFF), which is the counterpart of heart rate and indicates the frequency of heartbeat occurrence in units of time. The accurate calculation of CFF is important because it is recommended to have a cutoff frequency that does not exceed CFF when filtering BW in the ECG signal [26]. In Figure 1a, CFF is 1.5 Hz approximately. Unfortunately, no visible peak exists (Figure 1b) around 1.5 Hz in the Fourier spectrum because it is obscured by severe BW.
To overcome this drawback, we developed a novel scheme, called a dual-adaptive scheme (DAS), which can remove BW adaptively with the optimal cut-point not only adjusted to CFF, but also adjusted to the degree of BW existence. The proposed DAS contains three major steps as shown in Figure 2.
In the first step, CFF is calculated using a 20 s long portion of the ECG that is to be processed. In the second step, the optimal cut-point before CFF is investigated by analyzing the lower order DCT-coefficients. Finally, BW is reconstructed by applying IDCT to those DCT coefficients before the optimal cut-point, and the BW-free ECG is retrieved by subtracting BW from the original ECG. The detailed procedure is described in the sections below.

2.2.1. Calculating the Cardiac Fundamental Frequency (CFF)

Common methods to calculate CFF are based on R-wave detection. However, the R-wave detection itself is an awful task in the presence of various artifacts. Moreover, the CFF calculation according to the R-wave occurrence is improper in the case of abnormal ECG records, which is illustrated in Section 3. In this paper, we present a simple and effective method to calculate CFF through DCT domain analysis. It is well known that, for periodic waves, there must be a distinct peak that corresponds to the fundamental frequency in the spectrum domain. ECG signals can roughly be regarded as periodic waves, but their periodic properties are usually destroyed by artifacts. Nevertheless, the periodicity of ECG is well reflected by its QRS-complexes. Based on these ideas, CFF can be calculated by the following three substeps.
  • Extract the QRS-complexes x Q R S n from the ECG signal x n by a DCT-based band-pass filter whose passband is [5~40] Hz.
  • Waveform x Q R S n in Figure 1c is taken from QRS-complexes to strengthen the periodicity and the DCT coefficients y Q R S n (in Figure 1d) of x Q R S n are calculated afterward.
  • Detect the peak’s index I C F F related to CFF in y Q R S n . Detecting I C F F is based on a threshold decision as shown in Figure 1d. The maximum value V m of y Q R S n in the range of 0.2 Hz to 2.5 Hz is detected at first. The index I m of V m may be related to CFF but also could be related to the higher harmonics of CFF. In this study, a threshold value of 0.65 was chosen empirically to determine I C F F which is the first point whose value exceeds θ V m .

2.2.2. Searching for the Optimal Cut-Point before CFF

According to Equation (2), ECG signals can be decomposed into a combination of cosine waves. An example of the decomposition of the low-frequency part of the ECG, whose frequency is below CFF, is shown in Figure 3. In Figure 3b, each cosine waveform is generated from one DCT coefficient, as shown in the following formula.
x k ( n ) = w ( k ) y ( k ) cos ( π ( 2 n 1 ) ( k 1 ) / 2 N )
where   x k n is the cosine waveform generated from the k t h DCT coefficient y k .
These cosine waves could have overlapped with each other, but certain amounts of offset were added to separate them exactly for a good presentation. Two phenomena are illustrated in Figure 3b. Firstly, the cosine waves tended to have higher frequencies while the indexes of the DCT coefficient were increasing. Secondly, the waves near both the BW area and the CFF area had higher magnitudes, so the optimal cut-point to distinguish BW and the ECG could be regarded as a certain value in the area where the cosine waves bunched up together. The summation of those cosine waves below the cut-point yielded a trend signal (the red curve in Figure 3a), which was the ideal estimation of BW.
The goal of determining the optimal cut-point was transformed to search for the area where cosine waves were the flattest as shown in Figure 3b. Assume that there were a total number of I C F F waves whose frequencies were below CFF, where I C F F was calculated according to CFF by Equation (4).
These waves were uniformly divided into G groups, therefore each group contained the same number M of waves, where M is the quotient of I C F F divided by G.
g m i n = arg m i n g k = g 1 M + 1 g M 2 A k   1 g G
where A k is the amplitude of the k t h cosine waveform, and g denotes the group’s index. As illustrated in Figure 3c, the way to determine where the optimal cut-point is located is to calculate the gmin group which has the minimum value of amplitudes by Equation (6).
With Equations (3) and (5), we can deduce that:
A k = w k y k = y k / N   k = 1 y k 2 / N   2 k N
Therefore, we obtain the equivalent of (6) without considering the constant:
g m i n = arg m i n g k = g 1 M + 1 g M y k   1 g G
where y k is the absolute value of the k t h DCT coefficient.
Based on the above analysis, we searched the optimal cut-point directly according to Equation (8) by analyzing DCT coefficients whose frequencies were below CFF:
The lower order DCT coefficients of the ECG signal x n were calculated according to the following equation.
y k = w k n = 1 N x n cos π 2 n 1 k 1 / 2 N ,   k = 1 , 2 , , I C F F
These coefficients were used to construct an amplitude vector A = a 1 , a 2 , a 3 , ,   a G , each element of A was a summation of the same number M of y k . The minimum element in vector A was investigated to obtain its index, gmin. The index I O C P of the optimal cut-point in y(k) was calculated from the following equation.
I O C P = M g m i n

2.2.3. Reconstructing BW and Subtracting It from the Original ECG

The following equation was used to reconstruct BW from those DCT coefficients before the optimal cut-point.
b w n = k = 1 I O C P w k y k cos ( π 2 n 1 k 1 / 2 N ,   n = 1 , 2 , ,   N
then, a BW-free ECG could be restored by subtracting the estimated BW from the original ECG. It is shown as follows.
x r n = x n b w n
where b w n is the estimated BW, x r n is the ‘retrieved’ ECG after BW removal, and x n is the original ECG contaminated with BW.

3. Results

Experiments were carried out on both real ECG records and simulated ECGs to evaluate the proposed method qualitatively and quantitatively. The real ECG records were from the MIT-BIH Arrhythmia Database and the PTB Diagnostic Database. The former database is a collection of 48 half-hour two-lead ECGs whose sampling rate is 360 Hz. The latter is a database of 549 high-resolution 15-lead ECGs digitized at 1000 samples per second. The simulated “clean” ECG was constructed by repetitively concatenating an identical ECG cycle chosen from real ECG records. The simulated BW was generated by calculating low-frequency sinusoid waves and a low-frequency random component [13].
For comparison, the performances of the following five algorithms were investigated:
  • A DCT-based filter [27] with the proposed dual-adaptive scheme to search for the optimal cut-point between BW and the true ECG. θ = 0.65 ,   G = 10 .
  • A DCT-based filter [27] which let the cutoff frequency be 0.9 × CFF.
  • A linear phase, sharp cut-off FIR filter [28] with a cutoff frequency of 0.9 × CFF.
  • A WT-based algorithm using Daub-4 mother wavelet [29].
  • A weighted median filter [30] with parameters ( a = 500 ,   α = 1 ,   β = 40 ) .
The algorithms are referred to using Roman numerals I–V.

3.1. Performance Comparison on Real ECG Record

In the first experiment, to illustrate the effectiveness of the proposed method on the CFF calculation, which is a vital step for the whole process, the first 20 s portion of each record in the MIT-BIH database was taken into consideration. For the sake of comparison, the “gold standard” CFF should have been calculated according to its definition, “CFF is the frequency of heartbeat occurrence in unit of time”. However, the number of heartbeat occurrences is difficult to count in a 20 s portion due to the incompleteness of the heartbeat at each end. The “gold standard” CFF is approximately calculated using Equation (13) according to R-wave occurrence, which is an analog of heartbeat occurrence and much easier to count.
C F F R w a v e = N R w a v e / L
where N R w a v e is the number of R-waves that occur in L seconds-long ECG, and C F F R w a v e is the approximation of the “gold standard” CFF according to R-wave occurrence. The correctness of the CFF calculation with the proposed method was measured using the following Equation (14).
C F F d c t C F F R w a v e < 0.1 C F F R w a v e
where C F F d c t is the CFF calculated using the proposed method through DCT domain analysis. C F F d c t was considered to be correct if it tallied with this rule. It was reasonable to adopt this rule because the C F F R w a v e itself may have a maximum difference of 0.1   C F F R w a v e with the real “gold standard” CFF.
Experimental results demonstrated that, only 4 (record number: 203, 208, 221, and 232) out of a total of 48 records in this database failed to meet the rule, which means that the proposed CFF-calculation method achieved an accuracy of 91.67%. The four failed records were abnormal cases that contained ectopic heartbeats as shown in Figure 4. As a supplement, the same experiment was conducted with the PTB database and it obtained a higher accuracy of 95.80%.
In the second experiment, BW removal was carried out on abnormal records using C F F R w a v e and C F F d c t , respectively, in order to compare the impact of the two CFF-calculation schemes on the final result. After the CFF ( C F F R w a v e or C F F d c t ) had been calculated, a DCT-based filter with a 0.9×CFF cutoff frequency was applied.
The comparison results of the two CFFs is demonstrated in Figure 4. BW removal using the two CFFs was conducted on the abnormal record 208 which included premature ventricular contractions (PVCs). It was observed that the reconstructed ECG using C F F R w a v e had some distortions especially on the ST segment (which is framed in ellipses in Figure 4b). The ST-segment elevation was one of the abnormal presentations in patients with PVCs [31,32], if we compared the ECGs with the first few heart heats in detail shown in Figure 5, the original ECG in Figure 5a presented the ST-segment elevation, while the ECG in Figure 5b may have suppressed the important information. In contrast, the proposed method based on DCT-domain analysis achieves a promising result with keeping the ST-segment elevations shown in Figure 5c. The reason behind this is that the periodicity of ECG signals may be destroyed by abnormalities such as PVCs and arrhythmias. As Figure 4b and Figure 5b show, there was a prominent unusual frequency component, caused by PVCs that appeared before C F F R w a v e . Note that it still belongs to inherent ECG components and eliminating it would consequently cause distortions. However, it cannot be discovered using the CFF-calculation method based on R-wave occurrence and thence is prone to be eliminated. Fortunately, the proposed method is able to detect this unusual component and ‘mistake’ it for CFF so as to keep it from being removed.
In the third experiment, a comparison between the proposed method and the WT-based filter was made. Consecutive numbers eight, nine and ten were respectively chosen as the decomposition level of the WT-based method. The reconstructed BWs using different decomposition levels were plotted overlapping with the original ECG in Figure 6a–c. As Figure 6a shows, when the decomposition level was eight, the reconstructed BW was overfitting which indicated that the decomposition level needed to be higher. However, when the decomposition level was 10, which is too high, as shown in Figure 6c, the reconstructed BW was insufficient to fit the tendency of the ECG, especially in the surrounding areas highlighted by cycles. We obtained the optimal decomposition level nine between eight and ten and the best estimated BW is shown in Figure 6b. Then, the retrieved ECG using the WT-based method at the optimal decomposition level was compared to the one using the proposed method. As Figure 6e shows, although the optimal decomposition level was chosen, the retrieved ECG using the WT-based method still had some distortions in those areas surrounded by ellipses. In contrast, as shown in Figure 6f, it is apparent that BW was fully removed using the proposed method without introducing visible distortions.
In the fourth experiment, an ECG signal contaminated with severe BW was deliberately chosen in order to validate the proposed method when handling severe BW. Figure 7 shows the original ECG and the retrieved ECGs using five algorithms in a list fashion. By scrutinizing the middle part of each retrieved ECG, it is clear that BW was not fully removed using algorithms III and V. As for algorithms II and IV, although they fully removed BW, they also introduced visible distortions. The proposed method (algorithm I) achieved the best performance that fully removed BW while preserving the original clinical information.

3.2. Experiments with Simulated ECG and BW

In order to evaluate the performances of different methods quantitatively, tests should be conducted on simulated ECG and BW whose properties are already known. We constructed the ‘clean’ ECGs by concatenating identical beats chosen from the PTB database. In total, 24 clean ECG signals were simulated. The length of each signal was 30 s, and the sampling rate was 1000 Hz. The beats of these signals had different morphological features and heart rates. They were chosen from 12 different leads of different records. The simulated BW, given in Equation (15), consisted of four components. The sinusoid components were used to mimic the typical BW caused by respiration [13]. Low-frequency random noise was also added in order to simulate the random noise from the outside environment. This random component was generated by filtering white noise (700 μV amplitude) through a fifth-order Butterworth low-pass filter with 0.3 Hz cutoff frequency. With the last random components generated 30 times, 30 different BWs were obtained.
b w n = A sin 2 π 0.2 n / F s + B cos 2 π 0.35 n / F s + C cos 2 π 0.45 n / F s + η n
where η n is the low-frequency random component and A, B, and C are amplitudes of sinusoid components.
In the last experiment, the five algorithms were applied to the simulated ECGs. One example of simulated clean ECG and BW is shown in Figure 8. The contaminated ECG was obtained by summing the simulated clean ECG and BW. The reconstructed BWs using five algorithms were also plotted in this figure. As Figure 8 shows, it was difficult to distinguish the BWs reconstructed using algorithms I and II from the simulated one, which indicates that the DCT-based filters were capable of estimating the added BW ideally. Compared with the simulated BW, the one reconstructed using algorithm III introduces significant unwanted oscillations which were higher frequency components that came from ‘clean’ ECGs. Algorithms IV and V achieved moderate performances but nonetheless introduced visible distortions. Additionally, BW constructed using algorithm V was not smooth although the simulated BW was a smooth one, which is due to the nonlinear characteristic of this filtering technique.
For quantitative evolution, the most widely used measures are mean square error (MSE), and signal-to-noise ratio (SNR). However, using these measures, it is difficult to access the quality of filtered signals which have different mean values due to the DC offset. All algorithms in this paper generated zero-mean ‘retrieved’ ECG signals except algorithm V. In order to compare these algorithms fairly, we calculated the correlation coefficient (CC) between simulated ‘clean’ ECGs and ‘retrieved’ ECGs to evaluate their performances. It can be seen from Equation (16) that CC was independent of the signals’ mean values because there was an inner process to subtract the mean value of each signal from itself. The higher CC indicates the better properties of algorithms in preserving the original clinical information.
ρ c r = n = 1 N x c n u c x r n u r / σ c σ r
where x c n is the ‘clean’ ECG by simulation, x r n is ‘retrieved’ ECG by BW removal algorithms, ρ c r is CC between these two signals. u c and u r are the expected values of x c n and x r n , respectively, and σ c , σ r are the standard deviations of x c n and x r n , respectively.
As mentioned before, a total of 24 ‘clean’ ECGs and 30 BWs were generated. After applying five algorithms to these simulated ECGs, the CC of each ‘retrieved’ ECG with respect to the simulated ‘clean’ ECG was calculated. But the retrieved ECGs using algorithms III and V have significant distortions at each end of the signal due to the moving window used in these techniques. Therefore, for all retrieved signals, the first and last 500 samples were not considered when calculating CC in order to make a fair comparison. The comparison results are plotted in Figure 9, in which each point represents an average of 30 experiments. Two major aspects were revealed in Figure 9. First, it is striking that the performances of algorithms I and II were stable and far superior to those of the other three algorithms. Second, the CC curves of algorithms III, IV, and V fluctuated a lot from point to point, which indicates that their performances were sensitive to the morphological features and heart rate of the simulated ECG.

4. Discussion

Benefitting from the robust CFF-calculation subprocedure, both algorithms I and II achieved the most promising results. Nonetheless, algorithm I slightly outperformed algorithm II as shown in Figure 7 and Figure 9. One major factor that contributed to the robustness of the proposed CFF-calculation method lies in the QRS-complexes extraction by the DCT-based band-pass filter. Compared with other CFF-calculation methods based on R-wave detection, the proposed method illustrated its greater simplicity and effectiveness in the presence of various artifacts and abnormalities as shown in Figure 4 and Figure 5.
The DCT-based filtering technique [27] was also compared to the linear phase, sharp cut-off FIR filter [28]. Both types of filters had a linear-phase response which was their common favorable characteristic for BW removal. As shown in and Figure 8, some inherent ECG components are filtered by the FIR filter, while the DCT-based filter seldom affects the inherent components although their cutoff frequencies are set to be the same. This is because the DCT-based filter possesses unique ideal frequency characteristics. For instance, the transition band of the DCT-based filter can be as narrow as F s / 2 N Hz theoretically, which is the frequency interval between two adjacent DCT coefficients. Moreover, the DCT-based filter has negative infinite magnitude response on the stop band and infinite passband gain theoretically [27]. However, these characteristics cannot be realized by the FIR filter because it needs an infinite impulse response. Therefore, the DCT-based filter outperforms the FIR filter in terms of eliminating the unwanted frequency components precisely with the inherent ECG components intact.
As shown in Figure 6, Figure 7, Figure 8 and Figure 9, the proposed method is superior to the WT-based method. This is because WT-based methods are based on the assumption that BW can be captured by the coarse approximation cAj of level j. The frequency span of cAj is 0 ~ F s / 2 2 j , which indicates that the estimated BW has the cutoff frequency of F s / 2 2 j Hz. For example in Figure 6, if j is chosen to be 8, 9, and 10, then the cutoff frequency of the estimated BW is 1.9531, 0.9766, and 0.4883 Hz, respectively. Evidently, it is not possible to adjust the cutoff frequency precisely in accordance with CFF and the degree of BW exists in ECG. In contrast, the proposed method seeks for the optimal cut-point by constructing an amplitude vector whose frequency span is CFF. Given that the amplitude vector contains G elements, then the frequency resolution of the proposed method can be accurate to CFF/G. Therefore, the proposed method can remove BW more precisely than the WT-based method.
Finally, as shown in Figure 7, Figure 8 and Figure 9, the proposed method outperformed the weighted median filter. The weighted median filter was unable to trace the turning corner caused by severe BW (shown in Figure 7) due to the improper length of its sliding window. However, the weighted median filter achieved better results than the WT-based method and FIR filter when processing ECGs with moderate BW in the simulated experiments. Nonetheless, the proposed method is far superior to the weighted median filter as illustrated by the CC curves in Figure 9.
In conclusion, the proposed algorithm achieved the best performance in terms of fully removing BW and preserving the original clinical information when compared with three previous methods. The reasons for its outstanding performance are threefold. Firstly, it contained a robust subprocedure to calculate CFF properly, which ensured that the cup-point between BW and the ECG did not exceed CFF. Secondly, it included a novel scheme to seek the optimal cut-point by means of constructing an amplitude vector using lower-order DCT coefficients. Thirdly, it adopted a new filtering technique based on DCT, which had the ideal frequency properties. Based on the above reasons, the unnecessary frequency components can be precisely eliminated while keeping the inherent ECG components intact.

Author Contributions

Conceptualization and methodology, C.-C.L.; validation, P.-H.T.; formal analysis and investigation, P.-C.C.; writing—original draft preparation, C.-C.L.; writing—review and editing, C.-C.L. and P.-H.T.; supervision and project administration, P.-C.C. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by National Science and Technology Council of Taiwan grant number 111-2221-E-141-008-.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data presented in this study are openly available in PhysioNet at https://doi.org/10.13026/C28C71 and MIT-BIH Arrhythmia Database at https://doi.org/10.13026/c2f305.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Shin, S.; Kang, M.; Zhang, G.; Jung, J.; Kim, Y.T. Lightweight Ensemble Network for Detecting Heart Disease Using ECG Signals. Appl. Sci. 2022, 12, 3291. [Google Scholar] [CrossRef]
  2. Liu, R.; Shu, M.; Chen, C. ECG Signal Denoising and Reconstruction Based on Basis Pursuit. Appl. Sci. 2021, 11, 1591. [Google Scholar] [CrossRef]
  3. Hagiwara, Y.; Fujita, H.; Oh, S.L.; Tan, J.H.; San Tan, R.; Ciaccio, E.J.; Acharya, U.R. Computer-aided diagnosis of atrial fibrillation based on ECG Signals: A review. Inf. Sci. 2018, 467, 99–114. [Google Scholar] [CrossRef]
  4. Vogel, B.; Claessen, B.E.; Arnold, S.V.; Chan, D.; Cohen, D.J.; Giannitsis, E.; Gibson, C.M.; Goto, S.; Katus, H.A.; Kerneis, M.; et al. ST-segment elevation myocardial infarction. Nat. Rev. Dis. Primers 2019, 5, 39. [Google Scholar] [CrossRef] [PubMed]
  5. Chang, P.C.; Lin, J.J.; Hsieh, J.C.; Weng, J. Myocardial infarction classification with multi-lead ECG using hidden Markov models and Gaussian mixture models. Appl. Soft Comput. 2012, 12, 3165–3175. [Google Scholar] [CrossRef]
  6. Almeida, B.C.S.; Carmo, A.A.L.D.; Barbosa, M.P.T.; Silva, J.L.P.D.; Ribeiro, A.L.P. Association between microvolt T-wave alternans and malignant ventricular arrhythmias in Chagas disease. Arq. Bras. De Cardiol. 2018, 110, 412–417. [Google Scholar] [CrossRef] [PubMed]
  7. Kim, J.H.; Lee, K.H.; Lee, J.W.; Kim, K.S. Semi-real-time removal of baseline fluctuations in electrocardiogram (ECG) signals by an infinite impulse response low-pass filter (IIR-LPF). J. Supercomput. 2018, 74, 6785–6793. [Google Scholar] [CrossRef]
  8. Boudet, S.; de l’Aulnoit, A.H.; Demailly, R.; Peyrodie, L.; Beuscart, R.; de l’Aulnoit, D.H. Fetal heart rate baseline computation with a weighted median filter. Comput. Biol. Med. 2019, 114, 103468. [Google Scholar] [CrossRef]
  9. Khosravy, M.; Gupta, N.; Patel, N.; Senjyu, T.; Duque, C.A. Particle swarm optimization of morphological filters for electrocardiogram baseline drift estimation. In Applied Nature-Inspired Computing: Algorithms and Case Studies; Springer: Singapore, 2020; pp. 1–21. [Google Scholar]
  10. Sun, P.; Wu, Q.H.; Weindling, A.M.; Finkelstein, A.; Ibrahim, K. An improved morphological approach to background normalization of ECG signals. IEEE Trans. Biomed. Eng. 2003, 50, 117–121. [Google Scholar] [CrossRef]
  11. Romero, F.P.; Romaguera, L.V.; Vázquez-Seisdedos, C.R.; Costa, M.G.F.; Neto, J.E. Baseline wander removal methods for ECG signals: A comparative study. arXiv 2018, arXiv:1807.11359. [Google Scholar]
  12. Ojo, J.A.; Adetoyi, T.B.; Adeniran, S.A. Removal of Baseline Wander Noise from Electrocardiogram (ECG) using Fifth-order Spline Interpolation. J. Appl. Comput. Sci. Math. 2016, 10, 9–14. [Google Scholar] [CrossRef]
  13. Shusterman, V.; Shah, S.I.; Beigel, A.; Anderson, K.P. Enhancing the precision of ECG baseline correction: Selective filtering and removal of residual error. Comput. Biomed. Res. 2000, 33, 144–160. [Google Scholar] [CrossRef] [PubMed]
  14. Barhatte, A.S.; Ghongade, R.; Tekale, S.V. Noise analysis of ECG signal using fast ICA. In Proceedings of the 2016 Conference on Advances in Signal Processing (CASP), Pune, India, 9–11 June 2016; pp. 118–122. [Google Scholar]
  15. Kora, P.; Kumari, C.U.; Swaraja, K.; Meenakshi, K. Atrial fibrillation detection using discrete wavelet transform. In Proceedings of the 2019 IEEE International Conference on Electrical, Computer and Communication Technologies (ICECCT), Coimbatore, India, 20–22 February 2019; pp. 1–3. [Google Scholar]
  16. Lin, C.C.; Chang, H.Y.; Huang, Y.H.; Yeh, C.Y. A novel wavelet-based algorithm for detection of QRS complex. Appl. Sci. 2019, 9, 2142. [Google Scholar] [CrossRef]
  17. B’charri, E.; Latif, R.; Elmansouri, K.; Abenaou, A.; Jenkal, W. ECG signal performance de-noising assessment based on threshold tuning of dual-tree wavelet transform. Biomed. Eng. Online 2017, 16, 26. [Google Scholar] [CrossRef] [PubMed]
  18. Jung, W.H.; Lee, S.G. ECG identification based on non-fiducial feature extraction using window removal method. Appl. Sci. 2017, 7, 1205. [Google Scholar] [CrossRef]
  19. Haider, S.I.; Alhussein, M. Detection and classification of baseline-wander noise in ECG signals using discrete wavelet transform and decision tree classifier. Elektron. Ir Elektrotech. 2019, 25, 47–57. [Google Scholar] [CrossRef]
  20. Belkacem, S.; Messaoudi, N.; Dibi, Z. Artifact removal from electrocardiogram signal: A comparative study. In Proceedings of the 2018 International Conference on Signal, Image, Vision and their Applications (SIVA), Guelma, Algeria, 26–27 November 2018; pp. 1–5. [Google Scholar]
  21. Ahmed, N.; Natarajan, T.; Rao, K.R. Discrete cosine transform. IEEE Trans. Comput. 1974, 100, 90–93. [Google Scholar] [CrossRef]
  22. Sufyanu, Z.; Mohamad, F.S.; Yusuf, A.A.; Mamat, M.B. Enhanced Face Recognition Using Discrete Cosine Transform. Eng. Lett. 2016, 24, 52–61. [Google Scholar]
  23. Nikolaev, N.; Gotchev, A.; Egiazarian, K.; Nikolov, Z. Suppression of electromyogram interference on the electrocardiogram by transform domain denoising. Med. Biol. Eng. Comput. 2001, 39, 649–655. [Google Scholar] [CrossRef]
  24. Raj, S.; Ray, K.C. ECG signal analysis using DCT-based DOST and PSO optimized SVM. IEEE Trans. Instrum. Meas. 2017, 66, 470–478. [Google Scholar] [CrossRef]
  25. Bousseljot, R.; Kreiseler, D.; Schnabel, A. Nutzung der EKG-Signaldatenbank CARDIODAT der PTB über das Internet. Biomed. Tech. 1995, 40, 317–318. [Google Scholar] [CrossRef]
  26. Van Alste, J.A.; Schilder, T.S. Removal of base-line wander and power-line interference from the ECG by an efficient FIR filter with a reduced number of taps. IEEE Trans. Biomed. Eng. 1985, BME-32, 1052–1060. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  27. Shin, H.S.; Lee, C.; Lee, M. Ideal filtering approach on DCT domain for biomedical signals: Index blocked DCT filtering method (IB-DCTFM). J. Med. Syst. 2010, 34, 741–753. [Google Scholar] [CrossRef] [PubMed]
  28. Roy, S.; Chandra, A. A new method for denoising ECG signal using sharp cut-off FIR filter. In Proceedings of the 2018 International Symposium on Devices, Circuits and Systems, Howrah, India, 29–31 March 2018. [Google Scholar]
  29. Goel, S.; Tomar, P.; Kaur, G. An optimal wavelet approach for ECG noise cancellation. Int. J. Bio-Sci. Bio-Technol. 2016, 8, 39–52. [Google Scholar] [CrossRef]
  30. Subbiah, S.; Patro, R.; Rajendran, K. Reduction of noises in ECG signal by various filters. Int. J. Eng. Res. Technol. 2014, 3, 656–660. [Google Scholar]
  31. Kichloo, A.; Haji, A.Q.; Kanjwal, K. Cardiac memory presenting as ST elevations following premature ventricular complex ablation. HeartRhythm Case Rep. 2021, 7, 52–55. [Google Scholar] [CrossRef]
  32. Farzam, K.; Richards, J.R. Premature Ventricular Contraction. In StatPearls [Internet]; StatPearls Publishing: Treasure Island, FL, USA, 2022. Available online: https://www.ncbi.nlm.nih.gov/books/NBK532991/ (accessed on 18 May 2022).
Figure 1. Comparison of CFF detection by the previous method [20] and the proposed method (PTB record s0130lrem, lead I, 00:00−00:20). (a) Raw ECG signal contaminated with severe BW. (b) Amplitude of raw ECG in the Fourier domain. (c) Waveform of the extracted QRS complexes x Q R S n . (d) Amplitude of x Q R S n   in the DCT domain, the red ‘triangle’ and red ‘square’ denote the position of CFF and its higher harmonic, respectively.
Figure 1. Comparison of CFF detection by the previous method [20] and the proposed method (PTB record s0130lrem, lead I, 00:00−00:20). (a) Raw ECG signal contaminated with severe BW. (b) Amplitude of raw ECG in the Fourier domain. (c) Waveform of the extracted QRS complexes x Q R S n . (d) Amplitude of x Q R S n   in the DCT domain, the red ‘triangle’ and red ‘square’ denote the position of CFF and its higher harmonic, respectively.
Applsci 12 08839 g001
Figure 2. Block diagram of the Dual-Adaptive Scheme.
Figure 2. Block diagram of the Dual-Adaptive Scheme.
Applsci 12 08839 g002
Figure 3. Determine the optimal cut-point between BW and ECG (lead AVF of PTB record patient004/s0020arem). (a) Raw ECG signal (blue curve) and BW (red curve). (b) Cosine waves, each of which is generated from one DCT coefficient. (c) Amplitude of low-frequency components, each component is generated from two DCT coefficients.
Figure 3. Determine the optimal cut-point between BW and ECG (lead AVF of PTB record patient004/s0020arem). (a) Raw ECG signal (blue curve) and BW (red curve). (b) Cosine waves, each of which is generated from one DCT coefficient. (c) Amplitude of low-frequency components, each component is generated from two DCT coefficients.
Applsci 12 08839 g003
Figure 4. The impact of two CFFs when processing abnormal records (MIT-BIH record 208, lead I, 00:00–00:10). (a) Original ECG. (b,c) BW corrected ECG by using C F F R w a v e and C F F d c t , respectively. (d) Locations of the C F F R w a v e and C F F d c t in the DCT domain. (e,f) Estimated BWs by using C F F R w a v e and C F F d c t , respectively. The surrounding ellipses indicate the ST segment of the ectopic beats.
Figure 4. The impact of two CFFs when processing abnormal records (MIT-BIH record 208, lead I, 00:00–00:10). (a) Original ECG. (b,c) BW corrected ECG by using C F F R w a v e and C F F d c t , respectively. (d) Locations of the C F F R w a v e and C F F d c t in the DCT domain. (e,f) Estimated BWs by using C F F R w a v e and C F F d c t , respectively. The surrounding ellipses indicate the ST segment of the ectopic beats.
Applsci 12 08839 g004
Figure 5. The comparison in detail from Figure 4, with the first few heartbeats included. (a) Original ECG in Figure 4a. (b) BW corrected ECG using the C F F R w a v e in Figure 4b. (c) BW corrected ECG using the C F F d c t in Figure 4c.
Figure 5. The comparison in detail from Figure 4, with the first few heartbeats included. (a) Original ECG in Figure 4a. (b) BW corrected ECG using the C F F R w a v e in Figure 4b. (c) BW corrected ECG using the C F F d c t in Figure 4c.
Applsci 12 08839 g005
Figure 6. Comparison between the proposed method and the WT-based method (PTB record s0098lrem, lead V2, 00:10–00:19). (ac) The blue waveform is BW contaminated ECG, while the red curve is the estimated BW using algorithm IV when wavelet decomposition levels are 8, 9, and 10. (d) The black solid curve is the estimated BW using algorithm IV when wavelet decomposition level is nine (1000 μV offset is added), and the magenta dotted curve is the estimated BW using algorithm I. (e,f) BW corrected ECG using algorithm IV (decomposition level = 9) and algorithm I, respectively.
Figure 6. Comparison between the proposed method and the WT-based method (PTB record s0098lrem, lead V2, 00:10–00:19). (ac) The blue waveform is BW contaminated ECG, while the red curve is the estimated BW using algorithm IV when wavelet decomposition levels are 8, 9, and 10. (d) The black solid curve is the estimated BW using algorithm IV when wavelet decomposition level is nine (1000 μV offset is added), and the magenta dotted curve is the estimated BW using algorithm I. (e,f) BW corrected ECG using algorithm IV (decomposition level = 9) and algorithm I, respectively.
Applsci 12 08839 g006
Figure 7. Comparisons of the five algorithms for suppressing severe BW (PTB record, s0130lrem, lead AVF, 00:10–00:21).
Figure 7. Comparisons of the five algorithms for suppressing severe BW (PTB record, s0130lrem, lead AVF, 00:10–00:21).
Applsci 12 08839 g007
Figure 8. Comparison of estimated BW using five algorithms using the simulated ECG and BW.
Figure 8. Comparison of estimated BW using five algorithms using the simulated ECG and BW.
Applsci 12 08839 g008
Figure 9. Comparison of five algorithms using the correlation coefficient between ‘retrieved’ and ‘clean’ ECG.
Figure 9. Comparison of five algorithms using the correlation coefficient between ‘retrieved’ and ‘clean’ ECG.
Applsci 12 08839 g009
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Lin, C.-C.; Chang, P.-C.; Tsai, P.-H. A Dual-Adaptive Approach Based on Discrete Cosine Transform for Removal of ECG Baseline Wander. Appl. Sci. 2022, 12, 8839. https://doi.org/10.3390/app12178839

AMA Style

Lin C-C, Chang P-C, Tsai P-H. A Dual-Adaptive Approach Based on Discrete Cosine Transform for Removal of ECG Baseline Wander. Applied Sciences. 2022; 12(17):8839. https://doi.org/10.3390/app12178839

Chicago/Turabian Style

Lin, Chun-Chieh, Pei-Chann Chang, and Ping-Heng Tsai. 2022. "A Dual-Adaptive Approach Based on Discrete Cosine Transform for Removal of ECG Baseline Wander" Applied Sciences 12, no. 17: 8839. https://doi.org/10.3390/app12178839

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop