GNU Radio's GSM Package: tch_f_decoder_impl.h Source File

GNU Radio's GSM Package

tch_f_decoder_impl.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3 * @file
4 * @author (C) 2015 by Roman Khassraf <rkhassraf@gmail.com>
5 * @section LICENSE
6 *
7 * Gr-gsm 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 * Gr-gsm 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 gr-gsm; 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 #ifndef INCLUDED_GSM_TCH_F_DECODER_IMPL_H
24 #define INCLUDED_GSM_TCH_F_DECODER_IMPL_H
25
26 #include "openbts/AmrCoder.h"
27 #include "openbts/BitVector.h"
28 #include "openbts/GSM503Tables.h"
29 #include "openbts/GSM610Tables.h"
30 #include "openbts/GSM660Tables.h"
31 #include "openbts/ViterbiR204.h"
32 #include <grgsm/decoding/tch_f_decoder.h>
33
34
35 #define DATA_BLOCK_SIZE 184
36 #define PARITY_SIZE 40
37 #define FLUSH_BITS_SIZE 4
38 #define PARITY_OUTPUT_SIZE (DATA_BLOCK_SIZE + PARITY_SIZE + FLUSH_BITS_SIZE)
39
40 #define CONV_INPUT_SIZE PARITY_OUTPUT_SIZE
41 #define CONV_SIZE (2 * CONV_INPUT_SIZE)
42
43 #define BLOCKS 8
44 #define iBLOCK_SIZE (CONV_SIZE / BLOCKS)
45
46 namespace gr {
47 namespace gsm {
48
49 class tch_f_decoder_impl : public tch_f_decoder
50 {
51 private:
52 unsigned int d_collected_bursts_num;
53 unsigned short interleave_trans[CONV_SIZE];
54 pmt::pmt_t d_bursts[8];
55 enum tch_mode d_tch_mode;
56 bool d_boundary_check;
57 bool d_boundary_decode;
58 bool d_header_sent;
59
60 BitVector mU;
61 BitVector mP;
62 BitVector mD;
63 BitVector mDP;
64 BitVector mTCHU;
65 BitVector mTCHD;
66 BitVector mClass1A_d;
67 SoftVector mC;
68 SoftVector mClass1_c;
69 SoftVector mClass2_c;
70 SoftVector mTCHUC;
71
72 Parity mBlockCoder;
73 Parity mTCHParity;
74
75 ViterbiR2O4 mVR204Coder;
76 ViterbiBase *mViterbi;
77
78 unsigned char iBLOCK[2*BLOCKS*iBLOCK_SIZE];
79 unsigned char mAMRFrameHeader;
80
81 const unsigned *mAMRBitOrder;
82 const unsigned *mPuncture;
83 unsigned mClass1ALth;
84 unsigned mClass1BLth;
85 unsigned mPunctureLth;
86 uint8_t mAMRFrameLth;
87 uint8_t mKd;
88
89 void decode(pmt::pmt_t msg);
90 void setCodingMode(tch_mode mode);
91 public:
92 tch_f_decoder_impl(tch_mode mode, bool boundary_check=false);
93 ~tch_f_decoder_impl();
94 };
95
96 } // namespace gsm
97 } // namespace gr
98
99 #endif /* INCLUDED_GSM_TCH_F_DECODER_IMPL_H */
100
GSM610Tables.h
GSM503Tables.h
gr::gsm::tch_mode
tch_mode
Definition: tch_f_decoder.h:33
Parity
Definition: BitVector.h:92
gr::gsm::tch_f_decoder_impl::~tch_f_decoder_impl
~tch_f_decoder_impl()
AmrCoder.h
gr::gsm::tch_f_decoder_impl::tch_f_decoder_impl
tch_f_decoder_impl(tch_mode mode, bool boundary_check=false)
BitVector
Definition: BitVector.h:115
BitVector.h
GSM660Tables.h
BLOCKS
#define BLOCKS
Definition: tch_f_decoder_impl.h:43
SoftVector
Definition: BitVector.h:328
CONV_SIZE
#define CONV_SIZE
Definition: tch_f_decoder_impl.h:41
iBLOCK_SIZE
#define iBLOCK_SIZE
Definition: tch_f_decoder_impl.h:44
gr
Definition: constants.h:29
ViterbiR2O4
Definition: ViterbiR204.h:32
gr::gsm::tch_f_decoder_impl
Definition: tch_f_decoder_impl.h:49
ViterbiBase
Definition: Viterbi.h:26
tch_f_decoder.h
ViterbiR204.h
gr::gsm::tch_f_decoder
<+description of block+>
Definition: tch_f_decoder.h:52