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"
31#include "openbts/ViterbiR204.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
46namespace gr {
47 namespace gsm {
48
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);
94 };
95
96 } // namespace gsm
97} // namespace gr
98
99#endif /* INCLUDED_GSM_TCH_F_DECODER_IMPL_H */
100
Definition: BitVector.h:116
Definition: BitVector.h:92
Definition: BitVector.h:328
Definition: Viterbi.h:26
Definition: ViterbiR204.h:32
Definition: tch_f_decoder_impl.h:50
tch_f_decoder_impl(tch_mode mode, bool boundary_check=false)
<+description of block+>
Definition: tch_f_decoder.h:54
tch_mode
Definition: tch_f_decoder.h:34
Definition: constants.h:29
#define iBLOCK_SIZE
Definition: tch_f_decoder_impl.h:44
#define CONV_SIZE
Definition: tch_f_decoder_impl.h:41
#define BLOCKS
Definition: tch_f_decoder_impl.h:43