The Open Master Hearing Aid (openMHA)  openMHA
Open community platform for hearing aid algorithm research
gtfb_simple_rt_t Class Reference

Runtime configuration class of gtfb_simple_bridge plugin. More...

Public Member Functions

 gtfb_simple_rt_t (MHA_AC::algo_comm_t &ac, const std::string &name, mhaconfig_t &chcfg, std::vector< mha_real_t > cf, std::vector< mha_real_t > bw, unsigned int order, unsigned int pre_stages, unsigned int desired_delay, std::vector< mha_real_t > &vcltass, std::vector< mha_real_t > &resynthesis_gain, const std::string &element_gain_name)
 
mha_wave_tpre_plugin (mha_wave_t *s)
 Filter real input signal s with the pre_stages filter orders in each gammatone filter band. More...
 
mha_wave_tpost_plugin (mha_wave_t *s)
 Post-filter the complex-valued filter-bank signal s after it has been processed by the loaded plugin. More...
 
void insert_ac_variables ()
 (Re-)insert all AC variables into the AC space. More...
 
const MHAFilter::gamma_flt_tget_gf () const
 Const-accessor to contained gammatone filterbank object. More...
 

Static Private Member Functions

static std::vector< mha_real_tduplicate_vector (const std::vector< mha_real_t > &src, unsigned int nchannels)
 Helper function to repeat the elements in a vector. More...
 

Private Attributes

unsigned int _order
 Total number of gammatone filter orders. More...
 
unsigned int _pre_stages
 Number of filter orders applied before the loaded plugin is invoked. More...
 
unsigned int nbands
 Number of frequency bands to produce = number of gammatone filters. More...
 
MHA_AC::waveform_t imag
 Storage for the imaginary part of the filterbank signal. More...
 
MHA_AC::waveform_t accf
 AC variable to publish the center frequencies of the gammatone filters. More...
 
MHA_AC::waveform_t acbw
 AC variable to publish the bandwiths of the gammatone filters. More...
 
MHASignal::waveform_t input
 Real part of the filterbank signal. More...
 
MHASignal::waveform_t output
 Resynthesized broadband signal, used as the output signal of this plugin. More...
 
MHAFilter::gamma_flt_t gf
 The gammatone filter bank implementation. More...
 
MHA_AC::waveform_t cLTASS
 AC variable to publish band-specific LTASS level correction values. More...
 
MHA_AC::waveform_t ac_resynthesis_gain
 AC variable to publish the configured per-frequency resyntesis gains. More...
 
std::string element_gain_name_
 Either an empty string, or the name of an AC variable from which element-wise linear factors are read. More...
 
MHA_AC::algo_comm_t_ac
 Algorithm Communication Variable space. More...
 

Detailed Description

Runtime configuration class of gtfb_simple_bridge plugin.

Constructor & Destructor Documentation

◆ gtfb_simple_rt_t()

gtfb_simple_rt_t::gtfb_simple_rt_t ( MHA_AC::algo_comm_t ac,
const std::string &  name,
mhaconfig_t chcfg,
std::vector< mha_real_t cf,
std::vector< mha_real_t bw,
unsigned int  order,
unsigned int  pre_stages,
unsigned int  desired_delay,
std::vector< mha_real_t > &  vcltass,
std::vector< mha_real_t > &  resynthesis_gain,
const std::string &  element_gain_name 
)

Member Function Documentation

◆ pre_plugin()

mha_wave_t * gtfb_simple_rt_t::pre_plugin ( mha_wave_t s)

Filter real input signal s with the pre_stages filter orders in each gammatone filter band.

The real part of the complex output is returned in the return value of the method, the imaginary part is stored into the AC variable.

Parameters
sreal-valued, broad-band input signal
Returns
real part of complex-valued output signal after pre_stages gammatone filter orders have been applied in each band. Order of output bands in real and imaginary output are: (channel0,band0), (channel0,band1), ..., (cannel1,band0), ...

◆ post_plugin()

mha_wave_t * gtfb_simple_rt_t::post_plugin ( mha_wave_t s)

Post-filter the complex-valued filter-bank signal s after it has been processed by the loaded plugin.

The remaining gammatone filter orders are applied to restrict the loaded plugin's output signal to the respective bands. After

Parameters
scomplex-valued, filter-bank signal. This signal is produced by letting the loaded plugin process the output signal of the pre_plugin method.
Returns
real part of complex-valued output signal after pre_stages gammatone filter orders have been applied in each band. Order of output bands in real and imaginary output are: (channel0,band0), (channel0,band1), ..., (cannel1,band0), ...

◆ insert_ac_variables()

void gtfb_simple_rt_t::insert_ac_variables ( )

(Re-)insert all AC variables into the AC space.

Must be called during each prepare() and process() callback of the plugin. For the process() callback, this method is called from pre_plugin(). For the prepare() callback, it must be called by the plugin interface.

◆ get_gf()

const MHAFilter::gamma_flt_t& gtfb_simple_rt_t::get_gf ( ) const
inline

Const-accessor to contained gammatone filterbank object.

◆ duplicate_vector()

std::vector< mha_real_t > gtfb_simple_rt_t::duplicate_vector ( const std::vector< mha_real_t > &  src,
unsigned int  nchannels 
)
staticprivate

Helper function to repeat the elements in a vector.

Parameters
srcvector to repeat
nchannelsnumber of times to repeat input vector
Returns
a vector that returns nchannels repetitions of input vector.

Member Data Documentation

◆ _order

unsigned int gtfb_simple_rt_t::_order
private

Total number of gammatone filter orders.

◆ _pre_stages

unsigned int gtfb_simple_rt_t::_pre_stages
private

Number of filter orders applied before the loaded plugin is invoked.

◆ nbands

unsigned int gtfb_simple_rt_t::nbands
private

Number of frequency bands to produce = number of gammatone filters.

◆ imag

MHA_AC::waveform_t gtfb_simple_rt_t::imag
private

Storage for the imaginary part of the filterbank signal.

It is used as the imaginary input signal for the loaded plugin. Furthermore, it is expected that the loaded plugin processes the imaginary part of the data in place.

◆ accf

MHA_AC::waveform_t gtfb_simple_rt_t::accf
private

AC variable to publish the center frequencies of the gammatone filters.

◆ acbw

MHA_AC::waveform_t gtfb_simple_rt_t::acbw
private

AC variable to publish the bandwiths of the gammatone filters.

◆ input

MHASignal::waveform_t gtfb_simple_rt_t::input
private

Real part of the filterbank signal.

It is used as the real input signal to the loaded plugin.

◆ output

MHASignal::waveform_t gtfb_simple_rt_t::output
private

Resynthesized broadband signal, used as the output signal of this plugin.

◆ gf

MHAFilter::gamma_flt_t gtfb_simple_rt_t::gf
private

The gammatone filter bank implementation.

◆ cLTASS

MHA_AC::waveform_t gtfb_simple_rt_t::cLTASS
private

AC variable to publish band-specific LTASS level correction values.

◆ ac_resynthesis_gain

MHA_AC::waveform_t gtfb_simple_rt_t::ac_resynthesis_gain
private

AC variable to publish the configured per-frequency resyntesis gains.

◆ element_gain_name_

std::string gtfb_simple_rt_t::element_gain_name_
private

Either an empty string, or the name of an AC variable from which element-wise linear factors are read.

◆ _ac

MHA_AC::algo_comm_t& gtfb_simple_rt_t::_ac
private

Algorithm Communication Variable space.


The documentation for this class was generated from the following file: