GNSS-SDR  0.0.19
An Open Source GNSS Software Defined Receiver
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 {
40 public:
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 
83  /// Copy constructor
84  Gnss_Synchro(const Gnss_Synchro& other) noexcept = default;
85 
86  /// Copy assignment operator
87  Gnss_Synchro& operator=(const Gnss_Synchro& rhs) noexcept
88  {
89  // Only do assignment if RHS is a different object from this.
90  if (this != &rhs)
91  {
92  this->System = rhs.System;
93  this->Signal[0] = rhs.Signal[0];
94  this->Signal[1] = rhs.Signal[1];
95  this->Signal[2] = rhs.Signal[2];
96  this->PRN = rhs.PRN;
97  this->Channel_ID = rhs.Channel_ID;
98  this->Acq_delay_samples = rhs.Acq_delay_samples;
99  this->Acq_doppler_hz = rhs.Acq_doppler_hz;
100  this->Acq_samplestamp_samples = rhs.Acq_samplestamp_samples;
101  this->Acq_doppler_step = rhs.Acq_doppler_step;
102  this->fs = rhs.fs;
103  this->Prompt_I = rhs.Prompt_I;
104  this->Prompt_Q = rhs.Prompt_Q;
105  this->CN0_dB_hz = rhs.CN0_dB_hz;
106  this->Carrier_Doppler_hz = rhs.Carrier_Doppler_hz;
107  this->Carrier_phase_rads = rhs.Carrier_phase_rads;
108  this->Code_phase_samples = rhs.Code_phase_samples;
109  this->Tracking_sample_counter = rhs.Tracking_sample_counter;
110  this->correlation_length_ms = rhs.correlation_length_ms;
111  this->TOW_at_current_symbol_ms = rhs.TOW_at_current_symbol_ms;
112  this->Pseudorange_m = rhs.Pseudorange_m;
113  this->RX_time = rhs.RX_time;
114  this->interp_TOW_ms = rhs.interp_TOW_ms;
115  this->Flag_valid_acquisition = rhs.Flag_valid_acquisition;
116  this->Flag_valid_symbol_output = rhs.Flag_valid_symbol_output;
117  this->Flag_valid_word = rhs.Flag_valid_word;
118  this->Flag_valid_pseudorange = rhs.Flag_valid_pseudorange;
119  this->Flag_PLL_180_deg_phase_locked = rhs.Flag_PLL_180_deg_phase_locked;
120  }
121  return *this;
122  };
123 
124  /// Move constructor
125  Gnss_Synchro(Gnss_Synchro&& other) noexcept = default;
126 
127  /// Move assignment operator
129  {
130  if (this != &other)
131  {
132  this->System = other.System;
133  this->Signal[0] = other.Signal[0];
134  this->Signal[1] = other.Signal[1];
135  this->Signal[2] = other.Signal[2];
136  this->PRN = other.PRN;
137  this->Channel_ID = other.Channel_ID;
138  this->Acq_delay_samples = other.Acq_delay_samples;
139  this->Acq_doppler_hz = other.Acq_doppler_hz;
140  this->Acq_samplestamp_samples = other.Acq_samplestamp_samples;
141  this->Acq_doppler_step = other.Acq_doppler_step;
142  this->fs = other.fs;
143  this->Prompt_I = other.Prompt_I;
144  this->Prompt_Q = other.Prompt_Q;
145  this->CN0_dB_hz = other.CN0_dB_hz;
146  this->Carrier_Doppler_hz = other.Carrier_Doppler_hz;
147  this->Carrier_phase_rads = other.Carrier_phase_rads;
148  this->Code_phase_samples = other.Code_phase_samples;
149  this->Tracking_sample_counter = other.Tracking_sample_counter;
150  this->correlation_length_ms = other.correlation_length_ms;
151  this->TOW_at_current_symbol_ms = other.TOW_at_current_symbol_ms;
152  this->Pseudorange_m = other.Pseudorange_m;
153  this->RX_time = other.RX_time;
154  this->interp_TOW_ms = other.interp_TOW_ms;
155  this->Flag_valid_acquisition = other.Flag_valid_acquisition;
156  this->Flag_valid_symbol_output = other.Flag_valid_symbol_output;
157  this->Flag_valid_word = other.Flag_valid_word;
158  this->Flag_valid_pseudorange = other.Flag_valid_pseudorange;
159  this->Flag_PLL_180_deg_phase_locked = other.Flag_PLL_180_deg_phase_locked;
160 
161  // Leave the source object in a valid but unspecified state
162  other.Signal[0] = '\0';
163  other.Signal[1] = '\0';
164  other.Signal[2] = '\0';
165  other.System = 0;
166  other.PRN = 0;
167  other.Channel_ID = 0;
168  other.Acq_delay_samples = 0.0;
169  other.Acq_doppler_hz = 0.0;
170  other.Acq_samplestamp_samples = 0;
171  other.Acq_doppler_step = 0;
172  other.fs = 0;
173  other.Prompt_I = 0.0;
174  other.Prompt_Q = 0.0;
175  other.CN0_dB_hz = 0.0;
176  other.Carrier_Doppler_hz = 0.0;
177  other.Carrier_phase_rads = 0.0;
178  other.Code_phase_samples = 0.0;
179  other.Tracking_sample_counter = 0;
180  other.correlation_length_ms = 0;
181  other.TOW_at_current_symbol_ms = 0;
182  other.Pseudorange_m = 0.0;
183  other.RX_time = 0.0;
184  other.interp_TOW_ms = 0.0;
185  other.Flag_valid_acquisition = false;
186  other.Flag_valid_symbol_output = false;
187  other.Flag_valid_word = false;
188  other.Flag_valid_pseudorange = false;
189  other.Flag_PLL_180_deg_phase_locked = false;
190  }
191  return *this;
192  };
193 
194  /*!
195  * \brief This member function serializes and restores
196  * Gnss_Synchro objects from a byte stream.
197  */
198  template <class Archive>
199 
200  void serialize(Archive& ar, const unsigned int version)
201  {
202  if (version)
203  {
204  };
205  // Satellite and signal info
206  ar& BOOST_SERIALIZATION_NVP(System);
207  ar& BOOST_SERIALIZATION_NVP(Signal);
208  ar& BOOST_SERIALIZATION_NVP(PRN);
209  ar& BOOST_SERIALIZATION_NVP(Channel_ID);
210  // Acquisition
211  ar& BOOST_SERIALIZATION_NVP(Acq_delay_samples);
212  ar& BOOST_SERIALIZATION_NVP(Acq_doppler_hz);
213  ar& BOOST_SERIALIZATION_NVP(Acq_samplestamp_samples);
214  ar& BOOST_SERIALIZATION_NVP(Acq_doppler_step);
215  // Tracking
216  ar& BOOST_SERIALIZATION_NVP(fs);
217  ar& BOOST_SERIALIZATION_NVP(Prompt_I);
218  ar& BOOST_SERIALIZATION_NVP(Prompt_Q);
219  ar& BOOST_SERIALIZATION_NVP(CN0_dB_hz);
220  ar& BOOST_SERIALIZATION_NVP(Carrier_Doppler_hz);
221  ar& BOOST_SERIALIZATION_NVP(Carrier_phase_rads);
222  ar& BOOST_SERIALIZATION_NVP(Code_phase_samples);
223  ar& BOOST_SERIALIZATION_NVP(Tracking_sample_counter);
224  ar& BOOST_SERIALIZATION_NVP(correlation_length_ms);
225  // Telemetry Decoder
226  ar& BOOST_SERIALIZATION_NVP(TOW_at_current_symbol_ms);
227  // Observables
228  ar& BOOST_SERIALIZATION_NVP(Pseudorange_m);
229  ar& BOOST_SERIALIZATION_NVP(RX_time);
230  ar& BOOST_SERIALIZATION_NVP(interp_TOW_ms);
231  // Flags
232  ar& BOOST_SERIALIZATION_NVP(Flag_valid_acquisition);
233  ar& BOOST_SERIALIZATION_NVP(Flag_valid_symbol_output);
234  ar& BOOST_SERIALIZATION_NVP(Flag_valid_word);
235  ar& BOOST_SERIALIZATION_NVP(Flag_valid_pseudorange);
236  ar& BOOST_SERIALIZATION_NVP(Flag_PLL_180_deg_phase_locked);
237  }
238 };
239 
240 
241 /** \} */
242 /** \} */
243 #endif // GNSS_SDR_GNSS_SYNCHRO_H
double Prompt_Q
Set by Tracking processing block.
Definition: gnss_synchro.h:60
double Pseudorange_m
Set by Observables processing block.
Definition: gnss_synchro.h:72
int32_t Channel_ID
Set by Channel constructor.
Definition: gnss_synchro.h:49
char Signal[3]
Set by Channel::set_signal(Gnss_Signal gnss_signal)
Definition: gnss_synchro.h:47
uint32_t PRN
Set by Channel::set_signal(Gnss_Signal gnss_signal)
Definition: gnss_synchro.h:48
Gnss_Synchro & operator=(const Gnss_Synchro &rhs) noexcept
Copy assignment operator.
Definition: gnss_synchro.h:87
void serialize(Archive &ar, const unsigned int version)
This member function serializes and restores Gnss_Synchro objects from a byte stream.
Definition: gnss_synchro.h:200
bool Flag_valid_pseudorange
Set by Observables processing block.
Definition: gnss_synchro.h:80
uint32_t TOW_at_current_symbol_ms
Set by Telemetry Decoder processing block.
Definition: gnss_synchro.h:69
int32_t correlation_length_ms
Set by Tracking processing block.
Definition: gnss_synchro.h:66
double Carrier_phase_rads
Set by Tracking processing block.
Definition: gnss_synchro.h:63
char System
Set by Channel::set_signal(Gnss_Signal gnss_signal)
Definition: gnss_synchro.h:46
Gnss_Synchro()=default
Default constructor.
This is the class that contains the information that is shared by the processing blocks.
Definition: gnss_synchro.h:38
double Acq_delay_samples
Set by Acquisition processing block.
Definition: gnss_synchro.h:52
uint64_t Acq_samplestamp_samples
Set by Acquisition processing block.
Definition: gnss_synchro.h:54
double Carrier_Doppler_hz
Set by Tracking processing block.
Definition: gnss_synchro.h:62
bool Flag_valid_symbol_output
Set by Tracking processing block.
Definition: gnss_synchro.h:78
double Acq_doppler_hz
Set by Acquisition processing block.
Definition: gnss_synchro.h:53
double RX_time
Set by Observables processing block.
Definition: gnss_synchro.h:73
double CN0_dB_hz
Set by Tracking processing block.
Definition: gnss_synchro.h:61
int64_t fs
Set by Tracking processing block.
Definition: gnss_synchro.h:58
Gnss_Synchro & operator=(Gnss_Synchro &&other) noexcept
Move assignment operator.
Definition: gnss_synchro.h:128
double Prompt_I
Set by Tracking processing block.
Definition: gnss_synchro.h:59
~Gnss_Synchro()=default
Default destructor.
uint64_t Tracking_sample_counter
Set by Tracking processing block.
Definition: gnss_synchro.h:65
double interp_TOW_ms
Set by Observables processing block.
Definition: gnss_synchro.h:74
double Code_phase_samples
Set by Tracking processing block.
Definition: gnss_synchro.h:64
uint32_t Acq_doppler_step
Set by Acquisition processing block.
Definition: gnss_synchro.h:55
bool Flag_valid_acquisition
Set by Acquisition processing block.
Definition: gnss_synchro.h:77
bool Flag_PLL_180_deg_phase_locked
Set by Telemetry Decoder processing block.
Definition: gnss_synchro.h:81
bool Flag_valid_word
Set by Telemetry Decoder processing block.
Definition: gnss_synchro.h:79