40 #ifndef GNSS_SDR_PCPS_TONG_ACQUISITION_CC_H 41 #define GNSS_SDR_PCPS_TONG_ACQUISITION_CC_H 45 #include <gnuradio/block.h> 46 #include <gnuradio/fft/fft.h> 47 #include <gnuradio/gr_complex.h> 53 #if GNURADIO_USES_STD_POINTERS 55 #include <boost/shared_ptr.hpp> 60 #if GNURADIO_USES_STD_POINTERS 61 using pcps_tong_acquisition_cc_sptr = std::shared_ptr<pcps_tong_acquisition_cc>;
63 using pcps_tong_acquisition_cc_sptr = boost::shared_ptr<pcps_tong_acquisition_cc>;
66 pcps_tong_acquisition_cc_sptr pcps_tong_make_acquisition_cc(
70 int32_t samples_per_ms,
71 int32_t samples_per_code,
72 uint32_t tong_init_val,
73 uint32_t tong_max_val,
74 uint32_t tong_max_dwells,
76 const std::string& dump_filename);
97 d_gnss_synchro = p_gnss_synchro;
103 inline uint32_t
mag()
const 150 d_channel_fsm = std::move(channel_fsm);
160 d_threshold = threshold;
169 d_doppler_max = doppler_max;
178 d_doppler_step = doppler_step;
184 int general_work(
int noutput_items, gr_vector_int& ninput_items,
185 gr_vector_const_void_star& input_items,
186 gr_vector_void_star& output_items);
189 friend pcps_tong_acquisition_cc_sptr
190 pcps_tong_make_acquisition_cc(uint32_t sampled_ms, uint32_t doppler_max,
191 int64_t fs_in, int32_t samples_per_ms,
192 int32_t samples_per_code, uint32_t tong_init_val,
193 uint32_t tong_max_val, uint32_t tong_max_dwells,
194 bool dump,
const std::string& dump_filename);
197 int64_t fs_in, int32_t samples_per_ms,
198 int32_t samples_per_code, uint32_t tong_init_val,
199 uint32_t tong_max_val, uint32_t tong_max_dwells,
200 bool dump,
const std::string& dump_filename);
202 void calculate_magnitudes(gr_complex* fft_begin, int32_t doppler_shift,
203 int32_t doppler_offset);
205 std::weak_ptr<ChannelFsm> d_channel_fsm;
207 std::unique_ptr<gr::fft::fft_complex> d_fft_if;
208 std::unique_ptr<gr::fft::fft_complex> d_ifft;
210 std::vector<std::vector<gr_complex>> d_grid_doppler_wipeoffs;
211 std::vector<std::vector<float>> d_grid_data;
212 std::vector<gr_complex> d_fft_codes;
213 std::vector<float> d_magnitude;
215 std::string d_satellite_str;
216 std::string d_dump_filename;
218 std::ofstream d_dump_file;
223 uint64_t d_sample_counter;
226 float d_doppler_freq;
229 float d_test_statistics;
231 int32_t d_samples_per_ms;
232 int32_t d_samples_per_code;
234 uint32_t d_doppler_resolution;
235 uint32_t d_doppler_max;
236 uint32_t d_doppler_step;
237 uint32_t d_sampled_ms;
238 uint32_t d_dwell_count;
239 uint32_t d_tong_count;
240 uint32_t d_tong_init_val;
241 uint32_t d_tong_max_val;
242 uint32_t d_tong_max_dwells;
244 uint32_t d_num_doppler_bins;
245 uint32_t d_code_phase;
251 #endif // GNSS_SDR_PCPS_TONG_ACQUISITION_CC_H void set_gnss_synchro(Gnss_Synchro *p_gnss_synchro)
Set acquisition/tracking common Gnss_Synchro object pointer to exchange synchronization data between ...
~pcps_tong_acquisition_cc()
Default destructor.
void set_channel(uint32_t channel)
Set acquisition channel unique ID.
void init()
Initializes acquisition algorithm.
void set_doppler_step(uint32_t doppler_step)
Set Doppler steps for the grid search.
Interface of the State Machine for channel.
void set_channel_fsm(std::weak_ptr< ChannelFsm > channel_fsm)
Set channel fsm associated to this acquisition instance.
This is the class that contains the information that is shared by the processing blocks.
This class implements a Parallel Code Phase Search Acquisition with Tong algorithm.
void set_active(bool active)
Starts acquisition algorithm, turning from standby mode to active mode.
void set_local_code(std::complex< float > *code)
Sets local code for TONG acquisition algorithm.
void set_state(int32_t state)
If set to 1, ensures that acquisition starts at the first available sample.
void set_doppler_max(uint32_t doppler_max)
Set maximum Doppler grid search.
uint32_t mag() const
Returns the maximum peak of grid search.
void set_threshold(float threshold)
Set statistics threshold of TONG 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)
Parallel Code Phase Search Acquisition signal processing.
Interface of the Gnss_Synchro class.