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

Template Lagrange interpolation via FIR Fitler. More...

#include <lagrange.h>

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

Public Member Functions

void reset ()
 
Numeric out ()
 Get current output. More...
 
Numeric check (long i)
 Clock in new sample & compute current output. More...
 
 lagrange (void)
 
 lagrange (long n, long b=0)
 Constructor. More...
 
 ~lagrange (void)
 Destructor. More...
 
void set_size (long n)
 Set order of polynomial. More...
 
void input (Numeric in)
 Input new sample (do nothing else) More...
 
Numeric update (Numeric in, float_type offset)
 
Numeric fir (void)
 Calculate output for current coefficients. More...
 
Numeric rephase (float_type offset)
 Rephase => recalculate coefficients and output for new offset (for upsampling) More...
 
void calculate_coeff (float_type offset)
 Calculate coefficients given an offset. More...
 
void print ()
 Print out coefficients. More...
 

Public Attributes

long num_taps
 
std::vector< Coeff > coeff
 

Protected Types

typedef mixed_type< Numeric,
Coeff >::dtype 
sum_type
 

Protected Attributes

std::vector< Numeric > z
 
Numeric output
 
quantiser< Numeric > Q
 
long round_bits
 

Detailed Description

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

Template Lagrange interpolation via FIR Fitler.

This works best for float_type or complex<float_type> Coefficients are always real (i.e. no imaginary parts).

Author
Tony Kirke
lagrange.png
Tony Kirke
lagrange.png
lagrange.gif

Member Typedef Documentation

template<class Numeric, class Coeff = float_type>
typedef mixed_type<Numeric,Coeff>::dtype SPUC::lagrange< Numeric, Coeff >::sum_type
protected

Constructor & Destructor Documentation

template<class Numeric, class Coeff = float_type>
SPUC::lagrange< Numeric, Coeff >::lagrange ( void  )
inline
template<class Numeric, class Coeff = float_type>
SPUC::lagrange< Numeric, Coeff >::lagrange ( long  n,
long  b = 0 
)
inline

Constructor.

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

Destructor.

Member Function Documentation

template<class Numeric, class Coeff = float_type>
void SPUC::lagrange< Numeric, Coeff >::calculate_coeff ( float_type  offset)
inline
template<class Numeric, class Coeff = float_type>
Numeric SPUC::lagrange< Numeric, Coeff >::check ( long  i)
inline

Clock in new sample & compute current output.

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

Input new sample (do nothing else)

Referenced by SPUC::quad_data< float_type >::get_sample(), and SPUC::sim_qam< Numeric >::tx_step().

template<class Numeric, class Coeff = float_type>
Numeric SPUC::lagrange< Numeric, Coeff >::out ( )
inline

Get current output.

template<class Numeric, class Coeff = float_type>
void SPUC::lagrange< Numeric, Coeff >::print ( void  )
inline

Print out coefficients.

template<class Numeric, class Coeff = float_type>
Numeric SPUC::lagrange< Numeric, Coeff >::rephase ( float_type  offset)
inline

Rephase => recalculate coefficients and output for new offset (for upsampling)

Referenced by SPUC::quad_data< float_type >::get_sample(), SPUC::sim_qam< Numeric >::tx_step(), and SPUC::resampler< SPUC::complex< CNumeric > >::update().

template<class Numeric, class Coeff = float_type>
void SPUC::lagrange< Numeric, Coeff >::reset ( void  )
inline
template<class Numeric, class Coeff = float_type>
void SPUC::lagrange< Numeric, Coeff >::set_size ( long  n)
inline

Set order of polynomial.

template<class Numeric, class Coeff = float_type>
Numeric SPUC::lagrange< Numeric, Coeff >::update ( Numeric  in,
float_type  offset 
)
inline

Update => Clock in new input sample, recalculate coefficients and determine output

Referenced by SPUC::resampler< SPUC::complex< CNumeric > >::update().

Member Data Documentation

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

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