summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnathan Corgan <johnathan@corganlabs.com>2015-07-12 09:20:53 -0700
committerJohnathan Corgan <johnathan@corganlabs.com>2015-07-12 09:20:53 -0700
commit55d8f482f5acf33b8f629556a4fa5019908bb4be (patch)
treea8322bbb110fa015bfecf9d3c0ef9e8a54e27e27
parentfdb2f66d7ba100f62ed9629e6bb5179ebda486c6 (diff)
parent9ae9a10cadec5c1ea7c03677cc685b3a92591967 (diff)
Merge remote-tracking branch 'mmueller/freq_mod_remove_iterative_fmod'
-rw-r--r--gr-analog/lib/frequency_modulator_fc_impl.cc10
1 files changed, 4 insertions, 6 deletions
diff --git a/gr-analog/lib/frequency_modulator_fc_impl.cc b/gr-analog/lib/frequency_modulator_fc_impl.cc
index 1158167756..812eb8bf0b 100644
--- a/gr-analog/lib/frequency_modulator_fc_impl.cc
+++ b/gr-analog/lib/frequency_modulator_fc_impl.cc
@@ -27,8 +27,7 @@
#include "frequency_modulator_fc_impl.h"
#include <gnuradio/io_signature.h>
#include <gnuradio/fxpt.h>
-#include <math.h>
-#include <boost/math/special_functions/trunc.hpp>
+#include <cmath>
namespace gr {
namespace analog {
@@ -63,10 +62,9 @@ namespace gr {
for(int i = 0; i < noutput_items; i++) {
d_phase = d_phase + d_sensitivity * in[i];
- while(d_phase > (float)(M_PI))
- d_phase -= (float)(2.0 * M_PI);
- while(d_phase < (float)(-M_PI))
- d_phase += (float)(2.0 * M_PI);
+ //place phase in [-pi, +pi[
+ #define F_PI ((float)(M_PI))
+ d_phase = std::fmod(d_phase + F_PI, 2.0f * F_PI) - F_PI;
float oi, oq;