GNU Radio Manual and C++ API Reference  3.8.1.0
The Free & Open Software Radio Ecosystem
repetition_decoder.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2014 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_FEC_REPETITION_DECODER_H
24 #define INCLUDED_FEC_REPETITION_DECODER_H
25 
26 #include <gnuradio/fec/api.h>
28 #include <map>
29 #include <string>
30 
31 namespace gr {
32 namespace fec {
33 namespace code {
34 
35 /*!
36  * \brief Repetition Decoding class.
37  * \ingroup error_coding_blk
38  *
39  * \details
40  * A repetition decoder class. This takes a majority vote,
41  * biased by the \p ap_prob rate, and decides if the number of 1
42  * bits > ap_prob, it is a 1; else, it is a 0.
43  */
45 {
46 public:
47  /*!
48  * Build a repetition decoding FEC API object.
49  *
50  * \param frame_size Number of bits per frame. If using in the
51  * tagged stream style, this is the maximum allowable
52  * number of bits per frame.
53  * \param rep Repetition rate; encoder rate is rep bits out
54  * for each input bit.
55  * \param ap_prob The a priori probability that a bit is a 1
56  * (generally, unless otherwise known, assume to be
57  * 0.5).
58  */
59  static generic_decoder::sptr make(int frame_size, int rep, float ap_prob = 0.5);
60 
61  /*!
62  * Sets the uncoded frame size to \p frame_size. If \p
63  * frame_size is greater than the value given to the
64  * constructor, the frame size will be capped by that initial
65  * value and this function will return false. Otherwise, it
66  * returns true.
67  */
68  virtual bool set_frame_size(unsigned int frame_size) = 0;
69 
70  /*!
71  * Returns the coding rate of this encoder (it will always be 1).
72  */
73  virtual double rate() = 0;
74 };
75 
76 } /* namespace code */
77 } /* namespace fec */
78 } /* namespace gr */
79 
80 #endif /* INCLUDED_FEC_REPETITION_DECODER_H */
Parent class for FECAPI objects.
Definition: generic_decoder.h:60
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition: basic_block.h:43
Repetition Decoding class.
Definition: repetition_decoder.h:44
#define FEC_API
Definition: gr-fec/include/gnuradio/fec/api.h:30
boost::shared_ptr< generic_decoder > sptr
Definition: generic_decoder.h:75