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

CPU reference + always-available fallback. More...

#include <spectral_stack.hpp>

Public Member Functions

bool prepare (uint32_t fft_size, uint32_t hop, uint32_t num_layers)
uint32_t fft_size () const override
uint32_t num_layers () const override
bool available () const override
 True if this stack's compute backend is live.
bool capture (uint32_t layer, const float *frame_in) override
 Analyze frame_in (fft_size real samples) with the analysis window and freeze its magnitude + phase into layer, activating it.
void clear (uint32_t layer) override
 Deactivate a layer (its magnitude goes silent; phase keeps advancing).
bool layer_active (uint32_t layer) const override
bool render (float *frame_out, const float *weights, float smear, float jitter) override
 Advance + smear + weighted-sum the stack into frame_out (fft_size real samples).

Detailed Description

CPU reference + always-available fallback.

Holds each layer's magnitude and a persistent per-bin phase; render() advances the phase, smears, weighted-sums every active layer and does ONE inverse FFT. This is the bit-for-bit semantic the GPU stack reproduces — and the engine used when there's no GPU device.

Member Function Documentation

◆ available()

bool pulp::gpu_audio::CpuSpectralStack::available ( ) const
inlineoverridevirtual

True if this stack's compute backend is live.

The CPU stack is always available; the GPU stack is available only with a GPU device.

Implements pulp::gpu_audio::SpectralStack.

◆ capture()

bool pulp::gpu_audio::CpuSpectralStack::capture ( uint32_t layer,
const float * frame_in )
overridevirtual

Analyze frame_in (fft_size real samples) with the analysis window and freeze its magnitude + phase into layer, activating it.

Implements pulp::gpu_audio::SpectralStack.

◆ clear()

void pulp::gpu_audio::CpuSpectralStack::clear ( uint32_t layer)
overridevirtual

Deactivate a layer (its magnitude goes silent; phase keeps advancing).

Implements pulp::gpu_audio::SpectralStack.

◆ fft_size()

uint32_t pulp::gpu_audio::CpuSpectralStack::fft_size ( ) const
inlineoverridevirtual

◆ layer_active()

bool pulp::gpu_audio::CpuSpectralStack::layer_active ( uint32_t layer) const
overridevirtual

◆ num_layers()

uint32_t pulp::gpu_audio::CpuSpectralStack::num_layers ( ) const
inlineoverridevirtual

◆ prepare()

bool pulp::gpu_audio::CpuSpectralStack::prepare ( uint32_t fft_size,
uint32_t hop,
uint32_t num_layers )

◆ render()

bool pulp::gpu_audio::CpuSpectralStack::render ( float * frame_out,
const float * weights,
float smear,
float jitter )
overridevirtual

Advance + smear + weighted-sum the stack into frame_out (fft_size real samples).

weights (length num_layers) scales each layer; smear (0..1) blurs magnitude across frequency; jitter (0..1) adds phase wander. Returns false if no layer is active or the backend is unavailable.

Implements pulp::gpu_audio::SpectralStack.


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