Audio Spectrum Explorer

Spectrogram Explorer

Computes a real STFT with control over window size, hop length, and window type (Hann/Hamming), and shows the Spectrogram and Mel Spectrogram side by side.

Runs in the Browser

Learning Objective

Understand the trade-off between time and frequency resolution, the effect of the window, and the conversion of frequency to the Mel scale.

Experiment

Audio is processed inside your browser and is not sent to the server. The microphone is opened only when you press it.

Experiment Details

Prerequisites

  • Audio file or recording

Inputs

An audio file you upload from your device or a microphone recording; processing happens inside your browser and nothing is sent to the server.

Method

Split the signal into overlapping frames, multiply each frame by a window, then apply the FFT: $X(m,k)=\sum_n x[n+mH]\,w[n]\,e^{-j2\pi kn/N}$. For Mel, HTK triangular filters are applied, followed by $10\log_{10}$.

Results

The STFT matrix (magnitude), its dimensions (frames × bins), the frequency resolution $f_s/N$, and the time step $H/f_s$.

Charts

A color spectrogram (dB) with the Mel spectrogram beside it.

Scientific Interpretation

A larger window gives better frequency resolution and worse time resolution; the Mel scale compresses high frequencies, approximating the ear's perception.

Questions for Reflection

  • What happens to the time resolution when the window size is doubled?
  • Why do we use a Hann window instead of a rectangular window?

References

  1. McFee, Raffel, Liang, Ellis, McVicar, Battenberg, et al.. librosa: Audio and Music Signal Analysis in Python. Proceedings of the 14th Python in Science Conference (2015). DOI

Audio processing in the experiments takes place inside your browser. Audio, texts, and conversations are not saved on the server. Privacy Policy