mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-31 07:13:03 +00:00 
			
		
		
		
	bds_b3i: merging new changes, fixing small bugs
This commit is contained in:
		| @@ -91,25 +91,38 @@ list(SORT ACQ_ADAPTER_SOURCES) | ||||
|  | ||||
| source_group(Headers FILES ${ACQ_ADAPTER_HEADERS}) | ||||
|  | ||||
| add_library(acq_adapters ${ACQ_ADAPTER_SOURCES} ${ACQ_ADAPTER_HEADERS}) | ||||
| add_library(acquisition_adapters ${ACQ_ADAPTER_SOURCES} ${ACQ_ADAPTER_HEADERS}) | ||||
|  | ||||
| target_link_libraries(acq_adapters | ||||
| target_link_libraries(acquisition_adapters | ||||
|     PUBLIC | ||||
|         gnss_sp_libs | ||||
|         gnss_sdr_flags | ||||
|         acq_gr_blocks | ||||
|         rx_core_lib | ||||
|         Gnuradio::blocks | ||||
|         gnss_system_parameters | ||||
|         algorithms_libs | ||||
|         gnss_sdr_flags | ||||
|         acquisition_gr_blocks | ||||
|         core_system_parameters | ||||
|     PRIVATE | ||||
|         Boost::boost | ||||
|         Gflags::gflags | ||||
|         Glog::glog | ||||
|         Volkgnsssdr::volkgnsssdr | ||||
|         acquisition_lib | ||||
|         acquisition_libs | ||||
| ) | ||||
|  | ||||
| set_property(TARGET acq_adapters | ||||
| target_include_directories(acquisition_adapters | ||||
|     PUBLIC | ||||
|         ${CMAKE_SOURCE_DIR}/src/core/interfaces | ||||
| ) | ||||
|  | ||||
| if(ENABLE_CLANG_TIDY) | ||||
|     if(CLANG_TIDY_EXE) | ||||
|         set_target_properties(acquisition_adapters | ||||
|             PROPERTIES | ||||
|                 CXX_CLANG_TIDY "${DO_CLANG_TIDY}" | ||||
|         ) | ||||
|     endif() | ||||
| endif() | ||||
|  | ||||
| set_property(TARGET acquisition_adapters | ||||
|     APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES | ||||
|         $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> | ||||
| ) | ||||
|   | ||||
| @@ -68,7 +68,10 @@ BeidouB1iPcpsAcquisition::BeidouB1iPcpsAcquisition( | ||||
|     blocking_ = configuration_->property(role + ".blocking", true); | ||||
|     acq_parameters.blocking = blocking_; | ||||
|     doppler_max_ = configuration_->property(role + ".doppler_max", 5000); | ||||
|     if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; | ||||
|     if (FLAGS_doppler_max != 0) | ||||
|         { | ||||
|             doppler_max_ = FLAGS_doppler_max; | ||||
|         } | ||||
|     acq_parameters.doppler_max = doppler_max_; | ||||
|     sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1); | ||||
|     acq_parameters.sampled_ms = sampled_ms_; | ||||
| @@ -81,7 +84,7 @@ BeidouB1iPcpsAcquisition::BeidouB1iPcpsAcquisition( | ||||
|     dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); | ||||
|     acq_parameters.dump_filename = dump_filename_; | ||||
|     //--- Find number of samples per spreading code ------------------------- | ||||
|     code_length_ = static_cast<unsigned int>(std::round(static_cast<double>(fs_in_) / (BEIDOU_B1I_CODE_RATE_HZ / BEIDOU_B1I_CODE_LENGTH_CHIPS))); | ||||
|     code_length_ = static_cast<uint32_t>(std::round(static_cast<double>(fs_in_) / (BEIDOU_B1I_CODE_RATE_HZ / BEIDOU_B1I_CODE_LENGTH_CHIPS))); | ||||
|  | ||||
|     vector_length_ = code_length_ * sampled_ms_; | ||||
|  | ||||
| @@ -144,7 +147,7 @@ void BeidouB1iPcpsAcquisition::stop_acquisition() | ||||
| { | ||||
| } | ||||
|  | ||||
| void BeidouB1iPcpsAcquisition::set_channel(unsigned int channel) | ||||
| void BeidouB1iPcpsAcquisition::set_channel(uint32_t channel) | ||||
| { | ||||
|     channel_ = channel; | ||||
|     acquisition_->set_channel(channel_); | ||||
| @@ -170,7 +173,7 @@ void BeidouB1iPcpsAcquisition::set_threshold(float threshold) | ||||
| } | ||||
|  | ||||
|  | ||||
| void BeidouB1iPcpsAcquisition::set_doppler_max(unsigned int doppler_max) | ||||
| void BeidouB1iPcpsAcquisition::set_doppler_max(uint32_t doppler_max) | ||||
| { | ||||
|     doppler_max_ = doppler_max; | ||||
|  | ||||
| @@ -178,7 +181,7 @@ void BeidouB1iPcpsAcquisition::set_doppler_max(unsigned int doppler_max) | ||||
| } | ||||
|  | ||||
|  | ||||
| void BeidouB1iPcpsAcquisition::set_doppler_step(unsigned int doppler_step) | ||||
| void BeidouB1iPcpsAcquisition::set_doppler_step(uint32_t doppler_step) | ||||
| { | ||||
|     doppler_step_ = doppler_step; | ||||
|  | ||||
| @@ -213,7 +216,7 @@ void BeidouB1iPcpsAcquisition::set_local_code() | ||||
|  | ||||
|     beidou_b1i_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0); | ||||
|  | ||||
|     for (unsigned int i = 0; i < sampled_ms_; i++) | ||||
|     for (uint32_t i = 0; i < sampled_ms_; i++) | ||||
|         { | ||||
|             memcpy(&(code_[i * code_length_]), code, | ||||
|                 sizeof(gr_complex) * code_length_); | ||||
| @@ -239,7 +242,7 @@ void BeidouB1iPcpsAcquisition::set_state(int state) | ||||
| float BeidouB1iPcpsAcquisition::calculate_threshold(float pfa) | ||||
| { | ||||
|     //Calculate the threshold | ||||
|     unsigned int frequency_bins = 0; | ||||
|     uint32_t frequency_bins = 0; | ||||
|     /* | ||||
|     for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_) | ||||
|         { | ||||
| @@ -250,7 +253,7 @@ float BeidouB1iPcpsAcquisition::calculate_threshold(float pfa) | ||||
|     frequency_bins = (2 * doppler_max_ + doppler_step_) / doppler_step_; | ||||
|  | ||||
|     DLOG(INFO) << "Channel " << channel_ << "  Pfa = " << pfa; | ||||
|     unsigned int ncells = vector_length_ * frequency_bins; | ||||
|     uint32_t ncells = vector_length_ * frequency_bins; | ||||
|     double exponent = 1 / static_cast<double>(ncells); | ||||
|     double val = pow(1.0 - pfa, exponent); | ||||
|     auto lambda = static_cast<double>(vector_length_); | ||||
| @@ -315,7 +318,7 @@ gr::basic_block_sptr BeidouB1iPcpsAcquisition::get_left_block() | ||||
|         { | ||||
|             return acquisition_; | ||||
|         } | ||||
|     else if (item_type_ == "cshort") | ||||
|     if (item_type_ == "cshort") | ||||
|         { | ||||
|             return acquisition_; | ||||
|         } | ||||
|   | ||||
| @@ -41,6 +41,7 @@ | ||||
| #include <gnuradio/blocks/float_to_complex.h> | ||||
| #include <gnuradio/blocks/stream_to_vector.h> | ||||
| #include <volk_gnsssdr/volk_gnsssdr.h> | ||||
| #include <cstdint> | ||||
| #include <string> | ||||
|  | ||||
|  | ||||
| @@ -92,7 +93,7 @@ public: | ||||
|     /*! | ||||
|      * \brief Set acquisition channel unique ID | ||||
|      */ | ||||
|     void set_channel(unsigned int channel) override; | ||||
|     void set_channel(uint32_t channel) override; | ||||
|  | ||||
|     /*! | ||||
|      * \brief Set statistics threshold of PCPS algorithm | ||||
| @@ -102,12 +103,12 @@ public: | ||||
|     /*! | ||||
|      * \brief Set maximum Doppler off grid search | ||||
|      */ | ||||
|     void set_doppler_max(unsigned int doppler_max) override; | ||||
|     void set_doppler_max(uint32_t doppler_max) override; | ||||
|  | ||||
|     /*! | ||||
|      * \brief Set Doppler steps for the grid search | ||||
|      */ | ||||
|     void set_doppler_step(unsigned int doppler_step) override; | ||||
|     void set_doppler_step(uint32_t doppler_step) override; | ||||
|  | ||||
|     /*! | ||||
|      * \brief Initializes acquisition algorithm. | ||||
| @@ -153,25 +154,25 @@ private: | ||||
|     complex_byte_to_float_x2_sptr cbyte_to_float_x2_; | ||||
|     size_t item_size_; | ||||
|     std::string item_type_; | ||||
|     unsigned int vector_length_; | ||||
|     unsigned int code_length_; | ||||
|     uint32_t vector_length_; | ||||
|     uint32_t code_length_; | ||||
|     bool bit_transition_flag_; | ||||
|     bool use_CFAR_algorithm_flag_; | ||||
|     unsigned int channel_; | ||||
|     uint32_t channel_; | ||||
|     float threshold_; | ||||
|     unsigned int doppler_max_; | ||||
|     unsigned int doppler_step_; | ||||
|     unsigned int sampled_ms_; | ||||
|     unsigned int max_dwells_; | ||||
|     long fs_in_; | ||||
|     uint32_t doppler_max_; | ||||
|     uint32_t doppler_step_; | ||||
|     uint32_t sampled_ms_; | ||||
|     uint32_t max_dwells_; | ||||
|     int64_t fs_in_; | ||||
|     bool dump_; | ||||
|     bool blocking_; | ||||
|     std::string dump_filename_; | ||||
|     std::complex<float>* code_; | ||||
|     Gnss_Synchro* gnss_synchro_; | ||||
|     std::string role_; | ||||
|     unsigned int in_streams_; | ||||
|     unsigned int out_streams_; | ||||
|     uint32_t in_streams_; | ||||
|     uint32_t out_streams_; | ||||
|  | ||||
|     float calculate_threshold(float pfa); | ||||
| }; | ||||
|   | ||||
| @@ -6,7 +6,7 @@ | ||||
|  * | ||||
|  * ------------------------------------------------------------------------- | ||||
|  * | ||||
|  * Copyright (C) 2010-2015  (see AUTHORS file for a list of contributors) | ||||
|  * Copyright (C) 2010-2019  (see AUTHORS file for a list of contributors) | ||||
|  * | ||||
|  * GNSS-SDR is a software defined Global Navigation | ||||
|  *          Satellite Systems receiver | ||||
| @@ -24,7 +24,7 @@ | ||||
|  * GNU General Public License for more details. | ||||
|  * | ||||
|  * You should have received a copy of the GNU General Public License | ||||
|  * along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>. | ||||
|  * along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>. | ||||
|  * | ||||
|  * ------------------------------------------------------------------------- | ||||
|  */ | ||||
|   | ||||
| @@ -6,7 +6,7 @@ | ||||
|  * | ||||
|  * ------------------------------------------------------------------------- | ||||
|  * | ||||
|  * Copyright (C) 2010-2015  (see AUTHORS file for a list of contributors) | ||||
|  * Copyright (C) 2010-2019  (see AUTHORS file for a list of contributors) | ||||
|  * | ||||
|  * GNSS-SDR is a software defined Global Navigation | ||||
|  *          Satellite Systems receiver | ||||
| @@ -24,7 +24,7 @@ | ||||
|  * GNU General Public License for more details. | ||||
|  * | ||||
|  * You should have received a copy of the GNU General Public License | ||||
|  * along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>. | ||||
|  * along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>. | ||||
|  * | ||||
|  * ------------------------------------------------------------------------- | ||||
|  */ | ||||
|   | ||||
| @@ -61,7 +61,10 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition( | ||||
|     fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||
|     dump_ = configuration_->property(role + ".dump", false); | ||||
|     doppler_max_ = configuration_->property(role + ".doppler_max", 5000); | ||||
|     if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; | ||||
|     if (FLAGS_doppler_max != 0) | ||||
|         { | ||||
|             doppler_max_ = FLAGS_doppler_max; | ||||
|         } | ||||
|     sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4); | ||||
|  | ||||
|     if (sampled_ms_ % 4 != 0) | ||||
| @@ -79,7 +82,7 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition( | ||||
|  | ||||
|     //--- Find number of samples per spreading code (4 ms)  ----------------- | ||||
|     code_length_ = round( | ||||
|         fs_in_ / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)); | ||||
|         fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS)); | ||||
|  | ||||
|     vector_length_ = code_length_ * static_cast<int>(sampled_ms_ / 4); | ||||
|  | ||||
| @@ -145,7 +148,10 @@ void GalileoE1Pcps8msAmbiguousAcquisition::set_threshold(float threshold) | ||||
| { | ||||
|     float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); | ||||
|  | ||||
|     if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0); | ||||
|     if (pfa == 0.0) | ||||
|         { | ||||
|             pfa = configuration_->property(role_ + ".pfa", 0.0); | ||||
|         } | ||||
|  | ||||
|     if (pfa == 0.0) | ||||
|         { | ||||
|   | ||||
| @@ -62,7 +62,10 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition( | ||||
|     fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||
|     acq_parameters_.fs_in = fs_in_; | ||||
|     doppler_max_ = configuration_->property(role + ".doppler_max", 5000); | ||||
|     if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; | ||||
|     if (FLAGS_doppler_max != 0) | ||||
|         { | ||||
|             doppler_max_ = FLAGS_doppler_max; | ||||
|         } | ||||
|     acq_parameters_.doppler_max = doppler_max_; | ||||
|     acq_parameters_.ms_per_code = 4; | ||||
|     sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", acq_parameters_.ms_per_code); | ||||
| @@ -95,10 +98,10 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition( | ||||
|         } | ||||
|     if (acq_parameters_.use_automatic_resampler) | ||||
|         { | ||||
|             if (acq_parameters_.fs_in > Galileo_E1_OPT_ACQ_FS_HZ) | ||||
|             if (acq_parameters_.fs_in > GALILEO_E1_OPT_ACQ_FS_HZ) | ||||
|                 { | ||||
|                     acq_parameters_.resampler_ratio = floor(static_cast<float>(acq_parameters_.fs_in) / Galileo_E1_OPT_ACQ_FS_HZ); | ||||
|                     uint32_t decimation = acq_parameters_.fs_in / Galileo_E1_OPT_ACQ_FS_HZ; | ||||
|                     acq_parameters_.resampler_ratio = floor(static_cast<float>(acq_parameters_.fs_in) / GALILEO_E1_OPT_ACQ_FS_HZ); | ||||
|                     uint32_t decimation = acq_parameters_.fs_in / GALILEO_E1_OPT_ACQ_FS_HZ; | ||||
|                     while (acq_parameters_.fs_in % decimation > 0) | ||||
|                         { | ||||
|                             decimation--; | ||||
| @@ -107,19 +110,19 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition( | ||||
|                     acq_parameters_.resampled_fs = acq_parameters_.fs_in / static_cast<int>(acq_parameters_.resampler_ratio); | ||||
|                 } | ||||
|             //--- Find number of samples per spreading code (4 ms)  ----------------- | ||||
|             code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS))); | ||||
|             code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS))); | ||||
|             acq_parameters_.samples_per_ms = static_cast<float>(acq_parameters_.resampled_fs) * 0.001; | ||||
|             acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / Galileo_E1_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters_.resampled_fs))); | ||||
|             acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GALILEO_E1_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters_.resampled_fs))); | ||||
|         } | ||||
|     else | ||||
|         { | ||||
|             //--- Find number of samples per spreading code (4 ms)  ----------------- | ||||
|             code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS))); | ||||
|             code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS))); | ||||
|             acq_parameters_.samples_per_ms = static_cast<float>(fs_in_) * 0.001; | ||||
|             acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / Galileo_E1_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters_.fs_in))); | ||||
|             acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GALILEO_E1_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters_.fs_in))); | ||||
|         } | ||||
|  | ||||
|     acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast<float>(Galileo_E1_CODE_PERIOD_MS); | ||||
|     acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast<float>(GALILEO_E1_CODE_PERIOD_MS); | ||||
|     vector_length_ = sampled_ms_ * acq_parameters_.samples_per_ms; | ||||
|     if (bit_transition_flag_) | ||||
|         { | ||||
| @@ -187,7 +190,10 @@ void GalileoE1PcpsAmbiguousAcquisition::set_threshold(float threshold) | ||||
| { | ||||
|     float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); | ||||
|  | ||||
|     if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0); | ||||
|     if (pfa == 0.0) | ||||
|         { | ||||
|             pfa = configuration_->property(role_ + ".pfa", 0.0); | ||||
|         } | ||||
|  | ||||
|     if (pfa == 0.0) | ||||
|         { | ||||
|   | ||||
| @@ -89,7 +89,7 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( | ||||
|     //   dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); | ||||
|     //   acq_parameters.dump_filename = dump_filename_; | ||||
|     //--- Find number of samples per spreading code (4 ms)  ----------------- | ||||
|     auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS))); | ||||
|     auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS))); | ||||
|     //acq_parameters.samples_per_code = code_length_; | ||||
|     //int samples_per_ms = static_cast<int>(std::round(static_cast<double>(fs_in_) * 0.001)); | ||||
|     //acq_parameters.samples_per_ms = samples_per_ms; | ||||
| @@ -101,8 +101,8 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( | ||||
|     //        } | ||||
|  | ||||
|     //printf("fs_in = %d\n", fs_in); | ||||
|     //printf("Galileo_E1_B_CODE_LENGTH_CHIPS = %f\n", Galileo_E1_B_CODE_LENGTH_CHIPS); | ||||
|     //printf("Galileo_E1_CODE_CHIP_RATE_HZ = %f\n", Galileo_E1_CODE_CHIP_RATE_HZ); | ||||
|     //printf("GALILEO_E1_B_CODE_LENGTH_CHIPS = %f\n", GALILEO_E1_B_CODE_LENGTH_CHIPS); | ||||
|     //printf("GALILEO_E1_CODE_CHIP_RATE_HZ = %f\n", GALILEO_E1_CODE_CHIP_RATE_HZ); | ||||
|     //printf("acq adapter code_length = %d\n", code_length); | ||||
|     acq_parameters.code_length = code_length; | ||||
|     // The FPGA can only use FFT lengths that are a power of two. | ||||
| @@ -123,12 +123,12 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( | ||||
|     auto* fft_if = new gr::fft::fft_complex(nsamples_total, true);  // Direct FFT | ||||
|     auto* code = new std::complex<float>[nsamples_total];           // buffer for the local code | ||||
|     auto* fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); | ||||
|     d_all_fft_codes_ = new lv_16sc_t[nsamples_total * Galileo_E1_NUMBER_OF_CODES];  // memory containing all the possible fft codes for PRN 0 to 32 | ||||
|     d_all_fft_codes_ = new lv_16sc_t[nsamples_total * GALILEO_E1_NUMBER_OF_CODES];  // memory containing all the possible fft codes for PRN 0 to 32 | ||||
|     float max;                                                                      // temporary maxima search | ||||
|  | ||||
|     //int tmp_re, tmp_im; | ||||
|  | ||||
|     for (unsigned int PRN = 1; PRN <= Galileo_E1_NUMBER_OF_CODES; PRN++) | ||||
|     for (unsigned int PRN = 1; PRN <= GALILEO_E1_NUMBER_OF_CODES; PRN++) | ||||
|         { | ||||
|             //code_ = new gr_complex[vector_length_]; | ||||
|  | ||||
| @@ -258,7 +258,7 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( | ||||
|         } | ||||
|  | ||||
|  | ||||
|     //    for (unsigned int PRN = 1; PRN <= Galileo_E1_NUMBER_OF_CODES; PRN++) | ||||
|     //    for (unsigned int PRN = 1; PRN <= GALILEO_E1_NUMBER_OF_CODES; PRN++) | ||||
|     //        { | ||||
|     //                    // debug | ||||
|     //                    char filename2[25]; | ||||
|   | ||||
| @@ -60,7 +60,10 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition | ||||
|     fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||
|     dump_ = configuration_->property(role + ".dump", false); | ||||
|     doppler_max_ = configuration_->property(role + ".doppler_max", 5000); | ||||
|     if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; | ||||
|     if (FLAGS_doppler_max != 0) | ||||
|         { | ||||
|             doppler_max_ = FLAGS_doppler_max; | ||||
|         } | ||||
|     sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4); | ||||
|  | ||||
|     if (sampled_ms_ % 4 != 0) | ||||
| @@ -79,7 +82,7 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition | ||||
|     //--- Find number of samples per spreading code (4 ms)  ----------------- | ||||
|  | ||||
|     code_length_ = round( | ||||
|         fs_in_ / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)); | ||||
|         fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS)); | ||||
|  | ||||
|     vector_length_ = code_length_ * static_cast<int>(sampled_ms_ / 4); | ||||
|  | ||||
|   | ||||
| @@ -61,12 +61,15 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui | ||||
|     fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||
|     dump_ = configuration_->property(role + ".dump", false); | ||||
|     doppler_max_ = configuration_->property(role + ".doppler_max", 5000); | ||||
|     if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; | ||||
|     if (FLAGS_doppler_max != 0) | ||||
|         { | ||||
|             doppler_max_ = FLAGS_doppler_max; | ||||
|         } | ||||
|     sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 8); | ||||
|  | ||||
|     /*--- Find number of samples per spreading code (4 ms)  -----------------*/ | ||||
|     code_length_ = round( | ||||
|         fs_in_ / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)); | ||||
|         fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS)); | ||||
|  | ||||
|     int samples_per_ms = round(code_length_ / 4.0); | ||||
|  | ||||
| @@ -179,7 +182,10 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_threshold(float threshold) | ||||
| { | ||||
|     float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); | ||||
|  | ||||
|     if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0); | ||||
|     if (pfa == 0.0) | ||||
|         { | ||||
|             pfa = configuration_->property(role_ + ".pfa", 0.0); | ||||
|         } | ||||
|  | ||||
|     if (pfa == 0.0) | ||||
|         { | ||||
|   | ||||
| @@ -61,7 +61,10 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition( | ||||
|     fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||
|     dump_ = configuration_->property(role + ".dump", false); | ||||
|     doppler_max_ = configuration_->property(role + ".doppler_max", 5000); | ||||
|     if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; | ||||
|     if (FLAGS_doppler_max != 0) | ||||
|         { | ||||
|             doppler_max_ = FLAGS_doppler_max; | ||||
|         } | ||||
|     sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4); | ||||
|  | ||||
|     if (sampled_ms_ % 4 != 0) | ||||
| @@ -82,7 +85,7 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition( | ||||
|     //--- Find number of samples per spreading code (4 ms)  ----------------- | ||||
|  | ||||
|     code_length_ = round( | ||||
|         fs_in_ / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)); | ||||
|         fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS)); | ||||
|  | ||||
|     vector_length_ = code_length_ * static_cast<int>(sampled_ms_ / 4); | ||||
|  | ||||
| @@ -149,7 +152,10 @@ void GalileoE1PcpsTongAmbiguousAcquisition::set_threshold(float threshold) | ||||
| { | ||||
|     float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); | ||||
|  | ||||
|     if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0); | ||||
|     if (pfa == 0.0) | ||||
|         { | ||||
|             pfa = configuration_->property(role_ + ".pfa", 0.0); | ||||
|         } | ||||
|  | ||||
|     if (pfa == 0.0) | ||||
|         { | ||||
|   | ||||
| @@ -66,7 +66,10 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf( | ||||
|     fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||
|     dump_ = configuration_->property(role + ".dump", false); | ||||
|     doppler_max_ = configuration_->property(role + ".doppler_max", 5000); | ||||
|     if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; | ||||
|     if (FLAGS_doppler_max != 0) | ||||
|         { | ||||
|             doppler_max_ = FLAGS_doppler_max; | ||||
|         } | ||||
|     CAF_window_hz_ = configuration_->property(role + ".CAF_window_hz", 0); | ||||
|     Zero_padding = configuration_->property(role + ".Zero_padding", 0); | ||||
|     sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1); | ||||
| @@ -88,7 +91,7 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf( | ||||
|     bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); | ||||
|  | ||||
|     //--- Find number of samples per spreading code (1ms)------------------------- | ||||
|     code_length_ = round(static_cast<double>(fs_in_) / Galileo_E5a_CODE_CHIP_RATE_HZ * static_cast<double>(Galileo_E5a_CODE_LENGTH_CHIPS)); | ||||
|     code_length_ = round(static_cast<double>(fs_in_) / GALILEO_E5A_CODE_CHIP_RATE_HZ * static_cast<double>(GALILEO_E5A_CODE_LENGTH_CHIPS)); | ||||
|  | ||||
|     vector_length_ = code_length_ * sampled_ms_; | ||||
|  | ||||
| @@ -155,7 +158,10 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_threshold(float threshold) | ||||
| { | ||||
|     float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); | ||||
|  | ||||
|     if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0); | ||||
|     if (pfa == 0.0) | ||||
|         { | ||||
|             pfa = configuration_->property(role_ + ".pfa", 0.0); | ||||
|         } | ||||
|  | ||||
|     if (pfa == 0.0) | ||||
|         { | ||||
|   | ||||
| @@ -70,7 +70,10 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con | ||||
|     acq_parameters_.dump = dump_; | ||||
|     acq_parameters_.dump_channel = configuration_->property(role + ".dump_channel", 0); | ||||
|     doppler_max_ = configuration_->property(role + ".doppler_max", 5000); | ||||
|     if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; | ||||
|     if (FLAGS_doppler_max != 0) | ||||
|         { | ||||
|             doppler_max_ = FLAGS_doppler_max; | ||||
|         } | ||||
|     acq_parameters_.doppler_max = doppler_max_; | ||||
|     sampled_ms_ = 1; | ||||
|     max_dwells_ = configuration_->property(role + ".max_dwells", 1); | ||||
| @@ -93,10 +96,10 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con | ||||
|         } | ||||
|     if (acq_parameters_.use_automatic_resampler) | ||||
|         { | ||||
|             if (acq_parameters_.fs_in > Galileo_E5a_OPT_ACQ_FS_HZ) | ||||
|             if (acq_parameters_.fs_in > GALILEO_E5A_OPT_ACQ_FS_HZ) | ||||
|                 { | ||||
|                     acq_parameters_.resampler_ratio = floor(static_cast<float>(acq_parameters_.fs_in) / Galileo_E5a_OPT_ACQ_FS_HZ); | ||||
|                     uint32_t decimation = acq_parameters_.fs_in / Galileo_E5a_OPT_ACQ_FS_HZ; | ||||
|                     acq_parameters_.resampler_ratio = floor(static_cast<float>(acq_parameters_.fs_in) / GALILEO_E5A_OPT_ACQ_FS_HZ); | ||||
|                     uint32_t decimation = acq_parameters_.fs_in / GALILEO_E5A_OPT_ACQ_FS_HZ; | ||||
|                     while (acq_parameters_.fs_in % decimation > 0) | ||||
|                         { | ||||
|                             decimation--; | ||||
| @@ -106,21 +109,21 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con | ||||
|                 } | ||||
|  | ||||
|             //--- Find number of samples per spreading code ------------------------- | ||||
|             code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (Galileo_E5a_CODE_CHIP_RATE_HZ / Galileo_E5a_CODE_LENGTH_CHIPS))); | ||||
|             code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GALILEO_E5A_CODE_CHIP_RATE_HZ / GALILEO_E5A_CODE_LENGTH_CHIPS))); | ||||
|             acq_parameters_.samples_per_ms = static_cast<float>(acq_parameters_.resampled_fs) * 0.001; | ||||
|             acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / Galileo_E5a_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters_.resampled_fs))); | ||||
|             acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GALILEO_E5A_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters_.resampled_fs))); | ||||
|         } | ||||
|     else | ||||
|         { | ||||
|             acq_parameters_.resampled_fs = fs_in_; | ||||
|             //--- Find number of samples per spreading code ------------------------- | ||||
|             code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (Galileo_E5a_CODE_CHIP_RATE_HZ / Galileo_E5a_CODE_LENGTH_CHIPS))); | ||||
|             code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (GALILEO_E5A_CODE_CHIP_RATE_HZ / GALILEO_E5A_CODE_LENGTH_CHIPS))); | ||||
|             acq_parameters_.samples_per_ms = static_cast<float>(fs_in_) * 0.001; | ||||
|             acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / Galileo_E5a_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters_.fs_in))); | ||||
|             acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GALILEO_E5A_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters_.fs_in))); | ||||
|         } | ||||
|  | ||||
|     //--- Find number of samples per spreading code (1ms)------------------------- | ||||
|     code_length_ = static_cast<unsigned int>(std::round(static_cast<double>(fs_in_) / Galileo_E5a_CODE_CHIP_RATE_HZ * static_cast<double>(Galileo_E5a_CODE_LENGTH_CHIPS))); | ||||
|     code_length_ = static_cast<unsigned int>(std::round(static_cast<double>(fs_in_) / GALILEO_E5A_CODE_CHIP_RATE_HZ * static_cast<double>(GALILEO_E5A_CODE_LENGTH_CHIPS))); | ||||
|     vector_length_ = code_length_ * sampled_ms_; | ||||
|  | ||||
|     code_ = new gr_complex[vector_length_]; | ||||
| @@ -141,7 +144,7 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con | ||||
|     acq_parameters_.it_size = item_size_; | ||||
|     acq_parameters_.sampled_ms = sampled_ms_; | ||||
|     acq_parameters_.ms_per_code = 1; | ||||
|     acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast<float>(GALILEO_E5a_CODE_PERIOD_MS); | ||||
|     acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast<float>(GALILEO_E5A_CODE_PERIOD_MS); | ||||
|     acq_parameters_.num_doppler_bins_step2 = configuration_->property(role + ".second_nbins", 4); | ||||
|     acq_parameters_.doppler_step2 = configuration_->property(role + ".second_doppler_step", 125.0); | ||||
|     acq_parameters_.make_2_steps = configuration_->property(role + ".make_two_steps", false); | ||||
|   | ||||
| @@ -89,7 +89,7 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf | ||||
|             acq_pilot_ = false; | ||||
|         } | ||||
|  | ||||
|     auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / Galileo_E5a_CODE_CHIP_RATE_HZ * static_cast<double>(Galileo_E5a_CODE_LENGTH_CHIPS))); | ||||
|     auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / GALILEO_E5A_CODE_CHIP_RATE_HZ * static_cast<double>(GALILEO_E5A_CODE_LENGTH_CHIPS))); | ||||
|     acq_parameters.code_length = code_length; | ||||
|     // The FPGA can only use FFT lengths that are a power of two. | ||||
|     float nbits = ceilf(log2f((float)code_length)); | ||||
| @@ -111,13 +111,13 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf | ||||
|     auto* fft_if = new gr::fft::fft_complex(nsamples_total, true);  // Direct FFT | ||||
|     auto* code = new std::complex<float>[nsamples_total];           // buffer for the local code | ||||
|     auto* fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); | ||||
|     d_all_fft_codes_ = new lv_16sc_t[nsamples_total * Galileo_E5a_NUMBER_OF_CODES];  // memory containing all the possible fft codes for PRN 0 to 32 | ||||
|     d_all_fft_codes_ = new lv_16sc_t[nsamples_total * GALILEO_E5A_NUMBER_OF_CODES];  // memory containing all the possible fft codes for PRN 0 to 32 | ||||
|     float max;                                                                       // temporary maxima search | ||||
|  | ||||
|     //printf("creating the E5A acquisition CONT"); | ||||
|     //printf("nsamples_total = %d\n", nsamples_total); | ||||
|  | ||||
|     for (unsigned int PRN = 1; PRN <= Galileo_E5a_NUMBER_OF_CODES; PRN++) | ||||
|     for (unsigned int PRN = 1; PRN <= GALILEO_E5A_NUMBER_OF_CODES; PRN++) | ||||
|         { | ||||
|             //    gr_complex* code = new gr_complex[code_length_]; | ||||
|             char signal_[3]; | ||||
|   | ||||
| @@ -71,7 +71,10 @@ GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition( | ||||
|     blocking_ = configuration_->property(role + ".blocking", true); | ||||
|     acq_parameters.blocking = blocking_; | ||||
|     doppler_max_ = configuration_->property(role + ".doppler_max", 5000); | ||||
|     if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; | ||||
|     if (FLAGS_doppler_max != 0) | ||||
|         { | ||||
|             doppler_max_ = FLAGS_doppler_max; | ||||
|         } | ||||
|     acq_parameters.doppler_max = doppler_max_; | ||||
|     sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1); | ||||
|     acq_parameters.sampled_ms = sampled_ms_; | ||||
|   | ||||
| @@ -70,7 +70,10 @@ GlonassL2CaPcpsAcquisition::GlonassL2CaPcpsAcquisition( | ||||
|     blocking_ = configuration_->property(role + ".blocking", true); | ||||
|     acq_parameters.blocking = blocking_; | ||||
|     doppler_max_ = configuration_->property(role + ".doppler_max", 5000); | ||||
|     if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; | ||||
|     if (FLAGS_doppler_max != 0) | ||||
|         { | ||||
|             doppler_max_ = FLAGS_doppler_max; | ||||
|         } | ||||
|     acq_parameters.doppler_max = doppler_max_; | ||||
|     sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1); | ||||
|     bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); | ||||
|   | ||||
| @@ -70,7 +70,10 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( | ||||
|     blocking_ = configuration_->property(role + ".blocking", true); | ||||
|     acq_parameters_.blocking = blocking_; | ||||
|     doppler_max_ = configuration_->property(role + ".doppler_max", 5000); | ||||
|     if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; | ||||
|     if (FLAGS_doppler_max != 0) | ||||
|         { | ||||
|             doppler_max_ = FLAGS_doppler_max; | ||||
|         } | ||||
|     acq_parameters_.doppler_max = doppler_max_; | ||||
|     sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1); | ||||
|     acq_parameters_.sampled_ms = sampled_ms_; | ||||
|   | ||||
| @@ -67,7 +67,10 @@ GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler( | ||||
|     dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename); | ||||
|     acq_parameters.dump_filename = dump_filename_; | ||||
|     doppler_max_ = configuration->property(role + ".doppler_max", 5000); | ||||
|     if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; | ||||
|     if (FLAGS_doppler_max != 0) | ||||
|         { | ||||
|             doppler_max_ = FLAGS_doppler_max; | ||||
|         } | ||||
|     acq_parameters.doppler_max = doppler_max_; | ||||
|     sampled_ms_ = configuration->property(role + ".coherent_integration_time_ms", 1); | ||||
|     acq_parameters.sampled_ms = sampled_ms_; | ||||
|   | ||||
| @@ -61,7 +61,10 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition( | ||||
|     fs_in_ = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||
|     dump_ = configuration->property(role + ".dump", false); | ||||
|     doppler_max_ = configuration->property(role + ".doppler_max", 5000); | ||||
|     if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; | ||||
|     if (FLAGS_doppler_max != 0) | ||||
|         { | ||||
|             doppler_max_ = FLAGS_doppler_max; | ||||
|         } | ||||
|     doppler_min_ = configuration->property(role + ".doppler_min", -doppler_max_); | ||||
|     sampled_ms_ = configuration->property(role + ".coherent_integration_time_ms", 1); | ||||
|     max_dwells_ = configuration->property(role + ".max_dwells", 1); | ||||
|   | ||||
| @@ -61,7 +61,10 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition( | ||||
|     fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||
|     dump_ = configuration_->property(role + ".dump", false); | ||||
|     doppler_max_ = configuration->property(role + ".doppler_max", 5000); | ||||
|     if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; | ||||
|     if (FLAGS_doppler_max != 0) | ||||
|         { | ||||
|             doppler_max_ = FLAGS_doppler_max; | ||||
|         } | ||||
|     sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4); | ||||
|  | ||||
|     //--- Find number of samples per spreading code ------------------------- | ||||
|   | ||||
| @@ -61,7 +61,10 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition( | ||||
|     fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||
|     dump_ = configuration_->property(role + ".dump", false); | ||||
|     doppler_max_ = configuration->property(role + ".doppler_max", 5000); | ||||
|     if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; | ||||
|     if (FLAGS_doppler_max != 0) | ||||
|         { | ||||
|             doppler_max_ = FLAGS_doppler_max; | ||||
|         } | ||||
|     sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1); | ||||
|  | ||||
|     tong_init_val_ = configuration->property(role + ".tong_init_val", 1); | ||||
|   | ||||
| @@ -68,7 +68,10 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition( | ||||
|     blocking_ = configuration_->property(role + ".blocking", true); | ||||
|     acq_parameters_.blocking = blocking_; | ||||
|     doppler_max_ = configuration->property(role + ".doppler_max", 5000); | ||||
|     if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; | ||||
|     if (FLAGS_doppler_max != 0) | ||||
|         { | ||||
|             doppler_max_ = FLAGS_doppler_max; | ||||
|         } | ||||
|     acq_parameters_.doppler_max = doppler_max_; | ||||
|     bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); | ||||
|     acq_parameters_.bit_transition_flag = bit_transition_flag_; | ||||
|   | ||||
| @@ -69,7 +69,10 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition( | ||||
|     blocking_ = configuration_->property(role + ".blocking", true); | ||||
|     acq_parameters_.blocking = blocking_; | ||||
|     doppler_max_ = configuration->property(role + ".doppler_max", 5000); | ||||
|     if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; | ||||
|     if (FLAGS_doppler_max != 0) | ||||
|         { | ||||
|             doppler_max_ = FLAGS_doppler_max; | ||||
|         } | ||||
|     acq_parameters_.doppler_max = doppler_max_; | ||||
|     bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); | ||||
|     acq_parameters_.bit_transition_flag = bit_transition_flag_; | ||||
| @@ -118,20 +121,20 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition( | ||||
|                 } | ||||
|  | ||||
|             //--- Find number of samples per spreading code ------------------------- | ||||
|             code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GPS_L5i_CODE_RATE_HZ / GPS_L5i_CODE_LENGTH_CHIPS))); | ||||
|             code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GPS_L5I_CODE_RATE_HZ / GPS_L5I_CODE_LENGTH_CHIPS))); | ||||
|             acq_parameters_.samples_per_ms = static_cast<float>(acq_parameters_.resampled_fs) * 0.001; | ||||
|             acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GPS_L5i_CODE_RATE_HZ) * static_cast<float>(acq_parameters_.resampled_fs))); | ||||
|             acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GPS_L5I_CODE_RATE_HZ) * static_cast<float>(acq_parameters_.resampled_fs))); | ||||
|         } | ||||
|     else | ||||
|         { | ||||
|             acq_parameters_.resampled_fs = fs_in_; | ||||
|             //--- Find number of samples per spreading code ------------------------- | ||||
|             code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (GPS_L5i_CODE_RATE_HZ / GPS_L5i_CODE_LENGTH_CHIPS))); | ||||
|             code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (GPS_L5I_CODE_RATE_HZ / GPS_L5I_CODE_LENGTH_CHIPS))); | ||||
|             acq_parameters_.samples_per_ms = static_cast<float>(fs_in_) * 0.001; | ||||
|             acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GPS_L5i_CODE_RATE_HZ) * static_cast<float>(acq_parameters_.fs_in))); | ||||
|             acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GPS_L5I_CODE_RATE_HZ) * static_cast<float>(acq_parameters_.fs_in))); | ||||
|         } | ||||
|  | ||||
|     acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast<float>(GPS_L5i_PERIOD * 1000.0); | ||||
|     acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast<float>(GPS_L5I_PERIOD * 1000.0); | ||||
|     vector_length_ = std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2 : 1); | ||||
|     code_ = new gr_complex[vector_length_]; | ||||
|     acquisition_ = pcps_make_acquisition(acq_parameters_); | ||||
|   | ||||
| @@ -89,7 +89,7 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga( | ||||
|     //dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); | ||||
|     //acq_parameters.dump_filename = dump_filename_; | ||||
|     //--- Find number of samples per spreading code ------------------------- | ||||
|     auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / (GPS_L5i_CODE_RATE_HZ / static_cast<double>(GPS_L5i_CODE_LENGTH_CHIPS)))); | ||||
|     auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / (GPS_L5I_CODE_RATE_HZ / static_cast<double>(GPS_L5I_CODE_LENGTH_CHIPS)))); | ||||
|     acq_parameters.code_length = code_length; | ||||
|     // The FPGA can only use FFT lengths that are a power of two. | ||||
|     float nbits = ceilf(log2f((float)code_length)); | ||||
|   | ||||
| @@ -64,15 +64,15 @@ list(SORT ACQ_GR_BLOCKS_SOURCES) | ||||
|  | ||||
| source_group(Headers FILES ${ACQ_GR_BLOCKS_HEADERS}) | ||||
|  | ||||
| add_library(acq_gr_blocks ${ACQ_GR_BLOCKS_SOURCES} ${ACQ_GR_BLOCKS_HEADERS}) | ||||
| add_library(acquisition_gr_blocks ${ACQ_GR_BLOCKS_SOURCES} ${ACQ_GR_BLOCKS_HEADERS}) | ||||
|  | ||||
| target_link_libraries(acq_gr_blocks | ||||
| target_link_libraries(acquisition_gr_blocks | ||||
|     PUBLIC | ||||
|         Gnuradio::runtime | ||||
|         Gnuradio::fft | ||||
|         Volk::volk | ||||
|         gnss_system_parameters | ||||
|         acquisition_lib | ||||
|         acquisition_libs | ||||
|         core_system_parameters | ||||
|         ${OPT_LIBRARIES} | ||||
|     PRIVATE | ||||
|         Boost::filesystem | ||||
| @@ -80,17 +80,30 @@ target_link_libraries(acq_gr_blocks | ||||
|         Glog::glog | ||||
|         Matio::matio | ||||
|         Volkgnsssdr::volkgnsssdr | ||||
|         gnss_sp_libs | ||||
|         gnss_rx | ||||
|         algorithms_libs | ||||
| ) | ||||
|  | ||||
| target_include_directories(acquisition_gr_blocks | ||||
|     PUBLIC | ||||
|         ${CMAKE_SOURCE_DIR}/src/algorithms/libs | ||||
|     PRIVATE | ||||
|         ${CMAKE_SOURCE_DIR}/src/core/receiver | ||||
| ) | ||||
|  | ||||
| if(OPENCL_FOUND) | ||||
|     target_include_directories(acq_gr_blocks PUBLIC ${OPENCL_INCLUDE_DIRS}) | ||||
|     target_include_directories(acquisition_gr_blocks PUBLIC ${OPENCL_INCLUDE_DIRS}) | ||||
| endif() | ||||
|  | ||||
| target_include_directories(acq_gr_blocks PUBLIC ${CMAKE_SOURCE_DIR}/src/algorithms/libs) | ||||
| if(ENABLE_CLANG_TIDY) | ||||
|     if(CLANG_TIDY_EXE) | ||||
|         set_target_properties(acquisition_gr_blocks | ||||
|             PROPERTIES | ||||
|                 CXX_CLANG_TIDY "${DO_CLANG_TIDY}" | ||||
|         ) | ||||
|     endif() | ||||
| endif() | ||||
|  | ||||
| set_property(TARGET acq_gr_blocks | ||||
| set_property(TARGET acquisition_gr_blocks | ||||
|     APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES | ||||
|         $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> | ||||
| ) | ||||
|   | ||||
| @@ -36,11 +36,11 @@ | ||||
|  */ | ||||
|  | ||||
| #include "galileo_e5a_noncoherent_iq_acquisition_caf_cc.h" | ||||
| #include "control_message_factory.h" | ||||
| #include <glog/logging.h> | ||||
| #include <gnuradio/io_signature.h> | ||||
| #include <volk/volk.h> | ||||
| #include <volk_gnsssdr/volk_gnsssdr.h> | ||||
| #include <exception> | ||||
| #include <sstream> | ||||
| #include <utility> | ||||
|  | ||||
| @@ -214,9 +214,20 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc::~galileo_e5a_noncoherentIQ_acquisi | ||||
|     delete d_fft_if; | ||||
|     delete d_ifft; | ||||
|  | ||||
|     if (d_dump) | ||||
|     try | ||||
|         { | ||||
|             d_dump_file.close(); | ||||
|             if (d_dump) | ||||
|                 { | ||||
|                     d_dump_file.close(); | ||||
|                 } | ||||
|         } | ||||
|     catch (const std::ofstream::failure &e) | ||||
|         { | ||||
|             std::cerr << "Problem closing Acquisition dump file: " << d_dump_filename << '\n'; | ||||
|         } | ||||
|     catch (const std::exception &e) | ||||
|         { | ||||
|             std::cerr << e.what() << '\n'; | ||||
|         } | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -47,7 +47,7 @@ | ||||
|  | ||||
| class galileo_e5a_noncoherentIQ_acquisition_caf_cc; | ||||
|  | ||||
| typedef boost::shared_ptr<galileo_e5a_noncoherentIQ_acquisition_caf_cc> galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr; | ||||
| using galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr = boost::shared_ptr<galileo_e5a_noncoherentIQ_acquisition_caf_cc>; | ||||
|  | ||||
| galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr | ||||
| galileo_e5a_noncoherentIQ_make_acquisition_caf_cc(unsigned int sampled_ms, | ||||
|   | ||||
| @@ -30,11 +30,11 @@ | ||||
|  */ | ||||
|  | ||||
| #include "galileo_pcps_8ms_acquisition_cc.h" | ||||
| #include "control_message_factory.h" | ||||
| #include <glog/logging.h> | ||||
| #include <gnuradio/io_signature.h> | ||||
| #include <volk/volk.h> | ||||
| #include <volk_gnsssdr/volk_gnsssdr.h> | ||||
| #include <exception> | ||||
| #include <sstream> | ||||
| #include <utility> | ||||
|  | ||||
| @@ -54,6 +54,7 @@ galileo_pcps_8ms_acquisition_cc_sptr galileo_pcps_8ms_make_acquisition_cc( | ||||
|             samples_per_code, dump, std::move(dump_filename))); | ||||
| } | ||||
|  | ||||
|  | ||||
| galileo_pcps_8ms_acquisition_cc::galileo_pcps_8ms_acquisition_cc( | ||||
|     uint32_t sampled_ms, | ||||
|     uint32_t max_dwells, | ||||
| @@ -126,9 +127,20 @@ galileo_pcps_8ms_acquisition_cc::~galileo_pcps_8ms_acquisition_cc() | ||||
|     delete d_ifft; | ||||
|     delete d_fft_if; | ||||
|  | ||||
|     if (d_dump) | ||||
|     try | ||||
|         { | ||||
|             d_dump_file.close(); | ||||
|             if (d_dump) | ||||
|                 { | ||||
|                     d_dump_file.close(); | ||||
|                 } | ||||
|         } | ||||
|     catch (const std::ofstream::failure &e) | ||||
|         { | ||||
|             std::cerr << "Problem closing Acquisition dump file: " << d_dump_filename << '\n'; | ||||
|         } | ||||
|     catch (const std::exception &e) | ||||
|         { | ||||
|             std::cerr << e.what() << '\n'; | ||||
|         } | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -41,7 +41,7 @@ | ||||
|  | ||||
| class galileo_pcps_8ms_acquisition_cc; | ||||
|  | ||||
| typedef boost::shared_ptr<galileo_pcps_8ms_acquisition_cc> galileo_pcps_8ms_acquisition_cc_sptr; | ||||
| using galileo_pcps_8ms_acquisition_cc_sptr = boost::shared_ptr<galileo_pcps_8ms_acquisition_cc>; | ||||
|  | ||||
| galileo_pcps_8ms_acquisition_cc_sptr | ||||
| galileo_pcps_8ms_make_acquisition_cc(uint32_t sampled_ms, | ||||
|   | ||||
| @@ -317,7 +317,10 @@ void pcps_acquisition::init() | ||||
|     d_num_doppler_bins = static_cast<uint32_t>(std::ceil(static_cast<double>(static_cast<int32_t>(acq_parameters.doppler_max) - static_cast<int32_t>(-acq_parameters.doppler_max)) / static_cast<double>(d_doppler_step))); | ||||
|  | ||||
|     // Create the carrier Doppler wipeoff signals | ||||
|     if (d_grid_doppler_wipeoffs == nullptr) d_grid_doppler_wipeoffs = new gr_complex*[d_num_doppler_bins]; | ||||
|     if (d_grid_doppler_wipeoffs == nullptr) | ||||
|         { | ||||
|             d_grid_doppler_wipeoffs = new gr_complex*[d_num_doppler_bins]; | ||||
|         } | ||||
|     if (acq_parameters.make_2_steps && (d_grid_doppler_wipeoffs_step_two == nullptr)) | ||||
|         { | ||||
|             d_grid_doppler_wipeoffs_step_two = new gr_complex*[d_num_doppler_bins_step2]; | ||||
| @@ -629,7 +632,10 @@ float pcps_acquisition::first_vs_second_peak_statistic(uint32_t& indext, int32_t | ||||
|         { | ||||
|             d_tmp_buffer[idx] = 0.0; | ||||
|             idx++; | ||||
|             if (idx == static_cast<int32_t>(d_fft_size)) idx = 0; | ||||
|             if (idx == static_cast<int32_t>(d_fft_size)) | ||||
|                 { | ||||
|                     idx = 0; | ||||
|                 } | ||||
|         } | ||||
|     while (idx != excludeRangeIndex2); | ||||
|  | ||||
| @@ -842,7 +848,10 @@ void pcps_acquisition::acquisition_core(uint64_t samp_count) | ||||
|  | ||||
|             if (d_num_noncoherent_integrations_counter == acq_parameters.max_dwells) | ||||
|                 { | ||||
|                     if (d_state != 0) send_negative_acquisition(); | ||||
|                     if (d_state != 0) | ||||
|                         { | ||||
|                             send_negative_acquisition(); | ||||
|                         } | ||||
|                     d_state = 0; | ||||
|                     d_active = false; | ||||
|                     d_step_two = false; | ||||
|   | ||||
| @@ -63,7 +63,7 @@ | ||||
|  | ||||
| class pcps_acquisition; | ||||
|  | ||||
| typedef boost::shared_ptr<pcps_acquisition> pcps_acquisition_sptr; | ||||
| using pcps_acquisition_sptr = boost::shared_ptr<pcps_acquisition>; | ||||
|  | ||||
| pcps_acquisition_sptr | ||||
| pcps_make_acquisition(const Acq_Conf& conf_); | ||||
|   | ||||
| @@ -32,7 +32,6 @@ | ||||
|  | ||||
| #include "pcps_acquisition_fine_doppler_cc.h" | ||||
| #include "GPS_L1_CA.h" | ||||
| #include "control_message_factory.h" | ||||
| #include "gnss_sdr_create_directory.h" | ||||
| #include "gps_sdr_signal_processing.h" | ||||
| #include <boost/filesystem/path.hpp> | ||||
| @@ -314,7 +313,10 @@ double pcps_acquisition_fine_doppler_cc::compute_CAF() | ||||
|         { | ||||
|             d_grid_data[index_doppler][idx] = 0.0; | ||||
|             idx++; | ||||
|             if (idx == static_cast<int>(d_fft_size)) idx = 0; | ||||
|             if (idx == static_cast<int>(d_fft_size)) | ||||
|                 { | ||||
|                     idx = 0; | ||||
|                 } | ||||
|         } | ||||
|     while (idx != excludeRangeIndex2); | ||||
|  | ||||
|   | ||||
| @@ -55,13 +55,13 @@ | ||||
| #include <gnuradio/block.h> | ||||
| #include <gnuradio/fft/fft.h> | ||||
| #include <gnuradio/gr_complex.h> | ||||
| #include <cstdint> | ||||
| #include <fstream> | ||||
| #include <string> | ||||
|  | ||||
| class pcps_acquisition_fine_doppler_cc; | ||||
|  | ||||
| typedef boost::shared_ptr<pcps_acquisition_fine_doppler_cc> | ||||
|     pcps_acquisition_fine_doppler_cc_sptr; | ||||
| using pcps_acquisition_fine_doppler_cc_sptr = boost::shared_ptr<pcps_acquisition_fine_doppler_cc>; | ||||
|  | ||||
| pcps_acquisition_fine_doppler_cc_sptr | ||||
| pcps_make_acquisition_fine_doppler_cc(const Acq_Conf& conf_); | ||||
| @@ -87,7 +87,7 @@ private: | ||||
|     bool start(); | ||||
|  | ||||
|     Acq_Conf acq_parameters; | ||||
|     long d_fs_in; | ||||
|     int64_t d_fs_in; | ||||
|     int d_samples_per_ms; | ||||
|     int d_max_dwells; | ||||
|     int d_gnuradio_forecast_samples; | ||||
|   | ||||
| @@ -33,16 +33,16 @@ | ||||
| #include "pcps_assisted_acquisition_cc.h" | ||||
| #include "GPS_L1_CA.h" | ||||
| #include "concurrent_map.h" | ||||
| #include "control_message_factory.h" | ||||
| #include "gps_acq_assist.h" | ||||
| #include <glog/logging.h> | ||||
| #include <gnuradio/io_signature.h> | ||||
| #include <volk/volk.h> | ||||
| #include <volk_gnsssdr/volk_gnsssdr.h> | ||||
| #include <exception> | ||||
| #include <sstream> | ||||
| #include <utility> | ||||
|  | ||||
| extern concurrent_map<Gps_Acq_Assist> global_gps_acq_assist_map; | ||||
| extern Concurrent_Map<Gps_Acq_Assist> global_gps_acq_assist_map; | ||||
|  | ||||
| using google::LogMessage; | ||||
|  | ||||
| @@ -132,9 +132,20 @@ pcps_assisted_acquisition_cc::~pcps_assisted_acquisition_cc() | ||||
|     volk_gnsssdr_free(d_fft_codes); | ||||
|     delete d_ifft; | ||||
|     delete d_fft_if; | ||||
|     if (d_dump) | ||||
|     try | ||||
|         { | ||||
|             d_dump_file.close(); | ||||
|             if (d_dump) | ||||
|                 { | ||||
|                     d_dump_file.close(); | ||||
|                 } | ||||
|         } | ||||
|     catch (const std::ofstream::failure &e) | ||||
|         { | ||||
|             std::cerr << "Problem closing Acquisition dump file: " << d_dump_filename << '\n'; | ||||
|         } | ||||
|     catch (const std::exception &e) | ||||
|         { | ||||
|             std::cerr << e.what() << '\n'; | ||||
|         } | ||||
| } | ||||
|  | ||||
| @@ -381,7 +392,10 @@ int pcps_assisted_acquisition_cc::general_work(int noutput_items, | ||||
|     switch (d_state) | ||||
|         { | ||||
|         case 0:  // S0. StandBy | ||||
|             if (d_active == true) d_state = 1; | ||||
|             if (d_active == true) | ||||
|                 { | ||||
|                     d_state = 1; | ||||
|                 } | ||||
|             d_sample_counter += static_cast<uint64_t>(ninput_items[0]);  // sample counter | ||||
|             consume_each(ninput_items[0]); | ||||
|             break; | ||||
|   | ||||
| @@ -57,8 +57,7 @@ | ||||
|  | ||||
| class pcps_assisted_acquisition_cc; | ||||
|  | ||||
| typedef boost::shared_ptr<pcps_assisted_acquisition_cc> | ||||
|     pcps_assisted_acquisition_cc_sptr; | ||||
| using pcps_assisted_acquisition_cc_sptr = boost::shared_ptr<pcps_assisted_acquisition_cc>; | ||||
|  | ||||
| pcps_assisted_acquisition_cc_sptr | ||||
| pcps_make_assisted_acquisition_cc( | ||||
|   | ||||
| @@ -36,11 +36,11 @@ | ||||
|  | ||||
| #include "pcps_cccwsr_acquisition_cc.h" | ||||
| #include "GPS_L1_CA.h"  // GPS_TWO_PI | ||||
| #include "control_message_factory.h" | ||||
| #include <glog/logging.h> | ||||
| #include <gnuradio/io_signature.h> | ||||
| #include <volk/volk.h> | ||||
| #include <volk_gnsssdr/volk_gnsssdr.h> | ||||
| #include <exception> | ||||
| #include <sstream> | ||||
| #include <utility> | ||||
|  | ||||
| @@ -118,6 +118,7 @@ pcps_cccwsr_acquisition_cc::pcps_cccwsr_acquisition_cc( | ||||
|     d_channel = 0; | ||||
| } | ||||
|  | ||||
|  | ||||
| pcps_cccwsr_acquisition_cc::~pcps_cccwsr_acquisition_cc() | ||||
| { | ||||
|     if (d_num_doppler_bins > 0) | ||||
| @@ -140,12 +141,24 @@ pcps_cccwsr_acquisition_cc::~pcps_cccwsr_acquisition_cc() | ||||
|     delete d_ifft; | ||||
|     delete d_fft_if; | ||||
|  | ||||
|     if (d_dump) | ||||
|     try | ||||
|         { | ||||
|             d_dump_file.close(); | ||||
|             if (d_dump) | ||||
|                 { | ||||
|                     d_dump_file.close(); | ||||
|                 } | ||||
|         } | ||||
|     catch (const std::ofstream::failure &e) | ||||
|         { | ||||
|             std::cerr << "Problem closing Acquisition dump file: " << d_dump_filename << '\n'; | ||||
|         } | ||||
|     catch (const std::exception &e) | ||||
|         { | ||||
|             std::cerr << e.what() << '\n'; | ||||
|         } | ||||
| } | ||||
|  | ||||
|  | ||||
| void pcps_cccwsr_acquisition_cc::set_local_code(std::complex<float> *code_data, | ||||
|     std::complex<float> *code_pilot) | ||||
| { | ||||
| @@ -166,6 +179,7 @@ void pcps_cccwsr_acquisition_cc::set_local_code(std::complex<float> *code_data, | ||||
|     volk_32fc_conjugate_32fc(d_fft_code_pilot, d_fft_if->get_outbuf(), d_fft_size); | ||||
| } | ||||
|  | ||||
|  | ||||
| void pcps_cccwsr_acquisition_cc::init() | ||||
| { | ||||
|     d_gnss_synchro->Flag_valid_acquisition = false; | ||||
|   | ||||
| @@ -47,7 +47,7 @@ | ||||
|  | ||||
| class pcps_cccwsr_acquisition_cc; | ||||
|  | ||||
| typedef boost::shared_ptr<pcps_cccwsr_acquisition_cc> pcps_cccwsr_acquisition_cc_sptr; | ||||
| using pcps_cccwsr_acquisition_cc_sptr = boost::shared_ptr<pcps_cccwsr_acquisition_cc>; | ||||
|  | ||||
| pcps_cccwsr_acquisition_cc_sptr | ||||
| pcps_cccwsr_make_acquisition_cc( | ||||
|   | ||||
| @@ -50,7 +50,6 @@ | ||||
|  | ||||
| #include "pcps_opencl_acquisition_cc.h" | ||||
| #include "GPS_L1_CA.h"  //GPS_TWO_PI | ||||
| #include "control_message_factory.h" | ||||
| #include "opencl/fft_base_kernels.h" | ||||
| #include "opencl/fft_internal.h" | ||||
| #include <glog/logging.h> | ||||
| @@ -58,6 +57,7 @@ | ||||
| #include <volk/volk.h> | ||||
| #include <volk_gnsssdr/volk_gnsssdr.h> | ||||
| #include <algorithm> | ||||
| #include <exception> | ||||
| #include <fstream> | ||||
| #include <iostream> | ||||
| #include <sstream> | ||||
| @@ -187,9 +187,20 @@ pcps_opencl_acquisition_cc::~pcps_opencl_acquisition_cc() | ||||
|             delete d_fft_if; | ||||
|         } | ||||
|  | ||||
|     if (d_dump) | ||||
|     try | ||||
|         { | ||||
|             d_dump_file.close(); | ||||
|             if (d_dump) | ||||
|                 { | ||||
|                     d_dump_file.close(); | ||||
|                 } | ||||
|         } | ||||
|     catch (const std::ofstream::failure &e) | ||||
|         { | ||||
|             std::cerr << "Problem closing Acquisition dump file: " << d_dump_filename << '\n'; | ||||
|         } | ||||
|     catch (const std::exception &e) | ||||
|         { | ||||
|             std::cerr << e.what() << '\n'; | ||||
|         } | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -30,12 +30,12 @@ | ||||
|  | ||||
| #include "pcps_quicksync_acquisition_cc.h" | ||||
| #include "GPS_L1_CA.h" | ||||
| #include "control_message_factory.h" | ||||
| #include <glog/logging.h> | ||||
| #include <gnuradio/io_signature.h> | ||||
| #include <volk/volk.h> | ||||
| #include <volk_gnsssdr/volk_gnsssdr.h> | ||||
| #include <cmath> | ||||
| #include <exception> | ||||
| #include <sstream> | ||||
| #include <utility> | ||||
|  | ||||
| @@ -159,11 +159,21 @@ pcps_quicksync_acquisition_cc::~pcps_quicksync_acquisition_cc() | ||||
|     delete d_corr_output_f; | ||||
|     delete[] d_code_folded; | ||||
|  | ||||
|     if (d_dump) | ||||
|     try | ||||
|         { | ||||
|             d_dump_file.close(); | ||||
|             if (d_dump) | ||||
|                 { | ||||
|                     d_dump_file.close(); | ||||
|                 } | ||||
|         } | ||||
|     catch (const std::ofstream::failure& e) | ||||
|         { | ||||
|             std::cerr << "Problem closing Acquisition dump file: " << d_dump_filename << '\n'; | ||||
|         } | ||||
|     catch (const std::exception& e) | ||||
|         { | ||||
|             std::cerr << e.what() << '\n'; | ||||
|         } | ||||
|     // DLOG(INFO) << "END DESTROYER"; | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -208,7 +218,10 @@ void pcps_quicksync_acquisition_cc::init() | ||||
|     d_mag = 0.0; | ||||
|     d_input_power = 0.0; | ||||
|  | ||||
|     if (d_doppler_step == 0) d_doppler_step = 250; | ||||
|     if (d_doppler_step == 0) | ||||
|         { | ||||
|             d_doppler_step = 250; | ||||
|         } | ||||
|  | ||||
|     // Count the number of bins | ||||
|     d_num_doppler_bins = 0; | ||||
| @@ -535,7 +548,10 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items, | ||||
|                 DLOG(INFO) << "test statistics threshold " << d_threshold; | ||||
|                 DLOG(INFO) << "folding factor " << d_folding_factor; | ||||
|                 DLOG(INFO) << "possible delay correlation output"; | ||||
|                 for (int32_t i = 0; i < static_cast<int32_t>(d_folding_factor); i++) DLOG(INFO) << d_possible_delay[i] << "\t\t\t" << d_corr_output_f[i]; | ||||
|                 for (int32_t i = 0; i < static_cast<int32_t>(d_folding_factor); i++) | ||||
|                     { | ||||
|                         DLOG(INFO) << d_possible_delay[i] << "\t\t\t" << d_corr_output_f[i]; | ||||
|                     } | ||||
|                 DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; | ||||
|                 DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; | ||||
|                 DLOG(INFO) << "magnitude folded " << d_mag; | ||||
| @@ -564,7 +580,10 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items, | ||||
|                 DLOG(INFO) << "test statistics threshold " << d_threshold; | ||||
|                 DLOG(INFO) << "folding factor " << d_folding_factor; | ||||
|                 DLOG(INFO) << "possible delay    corr output"; | ||||
|                 for (int32_t i = 0; i < static_cast<int32_t>(d_folding_factor); i++) DLOG(INFO) << d_possible_delay[i] << "\t\t\t" << d_corr_output_f[i]; | ||||
|                 for (int32_t i = 0; i < static_cast<int32_t>(d_folding_factor); i++) | ||||
|                     { | ||||
|                         DLOG(INFO) << d_possible_delay[i] << "\t\t\t" << d_corr_output_f[i]; | ||||
|                     } | ||||
|                 DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; | ||||
|                 DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; | ||||
|                 DLOG(INFO) << "magnitude folded " << d_mag; | ||||
|   | ||||
| @@ -63,8 +63,7 @@ | ||||
|  | ||||
| class pcps_quicksync_acquisition_cc; | ||||
|  | ||||
| typedef boost::shared_ptr<pcps_quicksync_acquisition_cc> | ||||
|     pcps_quicksync_acquisition_cc_sptr; | ||||
| using pcps_quicksync_acquisition_cc_sptr = boost::shared_ptr<pcps_quicksync_acquisition_cc>; | ||||
|  | ||||
| pcps_quicksync_acquisition_cc_sptr | ||||
| pcps_quicksync_make_acquisition_cc( | ||||
|   | ||||
| @@ -50,11 +50,11 @@ | ||||
|  | ||||
| #include "pcps_tong_acquisition_cc.h" | ||||
| #include "GPS_L1_CA.h"  // for GPS_TWO_PI | ||||
| #include "control_message_factory.h" | ||||
| #include <glog/logging.h> | ||||
| #include <gnuradio/io_signature.h> | ||||
| #include <volk/volk.h> | ||||
| #include <volk_gnsssdr/volk_gnsssdr.h> | ||||
| #include <exception> | ||||
| #include <sstream> | ||||
| #include <utility> | ||||
|  | ||||
| @@ -76,6 +76,7 @@ pcps_tong_acquisition_cc_sptr pcps_tong_make_acquisition_cc( | ||||
|             tong_init_val, tong_max_val, tong_max_dwells, dump, std::move(dump_filename))); | ||||
| } | ||||
|  | ||||
|  | ||||
| pcps_tong_acquisition_cc::pcps_tong_acquisition_cc( | ||||
|     uint32_t sampled_ms, | ||||
|     uint32_t doppler_max, | ||||
| @@ -153,12 +154,24 @@ pcps_tong_acquisition_cc::~pcps_tong_acquisition_cc() | ||||
|     delete d_ifft; | ||||
|     delete d_fft_if; | ||||
|  | ||||
|     if (d_dump) | ||||
|     try | ||||
|         { | ||||
|             d_dump_file.close(); | ||||
|             if (d_dump) | ||||
|                 { | ||||
|                     d_dump_file.close(); | ||||
|                 } | ||||
|         } | ||||
|     catch (const std::ofstream::failure &e) | ||||
|         { | ||||
|             std::cerr << "Problem closing Acquisition dump file: " << d_dump_filename << '\n'; | ||||
|         } | ||||
|     catch (const std::exception &e) | ||||
|         { | ||||
|             std::cerr << e.what() << '\n'; | ||||
|         } | ||||
| } | ||||
|  | ||||
|  | ||||
| void pcps_tong_acquisition_cc::set_local_code(std::complex<float> *code) | ||||
| { | ||||
|     memcpy(d_fft_if->get_inbuf(), code, sizeof(gr_complex) * d_fft_size); | ||||
| @@ -169,6 +182,7 @@ void pcps_tong_acquisition_cc::set_local_code(std::complex<float> *code) | ||||
|     volk_32fc_conjugate_32fc(d_fft_codes, d_fft_if->get_outbuf(), d_fft_size); | ||||
| } | ||||
|  | ||||
|  | ||||
| void pcps_tong_acquisition_cc::init() | ||||
| { | ||||
|     d_gnss_synchro->Flag_valid_acquisition = false; | ||||
| @@ -213,6 +227,7 @@ void pcps_tong_acquisition_cc::init() | ||||
|         } | ||||
| } | ||||
|  | ||||
|  | ||||
| void pcps_tong_acquisition_cc::set_state(int32_t state) | ||||
| { | ||||
|     d_state = state; | ||||
| @@ -245,6 +260,7 @@ void pcps_tong_acquisition_cc::set_state(int32_t state) | ||||
|         } | ||||
| } | ||||
|  | ||||
|  | ||||
| int pcps_tong_acquisition_cc::general_work(int noutput_items, | ||||
|     gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, | ||||
|     gr_vector_void_star &output_items __attribute__((unused))) | ||||
|   | ||||
| @@ -61,7 +61,7 @@ | ||||
|  | ||||
| class pcps_tong_acquisition_cc; | ||||
|  | ||||
| typedef boost::shared_ptr<pcps_tong_acquisition_cc> pcps_tong_acquisition_cc_sptr; | ||||
| using pcps_tong_acquisition_cc_sptr = boost::shared_ptr<pcps_tong_acquisition_cc>; | ||||
|  | ||||
| pcps_tong_acquisition_cc_sptr | ||||
| pcps_tong_make_acquisition_cc( | ||||
|   | ||||
| @@ -29,24 +29,32 @@ list(SORT ACQUISITION_LIB_SOURCES) | ||||
|  | ||||
| source_group(Headers FILES ${ACQUISITION_LIB_HEADERS}) | ||||
|  | ||||
| add_library(acquisition_lib | ||||
| add_library(acquisition_libs | ||||
|     ${ACQUISITION_LIB_SOURCES} | ||||
|     ${ACQUISITION_LIB_HEADERS} | ||||
| ) | ||||
|  | ||||
| target_link_libraries(acquisition_lib | ||||
| target_link_libraries(acquisition_libs | ||||
|     PUBLIC | ||||
|         Volk::volk | ||||
|         Gnuradio::fft | ||||
|     PRIVATE | ||||
|         Gflags::gflags | ||||
|         Glog::glog | ||||
|         gnss_system_parameters | ||||
|         gnss_rx | ||||
|         gnss_sp_libs | ||||
|         algorithms_libs | ||||
|         core_system_parameters | ||||
| ) | ||||
|  | ||||
| set_property(TARGET acquisition_lib | ||||
| if(ENABLE_CLANG_TIDY) | ||||
|     if(CLANG_TIDY_EXE) | ||||
|         set_target_properties(acquisition_libs | ||||
|             PROPERTIES | ||||
|                 CXX_CLANG_TIDY "${DO_CLANG_TIDY}" | ||||
|         ) | ||||
|     endif() | ||||
| endif() | ||||
|  | ||||
| set_property(TARGET acquisition_libs | ||||
|     APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES | ||||
|         $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> | ||||
| ) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Damian Miralles
					Damian Miralles