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>
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 plots and drag
22 its edges if it is wrong. Duration and speed ({settings.sheetLengthIn} in ÷ duration) come from this segment, not from the label.
23 </li>
24 <li>
25 <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
26 full scale (FS² · s / Hz).
27 </li>
28 <li>
29 <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
30 dominate), scaled to the tear's duration and subtracted.
31 </li>
32 <li>
33 <b>Sound energy</b>: the background-subtracted spectrum summed over {fmtHz(settings.bandLow)} – {fmtHz(settings.bandHigh)}. <b>Median frequency</b> and{" "}
34 <b>centroid</b> describe where that energy sits.
35 </li>
36 </ul>
38 <h2>What it can't tell you</h2>
39 <ul>
40 <li>
41 <b>Only relative numbers.</b> The microphone is not calibrated, so energies are in arbitrary units. Comparisons are meaningful only between recordings
42 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
43 is bigger than many of the effects you may be looking for.
44 </li>
45 <li>
46 <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
47 that mic hears it. That is fine for comparing speeds against each other, but not for absolute spectra.
48 </li>
49 <li>
50 <b>Clipping ruins the energy.</b> If a tear is loud enough to hit full scale, its energy is underestimated. Clipped recordings are flagged.
51 </li>
52 <li>
53 <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
54 look at the spread before reading anything into a difference between speeds.
55 </li>
56 <li>
57 <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,
58 where most of this lives, but cannot remove it entirely.
59 </li>
60 <li>
61 <b>Same energy ≠ same clicks.</b> Equal energy and equal spectra are what identical clicks predict, but other explanations could produce them too.
62 Different energies or spectra, on the other hand, do show something changes with speed.
63 </li>
64 </ul>
66 <h2>How the audio is kept raw</h2>
67 <ul>
68 <li>
69 Chrome's echo cancellation, noise suppression and automatic gain control are turned off. The settings the browser actually applied are shown after
70 enabling the mic; a warning appears if any are still on.
71 </li>
72 <li>
73 Samples are taken directly from the audio graph (32-bit float), at the microphone's own sample rate, and stored unmodified. Nothing is compressed.
74 Downloads are 32-bit float WAV files with the exact recorded samples.
75 </li>
76 <li>
77 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,
78 set it to <b>Standard</b> (not Voice Isolation or Wide Spectrum). Also keep the input volume in System Settings → Sound fixed between sessions.
79 </li>
80 </ul>
82 <h2>Checking the analysis</h2>
83 <p>
84 Under “Import a file or add a synthetic test tear” you can add synthetic tears made exactly as the hypothesis says: 4000 clicks of one fixed shape with
85 random amplitudes, spread over 0.3 to 10 seconds. Their energies and spectra should agree within a fraction of a dB. If they don't, the analysis is wrong.
86 </p>
87 </div>
88 );
89}