GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem
probe_avg_mag_sqrd_f.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2005,2012 Free Software Foundation, Inc.
4  *
5  * This file is part of GNU Radio
6  *
7  * SPDX-License-Identifier: GPL-3.0-or-later
8  *
9  */
10 
11 #ifndef INCLUDED_ANALOG_PROBE_AVG_MAG_SQRD_F_H
12 #define INCLUDED_ANALOG_PROBE_AVG_MAG_SQRD_F_H
13 
14 #include <gnuradio/analog/api.h>
15 #include <gnuradio/sync_block.h>
16 
17 namespace gr {
18 namespace analog {
19 
20 /*!
21  * \brief compute avg magnitude squared.
22  * \ingroup measurement_tools_blk
23  *
24  * \details
25  * input stream 0: float
26  *
27  * Compute a running average of the magnitude squared of the the
28  * input. The level and indication as to whether the level exceeds
29  * threshold can be retrieved with the level and unmuted
30  * accessors.
31  */
33 {
34 public:
35  // gr::analog::probe_avg_mag_sqrd_f::sptr
36  typedef std::shared_ptr<probe_avg_mag_sqrd_f> sptr;
37 
38  /*!
39  * \brief Make a float sink that computes avg magnitude squared.
40  *
41  * \param threshold_db Threshold for muting.
42  * \param alpha Gain parameter for the running average filter.
43  */
44  static sptr make(double threshold_db, double alpha = 0.0001);
45 
46  virtual bool unmuted() const = 0;
47  virtual double level() const = 0;
48 
49  virtual double threshold() const = 0;
50 
51  virtual void set_alpha(double alpha) = 0;
52  virtual void set_threshold(double decibels) = 0;
53  virtual void reset() = 0;
54 };
55 
56 } /* namespace analog */
57 } /* namespace gr */
58 
59 #endif /* INCLUDED_ANALOG_PROBE_AVG_MAG_SQRD_F_H */
compute avg magnitude squared.
Definition: probe_avg_mag_sqrd_f.h:33
std::shared_ptr< probe_avg_mag_sqrd_f > sptr
Definition: probe_avg_mag_sqrd_f.h:36
virtual void set_alpha(double alpha)=0
virtual double level() const =0
virtual void set_threshold(double decibels)=0
virtual double threshold() const =0
virtual bool unmuted() const =0
static sptr make(double threshold_db, double alpha=0.0001)
Make a float sink that computes avg magnitude squared.
synchronous 1:1 input to output with history
Definition: sync_block.h:26
#define ANALOG_API
Definition: gr-analog/include/gnuradio/analog/api.h:18
GNU Radio logging wrapper.
Definition: basic_block.h:29