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