← Reliefr

Behind the algorithm

How it decides you need a laugh.

If you've switched on “When stressed,” the app reads heart-rate signals from Health Connect to work out when you might genuinely need one. Here is exactly how — including the part most stress trackers get wrong.

Sleep RHR · 42
Awake baseline · 56
Fires above · 76

Step one

42BPM

Your watch reports one number.

Sleep-derived resting heart rate — the daily figure Garmin, Pixel Watch, Galaxy Watch, Fitbit, Whoop and Apple Health already compute. We take the median of the last seven days.

Step two

But that isn't your resting state.

Sleep RHR is the lowest heart rate of your night — typically 10 to 25 bpm below where you sit during a normal awake, seated day. Compare a stress threshold against it and you are measuring from the wrong floor.

Step three · +14

So add the gap your fitness predicts.

The Fenland Study measured awake-seated HR at 67.6 bpm against sleeping HR of 56.9 in the same 10,865 people — and the gap widens with fitness.7 Athletes get +14. Sedentary users get +8.

Step four · +20

Then the jump the lab actually measured.

Across 171 Trier Social Stress Test studies covering 8,452 healthy adults, a mental-arithmetic stressor lifts heart rate about +20 bpm above an awake-seated baseline.12 Not a percentage. A fixed jump.

The result

76BPM

That's the line.

Built from your body, not from a population average. A sedentary colleague's line sits at 98. Same algorithm, same physiology, different numbers.

Part 1 · Inputs

Three signals, read on your phone.

Health Connect is Android's privacy-respecting bridge between fitness apps. When you grant permission, the algorithm reads exactly three things from it — and nothing else.

Sleep-derived resting HR

The daily figure your watch already computes. We take the median of the last seven days, so one bad night doesn't move your baseline.

Recent heart rate

The last 60 minutes of samples — stretched to 180 if your wearable hasn't synced, because Garmin Connect batch-syncs every few hours.

Exercise sessions

When your last workout ended. Inside 60 minutes, stress evaluation is skipped entirely — that's recovery, not anxiety.

Nothing leaves the device

The full evaluation runs in process memory on your phone. Health Connect data is read, one decision is made, the data is discarded. No heart rate, sleep or workout history ever touches a server. In the app, Settings → Privacy → Your data shows a live inventory of everything held about you.

Part 2 · The trap

Two ways to get the baseline wrong.

The percentage trap. The intuitive approach is “flag stress when current HR runs more than 30% above resting.” Plenty of older stress trackers did exactly this. It sounds reasonable, and it is quietly broken for anyone whose resting heart rate isn't average.

Take an endurance athlete resting at 42 bpm. Simply sitting upright at a desk puts them at 55 — already 31% above baseline. The percentage model fires all day. A sedentary user at 70 doesn't trigger until 91. Same algorithm, wildly different sensitivities, both wrong.

The wrong-baseline trap. Switching to an absolute offset is the right structural move — sympathetic activation produces a roughly user-independent jump, not a fractional one. But it leaves a second question: above what? Comparing a TSST-derived +20 against sleep RHR over-triggers for fit users and slightly under-triggers for sedentary ones. The fix is the chain you just scrolled through.

Sleep RHR
Awake baseline
Fires here
Old % model
Live 60 bpm · resting Correct — quiet while calm
Switch to the endurance athlete and turn on the % model: it sits below their normal upright heart rate, so it would fire continuously while nothing at all is happening.
Sleep resting HR42 bpm
Fitness-scaled gap+14
Estimated awake-sedentary baseline56 bpm
TSST offset at this sensitivity+20
Fires above76 bpm

Part 3 · The numbers

+20 bpm above awake calm.

The Trier Social Stress Test is the most widely validated laboratory paradigm for inducing acute psychological stress. Across every age, sex, fitness level and ethnicity studied, the heart-rate response is remarkably consistent.

Stressor taskMean HR increase above awake-seated baseline
Mental arithmetic challenge+20 bpm — our medium sensitivity
Public speaking task+25 bpm — our low sensitivity
Combined TSST protocol+26 bpm mean across all studies

The effect size in healthy adults is 0.96 — which in research terms means the response is close to universal. Virtually everyone reacts.3 Crucially, in every one of those studies the increase was measured from a seated five-minute pre-task baseline: awake calm, not sleep. That is the comparison point Reliefr uses.

