GNSS-SDR  0.0.21
An Open Source GNSS Software Defined Receiver
glonass_l1_ca_telemetry_decoder_gs.h
Go to the documentation of this file.
1 /*!
2  * \file glonass_l1_ca_telemetry_decoder_gs.h
3  * \brief Implementation of a GLONASS L1 C/A NAV data decoder block
4  * \note Code added as part of GSoC 2017 program
5  * \author Damian Miralles, 2017. dmiralles2009(at)gmail.comK
6  *
7  * -----------------------------------------------------------------------------
8  *
9  * GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
10  * This file is part of GNSS-SDR.
11  *
12  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
13  * SPDX-License-Identifier: GPL-3.0-or-later
14  *
15  * -----------------------------------------------------------------------------
16  */
17 
18 #ifndef GNSS_SDR_GLONASS_L1_CA_TELEMETRY_DECODER_GS_H
19 #define GNSS_SDR_GLONASS_L1_CA_TELEMETRY_DECODER_GS_H
20 
21 
22 #include "GLONASS_L1_L2_CA.h"
24 #include "gnss_synchro.h"
25 #include "nav_message_packet.h"
27 #include "tlm_conf.h"
28 #include <boost/circular_buffer.hpp>
29 #include <gnuradio/types.h> // for gr_vector_const_void_star
30 #include <array>
31 
32 /** \addtogroup Telemetry_Decoder
33  * \{ */
34 /** \addtogroup Telemetry_Decoder_gnuradio_blocks
35  * \{ */
36 
37 
39 
40 using glonass_l1_ca_telemetry_decoder_gs_sptr = gnss_shared_ptr<glonass_l1_ca_telemetry_decoder_gs>;
41 
42 glonass_l1_ca_telemetry_decoder_gs_sptr glonass_l1_ca_make_telemetry_decoder_gs(
43  const Gnss_Satellite &satellite,
44  const Tlm_Conf &conf);
45 
46 /*!
47  * \brief This class implements a block that decodes the GNAV data defined in GLONASS ICD v5.1
48  * \note Code added as part of GSoC 2017 program
49  * \see <a href="http://russianspacesystems.ru/wp-content/uploads/2016/08/ICD_GLONASS_eng_v5.1.pdf">GLONASS ICD</a>
50  *
51  */
53 {
54 public:
55  ~glonass_l1_ca_telemetry_decoder_gs() override; //!< Class destructor
56  void set_satellite(const Gnss_Satellite &satellite) override; //!< Set satellite PRN
57  void set_channel(int32_t channel) override; //!< Set receiver's channel
58  inline void reset() override {};
59 
60  /*!
61  * \brief This is where all signal processing takes place
62  */
63  int general_work(int noutput_items, gr_vector_int &ninput_items,
64  gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) override;
65 
66 private:
67  friend glonass_l1_ca_telemetry_decoder_gs_sptr glonass_l1_ca_make_telemetry_decoder_gs(
68  const Gnss_Satellite &satellite,
69  const Tlm_Conf &conf);
70 
71  glonass_l1_ca_telemetry_decoder_gs(const Gnss_Satellite &satellite, const Tlm_Conf &conf);
72 
73  const std::array<int16_t, GLONASS_GNAV_PREAMBLE_LENGTH_BITS> d_preambles_bits{GLONASS_GNAV_PREAMBLE_SAMPLES};
74 
75  void decode_string(const double *symbols, double cn0);
76 
77  // Storage for incoming data
78  boost::circular_buffer<Gnss_Synchro> d_symbol_history;
79 
80  // Navigation Message variable
82 
83  Gnss_Satellite d_satellite;
84 
85  Nav_Message_Packet d_nav_msg_packet;
86  std::unique_ptr<Tlm_CRC_Stats> d_Tlm_CRC_Stats;
87 
88  std::string d_dump_filename;
89  std::ofstream d_dump_file;
90 
91  double d_preamble_time_samples;
92  double d_TOW_at_current_symbol;
93 
94  // Variables for internal functionality
95  uint64_t d_sample_counter; // Sample counter as an index (1,2,3,..etc) indicating number of samples processed
96  uint64_t d_preamble_index; // Index of sample number where preamble was found
97 
98  uint32_t d_stat; // Status of decoder
99  int32_t d_CRC_error_counter; // Number of failed CRC operations
100  int32_t d_channel;
101 
102  bool d_flag_frame_sync; // Indicate when a frame sync is achieved
103  bool d_flag_preamble; // Flag indicating when preamble was found
104  bool d_dump;
105  bool d_dump_mat;
106  bool d_remove_dat;
107  bool d_enable_navdata_monitor;
108  bool d_dump_crc_stats;
109  bool d_tow_to_trk;
110 };
111 
112 
113 /** \} */
114 /** \} */
115 #endif // GNSS_SDR_GLONASS_L1_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.
void set_satellite(const Gnss_Satellite &satellite) override
Set satellite PRN.
void set_channel(int32_t channel) override
Set receiver&#39;s channel.
Class that contains all the configuration parameters for generic telemetry decoder block...
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 implements a block that decodes the GNAV data defined in GLONASS ICD v5.1.
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...
~glonass_l1_ca_telemetry_decoder_gs() override
Class destructor.
This class decodes a GLONASS GNAV Data message as described in GLONASS ICD (Edition 5...
Interface of the Gnss_Synchro class.