Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::gpu_audio::SpectralFreezeFramer Class Reference

STFT freeze framer: turns an arbitrary-length input stream into hop-spaced analysis frames, drives a SpectralStack (capture on a Freeze rising edge, render every hop), and overlap-adds the synthesized frames back into an arbitrary-length output stream. More...

#include <spectral_stack.hpp>

Public Member Functions

bool prepare (SpectralStack *stack, uint32_t fft_size, uint32_t hop, signal::WindowFunction::Type window=signal::WindowFunction::Type::hann)
 stack must outlive the framer and already be prepared with a matching fft_size.
void process (const float *in, float *out, uint32_t n, const SpectralFreezeControls &ctl)
 Process n input samples → n output samples (mono).
uint32_t fft_size () const
uint32_t hop () const
uint32_t captured_layers () const
void reset ()

Detailed Description

STFT freeze framer: turns an arbitrary-length input stream into hop-spaced analysis frames, drives a SpectralStack (capture on a Freeze rising edge, render every hop), and overlap-adds the synthesized frames back into an arbitrary-length output stream.

Owns no GPU state itself — the SpectralStack does — so it runs unchanged inline (CPU engine) or on the transport worker (GPU engine).

NOTE (SF-4): this deliberately does NOT delegate its WOLA to signal::SpectralFrameEngine. The engine owns both the analysis AND synthesis FFTs and normalizes the spectral→time synthesis it performs on the CPU. This framer instead hands the SpectralStack windowed time-domain frames and receives finished time-domain frames back — because the whole point of GpuSpectralStack is to run advance + smear + weighted-sum + the inverse FFT in ONE on-device submit and read back a completed frame. Routing through the engine would force either a redundant second FFT per hop or move synthesis off the GPU, defeating that batching. The framer's own COLA normalization is valid for the COLA window/hop configs it accepts (it rejects non-dividing hops up front rather than producing wrong output), so the consolidation is intentionally scoped to the jitter contract and the shared device, not the framing math.

Member Function Documentation

◆ captured_layers()

uint32_t pulp::gpu_audio::SpectralFreezeFramer::captured_layers ( ) const
inline

◆ fft_size()

uint32_t pulp::gpu_audio::SpectralFreezeFramer::fft_size ( ) const
inline

◆ hop()

uint32_t pulp::gpu_audio::SpectralFreezeFramer::hop ( ) const
inline

◆ prepare()

bool pulp::gpu_audio::SpectralFreezeFramer::prepare ( SpectralStack * stack,
uint32_t fft_size,
uint32_t hop,
signal::WindowFunction::Type window = signal::WindowFunction::Type::hann )

stack must outlive the framer and already be prepared with a matching fft_size.

hop must divide evenly into the overlap (hop <= fft_size).

◆ process()

void pulp::gpu_audio::SpectralFreezeFramer::process ( const float * in,
float * out,
uint32_t n,
const SpectralFreezeControls & ctl )

Process n input samples → n output samples (mono).

RT-safety depends on the stack: the CPU stack is heavy-but-bounded; the GPU stack blocks on readback, so the GPU path must run off the audio thread.

◆ reset()

void pulp::gpu_audio::SpectralFreezeFramer::reset ( )

The documentation for this class was generated from the following file: