GNU Radio Manual and C++ API Reference  3.7.9.2
The Free & Open Software Radio Ecosystem
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ldpc_bit_flip_decoder.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2015 Free Software Foundation, Inc.
4  *
5  * This is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published
7  * by the Free Software Foundation; either version 3, or (at your
8  * option) any later version.
9  *
10  * This software is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this software; see the file COPYING. If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 
22 #ifndef INCLUDED_FEC_LDPC_BIT_FLIP_DECODER_H
23 #define INCLUDED_FEC_LDPC_BIT_FLIP_DECODER_H
24 
25 #include <gnuradio/fec/api.h>
26 #include <gnuradio/fec/fec_mtrx.h>
28 
29 namespace gr {
30  namespace fec {
31  namespace code {
32 
33  /*!
34  * \brief LDPC bit flip decoding class
35  * \ingroup error_coding_blk
36  *
37  * \details
38  * A hard decision bit flip decoder class for decoding low
39  * density parity check (LDPC) codes. The decoder requires
40  * knowledge of the matrix used to create (encode) the
41  * codewords. The simple algorithm is:
42  *
43  * 1. Compute parity checks on all of the bits.
44  * 2. Flip the bit(s) associated with the most failed parity
45  * checks.
46  * 3. Check to see if new word is valid. (\f$\overline{x}\f$
47  * is a codeword if and only if
48  * \f$\mathbf{H}\bar{x}^{T}=\overline{0}\f$.) If it is not
49  * valid, go back to step 1.
50  * 4. Repeat until valid codeword is found or the maximum
51  * number of iterations is reached.
52  */
54  {
55  public:
56 
57  /*!
58  * \brief Build a bit flip decoding FEC API object.
59  * \param mtrx_obj The LDPC parity check matrix to use for
60  * decoding. This should be the same matrix used for
61  * encoding. Provide either a ldpc_H_matrix or
62  * a ldpc_G_matrix object.
63  * \param max_iter Maximum number of iterations to complete
64  * during the decoding algorithm. The default is 100
65  * because this seemed to be sufficient during
66  * testing. May be increased for possibly better
67  * performance, but may slow things down.
68  */
69  static generic_decoder::sptr make(const fec_mtrx_sptr mtrx_obj,
70  unsigned int max_iter=100);
71 
72  /*!
73  * \brief Sets the uncoded frame size to \p frame_size.
74  * \details
75  * Sets the uncoded frame size to \p frame_size. If \p
76  * frame_size is greater than the value given to the
77  * constructor, the frame size will be capped by that initial
78  * value and this function will return false. Otherwise, it
79  * returns true.
80  */
81  virtual bool set_frame_size(unsigned int frame_size) = 0;
82 
83  //! Returns the coding rate of this decoder.
84  virtual double rate() = 0;
85 
86  };
87  } /* namespace code */
88  } /* namespace fec */
89 } /* namespace gr */
90 
91 #endif /* INCLUDED_FEC_LDPC_BIT_FLIP_DECODER_H */
Parent class for FECAPI objects.
Definition: generic_decoder.h:60
LDPC bit flip decoding class.
Definition: ldpc_bit_flip_decoder.h:53
Include this header to use the message passing features.
Definition: logger.h:131
#define FEC_API
Definition: gr-fec/include/gnuradio/fec/api.h:30
boost::shared_ptr< generic_decoder > sptr
Definition: generic_decoder.h:75