|
| | StftT ()=default |
| | StftT (const StftConfig &config) |
| void | configure (const StftConfig &config) |
| | RT contract: configure() allocates FFT/window/ring/frame storage and is not audio-thread safe.
|
| bool | push_samples (const SampleType *samples, int count) |
| | Feed audio samples.
|
| const StftFrameT< SampleType > & | latest_frame () const |
| | Access the latest computed frame.
|
| bool | frame_ready () const |
| | Whether at least one frame has been computed.
|
| int | num_bins () const |
| | Number of frequency bins (fft_size/2 + 1).
|
| SampleType | window_sum () const |
| | Sum of the configured analysis-window coefficients.
|
| int | fft_size () const |
| | Current FFT size.
|
| int | hop_size () const |
| | Current hop size.
|
| std::vector< SampleType > | latest_magnitude_db (SampleType floor_db=SampleType{-120.0f}) const |
| | Get the latest frame magnitudes in dB. Not RT-safe; returns a vector.
|
| void | reset () |
template<typename SampleType = float>
class pulp::signal::StftT< SampleType >
Allocation-stable STFT processor with single-thread ownership.
Feed samples via push_samples(). When enough samples accumulate for a hop, a complete windowed FFT frame is computed. The latest frame is available via latest_frame().
Intended usage keeps push and read on one thread. For realtime visualization, VisualizationBridge copies audio into fixed SPSC storage in the callback, then its UI-owned poll path calls push_samples(), reads the frame, and publishes a snapshot through TripleBuffer.
The STFT itself is NOT thread-safe for concurrent push/read. A TripleBuffer can publish completed results, but does not make concurrent access to this object safe.