SPUC  3.0
Public Member Functions | Protected Attributes | List of all members
SPUC::cic< Numeric > Class Template Reference

class for CIC digital filter More...

#include <cic.h>

Public Member Functions

 cic (char n=3)
 Number of stages. More...
 
void reset ()
 Reset. More...
 
void num_stages (char n)
 To change the number of stages dynamically. More...
 
Numeric interpolate (Numeric in=0, signed char dump=0)
 For CIC interpolation, non-zero dump implies new input. More...
 
Numeric decimate (Numeric in, signed char dump)
 For CIC decimation, non-zero dump implies output required. More...
 

Protected Attributes

std::vector< Numeric > diff
 
std::vector< Numeric > nacc
 Differentiators. More...
 
std::vector< Numeric > prev
 Accumulators. More...
 
char stages
 Previous values. More...
 

Detailed Description

template<class Numeric>
class SPUC::cic< Numeric >

class for CIC digital filter

Implementation for cascaded integrator comb filters This implementation provides for both decimation and interpolation filtering. Registers are signed long and the default number of stages is 3.

Author
Tony Kirke
cic.gif

Constructor & Destructor Documentation

template<class Numeric>
SPUC::cic< Numeric >::cic ( char  n = 3)
inline

Number of stages.

Constructor

References SPUC_ASSERT, and SPUC::cic< Numeric >::stages.

Member Function Documentation

template<class Numeric>
Numeric SPUC::cic< Numeric >::decimate ( Numeric  in,
signed char  dump 
)
inline

For CIC decimation, non-zero dump implies output required.

References SPUC::cic< Numeric >::stages.

Referenced by SPUC::cascaded_cic< Numeric >::clock(), and SPUC::scic< Numeric >::decimate().

template<class Numeric>
Numeric SPUC::cic< Numeric >::interpolate ( Numeric  in = 0,
signed char  dump = 0 
)
inline

For CIC interpolation, non-zero dump implies new input.

References SPUC::cic< Numeric >::stages.

Referenced by SPUC::cascaded_cic< Numeric >::clock(), and main().

template<class Numeric>
void SPUC::cic< Numeric >::num_stages ( char  n)
inline
template<class Numeric>
void SPUC::cic< Numeric >::reset ( void  )
inline

Member Data Documentation

template<class Numeric>
std::vector<Numeric> SPUC::cic< Numeric >::diff
protected
template<class Numeric>
std::vector<Numeric> SPUC::cic< Numeric >::nacc
protected

Differentiators.

template<class Numeric>
std::vector<Numeric> SPUC::cic< Numeric >::prev
protected

Accumulators.

template<class Numeric>
char SPUC::cic< Numeric >::stages
protected

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