GNU Radio 3.7.0 C++ API
costas_loop_cc.h
Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2006,2011,2012 Free Software Foundation, Inc.
00004  * 
00005  * This file is part of GNU Radio
00006  * 
00007  * GNU Radio is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 3, or (at your option)
00010  * any later version.
00011  * 
00012  * GNU Radio is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  * 
00017  * You should have received a copy of the GNU General Public License
00018  * along with GNU Radio; see the file COPYING.  If not, write to
00019  * the Free Software Foundation, Inc., 51 Franklin Street,
00020  * Boston, MA 02110-1301, USA.
00021  */
00022 
00023 #ifndef INCLUDED_DIGITAL_COSTAS_LOOP_CC_H
00024 #define INCLUDED_DIGITAL_COSTAS_LOOP_CC_H
00025 
00026 #include <gnuradio/digital/api.h>
00027 #include <gnuradio/blocks/control_loop.h>
00028 #include <gnuradio/sync_block.h>
00029 
00030 namespace gr {
00031   namespace digital {
00032 
00033     /*! 
00034      * \brief A Costas loop carrier recovery module.
00035      * \ingroup synchronizers_blk
00036      *
00037      * \details
00038      * The Costas loop locks to the center frequency of a signal and
00039      * downconverts it to baseband. The second (order=2) order loop
00040      * is used for BPSK where the real part of the output signal is
00041      * the baseband BPSK signal and the imaginary part is the error
00042      * signal. When order=4, it can be used for quadrature
00043      * modulations where both I and Q (real and imaginary) are
00044      * outputted.
00045      *
00046      * More details can be found online:
00047      *
00048      * J. Feigin, "Practical Costas loop design: Designing a simple
00049      * and inexpensive BPSK Costas loop carrier recovery circuit," RF
00050      * signal processing, pp. 20-36, 2002.
00051      *
00052      * http://rfdesign.com/images/archive/0102Feigin20.pdf
00053      *  
00054      * The Costas loop can have two output streams:
00055      *    stream 1 is the baseband I and Q;
00056      *    stream 2 is the normalized frequency of the loop
00057      */
00058     class DIGITAL_API costas_loop_cc
00059       : virtual public sync_block, 
00060         virtual public blocks::control_loop
00061     {
00062     public:
00063       // gr::digital::costas_loop_cc::sptr
00064       typedef boost::shared_ptr<costas_loop_cc> sptr;
00065 
00066       /*! 
00067        * Make a Costas loop carrier recovery block.
00068        *
00069        * \param loop_bw  internal 2nd order loop bandwidth (~ 2pi/100)
00070        * \param order the loop order, either 2, 4, or 8
00071        */
00072       static sptr make(float loop_bw, int order);
00073     };
00074 
00075   } /* namespace digital */
00076 } /* namespace gr */
00077 
00078 #endif /* INCLUDED_DIGITAL_COSTAS_LOOP_CC_H */