The Open Master Hearing Aid (openMHA)  openMHA
Open community platform for hearing aid algorithm research
ADM::Linearphase_FIR< F > Class Template Reference

An efficient linear-phase fir filter implementation. More...

Public Member Functions

 Linearphase_FIR (unsigned order, const F *alphas)
 Create linear-phase FIR filter. More...
 
 ~Linearphase_FIR ()
 
process (const F &in_sample)
 Filter one sample with this linear-phase FIR filter. More...
 

Private Attributes

unsigned m_order
 The filter order of this linear-phase FIR filter. More...
 
F * m_alphas
 FIR filter coefficients. More...
 
F * m_output
 Ringbuffer for building future output. More...
 
unsigned m_now
 current start of ringbuffer More...
 

Detailed Description

template<class F>
class ADM::Linearphase_FIR< F >

An efficient linear-phase fir filter implementation.

Constructor & Destructor Documentation

◆ Linearphase_FIR()

template<class F >
ADM::Linearphase_FIR< F >::Linearphase_FIR ( unsigned  order,
const F *  alphas 
)

Create linear-phase FIR filter.

Parameters
orderfilter order of this FIR filter. restriction: must be even.
alphaspointer to Array of alpha coefficients. Since this class is for linear phase FIR filters only, only (order / 2 + 1) coefficients will be read. (Coefficients for linear-phase FIR filters are symmetric.)

◆ ~Linearphase_FIR()

template<class F >
ADM::Linearphase_FIR< F >::~Linearphase_FIR

Member Function Documentation

◆ process()

template<class F >
F ADM::Linearphase_FIR< F >::process ( const F &  in_sample)
inline

Filter one sample with this linear-phase FIR filter.

Parameters
in_samplethe current input sample
Returns
the computed output sample

Member Data Documentation

◆ m_order

template<class F >
unsigned ADM::Linearphase_FIR< F >::m_order
private

The filter order of this linear-phase FIR filter.

◆ m_alphas

template<class F >
F* ADM::Linearphase_FIR< F >::m_alphas
private

FIR filter coefficients.

Only m_order / 2 + 1 coefficients need to be stored since coefficients of linear-phase FIR filters are symmetric

◆ m_output

template<class F >
F* ADM::Linearphase_FIR< F >::m_output
private

Ringbuffer for building future output.

◆ m_now

template<class F >
unsigned ADM::Linearphase_FIR< F >::m_now
private

current start of ringbuffer


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