root / gnuradio-core / src / lib / general / gr_cpm.h @ 77a2d01c
History | View | Annotate | Download (2.9 kB)
| 1 | 730e550d | Martin Braun | /* -*- c++ -*- */
|
|---|---|---|---|
| 2 | 730e550d | Martin Braun | /*
|
| 3 | 730e550d | Martin Braun | * Copyright 2010 Free Software Foundation, Inc. |
| 4 | c96ea672 | Martin Braun | * |
| 5 | 730e550d | Martin Braun | * GNU Radio is free software; you can redistribute it and/or modify |
| 6 | 730e550d | Martin Braun | * it under the terms of the GNU General Public License as published by |
| 7 | 730e550d | Martin Braun | * the Free Software Foundation; either version 3, or (at your option) |
| 8 | 730e550d | Martin Braun | * any later version. |
| 9 | c96ea672 | Martin Braun | * |
| 10 | 730e550d | Martin Braun | * GNU Radio is distributed in the hope that it will be useful, |
| 11 | 730e550d | Martin Braun | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | 730e550d | Martin Braun | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | 730e550d | Martin Braun | * GNU General Public License for more details. |
| 14 | c96ea672 | Martin Braun | * |
| 15 | 730e550d | Martin Braun | * You should have received a copy of the GNU General Public License |
| 16 | 730e550d | Martin Braun | * along with GNU Radio; see the file COPYING. If not, write to |
| 17 | 730e550d | Martin Braun | * the Free Software Foundation, Inc., 51 Franklin Street, |
| 18 | 730e550d | Martin Braun | * Boston, MA 02110-1301, USA. |
| 19 | 730e550d | Martin Braun | */ |
| 20 | 730e550d | Martin Braun | |
| 21 | 730e550d | Martin Braun | |
| 22 | 730e550d | Martin Braun | #ifndef INCLUDED_GR_CPM_H
|
| 23 | 730e550d | Martin Braun | #define INCLUDED_GR_CPM_H
|
| 24 | 730e550d | Martin Braun | |
| 25 | 7628cff1 | Josh Blum | #include <gr_core_api.h> |
| 26 | 5155713e | Martin Braun | #include <vector> |
| 27 | 5155713e | Martin Braun | |
| 28 | 7628cff1 | Josh Blum | class GR_CORE_API gr_cpm |
| 29 | 730e550d | Martin Braun | {
|
| 30 | 730e550d | Martin Braun | public:
|
| 31 | 730e550d | Martin Braun | enum cpm_type {
|
| 32 | 730e550d | Martin Braun | LRC, |
| 33 | 730e550d | Martin Braun | LSRC, |
| 34 | 730e550d | Martin Braun | LREC, |
| 35 | 730e550d | Martin Braun | TFM, |
| 36 | 730e550d | Martin Braun | GAUSSIAN, |
| 37 | 730e550d | Martin Braun | GENERIC = 999
|
| 38 | 730e550d | Martin Braun | }; |
| 39 | 730e550d | Martin Braun | |
| 40 | c96ea672 | Martin Braun | /*! \brief Return the taps for an interpolating FIR filter (gr_interp_fir_filter_fff).
|
| 41 | c96ea672 | Martin Braun | * |
| 42 | c96ea672 | Martin Braun | * These taps represent the phase response \f$g(k)\f$ for use in a CPM modulator, |
| 43 | c96ea672 | Martin Braun | * see also gr_cpmmod_bc. |
| 44 | c96ea672 | Martin Braun | * |
| 45 | c96ea672 | Martin Braun | * \param type The CPM type (Rectangular, Raised Cosine, Spectral Raised Cosine, |
| 46 | c96ea672 | Martin Braun | * Tamed FM or Gaussian). |
| 47 | c96ea672 | Martin Braun | * \param samples_per_sym Samples per symbol. |
| 48 | c96ea672 | Martin Braun | * \param L The length of the phase response in symbols. |
| 49 | c96ea672 | Martin Braun | * \param beta For Spectral Raised Cosine, this is the rolloff factor. For Gaussian |
| 50 | c96ea672 | Martin Braun | * phase responses, this the 3dB-time-bandwidth product. For all other |
| 51 | c96ea672 | Martin Braun | * cases, it is ignored. |
| 52 | c96ea672 | Martin Braun | * |
| 53 | c96ea672 | Martin Braun | * Output: returns a vector of length \a K = \p samples_per_sym x \p L. |
| 54 | c96ea672 | Martin Braun | * This can be used directly in an interpolating FIR filter such as |
| 55 | c96ea672 | Martin Braun | * gr_interp_fir_filter_fff with interpolation factor \p samples_per_sym. |
| 56 | c96ea672 | Martin Braun | * |
| 57 | c96ea672 | Martin Braun | * All phase responses are normalised s.t. \f$ \sum_{k=0}^{K-1} g(k) = 1\f$; this will cause
|
| 58 | c96ea672 | Martin Braun | * a maximum phase change of \f$ h \cdot \pi\f$ between two symbols, where \a h is the |
| 59 | c96ea672 | Martin Braun | * modulation index. |
| 60 | c96ea672 | Martin Braun | * |
| 61 | c96ea672 | Martin Braun | * The following phase responses can be generated: |
| 62 | c96ea672 | Martin Braun | * - LREC: Rectangular phase response. |
| 63 | c96ea672 | Martin Braun | * - LRC: Raised cosine phase response, looks like 1 - cos(x). |
| 64 | c96ea672 | Martin Braun | * - LSRC: Spectral raised cosine. This requires a rolloff factor beta. |
| 65 | c96ea672 | Martin Braun | * The phase response is the Fourier transform of raised cosine |
| 66 | c96ea672 | Martin Braun | * function. |
| 67 | c96ea672 | Martin Braun | * - TFM: Tamed frequency modulation. This scheme minimizes phase change for |
| 68 | c96ea672 | Martin Braun | * rapidly varying input symbols. |
| 69 | c96ea672 | Martin Braun | * - GAUSSIAN: A Gaussian phase response. For a modulation index h = 1/2, this |
| 70 | c96ea672 | Martin Braun | * results in GMSK. |
| 71 | c96ea672 | Martin Braun | * |
| 72 | c96ea672 | Martin Braun | * A short description of all these phase responses can be found in [1]. |
| 73 | c96ea672 | Martin Braun | * |
| 74 | c96ea672 | Martin Braun | * [1]: Anderson, Aulin and Sundberg; Digital Phase Modulation |
| 75 | c96ea672 | Martin Braun | */ |
| 76 | 730e550d | Martin Braun | static std::vector<float> |
| 77 | 730e550d | Martin Braun | phase_response(cpm_type type, unsigned samples_per_sym, unsigned L, double beta=0.3); |
| 78 | 730e550d | Martin Braun | }; |
| 79 | 730e550d | Martin Braun | |
| 80 | 730e550d | Martin Braun | #endif /* INCLUDED_GR_CPM_H */ |