GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem
pwr_squelch_ff.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 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 
11 #ifndef INCLUDED_ANALOG_PWR_SQUELCH_FF_H
12 #define INCLUDED_ANALOG_PWR_SQUELCH_FF_H
13 
14 #include <gnuradio/analog/api.h>
16 #include <cmath>
17 
18 namespace gr {
19 namespace analog {
20 
21 /*!
22  * \brief gate or zero output when input power below threshold
23  * \ingroup level_controllers_blk
24  */
25 class ANALOG_API pwr_squelch_ff : public squelch_base_ff, virtual public block
26 {
27 protected:
28  void update_state(const float& in) override = 0;
29  bool mute() const override = 0;
30 
31 public:
32  // gr::analog::pwr_squelch_ff::sptr
33  typedef std::shared_ptr<pwr_squelch_ff> sptr;
34 
35  /*!
36  * \brief Make power-based squelch block.
37  *
38  * \param db threshold (in dB) for power squelch
39  * \param alpha Gain of averaging filter. Defaults to 0.0001.
40  * \param ramp attack / release time in samples; a sinusodial ramp
41  * is used. set to 0 to disable.
42  * \param gate if true, no output if no squelch tone.
43  * if false, output 0's if no squelch tone (default).
44  *
45  * The block will emit a tag with the key pmt::intern("squelch_sob")
46  * with the value of pmt::PMT_NIL on the first item it passes, and with
47  * the key pmt::intern("squelch_eob") on the last item it passes.
48  */
49  static sptr make(double db, double alpha = 0.0001, int ramp = 0, bool gate = false);
50 
51  std::vector<float> squelch_range() const override = 0;
52 
53  virtual double threshold() const = 0;
54  virtual void set_threshold(double db) = 0;
55  virtual void set_alpha(double alpha) = 0;
56 
57  int ramp() const override = 0;
58  void set_ramp(int ramp) override = 0;
59  bool gate() const override = 0;
60  void set_gate(bool gate) override = 0;
61  bool unmuted() const override = 0;
62 };
63 
64 } /* namespace analog */
65 } /* namespace gr */
66 
67 #endif /* INCLUDED_ANALOG_PWR_SQUELCH_FF_H */
gate or zero output when input power below threshold
Definition: pwr_squelch_ff.h:26
virtual void set_alpha(double alpha)=0
bool mute() const override=0
void set_gate(bool gate) override=0
std::shared_ptr< pwr_squelch_ff > sptr
Definition: pwr_squelch_ff.h:33
void set_ramp(int ramp) override=0
std::vector< float > squelch_range() const override=0
virtual double threshold() const =0
virtual void set_threshold(double db)=0
bool unmuted() const override=0
static sptr make(double db, double alpha=0.0001, int ramp=0, bool gate=false)
Make power-based squelch block.
bool gate() const override=0
void update_state(const float &in) override=0
int ramp() const override=0
basic squelch block; to be subclassed for other squelches.
Definition: squelch_base_ff.h:25
The abstract base class for all 'terminal' processing blocks.
Definition: gnuradio-runtime/include/gnuradio/block.h:63
#define ANALOG_API
Definition: gr-analog/include/gnuradio/analog/api.h:18
GNU Radio logging wrapper.
Definition: basic_block.h:29