GNU Radio Manual and C++ API Reference  3.8.1.0
The Free & Open Software Radio Ecosystem
polar_decoder_sc_list.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  * GNU Radio is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3, or (at your option)
10  * any later version.
11  *
12  * GNU Radio is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with GNU Radio; see the file COPYING. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 
24 #ifndef INCLUDED_POLAR_FEC_DECODER_SC_LIST_H
25 #define INCLUDED_POLAR_FEC_DECODER_SC_LIST_H
26 
27 #include <gnuradio/fec/api.h>
29 
30 namespace gr {
31 namespace fec {
32 namespace code {
33 
34 namespace polar {
35 class scl_list;
36 class path;
37 } // namespace polar
38 
39 /*!
40  * \brief Successive cancellation list (SCL) decoder for polar
41  * codes.
42  *
43  * \details
44  * Decoder is based on Tal, Vardy "List Decoding of Polar Codes",
45  * 2012 LLR version: Balatsoukas-Stimming, Parizi, Burg "LLR-based
46  * Successive Cancellation List Decoding of Polar Codes", 2015.
47  *
48  * Block expects float input with bits mapped 1 --> 1, 0 --> -1
49  * Or: f = 2.0 * bit - 1.0
50  */
52 {
53 public:
54  /*!
55  * \param max_list_size caps number of followed decoding paths.
56  * \param block_size codeword size. MUST be a power of 2.
57  * \param num_info_bits represents the number of information
58  * bits in a block. Also called frame_size. <= block_size
59  * \param frozen_bit_positions is an integer vector which
60  * defines the position of all frozen bits in a block.
61  * Its size MUST be equal to block_size - num_info_bits.
62  * Also it must be sorted and every position must only
63  * occur once.
64  * \param frozen_bit_values holds an unpacked byte for every
65  * frozen bit position. It defines if a frozen bit is
66  * fixed to '0' or '1'. Defaults to all ZERO.
67  */
68  static generic_decoder::sptr make(int max_list_size,
69  int block_size,
70  int num_info_bits,
71  std::vector<int> frozen_bit_positions,
72  std::vector<char> frozen_bit_values);
74 
75  // FECAPI
76  void generic_work(void* in_buffer, void* out_buffer);
77 
78 private:
79  polar_decoder_sc_list(int max_list_size,
80  int block_size,
81  int num_info_bits,
82  std::vector<int> frozen_bit_positions,
83  std::vector<char> frozen_bit_values);
84 
85  polar::scl_list* d_scl;
86 
87  void initialize_list(const float* in_buf);
88  const unsigned char* decode_list();
89  void decode_bit(const int u_num);
90  void calculate_llrs_for_list(const int u_num);
91  void set_bit_in_list(const int u_num);
92 };
93 
94 } // namespace code
95 } // namespace fec
96 } // namespace gr
97 
98 #endif /* INCLUDED_POLAR_FEC_DECODER_SC_LIST_H */
Successive cancellation list (SCL) decoder for polar codes.
Definition: polar_decoder_sc_list.h:51
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition: basic_block.h:43
Class holds common methods and attributes for different decoder implementations.
Definition: polar_decoder_common.h:39
#define FEC_API
Definition: gr-fec/include/gnuradio/fec/api.h:30
boost::shared_ptr< generic_decoder > sptr
Definition: generic_decoder.h:75