GNSS-SDR  0.0.21
An Open Source GNSS Software Defined Receiver
glonass_l2_ca_telemetry_decoder_gs.h
Go to the documentation of this file.
1 /*!
2  * \file glonass_l2_ca_telemetry_decoder_gs.h
3  * \brief Implementation of a GLONASS L2 C/A NAV data decoder block
4  * \author Damian Miralles, 2018. dmiralles2009(at)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 #ifndef GNSS_SDR_GLONASS_L2_CA_TELEMETRY_DECODER_GS_H
18 #define GNSS_SDR_GLONASS_L2_CA_TELEMETRY_DECODER_GS_H
19 
20 
21 #include "GLONASS_L1_L2_CA.h"
23 #include "gnss_synchro.h"
24 #include "nav_message_packet.h"
26 #include "tlm_conf.h"
27 #include <boost/circular_buffer.hpp>
28 #include <gnuradio/types.h> // for gr_vector_const_void_star
29 #include <array>
30 
31 /** \addtogroup Telemetry_Decoder
32  * \{ */
33 /** \addtogroup Telemetry_Decoder_gnuradio_blocks
34  * \{ */
35 
36 
38 
39 using glonass_l2_ca_telemetry_decoder_gs_sptr = gnss_shared_ptr<glonass_l2_ca_telemetry_decoder_gs>;
40 
41 glonass_l2_ca_telemetry_decoder_gs_sptr glonass_l2_ca_make_telemetry_decoder_gs(
42  const Gnss_Satellite &satellite,
43  const Tlm_Conf &conf);
44 
45 /*!
46  * \brief This class implements a block that decodes the GNAV data defined in GLONASS ICD v5.1
47  * \see <a href="http://russianspacesystems.ru/wp-content/uploads/2016/08/ICD_GLONASS_eng_v5.1.pdf">GLONASS ICD</a>
48  *
49  */
51 {
52 public:
53  ~glonass_l2_ca_telemetry_decoder_gs() override; //!< Class destructor
54  void set_satellite(const Gnss_Satellite &satellite) override; //!< Set satellite PRN
55  void set_channel(int32_t channel) override; //!< Set receiver's channel
56  inline void reset() override {};
57 
58  /*!
59  * \brief This is where all signal processing takes place
60  */
61  int general_work(int noutput_items, gr_vector_int &ninput_items,
62  gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) override;
63 
64 private:
65  friend glonass_l2_ca_telemetry_decoder_gs_sptr glonass_l2_ca_make_telemetry_decoder_gs(
66  const Gnss_Satellite &satellite,
67  const Tlm_Conf &conf);
68 
69  glonass_l2_ca_telemetry_decoder_gs(const Gnss_Satellite &satellite, const Tlm_Conf &conf);
70 
71  const std::array<int16_t, GLONASS_GNAV_PREAMBLE_LENGTH_BITS> d_preambles_bits{GLONASS_GNAV_PREAMBLE_SAMPLES};
72  void decode_string(const double *symbols, double cn0);
73 
74  // Storage for incoming data
75  boost::circular_buffer<Gnss_Synchro> d_symbol_history;
76 
77  // Navigation Message variable
79  Gnss_Satellite d_satellite;
80 
81  Nav_Message_Packet d_nav_msg_packet;
82  std::unique_ptr<Tlm_CRC_Stats> d_Tlm_CRC_Stats;
83 
84  std::string d_dump_filename;
85  std::ofstream d_dump_file;
86 
87  double d_preamble_time_samples;
88  double d_TOW_at_current_symbol;
89 
90  uint64_t d_sample_counter; // Sample counter as an index (1,2,3,..etc) indicating number of samples processed
91  uint64_t d_preamble_index; // Index of sample number where preamble was found
92  uint32_t d_stat; // Status of decoder
93 
94  int32_t d_CRC_error_counter; // Number of failed CRC operations
95  int32_t d_channel;
96 
97  bool d_flag_frame_sync; // Indicate when a frame sync is achieved
98  bool d_flag_preamble; // Flag indicating when preamble was found
99  bool d_dump;
100  bool d_dump_mat;
101  bool d_remove_dat;
102  bool d_enable_navdata_monitor;
103  bool d_dump_crc_stats;
104  bool d_tow_to_trk;
105 };
106 
107 
108 /** \} */
109 /** \} */
110 #endif // GNSS_SDR_GLONASS_L2_CA_TELEMETRY_DECODER_GS_H
Defines system parameters for GLONASS L1 C/A signal and NAV data.
Common base class for telemetry decoder GNU Radio implementations.
Class that contains all the configuration parameters for generic telemetry decoder block...
~glonass_l2_ca_telemetry_decoder_gs() override
Class destructor.
void set_channel(int32_t channel) override
Set receiver&#39;s channel.
This class represents a GNSS satellite.
Base class for telemetry decoder GNU Radio blocks.
Interface of a GLONASS GNAV Data message decoder as described in GLONASS ICD (Edition 5...
void set_satellite(const Gnss_Satellite &satellite) override
Set satellite PRN.
int general_work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) override
This is where all signal processing takes place.
This class decodes a GLONASS GNAV Data message as described in GLONASS ICD (Edition 5...
This class implements a block that decodes the GNAV data defined in GLONASS ICD v5.1.
Interface of the Gnss_Synchro class.