VISR  0.11.8
Versatile Interactive Scene Renderer
visr::rbbl::CrossfadingConvolverUniform< SampleType > Class Template Reference

#include <crossfading_convolver_uniform.hpp>

Public Types

using FrequencyDomainType = typename CoreConvolverUniform< SampleType >::FrequencyDomainType
 

Public Member Functions

 CrossfadingConvolverUniform (std::size_t numberOfInputs, std::size_t numberOfOutputs, std::size_t blockLength, std::size_t maxFilterLength, std::size_t maxRoutingPoints, std::size_t maxFilterEntries, std::size_t transitionSamples, FilterRoutingList const &initialRoutings=FilterRoutingList(), efl::BasicMatrix< SampleType > const &initialFilters=efl::BasicMatrix< SampleType >(), std::size_t alignment=0, char const *fftImplementation="default")
 
 ~CrossfadingConvolverUniform ()
 
std::size_t numberOfInputs () const
 
std::size_t numberOfOutputs () const
 
std::size_t blockLength () const
 
std::size_t dftBlockRepresentationSize () const
 
std::size_t dftFilterRepresentationSize () const
 
std::size_t alignment () const
 
std::size_t complexAlignment () const
 
std::size_t maxNumberOfRoutingPoints () const
 
std::size_t maxNumberOfFilterEntries () const
 
std::size_t maxFilterLength () const
 
std::size_t numberOfRoutingPoints () const
 
void process (SampleType const *const input, std::size_t inputStride, SampleType *const output, std::size_t outputStride, std::size_t alignment=0)
 
void clearRoutingTable ()
 
void initRoutingTable (FilterRoutingList const &routings)
 
void setRoutingEntry (FilterRouting const &routing)
 
void setRoutingEntry (std::size_t inputIdx, std::size_t outputIdx, std::size_t filterIdx, SampleType gain)
 
bool removeRoutingEntry (std::size_t inputIdx, std::size_t outputIdx)
 
void transformImpulseResponse (SampleType const *ir, std::size_t irLength, FrequencyDomainType *result, std::size_t alignment=0) const
 
void clearFilters ()
 
void initFilters (efl::BasicMatrix< SampleType > const &newImpulseResponses)
 
void setImpulseResponse (SampleType const *ir, std::size_t filterLength, std::size_t filterIdx, std::size_t alignment=0)
 
void setTransformedFilter (FrequencyDomainType const *fdFilter, std::size_t filterIdx, std::size_t alignment)
 

Detailed Description

template<typename SampleType>
class visr::rbbl::CrossfadingConvolverUniform< SampleType >

Generic class for MIMO convolution using a uniformly partioned fast convolution algorithm. It supports a arbitrary numbers of input and output channels and enables filters and an optional gain factor for arbitrary input-output connections.

Template Parameters
SampleTypeThe floating-point type of the signal samples

Member Typedef Documentation

Constructor & Destructor Documentation

template<typename SampleType >
visr::rbbl::CrossfadingConvolverUniform< SampleType >::CrossfadingConvolverUniform ( std::size_t  numberOfInputs,
std::size_t  numberOfOutputs,
std::size_t  blockLength,
std::size_t  maxFilterLength,
std::size_t  maxRoutingPoints,
std::size_t  maxFilterEntries,
std::size_t  transitionSamples,
FilterRoutingList const &  initialRoutings = FilterRoutingList(),
efl::BasicMatrix< SampleType > const &  initialFilters = efl::BasicMatrix<SampleType>(),
std::size_t  alignment = 0,
char const *  fftImplementation = "default" 
)
explicit

Constructor.

Parameters
numberOfInputsThe number of input signals processed.
numberOfOutputsThe number of output channels produced.
blockLengthThe numbers of samples processed for each input or output channels in one process() call.
maxFilterLengthThe maximum length of the FIR filters (in samples).
maxRoutingPointsThe maximum number of routing points between input and output channels, i.e., the number of filter operations to be calculated.
maxFilterEntriesThe maximum number of filters that can be stored within the filter. This number can be different from maxRoutingPoints, as the convolver can both reuse the same filter representation multiple times, or store multiple filter representations to enable switching of the filter characteristics at runtime.
transitionSamplesThe duration of the crossfade (in samples)
initialRoutingsThe initial set of routing points.
initialFiltersThe initial set of filter coefficients. The matrix rows represent the distinct filters.
alignmentThe alignment (given as a multiple of the sample type size) to be used to allocate all data structure. It also guaranteees the alignment of the input and output samples to the process call.
fftImplementationA string to determine the FFT wrapper to be used. The default value results in using the default FFT implementation for the given data type.
template<typename SampleType >
visr::rbbl::CrossfadingConvolverUniform< SampleType >::~CrossfadingConvolverUniform ( )
default

Destructor.

Member Function Documentation

template<typename SampleType>
std::size_t visr::rbbl::CrossfadingConvolverUniform< SampleType >::alignment ( ) const
inline
template<typename SampleType>
std::size_t visr::rbbl::CrossfadingConvolverUniform< SampleType >::blockLength ( ) const
inline
template<typename SampleType >
void visr::rbbl::CrossfadingConvolverUniform< SampleType >::clearFilters ( )

Reset all contained filters to zero. This also resets the currenly running, interpolated filters, effectively muting the output of the convolution.

