Skip to Content
  • Article
  • Open Access

31 December 2013

The Segmented Dynamic Time Warping Algorithm for Beat-to-Beat Heart Rate Estimation based on Ballistocardiogram Signals

,
,
and
1
Sino-Dutch Biomedical and Information Engineering School, Northeastern University, Shenyang 110819, Liaoning, China
2
College of Information and Technology, Jilin Normal University, Siping 136000, Jilin, China
3
School of Life Science, Jilin Normal University, Siping 136000, Jilin, China
*
Author to whom correspondence should be addressed.

Abstract

In order to improve the accuracy and speed of beat-to-beat heart rate estimation, a Segmented Dynamic Time Warping (SDTW) algorithm based on Ballistocardiogram (BCG) signal was presented. The beat-to-beat heart rate obtained through this algorithm was evaluated using 20 healthy subjects with synchronized lead I ECG as standard. The mean bias between JJ and RR interval was 0.2 ms and the confidence interval of 95% was ±19 ms. It indicates that the obtained beat-to-beat intervals are in better agreement with that of ECG. The mean relative error and matching time for heart rate estimation with the algorithm were 1.37% and 0.77 s, respectively. The results were superior to that of the traditional template matching algorithms. It establishes the foundation for heart disease monitoring based on BCG signal.

1. Introduction

Ballistocardiography (BCG) is a non-invasive technique used to measure the cardiac contraction and ejection force of blood into the aorta, which can be used to estimate cardiac output and contractility change [1]. Compared with Electrocardiogram (ECG), modern BCG measurement systems [2,3,4] does not required attaching sensors to patients’ body during recording. Therefore, the BCG system is more suitable for automatic health monitoring at home [5]. Among the current heart rate estimation algorithms based on BCG signal, power spectral density [6], autocorrelation coefficient [7] and continuous wavelet transform [8] cannot reflect beat-to-beat heart rate variation but only offer statistical estimations of the heart rate, so it is difficult to estimate abnormal heartbeat. Other estimation algorithms relied on fiducial points [9,10] can extract beat-to-beat heart rate, but they are sensitive to peak change so that they lack robustness.
The main peak (J-wave) amplitude of the one-beat cycle BCG varies from beat to beat, but the signal patterns repeats themselves with each heart beat. The pattern is consisted of several peaks instead of a single outstanding peak. Therefore, template matching is more suitable for heart beats recognition [11].
The Cross-correlation Template Matching (CCTM) algorithm [3,12] can be used to estimate the beat-to-beat heart rate. It can not reflect the amplitude difference but can reflect the phase difference between the two signals. Accordingly, when there is a larger amplitude difference in two signals with the similar waveform patterns, it would be wrongly judged. Alternatively, Euclidean Distance Template Matching (EDTM) can also be used to estimate the beat-to-beat heart rate [11]. However, it is sensitive to the waveform fluctuation and also leads to a wrong judgment easily. In order to solve these problems, we presented a Segmented Dynamic Time Warping (SDTW) algorithm for estimating beat-to-beat heart rate quickly and accurately. It will establish the foundation for heart rate variability detection based on BCG signal.

2. Data Preparation

2.1. Data Acquisition System

When someone stands on an electronic weighing scale, the strain gages will detect both the weight and the force of the heart beat [13]. Upon this principle, we have designed the BCG signal acquisition system based on a modified electronic weighing scale. The block diagram of the system is shown in Fig. 1. In this system, the TM7708 module integrates programmable amplifier, digital filtering and A/D conversion coefficient. It can effectively reduce the difficulty of the hardware circuit design and debugging, and improve the integration of the system. We chose the band pass filter with the cut-off frequency of 0.6-20 Hz to remove background and respiratory noise. As reference, the ECG is simultaneously acquired using I lead. The wireless data transmission module based on Wi-Fi technology is used to transfer signals into a PC where the signals will be processed in real time.
Fig. 1. The acquisition system for BCG and ECG signals.

2.2. Signal Preprocessing

Although the original signal is filtered using the internal circuit of the BCG detection system, the filtered signal still contains much noise. So we have applied the polynomial least square’s method and the wavelet transform to eliminate the baseline wander and remaining noise. The final ECG and BCG signals are shown in Fig. 2. It shows that most of the noise among the original BCG signals is eliminated. And the BCG signal is consistent with the rhythm of the synchronized ECG signal. The feature of BCG signal is retained well for the following treatment.
Fig. 2. The preprocessed ECG and BCG signals.

