Extracting the respiration cycle lengths from ECG signal recorded with bed sheet electrodes

A method for recognizing the respiration cycle lengths from the electrocardiographic (ECG) signal recorded with textile electrodes that are attached to a bed sheet is proposed. The method uses two features extracted from the ECG that are affected by the respiration: respiratory sinus arrhythmia and the amplitude of the R-peaks. The proposed method was tested in one hour long recordings with ten healthy young adults. A relative mean absolute error of 5.6 % was achieved when the algorithm was able to provide a result for approximately 40 % of the time. 90 % of the values were within 0.5 s and 97 % within 1 s from the reference respiration value. In addition to the instantaneous respiration cycle lengths, also the mean values during 1 and 5 minutes epochs are calculated. The effect of the ECG signal source is evaluated by calculating the result also from the simultaneously recorded reference ECG signal. The acquired respiration information can be used in the estimation of sleep quality and the detection of sleep disorders.


Introduction and related work
Respiration is one of the most important physiological signals in sleep studies where the data is collected using polysomnography (PSG). It is used for the detection of breathing-related sleep disorders by following the amplitude of the breathing signal and comparing the breathing signals recorded with respiratory inductance plethysmography and temperature sensors. Respiration rate (RR) or respiration cycle length (RCL) can also be used in sleep staging because the variation of respiration rate is higher when a person is awake or during the rapid eye movement sleep stage and is decreased during deep sleep stages [1]. The respiration related features are even more important in novel unobtrusive systems developed for long term monitoring of sleep, like the one presented in [2]. The reason is that smaller amount of physiological signals are available through unobtrusive monitoring techniques and e.g. electroencephalogram and electrooculogram, which are normally used in sleep staging in PSG recordings cannot be measured unobtrusively.
Many authors have investigated the detection of the RR or RCL using ECG signal. In these studies, the ECG has been recorded using conventional electrodes attached to certain locations on the torso. The most commonly used ECG related features for the RR detection are respiratory sinus arrhythmia (RSA) and the modulation of the R-peak amplitude (RPA). The RSA is a result of the variation in the instantaneous heart beat intervals caused by the respiration related control of the autonomous nervous system, whereas the RPA is caused by the changes in the lead field and the heart orientation due to the breathing movement. [3][4][5][6] We have earlier presented a system for recording night-time ECG unobtrusively using textile electrodes sewn on a bed sheet and used the data for detecting heart rate and heart rate variability parameters [7]. The current work investigates the usability of the recorded ECG in the detection of respiration cycle lengths. While other studies have investigated the detection of RR or RCL using conventional electrodes in fixed locations, the electrode locations do not stay constant when using the bed sheet integrated electrodes but change according to the sleeping posture and the measurement channel used. Also the quality of the ECG signal is not always as good as if using the regular gel electrodes.

ECG measurement system and R-peak detection algorithm
Our ECG measurement system consists of eight electrodes that are made by embroidering using silver coated polyamide yarn and are sewn on a bed sheet in 5 cm distances. The ECG is measured bipolarly between each adjacent electrode pair, which enables also combining the recorded ECG signals thus forming new ECG leads with wider inter-electrode distance. When recognizing the R-peaks and heart rate from the ECG, the ECG lead that produces the best signal is first selected and then used until the quality of the signal decreases too much. A detailed description of the channel selection and the Rpeak recognition procedure is presented in [7] and the effect of combining the ECG channels in [8].

