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

Public Member Functions

 channel_pair (const std::pair< int, int > &idx_, mha_real_t filter_rate_, mha_real_t mismatch_time_constant_)
 Channel pair ctor. More...
 
 channel_pair (int idx1_, int idx2_, mha_real_t filter_rate_, mha_real_t mismatch_time_constant_)
 Channel pair ctor. More...
 
mha_real_t update_mismatch (const mha_wave_t &signal_)
 Calculates the filtered rms level mismatch. More...
 
mha_real_t update_mismatch (const mha_spec_t &signal_, unsigned fftlen_)
 Calculates the filtered rms level mismatch. More...
 
mha_real_t get_mismatch () const
 Get last filter result. More...
 
const std::pair< int, int > & get_idx () const
 

Private Attributes

std::pair< int, int > idx
 Indices of channels. More...
 
MHAFilter::o1flt_lowpass_t mismatch
 Low-pass filtered level mismatch. More...
 

Constructor & Destructor Documentation

◆ channel_pair() [1/2]

level_matching::channel_pair::channel_pair ( const std::pair< int, int > &  idx_,
mha_real_t  filter_rate_,
mha_real_t  mismatch_time_constant_ 
)

Channel pair ctor.

Parameters
idx_Pair of channel indices
filter_rate_Filter rate of low pass filter
mismatch_time_constant_Time constant of low pass filter

◆ channel_pair() [2/2]

level_matching::channel_pair::channel_pair ( int  idx1_,
int  idx2_,
mha_real_t  filter_rate_,
mha_real_t  mismatch_time_constant_ 
)

Channel pair ctor.

Parameters
idx1First channel index. Used as reference
idx2Second channel index
filter_rate_Filter rate of low pass filter
mismatch_time_constant_Time constant of low pass filter

Member Function Documentation

◆ update_mismatch() [1/2]

mha_real_t level_matching::channel_pair::update_mismatch ( const mha_wave_t signal_)

Calculates the filtered rms level mismatch.

Parameters
signalInput signal
Returns
Low-pass filtered mismatch ratio

◆ update_mismatch() [2/2]

mha_real_t level_matching::channel_pair::update_mismatch ( const mha_spec_t signal_,
unsigned  fftlen_ 
)

Calculates the filtered rms level mismatch.

Parameters
signalInput signal
Returns
Low-pass filtered mismatch ratio

◆ get_mismatch()

mha_real_t level_matching::channel_pair::get_mismatch ( ) const

Get last filter result.

Returns
Last filter result

◆ get_idx()

const std::pair<int,int>& level_matching::channel_pair::get_idx ( ) const
inline

Member Data Documentation

◆ idx

std::pair<int,int> level_matching::channel_pair::idx
private

Indices of channels.

◆ mismatch

MHAFilter::o1flt_lowpass_t level_matching::channel_pair::mismatch
private

Low-pass filtered level mismatch.


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