blob: 30450bfb596645704b0e3c1f2e081928c01f0e0a [file] [log] [blame]
Piotr Krysikea34c012016-10-02 18:53:43 +02001#!/usr/bin/env python2
Piotr Krysik773a1942016-05-20 12:45:54 +02002# -*- coding: utf-8 -*-
Piotr Krysikea34c012016-10-02 18:53:43 +02003# @file
Piotr Krysika6268a52017-08-23 16:02:19 +02004# @author (C) 2016 by Piotr Krysik <ptrkrysik@gmail.com>
Piotr Krysikea34c012016-10-02 18:53:43 +02005# @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#
Piotr Krysik773a1942016-05-20 12:45:54 +020022##################################################
23# GNU Radio Python Flow Graph
24# Title: SDCCH/8 demapper
25# Author: Piotr Krysik
26# Description: Demapper for SDCCH/8 + SACCH/C8 control channels. This corresponds to channel combination vii specified in GSM 05.02, section 6.4
Piotr Krysike5bd4b82016-05-23 09:43:05 +020027# Generated: Mon May 23 09:32:48 2016
Piotr Krysik773a1942016-05-20 12:45:54 +020028##################################################
29
30from gnuradio import gr
31from gnuradio.filter import firdes
32import grgsm
33
34
Vasil Velichkov46c90be2019-09-02 04:06:41 +030035class gsm_sdcch8_demapper(gr.hier_block2):
Piotr Krysik773a1942016-05-20 12:45:54 +020036
37 def __init__(self, timeslot_nr=1):
Vasil Velichkov46c90be2019-09-02 04:06:41 +030038 gr.hier_block2.__init__(
Piotr Krysik773a1942016-05-20 12:45:54 +020039 self, "SDCCH/8 demapper",
40 gr.io_signature(0, 0, 0),
41 gr.io_signature(0, 0, 0),
42 )
43 self.message_port_register_hier_in("bursts")
44 self.message_port_register_hier_out("bursts")
45
46 ##################################################
47 # Parameters
48 ##################################################
49 self.timeslot_nr = timeslot_nr
50
51 ##################################################
52 # Blocks
53 ##################################################
Vasil Velichkovc895bf22019-07-24 22:42:40 +030054
55 # 3GPP TS 45.002 version 15.1.0 Release 15
56 # Table 4 : Mapping of logical channels onto physical channels (see subclauses 6.3, 6.4, 6.5)
57 # SDCCH/8 0 D 0 ... 7 C0 ... Cn NB1 51 B (0 ... 3)
58 # U B (15 ... 18)
59 # 1 D B (4 ... 7)
60 # U B (19 ... 22)
61 # 2 D B (8 ... 11)
62 # U B (23 ... 26)
63 # 3 D B (12 ... 15)
64 # U B (27 ... 30)
65 # 4 D B (16 ... 19)
66 # U B (31 ... 34)
67 # 5 D B (20 ... 23)
68 # U B (35 ... 38)
69 # 6 D B (24 ... 27)
70 # U B (39 ... 42)
71 # 7 D B (28 ... 31)
72 # U B (43 ... 46)
73 # SACCH/C8 0 D 0 ... 7 C0 ... Cn NB3 102 B (32 ... 35)
74 # U B (47 ... 50)
75 # 1 D B (36 ... 39)
76 # U B (51 ... 54)
77 # 2 D B (40 ... 43)
78 # U B (55 ... 58)
79 # 3 D B (44 ... 47)
80 # U B (59 ... 62)
81 # 4 D B (83 ... 86)
82 # U B (98 ... 101)
83 # 5 D B (87 ... 90)
84 # U B (0 ... 3)
85 # 6 D B (91 ... 94)
86 # U B (4 ... 7)
87 # 7 D B (95 ... 98)
88 # U B (8 ... 11)
89 self.gsm_universal_ctrl_chans_demapper_0 = grgsm.universal_ctrl_chans_demapper(
90 timeslot_nr, ([ #downlink
91 0,0,0,0,
92 4,4,4,4,
93 8,8,8,8,
94 12,12,12,12,
95 16,16,16,16,
96 20,20,20,20,
97 24,24,24,24,
98 28,28,28,28,
99 32,32,32,32,
100 36,36,36,36,
101 40,40,40,40,
102 44,44,44,44,
103 0,0,0
104 ]), ([
105 8,8,8,8,
106 8,8,8,8,
107 8,8,8,8,
108 8,8,8,8,
109 8,8,8,8,
110 8,8,8,8,
111 8,8,8,8,
112 8,8,8,8,
113 136,136,136,136,
114 136,136,136,136,
115 136,136,136,136,
116 136,136,136,136,
117 0,0,0
118 ]), ([
119 0,0,0,0,
120 1,1,1,1,
121 2,2,2,2,
122 3,3,3,3,
123 4,4,4,4,
124 5,5,5,5,
125 6,6,6,6,
126 7,7,7,7,
127 0,0,0,0,
128 1,1,1,1,
129 2,2,2,2,
130 3,3,3,3,
131 0,0,0,0,
132 0,0,0,
133 1,1,1,1,
134 2,2,2,2,
135 3,3,3,3,
136 4,4,4,4,
137 5,5,5,5,
138 6,6,6,6,
139 7,7,7,7,
140 4,4,4,4,
141 5,5,5,5,
142 6,6,6,6,
143 7,7,7,7,
144 0,0,0
145 ]), ([ #uplink
146 0,0,0,0,
147 4,4,4,4,
148 8,8,8,8,
149 0,0,0,
150 15,15,15,15,
151 19,19,19,19,
152 23,23,23,23,
153 27,27,27,27,
154 31,31,31,31,
155 35,35,35,35,
156 39,39,39,39,
157 43,43,43,43,
158 47,47,47,47
159 ]), ([
160 136,136,136,136,
161 136,136,136,136,
162 136,136,136,136,
163 0,0,0,
164 8,8,8,8,
165 8,8,8,8,
166 8,8,8,8,
167 8,8,8,8,
168 8,8,8,8,
169 8,8,8,8,
170 8,8,8,8,
171 8,8,8,8,
172 136,136,136,136
173 ]), ([
174 5,5,5,5,
175 6,6,6,6,
176 7,7,7,7,
177 0,0,0,
178 0,0,0,0,
179 1,1,1,1,
180 2,2,2,2,
181 3,3,3,3,
182 4,4,4,4,
183 5,5,5,5,
184 6,6,6,6,
185 7,7,7,7,
186 0,0,0,0,
187 1,1,1,1,
188 2,2,2,2,
189 3,3,3,3,
190 0,0,0,
191 0,0,0,0,
192 1,1,1,1,
193 2,2,2,2,
194 3,3,3,3,
195 4,4,4,4,
196 5,5,5,5,
197 6,6,6,6,
198 7,7,7,7,
199 4,4,4,4
200 ]))
Piotr Krysik773a1942016-05-20 12:45:54 +0200201
202 ##################################################
203 # Connections
204 ##################################################
205 self.msg_connect((self.gsm_universal_ctrl_chans_demapper_0, 'bursts'), (self, 'bursts'))
206 self.msg_connect((self, 'bursts'), (self.gsm_universal_ctrl_chans_demapper_0, 'bursts'))
207
208 def get_timeslot_nr(self):
209 return self.timeslot_nr
210
211 def set_timeslot_nr(self, timeslot_nr):
212 self.timeslot_nr = timeslot_nr