diff options
author | Marcus Müller <marcus@hostalia.de> | 2018-08-31 23:02:22 +0200 |
---|---|---|
committer | Marcus Müller <marcus@hostalia.de> | 2018-08-31 23:02:22 +0200 |
commit | 254fe5e89403d4de1fa6663d09efdf946996aff3 (patch) | |
tree | 62877d7ac7fdedf6c397c51e22ac6f97eba97ddf /gr-analog/lib/cpfsk_bc_impl.cc | |
parent | 896d1c9da31963ecf5b0d90942c2af51ca998a69 (diff) | |
parent | 5ad935c3a3dd46ce2860b13e2b774e4841784616 (diff) |
Merge remote-tracking branch 'origin/next' into merge_next
Diffstat (limited to 'gr-analog/lib/cpfsk_bc_impl.cc')
-rw-r--r-- | gr-analog/lib/cpfsk_bc_impl.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/gr-analog/lib/cpfsk_bc_impl.cc b/gr-analog/lib/cpfsk_bc_impl.cc index 3c1674aaa4..01b3ae3ebd 100644 --- a/gr-analog/lib/cpfsk_bc_impl.cc +++ b/gr-analog/lib/cpfsk_bc_impl.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008,2010,2012 Free Software Foundation, Inc. + * Copyright 2008,2010,2012,2018 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 @@ -25,12 +25,11 @@ #include "cpfsk_bc_impl.h" #include <gnuradio/io_signature.h> #include <gnuradio/expj.h> +#include <gnuradio/math.h> namespace gr { namespace analog { -#define M_TWOPI (2*M_PI) - cpfsk_bc::sptr cpfsk_bc::make(float k, float ampl, int samples_per_sym) { @@ -45,7 +44,7 @@ namespace gr { samples_per_sym) { d_samples_per_sym = samples_per_sym; - d_freq = k*M_PI/samples_per_sym; + d_freq = k*GR_M_PI/samples_per_sym; d_ampl = ampl; d_phase = 0.0; } @@ -69,10 +68,10 @@ namespace gr { else d_phase -= d_freq; - while(d_phase > M_TWOPI) - d_phase -= M_TWOPI; - while(d_phase < -M_TWOPI) - d_phase += M_TWOPI; + while(d_phase > GR_M_TWOPI) + d_phase -= GR_M_TWOPI; + while(d_phase < -GR_M_TWOPI) + d_phase += GR_M_TWOPI; *out++ = gr_expj(d_phase)*d_ampl; } |