GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem
probe_avg_mag_sqrd_c.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2005,2006,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 #ifndef INCLUDED_ANALOG_PROBE_AVG_MAG_SQRD_C_H
11 #define INCLUDED_ANALOG_PROBE_AVG_MAG_SQRD_C_H
12 
13 #include <gnuradio/analog/api.h>
14 #include <gnuradio/sync_block.h>
15 
16 namespace gr {
17 namespace analog {
18 
19 /*!
20  * \brief compute avg magnitude squared.
21  * \ingroup measurement_tools_blk
22  *
23  * \details
24  * Input stream 0: complex
25  *
26  * Compute a running average of the magnitude squared of the the
27  * input. The level and indication as to whether the level exceeds
28  * threshold can be retrieved with the level and unmuted
29  * accessors.
30  */
32 {
33 public:
34  // gr::analog::probe_avg_mag_sqrd_c::sptr
35  typedef std::shared_ptr<probe_avg_mag_sqrd_c> sptr;
36 
37  /*!
38  * \brief Make a complex sink that computes avg magnitude squared.
39  *
40  * \param threshold_db Threshold for muting.
41  * \param alpha Gain parameter for the running average filter.
42  */
43  static sptr make(double threshold_db, double alpha = 0.0001);
44 
45  virtual bool unmuted() const = 0;
46  virtual double level() const = 0;
47  virtual double threshold() const = 0;
48 
49  virtual void set_alpha(double alpha) = 0;
50  virtual void set_threshold(double decibels) = 0;
51  virtual void reset() = 0;
52 };
53 
54 } /* namespace analog */
55 } /* namespace gr */
56 
57 #endif /* INCLUDED_ANALOG_PROBE_AVG_MAG_SQRD_C_H */
compute avg magnitude squared.
Definition: probe_avg_mag_sqrd_c.h:32
virtual void set_threshold(double decibels)=0
virtual void set_alpha(double alpha)=0
virtual double level() const =0
virtual double threshold() const =0
static sptr make(double threshold_db, double alpha=0.0001)
Make a complex sink that computes avg magnitude squared.
std::shared_ptr< probe_avg_mag_sqrd_c > sptr
Definition: probe_avg_mag_sqrd_c.h:35
virtual bool unmuted() const =0
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