GNSS-SDR  0.0.19
An Open Source GNSS Software Defined Receiver
Galileo_INAV.h
Go to the documentation of this file.
1 /*!
2  * \file Galileo_INAV.h
3  * \brief Galileo INAV mesage constants
4  * \author Carles Fernandez, 2020. cfernandez(at)cttc.es
5  *
6  *
7  * -----------------------------------------------------------------------------
8  *
9  * GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
10  * This file is part of GNSS-SDR.
11  *
12  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
13  * SPDX-License-Identifier: GPL-3.0-or-later
14  *
15  * -----------------------------------------------------------------------------
16  */
17 
18 #ifndef GNSS_SDR_GALILEO_INAV_H
19 #define GNSS_SDR_GALILEO_INAV_H
20 
21 #include "MATH_CONSTANTS.h"
22 #include <cstddef>
23 #include <cstdint>
24 #include <utility>
25 #include <vector>
26 
27 /** \addtogroup Core
28  * \{ */
29 /** \addtogroup System_Parameters
30  * \{ */
31 
32 
33 // Galileo INAV message structure
34 constexpr double GALILEO_INAV_PAGE_PART_WITH_PREABLE_SECONDS = 2.04; //!< Page Duration + (Galileo I/NAV Preamble bits)*(Galileo E5b-I tiered Code Period(seconds))
35 constexpr uint32_t GALILEO_INAV_PAGE_SYMBOLS = 500; //!< The complete Galileo INAV page length
36 constexpr int32_t GALILEO_INAV_PREAMBLE_LENGTH_BITS = 10;
37 constexpr int32_t GALILEO_INAV_PREAMBLE_PERIOD_SYMBOLS = 250;
38 constexpr int32_t GALILEO_INAV_PAGE_PART_SYMBOLS = 250; //!< Each Galileo INAV pages are composed of two parts (even and odd) each of 250 symbols, including preamble. See Galileo ICD 4.3.2
39 constexpr int32_t GALILEO_INAV_PAGE_PART_SECONDS = 1; // a page part last 1 sec
40 constexpr int32_t GALILEO_INAV_PAGE_PART_MS = 1000; // a page part last 1 sec
41 constexpr int32_t GALILEO_INAV_PAGE_SECONDS = 2; // a full page last 2 sec
42 constexpr int32_t GALILEO_INAV_INTERLEAVER_ROWS = 8;
43 constexpr int32_t GALILEO_INAV_INTERLEAVER_COLS = 30;
44 constexpr int32_t GALILEO_TELEMETRY_RATE_BITS_SECOND = 250; // bps
45 constexpr int32_t GALILEO_PAGE_TYPE_BITS = 6;
46 constexpr int32_t GALILEO_DATA_JK_BITS = 128;
47 constexpr int32_t GALILEO_DATA_FRAME_BITS = 196;
48 constexpr int32_t GALILEO_DATA_FRAME_BYTES = 25;
49 constexpr char GALILEO_INAV_PREAMBLE[11] = "0101100000";
50 
51 const std::vector<std::pair<int32_t, int32_t>> TYPE({{1, 6}});
52 const std::vector<std::pair<int32_t, int32_t>> PAGE_TYPE_BIT({{1, 6}});
53 
54 /* Page 1 - Word type 1: Ephemeris (1/4) */
55 const std::vector<std::pair<int32_t, int32_t>> IOD_NAV_1_BIT({{7, 10}});
56 const std::vector<std::pair<int32_t, int32_t>> T0_E_1_BIT({{17, 14}});
57 constexpr int32_t T0E_1_LSB = 60;
58 const std::vector<std::pair<int32_t, int32_t>> M0_1_BIT({{31, 32}});
59 constexpr double M0_1_LSB = PI_TWO_N31;
60 const std::vector<std::pair<int32_t, int32_t>> E_1_BIT({{63, 32}});
61 constexpr double E_1_LSB = TWO_N33;
62 const std::vector<std::pair<int32_t, int32_t>> A_1_BIT({{95, 32}});
63 constexpr double A_1_LSB_GAL = TWO_N19;
64 // last two bits are reserved
65 
66 
67 /* Page 2 - Word type 2: Ephemeris (2/4) */
68 const std::vector<std::pair<int32_t, int32_t>> IOD_NAV_2_BIT({{7, 10}});
69 const std::vector<std::pair<int32_t, int32_t>> OMEGA_0_2_BIT({{17, 32}});
70 constexpr double OMEGA_0_2_LSB = PI_TWO_N31;
71 const std::vector<std::pair<int32_t, int32_t>> I_0_2_BIT({{49, 32}});
72 constexpr double I_0_2_LSB = PI_TWO_N31;
73 const std::vector<std::pair<int32_t, int32_t>> OMEGA_2_BIT({{81, 32}});
74 constexpr double OMEGA_2_LSB = PI_TWO_N31;
75 const std::vector<std::pair<int32_t, int32_t>> I_DOT_2_BIT({{113, 14}});
76 constexpr double I_DOT_2_LSB = PI_TWO_N43;
77 // last two bits are reserved
78 
79 /* Word type 3: Ephemeris (3/4) and SISA */
80 const std::vector<std::pair<int32_t, int32_t>> IOD_NAV_3_BIT({{7, 10}});
81 const std::vector<std::pair<int32_t, int32_t>> OMEGA_DOT_3_BIT({{17, 24}});
82 constexpr double OMEGA_DOT_3_LSB = PI_TWO_N43;
83 const std::vector<std::pair<int32_t, int32_t>> DELTA_N_3_BIT({{41, 16}});
84 constexpr double DELTA_N_3_LSB = PI_TWO_N43;
85 const std::vector<std::pair<int32_t, int32_t>> C_UC_3_BIT({{57, 16}});
86 constexpr double C_UC_3_LSB = TWO_N29;
87 const std::vector<std::pair<int32_t, int32_t>> C_US_3_BIT({{73, 16}});
88 constexpr double C_US_3_LSB = TWO_N29;
89 const std::vector<std::pair<int32_t, int32_t>> C_RC_3_BIT({{89, 16}});
90 constexpr double C_RC_3_LSB = TWO_N5;
91 const std::vector<std::pair<int32_t, int32_t>> C_RS_3_BIT({{105, 16}});
92 constexpr double C_RS_3_LSB = TWO_N5;
93 const std::vector<std::pair<int32_t, int32_t>> SISA_3_BIT({{121, 8}});
94 
95 
96 /* Word type 4: Ephemeris (4/4) and Clock correction parameters */
97 const std::vector<std::pair<int32_t, int32_t>> IOD_NAV_4_BIT({{7, 10}});
98 const std::vector<std::pair<int32_t, int32_t>> SV_ID_PRN_4_BIT({{17, 6}});
99 const std::vector<std::pair<int32_t, int32_t>> C_IC_4_BIT({{23, 16}});
100 constexpr double C_IC_4_LSB = TWO_N29;
101 const std::vector<std::pair<int32_t, int32_t>> C_IS_4_BIT({{39, 16}});
102 constexpr double C_IS_4_LSB = TWO_N29;
103 const std::vector<std::pair<int32_t, int32_t>> T0C_4_BIT({{55, 14}}); //
104 constexpr int32_t T0C_4_LSB = 60;
105 const std::vector<std::pair<int32_t, int32_t>> AF0_4_BIT({{69, 31}}); //
106 constexpr double AF0_4_LSB = TWO_N34;
107 const std::vector<std::pair<int32_t, int32_t>> AF1_4_BIT({{100, 21}}); //
108 constexpr double AF1_4_LSB = TWO_N46;
109 const std::vector<std::pair<int32_t, int32_t>> AF2_4_BIT({{121, 6}});
110 constexpr double AF2_4_LSB = TWO_N59;
111 const std::vector<std::pair<int32_t, int32_t>> SPARE_4_BIT({{127, 2}});
112 // last two bits are reserved
113 
114 /* Word type 5: Ionospheric correction, BGD, signal health and data validity status and GST */
115 /* Ionospheric correction */
116 /* Az */
117 const std::vector<std::pair<int32_t, int32_t>> AI0_5_BIT({{7, 11}}); //
118 constexpr double AI0_5_LSB = TWO_N2;
119 const std::vector<std::pair<int32_t, int32_t>> AI1_5_BIT({{18, 11}}); //
120 constexpr double AI1_5_LSB = TWO_N8;
121 const std::vector<std::pair<int32_t, int32_t>> AI2_5_BIT({{29, 14}}); //
122 constexpr double AI2_5_LSB = TWO_N15;
123 /* Ionospheric disturbance flag */
124 const std::vector<std::pair<int32_t, int32_t>> REGION1_5_BIT({{43, 1}}); //
125 const std::vector<std::pair<int32_t, int32_t>> REGION2_5_BIT({{44, 1}}); //
126 const std::vector<std::pair<int32_t, int32_t>> REGION3_5_BIT({{45, 1}}); //
127 const std::vector<std::pair<int32_t, int32_t>> REGION4_5_BIT({{46, 1}}); //
128 const std::vector<std::pair<int32_t, int32_t>> REGION5_5_BIT({{47, 1}}); //
129 const std::vector<std::pair<int32_t, int32_t>> BGD_E1_E5A_5_BIT({{48, 10}}); //
130 constexpr double BGD_E1_E5A_5_LSB = TWO_N32;
131 const std::vector<std::pair<int32_t, int32_t>> BGD_E1_E5B_5_BIT({{58, 10}}); //
132 constexpr double BGD_E1_E5B_5_LSB = TWO_N32;
133 const std::vector<std::pair<int32_t, int32_t>> E5B_HS_5_BIT({{68, 2}}); //
134 const std::vector<std::pair<int32_t, int32_t>> E1_B_HS_5_BIT({{70, 2}}); //
135 const std::vector<std::pair<int32_t, int32_t>> E5B_DVS_5_BIT({{72, 1}}); //
136 const std::vector<std::pair<int32_t, int32_t>> E1_B_DVS_5_BIT({{73, 1}}); //
137 /* GST */
138 const std::vector<std::pair<int32_t, int32_t>> WN_5_BIT({{74, 12}});
139 const std::vector<std::pair<int32_t, int32_t>> TOW_5_BIT({{86, 20}});
140 const std::vector<std::pair<int32_t, int32_t>> SPARE_5_BIT({{106, 23}});
141 
142 
143 /* Page 6 */
144 const std::vector<std::pair<int32_t, int32_t>> A0_6_BIT({{7, 32}});
145 constexpr double A0_6_LSB = TWO_N30;
146 const std::vector<std::pair<int32_t, int32_t>> A1_6_BIT({{39, 24}});
147 constexpr double A1_6_LSB = TWO_N50;
148 const std::vector<std::pair<int32_t, int32_t>> DELTA_T_LS_6_BIT({{63, 8}});
149 const std::vector<std::pair<int32_t, int32_t>> T0T_6_BIT({{71, 8}});
150 constexpr int32_t T0T_6_LSB = 3600;
151 const std::vector<std::pair<int32_t, int32_t>> W_NOT_6_BIT({{79, 8}});
152 const std::vector<std::pair<int32_t, int32_t>> WN_LSF_6_BIT({{87, 8}});
153 const std::vector<std::pair<int32_t, int32_t>> DN_6_BIT({{95, 3}});
154 const std::vector<std::pair<int32_t, int32_t>> DELTA_T_LSF_6_BIT({{98, 8}});
155 const std::vector<std::pair<int32_t, int32_t>> TOW_6_BIT({{106, 20}});
156 
157 
158 /* Page 7 */
159 const std::vector<std::pair<int32_t, int32_t>> IOD_A_7_BIT({{7, 4}});
160 const std::vector<std::pair<int32_t, int32_t>> WN_A_7_BIT({{11, 2}});
161 const std::vector<std::pair<int32_t, int32_t>> T0A_7_BIT({{13, 10}});
162 constexpr int32_t T0A_7_LSB = 600;
163 const std::vector<std::pair<int32_t, int32_t>> SVI_D1_7_BIT({{23, 6}});
164 const std::vector<std::pair<int32_t, int32_t>> DELTA_A_7_BIT({{29, 13}});
165 constexpr double DELTA_A_7_LSB = TWO_N9;
166 const std::vector<std::pair<int32_t, int32_t>> E_7_BIT({{42, 11}});
167 constexpr double E_7_LSB = TWO_N16;
168 const std::vector<std::pair<int32_t, int32_t>> OMEGA_7_BIT({{53, 16}});
169 constexpr double OMEGA_7_LSB = TWO_N15;
170 const std::vector<std::pair<int32_t, int32_t>> DELTA_I_7_BIT({{69, 11}});
171 constexpr double DELTA_I_7_LSB = TWO_N14;
172 const std::vector<std::pair<int32_t, int32_t>> OMEGA0_7_BIT({{80, 16}});
173 constexpr double OMEGA0_7_LSB = TWO_N15;
174 const std::vector<std::pair<int32_t, int32_t>> OMEGA_DOT_7_BIT({{96, 11}});
175 constexpr double OMEGA_DOT_7_LSB = TWO_N33;
176 const std::vector<std::pair<int32_t, int32_t>> M0_7_BIT({{107, 16}});
177 constexpr double M0_7_LSB = TWO_N15;
178 
179 
180 /* Page 8 */
181 const std::vector<std::pair<int32_t, int32_t>> IOD_A_8_BIT({{7, 4}});
182 const std::vector<std::pair<int32_t, int32_t>> AF0_8_BIT({{11, 16}});
183 constexpr double AF0_8_LSB = TWO_N19;
184 const std::vector<std::pair<int32_t, int32_t>> AF1_8_BIT({{27, 13}});
185 constexpr double AF1_8_LSB = TWO_N38;
186 const std::vector<std::pair<int32_t, int32_t>> E5B_HS_8_BIT({{40, 2}});
187 const std::vector<std::pair<int32_t, int32_t>> E1_B_HS_8_BIT({{42, 2}});
188 const std::vector<std::pair<int32_t, int32_t>> SVI_D2_8_BIT({{44, 6}});
189 const std::vector<std::pair<int32_t, int32_t>> DELTA_A_8_BIT({{50, 13}});
190 constexpr double DELTA_A_8_LSB = TWO_N9;
191 const std::vector<std::pair<int32_t, int32_t>> E_8_BIT({{63, 11}});
192 constexpr double E_8_LSB = TWO_N16;
193 const std::vector<std::pair<int32_t, int32_t>> OMEGA_8_BIT({{74, 16}});
194 constexpr double OMEGA_8_LSB = TWO_N15;
195 const std::vector<std::pair<int32_t, int32_t>> DELTA_I_8_BIT({{90, 11}});
196 constexpr double DELTA_I_8_LSB = TWO_N14;
197 const std::vector<std::pair<int32_t, int32_t>> OMEGA0_8_BIT({{101, 16}});
198 constexpr double OMEGA0_8_LSB = TWO_N15;
199 const std::vector<std::pair<int32_t, int32_t>> OMEGA_DOT_8_BIT({{117, 11}});
200 constexpr double OMEGA_DOT_8_LSB = TWO_N33;
201 
202 
203 /* Page 9 */
204 const std::vector<std::pair<int32_t, int32_t>> IOD_A_9_BIT({{7, 4}});
205 const std::vector<std::pair<int32_t, int32_t>> WN_A_9_BIT({{11, 2}});
206 const std::vector<std::pair<int32_t, int32_t>> T0A_9_BIT({{13, 10}});
207 constexpr int32_t T0A_9_LSB = 600;
208 const std::vector<std::pair<int32_t, int32_t>> M0_9_BIT({{23, 16}});
209 constexpr double M0_9_LSB = TWO_N15;
210 const std::vector<std::pair<int32_t, int32_t>> AF0_9_BIT({{39, 16}});
211 constexpr double AF0_9_LSB = TWO_N19;
212 const std::vector<std::pair<int32_t, int32_t>> AF1_9_BIT({{55, 13}});
213 constexpr double AF1_9_LSB = TWO_N38;
214 const std::vector<std::pair<int32_t, int32_t>> E5B_HS_9_BIT({{68, 2}});
215 const std::vector<std::pair<int32_t, int32_t>> E1_B_HS_9_BIT({{70, 2}});
216 const std::vector<std::pair<int32_t, int32_t>> SVI_D3_9_BIT({{72, 6}});
217 const std::vector<std::pair<int32_t, int32_t>> DELTA_A_9_BIT({{78, 13}});
218 constexpr double DELTA_A_9_LSB = TWO_N9;
219 const std::vector<std::pair<int32_t, int32_t>> E_9_BIT({{91, 11}});
220 constexpr double E_9_LSB = TWO_N16;
221 const std::vector<std::pair<int32_t, int32_t>> OMEGA_9_BIT({{102, 16}});
222 constexpr double OMEGA_9_LSB = TWO_N15;
223 const std::vector<std::pair<int32_t, int32_t>> DELTA_I_9_BIT({{118, 11}});
224 constexpr double DELTA_I_9_LSB = TWO_N14;
225 
226 
227 /* Page 10 */
228 const std::vector<std::pair<int32_t, int32_t>> IOD_A_10_BIT({{7, 4}});
229 const std::vector<std::pair<int32_t, int32_t>> OMEGA0_10_BIT({{11, 16}});
230 constexpr double OMEGA0_10_LSB = TWO_N15;
231 const std::vector<std::pair<int32_t, int32_t>> OMEGA_DOT_10_BIT({{27, 11}});
232 constexpr double OMEGA_DOT_10_LSB = TWO_N33;
233 const std::vector<std::pair<int32_t, int32_t>> M0_10_BIT({{38, 16}});
234 constexpr double M0_10_LSB = TWO_N15;
235 const std::vector<std::pair<int32_t, int32_t>> AF0_10_BIT({{54, 16}});
236 constexpr double AF0_10_LSB = TWO_N19;
237 const std::vector<std::pair<int32_t, int32_t>> AF1_10_BIT({{70, 13}});
238 constexpr double AF1_10_LSB = TWO_N38;
239 const std::vector<std::pair<int32_t, int32_t>> E5B_HS_10_BIT({{83, 2}});
240 const std::vector<std::pair<int32_t, int32_t>> E1_B_HS_10_BIT({{85, 2}});
241 const std::vector<std::pair<int32_t, int32_t>> A_0_G_10_BIT({{87, 16}});
242 constexpr double A_0G_10_LSB = TWO_N35;
243 const std::vector<std::pair<int32_t, int32_t>> A_1_G_10_BIT({{103, 12}});
244 constexpr double A_1G_10_LSB = TWO_N51;
245 const std::vector<std::pair<int32_t, int32_t>> T_0_G_10_BIT({{115, 8}});
246 constexpr int32_t T_0_G_10_LSB = 3600;
247 const std::vector<std::pair<int32_t, int32_t>> WN_0_G_10_BIT({{123, 6}});
248 
249 /* Page 16 */
250 constexpr double CED_DeltaAred_LSB = TWO_P8;
251 const std::vector<std::pair<int32_t, int32_t>> CED_DeltaAred_BIT({{7, 5}});
252 constexpr double CED_exred_LSB = TWO_N22;
253 const std::vector<std::pair<int32_t, int32_t>> CED_exred_BIT({{12, 13}});
254 constexpr double CED_eyred_LSB = TWO_N22;
255 const std::vector<std::pair<int32_t, int32_t>> CED_eyred_BIT({{25, 13}});
256 constexpr double CED_Deltai0red_LSB = TWO_N22;
257 const std::vector<std::pair<int32_t, int32_t>> CED_Deltai0red_BIT({{38, 17}});
258 constexpr double CED_Omega0red_LSB = TWO_N22;
259 const std::vector<std::pair<int32_t, int32_t>> CED_Omega0red_BIT({{55, 23}});
260 constexpr double CED_lambda0red_LSB = TWO_N22;
261 const std::vector<std::pair<int32_t, int32_t>> CED_lambda0red_BIT({{78, 23}});
262 constexpr double CED_af0red_LSB = TWO_N26;
263 const std::vector<std::pair<int32_t, int32_t>> CED_af0red_BIT({{101, 22}});
264 constexpr double CED_af1red_LSB = TWO_N35;
265 const std::vector<std::pair<int32_t, int32_t>> CED_af1red_BIT({{123, 6}});
266 
267 /* Pages 17, 18, 19, 20 */
268 const std::vector<std::pair<int32_t, int32_t>> RS_IODNAV_LSBS({{15, 2}});
269 constexpr size_t INAV_RS_SUBVECTOR_LENGTH = 15;
270 constexpr size_t INAV_RS_PARITY_VECTOR_LENGTH = 60;
271 constexpr size_t INAV_RS_INFO_VECTOR_LENGTH = 58;
272 constexpr size_t INAV_RS_BUFFER_LENGTH = 118;
273 constexpr int32_t BITS_IN_OCTET = 8;
274 constexpr int32_t FIRST_RS_BIT = 7;
275 constexpr int32_t FIRST_RS_BIT_AFTER_IODNAV = 17;
276 
277 /* Page 0 */
278 const std::vector<std::pair<int32_t, int32_t>> TIME_0_BIT({{7, 2}});
279 const std::vector<std::pair<int32_t, int32_t>> WN_0_BIT({{97, 12}});
280 const std::vector<std::pair<int32_t, int32_t>> TOW_0_BIT({{109, 20}});
281 
282 /* Secondary Synchronization Patters */
283 constexpr char GALILEO_INAV_PLAIN_SSP1[9] = "00000100";
284 constexpr char GALILEO_INAV_PLAIN_SSP2[9] = "00101011";
285 constexpr char GALILEO_INAV_PLAIN_SSP3[9] = "00101111";
286 constexpr char GALILEO_INAV_ENCODED_SSP1[17] = "1110100100100101";
287 constexpr char GALILEO_INAV_ENCODED_SSP2[17] = "0110110001001110";
288 constexpr char GALILEO_INAV_ENCODED_SSP3[17] = "1101000000111110";
289 
290 /** \} */
291 /** \} */
292 #endif // GNSS_SDR_GALILEO_INAV_H
constexpr double TWO_N59
2^-59
constexpr uint32_t GALILEO_INAV_PAGE_SYMBOLS
The complete Galileo INAV page length.
Definition: Galileo_INAV.h:35
constexpr double TWO_N5
2^-5
constexpr double TWO_N8
2^-8
constexpr double TWO_N50
2^-50
constexpr double TWO_N16
2^-16
constexpr double TWO_N33
2^-33
constexpr double TWO_N26
2^-26
constexpr double TWO_N32
2^-32
constexpr double TWO_N14
2^-14
constexpr double PI_TWO_N43
Pi*2^-43.
constexpr double TWO_N38
2^-38
constexpr double PI_TWO_N31
Pi*2^-31.
constexpr double TWO_N35
2^-35
Defines useful mathematical constants and their scaled versions.
constexpr double TWO_P8
2^8
constexpr double TWO_N30
2^-30
constexpr double TWO_N46
2^-46
constexpr double TWO_N51
2^-51
constexpr double GALILEO_INAV_PAGE_PART_WITH_PREABLE_SECONDS
Page Duration + (Galileo I/NAV Preamble bits)*(Galileo E5b-I tiered Code Period(seconds)) ...
Definition: Galileo_INAV.h:34
constexpr double TWO_N34
2^-34
constexpr double TWO_N9
2^-9
constexpr double TWO_N29
2^-29
constexpr double TWO_N19
2^-19
constexpr double TWO_N2
2^-2
constexpr int32_t GALILEO_INAV_PAGE_PART_SYMBOLS
Each Galileo INAV pages are composed of two parts (even and odd) each of 250 symbols, including preamble. See Galileo ICD 4.3.2.
Definition: Galileo_INAV.h:38
constexpr double TWO_N22
2^-22
constexpr double TWO_N15
2^-15