GNU Radio Manual and C++ API Reference  3.7.4
The Free & Open Software Radio Ecosystem
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
probe_mpsk_snr_est_c.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2011,2012 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_DIGITAL_PROBE_MPSK_SNR_EST_C_H
24 #define INCLUDED_DIGITAL_PROBE_MPSK_SNR_EST_C_H
25 
26 #include <gnuradio/digital/api.h>
28 #include <gnuradio/sync_block.h>
29 
30 namespace gr {
31  namespace digital {
32 
33  /*!
34  * \brief A probe for computing SNR of a signal.
35  * \ingroup measurement_tools_blk
36  *
37  * \details
38  * This is a probe block (a sink) that can be used to monitor and
39  * retrieve estimations of the signal SNR. This probe is designed
40  * for use with M-PSK signals especially. The type of estimator is
41  * specified as the \p type parameter in the constructor. The
42  * estimators tend to trade off performance for accuracy, although
43  * experimentation should be done to figure out the right approach
44  * for a given implementation. Further, the current set of
45  * estimators are designed and proven theoretically under AWGN
46  * conditions; some amount of error should be assumed and/or
47  * estimated for real channel conditions.
48  */
50  {
51  public:
52  // gr::digital::probe_mpsk_snr_est_c::sptr
54 
55  /*! Make an MPSK SNR probe.
56  *
57  * Parameters:
58  *
59  * \param type: the type of estimator to use see
60  * gr::digital::snr_est_type_t for details about the types.
61  * \param msg_nsamples: [not implemented yet] after this many
62  * samples, a message containing the SNR (key='snr') will be sent
63  * \param alpha: the update rate of internal running average
64  * calculations.
65  */
66  static sptr make(snr_est_type_t type,
67  int msg_nsamples=10000,
68  double alpha=0.001);
69 
70  //! Return the estimated signal-to-noise ratio in decibels
71  virtual double snr() = 0;
72 
73  //! Return the type of estimator in use
74  virtual snr_est_type_t type() const = 0;
75 
76  //! Return how many samples between SNR messages
77  virtual int msg_nsample() const = 0;
78 
79  //! Get the running-average coefficient
80  virtual double alpha() const = 0;
81 
82  //! Set type of estimator to use
83  virtual void set_type(snr_est_type_t t) = 0;
84 
85  //! Set the number of samples between SNR messages
86  virtual void set_msg_nsample(int n) = 0;
87 
88  //! Set the running-average coefficient
89  virtual void set_alpha(double alpha) = 0;
90  };
91 
92  } /* namespace digital */
93 } /* namespace gr */
94 
95 #endif /* INCLUDED_DIGITAL_PROBE_MPSK_SNR_EST_C_H */
snr_est_type_t
A block for computing SNR of a signal.
Definition: mpsk_snr_est.h:46
boost::shared_ptr< probe_mpsk_snr_est_c > sptr
Definition: probe_mpsk_snr_est_c.h:53
#define DIGITAL_API
Definition: gr-digital/include/gnuradio/digital/api.h:30
shared_ptr documentation stub
Definition: shared_ptr_docstub.h:15
synchronous 1:1 input to output with historyOverride work to provide the signal processing implementa...
Definition: sync_block.h:37
A probe for computing SNR of a signal.
Definition: probe_mpsk_snr_est_c.h:49