GNU Radio 3.6.1 C++ API
digital_cpmmod_bc.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2010 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 <digital_api.h>
27 #include <gr_hier_block2.h>
28 #include <gr_char_to_float.h>
31 #include <gr_cpm.h>
32 
33 
34 class digital_cpmmod_bc;
36 
37 
39 digital_make_cpmmod_bc(int type, float h,
40  unsigned samples_per_sym,
41  unsigned L, double beta=0.3);
42 
43 /*!
44  * \brief Generic CPM modulator
45  *
46  * \ingroup modulation_blk
47  * \ingroup digital
48  *
49  * \param type The modulation type. Can be one of LREC, LRC, LSRC, TFM
50  * or GAUSSIAN. See gr_cpm::phase_response() for a
51  * detailed description.
52  * \param h The modulation index. \f$ h \cdot \pi\f$ is the maximum
53  * phase change that can occur between two symbols, i.e., if
54  * you only send ones, the phase will increase by \f$ h \cdot
55  * \pi\f$ every \p samples_per_sym samples. Set this to 0.5
56  * for Minimum Shift Keying variants.
57  * \param samples_per_sym Samples per symbol.
58  * \param L The length of the phase duration in symbols. For L=1, this
59  * yields full- response CPM symbols, for L > 1,
60  * partial-response.
61  * \param beta For LSRC, this is the rolloff factor. For Gaussian
62  * pulses, this is the 3 dB time-bandwidth product.
63  *
64  * Examples:
65  * - Setting h = 0.5, L = 1, type = LREC yields MSK.
66  * - Setting h = 0.5, type = GAUSSIAN and beta = 0.3 yields GMSK
67  * as used in GSM.
68  *
69  * The input of this block are symbols from an M-ary alphabet
70  * +/-1, +/-3, ..., +/-(M-1). Usually, M = 2 and therefore, the
71  * valid inputs are +/-1.
72  * The modulator will silently accept any other inputs, though.
73  * The output is the phase-modulated signal.
74  */
76 {
78  digital_make_cpmmod_bc(int type, float h,
79  unsigned samples_per_sym,
80  unsigned L, double beta);
81 
82  std::vector<float> d_taps;
83  gr_char_to_float_sptr d_char_to_float;
84  gr_interp_fir_filter_fff_sptr d_pulse_shaper;
86 
87 protected:
88  digital_cpmmod_bc(gr_cpm::cpm_type type, float h,
89  unsigned samples_per_sym,
90  unsigned L, double beta);
91 
92 public:
93  //! Return the phase response FIR taps
94  std::vector<float> get_taps() { return d_taps; };
95 };
96 
97 #endif /* INCLUDED_DIGITAL_CPMMOD_BC_H */
98