The Open Master Hearing Aid (openMHA)  openMHA
Open community platform for hearing aid algorithm research
Vector and matrix processing toolbox

The vector and matrix processing toolbox consists of a number of classes defined in the namespace MHASignal, and many functions and operators for use with the structures mha_wave_t and mha_spec_t. More...

Collaboration diagram for Vector and matrix processing toolbox:

Classes

struct  mha_wave_t
 Waveform signal structure. More...
 
struct  mha_audio_descriptor_t
 Description of an audio fragment (planned as a replacement of mhaconfig_t). More...
 
struct  mha_audio_t
 An audio fragment in the openMHA (planned as a replacement of mha_wave_t and mha_spec_t). More...
 
class  MHASignal::spectrum_t
 a signal processing class for spectral data (based on mha_spec_t) More...
 
class  MHASignal::waveform_t
 signal processing class for waveform data (based on mha_wave_t) More...
 
class  MHASignal::doublebuffer_t
 Double-buffering class. More...
 
class  MHASignal::hilbert_t
 Hilbert transformation of a waveform segment. More...
 
class  MHASignal::minphase_t
 Minimal phase function. More...
 
class  MHASignal::uint_vector_t
 Vector of unsigned values, used for size and index description of n-dimensional matrixes. More...
 
class  MHASignal::matrix_t
 n-dimensional matrix with real or complex floating point values. More...
 
class  MHAParser::window_t
 MHA configuration interface for a window function generator. More...
 
class  MHASignal::delay_wave_t
 Delayline containing wave fragments. More...
 
class  MHASignal::async_rmslevel_t
 Class for asynchronous level metering. More...
 

Typedefs

typedef float mha_real_t
 openMHA type for real numbers More...
 

Functions

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...
 
mha_real_t MHASignal::bin2freq (mha_real_t bin, unsigned fftlen, mha_real_t srate)
 conversion from fft bin index to frequency More...
 
mha_real_t MHASignal::freq2bin (mha_real_t freq, unsigned fftlen, mha_real_t srate)
 conversion from frequency to fft bin index More...
 
mha_real_t MHASignal::smp2rad (mha_real_t samples, unsigned bin, unsigned fftlen)
 conversion from delay in samples to phase shift More...
 
mha_real_t MHASignal::rad2smp (mha_real_t phase_shift, unsigned bin, unsigned fftlen)
 conversion from phase shift to delay in samples More...
 
template<class elem_type >
std::vector< elem_type > MHASignal::dupvec (std::vector< elem_type > vec, unsigned n)
 Duplicate last vector element to match desired size. More...
 
template<class elem_type >
std::vector< elem_type > MHASignal::dupvec_chk (std::vector< elem_type > vec, unsigned n)
 Duplicate last vector element to match desired size, check for dimension. More...
 
bool equal_dim (const mha_wave_t &a, const mha_wave_t &b)
 Test for equal dimension of waveform structures. More...
 
bool equal_dim (const mha_wave_t &a, const mhaconfig_t &b)
 Test for match of waveform dimension with mhaconfig structure. More...
 
bool equal_dim (const mha_spec_t &a, const mha_spec_t &b)
 Test for equal dimension of spectrum structures. More...
 
bool equal_dim (const mha_spec_t &a, const mhaconfig_t &b)
 Test for match of spectrum dimension with mhaconfig structure. More...
 
bool equal_dim (const mha_wave_t &a, const mha_spec_t &b)
 Test for equal dimension of waveform/spectrum structures. More...
 
bool equal_dim (const mha_spec_t &a, const mha_wave_t &b)
 Test for equal dimension of waveform/spectrum structures. More...
 
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...
 
unsigned int size (const mha_wave_t &s)
 Return size of a waveform structure. More...
 
unsigned int size (const mha_spec_t &s)
 Return size of a spectrum structure. More...
 
unsigned int size (const mha_wave_t *s)
 Return size of a waveform structure. More...
 
unsigned int size (const mha_spec_t *s)
 Return size of a spectrum structure. More...
 
void clear (mha_wave_t &s)
 Set all values of waveform to zero. More...
 
void clear (mha_wave_t *s)
 Set all values of waveform to zero. More...
 
void clear (mha_spec_t &s)
 Set all values of spectrum to zero. More...
 
