SAF
Loading...
Searching...
No Matches
matrixconv.h File Reference

A standard matrix convolver. More...

#include "_common.h"

Go to the source code of this file.

Functions

void matrixconv_create (void **const phMCnv)
 Creates an instance of matrixconv.
 
void matrixconv_destroy (void **const phMCnv)
 Destroys an instance of matrixconv.
 
void matrixconv_init (void *const hMCnv, int samplerate, int hostBlockSize)
 Initialises an instance of matrixconv with default settings.
 
void matrixconv_process (void *const hMCnv, const float *const *inputs, float *const *const outputs, int nInputs, int nOutputs, int nSamples)
 Performs the matrix convolution processing.
 
void matrixconv_refreshParams (void *const hMCnv)
 Sets all intialisation flags to 1.
 
void matrixconv_checkReInit (void *const hMCnv)
 Checks whether things have to be reinitialised, and does so if it is needed.
 
void matrixconv_setFilters (void *const hMCnv, const float *const *H, int numChannels, int numSamples, int sampleRate)
 Loads the matrix of filters, which should have the input filters concatenated for each output.
 
void matrixconv_setEnablePart (void *const hMCnv, int newState)
 Enable (1), disable (0), partitioned convolution.
 
void matrixconv_setNumInputChannels (void *const hMCnv, int newValue)
 Sets the number of input channels.
 
int matrixconv_getFrameSize (void)
 Returns the processing framesize (i.e., number of samples processed with every _process() call )
 
int matrixconv_getEnablePart (void *const hMCnv)
 Returns a flag indicating whether partitioned convolution is enabled (1) or disabled (0)
 
int matrixconv_getNumInputChannels (void *const hMCnv)
 Returns the number input channels.
 
int matrixconv_getNumOutputChannels (void *const hMCnv)
 Returns the number of output channels (the same as the number of channels in the loaded wav file)
 
int matrixconv_getHostBlockSize (void *const hMCnv)
 Returns the currect host block size.
 
int matrixconv_getNfilters (void *const hMCnv)
 Returns the number of filters in the loaded wav file (number of outputs multiplied by the number of inputs)
 
int matrixconv_getFilterLength (void *const hMCnv)
 Returns the current filter length, in samples.
 
int matrixconv_getFilterFs (void *const hMCnv)
 Returns the samplerate of the loaded filters.
 
int matrixconv_getHostFs (void *const hMCnv)
 Returns the samperate of the host.
 
int matrixconv_getProcessingDelay (void *const hMCnv)
 Returns the processing delay in samples (may be used for delay compensation features)
 

Detailed Description

A standard matrix convolver.

Author
Leo McCormack
Date
30.09.2019
License
ISC

Definition in file matrixconv.h.

Function Documentation

◆ matrixconv_checkReInit()

void matrixconv_checkReInit ( void *const hMCnv)

Checks whether things have to be reinitialised, and does so if it is needed.

Examples
matrixconv.h.

Definition at line 172 of file matrixconv.c.

◆ matrixconv_create()

void matrixconv_create ( void **const phMCnv)

Creates an instance of matrixconv.

Parameters
[in]phMCnv(&) address of matrixconv handle
Examples
matrixconv.h.

Definition at line 28 of file matrixconv.c.

◆ matrixconv_destroy()

void matrixconv_destroy ( void **const phMCnv)

Destroys an instance of matrixconv.

Parameters
[in]phMCnv(&) address of matrixconv handle
Examples
matrixconv.h.

Definition at line 60 of file matrixconv.c.

◆ matrixconv_getEnablePart()

int matrixconv_getEnablePart ( void *const hMCnv)

Returns a flag indicating whether partitioned convolution is enabled (1) or disabled (0)

Examples
matrixconv.h.

Definition at line 266 of file matrixconv.c.

◆ matrixconv_getFilterFs()

int matrixconv_getFilterFs ( void *const hMCnv)

Returns the samplerate of the loaded filters.

Examples
matrixconv.h.

Definition at line 302 of file matrixconv.c.

◆ matrixconv_getFilterLength()

int matrixconv_getFilterLength ( void *const hMCnv)

Returns the current filter length, in samples.

Examples
matrixconv.h.

Definition at line 296 of file matrixconv.c.

◆ matrixconv_getHostBlockSize()

