The Open Master Hearing Aid (openMHA)  openMHA
Open community platform for hearing aid algorithm research
gtfb_analyzer.cpp File Reference

Gammatone Filterbank Analyzer Plugin. More...

Classes

struct  gtfb_analyzer::gtfb_analyzer_cfg_t
 Configuration for Gammatone Filterbank Analyzer. More...
 
class  gtfb_analyzer::gtfb_analyzer_t
 Gammatone Filterbank Analyzer Plugin. More...
 

Namespaces

 gtfb_analyzer
 

Functions

static const mha_complex_tfilter_complex (const mha_complex_t &input, const mha_complex_t &coeff, mha_complex_t *states, unsigned orders)
 Filters a complex input sample with the given filter coefficient. More...
 
static const mha_complex_tfilter_real (mha_real_t input, mha_complex_t &tmp_complex, const mha_complex_t &coeff, mha_complex_t *states, unsigned orders, const mha_complex_t &normphase)
 Filters a real input sample with the given filter coefficient and applies the given normalization with phase correction. More...
 

Detailed Description

Gammatone Filterbank Analyzer Plugin.

Function Documentation

◆ filter_complex()

static const mha_complex_t& filter_complex ( const mha_complex_t input,
const mha_complex_t coeff,
mha_complex_t states,
unsigned  orders 
)
inlinestatic

Filters a complex input sample with the given filter coefficient.

No normalization takes place. The implementation is tail-recursive and to exploit compiler optimization.

Parameters
inputThe complex input sample
coeffThe complex filter coefficient
statesPointer to the array of complex filter states.
ordersThe filter order
Returns
A const ref to the filtered sample

◆ filter_real()

static const mha_complex_t& filter_real ( mha_real_t  input,
mha_complex_t tmp_complex,
const mha_complex_t coeff,
mha_complex_t states,
unsigned  orders,
const mha_complex_t normphase 
)
inlinestatic

Filters a real input sample with the given filter coefficient and applies the given normalization with phase correction.

Parameters
inputThe real input sample
tmp_complexA reference to a mha_complex_t used for intermediate results. No assumptions should be made about the state of tmp_complex after the return of filter_real. This is an optimization to reduce the number of dtor/ctor calls of mha_complex_t
coeffThe complex filter coefficient
statesPointer to the array of complex filter states.
ordersThe filter order
normphaseNormalization coefficient including the phase correction
Returns
A const ref to the filtered sample