23 #ifndef INCLUDED_GSM_CONSTANTS_H
24 #define INCLUDED_GSM_CONSTANTS_H
26 #define GSM_SYMBOL_RATE (1625000.0/6.0) //symbols per second
27 #define GSM_SYMBOL_PERIOD (1.0/GSM_SYMBOL_RATE) //seconds per symbol
32 #define GUARD_FRACTIONAL 0.25 //fractional part of guard period
33 #define GUARD_PERIOD GUARD_BITS + GUARD_FRACTIONAL
34 #define DATA_BITS 57 //size of 1 data block in normal burst
35 #define STEALING_BIT 1
36 #define N_TRAIN_BITS 26
37 #define N_SYNC_BITS 64
38 #define USEFUL_BITS 142 //(2*(DATA_BITS+STEALING_BIT) + N_TRAIN_BITS )
39 #define FCCH_BITS USEFUL_BITS
40 #define BURST_SIZE (USEFUL_BITS+2*TAIL_BITS)
41 #define PROCESSED_CHUNK BURST_SIZE+2*GUARD_PERIOD
43 #define SCH_DATA_LEN 39
44 #define TS_BITS (TAIL_BITS+USEFUL_BITS+TAIL_BITS+GUARD_BITS) //a full TS (156 bits)
45 #define TS_PER_FRAME 8
46 #define FRAME_BITS (TS_PER_FRAME * TS_BITS + 2) // 156.25 * 8
47 #define FCCH_POS TAIL_BITS
49 #define TRAIN_POS ( TAIL_BITS + (DATA_BITS+STEALING_BIT) + 5) //first 5 bits of a training sequence
51 #define TRAIN_BEGINNING 5
52 #define SAFETY_MARGIN 6 //
54 #define FCCH_HITS_NEEDED (USEFUL_BITS - 4)
55 #define FCCH_MAX_MISSES 1
56 #define FCCH_MAX_FREQ_OFFSET 100
58 #define CHAN_IMP_RESP_LENGTH 5
60 #define MAX_SCH_ERRORS 10 //maximum number of subsequent sch errors after which gsm receiver goes to find_next_fcch state
66 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0,
67 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1,
68 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1,
69 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1
77 const unsigned TEST_CCH_FRAMES[] = {2, 3, 4, 5, 6, 7, 8, 9, 12, 13, 14, 15, 16, 17, 18, 19, 22, 23, 24, 25, 26, 27, 28, 29, 32, 33, 34, 35, 36, 37, 38, 39, 42, 43, 44, 45, 46, 47, 48, 49};
78 const unsigned TRAFFIC_CHANNEL_F[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24};
79 const unsigned TEST51[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50};
92 #define TRAIN_SEQ_NUM 9
105 {0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1},
106 {0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1},
107 {0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0},
108 {0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0},
109 {0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1},
110 {0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0},
111 {1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1},
112 {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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
165 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0,
166 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0,
167 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0,
168 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0,
169 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0,
170 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0,
171 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0,
172 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0,
173 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0
Definition: gsm_constants.h:63
const unsigned BCCH_FRAMES[]
Definition: gsm_constants.h:75
Definition: gsm_constants.h:62
static const unsigned char dummy_burst[]
Definition: gsm_constants.h:118
Definition: gsm_constants.h:63
Definition: gsm_constants.h:62
const unsigned FCCH_FRAMES[]
Definition: gsm_constants.h:72
#define N_TRAIN_BITS
Definition: gsm_constants.h:36
#define TRAIN_SEQ_NUM
Definition: gsm_constants.h:92
burst_type
Definition: gsm_constants.h:62
const unsigned TEST51[]
Definition: gsm_constants.h:79
static const unsigned char SYNC_BITS[]
Definition: gsm_constants.h:65
const unsigned SCH_FRAMES[]
Definition: gsm_constants.h:73
Definition: gsm_constants.h:62
Definition: gsm_constants.h:62
Definition: gsm_constants.h:62
static const unsigned char fc_fb[]
Definition: gsm_constants.h:150
multiframe_type
Definition: gsm_constants.h:63
Definition: gsm_constants.h:62
Definition: gsm_constants.h:62
static const unsigned char fc_compact_fb[]
Definition: gsm_constants.h:164
Definition: gsm_constants.h:63
static const unsigned char train_seq[TRAIN_SEQ_NUM][N_TRAIN_BITS]
Definition: gsm_constants.h:104
Definition: gsm_constants.h:62
const unsigned TEST_CCH_FRAMES[]
!the receiver shouldn't care about logical !channels so this will be removed from this header ...
Definition: gsm_constants.h:77
const unsigned TRAFFIC_CHANNEL_F[]
Definition: gsm_constants.h:78