GNU Radio 3.7.0 C++ API
cpm.h
Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2010,2012 Free Software Foundation, Inc.
00004  *
00005  * GNU Radio is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 3, or (at your option)
00008  * any later version.
00009  *
00010  * GNU Radio is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with GNU Radio; see the file COPYING.  If not, write to
00017  * the Free Software Foundation, Inc., 51 Franklin Street,
00018  * Boston, MA 02110-1301, USA.
00019  */
00020 
00021 
00022 #ifndef INCLUDED_ANALOG_CPM_H
00023 #define INCLUDED_ANALOG_CPM_H
00024 
00025 #include <gnuradio/analog/api.h>
00026 #include <vector>
00027 
00028 namespace gr {
00029   namespace analog {
00030 
00031     /*! \brief Return the taps for an interpolating FIR filter
00032      *   (gr::filter::interp_fir_filter_fff).
00033      */
00034     class ANALOG_API cpm
00035     {
00036     public:
00037       enum cpm_type {
00038         LRC,
00039         LSRC,
00040         LREC,
00041         TFM,
00042         GAUSSIAN,
00043         GENERIC = 999
00044       };
00045       
00046       /*! \brief Return the taps for an interpolating FIR filter
00047        *   (gr::filter::interp_fir_filter_fff).
00048        *
00049        * \details
00050        * These taps represent the phase response \f$g(k)\f$ for use in a CPM modulator,
00051        * see also gr_cpmmod_bc.
00052        *
00053        * \param type The CPM type (Rectangular, Raised Cosine,
00054        *             Spectral Raised Cosine, Tamed FM or Gaussian).
00055        * \param samples_per_sym Samples per symbol.
00056        * \param L The length of the phase response in symbols.
00057        * \param beta For Spectral Raised Cosine, this is the rolloff
00058        *             factor. For Gaussian phase responses, this the
00059        *             3dB-time-bandwidth product. For all other cases,
00060        *             it is ignored.
00061        *
00062        * Output: returns a vector of length \a K = \p samples_per_sym
00063        *         x \p L.  This can be used directly in an
00064        *         interpolating FIR filter such as
00065        *         gr_interp_fir_filter_fff with interpolation factor \p
00066        *         samples_per_sym.
00067        *
00068        * All phase responses are normalised s.t. \f$ \sum_{k=0}^{K-1}
00069        * g(k) = 1\f$; this will cause a maximum phase change of \f$ h
00070        * \cdot \pi\f$ between two symbols, where \a h is the
00071        * modulation index.
00072        *
00073        * The following phase responses can be generated:
00074        * - LREC: Rectangular phase response.
00075        * - LRC: Raised cosine phase response, looks like 1 - cos(x).
00076        * - LSRC: Spectral raised cosine. This requires a rolloff factor beta.
00077        *         The phase response is the Fourier transform of raised cosine
00078        *         function.
00079        * - TFM: Tamed frequency modulation. This scheme minimizes phase change for
00080        *        rapidly varying input symbols.
00081        * - GAUSSIAN: A Gaussian phase response. For a modulation index h = 1/2, this
00082        *             results in GMSK.
00083        *
00084        * A short description of all these phase responses can be found in [1].
00085        *
00086        * [1]: Anderson, Aulin and Sundberg; Digital Phase Modulation
00087        */
00088       static std::vector<float>
00089         phase_response(cpm_type type, unsigned samples_per_sym,
00090                        unsigned L, double beta=0.3);
00091     };
00092   } // namespace analog
00093 } // namespace gr
00094 
00095 #endif /* INCLUDED_ANALOG_CPM_H */
00096