Skip to content
BY-NC-ND 3.0 license Open Access Published by De Gruyter September 12, 2015

Combining different ECG derived respiration tracking methods to create an optimal reconstruction of the breathing pattern

  • Gustavo Lenis EMAIL logo , Felix Conz and Olaf Dössel


ECG derived respiration (EDR) is a technique applied to estimate the respiration signal using only the electrocardiogram (ECG). Different approaches have been proposed in the past on how respiration could be gained from the ECG. However, in many applications only one of them is used while the others are not considered at all. In this paper, we propose a new algorithm for the optimal linear combination of different EDR methods in order to create a more accurate estimation. Using two well known databases, it was statistically shown that an optimally chosen fixed set of coefficients for the linear combination delivers a better estimation than each of the methods used solely.

1 Introduction

Respiratory signals are required in a large variety of applications not only in medicine. For instance, the diagnosis of sleep disorders and the detection of apnea is carried out measuring respiration during the night. In addition, the performance of professional athletes can be improved by monitoring their respiration during physical activity. Furthermore, stress assessment and management can be evaluated by considering respiration signals. However, measuring and quantifying respiration can become a tedious job. Typically, the measurement is carried out using spirometers or acquiring transthoracic impedance. They have the disadvantage of requiring additional medical equipment and often disturbing the normal respiration of the subject. Therefore, the ECG derived respiration (EDR) appeared as a low cost convenient alternative. For this method only the ECG is needed which is already available in many cases. Respiration has a direct effect on the ECG due to three major coupling mechanisms. First, the electrodes used to record the ECG move with respect to the heart as the thorax inflates and deflates. Therefore, the projection of the mean electrical axis of the heart on the given electrodes changes with ribcage movement. Second, the electrical impedance of the torso changes depending on the volume of air present in the lungs. Air, and consequently the lungs have a significantly different electrical permittivity than the organs in the thorax. Since the lungs are between the heart and the electrodes on the chest, the potential difference measured by them changes depending on respiration. Third, a physiological phenomenon called respiratory sinus arrhythmia (RSA), which is a direct modulation of the heart rate by respiration rate. The modulation is achieved because during the inspiration the heart beats slower while during exhalation the heart rate accelerates. In the past, these three coupling mechanisms have been used to create different methods to extract a respiration signal from the ECG. In general, they have a direct influence on the baseline of the ECG, its amplitude through a modulation process and the instantaneous heart rate. In this work, we implemented a group of commonly used EDR methods and found an optimal linear combination of them in order to build a better reconstruction of the real breathing signal.

2 Methods

2.1 Data used in this study

In order to develop and test our algorithms, two well known data sets from Physionet [2] were used. The first data set is the Fantasia database (Fantasia). It contains a total of 40 recordings from 20 young and 20 elderly subjects in resting state while watching the Disney movie Fantasia. One ECG channel and one respiratory signal are present. The signals were digitized at 250 Hz. The second database is the MIT-BIH Polysomnographic Database (SLP). It contains a total of 18 recordings from 16 subjects that were evaluated for chronic obstructive sleep apnea syndrome. Among other physiologic signals, one ECG channel and one respiratory signal are present. The recordings have a duration between 2 and 7 hours depending on the subject. The signals were digitized at 250 Hz.

2.2 Preprocessing the ECG signal

When preprocessing ECG signals for EDR methods, it is of highest priority to fully suppress baseline wander. The majority of EDR methods try to reflect amplitude fluctuations in the ECG caused by respiration and are thus corrupted by low frequency artifacts. In order to estimate and then subtract the baseline, a concatenation of two median filters was applied. Median filters work analogously to moving average filters but they calculate the median signal value within a sliding window. The width of the sliding windows for the median estimation was chosen to be 200 ms and 600 ms respectively. This approach eliminates baseline wander while retaining P-QRS-T waves. A demonstration of the method is shown in figure 1. High frequency noise and power line interference were filtered using Gaussian kernels.

Figure 1 Baseline wander removal with concatenation of two median filters. Signal prior to filtering (red) and its spectrum compared to filtered signal and its spectrum (blue).
Figure 1

