GNU Radio's CCSDS Package
decodeLDPC_impl.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2019 <+YOU OR YOUR COMPANY+>.
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 by
7  * the Free Software Foundation; either version 3, or (at your option)
8  * 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 #ifndef INCLUDED_CCSDS_DECODELDPC_IMPL_H
22 #define INCLUDED_CCSDS_DECODELDPC_IMPL_H
23 
24 #include <ccsds/decodeLDPC.h>
25 //#include "fec/ldpc/soft_decoder.h"
26 #include "fec/ldpc/checknode.h"
27 #include "fec/ldpc/variablenode.h"
28 #include "fec/ldpc/ldpc.h"
29 #include <cassert>
30 #include <gnuradio/blocks/pack_k_bits.h>
31 namespace gr {
32  namespace ccsds {
33 
34  class decodeLDPC_impl : public decodeLDPC
35  {
36  private:
37  int d_iterations;
38  float d_sigma;
39  int d_update_sigma;
40  int d_code_type;
41  bool d_pack;
42  blocks::kernel::pack_k_bits *d_pack_8;
43  int punct;
44  string d_file;
45  pmt::pmt_t d_in_port;
46  pmt::pmt_t d_out_port;
47  int** H; //Parity matrix
48  //double *inputData;
49  ldpc *ccsdsLDPC;
50  std::vector<unsigned char> decodeFullC2(std::vector<float> softBits);
51  std::vector<unsigned char> decodeExpC2(std::vector<float> softBits);
52  std::vector<unsigned char> decodeAR4JA(std::vector<float> softBits);
53  std::vector<unsigned char> (decodeLDPC_impl::*ldpcDecode)(std::vector<float> input);
54  std::vector<unsigned char> slice(std::vector<float> logapp);
55 
56  public:
57  decodeLDPC_impl(std::string alist_file, int code_type, int iterations, float sigma, int update_sigma,int pack);
59  void decode(pmt::pmt_t msg);
60 
61  // Where all the action really happens
62  int work(int noutput_items,
63  gr_vector_const_void_star &input_items,
64  gr_vector_void_star &output_items);
65  };
66 
67  } // namespace ccsds
68 } // namespace gr
69 
70 #endif /* INCLUDED_CCSDS_DECODELDPC_IMPL_H */
71 
void decode(pmt::pmt_t msg)
Definition: cc_depuncture.h:28
Definition: examples/LDPC/ldpc_2/ldpc_decoder/ldpc.h:11
Definition: decodeLDPC_impl.h:34
<+description of block+>
Definition: decodeLDPC.h:36
decodeLDPC_impl(std::string alist_file, int code_type, int iterations, float sigma, int update_sigma, int pack)
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)