HARDT - The Ham Radio DSP Toolkit
Public Member Functions | List of all members
HFir< T > Class Template Reference

#include <hfir.h>

Public Member Functions

 HFir (float *coefficients, int length)
 
 HFir (float *coefficients, int length, int spacing, int advance, int skip)
 
 ~HFir ()
 
void Filter (T *values, T *result, size_t blocksize)
 
void SetCoefficients (float *coefficients, int length)
 
std::vector< float > GetCoefficients ()
 

Detailed Description

template<class T>
class HFir< T >

Implements the filtering for FIR-structured filters

Constructor & Destructor Documentation

◆ HFir() [1/2]

template<class T >
HFir< T >::HFir ( float *  coefficients,
int  length 
)
inline

Create a new FIR block (for calculating output values for a FIR filter)

Parameters
coefficientsThe FIR coefficients
lengthLength of the FIR filter (number of coefficients)

◆ HFir() [2/2]

template<class T >
HFir< T >::HFir ( float *  coefficients,
int  length,
int  spacing,
int  advance,
int  skip 
)
inline

Create a new FIR block (for calculating output values for a FIR filter)

Parameters
coefficientsThe FIR coefficients
lengthLength of the FIR filter (number of coefficients)
spacingHow many positions in the outbuffer to space output values This is mostly usefull when implementing multiple polyphase FIR filters (see use in the HInterpolator). A normal FIR filter uses a spacing of 1 (write output to adjacent locations)
advanceHow many steps to advance the delay line before next filter output value is being calculated (see use in HFirDecimator). A normal FIR filter uses advance=1 (do not further advance forward after each result) but a decimating FIR filter will calculate 1 result, then step further a number of samples into the delay line before calculating the next result.
skipSkip this number of values in the input and output buffer between each value. This allows you to pass in sparse buffers and only use, say, each 2. sample. Do note that the skip is applied to the input AS WELL as the output

◆ ~HFir()

template<class T >
HFir< T >::~HFir ( )
inline

Destroy this FIR block

Member Function Documentation

◆ Filter()

template<class T >
void HFir< T >::Filter ( T *  values,
T *  result,
size_t  blocksize 
)
inline

Filter a block of values through the FIR block

Parameters
valuesThe block to filter
resultPlace filtered block here
blocksizeThe number of samples in the input block

◆ GetCoefficients()

template<class T >
std::vector<float> HFir< T >::GetCoefficients ( )
inline

Get the coefficients for the FIR block

◆ SetCoefficients()

template<class T >
void HFir< T >::SetCoefficients ( float *  coefficients,
int  length 
)
inline

Change the coefficients for the FIR block

Parameters
coefficientsNew coefficients
lengthnumber of coefficients

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