34 *phMCnv = (
void*)pData;
103 const float *
const * inputs,
104 float*
const*
const outputs,
119 for(s=0; s<nSamples; s++){
123 for(; ch<numChannels; ch++)
129 for(; ch<nOutputs; ch++)
130 outputs[ch][s] = 0.0f;
140 for(i=0; i < numChannels; i++)
203 const float*
const* H,
215 for(i=0; i<numChannels; i++)
216 memcpy(&(pData->
filters[i*numSamples]), H[i], numSamples*
sizeof(
float));
#define MAX_NUM_CHANNELS
Maximum number of input/output channels supported.
void saf_multiConv_destroy(void **const phMC)
Destroys an instance of multiConv.
#define SAF_CLAMP(a, min, max)
Ensures value "a" is clamped between the "min" and "max" values.
void saf_multiConv_apply(void *const hMC, float *inputSig, float *outputSig)
Performs the multi-channel convolution.
void utility_svvcopy(const float *a, const int len, float *c)
Single-precision, vector-vector copy, i.e.
void saf_multiConv_create(void **const phMC, int hopSize, float *H, int length_h, int nCH, int usePartFLAG)
Creates an instance of multiConv.
#define SAF_MIN(a, b)
Returns the minimum of the two values.
#define MIN_FRAME_SIZE
Minimum framesize, in time-domain samples.
#define MAX_FRAME_SIZE
Maximum framesize, in time-domain samples.
void ** realloc2d(void **ptr, size_t dim1, size_t dim2, size_t data_size)
2-D realloc which does NOT retain previous data order
void * malloc1d(size_t dim1_data_size)
1-D malloc (same as malloc, but with error checking)
void * realloc1d(void *ptr, size_t dim1_data_size)
1-D realloc (same as realloc, but with error checking)
void ** calloc2d(size_t dim1, size_t dim2, size_t data_size)
2-D calloc (contiguously allocated, so use free() as usual to deallocate)
#define FLATTEN2D(A)
Use this macro when passing a 2-D dynamic multi-dimensional array to memset, memcpy or any other func...
int multiconv_getFilterLength(void *const hMCnv)
Returns the current filter length, in samples.
void multiconv_create(void **const phMCnv)
Creates an instance of multiconv.
void multiconv_init(void *const hMCnv, int sampleRate, int hostBlockSize)
Initialises an instance of multiconv with default settings.
int multiconv_getNfilters(void *const hMCnv)
Returns the number of filters in the loaded wav file.
int multiconv_getHostBlockSize(void *const hMCnv)
Returns the currect host block size.
int multiconv_getEnablePart(void *const hMCnv)
Returns a flag indicating whether partitioned convolution is enabled (1) or disabled (0)
int multiconv_getFilterFs(void *const hMCnv)
Returns the samplerate of the loaded filters.
int multiconv_getNumChannels(void *const hMCnv)
Returns the number input/output channels.
void multiconv_checkReInit(void *const hMCnv)
Checks whether things have to be reinitialised, and does so if it is needed.
void multiconv_setEnablePart(void *const hMCnv, int newState)
Enable (1), disable (0), partitioned convolution.
void multiconv_setNumChannels(void *const hMCnv, int newValue)
Sets the number of input/output channels.
void multiconv_refreshParams(void *const hMCnv)
Sets all intialisation flags to 1.
int multiconv_getProcessingDelay(void *const hMCnv)
Returns the processing delay in samples (may be used for delay compensation features)
int multiconv_getHostFs(void *const hMCnv)
Returns the samperate of the host.
void multiconv_destroy(void **const phMCnv)
Destroys an instance of multiconv.
void multiconv_process(void *const hMCnv, const float *const *inputs, float *const *const outputs, int nInputs, int nOutputs, int nSamples)
Performs the multuchannel convolution processing.
void multiconv_setFilters(void *const hMCnv, const float *const *H, int numChannels, int numSamples, int sampleRate)
Loads the multichannel of filters.
A multi-channel convolver.
A multi-channel convolver.
Main structure for multiconv.
int hostBlockSize_clamped
Clamped between MIN_FRAME_SIZE and MAX_FRAME_SIZE.
int nfilters
Current number of FIR filters.
void * hMultiConv
convolver handle
float ** outFIFO
Output FIFO buffer.
int nChannels
Current number of input/output channels.
int filter_length
length of the filters (input_wav_length/nInputChannels)
int host_fs
current samplerate of the host
int filter_fs
current samplerate of the filters
int FIFO_idx
FIFO buffer index.
int hostBlockSize
current host block size
float * filters
FLAT: nfilters x filter_length.
float ** inputFrameTD
Input buffer; MAX_NUM_CHANNELS x hostBlockSize_clamped.
float ** outputFrameTD
Output buffer; MAX_NUM_CHANNELS x hostBlockSize_clamped.
float ** inFIFO
Input FIFO buffer.
int enablePartitionedConv
1: enable partitioned convolution, 0: regular convolution (fft over the length of the filter)
int reInitFilters
FLAG: 0: do not reinit, 1: reinit, 2: reinit in progress.