GNU Radio Manual and C++ API Reference 3.7.14.0
The Free & Open Software Radio Ecosystem
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
28#include <gnuradio/sync_block.h>
29
30namespace gr {
31namespace 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 */
53{
54public:
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, int tag_nsamples = 10000, double alpha = 0.001);
68
69 //! Return the estimated signal-to-noise ratio in decibels
70 virtual double snr() = 0;
71
72 //! Return the type of estimator in use
73 virtual snr_est_type_t type() const = 0;
74
75 //! Return how many samples between SNR tags
76 virtual int tag_nsample() const = 0;
77
78 //! Get the running-average coefficient
79 virtual double alpha() const = 0;
80
81 //! Set type of estimator to use
82 virtual void set_type(snr_est_type_t t) = 0;
83
84 //! Set the number of samples between SNR tags
85 virtual void set_tag_nsample(int n) = 0;
86
87 //! Set the running-average coefficient
88 virtual void set_alpha(double alpha) = 0;
89};
90
91} /* namespace digital */
92} /* namespace gr */
93
94#endif /* INCLUDED_DIGITAL_MPSK_SNR_EST_CC_H */
A block for computing SNR of a signal.
Definition: mpsk_snr_est_cc.h:53
virtual double alpha() const =0
Get the running-average coefficient.
virtual snr_est_type_t type() const =0
Return the type of estimator in use.
virtual void set_type(snr_est_type_t t)=0
Set type of estimator to use.
virtual void set_alpha(double alpha)=0
Set the running-average coefficient.
virtual int tag_nsample() const =0
Return how many samples between SNR tags.
virtual double snr()=0
Return the estimated signal-to-noise ratio in decibels.
virtual void set_tag_nsample(int n)=0
Set the number of samples between SNR tags.
static sptr make(snr_est_type_t type, int tag_nsamples=10000, double alpha=0.001)
boost::shared_ptr< mpsk_snr_est_cc > sptr
Definition: mpsk_snr_est_cc.h:56
synchronous 1:1 input to output with history
Definition: sync_block.h:38
#define DIGITAL_API
Definition: gr-digital/include/gnuradio/digital/api.h:30
snr_est_type_t
A block for computing SNR of a signal.
Definition: mpsk_snr_est.h:46
Include this header to use the message passing features.
Definition: basic_block.h:45