1 Introduction

Nowadays words as “telemedicine” or “ambient assisted living” have become part of the ordinary dictionary as synonyms of the application of monitoring technologies over health conditions and data transfer, oriented to the person care and to the protection of her/his health status in a domestic environment. The main objective of such a service is, for obvious reasons, the so-called third age. According to the data of the World Health Organization, between 2015 and 2050 the number of people over 60 years is expected to increase from 12 to \(22\%\) with respect to the total world population, and by 2020 the number of people over 60 will overcome that of the children below 5. In other words, people live longer and while the natural ageing process cannot be stopped, it can be at least kept under control and improved as much as possible.

In this context the use of automatic monitoring systems is gaining more and more attention. In these systems the data generated by sensors are elaborated in order to give information about the health status of the examined person, with an evident cost reduction in comparison to a more traditional approach. In this work we will consider the monitoring of a subject during his time in bed, highlighting different phases during sleep time and extracting some of his vital signs, i.e. the cardiac and respiratory rate. This information is obtained by the elaboration of the BCG signal given by an accelerometric sensor, which is particularly suitable to a monitoring realized in a domestic environment, thanks to its small size and its non-invasiveness.

Sleep analysis through BCG technique is an alternative to polysomnographic (PSG) exam and results less invasive [1] since it avoids the use of electrodes during the electrocardiogram (EKG) measure needed to derive the heart rate and the use of a chest strap to obtain the respiratory rate from strain gauges.

Moreover, analysis based on BCG represents a reliable and non-intrusive way to verify the so called bed occupancy in hospitals and hospices. It can also be used for the prevention of sleep apnoea, a critical condition that has dramatic effects on health. In a study published by the American Journal of Respiratory and Critical Care Medicine [2], it emerged that amyloid beta depositions, main responsible of neurodegenerative diseases such as Alzheimer, are more abundant in people who suffer from sleep apnoea. Another work [3], published on American Academy of Neurology Journal, revealed that sleep apnoea and snoring can lead to memory and thought decline in early age. In that paper, both people in the first phases of mild cognitive impairment without memory and thought problems, and people with Alzheimer, were taken into account. It was proved that people with respiratory diseases during sleep had the diagnosis of cognitive impairment almost 10 years, on average, before people without these diseases.

The paper is organized as follows. Section 2 describes the BCG signal, while in Sect. 3 the algorithm for the extraction of heart and respiratory rate is illustrated. In Sect. 4 the results about the study of the characteristics of BCG signal related to particular action during “in bed” permanence are illustrated. Finally, Sect. 5 concludes the paper.

2 The Ballistocardiographic Signal (BCG)

The ballistocardiographic signal shows the mechanical activity of the heart, and in particular it represents the trend of reflux forces generated in the human body in response to the ejection of blood by the heart [4, 5]. The BCG signal was discovered in 1877 by J. W. Gordon, who noted that when a subject was standing on a scale, fluctuations in the balance needle seemed to be synchronized with his heart rate, and attributed the cause of these fluctuations to the ejection of blood in the aorta that would have caused a reflux force in the opposite direction [5,6,7].

During each beat, a displacement of the center of mass of the human body occurs, due to the movement of blood in the vessels; we therefore observe micro-movements in the body caused by reflux forces that trigger to counteract this displacement of the center of mass and preserve the total moment [7].

The BCG signal records exactly these micro-movements, which can be measured by displacement, velocity, or acceleration in all 3 spatial dimensions (Fig. 1). However, sometimes the measurement is observed in only one direction so that we can obtain the longitudinal BCG, which measures the deformations of the body in the head-to-foot direction, and the transverse BCG, which measures the back-ventral movements [7]. In the present paper we will refer to the longitudinal BCG only.

Fig. 1
figure 1

Recorded acceleration directions

