sfFDN
Loading...
Searching...
No Matches
Matrix Gallery

A collection of functions to generate various types of feedback matrices. More...

Functions

std::vector< float > sfFDN::GenerateMatrix (uint32_t mat_size, ScalarMatrixType type, uint32_t seed=0, std::optional< float > arg=std::nullopt)
 Generates a square matrix of size mat_size x mat_size based on the specified type.
 
std::vector< float > sfFDN::NestedAllpassMatrix (uint32_t mat_size, uint32_t seed=0, std::span< float > input_gains=std::span< float >(), std::span< float > output_gains=std::span< float >())
 Generates a nested allpass matrix of size mat_size x mat_size as described in [1].
 

Detailed Description

A collection of functions to generate various types of feedback matrices.

Function Documentation

◆ GenerateMatrix()

std::vector< float > sfFDN::GenerateMatrix ( uint32_t mat_size,
ScalarMatrixType type,
uint32_t seed = 0,
std::optional< float > arg = std::nullopt )

Generates a square matrix of size mat_size x mat_size based on the specified type.

Parameters
mat_sizeThe size of the matrix (number of rows and columns).
typeThe type of matrix to generate.
seedSeed for random number generation (used for Random and RandomHouseholder types).
argOptional argument for certain matrix types.
Returns
A flat vector containing the matrix elements in col-major order.

For the VariableDiffusion type, the optional argument 'arg' specifies the sparsity level (0 <= arg <= 1).

Adapted from the implementation in the FDNTB toolbox by S. J. Schlecht: https://github.com/SebastianJiroSchlecht/fdnToolbox/blob/master/Generate/fdnMatrixGallery.m

◆ NestedAllpassMatrix()

std::vector< float > sfFDN::NestedAllpassMatrix ( uint32_t mat_size,
uint32_t seed = 0,
std::span< float > input_gains = std::span< float >(),
std::span< float > output_gains = std::span< float >() )

Generates a nested allpass matrix of size mat_size x mat_size as described in [1].

Parameters
mat_sizeThe size of the matrix (number of rows and columns). Must be a power of two.
seedSeed for random number generation.
input_gains[Optional|Out]: input gains for the allpass filters.
output_gains[Optional|Out]: output gains for the allpass filters.
Returns
A flat vector containing the matrix elements in col-major order.
Note
[1] William G. Gardner; A real‐time multichannel room simulator. J. Acoust. Soc. Am. 1 October 1992; 92 (4_Supplement): 2395. https://doi.org/10.1121/1.404752