summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gr-blocks/grc/blocks_plateau_detector_fb.xml1
-rw-r--r--gr-blocks/include/gnuradio/blocks/plateau_detector_fb.h3
-rw-r--r--gr-blocks/lib/plateau_detector_fb_impl.cc10
-rw-r--r--gr-blocks/lib/plateau_detector_fb_impl.h3
4 files changed, 17 insertions, 0 deletions
diff --git a/gr-blocks/grc/blocks_plateau_detector_fb.xml b/gr-blocks/grc/blocks_plateau_detector_fb.xml
index 90f67a4cf5..77d0183af5 100644
--- a/gr-blocks/grc/blocks_plateau_detector_fb.xml
+++ b/gr-blocks/grc/blocks_plateau_detector_fb.xml
@@ -4,6 +4,7 @@
<key>blocks_plateau_detector_fb</key>
<import>from gnuradio import blocks</import>
<make>blocks.plateau_detector_fb($max_len, $threshold)</make>
+ <callback>set_threshold($threshold)</callback>
<param>
<name>Max. plateau length</name>
<key>max_len</key>
diff --git a/gr-blocks/include/gnuradio/blocks/plateau_detector_fb.h b/gr-blocks/include/gnuradio/blocks/plateau_detector_fb.h
index cb43625c1f..9a9d7c8a16 100644
--- a/gr-blocks/include/gnuradio/blocks/plateau_detector_fb.h
+++ b/gr-blocks/include/gnuradio/blocks/plateau_detector_fb.h
@@ -61,6 +61,9 @@ namespace gr {
* \param threshold Anything above this value is considered a plateau
*/
static sptr make(int max_len, float threshold=0.9);
+
+ virtual void set_threshold(float threshold) = 0;
+ virtual float threshold() const = 0;
};
} // namespace blocks
diff --git a/gr-blocks/lib/plateau_detector_fb_impl.cc b/gr-blocks/lib/plateau_detector_fb_impl.cc
index 14d52b392c..f074f30131 100644
--- a/gr-blocks/lib/plateau_detector_fb_impl.cc
+++ b/gr-blocks/lib/plateau_detector_fb_impl.cc
@@ -86,6 +86,16 @@ namespace gr {
return i;
}
+ void plateau_detector_fb_impl::set_threshold(float threshold)
+ {
+ d_threshold = threshold;
+ }
+
+ float plateau_detector_fb_impl::threshold() const
+ {
+ return d_threshold;
+ }
+
} /* namespace blocks */
} /* namespace gr */
diff --git a/gr-blocks/lib/plateau_detector_fb_impl.h b/gr-blocks/lib/plateau_detector_fb_impl.h
index 906891d62b..1a99745104 100644
--- a/gr-blocks/lib/plateau_detector_fb_impl.h
+++ b/gr-blocks/lib/plateau_detector_fb_impl.h
@@ -44,6 +44,9 @@ class plateau_detector_fb_impl : public plateau_detector_fb
gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items);
+
+ virtual void set_threshold(float threshold);
+ virtual float threshold() const;
};
} // namespace blocks