Since the ballistocardiographic signal is a signal of strength, it is possible to measure it using different types of sensor (piezoelectric, strain gauge, pressure, etc.). In the present paper the BCG signals have been acquired by a MEMS type sensor [4] which presents remarkable characteristics in terms of response speed and sensitivity to disturbances, and which must be positioned below the mattress. Looking at Fig. 1, longitudinal BCG is measured along the y axis, while transverse BCG is measured on the x axis. As well as the electrocardiographic signal (ECG), also the BCG signal has its own characteristic trend and periodicity that make it possible, at least visually, a simple identification of the heart beats (Fig. 2).

Fig. 2
figure 2

Typical trend of BCG signal

On the horizontal axis we find the time, while on the vertical one the amplitude, since the actual unit of measurement depends on the type of sensor used. The BCG signal is a representation of the reflux forces recorded in the body in relation to cardiac events [8], so in the phases in which the blood, inside the heart, is pumped in the head-to-feet direction, a force is expected in opposite direction, i.e. a peak with concavity upwards, while the opposite occurs when the blood is pumped in the feet-to-head direction. The reference peak that allows to distinguish the beats and therefore to calculate the cardiac period, is represented by the J peak, as it turns out to be the maximum in amplitude. The J peak represents the maximum peak, analogously to the R peak for the ECG, which represents the acceleration of the blood in the descending aorta and therefore in the abdomen; again for an acceleration in head-to-feet direction there is a foot-head reflux force and therefore a positive peak.

3 Cardiac and Respiratory Rate Evaluation

In our experiments, in order to extract the heart rate we considered an acquisition made on a healthy adult subject during sleep, and from this, for sake of simplicity, we isolated a 24-min portion, framed in red in Fig. 3, during which no movements of the subject were recorded. These movements are highlighted by signal peaks outside the time interval considered. Inside this 24-min range, a BCG raw signal evolution of 30 s is considered, on which our analysis is developed.

Fig. 3
figure 3

BCG raw signal of a healthy adult subject during sleep

The low frequency oscillation of the amplitudes (with period of about 4 s) due to the respiration contribution overlaps the trend of the BCG signal in time [9]. By filtering the components out of the range of significant frequencies for the BCG signal (1–12 Hz) through two Butterworth filters of the 6th order, a high pass one with cutoff frequency equal to 1 Hz and a low pass one with cutoff frequency equal to 12 Hz, we obtain the signal shown in Fig. 4, where the J peaks are visible.

Fig. 4
figure 4

J peaks of a raw BCG signal after a 1-12 Hz filtering

However, in order to further enhance the J peaks and to make the J-J intervals and consequently the heart rate more easily identifiable, each sample of the signal is raised to the square and its sign is retained, obtaining the signal in Fig. 5c, which is called Filtered Squared Signal [10]. By observing it, we can note that, applying a threshold on amplitude and erasing all the samples below this threshold, the beat signal represented by all the J peaks is obtained (Fig. 5d). In our work we set the threshold value at 200. The threshold is constant value while the signal experiences a continuous oscillation of the amplitude because of the respiration. Consequently, besides the J peaks, other undesired peaks are included in the beats signal, which hinder the extraction of the heart rate. Since the heart rate in healthy adult subjects at rest varies between 60 and 90 beats per minute, frequencies below 0.7 Hz and over 2 Hz have been cut by using a double Butterworth filter of the 6th order. In Fig. 5e we can observe the beats signal after filtering, or filtered Beats, in which peaks have been highlighted in red. By comparing the beats signal before and after filtering we can note that no more undesired peaks are present and only the J peaks remain.

The cardiac period, or the time interval between successive beats, is nothing but the temporal distance between adjacent J peaks, and the heart rate is its inverse. Finally, Fig. 5f shows the trend in heart rate over the time frame of the test.

Fig. 5
figure 5

Elaboration of the BCG raw signal to extract the cardiac frequency