Baseline wander removal with concatenation of two median filters. Signal prior to filtering (red) and its spectrum compared to filtered signal and its spectrum (blue).

2.3 EDR methods used

A large number of algorithms have been developed in the past to estimate respiration from the ECG. An introduction to this topic is given by Bailón [1] and O’Brien [3]. In this work, we implemented a total of 13 methods. As mention in the introduction, they are based on one of the three phenomena that couple respiration and ECG. Out of the 13 methods, 6 of them deal with the amplitude modulation caused on the QRS complex (first principal component (PCA), QRS integral, QR slope, QRS width, R peak and RS amplitude) and 4 of them on the T wave (T integral, T peak, T slope, RT peak). One of the methods uses the statistical properties of the ECG in every beat (kurtosis). Another one extracts the spectral properties of the signal below 0.5 Hz using the discrete wavelet transform (wavelet). Finally, the last method uses time distance between each QRS complex (RR interval). Since the majority of the methods do not deliver a continuous signal but rather one sample point per beat, an interpolation has to be carried out. We chose a low pass filter with a cutoff frequency equal to halve of the mean heart rate of the subject. Using this interpolation method we minimize additional frequency content that was not present in the original respiration signal. The functionality of the R peak method is displayed in figure 2.

Figure 2 Right: ECG signal and R peak amplitudes. Left: EDR based on R peak amplitude
Figure 2

Right: ECG signal and R peak amplitudes. Left: EDR based on R peak amplitude

2.4 Quantifying quality of EDR methods

In order to benchmark the EDR methods implemented in this work and choose the best ones to combine later, the maximal correlation between the measured and the estimated respiration was used. The procedure was carried out on non overlapping windows of the signal with a width of 20 s. A median correlation value was calculated in the end. This way, every method received a score between 0 and 1 for every signal. In the end, we chose the best four methods (PCA, R peak, QRS integral and RS amplitude) and they all turned out to be QRS complex based estimations. In order to include new information from other ECG waves and thus different time points, we also considered the best two T wave methods (T peak and T integral). The performance of each method on the Fantasia data set can be seen in figure 3.

Figure 3 Performance of each EDR method on the Fantasia data set.
Figure 3

Performance of each EDR method on the Fantasia data set.

2.5 Optimal linear combination of EDR methods to improve estimation

An optimal linear combination of the chosen EDR methods can be found (equation 1). For this purpose, a pre-possessing step is needed first. Every EDR method delivers a signal with its own amplitude and phase. In order to compensate amplitude differences between the methods, every EDR signal was normalized to have a unitary variance. Phase shift among EDR signals was corrected using the cross correlation between the PCA method and each of other methods. The time point of maximal cross correlation was subtracted from every EDR signal so that no time shift between the methods was present in the end.


The vector of coefficients aoptT was obtained using an optimization algorithm. The resulting EDR signal should be as similar as possible to the reference respiration measurement. Similarity was quantified in a correlation sense. In order to avoid linearly dependent parameter sets, we also restrained the values of each coefficient to be in the interval [0; 1] and to sum up to 1. Thus, the problem can be formulated as a minimization of a target function (equation 3). The optimization was carried out using the function fmincon implemented in MATLAB®.

(3)subject toi=16ai=1

For each subject in the Fantasia database, an optimal parameter set was calculated. It turned out that every signal had a different optimal coefficient vector. Therefore, the median parameter set among the complete database was fixed and defined as global optimum. In order to test the performance of this globally optimal parameter vector, it was compared to other three estimations. First, every single EDR method prior to optimal linear combination was considered. Second, the best performing EDR method for each subject was taken into account. Third, the locally best linear combination of methods for each subject was considered too. In addition, the optimal parameter vector was tested without modifications on the SLP database. Moreover, the comparison was carried out in the same way as for the Fantasia database.

3 Results

3.1 Optimal linear combination of EDR methods for the Fantasia database

Optimal coefficient vector obtained for the Fantasia can be seen in table 1. Figure 4 shows the results of the performance of the linear combination of EDR methods in the Fantasia database. It can be observed that the median performance of the combined EDR signal was higher than the median of every single EDR method. In addition, even though a fixed set of coefficients was used, the combined signal competes with the best single EDR method and linear combination of methods for every patient. The fixed coefficient vector achieved a median cross correlation coeffi-cient of almost 0.8.

