The Open Master Hearing Aid (openMHA)
openMHA
Open community platform for hearing aid algorithm research
|
Runtime configuration class of dynamic compression plugin dc
.
More...
Public Member Functions | |
dc_t (dc_vars_t vars, mha_real_t filter_rate, unsigned int nch_, MHA_AC::algo_comm_t &ac, mha_domain_t domain, unsigned int fftlen, unsigned int naudiochannels_, const std::string &configured_name, const std::vector< mha_real_t > &rmslevel_state={}, const std::vector< mha_real_t > &attack_state={}, const std::vector< mha_real_t > &decay_state={}) | |
Constructor. More... | |
mha_wave_t * | process (mha_wave_t *s_in) |
Process method extracts band-specific input levels using the rmslevel, attack and decay filters on each input sample, looks up the gains and applies them to each sample of the signal in place. More... | |
mha_spec_t * | process (mha_spec_t *s_in) |
Process method extracts band-specific input levels using the attack and decay filters on the latest STFT spectrum, looks up the gains and applies them in place. More... | |
void | explicit_insert () |
unsigned | get_nbands () const |
unsigned | get_nch () const |
const MHASignal::waveform_t & | get_level_in_db () const |
const MHASignal::waveform_t & | get_level_in_db_adjusted () const |
std::vector< mha_real_t > | get_rmslevel_filter_state () const |
std::vector< mha_real_t > | get_attack_filter_state () const |
std::vector< mha_real_t > | get_decay_filter_state () const |
Private Attributes | |
std::vector< MHATableLookup::linear_table_t > | gt |
Dynamic compression gains. More... | |
std::vector< mha_real_t > | offset |
band-specific dB offsets added to measured input levels before gain lookup is performed. More... | |
MHAFilter::o1flt_lowpass_t | rmslevel |
Envelope extraction filters used in waveform processing. More... | |
MHAFilter::o1flt_lowpass_t | attack |
Attack filters used in input level estimation. More... | |
MHAFilter::o1flt_maxtrack_t | decay |
Maximum-tracking decay filters used in input level estimation. More... | |
bool | bypass |
Dynamic compression is not applied if bypass == true. More... | |
bool | log_interp |
Flag whether gain table interpolation should be done in dB domain. More... | |
unsigned int | naudiochannels |
Number of broadband audio channels (before the upstream filterbank) More... | |
unsigned int | nbands |
Number of bands per broadband audio channel. More... | |
unsigned int | nch |
nbands * naudiochannels More... | |
MHA_AC::waveform_t | level_in_db |
Matrix of latest input levels before attack/decay filter. More... | |
MHA_AC::waveform_t | level_in_db_adjusted |
Matrix of latest input levels after attack/decay filter. More... | |
unsigned int | fftlen |
FFT length in samples, required for computing levels correctly. More... | |
Additional Inherited Members | |
Private Member Functions inherited from dc::dc_vars_validator_t | |
dc_vars_validator_t (dc_vars_t &v, unsigned int s, mha_domain_t domain) | |
Expands vectors in v, checks for consistency. More... | |
Runtime configuration class of dynamic compression plugin dc
.
dc::dc_t::dc_t | ( | dc_vars_t | vars, |
mha_real_t | filter_rate, | ||
unsigned int | nch_, | ||
MHA_AC::algo_comm_t & | ac, | ||
mha_domain_t | domain, | ||
unsigned int | fftlen, | ||
unsigned int | naudiochannels_, | ||
const std::string & | configured_name, | ||
const std::vector< mha_real_t > & | rmslevel_state = {} , |
||
const std::vector< mha_real_t > & | attack_state = {} , |
||
const std::vector< mha_real_t > & | decay_state = {} |
||
) |
Constructor.
vars | A copy of all configuration language variables of dc . |
filter_rate | The rate in Hz with which the level filters of plugin dc are called. For waveform processing this is equal to the audio sampling rate. For spectral processing, this is equal to the audio block rate. |
nch_ | Total number of compression bands: bands x channels. |
ac | Algorithm communication variable space. The constructor will not interact with it. |
domain | MHA_WAVEFORM or MHA_SPECTRUM . |
fftlen | FFT length used for STFT processing, in samples. |
naudiochannels_ | Number of broadband audio channels (before the upstream filterbank). |
configured_name | The configured name of this plugin in the MHA configuration. Used to derive the names of the AC variables published by this plugin. |
rmslevel_state | Start state of rmslevel filters. |
attack_state | Start state of attack level filters. |
decay_state | Start state of decay level filters. |
mha_wave_t * dc_t::process | ( | mha_wave_t * | s_in | ) |
Process method extracts band-specific input levels using the rmslevel, attack and decay filters on each input sample, looks up the gains and applies them to each sample of the signal in place.
s_in | Latest block of time-domain input signal. |
mha_spec_t * dc_t::process | ( | mha_spec_t * | s_in | ) |
Process method extracts band-specific input levels using the attack and decay filters on the latest STFT spectrum, looks up the gains and applies them in place.
s_in | Latest spectrum of the STFT input signal. |
void dc_t::explicit_insert | ( | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
Dynamic compression gains.
If log_interp
is true, then they are stored as dB gains, otherwise they are stored as linear gains.
|
private |
band-specific dB offsets added to measured input levels before gain lookup is performed.
|
private |
Envelope extraction filters used in waveform processing.
|
private |
Attack filters used in input level estimation.
|
private |
Maximum-tracking decay filters used in input level estimation.
|
private |
Dynamic compression is not applied if bypass == true.
|
private |
Flag whether gain table interpolation should be done in dB domain.
|
private |
Number of broadband audio channels (before the upstream filterbank)
|
private |
Number of bands per broadband audio channel.
|
private |
nbands
* naudiochannels
|
private |
Matrix of latest input levels before attack/decay filter.
|
private |
Matrix of latest input levels after attack/decay filter.
|
private |
FFT length in samples, required for computing levels correctly.