GNSS-SDR  0.0.19
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  * GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
15  * This file is part of GNSS-SDR.
16  *
17  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
18  * SPDX-License-Identifier: GPL-3.0-or-later
19  *
20  * -----------------------------------------------------------------------------
21  */
22 
23 #ifndef GNSS_SDR_GPS_L1_CA_TCP_CONNECTOR_TRACKING_CC_H
24 #define GNSS_SDR_GPS_L1_CA_TCP_CONNECTOR_TRACKING_CC_H
25 
26 #include "cpu_multicorrelator.h"
27 #include "gnss_block_interface.h"
28 #include "gnss_synchro.h"
29 #include "tcp_communication.h"
30 #include <gnuradio/block.h>
31 #include <volk_gnsssdr/volk_gnsssdr_alloc.h> // for volk_gnsssdr::vector
32 #include <fstream>
33 #include <map>
34 #include <string>
35 
36 /** \addtogroup Tracking
37  * \{ */
38 /** \addtogroup Tracking_gnuradio_blocks
39  * \{ */
40 
41 
43 
44 using gps_l1_ca_tcp_connector_tracking_cc_sptr = gnss_shared_ptr<Gps_L1_Ca_Tcp_Connector_Tracking_cc>;
45 
46 gps_l1_ca_tcp_connector_tracking_cc_sptr
47 gps_l1_ca_tcp_connector_make_tracking_cc(
48  int64_t fs_in, uint32_t vector_length,
49  bool dump,
50  const std::string &dump_filename,
51  float early_late_space_chips,
52  size_t port_ch0);
53 
54 
55 /*!
56  * \brief This class implements a DLL + PLL tracking loop block
57  */
58 class Gps_L1_Ca_Tcp_Connector_Tracking_cc : public gr::block
59 {
60 public:
62 
63  void set_channel(uint32_t channel);
64  void set_gnss_synchro(Gnss_Synchro *p_gnss_synchro);
65  void start_tracking();
66 
67  /*
68  * \brief just like gr_block::general_work, only this arranges to call consume_each for you
69  *
70  * The user must override work to define the signal processing code
71  */
72  int general_work(int noutput_items, gr_vector_int &ninput_items,
73  gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
74 
75  void forecast(int noutput_items, gr_vector_int &ninput_items_required);
76 
77 private:
78  friend gps_l1_ca_tcp_connector_tracking_cc_sptr
79  gps_l1_ca_tcp_connector_make_tracking_cc(
80  int64_t fs_in, uint32_t vector_length,
81  bool dump,
82  const std::string &dump_filename,
83  float early_late_space_chips,
84  size_t port_ch0);
85 
87  int64_t fs_in, uint32_t vector_length,
88  bool dump,
89  const std::string &dump_filename,
90  float early_late_space_chips,
91  size_t port_ch0);
92 
93  volk_gnsssdr::vector<gr_complex> d_ca_code;
94  // correlator
95  volk_gnsssdr::vector<float> d_local_code_shift_chips;
96  volk_gnsssdr::vector<gr_complex> d_correlator_outs;
97  volk_gnsssdr::vector<gr_complex> d_Prompt_buffer;
98  Cpu_Multicorrelator multicorrelator_cpu;
99  Tcp_Communication d_tcp_com;
100  Gnss_Synchro *d_acquisition_gnss_synchro;
101  // tracking configuration vars
102 
103  gr_complex *d_Early;
104  gr_complex *d_Prompt;
105  gr_complex *d_Late;
106 
107  // file dump
108  std::string d_dump_filename;
109  std::ofstream d_dump_file;
110 
111  std::map<std::string, std::string> systemName;
112  std::string sys;
113 
114  double d_early_late_spc_chips;
115  double d_code_phase_step_chips;
116  double d_rem_code_phase_samples;
117  double d_next_rem_code_phase_samples;
118  double d_code_freq_hz;
119  double d_carrier_doppler_hz;
120  double d_acc_carrier_phase_rad;
121  double d_code_phase_samples;
122  double d_sample_counter_seconds;
123 
124  int64_t d_fs_in;
125  uint64_t d_sample_counter;
126  uint64_t d_acq_sample_stamp;
127 
128  size_t d_port_ch0;
129  size_t d_port;
130 
131  uint32_t d_vector_length;
132  uint32_t d_channel;
133 
134  int32_t d_correlation_length_samples;
135  int32_t d_n_correlator_taps;
136  int32_t d_listen_connection;
137  int32_t d_current_prn_length_samples;
138  int32_t d_next_prn_length_samples;
139  int32_t d_cn0_estimation_counter;
140  int32_t d_carrier_lock_fail_counter;
141 
142  float d_rem_carr_phase_rad;
143  float d_acq_code_phase_samples;
144  float d_acq_carrier_doppler_hz;
145  float d_carrier_lock_test;
146  float d_CN0_SNV_dB_Hz;
147  float d_carrier_lock_threshold;
148  float d_control_id;
149 
150  bool d_enable_tracking;
151  bool d_pull_in;
152  bool d_dump;
153 };
154 
155 
156 /** \} */
157 /** \} */
158 #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:38
This interface represents a GNSS block.
Interface of the TCP communication class.
TCP communication class.
Interface of the Gnss_Synchro class.