Keywords

1 Introduction

Respiration signal is an important physiological signal, it plays an important role in diagnosis and treatment of many diseases. The traditional respiratory signal-recording methods are unmanageable in certain applications such as stress testing, ambulatory monitoring, and sleep studies due to the use of some cumbersome devices that may interfere with natural breath [1]. Compared with the traditional methods, the EDR (ECG-derived respiration) method extracts the respiratory wave through ECG, and the ECG signal has the advantages of being convenient in collection and having little interference to normal respiration, etc. Thus, the EDR method is very much applicable for home monitoring and ambulatory monitoring. As an advanced human body measurement technology, the EDR method has a wide application prospect in the man–machine–environment system engineering field.

The theories of the EDR method are as follows: (1) The motion of the electrodes relative to the heart during the respiratory cycle. (2) The thoracic impedance variations caused by the volume changes in the lungs. (3) Respiratory sinus arrhythmia (RSA). The heart rate increases in inspiration and decreases in expiration [1].

Due to these factors, many scholars proposed a series of EDR algorithms. The first EDR algorithm based on morphology variation information is proposed by Wang et al. [5]; they used the vectorcardiogram (VCG) to detect the respiratory rate and respiratory depth. Then many EDR algorithms based on the amplitude of the ECG features were proposed, including the methods for restoring the respiratory wave based on R wave peak amplitudes, RS amplitudes, QRS area [3], etc. Some scholars used RSA to get the EDR signal by combining with the methods of S-transform [4], etc. It is commonly believed that the EDR method based on ECG filter is the simplest way to get the respiratory wave through ECG. Yi et al. [6] extracted the ingredients of which the frequency was between 0.2 and 0.4 Hz in ECG by wavelet, and took them as the respiratory wave. The EDR signal obtained by this method had extremely high similarity with the actual respiratory wave through experiments. However, because of the complexity of the ECG, the ingredients of 0.2–0.4 Hz obtained by wavelet may also contain the other ingredients besides the respiratory signals, which causes big errors between the EDR signal and the actual respiratory wave. To overcome the above defect and get the EDR signal which is more similar to the actual respiratory wave, this paper proposed an EDR method based on signal reconstruction of R and S amplitudes and filter.

2 Method

2.1 Database

The MIT-BIH Polysomnographic Database includes 18 continuous records which come from 16 male subjects who suffer from sleep apnea. The records are digitized at 250 Hz with 12-bit resolution and continue between 2 and 7 h. Because the 16 subjects all have the sleep apnea diseases of different degrees, there are abnormal data caused by apnea and respiratory disorder in parts of the ECG and respiratory wave. In these data, the relationship between ECG and the respiratory wave is not clear, and thus, the EDR algorithm is not applicable. Therefore, this article took advantage of the data without apnea or respiratory disorder all of records for algorithm comparison.

2.2 EDR Methods

As mentioned above, the ECG signals were influenced by the respiration, and the influences on the R wave and S wave were the most significant. Thus, this paper chooses the information of the R and S wave amplitudes and the R wave peak position as the basis for signal reconstruction, and then uses the Kaiser low-pass filter for filtering the reconstruction signal to get the EDR signal. The detail of the algorithm is given as follows.

2.2.1 EDR Method Proposed in this Article

  1. (a)

    Data preprocessing

The method of this paper needs to use the information of the R wave peak amplitude, S wave peak amplitude, and the transverse coordinate positions of the R wave peak, and thus, it firstly needs to detect the features of ECG. The algorithm for feature points detection of the paper is the ECG feature points detection algorithm based on wavelet proposed by Yang et al. [7]. The algorithm is outstanding in time consumption, detection precision, etc., and is very much applicable to this paper.

  1. (b)

    Signal reconstruction

The R wave peak amplitude (RA), S wave peak amplitude (SA), and the transverse coordinate of R wave peak (RP) are expressed by the following formula:

$$ {\text{RA}}(i),\quad i = 1 \cdots m $$
(1)
$$ {\text{SA}}(i),\quad i = 1 \cdots m $$
(2)
$$ {\text{RP}}(i),\quad i = 1 \cdots m $$
(3)

Then, interpolation processing is carried out to \( {\text{RA,}}\,{\text{SA}} \) and \( {\text{RP}} \), and \( {\text{RA}}^{{\prime }} ,\,{\text{SA}}^{{\prime }} \) and \( {\text{RP}}^{{\prime }} \) are obtained. The processing method is as follows:

