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