diff options
author | Johnathan Corgan <johnathan@corganlabs.com> | 2013-06-15 16:37:31 -0700 |
---|---|---|
committer | Johnathan Corgan <johnathan@corganlabs.com> | 2013-06-15 16:37:31 -0700 |
commit | d37108be86951a60472e8aae5bd35f8c127b6871 (patch) | |
tree | c3f9d16100b076a47e978f7f9266df98e8b23646 | |
parent | f2f6bb223fa04c27291a2d4ea6c880e0abd973c3 (diff) | |
parent | 6dcf96dfb0c398d86b983c9062cecef71f0d80ca (diff) |
Merge remote-tracking branch 'ncorgan/agc3_cc_impl_fix'
-rw-r--r-- | gr-analog/lib/agc3_cc_impl.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gr-analog/lib/agc3_cc_impl.cc b/gr-analog/lib/agc3_cc_impl.cc index a6a85caf10..6ba6814ad1 100644 --- a/gr-analog/lib/agc3_cc_impl.cc +++ b/gr-analog/lib/agc3_cc_impl.cc @@ -24,6 +24,8 @@ #include "config.h" #endif +#include <vector> + #include "agc3_cc_impl.h" #include <gnuradio/io_signature.h> #include <volk/volk.h> @@ -68,12 +70,15 @@ namespace gr { // Compute magnitude of each sample #ifdef __GNUC__ float mags[noutput_items] __attribute__ ((aligned (16))); + volk_32fc_magnitude_32f(mags, &in[0], noutput_items); + // Compute a linear average on reset (no expected) + if(__builtin_expect(d_reset, false)) { #else - float mags[noutput_items]; + std::vector<float> mags(noutput_items); + volk_32fc_magnitude_32f(&mags[0], &in[0], noutput_items); + // Compute a linear average on reset (no expected) + if(!d_reset) { #endif - volk_32fc_magnitude_32f(mags, &in[0], noutput_items); - // Compute a linear average on reset (no expected) - if(__builtin_expect(d_reset, false)) { float mag; for(int i=0; i<noutput_items; i++) { mag += mags[i]; |