GNSS-SDR  0.0.13
An Open Source GNSS Software Defined Receiver
galileo_e1_tcp_connector_tracking_cc.h
Go to the documentation of this file.
1 /*!
2  * \file galileo_e1_tcp_connector_tracking_cc.h
3  * \brief Interface of a TCP connector block based on code DLL + carrier PLL VEML (Very Early
4  * Minus Late) tracking block for Galileo E1 signals
5  * \author David Pubill, 2012. dpubill(at)cttc.es
6  * Luis Esteve, 2012. luis(at)epsilon-formacion.com
7  * Javier Arribas, 2011. jarribas(at)cttc.es
8  *
9  * Code DLL + carrier PLL according to the algorithms described in:
10  * K.Borre, D.M.Akos, N.Bertelsen, P.Rinder, and S.H.Jensen,
11  * A Software-Defined GPS and Galileo Receiver. A Single-Frequency Approach,
12  * Birkhauser, 2007
13  *
14  * -----------------------------------------------------------------------------
15  *
16  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
17  *
18  * GNSS-SDR is a software defined Global Navigation
19  * Satellite Systems receiver
20  *
21  * This file is part of GNSS-SDR.
22  *
23  * SPDX-License-Identifier: GPL-3.0-or-later
24  *
25  * -----------------------------------------------------------------------------
26  */
27 
28 #ifndef GNSS_SDR_GALILEO_E1_TCP_CONNECTOR_TRACKING_CC_H
29 #define GNSS_SDR_GALILEO_E1_TCP_CONNECTOR_TRACKING_CC_H
30 
31 #include "cpu_multicorrelator.h"
32 #include "gnss_synchro.h"
33 #include "tcp_communication.h"
34 #include <gnuradio/block.h>
35 #include <volk_gnsssdr/volk_gnsssdr_alloc.h> // for volk_gnsssdr::vector
36 #include <fstream>
37 #include <map>
38 #include <string>
39 #if GNURADIO_USES_STD_POINTERS
40 #include <memory>
41 #else
42 #include <boost/shared_ptr.hpp>
43 #endif
44 
45 
47 
48 #if GNURADIO_USES_STD_POINTERS
49 using galileo_e1_tcp_connector_tracking_cc_sptr = std::shared_ptr<Galileo_E1_Tcp_Connector_Tracking_cc>;
50 #else
51 using galileo_e1_tcp_connector_tracking_cc_sptr = boost::shared_ptr<Galileo_E1_Tcp_Connector_Tracking_cc>;
52 #endif
53 
54 galileo_e1_tcp_connector_tracking_cc_sptr
55 galileo_e1_tcp_connector_make_tracking_cc(
56  int64_t fs_in, uint32_t vector_length,
57  bool dump,
58  const std::string &dump_filename,
59  float pll_bw_hz,
60  float dll_bw_hz,
61  float early_late_space_chips,
62  float very_early_late_space_chips,
63  size_t port_ch0);
64 
65 /*!
66  * \brief This class implements a code DLL + carrier PLL VEML (Very Early
67  * Minus Late) tracking block for Galileo E1 signals
68  */
69 class Galileo_E1_Tcp_Connector_Tracking_cc : public gr::block
70 {
71 public:
73 
74  void set_channel(uint32_t channel);
75  void set_gnss_synchro(Gnss_Synchro *p_gnss_synchro);
76  void start_tracking();
77 
78  int general_work(int noutput_items, gr_vector_int &ninput_items,
79  gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
80 
81  void forecast(int noutput_items, gr_vector_int &ninput_items_required);
82 
83 private:
84  friend galileo_e1_tcp_connector_tracking_cc_sptr
85  galileo_e1_tcp_connector_make_tracking_cc(
86  int64_t fs_in, uint32_t vector_length,
87  bool dump,
88  const std::string &dump_filename,
89  float pll_bw_hz,
90  float dll_bw_hz,
91  float early_late_space_chips,
92  float very_early_late_space_chips,
93  size_t port_ch0);
94 
96  int64_t fs_in, uint32_t vector_length,
97  bool dump,
98  const std::string &dump_filename,
99  float pll_bw_hz,
100  float dll_bw_hz,
101  float early_late_space_chips,
102  float very_early_late_space_chips,
103  size_t port_ch0);
104 
105  void update_local_code();
106 
107  void update_local_carrier();
108 
109  // tracking configuration vars
110  uint32_t d_vector_length;
111  bool d_dump;
112 
113  Gnss_Synchro *d_acquisition_gnss_synchro;
114  uint32_t d_channel;
115 
116  int64_t d_fs_in;
117 
118  int32_t d_correlation_length_samples;
119  int32_t d_n_correlator_taps;
120  float d_early_late_spc_chips;
121  float d_very_early_late_spc_chips;
122 
123  volk_gnsssdr::vector<gr_complex> d_ca_code;
124 
125  gr_complex *d_Very_Early;
126  gr_complex *d_Early;
127  gr_complex *d_Prompt;
128  gr_complex *d_Late;
129  gr_complex *d_Very_Late;
130 
131  // remaining code phase and carrier phase between tracking loops
132  double d_rem_code_phase_samples;
133  float d_next_rem_code_phase_samples;
134  float d_rem_carr_phase_rad;
135 
136  // acquisition
137  float d_acq_code_phase_samples;
138  float d_acq_carrier_doppler_hz;
139 
140  // correlator
141  volk_gnsssdr::vector<float> d_local_code_shift_chips;
142  volk_gnsssdr::vector<gr_complex> d_correlator_outs;
143  Cpu_Multicorrelator multicorrelator_cpu;
144 
145  // tracking vars
146  double d_code_freq_chips;
147  float d_carrier_doppler_hz;
148  float d_acc_carrier_phase_rad;
149  float d_acc_code_phase_secs;
150  float d_code_phase_samples;
151  size_t d_port_ch0;
152  size_t d_port;
153  int32_t d_listen_connection;
154  float d_control_id;
155  Tcp_Communication d_tcp_com;
156 
157  // PRN period in samples
158  int32_t d_current_prn_length_samples;
159  int32_t d_next_prn_length_samples;
160 
161  // processing samples counters
162  uint64_t d_sample_counter;
163  uint64_t d_acq_sample_stamp;
164 
165  // CN0 estimation and lock detector
166  int32_t d_cn0_estimation_counter;
167  volk_gnsssdr::vector<gr_complex> d_Prompt_buffer;
168  float d_carrier_lock_test;
169  float d_CN0_SNV_dB_Hz;
170  float d_carrier_lock_threshold;
171  int32_t d_carrier_lock_fail_counter;
172 
173  // control vars
174  bool d_enable_tracking;
175  bool d_pull_in;
176 
177  // file dump
178  std::string d_dump_filename;
179  std::ofstream d_dump_file;
180 
181  std::map<std::string, std::string> systemName;
182  std::string sys;
183 };
184 
185 #endif // GNSS_SDR_GALILEO_E1_TCP_CONNECTOR_TRACKING_CC_H
High optimized CPU vector multiTAP correlator class.
Class that implements carrier wipe-off and correlators.
This is the class that contains the information that is shared by the processing blocks.
Definition: gnss_synchro.h:33
Interface of the TCP communication class.
TCP communication class.
This class implements a code DLL + carrier PLL VEML (Very Early Minus Late) tracking block for Galile...
Interface of the Gnss_Synchro class.