/ magland / rip-sound-analyzer
Sign in
magland / rip-sound-analyzer
rip-sound-analyzer
Go to fileHistoryFork
scriptsDrop median frequency and centroid
srcAdd a button to clear all samples from the browser
.gitignoreRip Sound Analyzer: record tears, inspect one, compare across speeds
index.htmlRip Sound Analyzer: record tears, inspect one, compare across speeds
package-lock.jsonRip Sound Analyzer: record tears, inspect one, compare across speeds
package.jsonRip Sound Analyzer: record tears, inspect one, compare across speeds
README.mdOpen-ended samples instead of fixed speeds
tsconfig.jsonRip Sound Analyzer: record tears, inspect one, compare across speeds
vite.config.tsRip Sound Analyzer: record tears, inspect one, compare across speeds

Rip Sound Analyzer#

A 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.

The 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:

  1. the total sound energy of the tear, and
  2. its frequency makeup.

The app measures both for every recording and shows how they change with tear duration.

Running#

npm install
npm run dev

Open 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.

npm run build produces a static site in dist/ that can be hosted anywhere (HTTPS is required for microphone access, except on localhost).

npm test runs sanity checks of the analysis (Parseval, synthetic tears of different durations giving the same energy and spectrum, WAV round trip).

What it does#

  • 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:
    • Tear range: found automatically; drag across the level plot to mark it again, drag its edges, or type start/end times. Play the tear (with a moving playhead) or the whole recording.
    • Results: duration, speed, energy, mean power, peak/clipping, level above background.
    • Close-up: waveform and spectrogram, with zoom buttons, to look for individual clicks.
    • Frequency makeup: the tear's energy spectrum against the background.
  • 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.

Two frequency bands (set under Analysis settings): the energy band, default 15–20 kHz, is used for total energy, finding the tear, the level-over-time plot and the background comparison, because lower frequencies carry much more room and handling noise. The spectrum band, default 100 Hz–20 kHz, is the range over which spectra are shown and compared.

The “What this can tell you” tab in the app explains the method and its limits.

Layout#

  • src/analysis/ – FFT, tear detection, Welch spectra, energy and spectral statistics
  • src/audio/ – microphone capture, WAV encode/decode, synthetic tears
  • src/storage/ – IndexedDB
  • src/components/ – UI, including a small canvas plotting component
↑↓ move↵openescclose