#include <nco.h>
Public Member Functions | |
| nco (long bits=8) | |
| Constructor. | |
| void | reset () |
| Reset object. | |
| void | set_frequency (unsigned long freq) |
| Set frequency control word. | |
| void | reset_frequency (unsigned long freq) |
| Set frequency control word and register for frequency control word. | |
| long | get_phase (void) |
| Return current phase. | |
| void | load (long loop_filter_out) |
| Load new frequency control word. | |
| long | clock (long loop_filter_out) |
| Clock NCO with new frequency control word input. | |
| long | clock () |
| Clock NCO without changing frequency control word. | |
Public Attributes | |
| unsigned long | phase |
Protected Attributes | |
| unsigned long | acc |
| unsigned long | fcw |
| unsigned long | new_fcw |
| unsigned long | mask_bits |
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 |
) |
Constructor.
| long SPUC::nco::clock | ( | ) |
Clock NCO without changing frequency control word.
| long SPUC::nco::clock | ( | long | loop_filter_out | ) |
Clock NCO with new frequency control word input.
| 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.
unsigned long SPUC::nco::acc [protected] |
unsigned long SPUC::nco::fcw [protected] |
unsigned long SPUC::nco::mask_bits [protected] |
unsigned long SPUC::nco::new_fcw [protected] |
| unsigned long SPUC::nco::phase |
1.4.7