GNU Radio 3.5.3.1 C++ API
digital_mpsk_snr_est_cc.h
Go to the documentation of this file.
1
/* -*- c++ -*- */
2
/*
3
* Copyright 2011 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
#ifndef INCLUDED_DIGITAL_MPSK_SNR_EST_CC_H
23
#define INCLUDED_DIGITAL_MPSK_SNR_EST_CC_H
24
25
#include <
digital_api.h
>
26
#include <
gr_sync_block.h
>
27
#include <
digital_impl_mpsk_snr_est.h
>
28
29
class
digital_mpsk_snr_est_cc
;
30
typedef
boost::shared_ptr<digital_mpsk_snr_est_cc>
digital_mpsk_snr_est_cc_sptr
;
31
32
DIGITAL_API
digital_mpsk_snr_est_cc_sptr
33
digital_make_mpsk_snr_est_cc
(
snr_est_type_t
type
,
34
int
tag_nsamples=10000,
35
double
alpha
=0.001);
36
37
//! \brief A block for computing SNR of a signal.
38
/*! \ingroup snr_blk
39
*
40
* This block can be used to monitor and retrieve estimations of the
41
* signal SNR. It is designed to work in a flowgraph and passes all
42
* incoming data along to its output.
43
*
44
* The block is designed for use with M-PSK signals especially. The
45
* type of estimator is specified as the \p type parameter in the
46
* constructor. The estimators tend to trade off performance for
47
* accuracy, although experimentation should be done to figure out
48
* the right approach for a given implementation. Further, the
49
* current set of estimators are designed and proven theoretically
50
* under AWGN conditions; some amount of error should be assumed
51
* and/or estimated for real channel conditions.
52
*/
53
class
DIGITAL_API
digital_mpsk_snr_est_cc
:
public
gr_sync_block
54
{
55
private
:
56
snr_est_type_t
d_type;
57
int
d_nsamples, d_count;
58
double
d_alpha;
59
digital_impl_mpsk_snr_est
*d_snr_est;
60
61
//d_key is the tag name, 'snr', d_me is the block name + unique ID
62
pmt::pmt_t
d_key, d_me;
63
64
/*! Factory function returning shared pointer of this class
65
*
66
* Parameters:
67
*
68
* \param type: the type of estimator to use \ref ref_snr_est_types
69
* "snr_est_type_t" for details about the available types.
70
* \param tag_nsamples: after this many samples, a tag containing
71
* the SNR (key='snr') will be sent
72
* \param alpha: the update rate of internal running average
73
* calculations.
74
*/
75
friend
DIGITAL_API
digital_mpsk_snr_est_cc_sptr
76
digital_make_mpsk_snr_est_cc
(
snr_est_type_t
type,
77
int
tag_nsamples,
78
double
alpha);
79
80
// Private constructor
81
digital_mpsk_snr_est_cc
(
snr_est_type_t
type,
82
int
tag_nsamples,
83
double
alpha);
84
85
public
:
86
87
~
digital_mpsk_snr_est_cc
();
88
89
int
work
(
int
noutput_items,
90
gr_vector_const_void_star
&input_items,
91
gr_vector_void_star
&output_items);
92
93
//! Return the estimated signal-to-noise ratio in decibels
94
double
snr();
95
96
//! Return the type of estimator in use
97
snr_est_type_t
type()
const
;
98
99
//! Return how many samples between SNR tags
100
int
tag_nsample()
const
;
101
102
//! Get the running-average coefficient
103
double
alpha()
const
;
104
105
//! Set type of estimator to use
106
void
set_type(
snr_est_type_t
t);
107
108
//! Set the number of samples between SNR tags
109
void
set_tag_nsample(
int
n);
110
111
//! Set the running-average coefficient
112
void
set_alpha(
double
alpha);
113
};
114
115
#endif
/* INCLUDED_DIGITAL_MPSK_SNR_EST_CC_H */
gr-digital
include
digital_mpsk_snr_est_cc.h
Generated by
1.8.1.1