GNU Radio's SATNOGS Package
golay24.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) 2016, 2017, 2018
6  * Libre Space Foundation <http://librespacefoundation.org/>
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef INCLUDED_SATNOGS_GOLAY24_H
23 #define INCLUDED_SATNOGS_GOLAY24_H
24 
25 #include <satnogs/api.h>
26 
27 #include <cstdint>
28 #include <vector>
29 
30 namespace gr {
31 namespace satnogs {
32 
33 /*!
34  * \brief A binary Golay (24,12,8) encoder and decoder.
35  *
36  * A binary Golay (24,12,8) encoder and decoder. The implementation uses LUT
37  * based on the process described in the book:
38  *
39  * Morelos-Zaragoza, Robert H. The art of error correcting coding.
40  * John Wiley & Sons, 2006.
41  *
42  */
44 public:
45  golay24();
46  ~golay24();
47 
48  static const std::vector<uint32_t> G_P;
49  static const std::vector<uint32_t> G_I;
50 
51  uint32_t
52  encode12(uint16_t in, bool lsb_parity = true);
53 
54  bool
55  decode24(uint32_t *out, uint32_t in);
56 
57 };
58 
59 } // namespace satnogs
60 } // namespace gr
61 
62 #endif /* INCLUDED_SATNOGS_GOLAY24_H */
63 
static const std::vector< uint32_t > G_P
Definition: golay24.h:48
static const std::vector< uint32_t > G_I
Definition: golay24.h:49
Definition: amsat_duv_decoder.h:29
#define SATNOGS_API
Definition: api.h:30
A binary Golay (24,12,8) encoder and decoder.
Definition: golay24.h:43