GNSS-SDR  0.0.17
An Open Source GNSS Software Defined Receiver
galileo_e5b_pcps_acquisition.h
Go to the documentation of this file.
1 /*!
2  * \file galileo_e5b_pcps_acquisition.h
3  * \brief Adapts a PCPS acquisition block to an AcquisitionInterface for
4  * Galileo E5b data and pilot Signals
5  * \author Piyush Gupta, 2020. piyush04111999@gmail.com
6  * \note Code added as part of GSoC 2020 program.
7  *
8  * -----------------------------------------------------------------------------
9  *
10  * GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
11  * This file is part of GNSS-SDR.
12  *
13  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
14  * SPDX-License-Identifier: GPL-3.0-or-later
15  *
16  * -----------------------------------------------------------------------------
17  */
18 
19 #ifndef GNSS_SDR_GALILEO_E5B_PCPS_ACQUISITION_H
20 #define GNSS_SDR_GALILEO_E5B_PCPS_ACQUISITION_H
21 
22 
23 #include "channel_fsm.h"
24 #include "gnss_synchro.h"
25 #include "pcps_acquisition.h"
26 #include <volk_gnsssdr/volk_gnsssdr_alloc.h>
27 #include <memory>
28 #include <string>
29 
30 /** \addtogroup Acquisition
31  * \{ */
32 /** \addtogroup Acq_adapters
33  * \{ */
34 
35 
37 
39 {
40 public:
41  /*!
42  * \brief Constructor
43  */
45  const std::string& role,
46  unsigned int in_streams,
47  unsigned int out_streams);
48 
49  /*!
50  * \brief Destructor
51  */
52  ~GalileoE5bPcpsAcquisition() = default;
53 
54  /*!
55  * \brief Role
56  */
57  inline std::string role() override
58  {
59  return role_;
60  }
61 
62  /*!
63  * \brief Returns "GALILEO_E5b_PCPS_Acquisition"
64  */
65 
66  inline std::string implementation() override
67  {
68  return "Galileo_E5b_PCPS_Acquisition";
69  }
70 
71  /*!
72  * \brief Returns size of lv_16sc_t
73  */
74  inline size_t item_size() override
75  {
76  return sizeof(int16_t);
77  }
78 
79  /*!
80  * \brief Connect
81  */
82  void connect(gr::top_block_sptr top_block) override;
83 
84  /*!
85  * \brief Disconnect
86  */
87  void disconnect(gr::top_block_sptr top_block) override;
88 
89  /*!
90  * \brief Get left block
91  */
92  gr::basic_block_sptr get_left_block() override;
93 
94  /*!
95  * \brief Get right block
96  */
97  gr::basic_block_sptr get_right_block() override;
98 
99  /*!
100  * \brief Set acquisition/tracking common Gnss_Synchro object pointer
101  * to efficiently exchange synchronization data between acquisition and
102  * tracking blocks
103  */
104  void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
105 
106  /*!
107  * \brief Set acquisition channel unique ID
108  */
109  inline void set_channel(unsigned int channel) override
110  {
111  channel_ = channel;
112  acquisition_->set_channel(channel_);
113  }
114 
115  /*!
116  * \brief Set channel fsm associated to this acquisition instance
117  */
118  inline void set_channel_fsm(std::weak_ptr<ChannelFsm> channel_fsm) override
119  {
120  channel_fsm_ = channel_fsm;
121  acquisition_->set_channel_fsm(channel_fsm);
122  }
123 
124  /*!
125  * \brief Set statistics threshold of PCPS algorithm
126  */
127  void set_threshold(float threshold) override;
128 
129  /*!
130  * \brief Set maximum Doppler off grid search
131  */
132  void set_doppler_max(unsigned int doppler_max) override;
133 
134  /*!
135  * \brief Set Doppler steps for the grid search
136  */
137  void set_doppler_step(unsigned int doppler_step) override;
138 
139  /*!
140  * \brief Set Doppler center for the grid search
141  */
142  void set_doppler_center(int doppler_center) override;
143 
144  /*!
145  * \brief Initializes acquisition algorithm.
146  */
147  void init() override;
148 
149  /*!
150  * \brief Sets local Galileo E5b code for PCPS acquisition algorithm.
151  */
152  void set_local_code() override;
153 
154  /*!
155  * \brief Returns the maximum peak of grid search
156  */
157  signed int mag() override;
158 
159  /*!
160  * \brief Restart acquisition algorithm
161  */
162  void reset() override;
163 
164  /*!
165  * \brief If set to 1, ensures that acquisition starts at the
166  * first available sample.
167  * \param state - int=1 forces start of acquisition
168  */
169  void set_state(int state) override;
170 
171  /*!
172  * \brief Stop running acquisition
173  */
174  void stop_acquisition() override;
175 
176  /*!
177  * \brief Sets the resampler latency to account it in the acquisition code delay estimation
178  */
179  void set_resampler_latency(uint32_t latency_samples) override;
180 
181 private:
182  pcps_acquisition_sptr acquisition_;
183 
184  volk_gnsssdr::vector<std::complex<float>> code_;
185  std::weak_ptr<ChannelFsm> channel_fsm_;
186 
187  Gnss_Synchro* gnss_synchro_;
188  Acq_Conf acq_parameters_;
189 
190  std::string item_type_;
191  std::string dump_filename_;
192  std::string role_;
193 
194  size_t item_size_;
195  int64_t fs_in_;
196 
197  float threshold_;
198  int doppler_center_;
199  unsigned int vector_length_;
200  unsigned int code_length_;
201  unsigned int channel_;
202  unsigned int doppler_max_;
203  unsigned int doppler_step_;
204  unsigned int sampled_ms_;
205  unsigned int in_streams_;
206  unsigned int out_streams_;
207 
208  bool acq_pilot_;
209  bool acq_iq_;
210 };
211 
212 
213 /** \} */
214 /** \} */
215 #endif // GNSS_SDR_GALILEO_E5B_PCPS_ACQUISITION_H
void disconnect(gr::top_block_sptr top_block) override
Disconnect.
void set_threshold(float threshold) override
Set statistics threshold of PCPS algorithm.
gr::basic_block_sptr get_left_block() override
Get left block.
signed int mag() override
Returns the maximum peak of grid search.
void set_local_code() override
Sets local Galileo E5b code for PCPS acquisition algorithm.
GalileoE5bPcpsAcquisition(const ConfigurationInterface *configuration, const std::string &role, unsigned int in_streams, unsigned int out_streams)
Constructor.
Interface of the State Machine for channel.
void set_doppler_center(int doppler_center) override
Set Doppler center for the grid search.
void reset() override
Restart acquisition algorithm.
void set_resampler_latency(uint32_t latency_samples) override
Sets the resampler latency to account it in the acquisition code delay estimation.
void set_channel(unsigned int channel) override
Set acquisition channel unique ID.
This class implements a Parallel Code Phase Search Acquisition.
std::string implementation() override
Returns "GALILEO_E5b_PCPS_Acquisition".
This abstract class represents an interface to an acquisition GNSS block.
This is the class that contains the information that is shared by the processing blocks.
Definition: gnss_synchro.h:38
This abstract class represents an interface to configuration parameters.
void set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) override
Set acquisition/tracking common Gnss_Synchro object pointer to efficiently exchange synchronization d...
gr::basic_block_sptr get_right_block() override
Get right block.
void set_doppler_step(unsigned int doppler_step) override
Set Doppler steps for the grid search.
void connect(gr::top_block_sptr top_block) override
Connect.
size_t item_size() override
Returns size of lv_16sc_t.
std::string role() override
Role.
~GalileoE5bPcpsAcquisition()=default
Destructor.
void init() override
Initializes acquisition algorithm.
void set_channel_fsm(std::weak_ptr< ChannelFsm > channel_fsm) override
Set channel fsm associated to this acquisition instance.
void set_doppler_max(unsigned int doppler_max) override
Set maximum Doppler off grid search.
void stop_acquisition() override
Stop running acquisition.
Interface of the Gnss_Synchro class.
void set_state(int state) override
If set to 1, ensures that acquisition starts at the first available sample.