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

FFT based FIR filter implementation. More...

Inheritance diagram for MHAFilter::fftfilter_t:
Inheritance graph

Public Member Functions

 fftfilter_t (unsigned int fragsize, unsigned int channels, unsigned int fftlen)
 Constructor. More...
 
 ~fftfilter_t ()
 
void update_coeffs (const mha_wave_t *pwIRS)
 Update the set of coefficients. More...
 
void filter (const mha_wave_t *pwIn, mha_wave_t **ppwOut, const mha_wave_t *pwIRS)
 Apply filter with changing coefficients to a waveform fragment. More...
 
void filter (const mha_wave_t *pwIn, mha_wave_t **ppwOut)
 Apply filter to waveform fragment, without changing the coefficients. More...
 
void filter (const mha_wave_t *pwIn, mha_wave_t **ppwOut, const mha_spec_t *psWeights)
 Apply filter with changing coefficients to a waveform fragment. More...
 

Private Attributes

unsigned int fragsize
 
unsigned int channels
 
unsigned int fftlen
 
MHASignal::waveform_t wInput_fft
 
mha_wave_t wInput
 
MHASignal::waveform_t wOutput_fft
 
mha_wave_t wOutput
 
MHASignal::spectrum_t sInput
 
MHASignal::spectrum_t sWeights
 
MHASignal::waveform_t wIRS_fft
 
mha_fft_t fft
 

Detailed Description

FFT based FIR filter implementation.

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

Constructor & Destructor Documentation

◆ fftfilter_t()

MHAFilter::fftfilter_t::fftfilter_t ( unsigned int  fragsize,
unsigned int  channels,
unsigned int  fftlen 
)

Constructor.

Parameters
fragsizeNumber of frames expected in input signal (each cycle).
channelsNumber of channels expected in input signal.
fftlenFFT length of filter.

◆ ~fftfilter_t()

MHAFilter::fftfilter_t::~fftfilter_t ( )

Member Function Documentation

◆ update_coeffs()

void MHAFilter::fftfilter_t::update_coeffs ( const mha_wave_t pwIRS)

Update the set of coefficients.

Parameters
pwIRSCoefficients structure
Note
The number of channels in h must match the number of channels given in the constructor. The filter length is limited to fftlen-fragsize+1 (longer IRS will be shortened).

◆ filter() [1/3]

void MHAFilter::fftfilter_t::filter ( const mha_wave_t pwIn,
mha_wave_t **  ppwOut,
const mha_wave_t pwIRS 
)

Apply filter with changing coefficients to a waveform fragment.

Parameters
pwInInput signal pointer.
Return values
ppwOutPointer to output signal pointer, will be set to a valid signal.
Parameters
pwIRSPointer to FIR coefficients structure.

◆ filter() [2/3]

void MHAFilter::fftfilter_t::filter ( const mha_wave_t pwIn,
mha_wave_t **  ppwOut 
)

Apply filter to waveform fragment, without changing the coefficients.

Parameters
pwInInput signal pointer.
Return values
ppwOutPointer to output signal pointer, will be set to a valid signal

◆ filter() [3/3]

void MHAFilter::fftfilter_t::filter ( const mha_wave_t pwIn,
mha_wave_t **  ppwOut,
const mha_spec_t psWeights 
)

Apply filter with changing coefficients to a waveform fragment.

Parameters
pwInInput signal pointer.
Return values
ppwOutPointer to output signal pointer, will be set to a valid signal.
Parameters
psWeightsPointer to filter weights structure.

Member Data Documentation

◆ fragsize

unsigned int MHAFilter::fftfilter_t::fragsize
private

◆ channels

unsigned int MHAFilter::fftfilter_t::channels
private

◆ fftlen

unsigned int MHAFilter::fftfilter_t::fftlen
private

◆ wInput_fft

MHASignal::waveform_t MHAFilter::fftfilter_t::wInput_fft
private

◆ wInput

mha_wave_t MHAFilter::fftfilter_t::wInput
private

◆ wOutput_fft

MHASignal::waveform_t MHAFilter::fftfilter_t::wOutput_fft
private

◆ wOutput

mha_wave_t MHAFilter::fftfilter_t::wOutput
private

◆ sInput

MHASignal::spectrum_t MHAFilter::fftfilter_t::sInput
private

◆ sWeights

MHASignal::spectrum_t MHAFilter::fftfilter_t::sWeights
private

◆ wIRS_fft

MHASignal::waveform_t MHAFilter::fftfilter_t::wIRS_fft
private

◆ fft

mha_fft_t MHAFilter::fftfilter_t::fft
private

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