The Open Master Hearing Aid (openMHA)
openMHA
Open community platform for hearing aid algorithm research
|
Generic IIR filter class. More...
Public Member Functions | |
filter_t (unsigned int ch, unsigned int lena, unsigned int lenb) | |
Constructor. More... | |
filter_t (unsigned int ch, const std::vector< mha_real_t > &vA, const std::vector< mha_real_t > &vB) | |
Constructor with initialization of coefficients. More... | |
filter_t (const MHAFilter::filter_t &src) | |
Copy constructor. More... | |
filter_t & | operator= (const MHAFilter::filter_t &)=delete |
Assignment operator is not implemented. More... | |
~filter_t () | |
void | filter (mha_wave_t *out, const mha_wave_t *in) |
Filter all channels in a waveform structure. More... | |
void | filter (mha_real_t *dest, const mha_real_t *src, unsigned int dframes, unsigned int frame_dist, unsigned int channel_dist, unsigned int channel_begin, unsigned int channel_end) |
Filter parts of a waveform structure. More... | |
mha_real_t | filter (mha_real_t x, unsigned int ch) |
Filter one sample. More... | |
unsigned int | get_len_A () const |
Return length of recursive coefficients. More... | |
unsigned int | get_len_B () const |
Return length of non-recursive coefficients. More... | |
Public Attributes | |
double * | A |
Pointer to recursive coefficients. More... | |
double * | B |
Pointer to non-recursive coefficients. More... | |
Private Attributes | |
unsigned int | len_A |
unsigned int | len_B |
unsigned int | len |
unsigned int | channels |
double * | state |
Generic IIR filter class.
This class implements a generic multichannel IIR filter. It is realized as direct form II. It can work on any float array or on mha_wave_t structs. The filter coefficients can be directly accessed.
MHAFilter::filter_t::filter_t | ( | unsigned int | ch, |
unsigned int | lena, | ||
unsigned int | lenb | ||
) |
Constructor.
ch | Number of channels |
lena | Number of recursive coefficients |
lenb | Number of non-recursive coefficients |
MHAFilter::filter_t::filter_t | ( | unsigned int | ch, |
const std::vector< mha_real_t > & | vA, | ||
const std::vector< mha_real_t > & | vB | ||
) |
Constructor with initialization of coefficients.
ch | Number of channels. |
vA | Recursive coefficients. |
vB | Non-recursive coefficients. |
MHAFilter::filter_t::filter_t | ( | const MHAFilter::filter_t & | src | ) |
Copy constructor.
MHAFilter::filter_t::~filter_t | ( | ) |
|
delete |
Assignment operator is not implemented.
Use copy constructor instead.
void MHAFilter::filter_t::filter | ( | mha_wave_t * | out, |
const mha_wave_t * | in | ||
) |
Filter all channels in a waveform structure.
out | Output signal |
in | Input signal |
void MHAFilter::filter_t::filter | ( | mha_real_t * | dest, |
const mha_real_t * | src, | ||
unsigned int | dframes, | ||
unsigned int | frame_dist, | ||
unsigned int | channel_dist, | ||
unsigned int | channel_begin, | ||
unsigned int | channel_end | ||
) |
Filter parts of a waveform structure.
dest | Output signal. |
src | Input signal. |
dframes | Number of frames to be filtered. |
frame_dist | Index distance between frames of one channel |
channel_dist | Index distance between audio channels |
channel_begin | Number of first channel to be processed |
channel_end | Number of last channel to be processed |
mha_real_t MHAFilter::filter_t::filter | ( | mha_real_t | x, |
unsigned int | ch | ||
) |
Filter one sample.
x | Input value |
ch | Channel number to use in filter state |
|
inline |
Return length of recursive coefficients.
|
inline |
Return length of non-recursive coefficients.
double* MHAFilter::filter_t::A |
Pointer to recursive coefficients.
double* MHAFilter::filter_t::B |
Pointer to non-recursive coefficients.
|
private |
|
private |
|
private |
|
private |
|
private |