PhysSandbox
Classical MechanicsWaves & SoundElectricity & MagnetismOptics & LightGravity & OrbitsLabs
🌙Astronomy & The Sky🌡️Thermodynamics🌍Biophysics, Fluids & Geoscience📐Math Visualization🔧Engineering🧪Chemistry

Related simulators

Continue with similar topics in this category — or all 85 in Math Visualization.

View category →
NewUniversity / research

Convolution (pulses)

Launch Simulator

Two rectangular pulses; overlap length at τ = 0.

NewUniversity / research

ΔΣ (1-bit) Modulator

Launch Simulator

First- and second-order discrete-time ΔΣ with ±1 quantizer: shaped quantization noise, sine test tone, boxcar reconstruction, and Hann-windowed error spectrum (last 1024 samples).

NewSchool

FFT Magnitude Spectrum

Launch Simulator

Paint or preset a 256-point signal; radix-2 FFT shows |X[k]| vs bin (DC to Nyquist).

NewUniversity / research

Runge–Kutta Stability Regions

Launch Simulator

Absolute-stability regions in the z = hλ plane for explicit Euler, RK2, and RK4; move λ and h, compare |R(z)|, and see why stiff modes constrain explicit time steps.

School

Lissajous Curves

Launch Simulator

Beautiful patterns from two frequencies with adjustable ratio.

NewUniversity / research

Butterworth / Chebyshev IIR

Launch Simulator

Design Butterworth, Chebyshev I/II LP/HP filters: |H(f)|, phase, impulse response, and z-plane pole–zero plot via bilinear transform.

PhysSandbox

Interactive physics, chemistry, and engineering simulators for students, teachers, and curious minds.

Physics

  • Classical Mechanics
  • Waves & Sound
  • Electricity & Magnetism

Science

  • Optics & Light
  • Gravity & Orbits
  • Astronomy & The Sky

More

  • Thermodynamics
  • Biophysics, Fluids & Geoscience
  • Math Visualization
  • Engineering
  • Chemistry

© 2026 PhysSandbox. Free interactive science simulators.

PrivacyTermsContact
Home/Math Visualization/STFT & Spectrogram

STFT & Spectrogram

Slide a windowed FFT across the signal: chirps, two-tones, bursts. Tune window M, hop, type — see the time–frequency trade-off live.

Signal & STFT

Signal preset

8
0.25
60dB
2.048s

Shortcuts

  • •Drag on the spectrogram to move the time cursor

Measured values

time resolution Δt64.00ms
freq resolution Δf3.91Hz
overlap75%
frames61
peak f at cursor226.6Hz

About this model

The short-time Fourier transform (STFT) estimates how a signal’s spectrum evolves by sliding a window of length M across the waveform, taking an FFT at each hop, and stacking the magnitude frames into a spectrogram. This simulator feeds chirps, two-tone mixtures, and bursts through a windowed FFT so you can see tones rise, split, or appear transiently. Window type, length M, and hop size control leakage, time resolution, and frequency resolution: larger M sharpens frequency bins but smears onsets, while short windows do the opposite. The model is a standard discrete STFT teaching tool — not a full filter-bank or constant-Q analyzer — and assumes real-valued demo signals without adaptive windowing. Tune M, hop, and window shape to watch the time–frequency trade-off live.

Who it's for: Signal processing, DSP, audio engineering, and applied math courses introducing time–frequency analysis.

Key terms

  • STFT
  • Spectrogram
  • Window function
  • Hop size
  • Time-frequency trade-off
  • FFT

How it works

Short-Time Fourier Transform: slide a window w[n] of length M across the signal in steps of hop, FFT each frame, plot |X(t,f)| in dB as a heatmap. There is a hard time–frequency trade-off: large M sharpens Δf = f_s/M but blurs Δt ≈ M/f_s; small M does the opposite. Try the up-chirp with M = 32 vs M = 1024, or compare windows on the two-tone preset to see leakage on a rectangular window vs Hann/Blackman side-lobes.

Key equations

X(m, k) = Σₙ x[n + m·H] · w[n] · e⁻²πⁱᵏⁿᐟᴹ
Δt = H/f_s, Δf = f_s/M (Heisenberg Δt·Δf ≥ 1/(4π))

Frequently asked questions

Why can’t I get sharp time and frequency resolution at once?
A longer window averages over more samples, so frequency bins narrow but events are blurred in time. A shorter window localizes onsets but widens spectral peaks. That uncertainty is built into the fixed-window STFT.
What does hop size change?
Hop is how far the window advances between frames. Smaller hops densify the time axis and can smooth the spectrogram appearance, but they do not create new frequency resolution beyond what M and the FFT length already set.
Why do tones show vertical stripes or smearing?
Spectral leakage from a finite window spreads energy into neighboring bins; a poor window choice exaggerates side lobes. Chirps smear diagonally because frequency is changing inside each analysis window.