commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 03/08: blocks: peak detector fix initial va


From: git
Subject: [Commit-gnuradio] [gnuradio] 03/08: blocks: peak detector fix initial value
Date: Mon, 30 Jan 2017 13:38:40 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch maint
in repository gnuradio.

commit 9d9ea63c45b5f314eb344a69340ef49e8edafdfa
Author: Bastian Bloessl <address@hidden>
Date:   Sun Jan 29 12:24:05 2017 +0100

    blocks: peak detector fix initial value
---
 gr-blocks/lib/peak_detector2_fb_impl.cc  | 3 ++-
 gr-blocks/lib/peak_detector_XX_impl.cc.t | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/gr-blocks/lib/peak_detector2_fb_impl.cc 
b/gr-blocks/lib/peak_detector2_fb_impl.cc
index dc13e66..f361ea1 100644
--- a/gr-blocks/lib/peak_detector2_fb_impl.cc
+++ b/gr-blocks/lib/peak_detector2_fb_impl.cc
@@ -27,6 +27,7 @@
 #include "peak_detector2_fb_impl.h"
 #include <gnuradio/io_signature.h>
 #include <string.h>
+#include <limits>
 
 namespace gr {
   namespace blocks {
@@ -109,7 +110,7 @@ namespace gr {
             sigout[i]=d_avg;
           if(iptr[i] > d_avg * (1.0f + d_threshold_factor_rise)) {
             d_found = true;
-            d_peak_val = -(float)INFINITY;
+            d_peak_val = std::numeric_limits<float>::min();
             set_output_multiple(d_look_ahead);
             return i;
           }
diff --git a/gr-blocks/lib/peak_detector_XX_impl.cc.t 
b/gr-blocks/lib/peak_detector_XX_impl.cc.t
index 6846a02..3ad5f3c 100644
--- a/gr-blocks/lib/peak_detector_XX_impl.cc.t
+++ b/gr-blocks/lib/peak_detector_XX_impl.cc.t
@@ -29,6 +29,7 @@
 #include "@address@hidden"
 #include <gnuradio/io_signature.h>
 #include <string.h>
+#include <limits>
 
 namespace gr {
   namespace blocks {
@@ -70,7 +71,7 @@ namespace gr {
 
       memset(optr, 0, noutput_items*sizeof(char));
 
-      @I_TYPE@ peak_val = -(@I_TYPE@)INFINITY;
+      @I_TYPE@ peak_val = std::numeric_limits<@I_TYPE@>::min();
       int peak_ind = 0;
       unsigned char state = 0;
       int i = 0;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]