ECG derived respiration signals and RCL detection
We selected two commonly used respiration related features that are present in the ECG signal to determine the RCL: RSA and RPA. We also tested filtering the ECG signal with low, 0.6 Hz cut-off in order to reveal the baseline wandering caused by the breathing. The resulting signal however suffered from frequent interferences and did not provide as good results as the RSA and RPA signals.
The raw RSA and RPA signals contain one sample for each heartbeat. Both signals are first interpolated into constant 0.1 s sample interval using cubic spline interpolation. After this, the signals are filtered with different pass-bands in order to bring out the respiration related variation in the signals. Theoretically, both signals should contain a sinusoidal kind of variation at the frequency of the respiration but they also include interference components. Different pass-bands are used because the RCL usually varies between 2 s and 10 s, corresponding to the frequency range of 0.1-0.5 Hz. Depending on the respective value of the RCL, different pass-band will produce the best filtering result. The selected pass-bands are 0.1-0.22 Hz, 0.1-0.33 Hz, and 0.1-0.5 Hz. Forward-backwardfiltering was used in order to eliminate the phase delay, which in this case could cause a significant distortion in the signals. The order of the Butterworth response filters was set as two. Using the forward-backward filtering then produces the overall filter order of four.
Next, the repetition intervals of each signal are calculated by searching local maxima and minima as well as rising and falling zero crossings and then calculating the repetition intervals of these features. This way, altogether 24 (respiration) interval signals are formed (2 ECG derived signals × 3 filters × 4 features). The interval signals are then linearly interpolated into 1000 ms sample interval. Finally, for each time instant a cluster of six RCL suggestions that are closest to each other is searched for. If the square sum of the distances is less than an empirically set threshold, the center of the cluster is chosen as the RCL for that time instant. If the smallest square distance of any six suggestions is higher than the threshold, no RCL value is chosen. Earlier we used a similar method for detecting the RCLs from the signals that were recorded using force sensors placed under a bed post [8].

Per epoch mean RCL detection
In addition to the instantaneous RCLs, we also tested how the presented method performs when the RCL values are used for calculating the mean RCL for epochs of certain length. The mean RCL is simply calculated by averaging all the RCLs detected during e.g. 1 or 5 minute epochs. If the mean RCL is calculated for all epochs that contain at least one detected instantaneous RCL, good coverage is achieved but the error of the result is probably higher. The error can be decreased by setting the minimum number of RCLs that must have been detected during an epoch before the mean RCL for the epoch is reported. The results were calculated using the overlaps of 50 and 240 seconds for the 60 and 300 second epoch lengths, respectively.

Reference respiration measurement
The reference respiration signal was measured using an NTC thermistor placed inside a breathing mask. The resistance of the thermistor was measured, converted into the temperature, and filtered. The respiration rate was calculated from the band-pass filtered temperature signal by finding the maximum from each separate segment that is above the zero level. These points correspond to the end of the inhale phase. Finally, the signals were visually inspected and false or missing detections were corrected. Short sections from the recordings of four test subjects were found, where the amplitude of the reference breathing signal was significantly decreased or the waveform distorted. These parts were discarded from the analysis because reliable reference was not available.

