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

FFT based overlapping filter bank. More...

Inheritance diagram for MHAOvlFilter::fftfb_t:
Inheritance graph

Public Member Functions

 fftfb_t (MHAOvlFilter::fftfb_vars_t &par, unsigned int nfft, mha_real_t fs)
 Constructor for a FFT-based overlapping filter bank. More...
 
 ~fftfb_t ()
 
void apply_gains (mha_spec_t *s_out, const mha_spec_t *s_in, const mha_wave_t *gains)
 
void get_fbpower (mha_wave_t *fbpow, const mha_spec_t *s_in)
 
void get_fbpower_db (mha_wave_t *fbpow, const mha_spec_t *s_in)
 
std::vector< mha_real_tget_ltass_gain_db () const
 
unsigned int bin1 (unsigned int band) const
 Return index of first non-zero filter shape window. More...
 
unsigned int bin2 (unsigned int band) const
 Return index of first zero filter shape window above center frequency. More...
 
unsigned int get_fftlen () const
 Return fft length. More...
 
mha_real_t w (unsigned int k, unsigned int b) const
 Return filter shape window at index k in band b. More...
 
- Public Member Functions inherited from MHAOvlFilter::fspacing_t
 fspacing_t (const MHAOvlFilter::fftfb_vars_t &par, unsigned int nfft, mha_real_t fs)
 
std::vector< unsigned int > get_cf_fftbin () const
 
std::vector< mha_real_tget_cf_hz () const
 
std::vector< mha_real_tget_ef_hz () const
 
unsigned int nbands () const
 Return number of bands in filter bank. More...
 

Private Attributes

unsigned int * vbin1
 
unsigned int * vbin2
 
mha_real_t(* shape )(mha_real_t)
 
unsigned int fftlen
 
mha_real_t samplingrate
 
- Private Attributes inherited from mha_wave_t
mha_real_tbuf
 signal buffer More...
 
unsigned int num_channels
 number of channels More...
 
unsigned int num_frames
 number of frames in each channel More...
 
mha_channel_info_tchannel_info
 detailed channel description More...
 

Additional Inherited Members

- Protected Member Functions inherited from MHAOvlFilter::fspacing_t
void fail_on_nonmonotonic_cf ()
 
void fail_on_unique_fftbins ()
 
- Protected Attributes inherited from MHAOvlFilter::fspacing_t
std::vector< MHAOvlFilter::band_descriptor_tbands
 
mha_real_t(* symmetry_scale )(mha_real_t)
 
- Private Member Functions inherited from MHASignal::waveform_t
 waveform_t (const unsigned int &frames, const unsigned int &channels)
 constructor of waveform_t More...
 
 waveform_t (const mhaconfig_t &cf)
 Constructor to create a waveform from plugin configuration. More...
 
 waveform_t (const mha_wave_t &src)
 Copy contructor for mha_wave_t source. More...
 
 waveform_t (const MHASignal::waveform_t &src)
 Copy contructor. More...
 
 waveform_t (const std::vector< mha_real_t > &src)
 Copy contructor for std::vector<mha_real_t> source. More...
 
virtual ~waveform_t (void)
 
std::vector< mha_real_tflatten () const
 
 operator std::vector< mha_real_t > () const
 
void operator= (const mha_real_t &v)
 
mha_real_toperator[] (unsigned int k)
 
const mha_real_toperator[] (unsigned int k) const
 
mha_real_tvalue (unsigned int t, unsigned int ch)
 Element accessor. More...
 
mha_real_toperator() (unsigned int t, unsigned int ch)
 Element accessor. More...
 
const mha_real_tvalue (unsigned int t, unsigned int ch) const
 Constant element accessor. More...
 
const mha_real_toperator() (unsigned int t, unsigned int ch) const
 Constant element accessor. More...
 
mha_real_t sum (const unsigned int &a, const unsigned int &b)
 sum of all elements between [a,b) in all channels More...
 
mha_real_t sum (const unsigned int &a, const unsigned int &b, const unsigned int &ch)
 sum of all elements between [a,b) in channel ch More...
 
mha_real_t sum ()
 sum of all elements More...
 
mha_real_t sumsqr ()
 sum of square of all elements More...
 
mha_real_t sum_channel (const unsigned int &)
 return sum of all elements in one channel More...
 
