qm-dsp 1.8
DecimatorB Class Reference

DecimatorB carries out a fast downsample by a power-of-two factor. More...

#include <DecimatorB.h>

Public Member Functions

void process (const double *src, double *dst)
void process (const float *src, float *dst)
 DecimatorB (int inLength, int decFactor)
 Construct a DecimatorB to operate on input blocks of length inLength, with decimation factor decFactor.
virtual ~DecimatorB ()
int getFactor () const

Private Member Functions

void deInitialise ()
void initialise (int inLength, int decFactor)
void doAntiAlias (const double *src, double *dst, int length, int filteridx)
void doProcess ()

Private Attributes

int m_inputLength
int m_outputLength
int m_decFactor
std::vector< std::vector< double > > m_o
double m_a [7]
double m_b [7]
double * m_aaBuffer
double * m_tmpBuffer

Detailed Description

DecimatorB carries out a fast downsample by a power-of-two factor.

It only knows how to decimate by a factor of 2, and will use repeated decimation for higher factors. A Butterworth filter of order 6 is used for the lowpass filter.

Definition at line 25 of file DecimatorB.h.

Constructor & Destructor Documentation

◆ DecimatorB()

DecimatorB::DecimatorB ( int inLength,
int decFactor )

Construct a DecimatorB to operate on input blocks of length inLength, with decimation factor decFactor.

inLength should be a multiple of decFactor. Output blocks will be of length inLength / decFactor.

decFactor must be a power of two.

Definition at line 23 of file DecimatorB.cpp.

References initialise(), m_aaBuffer, m_decFactor, m_inputLength, m_outputLength, and m_tmpBuffer.

◆ ~DecimatorB()

DecimatorB::~DecimatorB ( )
virtual

Definition at line 34 of file DecimatorB.cpp.

References deInitialise().

Member Function Documentation

◆ process() [1/2]

void DecimatorB::process ( const double * src,
double * dst )

Definition at line 132 of file DecimatorB.cpp.

References doProcess(), m_decFactor, m_inputLength, m_outputLength, and m_tmpBuffer.

◆ process() [2/2]

void DecimatorB::process ( const float * src,
float * dst )

Definition at line 147 of file DecimatorB.cpp.

References doProcess(), m_decFactor, m_inputLength, m_outputLength, and m_tmpBuffer.

◆ getFactor()

int DecimatorB::getFactor ( ) const
inline

Definition at line 42 of file DecimatorB.h.

References m_decFactor.

◆ deInitialise()

void DecimatorB::deInitialise ( )
private

Definition at line 84 of file DecimatorB.cpp.

References m_aaBuffer, and m_tmpBuffer.

Referenced by ~DecimatorB().

◆ initialise()

void DecimatorB::initialise ( int inLength,
int decFactor )
private

◆ doAntiAlias()

void DecimatorB::doAntiAlias ( const double * src,
double * dst,
int length,
int filteridx )
private

Definition at line 90 of file DecimatorB.cpp.

References m_a, m_b, and m_o.

Referenced by doProcess().

◆ doProcess()

void DecimatorB::doProcess ( )
private

Definition at line 111 of file DecimatorB.cpp.

References doAntiAlias(), m_aaBuffer, m_decFactor, m_inputLength, and m_tmpBuffer.

Referenced by process(), and process().

Member Data Documentation

◆ m_inputLength

int DecimatorB::m_inputLength
private

Definition at line 50 of file DecimatorB.h.

Referenced by DecimatorB(), doProcess(), initialise(), process(), and process().

◆ m_outputLength

int DecimatorB::m_outputLength
private

Definition at line 51 of file DecimatorB.h.

Referenced by DecimatorB(), initialise(), process(), and process().

◆ m_decFactor

int DecimatorB::m_decFactor
private

Definition at line 52 of file DecimatorB.h.

Referenced by DecimatorB(), doProcess(), getFactor(), initialise(), process(), and process().

◆ m_o

std::vector<std::vector<double> > DecimatorB::m_o
private

Definition at line 54 of file DecimatorB.h.

Referenced by doAntiAlias(), and initialise().

◆ m_a

double DecimatorB::m_a[7]
private

Definition at line 56 of file DecimatorB.h.

Referenced by doAntiAlias(), and initialise().

◆ m_b

double DecimatorB::m_b[7]
private

Definition at line 57 of file DecimatorB.h.

Referenced by doAntiAlias(), and initialise().

◆ m_aaBuffer

double* DecimatorB::m_aaBuffer
private

Definition at line 59 of file DecimatorB.h.

Referenced by DecimatorB(), deInitialise(), doProcess(), and initialise().

◆ m_tmpBuffer

double* DecimatorB::m_tmpBuffer
private

Definition at line 60 of file DecimatorB.h.

Referenced by DecimatorB(), deInitialise(), doProcess(), initialise(), process(), and process().


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