void clear (mha_spec_t *s)
 Set all values of spectrum to zero. More...
 
void assign (mha_wave_t self, mha_real_t val)
 Set all values of waveform 'self' to 'val'. 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...
 
mha_real_tvalue (mha_wave_t *s, unsigned int fr, unsigned int ch)
 Access an element of a waveform structure. More...
 
const mha_real_tvalue (const mha_wave_t *s, unsigned int fr, unsigned int ch)
 Constant access to an element of a waveform structure. More...
 
mha_complex_tvalue (mha_spec_t *s, unsigned int fr, unsigned int ch)
 Access to an element of a spectrum. More...
 
const mha_complex_tvalue (const mha_spec_t *s, unsigned int fr, unsigned int ch)
 Constant access to an element of a spectrum. More...
 
mha_real_tvalue (mha_wave_t &s, unsigned int fr, unsigned int ch)
 Access to an element of a waveform structure. More...
 
const mha_real_tvalue (const mha_wave_t &s, unsigned int fr, unsigned int ch)
 Constant access to an element of a waveform structure. More...
 
mha_complex_tvalue (mha_spec_t &s, unsigned int fr, unsigned int ch)
 Access to an element of a spectrum. More...
 
const mha_complex_tvalue (const mha_spec_t &s, unsigned int fr, unsigned int ch)
 Constant access to an element of a spectrum. More...
 
std::vector< float > std_vector_float (const mha_wave_t &)
 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 &)
 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 &)
 Converts a mha_spec_t structure into a std::vector< std::vector<mha_complex_t> > (outer vector represents channels). More...
 
mha_wave_toperator+= (mha_wave_t &, const mha_real_t &)
 Addition operator. More...
 
mha_wave_toperator+= (mha_wave_t &, const mha_wave_t &)
 Addition operator. More...
 
mha_wave_toperator-= (mha_wave_t &, const mha_wave_t &)
 Subtraction operator. More...
 
mha_spec_toperator-= (mha_spec_t &, const mha_spec_t &)
 Subtraction operator. More...
 
mha_wave_toperator*= (mha_wave_t &, const mha_real_t &)
 Element-wise multiplication operator. More...
 
mha_wave_toperator*= (mha_wave_t &, const mha_wave_t &)
 Element-wise multiplication operator. More...
 
mha_spec_toperator*= (mha_spec_t &, const mha_real_t &)
 Element-wise multiplication operator. More...
 
mha_spec_toperator*= (mha_spec_t &, const mha_wave_t &)
 Element-wise multiplication operator. More...
 
mha_spec_toperator*= (mha_spec_t &, const mha_spec_t &)
 Element-wise multiplication operator. More...
 
mha_spec_toperator/= (mha_spec_t &, const mha_spec_t &)
 Element-wise division operator. More...
 
mha_wave_toperator/= (mha_wave_t &, const mha_wave_t &)
 Element-wise division operator. More...
 
mha_spec_toperator+= (mha_spec_t &, const mha_spec_t &)
 Addition operator. More...
 
mha_spec_toperator+= (mha_spec_t &, const mha_real_t &)
 Addition operator. More...
 
mha_wave_toperator^= (mha_wave_t &self, const mha_real_t &arg)
 Exponent operator. More...
 
void MHASignal::copy_channel (mha_spec_t &self, const mha_spec_t &src, unsigned sch, unsigned dch)
 Copy one channel of a source signal. More...
 
void MHASignal::copy_channel (mha_wave_t &self, const mha_wave_t &src, unsigned src_channel, unsigned dest_channel)
 Copy one channel of a source signal. More...
 
mha_real_t MHASignal::rmslevel (const mha_spec_t &s, unsigned int channel, unsigned int fftlen)
 Return RMS level of a spectrum channel. More...
 
mha_real_t MHASignal::colored_intensity (const mha_spec_t &s, unsigned int channel, unsigned int fftlen, mha_real_t *sqfreq_response=nullptr)
 Colored spectrum intensity. More...
 
mha_real_t MHASignal::maxabs (const mha_spec_t &s, unsigned int channel)
 Find maximal absolute value. More...
 
mha_real_t MHASignal::rmslevel (const mha_wave_t &s, unsigned int channel)
 Return RMS level of a waveform channel. More...
 
