Last updated: 2026-09-11 Status: active. Everything in this repo is measured against this doc.
An app that tells you the RPM of a running combustion engine from its sound. Point the phone at the engine, record a few seconds (or pick a recording you already have), press Calculate, read one number.
Target engines: simple ones. Single cylinder, not running too smoothly, e.g. a motorcycle or generator at idle. Multi-cylinder engines are out of scope for the MVP.
No backend. No account, no login. Everything runs on the device.
One codebase for both; see Stack.
Both paths produce a 16 kHz mono buffer that the user can play back. The user then crops it, with the waveform visible, to the clearest section. Cropping is always shown and the analysed window is capped at 10 s, so long files are handled by picking a window, not by rejecting them. Mic capture runs with echo cancellation, noise suppression and auto gain off.
Reference method (from the sample analysis, ~/git/rpm-boss/audio/combustion-counts.md):
mono 16 kHz, Butterworth bandpass 60-2000 Hz, full-wave rectify, lowpass 150 Hz
envelope, then (B) autocorrelation per 1 s window, lag range 8-100 pulses/s,
median across windows; cross-checked by (A) peak counting with
find_peaks(distance = 0.6 * sr / rate, prominence = 0.5 * std).
Both agree within ~3 % on all seven samples. RPM = pulses/s x 60 x
(revolutions per pulse: 2 for 4-stroke, 1 for 2-stroke).
Seven recordings of a single-cylinder 4-stroke at idle, 6-16 s each, AAC 48 kHz
stereo, in ~/git/rpm-boss/audio/, with independently verified pulse counts in
combustion-counts.md (1400-1800 RPM). These are the test fixtures. Every
change to the analysis is judged by the test suite over these files; the
tolerance is set per file from the A/B agreement in that table.
One screen, one grid, two layouts. The same seven parts in the same DOM order; only where they sit changes.
There is one waveform, not two. When a result arrives the crop canvas zooms to the analysed window and draws a mark on every combustion, so the number and the evidence for it are the same picture. Touching the waveform widens the view again.
Stacked below 600 px, or on any screen taller than it is wide: the parts in the order above, one column.
Split at 600 px and wider in landscape: a control column beside a signal column. The switch is width and shape, because a waveform gains almost nothing from height and everything from width. Phase 8 measured what happens otherwise: a portrait tablet took the landscape layout and the whole app collapsed into a band across the middle of the screen.
Dark by default; light is a choice, not the device's. Urdu mirrors the whole
layout from one dir attribute, because grid columns follow the inline
direction.
Float32Array, no DOM
dependency. Ported from the scipy reference. Runs in a Web Worker in the app
and in Node under test.decodeAudioData for files (incl. MP4 audio track),
MediaRecorder + getUserMedia for recording.Rejected: Flutter (web would be second-class, and web is the test loop), Python on device (not shippable), essentia/librosa-style WASM libraries (method does not need them).
Video input with crop-and-preview, noise reduction, user-marked combustions, live tachometer without recording, tachometer gauge UI, named/grouped results per vehicle, multi-cylinder presets, the 4-stroke / 2-stroke preset.