/ magland / rip-sound-analyzer
Sign in
magland / rip-sound-analyzer
rip-sound-analyzer / README.md
43 lines · 3.2 KBPreviewCodeBlameHistoryRaw
1# Rip Sound Analyzer
3A small browser app for studying the sound of tearing paper. Record yourself tearing a strip off an 11 inch sheet at different speeds, label each recording with its speed, and compare.
5The working idea: a tear is a rapid sum of tiny, similar clicks. If so, tearing faster packs the same clicks into less time, and two things should not depend on speed:
71. the total sound energy of the tear, and
82. its frequency makeup.
10The app measures both for every recording and shows how they change with tear duration.
12## Running
14```bash
15npm install
16npm run dev
17```
19Open the printed localhost URL in Chrome. Everything runs in the browser; recordings are stored in the browser's IndexedDB. There is no server and no account.
21`npm run build` produces a static site in `dist/` that can be hosted anywhere (HTTPS is required for microphone access, except on localhost).
23`npm test` runs sanity checks of the analysis (Parseval, synthetic tears of different durations giving the same energy and spectrum, WAV round trip).
25## What it does
27- **Record**: a list of samples, each one tear at whatever speed you choose, sorted slowest first by measured tear duration. Add a new sample, re-record or delete one, and give it an optional name and notes. Capture is raw: Chrome's echo cancellation, noise suppression and auto gain are off, and samples come straight from the audio graph via an AudioWorklet at the mic's own sample rate (32-bit float, no compression). For each sample:
28 - **Tear range**: level in the analysis band, waveform (filtered to the analysis band by default, or raw) and spectrogram on one zoomable time axis. The range is found automatically from the clicks in the filtered waveform (short separate sounds such as key presses are left out and listed, with a button to take them in); drag across any of the three plots to mark it again, drag its edges, or type start/end times. Play the tear (with a moving playhead) or the whole recording.
29 - **Results**: duration, speed, energy, mean power, peak/clipping, level above background.
30 - **Frequency makeup**: the tear's energy spectrum against the background.
31- **Export / import**: “Export dataset” saves every sample and the analysis settings to one .zip (`dataset.json` plus a 32-bit float WAV per sample). “Import dataset…” replaces everything in the browser with such a file, after confirming.
32- **Compare**: all samples, coloured by tear duration (stronger = faster): energy vs tear duration, loudness (mean power) vs duration, spectra of all speeds overlaid (optionally shape only), a table and CSV export.
34Analysis band (set under Analysis settings), default 10–20 kHz: used for total energy, finding the tear, the level plot, the optional filtered waveform, the background comparison and normalising spectra, because lower frequencies carry much more room and handling noise. Spectra are still drawn over the full range for context.
36The “What this can tell you” tab in the app explains the method and its limits.
38## Layout
40- `src/analysis/` – FFT, tear detection, spectra, energy
41- `src/audio/` – microphone capture, WAV encode/decode, synthetic tears
42- `src/storage/` – IndexedDB, dataset export/import (uncompressed zip)
43- `src/components/` – UI, including a small canvas plotting component
↑↓ move↵openescclose