GNU Radio's SATNOGS Package
conv_encoder.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * gr-satnogs: SatNOGS GNU Radio Out-Of-Tree Module
4 *
5 * Copyright (C) 2021, Libre Space Foundation <http://libre.space>
6 *
7 * This program 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 of the License, or
10 * (at your option) any later version.
11 *
12 * This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef INCLUDED_SATNOGS_CONV_ENCODER_H
22#define INCLUDED_SATNOGS_CONV_ENCODER_H
23
25#include <itpp/base/array.h>
26#include <itpp/comm/convcode.h>
27#include <itpp/comm/reedsolomon.h>
28#include <cstddef>
29#include <cstdint>
30#include <cstdlib>
31
32namespace gr {
33namespace satnogs {
34
36{
37
38 /**
39 * \brief SATNOGS compatible convolutional encoder with puncturing support
40 *
41 */
42public:
43 typedef enum { RATE_1_2 = 0, RATE_2_3, RATE_3_4, RATE_5_6, RATE_7_8 } coding_rate_t;
44
45 conv_encoder(coding_rate_t cc_rate, size_t max_frame_len);
47
48 size_t encode(uint8_t* out, const uint8_t* in, size_t len);
49
50 size_t encode_trunc(uint8_t* out, const uint8_t* in, size_t len);
51
52 void reset();
53
54 size_t finalize(uint8_t* out);
55
56private:
57 coding_rate_t d_cc_rate;
58 itpp::Convolutional_Code d_conv_code;
59 itpp::ivec d_cc_generator;
60
61 size_t inv_and_puncture(uint8_t* out, const itpp::bvec& in);
62};
63
64} // namespace satnogs
65} // namespace gr
66
67#endif /* INCLUDED_SATNOGS_CONV_ENCODER_H */
#define SATNOGS_API
Definition: api.h:19
Definition: conv_encoder.h:36
size_t encode_trunc(uint8_t *out, const uint8_t *in, size_t len)
size_t finalize(uint8_t *out)
conv_encoder(coding_rate_t cc_rate, size_t max_frame_len)
coding_rate_t
SATNOGS compatible convolutional encoder with puncturing support.
Definition: conv_encoder.h:43
size_t encode(uint8_t *out, const uint8_t *in, size_t len)
Definition: amsat_duv_decoder.h:29