GNU Radio Manual and C++ API Reference 3.10.5.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
14typedef float INPUT_DATATYPE;
15typedef unsigned char OUTPUT_DATATYPE;
16
18#include <map>
19#include <string>
20#include <vector>
21
22#include <gnuradio/fec/alist.h>
24#include <gnuradio/fec/cldpc.h>
25
26namespace gr {
27namespace fec {
28
29
30#define MAXLOG 1e7
31
33{
34private:
35 // private constructor
36 ldpc_decoder(std::string alist_file, float sigma, 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
51public:
52 ~ldpc_decoder() override;
53
54 double rate() override;
55 bool set_frame_size(unsigned int frame_size) override;
56
58 make(std::string alist_file, float sigma = 0.5, int max_iterations = 50);
59
60 int get_output_size() override;
61 int get_input_size() override;
62 int get_input_item_size() override;
63 int get_output_item_size() override;
64 float get_iterations() override { return d_iterations; }
65};
66
67} // namespace fec
68} // namespace gr
69
70#endif /* INCLUDED_LDPC_DECODER_H */
Definition: alist.h:32
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
double rate() override
bool set_frame_size(unsigned int frame_size) override
static generic_decoder::sptr make(std::string alist_file, float sigma=0.5, int max_iterations=50)
int get_input_item_size() override
float get_iterations() override
Definition: ldpc_decoder.h:64
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