The respiratory rate is another important vital function which, in cases such as sleep apnoea, represents a parameter to be subjected to continuous monitoring. To extract the respiratory rate, the same portion of signal used for the extraction of heart rate was analyzed, thus we refer to the same healthy adult subject in the same conditions. A similar procedure to the one that led to the extraction of the heart rate is applied: a Butterworth filter of the 6th order of the low pass type with a cutoff frequency of 0.7 Hz is applied to the raw BCG portion of the signal analyzed, in order to eliminate all the signal components with a higher frequency than the respiratory one. The filtered signal clearly shows a slowly variable trend over time of about 4s, which unequivocally is related to the respiratory period.

Apart from the presence of “double peaks”, it is immediately clear that the useful peaks are all those present on the y positive half-plane, Therefore by simply placing a threshold at 0 of amplitude, above which the signal and the peaks can be considered as useful, we get a new signal, called Breaths Signal. In the hypothesis that the subject of the test breathes in a regular manner, in order to overcome the problem of the presence of double peaks or peaks too far from each other, when the cardiac period is not included in the normal range we can resort to one of the following mathematical approximations:

  1. 1.

    When peaks are too close to each other, they can be replaced by a unique peak positioned halfway between one peak and another;

  2. 2.

    Whether in the presence of peaks that are too close or too far apart, we can attribute to the cardiac period the value assumed in the previous time instant.

As done for the heart rate and the cardiac period, we plot the respiratory rate as a function of the time (Fig. 6).

Fig. 6
figure 6

Respiratory rate as a function of time

4 “In Bed” Analysis

In this paragraph we describe the processing of the BCG signal, with the goal of analyzing some of its characteristics that vary according to the activity carried out by the subject, and in particular we will try, by using an adaptive algorithm, to recognize instant by instant which action is played by the subject.

For this purpose 3 healthy adult subjects, whose characteristics are described in Table 1, were submitted to the same test.

Table 1 Characteristics of the subjects under test

Four activities were carried out, in the following denoted as: REST, TALK, MOVE, EMPTY. The test, called “RGBK”, consists in the succession of such activities:

  • 1 min at rest in supine position (REST)

  • 1 min talking in supine position (TALK)

  • Supine to lateral position change (MOVE)

  • 1 min at rest in lateral position (REST)

  • 1 min talking in lateral position (TALK)

  • Lateral to supine position change (MOVE)

  • 1 min at rest in supine position (REST)

  • Leaving the bed (MOVE)

  • About 30 s of empty bed (EMPTY)

The developed algorithm consists of a preliminary calibration phase, followed by the actual activity recognition procedure. The calibration phase uses portions of the acquired signal to set the ranges in amplitude ad variance for the different activities carried out during the test; for example, to set the ranges for the “talk” activity, a portion of signal during which the subject was talking was taken, and from it both amplitude and variance ranges have been extracted. After the calibration phase, the signal is divided into small intervals and for each of them, according to its amplitude or variance, we assign the corresponding activity, based on the ranges found during the calibration phase. We finally plot in different diagrams the RGBK signal obtained by associating a different color with each activity in the following way:

  • Empty \(\rightarrow \) Red \(\rightarrow \) R

  • Rest \(\rightarrow \) Green \(\rightarrow \) G

  • Talk \(\rightarrow \) Blue \(\rightarrow \) B

  • Move \(\rightarrow \) Black \(\rightarrow \) K

Figure 7 shows the RGBK signal relative to subject 1 before applying the activity recognition algorithm, while Fig. 8 shows the signal to which the discrimination of the activities based on variance has been applied. It is possible to observe that the algorithm is able to distinguish the various phases of the test quite precisely. The RGBK signals for the subject 2 and 3 after applying the activity recognition algorithm, based on the signal variance, are depicted in Fig. 9 and in Fig. 10.

Fig. 7
figure 7

RGBK signal for the subject 1. To obtain the value of the time in any instant, it is sufficient to divide the number of samples by 1000, i.e. the sampling frequency

