GNU Radio Manual and C++ API Reference  3.7.4
The Free & Open Software Radio Ecosystem
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
costas_loop_cc.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2006,2011,2012 Free Software Foundation, Inc.
4  *
5  * This file is part of GNU Radio
6  *
7  * GNU Radio is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3, or (at your option)
10  * any later version.
11  *
12  * GNU Radio is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with GNU Radio; see the file COPYING. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 #ifndef INCLUDED_DIGITAL_COSTAS_LOOP_CC_H
24 #define INCLUDED_DIGITAL_COSTAS_LOOP_CC_H
25 
26 #include <gnuradio/digital/api.h>
28 #include <gnuradio/sync_block.h>
29 
30 namespace gr {
31  namespace digital {
32 
33  /*!
34  * \brief A Costas loop carrier recovery module.
35  * \ingroup synchronizers_blk
36  *
37  * \details
38  * The Costas loop locks to the center frequency of a signal and
39  * downconverts it to baseband.
40  *
41  * \li When order=2: used for BPSK where the real part of the
42  * output signal is the baseband BPSK signal and the imaginary
43  * part is the error signal.
44  *
45  * \li When order=4: can be used for QPSK where both I and Q (real
46  * and imaginary) are outputted.
47  *
48  * \li When order=8: used for 8PSK.
49  *
50  * More details can be found online:
51  *
52  * J. Feigin, "Practical Costas loop design: Designing a simple
53  * and inexpensive BPSK Costas loop carrier recovery circuit," RF
54  * signal processing, pp. 20-36, 2002.
55  *
56  * http://rfdesign.com/images/archive/0102Feigin20.pdf
57  *
58  * The Costas loop can have two output streams:
59  * \li stream 1 (required) is the baseband I and Q;
60  * \li stream 2 (optional) is the normalized frequency of the loop
61  */
63  : virtual public sync_block,
64  virtual public blocks::control_loop
65  {
66  public:
67  // gr::digital::costas_loop_cc::sptr
69 
70  /*!
71  * Make a Costas loop carrier recovery block.
72  *
73  * \param loop_bw internal 2nd order loop bandwidth (~ 2pi/100)
74  * \param order the loop order, either 2, 4, or 8
75  */
76  static sptr make(float loop_bw, int order);
77 
78  /*!
79  * Returns the current value of the loop error.
80  */
81  virtual float error() const = 0;
82  };
83 
84  } /* namespace digital */
85 } /* namespace gr */
86 
87 #endif /* INCLUDED_DIGITAL_COSTAS_LOOP_CC_H */
A Costas loop carrier recovery module.
Definition: costas_loop_cc.h:62
#define DIGITAL_API
Definition: gr-digital/include/gnuradio/digital/api.h:30
shared_ptr documentation stub
Definition: shared_ptr_docstub.h:15
boost::shared_ptr< costas_loop_cc > sptr
Definition: costas_loop_cc.h:68
synchronous 1:1 input to output with historyOverride work to provide the signal processing implementa...
Definition: sync_block.h:37
A second-order control loop implementation class.
Definition: control_loop.h:61