3. SDTW Algorithm

3.1. Overview

An overview of the proposed algorithm is given in the flowchart shown in Fig. 3. Firstly, the original BCG signal is preprocessed to reduce the effects of noise. Secondly, a short segment of the preprocessed signal as training data is an extracted feature of the one-beat cycle signal to construct a template. The remaining signal is used as the test data that is segmented based on local peak points. Thirdly, template matching is carried out between the template and the segmented test data. Finally, the J waves are located and then the beat-to-beat intervals are detected.
Fig. 3. The flow chart of the proposed algorithm.

3.2. BCG Template Modeling

During the template modeling phase, a segment signal of 10 seconds as the training data is analyzed to extract one-beat cycle BCG signal template using the fiducial point’s method [10]. The template represents a general morphology characteristic of BCG cycles, which are selected by the following criteria.
(a) The initial template signal is constructed by an ensemble averaging the separated BCGcycle signal by aligning at each J peak point.
(b) The cross-correlation coefficient is calculated between each one-beat cycle BCG signal andthe initial template. It will eliminate the unqualified cycle using the threshold of 0.85.
(c) The remaining one-beat cycle BCG signal is recalculated by step (a) and formed the finaltemplate. It is shown in Fig. 4.
Fig. 4. The constructed BCG templates and its wave’s nomenclature.

3.3. Segmentation and Template Matching

