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

Classes

class  dc_vars_t
 class for dc_simple plugin which registers variables to MHAParser. More...
 
class  dc_vars_validator_t
 Helper class to check sizes of configuration variable vectors. More...
 
class  level_smoother_t
 Class which computes smoothed input levels on individual bands, using an attack and release filter, which are a first order low pass filter and a maximum tracker filter, respectively. More...
 
class  dc_t
 Runtime config class for dc_simple plugin. More...
 
class  dc_if_t
 interface class for dc_simple More...
 

Typedefs

typedef MHAPlugin::plugin_t< dc_tDC
 Define alternate name for runtime_cfg_t. More...
 
typedef MHAPlugin::config_t< level_smoother_tLEVEL
 Define alternate name for config_t. More...
 

Functions

void test_fail (const std::vector< float > &v, unsigned int s, const std::string &name)
 Checks size of vector. More...
 
std::vector< float > force_resize (const std::vector< float > &v, unsigned int s, const std::string &name)
 Creates a copy of vector v with s elements, provided that \v has either s elements or 1 elements. More...
 
mha_real_t not_zero (mha_real_t x, const std::string &comment)
 Helper function to throw an error if x is 0. More...
 

Typedef Documentation

◆ DC

Define alternate name for runtime_cfg_t.

◆ LEVEL

Define alternate name for config_t.

Function Documentation

◆ test_fail()

void dc_simple::test_fail ( const std::vector< float > &  v,
unsigned int  s,
const std::string &  name 
)

Checks size of vector.

Parameters
[in]vThe vector to check the size of.
[in]sExpected size of vector v.
[in]nameName of vector to include in error message when size does not match.
Exceptions
MHA_Errorif the size of v is neither s nor 1.

◆ force_resize()

std::vector< float > dc_simple::force_resize ( const std::vector< float > &  v,
unsigned int  s,
const std::string &  name 
)

Creates a copy of vector v with s elements, provided that \v has either s elements or 1 elements.

Parameters
[in]vThe vector to copy elements from.
[in]sThe desired number of elements in the output vector.
[in]nameName of vector to include in error message when input size does not match expectation.
Returns
A copy of v with s elements.
Exceptions
MHA_Errorif size of v is neither s nor 1.

◆ not_zero()

mha_real_t dc_simple::not_zero ( mha_real_t  x,
const std::string &  comment 
)

Helper function to throw an error if x is 0.

Parameters
[in]xThe value to check.
[in]commentOptional explanation for error message.
Exceptions
MHA_Errorif x == 0.