GNU Radio 3.7.0 C++ API
|
A Costas loop carrier recovery module. More...
#include <costas_loop_cc.h>
Public Types | |
typedef boost::shared_ptr < costas_loop_cc > | sptr |
Static Public Member Functions | |
static sptr | make (float loop_bw, int order) |
Additional Inherited Members | |
![]() | |
virtual int | work (int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)=0 |
just like gr::block::general_work, only this arranges to call consume_each for you More... | |
void | forecast (int noutput_items, gr_vector_int &ninput_items_required) |
Estimate input requirements given output request. More... | |
int | general_work (int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) |
compute output items from input items More... | |
int | fixed_rate_ninput_to_noutput (int ninput) |
Given ninput samples, return number of output samples that will be produced. N.B. this is only defined if fixed_rate returns true. Generally speaking, you don't need to override this. More... | |
int | fixed_rate_noutput_to_ninput (int noutput) |
Given noutput samples, return number of input samples required to produce noutput. N.B. this is only defined if fixed_rate returns true. Generally speaking, you don't need to override this. More... | |
![]() | |
control_loop (void) | |
control_loop (float loop_bw, float max_freq, float min_freq) | |
virtual | ~control_loop () |
void | update_gains () |
update the system gains from the loop bandwidth and damping factor More... | |
void | advance_loop (float error) |
Advance the control loop based on the current gain settings and the inputted error signal. More... | |
void | phase_wrap () |
Keep the phase between -2pi and 2pi. More... | |
void | frequency_limit () |
Keep the frequency between d_min_freq and d_max_freq. More... | |
virtual void | set_loop_bandwidth (float bw) |
Set the loop bandwidth. More... | |
void | set_damping_factor (float df) |
Set the loop damping factor. More... | |
void | set_alpha (float alpha) |
Set the loop gain alpha. More... | |
void | set_beta (float beta) |
Set the loop gain beta. More... | |
void | set_frequency (float freq) |
Set the control loop's frequency. More... | |
void | set_phase (float phase) |
Set the control loop's phase. More... | |
void | set_max_freq (float freq) |
Set the control loop's maximum frequency. More... | |
void | set_min_freq (float freq) |
Set the control loop's minimum frequency. More... | |
float | get_loop_bandwidth () const |
Returns the loop bandwidth. More... | |
float | get_damping_factor () const |
Returns the loop damping factor. More... | |
float | get_alpha () const |
Returns the loop gain alpha. More... | |
float | get_beta () const |
Returns the loop gain beta. More... | |
float | get_frequency () const |
Get the control loop's frequency estimate. More... | |
float | get_phase () const |
Get the control loop's phase estimate. More... | |
float | get_max_freq () const |
Get the control loop's maximum frequency. More... | |
float | get_min_freq () const |
Get the control loop's minimum frequency. More... | |
![]() | |
enum | vcolor { WHITE, GREY, BLACK } |
![]() | |
sync_block (void) | |
sync_block (const std::string &name, gr::io_signature::sptr input_signature, gr::io_signature::sptr output_signature) | |
![]() | |
std::vector< long > | d_max_output_buffer |
std::vector< long > | d_min_output_buffer |
gr::thread::mutex | d_setlock |
gr::logger_ptr | d_logger |
gr::logger_ptr | d_debug_logger |
![]() | |
float | d_phase |
float | d_freq |
float | d_max_freq |
float | d_min_freq |
float | d_damping |
float | d_loop_bw |
float | d_alpha |
float | d_beta |
A Costas loop carrier recovery module.
The Costas loop locks to the center frequency of a signal and downconverts it to baseband. The second (order=2) order loop is used for BPSK where the real part of the output signal is the baseband BPSK signal and the imaginary part is the error signal. When order=4, it can be used for quadrature modulations where both I and Q (real and imaginary) are outputted.
More details can be found online:
J. Feigin, "Practical Costas loop design: Designing a simple and inexpensive BPSK Costas loop carrier recovery circuit," RF signal processing, pp. 20-36, 2002.
http://rfdesign.com/images/archive/0102Feigin20.pdf
The Costas loop can have two output streams: stream 1 is the baseband I and Q; stream 2 is the normalized frequency of the loop
|
static |
Make a Costas loop carrier recovery block.
loop_bw | internal 2nd order loop bandwidth (~ 2pi/100) |
order | the loop order, either 2, 4, or 8 |