GNU Radio Manual and C++ API Reference  3.7.9.2
The Free & Open Software Radio Ecosystem
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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 PSK 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  *
49  * The block has three output message ports that will emit a
50  * message every msg_samples number of samples. These message
51  * ports are:
52  * \li snr: the current SNR estimate (in dB)
53  * \li signal: the current signal power estimate (in dBx)
54  * \li noise: the current noise power estimate (in dBx)
55  *
56  * Some calibration is required to convert dBx of the signal and
57  * noise power estimates to real measurements, such as dBm.
58  */
60  {
61  public:
62  // gr::digital::probe_mpsk_snr_est_c::sptr
63  typedef boost::shared_ptr<probe_mpsk_snr_est_c> sptr;
64 
65  /*! Make an MPSK SNR probe.
66  *
67  * Parameters:
68  *
69  * \param type: the type of estimator to use see
70  * gr::digital::snr_est_type_t for details about the types.
71  * \param msg_nsamples: [not implemented yet] after this many
72  * samples, a message containing the SNR (key='snr') will be sent
73  * \param alpha: the update rate of internal running average
74  * calculations.
75  */
76  static sptr make(snr_est_type_t type,
77  int msg_nsamples=10000,
78  double alpha=0.001);
79 
80  //! Return the estimated signal-to-noise ratio in decibels
81  virtual double snr() = 0;
82 
83  //! Return the estimated signal power in decibels
84  virtual double signal() = 0;
85 
86  //! Return the estimated noise power in decibels
87  virtual double noise() = 0;
88 
89  //! Return the type of estimator in use
90  virtual snr_est_type_t type() const = 0;
91 
92  //! Return how many samples between SNR messages
93  virtual int msg_nsample() const = 0;
94 
95  //! Get the running-average coefficient
96  virtual double alpha() const = 0;
97 
98  //! Set type of estimator to use
99  virtual void set_type(snr_est_type_t t) = 0;
100 
101  //! Set the number of samples between SNR messages
102  virtual void set_msg_nsample(int n) = 0;
103 
104  //! Set the running-average coefficient
105  virtual void set_alpha(double alpha) = 0;
106  };
107 
108  } /* namespace digital */
109 } /* namespace gr */
110 
111 #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:63
#define DIGITAL_API
Definition: gr-digital/include/gnuradio/digital/api.h:30
Include this header to use the message passing features.
Definition: logger.h:131
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 PSK signal.
Definition: probe_mpsk_snr_est_c.h:59