|
#define | add4f(a, b) __builtin_ia32_addps(a,b) |
|
#define | sub4f(a, b) __builtin_ia32_subps(a,b) |
|
#define | mul4f(a, b) __builtin_ia32_mulps(a,b) |
|
#define | MXCSR_DAZ (1 << 6) /* Enable denormals are zero mode */ |
|
#define | MXCSR_FTZ (1 << 15) /* Enable flush to zero mode */ |
|
#define | check_alignment(ptr, alignment) |
| Checks alignment of pointer address. More...
|
|
|
void | filter_sisd_complex (const unsigned bands, const unsigned order, const mha_complex_t *inputs, mha_complex_t *outputs, const mha_complex_t *coefficients, mha_complex_t *states) |
| Filters one sample per band, using SISD operations and the mha_complex operations. More...
|
|
void | filter_sisd_real (const unsigned bands, const unsigned order, const mha_complex_t *inputs, mha_complex_t *outputs, const mha_complex_t *coefficients, mha_complex_t *states) |
| Filters one sample per band, using SISD operations and real operations (operating on real and imaginary part as necessary). More...
|
|
void | filter_simd (const unsigned bands, const unsigned order, const mha_real_t *rinputs, const mha_real_t *iinputs, mha_real_t *routputs, mha_real_t *ioutputs, const mha_real_t *rcoefficients, const mha_real_t *icoefficients, mha_real_t *rstates, mha_real_t *istates) |
| Filters one sample per band, using simd operations on float32 To process more than one sample, the function must be called repeatedly in correct order (from oldest sample to newest sample), and the calling function must preserve the filter state (parameters rstates and istates). More...
|
|
Gammatone Filterbank Analyzer Plugin using SIMD.
A single-instruction-multiple-data (SIMD) implementation of a gammatone filterbank (GTFB)
Not all functions in this file are actually used. Read the functions in this file as a path to convert an algorithm, here complex-valued gammatone filtering as introduced in Hohmann 2002, from a single-instruction-single-data (SISD) implementation that uses complex arithmetic operations to a SIMD implementation of the same, splitting the complex arithmetic operations into their defining real operations, i.e (a+b).real==a.real+b.real, (a+b).imag==a.imag+b.imag, (a*b).real==a.real*b.real-a.imag*b.imag, (a*b).imag==a.real*b.imag+a.imag*b.real.
Filters one sample per band, using SISD operations and the mha_complex operations.
To process more than one sample, the function must be called repeatedly in correct order (from oldest sample to newest sample), and the calling function must preserve the filter state (parameter states).
This function is not actually used in this plugin, but can be used for testing. It implements the Hohmann 2002 filtering in the most readable form, and is translated towards a SIMD implementation in the following functions.
- Parameters
-
bands | Number of total bands to compute (i.e. input_channels * num_frequencies) |
order | Gammatone filter order |
inputs | Pointer to array of complex input samples, only 1 sample per band |
outputs | Pointer to array with space for output samples, 1 complex sample per band |
coefficients | Pointer to array of recursive filter coefficient, 1 coefficient per band. The same coefficient is reused for all filter orders. |
states | Pointer to array of complex filter states. Array size is bands*order. Initialize all elements with zeros before filtering the first sample. Filter state values will be modified by the function. For filtering the next sample, this function needs the filter state array from filtering the previous sample again, unmodified. The filter state of band b, order o can be found at index [b+o*bands] |
Filters one sample per band, using SISD operations and real operations (operating on real and imaginary part as necessary).
To process more than one sample, the function must be called repeatedly in correct order (from oldest sample to newest sample), and the calling function must preserve the filter state (parameter states).
This function is not actually used in this plugin, but can be used for testing. It reimplements filter_sisd_complex, but expands the complex operations into real arithmetics.
- Parameters
-
bands | Number of total bands to compute (i.e. input_channels * num_frequencies) |
order | Gammatone filter order |
inputs | Pointer to array of complex input samples, only 1 sample per band |
outputs | Pointer to array with space for output samples, 1 complex sample per band |
coefficients | Pointer to array of recursive filter coefficient, 1 coefficient per band. The same coefficient is reused for all filter orders. |
states | Pointer to array of complex filter states. Array size is bands*order. Initialize all elements with zeros before filtering the first sample. Filter state values will be modified by the function. For filtering the next sample, this function needs the filter state array from filtering the previous sample again, unmodified. The filter state of band b, order o can be found at index [b+o*bands] |
Filters one sample per band, using simd operations on float32 To process more than one sample, the function must be called repeatedly in correct order (from oldest sample to newest sample), and the calling function must preserve the filter state (parameters rstates and istates).
This reimplements filter_sisd_real, but uses the CPU's vector registers for the arithmetics, and is actually used by this plugin.
- Parameters
-
bands | Number of total bands to compute (i.e. input_channels * num_frequencies) bands is also the size of the arrays pointed to by rinputs, iinputs, routputs, ioutputs, rcoefficients, icoefficients. |
order | Gammatone filter order |
rinputs | Pointer to array of the real part of input samples |
iinputs | Pointer to array of the imaginary part of input samples |
routputs | Pointer to array with space for the real parts of the output samples |
routputs | Pointer to array with space for the real parts of the output samples |
rcoefficients | Pointer to array of the real parts of the recursive filter coefficients |
icoefficients | Pointer to array of the imaginary parts of the filter coefficients |
rstates | Pointer to array of real parts of filter states. Array size is bands*order. Initialize all elements with zeros before filtering the first sample. Filter state values will be modified by the function. For filtering the next sample, this function needs the filter state arrays from filtering the previous sample again, unmodified. The real part of the filter state of band b, order o can be found at index [b+o*bands] |
istates | Pointer to array of imaginary parts of filter states. Array size is bands*order. Initialize all elements with zeros before filtering the first sample. Filter state values will be modified by the function. For filtering the next sample, this function needs the filter state arrays from filtering the previous sample again, unmodified. The imaginary part of the filter state of band b, order o can be found at index [b+o*bands] |