mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-31 07:13:03 +00:00 
			
		
		
		
	completing the acquisition assistance option from primary frequencies (e.g. L1, E1) to secondary frequencies (e.g. L5, E5)
This commit is contained in:
		| @@ -154,6 +154,7 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition( | ||||
|     channel_ = 0; | ||||
|     threshold_ = 0.0; | ||||
|     doppler_step_ = 0; | ||||
|     doppler_center_ = 0; | ||||
|     gnss_synchro_ = nullptr; | ||||
|  | ||||
|     if (in_streams_ > 1) | ||||
| @@ -211,6 +212,13 @@ void GalileoE1PcpsAmbiguousAcquisition::set_doppler_step(unsigned int doppler_st | ||||
|     acquisition_->set_doppler_step(doppler_step_); | ||||
| } | ||||
|  | ||||
| void GalileoE1PcpsAmbiguousAcquisition::set_doppler_center(int doppler_center) | ||||
| { | ||||
|     doppler_center_ = doppler_center; | ||||
|  | ||||
|     acquisition_->set_doppler_center(doppler_center_); | ||||
| } | ||||
|  | ||||
|  | ||||
| void GalileoE1PcpsAmbiguousAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro) | ||||
| { | ||||
|   | ||||
| @@ -123,6 +123,11 @@ public: | ||||
|      */ | ||||
|     void set_doppler_step(unsigned int doppler_step) override; | ||||
|  | ||||
|     /*! | ||||
|      * \brief Set Doppler center for the grid search | ||||
|      */ | ||||
|     void set_doppler_center(int doppler_center) override; | ||||
|  | ||||
|     /*! | ||||
|      * \brief Initializes acquisition algorithm. | ||||
|      */ | ||||
| @@ -176,6 +181,7 @@ private: | ||||
|     float threshold_; | ||||
|     unsigned int doppler_max_; | ||||
|     unsigned int doppler_step_; | ||||
|     int doppler_center_; | ||||
|     unsigned int sampled_ms_; | ||||
|     unsigned int max_dwells_; | ||||
|     int64_t fs_in_; | ||||
|   | ||||
| @@ -152,6 +152,7 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con | ||||
|     channel_ = 0; | ||||
|     threshold_ = 0.0; | ||||
|     doppler_step_ = 0; | ||||
|     doppler_center_ = 0; | ||||
|     gnss_synchro_ = nullptr; | ||||
|  | ||||
|     if (in_streams_ > 1) | ||||
| @@ -208,6 +209,12 @@ void GalileoE5aPcpsAcquisition::set_doppler_step(unsigned int doppler_step) | ||||
|     acquisition_->set_doppler_step(doppler_step_); | ||||
| } | ||||
|  | ||||
| void GalileoE5aPcpsAcquisition::set_doppler_center(int doppler_center) | ||||
| { | ||||
|     doppler_center_ = doppler_center; | ||||
|  | ||||
|     acquisition_->set_doppler_center(doppler_center_); | ||||
| } | ||||
|  | ||||
| void GalileoE5aPcpsAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro) | ||||
| { | ||||
|   | ||||
| @@ -111,6 +111,11 @@ public: | ||||
|      */ | ||||
|     void set_doppler_step(unsigned int doppler_step) override; | ||||
|  | ||||
|     /*! | ||||
|      * \brief Set Doppler center for the grid search | ||||
|      */ | ||||
|     void set_doppler_center(int doppler_center) override; | ||||
|  | ||||
|     /*! | ||||
|      * \brief Initializes acquisition algorithm. | ||||
|      */ | ||||
| @@ -169,6 +174,7 @@ private: | ||||
|     std::weak_ptr<ChannelFsm> channel_fsm_; | ||||
|     unsigned int doppler_max_; | ||||
|     unsigned int doppler_step_; | ||||
|     unsigned int doppler_center_; | ||||
|     unsigned int sampled_ms_; | ||||
|     unsigned int max_dwells_; | ||||
|     unsigned int in_streams_; | ||||
|   | ||||
| @@ -148,6 +148,7 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( | ||||
|     channel_ = 0; | ||||
|     threshold_ = 0.0; | ||||
|     doppler_step_ = 0; | ||||
|     doppler_center_ = 0; | ||||
|     gnss_synchro_ = nullptr; | ||||
|  | ||||
|     if (in_streams_ > 1) | ||||
| @@ -200,6 +201,12 @@ void GpsL1CaPcpsAcquisition::set_doppler_step(unsigned int doppler_step) | ||||
|     acquisition_->set_doppler_step(doppler_step_); | ||||
| } | ||||
|  | ||||
| void GpsL1CaPcpsAcquisition::set_doppler_center(int doppler_center) | ||||
| { | ||||
|     doppler_center_ = doppler_center; | ||||
|  | ||||
|     acquisition_->set_doppler_center(doppler_center_); | ||||
| } | ||||
|  | ||||
| void GpsL1CaPcpsAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro) | ||||
| { | ||||
|   | ||||
| @@ -127,6 +127,11 @@ public: | ||||
|      */ | ||||
|     void set_doppler_step(unsigned int doppler_step) override; | ||||
|  | ||||
|     /*! | ||||
|      * \brief Set Doppler center for the grid search | ||||
|      */ | ||||
|     void set_doppler_center(int doppler_center) override; | ||||
|  | ||||
|     /*! | ||||
|      * \brief Initializes acquisition algorithm. | ||||
|      */ | ||||
| @@ -179,6 +184,7 @@ private: | ||||
|     float threshold_; | ||||
|     unsigned int doppler_max_; | ||||
|     unsigned int doppler_step_; | ||||
|     unsigned int doppler_center_; | ||||
|     unsigned int sampled_ms_; | ||||
|     unsigned int max_dwells_; | ||||
|     int64_t fs_in_; | ||||
|   | ||||
| @@ -151,6 +151,7 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition( | ||||
|     channel_ = 0; | ||||
|     threshold_ = 0.0; | ||||
|     doppler_step_ = 0; | ||||
|     doppler_center_ = 0; | ||||
|     gnss_synchro_ = nullptr; | ||||
|  | ||||
|     num_codes_ = acq_parameters_.sampled_ms / acq_parameters_.ms_per_code; | ||||
| @@ -210,6 +211,12 @@ void GpsL2MPcpsAcquisition::set_doppler_step(unsigned int doppler_step) | ||||
|     acquisition_->set_doppler_step(doppler_step_); | ||||
| } | ||||
|  | ||||
| void GpsL2MPcpsAcquisition::set_doppler_center(int doppler_center) | ||||
| { | ||||
|     doppler_center_ = doppler_center; | ||||
|  | ||||
|     acquisition_->set_doppler_center(doppler_center_); | ||||
| } | ||||
|  | ||||
| void GpsL2MPcpsAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro) | ||||
| { | ||||
|   | ||||
| @@ -124,6 +124,11 @@ public: | ||||
|      */ | ||||
|     void set_doppler_step(unsigned int doppler_step) override; | ||||
|  | ||||
|     /*! | ||||
|      * \brief Set Doppler center for the grid search | ||||
|      */ | ||||
|     void set_doppler_center(int doppler_center) override; | ||||
|  | ||||
|     /*! | ||||
|      * \brief Initializes acquisition algorithm. | ||||
|      */ | ||||
| @@ -176,6 +181,7 @@ private: | ||||
|     float threshold_; | ||||
|     unsigned int doppler_max_; | ||||
|     unsigned int doppler_step_; | ||||
|     unsigned int doppler_center_; | ||||
|     unsigned int max_dwells_; | ||||
|     int64_t fs_in_; | ||||
|     bool dump_; | ||||
|   | ||||
| @@ -147,6 +147,7 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition( | ||||
|     channel_ = 0; | ||||
|     threshold_ = 0.0; | ||||
|     doppler_step_ = 0; | ||||
|     doppler_center_ = 0; | ||||
|     gnss_synchro_ = nullptr; | ||||
|  | ||||
|     if (in_streams_ > 1) | ||||
| @@ -205,6 +206,12 @@ void GpsL5iPcpsAcquisition::set_doppler_step(unsigned int doppler_step) | ||||
|     acquisition_->set_doppler_step(doppler_step_); | ||||
| } | ||||
|  | ||||
| void GpsL5iPcpsAcquisition::set_doppler_center(int doppler_center) | ||||
| { | ||||
|     doppler_center_ = doppler_center; | ||||
|  | ||||
|     acquisition_->set_doppler_center(doppler_center_); | ||||
| } | ||||
|  | ||||
| void GpsL5iPcpsAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro) | ||||
| { | ||||
|   | ||||
| @@ -124,6 +124,11 @@ public: | ||||
|      */ | ||||
|     void set_doppler_step(unsigned int doppler_step) override; | ||||
|  | ||||
|     /*! | ||||
|      * \brief Set Doppler center for the grid search | ||||
|      */ | ||||
|     void set_doppler_center(int doppler_center) override; | ||||
|  | ||||
|     /*! | ||||
|      * \brief Initializes acquisition algorithm. | ||||
|      */ | ||||
| @@ -176,6 +181,7 @@ private: | ||||
|     float threshold_; | ||||
|     unsigned int doppler_max_; | ||||
|     unsigned int doppler_step_; | ||||
|     unsigned int doppler_center_; | ||||
|     unsigned int max_dwells_; | ||||
|     int64_t fs_in_; | ||||
|     bool dump_; | ||||
|   | ||||
| @@ -48,7 +48,6 @@ | ||||
| #else | ||||
| #include <boost/filesystem/path.hpp> | ||||
| #endif | ||||
| #include <glog/logging.h> | ||||
| #include <gnuradio/io_signature.h> | ||||
| #include <matio.h> | ||||
| #include <pmt/pmt.h>        // for from_long | ||||
| @@ -90,7 +89,7 @@ pcps_acquisition::pcps_acquisition(const Acq_Conf& conf_) : gr::block("pcps_acqu | ||||
|     d_active = false; | ||||
|     d_positive_acq = 0; | ||||
|     d_state = 0; | ||||
|     d_old_freq = 0LL; | ||||
|     d_doppler_bias = 0; | ||||
|     d_num_noncoherent_integrations_counter = 0U; | ||||
|     d_consumed_samples = acq_parameters.sampled_ms * acq_parameters.samples_per_ms * (acq_parameters.bit_transition_flag ? 2 : 1); | ||||
|     if (acq_parameters.sampled_ms == acq_parameters.ms_per_code) | ||||
| @@ -107,6 +106,7 @@ pcps_acquisition::pcps_acquisition(const Acq_Conf& conf_) : gr::block("pcps_acqu | ||||
|     d_num_doppler_bins = 0U; | ||||
|     d_threshold = 0.0; | ||||
|     d_doppler_step = 0U; | ||||
|     d_doppler_center = 0U; | ||||
|     d_doppler_center_step_two = 0.0; | ||||
|     d_test_statistics = 0.0; | ||||
|     d_channel = 0U; | ||||
| @@ -215,8 +215,6 @@ void pcps_acquisition::set_resampler_latency(uint32_t latency_samples) | ||||
|  | ||||
| void pcps_acquisition::set_local_code(std::complex<float>* code) | ||||
| { | ||||
|     // reset the intermediate frequency | ||||
|     d_old_freq = 0LL; | ||||
|     // This will check if it's fdma, if yes will update the intermediate frequency and the doppler grid | ||||
|     if (is_fdma()) | ||||
|         { | ||||
| @@ -253,17 +251,19 @@ void pcps_acquisition::set_local_code(std::complex<float>* code) | ||||
|  | ||||
| bool pcps_acquisition::is_fdma() | ||||
| { | ||||
|     // reset the intermediate frequency | ||||
|     d_doppler_bias = 0; | ||||
|     // Dealing with FDMA system | ||||
|     if (strcmp(d_gnss_synchro->Signal, "1G") == 0) | ||||
|         { | ||||
|             d_old_freq += DFRQ1_GLO * GLONASS_PRN.at(d_gnss_synchro->PRN); | ||||
|             LOG(INFO) << "Trying to acquire SV PRN " << d_gnss_synchro->PRN << " with freq " << d_old_freq << " in Glonass Channel " << GLONASS_PRN.at(d_gnss_synchro->PRN) << std::endl; | ||||
|             d_doppler_bias = static_cast<int32_t>(DFRQ1_GLO * GLONASS_PRN.at(d_gnss_synchro->PRN)); | ||||
|             LOG(INFO) << "Trying to acquire SV PRN " << d_gnss_synchro->PRN << " with freq " << d_doppler_bias << " in Glonass Channel " << GLONASS_PRN.at(d_gnss_synchro->PRN) << std::endl; | ||||
|             return true; | ||||
|         } | ||||
|     if (strcmp(d_gnss_synchro->Signal, "2G") == 0) | ||||
|         { | ||||
|             d_old_freq += DFRQ2_GLO * GLONASS_PRN.at(d_gnss_synchro->PRN); | ||||
|             LOG(INFO) << "Trying to acquire SV PRN " << d_gnss_synchro->PRN << " with freq " << d_old_freq << " in Glonass Channel " << GLONASS_PRN.at(d_gnss_synchro->PRN) << std::endl; | ||||
|             d_doppler_bias += static_cast<int32_t>(DFRQ2_GLO * GLONASS_PRN.at(d_gnss_synchro->PRN)); | ||||
|             LOG(INFO) << "Trying to acquire SV PRN " << d_gnss_synchro->PRN << " with freq " << d_doppler_bias << " in Glonass Channel " << GLONASS_PRN.at(d_gnss_synchro->PRN) << std::endl; | ||||
|             return true; | ||||
|         } | ||||
|     return false; | ||||
| @@ -318,14 +318,10 @@ void pcps_acquisition::init() | ||||
|  | ||||
|     for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) | ||||
|         { | ||||
|             for (uint32_t k = 0; k < d_fft_size; k++) | ||||
|                 { | ||||
|                     d_magnitude_grid[doppler_index][k] = 0.0; | ||||
|                 } | ||||
|             int32_t doppler = -static_cast<int32_t>(acq_parameters.doppler_max) + d_doppler_step * doppler_index; | ||||
|             update_local_carrier(gsl::span<gr_complex>(d_grid_doppler_wipeoffs[doppler_index].data(), d_fft_size), d_old_freq + doppler); | ||||
|             std::fill(d_magnitude_grid[doppler_index].begin(), d_magnitude_grid[doppler_index].end(), 0.0); | ||||
|         } | ||||
|  | ||||
|     update_grid_doppler_wipeoffs(); | ||||
|     d_worker_active = false; | ||||
|  | ||||
|     if (d_dump) | ||||
| @@ -341,8 +337,8 @@ void pcps_acquisition::update_grid_doppler_wipeoffs() | ||||
| { | ||||
|     for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) | ||||
|         { | ||||
|             int32_t doppler = -static_cast<int32_t>(acq_parameters.doppler_max) + d_doppler_step * doppler_index; | ||||
|             update_local_carrier(gsl::span<gr_complex>(d_grid_doppler_wipeoffs[doppler_index].data(), d_fft_size), d_old_freq + doppler); | ||||
|             int32_t doppler = -static_cast<int32_t>(acq_parameters.doppler_max) + d_doppler_center + d_doppler_step * doppler_index; | ||||
|             update_local_carrier(gsl::span<gr_complex>(d_grid_doppler_wipeoffs[doppler_index].data(), d_fft_size), d_doppler_bias + doppler); | ||||
|         } | ||||
| } | ||||
|  | ||||
| @@ -394,7 +390,8 @@ void pcps_acquisition::send_positive_acquisition() | ||||
|                << ", code phase " << d_gnss_synchro->Acq_delay_samples | ||||
|                << ", doppler " << d_gnss_synchro->Acq_doppler_hz | ||||
|                << ", magnitude " << d_mag | ||||
|                << ", input signal power " << d_input_power; | ||||
|                << ", input signal power " << d_input_power | ||||
|                << ", Assist doppler_center " << d_doppler_center; | ||||
|     d_positive_acq = 1; | ||||
|  | ||||
|     if (!d_channel_fsm.expired()) | ||||
| @@ -552,7 +549,7 @@ float pcps_acquisition::max_to_input_power_statistic(uint32_t& indext, int32_t& | ||||
|     indext = index_time; | ||||
|     if (!d_step_two) | ||||
|         { | ||||
|             doppler = -static_cast<int32_t>(doppler_max) + doppler_step * static_cast<int32_t>(index_doppler); | ||||
|             doppler = -static_cast<int32_t>(doppler_max) + d_doppler_center + doppler_step * static_cast<int32_t>(index_doppler); | ||||
|         } | ||||
|     else | ||||
|         { | ||||
| @@ -590,7 +587,7 @@ float pcps_acquisition::first_vs_second_peak_statistic(uint32_t& indext, int32_t | ||||
|  | ||||
|     if (!d_step_two) | ||||
|         { | ||||
|             doppler = -static_cast<int32_t>(doppler_max) + doppler_step * static_cast<int32_t>(index_doppler); | ||||
|             doppler = -static_cast<int32_t>(doppler_max) + d_doppler_center + doppler_step * static_cast<int32_t>(index_doppler); | ||||
|         } | ||||
|     else | ||||
|         { | ||||
|   | ||||
| @@ -55,6 +55,7 @@ | ||||
| #include "acq_conf.h" | ||||
| #include "channel_fsm.h" | ||||
| #include <armadillo> | ||||
| #include <glog/logging.h> | ||||
| #include <gnuradio/block.h> | ||||
| #include <gnuradio/fft/fft.h> | ||||
| #include <gnuradio/gr_complex.h>     // for gr_complex | ||||
| @@ -188,6 +189,21 @@ public: | ||||
|         d_doppler_step = doppler_step; | ||||
|     } | ||||
|  | ||||
|     /*! | ||||
|      * \brief Set Doppler center frequency for the grid search. It will refresh the Doppler grid. | ||||
|      * \param doppler_center - Frequency center of the search grid [Hz]. | ||||
|      */ | ||||
|     inline void set_doppler_center(int32_t doppler_center) | ||||
|     { | ||||
|         gr::thread::scoped_lock lock(d_setlock);  // require mutex with work function called by the scheduler | ||||
|         if (doppler_center != d_doppler_center) | ||||
|             { | ||||
|                 DLOG(INFO) << " Doppler assistance for Channel: " << d_channel << " => Doppler: " << doppler_center << "[Hz]"; | ||||
|                 d_doppler_center = doppler_center; | ||||
|                 update_grid_doppler_wipeoffs(); | ||||
|             } | ||||
|     } | ||||
|  | ||||
|     void set_resampler_latency(uint32_t latency_samples); | ||||
|  | ||||
|     /*! | ||||
| @@ -211,6 +227,8 @@ private: | ||||
|     uint32_t d_channel; | ||||
|     uint32_t d_samplesPerChip; | ||||
|     uint32_t d_doppler_step; | ||||
|     int32_t d_doppler_center; | ||||
|     int32_t d_doppler_bias; | ||||
|     uint32_t d_num_noncoherent_integrations_counter; | ||||
|     uint32_t d_fft_size; | ||||
|     uint32_t d_consumed_samples; | ||||
| @@ -220,7 +238,6 @@ private: | ||||
|     uint32_t d_buffer_count; | ||||
|     uint64_t d_sample_counter; | ||||
|     int64_t d_dump_number; | ||||
|     int64_t d_old_freq; | ||||
|     float d_threshold; | ||||
|     float d_mag; | ||||
|     float d_input_power; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Javier Arribas
					Javier Arribas