blob: 06baa629f04bbc636b8260ca2d35417405f6de02 [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: BCCH + CCCH demapper
25# Author: Piotr Krysik
26# Description: Demapper for BCCH + CCCH control channels. This corresponds to channel combination iv specified in GSM 05.02, section 6.4
Piotr Krysike5bd4b82016-05-23 09:43:05 +020027# Generated: Mon May 23 09:32:44 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_bcch_ccch_demapper(gr.hier_block2):
Piotr Krysik773a1942016-05-20 12:45:54 +020036
37 def __init__(self, timeslot_nr=0):
Vasil Velichkov46c90be2019-09-02 04:06:41 +030038 gr.hier_block2.__init__(
Piotr Krysik773a1942016-05-20 12:45:54 +020039 self, "BCCH + CCCH 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 Velichkovfa184a92019-07-25 22:43:33 +030054
55 # 3GPP TS 45.002 version 15.1.0 Release 15
56 # Table 3 : Mapping of logical channels onto physical channels (see subclauses 6.3, 6.4, 6.5)
57 # BCCH Norm D 0,2,4,6 C0 NB 51 B(2..5)
58 # RACH U 0,2,4,6 C0 AB, Extended AB2 51 B0(0),B1(1)..B50(50)
59 # Figure 8a: TDMA frame mapping for FCCH + SCH + BCCH + CCCH
60 self.gsm_universal_ctrl_chans_demapper_0 = grgsm.universal_ctrl_chans_demapper(
61 timeslot_nr, ([ #downlink
62 0,0,
63 2,2,2,2,
64 6,6,6,6,
65 0,0,
66 12,12,12,12,
67 16,16,16,16,
68 0,0,
69 22,22,22,22,
70 26,26,26,26,
71 0,0,
72 32,32,32,32,
73 36,36,36,36,
74 0,0,
75 42,42,42,42,
76 46,46,46,46,
77 0,
78 ]), ([
79 0,0,
80 1,1,1,1,
81 2,2,2,2,
82 0,0,
83 2,2,2,2,
84 2,2,2,2,
85 0,0,
86 2,2,2,2,
87 2,2,2,2,
88 0,0,
89 2,2,2,2,
90 2,2,2,2,
91 0,0,
92 2,2,2,2,
93 2,2,2,2,
94 0,
95 ]), ([
96 0,0,
97 0,0,0,0,
98 0,0,0,0,
99 0,0,
100 1,1,1,1,
101 2,2,2,2,
102 0,0,
103 3,3,3,3,
104 4,4,4,4,
105 0,0,
106 5,5,5,5,
107 6,6,6,6,
108 0,0,
109 7,7,7,7,
110 8,8,8,8,
111 0,
112 0,0,0,0,
113 0,0,0,0,
114 0,0,0,0,
115 1,1,1,1,
116 2,2,2,2,
117 0,0,
118 3,3,3,3,
119 4,4,4,4,
120 0,0,
121 5,5,5,5,
122 6,6,6,6,
123 0,0,
124 7,7,7,7,
125 8,8,8,8,
126 0,
127 ]), ([ #uplink
128 0,1,2,3,
129 4,5,6,7,
130 8,9,10,11,
131 12,13,14,15,
132 16,17,18,19,
133 20,21,22,23,
134 24,25,26,27,
135 28,29,30,31,
136 32,33,34,35,
137 36,37,38,39,
138 40,41,42,43,
139 44,45,46,47,
140 48,49,50,
141 ]), ([
142 3,3,3,3,
143 3,3,3,3,
144 3,3,3,3,
145 3,3,3,3,
146 3,3,3,3,
147 3,3,3,3,
148 3,3,3,3,
149 3,3,3,3,
150 3,3,3,3,
151 3,3,3,3,
152 3,3,3,3,
153 3,3,3,3,
154 3,3,3,
155 ]), ([
156 0,0,0,0,
157 0,0,0,0,
158 0,0,0,0,
159 0,0,0,0,
160 0,0,0,0,
161 0,0,0,0,
162 0,0,0,0,
163 0,0,0,0,
164 0,0,0,0,
165 0,0,0,0,
166 0,0,0,0,
167 0,0,0,0,
168 0,0,0,
169 0,0,0,0,
170 0,0,0,0,
171 0,0,0,0,
172 0,0,0,0,
173 0,0,0,0,
174 0,0,0,0,
175 0,0,0,0,
176 0,0,0,0,
177 0,0,0,0,
178 0,0,0,0,
179 0,0,0,0,
180 0,0,0,0,
181 0,0,0,
182 ]))
Piotr Krysik773a1942016-05-20 12:45:54 +0200183
184 ##################################################
185 # Connections
186 ##################################################
187 self.msg_connect((self.gsm_universal_ctrl_chans_demapper_0, 'bursts'), (self, 'bursts'))
188 self.msg_connect((self, 'bursts'), (self.gsm_universal_ctrl_chans_demapper_0, 'bursts'))
189
190 def get_timeslot_nr(self):
191 return self.timeslot_nr
192
193 def set_timeslot_nr(self, timeslot_nr):
194 self.timeslot_nr = timeslot_nr