Test subjects and data collection
We made test measurements with eight male and two female subjects (subjects 6 and 10). The subjects were 23-33-year-old, normal weight and had no history of cardiovascular problems or sleeping related breathing disorders. The measurements were made in laboratory settings using an 80 cm wide spring mattress bed. The subjects were allowed to change their sleeping posture freely. The length of the recordings was approximately one hour and most of the subjects fell asleep during this time. In order to evaluate the effect of the ECG signal source to the performance of the proposed RCL detection algorithm, we also used the reference ECG signal that was recorded at the same time with disposable Ag/AgCl electrodes. The reference electrodes were placed under both clavicles so that they did not disturb the skin contact of the sheet electrodes in any posture. Table 1 shows the results of instantaneous RCL detection for each subject. As seen in table 1, there is a significant variation in the performance of the method between the subjects. The best detection coverage was obtained with the data of subject 5, 83.2 % of the total recording time or 91.9 % of time when the source ECG signal was available. The average detection coverage for all the subjects is approximately 40 % of the whole recording time, which is nearly 50 % of the time the bed sheet ECG signal has been available. The ECG signal of the test subject 7 was so low in amplitude that the RPA signal was practically unusable and even when the R-peak detection algorithm was able to find the R-R-interval signal with 74 % coverage, the RCL detector found results that were reliable enough only 3 % of the time. The data of this subject was therefore excluded from the calculation of the average results. The last two rows in table 1 present the instantaneous RCL detection results calculated using the reference ECG data. The coverage of the detected RCLs is higher when using the reference ECG than with the sheet ECG but this is explained by the fact that the RSA and RPA signals produced by the reference ECG are available almost 100 % of the time whereas the coverage of the sheet ECG based RSA and RPA is 82 % in average. Also the error figures for the reference ECG based RCL are slightly better than for the sheet ECG. The results of the subject 7 were now included because the reference ECG did not suffer from the same problems as the sheet ECG signal.  Figure 1 shows as an example, the histogram of the RCL error for the test subject 5. As seen in figure 1, the error produced by the presented method has a Gaussian distribution with zero mean, which shows that the method does not produce any bias to the result. Figure 2 shows the scatter plot of the sheet ECG based instantaneous RCL values and the thermistor reference values for the same person. The concordance correlation is a measure of the deviation of the variable pairs from the 45degree line drawn through the origin (the grey line in figure 2).    Figure 3 shows the coverage and the mean absolute error (MAE) of the mean RCL values as a function of the minimum required number of the instantaneous RCLs in an epoch. The results in figure  3 are calculated for 1 minute epoch length and using 50 seconds overlap between epochs. 88.4 % of all epochs calculated using the sheet ECG data contained at least one RCL value and the average relative MAE for the mean RCL was 6.6 %. Somewhat better mean RCL coverage is achieved by using the reference ECG signal because the reference signal is always available. The average MAE is slightly smaller for the reference ECG when all possible epochs are considered but when the minimum number of the required RCLs in an epoch is increased, both signals produce similar errors. Orphanidou et al. received 4.8 % average relative MAE for 1 minute mean respiration rate with young subjects when they combined the RSA and RPA signals by selecting as the result the one that has the higher magnitude of the pole in the autoregressive spectrum [3]. They did not calculate the results for all the available data but used a criterion for choosing the parts where a high quality reference signal was available. In this way they used 71 % of the available data. Similar coverage is achieved by the sheet ECG data when setting a 10 % minimum value for the within epoch RCL coverage. The average relative MAE is then approximately the same as in [3]. The reference ECG yields approximately 3.3 % MAE when using the same criterion.

Mean RCL detection results
Cysarz et al. used the concordance correlation coefficient (CCC) to describe the agreement between the respiration rate calculated in 5 minute time windows from a single ECG lead and the reference air flow sensor [4]. The regular Pearson correlation only considers the linear dependency of two variables but concordance correlation also takes into account the difference of the exact values of the tested variables. Cysarz et al. received the night-time CCC values of 0.79 and 0.73 younger group of subjects when using only RSA and RPA signals, respectively. They did not consider the epochs where the valid R-peaks were available less than 75 % of the time. Table 2 shows the CCCs between the 1 and 5 minute mean RCLs and the thermistor based reference RCL. The average CCC of 0.63 was achieved with both sheet and reference ECG when all available epochs were considered. The CCCs are considerably improved (0.82 and 0.86 for the sheet and the reference ECG) when only the epochs that contain at least 25 % of the RCLs are considered. The mean RCL coverages are however then decreased to 64 and 79 %.

Conclusions
A method for detecting instantaneous respiration cycle lengths from an ECG signal recorded with bed sheet integrated textile electrodes or regular ECG electrodes has been presented. Also mean RCLs are calculated for 1 and 5 minute epochs and the results compared with methods found in the literature. The proposed method performs well with both sheet ECG and reference ECG signals at least with the test subjects who were younger than 35 years.
The future work includes the evaluation of the proposed method with people of wider demographics. It has been concluded that the RSA phenomenon attenuates along with aging and that parameter is not as efficient for estimating the RCL with older people [4].