The Open Master Hearing Aid (openMHA)  openMHA
Open community platform for hearing aid algorithm research
MHAFilter::transfer_function_t Struct Reference

a structure containing a source channel number, a target channel number, and an impulse response. More...

Public Member Functions

 transfer_function_t ()
 Default constructor for STL conformity. More...
 
 transfer_function_t (unsigned int source_channel_index, unsigned int target_channel_index, const std::vector< float > &impulse_response)
 Data constructor. More...
 
unsigned int partitions (unsigned int fragsize) const
 for the given partition size, return the number of partitions of the impulse response. More...
 
unsigned int non_empty_partitions (unsigned int fragsize) const
 for the given partition size, return the number of non-empty partitions of the impulse response. More...
 
bool isempty (unsigned int fragsize, unsigned int index) const
 checks if the partition contains only zeros More...
 

Public Attributes

unsigned int source_channel_index
 Source audio channel index for this transfer function. More...
 
unsigned int target_channel_index
 Target audio channel index for this transfer function. More...
 
std::vector< float > impulse_response
 Impulse response of transfer from source to target channel. More...
 

Detailed Description

a structure containing a source channel number, a target channel number, and an impulse response.

Constructor & Destructor Documentation

◆ transfer_function_t() [1/2]

MHAFilter::transfer_function_t::transfer_function_t ( )
inline

Default constructor for STL conformity.

Not used.

◆ transfer_function_t() [2/2]

MHAFilter::transfer_function_t::transfer_function_t ( unsigned int  source_channel_index,
unsigned int  target_channel_index,
const std::vector< float > &  impulse_response 
)

Data constructor.

Parameters
source_channel_indexSource audio channel index for this transfer function
target_channel_indexTarget audio channel index for this transfer function
impulse_responseImpulse response of transfer from source to target channel

Member Function Documentation

◆ partitions()

unsigned int MHAFilter::transfer_function_t::partitions ( unsigned int  fragsize) const
inline

for the given partition size, return the number of partitions of the impulse response.

Parameters
fragsizepartition size
Returns
number of partitions occupied by the impulse response

◆ non_empty_partitions()

unsigned int MHAFilter::transfer_function_t::non_empty_partitions ( unsigned int  fragsize) const
inline

for the given partition size, return the number of non-empty partitions of the impulse response.

Parameters
fragsizepartition size
Returns
the number of non-empty partitions of the impulse response, i.e. partitions containing only zeros are not counted.

◆ isempty()

bool MHAFilter::transfer_function_t::isempty ( unsigned int  fragsize,
unsigned int  index 
) const
inline

checks if the partition contains only zeros

Parameters
fragsizepartition size
indexpartition index
Returns
true when this partition of the impulse response contains only zeros.

Member Data Documentation

◆ source_channel_index

unsigned int MHAFilter::transfer_function_t::source_channel_index

Source audio channel index for this transfer function.

◆ target_channel_index

unsigned int MHAFilter::transfer_function_t::target_channel_index

Target audio channel index for this transfer function.

◆ impulse_response

std::vector<float> MHAFilter::transfer_function_t::impulse_response

Impulse response of transfer from source to target channel.


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