summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnathan Corgan2012-04-07 11:32:37 -0700
committerJohnathan Corgan2012-04-07 11:32:37 -0700
commit53795b5ec67cd0b36374463231bb9226d91cecce (patch)
tree798b6788ffc3b654513bacec3cb21afc7d2054c1
parent5a55ae7098d58e5a1fc56b65110d9086d70c7124 (diff)
downloadgnuradio-53795b5ec67cd0b36374463231bb9226d91cecce.tar.gz
gnuradio-53795b5ec67cd0b36374463231bb9226d91cecce.tar.bz2
gnuradio-53795b5ec67cd0b36374463231bb9226d91cecce.zip
core: use while instead of if in frequency_modulator
* It is possible to wrap multiple times in a single update if the sensitivity parameter is high enough.
-rw-r--r--gnuradio-core/src/lib/general/gr_frequency_modulator_fc.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.cc b/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.cc
index 553b50398..34f2f88bc 100644
--- a/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.cc
+++ b/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.cc
@@ -55,9 +55,9 @@ gr_frequency_modulator_fc::work (int noutput_items,
for (int i = 0; i < noutput_items; i++){
d_phase = d_phase + d_sensitivity * in[i];
- if (d_phase > (float)(M_PI))
+ while (d_phase > (float)(M_PI))
d_phase -= (float)(2.0 * M_PI);
- else if (d_phase < (float)(-M_PI))
+ while (d_phase < (float)(-M_PI))
d_phase += (float)(2.0 * M_PI);
float oi, oq;