mha_real_t MHASignal::maxabs (const mha_wave_t &s, unsigned int channel)
 Find maximal absolute value. More...
 
mha_real_t MHASignal::maxabs (const mha_wave_t &s)
 Find maximal absolute value. More...
 
mha_real_t MHASignal::max (const mha_wave_t &s)
 Find maximal value. More...
 
mha_real_t MHASignal::min (const mha_wave_t &s)
 Find minimal value. More...
 
mha_real_t MHASignal::sumsqr_channel (const mha_wave_t &s, unsigned int channel)
 Calculate sum of squared values in one channel. More...
 
mha_real_t MHASignal::sumsqr_frame (const mha_wave_t &s, unsigned int frame)
 Calculate sum over all channels of squared values. More...
 
void conjugate (mha_spec_t &self)
 Replace (!) the value of this mha_spec_t with its conjugate. More...
 

Detailed Description

The vector and matrix processing toolbox consists of a number of classes defined in the namespace MHASignal, and many functions and operators for use with the structures mha_wave_t and mha_spec_t.

Typedef Documentation

◆ mha_real_t

typedef float mha_real_t

openMHA type for real numbers

This type is expected to be allways the C-type 'float' (IEEE 754 single).

Function Documentation

◆ range()

mha_wave_t range ( mha_wave_t  s,
unsigned int  k0,
unsigned int  len 
)

Return a time interval from a waveform chunk.

A waveform chunk containing a time intervall of a larger waveform chunk is returned. The number of channels remains constant. The data of the output waveform structure points to the data of the input structure, i.e., write access to the output waveform chunk modifies the corresponding entries in the input chunk.

Parameters
sWaveform structure
k0Index of first value in output
lenNumber of frames in output
Returns
Waveform structure representing the sub-interval.

◆ channels()

mha_spec_t channels ( mha_spec_t  s,
unsigned int  ch_start,
unsigned int  nch 
)

Return a channel interval from a spectrum.

Parameters
sInput spectrum
ch_startIndex of first channel in output
nchNumber of channels in output
Returns
Spectrum structure representing the sub-interval.

◆ bin2freq()

mha_real_t MHASignal::bin2freq ( mha_real_t  bin,
unsigned  fftlen,
mha_real_t  srate 
)
inline

conversion from fft bin index to frequency

Parameters
binindex of fft bin, index 0 has dc
fftlenFFT length
sratesampling frequency / Hz
Returns
frequency of fft bin / Hz

◆ freq2bin()

mha_real_t MHASignal::freq2bin ( mha_real_t  freq,
unsigned  fftlen,
mha_real_t  srate 
)
inline

conversion from frequency to fft bin index

Parameters
freqfrequency / Hz
fftlenFFT length
sratesampling frequency / Hz
Returns
0-based index of fft bin, generally has non-zero fractional part

◆ smp2rad()

mha_real_t MHASignal::smp2rad ( mha_real_t  samples,
unsigned  bin,
unsigned  fftlen 
)
inline

conversion from delay in samples to phase shift

Compute phase shift that needs to be applied to fft spectrum to achieve the desired delay.

Parameters
samplesdelay in samples. Positive delay: shift current signal to future.
binindex of fft bin, index 0 has dc (index 0 and nyqvist bin cannot be delayed)
fftlenFFT length
Returns
The phase shift in radiant that needs to be applied to fft bin to achieve the desired delay. A positive delay requires a negative phase shift. If required phase shift is >pi or <-pi, then the desired delay cannot be applied in the fft domain with given parameters. Required phase shifts close to pi should not be used. If bin is 0 or nyqvist, returns 0 phase shift.

◆ rad2smp()

mha_real_t MHASignal::rad2smp ( mha_real_t  phase_shift,
unsigned  bin,
unsigned  fftlen 
)
inline

conversion from phase shift to delay in samples

Compute delay in samples that is achieved by a phase shift.

Parameters
phase_shiftphase shift in radiant
binindex of fft bin, index 0 has dc (index 0 and nyqvist bin cannot be delayed)
fftlenFFT length
Returns
The delay in samples achieved by applying the phase shift. A negative phase shift causes a positive delay: shifts current signal to future.

