stft.h
A short-time Fourier transform you can process in the middle of.
#include <sonore/stft.h>- 1type
- Guides: Getting started, MIDI and MPE
On this page
Design notes
fft.h has the transform, an analyser that only LOOKS, and a convolver that does one specific thing in the frequency domain. What was missing was the general frame: window, transform, hand the spectrum to the caller, transform back, overlap-add -- the substrate of a spectral gate, a denoiser, a freeze, a vocoder, a phase vocoder. This is that frame, and only that: the processing is the functor you pass in.
Reconstruction is EXACT, not approximately: the overlap-add normalisation is computed at prepare() by summing the squared window over one hop's worth of positions, and every output sample is divided by the sum at its position. That holds for any window and any overlap where the sum is never zero, which is every sensible combination, and it means the identity processor gives back the input to float precision -- asserted in the unit test -- rather than the 1.5x-with-ripple that a "Hann at 75% is COLA" shortcut produces with a symmetric window.
Included by dsp.h. Depends on Fft<> from fft.h.