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

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_tprocess (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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ cfg_t()

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

Member Function Documentation

◆ process()

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.

Parameters
[in,out]signalThe current STFT spectrum.
[out]detectedThis 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_quotientThis 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.
Exceptions
MHA_Errorif windnoise_indicators.size() != signal.num_channels.

◆ update_PSD_Lowpass()

void cfg_t::update_PSD_Lowpass ( const mha_spec_t signal)

Low-pass filters the power spectrum.

◆ threshold_compare()

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.

Parameters
[out]detectedThis 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_quotientThis 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.

◆ remapping()

int cfg_t::remapping ( const std::vector< float > &  lowpass_quotient)

◆ compensation()

void cfg_t::compensation ( mha_spec_t signal,
int  best_signal_channel_index 
)

Member Data Documentation

◆ UseChannel_LF_attenuation

bool windnoise::cfg_t::UseChannel_LF_attenuation = false

FIXME: documentation for UseChannel_LF_attenuation.

◆ alpha_Lowpass

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.

◆ FrequencyBinLowPass

unsigned windnoise::cfg_t::FrequencyBinLowPass = 0

Only smoothed power spectrum bins < FrequencyBinLowPass are added to the low-pass intensity.

◆ LowPassFraction

float windnoise::cfg_t::LowPassFraction = 1

The wind noise detection threshold: We have wind noise if lowFreqIntensity / broadBandIntensity > LowPassFraction.

◆ LowPassWindGain

float windnoise::cfg_t::LowPassWindGain = 1

FIXME: documentation for LowPassWindGain.

◆ PSD_Lowpass

MHASignal::waveform_t windnoise::cfg_t::PSD_Lowpass

The smoothed-over-time power spectrum.

◆ powspec

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.


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