GNSS-SDR 0.0.21
An Open Source GNSS Software Defined Receiver
Loading...
Searching...
No Matches
pcps_assisted_acquisition_cc.h
Go to the documentation of this file.
1/*!
2 * \file pcps_assisted_acquisition_cc.h
3 * \brief This class implements a Parallel Code Phase Search Acquisition with assistance and multi-dwells
4 *
5 * Acquisition strategy (Kay Borre book + CFAR threshold).
6 * <ol>
7 * <li> Compute the input signal power estimation
8 * <li> Doppler serial search loop
9 * <li> Perform the FFT-based circular convolution (parallel time search)
10 * <li> Record the maximum peak and the associated synchronization parameters
11 * <li> Compute the test statistics and compare to the threshold
12 * <li> Declare positive or negative acquisition using a message queue
13 * </ol>
14 *
15 * Kay Borre book: K.Borre, D.M.Akos, N.Bertelsen, P.Rinder, and S.H.Jensen,
16 * "A Software-Defined GPS and Galileo Receiver. A Single-Frequency
17 * Approach", Birkhauser, 2007. pp 81-84
18 *
19 * \authors <ul>
20 * <li> Javier Arribas, 2013. jarribas(at)cttc.es
21 * </ul>
22 *
23 * -----------------------------------------------------------------------------
24 *
25 * GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
26 * This file is part of GNSS-SDR.
27 *
28 * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
29 * SPDX-License-Identifier: GPL-3.0-or-later
30 *
31 * -----------------------------------------------------------------------------
32 */
33
34#ifndef GNSS_SDR_PCPS_ASSISTED_ACQUISITION_CC_H
35#define GNSS_SDR_PCPS_ASSISTED_ACQUISITION_CC_H
36
37#include "acq_conf.h"
39#include "channel_fsm.h"
40#include "gnss_sdr_fft.h"
41#include "gnss_synchro.h"
42#include <gnuradio/block.h>
43#include <gnuradio/gr_complex.h>
44#include <fstream>
45#include <memory>
46#include <string>
47#include <utility>
48#include <vector>
49
50/** \addtogroup Acquisition
51 * \{ */
52/** \addtogroup Acq_gnuradio_blocks
53 * \{ */
54
55
57
58using pcps_assisted_acquisition_cc_sptr = gnss_shared_ptr<pcps_assisted_acquisition_cc>;
59
60pcps_assisted_acquisition_cc_sptr pcps_make_assisted_acquisition_cc(const Acq_Conf& conf);
61
62/*!
63 * \brief This class implements a Parallel Code Phase Search Acquisition.
64 *
65 * Check \ref Navitec2012 "An Open Source Galileo E1 Software Receiver",
66 * Algorithm 1, for a pseudocode description of this implementation.
67 */
68class pcps_assisted_acquisition_cc : public acquisition_impl_interface
69{
70public:
71 /*!
72 * \brief Default destructor.
73 */
75
76 /*!
77 * \brief Set acquisition/tracking common Gnss_Synchro object pointer
78 * to exchange synchronization data between acquisition and tracking blocks.
79 * \param p_gnss_synchro Satellite information shared by the processing blocks.
80 */
81 inline void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override
82 {
83 d_gnss_synchro = p_gnss_synchro;
84 }
85
86 /*!
87 * \brief Returns the maximum peak of grid search.
88 */
89 inline uint32_t mag() const override
90 {
91 return d_test_statistics;
92 }
93
94 /*!
95 * \brief Sets local code for PCPS acquisition algorithm.
96 * \param code - Pointer to the PRN code.
97 */
98 void set_local_code(std::complex<float>* code) override;
99
100 /*!
101 * \brief Starts acquisition algorithm, turning from standby mode to
102 * active mode
103 * \param active - bool that activates/deactivates the block.
104 */
105 inline void set_active(bool active) override
106 {
107 if (!active)
108 {
109 d_state = 0;
110 }
111
112 d_active = active;
113 }
114
115 /*!
116 * \brief Set acquisition channel unique ID
117 * \param channel - receiver channel.
118 */
119 inline void set_channel(uint32_t channel) override
120 {
121 d_channel = channel;
122 }
123
124 /*!
125 * \brief Set channel fsm associated to this acquisition instance
126 */
127 inline void set_channel_fsm(std::weak_ptr<ChannelFsm> channel_fsm) override
128 {
129 d_channel_fsm = std::move(channel_fsm);
130 }
131
132 /*!
133 * \brief Parallel Code Phase Search Acquisition signal processing.
134 */
135 int general_work(int noutput_items, gr_vector_int& ninput_items,
136 gr_vector_const_void_star& input_items,
137 gr_vector_void_star& output_items) override;
138
139
140private:
141 void forecast(int noutput_items, gr_vector_int& ninput_items_required) override;
142
143 friend pcps_assisted_acquisition_cc_sptr
144 pcps_make_assisted_acquisition_cc(const Acq_Conf& conf);
145
146 explicit pcps_assisted_acquisition_cc(const Acq_Conf& conf);
147
148 void calculate_magnitudes(gr_complex* fft_begin, int32_t doppler_shift, int32_t doppler_offset);
149
150 int32_t compute_and_accumulate_grid(gr_vector_const_void_star& input_items);
151 float estimate_input_power(gr_vector_const_void_star& input_items) const;
152 float search_maximum();
153 void get_assistance();
154 void reset_grid();
155 void redefine_grid();
156
157 std::string d_satellite_str;
158 const Acq_Conf d_acq_params;
159
160 std::ofstream d_dump_file;
161
162 Gnss_Synchro* d_gnss_synchro;
163
164 uint64_t d_sample_counter;
165
166 float d_input_power;
167 float d_test_statistics;
168
169 uint32_t d_channel;
170 uint32_t d_code_phase;
171 const uint32_t d_fft_size;
172
173 const int32_t d_gnuradio_forecast_samples;
174 int32_t d_doppler_max;
175 int32_t d_doppler_min;
176 int32_t d_num_doppler_points;
177 int32_t d_state;
178 int32_t d_well_count;
179
180 bool d_active;
181 bool d_disable_assist;
182
183 std::weak_ptr<ChannelFsm> d_channel_fsm;
184 std::unique_ptr<gnss_fft_complex_fwd> d_fft_if;
185 std::unique_ptr<gnss_fft_complex_rev> d_ifft;
186
187 std::vector<std::vector<std::complex<float>>> d_grid_doppler_wipeoffs;
188 std::vector<std::vector<float>> d_grid_data;
189 std::vector<gr_complex> d_fft_codes;
190};
191
192
193/** \} */
194/** \} */
195#endif // GNSS_SDR_PCPS_ASSISTED_ACQUISITION_CC_H
Class that contains all the configuration parameters for generic acquisition block based on the PCPS ...
Header file of the interface to an acquisition implementation GNSS block.
Interface of the State Machine for channel.
This is the class that contains the information that is shared by the processing blocks.
This class implements a Parallel Code Phase Search Acquisition.
void set_active(bool active) override
Starts acquisition algorithm, turning from standby mode to active mode.
~pcps_assisted_acquisition_cc()
Default destructor.
void set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) override
Set acquisition/tracking common Gnss_Synchro object pointer to exchange synchronization data between ...
uint32_t mag() const override
Returns the maximum peak of grid search.
void set_channel(uint32_t channel) override
Set acquisition channel unique ID.
void set_channel_fsm(std::weak_ptr< ChannelFsm > channel_fsm) override
Set channel fsm associated to this acquisition instance.
void set_local_code(std::complex< float > *code) override
Sets local code for PCPS acquisition algorithm.
int general_work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) override
Parallel Code Phase Search Acquisition signal processing.
Helper file for FFT interface.
Interface of the Gnss_Synchro class.