GNU Radio 3.6.5.1 C++ API
digital_probe_density_b.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2008,2012 Free Software Foundation, Inc.
4  *
5  * GNU Radio is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3, or (at your option)
8  * any later version.
9  *
10  * GNU Radio is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with GNU Radio; see the file COPYING. If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street,
18  * Boston, MA 02110-1301, USA.
19  */
20 #ifndef INCLUDED_GR_PROBE_DENSITY_B_H
21 #define INCLUDED_GR_PROBE_DENSITY_B_H
22 
23 #include <digital_api.h>
24 #include <gr_sync_block.h>
25 
27 
29 
31 digital_make_probe_density_b(double alpha);
32 
33 /*!
34  * \ingroup measurement_tools_blk
35  *
36  * This block maintains a running average of the input stream and
37  * makes it available as an accessor function. The input stream
38  * is type unsigned char.
39  *
40  * If you send this block a stream of unpacked bytes, it will tell
41  * you what the bit density is.
42  *
43  * \param alpha Average filter constant
44  *
45  */
46 
48 {
49 private:
51  digital_make_probe_density_b(double alpha);
52 
53  double d_alpha;
54  double d_beta;
55  double d_density;
56 
57  digital_probe_density_b(double alpha);
58 
59 public:
61 
62  /*!
63  * \brief Returns the current density value
64  */
65  double density() const { return d_density; }
66 
67  /*!
68  * \brief Set the average filter constant
69  */
70  void set_alpha(double alpha);
71 
72  int work(int noutput_items,
73  gr_vector_const_void_star &input_items,
74  gr_vector_void_star &output_items);
75 };
76 
77 #endif /* INCLUDED_GR_PROBE_DENSITY_B_H */