GNSS-SDR  0.0.13
An Open Source GNSS Software Defined Receiver
gps_l1_ca_tcp_connector_tracking_cc.h
Go to the documentation of this file.
1 /*!
2  * \file gps_l1_ca_tcp_connector_tracking_cc.h
3  * \brief Interface of a TCP connector block based on code DLL + carrier PLL
4  * \author David Pubill, 2012. dpubill(at)cttc.es
5  * Javier Arribas, 2011. jarribas(at)cttc.es
6  *
7  * Code DLL + carrier PLL according to the algorithms described in:
8  * K.Borre, D.M.Akos, N.Bertelsen, P.Rinder, and S.H.Jensen,
9  * A Software-Defined GPS and Galileo Receiver. A Single-Frequency Approach,
10  * Birkhauser, 2007
11  *
12  * -----------------------------------------------------------------------------
13  *
14  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
15  *
16  * GNSS-SDR is a software defined Global Navigation
17  * Satellite Systems receiver
18  *
19  * This file is part of GNSS-SDR.
20  *
21  * SPDX-License-Identifier: GPL-3.0-or-later
22  *
23  * -----------------------------------------------------------------------------
24  */
25 
26 #ifndef GNSS_SDR_GPS_L1_CA_TCP_CONNECTOR_TRACKING_CC_H
27 #define GNSS_SDR_GPS_L1_CA_TCP_CONNECTOR_TRACKING_CC_H
28 
29 #include "cpu_multicorrelator.h"
30 #include "gnss_synchro.h"
31 #include "tcp_communication.h"
32 #include <gnuradio/block.h>
33 #include <volk_gnsssdr/volk_gnsssdr_alloc.h> // for volk_gnsssdr::vector
34 #include <fstream>
35 #include <map>
36 #include <string>
37 #if GNURADIO_USES_STD_POINTERS
38 #include <memory>
39 #else
40 #include <boost/shared_ptr.hpp>
41 #endif
42 
43 
45 
46 #if GNURADIO_USES_STD_POINTERS
47 using gps_l1_ca_tcp_connector_tracking_cc_sptr = std::shared_ptr<Gps_L1_Ca_Tcp_Connector_Tracking_cc>;
48 #else
49 using gps_l1_ca_tcp_connector_tracking_cc_sptr = boost::shared_ptr<Gps_L1_Ca_Tcp_Connector_Tracking_cc>;
50 #endif
51 
52 gps_l1_ca_tcp_connector_tracking_cc_sptr
53 gps_l1_ca_tcp_connector_make_tracking_cc(
54  int64_t fs_in, uint32_t vector_length,
55  bool dump,
56  const std::string &dump_filename,
57  float early_late_space_chips,
58  size_t port_ch0);
59 
60 
61 /*!
62  * \brief This class implements a DLL + PLL tracking loop block
63  */
64 class Gps_L1_Ca_Tcp_Connector_Tracking_cc : public gr::block
65 {
66 public:
68 
69  void set_channel(uint32_t channel);
70  void set_gnss_synchro(Gnss_Synchro *p_gnss_synchro);
71  void start_tracking();
72 
73  /*
74  * \brief just like gr_block::general_work, only this arranges to call consume_each for you
75  *
76  * The user must override work to define the signal processing code
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 gps_l1_ca_tcp_connector_tracking_cc_sptr
85  gps_l1_ca_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 early_late_space_chips,
90  size_t port_ch0);
91 
93  int64_t fs_in, uint32_t vector_length,
94  bool dump,
95  const std::string &dump_filename,
96  float early_late_space_chips,
97  size_t port_ch0);
98 
99  volk_gnsssdr::vector<gr_complex> d_ca_code;
100  // correlator
101  volk_gnsssdr::vector<float> d_local_code_shift_chips;
102  volk_gnsssdr::vector<gr_complex> d_correlator_outs;
103  volk_gnsssdr::vector<gr_complex> d_Prompt_buffer;
104  Cpu_Multicorrelator multicorrelator_cpu;
105  Tcp_Communication d_tcp_com;
106  Gnss_Synchro *d_acquisition_gnss_synchro;
107  // tracking configuration vars
108 
109  gr_complex *d_Early;
110  gr_complex *d_Prompt;
111  gr_complex *d_Late;
112 
113  // file dump
114  std::string d_dump_filename;
115  std::ofstream d_dump_file;
116 
117  std::map<std::string, std::string> systemName;
118  std::string sys;
119 
120  double d_early_late_spc_chips;
121  double d_code_phase_step_chips;
122  double d_rem_code_phase_samples;
123  double d_next_rem_code_phase_samples;
124  double d_code_freq_hz;
125  double d_carrier_doppler_hz;
126  double d_acc_carrier_phase_rad;
127  double d_code_phase_samples;
128  double d_sample_counter_seconds;
129 
130  int64_t d_fs_in;
131  uint64_t d_sample_counter;
132  uint64_t d_acq_sample_stamp;
133 
134  size_t d_port_ch0;
135  size_t d_port;
136 
137  uint32_t d_vector_length;
138  uint32_t d_channel;
139 
140  int32_t d_correlation_length_samples;
141  int32_t d_n_correlator_taps;
142  int32_t d_listen_connection;
143  int32_t d_current_prn_length_samples;
144  int32_t d_next_prn_length_samples;
145  int32_t d_cn0_estimation_counter;
146  int32_t d_carrier_lock_fail_counter;
147 
148  float d_rem_carr_phase_rad;
149  float d_acq_code_phase_samples;
150  float d_acq_carrier_doppler_hz;
151  float d_carrier_lock_test;
152  float d_CN0_SNV_dB_Hz;
153  float d_carrier_lock_threshold;
154  float d_control_id;
155 
156  bool d_enable_tracking;
157  bool d_pull_in;
158  bool d_dump;
159 };
160 
161 #endif // GNSS_SDR_GPS_L1_CA_TCP_CONNECTOR_TRACKING_CC_H
High optimized CPU vector multiTAP correlator class.
This class implements a DLL + PLL tracking loop block.
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.
Interface of the Gnss_Synchro class.