GNU Radio 3.7.3 C++ API
cpmmod_bc.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2010,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_CPMMOD_BC_H
24 #define INCLUDED_DIGITAL_CPMMOD_BC_H
25 
26 #include <gnuradio/digital/api.h>
27 #include <gnuradio/hier_block2.h>
28 #include <gnuradio/analog/cpm.h>
29 
30 namespace gr {
31  namespace digital {
32 
33  /*!
34  * \brief Generic CPM modulator
35  * \ingroup modulators_blk
36  *
37  * \details
38  * Examples:
39  * - Setting h = 0.5, L = 1, type = LREC yields MSK.
40  * - Setting h = 0.5, type = GAUSSIAN and beta = 0.3 yields GMSK
41  * as used in GSM.
42  *
43  * The input of this block are symbols from an M-ary alphabet
44  * +/-1, +/-3, ..., +/-(M-1). Usually, M = 2 and therefore, the
45  * valid inputs are +/-1.
46  * The modulator will silently accept any other inputs, though.
47  * The output is the phase-modulated signal.
48  */
49  class DIGITAL_API cpmmod_bc : virtual public hier_block2
50  {
51  public:
52  // gr::digital::cpmmod_bc::sptr
54 
55  /*!
56  * Make CPM modulator block.
57  *
58  * \param type The modulation type. Can be one of LREC, LRC, LSRC, TFM
59  * or GAUSSIAN. See gr_cpm::phase_response() for a
60  * detailed description.
61  * \param h The modulation index. \f$ h \cdot \pi\f$ is the maximum
62  * phase change that can occur between two symbols, i.e., if
63  * you only send ones, the phase will increase by \f$ h \cdot
64  * \pi\f$ every \p samples_per_sym samples. Set this to 0.5
65  * for Minimum Shift Keying variants.
66  * \param samples_per_sym Samples per symbol.
67  * \param L The length of the phase duration in symbols. For L=1, this
68  * yields full- response CPM symbols, for L > 1,
69  * partial-response.
70  * \param beta For LSRC, this is the rolloff factor. For Gaussian
71  * pulses, this is the 3 dB time-bandwidth product.
72  */
73  static sptr make(analog::cpm::cpm_type type, float h,
74  int samples_per_sym,
75  int L, double beta=0.3);
76 
77  /*!
78  * Make GMSK modulator block.
79  *
80  * The type is GAUSSIAN and the modulation index for GMSK is
81  * 0.5. This are populated automatically by this factory
82  * function.
83  *
84  * \param samples_per_sym Samples per symbol.
85  * \param L The length of the phase duration in symbols. For L=1, this
86  * yields full- response CPM symbols, for L > 1,
87  * partial-response.
88  * \param beta For LSRC, this is the rolloff factor. For Gaussian
89  * pulses, this is the 3 dB time-bandwidth product.
90  */
91  static sptr make_gmskmod_bc(int samples_per_sym=2,
92  int L=4, double beta=0.3);
93 
94  //! Return the phase response FIR taps
95  virtual std::vector<float> taps() const = 0;
96 
97  //! Return the type of CPM modulator
98  virtual int type() const = 0;
99 
100  //! Return the modulation index of the modulator.
101  virtual float index() const = 0;
102 
103  //! Return the number of samples per symbol
104  virtual int samples_per_sym() const = 0;
105 
106  //! Return the length of the phase duration (in symbols)
107  virtual int length() const = 0;
108 
109  //! Return the value of beta for the modulator
110  virtual double beta() const = 0;
111  };
112 
113  } /* namespace digital */
114 } /* namespace gr */
115 
116 #endif /* INCLUDED_DIGITAL_CPMMOD_BC_H */
117 
cpm_type
Definition: cpm.h:37
#define DIGITAL_API
Definition: gr-digital/include/gnuradio/digital/api.h:30
shared_ptr documentation stub
Definition: shared_ptr_docstub.h:15
Generic CPM modulator.
Definition: cpmmod_bc.h:49
PMT_API size_t length(const pmt_t &v)
Return the number of elements in v.
boost::shared_ptr< cpmmod_bc > sptr
Definition: cpmmod_bc.h:53
static const float taps[NSTEPS+1][NTAPS]
Definition: interpolator_taps.h:9
Hierarchical container class for gr::block's and gr::hier_block2's.
Definition: hier_block2.h:46