Enough support to infer f.
At least three different orders must agree, with the lowest at order 3 or below. An absent fundamental is labelled Inferred.
FROM SOUND TO A MUSICAL NOTE
A bright overtone can win the spectrum.
A family of overtones can reveal the pitch.
Toneglass looks for clear, related, persistent frequencies. It estimates a common fundamental, then names the nearest note. This is a transparent harmonic heuristic—not a complete simulation of hearing.
Try making the eighth harmonic louder.
These synthetic peaks run through the app’s actual harmonic-grouping function. The picture illustrates changing levels; it is not a recording. A strong 4,180 Hz peak contributes evidence for 522.5 Hz because it is 8 × that frequency.
A narrow line matters more than a broad hill of noise.
A 16,384-sample FFT separates the sound into frequencies. At 48 kHz, each window spans about 341 ms, with bins about 2.93 Hz apart.
For each local maximum, the detector estimates the nearby noise floor using a median, leaving out the peak’s centre. A candidate must rise at least 12 dB above that floor.
It refines the frequency between bins by fitting the peak and its two neighbours. This gives a smoother estimate; it does not magically add frequency resolution.
Normalize their levels, then give lower harmonics more weight.
Every admitted peak proposes possible fundamentals by division. Other peaks join a proposal when they lie near integer multiples of it. Unrelated peaks compete as separate families.
Levels become amplitudes relative to the strongest admitted peak. Each contribution is adjusted for local contrast, then divided by √harmonic order. A bright eighth harmonic helps, but gets less weight than an equally strong fundamental.
The bars show weighted contributions, not probabilities. This example gives every peak the same strong local contrast. The final score also rewards prominence and multiple supporting harmonics.
Keep up to 48 prominent peaks; ignore those more than 35 dB below the strongest of them. Let M be that strongest level, L the peak level, P its prominence and h its harmonic order.
w = 10^((L − M) / 20) × clamp(P / 18, 0.4, 1) / √hSum w across the family. Score = M + 20 log₁₀(sum w) + 0.7 × weighted mean prominence + a gentle A-weighting term + a support bonus (1.5 per additional harmonic, capped at 6). Prominence is capped at 36 dB in the mean.
Seeds are divided by 1…10; matches may use orders 1…12. Match tolerance is the larger of 1.5 FFT bins or 1.2% of the expected harmonic frequency. These are engineering choices, not established perceptual thresholds.
If the fundamental is present, use its measured frequency. Otherwise, average each member’s frequency divided by its order, using the weights above. Normalizing helps compare relative structure as level changes, but microphone response, masking and absolute cutoffs still matter.
Harmonic matching needs guardrails.
At least three different orders must agree, with the lowest at order 3 or below. An absent fundamental is labelled Inferred.
If all orders share a divisor, reject the lower proposal. There is no independent evidence here for f instead of 2f.
A more complete parent family can also outrank its octave subset: the subset gets a 6-point penalty when a sufficiently strong parent has at least three members, including two the subset cannot explain.
Frequency comes first; the musical label comes last.
A candidate needs four consecutive observations and at least 180 ms of persistence. Nearby estimates are smoothed. The current leader stays selected if it is within 3 score points of the challenger, reducing flicker. The timeline shows nominal updates; FFT windows overlap.
Finally, the estimate maps to equal-tempered notes at A4 = 440 Hz. 522.5 Hz → C5, about 2.5 cents flat. The raw frequency is never snapped to C. Middle C is C4 = 261.63 Hz; C5 = 523.25 Hz.
note number = 69 + 12 × log₂(frequency / 440)Round the note number to select the nearest semitone. Cents = 100 × (unrounded note number − rounded note number). A semitone is 100 cents.
The spectrum uses browser Blackman windowing and 0.55 magnitude smoothing. The tracker blends 45% of the previous frequency with 55% of the new estimate. Stability adds delay; it is not evidence that a brief or changing sound has no pitch.
Useful evidence, with the assumptions visible.
Offline spectral analysis followed the low line over the recording: its median was about 522.51 Hz, with a central 90% range of 520.46–523.27 Hz. Peaks near 1,045, 1,568, 2,091 and 4,180 Hz supported the same family as their relative levels changed.
Replaying 466 spectrum frames through the grouped detector gave C5 on all 463 frames after the three-frame startup. An offline autocorrelation cross-check also usually found this pitch, but sometimes chose the octave below. Autocorrelation is not part of the live detector. This recording helped develop the heuristic, so the replay is a regression check, not a held-out test.
Sum the linear spectral powers of the nearest FFT bin and three bins on either side. Double this positive-frequency power and divide by the Blackman window’s mean-square gain (0.3046), then take 10 log₁₀. This estimates band-limited RMS relative to full scale: a steady sine of peak amplitude 1 reads approximately −3.01 dBFS.
level ≈ 10 log₁₀(2 × Σ 10^(bin dB / 10) / 0.3046)The seven-bin band is about 20.5 Hz wide at 48 kHz sampling. Existing spectral smoothing makes the meter settle gradually. It is not a true-peak or whole-input meter; its held marker tracks the band RMS estimate. Colour thresholds are display conventions, not acoustic safety limits. See the Web Audio FFT definition.
The piano highlights the nearest semitone from C3 through B5. Notes outside this range are labelled above or below the keyboard, never folded into another octave. Blue C4 and the A4 violin reference stay fixed.