Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::signal::ConvolverInputHistoryT< SampleType > Struct Template Reference

The convolver's input-side overlap-save history. More...

#include <convolver_messages.hpp>

Public Attributes

int block_size = 0
int fft_size = 0
ConvolverSpectrumArenaT< SampleType > spectra
 Ring of forward FFTs of recent input blocks.
std::vector< std::complex< SampleType > > overlap
 Overlap-save window: fft_size complex slots whose leading fft_size scalars hold the real window, previous block first, then the current one.
std::size_t write_pos = 0

Detailed Description

template<typename SampleType = float>
struct pulp::signal::ConvolverInputHistoryT< SampleType >

The convolver's input-side overlap-save history.

This belongs to the INPUT STREAM, not to any impulse response: it is the ring of forward FFTs of recent input blocks plus the time-domain overlap buffer, and what is in it depends only on the audio that has already been fed in. Its identity therefore does not change when the IR changes.

PartitionedConvolver owns exactly one of these and renders EVERY live IR against it — including both sides of a crossfade — so an IR swap never restarts the history and the incoming IR never has to convolve against silence. It is also why a crossfade costs one forward FFT per block rather than two.

Ring capacity (spectra.size()) must be at least the partition count of every IR rendering against it, so that the ages an IR reads back map to distinct slots. A ConvolverIrStateT carries a pre-allocated history sized for its own partition count as a SPARE; the convolver adopts that spare only when it needs a longer ring than it already has, which is what keeps ring growth allocation-free on the audio thread.

Member Data Documentation

◆ block_size

template<typename SampleType = float>
int pulp::signal::ConvolverInputHistoryT< SampleType >::block_size = 0

◆ fft_size

template<typename SampleType = float>
int pulp::signal::ConvolverInputHistoryT< SampleType >::fft_size = 0

◆ overlap

template<typename SampleType = float>
std::vector<std::complex<SampleType> > pulp::signal::ConvolverInputHistoryT< SampleType >::overlap

Overlap-save window: fft_size complex slots whose leading fft_size scalars hold the real window, previous block first, then the current one.

Zero-filled is a valid cold start.

◆ spectra

template<typename SampleType = float>
ConvolverSpectrumArenaT<SampleType> pulp::signal::ConvolverInputHistoryT< SampleType >::spectra

Ring of forward FFTs of recent input blocks.

Each slot holds the fft_size / 2 + 1 bins DC..Nyquist, the only ones written and read: the input is real, so the upper half of its spectrum is redundant.

write_pos is advanced once per processed block, after every IR has rendered, so it means two different things depending on when you look — get this wrong and the delay line is silently off by one:

  • DURING a block, it is the slot the block being processed occupies, so the block of age a sits at (write_pos + capacity - a) % capacity and partition p of an IR reads age p;
  • BETWEEN blocks (where a swap happens), it is the slot the NEXT block will occupy, so the most recently written block is at write_pos - 1.

◆ write_pos

template<typename SampleType = float>
std::size_t pulp::signal::ConvolverInputHistoryT< SampleType >::write_pos = 0

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