From 53795b5ec67cd0b36374463231bb9226d91cecce Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Sat, 7 Apr 2012 11:32:37 -0700 Subject: 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. --- gnuradio-core/src/lib/general/gr_frequency_modulator_fc.cc | 4 ++-- 1 file 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; -- cgit