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

Class for storing two hanning ramps: a rising ramp a and a falling ramp b. More...

Public Member Functions

 hanning_ramps_t (unsigned int len_a, unsigned int len_b)
 Initialize two arrays with hanning ramp factors. More...
 
 ~hanning_ramps_t ()
 
void operator() (MHASignal::waveform_t &b)
 Apply the hanning ramps to a waveform. More...
 

Private Attributes

unsigned int len_a
 Length of the rising ramp a. More...
 
unsigned int len_b
 Length of the falling ramp b. More...
 
mha_real_tramp_a
 Factors of the rising hanning ramp from 0 (inclusive) to 1 (exclusive). More...
 
mha_real_tramp_b
 Factors of the falling hanning ramp from 1 (inclusive) to 0(exclusive). More...
 

Detailed Description

Class for storing two hanning ramps: a rising ramp a and a falling ramp b.

Constructor & Destructor Documentation

◆ hanning_ramps_t()

hanning_ramps_t::hanning_ramps_t ( unsigned int  len_a,
unsigned int  len_b 
)

Initialize two arrays with hanning ramp factors.

Parameters
len_aLength of the rising ramp a from 0 (inclusive) to 1 (exclusive).
len_bLength of the falling ramp b from 1 (inclusive) to 0 (exclusive).

◆ ~hanning_ramps_t()

hanning_ramps_t::~hanning_ramps_t ( void  )

Member Function Documentation

◆ operator()()

void hanning_ramps_t::operator() ( MHASignal::waveform_t b)

Apply the hanning ramps to a waveform.

Parameters
bThe waveform to which the ramps are applied. ramp_a is applied to the first len_a frames of b, ramp_b is applied to the last len_b frames of b. Ramps are applied to all channels. If the waveform has fewer frames than len_a or len_b, then the respective ramp is truncated. The audio samples stored by b are modified in place.

Member Data Documentation

◆ len_a

unsigned int hanning_ramps_t::len_a
private

Length of the rising ramp a.

◆ len_b

unsigned int hanning_ramps_t::len_b
private

Length of the falling ramp b.

◆ ramp_a

mha_real_t* hanning_ramps_t::ramp_a
private

Factors of the rising hanning ramp from 0 (inclusive) to 1 (exclusive).

◆ ramp_b

mha_real_t* hanning_ramps_t::ramp_b
private

Factors of the falling hanning ramp from 1 (inclusive) to 0(exclusive).


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