Time-Domain Waveform
Spectrogram (STFT)
Energy Density Legend
Understanding Spectrograms
What is a Spectrogram?
A spectrogram is a visual representation of the spectrum of frequencies in a signal as it varies with time. It is computed using the Short-Time Fourier Transform (STFT), which divides the signal into overlapping segments, applies a window function, and computes the FFT for each segment.
Time-Frequency Resolution Trade-off
The window size controls the fundamental trade-off between time resolution and frequency resolution. A larger window provides better frequency resolution but poorer time resolution. This is a manifestation of the Heisenberg uncertainty principle in signal processing.
Window Functions and Spectral Leakage
When the STFT extracts finite-length segments, discontinuities at the boundaries cause spectral leakage. Window functions taper the signal at edges to reduce this effect. Hann provides good balance, Blackman has stronger side-lobe suppression, and Rectangular has the worst leakage.
Applications
STFT Mathematical Definition
STFT{x[n]}(m, k) = SUM(n=0 to N-1) x[n + mH] w[n] e^(-j2pi kn/N)
Where x[n] is the input signal, w[n] is the window function, N is the window size, H is the hop size, m is the frame index, and k is the frequency bin index.
How to Use This Tool
- Select a signal type and adjust its parameters.
- Alternatively, upload an audio file for analysis.
- Adjust STFT parameters: window size controls frequency vs. time resolution trade-off.
- Choose a colormap and frequency scale that best reveals the features.
- Hover over the spectrogram to inspect time-frequency energy at any point.