SPUC  3.0
Public Member Functions | Public Attributes | Protected Attributes | List of all members

NCO with 32 bit accumulator. More...

#include <nco.h>

Public Member Functions

 nco (long bits=8)
 Constructor. More...
 
void reset ()
 Reset object. More...
 
void set_frequency (unsigned long freq)
 Set frequency control word. More...
 
void reset_frequency (unsigned long freq)
 Set frequency control word and register for frequency control word. More...
 
long get_phase (void)
 Return current phase. More...
 
void load (long loop_filter_out)
 Load new frequency control word. More...
 
long clock (long loop_filter_out)
 Clock NCO with new frequency control word input. More...
 
long clock ()
 Clock NCO without changing frequency control word. More...
 

Public Attributes

unsigned long phase
 

Protected Attributes

unsigned long acc
 
unsigned long fcw
 
unsigned long new_fcw
 
unsigned long mask_bits
 

Detailed Description

NCO with 32 bit accumulator.

Numerically controlled oscillator (with 32 bits accumulator) returns the top (mask_bits) MSBs from accumulator Useful for carrier recovery where top bits used for input to sine,cos lookup table. FCW : frequency control word ACC : accumulator Frequency must be set through interface routines set_frequency or reset_frequency. Load routine is to allow frequency to be updated (typically with a loop filter). When not changing frequency call "clock" routine.

Author
Tony Kirke
nco.png

Constructor & Destructor Documentation

SPUC::nco::nco ( long  bits = 8)

Constructor.

References acc, fcw, mask_bits, MASK_NEG_HI, new_fcw, and phase.

Member Function Documentation

long SPUC::nco::clock ( long  loop_filter_out)

Clock NCO with new frequency control word input.

References clock(), fcw, and new_fcw.

Here is the call graph for this function:

long SPUC::nco::clock ( void  )

Clock NCO without changing frequency control word.

References acc, mask_bits, new_fcw, and phase.

Referenced by clock().

long SPUC::nco::get_phase ( void  )
inline

Return current phase.

void SPUC::nco::load ( long  loop_filter_out)
inline

Load new frequency control word.

void SPUC::nco::reset ( void  )
inline

Reset object.

void SPUC::nco::reset_frequency ( unsigned long  freq)
inline

Set frequency control word and register for frequency control word.

void SPUC::nco::set_frequency ( unsigned long  freq)
inline

Set frequency control word.

Member Data Documentation

unsigned long SPUC::nco::acc
protected

Referenced by clock(), and nco().

unsigned long SPUC::nco::fcw
protected

Referenced by clock(), and nco().

unsigned long SPUC::nco::mask_bits
protected

Referenced by clock(), and nco().

unsigned long SPUC::nco::new_fcw
protected

Referenced by clock(), and nco().

unsigned long SPUC::nco::phase

Referenced by clock(), and nco().


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