GNU Radio Manual and C++ API Reference  3.10.9.1
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  * SPDX-License-Identifier: GPL-3.0-or-later
8  *
9  */
10 
11 
12 #ifndef INCLUDED_POLAR_FEC_DECODER_SC_LIST_H
13 #define INCLUDED_POLAR_FEC_DECODER_SC_LIST_H
14 
15 #include <gnuradio/fec/api.h>
17 
18 namespace gr {
19 namespace fec {
20 namespace code {
21 
22 namespace polar {
23 class scl_list;
24 } // namespace polar
25 
26 /*!
27  * \brief Successive cancellation list (SCL) decoder for polar
28  * codes.
29  *
30  * \details
31  * Decoder is based on Tal, Vardy "List Decoding of Polar Codes",
32  * 2012 LLR version: Balatsoukas-Stimming, Parizi, Burg "LLR-based
33  * Successive Cancellation List Decoding of Polar Codes", 2015.
34  *
35  * Block expects float input with bits mapped 1 --> 1, 0 --> -1
36  * Or: f = 2.0 * bit - 1.0
37  */
39 {
40 public:
41  /*!
42  * \param max_list_size caps number of followed decoding paths.
43  * \param block_size codeword size. MUST be a power of 2.
44  * \param num_info_bits represents the number of information
45  * bits in a block. Also called frame_size. <= block_size
46  * \param frozen_bit_positions is an integer vector which
47  * defines the position of all frozen bits in a block.
48  * Its size MUST be equal to block_size - num_info_bits.
49  * Also it must be sorted and every position must only
50  * occur once.
51  * \param frozen_bit_values holds an unpacked byte for every
52  * frozen bit position. It defines if a frozen bit is
53  * fixed to '0' or '1'. Defaults to all ZERO.
54  */
55  static generic_decoder::sptr make(int max_list_size,
56  int block_size,
57  int num_info_bits,
58  std::vector<int> frozen_bit_positions,
59  std::vector<uint8_t> frozen_bit_values);
61 
62  // FECAPI
63  void generic_work(void* in_buffer, void* out_buffer) override;
64 
65 private:
66  polar_decoder_sc_list(int max_list_size,
67  int block_size,
68  int num_info_bits,
69  std::vector<int> frozen_bit_positions,
70  std::vector<uint8_t> frozen_bit_values);
71 
72  // Pointer because it's an impl type.
73  const std::unique_ptr<polar::scl_list> d_scl;
74 
75  void initialize_list(const float* in_buf);
76  const unsigned char* decode_list();
77  void decode_bit(const int u_num);
78  void calculate_llrs_for_list(const int u_num);
79  void set_bit_in_list(const int u_num);
80 };
81 
82 } // namespace code
83 } // namespace fec
84 } // namespace gr
85 
86 #endif /* INCLUDED_POLAR_FEC_DECODER_SC_LIST_H */
Class holds common methods and attributes for different decoder implementations.
Definition: polar_decoder_common.h:28
Successive cancellation list (SCL) decoder for polar codes.
Definition: polar_decoder_sc_list.h:39
static generic_decoder::sptr make(int max_list_size, int block_size, int num_info_bits, std::vector< int > frozen_bit_positions, std::vector< uint8_t > frozen_bit_values)
void generic_work(void *in_buffer, void *out_buffer) override
std::shared_ptr< generic_decoder > sptr
Definition: generic_decoder.h:62
#define FEC_API
Definition: gr-fec/include/gnuradio/fec/api.h:18
GNU Radio logging wrapper.
Definition: basic_block.h:29