diff options
author | Johnathan Corgan <johnathan@corganlabs.com> | 2013-09-26 13:53:44 -0700 |
---|---|---|
committer | Johnathan Corgan <johnathan@corganlabs.com> | 2013-09-26 13:53:44 -0700 |
commit | 1aa07b3640ccf43a7ccdc8d610449f51c0f38b91 (patch) | |
tree | 701a76ab2a6547f22a49fe378c3cb578372877ea | |
parent | 9b7bfd4740bd4b75da4585f6424f692632fc20d8 (diff) | |
parent | dc13f9cd41b1f0cf84f51c007e25c8c64969954f (diff) |
Merge remote-tracking branch 'ncorgan/analog_fix_20130926'
-rw-r--r-- | gr-analog/lib/agc3_cc_impl.cc | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/gr-analog/lib/agc3_cc_impl.cc b/gr-analog/lib/agc3_cc_impl.cc index d9fb846a8b..86e2212927 100644 --- a/gr-analog/lib/agc3_cc_impl.cc +++ b/gr-analog/lib/agc3_cc_impl.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006,2010,2012 Free Software Foundation, Inc. + * Copyright 2006,2010,2012,2013 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -24,6 +24,7 @@ #include "config.h" #endif +#include <float.h> #include <vector> #include "agc3_cc_impl.h" @@ -102,8 +103,13 @@ namespace gr { } else { // Otherwise perform a normal iir update +#ifdef _MSC_VER + std::vector<float> mag_sq(noutput_items/d_iir_update_decim); + std::vector<float> inv_mag(noutput_items/d_iir_update_decim); +#else float mag_sq[noutput_items/d_iir_update_decim] __attribute__ ((aligned (16))); float inv_mag[noutput_items/d_iir_update_decim] __attribute__ ((aligned (16))); +#endif // generate squared magnitudes at decimated rate (gather operation) for(int i=0; i<noutput_items/d_iir_update_decim; i++){ @@ -112,12 +118,16 @@ namespace gr { } // compute inverse square roots - volk_32f_invsqrt_32f_a(inv_mag, mag_sq, noutput_items/d_iir_update_decim); + volk_32f_invsqrt_32f_a(&inv_mag[0], &mag_sq[0], noutput_items/d_iir_update_decim); // apply updates for(int i=0; i<noutput_items/d_iir_update_decim; i++){ float magi = inv_mag[i]; +#ifdef _MSC_VER + if(!_finite(magi)){ +#else if(std::isfinite(magi)){ +#endif float rate = (magi > d_gain/d_reference)?d_decay:d_attack; d_gain = d_gain*(1-rate) + d_reference*magi*rate; } else { |