Spectrogram Lab — Anomaly Detector
Generate audio signals, visualize their spectrograms in real-time, and detect anomalies using statistical thresholding — all powered by the Web Audio API.
How It Works
The demo uses the Web Audio API to generate or capture audio, then performs FFT analysis to compute the frequency spectrum. The scrolling spectrogram uses an inferno-style color map. Anomalies are detected when spectral energy exceeds 2 standard deviations above the running mean.
| Control | Action |
|---|---|
| Synth mode | Generate audio with adjustable frequency, amplitude, noise, and harmonics |
| Mic mode | Capture live audio from your microphone |
| Inject Anomaly | Add a random transient burst (click, screech, or noise) |
| Frequency band | Focus detection on Low, Mid, High, or All frequencies |
The Concept
In industrial settings, acoustic anomaly detection identifies faulty equipment by analyzing sound patterns. Normal operating sounds have consistent spectral signatures, while anomalies (grinding, clicking, rattling) produce distinctive frequency spikes that statistical or deep learning models can flag automatically.