GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem
ldpc_gen_mtrx_encoder.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2015 Free Software Foundation, Inc.
4  *
5  * SPDX-License-Identifier: GPL-3.0-or-later
6  *
7  */
8 
9 #ifndef INCLUDED_FEC_LDPC_GEN_MTRX_ENCODER_H
10 #define INCLUDED_FEC_LDPC_GEN_MTRX_ENCODER_H
11 
12 #include <gnuradio/fec/api.h>
15 
16 namespace gr {
17 namespace fec {
18 namespace code {
19 
20 /*!
21  * \brief LDPC generator matrix encoder
22  * \ingroup error_coding_blk
23  *
24  * \details
25  * A standard encoder class. This method is discussed in many
26  * textbooks; one is: Turbo Coding for Satellite and Wireless
27  * Communications by Soleymani, Gao, and Vilaipornsawai.
28  * Given a generator matrix in systematic form,
29  * \f$\mathbf{G}=\left[\mathbf{I}_{k}|\mathbf{P}\right]\f$,
30  * where \f$\mathbf{I}_{k}\f$ is the identity matrix and
31  * \f$\mathbf{P}\f$ is the parity submatrix, the information
32  * word \f$\bar{s}\f$ is encoded into a codeword
33  * \f$\overline{x}\f$ via:
34  * \f[\overline{x}=\mathbf{G}^{T}\bar{s}\f]
35  */
37 {
38 public:
39  /*!
40  * \brief Build an encoding FEC API object.
41  * \param G_obj The ldpc_G_matrix object to use for
42  * encoding.
43  */
45 
46  /*!
47  * \brief Sets the uncoded frame size to \p frame_size.
48  * \details
49  * Sets the uncoded frame size to \p frame_size. If \p
50  * frame_size is greater than the value given to the
51  * constructor, the frame size will be capped by that initial
52  * value and this function will return false. Otherwise, it
53  * returns true.
54  */
55  bool set_frame_size(unsigned int frame_size) override = 0;
56 
57  //! Returns the coding rate of this encoder.
58  double rate() override = 0;
59 };
60 } /* namespace code */
61 } /* namespace fec */
62 } /* namespace gr */
63 
64 #endif /* INCLUDED_FEC_LDPC_GEN_MTRX_ENCODER_H */
std::shared_ptr< ldpc_G_matrix > sptr
Definition: ldpc_G_matrix.h:46
LDPC generator matrix encoder.
Definition: ldpc_gen_mtrx_encoder.h:37
bool set_frame_size(unsigned int frame_size) override=0
Sets the uncoded frame size to frame_size.
static generic_encoder::sptr make(const code::ldpc_G_matrix::sptr G_obj)
Build an encoding FEC API object.
double rate() override=0
Returns the coding rate of this encoder.
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