← Back to MedBug MedBug insights
23 Jul 2026 · 6 min read

Can your mattress read your heartbeat?

Turns out — pretty precisely. Here's how an under-mattress sensor learned to tell a real heartbeat from a rustling doona, down to the beat.

MedBug heart-rate and respiratory signals compared with reference ECG, including instantaneous HR tracking

Mattress signal vs hospital ECG — the top traces show the under-mattress pulse next to the reference heartbeat; the bottom plot is instantaneous heart rate from both. When the night is quiet, the two stay locked almost beat for beat.

Heart rate and breathing rate sound like the most basic vital signs in medicine — and they are. But outside a hospital or a smartwatch strapped to your wrist, almost nobody actually measures them properly, overnight, for free, night after night. That's the gap this project is trying to close: can a sensor hidden under your mattress read both, accurately enough to matter clinically, without you doing anything at all?

This system estimates heart rate and breathing rate from tiny mattress vibrations — no straps, no watch, no skin contact — then compares those estimates against hospital-grade ECG and airflow in the same night.

Why bother with breathing rate?

Heart rate gets all the attention — every smartwatch has an LED for it. Breathing rate is quietly more informative and far less measured. During sleep, both drift with sleep stage, react to arousals, and spike around respiratory events. In particular, the little burst of heart-rate acceleration right after an apnoea ends isn't just noise — it's an autonomic nervous system fingerprint, and its size has been linked to cardiovascular risk independent of the plain old apnoea count.

Average heart rate around sleep apnoea onset and offset for one participant, showing a dip during the pause and a rebound when breathing resumes

Heart rate around a breathing pause — average of many events, one person. Left: in the lead-up to the pause (dashed line = start), heart rate dips a little as the event runs, from a baseline that was already high. Right: when the pause ends (dashed line = end), heart rate jumps fast, overshoots, then settles. Shaded bands show how much the average varies. This is the shape a mattress sensor has to match beat by beat — not just a single number for the whole night.

Teaching an algorithm what a heartbeat feels like

The mattress strip actually has two dedicated channels — one hardware-tuned to pick up the big, slow sway of breathing, and one tuned to the much smaller, faster mechanical thump of each heartbeat. The tricky part isn't detecting a peak; it's knowing when not to trust one. A rolling artifact score — built from nine separate signal-quality features like jerk, baseline shift, and spectral flatness — quietly withholds an estimate whenever a window looks more like a shuffle than a heartbeat.

When the signal is clean, heart rate comes from a "harmonic Bayes" search: the algorithm doesn't just grab the strongest frequency peak, it checks whether that peak's harmonics line up too, then folds in a gentle prior that heart rates cluster around 72 bpm. Breathing rate uses two independent methods — a frequency-spectrum estimate and an autocorrelation estimate — and only reports a number when the two agree.

Still vs a full night

Controlled wakefulness is the easy mode — stable position, minimal movement. A real night, in 120 people mostly referred for suspected sleep apnoea, is the opposite: body-position changes, limb movements, arousals, and constantly shifting mattress loading.

Lying still · Study 1 · N=19
  • Heart rate MAE 0.74 bpm vs ECG
  • Breathing rate MAE 0.42 /min vs airflow
  • Correlation r = 0.99 for both
Overnight sleep · Study 2 · N=120
  • Heart rate MAE 3.41 bpm (r = 0.888)
  • Breathing rate MAE 0.57 /min (r = 0.934)
  • Bias near zero for both signals
3.41 bpm
Overnight heart-rate MAE
0.57 /min
Overnight breathing-rate MAE
+0.40 bpm
Heart-rate bias
−0.01 /min
Breathing-rate bias

MAE = mean absolute error vs reference. Bias near zero means residual error is mostly intermittent detection noise, not a fixed calibration offset.

Breathing rate turned out to be the easier of the two signals to track overnight — which makes physical sense. The chest's breathing motion is a big, slow, low-frequency displacement, easy to separate from noise. A heartbeat's mechanical signature is far smaller and more dependent on body position and physique, so it's more vulnerable to a shifted sleeper or a heavy doona.

"The near-zero overnight bias for both HR and RR indicates that residual error was not driven by fixed calibration offsets — the wider limits of agreement are more consistent with intermittent, subject- and segment-specific detection errors." — According to Chief Engineer Phuc Nguyen

The part that actually surprised us: beat-by-beat

Reporting one average heart rate for the whole night is the easy version of this problem. The harder — and more clinically useful — version is tracking every single beat-to-beat fluctuation, especially the sharp acceleration that follows a respiratory event ending. Averaged across the cohort, instantaneous tracking held a median correlation of r = 0.78 against ECG, and in a representative recording it reached r = 0.985 with an error of under 1 bpm.

Critically, when the team lined up hundreds of respiratory events and averaged the heart-rate trace around each one, the non-contact system reproduced the same shape ECG did — both the big, dramatic surges and the smaller, subtler ones. That's the detail a nightly average would completely erase.

···

The honest caveats

Where this goes next

The headline result isn't just "a mattress can estimate heart rate" — plenty of devices can. It's that this system knows when to stay quiet rather than guess, and when it does speak, it's precise enough to catch the fine print: the individual heartbeat response to a blocked airway, not just the nightly average. That's the difference between a wellness gadget and something that could eventually support real sleep phenotyping, at home, night after night.

Quick answers

Is this the same as heart-rate variability (HRV)?

No. This paper validates heart rate and breathing rate — including beat-to-beat heart-rate tracking around respiratory events. HRV is a related but separate analysis of variation between beats; it is not the primary endpoint here.

How does a mattress sense a heartbeat?

Each heartbeat produces a tiny mechanical impulse that travels through the body into the mattress. Dedicated channels pick up that ballistocardiographic signal alongside larger breathing motion, then an artifact score decides when the window is clean enough to report.

Why is overnight error higher than lying still?

Overnight sleep includes turns, arousals, and shifting body load. The algorithm withholds estimates during messy windows, so remaining error is mostly intermittent detection noise — not a systematic offset (bias stays near zero).

Is this a clinical product yet?

These results are research validation against concurrent reference signals. They support further phenotyping work; they are not a cleared medical device claim for diagnosis or treatment decisions.

non-contact sensing heart rate respiratory rate ballistocardiography signal quality
Source: "An Interpretable Algorithm for Contactless Vital Sign and Beat-to-Beat Cardiac Monitoring" — Nguyen, Vakulin, Lechat, Reynolds, Eckert, Nguyen & Catcheside. Flinders Health & Medical Research Institute, Sleep Health, Flinders University, South Australia.