GNSS-SDR  0.0.21
An Open Source GNSS Software Defined Receiver
base_pcps_acquisition.h
1 /*!
2  * \file base_ca_pcps_acquisition.h
3  * \brief Adapts a PCPS acquisition block to an AcquisitionInterface
4  * \authors <ul>
5  * <li> Mathieu Favreau, 2025. favreau.mathieu(at)hotmail.com
6  * </ul>
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-2025 (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_BASE_PCPS_ACQUISITION_H
20 #define GNSS_SDR_BASE_PCPS_ACQUISITION_H
21 
22 #include "acq_conf.h"
23 #include "channel_fsm.h"
25 #include "gnss_synchro.h"
26 #include "pcps_acquisition.h"
27 #include <gnuradio/blocks/float_to_complex.h>
28 #include <volk_gnsssdr/volk_gnsssdr_alloc.h>
29 
30 /** \addtogroup Acquisition
31  * Classes for GNSS signal acquisition
32  * \{ */
33 /** \addtogroup Acq_adapters acquisition_adapters
34  * Wrap GNU Radio acquisition blocks with an AcquisitionInterface
35  * \{ */
36 
37 
39 
40 /*!
41  * \brief This class adapts a PCPS acquisition block to an AcquisitionInterface
42  */
44 {
45 public:
47  const ConfigurationInterface* configuration,
48  const std::string& role,
49  unsigned int in_streams,
50  unsigned int out_streams,
51  double chip_rate,
52  double opt_freq,
53  double code_length_chips,
54  uint32_t ms_per_code);
55 
56  ~BasePcpsAcquisition() = default;
57 
58  inline std::string role() override
59  {
60  return role_;
61  }
62 
63  inline size_t item_size() override
64  {
65  return acq_parameters_.it_size;
66  }
67 
68  void connect(gr::top_block_sptr top_block) override;
69  void disconnect(gr::top_block_sptr top_block) override;
70  gr::basic_block_sptr get_left_block() override;
71  gr::basic_block_sptr get_right_block() override;
72 
73  /*!
74  * \brief Set acquisition/tracking common Gnss_Synchro object pointer
75  * to efficiently exchange synchronization data between acquisition and
76  * tracking blocks
77  */
78  void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
79 
80  /*!
81  * \brief Set acquisition channel unique ID
82  */
83  inline void set_channel(unsigned int channel) override
84  {
85  acquisition_->set_channel(channel);
86  }
87 
88  /*!
89  * \brief Set channel fsm associated to this acquisition instance
90  */
91  inline void set_channel_fsm(std::weak_ptr<ChannelFsm> channel_fsm) override
92  {
93  acquisition_->set_channel_fsm(std::move(channel_fsm));
94  }
95 
96  /*!
97  * \brief Set Doppler center for the grid search
98  */
99  void set_doppler_center(int doppler_center) override;
100 
101  /*!
102  * \brief Returns the maximum peak of grid search
103  */
104  signed int mag() override;
105 
106  /*!
107  * \brief Restart acquisition algorithm
108  */
109  void reset() override;
110 
111  /*!
112  * \brief Stop running acquisition
113  */
114  void stop_acquisition() override;
115 
116  /*!
117  * \brief Sets the resampler latency to account it in the acquisition code delay estimation
118  */
119  void set_resampler_latency(uint32_t latency_samples) override;
120 
121  /*!
122  * \brief Sets local code
123  */
124  void set_local_code() override;
125 
126 private:
127  /*!
128  * \brief Generate code
129  */
130  virtual void code_gen_complex_sampled(own::span<std::complex<float>> dest, uint32_t prn, int32_t sampling_freq) = 0;
131 
132  const Acq_Conf acq_parameters_;
133  gr::blocks::float_to_complex::sptr float_to_complex_;
134  complex_byte_to_float_x2_sptr cbyte_to_float_x2_;
135  Gnss_Synchro* gnss_synchro_;
136  const std::string role_;
137  const unsigned int vector_length_;
138  const unsigned int code_length_;
139  volk_gnsssdr::vector<std::complex<float>> code_;
140  pcps_acquisition_sptr acquisition_;
141 };
142 
143 
144 /** \} */
145 /** \} */
146 #endif // GNSS_SDR_BASE_PCPS_ACQUISITION_H
This class adapts a PCPS acquisition block to an AcquisitionInterface.
void stop_acquisition() override
Stop running acquisition.
Class that contains all the configuration parameters for generic acquisition block based on the PCPS ...
void set_doppler_center(int doppler_center) override
Set Doppler center for the grid search.
Interface of the State Machine for channel.
void reset() override
Restart acquisition algorithm.
void set_channel(unsigned int channel) override
Set acquisition channel unique ID.
This class implements a Parallel Code Phase Search Acquisition.
void set_local_code() override
Sets local code.
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.
signed int mag() override
Returns the maximum peak of grid search.
void set_channel_fsm(std::weak_ptr< ChannelFsm > channel_fsm) override
Set channel fsm associated to this acquisition instance.
void set_resampler_latency(uint32_t latency_samples) override
Sets the resampler latency to account it in the acquisition code delay estimation.
void set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) override
Set acquisition/tracking common Gnss_Synchro object pointer to efficiently exchange synchronization d...
Adapts a std::complex<signed char> stream into two 16-bits (short) streams.
Interface of the Gnss_Synchro class.