- Research
- Open Access
- Published:

# Detecting heart rate while jogging: blind source separation of gait and heartbeat

*Mathematics-in-Industry Case Studies*
**volume 7**, Article number: 2 (2017)

## Abstract

A blind source signal separation problem that was brought to a Study Group in Limerick in 2013 required a way to prevent the gait of a jogger from masking the heartbeat, when detected by a simple photodiode that measures light transmission through a jogger’s wrist tissues. The group was successful in discovering a singular value decomposition (SVD) approach, which not only allows accurate detection of heart rate but also allows recovery of a good facsimile of the entire blood pressure time series from the mixed photodiode signal.

## Introduction

We consider a blind source signal separation problem that was brought to the European Study Group with Industry held in June 2013 at the University of Limerick. The problem arises when considering how to detect heart rate in a simple non-intrusive way while walking or jogging.

Specifically, a very simple heart rate monitor was considered, based on a single wrist device similar to that pictured in Fig. 1 that does not require a separate transmitting chest band. The device is to contain a single channel photodiode mounted against the skin so that light reaching it has to travel through wrist tissue, which detects changes in the intensity of the light that reaches it, and a processor chip to analyse the single-channel signal and display the heart rate detected. The light reaching the photodiode is affected mainly by two things, variation in the perfusion^{1} of the tissues through which it passes and variation in the incident intensity on the skin surface surrounding the monitor. The first effect is due to varying blood pressure, which causes a pulsatile^{2} perfusion of body tissues, hence a pulsatile variation in the absorption of the light that travels from skin through tissue to the photodiode. The second effect, which masks the first, is due to the gait of a person, walking or running perhaps, moving the wrist and causing the light levels incident upon the skin to vary rhythmically. The periods of these two effects are usually very close. Walking is typically about one step per second, and walking heart rate is about 60 beats per minute. Running gait may be three times as fast, and running heart rate is usually also similar to gait at about 180 beats per minute.

Although no data was available for the Study Group to assess, we were advised that in prototypes, the gait was masking detection of heart rate, so that the instrument was reporting running rate rather than the desired heart rate. The Group was asked to investigate and assess ways to process the time series and separate the heart rate out of the combined signal coming from the photodiode.

The problem then is to separate two time series signals with the same or similar periods but with different characteristic structures or wave shapes in time, when they are presented as a single combination. The input thus comprises a single combined signal, and the required output is the recovery of the two initial signals. In the literature, this is referred to as *blind source separation*. Some information about the sources is needed to do this. For example, in the case of two voices recorded in one channel, if one voice is deeper than the other, it is possible to model the footprint of each voice in the frequency domain by assuming a certain shape to the power spectrum, fit the shapes to the observed power spectrum, and subtract out each voice in turn [1]. Or, in the case of recording the heartbeat of a pregnant woman, if the fetal heart rate is higher than the mother’s heart rate, this can be leveraged to extract it from a mixed signal obtained from a passive sound sensor on the mother’s abdomen [2].

It is noted in Syed et al. [3] that blind source separation problems are considered tractable if they involve linear mixtures of the sources and that it is necessary to know something about the structure of the sources or something about the mixing matrix that combines them. In particular, if the sources are statistically independent random signals, independent component analysis (ICA) is effective, or if the sources are nonnegative, matrix factorisation is effective, or if the sources are sparse, a sparse component analysis can be effective.

In a review of blind source separation (BSS) methods, Jutten and Karhunen [4] note that linear problems with random sources with no temporal structure are routinely solved using ICA. However, where there is temporal structure (as here), or worse, nonlinear combinations of sources (as here), BSS problems require additional prior information. Indeed, they point out that BSS ‘is simply impossible for general nonlinear transformations by resorting to statistical independence only without additional constraints or prior information’. Furthermore, their development is for random signals, which is not a good description of our problem.

