/ magland / rip-sound-analyzer
Sign in
magland / rip-sound-analyzer
rip-sound-analyzer / src / components / About.tsx
95 lines · 5.9 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>
18eb8cdFind the tear from clicks in the filtered waveform; count every click's energy in fullJeremy Magland 21 <b>Tear segment</b>: found automatically from the clicks in the waveform filtered to the analysis band. The background noise's RMS amplitude is
22 taken from the quietest 10 ms stretches, and any peak above 6 times that counts as a click. Clicks less than 1 s apart make up one sound; the sound
23 with the most energy is the tear, and it runs from its first click to its last (plus 10 ms before and 20 ms after). Short sounds at either end that
24 stand well apart from the rest, such as a key press, are left out and listed, with a button to take them in. Check the range on the Record tab and
25 adjust it if it is wrong. Duration and speed ({settings.sheetLengthIn} in ÷ duration) come from this segment.
27 <li>
18eb8cdFind the tear from clicks in the filtered waveform; count every click's energy in fullJeremy Magland 28 <b>Energy spectral density</b> of the tear: one FFT of the whole segment, with no window, summed into 23 Hz bins (the grid of a 2048-point
29 spectrum at 48 kHz). Every click counts in full wherever it falls in the segment, even right at its edges; averaging windowed frames would count
30 clicks near the edges for less. Units are digital full scale (FS² · s / Hz).
32 <li>
33 <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
34 dominate), scaled to the tear's duration and subtracted.
35 </li>
36 <li>
751f8faSelect the tear on level, waveform or spectrogram; 10–20 kHz analysis bandJeremy Magland 37 <b>Sound energy</b>: the background-subtracted spectrum summed over the <b>analysis band</b>, {fmtHz(settings.energyLow)} –{" "}
38 {fmtHz(settings.energyHigh)}. Lower frequencies carry much more room and handling noise, so energy, the automatic tear range, the level plot and
39 the filtered waveform all use only this band. Spectra are still shown over the full range for context. The band can be changed under Analysis
40 settings.
42 </ul>
44 <h2>What it can't tell you</h2>
45 <ul>
46 <li>
47 <b>Only relative numbers.</b> The microphone is not calibrated, so energies are in arbitrary units. Comparisons are meaningful only between recordings
48 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
49 is bigger than many of the effects you may be looking for.
50 </li>
51 <li>
751f8faSelect the tear on level, waveform or spectrogram; 10–20 kHz analysis bandJeremy Magland 52 <b>The mic colours the sound.</b> A laptop microphone has its own frequency response and records little above about 20 kHz, so the top of the analysis band is near the limit of what it captures. Spectra show the sound as
d0a8b32Rip Sound Analyzer: record tears, inspect one, compare across speedsJeremy Magland 53 that mic hears it. That is fine for comparing speeds against each other, but not for absolute spectra.
54 </li>
55 <li>
56 <b>Clipping ruins the energy.</b> If a tear is loud enough to hit full scale, its energy is underestimated. Clipped recordings are flagged.
57 </li>
58 <li>
09371b0Open-ended samples instead of fixed speedsJeremy Magland 59 <b>Run-to-run scatter.</b> Two tears at the same speed won't give identical numbers (paper varies, your hands vary). Record several tears at similar
60 speeds and look at the spread before reading anything into a difference between speeds.
62 <li>
8bf83cfMeasure energy and find the tear in a 15–20 kHz bandJeremy Magland 63 <b>Not just the tear.</b> Hand and paper movement, the sheet flapping and the room all add sound. Most of this is at low frequencies, which is why energy is measured
64 in a high band, but the band cannot remove it entirely.
66 <li>
67 <b>Same energy ≠ same clicks.</b> Equal energy and equal spectra are what identical clicks predict, but other explanations could produce them too.
68 Different energies or spectra, on the other hand, do show something changes with speed.
69 </li>
70 </ul>
72 <h2>How the audio is kept raw</h2>
73 <ul>
74 <li>
75 Chrome's echo cancellation, noise suppression and automatic gain control are turned off. The settings the browser actually applied are shown after
76 enabling the mic; a warning appears if any are still on.
77 </li>
78 <li>
79 Samples are taken directly from the audio graph (32-bit float), at the microphone's own sample rate, and stored unmodified. Nothing is compressed.
80 Downloads are 32-bit float WAV files with the exact recorded samples.
81 </li>
82 <li>
83 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,
84 set it to <b>Standard</b> (not Voice Isolation or Wide Spectrum). Also keep the input volume in System Settings → Sound fixed between sessions.
85 </li>
86 </ul>
88 <h2>Checking the analysis</h2>
89 <p>
d8b88deRecord tab organised around five fixed speeds, one tear eachJeremy Magland 90 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
91 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.
93 </div>
94 );
↑↓ move↵openescclose