GNU Radio 3.6.5 C++ API

digital_cpmmod_bc.h

Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2010 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 <digital_api.h>
00027 #include <gr_hier_block2.h>
00028 #include <gr_char_to_float.h>
00029 #include <gr_interp_fir_filter_fff.h>
00030 #include <gr_frequency_modulator_fc.h>
00031 #include <gr_cpm.h>
00032 
00033 
00034 class digital_cpmmod_bc;
00035 typedef boost::shared_ptr<digital_cpmmod_bc> digital_cpmmod_bc_sptr;
00036 
00037 
00038 DIGITAL_API digital_cpmmod_bc_sptr
00039 digital_make_cpmmod_bc(int type, float h,
00040                        unsigned samples_per_sym,
00041                        unsigned L, double beta=0.3);
00042 
00043 /*!
00044  * \brief Generic CPM modulator
00045  * \ingroup modulators_blk
00046  *
00047  * \details
00048  * Examples:
00049  * - Setting h = 0.5, L = 1, type = LREC yields MSK.
00050  * - Setting h = 0.5, type = GAUSSIAN and beta = 0.3 yields GMSK
00051  *           as used in GSM.
00052  *
00053  * The input of this block are symbols from an M-ary alphabet
00054  * +/-1, +/-3, ..., +/-(M-1). Usually, M = 2 and therefore, the
00055  * valid inputs are +/-1.
00056  * The modulator will silently accept any other inputs, though.
00057  * The output is the phase-modulated signal.
00058  */
00059 class DIGITAL_API digital_cpmmod_bc : public gr_hier_block2
00060 {
00061   friend DIGITAL_API digital_cpmmod_bc_sptr
00062     digital_make_cpmmod_bc(int type, float h,
00063                            unsigned samples_per_sym,
00064                            unsigned L, double beta);
00065   
00066   std::vector<float> d_taps;
00067   gr_char_to_float_sptr d_char_to_float;
00068   gr_interp_fir_filter_fff_sptr d_pulse_shaper;
00069   gr_frequency_modulator_fc_sptr d_fm;
00070   
00071 protected:
00072   /*!
00073    * Build a generic CPM modulator block.
00074    *
00075    * \param type The modulation type. Can be one of LREC, LRC, LSRC, TFM
00076    *             or GAUSSIAN. See gr_cpm::phase_response() for a
00077    *             detailed description.
00078    * \param h The modulation index. \f$ h \cdot \pi\f$ is the maximum
00079    *          phase change that can occur between two symbols, i.e., if
00080    *          you only send ones, the phase will increase by \f$ h \cdot
00081    *          \pi\f$ every \p samples_per_sym samples. Set this to 0.5
00082    *          for Minimum Shift Keying variants.
00083    * \param samples_per_sym Samples per symbol.
00084    * \param L The length of the phase duration in symbols. For L=1, this
00085    *          yields full- response CPM symbols, for L > 1,
00086    *          partial-response.
00087    * \param beta For LSRC, this is the rolloff factor. For Gaussian
00088    *             pulses, this is the 3 dB time-bandwidth product.
00089    */
00090   digital_cpmmod_bc(gr_cpm::cpm_type type, float h,
00091                     unsigned samples_per_sym,
00092                     unsigned L, double beta);
00093   
00094 public:
00095   //! Return the phase response FIR taps
00096   std::vector<float> get_taps() { return d_taps; };
00097 };
00098 
00099 #endif /* INCLUDED_DIGITAL_CPMMOD_BC_H */
00100