Gao et al. [5] consider separating a single signal into foetal and maternal ECG sources and use a combination of approaches. They first compute a spectrogram of the combined signal, then use singular value decomposition (SVD, described in more detail later) to smooth the spectrogram by retaining the first *k* singular values and left and right eigenvectors. Then, they use ICA on the right singular eigenvectors, generate new left eigenvectors, and use ICA on those separately. They note that this involves the crucial assumption that the spectral components of foetal and maternal signals are independent random variables. Then, they select the two most significant new components and test how well they represent the maternal and foetal blind sources. Since they are working in frequency space (evolving slowly with time), they are leveraging the different spectra of the two sources—foetal ECG is typically higher frequency than maternal. They note that straight SVD does not do as well at their combination approach, at detecting foetal heartbeats. Their method does not reproduce a foetal source component and only broadly locates foetal heartbeats in time.

A similar approach is taken by Murata et al. [6], who seek to separate voices in a conversation recorded by one microphone. They start with the windowed Fourier transform, then seek to diagonalise the correlation functions. These need to be weakly stationary.

The position of ICA as a new paradigm for BSS, and issues involving stability and convergence, and the number of signals having to be greater than or equal to the number of sources (which is not the case here), and ways around the need for linearity, are discussed in the special issue of *Neurocomputing* edited by Amari et al. [7].

After the work discussed in this paper was done, we were alerted to a little-known paper by Fowler et al. [8], which recommends a similar procedure to the one we find here to be so effective. However, Fowler et al. were investigating a different problem to filter different oscillations in data from the respiration of children in quiet and REM sleep. The filtering is to assist in diagnosis of ailments and to warn of incipient sudden infant death syndrome. In their work, a careful choice of lag is made when embedding data in a phase space, then SVD is applied to smooth the data in preparation for diagnosis. While the approach is similar in style to ours, there is no attempt or need to separate blind source signals in [8].

In the remainder of this paper, we will indicate how we overcame the shortcoming of there being no data available by creating an ersatz set of data incorporating two sources (gait and blood pressure), we discuss embedding our ersatz data in a high dimensional phase space, and we show how the use of SVD can not only prevent the gait source from masking heart rate, but how we can recover a remarkably good facsimile of the original blood pressure source.

## Methods

### Ersatz data

The group found some high-resolution arterial blood pressure data that would serve as a proxy for perfusion of tissue (Fig. 2) [9]. The Beer-Lambert law for light transmission through an absorbing medium was then used together with a simple assumed formula for the effect of gait on incident light intensity to manufacture an ersatz data set that we could use to test our ideas on separating the heart signal from the gait signal.

### The Beer-Lambert law

The Beer-Lambert law gives the transmitted intensity of light *I*(*t*) when the light of incident intensity *I*
_{0}(*t*) passes through an absorbing medium. Here, we modify it slightly to relate transmitted light intensity to blood pressure, as

where *P*(*t*) is the blood pressure and *λ* is to convert the blood pressure to effective absorption by the tissue.

Figure 2 shows a typical arterial blood pressure signal, *P*(*t*), on the left and a signal generated from *P* using Eq. (1), in the particular form

on the right. Noting that gait and heartbeat have similar frequencies, the period of the sine function representing a realistic gait has been chosen to approximately match the average frequency of the blood pressure data *P*(*t*), and the amplitudes in the exponent and of the sine are motivated by anticipated signal-to-noise ratios of 5 %. Note that the blood pressure signal has a small variation in frequency, or in particular the time between peak pressures which can be used to give a beat-to-beat heart rate, over the time period used. Our study is based on this ersatz data set. It has the advantage that we know the input signals, so we can assess how well our blind source separate technique works.

## Results and discussion

### Spectral characteristics

The group was interested in whether a spectrogram might indicate characteristics of the combined signal in the frequency domain that differed in some way from the pressure signal. Figure 3
a displays a spectrogram of light intensity corresponding to light intensity *I*(*t*). Figure 3
b shows a spectrogram of the blood pressure signal, *P*(*t*).

It is difficult to conclude anything from these spectrograms. The periods in both do not appear to vary much, although the blood pressure period does appear to vary from beat to beat in the time series plot. There is a more apparent jump in the colors of the blood pressure spectrogram at times that correspond to the rapid rise in pressure associated with systole, compared to the gentler sine-dominated oscillations of *I*(*t*).

