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

More from Math Visualization

Other simulators in this category — or see all 85.

View category →
NewUniversity / research

Morlet Wavelet (CWT)

Launch Simulator

Continuous wavelet transform with the complex Morlet wavelet: scaleogram |W(s,t)|, log-frequency axis, cone of influence, adjustable ω₀ and scale range.

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.

NewUniversity / research

Kalman Filter (1-D)

Launch Simulator

Recursive optimal estimation: noisy measurements, hidden truth, predict + update with Q and R; random-walk or constant-velocity model with ±2σ band and innovations.

NewUniversity / research

Kalman Filter 2D Tracking

Launch Simulator

4-state constant-velocity tracker: noisy (x,y) measurements, process acceleration noise Q, measurement variance R, and a live ≈2σ covariance ellipse.

NewUniversity / research

Lattice Boltzmann D2Q9 Flow

Launch Simulator

Interactive D2Q9 BGK solver: lid-driven cavity or flow past a cylinder, vorticity colors, Reynolds-number control, and bounce-back walls.

NewUniversity / research

Finite-Volume Advection-Diffusion 2D

Launch Simulator

Conservative scalar transport on a 2D grid: face fluxes, upwind vs central interpolation, Peclet number, CFL, and numerical diffusion.

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.