signal processing · the Instrument Room

The Window You Cannot Win

A spectrogram looks like a photograph of a sound. It is not. It has a setting, and the setting is a trade you are always making whether or not you know it: widen the analysis window and the pitch sharpens while the onset smears into a stripe, narrow it and the attack snaps into place while the pitch blurs into a band. Below is a signal built so the loss is visible, and one knob. Some pairs no setting can win.

everything recomputed live · one shared engine · browser 11/11 · offline 49/49

One knob

The signal has two things in it. Early on, two steady tones a few hertz apart, which you can only tell apart by looking at a long stretch of sound. Later, two clicks a few milliseconds apart, which you can only tell apart by looking at a short one. Drag the window.

two tones apart?
two clicks apart?
both at once?

The verdicts are not eyeballed. Each one reads the spectrogram at the two places the events actually are and asks whether the valley between them falls below 70% of the weaker peak. Same test, every setting, both panels.

The trade has a floor

Every window has a duration and a bandwidth, and you cannot shrink both. Measured as the standard deviations of its energy in time and in frequency, the product obeys σt · σf ≥ 1/4π ≈ . That is not a property of any instrument: it is what a Fourier pair is. The Gaussian is the one window that reaches it, and here it does, to six decimals.

windowσt (ms)σf (Hz)product× the floor

The rectangular window, which is what you get by simply cutting a chunk out of a recording, sits times above the floor. Its edges are discontinuities and a discontinuity is broadband, so chopping bluntly costs you far more frequency precision than the mathematics demands. Tapering is not decoration.

When no setting exists

If separating the tones needs a window at least this long, and separating the clicks needs one at most that long, then whether any window works at all is decided before you touch the knob. Two tones Δf apart and two clicks Δt apart, swept over every window length:

Δf · ΔtΔf (Hz)Δt (ms)any window?which

Sixteen pairs, spanning separations from 15 to 150 Hz and gaps from 20 to 100 ms, and the line falls where the arithmetic says it should: the product of the two things you are asking for has to clear about one. Below that, the question is not hard, it is refused.

Two sanity conditions the sweep has to satisfy, and does. Tones further apart must never be harder to separate at a fixed window (), and a longer window must never be worse at separating tones (). Both hold across the whole grid. They are checked because the first two versions of this measurement failed them, which is how the bugs were found.

What the ear does with the same budget

The ear is under the same constraint and spends it differently. It is biased toward onset, motion and change, which is why a machine will hand you a steady tone you never noticed while smearing a consonant you heard perfectly well. Neither is more correct. The surface you get is made of chosen blur, and the only mistake is forgetting that you chose.

The numbers, recomputed

not yet run

Where this is soft

The uncertainty relation for a Fourier pair is standard; the form used here, with the bound 1/4π for standard deviations in seconds and hertz, is the one Gabor sets out in "Theory of Communication", J. Inst. Electr. Eng. 93 (1946) 429-457, where the Gaussian is identified as the function attaining it. Everything on this page is computed by research/gabor-uncertainty/engine.mjs, which the page and the offline verifier both load unchanged.