Next Article in Journal
An Ontology Based Approach for Regulatory Compliance of EU Reg. No 995/2010 in Greece
Previous Article in Journal
Optimal Analysis of 40 Gbps Dispersion Compensated Optical Fiber System
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Proceeding Paper

Removal of ECG Baseline Wander Using a Resting Cycle Template †

by
Eladio Altamira-Colado
*,
Miguel Bravo-Zanoguera
,
Daniel Cuevas-González
,
Marco Reyna-Carranza
and
Roberto López-Avitia
Facultad de Ingeniería, Universidad Autónoma de Baja California, Mexicali 21280, Mexico
*
Author to whom correspondence should be addressed.
Presented at the 8th International Electronic Conference on Sensors and Applications, 1–15 November 2021; Available online: https://ecsa-8.sciforum.net.
Eng. Proc. 2021, 10(1), 45; https://doi.org/10.3390/ecsa-8-11289
Published: 1 November 2021

Abstract

:
The development of electrocardiogram (ECG) wearable devices has increased due to its applications on ambulatory patients. ECG signals provide useful information about the heart behavior, but when daily activities are monitored, motion artifacts are introduced producing saturation of the signal, thus losing the information. The typical resolution used to record ECG signals is of maximum 16-bit, which might not be enough to detect low-amplitude potentials and at the same time avoid saturation due to baseline wander, since this last issue demands a low-gain signal chain. A high-resolution provides a more detailed ECG signal under a low gain input, and if the signal is corrupted by motion artifact noise but is not saturated, it can be filtered to recover the signal of interest. In this work, a 24-bit ADC is used to record the ECG, and a new method, the rest ECG cycle template, is proposed to remove the baseline wander. This new method is compared to high-pass filter and spline interpolation methods in their ability to remove baseline wander. This new method presumes that a user is able to establish a rest ECG during his/her daily activities.

Published: 1 November 2021

1. Introduction

The electrocardiogram (ECG) provides information about a patient heart electrical behavior, and it is frequently measured placing electrodes on the skin surface [1]. The ECG can be measured by wearable sensors, allowing detection to be done during physical activity [2]. At any rate, the raw ECG signal might not be useful when noise affects the information contained. Therefore, denoising an ECG signal is necessary before an appropriate interpretation can be made.
ECG is susceptible to noise from different sources, baseline wander (BW) being one that is commonly induced by the patient’s breathing and movement activity. BW is an undesired low-frequency component that would interfere in the signal interpretation. The removal methods for this type of noise normally include polynomial splining and high-pass frequency filters [3].
The usage of high-pass filters is a widely applied method to remove BW from a signal. However, they might remove useful low-frequency information, as well as depress the P and T waves; therefore, other methods to remove BW are preferred [4]. Other methods look to replicate the BW trend to subtract it from the ECG signal, leaving the signal of interest as useful information. Some methods to replicate the BW trend include spline interpolation, whose accuracy increases as the number of interpolated points increases [5]. Additionally, independent of the BW removal method, using lower resolution ADCs (of typically 16-bit or less) results in saturation of the ECG signal due to large motion artifacts.
With a methodology for a rapid prototyping of an ECG device, motion artifacts inherent in mobile health devices, such as the ones occurring from wearable ECG sensors, were previously studied using high-resolution measure devices [6]. The objective of this present work was to use this same rapid prototyping platform to identify a new method to replicate the BW trend using an ECG rest cycle template and compare it with a high-pass filter and spline interpolation methods, as a consideration of processing a noisy signal acquired by a high-resolution (24 bits) wearable system.
The ECG noisy signal was processed by the three methods: using a resting cycle template, spline interpolation, and second-order Butterworth filter. Statistics and visual observations on the resulting signal were assessed after each method was applied. This new resting cycle template method presents a good performance and presumes that a user is able to establish a rest ECG during his/her daily activities.

2. Materials and Methods

In this section, the signal acquisition and processing methods are described, as well as the human volunteer specifications.