$$ {\text{RA}}^{\prime } (i) = \left\{ {\begin{array}{*{20}l} {{\text{RA}}(\frac{{i + 1}}{2}),} & {{\text{for}}{\kern 1pt} {\text{odd}}{\kern 1pt} \,\, i} \\ {({\text{RA}}(\frac{i}{2}) + {\text{RA}}(\frac{i}{2} + 1))/2,} & {{\text{for}}{\kern 1pt} {\text{even}}{\kern 1pt} \,\, i} \\ \end{array} } \right.,i = 1 \cdots 2m - 1 $$
(4)
$$ {\text{SA}}^{{\prime }} (i) = \left\{ {\begin{array}{*{20}l} {{\text{SA}}\left( {\frac{i + 1}{2}} \right)}, & {\text{for}}\,{\text{odd}}\,i \\ {\left( {{\text{SA}}(\frac{i}{2}} \right) + {\text{SA}}\left( {\frac{i}{2} + 1} \right)/2,} & {\text{for}}\, {\text{even}}\,i \\ \end{array} } \right. \, ,i = 1 \cdots 2m - 1 $$
(5)
$$ RP^{\prime } (i) = \left\{ {\begin{array}{*{20}l} {RP\left( {\frac{i + 1}{2}} \right),} & {{\text{for}}\,{\text{odd}}\,\, i} \\ {round \left( {\frac{RP(i/2) + RP(i/2 + 1)}{2}} \right),} & {{\text{for}}\, \, {\text{even}}\,i} \\ \end{array} } \right.,\;i = 1 \cdots 2m - 1 $$
(6)

To make the respiratory information included in the reconstruction signal to be more significant, the \( {\text{RA}}^{{\prime }} \) and \( {\text{SA}}^{{\prime }} \) sequences are operated as follows. The processed sequences are expressed as \( {\text{RA}}^{\prime \prime} \) and \( {\text{SA}}^{\prime \prime} \).

$$ {\text{RA}}^{{\prime \prime }} (i) = {\text{RA}}^{{\prime }} (i) - \hbox{min} ({\text{RA}}^{{\prime }} (i)) \times 0.95,\quad i = 1 \cdots 2m - 1 $$
(7)
$$ {\text{SA}}^{{\prime \prime }} (i) = {\text{SA}}^{{\prime }} (i) - \hbox{max} ({\text{SA}}^{{\prime }} (i)) \times 0.95,\quad i = 1 \cdots 2m - 1 $$
(8)

Sampling reconstruction is carried out to the \( {\text{RA}}^{\prime \prime} \) and \( {\text{SA}}^{\prime \prime} \) sequences to get the reconstruction sequence, and it is expressed as \( {\text{sig}} \).

$$ {\text{sig}}(i) = \left\{ {\begin{array}{*{20}c} {{\text{RA}}^{{\prime \prime }} (i),} & {{\text{for}}{\kern 1pt} {\text{odd}}{\kern 1pt} \, \, i} \\ {{\text{SA}}^{{\prime \prime }} (i),} & {{\text{for}}{\kern 1pt} {\text{even}}{\kern 1pt} \, \, i} \\ \end{array} } \right.,\quad i = 2m - 1 $$
(9)

The signal sig is interpolated to 250 Hz by spline interpolation. The transverse coordinate of the sig (i) is RP′(i). Finally, we can get the last reconstruction signal which is expressed as S.

For explanation, Fig. 1 shows the reconstruction signal S which is not processed by formulas (7) and (8). The Discussion will introduce the reason why the data processing of formulas (7) and (8) is needed in detail.

Fig. 1
figure 1

Exhibition of ECG and S from the record slp02a (0–10 s). a the ECG and S unprocessed by formulas (7) and (8). b The comparison of S processed by formulas (7) and (8) and S unprocessed by formulas (7) and (8)

  1. (c)

    Filter

At last, the EDR signal can be obtained by applying Kaiser low-pass filter to the reconstructed signal S. Generally, it is believed the respiratory wave frequency is 0.2–0.4 Hz [6], and thus, the cutoff frequency of passband of the Kaiser low-pass filter is set as 0.4 Hz, the stop band starting frequency is 0.6 Hz, and the passband fluctuation and the stop band attenuation are, respectively, set as 0.01 and 0.001. The processing effect is shown as Fig. 2.

Fig. 2
figure 2

ECG, S, EDR, and reference respiration signal from the record slp02a (0–80 s)

As shown in Fig. 2, the EDR signal and the reference respiratory signal are in the anti-phase relationship of which the detailed reason is explained in the paper [8]. This anti-phase relationship does not influence the acquiring of the EDR signal and the assessment of the algorithm effect, and thus, it is not deeply studied. However, it shall mention that not all of the other data in the database have the anti-phase relationship as shown in the figure.

2.2.2 EDR Methods for Comparison

The method of the paper will be compared with the EDR method based on wavelet and the EDR method based on experience mode decomposition (EMD). The former decomposes ECG through the wavelet and extracts the ingredients for which the frequency is between 0.2 and 0.4 Hz [6], which are used as the respiratory wave. The db6 mother wavelet is chosen as wavelet basis function [6].

The EDR method based on EMD does not need to choose the wavelet basis function in advance, and thus, its application is wider than the EDR method based on wavelet. The EDR method based on EMD proposed by Labate et al. [2] firstly decomposes ECG into a set of intrinsic mode functions (IMF) and then visually screens out one IMF or the sum of a plurality of IMFs which are closest to the respiratory wave to be used as the EDR signal.

2.3 Assessment Indexes of Algorithm

The assessment indexes of EDR algorithms used by the paper are the correlation coefficients (C) and the magnitude-squared coherence (MSC). To avoid the possible time delay, we choose the maximum absolute correlation of which the time window is within 10s as the value of correlation coefficient (C). The reason for choosing 10s as the time window is that normal human’s lowest respiratory frequency is about 0.1 Hz [6].

MSC is the index for calculating the coherence of signal in frequency domain and can be calculated by the following formula.

$$ C{\text{xy}}(f) = \frac{{\left| {P{\text{xy}}(f)} \right|^{2} }}{{P{\text{xx}}(f)P{\text{yy}}(f)}} $$
(10)

The \( P{\text{xx}}(f) \) and \( P{\text{yy}}(f) \) are the power spectrum densities of the reference respiratory wave and the EDR signal, and \( P{\text{xy}}(f) \) is the cross-power spectrum density. The spectra are calculated using Welch’s method using a 1024-point fast Fourier transform. The periodic Hamming window is used whose length was chosen to obtain eight sections of input signal. The overlap is 50%.

3 Result

Figure 3 shows the comparison of the results for the same ECG among the method proposed in this article and the other two methods. To be convenient for comparison, the EDR signal’s amplitudes are normalized. As shown in Fig. 3, all of the three methods can obtain the surrogate respiratory wave, but the respiration obtained by the method in this paper is more stable, and the appearance of the wave is more close to the reference respiratory wave.

Fig. 3
figure 3

ECG and reference respiratory signal from the record slp02a along with the three EDR signals. The figure shows the data from 0 to 80 s [from top to bottom: the ECG signal; the reference respiratory signal; EDR signal presented in this article; EDR signal based on wavelet; EDR signal based on EMD, imf15 is selected]

Table 1 shows the quantitative comparison of the three EDR methods for all records in the database. The two-tailed t test is used to test for significant differences. The result proves that the method proposed in this article is better than the other two methods in the correlation coefficient and magnitude-squared coherence, and the difference is significant. At the same time, the EDR method based on wavelet is significantly better than the EDR method based on EMD.

Table 1 Comparison of all records \( (\bar{x} \pm s,n = 18) \)

4 Discussion

The respiratory signal extracted by the method of the paper is significantly better than the other two methods not only in wave shape but also in the quantitative comparison including correlation coefficients and MSC through experiments. The wavelet EDR method has the disadvantage that because of the complexity of the ECG, the 0.2–0.4 Hz component extracted by the wavelet may also contain the other information in the ECG besides the respiration information, and thus, the surrogate respiration obtained by the method may have big errors in many details. The EDR method based on EMD does not need to set the wavelet basis function in advance, and thus, it can be more widely applied. However, limited by the algorithm itself, the IMFs obtained by decomposition does not have specific frequency meaning, and at current, we can only select one IMF or the sum of some IMFs manually to construct the EDR. The method of the paper removes the interference of the other information in ECG by signal reconstruction. The reconstructed signal only contains the information of the respiration and the high-frequency information generated by interpolation which is similar to the modulation wave. Thus, the respiratory wave with excellent performance can be obtained by only using filter. In addition, no manual intervention is required for the method, and the automation is good.

As mentioned above, formulas (7) and (8) shall be used for processing the RA′ and SA′ sequences because of the following reasons: As shown in Fig. 4, in the spectrum of the reconstructed signal S, the power of the respiration is centrally distributed in the part of 0.2–0.5 Hz, and the part of 1–2 Hz is the high-frequency part generated by the interpolation which is similar to the modulation wave. In the spectrum of S after being processed by formulas (7) and (8), the low-frequency part expressing the respiration is not changed, the power of high-frequency part is reduced, and the ratio of the power of the respiration to the total power is increased, which provides convenience for identifying the respiration power spectrum and designing the filter. In addition, the EDR signals obtained before and after the processing of formulas (7) and (8) are not varied significantly, and thus, the processing of this step is practical and reasonable.

Fig. 4
figure 4

Three figures in the first row show the S, the spectrum of S, and EDR unprocessed by formulas (7) and (8). The bottom three are the S, the spectrum of S, and EDR processed by the formulas

5 Conclusion

This article proposes an EDR method based on signal reconstruction and filter, which firstly uses the amplitudes of R and S waves and the position of the R wave peak for signal reconstruction, and then the EDR signal is obtained by the Kaiser low-pass filter. In the comparison with the EDR method based on wavelet and the EDR method based on experience mode decomposition, the algorithm of the paper restores the respiratory wave whose shape is more similar to the actual respiratory wave. And the algorithm proposed in this article outperforms the other two methods in the quantitative comparison. The method of the paper is very much applicable for the home monitoring and ambulatory monitoring with the advantages of simplicity for calculation, convenience in application, and having no use for any additional sensor. As an advanced human body signal measurement technology, the EDR method has a wide application in the man–machine–environment system engineering field.