GNU Radio Manual and C++ API Reference  3.8.1.0
The Free & Open Software Radio Ecosystem
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, int msg_nsamples = 10000, double alpha = 0.001);
77 
78  //! Return the estimated signal-to-noise ratio in decibels
79  virtual double snr() = 0;
80 
81  //! Return the estimated signal power in decibels
82  virtual double signal() = 0;
83 
84  //! Return the estimated noise power in decibels
85  virtual double noise() = 0;
86 
87  //! Return the type of estimator in use
88  virtual snr_est_type_t type() const = 0;
89 
90  //! Return how many samples between SNR messages
91  virtual int msg_nsample() const = 0;
92 
93  //! Get the running-average coefficient
94  virtual double alpha() const = 0;
95 
96  //! Set type of estimator to use
97  virtual void set_type(snr_est_type_t t) = 0;
98 
99  //! Set the number of samples between SNR messages
100  virtual void set_msg_nsample(int n) = 0;
101 
102  //! Set the running-average coefficient
103  virtual void set_alpha(double alpha) = 0;
104 };
105 
106 } /* namespace digital */
107 } /* namespace gr */
108 
109 #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
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition: basic_block.h:43
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