2.1. Rapid Prototyping Platform and Signal Acquisition

The signal used in this work was acquired from a human volunteer on a treadmill using a system built on a previous work [6]: Figure 1 shows the block diagram of the wearable device test platform used to acquire the signal. The AD8232 board used was the cardiac monitor provided by the manufacturer Sparkfun [7]. The C8051F350 microcontroller was used on a development kit provided by the Slicon Labs company. These modules and the HC-05 module serve as a breakout box for rapid prototyping.
Subject specifications: healthy male, height 1.77 m, 23 years old, weight of 61 kg, electrical axis of the heart position: 120 degrees, DII registered lead: IN+ corresponding right arm (RA), IN-corresponding right leg (RL), and corresponding reference left arm (LA) [6].
The signal was acquired during a stationary gait with sudden movement to induce BW. The volunteer started on a rest position on their feet before the beginning of the stationary gait. Arduino serial monitor software was used to acquire the signal on a computer using a 115,200 baud rate, with a 180 Hz sampling rate for the internal C8051F350 ADC, and using the AD8232 with a 100× gain [6]. The recorded signal to be processed is shown in Figure 2.

2.2. Signal Processing

In this section, each signal processing method to remove the BW is described. To compare each method’s effectiveness, the root-mean-square (RMS) value and standard deviation (σ) were compared with the RMS value and σ of the original signal to calculate the attenuation level it provided, assuming the only noise contribution is the variation of the BW. The RMS value and σ were calculated with the MATLAB rms and std functions, respectively.

2.2.1. Method 1. Second-Order High-Pass Butterworth Filter

A second-order high-pass Butterworth filter was designed with the Filter Designer MATLAB application [8]. The cut frequency was set to 1 Hz. Figure 3 shows the filter’s magnitude response.

2.2.2. Method 2. Spline Interpolation

A trend vector was generated by a spline interpolation using samples from the original recorded signal. These sample points are chosen mostly in the segment between the T and P waves where the ECG is in the isoelectric phase, where the ideal value of the baseline signal should be zero. The points were manually selected and are shown in Figure 4.
Using the MATLAB spline function, the trend curve was generated as shown in Figure 5.
The processed signal was obtained by subtracting the trend curve vector from the original signal.

2.2.3. Method 3. Using an ECG Rest Cycle Template

To design this method, it is assumed that, once the BW is removed, every ECG wave shape during the recording was equal in the signal. Therefore, an ECG wave during a resting position when no BW was present was used as a template to build an expected signal (ES).
The selected ECG wave to be used as template was the first ECG wave in the original signal and is shown in Figure 6, since the signal capture started on a rest position. However, it is still a debate regarding what is the best way to construct the template since there are several complete rest cycles before motion artifacts occur, and it is assumed that, during his/her daily activities, the user can establish a resting period at will.
The desired signal was built by placing the template (shown in Figure 6) along a vector in the same positions where every ECG wave in the original signal is present, being centered by the R peak (highest value) of the wave. The R peaks were manually detected now, but, for future implementation, there are several automated algorithms that can achieve the peak detection. Figure 7 shows the result of the expected signal, with template copies moved to the positions of the R peak of the original signal.
By subtracting the expected signal from the original signal, the motion artifact was obtained (Figure 8a). A small amount of high frequency noise appears, but after applying a second-order low-pass Butterworth filter with a 1 Hz cutoff frequency to the motion artifact, a curve that replicates the BW results, as shown in Figure 8b.
The processed clean ECG signal is obtained now by subtracting the curve that replicates the BW (Figure 8b) from the original signal.

3. Results and Discussion

