summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gnuradio-core/src/lib/general/Makefile.am5
-rw-r--r--gnuradio-core/src/lib/general/general.i4
-rw-r--r--gnuradio-core/src/lib/general/gr_cpm.cc214
-rw-r--r--gnuradio-core/src/lib/general/gr_cpm.h80
-rw-r--r--gnuradio-core/src/lib/general/gr_cpm.i40
-rw-r--r--gnuradio-core/src/lib/general/qa_general.cc2
-rw-r--r--gnuradio-core/src/lib/general/qa_gr_cpm.cc140
-rw-r--r--gnuradio-core/src/lib/general/qa_gr_cpm.h49
-rw-r--r--gnuradio-core/src/lib/hier/Makefile.am14
-rw-r--r--gnuradio-core/src/lib/hier/gr_cpmmod_bc.cc64
-rw-r--r--gnuradio-core/src/lib/hier/gr_cpmmod_bc.h86
-rw-r--r--gnuradio-core/src/lib/hier/gr_cpmmod_bc.i36
-rw-r--r--gnuradio-core/src/lib/hier/gr_gmskmod_bc.cc41
-rw-r--r--gnuradio-core/src/lib/hier/gr_gmskmod_bc.h59
-rw-r--r--gnuradio-core/src/lib/hier/gr_gmskmod_bc.i36
-rw-r--r--gnuradio-core/src/lib/hier/hier.i5
-rwxr-xr-xgnuradio-core/src/python/gnuradio/gr/qa_cpm.py90
-rw-r--r--grc/blocks/Makefile.am2
-rw-r--r--grc/blocks/block_tree.xml2
-rw-r--r--grc/blocks/gr_cpmmod_bc.xml69
-rw-r--r--grc/blocks/gr_gmskmod_bc.xml38
21 files changed, 1072 insertions, 4 deletions
diff --git a/gnuradio-core/src/lib/general/Makefile.am b/gnuradio-core/src/lib/general/Makefile.am
index f210cee39..fe545f98c 100644
--- a/gnuradio-core/src/lib/general/Makefile.am
+++ b/gnuradio-core/src/lib/general/Makefile.am
@@ -55,6 +55,7 @@ libgeneral_la_SOURCES = \
gr_copy.cc \
gr_count_bits.cc \
gr_cpfsk_bc.cc \
+ gr_cpm.cc \
gr_ctcss_squelch_ff.cc \
gr_decode_ccsds_27_fb.cc \
gr_deinterleave.cc \
@@ -176,6 +177,7 @@ libgeneral_la_SOURCES = \
libgeneral_qa_la_SOURCES = \
qa_general.cc \
qa_gr_circular_file.cc \
+ qa_gr_cpm.cc \
qa_gr_firdes.cc \
qa_gr_fxpt.cc \
qa_gr_fxpt_nco.cc \
@@ -203,6 +205,7 @@ grinclude_HEADERS = \
gr_copy.h \
gr_count_bits.h \
gr_cpfsk_bc.h \
+ gr_cpm.h \
gr_ctcss_squelch_ff.h \
gr_decode_ccsds_27_fb.h \
gr_diff_decoder_bb.h \
@@ -340,6 +343,7 @@ grinclude_HEADERS = \
noinst_HEADERS = \
qa_general.h \
qa_gr_circular_file.h \
+ qa_gr_cpm.h \
qa_gr_firdes.h \
qa_gr_fxpt.h \
qa_gr_fxpt_nco.h \
@@ -367,6 +371,7 @@ swiginclude_HEADERS = \
gr_conjugate_cc.i \
gr_copy.i \
gr_cpfsk_bc.i \
+ gr_cpm.i \
gr_ctcss_squelch_ff.i \
gr_decode_ccsds_27_fb.i \
gr_diff_decoder_bb.i \
diff --git a/gnuradio-core/src/lib/general/general.i b/gnuradio-core/src/lib/general/general.i
index f9adff3fa..e965eea64 100644
--- a/gnuradio-core/src/lib/general/general.i
+++ b/gnuradio-core/src/lib/general/general.i
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc.
+ * Copyright 2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -137,6 +137,7 @@
#include <gr_annotator_alltoall.h>
#include <gr_annotator_1to1.h>
#include <gr_burst_tagger.h>
+#include <gr_cpm.h>
%}
%include "gri_control_loop.i"
@@ -254,3 +255,4 @@
%include "gr_annotator_alltoall.i"
%include "gr_annotator_1to1.i"
%include "gr_burst_tagger.i"
+%include "gr_cpm.i"
diff --git a/gnuradio-core/src/lib/general/gr_cpm.cc b/gnuradio-core/src/lib/general/gr_cpm.cc
new file mode 100644
index 000000000..a00526b52
--- /dev/null
+++ b/gnuradio-core/src/lib/general/gr_cpm.cc
@@ -0,0 +1,214 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2010 Free Software Foundation, Inc.
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+// Calculate the taps for the CPM phase responses
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <cmath>
+#include <cfloat>
+#include <gr_cpm.h>
+
+#ifndef M_TWOPI
+# define M_TWOPI (2*M_PI)
+#endif
+
+//! Normalised sinc function, sinc(x)=sin(pi*x)/pi*x
+inline double
+sinc(double x)
+{
+ if (x == 0) {
+ return 1.0;
+ }
+
+ return sin(M_PI * x) / (M_PI * x);
+}
+
+
+//! Taps for L-RC CPM (Raised cosine of length L symbols)
+std::vector<float>
+generate_cpm_lrc_taps(unsigned samples_per_sym, unsigned L)
+{
+ std::vector<float> taps(samples_per_sym * L, 1.0/L/samples_per_sym);
+ for (unsigned i = 0; i < samples_per_sym * L; i++) {
+ taps[i] *= 1 - cos(M_TWOPI * i / L / samples_per_sym);
+ }
+
+ return taps;
+}
+
+
+/*! Taps for L-SRC CPM (Spectral raised cosine of length L symbols).
+ *
+ * L-SRC has a time-continuous phase response function of
+ *
+ * g(t) = 1/LT * sinc(2t/LT) * cos(beta * 2pi t / LT) / (1 - (4beta / LT * t)^2)
+ *
+ * which is the Fourier transform of a cos-rolloff function with rolloff
+ * beta, and looks like a sinc-function, multiplied with a rolloff term.
+ * We return the main lobe of the sinc, i.e., everything between the
+ * zero crossings.
+ * The time-discrete IR is thus
+ *
+ * g(k) = 1/Ls * sinc(2k/Ls) * cos(beta * pi k / Ls) / (1 - (4beta / Ls * k)^2)
+ * where k = 0...Ls-1
+ * and s = samples per symbol.
+ */
+std::vector<float>
+generate_cpm_lsrc_taps(unsigned samples_per_sym, unsigned L, double beta)
+{
+ double Ls = (double) L * samples_per_sym;
+ std::vector<double> taps_d(L * samples_per_sym, 0.0);
+ std::vector<float> taps(L * samples_per_sym, 0.0);
+
+ double sum = 0;
+ for (unsigned i = 0; i < samples_per_sym * L; i++) {
+ double k = i - Ls/2; // Causal to acausal
+
+ taps_d[i] = 1.0 / Ls * sinc(2.0 * k / Ls);
+
+ // For k = +/-Ls/4*beta, the rolloff term's cos-function becomes zero
+ // and the whole thing converges to PI/4 (to prove this, use de
+ // l'hopital's rule).
+ if (fabs(fabs(k) - Ls/4/beta) < 2*DBL_EPSILON) {
+ taps_d[i] *= M_PI_4;
+ } else {
+ double tmp = 4.0 * beta * k / Ls;
+ taps_d[i] *= cos(beta * M_TWOPI * k / Ls) / (1 - tmp * tmp);
+ }
+ sum += taps_d[i];
+ }
+ for (unsigned i = 0; i < samples_per_sym * L; i++) {
+ taps[i] = (float) taps_d[i] / sum;
+ }
+
+ return taps;
+}
+
+
+//! Taps for L-REC CPM (Rectangular pulse shape of length L symbols)
+std::vector<float>
+generate_cpm_lrec_taps(unsigned samples_per_sym, unsigned L)
+{
+ return std::vector<float>(samples_per_sym * L, 1.0/L/samples_per_sym);
+}
+
+
+//! Helper function for TFM
+double tfm_g0(double k, double sps)
+{
+ if (fabs(k) < 2 * DBL_EPSILON) {
+ return 1.145393004159143; // 1 + pi^2/48 / sqrt(2)
+ }
+
+ const double pi2_24 = 0.411233516712057; // pi^2/24
+ double f = M_PI * k / sps;
+ return sinc(k/sps) - pi2_24 * (2 * sin(f) - 2*f*cos(f) - f*f*sin(f)) / (f*f*f);
+}
+
+
+//! Taps for TFM CPM (Tamed frequency modulation)
+//
+// See [2, Chapter 2.7.2].
+//
+// [2]: Anderson, Aulin and Sundberg; Digital Phase Modulation
+std::vector<float>
+generate_cpm_tfm_taps(unsigned sps, unsigned L)
+{
+ unsigned causal_shift = sps * L / 2;
+ std::vector<double> taps_d(sps * L, 0.0);
+ std::vector<float> taps(sps * L, 0.0);
+
+ double sum = 0;
+ for (unsigned i = 0; i < sps * L; i++) {
+ double k = (double)(((int)i) - ((int)causal_shift)); // Causal to acausal
+
+ taps_d[i] = tfm_g0(k - sps, sps) +
+ 2 * tfm_g0(k, sps) +
+ tfm_g0(k + sps, sps);
+ sum += taps_d[i];
+ }
+ for (unsigned i = 0; i < sps * L; i++) {
+ taps[i] = (float) taps_d[i] / sum;
+ }
+
+ return taps;
+}
+
+
+//! Taps for Gaussian CPM. Phase response is truncated after \p L symbols.
+// \p bt sets the 3dB-time-bandwidth product.
+//
+// Note: for h = 0.5, this is the phase response for GMSK.
+//
+// This C99-compatible formula for the taps is taken straight
+// from [1, Chapter 9.2.3].
+// A version in Q-notation can be found in [2, Chapter 2.7.2].
+//
+// [1]: Karl-Dirk Kammeyer; Nachrichtenübertragung, 4th Edition.
+// [2]: Anderson, Aulin and Sundberg; Digital Phase Modulation
+//
+std::vector<float>
+generate_cpm_gaussian_taps(unsigned samples_per_sym, unsigned L, double bt)
+{
+ double Ls = (double) L * samples_per_sym;
+ std::vector<double> taps_d(L * samples_per_sym, 0.0);
+ std::vector<float> taps(L * samples_per_sym, 0.0);
+
+ // alpha = sqrt(2/ln(2)) * pi * BT
+ double alpha = 5.336446256636997 * bt;
+ for (unsigned i = 0; i < samples_per_sym * L; i++) {
+ double k = i - Ls/2; // Causal to acausal
+ taps_d[i] = (erf(alpha * (k / samples_per_sym + 0.5)) -
+ erf(alpha * (k / samples_per_sym - 0.5)))
+ * 0.5 / samples_per_sym;
+ taps[i] = (float) taps_d[i];
+ }
+
+ return taps;
+}
+
+
+std::vector<float>
+gr_cpm::phase_response(cpm_type type, unsigned samples_per_sym, unsigned L, double beta)
+{
+ switch (type) {
+ case LRC:
+ return generate_cpm_lrc_taps(samples_per_sym, L);
+
+ case LSRC:
+ return generate_cpm_lsrc_taps(samples_per_sym, L, beta);
+
+ case LREC:
+ return generate_cpm_lrec_taps(samples_per_sym, L);
+
+ case TFM:
+ return generate_cpm_tfm_taps(samples_per_sym, L);
+
+ case GAUSSIAN:
+ return generate_cpm_gaussian_taps(samples_per_sym, L, beta);
+
+ default:
+ return generate_cpm_lrec_taps(samples_per_sym, 1);
+ }
+}
+
diff --git a/gnuradio-core/src/lib/general/gr_cpm.h b/gnuradio-core/src/lib/general/gr_cpm.h
new file mode 100644
index 000000000..cae6fe313
--- /dev/null
+++ b/gnuradio-core/src/lib/general/gr_cpm.h
@@ -0,0 +1,80 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2010 Free Software Foundation, Inc.
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+
+#ifndef INCLUDED_GR_CPM_H
+#define INCLUDED_GR_CPM_H
+
+#include <vector>
+
+class gr_cpm
+{
+ public:
+ enum cpm_type {
+ LRC,
+ LSRC,
+ LREC,
+ TFM,
+ GAUSSIAN,
+ GENERIC = 999
+ };
+
+ /*! \brief Return the taps for an interpolating FIR filter (gr_interp_fir_filter_fff).
+ *
+ * These taps represent the phase response \f$g(k)\f$ for use in a CPM modulator,
+ * see also gr_cpmmod_bc.
+ *
+ * \param type The CPM type (Rectangular, Raised Cosine, Spectral Raised Cosine,
+ * Tamed FM or Gaussian).
+ * \param samples_per_sym Samples per symbol.
+ * \param L The length of the phase response in symbols.
+ * \param beta For Spectral Raised Cosine, this is the rolloff factor. For Gaussian
+ * phase responses, this the 3dB-time-bandwidth product. For all other
+ * cases, it is ignored.
+ *
+ * Output: returns a vector of length \a K = \p samples_per_sym x \p L.
+ * This can be used directly in an interpolating FIR filter such as
+ * gr_interp_fir_filter_fff with interpolation factor \p samples_per_sym.
+ *
+ * All phase responses are normalised s.t. \f$ \sum_{k=0}^{K-1} g(k) = 1\f$; this will cause
+ * a maximum phase change of \f$ h \cdot \pi\f$ between two symbols, where \a h is the
+ * modulation index.
+ *
+ * The following phase responses can be generated:
+ * - LREC: Rectangular phase response.
+ * - LRC: Raised cosine phase response, looks like 1 - cos(x).
+ * - LSRC: Spectral raised cosine. This requires a rolloff factor beta.
+ * The phase response is the Fourier transform of raised cosine
+ * function.
+ * - TFM: Tamed frequency modulation. This scheme minimizes phase change for
+ * rapidly varying input symbols.
+ * - GAUSSIAN: A Gaussian phase response. For a modulation index h = 1/2, this
+ * results in GMSK.
+ *
+ * A short description of all these phase responses can be found in [1].
+ *
+ * [1]: Anderson, Aulin and Sundberg; Digital Phase Modulation
+ */
+ static std::vector<float>
+ phase_response(cpm_type type, unsigned samples_per_sym, unsigned L, double beta=0.3);
+};
+
+#endif /* INCLUDED_GR_CPM_H */
+
diff --git a/gnuradio-core/src/lib/general/gr_cpm.i b/gnuradio-core/src/lib/general/gr_cpm.i
new file mode 100644
index 000000000..f01aba34e
--- /dev/null
+++ b/gnuradio-core/src/lib/general/gr_cpm.i
@@ -0,0 +1,40 @@
+/* -*- C++ -*- */
+/*
+ * Copyright 2010 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+%rename(cpm) gr_cpm;
+
+class gr_cpm
+{
+ public:
+ enum cpm_type {
+ LRC,
+ LSRC,
+ LREC,
+ TFM,
+ GAUSSIAN,
+ GENERIC = 999
+ };
+
+ static std::vector<float>
+ phase_response(cpm_type type, unsigned samples_per_sym, unsigned L, double beta=0.3);
+};
+
diff --git a/gnuradio-core/src/lib/general/qa_general.cc b/gnuradio-core/src/lib/general/qa_general.cc
index 6984d798c..b9080f362 100644
--- a/gnuradio-core/src/lib/general/qa_general.cc
+++ b/gnuradio-core/src/lib/general/qa_general.cc
@@ -28,6 +28,7 @@
#include <qa_general.h>
#include <qa_gr_firdes.h>
#include <qa_gr_circular_file.h>
+#include <qa_gr_cpm.h>
#include <qa_gr_fxpt.h>
#include <qa_gr_fxpt_nco.h>
#include <qa_gr_fxpt_vco.h>
@@ -41,6 +42,7 @@ qa_general::suite ()
s->addTest (qa_gr_firdes::suite ());
s->addTest (qa_gr_circular_file::suite ());
+ s->addTest (qa_gr_cpm::suite ());
s->addTest (qa_gr_fxpt::suite ());
s->addTest (qa_gr_fxpt_nco::suite ());
s->addTest (qa_gr_fxpt_vco::suite ());
diff --git a/gnuradio-core/src/lib/general/qa_gr_cpm.cc b/gnuradio-core/src/lib/general/qa_gr_cpm.cc
new file mode 100644
index 000000000..cc32d1117
--- /dev/null
+++ b/gnuradio-core/src/lib/general/qa_gr_cpm.cc
@@ -0,0 +1,140 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2010 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include <qa_gr_cpm.h>
+#include <gr_cpm.h>
+#include <cppunit/TestAssert.h>
+
+const double DELTA = 1e-5;
+const int L = 5;
+const int samples_per_sym = 4;
+const float taps_lrc[20] = {
+ 0, 0.002447174185242, 0.009549150281253, 0.020610737385376,
+ 0.034549150281253, 0.050000000000000, 0.065450849718747, 0.079389262614624,
+ 0.090450849718747, 0.097552825814758, 0.100000000000000, 0.097552825814758,
+ 0.090450849718747, 0.079389262614624, 0.065450849718747, 0.050000000000000,
+ 0.034549150281253, 0.020610737385376, 0.009549150281253, 0.002447174185242
+};
+
+
+const float taps_lsrc[20] = { // beta = 0.2
+ 0.000000000000000, 0.009062686687436, 0.019517618142920, 0.030875041875917,
+ 0.042552315421249, 0.053912556756416, 0.064308860403517, 0.073130584159352,
+ 0.079847961304114, 0.084051371489937, 0.085482007518284, 0.084051371489937,
+ 0.079847961304114, 0.073130584159352, 0.064308860403517, 0.053912556756416,
+ 0.042552315421249, 0.030875041875917, 0.019517618142920, 0.009062686687436
+};
+
+
+const float taps_tfm[20] = {
+ -0.003946522220317, -0.005147757690530, -0.003171631690177, 0.003959659609805,
+ 0.017498721302356, 0.037346982678383, 0.062251889790391, 0.087364237065604,
+ 0.110049050955117, 0.125677762224511, 0.132288693729399, 0.125677762224511,
+ 0.110049050955117, 0.087364237065604, 0.062251889790391, 0.037346982678383,
+ 0.017498721302356, 0.003959659609805, -0.003171631690177, -0.005147757690530
+};
+
+
+const float taps_gaussian[20] = { // BT = 0.3
+ 0.000000743866524, 0.000009286258371, 0.000085441834550, 0.000581664421923,
+ 0.002945540765422, 0.011178079812344, 0.032117220937421, 0.070841188736816,
+ 0.122053715366673, 0.167389736919915, 0.185594670675172, 0.167389736919915,
+ 0.122053715366673, 0.070841188736816, 0.032117220937421, 0.011178079812344,
+ 0.002945540765422, 0.000581664421923, 0.000085441834550, 0.000009286258371
+};
+
+
+// Check LREC phase response
+void
+qa_gr_cpm::t1 ()
+{
+ std::vector<float> taps(gr_cpm::phase_response(gr_cpm::LREC, samples_per_sym, L));
+
+ for (int i = 0; i < L * samples_per_sym; i++) {
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(taps[i], 0.05, DELTA);
+ }
+}
+
+
+// Check LRC phase response
+void
+qa_gr_cpm::t2 ()
+{
+ std::vector<float> taps(gr_cpm::phase_response(gr_cpm::LRC, samples_per_sym, L));
+ float sum = 0;
+
+ for (int i = 0; i < L * samples_per_sym; i++) {
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(taps[i], taps_lrc[i], DELTA);
+ sum += taps[i];
+ }
+
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(sum, 1.0, DELTA);
+}
+
+
+// Check LSRC phase response
+void
+qa_gr_cpm::t3 ()
+{
+ std::vector<float> taps(gr_cpm::phase_response(gr_cpm::LSRC, samples_per_sym, L, 0.2));
+ float sum = 0;
+
+ for (int i = 0; i < L * samples_per_sym; i++) {
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(taps[i], taps_lsrc[i], DELTA);
+ sum += taps[i];
+ }
+
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(sum, 1.0, DELTA);
+}
+
+
+// Check the TFM phase response
+void
+qa_gr_cpm::t4 ()
+{
+ std::vector<float> taps(gr_cpm::phase_response(gr_cpm::TFM, samples_per_sym, L));
+ float sum = 0;
+
+ for (int i = 0; i < L * samples_per_sym; i++) {
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(taps[i], taps_tfm[i], DELTA);
+ sum += taps[i];
+ }
+
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(sum, 1.0, DELTA);
+}
+
+
+// Check the Gaussian phase response
+void
+qa_gr_cpm::t5 ()
+{
+ std::vector<float> taps(gr_cpm::phase_response(gr_cpm::GAUSSIAN, samples_per_sym, L, 0.3));
+ float sum = 0;
+
+ for (int i = 0; i < L * samples_per_sym; i++) {
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(taps[i], taps_gaussian[i], DELTA);
+ sum += taps[i];
+ }
+
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(sum, 1.0, DELTA);
+}
+
diff --git a/gnuradio-core/src/lib/general/qa_gr_cpm.h b/gnuradio-core/src/lib/general/qa_gr_cpm.h
new file mode 100644
index 000000000..741cb2860
--- /dev/null
+++ b/gnuradio-core/src/lib/general/qa_gr_cpm.h
@@ -0,0 +1,49 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2010 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+#ifndef _QA_GR_CPM_H
+#define _QA_GR_CPM_H
+
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/TestCase.h>
+
+class qa_gr_cpm : public CppUnit::TestCase {
+
+ CPPUNIT_TEST_SUITE (qa_gr_cpm);
+ CPPUNIT_TEST (t1);
+ CPPUNIT_TEST (t2);
+ CPPUNIT_TEST (t3);
+ CPPUNIT_TEST (t4);
+ CPPUNIT_TEST (t5);
+ CPPUNIT_TEST_SUITE_END ();
+
+ private:
+ void t1 ();
+ void t2 ();
+ void t3 ();
+ void t4 ();
+ void t5 ();
+
+};
+
+
+#endif /* _QA_GR_CPM_H */
+
diff --git a/gnuradio-core/src/lib/hier/Makefile.am b/gnuradio-core/src/lib/hier/Makefile.am
index b525d19b4..8d56be7a3 100644
--- a/gnuradio-core/src/lib/hier/Makefile.am
+++ b/gnuradio-core/src/lib/hier/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2009 Free Software Foundation, Inc.
+# Copyright 2009,2010 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -27,11 +27,19 @@ AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(WITH_INCLUDES)
noinst_LTLIBRARIES = libhier.la
libhier_la_SOURCES = \
- gr_channel_model.cc
+ gr_channel_model.cc \
+ gr_gmskmod_bc.cc \
+ gr_cpmmod_bc.cc
grinclude_HEADERS = \
- gr_channel_model.h
+ gr_channel_model.h \
+ gr_gmskmod_bc.h \
+ gr_cpmmod_bc.h
+
swiginclude_HEADERS = \
hier.i \
gr_channel_model.i
+ gr_channel_model.i \
+ gr_gmskmod_bc.i \
+ gr_cpmmod_bc.i
diff --git a/gnuradio-core/src/lib/hier/gr_cpmmod_bc.cc b/gnuradio-core/src/lib/hier/gr_cpmmod_bc.cc
new file mode 100644
index 000000000..24c25e22f
--- /dev/null
+++ b/gnuradio-core/src/lib/hier/gr_cpmmod_bc.cc
@@ -0,0 +1,64 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2010 Free Software Foundation, Inc.
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <gr_cpmmod_bc.h>
+#include <gr_io_signature.h>
+
+
+// Shared pointer constructor
+gr_cpmmod_bc_sptr
+gr_make_cpmmod_bc(int type, float h, unsigned samples_per_sym, unsigned L, double beta)
+{
+ return gnuradio::get_initial_sptr(new gr_cpmmod_bc((gr_cpm::cpm_type)type, h, samples_per_sym, L, beta));
+}
+
+
+gr_cpmmod_bc::gr_cpmmod_bc(gr_cpm::cpm_type type, float h, unsigned samples_per_sym,
+ unsigned L, double beta)
+ : gr_hier_block2("gr_cpmmod_bc",
+ gr_make_io_signature(1, 1, sizeof(char)),
+ gr_make_io_signature2(1, 1, sizeof(gr_complex), sizeof(float))),
+ d_taps(gr_cpm::phase_response(type, samples_per_sym, L, beta)),
+ d_char_to_float(gr_make_char_to_float()),
+ d_pulse_shaper(gr_make_interp_fir_filter_fff(samples_per_sym, d_taps)),
+ d_fm(gr_make_frequency_modulator_fc(M_PI * h))
+{
+ switch (type) {
+ case gr_cpm::LRC:
+ case gr_cpm::LSRC:
+ case gr_cpm::LREC:
+ case gr_cpm::TFM:
+ case gr_cpm::GAUSSIAN:
+ break;
+
+ default:
+ throw std::invalid_argument("invalid CPM type");
+ }
+
+ connect(self(), 0, d_char_to_float, 0);
+ connect(d_char_to_float, 0, d_pulse_shaper, 0);
+ connect(d_pulse_shaper, 0, d_fm, 0);
+ connect(d_fm, 0, self(), 0);
+}
+
diff --git a/gnuradio-core/src/lib/hier/gr_cpmmod_bc.h b/gnuradio-core/src/lib/hier/gr_cpmmod_bc.h
new file mode 100644
index 000000000..210b30612
--- /dev/null
+++ b/gnuradio-core/src/lib/hier/gr_cpmmod_bc.h
@@ -0,0 +1,86 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2010 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef INCLUDED_GR_CPMMOD_BC_H
+#define INCLUDED_GR_CPMMOD_BC_H
+
+#include <gr_hier_block2.h>
+#include <gr_char_to_float.h>
+#include <gr_interp_fir_filter_fff.h>
+#include <gr_frequency_modulator_fc.h>
+#include <gr_cpm.h>
+
+
+class gr_cpmmod_bc;
+typedef boost::shared_ptr<gr_cpmmod_bc> gr_cpmmod_bc_sptr;
+
+
+gr_cpmmod_bc_sptr
+gr_make_cpmmod_bc(int type, float h, unsigned samples_per_sym, unsigned L, double beta=0.3);
+
+
+/*!
+ * \brief Generic CPM modulator
+ *
+ * \ingroup modulation_blk
+ *
+ * \param type The modulation type. Can be one of LREC, LRC, LSRC, TFM or GAUSSIAN. See
+ * gr_cpm::phase_response() for a detailed description.
+ * \param h The modulation index. \f$ h \cdot \pi\f$ is the maximum phase change that can occur
+ * between two symbols, i.e., if you only send ones, the phase will increase
+ * by \f$ h \cdot \pi\f$ every \p samples_per_sym samples. Set this to 0.5 for Minimum Shift
+ * Keying variants.
+ * \param samples_per_sym Samples per symbol.
+ * \param L The length of the phase duration in symbols. For L=1, this yields full-
+ * response CPM symbols, for L > 1, partial-response.
+ * \param beta For LSRC, this is the rolloff factor. For Gaussian pulses, this is the 3 dB
+ * time-bandwidth product.
+ *
+ * Examples:
+ * - Setting h = 0.5, L = 1, type = LREC yields MSK.
+ * - Setting h = 0.5, type = GAUSSIAN and beta = 0.3 yields GMSK as used in GSM.
+ *
+ * The input of this block are symbols from an M-ary alphabet
+ * +/-1, +/-3, ..., +/-(M-1). Usually, M = 2 and therefore, the
+ * valid inputs are +/-1.
+ * The modulator will silently accept any other inputs, though.
+ * The output is the phase-modulated signal.
+ */
+class gr_cpmmod_bc : public gr_hier_block2
+{
+ friend gr_cpmmod_bc_sptr gr_make_cpmmod_bc(int type, float h, unsigned samples_per_sym, unsigned L, double beta);
+
+ std::vector<float> d_taps;
+ gr_char_to_float_sptr d_char_to_float;
+ gr_interp_fir_filter_fff_sptr d_pulse_shaper;
+ gr_frequency_modulator_fc_sptr d_fm;
+
+ protected:
+ gr_cpmmod_bc(gr_cpm::cpm_type type, float h, unsigned samples_per_sym, unsigned L, double beta);
+
+ public:
+ //! Return the phase response FIR taps
+ std::vector<float> get_taps() { return d_taps; };
+};
+
+#endif /* INCLUDED_GR_CPMMOD_BC_H */
+
diff --git a/gnuradio-core/src/lib/hier/gr_cpmmod_bc.i b/gnuradio-core/src/lib/hier/gr_cpmmod_bc.i
new file mode 100644
index 000000000..55116cda7
--- /dev/null
+++ b/gnuradio-core/src/lib/hier/gr_cpmmod_bc.i
@@ -0,0 +1,36 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2010 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+GR_SWIG_BLOCK_MAGIC(gr, cpmmod_bc)
+
+gr_cpmmod_bc_sptr
+gr_make_cpmmod_bc(int type, float h, unsigned samples_per_sym, unsigned L, double beta=0.3);
+
+class gr_cpmmod_bc : public gr_hier_block2
+{
+ private:
+ gr_cpmmod_bc(int type, float h, unsigned samples_per_sym, unsigned L, double beta);
+
+ public:
+ std::vector<float> get_taps();
+};
+
diff --git a/gnuradio-core/src/lib/hier/gr_gmskmod_bc.cc b/gnuradio-core/src/lib/hier/gr_gmskmod_bc.cc
new file mode 100644
index 000000000..37128d99c
--- /dev/null
+++ b/gnuradio-core/src/lib/hier/gr_gmskmod_bc.cc
@@ -0,0 +1,41 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2010 Free Software Foundation, Inc.
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <gr_gmskmod_bc.h>
+#include <gr_io_signature.h>
+
+
+// Shared pointer constructor
+gr_gmskmod_bc_sptr
+gr_make_gmskmod_bc(unsigned samples_per_sym, double bt, unsigned L)
+{
+ return gnuradio::get_initial_sptr(new gr_gmskmod_bc(samples_per_sym, bt, L));
+}
+
+
+gr_gmskmod_bc::gr_gmskmod_bc(unsigned samples_per_sym, double bt, unsigned L)
+ : gr_cpmmod_bc(gr_cpm::GAUSSIAN, 0.5, samples_per_sym, L, bt)
+{
+}
+
diff --git a/gnuradio-core/src/lib/hier/gr_gmskmod_bc.h b/gnuradio-core/src/lib/hier/gr_gmskmod_bc.h
new file mode 100644
index 000000000..39bd576e2
--- /dev/null
+++ b/gnuradio-core/src/lib/hier/gr_gmskmod_bc.h
@@ -0,0 +1,59 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2010 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef INCLUDED_GR_GMSKMOD_BC_H
+#define INCLUDED_GR_GMSKMOD_BC_H
+
+#include <gr_cpmmod_bc.h>
+
+class gr_gmskmod_bc;
+typedef boost::shared_ptr<gr_gmskmod_bc> gr_gmskmod_bc_sptr;
+
+
+gr_gmskmod_bc_sptr
+gr_make_gmskmod_bc(unsigned samples_per_sym=2, double bt=0.3, unsigned L=4);
+
+
+/*!
+ * \brief GMSK modulator
+ *
+ * \ingroup modulation_blk
+ *
+ * \param samples_per_sym Samples per symbol.
+ * \param bt The 3 dB time-bandwidth product.
+ * \param L The length of the phase duration in symbols. The Gaussian pulse is truncated
+ * after L symbols.
+ *
+ * The input of this block are symbols from an M-ary alphabet
+ * +/-1, +/-3, ..., +/-(M-1). Usually, M = 2 and therefore, the
+ * valid inputs are +/-1.
+ * The modulator will silently accept any other inputs, though.
+ * The output is the phase-modulated signal.
+ */
+class gr_gmskmod_bc : public gr_cpmmod_bc
+{
+ friend gr_gmskmod_bc_sptr gr_make_gmskmod_bc(unsigned samples_per_sym, double bt, unsigned L);
+ gr_gmskmod_bc(unsigned samples_per_sym, double bt, unsigned L);
+};
+
+#endif /* INCLUDED_GR_GMSKMOD_BC_H */
+
diff --git a/gnuradio-core/src/lib/hier/gr_gmskmod_bc.i b/gnuradio-core/src/lib/hier/gr_gmskmod_bc.i
new file mode 100644
index 000000000..dadf3be62
--- /dev/null
+++ b/gnuradio-core/src/lib/hier/gr_gmskmod_bc.i
@@ -0,0 +1,36 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2010 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+GR_SWIG_BLOCK_MAGIC(gr, gmskmod_bc)
+
+gr_gmskmod_bc_sptr
+gr_make_gmskmod_bc(unsigned samples_per_sym=2, double bt=0.3, unsigned L=4);
+
+class gr_gmskmod_bc : public gr_hier_block2
+{
+ private:
+ gr_cpmmod_bc(int type, float h, unsigned samples_per_sym, double beta, unsigned L);
+
+ public:
+ std::vector<float> get_taps();
+};
+
diff --git a/gnuradio-core/src/lib/hier/hier.i b/gnuradio-core/src/lib/hier/hier.i
index dbcc8e915..b8915e15b 100644
--- a/gnuradio-core/src/lib/hier/hier.i
+++ b/gnuradio-core/src/lib/hier/hier.i
@@ -26,6 +26,11 @@
#endif
#include <gr_channel_model.h>
+#include <gr_cpmmod_bc.h>
+#include <gr_gmskmod_bc.h>
%}
%include "gr_channel_model.i"
+%include "gr_cpmmod_bc.i"
+%include "gr_gmskmod_bc.i"
+
diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_cpm.py b/gnuradio-core/src/python/gnuradio/gr/qa_cpm.py
new file mode 100755
index 000000000..776173466
--- /dev/null
+++ b/gnuradio-core/src/python/gnuradio/gr/qa_cpm.py
@@ -0,0 +1,90 @@
+#!/usr/bin/env python
+#
+# Copyright 2010 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+from gnuradio import gr, gr_unittest
+import numpy
+
+class test_cpm(gr_unittest.TestCase):
+
+ def setUp (self):
+ self.tb = gr.top_block ()
+
+ def tearDown (self):
+ self.tb = None
+
+ def do_check_phase_shift(self, type, name):
+ sps = 2
+ L = 1
+ in_bits = (1,) * 20
+ src = gr.vector_source_b(in_bits, False)
+ cpm = gr.cpmmod_bc(type, 0.5, sps, L)
+ arg = gr.complex_to_arg()
+ sink = gr.vector_sink_f()
+
+ self.tb.connect(src, cpm, arg, sink)
+ self.tb.run()
+
+ symbol_phases = numpy.array(sink.data()[sps*L-1::sps])
+ phase_diff = numpy.mod(numpy.subtract(symbol_phases[1:], symbol_phases[:-1]),
+ (2*numpy.pi,) * (len(symbol_phases)-1))
+ self.assertFloatTuplesAlmostEqual(tuple(phase_diff), (0.5 * numpy.pi,) * len(phase_diff), 5,
+ msg="Phase shift was not correct for CPM method " + name)
+
+ def test_001_lrec(self):
+ self.do_check_phase_shift(gr.cpm.LRC, 'LREC')
+
+ def test_001_lrc(self):
+ self.do_check_phase_shift(gr.cpm.LRC, 'LRC')
+
+ def test_001_lsrc(self):
+ self.do_check_phase_shift(gr.cpm.LSRC, 'LSRC')
+
+ def test_001_ltfm(self):
+ self.do_check_phase_shift(gr.cpm.TFM, 'TFM')
+
+ def test_001_lgmsk(self):
+ sps = 2
+ L = 5
+ bt = 0.3
+ in_bits = (1,) * 20
+ src = gr.vector_source_b(in_bits, False)
+ gmsk = gr.gmskmod_bc(sps, bt, L)
+ arg = gr.complex_to_arg()
+ sink = gr.vector_sink_f()
+
+ self.tb.connect(src, gmsk, arg, sink)
+ self.tb.run()
+
+ symbol_phases = numpy.array(sink.data()[sps*L-1::sps])
+ phase_diff = numpy.mod(numpy.subtract(symbol_phases[1:], symbol_phases[:-1]),
+ (2*numpy.pi,) * (len(symbol_phases)-1))
+ self.assertFloatTuplesAlmostEqual(tuple(phase_diff), (0.5 * numpy.pi,) * len(phase_diff), 5,
+ msg="Phase shift was not correct for GMSK")
+
+ def test_phase_response(self):
+ phase_response = gr.cpm.phase_response(gr.cpm.LREC, 2, 4)
+ self.assertAlmostEqual(numpy.sum(phase_response), 1)
+
+
+if __name__ == '__main__':
+ gr_unittest.run(test_cpm, "test_cpm.xml")
+
diff --git a/grc/blocks/Makefile.am b/grc/blocks/Makefile.am
index 14ffe8358..0360ebc80 100644
--- a/grc/blocks/Makefile.am
+++ b/grc/blocks/Makefile.am
@@ -91,6 +91,7 @@ dist_ourdata_DATA = \
gr_costas_loop_cc.xml \
gr_cpfsk_bc.xml \
gr_dc_blocker.xml \
+ gr_cpmmod_bc.xml \
gr_decode_ccsds_27_fb.xml \
gr_deinterleave.xml \
gr_delay.xml \
@@ -117,6 +118,7 @@ dist_ourdata_DATA = \
gr_freq_xlating_fir_filter_xxx.xml \
gr_frequency_modulator_fc.xml \
gr_glfsr_source_x.xml \
+ gr_gmskmod_bc.xml \
gr_goertzel_fc.xml \
gr_head.xml \
gr_hilbert_fc.xml \
diff --git a/grc/blocks/block_tree.xml b/grc/blocks/block_tree.xml
index 0b641d79c..3dc247aec 100644
--- a/grc/blocks/block_tree.xml
+++ b/grc/blocks/block_tree.xml
@@ -197,6 +197,8 @@
<block>gr_phase_modulator_fc</block>
<block>gr_quadrature_demod_cf</block>
<block>gr_cpfsk_bc</block>
+ <block>gr_cpmmod_bc</block>
+ <block>gr_gmskmod_bc</block>
<block>gr_diff_phasor_cc</block>
<block>gr_constellation_decoder_cb</block>
diff --git a/grc/blocks/gr_cpmmod_bc.xml b/grc/blocks/gr_cpmmod_bc.xml
new file mode 100644
index 000000000..da405534e
--- /dev/null
+++ b/grc/blocks/gr_cpmmod_bc.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0"?>
+<!--
+###################################################
+## Continuous Phase Modulation
+###################################################
+ -->
+<block>
+ <name>Continuous Phase Modulation</name>
+ <key>gr_cpmmod_bc</key>
+ <import>from gnuradio import gr</import>
+ <make>gr.cpmmod_bc($type, $mod_index, $samples_per_symbol, $L, $beta)</make>
+ <param>
+ <name>CPM Type</name>
+ <key>type</key>
+ <type>enum</type>
+ <option>
+ <name>L-REC (Rectangular phase response)</name>
+ <key>gr.cpm.LREC</key>
+ </option>
+ <option>
+ <name>L-RC (Raised Cosine)</name>
+ <key>gr.cpm.LRC</key>
+ </option>
+ <option>
+ <name>L-SRC (Spectral raised cosine)</name>
+ <key>gr.cpm.LSRC</key>
+ </option>
+ <option>
+ <name>TFM (Tamed frequency modulation)</name>
+ <key>gr.cpm.TFM</key>
+ </option>
+ <option>
+ <name>Gaussian</name>
+ <key>gr.cpm.GAUSSIAN</key>
+ </option>
+ </param>
+ <param>
+ <name>Modulation Index</name>
+ <key>mod_index</key>
+ <value>0.5</value>
+ <type>real</type>
+ </param>
+ <param>
+ <name>Samples/Symbol</name>
+ <key>samples_per_symbol</key>
+ <value>4</value>
+ <type>int</type>
+ </param>
+ <param>
+ <name>Pulse Duration (Symbols)</name>
+ <key>L</key>
+ <value>4</value>
+ <type>int</type>
+ </param>
+ <param>
+ <name>Phase Response Parameter (BT or Beta)</name>
+ <key>beta</key>
+ <value>0.3</value>
+ <type>real</type>
+ </param>
+ <sink>
+ <name>in</name>
+ <type>byte</type>
+ </sink>
+ <source>
+ <name>out</name>
+ <type>complex</type>
+ </source>
+</block>
diff --git a/grc/blocks/gr_gmskmod_bc.xml b/grc/blocks/gr_gmskmod_bc.xml
new file mode 100644
index 000000000..82e47452b
--- /dev/null
+++ b/grc/blocks/gr_gmskmod_bc.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<!--
+###################################################
+## GMSK
+###################################################
+ -->
+<block>
+ <name>GMSK Modulator</name>
+ <key>gr_gmskmod_bc</key>
+ <import>from gnuradio import gr</import>
+ <make>gr.gmskmod_bc($samples_per_symbol, $bt, $L)</make>
+ <param>
+ <name>Samples/Symbol</name>
+ <key>samples_per_symbol</key>
+ <value>2</value>
+ <type>int</type>
+ </param>
+ <param>
+ <name>3 dB Time-Bandwith Product</name>
+ <key>bt</key>
+ <value>0.3</value>
+ <type>real</type>
+ </param>
+ <param>
+ <name>Pulse Duration (Symbols)</name>
+ <key>L</key>
+ <value>4</value>
+ <type>int</type>
+ </param>
+ <sink>
+ <name>in</name>
+ <type>byte</type>
+ </sink>
+ <source>
+ <name>out</name>
+ <type>complex</type>
+ </source>
+</block>