Class VariableBlockSizeAdapter

Class Documentation

class ear::dsp::VariableBlockSizeAdapter

Adapt something that processes fixed-size blocks of samples into one that processes variable sized blocks by adding some delay.

This can be used with e.g. BlockConvolver to process arbitrary block lengths. This isn’t built into the BlockConvolver, because it’s not always necessary, and because this introduces some delay; if we adapt multiple components with this then we can save some delay compared to having it built into each component.

Public Types

using ProcessFunc = void(const float *const *in, float *const *out)

Public Functions

VariableBlockSizeAdapter(size_t block_size, size_t num_channels_in, size_t num_channels_out, std::function<ProcessFunc> process_func)
Parameters
  • block_size – number of samples accepted by process_func

  • num_channels_in – number of input channels

  • num_channels_out – number of output channels

  • process_func – function to call to process block_size samples

void process(size_t nsamples, const float *const *in, float *const *out)

Process nsamples samples.

int get_delay() const

The delay introduced by the variable block size processing, not accounting for any delay introduced by the inner process.