mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-31 15:23:04 +00:00 
			
		
		
		
	Merge remote-tracking branch 'cf/tong' into next
This commit is contained in:
		| @@ -70,6 +70,7 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition( | |||||||
|  |  | ||||||
|     tong_init_val_ = configuration->property(role + ".tong_init_val", 1); |     tong_init_val_ = configuration->property(role + ".tong_init_val", 1); | ||||||
|     tong_max_val_ = configuration->property(role + ".tong_max_val", 2); |     tong_max_val_ = configuration->property(role + ".tong_max_val", 2); | ||||||
|  |     tong_max_dwells_ = configuration->property(role + ".tong_max_dwells", tong_max_val_ + 1); | ||||||
|  |  | ||||||
|     dump_filename_ = configuration_->property(role + ".dump_filename", |     dump_filename_ = configuration_->property(role + ".dump_filename", | ||||||
|             default_dump_filename); |             default_dump_filename); | ||||||
| @@ -92,7 +93,7 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition( | |||||||
|             item_size_ = sizeof(gr_complex); |             item_size_ = sizeof(gr_complex); | ||||||
|             acquisition_cc_ = pcps_tong_make_acquisition_cc(sampled_ms_, doppler_max_, |             acquisition_cc_ = pcps_tong_make_acquisition_cc(sampled_ms_, doppler_max_, | ||||||
|                     if_, fs_in_, samples_per_ms, code_length_, tong_init_val_, |                     if_, fs_in_, samples_per_ms, code_length_, tong_init_val_, | ||||||
|                     tong_max_val_, dump_, dump_filename_); |                     tong_max_val_, tong_max_dwells_, dump_, dump_filename_); | ||||||
|  |  | ||||||
|             stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_); |             stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_); | ||||||
|             DLOG(INFO) << "stream_to_vector(" |             DLOG(INFO) << "stream_to_vector(" | ||||||
|   | |||||||
| @@ -143,6 +143,7 @@ private: | |||||||
|     unsigned int sampled_ms_; |     unsigned int sampled_ms_; | ||||||
|     unsigned int tong_init_val_; |     unsigned int tong_init_val_; | ||||||
|     unsigned int tong_max_val_; |     unsigned int tong_max_val_; | ||||||
|  |     unsigned int tong_max_dwells_; | ||||||
|     long fs_in_; |     long fs_in_; | ||||||
|     long if_; |     long if_; | ||||||
|     bool dump_; |     bool dump_; | ||||||
|   | |||||||
| @@ -60,6 +60,7 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition( | |||||||
|  |  | ||||||
|     tong_init_val_ = configuration->property(role + ".tong_init_val", 1); |     tong_init_val_ = configuration->property(role + ".tong_init_val", 1); | ||||||
|     tong_max_val_ = configuration->property(role + ".tong_max_val", 2); |     tong_max_val_ = configuration->property(role + ".tong_max_val", 2); | ||||||
|  |     tong_max_dwells_ = configuration->property(role + ".tong_max_dwells", tong_max_val_ + 1); | ||||||
|  |  | ||||||
|     dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); |     dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); | ||||||
|  |  | ||||||
| @@ -75,7 +76,7 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition( | |||||||
|         { |         { | ||||||
|             item_size_ = sizeof(gr_complex); |             item_size_ = sizeof(gr_complex); | ||||||
|             acquisition_cc_ = pcps_tong_make_acquisition_cc(sampled_ms_, doppler_max_, if_, fs_in_, |             acquisition_cc_ = pcps_tong_make_acquisition_cc(sampled_ms_, doppler_max_, if_, fs_in_, | ||||||
|                                     code_length_, code_length_, tong_init_val_, tong_max_val_, |                                     code_length_, code_length_, tong_init_val_, tong_max_val_, tong_max_dwells_, | ||||||
|                                     dump_, dump_filename_); |                                     dump_, dump_filename_); | ||||||
|  |  | ||||||
|             stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_); |             stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_); | ||||||
|   | |||||||
| @@ -143,6 +143,7 @@ private: | |||||||
|     unsigned int sampled_ms_; |     unsigned int sampled_ms_; | ||||||
|     unsigned int tong_init_val_; |     unsigned int tong_init_val_; | ||||||
|     unsigned int tong_max_val_; |     unsigned int tong_max_val_; | ||||||
|  |     unsigned int tong_max_dwells_; | ||||||
|     long fs_in_; |     long fs_in_; | ||||||
|     long if_; |     long if_; | ||||||
|     bool dump_; |     bool dump_; | ||||||
|   | |||||||
| @@ -63,19 +63,19 @@ pcps_tong_acquisition_cc_sptr pcps_tong_make_acquisition_cc( | |||||||
|                               unsigned int sampled_ms, unsigned int doppler_max, |                               unsigned int sampled_ms, unsigned int doppler_max, | ||||||
|                               long freq, long fs_in, int samples_per_ms, |                               long freq, long fs_in, int samples_per_ms, | ||||||
|                               int samples_per_code, unsigned int tong_init_val, |                               int samples_per_code, unsigned int tong_init_val, | ||||||
|                               unsigned int tong_max_val, |                               unsigned int tong_max_val,  unsigned int tong_max_dwells, | ||||||
|                               bool dump, std::string dump_filename) |                               bool dump, std::string dump_filename) | ||||||
| { | { | ||||||
|     return pcps_tong_acquisition_cc_sptr( |     return pcps_tong_acquisition_cc_sptr( | ||||||
|             new pcps_tong_acquisition_cc(sampled_ms, doppler_max, freq, fs_in, samples_per_ms, samples_per_code, |             new pcps_tong_acquisition_cc(sampled_ms, doppler_max, freq, fs_in, samples_per_ms, samples_per_code, | ||||||
|                                     tong_init_val, tong_max_val, dump, dump_filename)); |                                     tong_init_val, tong_max_val, tong_max_dwells, dump, dump_filename)); | ||||||
| } | } | ||||||
|  |  | ||||||
| pcps_tong_acquisition_cc::pcps_tong_acquisition_cc( | pcps_tong_acquisition_cc::pcps_tong_acquisition_cc( | ||||||
|                          unsigned int sampled_ms, unsigned int doppler_max, |                          unsigned int sampled_ms, unsigned int doppler_max, | ||||||
|                          long freq, long fs_in, int samples_per_ms, |                          long freq, long fs_in, int samples_per_ms, | ||||||
|                          int samples_per_code, unsigned int tong_init_val, |                          int samples_per_code, unsigned int tong_init_val, | ||||||
|                          unsigned int tong_max_val, |                          unsigned int tong_max_val, unsigned int tong_max_dwells, | ||||||
|                          bool dump, std::string dump_filename) : |                          bool dump, std::string dump_filename) : | ||||||
|     gr::block("pcps_tong_acquisition_cc", |     gr::block("pcps_tong_acquisition_cc", | ||||||
|     gr::io_signature::make(1, 1, sizeof(gr_complex) * sampled_ms * samples_per_ms), |     gr::io_signature::make(1, 1, sizeof(gr_complex) * sampled_ms * samples_per_ms), | ||||||
| @@ -90,8 +90,9 @@ pcps_tong_acquisition_cc::pcps_tong_acquisition_cc( | |||||||
|     d_samples_per_ms = samples_per_ms; |     d_samples_per_ms = samples_per_ms; | ||||||
|     d_samples_per_code = samples_per_code; |     d_samples_per_code = samples_per_code; | ||||||
|     d_sampled_ms = sampled_ms; |     d_sampled_ms = sampled_ms; | ||||||
|     d_well_count = 0; |     d_dwell_count = 0; | ||||||
|     d_tong_max_val = tong_max_val; |     d_tong_max_val = tong_max_val; | ||||||
|  |     d_tong_max_dwells = tong_max_dwells; | ||||||
|     d_tong_init_val = tong_init_val; |     d_tong_init_val = tong_init_val; | ||||||
|     d_tong_count = d_tong_init_val; |     d_tong_count = d_tong_init_val; | ||||||
|     d_doppler_max = doppler_max; |     d_doppler_max = doppler_max; | ||||||
| @@ -213,8 +214,7 @@ void pcps_tong_acquisition_cc::set_state(int state) | |||||||
|             d_gnss_synchro->Acq_delay_samples = 0.0; |             d_gnss_synchro->Acq_delay_samples = 0.0; | ||||||
|             d_gnss_synchro->Acq_doppler_hz = 0.0; |             d_gnss_synchro->Acq_doppler_hz = 0.0; | ||||||
|             d_gnss_synchro->Acq_samplestamp_samples = 0; |             d_gnss_synchro->Acq_samplestamp_samples = 0; | ||||||
|             d_well_count = 0; |             d_dwell_count = 0; | ||||||
|             d_well_count = 0; |  | ||||||
|             d_tong_count = d_tong_init_val; |             d_tong_count = d_tong_init_val; | ||||||
|             d_mag = 0.0; |             d_mag = 0.0; | ||||||
|             d_input_power = 0.0; |             d_input_power = 0.0; | ||||||
| @@ -252,7 +252,7 @@ int pcps_tong_acquisition_cc::general_work(int noutput_items, | |||||||
|                     d_gnss_synchro->Acq_delay_samples = 0.0; |                     d_gnss_synchro->Acq_delay_samples = 0.0; | ||||||
|                     d_gnss_synchro->Acq_doppler_hz = 0.0; |                     d_gnss_synchro->Acq_doppler_hz = 0.0; | ||||||
|                     d_gnss_synchro->Acq_samplestamp_samples = 0; |                     d_gnss_synchro->Acq_samplestamp_samples = 0; | ||||||
|                     d_well_count = 0; |                     d_dwell_count = 0; | ||||||
|                     d_tong_count = d_tong_init_val; |                     d_tong_count = d_tong_init_val; | ||||||
|                     d_mag = 0.0; |                     d_mag = 0.0; | ||||||
|                     d_input_power = 0.0; |                     d_input_power = 0.0; | ||||||
| @@ -292,7 +292,7 @@ int pcps_tong_acquisition_cc::general_work(int noutput_items, | |||||||
|  |  | ||||||
|             d_sample_counter += d_fft_size; // sample counter |             d_sample_counter += d_fft_size; // sample counter | ||||||
|  |  | ||||||
|             d_well_count++; |             d_dwell_count++; | ||||||
|  |  | ||||||
|             DLOG(INFO) << "Channel: " << d_channel |             DLOG(INFO) << "Channel: " << d_channel | ||||||
|                     << " , doing acquisition of satellite: " << d_gnss_synchro->System << " "<< d_gnss_synchro->PRN |                     << " , doing acquisition of satellite: " << d_gnss_synchro->System << " "<< d_gnss_synchro->PRN | ||||||
| @@ -370,7 +370,7 @@ int pcps_tong_acquisition_cc::general_work(int noutput_items, | |||||||
|             // 5- Compute the test statistics and compare to the threshold |             // 5- Compute the test statistics and compare to the threshold | ||||||
|             d_test_statistics = d_mag; |             d_test_statistics = d_mag; | ||||||
|  |  | ||||||
|             if (d_test_statistics > d_threshold*d_well_count) |             if (d_test_statistics > d_threshold * d_dwell_count) | ||||||
|                 { |                 { | ||||||
|                     d_tong_count++; |                     d_tong_count++; | ||||||
|                     if (d_tong_count == d_tong_max_val) |                     if (d_tong_count == d_tong_max_val) | ||||||
| @@ -387,6 +387,10 @@ int pcps_tong_acquisition_cc::general_work(int noutput_items, | |||||||
|                         } |                         } | ||||||
|                 } |                 } | ||||||
|  |  | ||||||
|  |             if(d_dwell_count >= d_tong_max_dwells) | ||||||
|  |                 { | ||||||
|  |                     d_state = 3; // Negative acquisition | ||||||
|  |                 } | ||||||
|             consume_each(1); |             consume_each(1); | ||||||
|  |  | ||||||
|             break; |             break; | ||||||
|   | |||||||
| @@ -66,7 +66,7 @@ pcps_tong_acquisition_cc_sptr | |||||||
| pcps_tong_make_acquisition_cc(unsigned int sampled_ms, unsigned int doppler_max, | pcps_tong_make_acquisition_cc(unsigned int sampled_ms, unsigned int doppler_max, | ||||||
|                               long freq, long fs_in, int samples_per_ms, |                               long freq, long fs_in, int samples_per_ms, | ||||||
|                               int samples_per_code, unsigned int tong_init_val, |                               int samples_per_code, unsigned int tong_init_val, | ||||||
|                               unsigned int tong_max_val, |                               unsigned int tong_max_val, unsigned int tong_max_dwells, | ||||||
|                               bool dump, std::string dump_filename); |                               bool dump, std::string dump_filename); | ||||||
|  |  | ||||||
| /*! | /*! | ||||||
| @@ -80,13 +80,13 @@ private: | |||||||
|     pcps_tong_make_acquisition_cc(unsigned int sampled_ms, unsigned int doppler_max, |     pcps_tong_make_acquisition_cc(unsigned int sampled_ms, unsigned int doppler_max, | ||||||
|             long freq, long fs_in, int samples_per_ms, |             long freq, long fs_in, int samples_per_ms, | ||||||
|             int samples_per_code, unsigned int tong_init_val, |             int samples_per_code, unsigned int tong_init_val, | ||||||
|             unsigned int tong_max_val, |             unsigned int tong_max_val, unsigned int tong_max_dwells, | ||||||
|             bool dump, std::string dump_filename); |             bool dump, std::string dump_filename); | ||||||
|  |  | ||||||
|     pcps_tong_acquisition_cc(unsigned int sampled_ms, unsigned int doppler_max, |     pcps_tong_acquisition_cc(unsigned int sampled_ms, unsigned int doppler_max, | ||||||
|             long freq, long fs_in, int samples_per_ms, |             long freq, long fs_in, int samples_per_ms, | ||||||
|             int samples_per_code, unsigned int tong_init_val, |             int samples_per_code, unsigned int tong_init_val, | ||||||
|             unsigned int tong_max_val, |             unsigned int tong_max_val, unsigned int tong_max_dwells, | ||||||
|             bool dump, std::string dump_filename); |             bool dump, std::string dump_filename); | ||||||
|  |  | ||||||
|     void calculate_magnitudes(gr_complex* fft_begin, int doppler_shift, |     void calculate_magnitudes(gr_complex* fft_begin, int doppler_shift, | ||||||
| @@ -102,10 +102,11 @@ private: | |||||||
|     unsigned int d_doppler_max; |     unsigned int d_doppler_max; | ||||||
|     unsigned int d_doppler_step; |     unsigned int d_doppler_step; | ||||||
|     unsigned int d_sampled_ms; |     unsigned int d_sampled_ms; | ||||||
|     unsigned int d_well_count; |     unsigned int d_dwell_count; | ||||||
|     unsigned int d_tong_count; |     unsigned int d_tong_count; | ||||||
|     unsigned int d_tong_init_val; |     unsigned int d_tong_init_val; | ||||||
|     unsigned int d_tong_max_val; |     unsigned int d_tong_max_val; | ||||||
|  |     unsigned int d_tong_max_dwells; | ||||||
|     unsigned int d_fft_size; |     unsigned int d_fft_size; | ||||||
|     unsigned long int d_sample_counter; |     unsigned long int d_sample_counter; | ||||||
|     gr_complex** d_grid_doppler_wipeoffs; |     gr_complex** d_grid_doppler_wipeoffs; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Carles Fernandez
					Carles Fernandez