GNU Radio 3.7.0 C++ API
probe_mpsk_snr_est_c.h
Go to the documentation of this file.
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_PROBE_MPSK_SNR_EST_C_H
00024 #define INCLUDED_DIGITAL_PROBE_MPSK_SNR_EST_C_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 probe for computing SNR of a signal.
00035      * \ingroup measurement_tools_blk
00036      *
00037      * \details 
00038      * This is a probe block (a sink) that can be used to monitor and
00039      * retrieve estimations of the signal SNR. This probe is designed
00040      * for use with M-PSK signals especially. The type of estimator is
00041      * specified as the \p type parameter in the constructor. The
00042      * estimators tend to trade off performance for accuracy, although
00043      * experimentation should be done to figure out the right approach
00044      * for a given implementation. Further, the current set of
00045      * estimators are designed and proven theoretically under AWGN
00046      * conditions; some amount of error should be assumed and/or
00047      * estimated for real channel conditions.
00048      */
00049     class DIGITAL_API probe_mpsk_snr_est_c : virtual public sync_block
00050     {
00051     public:
00052       // gr::digital::probe_mpsk_snr_est_c::sptr
00053       typedef boost::shared_ptr<probe_mpsk_snr_est_c> sptr;
00054 
00055       /*! Make an MPSK SNR probe.
00056        *
00057        *  Parameters:
00058        *
00059        *  \param type: the type of estimator to use see
00060        *   gr::digital::snr_est_type_t for details about the types.
00061        *  \param msg_nsamples: [not implemented yet] after this many
00062        *   samples, a message containing the SNR (key='snr') will be sent
00063        *  \param alpha: the update rate of internal running average
00064        *   calculations.
00065        */
00066       static sptr make(snr_est_type_t type,
00067                        int msg_nsamples=10000,
00068                        double alpha=0.001);
00069 
00070       //! Return the estimated signal-to-noise ratio in decibels
00071       virtual double snr() = 0;
00072 
00073       //! Return the type of estimator in use
00074       virtual snr_est_type_t type() const = 0;
00075 
00076       //! Return how many samples between SNR messages
00077       virtual int msg_nsample() const = 0;
00078 
00079       //! Get the running-average coefficient
00080       virtual double alpha() const = 0;
00081 
00082       //! Set type of estimator to use
00083       virtual void set_type(snr_est_type_t t) = 0;
00084 
00085       //! Set the number of samples between SNR messages
00086       virtual void set_msg_nsample(int n) = 0;
00087 
00088       //! Set the running-average coefficient
00089       virtual void set_alpha(double alpha) = 0;
00090     };
00091 
00092   } /* namespace digital */
00093 } /* namespace gr */
00094 
00095 #endif /* INCLUDED_DIGITAL_PROBE_MPSK_SNR_EST_C_H */