GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem
ldpc_decoder.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2015 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_LDPC_DECODER_H
12 #define INCLUDED_LDPC_DECODER_H
13 
14 typedef float INPUT_DATATYPE;
15 typedef unsigned char OUTPUT_DATATYPE;
16 
17 #include <gnuradio/fec/decoder.h>
18 #include <map>
19 #include <string>
20 #include <vector>
21 
22 #include <gnuradio/fec/alist.h>
23 #include <gnuradio/fec/awgn_bp.h>
24 #include <gnuradio/fec/cldpc.h>
25 
26 namespace gr {
27 namespace fec {
28 
29 
30 #define MAXLOG 1e7
31 
33 {
34 private:
35  // private constructor
36  ldpc_decoder(std::string alist_file, int max_iterations);
37 
38  // plug into the generic fec api
39  int get_history() override;
40  float get_shift() override;
41  const char* get_conversion();
42  void generic_work(void* inBuffer, void* outbuffer) override;
43  float d_iterations;
44  int d_input_size, d_output_size;
45  double d_rate;
46 
47  alist d_list;
48  cldpc d_code;
49  awgn_bp d_spa;
50 
51 public:
52  ~ldpc_decoder() override;
53 
54  double rate() override;
55  bool set_frame_size(unsigned int frame_size) override;
56 
57  static generic_decoder::sptr make(std::string alist_file, int max_iterations = 50);
58 
59  int get_output_size() override;
60  int get_input_size() override;
61  int get_input_item_size() override;
62  int get_output_item_size() override;
63  float get_iterations() override { return d_iterations; }
64 };
65 
66 } // namespace fec
67 } // namespace gr
68 
69 #endif /* INCLUDED_LDPC_DECODER_H */
Definition: alist.h:33
Definition: awgn_bp.h:34
Definition: cldpc.h:23
Parent class for FECAPI objects.
Definition: generic_decoder.h:48
std::shared_ptr< generic_decoder > sptr
Definition: generic_decoder.h:62
Definition: ldpc_decoder.h:33
~ldpc_decoder() override
static generic_decoder::sptr make(std::string alist_file, int max_iterations=50)
double rate() override
bool set_frame_size(unsigned int frame_size) override
int get_input_item_size() override
float get_iterations() override
Definition: ldpc_decoder.h:63
int get_output_item_size() override
int get_input_size() override
int get_output_size() override
#define FEC_API
Definition: gr-fec/include/gnuradio/fec/api.h:18
float INPUT_DATATYPE
Definition: ldpc_decoder.h:14
unsigned char OUTPUT_DATATYPE
Definition: ldpc_decoder.h:15
FEC_API int get_history(generic_decoder::sptr my_decoder)
FEC_API float get_shift(generic_decoder::sptr my_decoder)
GNU Radio logging wrapper.
Definition: basic_block.h:29