◆ dupvec()

template<class elem_type >
std::vector<elem_type> MHASignal::dupvec ( std::vector< elem_type >  vec,
unsigned  n 
)

Duplicate last vector element to match desired size.

Parameters
vecInput vector.
nTarget number of elements.
Return values
Resizedvector.

◆ dupvec_chk()

template<class elem_type >
std::vector<elem_type> MHASignal::dupvec_chk ( std::vector< elem_type >  vec,
unsigned  n 
)

Duplicate last vector element to match desired size, check for dimension.

The input dimension can be either 1 or the target length.

Parameters
vecInput vector.
nTarget number of elements.
Return values
Resizedvector.

◆ equal_dim() [1/6]

bool equal_dim ( const mha_wave_t a,
const mha_wave_t b 
)
inline

Test for equal dimension of waveform structures.

◆ equal_dim() [2/6]

bool equal_dim ( const mha_wave_t a,
const mhaconfig_t b 
)
inline

Test for match of waveform dimension with mhaconfig structure.

◆ equal_dim() [3/6]

bool equal_dim ( const mha_spec_t a,
const mha_spec_t b 
)
inline

Test for equal dimension of spectrum structures.

◆ equal_dim() [4/6]

bool equal_dim ( const mha_spec_t a,
const mhaconfig_t b 
)
inline

Test for match of spectrum dimension with mhaconfig structure.

◆ equal_dim() [5/6]

bool equal_dim ( const mha_wave_t a,
const mha_spec_t b 
)
inline

Test for equal dimension of waveform/spectrum structures.

Warning
Waveform structures mha_wave_t use interleaved data order, while spectrum structures mha_spec_t use non-interleaved.

◆ equal_dim() [6/6]

bool equal_dim ( const mha_spec_t a,
const mha_wave_t b 
)
inline

Test for equal dimension of waveform/spectrum structures.

Warning
Waveform structures mha_wave_t use interleaved data order, while spectrum structures mha_spec_t use non-interleaved.

◆ integrate() [1/2]

void integrate ( mha_wave_t s)

Numeric integration of a signal vector (real values)

Parameters
sInput signal vector

◆ integrate() [2/2]

void integrate ( mha_spec_t s)

Numeric integration of a signal vector (complex values)

Parameters
sInput signal vector

◆ size() [1/4]

unsigned int size ( const mha_wave_t s)
inline

Return size of a waveform structure.

◆ size() [2/4]

unsigned int size ( const mha_spec_t s)
inline

Return size of a spectrum structure.

◆ size() [3/4]

unsigned int size ( const mha_wave_t s)
inline

Return size of a waveform structure.

◆ size() [4/4]

unsigned int size ( const mha_spec_t s)
inline

Return size of a spectrum structure.

◆ clear() [1/4]

void clear ( mha_wave_t s)
inline

Set all values of waveform to zero.

◆ clear() [2/4]

void clear ( mha_wave_t s)
inline

Set all values of waveform to zero.

◆ clear() [3/4]

void clear ( mha_spec_t s)
inline

Set all values of spectrum to zero.

◆ clear() [4/4]

void clear ( mha_spec_t s)
inline

Set all values of spectrum to zero.

◆ assign() [1/3]

void assign ( mha_wave_t  self,
mha_real_t  val 
)
inline

Set all values of waveform 'self' to 'val'.

Parameters
selfWaveform to be modified.
valValue to be assigned to all entries of waveform.

◆ assign() [2/3]

void assign ( mha_wave_t  self,
const mha_wave_t val 
)

Set all values of waveform 'self' to 'val'.

Parameters
selfWaveform to be modified.
valSource waveform structure.

◆ assign() [3/3]

void assign ( mha_spec_t  self,
const mha_spec_t val 
)

Set all values of spectrum 'self' to 'val'.

Parameters
selfSpectrum to be modified.
valSource spectrum.

◆ timeshift()

void timeshift ( mha_wave_t self,
int  shift 
)

Time shift of waveform chunk.

Shifted areas are filled with zeros.

Parameters
selfWaveform chunk to be shifted
shiftShift amount, positive values shift to later times

◆ value() [1/8]

mha_real_t& value ( mha_wave_t s,
unsigned int  fr,
unsigned int  ch 
)
inline

