Skip to content

HIRT documentation

Maxime Sirbu edited this page Dec 5, 2022 · 2 revisions

This page aims to document HIRT classes and methods to be used in other contexts than HISS own max packages.

HIRT implements a partitionned convolution algorithm, the detail of how an algorithm is implemented is explained in this paper

The method consists of computing the multiplication in frequency space of the two signal ffts in chunks of different sizes. Smaller ones at the beginning and bigger ones in the end. This aims to allow processing convolution of large buffers while allowing a small latency.

Convolver

Convolver is the base class for computing convolutions from a source with number of channels to a destination with any number of channels. There are three different latency modes that can be used:

  • kLatencyZero is supposed to have effective zero latency. It's achieved by using a time-based convolution as the first part of partitionned convolution, instead of frequency-based. It usefulness can be appreciated according to the current buffer size for audio computation, since it can already implie a latency.
  • kLatencyShort use a partition of size 256, 1024, 4096, 16384.
  • kLatencyMedium use a partition of size 1024, 4096, 16384.

Latency mode can be set accordingly to the current audio buffer size (e.g. with an audio buffer size > 1024 kLatencyMedium should be chosen).

Convolver::Convolver

  • Convolver::Convolver(uint32_t numIO, LatencyMode latency) constructs a convolver with numIO channels, ie each input channel will be convolved to exactly one output channel.
  • Convolver(uint32_t numIO, LatencyMode latency) constructs a convolver with numIns to numOuts cross convolutions. Each input will be convolved to every output with its own impulse response.

Convolver::clear

  • void Convolver::clear(uint32_t inChan, uint32_t outChan, bool resize) clears the IR set from channel inChan to outChan. If resize the channel convolver will have its partionned structure resized.
  • void Convolver::clear(bool resize) clears all channel IR.
Clone this wiki locally