/ magland / rip-sound-analyzer
Sign in
magland / rip-sound-analyzer
rip-sound-analyzer / src / components / About.tsx
88 lines · 5.0 KBCodeBlameHistory
d0a8b32Rip Sound Analyzer: record tears, inspect one, compare across speedsJeremy Magland 1import type { AnalysisSettings } from "../analysis/analyze.ts";
2import { fmtHz } from "../model.ts";
4export function About({ settings }: { settings: AnalysisSettings }) {
5 return (
6 <div className="about card">
7 <h2>The idea</h2>
8 <p>
9 A tear may be a rapid sum of tiny, similar clicks, one per fibre or bond that breaks. If so, tearing faster packs the same clicks into less time.
10 Two things should then stay the same at every speed: the <b>total sound energy</b> of a tear, and its <b>frequency makeup</b>. Their sum gets
11 louder for a faster tear (more clicks per second) but shorter, and the two effects cancel in the total energy.
12 </p>
13 <p>
14 This holds even when the clicks overlap and blur together, as long as they arrive at random times: the energies of randomly timed clicks add up.
15 So nothing here depends on picking out individual clicks.
16 </p>
18 <h2>What is measured</h2>
19 <ul>
20 <li>
d8b88deRecord tab organised around five fixed speeds, one tear eachJeremy Magland 21 <b>Tear segment</b>: found automatically as the loudest stretch well above the background (gaps under 0.6 s are bridged). Check it on the Record tab and adjust it if it is wrong. Duration and speed ({settings.sheetLengthIn} in ÷ duration) come from this segment, not from the label.
23 <li>
24 <b>Energy spectral density</b> of the tear: Welch average of 2048-point Hann-windowed spectra over the segment, times its duration. Units are digital
25 full scale (FS² · s / Hz).
26 </li>
27 <li>
28 <b>Background</b>: the same spectrum measured on the quiet audio before and after the tear (median across windows, so a stray key click does not
29 dominate), scaled to the tear's duration and subtracted.
30 </li>
31 <li>
32 <b>Sound energy</b>: the background-subtracted spectrum summed over {fmtHz(settings.bandLow)} – {fmtHz(settings.bandHigh)}. <b>Median frequency</b> and{" "}
33 <b>centroid</b> describe where that energy sits.
34 </li>
35 </ul>
37 <h2>What it can't tell you</h2>
38 <ul>
39 <li>
40 <b>Only relative numbers.</b> The microphone is not calibrated, so energies are in arbitrary units. Comparisons are meaningful only between recordings
41 made with the same mic, at the same distance and angle, in the same room. Moving the paper twice as far away lowers the energy by roughly 6 dB, which
42 is bigger than many of the effects you may be looking for.
43 </li>
44 <li>
45 <b>The mic colours the sound.</b> A laptop microphone has its own frequency response and records little above about 20 kHz. Spectra show the sound as
46 that mic hears it. That is fine for comparing speeds against each other, but not for absolute spectra.
47 </li>
48 <li>
49 <b>Clipping ruins the energy.</b> If a tear is loud enough to hit full scale, its energy is underestimated. Clipped recordings are flagged.
50 </li>
51 <li>
52 <b>Run-to-run scatter.</b> Two tears at the same speed won't give identical numbers (paper varies, your hands vary). Make several tears per speed and
53 look at the spread before reading anything into a difference between speeds.
54 </li>
55 <li>
56 <b>Not just the tear.</b> Hand and paper movement, the sheet flapping and the room all add sound. The band setting excludes the lowest frequencies,
57 where most of this lives, but cannot remove it entirely.
58 </li>
59 <li>
60 <b>Same energy ≠ same clicks.</b> Equal energy and equal spectra are what identical clicks predict, but other explanations could produce them too.
61 Different energies or spectra, on the other hand, do show something changes with speed.
62 </li>
63 </ul>
65 <h2>How the audio is kept raw</h2>
66 <ul>
67 <li>
68 Chrome's echo cancellation, noise suppression and automatic gain control are turned off. The settings the browser actually applied are shown after
69 enabling the mic; a warning appears if any are still on.
70 </li>
71 <li>
72 Samples are taken directly from the audio graph (32-bit float), at the microphone's own sample rate, and stored unmodified. Nothing is compressed.
73 Downloads are 32-bit float WAV files with the exact recorded samples.
74 </li>
75 <li>
76 macOS can apply its own processing outside the browser's control. While recording, open Control Center: if a <b>Mic Mode</b> option is shown,
77 set it to <b>Standard</b> (not Voice Isolation or Wide Spectrum). Also keep the input volume in System Settings → Sound fixed between sessions.
78 </li>
79 </ul>
81 <h2>Checking the analysis</h2>
82 <p>
d8b88deRecord tab organised around five fixed speeds, one tear eachJeremy Magland 83 The project's test script (<code>npm test</code>) builds synthetic tears exactly as the hypothesis says (4000 clicks of one fixed shape with random
84 amplitudes, spread over 0.3 to 10 seconds) and checks that their measured energies and spectra agree. They do, within a fraction of a dB.
86 </div>
87 );
↑↓ move↵openescclose