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
mpsk_snr_est_cc.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_MPSK_SNR_EST_CC_H
24 #define INCLUDED_DIGITAL_MPSK_SNR_EST_CC_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 block for computing SNR of a signal.
35  * \ingroup measurement_tools_blk
36  *
37  * \details
38  * This block can be used to monitor and retrieve estimations of
39  * the signal SNR. It is designed to work in a flowgraph and
40  * passes all incoming data along to its output.
41  *
42  * The block is designed for use with M-PSK signals
43  * especially. The type of estimator is specified as the \p type
44  * parameter in the constructor. The estimators tend to trade off
45  * performance for accuracy, although experimentation should be
46  * done to figure out the right approach for a given
47  * implementation. Further, the current set of estimators are
48  * designed and proven theoretically under AWGN conditions; some
49  * amount of error should be assumed and/or estimated for real
50  * channel conditions.
51  */
52  class DIGITAL_API mpsk_snr_est_cc : virtual public sync_block
53  {
54  public:
55  // gr::digital::mpsk_snr_est_cc::sptr
56  typedef boost::shared_ptr<mpsk_snr_est_cc> sptr;
57 
58  /*! Factory function returning shared pointer of this class
59  *
60  * \param type: the type of estimator to use gr::digital::snr_est_type_t
61  * "snr_est_type_t" for details about the available types
62  * \param tag_nsamples: after this many samples, a tag containing
63  * the SNR (key='snr') will be sent
64  * \param alpha: the update rate of internal running average
65  * calculations
66  */
67  static sptr make(snr_est_type_t type,
68  int tag_nsamples=10000,
69  double alpha=0.001);
70 
71  //! Return the estimated signal-to-noise ratio in decibels
72  virtual double snr() = 0;
73 
74  //! Return the type of estimator in use
75  virtual snr_est_type_t type() const = 0;
76 
77  //! Return how many samples between SNR tags
78  virtual int tag_nsample() const = 0;
79 
80  //! Get the running-average coefficient
81  virtual double alpha() const = 0;
82 
83  //! Set type of estimator to use
84  virtual void set_type(snr_est_type_t t) = 0;
85 
86  //! Set the number of samples between SNR tags
87  virtual void set_tag_nsample(int n) = 0;
88 
89  //! Set the running-average coefficient
90  virtual void set_alpha(double alpha) = 0;
91  };
92 
93  } /* namespace digital */
94 } /* namespace gr */
95 
96 #endif /* INCLUDED_DIGITAL_MPSK_SNR_EST_CC_H */
snr_est_type_t
A block for computing SNR of a signal.
Definition: mpsk_snr_est.h:46
#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
boost::shared_ptr< mpsk_snr_est_cc > sptr
Definition: mpsk_snr_est_cc.h:56
synchronous 1:1 input to output with historyOverride work to provide the signal processing implementa...
Definition: sync_block.h:37
A block for computing SNR of a signal.
Definition: mpsk_snr_est_cc.h:52