GNSS-SDR 0.0.21
An Open Source GNSS Software Defined Receiver
Loading...
Searching...
No Matches
gnss_synchro.h
Go to the documentation of this file.
1/*!
2 * \file gnss_synchro.h
3 * \brief Interface of the Gnss_Synchro class
4 * \author
5 * Luis Esteve, 2012. luis(at)epsilon-formacion.com
6 * Javier Arribas, 2012. jarribas(at)cttc.es
7 * Álvaro Cebrián Juan, 2018. acebrianjuan(at)gmail.com
8 *
9 * -----------------------------------------------------------------------------
10 *
11 * GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
12 * This file is part of GNSS-SDR.
13 *
14 * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
15 * SPDX-License-Identifier: GPL-3.0-or-later
16 *
17 * -----------------------------------------------------------------------------
18 */
19
20#ifndef GNSS_SDR_GNSS_SYNCHRO_H
21#define GNSS_SDR_GNSS_SYNCHRO_H
22
23#include <boost/serialization/nvp.hpp>
24#include <cstdint>
25#include <utility>
26
27/** \addtogroup Core
28 * \{ */
29/** \addtogroup System_Parameters core_system_parameters
30 * GNSS parameters
31 * \{ */
32
33
34/*!
35 * \brief This is the class that contains the information that is shared
36 * by the processing blocks.
37 */
39{
40public:
41 Gnss_Synchro() = default; //!< Default constructor
42
43 ~Gnss_Synchro() = default; //!< Default destructor
44
45 // Satellite and signal info
46 char System{}; //!< Set by Channel::set_signal(Gnss_Signal gnss_signal)
47 char Signal[3]{}; //!< Set by Channel::set_signal(Gnss_Signal gnss_signal)
48 uint32_t PRN{}; //!< Set by Channel::set_signal(Gnss_Signal gnss_signal)
49 int32_t Channel_ID{}; //!< Set by Channel constructor
50
51 // Acquisition
52 double Acq_delay_samples{}; //!< Set by Acquisition processing block
53 double Acq_doppler_hz{}; //!< Set by Acquisition processing block
54 uint64_t Acq_samplestamp_samples{}; //!< Set by Acquisition processing block
55 uint32_t Acq_doppler_step{}; //!< Set by Acquisition processing block
56
57 // Tracking
58 int64_t fs{}; //!< Set by Tracking processing block
59 double Prompt_I{}; //!< Set by Tracking processing block
60 double Prompt_Q{}; //!< Set by Tracking processing block
61 double CN0_dB_hz{}; //!< Set by Tracking processing block
62 double Carrier_Doppler_hz{}; //!< Set by Tracking processing block
63 double Carrier_phase_rads{}; //!< Set by Tracking processing block
64 double Code_phase_samples{}; //!< Set by Tracking processing block
65 uint64_t Tracking_sample_counter{}; //!< Set by Tracking processing block
66 int32_t correlation_length_ms{}; //!< Set by Tracking processing block
67
68 // Telemetry Decoder
69 uint32_t TOW_at_current_symbol_ms{}; //!< Set by Telemetry Decoder processing block
70
71 // Observables
72 double Pseudorange_m{}; //!< Set by Observables processing block
73 double RX_time{}; //!< Set by Observables processing block
74 double interp_TOW_ms{}; //!< Set by Observables processing block
75
76 // Flags
77 bool Flag_valid_acquisition{}; //!< Set by Acquisition processing block
78 bool Flag_valid_symbol_output{}; //!< Set by Tracking processing block
79 bool Flag_valid_word{}; //!< Set by Telemetry Decoder processing block
80 bool Flag_valid_pseudorange{}; //!< Set by Observables processing block
81 bool Flag_PLL_180_deg_phase_locked{}; //!< Set by Telemetry Decoder processing block
82 bool Flag_cycle_slip{}; //!< Set by Observables processing block
83
84 /// Copy constructor
85 Gnss_Synchro(const Gnss_Synchro& other) noexcept = default;
86
87 /// Copy assignment operator
88 Gnss_Synchro& operator=(const Gnss_Synchro& rhs) noexcept
89 {
90 // Only do assignment if RHS is a different object from this.
91 if (this != &rhs)
92 {
93 this->System = rhs.System;
94 this->Signal[0] = rhs.Signal[0];
95 this->Signal[1] = rhs.Signal[1];
96 this->Signal[2] = rhs.Signal[2];
97 this->PRN = rhs.PRN;
98 this->Channel_ID = rhs.Channel_ID;
99 this->Acq_delay_samples = rhs.Acq_delay_samples;
100 this->Acq_doppler_hz = rhs.Acq_doppler_hz;
101 this->Acq_samplestamp_samples = rhs.Acq_samplestamp_samples;
102 this->Acq_doppler_step = rhs.Acq_doppler_step;
103 this->fs = rhs.fs;
104 this->Prompt_I = rhs.Prompt_I;
105 this->Prompt_Q = rhs.Prompt_Q;
106 this->CN0_dB_hz = rhs.CN0_dB_hz;
107 this->Carrier_Doppler_hz = rhs.Carrier_Doppler_hz;
108 this->Carrier_phase_rads = rhs.Carrier_phase_rads;
109 this->Code_phase_samples = rhs.Code_phase_samples;
110 this->Tracking_sample_counter = rhs.Tracking_sample_counter;
111 this->correlation_length_ms = rhs.correlation_length_ms;
112 this->TOW_at_current_symbol_ms = rhs.TOW_at_current_symbol_ms;
113 this->Pseudorange_m = rhs.Pseudorange_m;
114 this->RX_time = rhs.RX_time;
115 this->interp_TOW_ms = rhs.interp_TOW_ms;
116 this->Flag_valid_acquisition = rhs.Flag_valid_acquisition;
117 this->Flag_valid_symbol_output = rhs.Flag_valid_symbol_output;
118 this->Flag_valid_word = rhs.Flag_valid_word;
119 this->Flag_valid_pseudorange = rhs.Flag_valid_pseudorange;
120 this->Flag_PLL_180_deg_phase_locked = rhs.Flag_PLL_180_deg_phase_locked;
121 this->Flag_cycle_slip = rhs.Flag_cycle_slip;
122 }
123 return *this;
124 };
125
126 /// Move constructor
127 Gnss_Synchro(Gnss_Synchro&& other) noexcept = default;
128
129 /// Move assignment operator
131 {
132 if (this != &other)
133 {
134 this->System = other.System;
135 this->Signal[0] = other.Signal[0];
136 this->Signal[1] = other.Signal[1];
137 this->Signal[2] = other.Signal[2];
138 this->PRN = other.PRN;
139 this->Channel_ID = other.Channel_ID;
140 this->Acq_delay_samples = other.Acq_delay_samples;
141 this->Acq_doppler_hz = other.Acq_doppler_hz;
142 this->Acq_samplestamp_samples = other.Acq_samplestamp_samples;
143 this->Acq_doppler_step = other.Acq_doppler_step;
144 this->fs = other.fs;
145 this->Prompt_I = other.Prompt_I;
146 this->Prompt_Q = other.Prompt_Q;
147 this->CN0_dB_hz = other.CN0_dB_hz;
148 this->Carrier_Doppler_hz = other.Carrier_Doppler_hz;
149 this->Carrier_phase_rads = other.Carrier_phase_rads;
150 this->Code_phase_samples = other.Code_phase_samples;
151 this->Tracking_sample_counter = other.Tracking_sample_counter;
152 this->correlation_length_ms = other.correlation_length_ms;
153 this->TOW_at_current_symbol_ms = other.TOW_at_current_symbol_ms;
154 this->Pseudorange_m = other.Pseudorange_m;
155 this->RX_time = other.RX_time;
156 this->interp_TOW_ms = other.interp_TOW_ms;
157 this->Flag_valid_acquisition = other.Flag_valid_acquisition;
158 this->Flag_valid_symbol_output = other.Flag_valid_symbol_output;
159 this->Flag_valid_word = other.Flag_valid_word;
160 this->Flag_valid_pseudorange = other.Flag_valid_pseudorange;
161 this->Flag_PLL_180_deg_phase_locked = other.Flag_PLL_180_deg_phase_locked;
162
163 // Leave the source object in a valid but unspecified state
164 other.Signal[0] = '\0';
165 other.Signal[1] = '\0';
166 other.Signal[2] = '\0';
167 other.System = 0;
168 other.PRN = 0;
169 other.Channel_ID = 0;
170 other.Acq_delay_samples = 0.0;
171 other.Acq_doppler_hz = 0.0;
172 other.Acq_samplestamp_samples = 0;
173 other.Acq_doppler_step = 0;
174 other.fs = 0;
175 other.Prompt_I = 0.0;
176 other.Prompt_Q = 0.0;
177 other.CN0_dB_hz = 0.0;
178 other.Carrier_Doppler_hz = 0.0;
179 other.Carrier_phase_rads = 0.0;
180 other.Code_phase_samples = 0.0;
181 other.Tracking_sample_counter = 0;
182 other.correlation_length_ms = 0;
183 other.TOW_at_current_symbol_ms = 0;
184 other.Pseudorange_m = 0.0;
185 other.RX_time = 0.0;
186 other.interp_TOW_ms = 0.0;
187 other.Flag_valid_acquisition = false;
188 other.Flag_valid_symbol_output = false;
189 other.Flag_valid_word = false;
190 other.Flag_valid_pseudorange = false;
191 other.Flag_PLL_180_deg_phase_locked = false;
192 other.Flag_cycle_slip = false;
193 }
194 return *this;
195 };
196
197 /*!
198 * \brief This member function serializes and restores
199 * Gnss_Synchro objects from a byte stream.
200 */
201 template <class Archive>
202
203 void serialize(Archive& ar, const unsigned int version)
204 {
205 if (version)
206 {
207 };
208 // Satellite and signal info
209 ar& BOOST_SERIALIZATION_NVP(System);
210 ar& BOOST_SERIALIZATION_NVP(Signal);
211 ar& BOOST_SERIALIZATION_NVP(PRN);
212 ar& BOOST_SERIALIZATION_NVP(Channel_ID);
213 // Acquisition
214 ar& BOOST_SERIALIZATION_NVP(Acq_delay_samples);
215 ar& BOOST_SERIALIZATION_NVP(Acq_doppler_hz);
216 ar& BOOST_SERIALIZATION_NVP(Acq_samplestamp_samples);
217 ar& BOOST_SERIALIZATION_NVP(Acq_doppler_step);
218 // Tracking
219 ar& BOOST_SERIALIZATION_NVP(fs);
220 ar& BOOST_SERIALIZATION_NVP(Prompt_I);
221 ar& BOOST_SERIALIZATION_NVP(Prompt_Q);
222 ar& BOOST_SERIALIZATION_NVP(CN0_dB_hz);
223 ar& BOOST_SERIALIZATION_NVP(Carrier_Doppler_hz);
224 ar& BOOST_SERIALIZATION_NVP(Carrier_phase_rads);
225 ar& BOOST_SERIALIZATION_NVP(Code_phase_samples);
226 ar& BOOST_SERIALIZATION_NVP(Tracking_sample_counter);
227 ar& BOOST_SERIALIZATION_NVP(correlation_length_ms);
228 // Telemetry Decoder
229 ar& BOOST_SERIALIZATION_NVP(TOW_at_current_symbol_ms);
230 // Observables
231 ar& BOOST_SERIALIZATION_NVP(Pseudorange_m);
232 ar& BOOST_SERIALIZATION_NVP(RX_time);
233 ar& BOOST_SERIALIZATION_NVP(interp_TOW_ms);
234 // Flags
235 ar& BOOST_SERIALIZATION_NVP(Flag_valid_acquisition);
236 ar& BOOST_SERIALIZATION_NVP(Flag_valid_symbol_output);
237 ar& BOOST_SERIALIZATION_NVP(Flag_valid_word);
238 ar& BOOST_SERIALIZATION_NVP(Flag_valid_pseudorange);
239 ar& BOOST_SERIALIZATION_NVP(Flag_PLL_180_deg_phase_locked);
240 ar& BOOST_SERIALIZATION_NVP(Flag_cycle_slip);
241 }
242};
243
244
245/** \} */
246/** \} */
247#endif // GNSS_SDR_GNSS_SYNCHRO_H
char System
Set by Channel::set_signal(Gnss_Signal gnss_signal).
double Carrier_phase_rads
Set by Tracking processing block.
int32_t correlation_length_ms
Set by Tracking processing block.
void serialize(Archive &ar, const unsigned int version)
This member function serializes and restores Gnss_Synchro objects from a byte stream.
Gnss_Synchro()=default
Default constructor.
double CN0_dB_hz
Set by Tracking processing block.
bool Flag_valid_word
Set by Telemetry Decoder processing block.
uint32_t TOW_at_current_symbol_ms
Set by Telemetry Decoder processing block.
bool Flag_cycle_slip
Set by Observables processing block.
char Signal[3]
Set by Channel::set_signal(Gnss_Signal gnss_signal).
bool Flag_PLL_180_deg_phase_locked
Set by Telemetry Decoder processing block.
Gnss_Synchro(Gnss_Synchro &&other) noexcept=default
Move constructor.
bool Flag_valid_pseudorange
Set by Observables processing block.
int64_t fs
Set by Tracking processing block.
double Carrier_Doppler_hz
Set by Tracking processing block.
double Prompt_I
Set by Tracking processing block.
~Gnss_Synchro()=default
Default destructor.
double Acq_delay_samples
Set by Acquisition processing block.
bool Flag_valid_symbol_output
Set by Tracking processing block.
Gnss_Synchro & operator=(Gnss_Synchro &&other) noexcept
Move assignment operator.
uint32_t Acq_doppler_step
Set by Acquisition processing block.
uint64_t Tracking_sample_counter
Set by Tracking processing block.
double interp_TOW_ms
Set by Observables processing block.
double RX_time
Set by Observables processing block.
uint32_t PRN
Set by Channel::set_signal(Gnss_Signal gnss_signal).
double Prompt_Q
Set by Tracking processing block.
Gnss_Synchro & operator=(const Gnss_Synchro &rhs) noexcept
Copy assignment operator.
Gnss_Synchro(const Gnss_Synchro &other) noexcept=default
Copy constructor.
double Pseudorange_m
Set by Observables processing block.
uint64_t Acq_samplestamp_samples
Set by Acquisition processing block.
double Acq_doppler_hz
Set by Acquisition processing block.
bool Flag_valid_acquisition
Set by Acquisition processing block.
int32_t Channel_ID
Set by Channel constructor.
double Code_phase_samples
Set by Tracking processing block.