High sensitivity drops the offset to +15 to catch milder reactions. Low raises it to +25 so only heavier ones register.

The gap table

Your awake baseline is estimated from sleep resting HR plus a population-norm gap that scales with fitness:7

Your sleep resting HREstimated awake-sedentary gap
Under 50 bpm — athletic+14 bpm
50–59 bpm — fit+11 bpm
60–69 bpm — average+10 bpm
70+ bpm — sedentary or older+8 bpm

Athletes get a larger gap than sedentary users, which is exactly how the physiology works: fitter people have more parasympathetic dominance at rest and a larger sympathetic response on standing.

The same event, three bodies

Three users hitting an identical stress level — mental arithmetic during a difficult meeting, medium sensitivity:

UserSleep RHRAwake baselineThresholdHR during stressFires?
Endurance athlete4256 (42+14)7676Yes
Recreational fit5869 (58+11)8989Yes
Sedentary office7078 (70+8)9898Yes

Same physiological event. Same algorithm. Different absolute numbers, because the people are different — and a normal upright office heart rate of 60 no longer trips the athlete's threshold the way it did in earlier versions.

Part 4 · The guard rails

Three reasons it stays quiet.

60′

Workouts get a pass

Heart rate stays elevated for up to 30 minutes after a stressor ends, and exercise recovery runs longer.4 If your last workout finished within the hour, stress evaluation is skipped entirely. Better to miss a real moment than fire as you leave the gym.

+40

Movement is filtered out

Any sample above resting +40 bpm is dropped from the recent-window average. Walking briskly across the office is movement, not anxiety — filtering it keeps the average honest.

70

A hard absolute floor

Nothing fires below 70 bpm in the recent window, whatever the delta says. Below 70 you are effectively not in sympathetic arousal — post-stress TSST heart rate sits at 78–82.

Part 5 · Honest limitations

Best effort, not a clinical instrument.

Heart-rate-based stress detection running passively in the background is not an instrument-grade signal. Caffeine, hurrying up a flight of stairs, an animated conversation, a tense email exchange — any of these can lift your heart rate enough to fire a delivery when nothing about your day genuinely qualifies as stressful.

We accept that trade. The alternative is asking you to tell the app when you're stressed, which defeats the entire point of a passive trigger. And practically: an unexpected joke is not the worst thing that can happen to your afternoon.

If a delivery feels wrong, dislike it on the card. The algorithm learns from your ratings and tunes what fires when.

What this page is not claiming

That heart rate equals stress. That the app can distinguish excitement from anxiety. That any of this is diagnostic. It is a timing heuristic built on published population data, tuned by your own ratings — nothing more, and we would rather say so here than imply otherwise.

Keep reading

Why humor, though?

Sources

References

Every citation on this page links to the original peer-reviewed source.

  1. Allen AP, Kennedy PJ, Cryan JF, Dinan TG, Clarke G. Biological and psychological markers of stress in humans: Focus on the Trier Social Stress Test. Neuroscience & Biobehavioral Reviews (2014). pmc.ncbi.nlm.nih.gov
  2. Helminen E et al. Physiological and psychological responses to acute stress: A meta-analysis of 171 studies of the Trier Social Stress Test including 8,452 healthy adults. Psychoneuroendocrinology (2025). sciencedirect.com
  3. Petrowski K, Schmalbach B, Kliem S, Hinz A, Brähler E. The Trier Social Stress Test elevates blood pressure, heart rate, and anxiety. Psych (2021). mdpi.com
  4. Kudielka BM, Buske-Kirschbaum A, Hellhammer DH, Kirschbaum C. Differential heart rate reactivity and recovery after psychosocial stress (TSST). International Journal of Behavioral Medicine. link.springer.com
  5. Schubert C, Lambertz M, Nelesen RA, Bardwell W, Choi JB, Dimsdale JE. The persistent effect of acute psychosocial stress on heart rate variability. EXCLI Journal. pmc.ncbi.nlm.nih.gov
  6. Kim HG, Cheon EJ, Bai DS, Lee YH, Koo BH. Stress and heart rate variability: A meta-analysis and review of the literature. Psychiatry Investigation (2018). pmc.ncbi.nlm.nih.gov
  7. Gonzales TI, Westgate K, Strain T, et al. Resting heart rate as a biomarker for tracking change in cardiorespiratory fitness: the Fenland Study. Population-based study, n=10,865. pmc.ncbi.nlm.nih.gov