Fig. 8
figure 8

RGBK signal for the subject 1 after applying the algorithm of recognition of the activities based on the variance of the signal

Fig. 9
figure 9

RGBK signal for the subject 2 after applying the algorithm of recognition of the activities based on the variance of the signal

Fig. 10
figure 10

RGBK signal for the subject 3 after applying the algorithm of recognition of the activities based on the variance of the signal

As far as subjects 1 and 2 are concerned, it is possible to identify the different phases of the test (Figs. 8 and 9), while it is not possible to do the same with subject 3 (Fig. 10), since by looking at her graphs no differences between the REST activity and the TALK activity are identifiable. To justify this anomaly, two main hypotheses have been proposed:

  1. 1.

    In the examined case, the body mass index (BMI) could be determining for a correct recognition of activities since, with respect to subjects 1 and 2, subject 3 shows a lower value. As it was reported in [1], in fact, subjects with too high or too low BMI are usually not included in the tests, probably because they would produce unreliable data. A more concrete proof of this argument has been reported in [11], where a high BMI value has been found to have a detrimental effect on the signal. In this case, the BMI of subject 3 is the normal range, so that it is possible to extract the main vital parameters without difficulty, but it is probably too low to allow the algorithm to distinguish TALK activity from REST activity.

  2. 2.

    Subject 3 could have vocal characteristics that do not allow to recognize, using this algorithm, if he is speaking or not.

In order to confirm the discussed hypotheses, we depicted the spectrum of the signal portion relative to the TALK trait of subject 3 in Fig. 11, and we compared it with the spectra of subjects 1 (Fig. 12) and 2 (Fig. 13). Although the location of the TALK portion in subject 3 it is not visually identifiable in Fig. 10, it is known a priori, having personally performed the tests.

Fig. 11
figure 11

TALK spectrum for the subject 3

Fig. 12
figure 12

TALK spectrum for the subject 1

Fig. 13
figure 13

TALK spectrum for the subject 2

Looking at the spectra of the three subjects we can draw some observations:

  1. 1.

    The maximum signal amplitude for subjects 2 and 3 (both women) is of the order of 104, while for subject 1 (man) it is of the order of 105. This allows to hypothesize that the subject 1 has a greater acoustic intensity (which is a plausible hypothesis since the subject is a man).

  2. 2.

    Another analogy, regarding the positioning of the peaks of the spectrum, is always present between subjects 2 and 3: in addition to a low-frequency peak due to respiration and to a peak around the 3.5 Hz typical of the BCG signal and present also in the subject 1 spectrum, there are 3 peaks placed at about 5, 6 and 9 Hz in both spectra of subjects 2 and 3. These data may suggest that subjects 2 and 3 have a comparable vocal range.

  3. 3.

    As the spectra of subjects 2 and 3 are roughly similar, what might distinguish them, and which is not evident from the frequency content, is the tone of voice.

5 Conclusion

In this work we have presented the cardiorespiratory monitoring technique based on the BCG signal. This technique shows considerable advantages from the cost, comfort and versatility points of view. Moreover, it can be applied in the polysomnographic (PSG) examination, as it can replace the annoying electrodes for measuring the ECG used to derive the heart rate, and the chest belt used to derive the respiratory frequency from the signal coming from the strain gauges. It is a reliable and non-intrusive way to verify the so-called bed occupancy, or to keep under control, for example in hospitals or nursing homes, whether the patient is actually in bed or not. Finally, it can be used in the prevention of sleep apnoea, a very dangerous condition that has serious repercussions on health. It has been verified how the analysis of the BCG signal also provides indications on the quiet state of the subject during his stay in bed, thus allowing to extend the analysis from vital parameters to qualitative assessments on the subject’s well-being. The information obtained from BCG signal analysis represents the basis for an activity of sleep disorders identification based on a machine learning approach.