1 Introduction

Recently, the average life span has lengthened by elevation of the GNP, improvement of quality of life, advancement of medical science, etc. As a consequence, many advanced countries can be said to have aging societies. As a result of this, concern has been expressed about the quality of medical care that elderly residents receive in residential and nursing homes [20]. It is so-called home healthcare. The most important requirements of home healthcare are that they be nonintrusive and noninvasive. Therefore, devices for telemedicine, more exactly, remote monitoring of physiological or daily living signs should be carried out with these considerations as follows: (1) no pain or burden must be imposed to acquire information on health condition and (2) no discomfort must be added either [19]. Another consideration should be given for extraction of qualified data as not only are the sites where measuring occurs individual residences, but also operators who control the system are just ordinary persons. This study is proposing a method which measures ECG with two electrodes made of conductive textile located on the bed in order to minimize the restriction on subjects and extract ECG-derived respiration (EDR) from the obtained ECG. In order to measure the ECG conventionally, electrodes with adhesive electrolyte, absorption electrodes for the chest, tong-shaped electrodes for the limbs and cables are used. Such electrodes and cables might make subjects feel stressed. In contrast, the conductive textile can realize long-term ECG measurement without any inconvenience while sleeping. When using the conductive textile as an electrode, there are three major types of electrode arrangements generally recommended; the first type consists of a pillow electrode, lower limb electrode on the bed and isolated electrode beneath the seat as Ishijima published [6]. The second type has three electrodes for the head, body, and leg to measure ECG and respiration as Ishijima also used [7, 8, 16]. The last one forms the basic setting with three input ECGs by arranging electrodes on both the shoulders and legs in bed [22]. These arrangements are designed to minimize noise by operating the driving circuit on the right leg or grounding the amplifier and the human body. Nevertheless, there are some disadvantages in that three electrodes are required, and especially subjects have to remove their clothing from the upper body in the second and third cases. In this study, we designed the system using only two electrodes located either in the part of pillow and leg (similar to lead III) or right and left shoulder (similar to lead I).

It is widely accepted that among several methods to measure EDR, the method proposed by Moody and others, which uses the arctangent of the ratio of two leads, is better than other methods based on single-lead type [13, 14] and previous work has established that the variation of the angle of mean electrical axis reflects the respiratory patterns [17] and the angle of the mean electrical axis of the heart correlates well with respiration [2]. However, in recent research, it has been established that single-lead estimates are more robust than methods based on the mean electrical axis [15]. Actually the effects of respiration on ECG modulation depend on subjects’ personal respiration characteristics (whether thoracic respiration or abdominal respiration), location of heart and magnitude of rotation. Moreover, since lead I and lead III are not orthogonal [4], the results can be lower than the ECG-derived respiration through single-lead in some cases. Besides, since the position of the electrodes on the thorax determines the polarity and amplitude of the ECG events (that is, the position of the leads determine the plane in which the depolarization wave signal is measured) [1], this study using relatively wider and bigger electrodes could use the single-lead approach. Thus, we have to select one value among lead I, lead III, and arctangent product as the ECG-derived respiration on the basis of similarity to actual respiration signal. This process should be conducted through automatic algorithm without the researcher’s using their naked eye.

The study proposes a new ECG based respiration extraction algorithm consisting of ECG measurement with leads I and III from the conductive textiles, removal of baseline wandering using median filter, R-wave detection, variation modification using moving average and optimal lead selection. In order to resolve the problem with optimal lead selection for extracting EDR, it was considered that respiration signal frequency does not vary unexpectedly and the EDR, which is obtained from an inappropriate lead, shows abnormally large frequency variation. Based on this, it is reasonable to use the estimation of respiration frequency as a method to select a proper lead. There are many methods for the selection based on frequency variation such as time-frequency analysis. Nevertheless, considering that respiration signal is a narrow band signal, the study invented an optimal lead selection with relatively small computation load by estimating instantaneous frequency by Hilbert transform and calculating the variation within target section. In order to evaluate the proposed selection method, the EDR signals and the variation of thoracic circumference, which was measured simultaneously with ECG, were compared. According to the results on 15 subjects, respiration signals with high correlation coefficient over 0.8 could be automatically derived.

