The most important ECG marker for the diagnosis of ischemia or infarction is a change in the ST segment. Baseline wander is a typical artifact that corrupts the recorded ECG and can hinder the correct diagnosis of such diseases. For the purpose of finding the best suited filter for the removal of baseline wander, the ground truth about the ST change prior to the corrupting artifact and the subsequent filtering process is needed. In order to create the desired reference, we used a large simulation study that allowed us to represent the ischemic heart at a multiscale level from the cardiac myocyte to the surface ECG. We also created a realistic model of baseline wander to evaluate five filtering techniques commonly used in literature. In the simulation study, we included a total of 5.5 million signals coming from 765 electrophysiological setups. We found that the best performing method was the wavelet-based baseline cancellation. However, for medical applications, the Butterworth high-pass filter is the better choice because it is computationally cheap and almost as accurate. Even though all methods modify the ST segment up to some extent, they were all proved to be better than leaving baseline wander unfiltered.
Notorious changes in the ST segment (elevation or depression) are the most important ECG marker when dealing with acute coronary syndrome caused by ischemia or mycardial infarction [
(a) ECG recording corrupted by baseline wander. The removal of this artifact is necessary when diagnosing a change in the ST segment. Yet, the filtering process can modify the signal as seen in (b). (b) ECG recording with a clear ST depression before (blue) and after (red) high-pass filtering. The ST depression is reduced because of too strong filtering. The signals presented in this figure were retrieved from the Physionet database [
Hence, baseline drift must be removed and, as a matter of fact, it is a standard signal processing step in many devices or postprocessing algorithms [
Even though some interesting approaches to address this question have been reported in literature [
By adding baseline wander to the ECG, we reproduce the signals in a controlled environment that would have been recorded in real life. Since the ground truth is also known, the performance of the filters can be studied. Moreover, the simulation software allows varying the patient geometry, the location, and size of the ischemia in the heart and the electrical properties of the model. This leads to a large number of possible ECG signals and ST changes.
In this study, we address the question of the best suited technique for baseline removal without compromising ST changes. For that purpose, we use a diverse database of simulated ECGs with a state-of-the-art electrophysiological model, add synthetic baseline wander, and compare the performance of five manually tuned filters commonly used in literature. Preliminary results on a smaller study including fewer filters and less signals were presented at the national conference of biomedical engineering in Germany [
The database containing the
A cellular automaton was chosen to perform the ischemia simulations [
The AP in each voxel was obtained from a monodomain simulation carried out using the software acCELLerate and utilizing the Ten Tusscher cell model with a basic cycle length of 60 beats per minute [
From every simulation, a QRS complex, an ST segment, and a T wave were obtained. The QT interval was equal to 400 ms in all simulations. The sampling frequency of the simulated signals was 500 Hz, but upsampling to
Finally, a quasiperiodical extension was carried out to create an ECG with a fixed length of 100 s (51200 samples). In order to make the signal more realistic and recreate heart rate variability (HRV), variable RR intervals were added. RR intervals were modeled with a Gaussian distribution having an expected value of 1 s and a standard deviation of 50 ms. These parameters are in accordance with normal short term HRV values reported in literature [
Demonstration of the three torso models and one example per torso of an ischemic ECG. (a), (b), and (c) torso model and electrode placement of the first, second, and third geometry used in the study. (d) Simulated ECG (Wilson lead V5) with ST depression using the torso model displayed in (a). This ECG is the result of a transmural ischemia with a radius of 20 mm and located in AHA segment 14. (e) Simulated ECG (Einthoven lead I) with ST elevation using the torso model displayed in (b). This ECG is the result of a transmural ischemia with a radius of 25 mm in AHA segment 13. (f) Simulated ECG (Einthoven lead II) with ST depression using the third torso model displayed in (c). This ECG is the result of a transmural ischemia with a radius of 20 mm in AHA segment 5.
We modeled baseline wander as a linear combination of sinusoidal functions in the frequency range from 0 to 0.5 Hz. The amplitude and phase of each of the waveforms were chosen randomly to avoid deterministic coherence and to make each randomly generated signal unique. The upper limit of the frequency band was ten times larger than what is recommended for a high-pass filter for ST segment analysis. This fact in combination with very low SNR levels of up to −10 dB made this artifact a challenging one and allowed for performance ranking among the removal techniques [
Mathematically speaking, the model was defined as follows:
The baseline is then added to the simulated ECG signal:
Again,
(a) Exemplary ECG signal corrupted by an arbitrary realization of the baseline wander model. The baseline wander artifact can be seen indicated by the red dashed line. An SNR of −3 dB was chosen for this example. (b) Frequency spectrum corresponding to the baseline wander artifact presented in (a). (c) Frequency spectrum corresponding to the signal (ECG plus baseline wander) displayed in (a). (d) A different example of an ECG signal corrupted by another realization of the baseline wander model. An SNR of +3 dB was chosen for this example. (e) Frequency spectrum corresponding to the baseline wander artifact presented in (d). (f) Frequency spectrum corresponding to the signal (ECG plus baseline wander) displayed in (d).
Signal processing workflow used in this study. (a) Creation the ECG and baseline wander artifact and the superposition to combine them. (b) The simulated and extended ECG is added to the baseline wander artifact to create the corrupted signal. The five baseline removal techniques are then applied to the corrupted signal to reconstruct the original one. To evaluate filtering performance, four different criteria are applied. At the end, the results are statistically analyzed to determine the best filtering method.
We compared five state-of-the-art filtering techniques used regularly in literature: Butterworth high-pass filter [
The first method has the property of being simple, easy to implement, and applicable in many scenarios. Therefore, a classic Butterworth high-pass filter with a total order of four and a cut-off frequency of 0.5 Hz was chosen. Actually, the transfer function of the filter had an order of 2 but the filtering process was performed in forward and reverse direction creating a zero-phase filtered signal and a resulting order of four [
The second method has the goal of estimating the baseline wander using a concatenation of two moving median filters and subtracting that estimate from the corrupted signal. The moving median is based on the same principle as the moving average, but, instead of the mean, the median within a moving window of a given length is calculated. This filter benefits from the assumption that baseline wander and ECG signal have different amplitude distributions within the moving windows. The filter is nonlinear making its behavior more complex [
The removal technique started with a window length of 400 ms corresponding to the QT interval. Since windows of this short duration can deliver an estimation that is a mixture of true ECG signal and baseline, a second moving median with a window of a longer length was applied after the first estimation. We chose the second window to be 2 s long. By doing so, the complete frequency band of the artifact was included in the baseline estimation.
The idea behind this method was to detect the center of the PQ interval in every beat and to interpolate those points to create an estimate of the baseline wander. This technique assumes that the PQ interval corresponds to the isoline of the ECG so that a nonzero signal in this interval must be due to baseline wander. Cubic splines were then used to connect the PQ center points and reconstruct the artifact. Finally, the estimated baseline wander was subtracted from the corrupted signal to reconstruct the original ECG [
In this method, the signal was decomposed using the discrete wavelet transform (DWT) and the approximation coefficients at the lowest frequency band were set to zero with the aim of fully cancelling baseline wander. The filtered ECG was then reconstructed by synthesizing the modified coefficients. The decomposition level
The wavelet used for this procedure was Daubechies 8 that has a compact support of 16 samples and is characterized by 8 vanishing moments.
The principle behind this method is very similar to the wavelet-based baseline cancellation, but a high-pass filtering is used on the approximation coefficients instead of setting them to zero. This is somewhat comparable to a soft threshold on the approximation coefficients. For the wavelet decomposition, the Vaidyanathan-Hoang wavelet was used in accordance with [
Four performance indexes were chosen to evaluate the filters regarding the quality of reconstruction and the clinical applicability in terms of simplicity of the algorithm. The four evaluation criteria will be explained in detail.
As all filtered signals undergo a transient oscillation at their boundaries, we removed the first and final second (corresponding approximately to one beat) at the beginning and at the end of each signal from the evaluation analysis.
With the aim of quantifying impairment in the morphology of the reconstructed signals, we used the correlation coefficient. It is independent from scaling or offsetting the signals and focuses on the matching form of original and reconstructed waveforms. Mathematically speaking, the correlation coefficient between the original signal
The
The
For the clinical diagnosis of ST changes, thresholds for deviations in the J point of the ECG have been recommended [
In this case, the signal
In a clinical environment, the computation time plays an important role if a fast diagnosis should be delivered by the physician. Faster computation times also correlate with simpler algorithms easier to implement for portable or stationary clinical devices. Thus, the computation time needed to process each signal was the fourth performance index. The computer used to run the calculations has a 2.4 GHz Intel Xeon E5645 processor with 12 cores and 64 GB of RAM running MacOS and Matlab 2016a.
For the statistical analysis, we compared the performance of the five baseline removal techniques applied on the complete data set with respect to the four quality criteria mentioned previously. In addition, we also quantified all performance indexes for the case that no filter was applied. The idea behind this comparison is to find a “clear winner” among the filtering techniques that can be applied in many different scenarios.
We hypothesize that the best baseline removal technique for a given performance index was the one with the best median. This hypothesis was accepted if the statistical distribution of that performance index is significantly higher than all other methods. For statistical significance testing, we used the Wilcoxon signed rank test and a level of significance (
When comparing a candidate for best performing filter to all other filters, a total of five
We present the results of the simulation study in the form of boxplots and a summarizing table. Figures
Summary of the results obtained for the performance evaluation among the filters. The values are given as MED
Filter/indexes | Correlation |
|
KP deviation [mV] | Computation time [s] |
---|---|---|---|---|
No filter |
|
|
|
|
Butterworth |
|
|
|
|
Median |
|
|
|
|
Spline |
|
|
|
|
Wavelet cancellation |
|
|
|
|
Wavelet high-pass |
|
|
|
|
|
||||
|
<10−6 | <10−6 | <10−6 | <10−6 |
Boxplots displaying the results of performance evaluation of the filtering techniques. (a) Correlation coefficient between original and filtered signal, (b)
According to the chosen evaluation scheme, the method that best maintained the original ECG morphology (highest correlation coefficient) was the wavelet-based baseline cancellation with a median and interquartile range (MED
Finally, some particular examples showing how the filtered signals compare to the original ones are shown in Figure
Four particular examples showing how the filtered signals compare to the original ones. (a) Filtering results for a signal that came from the ECG lead I in the first torso model and had an SNR of 0 dB. (b) Filtering results for a signal that came from the ECG lead II in the third torso model and had an SNR of +3 dB. (c) Filtering results for a signal that came from the ECG lead V2 in the second torso model and had an SNR of −10 dB. (d) Filtering results for a signal that came from the ECG lead aVL in the third torso model and had an SNR of −3 dB.
In the simulation study, we saw that the wavelet-based baseline cancellation was the best performing method achieving the highest median and lowest IQR for the correlation coefficient,
A similar performance in terms of correlation coefficient and
The results demonstrated that even though there were small differences among the methods, they were all good performers in terms of correlation coefficient,
We also reaffirmed that baseline wander can indeed strongly affect an ECG. The nonfiltered signal had a median correlation coefficient of 0.779 and an IQR of the KP deviation of 280.2 mV. Thus, removing the baseline wander becomes mandatory to allow any further processing of the ECG. We also found that even though all methods deliver an improvement, the KP deviation after filtering had an IQR of at least 41.9
This study ranks popular baseline wander removal techniques using a reference ECG signal that is free of artifacts but exhibits all the properties of an ischemic ECG. The simulation of realistic ECGs is a challenging task because of the complexity of the underlying electrophysiological behavior reproduced by the multiscale model. This model is governed by a large variety of coupled differential equations that need to be correctly parametrized first [
Even though the total amount of signals used in this study was large, there were only three different geometries and one electrophysiological model (Ten Tusscher) used to simulate ischemia [
A more sophisticated baseline wander model would also be of interest. It is well-known that respiration cannot only lead to a floating baseline but it can also modulate the ECG signal [
The filter parameters used in this work were chosen in a heuristic manner with the intention of having a good performance for the well-known artifact. However, they were not computationally optimized to deliver the best possible results. For example, the order of the Butterworth filter, the length windows of the median filters, or the wavelet used for the decomposition could all be further optimized to achieve even better results. This optimization process could also be included in a future work together with other more less common baseline removal techniques such as the empirical mode decomposition, the blind source separation, or a Gaussian filter adapted to remove the known spectrum of the artifact [
The use of the KP instead of the J point to evaluate the ST change deviations was a strategic decision in order to allow automatized quantification of performance. Allowing a trained physician to annotate the J point and perform the study with the annotations might deliver different results. However, by the large amount of signals simulated, a manual annotation becomes unpractical. In any case, we were consistent using the same definition for all filtering techniques and allowing comparability among them.
Last but not least, we quantified the changes in the ST segment caused by filtering measuring the deviation in KP. Yet, the true clinical impact of the filters on the diagnosis of an ischemia was not studied. We did not count how many ischemia cases would have been missed because of the filtering process. This question is not easily answered because the identification of an ST change can be compromised by other factors besides the filters. Those factors are, for example, a large variety of silent ischemia, the number of electrodes used in the recording, or the placement of the electrodes on the chest of the patient [
In this study, we addressed the question of the best suited technique for baseline removal without compromising ST changes in the ischemic ECG. For this purpose, a large simulation study with 5.508 million signals was carried out. The best performing filter with respect to quality of the reconstruction turned out to be the wavelet-based baseline cancellation. However, for medical applications, the Butterworth high-pass filter is the better choice because it is computationally fast and almost as accurate. In addition, all the methods tested proved to be better than leaving baseline wander unfiltered. It was also shown that none of methods was capable of reconstructing the original ECG without modifying the ST segment, so the user has to be always very careful when diagnosing an ST change. In future, other baseline wander models including nonlinear behavior and higher frequency baseline wander could be used to test the methods in more challenging scenarios.
The authors declare that they have no conflicts of interest.
Gustavo Lenis and Nicolas Pilia contributed equally to this work.
The authors would like to acknowledge the support given by the Deutsche Forschungsgemeinschaft and the Open Access Publishing Fund of Karlsruhe Institute of Technology.