summaryrefslogtreecommitdiff
path: root/gr-blocks/include
diff options
context:
space:
mode:
authorTim O'Shea <tim.oshea753@gmail.com>2013-03-01 09:14:44 -0500
committerTom Rondeau <trondeau@vt.edu>2013-03-13 15:20:39 -0400
commit3cf9ea682c7286ef25df1346bc9c9528a74c3469 (patch)
tree11d5cf563d258fe3345d3de0f64363286cacb056 /gr-blocks/include
parente247d2c1f5e6023b4094465f740d1c48332ae672 (diff)
blocks: adding probe_rate block
Conflicts: gr-blocks/include/blocks/CMakeLists.txt gr-blocks/lib/CMakeLists.txt gr-blocks/swig/blocks_swig.i
Diffstat (limited to 'gr-blocks/include')
-rw-r--r--gr-blocks/include/blocks/CMakeLists.txt4
-rw-r--r--gr-blocks/include/blocks/probe_rate.h60
2 files changed, 61 insertions, 3 deletions
diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt
index 111feef4f1..c7b3cb918e 100644
--- a/gr-blocks/include/blocks/CMakeLists.txt
+++ b/gr-blocks/include/blocks/CMakeLists.txt
@@ -124,9 +124,6 @@ install(FILES
conjugate_cc.h
deinterleave.h
delay.h
- file_descriptor_sink.h
- file_descriptor_source.h
- file_sink.h
file_source.h
file_meta_sink.h
file_meta_source.h
@@ -156,6 +153,7 @@ install(FILES
pdu.h
pdu_to_tagged_stream.h
peak_detector2_fb.h
+ probe_rate.h
regenerate_bb.h
repeat.h
rms_cf.h
diff --git a/gr-blocks/include/blocks/probe_rate.h b/gr-blocks/include/blocks/probe_rate.h
new file mode 100644
index 0000000000..e08a9dce06
--- /dev/null
+++ b/gr-blocks/include/blocks/probe_rate.h
@@ -0,0 +1,60 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2005,2013 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef INCLUDED_BLOCKS_PROBE_RATE_H
+#define INCLUDED_BLOCKS_PROBE_RATE_H
+
+#include <blocks/api.h>
+#include <gr_sync_block.h>
+
+namespace gr {
+ namespace blocks {
+
+ /*!
+ * \brief throughput measurement
+ */
+ class BLOCKS_API probe_rate : virtual public gr_sync_block
+ {
+ public:
+ // gr::blocks::probe_rate::sptr
+ typedef boost::shared_ptr<probe_rate> sptr;
+
+ /*!
+ * \brief Make a throughput measurement block
+ * \param itemsize size of each stream item
+ * \param update_rate_sec minimum update time in seconds
+ * \param alpha gain for running average filter
+ */
+ static sptr make(size_t itemsize, double update_rate_ms = 500.0, double alpha = 0.0001);
+
+ virtual void set_alpha(double alpha) = 0;
+
+ virtual double rate() = 0;
+
+ virtual bool start() = 0;
+ virtual bool stop() = 0;
+ };
+
+ } /* namespace blocks */
+} /* namespace gr */
+
+#endif /* INCLUDED_BLOCKS_PROBE_RATE_H */