GNU Radio 3.7.1 C++ API
|
00001 /* -*- c++ -*- */ 00002 /* 00003 * Copyright 2008,2012 Free Software Foundation, Inc. 00004 * 00005 * GNU Radio is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation; either version 3, or (at your option) 00008 * any later version. 00009 * 00010 * GNU Radio is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with GNU Radio; see the file COPYING. If not, write to 00017 * the Free Software Foundation, Inc., 51 Franklin Street, 00018 * Boston, MA 02110-1301, USA. 00019 */ 00020 00021 #ifndef INCLUDED_GR_PROBE_DENSITY_B_H 00022 #define INCLUDED_GR_PROBE_DENSITY_B_H 00023 00024 #include <gnuradio/digital/api.h> 00025 #include <gnuradio/sync_block.h> 00026 00027 namespace gr { 00028 namespace digital { 00029 00030 /*! 00031 * \ingroup measurement_tools_blk 00032 * 00033 * This block maintains a running average of the input stream and 00034 * makes it available as an accessor function. The input stream is 00035 * type unsigned char. 00036 * 00037 * If you send this block a stream of unpacked bytes, it will tell 00038 * you what the bit density is. 00039 */ 00040 class DIGITAL_API probe_density_b : virtual public sync_block 00041 { 00042 public: 00043 // gr::digital::probe_density_b::sptr 00044 typedef boost::shared_ptr<probe_density_b> sptr; 00045 00046 /*! 00047 * Make a density probe block. 00048 * 00049 * \param alpha Average filter constant 00050 * 00051 */ 00052 static sptr make(double alpha); 00053 00054 /*! 00055 * \brief Returns the current density value 00056 */ 00057 virtual double density() const = 0; 00058 00059 /*! 00060 * \brief Set the average filter constant 00061 */ 00062 virtual void set_alpha(double alpha) = 0; 00063 }; 00064 00065 } /* namespace digital */ 00066 } /* namespace gr */ 00067 00068 #endif /* INCLUDED_GR_PROBE_DENSITY_B_H */