STFT (Short-Time Fourier Transform)
What it is
A technique that converts a time-domain signal (audio, sensor data, vibration) into a time-frequency representation by applying the Fourier transform to short overlapping windows of the signal.
What It’s Used for
It is used to extract spectral features (spectrograms) from raw waveforms for tasks like speech recognition, audio classification, keyword spotting, anomaly detection from vibration/IMU sensors, and as a preprocessing step before feeding data into a neural network.
Why and how it Helps
Raw audio or sensor signals mix many frequencies over time in a way that’s hard for simple models to learn from directly; STFT slices the signal into small time windows and computes the frequency content of each, producing a 2D spectrogram that reveals how frequencies change over time. This representation is much more compact and informative for pattern recognition, letting CNNs or small models treat it like an image.
When to Use it
Use STFT when you need interpretable, hand-crafted frequency features for low-power edge devices (e.g. keyword spotting, predictive maintenance) where compute and memory are limited and classic DSP pipelines are well understood and cheap to run. Avoid it when you need adaptive time-frequency resolution (consider wavelet transforms) or when end-to-end learned features from raw waveforms outperform it and compute budget allows; also note STFT has a fixed time-frequency tradeoff controlled by window size, which must be tuned per application.