Skip to content

Frequency Spectrum Analyzer

Analyzes the frequency spectrum of an audio file and returns metrics that describe its tonal balance, brightness, and spectral shape.

Parameters

Parameter Type Default Description
file_path string required Path to audio file (WAV, FLAC, AIFF, or OGG -- MP3, AAC, M4A, and WMA are rejected)

Example Output

Illustrative summary; MCP responses use structured JSON.

$ analyze_spectrum vocals.wav

Spectral Analysis Centroid: 2,847 Hz Rolloff: 8.2 kHz (85th percentile) Flatness: 0.0012 Contrast: [0.6123, 0.7018, 0.6544, 0.5892] Dissonance: 0.23

Octave Band Energy: 31_hz: -48.6 dB 62_hz: -42.1 dB 125_hz: -28.9 dB 250_hz: -18.3 dB 500_hz: -14.5 dB 1000_hz: -12.7 dB 2000_hz: -13.9 dB 4000_hz: -16.4 dB 8000_hz: -22.8 dB 16000_hz: -31.2 dB

What the Numbers Mean

  • Centroid — The “center of mass” of the spectrum. Higher values mean brighter audio. Vocals typically sit at 2-4 kHz, kicks at 100-200 Hz, cymbals at 8-12 kHz.

  • Rolloff — The frequency below which 85% of the spectral energy sits. Tells you where the meaningful high-frequency content ends. A vocal with rolloff at 8 kHz has controlled highs; rolloff at 14 kHz has significant air/breath content.

  • Flatness — How noise-like vs tonal the audio is. 0.0 = pure tone, 1.0 = white noise. Music typically ranges 0.001-0.05. Drums are higher (0.05-0.2), sustained notes are lower (0.001-0.01).

  • Contrast — Peak-to-valley contrast in the spectrum, returned as a list of values (one per frequency band analyzed — not the same fixed band set as the octave energy readout below). Higher values mean more defined tonal peaks in that band; lower values mean a flatter, more noise-like spectrum there.

  • Dissonance — A roughness descriptor based on spectral peaks. It does not identify which instruments mask one another; use the masking tools on separate stems for that comparison.

  • Octave Band Energy — Energy in dB across ten standard octave bands (31 Hz to 16 kHz, each named for its center frequency). Use this to see exactly where a mix is thin or overloaded, rather than relying on the single centroid value.

Example Prompts

Frequency check

Analyze the frequency balance of my vocal at vocals.wav

Brightness comparison

Compare the spectral centroid of my mix versus the reference — is mine too dark?

Per-band breakdown

Show me the per-band energy distribution of bass.wav — I think there’s too much sub

Pro tip

If centroid seems off but you can’t hear why, check per-band energy. A high centroid with strong low-mid energy usually means harsh high-mids are pulling the average up — not that lows are missing.