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

FFT based FIR filterbank implementation. More...

Inheritance diagram for MHAFilter::fftfilterbank_t:
Inheritance graph

Public Member Functions

 fftfilterbank_t (unsigned int fragsize, unsigned int inputchannels, unsigned int firchannels, unsigned int fftlen)
 Constructor. More...
 
 ~fftfilterbank_t ()
 
void update_coeffs (const mha_wave_t *h)
 Update the set of coefficients. More...
 
void filter (const mha_wave_t *s_in, mha_wave_t **s_out, const mha_wave_t *h)
 Apply filter with changing coefficients to a waveform fragment. More...
 
void filter (const mha_wave_t *s_in, mha_wave_t **s_out)
 Apply filter to waveform fragment, without changing the coefficients. More...
 
const mha_wave_tget_irs () const
 Return the current IRS. More...
 

Private Attributes

unsigned int fragsize
 
unsigned int inputchannels
 
unsigned int firchannels
 
unsigned int outputchannels
 
unsigned int fftlen
 
MHASignal::waveform_t hw
 
MHASignal::spectrum_t Hs
 
MHASignal::waveform_t xw
 
MHASignal::spectrum_t Xs
 
MHASignal::waveform_t yw
 
MHASignal::spectrum_t Ys
 
MHASignal::waveform_t yw_temp
 
MHASignal::waveform_t tail
 
mha_fft_t fft
 

Detailed Description

FFT based FIR filterbank implementation.

This class convolves n input channels with m filter coefficient sets and returns n*m output channels.

The maximal number of coefficients can be FFT length - fragsize + 1.

Constructor & Destructor Documentation

◆ fftfilterbank_t()

MHAFilter::fftfilterbank_t::fftfilterbank_t ( unsigned int  fragsize,
unsigned int  inputchannels,
unsigned int  firchannels,
unsigned int  fftlen 
)

Constructor.

Parameters
fragsizeNumber of frames expected in input signal (each cycle).
inputchannelsNumber of channels expected in input signal.
firchannelsNumber of channels expected in FIR filter coefficients (= number of bands).
fftlenFFT length of filter.

The number of output channels is inputchannels*firchannels.

◆ ~fftfilterbank_t()

MHAFilter::fftfilterbank_t::~fftfilterbank_t ( )

Member Function Documentation

◆ update_coeffs()

void MHAFilter::fftfilterbank_t::update_coeffs ( const mha_wave_t h)

Update the set of coefficients.

Parameters
hCoefficients structure
Note
The number of channels in h must match the number of channels given in the constructor, and the number of frames can not be more than fftlen-fragsize+1.

◆ filter() [1/2]

void MHAFilter::fftfilterbank_t::filter ( const mha_wave_t s_in,
mha_wave_t **  s_out,
const mha_wave_t h 
)

Apply filter with changing coefficients to a waveform fragment.

Parameters
s_inInput signal pointer.
Return values
s_outPointer to output signal pointer, will be set to a valid signal
Parameters
hFIR coefficients

◆ filter() [2/2]

void MHAFilter::fftfilterbank_t::filter ( const mha_wave_t s_in,
mha_wave_t **  s_out 
)

Apply filter to waveform fragment, without changing the coefficients.

Parameters
s_inInput signal pointer.
Return values
s_outPointer to output signal pointer, will be set to a valid signal

◆ get_irs()

const mha_wave_t* MHAFilter::fftfilterbank_t::get_irs ( ) const
inline

Return the current IRS.

Member Data Documentation

◆ fragsize

unsigned int MHAFilter::fftfilterbank_t::fragsize
private

◆ inputchannels

unsigned int MHAFilter::fftfilterbank_t::inputchannels
private

◆ firchannels

unsigned int MHAFilter::fftfilterbank_t::firchannels
private

◆ outputchannels

unsigned int MHAFilter::fftfilterbank_t::outputchannels
private

◆ fftlen

unsigned int MHAFilter::fftfilterbank_t::fftlen
private

◆ hw

MHASignal::waveform_t MHAFilter::fftfilterbank_t::hw
private

◆ Hs

MHASignal::spectrum_t MHAFilter::fftfilterbank_t::Hs
private

◆ xw

MHASignal::waveform_t MHAFilter::fftfilterbank_t::xw
private

◆ Xs

MHASignal::spectrum_t MHAFilter::fftfilterbank_t::Xs
private

◆ yw

MHASignal::waveform_t MHAFilter::fftfilterbank_t::yw
private

◆ Ys

MHASignal::spectrum_t MHAFilter::fftfilterbank_t::Ys
private

◆ yw_temp

MHASignal::waveform_t MHAFilter::fftfilterbank_t::yw_temp
private

◆ tail

MHASignal::waveform_t MHAFilter::fftfilterbank_t::tail
private

◆ fft

mha_fft_t MHAFilter::fftfilterbank_t::fft
private

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