GNU Radio 3.7.0 C++ API
cpmmod_bc.h
Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2010,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_CPMMOD_BC_H
00024 #define INCLUDED_DIGITAL_CPMMOD_BC_H
00025 
00026 #include <gnuradio/digital/api.h>
00027 #include <gnuradio/hier_block2.h>
00028 #include <gnuradio/analog/cpm.h>
00029 
00030 namespace gr {
00031   namespace digital {
00032 
00033     /*!
00034      * \brief Generic CPM modulator
00035      * \ingroup modulators_blk
00036      *
00037      * \details
00038      * Examples:
00039      * - Setting h = 0.5, L = 1, type = LREC yields MSK.
00040      * - Setting h = 0.5, type = GAUSSIAN and beta = 0.3 yields GMSK
00041      *           as used in GSM.
00042      *
00043      * The input of this block are symbols from an M-ary alphabet
00044      * +/-1, +/-3, ..., +/-(M-1). Usually, M = 2 and therefore, the
00045      * valid inputs are +/-1.
00046      * The modulator will silently accept any other inputs, though.
00047      * The output is the phase-modulated signal.
00048      */
00049     class DIGITAL_API cpmmod_bc : virtual public hier_block2
00050     {
00051     public:
00052       // gr::digital::cpmmod_bc::sptr
00053       typedef boost::shared_ptr<cpmmod_bc> sptr;
00054 
00055       /*!
00056        * Make CPM modulator block.
00057        *
00058        * \param type The modulation type. Can be one of LREC, LRC, LSRC, TFM
00059        *             or GAUSSIAN. See gr_cpm::phase_response() for a
00060        *             detailed description.
00061        * \param h The modulation index. \f$ h \cdot \pi\f$ is the maximum
00062        *          phase change that can occur between two symbols, i.e., if
00063        *          you only send ones, the phase will increase by \f$ h \cdot
00064        *          \pi\f$ every \p samples_per_sym samples. Set this to 0.5
00065        *          for Minimum Shift Keying variants.
00066        * \param samples_per_sym Samples per symbol.
00067        * \param L The length of the phase duration in symbols. For L=1, this
00068        *          yields full- response CPM symbols, for L > 1,
00069        *          partial-response.
00070        * \param beta For LSRC, this is the rolloff factor. For Gaussian
00071        *             pulses, this is the 3 dB time-bandwidth product.
00072        */
00073       static sptr make(analog::cpm::cpm_type type, float h,
00074                        int samples_per_sym,
00075                        int L, double beta=0.3);
00076 
00077       /*!
00078        * Make GMSK modulator block.
00079        *
00080        * The type is GAUSSIAN and the modulation index for GMSK is
00081        * 0.5. This are populated automatically by this factory
00082        * function.
00083        *
00084        * \param samples_per_sym Samples per symbol.
00085        * \param L The length of the phase duration in symbols. For L=1, this
00086        *          yields full- response CPM symbols, for L > 1,
00087        *          partial-response.
00088        * \param beta For LSRC, this is the rolloff factor. For Gaussian
00089        *             pulses, this is the 3 dB time-bandwidth product.
00090        */
00091       static sptr make_gmskmod_bc(int samples_per_sym=2,
00092                                   int L=4, double beta=0.3);
00093 
00094       //! Return the phase response FIR taps
00095       virtual std::vector<float> taps() const = 0;
00096 
00097       //! Return the type of CPM modulator
00098       virtual int type() const = 0;
00099 
00100       //! Return the modulation index of the modulator.
00101       virtual float index() const = 0;
00102 
00103       //! Return the number of samples per symbol
00104       virtual int samples_per_sym() const = 0;
00105 
00106       //! Return the length of the phase duration (in symbols)
00107       virtual int length() const = 0;
00108 
00109       //! Return the value of beta for the modulator
00110       virtual double beta() const = 0;
00111     };
00112 
00113   } /* namespace digital */
00114 } /* namespace gr */
00115 
00116 #endif /* INCLUDED_DIGITAL_CPMMOD_BC_H */
00117