GNSS-SDR  0.0.13
An Open Source GNSS Software Defined Receiver
Beidou_DNAV.h
Go to the documentation of this file.
1 /*!
2  * \file Beidou_DNAV.h
3  * \brief Defines system parameters for BeiDou DNAV data processing
4  * \author Damian Miralles, 2018. dmiralles2009@gmail.com
5  * -----------------------------------------------------------------------------
6  *
7  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
8  *
9  * GNSS-SDR is a software defined Global Navigation
10  * Satellite Systems receiver
11  *
12  * This file is part of GNSS-SDR.
13  *
14  * SPDX-License-Identifier: GPL-3.0-or-later
15  *
16  * -----------------------------------------------------------------------------
17  */
18 
19 
20 #ifndef GNSS_SDR_BEIDOU_DNAV_H
21 #define GNSS_SDR_BEIDOU_DNAV_H
22 
23 #include "MATH_CONSTANTS.h"
24 #include <cstdint>
25 #include <utility>
26 #include <vector>
27 
28 
29 // DNAV SCALE FACTORS
30 // EPH
31 constexpr double D1_TOC_LSB = TWO_P3;
32 constexpr double D1_TGD1_LSB = 0.1e-9;
33 constexpr double D1_TGD2_LSB = 0.1e-9;
34 constexpr double D1_ALPHA0_LSB = TWO_N30;
35 constexpr double D1_ALPHA1_LSB = TWO_N27;
36 constexpr double D1_ALPHA2_LSB = TWO_N24;
37 constexpr double D1_ALPHA3_LSB = TWO_N24;
38 constexpr double D1_BETA0_LSB = TWO_P11;
39 constexpr double D1_BETA1_LSB = TWO_P14;
40 constexpr double D1_BETA2_LSB = TWO_P16;
41 constexpr double D1_BETA3_LSB = TWO_P16;
42 constexpr double D1_A2_LSB = TWO_N66;
43 constexpr double D1_A0_LSB = TWO_N33;
44 constexpr double D1_A1_LSB = TWO_N50;
45 constexpr double D1_DELTA_N_LSB = PI_TWO_N43;
46 constexpr double D1_CUC_LSB = TWO_N31;
47 constexpr double D1_M0_LSB = PI_TWO_N31;
48 constexpr double D1_E_LSB = TWO_N33;
49 constexpr double D1_CUS_LSB = TWO_N31;
50 constexpr double D1_CRC_LSB = TWO_N6;
51 constexpr double D1_CRS_LSB = TWO_N6;
52 constexpr double D1_SQRT_A_LSB = TWO_N19;
53 constexpr double D1_TOE_LSB = TWO_P3;
54 constexpr double D1_I0_LSB = PI_TWO_N31;
55 constexpr double D1_CIC_LSB = TWO_N31;
56 constexpr double D1_OMEGA_DOT_LSB = PI_TWO_N43;
57 constexpr double D1_CIS_LSB = TWO_N31;
58 constexpr double D1_IDOT_LSB = PI_TWO_N43;
59 constexpr double D1_OMEGA0_LSB = PI_TWO_N31;
60 constexpr double D1_OMEGA_LSB = PI_TWO_N31;
61 // ALM
62 constexpr double D1_SQRT_A_ALMANAC_LSB = TWO_N11;
63 constexpr double D1_A1_ALMANAC_LSB = TWO_N38;
64 constexpr double D1_A0_ALMANAC_LSB = TWO_N20;
65 constexpr double D1_OMEGA0_ALMANAC_LSB = PI_TWO_N23;
66 constexpr double D1_E_ALMANAC_LSB = TWO_N21;
67 constexpr double D1_DELTA_I_LSB = PI_TWO_N19;
68 constexpr double D1_TOA_LSB = TWO_P12;
69 constexpr double D1_OMEGA_DOT_ALMANAC_LSB = PI_TWO_N38;
70 constexpr double D1_OMEGA_ALMANAC_LSB = PI_TWO_N23;
71 constexpr double D1_M0_ALMANAC_LSB = PI_TWO_N23;
72 constexpr double D1_A0GPS_LSB = 0.1e-9;
73 constexpr double D1_A1GPS_LSB = 0.1e-9;
74 constexpr double D1_A0GAL_LSB = 0.1e-9;
75 constexpr double D1_A1GAL_LSB = 0.1e-9;
76 constexpr double D1_A0GLO_LSB = 0.1e-9;
77 constexpr double D1_A1GLO_LSB = 0.1e-9;
78 constexpr double D1_A0UTC_LSB = TWO_N30;
79 constexpr double D1_A1UTC_LSB = TWO_N50;
80 
81 constexpr int32_t BEIDOU_DNAV_PREAMBLE_LENGTH_BITS = 11;
82 constexpr int32_t BEIDOU_DNAV_PREAMBLE_LENGTH_SYMBOLS = 11; // **************
83 constexpr int32_t BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS = 300;
84 constexpr int32_t BEIDOU_DNAV_SUBFRAME_DATA_BITS = 300; //!< Number of bits per subframe in the NAV message [bits]
85 // Number of leap seconds passed from the start of the GPS epoch up to the start of BeiDou epoch
86 constexpr int32_t BEIDOU_DNAV_BDT2GPST_LEAP_SEC_OFFSET = 14;
87 // Number of weeks passed from the start of the GPS epoch up to the start of BeiDou epoch
88 constexpr int32_t BEIDOU_DNAV_BDT2GPST_WEEK_NUM_OFFSET = 1356;
89 
90 constexpr uint32_t BEIDOU_DNAV_SUBFRAME_SYMBOLS = 300;
91 constexpr uint32_t BEIDOU_DNAV_WORDS_SUBFRAME = 10;
92 constexpr uint32_t BEIDOU_DNAV_WORD_LENGTH_BITS = 30;
93 constexpr char BEIDOU_DNAV_PREAMBLE[12] = "11100010010";
94 
95 
96 // BEIDOU D1 NAVIGATION MESSAGE STRUCTURE
97 // GENERAL
98 const std::vector<std::pair<int32_t, int32_t> > D1_PRE({{1, 11}});
99 const std::vector<std::pair<int32_t, int32_t> > D1_FRAID({{16, 3}});
100 const std::vector<std::pair<int32_t, int32_t> > D1_SOW({{19, 8}, {31, 12}});
101 const std::vector<std::pair<int32_t, int32_t> > D1_PNUM({{44, 7}});
102 
103 // SUBFRAME 1
104 const std::vector<std::pair<int32_t, int32_t> > D1_SAT_H1({{43, 1}});
105 const std::vector<std::pair<int32_t, int32_t> > D1_AODC({{44, 5}});
106 const std::vector<std::pair<int32_t, int32_t> > D1_URAI({{49, 4}});
107 const std::vector<std::pair<int32_t, int32_t> > D1_WN({{61, 13}});
108 const std::vector<std::pair<int32_t, int32_t> > D1_TOC({{74, 9}, {91, 8}});
109 const std::vector<std::pair<int32_t, int32_t> > D1_TGD1({{99, 10}});
110 const std::vector<std::pair<int32_t, int32_t> > D1_TGD2({{109, 4}, {121, 6}});
111 const std::vector<std::pair<int32_t, int32_t> > D1_ALPHA0({{127, 8}});
112 const std::vector<std::pair<int32_t, int32_t> > D1_ALPHA1({{135, 8}});
113 const std::vector<std::pair<int32_t, int32_t> > D1_ALPHA2({{151, 8}});
114 const std::vector<std::pair<int32_t, int32_t> > D1_ALPHA3({{159, 8}});
115 const std::vector<std::pair<int32_t, int32_t> > D1_BETA0({{167, 6}, {181, 2}});
116 const std::vector<std::pair<int32_t, int32_t> > D1_BETA1({{183, 8}});
117 const std::vector<std::pair<int32_t, int32_t> > D1_BETA2({{191, 8}});
118 const std::vector<std::pair<int32_t, int32_t> > D1_BETA3({{199, 4}, {211, 4}});
119 const std::vector<std::pair<int32_t, int32_t> > D1_A2({{215, 11}});
120 const std::vector<std::pair<int32_t, int32_t> > D1_A0({{226, 7}, {241, 17}});
121 const std::vector<std::pair<int32_t, int32_t> > D1_A1({{258, 5}, {271, 17}});
122 const std::vector<std::pair<int32_t, int32_t> > D1_AODE({{288, 5}});
123 
124 // SUBFRAME 2
125 const std::vector<std::pair<int32_t, int32_t> > D1_DELTA_N({{43, 10}, {61, 6}});
126 const std::vector<std::pair<int32_t, int32_t> > D1_CUC({{67, 16}, {91, 2}});
127 const std::vector<std::pair<int32_t, int32_t> > D1_M0({{93, 20}, {121, 12}});
128 const std::vector<std::pair<int32_t, int32_t> > D1_E({{133, 10}, {151, 22}});
129 const std::vector<std::pair<int32_t, int32_t> > D1_CUS({{181, 18}});
130 const std::vector<std::pair<int32_t, int32_t> > D1_CRC({{199, 4}, {211, 14}});
131 const std::vector<std::pair<int32_t, int32_t> > D1_CRS({{225, 8}, {241, 10}});
132 const std::vector<std::pair<int32_t, int32_t> > D1_SQRT_A({{251, 12}, {271, 20}});
133 const std::vector<std::pair<int32_t, int32_t> > D1_TOE_SF2({{291, 2}});
134 
135 // SUBFRAME 3
136 const std::vector<std::pair<int32_t, int32_t> > D1_TOE_SF3({{43, 10}, {61, 5}});
137 const std::vector<std::pair<int32_t, int32_t> > D1_I0({{66, 17}, {91, 15}});
138 const std::vector<std::pair<int32_t, int32_t> > D1_CIC({{106, 7}, {121, 11}});
139 const std::vector<std::pair<int32_t, int32_t> > D1_OMEGA_DOT({{132, 11}, {151, 13}});
140 const std::vector<std::pair<int32_t, int32_t> > D1_CIS({{164, 9}, {181, 9}});
141 const std::vector<std::pair<int32_t, int32_t> > D1_IDOT({{190, 13}, {211, 1}});
142 const std::vector<std::pair<int32_t, int32_t> > D1_OMEGA0({{212, 21}, {241, 11}});
143 const std::vector<std::pair<int32_t, int32_t> > D1_OMEGA({{252, 11}, {271, 21}});
144 
145 // SUBFRAME 4 AND PAGES 1 THROUGH 6 IN SUBFRAME 5
146 const std::vector<std::pair<int32_t, int32_t> > D1_SQRT_A_ALMANAC({{51, 2}, {61, 22}});
147 const std::vector<std::pair<int32_t, int32_t> > D1_A1_ALMANAC({{91, 11}});
148 const std::vector<std::pair<int32_t, int32_t> > D1_A0_ALMANAC({{102, 11}});
149 const std::vector<std::pair<int32_t, int32_t> > D1_OMEGA0_ALMANAC({{121, 22}, {151, 2}});
150 const std::vector<std::pair<int32_t, int32_t> > D1_E_ALMANAC({{153, 17}});
151 const std::vector<std::pair<int32_t, int32_t> > D1_DELTA_I({{170, 3}, {181, 13}});
152 const std::vector<std::pair<int32_t, int32_t> > D1_TOA({{194, 8}});
153 const std::vector<std::pair<int32_t, int32_t> > D1_OMEGA_DOT_ALMANAC({{202, 1}, {211, 16}});
154 const std::vector<std::pair<int32_t, int32_t> > D1_OMEGA_ALMANAC({{227, 6}, {241, 18}});
155 const std::vector<std::pair<int32_t, int32_t> > D1_M0_ALMANAC({{259, 4}, {271, 20}});
156 
157 // SUBFRAME 5 PAGE 7
158 const std::vector<std::pair<int32_t, int32_t> > D1_HEA1({{51, 2}, {61, 7}});
159 const std::vector<std::pair<int32_t, int32_t> > D1_HEA2({{68, 9}});
160 const std::vector<std::pair<int32_t, int32_t> > D1_HEA3({{77, 6}, {91, 3}});
161 const std::vector<std::pair<int32_t, int32_t> > D1_HEA4({{94, 9}});
162 const std::vector<std::pair<int32_t, int32_t> > D1_HEA5({{103, 9}});
163 const std::vector<std::pair<int32_t, int32_t> > D1_HEA6({{112, 1}, {121, 8}});
164 const std::vector<std::pair<int32_t, int32_t> > D1_HEA7({{129, 9}});
165 const std::vector<std::pair<int32_t, int32_t> > D1_HEA8({{138, 5}, {151, 4}});
166 const std::vector<std::pair<int32_t, int32_t> > D1_HEA9({{155, 9}});
167 const std::vector<std::pair<int32_t, int32_t> > D1_HEA10({{164, 9}});
168 const std::vector<std::pair<int32_t, int32_t> > D1_HEA11({{181, 9}});
169 const std::vector<std::pair<int32_t, int32_t> > D1_HEA12({{190, 9}});
170 const std::vector<std::pair<int32_t, int32_t> > D1_HEA13({{199, 4}, {211, 5}});
171 const std::vector<std::pair<int32_t, int32_t> > D1_HEA14({{216, 9}});
172 const std::vector<std::pair<int32_t, int32_t> > D1_HEA15({{225, 8}, {241, 1}});
173 const std::vector<std::pair<int32_t, int32_t> > D1_HEA16({{242, 9}});
174 const std::vector<std::pair<int32_t, int32_t> > D1_HEA17({{251, 9}});
175 const std::vector<std::pair<int32_t, int32_t> > D1_HEA18({{260, 3}, {271, 6}});
176 const std::vector<std::pair<int32_t, int32_t> > D1_HEA19({{277, 9}});
177 
178 // SUBFRAME 5 PAGE 8
179 const std::vector<std::pair<int32_t, int32_t> > D1_HEA20({{51, 2}, {61, 7}});
180 const std::vector<std::pair<int32_t, int32_t> > D1_HEA21({{68, 9}});
181 const std::vector<std::pair<int32_t, int32_t> > D1_HEA22({{77, 6}, {91, 3}});
182 const std::vector<std::pair<int32_t, int32_t> > D1_HEA23({{94, 9}});
183 const std::vector<std::pair<int32_t, int32_t> > D1_HEA24({{103, 9}});
184 const std::vector<std::pair<int32_t, int32_t> > D1_HEA25({{112, 1}, {121, 8}});
185 const std::vector<std::pair<int32_t, int32_t> > D1_HEA26({{129, 9}});
186 const std::vector<std::pair<int32_t, int32_t> > D1_HEA27({{138, 5}, {151, 4}});
187 const std::vector<std::pair<int32_t, int32_t> > D1_HEA28({{155, 9}});
188 const std::vector<std::pair<int32_t, int32_t> > D1_HEA29({{164, 9}});
189 const std::vector<std::pair<int32_t, int32_t> > D1_HEA30({{181, 9}});
190 const std::vector<std::pair<int32_t, int32_t> > D1_WNA({{190, 8}});
191 const std::vector<std::pair<int32_t, int32_t> > D1_TOA2({{198, 5}, {211, 3}});
192 
193 // SUBFRAME 5 PAGE 9
194 const std::vector<std::pair<int32_t, int32_t> > D1_A0GPS({{97, 14}});
195 const std::vector<std::pair<int32_t, int32_t> > D1_A1GPS({{111, 2}, {121, 14}});
196 const std::vector<std::pair<int32_t, int32_t> > D1_A0GAL({{135, 8}, {151, 6}});
197 const std::vector<std::pair<int32_t, int32_t> > D1_A1GAL({{157, 16}});
198 const std::vector<std::pair<int32_t, int32_t> > D1_A0GLO({{181, 14}});
199 const std::vector<std::pair<int32_t, int32_t> > D1_A1GLO({{195, 8}, {211, 8}});
200 
201 // SUBFRAME 5 PAGE 10
202 const std::vector<std::pair<int32_t, int32_t> > D1_DELTA_T_LS({{51, 2}, {61, 6}});
203 const std::vector<std::pair<int32_t, int32_t> > D1_DELTA_T_LSF({{67, 8}});
204 const std::vector<std::pair<int32_t, int32_t> > D1_WN_LSF({{75, 8}});
205 const std::vector<std::pair<int32_t, int32_t> > D1_A0UTC({{91, 22}, {121, 10}});
206 const std::vector<std::pair<int32_t, int32_t> > D1_A1UTC({{131, 12}, {151, 12}});
207 const std::vector<std::pair<int32_t, int32_t> > D1_DN({{163, 8}});
208 
209 // D2 NAV Message Decoding Information
210 const std::vector<std::pair<int32_t, int32_t> > D2_PRE({{1, 11}});
211 const std::vector<std::pair<int32_t, int32_t> > D2_FRAID({{16, 3}});
212 const std::vector<std::pair<int32_t, int32_t> > D2_SOW({{19, 8}, {31, 12}});
213 const std::vector<std::pair<int32_t, int32_t> > D2_PNUM({{43, 4}});
214 
215 // D2 NAV, SUBFRAME 1, PAGE 1
216 const std::vector<std::pair<int32_t, int32_t> > D2_SAT_H1({{47, 1}});
217 const std::vector<std::pair<int32_t, int32_t> > D2_AODC({{48, 5}});
218 const std::vector<std::pair<int32_t, int32_t> > D2_URAI({{61, 4}});
219 const std::vector<std::pair<int32_t, int32_t> > D2_WN({{65, 13}});
220 const std::vector<std::pair<int32_t, int32_t> > D2_TOC({{78, 5}, {91, 12}});
221 const std::vector<std::pair<int32_t, int32_t> > D2_TGD1({{103, 10}});
222 const std::vector<std::pair<int32_t, int32_t> > D2_TGD2({{121, 10}});
223 
224 // D2 NAV, SUBFRAME 1, PAGE 2
225 const std::vector<std::pair<int32_t, int32_t> > D2_ALPHA0({{47, 6}, {61, 2}});
226 const std::vector<std::pair<int32_t, int32_t> > D2_ALPHA1({{63, 8}});
227 const std::vector<std::pair<int32_t, int32_t> > D2_ALPHA2({{71, 8}});
228 const std::vector<std::pair<int32_t, int32_t> > D2_ALPHA3({{79, 4}, {91, 4}});
229 const std::vector<std::pair<int32_t, int32_t> > D2_BETA0({{95, 8}});
230 const std::vector<std::pair<int32_t, int32_t> > D2_BETA1({{103, 8}});
231 const std::vector<std::pair<int32_t, int32_t> > D2_BETA2({{111, 2}, {121, 6}});
232 const std::vector<std::pair<int32_t, int32_t> > D2_BETA3({{127, 8}});
233 
234 // D2 NAV, SUBFRAME 1, PAGE 3
235 const std::vector<std::pair<int32_t, int32_t> > D2_A0({{101, 12}, {121, 12}});
236 const std::vector<std::pair<int32_t, int32_t> > D2_A1_MSB({{133, 4}});
237 const std::vector<std::pair<int32_t, int32_t> > D2_A1_LSB({{47, 6}, {61, 12}});
238 const std::vector<std::pair<int32_t, int32_t> > D2_A1({{279, 22}});
239 
240 // D2 NAV, SUBFRAME 1, PAGE 4
241 const std::vector<std::pair<int32_t, int32_t> > D2_A2({{73, 10}, {91, 1}});
242 const std::vector<std::pair<int32_t, int32_t> > D2_AODE({{92, 5}});
243 const std::vector<std::pair<int32_t, int32_t> > D2_DELTA_N({{97, 16}});
244 const std::vector<std::pair<int32_t, int32_t> > D2_CUC_MSB({{121, 14}});
245 const std::vector<std::pair<int32_t, int32_t> > D2_CUC_LSB({{47, 4}});
246 const std::vector<std::pair<int32_t, int32_t> > D2_CUC({{283, 18}});
247 
248 // D2 NAV, SUBFRAME 1, PAGE 5
249 const std::vector<std::pair<int32_t, int32_t> > D2_M0({{51, 2}, {61, 22}, {91, 8}});
250 const std::vector<std::pair<int32_t, int32_t> > D2_CUS({{99, 14}, {121, 4}});
251 const std::vector<std::pair<int32_t, int32_t> > D2_E_MSB({{125, 10}});
252 
253 // D2 NAV, SUBFRAME 1, PAGE 6
254 const std::vector<std::pair<int32_t, int32_t> > D2_E_LSB({{47, 6}, {61, 16}});
255 const std::vector<std::pair<int32_t, int32_t> > D2_SQRT_A({{77, 6}, {91, 22}, {121, 4}});
256 const std::vector<std::pair<int32_t, int32_t> > D2_CIC_MSB({{125, 10}});
257 const std::vector<std::pair<int32_t, int32_t> > D2_CIC_LSB({{47, 6}, {61, 2}});
258 const std::vector<std::pair<int32_t, int32_t> > D2_CIC({{283, 18}});
259 
260 // D2 NAV, SUBFRAME 1, PAGE 7
261 const std::vector<std::pair<int32_t, int32_t> > D2_CIS({{63, 18}});
262 const std::vector<std::pair<int32_t, int32_t> > D2_TOE({{81, 2}, {91, 15}});
263 const std::vector<std::pair<int32_t, int32_t> > D2_I0_MSB({{106, 7}, {121, 14}});
264 const std::vector<std::pair<int32_t, int32_t> > D2_I0_LSB({{47, 6}, {61, 5}});
265 const std::vector<std::pair<int32_t, int32_t> > D2_I0({{269, 32}});
266 
267 // D2 NAV, SUBFRAME 1, PAGE 8
268 const std::vector<std::pair<int32_t, int32_t> > D2_CRC({{66, 17}, {91, 1}});
269 const std::vector<std::pair<int32_t, int32_t> > D2_CRS({{92, 18}});
270 const std::vector<std::pair<int32_t, int32_t> > D2_OMEGA_DOT_MSB({{110, 3}, {121, 16}});
271 const std::vector<std::pair<int32_t, int32_t> > D2_OMEGA_DOT_LSB({{47, 5}});
272 const std::vector<std::pair<int32_t, int32_t> > D2_OMEGA_DOT({{277, 24}});
273 
274 // D2 NAV, SUBFRAME 1, PAGE 9
275 const std::vector<std::pair<int32_t, int32_t> > D2_OMEGA0({{52, 1}, {61, 22}, {91, 9}});
276 const std::vector<std::pair<int32_t, int32_t> > D2_OMEGA_MSB({{100, 13}, {121, 14}});
277 const std::vector<std::pair<int32_t, int32_t> > D2_OMEGA_LSB({{47, 5}});
278 const std::vector<std::pair<int32_t, int32_t> > D2_OMEGA({{269, 32}});
279 
280 // D2 NAV, SUBFRAME 1, PAGE 10
281 const std::vector<std::pair<int32_t, int32_t> > D2_IDOT({{52, 1}, {61, 13}});
282 
283 #endif // GNSS_SDR_BEIDOU_DNAV_H
constexpr double TWO_P12
2^12
constexpr double TWO_N20
2^-20
constexpr double TWO_N11
2^-11
constexpr double TWO_N19
2^-19
constexpr double TWO_N50
2^-50
constexpr double TWO_N6
2^-6
constexpr double TWO_N24
2^-24
Defines useful mathematical constants and their scaled versions.
constexpr double TWO_N30
2^-30
constexpr double TWO_P14
2^14
constexpr double TWO_P3
2^3
constexpr double PI_TWO_N19
Pi*2^-19.
constexpr double PI_TWO_N43
Pi*2^-43.
constexpr double TWO_P11
2^11
constexpr double TWO_N21
2^-21
constexpr double PI_TWO_N23
Pi*2^-23.
constexpr double TWO_N31
2^-31
constexpr double TWO_N38
2^-38
constexpr double TWO_N33
2^-33
constexpr double PI_TWO_N38
Pi*2^-38.
constexpr int32_t BEIDOU_DNAV_SUBFRAME_DATA_BITS
Number of bits per subframe in the NAV message [bits].
Definition: Beidou_DNAV.h:84
constexpr double TWO_P16
2^16
constexpr double TWO_N66
2^-66
constexpr double TWO_N27
2^-27
constexpr double PI_TWO_N31
Pi*2^-31.