SPUC
3.0
|
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 |
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.
SPUC::nco::nco | ( | long | bits = 8 | ) |
long SPUC::nco::clock | ( | long | loop_filter_out | ) |
long SPUC::nco::clock | ( | void | ) |
|
inline |
Return current phase.
|
inline |
Load new frequency control word.
|
inline |
Reset object.
|
inline |
Set frequency control word and register for frequency control word.
|
inline |
Set frequency control word.