← Gallery Spectrum analyzer — live oscillator proof

Spectrum analyzer — live oscillator proof

SpectrumAnalyzer — RealtimeSpectrumAnalyzer · renderStaticSpectrum · createSpectrogram

Play a tone, watch the analyzer find it: a live oscillator feeds a real-time spectrum display, and the tallest peak has to land on the oscillator's frequency — retune it and the peak follows. Static proofs also run on load with the repaired xa-fft-backed paths: renderStaticSpectrum of a 1 kHz sine must report its peak within one FFT bin (previously it always threw), and createSpectrogram of a 200→2000 Hz chirp must produce the exact legacy frame count with a rising peak bin (previously an O(n²) DFT that hung). Press Start for the live proof: a 1000 Hz OscillatorNode feeds RealtimeSpectrumAnalyzer (fftSize 4096) and the argmax of analyser.frequencyData must sit within one bin (±10.8 Hz) of 1000 Hz. Sweep buttons retune the oscillator so you can watch (and hear, quietly) the peak track.