A JS Cadence Sensor
signal-processing
At some point during the pandemic, I became suspicious about the accuracy of my Saris H3 cadence sensor, so I wrote my own. (It turns out that the cadence sensor is fine.)
RPM:
How it works
The algorithm is embarrassingly simple for how well it works:
- Capture the time series of the accelerometer data (with a 1s half-life exponential decay),
- compute the PCA, and extract the first principal component. You now have a 1D time series
- Compute the FFT, and find the period with largest energy.
Smartphones: supercomputer processing power, tricorder sensors. Amazing stuff.