GNU Radio Manual and C++ API Reference 3.10.5.1
The Free & Open Software Radio Ecosystem
repetition_encoder.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 * SPDX-License-Identifier: GPL-3.0-or-later
8 *
9 */
10
11#ifndef INCLUDED_FEC_REPETITION_ENCODER_H
12#define INCLUDED_FEC_REPETITION_ENCODER_H
13
14#include <gnuradio/fec/api.h>
16#include <map>
17#include <string>
18
19namespace gr {
20namespace fec {
21namespace code {
22
23/*!
24 * \brief Repetition Encoding class.
25 * \ingroup error_coding_blk
26 *
27 * \details
28 * A repetition encoder class that repeats each input bit \p rep
29 * times. To decode, take a majority vote over the number of
30 * repetitions.
31 */
33{
34public:
35 /*!
36 * Build a repetition encoding FEC API object.
37 *
38 * \param frame_size Number of bits per frame. If using in the
39 * tagged stream style, this is the maximum allowable
40 * number of bits per frame.
41 * \param rep Repetition rate; encoder rate is rep bits out
42 * for each input bit.
43 */
44 static generic_encoder::sptr make(int frame_size, int rep);
45
46 /*!
47 * Sets the uncoded frame size to \p frame_size. If \p
48 * frame_size is greater than the value given to the
49 * constructor, the frame size will be capped by that initial
50 * value and this function will return false. Otherwise, it
51 * returns true.
52 */
53 bool set_frame_size(unsigned int frame_size) override = 0;
54
55 /*!
56 * Returns the coding rate of this encoder.
57 */
58 double rate() override = 0;
59};
60
61} /* namespace code */
62} /* namespace fec */
63} /* namespace gr */
64
65#endif /* INCLUDED_FEC_REPETITION_ENCODER_H */
Repetition Encoding class.
Definition: repetition_encoder.h:33
bool set_frame_size(unsigned int frame_size) override=0
static generic_encoder::sptr make(int frame_size, int rep)
Definition: generic_encoder.h:23
std::shared_ptr< generic_encoder > sptr
Definition: generic_encoder.h:37
#define FEC_API
Definition: gr-fec/include/gnuradio/fec/api.h:18
GNU Radio logging wrapper.
Definition: basic_block.h:29