The Open Master Hearing Aid (openMHA)  openMHA
Open community platform for hearing aid algorithm research
mha_fftfb.cpp File Reference

Classes

class  MHAOvlFilter::barkscale::hz2bark_t
 
class  MHAOvlFilter::barkscale::bark2hz_t
 

Namespaces

 MHAOvlFilter
 Namespace for overlapping FFT based filter bank classes and functions.
 
 MHAOvlFilter::barkscale
 
 MHAOvlFilter::FreqScaleFun
 Transform functions from linear scale in Hz to new frequency scales.
 
 MHAOvlFilter::ShapeFun
 Shape functions for overlapping filters.
 

Macros

#define BARKSCALE_ENTRIES   50
 

Functions

mha_real_t MHAOvlFilter::FreqScaleFun::hz2hz (mha_real_t x)
 Dummy scale transformation Hz to Hz. More...
 
mha_real_t MHAOvlFilter::FreqScaleFun::hz2khz (mha_real_t x)
 
mha_real_t MHAOvlFilter::FreqScaleFun::hz2octave (mha_real_t x)
 
mha_real_t MHAOvlFilter::FreqScaleFun::hz2third_octave (mha_real_t x)
 
mha_real_t MHAOvlFilter::FreqScaleFun::hz2bark (mha_real_t x)
 Transformation to bark scale. More...
 
mha_real_t MHAOvlFilter::FreqScaleFun::hz2bark_analytic (mha_real_t)
 
mha_real_t MHAOvlFilter::FreqScaleFun::hz2erb (mha_real_t)
 
mha_real_t MHAOvlFilter::FreqScaleFun::hz2erb_glasberg1990 (mha_real_t)
 
mha_real_t MHAOvlFilter::FreqScaleFun::hz2log (mha_real_t x)
 Third octave frequency scale. More...
 
mha_real_t MHAOvlFilter::FreqScaleFun::inv_scale (mha_real_t, mha_real_t(*)(mha_real_t))
 
mha_real_t MHAOvlFilter::ShapeFun::rect (mha_real_t x)
 Filter shape function for rectangular filters. More...
 
mha_real_t MHAOvlFilter::ShapeFun::linear (mha_real_t x)
 Filter shape function for sawtooth filters. More...
 
mha_real_t MHAOvlFilter::ShapeFun::hann (mha_real_t x)
 Filter shape function for hanning shaped filters. More...
 
mha_real_t MHAOvlFilter::ShapeFun::expflt (mha_real_t)
 
mha_real_t MHAOvlFilter::ShapeFun::gauss (mha_real_t)
 
mha_real_t filtershapefun (mha_real_t f, MHAOvlFilter::band_descriptor_t b, mha_real_t plateau)
 Transform the test frequency into the relative position on the filter flank of the given frequency band. More...
 

Variables

mha_real_t MHAOvlFilter::barkscale::vfreq [BARKSCALE_ENTRIES]
 
mha_real_t MHAOvlFilter::barkscale::vbark [BARKSCALE_ENTRIES]
 

Macro Definition Documentation

◆ BARKSCALE_ENTRIES

#define BARKSCALE_ENTRIES   50

Function Documentation

◆ filtershapefun()

mha_real_t filtershapefun ( mha_real_t  f,
MHAOvlFilter::band_descriptor_t  b,
mha_real_t  plateau 
)

Transform the test frequency into the relative position on the filter flank of the given frequency band.

Parameters
fTest frequency in units corresponding to the chosen frequency scale
bDescriptor of a single filter bank band: E.g. contains center frequencies of this and the two adjacent bands, and the crossover ("edge") frequencies of this band.
plateauFor non-rectangular filter shapes, specifies what frequency portion of the band around its center frequency should have no attenuation applied.
Precondition
0 <= plateau <= 1
Returns
The position of frequency f on the filter flank as follows: A returned position of 0 means that f is equal to the band's center frequency, or should be treated the same as the center frequency (i.e. is within the band's plateau). A returned position of -1 means that f is <= the lowest frequency of the filter flank (or is an even lower frequency). A returned value of -0.5 means that f is equal to the lower edge frequency. Positive returned values have equivalent meanings for the high half of the filter flank.