The proposed algorithm in the study also has some advantages, in that, it shows rapid operation time because it uses a fixed data window when calculating the area for ECG-derived respiration extraction, and it produces signals more similar to real respiration signals by applying moving average to the calculated area. Additionally, EDR can be treated to have the same sampling frequency by using cubic-spline interpolation, and consequently, the conventional respiration signal can be used instead, for several experiments such as respiration analysis based on time series and signal processing based also on frequency.

A primary goal in this study is to improve and validate performance of one segment of home-healthcare monitoring which is applied on bed.

2 Methodology

ECG signals (lead I and lead III) were acquired simultaneously on bed using conductive textiles; including adhesive electrode ECG (lead I) for comparison. Thoracic belt respiration signal using RSP100C (Biopac) were acquired simultaneously with ECG signal. As mentioned earlier, EDR signals extracted from two single-lead ECG (not adhesive electrode ECG), respectively, have a significant characteristic which is subject-dependent signal, that is, quality of final EDR signals are determined by which ECG leads are used. Therefore, we have to decide which lead signal of ECG reflects well on respiratory effort. For this, Hilbert transform was applied to extract instantaneous frequency. The reason for taking instantaneous frequency is that it is a very good discriminator between well-derived EDR and not. Fifteen healthy male subjects (not people with diseases such as sleep apnea or periodic breathing) whose mean age was 25.6 ± 1.9 (mean ± SD) years, mean height was 175.3 ± 4.7 cm, mean weight was 69.2 ± 4.4 kg and BMI was 23.9 ± 2.8 kg/m2, volunteered for the study. All subjects gave informed consents to participate and an internal Ethics Committee approved the experimental protocol. LabVIEW 8.2 was used for deriving EDR and extracting instantaneous frequency. Respiration signal obtained from a thoracic belt was also measured to verify EDR. All the signals were collected at the sampling rate of 360 Hz using an amplifier circuit made by us.

2.1 ECG measurement

The test subject was placed on bed in the supine position. The acquisition procedures performed simultaneously on bed as in Fig. 1. Figure 1 shows the type I configuration of conductive textiles in bed, the other case that the solid line conductive textiles (75 cm × 41 cm) are located in right- and left-hand sides of the body so that lead I analogous signal is produced. The type III represents one case of using the dotted line conductive textile as a pillow (103 cm × 50 cm) and a sheet (149 cm × 41 cm) located in lower body so that this type produces lead III analogous ECG signal. Ag coated textile can be more conductive depending on moisture in the skin and it is not necessary to replace it frequently. Moreover, subjects were satisfied with the feeling of this textile during the experiment. Besides, it can be used for a long time (over 1 year) with gentle cleaning.

Fig. 1
figure 1

ECG measurement set-up in accordance with conductive textile arrangement. Configuration of measuring lead III-analogy ECG signals using the dotted line conductive textiles and configuration of measuring lead I-analogy ECG signals using the solid line conductive textiles

We acquired the ECG signal from subjects on bed during 6 h at night; in this study, all subjects were wearing cloths (knee pants and running shirt) and in the supine position. A subject’s body position can be fixed supine, prone or on the side for simultaneous measurement. If a subject’s signal had a large motion artifact, we could not use that data, but if it had a small motion artifact, we could use data through interpolation method. Fig. 2a shows ECG signal measured with conventional adhesive electrodes (Ag/AgCl) in lead I, b shows ECG signal measured with conductive textile in type I and c shows ECG signal measured with conductive textile in type III in turn. There was no significant difference between conductive textiles and general electrodes. The contact between the skin and electrode can make noise like that in Fig. 2b. However, almost signals are appropriatly following signal processing. On average, 84.2% of the ECG data was usable throughout the experiment.

Fig. 2
figure 2

Two electrodes ECG amplifier outputs through each type of the conductive textiles and the adhesive electrodes simultaneously. a The ECG signal from adhesive electrodes in type I. b The ECG signal from conductive textile in type I. c The ECG signal from conductive textile in type III

2.2 Extraction algorithm of ECG-derived respiration signal

