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

Classes

class  MHASignal::hilbert_fftw_t
 

Namespaces

 MHASignal
 Namespace for audio signal handling and processing classes.
 

Macros

#define MHA_ID_UINT_VECTOR   "MHASignal::uint_vector_t"
 
#define MHA_ID_MATRIX   "MHASignal::matrix_t"
 
#define ASSERT_EQUAL_DIM(a, b)
 
#define ASSERT_EQUAL_DIM_PTR(a, b)
 

Functions

void set_minabs (mha_spec_t &self, const mha_real_t &m)
 
mha_wave_toperator+= (mha_wave_t &self, const mha_real_t &v)
 Addition operator. More...
 
mha_wave_toperator*= (mha_wave_t &self, const mha_real_t &v)
 Element-wise multiplication operator. More...
 
mha_spec_toperator*= (mha_spec_t &self, const mha_real_t &v)
 Element-wise multiplication operator. More...
 
mha_wave_toperator*= (mha_wave_t &self, const mha_wave_t &v)
 Element-wise multiplication operator. More...
 
mha_spec_toperator*= (mha_spec_t &self, const mha_wave_t &v)
 Element-wise multiplication operator. More...
 
mha_spec_toperator*= (mha_spec_t &self, const mha_spec_t &v)
 Element-wise multiplication operator. More...
 
mha_spec_tsafe_div (mha_spec_t &self, const mha_spec_t &v, mha_real_t eps)
 In-Place division with lower limit on divisor. More...
 
mha_spec_toperator/= (mha_spec_t &self, const mha_spec_t &v)
 Element-wise division operator. More...
 
mha_wave_toperator/= (mha_wave_t &self, const mha_wave_t &v)
 Element-wise division operator. More...
 
mha_spec_toperator+= (mha_spec_t &self, const mha_spec_t &v)
 Addition operator. More...
 
mha_spec_toperator+= (mha_spec_t &self, const mha_real_t &v)
 Addition operator. More...
 
mha_wave_toperator+= (mha_wave_t &self, const mha_wave_t &v)
 Addition operator. More...
 
mha_wave_toperator-= (mha_wave_t &self, const mha_wave_t &v)
 Subtraction operator. More...
 
mha_spec_toperator-= (mha_spec_t &self, const mha_spec_t &v)
 Subtraction operator. More...
 
mha_fft_t mha_fft_new (unsigned int n)
 Create a new instance of an FFT object. More...
 
void mha_fft_free (mha_fft_t h)
 Remove an FFT object. More...
 
void mha_fft_wave2spec (mha_fft_t h, const mha_wave_t *in, mha_spec_t *out)
 Perform an FFT on each channel of input waveform signal. More...
 
void mha_fft_wave2spec (mha_fft_t h, const mha_wave_t *in, mha_spec_t *out, bool swap)
 Tranform waveform segment into spectrum. More...
 
void mha_fft_spec2wave (mha_fft_t h, const mha_spec_t *in, mha_wave_t *out)
 Perform an inverse FFT on each channel of input spectrum. More...
 
void mha_fft_spec2wave (mha_fft_t h, const mha_spec_t *in, mha_wave_t *out, unsigned int offset)
 Perform an inverse FFT on each channel of input spectrum. More...
 
void mha_fft_forward (mha_fft_t h, mha_spec_t *sIn, mha_spec_t *sOut)
 Complex to complex FFT (forward). More...
 
void mha_fft_backward (mha_fft_t h, mha_spec_t *sIn, mha_spec_t *sOut)
 Complex to complex FFT (backward). More...
 
void mha_fft_forward_scale (mha_fft_t h, mha_spec_t *sIn, mha_spec_t *sOut)
 Complex to complex FFT (forward). More...
 
void mha_fft_backward_scale (mha_fft_t h, mha_spec_t *sIn, mha_spec_t *sOut)
 Complex to complex FFT (backward). More...
 
void mha_fft_wave2spec_scale (mha_fft_t h, const mha_wave_t *in, mha_spec_t *out)
 Tranform waveform segment into spectrum. More...
 
void mha_fft_spec2wave_scale (mha_fft_t h, const mha_spec_t *in, mha_wave_t *out)
 Tranform spectrum into waveform segment. More...
 
std::vector< float > std_vector_float (const mha_wave_t &w)
 Converts a mha_wave_t structure into a std::vector<float> (interleaved order). More...
 
std::vector< std::vector< float > > std_vector_vector_float (const mha_wave_t &w)
 Converts a mha_wave_t structure into a std::vector< std::vector<float> > (outer vector represents channels). More...
 
std::vector< std::vector< mha_complex_t > > std_vector_vector_complex (const mha_spec_t &w)
 Converts a mha_spec_t structure into a std::vector< std::vector<mha_complex_t> > (outer vector represents channels). More...
 
static mha_real_t intensity (const mha_spec_t &s, unsigned int channel, unsigned int fftlen, mha_real_t *sqfreq_response=0)
 
void integrate (mha_wave_t &s)
 Numeric integration of a signal vector (real values) More...
 
void integrate (mha_spec_t &s)
 Numeric integration of a signal vector (complex values) More...
 
mha_wave_toperator^= (mha_wave_t &self, const mha_real_t &arg)
 Exponent operator. More...
 
mha_wave_t range (mha_wave_t s, unsigned int k0, unsigned int len)
 Return a time interval from a waveform chunk. More...
 
mha_spec_t channels (mha_spec_t s, unsigned int ch_start, unsigned int nch)
 Return a channel interval from a spectrum. More...
 
void assign (mha_wave_t self, const mha_wave_t &val)
 Set all values of waveform 'self' to 'val'. More...
 
void assign (mha_spec_t self, const mha_spec_t &val)
 Set all values of spectrum 'self' to 'val'. More...
 
void timeshift (mha_wave_t &self, int shift)
 Time shift of waveform chunk. More...
 

Macro Definition Documentation

◆ MHA_ID_UINT_VECTOR

#define MHA_ID_UINT_VECTOR   "MHASignal::uint_vector_t"

◆ MHA_ID_MATRIX

#define MHA_ID_MATRIX   "MHASignal::matrix_t"

◆ ASSERT_EQUAL_DIM

#define ASSERT_EQUAL_DIM (   a,
 
)

◆ ASSERT_EQUAL_DIM_PTR

#define ASSERT_EQUAL_DIM_PTR (   a,
 
)

Function Documentation

◆ set_minabs()

void set_minabs ( mha_spec_t self,
const mha_real_t m 
)

◆ safe_div()

mha_spec_t& safe_div ( mha_spec_t self,
const mha_spec_t v,
mha_real_t  eps 
)

In-Place division with lower limit on divisor.

◆ intensity()

static mha_real_t intensity ( const mha_spec_t s,
unsigned int  channel,
unsigned int  fftlen,
mha_real_t sqfreq_response = 0 
)
static