SPUC  3.0
Public Types | Public Member Functions | Public Attributes | Friends | List of all members
SPUC::fir< Numeric, Coeff > Class Template Reference

Template Class for Modeling a Finite Impulse Response filter. More...

#include <fir.h>

Inheritance diagram for SPUC::fir< Numeric, Coeff >:
Inheritance graph
[legend]
Collaboration diagram for SPUC::fir< Numeric, Coeff >:
Collaboration graph
[legend]

Public Types

typedef base_type< Numeric >::btype Numeric_base
 
typedef mixed_type< Numeric,
Coeff >::dtype 
sum_type
 

Public Member Functions

void settap (long i, Coeff tap)
 Set tap weights. More...
 
void settaps (fir_coeff< Coeff > &c)
 
long number_of_taps ()
 
Coeff gettap (long i)
 
void reset ()
 Reset. More...
 
Coeff coeff_sum ()
 Get sum of coefficients. More...
 
void normalize_gain ()
 
void make_hpf ()
 
Numeric out ()
 Get current output. More...
 
Numeric check (long i)
 Clock in new sample & compute current output. More...
 
void set_round_bits (long x)
 
 ~fir (void)
 
 fir (void)
 Constructor. More...
 
 fir (long n, long rb=0)
 Constructor. More...
 
 fir (fir_coeff< Coeff > C)
 Constructor. More...
 
void set_size (long n)
 Set size of Filter. More...
 
long get_size (void)
 
 fir (const char *file)
 Constructor that gets coefficients from file (requires fir.cpp) More...
 
Numeric clock (Numeric in)
 Update filter by inputting 1 sample and returning convolved output sample. More...
 
Numeric update (Numeric in)
 
Numeric iir (Numeric in)
 
int read_taps (const char *file)
 
void print (void)
 
void settap (std::vector< Coeff > z)
 

Public Attributes

std::vector< Coeff > coeff
 
std::vector< Numeric > z
 
Numeric output
 
quantiser< Numeric > Q
 
long num_taps
 

Friends

template<class N , class C >
std::vector< C > get_taps (const fir< N, C > &x)
 
template<class N , class C >
std::vector< N > get_input (const fir< N, C > &y)
 

Detailed Description

template<class Numeric, class Coeff = float_type>
class SPUC::fir< Numeric, Coeff >

Template Class for Modeling a Finite Impulse Response filter.

Template works for float_type, long, complex, etc Taps initialized to zeros.

Author
Tony Kirke
fir.png
fir.gif

Member Typedef Documentation

template<class Numeric, class Coeff = float_type>
typedef base_type<Numeric>::btype SPUC::fir< Numeric, Coeff >::Numeric_base
template<class Numeric, class Coeff = float_type>
typedef mixed_type<Numeric,Coeff>::dtype SPUC::fir< Numeric, Coeff >::sum_type

Constructor & Destructor Documentation

template<class Numeric, class Coeff = float_type>
SPUC::fir< Numeric, Coeff >::~fir ( void  )
inline
template<class Numeric, class Coeff = float_type>
SPUC::fir< Numeric, Coeff >::fir ( void  )
inline

Constructor.

template<class Numeric, class Coeff = float_type>
SPUC::fir< Numeric, Coeff >::fir ( long  n,
long  rb = 0 
)
inline

Constructor.

template<class Numeric, class Coeff = float_type>
SPUC::fir< Numeric, Coeff >::fir ( fir_coeff< Coeff >  C)
inline

Constructor.

template<class Numeric, class Coeff = float_type>
SPUC::fir< Numeric, Coeff >::fir ( const char *  file)
inline

Constructor that gets coefficients from file (requires fir.cpp)

Member Function Documentation

template<class Numeric, class Coeff = float_type>
Numeric SPUC::fir< Numeric, Coeff >::check ( long  i)
inline

Clock in new sample & compute current output.

template<class Numeric, class Coeff = float_type>
Numeric SPUC::fir< Numeric, Coeff >::clock ( Numeric  in)
inline

Update filter by inputting 1 sample and returning convolved output sample.

Referenced by main().

template<class Numeric, class Coeff = float_type>
Coeff SPUC::fir< Numeric, Coeff >::coeff_sum ( )
inline

Get sum of coefficients.

Referenced by SPUC::fir< Numeric, Numeric >::normalize_gain().

template<class Numeric, class Coeff = float_type>
long SPUC::fir< Numeric, Coeff >::get_size ( void  )
inline
template<class Numeric, class Coeff = float_type>
Coeff SPUC::fir< Numeric, Coeff >::gettap ( long  i)
inline
template<class Numeric, class Coeff = float_type>
Numeric SPUC::fir< Numeric, Coeff >::iir ( Numeric  in)
inline
template<class Numeric, class Coeff = float_type>
void SPUC::fir< Numeric, Coeff >::make_hpf ( )
inline
template<class Numeric, class Coeff = float_type>
void SPUC::fir< Numeric, Coeff >::normalize_gain ( )
inline
template<class Numeric, class Coeff = float_type>
long SPUC::fir< Numeric, Coeff >::number_of_taps ( )
inline
template<class Numeric, class Coeff = float_type>
Numeric SPUC::fir< Numeric, Coeff >::out ( )
inline

Get current output.

template<class Numeric, class Coeff = float_type>
void SPUC::fir< Numeric, Coeff >::print ( void  )
inline
template<class Numeric, class Coeff = float_type>
int SPUC::fir< Numeric, Coeff >::read_taps ( const char *  file)
inline
template<class Numeric, class Coeff = float_type>
void SPUC::fir< Numeric, Coeff >::reset ( void  )
inline
template<class Numeric, class Coeff = float_type>
void SPUC::fir< Numeric, Coeff >::set_round_bits ( long  x)
inline
template<class Numeric, class Coeff = float_type>
void SPUC::fir< Numeric, Coeff >::set_size ( long  n)
inline
template<class Numeric, class Coeff = float_type>
void SPUC::fir< Numeric, Coeff >::settap ( long  i,
Coeff  tap 
)
inline
template<class Numeric, class Coeff = float_type>
void SPUC::fir< Numeric, Coeff >::settap ( std::vector< Coeff >  z)
inline
template<class Numeric, class Coeff = float_type>
void SPUC::fir< Numeric, Coeff >::settaps ( fir_coeff< Coeff > &  c)
inline
template<class Numeric, class Coeff = float_type>
Numeric SPUC::fir< Numeric, Coeff >::update ( Numeric  in)
inline

Friends And Related Function Documentation

template<class Numeric, class Coeff = float_type>
template<class N , class C >
std::vector<N> get_input ( const fir< N, C > &  y)
friend
template<class Numeric, class Coeff = float_type>
template<class N , class C >
std::vector<C> get_taps ( const fir< N, C > &  x)
friend

Member Data Documentation

template<class Numeric, class Coeff = float_type>
std::vector<Coeff> SPUC::fir< Numeric, Coeff >::coeff
template<class Numeric, class Coeff = float_type>
long SPUC::fir< Numeric, Coeff >::num_taps
template<class Numeric, class Coeff = float_type>
Numeric SPUC::fir< Numeric, Coeff >::output
template<class Numeric, class Coeff = float_type>
quantiser<Numeric> SPUC::fir< Numeric, Coeff >::Q
template<class Numeric, class Coeff = float_type>
std::vector<Numeric> SPUC::fir< Numeric, Coeff >::z

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