diff options
author | Callyan <sufodex@gmail.com> | 2020-04-13 10:58:34 +0200 |
---|---|---|
committer | Martin Braun <martin@gnuradio.org> | 2021-01-11 08:57:22 -0800 |
commit | 97c6fe790c8f93490775357f4595a41b404e9ba8 (patch) | |
tree | 4ae30f3bf6422e6fc11ada933bd69ab191bb9011 /gr-blocks/lib | |
parent | 7645f83ee1a57999e9cedc436ab5e5e397ce20db (diff) |
peak_detector2: bug fix and add a test case
Diffstat (limited to 'gr-blocks/lib')
-rw-r--r-- | gr-blocks/lib/peak_detector2_fb_impl.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gr-blocks/lib/peak_detector2_fb_impl.cc b/gr-blocks/lib/peak_detector2_fb_impl.cc index 3d2b68b520..b95fdd381c 100644 --- a/gr-blocks/lib/peak_detector2_fb_impl.cc +++ b/gr-blocks/lib/peak_detector2_fb_impl.cc @@ -88,7 +88,8 @@ int peak_detector2_fb_impl::work(int noutput_items, sigout[i] = d_avg; if (iptr[i] > d_avg * (1.0f + d_threshold_factor_rise)) { d_found = true; - d_peak_val = std::numeric_limits<float>::min(); + d_peak_val = iptr[i]; + d_peak_ind = i; set_output_multiple(d_look_ahead); return i + 1; } |