Abstract
Sleep apnea is a serious health condition that affects many individuals and has been associated with serious health conditions such as cardiovascular disease. Clinical diagnosis of sleep apnea requires that a patient spend the night in a sleep clinic while being wired up to numerous obtrusive sensors. We are developing a system that utilizes respiration rate and breathing amplitude inferred from non-contact bed sensors (i.e. load cells placed under bed supports) to detect sleep apnea. Multi-harmonic artifacts generated either biologically or as a result of the impulse response of the bed have made it challenging to track respiration rate and amplitude with high resolution in time. In this paper, we present an algorithm that can accurately track respiration on a second-by-second basis while removing noise harmonics. The algorithm is tested using data collected from 5 patients during overnight sleep studies. Respiration rate is compared with polysomnography estimations of respiration rate estimated by a technician following clinical standards. Results indicate that certain subjects exhibit a large harmonic component of their breathing signal that can be removed by our algorithm. When compared with technician transcribed respiration rates using polysomnography signals, we demonstrate improved accuracy of respiration rate tracking using harmonic artifact rejection (mean error: 0.18 breaths/minute) over tracking not using harmonic artifact rejection (mean error: −2.74 breaths/minute).
I. INTRODUCTION
Sleep apnea is a prevalent condition associated with poor health outcomes such as cardiovascular disease [1]. It is estimated that 9% of middle aged women and 24% of middle aged men suffer from sleep apnea [2] and the majority of individuals with sleep apnea are undiagnosed [3]. Overnight attended polysomnography (PSG) is the gold standard for the diagnosis of sleep apnea. During a PSG test, patients are wired to numerous sensors including but not limited to electrodes placed on the head, chest, face, legs, and arms to measure brain, heart and muscle activity; belts placed around the chest and abdomen to measure movement of breathing; and sensors placed in the nose and over the mouth to measure airflow during breathing. Patient sleep has been shown to be altered during overnight PSG testing [4], and it has been suggested that discomfort caused by the various sensors attached to the patient may be partially to blame [5].
Load cells (i.e. force sensors) placed under the supports of a bed have been shown to have great utility for non-contact detection of various aspects of sleep while an individual lies on the bed. In our lab, we have used load cells to detect lying position [6], distinguish between sleep and wake [7], and have even utilized load cell data to detect sleep apnea[8, 9]. Load cells have also been shown to be able to detect breathing [10, 11].
When an individual lies on the bed, their breathing causes small periodic displacements of mass (e.g. visceral organs moved as the diaphragm contracts and relaxes) that can be detected by load cells placed under the supports of the bed. Estimating respiration rate from this periodic signal in the time domain requires that the signal must first be low-pass filtered to remove high frequency vibrations in the signal caused by the heart beating and the bed/mattress system resonance. Next, it is necessary to locate peaks and troughs in the filtered signal that indicate the location of individual breaths. However, due to the wide range of possible respiration rates, we and others [11] have found that extraneous peaks in the filtered signal hamper the accurate estimation of a breathing rate. These extra peaks manifest as higher order harmonics of the breathing signal as can be observed in Fig. 1. Notice in Fig. 1 that the true respiration rate is shown in black. These higher order spectral harmonics present in the breathing estimation that can make it challenging to accurately estimate respiration rate.
Figure 1.

