You will be able to
- Calculate unpadded STFT frame and bin counts.
- Explain window duration, hop and latency trade-offs.
Local transforms
The short-time Fourier transform applies a window to successive frames and transforms each one. A spectrogram usually displays magnitude or power against time and frequency; the complex STFT contains phase too. This lesson’s lab calculates shapes and storage, not a measured spectrogram.
Choose what you need to see
Longer windows describe narrower frequency features but mix events across more time. Smaller hops produce more overlapping frames without making each window shorter. FFT size can exceed frame length by zero-padding; it refines the bin grid, not the duration of observed information. Centring and padding change frame count, timing and online latency.
Worked example
L=1,024, W=256, H=128, K=256 yields 7 frames and 129 complex bins per frame. At 8 ksample/s, each window spans 32 ms.
A common trap
A smaller hop does not by itself improve the frequency resolution of each frame. Overlap and window duration do different jobs.
Predict, then experiment
If you halve the hop with window size fixed, what happens to frame count and window duration? Before touching the controls, say or write your prediction.
Interactive experiment
Shapes through an STFT pipeline
How do framing choices determine the output tensor and its storage?
The estimate assumes an unpadded, one-sided transform and stores real and imaginary FP32 values. It is an analytical size estimate, not a runtime benchmark.
Your experiment
Set signal length 48000, rate 48000, frame/FFT 1024, hop 256. Compare hop 512, then FFT 2048. Keep FFT at least as large as frame size.
Change one parameter at a time. Compare what you observed with your prediction and record an explanation in your notes.
Check your understanding
Try from memory first. Hints and feedback are part of learning, not a penalty. These checks are for self-study, not a graded qualification.
Reference answers (after your attempt)
- refines frequency-bin spacing — Correct: measured window duration remains fixed.
- 7frames — 1+floor((1024−256)/128)=7.
Apply it: Design an online analyser
Use paper, your notes, or a local notebook/editor. Code examples are Python 3 starting points to run yourself; this page does not execute code or automatically assess the practical task.
- Choose a rate, frame length and hop for tracking brief events.
- Calculate window duration and frame rate.
- Specify padding, timestamps and the acceptable latency.
Reference solution & review criteria
Example: 16 ksample/s, W=320, H=160 gives 20 ms windows and 100 frames/s. Causal/end-aligned framing avoids future padding assumptions, but acquisition and processing still contribute latency.
Your notebook
Notes and progress stay in this browser. They are not sent to the server; ordinary web-server request logs still operate. Export a backup from the course page.
Completion requires both correct checks and your practical-task acknowledgement.
Go deeper
Sources support further study; the worked examples and questions here are original. Browser experiments are small, disclosed models—not evidence of production-model quality or hardware performance.