Spectral techniques are designed for linear systems and rely on a frequency difference. So next, we attempted a phase plane reconstruction [10] to see how we could leverage differences in temporal structure of the smooth gait and sharper blood pressure. Such techniques are motivated and based on the theory of dynamical systems, and the time evolution is defined in an appropriate phase space.

### Phase space reconstruction

Our time series may be regarded as a sequence of measurements obtained from a dynamical system. The established approach is to embed the time series onto a trajectory in a finite dimensional space. It has been demonstrated under quite general circumstances that the reconstructed trajectory is topologically equivalent to the trajectory in the unknown space in which the original trajectory is living. The particular method used here is the method of delays, based on the idea of a delay register [10, 11].

To do this, we choose an embedding dimension and a time lag or delay. Embedding theorems guarantee faithful reproduction of the trajectory if the embedding dimension is larger than twice the number of active degrees of freedom, regardless of how large the dimensionality of the true space is. The delay is not the subject of the embedding theorems since they consider data with infinite precision. In practice, the time delay must be found by experimentation: no rigorous way of establishing its optimal value has been determined [8, 12].

If the delay is small compared to the intrinsic time scales of the system, successive elements of the delay vectors are strongly correlated. However, if it is too small, there is almost no difference between the different elements of the delay vectors; if it is large enough, the different coordinates may be almost uncorrelated, or independent, providing a topologically correct view of dynamical behaviour. Delays are fed into the register and propogate sequentially until they are lost at the other end *n* clock cycles later. At any instant, the register thus contains *n* consecutive data values (*v*
_{
i
},*v*
_{
i−1},…*v*
_{
i−n
}).

Each sequence of data points can be thought of as an *n*-dimensional vector, usually written as a column vector. The sequence of *n*-vectors generated by clocking the data through the delay register can be thought of as a discrete trajectory in an *n*-dimensional Euclidean space. If the signal arises from a finite-dimensional deterministic system, then provided the embedding dimension is sufficiently large, the trajectory gives a genuine image of the dynamics in its own phase space.

We then reconstructed a two-dimensional phase space view of our data in this way, using the ersatz values of *I*(*t*) created using the Beer-Lambert law. The results appear in Fig. 4, with a choice of lag of about 1/4 of the main period present in the signal, which also is close to the first zero of the autocorrelation of *I*(*t*). The large D-shaped structure is reminiscent of the ellipse we would obtain if we used only the gait signal to create the two-dimensional trajectory, so we associate the D-shape with gait. The small loops seen at various places on the straight line part of the D we associate with heartbeats.

The appearance of this phase space reconstruction led us to think about ways to remove the larger D-shaped behaviour from the signal, then leaving behind mostly the effects of the blood pressure. Although we are motivated by a two-dimensional projection of the trajectory, we now consider a higher dimensional phase space, acknowledging that the dimension needs to be high enough to obtain a topologically equivalent trajectory. The results of the remarkably effective SVD method are detailed in the following sections.

### Singular value decomposition

The set of all delay vectors forms an ellipsoidal cloud in the Euclidean space and we wish to establish and then remove the two most important directions associated with the data, as these will correspond to the D shape seen in Fig. 4. The procedure continues by subtracting off the mean value from each column vector creating a new set *x*
_{
i
} and then diagonalising the covariance matrix

This is related to the singular value decomposition of a trajectory matrix *M* which has rows consisting of the row vectors \({x_{i}^{T}}\). The covariance matrix is actually the product *M*
^{T}
*M* and the right singular vectors are the eigenvectors of the covariance matrix. The matrix is real and symmetric, hence its eigenvalues are real and its eigenvectors are orthogonal. Mathematically, the singular values of *M* are the square roots of the eigenvalues of the covariance matrix.

Finding the singular vectors corresponds to finding the semi-major axes of the data cloud generated in the embedded phase space by the trajectory, and the singular values are then related to the lengths of these axes. Thus, the singular vectors give a geometric description of where the trajectory lies, and the singular values are a measure of the extent of the trajectory in the corresponding directions. The most relevant directions in space relate to the vectors corresponding to the largest eigenvalues; directions associated with small eigenvectors may be neglected.