Dynamic Time Warping (DTW) is an algorithm for measuring similarity between two sequences which may vary in phase and amplitude. The algorithm has been widely used in pattern recognition in time series and speech recognition [14,15]. In this algorithm, the similarity is measured by aligning the two sequences and computing a distance coefficient between them. The timing differences between the test data T (Eq. (1)) and the template data R (Eq. (2)) can be depicted by the sequence F (Eq. (3)). It can be considered to represent a warping coefficient which approximately realizes a mapping from the time axis of pattern T into that of pattern R.
T = {t(i)|1 ≤ i ≤ M|}
R = {r(j)|1 ≤ j ≤ N|}
F = {f(k)[1 ≤ k ≤ K]}, f(k) = (i(k),j(k))
M, N and K are the length of each sequence respectively.
In general, DTW method can find an optimal match path between two given sequences conforming to the following restrictions [16].
(a) Matching endpoints conditions:
i(1) = 1, j(1) = 1, i(k) = N, j(k) = M
(b) Continuity conditions:
i(k) − i(k − 1) ≤ 1, j(k) − j(k − 1) ≤ 1
(c) Monotonic conditions:
i(k − 1) ≤ i(k), j(k − 1) ≤ j(k)
(d) Slope conditions to avoid excessive fluctuation of the time-axis:
0.5 ≤ |i(k) − j(k)| ≤ 2
The distortion distance between t(i) and r(j) is d, as shown in Eq. (8).
d[t(i),r(j)] = ‖t(i) − r(j)‖
The sum of d is the accumulated distance of D which indicates similar degree between two signals, as shown in Eq. (9). The smaller D represents greater similar degree.
D[i(k),j(k)] = d[(T(i(k),R(j(k))] + D[i(k − 1),j(k − 1)]
Since the length of each one-beat cycle BCG signal is not exactly the same, and the amplitude difference is not significant, we can use the DTW algorithm to calculate the similarity degree between template and test data. Template matching was performed by local moving window coefficient, which generates accumulated distance coefficients between the template and BCG signal. The J peak of each one-beat cycle BCG signal is detected by finding each minimum point in the accumulated distance coefficient signal.
A segment test data from one subject is shown in Fig. 5 (a) and the matching result using DTW algorithm is shown in Fig. 5 (b). The accumulated distance coefficient signal exhibits each local minimum position where the signal segment is matched with the template. Therefore, each local minimum position can ensure the position of J peak, which can be obtained by peak detection. And then the beat-to-beat heart rate can be obtained by computing each JJ interval.
Fig. 5. The illustration of SDTW algorithm. (a) BCG signal, (b) The accumulated distance of DTW (Dist.) and (c) The accumulated distance of SDTW (Dist.).
The experiment results show that the DTW algorithm is effective for estimating the beat-to-beat heart rate. However, the algorithm calculating process point by point needs heavy computation. So it is necessary to improve the calculation speed. The statistical results show that there are just four consecutive peaks (H, J, L and N) with large amplitude and the J peak is the highest one among them in template and the BCG cycles. These extreme points represent the basic features of the sequence, so the matching algorithm which is only based on the feature points can effectively reduce the times of matching and then improve the computing speed [17]. Therefore, we presented a Segmented Dynamic Time Warping (SDTW) algorithm for estimation of beatto-beat heart rate quickly and accurately. The algorithm which is based on the morphology characteristics of BCG cycles aims at extracting the tendency of the BCG cycles and then uses the effective turning point to partition the signal. Using this algorithm, there is no need for matching operation point by point, because the matching extreme value will exist only if the test data segment meets these characteristics. The algorithm process is as follows:
(a) Peak extraction: Extracting all local peak points of the BCG signal Swa(i)(i = 1,2,··· ,M) using Eq. (10):
Jfbi 06 00415 i001 where Smax(i)(i = 1,2,··· ,M) is the abscissa sequence of all maximum points. All of the maxima positions are signed with ‘*’, as shown in Fig. 5 (a).
(b) Segmentation and template matching: We extract data from any continuous four peaks anduse the amplitude threshold R to extract the meet requirements peaks as a possible matching data segment. When the amplitude difference of the adjacent peak is greater than R, the DTW will be carried out. According to the statistical amplitude characteristic of BCG cycles signal, we can set empirically 0.2 ≤ R ≤ 0.4. The matching results are saved in the sequence of Sdtw(index(i))(i = 1,2,··· ,M), as shown in Fig. 5 (c). It shows that the local minimum corresponds to that in Fig. 5 (b).
(c) Locate all the J waves: Extract the entire minimum from the Sdtw signal in Fig. 5 (c), and correspondingly search for the maximum peak position (J wave) between any two minimum positions in Fig. 5 (a).
(d) Calculate beat-to-beat intervals: Finally, beat-to-beat heart rate intervals are obtained bycalculating the each JJ interval.

4. Experiment and Result Analysis

4.1. Sample Condition

The performance of the SDTW algorithm was evaluated on a group of 20 healthy volunteers (ten males, ten females, and ages: 20-35). Each subject was required to move as little as possible while standing still on the scale. When BCG was recorded, the lead I ECG data was simultaneously recorded for reference. The subject would have difficulty remaining standing stable on the scale for longer time, so the length of the recording for one minute is enough to estimate heart beat and the length of beat-to-beat interval. A segment signal of 10 seconds as the training data was used to extract the template for each subject. And then, the remaining signal of 50 seconds was scanned for beat-to-beat heart rate using SDTW algorithm for the same subject.

4.2. Evaluation Experiment of SDTW Algorithm and Analysis

SDTW algorithm belongs to a pattern-matching operation based on a complete heart beat signal model. Due to the fact that interference signal with smaller amplitude does not have a serious impact on the signal model, the algorithm is not sensitive to the noise signals of small amplitude [11]. However, if the noise amplitude is larger, such as the motion artifact signal, it would lead to match failure. So we must remove them in advance.
The BCG signal with the motion artifact was computed by SDTW algorithm, and the result is shown in Fig. 6. The position of the motion artifact was marked with a rectangular box (see Fig. 6 (a)). In Fig. 6 (b), for normal BCG signal, the algorithm would obtain clear local minima, which synchronize with the R wave of ECG signal. However, no local minima are abstracted within the artifact’s segment. The beat-to-beat heart rate variation is shown in Fig. 6 (c). The position of the marked ‘*’ in Fig. 6 (c) corresponds to the significantly lower abnormal heart rate (28 bpm), which will influence beat-to-beat heart rate estimation. In order to ensure that only the artifact-free signal segments are considered for evaluation, we should eliminate the motion artifact sectional data using the mean JJ interval as the threshold.
Fig. 6. Automatically detected motion artifact and beat-to-beat heart rate variation. (a) BCG signal, (b) The accumulated distance of SDTW (Dist.) and (c) The beat-to-beat heart rate.
We have also calculated the mean bias and Standard Deviation (SD) between JJ interval and the corresponding RR interval for a 10 seconds record of each subject to evaluate SDTW algorithm. The Bland statistical plot [18] is shown in Fig. 7. The results show that the mean bias obtained is 0.2 ms and the 95% of the confidence interval (±2 SD) is ±19 ms. It indicates that the beat-to-beat heart rates are in better agreement with the ECG.
Fig. 7. Statistical figure of JJ interval and RR interval difference.

4.3. Comparison Experiment

We carried out the comparison experiment of SDTW with the traditional CCTM, EDTM and DTW algorithms in order to evaluate the performance of the presented algorithm. The heart rates were obtained by averaging the beat-to-beat heart rate intervals’ lengths under the different algorithms. The typical processing result is shown in Fig. 8.
Fig. 8. The compared results from four methods. (a) BCG signal, (b) The cross-correlation coefficient (Corr.) from CCTM, (c) The Euclidean distance (ECU Dist.) from EDTM, (d) The accumulated distance of DTW (DTW Dist.) and (e) The accumulated distance of SDTW (SDTW Dist.).
The Fig. 8 (b) and (c) exhibit the inadequacy of the CCTM and EDTM algorithms. Since the wave pattern which is signed by the letter ‘N’ in Fig. 8 (a) is similar to the template of the subject, the corresponding false extremum which is signed by the letter ‘F’ appears in Fig. 8 (b). It would result in an error in locating the J waves. In Fig. 8 (c), the amplitude of each local minima point indicates obvious differences, which will be difficult to extract the minimum coordinate using the fixed threshold. In addition, the accumulated distance coefficients from Fig. 8 (d) and (e) exhibit clearly each local minima where the segment is matched with the template of the signal. Meanwhile, the local minima of SDTW show significant correlation with that of DTW. Because the amplitude of each local minima is close to zero in Fig. 8 (d) and (e), it is easy to use fixed threshold for extracting the coordinate.
The mean and standard deviations of relative errors (E) and those of the matching time (t) were used to compare performance of the SDTW with others algorithm. The E is calculated by Eq. (11).
Jfbi 06 00415 i002 where HRBCG and HRECG are, the heart rate of BCG and ECG respectively. The results of this comparison are listed in Table 1.
Table 1. Performance comparison of different algorithms.
Table 1 shows that the mean and standard deviations of relative errors for all subjects are 3.62±1.90%, 3.38±1.35%, 1.37±0.71% and 1.37±0.71% from CCTM, EDTM, DTW and SDTW, respectively. And the value of the SDTW is equal to that of DTW, which is superior to the results from the others. The traditional CCTM algorithm is sensitive to the phase and EDTM algorithm is sensitive to the amplitude, so the relative errors are higher. Therefore, the SDTW algorithm combines phase with amplitude characteristic, which effectively makes up for the inadequacy of the traditional algorithms. Although the mean and standard deviations of matching time for EDTW is the shortest (0.17±0.03 s), but the accuracy is much less than SDTW. In addition, the value is 0.77±0.16 s for SDTW, which is far less than that of CCTM (7.34±0.84 s) and DTW (12.98±1.44 s). The main reason is that the method of segmented matching does not need matching operation point by point, which significantly improves the computing speed. Therefore, SDTW algorithm can improve the accuracy and speed of beat-to-beat heart rate estimation in BCG effectively.

5. Conclusion

A novel algorithm for estimation of beat-to-beat heart rates in BCG was presented. The experimental results indicate that the obtained beat-to-beat heart rate intervals are in better agreement with that of ECG. The mean of relative errors and matching time for heart rate estimation with the presented algorithm were 1.37% and 0.77 s, respectively. The results were superior to that of the other algorithms. Therefore, the algorithm can calculate the heart rate and intervals of beat-to-beat heart rate accurately and rapidly, which makes it possible for online estimation of heart rate. It establishes the foundation for heart disease monitoring based on BCG signal.
Our future plans involve further research on diagnosis characteristic extraction of BCG signal for diagnosing heart disease, and explore the feasibility of heart disease monitoring system based on BCG.

Acknowledgments

The authors would like to thank all the volunteers for their valuable collaboration and help. This work is supported by the National Natural Science Foundation of China (No. 81202527).

References

  1. Wiard, R.M.; Inan, O.T.; Argyres, B.; Etemadi, M.; Kovacs, G.T.A.; Giovangrandi, L. Automatic detection of motion artifacts in the ballistocardiogram measured on a modified bathroom scale. Med. Biol. Eng. Comput. 2011, 49(2), 213–220. [Google Scholar] [CrossRef] [Scilit]
  2. Noh, Y.H.; Jeong, D.U. Implementation of unconstrained Ballistocardiogram monitoring system for ubiquitous healthcare. Sens. Lett. 2011, 9(1), 228–233. [Google Scholar] [CrossRef] [Scilit]
  3. Shin, J.H.; Hwang, S.H.; Chang, M.H.; Park, K.S. Heart rate variability analysis using a ballistocardiogram during Valsalva manoeuvre and post exercise. Physiol. Meas. 2011, 32(8), 1239–1264. [Google Scholar] [CrossRef] [Scilit]
  4. Jiang, F.F.; Wang, X.; Yang, D. The research on Time-frequency Detection Method of Respiratory Component in Ballistocardiogram signal. J.Biomedical Eng. 2012, 29(3), 397–401. [Google Scholar]
  5. Mack, D.C.; Patrie, J.T.; Suratt, P.M.; Felder, R.A.; Alwan, M.A. Development and preliminary validation of heart rate and breathing rate detection using a passive ballistocardiography-based sleep monitoring system. IEEE Trans. Inf. Technol. BioMed 2009, 13(1), 111–120. [Google Scholar] [CrossRef] [Scilit]
  6. Karki, S.; Lekkal, J. A new method to measure heart rate with EMFi and PVDF materials. J. Med. Eng. Technol. 2009, 33(7), 551–558. [Google Scholar] [CrossRef] [Scilit]
  7. Shin, J.H.; Chee, Y.J.; Jeong, D.U.; Park, K.S. Nonconstrained sleep monitoring system and algorithms using air-mattress with balancing tube method. Inf. Technol. Biomed. IEEE Trans. 2010, 14(1), 147–156. [Google Scholar] [CrossRef]
  8. Gilaberte, S.; Gomez-Clapers, J.; Casanella, R.; Pallas-Areny, R. Heart and respiratory rate detection on a bathroom scale based on the ballistocardiogram and the continuous wavelet transform. Hum. Factor 2010, 1, 557–560. [Google Scholar]
  9. Akhbardeh, A.; Kaminska, B.; Tavakolian, K. BSeg++: A modified blind segmentation method for ballistocardiogram cycle extraction. Conf. Proc. IEEE Eng. Med. Biol. Soc. 2007, 2007, 1896–1899. [Google Scholar]
  10. Wang, X.; Jin, J.J. Design and realization of heart rate measuring device based on body vibration signals. Transducer Microsyst. Technol. 2008, 27(11), 81–83. [Google Scholar]
  11. Bruser, C.; Stadlthanner, K.; de Waele, S.; Leonhardt, S. Adaptive Beat-to-Beat Heart Rate Estimation in Ballistocardiograms. IEEE Trans. Inf. Technol. Biomed. 2011, 15(5), 778–786. [Google Scholar]
  12. Shin, J.H.; Choi, B.H.; Lim, Y.G.; Jeong, D.U.; Park, K.S. Automatic ballistocardiogram (BCG) beat detection using a template matching approach. Conf. Proc. IEEE Eng. Med. Biol. Soc. 2008, Vol.2008, 1144–1146. [Google Scholar] [CrossRef] [Scilit]
  13. Gonzalez-Landaeta, R.; Casas, O.; Pall`as-Areny, R. Heart rate detection from an electronic weighing scale. Physiol. Meas. 2008, 29(8), 979–988. [Google Scholar] [CrossRef] [Scilit]
  14. Shi, L.; Guo, B.; Li, Z.J.; Zhao, Y. Human identification approach based on ECG. Comput. Eng. 2011, 37(1), 175–177. [Google Scholar]
  15. Adwan, S.; Arof, H. On improving dynamic time warping for pattern matching. Measurement 2012, 45(6), 1609–1620. [Google Scholar] [CrossRef] [Scilit]
  16. Sakoe, H.; Chiba, S. Dynamic programming algorithm optimization for spoken word recognition. IEEE Trans. Acoust. Speech Signal Process. 1978, 26(1), 43–49. [Google Scholar] [CrossRef] [Scilit]
  17. Shang, F.H.; Sun, D.C. PLR based on time series tendency turning point. Appl. Res. Comput. 2010, 27(6), 2075–2077. [Google Scholar]
  18. Bland, J.M.; Altman, D.G. Statistical method for assessing agreement between two methods of clinical measurement. Int. J. Nurs. Stud. 2010, 47(8), 931–936. [Google Scholar]

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.