GNSS-SDR  0.0.19
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 #include <utility>
30 
31 /** \addtogroup Acquisition
32  * \{ */
33 /** \addtogroup Acq_adapters
34  * \{ */
35 
36 
38 
40 {
41 public:
42  /*!
43  * \brief Constructor
44  */
46  const std::string& role,
47  unsigned int in_streams,
48  unsigned int out_streams);
49 
50  /*!
51  * \brief Destructor
52  */
53  ~GalileoE5bPcpsAcquisition() = default;
54 
55  /*!
56  * \brief Role
57  */
58  inline std::string role() override
59  {
60  return role_;
61  }
62 
63  /*!
64  * \brief Returns "GALILEO_E5b_PCPS_Acquisition"
65  */
66 
67  inline std::string implementation() override
68  {
69  return "Galileo_E5b_PCPS_Acquisition";
70  }
71 
72  /*!
73  * \brief Returns size of lv_16sc_t
74  */
75  inline size_t item_size() override
76  {
77  return sizeof(int16_t);
78  }
79 
80  /*!
81  * \brief Connect
82  */
83  void connect(gr::top_block_sptr top_block) override;
84 
85  /*!
86  * \brief Disconnect
87  */
88  void disconnect(gr::top_block_sptr top_block) override;
89 
90  /*!
91  * \brief Get left block
92  */
93  gr::basic_block_sptr get_left_block() override;
94 
95  /*!
96  * \brief Get right block
97  */
98  gr::basic_block_sptr get_right_block() override;
99 
100  /*!
101  * \brief Set acquisition/tracking common Gnss_Synchro object pointer
102  * to efficiently exchange synchronization data between acquisition and
103  * tracking blocks
104  */
105  void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
106 
107  /*!
108  * \brief Set acquisition channel unique ID
109  */
110  inline void set_channel(unsigned int channel) override
111  {
112  channel_ = channel;
113  acquisition_->set_channel(channel_);
114  }
115 
116  /*!
117  * \brief Set channel fsm associated to this acquisition instance
118  */
119  inline void set_channel_fsm(std::weak_ptr<ChannelFsm> channel_fsm) override
120  {
121  channel_fsm_ = std::move(channel_fsm);
122  acquisition_->set_channel_fsm(channel_fsm_);
123  }
124 
125  /*!
126  * \brief Set statistics threshold of PCPS algorithm
127  */
128  void set_threshold(float threshold) override;
129 
130  /*!
131  * \brief Set maximum Doppler off grid search
132  */
133  void set_doppler_max(unsigned int doppler_max) override;
134 
135  /*!
136  * \brief Set Doppler steps for the grid search
137  */
138  void set_doppler_step(unsigned int doppler_step) override;
139 
140  /*!
141  * \brief Set Doppler center for the grid search
142  */
143  void set_doppler_center(int doppler_center) override;
144 
145  /*!
146  * \brief Initializes acquisition algorithm.
147  */
148  void init() override;
149 
150  /*!
151  * \brief Sets local Galileo E5b code for PCPS acquisition algorithm.
152  */
153  void set_local_code() override;
154 
155  /*!
156  * \brief Returns the maximum peak of grid search
157  */
158  signed int mag() override;
159 
160  /*!
161  * \brief Restart acquisition algorithm
162  */
163  void reset() override;
164 
165  /*!
166  * \brief If set to 1, ensures that acquisition starts at the
167  * first available sample.
168  * \param state - int=1 forces start of acquisition
169  */
170  void set_state(int state) override;
171 
172  /*!
173  * \brief Stop running acquisition
174  */
175  void stop_acquisition() override;
176 
177  /*!
178  * \brief Sets the resampler latency to account it in the acquisition code delay estimation
179  */
180  void set_resampler_latency(uint32_t latency_samples) override;
181 
182 private:
183  pcps_acquisition_sptr acquisition_;
184 
185  volk_gnsssdr::vector<std::complex<float>> code_;
186  std::weak_ptr<ChannelFsm> channel_fsm_;
187 
188  Gnss_Synchro* gnss_synchro_;
189  Acq_Conf acq_parameters_;
190 
191  std::string item_type_;
192  std::string dump_filename_;
193  std::string role_;
194 
195  size_t item_size_;
196  int64_t fs_in_;
197 
198  float threshold_;
199  int doppler_center_;
200  unsigned int vector_length_;
201  unsigned int code_length_;
202  unsigned int channel_;
203  unsigned int doppler_max_;
204  unsigned int doppler_step_;
205  unsigned int sampled_ms_;
206  unsigned int in_streams_;
207  unsigned int out_streams_;
208 
209  bool acq_pilot_;
210  bool acq_iq_;
211 };
212 
213 
214 /** \} */
215 /** \} */
216 #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.