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