Access an element of a waveform structure.

Parameters
sWaveform structure
frFrame number
chChannel number
Returns
Reference to element

◆ value() [2/8]

const mha_real_t& value ( const mha_wave_t s,
unsigned int  fr,
unsigned int  ch 
)
inline

Constant access to an element of a waveform structure.

Parameters
sWaveform structure
frFrame number
chChannel number
Returns
Reference to element

◆ value() [3/8]

mha_complex_t& value ( mha_spec_t s,
unsigned int  fr,
unsigned int  ch 
)
inline

Access to an element of a spectrum.

Parameters
sSpectrum structure
frBin number
chChannel number
Returns
Reference to element

◆ value() [4/8]

const mha_complex_t& value ( const mha_spec_t s,
unsigned int  fr,
unsigned int  ch 
)
inline

Constant access to an element of a spectrum.

Parameters
sSpectrum structure
frBin number
chChannel number
Returns
Reference to element

◆ value() [5/8]

mha_real_t& value ( mha_wave_t s,
unsigned int  fr,
unsigned int  ch 
)
inline

Access to an element of a waveform structure.

Parameters
sWaveform structure
frFrame number
chChannel number
Returns
Reference to element

◆ value() [6/8]

const mha_real_t& value ( const mha_wave_t s,
unsigned int  fr,
unsigned int  ch 
)
inline

Constant access to an element of a waveform structure.

Parameters
sWaveform structure
frFrame number
chChannel number
Returns
Reference to element

◆ value() [7/8]

mha_complex_t& value ( mha_spec_t s,
unsigned int  fr,
unsigned int  ch 
)
inline

Access to an element of a spectrum.

Parameters
sSpectrum structure
frBin number
chChannel number
Returns
Reference to element

◆ value() [8/8]

const mha_complex_t& value ( const mha_spec_t s,
unsigned int  fr,
unsigned int  ch 
)
inline

Constant access to an element of a spectrum.

Parameters
sSpectrum structure
frBin number
chChannel number
Returns
Reference to element

◆ std_vector_float()

std::vector<float> std_vector_float ( const mha_wave_t w)

Converts a mha_wave_t structure into a std::vector<float> (interleaved order).

Warning
This function is not real-time safe. Do not use in signal processing thread.

◆ std_vector_vector_float()

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).

Warning
This function is not real-time safe. Do not use in signal processing thread.

◆ std_vector_vector_complex()

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).

Warning
This function is not real-time safe. Do not use in signal processing thread.

◆ operator+=() [1/4]

mha_wave_t& operator+= ( mha_wave_t self,
const mha_real_t v 
)

Addition operator.

◆ operator+=() [2/4]

mha_wave_t& operator+= ( mha_wave_t self,
const mha_wave_t v 
)

Addition operator.

◆ operator-=() [1/2]

mha_wave_t& operator-= ( mha_wave_t self,
const mha_wave_t v 
)

Subtraction operator.

◆ operator-=() [2/2]

mha_spec_t& operator-= ( mha_spec_t self,
const mha_spec_t v 
)

Subtraction operator.

◆ operator*=() [1/5]

mha_wave_t& operator*= ( mha_wave_t self,
const mha_real_t v 
)

Element-wise multiplication operator.

◆ operator*=() [2/5]

mha_wave_t& operator*= ( mha_wave_t self,
const mha_wave_t v 
)

Element-wise multiplication operator.

◆ operator*=() [3/5]

mha_spec_t& operator*= ( mha_spec_t self,
const mha_real_t v 
)

Element-wise multiplication operator.

◆ operator*=() [4/5]

mha_spec_t& operator*= ( mha_spec_t self,
const mha_wave_t v 
)

Element-wise multiplication operator.

◆ operator*=() [5/5]

mha_spec_t& operator*= ( mha_spec_t self,
const mha_spec_t v 
)

Element-wise multiplication operator.

◆ operator/=() [1/2]

mha_spec_t& operator/= ( mha_spec_t self,
const mha_spec_t v 
)

Element-wise division operator.

◆ operator/=() [2/2]

mha_wave_t& operator/= ( mha_wave_t self,
const mha_wave_t v 
)

Element-wise division operator.

◆ operator+=() [3/4]