The whole algorithm consists of pre-processing for removal of power-line noise using notch filter and baseline wandering using median filter, R-wave detection from ECG and area calculation, moving average operation of each area within QRS complex and cubic-spline interpolation, polynomial regression processing for removal of DC or low-frequency of the derived respiration signals, and optimal lead selection between type I and type III by calculating the instantaneous frequency and its variation using Hilbert transform. Figure 3 shows the overall flow-chart of the proposed algorithm.

Fig. 3
figure 3

Procedure of extracting ECG-derived respiration

2.2.1 Signal preprocessing

When extracting respiration signal from ECG, 50/60 Hz power-line noise and baseline wandering in ECG might be the most serious noise sources in EDR signal extraction. For eliminating power-line noise, we used a 50/60 Hz notch filter. For baseline wander, a high-pass filter, which is widely used for removal of baseline fluctuation, distorts the original signals, and can change the ECG modulation by respiration. Unfortunately, removal of baseline using wavelet and cubic-spline method is slower than median filtering method. Thus, the median filter was used to remove the baseline wandering since its signal distortion is low and its operation speed is fast. The details in the median filtering are as follows: first of all, a certain length of window is applied to input signal and all samples in the window are sorted in order of ascending or descending. Then, the median of the sorted series is determined. In this study, we had the use of 200 points window, which was determined through empirical trial and error. Figure 4 demonstrates that power-line noise and baseline wandering can be effectively removed by notch and median filtering. Figure 4a shows ECG signals including power-line noise and baseline wandering, b shows baseline wandering waveform by median filtering, and c shows ECG signals without power-line noise and baseline wandering by notch filtration and a–b, respectively.

Fig. 4
figure 4

Preprocess of the ECG signal from conductive textile. a Original ECG signal. b Extracted baseline waveform. c Preprocessed ECG signal eliminated both power-line noise and baseline wander

2.2.2 R-wave detection and area calculation

Following the removal of 50/60 Hz and baseline noise, R-waves from both of the type are detected. In this study, wavelet-based peak detection is used for finding R-waves [9, 10, 5]. Although a wide variety of wavelets are available, not all are appropriate for wavelet-based peak detection. We used the biorthogonal 3.1 wavelet to perform R-wave detection. Also, multiresolution analysis is useful for identifying peaks and valleys of noisy signals, and this method makes wavelet-based peak detection more accurate and robust than threshold or curve fitting based peak detection methods.

ECG-derived respiration is based on the notion that the ECG is modulated by respiration frequency. The modulation is attributable to the change in heart location by respiration and the relative displacement of skin electrode based on the heart. There are three conventional signal processing methods to extract respiration signals from ECG in association with window; first, independent lead method with fixed QRS data window; second, independent lead method with variable QRS data window; third, dependant lead method with variable data window [3]. As for the first one, the window width against lead I and the width against lead III are independent. In this case, following the detection of R-and Q-waves at each lead, the fixed length of the window is determined by doubling the average length of the Q- and R-waves. As for the second one, Q-, R- and S- waves are detected by each lead on every heartbeat, and the length of Q- and S-waves are used as the width of window. As for the last one, Q-, R- and S-waves are detected by one of the two leads, and the length of the Q- and the S-waves are equally applied to the other lead as variable window width. The work of Mazzanti et al. [19] proposed automatic optimal lead(s) selection from multiple lead systems and calculates the EDR-waves from QRS-area variations. The study tried to integrate the strengths of the three methods, so fixed QRS data window and dependant lead method were selected. This method uses the same data windows for every lead and defines the width of window as the double of the average length of Q- and R-waves, which is independent on the length of each QRS complex section. It is advantageous in that the operation speed is enhanced and near uniform EDR signals can be extracted at every ECG lead. Actually, when we use the fixed window, we can process using average through before and behind beat if ectopic beat do not occur often during signal acquisition. However, if irregular premature ventricular contraction (PVC) occur often, measurement of EDR is impossible.

Once the R-wave detection on each lead is complete, partial area is calculated using the fixed data window with the detected R-waves. The slopes of the QRS complexes are of relatively high frequency, so almost no noise is included there. Generally, high sensitivity is recommended for the data window at stable state [21]. Thus, the length of data window was fixed at 60 ms through empirical trial and error, and the area closed by the width of the data window centered the R-waves. The error by a fixed window can occur but it seldom does during experimentation. After calculating area within the specified windowed data, those results were rearranged to corresponding R-waves which we call R-wave time-index. This study did not consider using the T-wave amplitude for deriving the EDR. Figure 5 shows the details of the process mentioned above.

