The Open Master Hearing Aid (openMHA)
openMHA
Open community platform for hearing aid algorithm research
|
This is the runtime configuration, the main processing will be done in this class. More...
Public Member Functions | |
adaptive_feedback_canceller_config (algo_comm_t &ac, const mhaconfig_t in_cfg, adaptive_feedback_canceller *afc) | |
~adaptive_feedback_canceller_config () | |
mha_wave_t * | process (mha_wave_t *MICsig) |
The process() method contains the actual AFC algorithm, the output is stored in LSsig_output. More... | |
void | insert () |
Insert all AC-variables into the AC-space. More... | |
Private Attributes | |
const unsigned int | ntaps |
Length of the estimated filter. More... | |
const unsigned int | frames |
Length of a block in samples (fragsize) More... | |
const unsigned int | channels |
Number of channels. More... | |
const int | n_no_update_ |
Number of blocks after startup where the feedback filter is not updated. More... | |
int | no_update_count |
Index counting no-update-blocks up to n_no_update_ to check in process() whether a filter update shall be performed or not. More... | |
const mha_real_t | fragsize |
Fragsize for computing delay_roundtrip and delay_update, defaults to the MHA's fragsize. More... | |
const mha_real_t | stepsize |
Normalized stepsize of the NLMS-Algorithm. More... | |
const mha_real_t | min_const |
Minimum constant to prevent division by zero in the NLMS-Algorithm. More... | |
MHASignal::waveform_t | forward_sig |
Copy of error signal that is channeled into the forward path processing. More... | |
MHASignal::waveform_t | LSsig_initializer |
Signal consisting of zeros, it is only used to initialize the loudspeaker signal (LSsig) for the first iteration (before forward_path_proc.process() is called for the first time). More... | |
mha_wave_t * | LSsig |
Pointer to the loudspeaker (LS) signal. More... | |
MHASignal::waveform_t | LSsig_output |
MHASignal::delay_t | delay_forward_path |
Delay line for additional decorrelation in the forward path. More... | |
MHAParser::mhapluginloader_t & | forward_path_proc |
Pluginloader to load the plugins that represent the hearing aid processing in the forward path. More... | |
MHASignal::delay_t | delay_roundtrip |
Delay line equal to the measured roundtrip latency - fragsize. More... | |
MHASignal::delay_t | delay_update |
std::vector< MHAFilter::filter_t > | FBfilter_estim |
MHA_AC::waveform_t | FBfilter_estim_ac |
MHASignal::waveform_t | FBsig_estim |
MHASignal::waveform_t | ERRsig |
MHA_AC::waveform_t | ERRsig_ac |
bool | use_lpc_decorr |
std::vector< MHAFilter::filter_t > | lpc_filter |
MHASignal::waveform_t | white_LSsig |
Loudspeaker signal, whitened by filtering with LPC coefficients. More... | |
MHASignal::waveform_t | white_LSsig_smpl |
Single sample (for each channel) of white_LSsig that will be written to rb_white_LSsig next. More... | |
MHASignal::ringbuffer_t | rb_white_LSsig |
Ringbuffer containing the values used to determine the power of white_LSsig in each channel (see channels) and update FBfilter_estim. More... | |
std::vector< mha_real_t > | current_power |
MHASignal::waveform_t | white_MICsig |
MHASignal::waveform_t | white_FBsig_estim |
MHASignal::waveform_t | white_ERRsig |
bool | debug_mode |
When executing the code for debug purposes this flag can be set to true in order to capture variable states and provide them as AC variables to the user. More... | |
MHA_AC::waveform_t | current_power_ac |
MHA_AC::waveform_t | estim_err_ac |
AC-variable publishing the state of 'estim_err' if debug_mode == true 'estim_err' is a variable local to this plugin's process() method. More... | |
This is the runtime configuration, the main processing will be done in this class.
During runtime AC variables are published by this class, mainly for debbugging purposes.
adaptive_feedback_canceller_config::adaptive_feedback_canceller_config | ( | algo_comm_t & | ac, |
const mhaconfig_t | in_cfg, | ||
adaptive_feedback_canceller * | afc | ||
) |
ac | Algorithm communication variable space |
in_cfg | MHA signal dimensions for this plugin |
adaptive_feedback_canceller | Pointer to plugin interface instance, used to extract user configuration values. |
adaptive_feedback_canceller_config::~adaptive_feedback_canceller_config | ( | ) |
mha_wave_t * adaptive_feedback_canceller_config::process | ( | mha_wave_t * | MICsig | ) |
The process() method contains the actual AFC algorithm, the output is stored in LSsig_output.
MICsig | The microphone signal which contains the target signal + the feedback signal. The input signal is not altered in place. |
void adaptive_feedback_canceller_config::insert | ( | ) |
Insert all AC-variables into the AC-space.
|
private |
Length of the estimated filter.
|
private |
Length of a block in samples (fragsize)
|
private |
Number of channels.
This plugin assumes that the number of input channels is equal to the number of output channels. Each input is paired with an output and one pair is called a channel. This is necessary because the AFC needs input and output information to work.
|
private |
Number of blocks after startup where the feedback filter is not updated.
|
private |
Index counting no-update-blocks up to n_no_update_ to check in process() whether a filter update shall be performed or not.
|
private |
Fragsize for computing delay_roundtrip and delay_update, defaults to the MHA's fragsize.
It is assumed that the soundcard's and the MHA's fragsize are equal. In special cases, the user can set this variable to an individual value.
|
private |
Normalized stepsize of the NLMS-Algorithm.
|
private |
Minimum constant to prevent division by zero in the NLMS-Algorithm.
|
private |
Copy of error signal that is channeled into the forward path processing.
|
private |
Signal consisting of zeros, it is only used to initialize the loudspeaker signal (LSsig) for the first iteration (before forward_path_proc.process() is called for the first time).
|
private |
Pointer to the loudspeaker (LS) signal.
The destination of this pointer will be altered by the plugin loaded by the pluginloader in the forward path processing.
|
private |
|
private |
Delay line for additional decorrelation in the forward path.
|
private |
Pluginloader to load the plugins that represent the hearing aid processing in the forward path.
|
private |
Delay line equal to the measured roundtrip latency - fragsize.
The roundtrip latency describes the timespan between playing back and receiving the same signal, including delays induced by soundcard buffering and the transducers. Can be measured via jack_iodelay. It is used on the loudspeaker signal LSsig before the filtering with FBfilter_estim, to achieve about the same temporal alignment to MICsig as the alignment of the target signal and the true feedback signal.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Loudspeaker signal, whitened by filtering with LPC coefficients.
If use_lpc_decorr is false then this is just a copy of LSsig before the delays.
|
private |
Single sample (for each channel) of white_LSsig that will be written to rb_white_LSsig next.
For the filter estimation we have to use a ringbuffer with the size of filter_length to buffer white_LSsig. For each filter tap we have to update the buffer and it is only possible to update a ringbuffer with a whole waveform_t. That is why we have to use this single sample variable.
|
private |
Ringbuffer containing the values used to determine the power of white_LSsig in each channel (see channels) and update FBfilter_estim.
The ringbuffer has a size equal to filter_length.
|
private |
|
private |
|
private |
|
private |
|
private |
When executing the code for debug purposes this flag can be set to true in order to capture variable states and provide them as AC variables to the user.
The following variables are captured: FBfilter_estim_ac, ERRsig_ac, current_power_ac, estim_err_ac
|
private |
|
private |
AC-variable publishing the state of 'estim_err' if debug_mode == true 'estim_err' is a variable local to this plugin's process() method.
It represents a part of the NLMS equation, namely the stepsize normalized by current_power times ERRsig.