Spectrogram that was estimated for 10 minutes of the load cell signal collected during subject 4’s overnight sleep test. The respiration rate estimates predicted from this frequency content are shown as yellow boxes when no harmonic correct was applied. A redline shows the load cell estimated respiration rate when harmonic correction was utilized. For comparison, the respiration rate ground truth estimates are indicated with the black line.
In an attempt to eliminate extraneous peaks and troughs in the load cell signal, one group developed a method [11] that utilizes several different low-pass filters. The specific filtered signal used to detect peaks/troughs was chosen by finding the filtered signal that resulted in the least variance of breathing amplitude estimated using the detected peaks and troughs. Since accurate detection of breathing is important in our efforts to detect sleep apnea using the load cell signals, this solution would not be ideal as highly variable breathing amplitudes are expected during apneic periods.
Another approach for detecting respiration rate is to analyze the load cell signal in the frequency domain. However, the same phenomenon that leads to the extraneous peaks/troughs in the time domain signal leads to higher order harmonics in the frequency domain that are oftentimes more powerful than the frequencies associated with the actual breathing rate. In this paper, we present an algorithm that is able to accurately track respiration rate from non-contact load cell signals using frequency domain techniques that detects higher order harmonics and utilizes harmonic artifact rejection (HAR). We compare this algorithm to respiration rates estimated using a similar algorithm without HAR and with standard PSG estimates of respiration rate.
II. METHODS
A. Subjects
Five subjects (4 female, 1 male) were recruited from individuals undergoing regularly scheduled overnight PSG testing at the Pacific Sleep Program sleep lab (Portland, OR). The mean age was 35.2 ±14.5 years, and the mean BMI was 30.7±7.4 kg/m2. (OHSU eIRB #6308)
B. Setup
A single load cell was placed beneath each of the five supports of the queen sized bed at the sleep lab. Each subject was outfitted with an array of sensors commonly used to monitor sleep during overnight PSG. Specifically, a nasal pressure cannula and thermistor were fitted in their nostrils and belts were placed around their chest and abdomen to monitor breathing. Load cell data was collected concurrently with the PSG sensors during each overnight test. Each subject’s data were visually inspected to select a 2 hour period for analysis that contained quiescent breathing and minimal movement.
C. Respiration Rate (Ground Truth)
Clinical estimation of respiration rate from PSG breathing signals typically involves counting the number of breaths for a specified duration of time and then dividing by that time period to calculate the number of breaths per minute. Following this convention, PSG breathing signals from the nasal pressure cannula, thermistor, and chest/abdomen belts were visually inspected by a technician. The technician manually marked the peak of every breath in the PSG breathing signals during the 2 hour period selected for each subject. The amount of time each breath takes, measured as seconds per breath, was estimated by measuring the time between each consecutive peak (i.e. the inter-peak interval (IPIPeaks). Then, a vector of respiration rates using the IPIPeaks from the PSG signal (RRPSG) was estimated for each subject’s 2 hour segment using:
| (1) |
where RRPSG is measured in breathes per minute. For comparison with respiration rate estimates from the load cell signals, a fifteen second moving window was used to average the values in RRPSG creating a new RRPSG vector containing averaged respiration rate estimates at a 1 Hz sampling rate.
D. Load Cell Respiration Rate (No HAR)
The following steps outline the algorithm used to track respiration rate using the frequency domain without HAR.
Decimate. The data from each load cell, originally collected at a sampling rate of 500 Hz, were decimated to a sampling rate of 10 Hz.
Calculate center of pressure. The data from each load cell was combined to create a center of pressure signal (CoPY) estimated along the long axis of the bed (i.e. y axis). Specifics about calculating CoPY are in [6].
Movement artifact rejection. Movement in the CoPY signal was automatically detected and removed. As part of the movement removal process, the linear trend between movements was subtracted from the load cell signals.
Remove baseline drift. Any remaining baseline wander was further removed using a high-pass 6th order Chebyshev Type II filter with a stopband edge frequency of 0.05 Hz that attenuated the stopband by 40 dB.
Heart rate rejection. Artifacts associated with the high frequency vibrations in the signal caused by the heart beating and the bed/mattress system resonance were removed using a low-pass 7th order Chebyshev Type II filter with a stopband edge frequency of 0.95 Hz that attenuated the stopband by 40 dB.
Data segmentation. The non-movement segments of the CoPY signal were divided into overlapping 15 second windows that were offset by 1 second each.
- Estimate power spectral density. The power spectral density (XCoPy) was estimated with a modified periodogram for each window using:
where Δt is the time between samples, hn is a Hamming window, and f is the vector of frequencies.(2) Select spectral peak. The respiration rate in breaths per minute for each window (i.e. RRCoPy) was estimated as the most powerful frequency peak in XCoPy between the frequencies of 0.1 Hz and 0.6 Hz (representing breathing rates between 6 and 36 breaths per minute (bpm)) multiplied by 60.
E. Load Cell Respiration Rate (HAR)
The algorithm used to estimate the respiration rate using frequency domain techniques with HAR is outlined in the following steps, which returns respiration rate free of harmonics (i.e. RRHAR).
Signal conditioning. Implement steps 1–7 as described in section D.
Find 3 spectral peaks. Find, at most, the 3 frequency peaks in XCoPy with the largest power between 6 and 36 bpm to get, at most, 3 possible respiration rates (rr1, rr2, and rr3) and order the estimates so that rr3 is the highest and rr1 is the lowest rate. Each rr was required to be at least 0.01 times the power of the largest rr.
If one peak, return peak. If there is only one peak frequency leading to one estimate (i.e. rr1), return rr1 as the respiration rate estimate (i.e. RRHAR) for that window.
If two peaks, and no harmonic, return most powerful peak, else return rr1. Test whether or not rr1 is a harmonic of rr2 (i.e. |rr2/2 – rr1| ≤ Δ) where Δ is set to 1 bpm. If the harmonic condition is true, return rr1 as the respiration estimate. If the condition is untrue, return the respiration estimate (i.e. rr1 or rr2) with the corresponding frequency peak that has the most power.
-
If three peaks, use the following rules:
if (5a) else if (5b) else if (5c) else if (5d) else if (5e) else if (5f) else (5g)
The first three conditions above (5a–5c) account for the condition whereby there is one harmonic present and returns the lowest respiration rate that has a higher order harmonic. Condition 5d is when the second spectral peak is double the first and the third is double the second. In this case, it is not likely that the lowest spectral peak is a harmonic, because if it were, the largest peak would be 3 times its rate, not 4. Condition 5e is when the 2nd and 3rd highest frequency peaks are both harmonics of the lowest frequency peak. In this case, the lowest frequency peak is selected. Condition 5f occurs when the two lowest frequency peaks are close to each other and their harmonic is the third peak. The most powerful of the two lowest frequency peaks is selected in this case. And lastly, for condition 5g, if none of the peaks have a harmonic relationship, then the maximum energy peak is returned.
Apply median filter. Filter the vector of estimated respiration rates (RRHAR) with a 31 order median filter.
Select peak rr closest to median. On a point-by-point basis, refer back to the 3 respiration rate estimates from step 2 (i.e. rr1, rr2, and rr3), and adjust the respiration rate estimates in RRHAR to be the estimate (rr1, rr2, or rr3) that is closest to the median filtered respiration rate estimate.
F. Compare Load Cell Respiration Rate Estimates with Ground Truth
The errors (E) between ground truth respiration rate estimates and those estimates found using the load cell data were estimated on a second-by-second basis using:
| (3) |
It should be mentioned that due to factors such as the removal of movement artifacts in the load cell data, there were not respiration rate estimates for every second in the two hour periods. Respiration rate estimates were only compared when there was a valid estimate for both the ground truth and the load cell derived estimate for a particular second.
III. RESULTS
The HAR algorithm worked well in removing higher order harmonics from the breathing signal and enabling a more accurate and robust estimate of respiration for those subjects who exhibited the harmonic phenomena. Fig. 2 shows the errors for the respiration rate estimation both without HAR (E1) and with HAR (E2).
Figure 2.

(Upper) Errors for the respiration tracking algorithm without HAR. (Lower) Errors for the respiration tracking algorithm with HAR.
Notice that for subjects 3 and 4, a higher order harmonic is present in the breathing signal. This harmonic leads to a non-Gaussian distribution of E1 that has a relatively larger variance. This harmonic is removed by the HAR algorithm. The effectiveness of the HAR algorithm is confirmed in Figs. 3 and 4. Notice in Fig. 3, which shows the error of the respiration rate estimation for a 2-hour period for subject 3, that there is a clear error caused by a harmonic. The distribution of the error is bi-modal. The bimodal error distribution is eliminated as shown in Fig. 4 when the HAR algorithm is applied.
Figure 3.

(Upper) Respiration rate estimates using CoPY for subject 3 with no HAR are displayed as the green circles. Respiration rate ground truth is displayed as the black line. (Lower) Histogram illustrating the error (E1) between RRPSG and RRCoPy.
Figure 4.

(Upper) Respiration rate estimates using CoPY for subject 3 with HAR are displayed as the green circles. Respiration rate ground truth is displayed as the black line. (Lower) Histogram illustrating the error (E2) between RRPSG and RRHAR.
IV. DISCUSSION
In this paper, we have demonstrated that selecting the largest amplitude spectral peak of a breathing signal estimated using load cells is not sufficient for obtaining an accurate estimate of respiration rate (Figs. 1, 2, 3). The HAR algorithm that we present herein is effective at identifying and removing harmonics from the breathing signal. This is evident especially for subjects 3 and 4 in Fig. 2. While respiration rate estimation for subjects 1, 2, and 5 appear to benefit little from HAR, subject 3 and 4 contain significant power at the respiration rate harmonic across the 2 hour period and accurate respiration rate estimation is only achieved with the HAR algorithm. The errors (E1) in Fig. 3 show that for subject 3 the harmonic is estimated almost as frequently as the actual respiration rate when no HAR is used. Once the HAR algorithm is applied, Fig. 4 shows how well we can track respiration rate using the CoPY load cell signals. In the future, we expect that being able to accurately track respiration across short time windows will enable more robust sleep apnea detection and potential identification of individual apnea events.
Acknowledgments
The authors would like to thank John Hunt for his expertise in designing and building the load cell system.
The project described was supported by Grant Number 2 R01HL098621-04A1 from the National Heart, Lung, and Blood Institute. The content is solely the responsibility of the authors and does not necessarily represent the official views of the National Heart, Lung, and Blood Institute or the National Institutes of Health.
The project was also supported in part by Grant Number P30AG024978.
Contributor Information
Zachary T. Beattie, Division of Sleep Medicine, Department of Psychiatry, Oregon Health & Science University, Portland, OR 97239 USA
Peter G. Jacobs, Email: hagench@ohsu.edu, Division of Sleep Medicine, Department of Psychiatry, Oregon Health & Science University, Portland, OR 97239 USA.
Thomas C. Riley, Email: jacobsp@ohsu.edu, Department of Biomedical Engineering, Oregon Health & Science University, Portland, OR 97239 USA.
Chad C. Hagen, Email: rileyt@ohsu.edu, Department of Neurology, Oregon Health & Science University, Portland, OR 97239 USA.
References
- 1.Redline S, Budhiraja R, Kapur V, Marcus CL, Mateika JH, Mehra R, Parthasarthy S, Somers VK, Strohl KP, Sulit LG, Gozal D, Wise MS, Quan SF. The scoring of respiratory events in sleep: reliability and validity. J Clin Sleep Med. 2007;3:169–200. [PubMed] [Google Scholar]
- 2.Young T, Palta M, Dempsey J, Skatrud J, Weber S, Badr S. The occurrence of sleep-disordered breathing among middle-aged adults. N Engl J Med. 1993;328:1230–5. doi: 10.1056/NEJM199304293281704. [DOI] [PubMed] [Google Scholar]
- 3.Young T, Evans L, Finn L, Palta M. Estimation of the clinically diagnosed proportion of sleep apnea syndrome in middle-aged men and women. Sleep. 1997;20:705–6. doi: 10.1093/sleep/20.9.705. [DOI] [PubMed] [Google Scholar]
- 4.Agnew HW, Jr, Webb WB, Williams RL. The first night effect: an EEG study of sleep. Psychophysiology. 1966;2:263–6. doi: 10.1111/j.1469-8986.1966.tb02650.x. [DOI] [PubMed] [Google Scholar]
- 5.Le Bon O, Staner L, Hoffmann G, Dramaix M, San Sebastian I, Murphy JR, Kentos M, Pelc I, Linkowski P. The first-night effect may last more than one night. J Psychiatr Res. 2001;35:165–72. doi: 10.1016/s0022-3956(01)00019-x. [DOI] [PubMed] [Google Scholar]
- 6.Beattie ZT, Hagen CC, Hayes TL. Classification of lying position using load cells under the bed. Conf Proc IEEE Eng Med Biol Soc. 2011:474–7. doi: 10.1109/IEMBS.2011.6090068. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 7.Austin D, Beattie ZT, Riley T, Adami AM, Hagen CC, Hayes TL. Unobtrusive classification of sleep and wakefulness using load cells under the bed. Conf Proc IEEE Eng Med Biol Soc. 2012:5254–7. doi: 10.1109/EMBC.2012.6347179. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 8.Beattie ZT, Hagen CC, Pavel M, Hayes TL. Classification of breathing events using load cells under the bed. Conf Proc IEEE Eng Med Biol Soc. 2009;2009:3921–4. doi: 10.1109/IEMBS.2009.5333548. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 9.Beattie ZT, Hayes TL, Guilleminault C, Hagen CC. Accurate scoring of the apnea-hypopnea index using a simple non-contact breathing sensor. J Sleep Res. 2013;22:356–62. doi: 10.1111/jsr.12023. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 10.Brink M, Muller CH, Schierz C. Contact-free measurement of heart rate, respiration rate, and body movements during sleep. Behav Res Methods. 2006;38:511–21. doi: 10.3758/bf03192806. [DOI] [PubMed] [Google Scholar]
- 11.Paalasmaa J, Leppakorpi L, Partinen M. Quantifying respiratory variation with force sensor measurements. Conf Proc IEEE Eng Med Biol Soc. 2011:3812–5. doi: 10.1109/IEMBS.2011.6090773. [DOI] [PubMed] [Google Scholar]