The most relevant directions in space are given by the eigenvectors corresponding to the largest eigenvalues. The group thought that the SVD might then identify the two most important axes as those associated with the D-shape seen in two dimensions and allow us to remove those dimensions from the data.

The first step in using SVD is to create a matrix *M*, each row of which is the vector (*I*
_{
k+1},*I*
_{
k+2},…,*I*
_{
k+n
}), with the first row having *k*=0, the second *k*=*n*+1, the third *k*=2*n*+1, etc. We generated as many rows as the data allowed, say *m* rows. In the standard approach, each row is then averaged separately, and the average is subtracted from that row to create a normalised *M* matrix. This moves the origin in phase space to the middle of the ellipsoid. In fact, we found that we obtained better results if we did not normalise the matrix *M*.

The SVD decomposes the matrix *M* as

where *U*
^{T}
*U*=*I, V*
^{T}
*V*=*I*; the columns of *U* are orthonormal eigenvectors of *M*
*M*
^{T}; the columns of *V* are orthonormal eigenvectors of *M*
^{T}
*M*; and *S* is a diagonal matrix containing the singular values of *M* in descending order.

In order to remove the D-shape seen in two dimensions, we set the two biggest singular values in *S* to zero. We then compute a new *M* matrix using the modified *S* matrix and the same matrices *U* and *V* as obtained from the original *M* matrix. This new *M* matrix then gives a time series that should represent or capture the notches in *I*(*t*).

Figure 5 shows the blood pressure data, the gait data, the composite signal *I*(*t*), the result (the residual) of removing just the most singular value from the time series by setting the first singular value in *S* to zero, and the result of also removing the second most singular value from *I*(*t*). Note that the remaining time series has a pulse of activity located exactly at each place that blood pressures rise to systole. Figure 6 shows the result of repeating this analysis when the gait has a period that is about 50 % longer than before. SVD seems to work just as well, in locating the places where blood pressure rises, that is, in finding heart rate.

Figure 7 shows more detail of just the blood pressure curve and the result of removing the two most singular values, otherwise the same case as in Fig. 5. Figure 8 shows a closeup view of the blood pressure signal over one period, superposed with the combined *I*(*t*) signal and the result of removing the two most singular values from that signal. Note the increased amplitude of the oscillations in this ‘after SVD’ data at the place where blood pressure rises suddenly to systole.

In fact, we discovered that it is possible to recover curves that look just like the original blood pressure data, by first rectifying and then smoothing the residual signal obtained after removing the two most singular values. As illustrated in Fig. 9, the resulting signal looks a lot like the original blood pressure data before modifying with the Beer-Lambert law. That is, buried in the apparently noisy SVD result is the original blood pressure data. Removing the two most singular values from the composite signal *I*(*t*), then rectifying and smoothing, gives a filtered signal that looks very like the desired blood pressure curve and will give correct heartrate values. More extensive testing is required to be sure of the general efficacy of this approach, but it looks very promising and is visually compelling. We found that it is not sensitive to the length of vectors *n* chosen to make the matrix *M* from the time series.

## Conclusions

A point of difference is needed, either in the time domain or in the frequency domain, to separate blind sources. For example, different frequency footprints can be used to reconstruct signals (male/female voices), or different appearance in the time domain, like notches, give some hope of distinguishing two mixed signals. In the present paper, we are leveraging the difference in scale of the two component signals.

Our use of the SVD appears to be very effective in the time domain, for extracting a time series from the Beer-Lambert law data, that looks very similar to the blood pressure data used as one of the sources when generating the data for light intensity *I*(*t*) as measured by a photodiode. Apparently removing the two most singular values in the SVD approach can recover the blood pressure signal, with no specific prior knowledge of shape required. This approach needs to be explored further, with other shapes used for gait and with plethysmograph data for perfusion of finger tissue, or even better with actual data obtained from a photodiode worn by an active person.