Figure 9 shows the resulting signal of each method, as well as the original signal. Visually, the signal that results from method 3 is that less affected by BW. However, the comparison is made using their RMS value and σ, as stated in Section 2.2. Table 1 shows the numeric results of the comparison.
As observed in Table 1, using an ECG rest cycle (method 3) as a template to remove BW from a noisy ECG signal provides a higher attenuation of the BW than applying a second-order high-pass Butterworth filter, as well as providing a higher attenuation than using a generated trend curve by spline interpolation to remove BW.
A more accurate trend curve can be generated if more points from the original signal are used. However, since the points are limited to sections of isoelectric potential where no ECG waves are present, BW would not be completely removed. Using a second-order Butterworth high-pass filter provides a higher attenuation of BW than using spline interpolation.
There are some limitations of the study. Even though the technique was found to per-form well, the tests were applied on one subject only, so larger studies are necessary to generalize from the results. In addition, it is not yet clear how well this technique would work in arrhythmias, when there are different QRS morphologies in a recording. Perhaps, the possibility to acquire an ECG template on the fly (without BW noise) will be necessary, in order to work with multiple QRS morphologies. Furthermore, since there is no ground truth ECG signal against which to compare the recovered signal, the RMS value and σ metrics are simply approximations.

4. Conclusions

The usage of wearable devices to record an ECG signal from a patient in daily activities can easily corrupt the signal of interest with motion artifacts. However, with adequate post-processing, a smooth and useful ECG signal can be achieved by removing the BW, as the method of ECG rest cycle template presented. This wearable device method required a high-resolution 24-bit ADC and a low gain AD8232 analog input, together with the capability for the patient to set a resting moment. The usage of a QRS peak detector is recommended to automate the build of the expected signal, which is the key to correctly establish the motion artifacts.

Author Contributions

Conceptualization and methodology, investigation, writing—review and editing, supervision, project administration, E.A.-C. and M.B.-Z.; software, writing—original draft preparation, visualization, E.A.-C.; validation, M.B.-Z. and D.C.-G.; and final paper review, M.R.-C. and R.L.-A. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by Consejo Nacional de Ciencia y Tecnología (CONACyT) D.C.-G. Scholar fellowship CVU: 763230 and E.A.-C. Scholar fellowship CVU: 1055121.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Informed consent was obtained from all subjects involved in the study.

Data Availability Statement

The data presented in this study are available in https://drive.google.com/drive/folders/1VhCZNpY5uav9MvPCvoY3QGWAs9O9j0NT?usp=sharing, accessed on 25 October 2020.

Acknowledgments

We thank CONACyT for the scholar fellowship of D.C.-G. and E.A.-C.

Conflicts of Interest

The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.

References

  1. Sörnmo, L.; Laguna, P. Chapter 6—The Electrocardiogram—A Brief Background. In Biomedical Engineering, Bioelectrical Signal Processing in Cardiac and Neurological Applications; Academic Press: Cambridge, MA, USA, 2005; pp. 411–452. [Google Scholar]
  2. Armstrong, S. Wireless connectivity for health and sports monitoring: A review. Br. J. Sports Med. 2007, 41, 285–289. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  3. van Alsté, J.A.; van Eck, W.; Herrmann, O.E. ECG baseline wander reduction using linear phase filters. Comput. Biomed. Res. 1986, 19, 417–427. [Google Scholar] [CrossRef] [Green Version]
  4. Rangaraj, M. Filtering for Removal of Artifacts. In Biomedical Signal Analysis: A Case-Study Approach; IEEE: Manhattan, NY, USA, 2002; pp. 73–176. [Google Scholar] [CrossRef]
  5. Sledzik, J.; Stelengowska, M.; Momot, M. Preserving ST Segment Morphology Using Spline Interpolation for Removal of Wandering Baseline Effect in ECG Signal. In 5th European Conference of the International Federation for Medical and Biological Engineering. IFMBE Proceedings; Jobbágy, Á., Ed.; Springer: Berlin/Heidelberg, Germany, 2011; Volume 37, Available online: https://link.springer.com/chapter/10.1007/978-3-642-23508-5_121 (accessed on 25 October 2020).
  6. Cuevas-González, D.; Bravo-Zanoguera, M.; Altamira-Colado, E.; López-Avitia, R.; García-Vázquez, J.P.; Reyna, M.A. Coping with Motion Artifacts by Analog Front-End ECG Microchips under Variable Digital Resolution and Gain. Eng. Proc. 2020, 2, 12. [Google Scholar] [CrossRef]
  7. SparkFun. Single Lead Heart Rate Monitor AD8232. Available online: https://www.sparkfun.com/products/12650 (accessed on 5 October 2020).
  8. Filter Design (MATLAB). 2018. Available online: https://la.mathworks.com/discovery/filter-design.html (accessed on 25 October 2020).