Fig. 5
figure 5

An example of procedure for calculating consecutive windowed ECG segment centered at R-wave. a Original ECG including power-line noise. b Preprocessed ECG with 60 ms-fixed window centered at R-wave. c Arrangement of calculated area of specified interval to R-wave time-index

2.2.3 Moving average and interpolation

When extracting respiration signals, we should consider the precision of respiration frequency and the clear discrimination between inspiration and expiration from reconstructing EDR. A two-point moving average was used to make such inspiration and expiration re-location by means of adjusting the maximum and the minimum values. The calculated area was found using two-point moving average following the corresponding R-waves were arranged on the time axis. The frequency band of respiration was generally <1 Hz showing 0.05–0.7 Hz, which indicates that the signal was extremely slow. One cycle of respiration (one inspiration and expiration) was derived from ECG corresponding to 4–10 heartbeats. Therefore, linear interpolation is good in signal reconstruction speed, but cannot build the waveform similar to real respiration signal. In order to reconstruct such data, cubic-spline interpolation was used in the study. If a data set of original signals, y = f(x i ), = 0, 1,..., n − 1, the output of the cubic spline interpolation at a given interval [x i , x i+1], y can be written as follows:

$$ y = Ay_i + By_i + 1 + Cy''_i + Dy''_i + 1 $$
(1)

Coefficients A, B, C, and D are as follows:

$$ \begin{gathered} A = \frac{{x_{i + 1} - x}} {{x_{i + 1} - x_i }},\quad B = 1 - A, \hfill \\ C = \frac{1} {6}\left( {A^3 - A} \right)\left( {x_{i + 1} - x_i } \right)^2 , \hfill \\ D = \frac{1} {6}\left( {B^3 - B} \right)\left( {x_{i + 1} - x_i } \right)^2 \hfill \\ \end{gathered} $$
(2)

where x should be x ≤ ≤ x n − 1. Signals were interpolated at 360 Hz, which are the same as sampling frequency of ECG signal and the thoracic belt respiration signal. Figure 6a–e shows ECG signal with peaks detected, R-wave time index arrangement of calculated interval area, linear interpolation of moving averaged signal, cubic-spline interpolation of moving averaged signal and respiration signal using thoracic belt, respectively. Actually, a phase difference exists between the EDR and the thoracic respiration. However, its difference was small, so this study did not consider it in correlation calculations.

Fig. 6
figure 6

Representation of each processed signal for extracting EDR signal and comparison with respiration signal using thoracic belt. a ECG signal with peaks detected. b R-wave time-index arrangement of calculated interval area. c Linear interpolation of moving averaged signal. d Cubic-spline interpolation of moving averaged signal. e Respiration signal using thoracic belt

2.3 Optimal lead selection by Hilbert transform

In terms of EDR extraction, it is obvious that taking arctangent for the ratio of two leads (types in this study) is not always the best method. Therefore this study had to choose one as an extraction method among type I, type III, and arctangent of type I and type III. For this, it was considered that respiration signal frequency does not vary unexpectedly and the EDR, which is obtained from an inappropriate lead shows abnormally large frequency variation in contrast with an appropriated one. In this study, we propose an optimal lead selection method, which estimates instantaneous frequency by Hilbert transform, considering respiration signal is of narrow band, and calculates the variation within a specific section.

This process consists of two parts, preprocessing and instantaneous frequency estimation by Hilbert transform. The preprocessing should be conducted since R-waves, used to calculate the area, reflect respiration and body movement, and it is necessary to remove very low-frequencies including DC for precise results by Hilbert transform. In the study, The DC and drift factors were removed by using fifth polynomial regression.

Hilbert transform was used to get the instantaneous frequency of the derived respiration signal. Instantaneous frequency is based on recent time-frequency analysis with the analytic signal [18]. Most signals in nature consist of real number parts only. Thus, Hilbert transform is taken to construct imaginary part as a quadrature phase necessary for analytic signal. The analytic signal of y i (n), a complex signal, is expressed as follow:

