37 #ifndef GNSS_SDR_PCPS_TONG_ACQUISITION_CC_H 38 #define GNSS_SDR_PCPS_TONG_ACQUISITION_CC_H 43 #include <gnuradio/block.h> 44 #include <gnuradio/gr_complex.h> 59 using pcps_tong_acquisition_cc_sptr = gnss_shared_ptr<pcps_tong_acquisition_cc>;
61 pcps_tong_acquisition_cc_sptr pcps_tong_make_acquisition_cc(
65 int32_t samples_per_ms,
66 int32_t samples_per_code,
67 uint32_t tong_init_val,
68 uint32_t tong_max_val,
69 uint32_t tong_max_dwells,
71 const std::string& dump_filename,
72 bool enable_monitor_output);
93 d_gnss_synchro = p_gnss_synchro;
99 inline uint32_t
mag()
const 146 d_channel_fsm = std::move(channel_fsm);
156 d_threshold = threshold;
165 d_doppler_max = doppler_max;
174 d_doppler_step = doppler_step;
180 int general_work(
int noutput_items, gr_vector_int& ninput_items,
181 gr_vector_const_void_star& input_items,
182 gr_vector_void_star& output_items);
185 friend pcps_tong_acquisition_cc_sptr
186 pcps_tong_make_acquisition_cc(uint32_t sampled_ms, uint32_t doppler_max,
187 int64_t fs_in, int32_t samples_per_ms,
188 int32_t samples_per_code, uint32_t tong_init_val,
189 uint32_t tong_max_val, uint32_t tong_max_dwells,
190 bool dump,
const std::string& dump_filename,
bool enable_monitor_output);
193 int64_t fs_in, int32_t samples_per_ms,
194 int32_t samples_per_code, uint32_t tong_init_val,
195 uint32_t tong_max_val, uint32_t tong_max_dwells,
196 bool dump,
const std::string& dump_filename,
bool enable_monitor_output);
198 void calculate_magnitudes(gr_complex* fft_begin, int32_t doppler_shift,
199 int32_t doppler_offset);
201 std::weak_ptr<ChannelFsm> d_channel_fsm;
202 std::unique_ptr<gnss_fft_complex_fwd> d_fft_if;
203 std::unique_ptr<gnss_fft_complex_rev> d_ifft;
205 std::vector<std::vector<gr_complex>> d_grid_doppler_wipeoffs;
206 std::vector<std::vector<float>> d_grid_data;
207 std::vector<gr_complex> d_fft_codes;
208 std::vector<float> d_magnitude;
210 std::string d_satellite_str;
211 std::string d_dump_filename;
213 std::ofstream d_dump_file;
218 uint64_t d_sample_counter;
221 float d_doppler_freq;
224 float d_test_statistics;
226 int32_t d_samples_per_ms;
227 int32_t d_samples_per_code;
229 uint32_t d_doppler_resolution;
230 uint32_t d_doppler_max;
231 uint32_t d_doppler_step;
232 uint32_t d_sampled_ms;
233 uint32_t d_dwell_count;
234 uint32_t d_tong_init_val;
235 uint32_t d_tong_max_val;
236 uint32_t d_tong_max_dwells;
237 uint32_t d_tong_count;
239 uint32_t d_num_doppler_bins;
240 uint32_t d_code_phase;
244 bool d_enable_monitor_output;
250 #endif // GNSS_SDR_PCPS_TONG_ACQUISITION_CC_H Helper file for FFT interface.
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.