Figure 1. Block diagram of high-resolution rapid prototyping platform for wearable devices.
Figure 1. Block diagram of high-resolution rapid prototyping platform for wearable devices.
Engproc 10 00045 g001
Figure 2. Original recorded signal.
Figure 2. Original recorded signal.
Engproc 10 00045 g002
Figure 3. Magnitude response of filter.
Figure 3. Magnitude response of filter.
Engproc 10 00045 g003
Figure 4. Selected samples of original signal to build a trend curve.
Figure 4. Selected samples of original signal to build a trend curve.
Engproc 10 00045 g004
Figure 5. Generated trend curve by spline interpolation.
Figure 5. Generated trend curve by spline interpolation.
Engproc 10 00045 g005
Figure 6. ECG rest cycle wave template.
Figure 6. ECG rest cycle wave template.
Engproc 10 00045 g006
Figure 7. Expected signal.
Figure 7. Expected signal.
Engproc 10 00045 g007
Figure 8. (a) Motion artifact after subtraction of the expected signal (template train) to the original signal; (b) baseline wander.
Figure 8. (a) Motion artifact after subtraction of the expected signal (template train) to the original signal; (b) baseline wander.
Engproc 10 00045 g008
Figure 9. Resulting signals comparison with original signal. (a) original signal; (b) Method 1 resulting signal; (c) Method 2 resulting signal; (d) Method 3 resulting signal.
Figure 9. Resulting signals comparison with original signal. (a) original signal; (b) Method 1 resulting signal; (c) Method 2 resulting signal; (d) Method 3 resulting signal.
Engproc 10 00045 g009
Table 1. This table shows the comparison between each method described in this work. The RMS value and standard deviation (σ) of each processed signal are compared with the RMS value and standard deviation (σ) of the original signal. The attenuation that each method provides is shown.
Table 1. This table shows the comparison between each method described in this work. The RMS value and standard deviation (σ) of each processed signal are compared with the RMS value and standard deviation (σ) of the original signal. The attenuation that each method provides is shown.
MethodRMS σRMS Ratioσ RatioRMS Attenuation (dB)σ Attenuation (dB)
Original signal160,230160,2381.001.000.000.00
Method 181,72271,6430.510.45−2.92−3.50
Method 287,15484,6820.540.53−2.64−2.77
Method 359,67058,6290.370.37−4.29−4.37
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Altamira-Colado, E.; Bravo-Zanoguera, M.; Cuevas-González, D.; Reyna-Carranza, M.; López-Avitia, R. Removal of ECG Baseline Wander Using a Resting Cycle Template. Eng. Proc. 2021, 10, 45. https://doi.org/10.3390/ecsa-8-11289

AMA Style

Altamira-Colado E, Bravo-Zanoguera M, Cuevas-González D, Reyna-Carranza M, López-Avitia R. Removal of ECG Baseline Wander Using a Resting Cycle Template. Engineering Proceedings. 2021; 10(1):45. https://doi.org/10.3390/ecsa-8-11289

Chicago/Turabian Style

Altamira-Colado, Eladio, Miguel Bravo-Zanoguera, Daniel Cuevas-González, Marco Reyna-Carranza, and Roberto López-Avitia. 2021. "Removal of ECG Baseline Wander Using a Resting Cycle Template" Engineering Proceedings 10, no. 1: 45. https://doi.org/10.3390/ecsa-8-11289

Article Metrics

Back to TopTop