Table 1

Optimal coeflcient vector for linear combination of EDR methods

EDR MethodPCAQRS integralR peakRS amplitudeT integralT peak
Coeff. value0.37410.42530.00000.01640.01620.1679
Figure 4 Performance of linearly combined EDR methods on the Fantasia data set.
Figure 4

Performance of linearly combined EDR methods on the Fantasia data set.

3.2 Performance of the algorithm on the SLP database

Figure 5 shows the results of the performance of linear combination of EDR methods on the SLP database using the fixed parameter vector obtained from the Fantasia database. The results are qualitatively similar to the ones presented in the previous section. However, in this data set the fixed coefficient vector achieved a median cross correlation coefficient of almost 0.9, which was larger than the one obtained for the Fantasia dataset.

Figure 5 Performance of linearly combined EDR methods on the SLP data set.
Figure 5

Performance of linearly combined EDR methods on the SLP data set.

4 Discussion

The magnitude of each coefficient in the parameter vector reflects the performance of each EDR method. Higher values are in accordance with better performance. It was also possible to demonstrate that a fixed set of coefficients can deliver a median performance that is better than each of the single EDR methods. This is in accordance with the theory of optimal linear estimation. Furthermore, the fixed set of parameters performed almost as good as the specially chosen estimations for each subject. Since in the majority of EDR applications no prior knowledge about the quality of each EDR method is available, a fixed vector of coeffi-cients for the linear combination is a promising approach to this problem. The fixed set of parameters has the disadvantage of not adapting from subject to subject. This can be problematic if for one particular subject an EDR method is specially noisy. In that case, it would be convenient to reduce its corresponding coefficient in the linear combination. It was also very interesting to see that a fixed parameter vector that was originally obtained using the Fantasia database could be generalize to the new and up to that point unknown SLP database. This result proves that a fixed set of parameters can be used for general applications with different subjects, recording devices and ECG leads.

5 Limitations and outlook

The proposed algorithm has two significant drawbacks. First, the coefficient vector for the linear combination is fixed. In future, the algorithm could be extended to deliver a coefficient vector that changes in time and adapts its components to local signal quality. Second, the algorithm does not include all EDR methods. It would be interesting to optimally integrate all EDR methods to the existing algorithm and reevaluate its performance. Adding new EDR methods not mentioned here, together with an ECG multilead approach could significantly improve the performance of the algorithm even further.

Author's Statement

  1. Conflict of interest: Authors state no conflict of interest. Material and Methods: Informed consent: Informed consent has been obtained from all individuals included in this study. Ethical approval: The research related to human use has been complied with all the relevant national regulations, institutional policies and in accordance the tenets of the Helsinki Declaration, and has been approved by the authors’ institutional review board or equivalent committee.


[1] Bailón R, Sörnmo L and Laguna P. Estimation of the ECG-derived respiration (EDR) signal from the ECG. In: Advanced methods and tools for ECG data analysis. Nordwood: Artech House 2006: 215–244.Search in Google Scholar

[2] Goldberger AL, Amaral LAN, Glass L, Hausdorff JM, Ivanov PCh, Mark RG, Mietus JE, Moody GB, Peng C-K, Stanley HE. PhysioBank, PhysioToolkit, and PhysioNet: Components of a New Research Resource for Complex Physiologic Signals. Circulation 2000; 79: e215–e220.10.1161/01.CIR.101.23.e215Search in Google Scholar

[3] O’Brien C, Heneghan C. A comparison of algorithms for estimation of a respiratory signal from the surface electrocardiogram. Computers in biology and medicine 2007; 37: 305–31410.1016/j.compbiomed.2006.02.002Search in Google Scholar PubMed

Published Online: 2015-9-12
Published in Print: 2015-9-1

© 2015 by Walter de Gruyter GmbH, Berlin/Boston

This article is distributed under the terms of the Creative Commons Attribution Non-Commercial License, which permits unrestricted non-commercial use, distribution, and reproduction in any medium, provided the original work is properly cited.

Downloaded on 24.2.2024 from
Scroll to top button