void assign (const unsigned int &k, const unsigned int &ch, const mha_real_t &val)
 set frame "k" in channel "ch" to value "val" More...
 
void assign (const mha_real_t &)
 set all elements to value More...
 
void assign_frame (const unsigned int &k, const mha_real_t &val)
 assign value "val" to frame k in all channels More...
 
void assign_channel (const unsigned int &c, const mha_real_t &val)
 assign value "val" to channel ch in all frames More...
 
void copy (const std::vector< mha_real_t > &v)
 
void copy (const mha_wave_t &)
 copy data from source into current waveform More...
 
void copy (const mha_wave_t *)
 
void copy_channel (const mha_wave_t &, unsigned int, unsigned int)
 Copy one channel of a given waveform signal to a target channel. More...
 
void copy_from_at (unsigned int, unsigned int, const mha_wave_t &, unsigned int)
 Copy part of the source signal into part of this waveform object. More...
 
void export_to (mha_wave_t &)
 copy data into allocated mha_wave_t structure More...
 
void limit (const mha_real_t &min, const mha_real_t &max)
 limit target to range [min,max] More...
 
void power (const waveform_t &)
 transform waveform signal (in Pa) to squared signal (in W/m^2) More...
 
void powspec (const mha_spec_t &)
 get the power spectrum (in W/m^2) from a complex spectrum More...
 
void scale (const unsigned int &a, const unsigned int &b, const unsigned int &ch, const mha_real_t &val)
 scale section [a,b) in channel "ch" by "val" More...
 
void scale (const unsigned int &k, const unsigned int &ch, const mha_real_t &val)
 scale one element More...
 
void scale_channel (const unsigned int &, const mha_real_t &)
 scale one channel of target with a scalar More...
 
void scale_frame (const unsigned int &, const mha_real_t &)
 
unsigned int get_size () const
 

Detailed Description

FFT based overlapping filter bank.

Constructor & Destructor Documentation

◆ fftfb_t()

MHAOvlFilter::fftfb_t::fftfb_t ( MHAOvlFilter::fftfb_vars_t par,
unsigned int  nfft,
mha_real_t  fs 
)

Constructor for a FFT-based overlapping filter bank.

Parameters
parParameters for the FFT filterbank that can not be deduced from the signal dimensions are taken from this set of configuration variables.
nfftFFT length
fsSampling rate / Hz

◆ ~fftfb_t()

MHAOvlFilter::fftfb_t::~fftfb_t ( )

Member Function Documentation

◆ apply_gains()

void MHAOvlFilter::fftfb_t::apply_gains ( mha_spec_t s_out,
const mha_spec_t s_in,
const mha_wave_t gains 
)

◆ get_fbpower()

void MHAOvlFilter::fftfb_t::get_fbpower ( mha_wave_t fbpow,
const mha_spec_t s_in 
)

◆ get_fbpower_db()

void MHAOvlFilter::fftfb_t::get_fbpower_db ( mha_wave_t fbpow,
const mha_spec_t s_in 
)

◆ get_ltass_gain_db()

std::vector< float > MHAOvlFilter::fftfb_t::get_ltass_gain_db ( ) const

◆ bin1()

unsigned int MHAOvlFilter::fftfb_t::bin1 ( unsigned int  band) const
inline

Return index of first non-zero filter shape window.

◆ bin2()

unsigned int MHAOvlFilter::fftfb_t::bin2 ( unsigned int  band) const
inline

Return index of first zero filter shape window above center frequency.

◆ get_fftlen()

unsigned int MHAOvlFilter::fftfb_t::get_fftlen ( ) const
inline

Return fft length.

◆ w()

mha_real_t MHAOvlFilter::fftfb_t::w ( unsigned int  k,
unsigned int  b 
) const
inline

Return filter shape window at index k in band b.

Parameters
kFrequency index
bBand index

Member Data Documentation

◆ vbin1

unsigned int* MHAOvlFilter::fftfb_t::vbin1
private

◆ vbin2

unsigned int* MHAOvlFilter::fftfb_t::vbin2
private

◆ shape

mha_real_t(* MHAOvlFilter::fftfb_t::shape) (mha_real_t)
private

◆ fftlen

unsigned int MHAOvlFilter::fftfb_t::fftlen
private

◆ samplingrate

mha_real_t MHAOvlFilter::fftfb_t::samplingrate
private

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