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). | |
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.
|
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.
|
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.
|
overridevirtual |
Deactivate a layer (its magnitude goes silent; phase keeps advancing).
Implements pulp::gpu_audio::SpectralStack.
|
inlineoverridevirtual |
Implements pulp::gpu_audio::SpectralStack.
|
overridevirtual |
Implements pulp::gpu_audio::SpectralStack.
|
inlineoverridevirtual |
Implements pulp::gpu_audio::SpectralStack.
| bool pulp::gpu_audio::CpuSpectralStack::prepare | ( | uint32_t | fft_size, |
| uint32_t | hop, | ||
| uint32_t | num_layers ) |
|
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.