GNU Radio 3.7.1 C++ API
|
00001 /* -*- c++ -*- */ 00002 /* 00003 * Copyright 2011,2012 Free Software Foundation, Inc. 00004 * 00005 * This file is part of GNU Radio 00006 * 00007 * GNU Radio is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 3, or (at your option) 00010 * any later version. 00011 * 00012 * GNU Radio is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with GNU Radio; see the file COPYING. If not, write to 00019 * the Free Software Foundation, Inc., 51 Franklin Street, 00020 * Boston, MA 02110-1301, USA. 00021 */ 00022 00023 #ifndef INCLUDED_DIGITAL_MPSK_SNR_EST_CC_H 00024 #define INCLUDED_DIGITAL_MPSK_SNR_EST_CC_H 00025 00026 #include <gnuradio/digital/api.h> 00027 #include <gnuradio/digital/mpsk_snr_est.h> 00028 #include <gnuradio/sync_block.h> 00029 00030 namespace gr { 00031 namespace digital { 00032 00033 /*! 00034 * \brief A block for computing SNR of a signal. 00035 * \ingroup measurement_tools_blk 00036 * 00037 * \details 00038 * This block can be used to monitor and retrieve estimations of 00039 * the signal SNR. It is designed to work in a flowgraph and 00040 * passes all incoming data along to its output. 00041 * 00042 * The block is designed for use with M-PSK signals 00043 * especially. The type of estimator is specified as the \p type 00044 * parameter in the constructor. The estimators tend to trade off 00045 * performance for accuracy, although experimentation should be 00046 * done to figure out the right approach for a given 00047 * implementation. Further, the current set of estimators are 00048 * designed and proven theoretically under AWGN conditions; some 00049 * amount of error should be assumed and/or estimated for real 00050 * channel conditions. 00051 */ 00052 class DIGITAL_API mpsk_snr_est_cc : virtual public sync_block 00053 { 00054 public: 00055 // gr::digital::mpsk_snr_est_cc::sptr 00056 typedef boost::shared_ptr<mpsk_snr_est_cc> sptr; 00057 00058 /*! Factory function returning shared pointer of this class 00059 * 00060 * \param type: the type of estimator to use gr::digital::snr_est_type_t 00061 * "snr_est_type_t" for details about the available types 00062 * \param tag_nsamples: after this many samples, a tag containing 00063 * the SNR (key='snr') will be sent 00064 * \param alpha: the update rate of internal running average 00065 * calculations 00066 */ 00067 static sptr make(snr_est_type_t type, 00068 int tag_nsamples=10000, 00069 double alpha=0.001); 00070 00071 //! Return the estimated signal-to-noise ratio in decibels 00072 virtual double snr() = 0; 00073 00074 //! Return the type of estimator in use 00075 virtual snr_est_type_t type() const = 0; 00076 00077 //! Return how many samples between SNR tags 00078 virtual int tag_nsample() const = 0; 00079 00080 //! Get the running-average coefficient 00081 virtual double alpha() const = 0; 00082 00083 //! Set type of estimator to use 00084 virtual void set_type(snr_est_type_t t) = 0; 00085 00086 //! Set the number of samples between SNR tags 00087 virtual void set_tag_nsample(int n) = 0; 00088 00089 //! Set the running-average coefficient 00090 virtual void set_alpha(double alpha) = 0; 00091 }; 00092 00093 } /* namespace digital */ 00094 } /* namespace gr */ 00095 00096 #endif /* INCLUDED_DIGITAL_MPSK_SNR_EST_CC_H */