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

Public Member Functions

 cpuload_cfg_t (mha_real_t factor_, size_t table_size_, bool use_sine_)
 Ctor of the runtime configuration class. More...
 
void process (unsigned fac_)
 Process callback. Does not actually change signal. More...
 

Private Member Functions

void calc_sine ()
 
void write_to_table ()
 

Private Attributes

float phase =0
 Phase of the sine. More...
 
volatile float result =0
 Result of sin(phase). Volatile to prevent compiler from optimizing away the calculation. More...
 
bool use_sine =false
 Use sine or do table operation. More...
 
float factor =0
 cpu load factor. Values > 1 increase cpu load, values < 1 decrease it More...
 
std::vector< float > table
 Table with arbitrary values to operate on. Unused if use_sine=true. More...
 

Constructor & Destructor Documentation

◆ cpuload_cfg_t()

cpuload::cpuload_cfg_t::cpuload_cfg_t ( mha_real_t  factor_,
size_t  table_size_,
bool  use_sine_ 
)

Ctor of the runtime configuration class.

Parameters
factor_cpu load factor. Values > 1 increase cpu load, values < 1 decrease it
table_size_
use_sine_

Member Function Documentation

◆ process()

void cpuload::cpuload_cfg_t::process ( unsigned  fac_)

Process callback. Does not actually change signal.

◆ calc_sine()

void cpuload::cpuload_cfg_t::calc_sine ( )
private

◆ write_to_table()

void cpuload::cpuload_cfg_t::write_to_table ( )
private

Member Data Documentation

◆ phase

float cpuload::cpuload_cfg_t::phase =0
private

Phase of the sine.

◆ result

volatile float cpuload::cpuload_cfg_t::result =0
private

Result of sin(phase). Volatile to prevent compiler from optimizing away the calculation.

◆ use_sine

bool cpuload::cpuload_cfg_t::use_sine =false
private

Use sine or do table operation.

◆ factor

float cpuload::cpuload_cfg_t::factor =0
private

cpu load factor. Values > 1 increase cpu load, values < 1 decrease it

◆ table

std::vector<float> cpuload::cpuload_cfg_t::table
private

Table with arbitrary values to operate on. Unused if use_sine=true.


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