The Open Master Hearing Aid (openMHA)
openMHA
Open community platform for hearing aid algorithm research
|
Runtime config class for windnoise plugin. More...
Public Member Functions | |
cfg_t (const mhaconfig_t &signal_info, bool UseChannel_LF_attenuation, float tau_Lowpass, float LowPassCutOffFrequency, float LowPassFraction_dB, float LowPassWindGain_dB) | |
constructor translates configuration variables to runtime config More... | |
mha_spec_t * | process (mha_spec_t *signal, std::vector< int > &detected, std::vector< float > &lowpass_quotient) |
Detect windnoise. More... | |
void | update_PSD_Lowpass (const mha_spec_t *signal) |
Low-pass filters the power spectrum. More... | |
void | threshold_compare (std::vector< int > &detected, std::vector< float > &lowpass_quotient) |
Wind noise detection by comparing low-frequency intensity with broadband intensity. More... | |
int | remapping (const std::vector< float > &lowpass_quotient) |
void | compensation (mha_spec_t *signal, int best_signal_channel_index) |
Public Attributes | |
bool | UseChannel_LF_attenuation = false |
FIXME: documentation for UseChannel_LF_attenuation. More... | |
float | alpha_Lowpass = 0 |
Filter coefficient for low-pass filtering each bin in the power spectrum with a first-order recursive low-pass filter. More... | |
unsigned | FrequencyBinLowPass = 0 |
Only smoothed power spectrum bins < FrequencyBinLowPass are added to the low-pass intensity. More... | |
float | LowPassFraction = 1 |
The wind noise detection threshold: We have wind noise if lowFreqIntensity / broadBandIntensity > LowPassFraction. More... | |
float | LowPassWindGain = 1 |
FIXME: documentation for LowPassWindGain. More... | |
MHASignal::waveform_t | PSD_Lowpass |
The smoothed-over-time power spectrum. More... | |
MHASignal::waveform_t | powspec |
Temporary storage for the power spectrum of the current input spectrum. More... | |
Runtime config class for windnoise plugin.
Computes power spectra of incoming STFT spectra, smoothes the power spectrum over time by low-pass filtering the intensities of each bin over time, then detects wind noise presence by comparing intensity at low frequency bins to broadband intensity.
cfg_t::cfg_t | ( | const mhaconfig_t & | signal_info, |
bool | UseChannel_LF_attenuation, | ||
float | tau_Lowpass, | ||
float | LowPassCutOffFrequency, | ||
float | LowPassFraction_dB, | ||
float | LowPassWindGain_dB | ||
) |
constructor translates configuration variables to runtime config
mha_spec_t * cfg_t::process | ( | mha_spec_t * | signal, |
std::vector< int > & | detected, | ||
std::vector< float > & | lowpass_quotient | ||
) |
Detect windnoise.
FIXME: cancel it. The process method calls update_PSD_Lowpass and threshold_compare to do its work.
[in,out] | signal | The current STFT spectrum. |
[out] | detected | This Method changes the elements of the vector but not its size. Each element is set to 1 or 0, depending on windnoise being detected in the corresponding audio channel. |
[out] | lowpass_quotient | This Method changes elements of the vector but not its size. Each element is set to the ratio between intensity of the signal, at low frequencies and overall intensity, in the corresponding audio channel. |
MHA_Error | if windnoise_indicators.size() != signal.num_channels. |
void cfg_t::update_PSD_Lowpass | ( | const mha_spec_t * | signal | ) |
Low-pass filters the power spectrum.
void cfg_t::threshold_compare | ( | std::vector< int > & | detected, |
std::vector< float > & | lowpass_quotient | ||
) |
Wind noise detection by comparing low-frequency intensity with broadband intensity.
[out] | detected | This Method changes the elements of the vector but not its size. Each element is set to 1 or 0, depending on windnoise being detected in the corresponding audio channel. |
[out] | lowpass_quotient | This Method changes elements of the vector but not its size. Each element is set to the ratio between intensity of the signal, at low frequencies and overall intensity, in the corresponding audio channel. |
int cfg_t::remapping | ( | const std::vector< float > & | lowpass_quotient | ) |
void cfg_t::compensation | ( | mha_spec_t * | signal, |
int | best_signal_channel_index | ||
) |
bool windnoise::cfg_t::UseChannel_LF_attenuation = false |
FIXME: documentation for UseChannel_LF_attenuation.
float windnoise::cfg_t::alpha_Lowpass = 0 |
Filter coefficient for low-pass filtering each bin in the power spectrum with a first-order recursive low-pass filter.
unsigned windnoise::cfg_t::FrequencyBinLowPass = 0 |
Only smoothed power spectrum bins < FrequencyBinLowPass are added to the low-pass intensity.
float windnoise::cfg_t::LowPassFraction = 1 |
The wind noise detection threshold: We have wind noise if lowFreqIntensity / broadBandIntensity > LowPassFraction.
float windnoise::cfg_t::LowPassWindGain = 1 |
FIXME: documentation for LowPassWindGain.
MHASignal::waveform_t windnoise::cfg_t::PSD_Lowpass |
The smoothed-over-time power spectrum.
MHASignal::waveform_t windnoise::cfg_t::powspec |
Temporary storage for the power spectrum of the current input spectrum.
Only needed to hold the newest squared magnitudes until they are filtered into PSD_Lowpass.