Pocketlab Step Counter (accelerometer CSV)
Count steps in an accelerometer recording: steps, cadence, distance and steps per minute.
How it works
Counts the steps in a phone or wearable accelerometer recording, the same way the Pocketlab step counter does live: paste or upload a CSV with a time column and one to three acceleration columns. You get the number of steps, the walking cadence, an estimated distance from your step length, steps per minute and a chart with every detected step.
- The magnitude of the acceleration √(x² + y² + z²) is taken, so the phone may sit in any orientation. A 1-second moving average (gravity and slow movements) is subtracted and the rest is smoothed over about 0.12 s.
- A step is a local maximum above an adaptive threshold (a share of the signal's standard deviation set by the sensitivity, at least 0.5 m/s²). Peaks closer than 0.25 s count once (the higher one); single peaks without a neighbouring step within 2 s are bumps, not walking.
- Cadence = 60 / median time between steps. Distance = steps × step length — an estimate, because step length changes with speed and slope.
A phone in a bag, a hand or a pocket moves differently; on even ground counts are usually within a few percent, but shuffling, stairs, cycling and car rides give wrong counts. Not a medical or fitness device.
Sources
Part of Pocketlab
-
Pocketlab Phone sensor instruments & measurement log
Your phone as 14 pocket instruments, with a measurement log you can export and share.
Related tools
- Pocketlab Seismograph (accelerometer CSV → peaks and events) – Peak and RMS shaking, a seismogram trace and STA/LTA events from an accelerometer recording.
- Pocketlab Vibration Spectrum (accelerometer CSV) – Accelerometer CSV in, vibration spectrum out: peak frequencies, amplitudes, rpm and RMS.
How to use the Pocketlab Step Counter
Count the steps in an accelerometer recording, with cadence, a distance estimate and steps per minute — the same counter as the Pocketlab app.
What it is for
You recorded your phone's accelerometer during a walk — with Pocketlab, a sensor logger app or a data logger — and want to know how many steps are in it. This tool reads the CSV (a time column and one to three acceleration columns) and counts the steps. It also gives the cadence in steps per minute, a distance estimate from your step length and a table of steps for every minute.
It uses the same counter as the step counter in Pocketlab. A walk recorded there and downloaded as CSV gives the same count here, so you can check a recording again with another sensitivity or step length.
It does not replace a fitness tracker, and it does not estimate calories or health values. It counts peaks in the movement signal, nothing more.
Worked example
The tool's first example is one minute of walking at 50 samples a second, phone in a trouser pocket. With Step length set to 0.74 m and Sensitivity 5 the tool reports:
- Steps: 108
- Cadence: 107.1 steps/min
- Distance (estimate): 79.9 m
- Duration: 1:00, Sample rate: 50.0 Hz
The summary reads "108 steps in 1:00 at 107 steps a minute, about 80 m with a 0.74 m step". The step table has a single row, minute 1 with 108 steps.
At sensitivity 1 the result is the same 108 steps, but the threshold rises from 0.5 to 0.749 m/s². The steps in this recording are clear, so the count does not change. In a shaky recording, the sensitivity is what decides whether light bumps count.
The second example, a phone lying on a table, finds no steps and warns that no walking was found.
How to read the result
Steps is the main number. Cadence uses the median time between steps, so a short stop at a crossing does not pull it down — that is why it can differ slightly from steps divided by minutes. Distance is simply steps × step length, so it is only as good as the step length you type in.
The step signal chart shows the smoothed acceleration with gravity removed. Every peak above the threshold is one step. The Steps per minute table helps you find the parts of a long recording where you actually walked.
The result also lists the threshold in m/s² and the detected sample rate. Phones usually record 50 samples a second or more; very low rates smear the steps together.
Tips and common mistakes
- Measure your step length once: walk ten steps, measure the distance and divide by ten. The 0.7 m default is only a typical value.
- Set Acceleration unit to g when your logger writes values around 1.0 instead of 9.8 — otherwise every number is ten times too small.
- If the time column is in milliseconds and the header does not say so, set Time unit by hand.
- A phone held in the hand while you look at it counts worse than one in a pocket. Swinging a bag can add steps.
- Stairs, shuffling, cycling and car rides give wrong counts. Cut those parts out of the CSV before counting.
- Raise the sensitivity only when the count is clearly too low; a high sensitivity also counts small jolts.
FAQ
How accurate is the count?
On even ground with the phone in a pocket, counts are usually within a few percent. Very slow walking, a phone in a loose bag or a lot of stopping make it worse.
Which files can I use?
Any CSV or text file with a time column and acceleration columns, separated by commas, semicolons or tabs. The Pocketlab vibration meter, seismograph and step counter all write the same time_s,ax,ay,az format.
Why is the cadence not exactly steps per minute?
Cadence is 60 divided by the median gap between steps. It describes your walking rhythm, while steps divided by the total time also counts pauses.
Does it work with a smartwatch recording?
Yes, if you can export the raw accelerometer as CSV. Arm swings look different from hip movement, so try a lower sensitivity first.
Guide last updated:
For scripts and AI agents
- JSON API:
POST https://pocketlabstepcounter.usefulweb.app/api/v1/calculate(same calculation as this page) - Interface description: OpenAPI 3.1 · AI guide: llms.txt
- MCP server (Streamable HTTP):
https://pocketlabstepcounter.usefulweb.app/mcp· tool namepocketlab_step_counter
Example request
curl -s -X POST https://pocketlabstepcounter.usefulweb.app/api/v1/calculate \
-H 'content-type: application/json' \
-d '{…see OpenAPI examples…}'