diff options
author | Tom Rondeau <tom@trondeau.com> | 2015-04-08 12:20:08 -0400 |
---|---|---|
committer | Tom Rondeau <tom@trondeau.com> | 2015-04-08 12:20:08 -0400 |
commit | 86759e94bb1cc7d3ff071e398e972ec1a6ceed70 (patch) | |
tree | 0608ac4b0ea1eed2afa1bc09c409abafd20d7324 /gr-blocks/lib/peak_detector2_fb_impl.cc | |
parent | d4b38e890c5ba3422160ba1ca5db3f55762eeb34 (diff) |
blocks: fixed problem with setting peak detector's alpha value.
This changes the public interface from an int to a float. But the
alpha must be between 0 and 1 for it to make any sense, so if this is
being used, it's never producing the right answer. Also, it's likely
that this change will be transparent to anyone who is trying to set
it.
Diffstat (limited to 'gr-blocks/lib/peak_detector2_fb_impl.cc')
-rw-r--r-- | gr-blocks/lib/peak_detector2_fb_impl.cc | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/gr-blocks/lib/peak_detector2_fb_impl.cc b/gr-blocks/lib/peak_detector2_fb_impl.cc index dd1b677222..7ff7f542ec 100644 --- a/gr-blocks/lib/peak_detector2_fb_impl.cc +++ b/gr-blocks/lib/peak_detector2_fb_impl.cc @@ -43,8 +43,8 @@ namespace gr { peak_detector2_fb_impl::peak_detector2_fb_impl(float threshold_factor_rise, int look_ahead, float alpha) : sync_block("peak_detector2_fb", - io_signature::make(1, 1, sizeof(float)), - io_signature::make2(1, 2, sizeof(char), sizeof(float))), + io_signature::make(1, 1, sizeof(float)), + io_signature::make2(1, 2, sizeof(char), sizeof(float))), d_threshold_factor_rise(threshold_factor_rise), d_look_ahead(look_ahead), d_alpha(alpha), d_avg(0.0f), d_found(false) { @@ -62,8 +62,6 @@ namespace gr { float *iptr = (float *)input_items[0]; char *optr = (char *)output_items[0]; - assert(noutput_items >= 2); - memset(optr, 0, noutput_items*sizeof(char)); for(int i = 0; i < noutput_items; i++) { @@ -114,5 +112,3 @@ namespace gr { } /* namespace blocks */ } /* namespace gr */ - - |