3 * Copyright 2008 Free Software Foundation, Inc.
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)
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.
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.
20 #ifndef INCLUDED_GR_PROBE_DENSITY_B_H
21 #define INCLUDED_GR_PROBE_DENSITY_B_H
23 #include <gr_sync_block.h>
25 class gr_probe_density_b;
27 typedef boost::shared_ptr<gr_probe_density_b> gr_probe_density_b_sptr;
29 gr_probe_density_b_sptr gr_make_probe_density_b(double alpha);
32 * This block maintains a running average of the input stream and
33 * makes it available as an accessor function. The input stream
34 * is type unsigned char.
36 * If you send this block a stream of unpacked bytes, it will tell
37 * you what the bit density is.
39 * \param alpha Average filter constant
43 class gr_probe_density_b : public gr_sync_block
46 friend gr_probe_density_b_sptr gr_make_probe_density_b(double alpha);
52 gr_probe_density_b(double alpha);
55 ~gr_probe_density_b();
58 * \brief Returns the current density value
60 double density() const { return d_density; }
63 * \brief Set the average filter constant
65 void set_alpha(double alpha);
67 int work(int noutput_items,
68 gr_vector_const_void_star &input_items,
69 gr_vector_void_star &output_items);
72 #endif /* INCLUDED_GR_PROBE_DENSITY_B_H */