mha_spec_t& operator+= ( mha_spec_t self,
const mha_spec_t v 
)

Addition operator.

◆ operator+=() [4/4]

mha_spec_t& operator+= ( mha_spec_t self,
const mha_real_t v 
)

Addition operator.

◆ operator^=()

mha_wave_t& operator^= ( mha_wave_t self,
const mha_real_t arg 
)

Exponent operator.

Warning
This overwrites the xor operator!

◆ copy_channel() [1/2]

void MHASignal::copy_channel ( mha_spec_t self,
const mha_spec_t src,
unsigned  sch,
unsigned  dch 
)

Copy one channel of a source signal.

Parameters
selfDestination.
srcSource
schSource channel number
dchDestination channel number

◆ copy_channel() [2/2]

void MHASignal::copy_channel ( mha_wave_t self,
const mha_wave_t src,
unsigned  src_channel,
unsigned  dest_channel 
)

Copy one channel of a source signal.

Parameters
selfDestination.
srcSource
src_channelSource channel number
dest_channelDestination channel number

◆ rmslevel() [1/2]

mha_real_t MHASignal::rmslevel ( const mha_spec_t s,
unsigned int  channel,
unsigned int  fftlen 
)

Return RMS level of a spectrum channel.

Computes the RMS level of the signal in Pascal in the given channel.

Takes into account the the negative frequency bins that are not stored (Central Calibration).

Parameters
sInput spectrum
channelChannel number to be tested
fftlenFFT length (to correctly count the level of the Nyquist bin)
Returns
RMS level in Pa

◆ colored_intensity()

mha_real_t MHASignal::colored_intensity ( const mha_spec_t s,
unsigned int  channel,
unsigned int  fftlen,
mha_real_t sqfreq_response = nullptr 
)

Colored spectrum intensity.

computes the squared sum of the spectrum after filtering with the frequency response. Takes into account the negative frequency bins that are not stored (Central Calibration).

Parameters
sInput spectrum
channelChannel number to be tested
fftlenFFT length (to correctly count the level of the Nyquist bin)
sqfreq_responseAn array with one squared weighting factor for every fft bin. Array length must be equal to s->num_frames. nullptr can be given for equal weighting of all frequencies.
Returns
sum of squares. Root of this is the colored level in Pa

◆ maxabs() [1/3]

mha_real_t MHASignal::maxabs ( const mha_spec_t s,
unsigned int  channel 
)

Find maximal absolute value.

Parameters
sInput signal
channelChannel to be tested
Returns
maximum absolute value

◆ rmslevel() [2/2]

mha_real_t MHASignal::rmslevel ( const mha_wave_t s,
unsigned int  channel 
)

Return RMS level of a waveform channel.

Parameters
sInput waveform signal
channelChannel number to be tested
Returns
RMS level in Pa

◆ maxabs() [2/3]

mha_real_t MHASignal::maxabs ( const mha_wave_t s,
unsigned int  channel 
)

Find maximal absolute value.

Parameters
sInput signal
channelChannel to be tested
Returns
maximum absolute value

◆ maxabs() [3/3]

mha_real_t MHASignal::maxabs ( const mha_wave_t s)

Find maximal absolute value.

Parameters
sInput signal
Returns
maximum absolute value

◆ max()

mha_real_t MHASignal::max ( const mha_wave_t s)

Find maximal value.

Parameters
sInput signal
Returns
maximum absolute value

◆ min()

mha_real_t MHASignal::min ( const mha_wave_t s)

Find minimal value.

Parameters
sInput signal
Returns
maximum absolute value

◆ sumsqr_channel()

mha_real_t MHASignal::sumsqr_channel ( const mha_wave_t s,
unsigned int  channel 
)

Calculate sum of squared values in one channel.

Parameters
sInput signal
channelChannel
Returns
$\sum x^2$

◆ sumsqr_frame()

mha_real_t MHASignal::sumsqr_frame ( const mha_wave_t s,
unsigned int  frame 
)

Calculate sum over all channels of squared values.

Parameters
sInput signal
frameFrame number
Returns
$\sum x^2$

◆ conjugate()

void conjugate ( mha_spec_t self)
inline

Replace (!) the value of this mha_spec_t with its conjugate.