Cornish Reps back to the site

How a rep gets counted

The count does not come from sound or from a camera. There is a motion sensor in the earbud, iOS hands over acceleration, head angle and rotation rate, and the app looks for reps in that line. Here is what the line is, how a number comes out of it, and where it lies. The recordings are real, and you can download them and look for yourself.

What the earbud gives you

iOS delivers a CMDeviceMotion stream from the sensor in the earbud: about fifty frames a second, each with acceleration on three axes, the head rotation quaternion and the rotation rate.

The app takes three things from it. Acceleration along the gravity vector: your body going down and coming back up. Head pitch: where your head points relative to the horizon. Gravity along the ear axis: whether you are lying down or standing.

Two ways to count

Sit-ups and knee push-ups are counted by head angle. The whole torso rotates, tempo does not matter, and body wobble barely shows up in the angle. A rep lands on the way back from the bottom: when the angle has travelled back far enough and the swing from the previous top is big enough. There are no absolute thresholds here, because one person's top is lower than another person's bottom.

Push-ups, squats and pull-ups are counted by acceleration along gravity. Each has its own threshold: 0.15 G for squats, where the signal is huge, 0.06 for push-ups, 0.07 for pull-ups. Squats and push-ups run a three-phase cycle, down, drive, return, and the rep lands on the return to the starting position rather than at the bottom.

Sit-ups: 22 reps in a row

A steady set with no pauses. Every dip is one crunch, and the tick marks are the moments the app counted. The bottoms wander in depth while the count stays even: it looks at the swing and the return, not at an absolute level.

situps-live: 22 повторений за 63.2 секунд

Why one threshold is not enough

An amplitude threshold catches any movement of roughly the right size. Getting into position, sitting up, drinking, reaching for the phone, shaking your head: all of it produces a cycle of the right swing. So there are gates on top of the threshold, and each one grew out of a specific recording where the count lied.

A posture gate. Push-ups happen head down: on real reps gravity along the ear axis sits at 0.55 and up, while false counts arrive from standing or sitting, where it is near zero. Squats are the opposite, done with a level head, and bending to pick something off the floor used to count as a rep.

A rotation gate. Shaking, nodding and turning rotate the head: the median rotation rate runs 1.4 and up. A real rep travels in a line, at 0.85 and below. Sit-ups have no such gate: lying down, the head is allowed to rotate.

A cycle length gate. A real crunch takes between 0.5 and 2.4 seconds. Settling into position, drinking and staring at the phone take 2.6 and more.

An energy gate. A false cycle is thin: the threshold is crossed but there is no area under the curve. A minimum area throws out noise on a weak signal.

A refractory period. After a rep the next one cannot land for 0.6 seconds on push-ups, or 1.2 on squats.

Push-ups: coming out of the plank

A recording from tuning the posture gate. Late in the set the person sinks back and tries to push up from a half-sitting position. The amplitude still looks similar, gravity along the ear axis drops, and the count stops.

pushups-outofpose: 9 повторений за 48.2 секунд

Knee push-ups: the start of a set

Lowering from standing into position takes two to four seconds and produces a bigger angle cycle than a rep does. That setup used to be counted while the first real rep was lost. The fix is a sliding window for the top of the cycle, plus a requirement that the return from the bottom be a fraction of the swing and not only an absolute number.

knees-falsestart: 8 повторений за 23.8 секунд

Squats: pauses

Between reps the person stands and breathes. The counter does not lose its place: the phase resets only after more than six seconds stuck mid-cycle.

squats-pauses: 21 повторений за 78.9 секунд

Where the count is wrong

The thresholds come from recordings of my own workouts and a couple of friends', all on AirPods Pro. Other models have had less field time, and the count can drift on them.

Weak and very slow reps get lost: the swing never reaches the threshold. Tired crunches dip shallower, and the threshold is already lowered for them, but there is a floor.

Extra counts come from movements that look like the exercise: shifting your body, warming up, stretching during a pause.

You can fix a set out loud: plus N, minus N. That is not a crutch, it is part of the deal. The counter estimates a movement rather than measuring it.

If a model is off every time, export the CSV from the counter screen and send it to hi@cornishreps.com. One recording helps more than any description in words.

The recordings

The four recordings from the charts above, straight off the phone. Each row holds the timestamp, acceleration on three axes, gravity, head angle, rotation rate, the smoothed signal, the gate state and the count at that moment.

There is nothing personal in them: sensor numbers and timestamps only.

Get it on TestFlight

iOS 18 and up. Free, no account needed. Still in testing, something may not work