GNU Radio Manual and C++ API Reference  3.8.1.0
The Free & Open Software Radio Ecosystem
bin_statistics_f.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2006,2013 Free Software Foundation, Inc.
4  *
5  * This file is part of GNU Radio
6  *
7  * GNU Radio is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3, or (at your option)
10  * any later version.
11  *
12  * GNU Radio is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with GNU Radio; see the file COPYING. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 #ifndef INCLUDED_GR_BIN_STATISTICS_F_H
24 #define INCLUDED_GR_BIN_STATISTICS_F_H
25 
26 #include <gnuradio/blocks/api.h>
27 #include <gnuradio/feval.h>
28 #include <gnuradio/msg_queue.h>
29 #include <gnuradio/sync_block.h>
30 
31 namespace gr {
32 namespace blocks {
33 
34 /*!
35  * \brief control scanning and record frequency domain statistics
36  * \ingroup misc_blk
37  */
38 class BLOCKS_API bin_statistics_f : virtual public sync_block
39 {
40 protected:
41  std::vector<float> d_max; // per bin maxima
42 
43  virtual size_t vlen() const = 0;
44  virtual double center_freq() const = 0;
45  virtual gr::msg_queue::sptr msgq() const = 0;
46 
47  virtual void reset_stats() = 0;
48  virtual void accrue_stats(const float* input) = 0;
49  virtual void send_stats() = 0;
50 
51 public:
52  // gr::blocks::bin_statistics_f::sptr
53  typedef boost::shared_ptr<bin_statistics_f> sptr;
54 
55  /*!
56  * Build a bin statistics block. See qa_bin_statistics.py and
57  * gr-uhd/examples/python/usrp_spectrum_sense.py for examples of
58  * its use, specifically how to use the callback function.
59  *
60  * \param vlen vector length
61  * \param msgq message queue
62  * \param tune a feval_dd callback function
63  * \param tune_delay number of samples for the tune delay
64  * \param dwell_delay number of samples for the dwell delay
65  */
66  static sptr make(unsigned int vlen, // vector length
68  feval_dd* tune, // callback
69  size_t tune_delay, // samples
70  size_t dwell_delay); // samples
71 };
72 
73 } /* namespace blocks */
74 } /* namespace gr */
75 
76 #endif /* INCLUDED_GR_BIN_STATISTICS_F_H */
boost::shared_ptr< msg_queue > sptr
Definition: msg_queue.h:47
control scanning and record frequency domain statistics
Definition: bin_statistics_f.h:38
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition: basic_block.h:43
#define BLOCKS_API
Definition: gr-blocks/include/gnuradio/blocks/api.h:30
synchronous 1:1 input to output with historyOverride work to provide the signal processing implementa...
Definition: sync_block.h:37
std::vector< float > d_max
Definition: bin_statistics_f.h:41
base class for evaluating a function: double -> doubleThis class is designed to be subclassed in Pyth...
Definition: feval.h:46
boost::shared_ptr< bin_statistics_f > sptr
Definition: bin_statistics_f.h:53