int matrixconv_getHostBlockSize ( void *const hMCnv)

Returns the currect host block size.

Examples
matrixconv.h.

Definition at line 284 of file matrixconv.c.

◆ matrixconv_getHostFs()

int matrixconv_getHostFs ( void *const hMCnv)

Returns the samperate of the host.

Examples
matrixconv.h.

Definition at line 308 of file matrixconv.c.

◆ matrixconv_getNfilters()

int matrixconv_getNfilters ( void *const hMCnv)

Returns the number of filters in the loaded wav file (number of outputs multiplied by the number of inputs)

Examples
matrixconv.h.

Definition at line 290 of file matrixconv.c.

◆ matrixconv_getNumInputChannels()

int matrixconv_getNumInputChannels ( void *const hMCnv)

Returns the number input channels.

Examples
matrixconv.h.

Definition at line 272 of file matrixconv.c.

◆ matrixconv_getNumOutputChannels()

int matrixconv_getNumOutputChannels ( void *const hMCnv)

Returns the number of output channels (the same as the number of channels in the loaded wav file)

Examples
matrixconv.h.

Definition at line 278 of file matrixconv.c.

◆ matrixconv_getProcessingDelay()

int matrixconv_getProcessingDelay ( void *const hMCnv)

Returns the processing delay in samples (may be used for delay compensation features)

Examples
matrixconv.h.

Definition at line 314 of file matrixconv.c.

◆ matrixconv_init()

void matrixconv_init ( void *const hMCnv,
int samplerate,
int hostBlockSize )

Initialises an instance of matrixconv with default settings.

Parameters
[in]hMCnvmatrixconv handle
[in]samplerateHost samplerate.
[in]hostBlockSizeHost frame/block size
Examples
matrixconv.h.

Definition at line 80 of file matrixconv.c.

◆ matrixconv_process()

void matrixconv_process ( void *const hMCnv,
const float *const * inputs,
float *const *const outputs,
int nInputs,
int nOutputs,
int nSamples )

Performs the matrix convolution processing.

Parameters
[in]hMCnvmatrixconv handle
[in]inputsInput channel buffers; 2-D array: nInputs x nSamples
[in]outputsOutput channel buffers; 2-D array: nOutputs x nSamples
[in]nInputsNumber of input channels
[in]nOutputsNumber of output channels
[in]nSamplesNumber of samples in 'inputs'/'output' matrices
Examples
matrixconv.h.

Definition at line 100 of file matrixconv.c.

◆ matrixconv_refreshParams()

void matrixconv_refreshParams ( void *const hMCnv)

Sets all intialisation flags to 1.

Re-initialising all settings/variables, as matrixconv is currently configured, at next available opportunity.

Examples
matrixconv.h.

Definition at line 166 of file matrixconv.c.

◆ matrixconv_setEnablePart()

void matrixconv_setEnablePart ( void *const hMCnv,
int newState )

Enable (1), disable (0), partitioned convolution.

Examples
matrixconv.h.

Definition at line 242 of file matrixconv.c.

◆ matrixconv_setFilters()

void matrixconv_setFilters ( void *const hMCnv,
const float *const * H,
int numChannels,
int numSamples,
int sampleRate )

Loads the matrix of filters, which should have the input filters concatenated for each output.

For example, a matrix: 25 x 32 x 512 (numInputs x numOutputs x filterLength) should be loaded as a 25 x 16384 (note 32x512=16384).

This is then divided by the number of inputs, which should be user specified to be 32 in this case.

Parameters
[in]hMCnvmatrixconv handle
[in]HInput channel buffers; 2-D array: numChannels x nSamples
[in]numChannelsNumber of channels in loaded data (also the number of outputs)
[in]numSamplesNumber of samples (per channel) in the loaded data
[in]sampleRateSamplerate of the loaded data
Examples
matrixconv.h.

Definition at line 209 of file matrixconv.c.

◆ matrixconv_setNumInputChannels()

void matrixconv_setNumInputChannels ( void *const hMCnv,
int newValue )

Sets the number of input channels.

Note
The loaded wav data channels are divided by the number of channels (into equal lengths). These are interpreted by matrixconv as the filters to apply to each input channel to acquire the corresponding output channel
Examples
matrixconv.h.

Definition at line 251 of file matrixconv.c.