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.
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.
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
- "Resolved" is a threshold, and thresholds are choices. We call two things separate when the valley between them drops below 70% of the weaker peak. That is a conventional criterion, not a law. Move the threshold and the exact window lengths in the tables move with it. What does not move is the shape: a band that resolves tones, a band that resolves clicks, and whether the two bands overlap.
- The floor is exact; the boundary at one is not. σtσf ≥ 1/4π is a theorem about second moments. The claim that Δf · Δt must clear about one is an empirical statement about this detector on these signals, and it depends on the threshold above. We report where our sweep puts the line, not a derived constant.
- Zero-padding is in the code and does nothing for resolution. Each frame is padded four-fold before the transform. That interpolates the same spectrum onto a finer grid so bin spacing is never what limits the detector. It buys no resolution whatsoever, which is a thing worth knowing, since a smoother-looking spectrum is easy to mistake for a sharper one.
- The measurement was wrong twice before it was right. The first detector hunted for local maxima and reported two tones 30 Hz apart resolved by a 12 ms window, which is impossible. The second read a single frame, and two tones beat at exactly their separation, so the frame could land in a beat null and report a blob where its neighbour showed two clean peaks. That one produced a table where wider-spaced tones looked harder to resolve than narrow ones. Both were failures of the instrument, not the physics, and both were caught by the monotonicity conditions above rather than by inspection.
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.