Spectrum Analyzer
Visualize audio frequencies live with FFT — bars, spectrum line, waveform. Records as MP4/WebM, runs in browser, no upload. Supports MP3, WAV, FLAC.
About this Audio Spectrum Analyzer
An audio spectrum analyzer turns the time-domain signal you hear into a frequency-domain picture you can read. Instead of plotting amplitude against time, it plots magnitude against frequency, revealing exactly which tones, harmonics, and noise components are present at each instant. This online tool runs entirely inside your browser using the Web Audio API and the Meyda feature-extraction library, so audio files never leave your device. The same techniques are used by professional measurement systems from Audio Precision, Rohde & Schwarz, and Stanford CCRMA research tools — adapted here for free, no-install use.
The tool accepts virtually any container the browser can decode: MP3, WAV, FLAC, OGG, M4A, OPUS, AAC, plus video files (MP4, MOV, AVI, MKV) from which we extract the audio track using ffmpeg.wasm. After decoding, the audio buffer is fed through an AnalyserNode that computes a real-time Fast Fourier Transform on overlapping windows. The result is rendered as either a smooth frequency curve, classic vertical bars, or a time-domain waveform, all driven by the requestAnimationFrame loop for stable 60 fps display.
Audio engineers reach for spectrum analysis when mixing or mastering: a quick glance shows whether the kick drum has the expected 60–80 Hz fundamental, whether vocals sit in the 2–5 kHz presence band, or whether mud is accumulating around 200–400 Hz. Musicians use it to verify instrument tuning, teachers use it to demonstrate harmonics and overtones, podcasters use it to spot mains hum at 50/60 Hz, and acousticians use it for room-mode investigation when a calibrated microphone is available. The tool also supports recording a video of the live spectrum animation as WebM (VP9/VP8) or MP4 (H.264), which is useful for YouTube content, lectures, and music visualizers.
Three controls deserve attention. Smoothing (FFT timeSmoothingConstant) averages successive frames; values near 0 give a twitchy, raw response that exposes transients, while values near 0.9 produce a calm visual but mask short events. The visualization type switches between a continuous spectrum line, discrete bars (an 8-band style display reminiscent of vintage hi-fi VU meters), and the raw waveform. The download tools let you save still snapshots or recordings of the spectrum for use in tutorials and social posts. All processing is local, all output is yours, and no telemetry of audio content is collected — only basic anonymous usage analytics for the page itself.
How the analyzer works
Audio is decoded by the Web Audio API into a 32-bit float PCM buffer at the file's native sample rate (typically 44.1 kHz or 48 kHz). The buffer is routed through an AudioBufferSourceNode → AnalyserNode → AudioContext.destination chain. The AnalyserNode is configured with fftSize = 2048 by default, giving 1024 frequency bins covering the range 0 Hz to Nyquist (sampleRate / 2). Each bin therefore represents sampleRate / fftSize ≈ 21.5 Hz at 44.1 kHz — the fundamental frequency-resolution limit of this tool. Doubling fftSize (to 4096 or 8192) doubles resolution but doubles latency.
Before the FFT runs, the AnalyserNode applies a Blackman window to each frame. Windowing tapers the edges of the analysis frame to zero, which prevents the spectral leakage that a rectangular window would cause when frequencies don't sit exactly on a bin centre. Other common choices in DSP — Hann, Hamming, Kaiser — trade main-lobe width against side-lobe rejection; Blackman is the Web Audio default and is a sensible all-purpose pick.
After the FFT, the analyzer returns either time-domain samples (getByteTimeDomainData) for the waveform view, or magnitude-spectrum data in dBFS (getByteFrequencyData, scaled to 0–255 between minDecibels = −100 dBFS and maxDecibels = −30 dBFS). Successive frames are smoothed with the formula: out[i] = α · prev[i] + (1−α) · current[i], where α is the smoothing constant. This is a single-pole IIR filter with cutoff that depends on α and the frame rate.
The displayed magnitude axis is logarithmic in decibels, which matches human hearing. The frequency axis can be linear (uniform Hz spacing, used here for the spectrum line) or logarithmic (matches musical octaves). For the bars view we group bins into perceptually meaningful bands (sub-bass, bass, low-mid, mid, high-mid, treble, presence, brilliance) following common mixing-console conventions. Magnitude versus power is a frequent source of confusion: this tool shows magnitude (proportional to amplitude), so a 3 dB rise corresponds to a roughly 1.4× pressure ratio; if you need power (proportional to energy), the same number is double.
Snapshots are exported by reading the canvas back as a PNG via canvas.toBlob. Live recordings use MediaRecorder over a stream captured from canvas.captureStream(60), giving a true 60 fps screen capture without external software. When MP4 is selected, the recorded WebM is transcoded to H.264 in the browser using ffmpeg.wasm — a port of the ffmpeg library compiled to WebAssembly. This is slower than VP9 but produces files compatible with iOS, PowerPoint, and most legacy editors.
Accuracy and limitations
This tool gives a reliable picture of relative spectral content, but it cannot measure absolute sound pressure level (SPL in dB SPL) without calibration. The microphone or audio interface that originally captured the file has its own frequency response, gain, and noise floor, none of which we can know after the fact. Treat the dB axis as decibels relative to full scale (dBFS), not dB SPL. To obtain dB SPL you need a class-1 measurement microphone, a known reference source (typically a 94 dB SPL pistonphone), and offline calibration in a metrology-grade application — not a browser tool.
Frequency accuracy is bounded by the bin width: at 44.1 kHz with fftSize 2048, two tones less than ~22 Hz apart cannot be resolved as separate peaks. This is the inverse of the Heisenberg-style time-frequency trade-off. If you need finer resolution, increase fftSize at the cost of slower update; if you need finer time resolution (transient detection), decrease fftSize. The smoothing constant adds further temporal averaging, which is desirable for a calm display but hides short events; set it to 0 when chasing clicks or pops.
- Cannot measure absolute SPL (dB SPL) without a calibrated microphone and reference signal — readings are dBFS only.
- Frequency resolution is limited to sampleRate ÷ fftSize ≈ 21.5 Hz at 44.1 kHz / FFT 2048.
- The Web Audio AnalyserNode applies a fixed Blackman window; researchers needing other windows should use offline DSP libraries.
- Heavily compressed lossy formats (low-bitrate MP3, AAC) lose high-frequency detail and may show artifacts that are encoder ringing rather than source content.
- Browser audio decoders may resample non-standard sample rates (e.g. 96 kHz) down to the AudioContext rate, masking ultrasonic content.
- Real-time animation runs at 60 fps; very fast transients (under ~17 ms) may fall between frames.
Glossary
- FFT (Fast Fourier Transform)
- An efficient O(N log N) algorithm for computing the Discrete Fourier Transform, which decomposes a finite-length signal into the sum of complex sinusoids at evenly-spaced frequencies.
- Frequency bin
- One of the N/2 frequency slots produced by an N-point FFT, each centred at k × sampleRate / N for integer k. Bin width equals sampleRate / fftSize.
- Nyquist frequency
- Half the sample rate. The highest frequency that can be represented unambiguously in a digital signal; content above this folds back as aliasing during recording.
- dBFS (decibels Full Scale)
- A digital level reference where 0 dBFS is the maximum representable value (typically a peak of ±1.0 in 32-bit float or ±32767 in 16-bit). All values are negative; the noise floor of a clean 16-bit recording is around −96 dBFS.
- Magnitude vs. power
- Magnitude is the absolute value |X(f)|; power is its square |X(f)|². A 3 dB increase corresponds to a 2× ratio in power but a √2 ≈ 1.41× ratio in magnitude. Spectrum analyzers may plot either; this tool plots magnitude.
- Windowing
- Multiplying the analysis frame by a tapered weighting function (Hann, Hamming, Blackman, Kaiser, …) before the FFT to suppress spectral leakage caused by the frame boundaries.
- Spectrogram
- A two-dimensional plot of FFT magnitudes over time, with frequency on the vertical axis, time on the horizontal, and intensity coded by colour. Closely related to the spectrum view but unrolled in time.
- Sample rate
- The number of audio samples captured per second, expressed in Hz. CD quality is 44.1 kHz; pro audio is 48 kHz, 96 kHz, or 192 kHz.
Frequently Asked Questions
What audio formats are supported?
All formats your browser can decode: MP3, WAV, OGG, AAC, M4A, FLAC, OPUS, plus video containers (MP4, MOV, MKV, AVI) from which the audio is automatically extracted. Decoding happens entirely in your browser via the Web Audio API.
What is a spectrum analyzer used for?
Mixing and mastering checks, instrument tuning, room-mode investigation, finding mains hum (50/60 Hz) and harmonics, comparing two recordings, demonstrating Fourier analysis in classrooms, building music visualizers for video, and quality-controlling broadcast or podcast audio.
What FFT size does the tool use?
The default fftSize is 2048, which gives 1024 frequency bins and ≈21.5 Hz resolution at 44.1 kHz. The Web Audio AnalyserNode supports any power of two from 32 to 32768; this tool chooses 2048 as a balance of resolution, latency, and CPU load.
What does the smoothing slider do?
It controls the AnalyserNode timeSmoothingConstant: a single-pole IIR filter on successive FFT frames. 0.0 shows the raw frame-by-frame spectrum (useful for transients, hissier display); 0.8–0.9 produces a calm, music-friendly look; 1.0 freezes the display.
What's the difference between Spectrum, Bars, and Waveform views?
Spectrum is a continuous frequency-domain curve from 0 Hz to Nyquist. Bars groups bins into perceptual bands like sub-bass / bass / mid / treble / presence — visually like a classic hi-fi display. Waveform shows the raw time-domain signal (amplitude vs. time) and is useful for spotting clipping, DC offset, or asymmetry.
Can I measure dB SPL?
No. The display is in dBFS (decibels relative to digital full scale). Measuring real-world SPL requires a calibrated reference microphone (e.g. Earthworks M30, B&K 4189), a known acoustic source, and metrology-grade software. Browser-only tools cannot do this — but for relative comparison and shape analysis, dBFS works fine.
Why does my spectrum show zero above 16 kHz?
Most likely your file is a low-bitrate MP3 or AAC; lossy codecs aggressively cut high frequencies (often a steep low-pass at 16 kHz for 128 kbps MP3). Try a WAV or FLAC of the same source. It can also indicate the original recording was bandwidth-limited.
What does the snapshot/recording feature export?
Snapshot saves a PNG of the current canvas at full resolution. Recording captures the live animation as WebM (VP9 best, VP8 wider compatibility) or transcodes it to MP4 (H.264) using in-browser ffmpeg.wasm. Audio is muxed in alongside the video for direct upload to YouTube or social platforms.
Is my audio uploaded anywhere?
No. Decoding, FFT analysis, rendering, and recording all happen locally in your browser. No bytes of your audio leave your device. The page itself uses standard analytics for traffic counts only.
Why does the spectrum look different from my DAW?
DAWs often apply A-weighting, K-weighting, longer FFT sizes, or psychoacoustic smoothing. They may also display per-band RMS rather than peak. Use this tool for quick checks and shape comparison; use a calibrated DAW analyzer (FabFilter Pro-Q, Voxengo SPAN, iZotope Insight) for mastering-grade decisions.
References & further reading
- W3C Audio Working Group. (2021). Web Audio API specification (W3C Recommendation) World Wide Web Consortium.
- Smith, J. O.. (2007). Mathematics of the Discrete Fourier Transform (DFT), with Audio Applications Stanford CCRMA / W3K Publishing.
- ITU Radiocommunication Sector. (2023). ITU-R BS.1387-2: Method for objective measurements of perceived audio quality (PEAQ) International Telecommunication Union.
- IEEE Instrumentation and Measurement Society. (2017). IEEE Std 1057-2017: Standard for Digitizing Waveform Recorders IEEE.
- Harris, F. J.. (1978). On the use of windows for harmonic analysis with the discrete Fourier transform Proceedings of the IEEE, vol. 66, no. 1.
Last reviewed: · Reviewed by WuTools Audio Engineering Team