$$ \tilde y_i (n) = y_i (n) + j\hat{y}_i (n),\quad {\rm for}\,\,n = 1, \ldots ,N $$
(3)

where \( \hat{y}_i (n) \) is the Hilbert transform of y i (n). Using a sign function, the discrete Fourier transform of the analytic signal is given by

$$ \tilde Y(l) = \left[ {1 + {\rm sign}(l)} \right]Y(l). $$
(4)

Therefore, \( \tilde y_i (n) \) is obtained by the inverse discrete Fourier transform, setting the Fourier transform as follow;

$$ \begin{array}{*{20}l} {\tilde Y(l) = 0} & {{\text{for }}\,l < 0} \\ {\tilde Y(l) = 2Y(l)} & {{\text{for }}\,l \ge 0} \\ \end{array}. $$
(5)

The instantaneous frequency is defined as

$$ f_i (n) = \frac{1} {{2\pi }}\theta '_i (n),\quad {\rm for}\,\,n = 1, \ldots ,N $$
(6)

where \( \theta '_i (n) \) is the first order difference of the instantaneous phase and \( \theta _i (n) \) with respect to the local time index. \( \theta _i (n) \) is therefore given by

$$ \theta _i (n) = \tan ^{ - 1} \left( {\frac{{\hat{y}_i (n)}} {{y_i (n)}}} \right) $$
(7)

The minimum value among the variations, which is standard deviation (SD), within the instantaneous frequency section determined by taking Hilbert transform with EDR signal, was selected as the optimal EDR respiration. Figure 7 shows EDR signals and variation of the respiration frequency estimated by using Hilbert transform. Figure 7 indicates that the EDR by type III with small variation of instantaneous frequency is optimal. Note that the solid line and dashed line in Fig. 7a, c show EDR signal and thoracic belt signal, respectively. In order to compensate for the differing amplitude of heart rate variability among different subjects, the amplitudes are then normalized [12].

Fig. 7
figure 7

ECG-derived respiration (EDR) signals and variation of the respiration frequency estimated by using Hilbert transform. All of signals are normalized. a EDR (solid line) and thoracic belt (dashed line) from type I. b Instantaneous frequency of EDR shown in a. c EDR (solid line) and thoracic belt (dashed line) from type III. d Instantaneous frequency of EDR shown in c with smaller variation

3 Results

The validity of the algorithm was demonstrated by identifying that the correlation between the derived signal selected by the algorithm and the respiration signal measured by the thoracic belt method was high compared with others.

3.1 Evaluation of ECG-derived respiration

In order to evaluate the similarity between EDR signals and real respiration signals, the correlation coefficient was calculated by comparing the respiration signals measured by thoracic belt method, which is widely used for respiration measurement.

Figure 8 compares the EDR signals extracted by each type (type I and type III) and the thoracic belt respiration signals as real respiration. Figure 8a is a typical example that all EDR signals from type I and type III reflect respiration well, b is the EDR from type I reflecting respiration effort better than EDR type III, and c is the other way around of b.

Fig. 8
figure 8

Typical examples of EDR signal patterns for each case (solid line EDR, dashed line actual respiration). All of signals are normalized. a EDR from both type I and type III reflects respiration effort well. b EDR from type I reflects respiration effort well. c EDR from type III reflects respiration effort well

Table 1 shows respiration rates which were computed from thoracic belt signals (as a reference), EDR type I and EDR type III, and also correlation coefficients between reference respiration signals and each EDR signal with whole data (about 6 h). In most cases, we can see all EDR and real respiration signals are almost identical in terms of respiration rate. This means the intrathoracic impedance variation caused by respiration effort transfers to the skin electrode without loss.

Table 1 Quantitative comparison of signals between thoracic belt method and EDR

In the case of normal ECG as shown in Fig. 8, it was identified that EDR signal and real respiration signal are similar to each other, so that the new method is more sensitive than the conventional one. Moreover, it was also indentified an apnea signal during sleep (subject D) as shown in Fig. 9. However, as for subject K, some of the respiration data was lost because there were many partial missing beats, where QRS complex section and T-waves are not available except P-waves, and consequently, precise respiration signals were not derived.

Fig. 9
figure 9

A case that an apnea occurred during sleep (solid line EDR, dashed line actual respiration). Those of signals are normalized

3.2 Evaluation of optimal type selection algorithm

As shown in Table 1, the difference of respiration rate was not distinctive regardless of which one was used between type I and type III. Accordingly, there are many difficulties in selecting optimal signals on frequency domain. As expected, the frequency analysis based on Hilbert transform made it possible to select EDR signal similar to real respiration which had remained stable with constant rate in most subjects. Fig. 10 shows correlation coefficients between thoracic belt signals and EDR signals and standard deviations of variations of instantaneous frequency for each EDR.

Fig. 10
figure 10

Correlation coefficients between actual (thoracic belt) and both types of EDR signals and standard deviation of variations of instantaneous frequency. a Correlation coefficients between actual and both types of EDR signals. b Standard deviations of variations of instantaneous frequency for each EDR

In most cases, it was found that the instantaneous frequency variation is small if the correlation coefficient, between the respiration signals directly measured and the derived respiration signals, is high. Therefore, the EDR derived by the proposed algorithm was proved to be suitable for respiration signal extraction. If conventional method only (no selecting lead) is used, high-correlative respiration signal could not always be obtained. To put it clearly, lead selection by instantaneous frequency estimation based on Hilbert transform can give more significant signal than conventional method. However, as for subject K mentioned above, it failed to detect a proper lead, which would derive the optimal respiration signals due to the distortion of the derived respiration signals caused by the abnormal ECG.

4 Discussion

The purpose of the study is to improve the existing method for extracting ECG-derived respiration signal and develop a new algorithm which shows excellent performance under varying conditions by which instantaneous frequency estimation based on Hilbert transform automatically selects the appropriate signal among the extracted respiration signals from each type of configuration on conductive textiles. In order to improve the ECG-derived respiration signals, we modified the conventional method with multiple leads. Compared to the previous studies on EDR extraction methods, the EDR extracted by single-lead has been underestimated. To put it in another way, this study can obtain respiration signals with better characteristics by single-lead depending on subject. According to the currently reported study on EDR extraction, the conventional method, which calculates the area of QRS complex and takes arctangent for the ratio between them, provided lead I and III meet at right angles, was still used. However, leads I and III are not actually orthogonal (a VF meeting lead I at right angles) and arctangent product does not always mean the optimal EDR since the location of the heart is different for each subject. Additionally, the respiration modulation is dependent on the respiration pattern of the subject. As for thoracic respiration, the respiration modulation is active in ECG lead I, while the respiration modulation is distinctive in ECG lead III as for abdominal respiration. Thus, we have to choose the optimal derived respiration based on quantitative method. Besides, using a fixed QRS data window, dependent lead method and operating the moving average of the results, clear discrimination between inspiration and expiration could be achieved.

The proposed algorithm was applied to the ECG signals from 15 subjects and then, the respiration signals were measured on bed in home environment. According to the results, EDR signals showed over a correlation of more than 0.8 with actual respiration signals from thoracic belt. Based on this, the algorithm was implemented; in detail, instantaneous frequency estimation based on Hilbert transform automatically selects the appropriate respiration signal among the extracted signals by means of selecting the minimum value among the deviations of instantaneous frequency variation. It was found that the deviation of instantaneous frequency was lowest in EDR signals with high-correlation with real respiration signals, and the validity of this algorithm was identified. The algorithm was tested with 15 subjects and complete respiration signals were obtained from 14 subjects.

Since there is no extra sensor and no hardware required for ECG-derived respiration extraction, it is a useful method for long-term home monitoring of sleep, and further makes it possible to measure respiration signals as well as ECG and heart rate variation using a Holter ECG machine. However, the EDR signals are thoroughly dependant on ECG, so that specific ECG caused by a certain disease can disturb the precise ECG-derived respiration extraction. In the case of a partial dropped beat, for example, the respiration data at the defects was not obtained, and consequently, precise reconstruction of respiration signals failed. The problem can probably be solved by inserting an average template value into the defects and more studies on this should be conducted.

5 Conclusion

In this work we proposed an improved algorithm, which can extract EDR better than the conventional method and automatically select the optimal derived respiration signal in two different types of conductive textile positioning. EDR signals by proposed algorithm showed a high-correlation with actual respiration signals. We considered that this study shall be useful in fields of home healthcare.