This approach does not require linearity in the way that signals are combined or that the periods of the two signals be very different, just that the nature of the blind source signals be temporally different. In principle, it can be extended to separating more than two sources, provided that two singular values are used to remove each source in turn. This in itself is an assumption about the nature of the sources that they be essentially two-dimensional in nature.

## Endnotes

^{1} Perfusion is the delivery of blood to a capillary bed in biological tissue.

^{2} Pulsatile means rhythmic.

## References

- 1
Kristjansson T, Attias H, Hershey J (2004) Single microphone source separation using high resolution signal reconstruction. Acoustics, Speech, and Signal Processing, 2004 In: Proceedings ICASSP ’04; IEEE International Conference on 17-21 May 2004, 817–820, doi:10.1109/ICASSP.2004.1326383.

- 2
Acharyya R, Scott NL, Teal PL (2009) Non-invasive foetal heartbeat rate extraction from an underdetermined single signal. Health 1(2): 111–116.

- 3
Syed MN, Georgiev PG, Pardalos PM (2014) A hierarchical approach for sparse source blind signal separation problem. Comput Oper Res 41: 386–398.

- 4
Jutten C, Karhunen J (2004) Advances in blind source separation (BSS) and independent component analysis (ICA) for nonlinear mixtures. Int J Neural Syst 14(5): 267–292.

- 5
Gao P, Chang E, Wyse L (2003) Blind separation of fetal ECG from single misture using SVD and ICA. Information, Communications and Signal Processing, 2003 and Fourth Pacific Rim Conference on Multimedia In: Proceedings of the 2003 Joint Conference of the Fourth International Conference on 15-18 Dec. 2003 (ICICS-PCM), 1418–1422, doi:10.1109/ICICS.2003.1292699.

- 6
Murata N, Ikeda S, Ziehe A (2001) An approach to blind source separation based on temporal structure of speech signals. Neurocomputing 41: 1–24.

- 7
Amari S-I, Hyvarinen A, Lee S-Y, Lee T-W, Sanchez AVD (2002) Blind signal separation and independent component analysis. Neurocomputing 49: 1–5.

- 8
Fowler AC, Kember G, Johnson P, Walter SJ, Fleming P, Clements M (1994) A method for filtering respiratory oscillations. J Theor Biol 170: 273–281.

- 9
Goldberger AL, Amaral LAN, Glass L, Hausdorff JM, Ivanov PCH, Mark RG, Mietus JE, Moody GB, Peng CK, Stanley HE (2000) PhysioBank, PhysioToolkit, and PhysioNet: components of a new research resource for complex physiologic signals. Circulation 101(23): e215—e220. http://physionet.org/physiobank/database/fantasia/.

- 10
Ruelle D, Takens F (1971) On the nature of turbulence. Commun Math Phys 20(3): 167–192.

- 11
Broomhead DS, King GP (1986) Extracting qualitative dynamics from experimental data. Physica20D: 217–236.

- 12
Kantz H, Schreiber T (1997) Nonlinear time series analysis. Cambridge University Press.

## Acknowledgements

We are grateful for the support of the Mathematics Applications Consortium for Science and Industry (www.macsi.ul.ie) funded by the Science Foundation Ireland (SFI) investigator award 12/IA/1683 and the SFI conference and workshop grant 13/CW/12578.

## Author information

## Additional information

### Competing interests

The authors declare that they have no competing interests.

### Authors’ contributions

This is an equal collaboration between the authors. All authors have read and approved the manuscript.

## Rights and permissions

**Open Access** This article is distributed under the terms of the Creative Commons Attribution 4.0 International License(http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.

## About this article

### Cite this article

Vo, T., McGuinness, M., Hegarty, A.F. *et al.* Detecting heart rate while jogging: blind source separation of gait and heartbeat.
*Mathematics-in-Industry Case Studies* **7, **2 (2017). https://doi.org/10.1186/s40929-016-0004-5

Received:

Accepted:

Published:

### Keywords

- Blind source separation
- SVD
- Heart rate monitor