summaryrefslogtreecommitdiff
path: root/gr-analog/lib/cpfsk_bc_impl.cc
diff options
context:
space:
mode:
authorMarcus Müller <marcus@hostalia.de>2018-03-22 22:29:21 +0100
committerMarcus Müller <marcus@hostalia.de>2018-03-22 22:32:12 +0100
commitd3aba0022c3317bc8856f05612cafcdca4b4d667 (patch)
tree9dd5ddbf8db2f357754a73b4eed4d0cc8924360a /gr-analog/lib/cpfsk_bc_impl.cc
parent9ae5d4cd3da84ce7e5a0c2abe7fec1ff8d229ae8 (diff)
parent886ce0f13b4135c1206c26786e06a524e92fc271 (diff)
Merge branch 'fix_cmake_cxx_standard' of https://github.com/noc0lour/gnuradio into noc0lour-fix_cmake_cxx_standard
Diffstat (limited to 'gr-analog/lib/cpfsk_bc_impl.cc')
-rw-r--r--gr-analog/lib/cpfsk_bc_impl.cc15
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;
}