Note
The semantics of this function differs from setFilters / setImpulseResponse / setTransformedFilter, which
template<typename SampleType >
void visr::rbbl::CrossfadingConvolverUniform< SampleType >::clearRoutingTable ( )

Manipulation of the routing table. Remove all entries from the routing table.

template<typename SampleType>
std::size_t visr::rbbl::CrossfadingConvolverUniform< SampleType >::complexAlignment ( ) const
inline
template<typename SampleType>
std::size_t visr::rbbl::CrossfadingConvolverUniform< SampleType >::dftBlockRepresentationSize ( ) const
inline
template<typename SampleType>
std::size_t visr::rbbl::CrossfadingConvolverUniform< SampleType >::dftFilterRepresentationSize ( ) const
inline
template<typename SampleType >
void visr::rbbl::CrossfadingConvolverUniform< SampleType >::initFilters ( efl::BasicMatrix< SampleType > const &  newImpulseResponses)

Load a new set of impulse responses, resetting all prior loaded filters. If there are fewer filters in the matrix than the maximum admissible number, the remaining filters are set to zero. Likewise, if the length of the new filters is less than the maximum allowed filter length, the remaining elements are set to zero.

Parameters
newImpulseResponsesThe matrix of new filters, with each row representing an impulse response.
Exceptions
std::invalid_argumentIf the number of filters (number of rows) exceeds the maximum admissible number of filters.
std::invalid_argumeentIf the length of the filters (number of matrix columns) exceeds the maximum admissible length,
Note
This function does not affect the currently set (interpolated) filters used in the running convolution.
template<typename SampleType >
void visr::rbbl::CrossfadingConvolverUniform< SampleType >::initRoutingTable ( FilterRoutingList const &  routings)

Initialize the routing table from a set of entries. All pre-existing entries are cleared beforehand.

Parameters
routingsA vector of routing entries
Exceptions
std::invalid_argumentIf the number of new entries exceeds the maximally permitted number of routings
std::invalid_argumentIf any input, output, or filter index exceeds the admissible range for the respective type.
template<typename SampleType>
std::size_t visr::rbbl::CrossfadingConvolverUniform< SampleType >::maxFilterLength ( ) const
inline
template<typename SampleType>
std::size_t visr::rbbl::CrossfadingConvolverUniform< SampleType >::maxNumberOfFilterEntries ( ) const
inline
template<typename SampleType>
std::size_t visr::rbbl::CrossfadingConvolverUniform< SampleType >::maxNumberOfRoutingPoints ( ) const
inline
template<typename SampleType>
std::size_t visr::rbbl::CrossfadingConvolverUniform< SampleType >::numberOfInputs ( ) const
inline
template<typename SampleType>
std::size_t visr::rbbl::CrossfadingConvolverUniform< SampleType >::numberOfOutputs ( ) const
inline
template<typename SampleType>
std::size_t visr::rbbl::CrossfadingConvolverUniform< SampleType >::numberOfRoutingPoints ( ) const
inline
template<typename SampleType >
void visr::rbbl::CrossfadingConvolverUniform< SampleType >::process ( SampleType const *const  input,
std::size_t  inputStride,
SampleType *const  output,
std::size_t  outputStride,
std::size_t  alignment = 0 
)
template<typename SampleType >
bool visr::rbbl::CrossfadingConvolverUniform< SampleType >::removeRoutingEntry ( std::size_t  inputIdx,
std::size_t  outputIdx 
)
Returns
true if the entry was removes, false if not (i.e., the entry did not exist).
template<typename SampleType >
void visr::rbbl::CrossfadingConvolverUniform< SampleType >::setImpulseResponse ( SampleType const *  ir,
std::size_t  filterLength,
std::size_t  filterIdx,
std::size_t  alignment = 0 
)
template<typename SampleType >
void visr::rbbl::CrossfadingConvolverUniform< SampleType >::setRoutingEntry ( FilterRouting const &  routing)

Add a new routing to the routing table.

Exceptions
std::invalid_argumentIf adding the entry would exceed the maximally permitted number of routings
std::invalid_argumentIf any input, output, or filter index exceeds the admissible range for the respective type.
template<typename SampleType >
void visr::rbbl::CrossfadingConvolverUniform< SampleType >::setRoutingEntry ( std::size_t  inputIdx,
std::size_t  outputIdx,
std::size_t  filterIdx,
SampleType  gain 
)

Add a new routing to the routing table.

Exceptions
std::invalid_argumentIf adding the entry would exceed the maximally permitted number of routings
std::invalid_argumentIf any input, output, or filter index exceeds the admissible range for the respective type.
template<typename SampleType >
void visr::rbbl::CrossfadingConvolverUniform< SampleType >::setTransformedFilter ( FrequencyDomainType const *  fdFilter,
std::size_t  filterIdx,
std::size_t  alignment 
)

Set a transformed filter (i.e., in the partitioned, zero-padded representation) to a given filter (routing) slot.

Note
The transformed filter should be obtained using transformImpulseResponse(), because the actual format (block size, padding, etc.) depends on the convolver.
template<typename SampleType >
void visr::rbbl::CrossfadingConvolverUniform< SampleType >::transformImpulseResponse ( SampleType const *  ir,
std::size_t  irLength,
FrequencyDomainType result,
std::size_t  alignment = 0 
) const

Query the currently active number of routings. Manipulation of the contained filter representation. Transform an impulse response into the partitioned frequency-domain representation

Todo:
The semantics of the alignment parameter would be clearer if it would be in bytes.

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