itpp_sci  1.0.0
it++ based simulation framework for scicoslab, scilab and scipy
Public Member Functions | List of all members
SIM::nco Class Reference

fixed point NCO - numerically controlled oscillator
Core function: SIM::nco.process()
More...

Inheritance diagram for SIM::nco:
Inheritance graph
[legend]

Public Member Functions

 nco ()
 
 ~nco ()
 
void set_N (int n)
 
void set_acc (double a)
 
void set_output (const vec &yout)
 
int get_N ()
 
double get_acc ()
 
vec get_output ()
 
mat process (const bvec &ce, const vec &x)
 

Detailed Description

fixed point NCO - numerically controlled oscillator
Core function: SIM::nco.process()

Accumulated phase is in Q1.N format, operational type is Q(64-N).N
input vector x [vec] is frequency control word
fcw is saturated at (-1..+1) and converted from fractional double to Q1.N fixed point
nco output is a matrix mat=[cy|ph] where:
cy is overflow flag: +1 for positive -1 for negative
ph is accumulated phase converted to double fractional format

Constructor & Destructor Documentation

SIM::nco::nco ( )
inline
SIM::nco::~nco ( )
inline

Member Function Documentation

double SIM::nco::get_acc ( void  )

get state of phase accumulator converted to double fractional format

int SIM::nco::get_N ( void  )

get N - number of bits for fractional representation in Q1.N

vec SIM::nco::get_output ( void  )

get initial output value y0

mat SIM::nco::process ( const bvec &  ce,
const vec &  x 
)

process input samples - x[i] for active clock ticks ce[i]

Parameters
ce- bvec - clock enable vector
x- vec - input vector - fcw saturated at (-1..+1) in double fractional format
Returns
y - mat - output matrix [cy|ph] cy =(1,0,-1), ph - accumulated phase in double fractional format
void SIM::nco::set_acc ( double  a)

set state of phase accumulator

Parameters
[in]a- state of phase accumulator in double fractional format
void SIM::nco::set_N ( int  n)

set N - number of bits for fractional representation in Q1.N

Parameters
[in]n- number of bits
void SIM::nco::set_output ( const vec &  yout)

set initial output value y0

Parameters
[in]yout- [vec] = [cy|ph]

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