diff --git a/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.cc index f8e66a09d..a0e6646c4 100644 --- a/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.cc @@ -32,9 +32,10 @@ #if HAS_STD_SPAN #include +namespace own = std; #else #include -using std::span = gsl::span; +namespace own = gsl; #endif @@ -147,7 +148,7 @@ void BeidouB1iPcpsAcquisition::set_local_code() beidou_b1i_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0); - std::span code_span(code_.data(), vector_length_); + own::span code_span(code_.data(), vector_length_); for (unsigned int i = 0; i < num_codes_; i++) { std::copy_n(code.data(), code_length_, code_span.subspan(i * code_length_, code_length_).data()); diff --git a/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.cc index 065f771a6..c5b614f39 100644 --- a/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.cc @@ -29,9 +29,10 @@ #if HAS_STD_SPAN #include +namespace own = std; #else #include -using std::span = gsl::span; +namespace own = gsl; #endif using google::LogMessage; @@ -144,7 +145,7 @@ void BeidouB3iPcpsAcquisition::set_local_code() beidou_b3i_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0); - std::span code_span(code_.data(), vector_length_); + own::span code_span(code_.data(), vector_length_); for (unsigned int i = 0; i < num_codes_; i++) { std::copy_n(code.data(), code_length_, code_span.subspan(i * code_length_, code_length_).data()); diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc index a8958f635..f4386e1c3 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc @@ -29,9 +29,10 @@ #if HAS_STD_SPAN #include +namespace own = std; #else #include -using std::span = gsl::span; +namespace own = gsl; #endif GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition( @@ -214,7 +215,7 @@ void GalileoE1Pcps8msAmbiguousAcquisition::set_local_code() galileo_e1_code_gen_complex_sampled(code, Signal_, cboc, gnss_synchro_->PRN, fs_in_, 0, false); - std::span code_span(code_.data(), vector_length_); + own::span code_span(code_.data(), vector_length_); for (unsigned int i = 0; i < sampled_ms_ / 4; i++) { std::copy_n(code.data(), code_length_, code_span.subspan(i * code_length_, code_length_).data()); diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc index dfe71a321..d625c9fb4 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc @@ -30,9 +30,10 @@ #if HAS_STD_SPAN #include +namespace own = std; #else #include -using std::span = gsl::span; +namespace own = gsl; #endif GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition( @@ -188,7 +189,7 @@ void GalileoE1PcpsAmbiguousAcquisition::set_local_code() } } - std::span code__span(code_.data(), vector_length_); + own::span code__span(code_.data(), vector_length_); for (unsigned int i = 0; i < sampled_ms_ / 4; i++) { std::copy_n(code.data(), code_length_, code__span.subspan(i * code_length_, code_length_).data()); diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc index ae47b0351..e0ae0ccdb 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc @@ -29,9 +29,10 @@ #if HAS_STD_SPAN #include +namespace own = std; #else #include -using std::span = gsl::span; +namespace own = gsl; #endif GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcquisition( @@ -248,7 +249,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_local_code() galileo_e1_code_gen_complex_sampled(code, Signal_, cboc, gnss_synchro_->PRN, fs_in_, 0, false); - std::span code_span(code_.data(), vector_length_); + own::span code_span(code_.data(), vector_length_); for (unsigned int i = 0; i < (sampled_ms_ / (folding_factor_ * 4)); i++) { std::copy_n(code.data(), code_length_, code_span.subspan(i * code_length_, code_length_).data()); diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc index 02b6bd8d3..37a844970 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc @@ -29,9 +29,10 @@ #if HAS_STD_SPAN #include +namespace own = std; #else #include -using std::span = gsl::span; +namespace own = gsl; #endif GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition( @@ -217,7 +218,7 @@ void GalileoE1PcpsTongAmbiguousAcquisition::set_local_code() galileo_e1_code_gen_complex_sampled(code, Signal_, cboc, gnss_synchro_->PRN, fs_in_, 0, false); - std::span code_span(code_.data(), vector_length_); + own::span code_span(code_.data(), vector_length_); for (unsigned int i = 0; i < sampled_ms_ / 4; i++) { std::copy_n(code.data(), code_length_, code_span.subspan(i * code_length_, code_length_).data()); diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc index fbeb8ca64..fc1ff0f51 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc @@ -35,9 +35,10 @@ #if HAS_STD_SPAN #include +namespace own = std; #else #include -using std::span = gsl::span; +namespace own = gsl; #endif GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf( @@ -232,8 +233,8 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_local_code() } // WARNING: 3ms are coherently integrated. Secondary sequence (1,1,1) // is generated, and modulated in the 'block'. - std::span codeQ_span(codeQ_.data(), vector_length_); - std::span codeI_span(codeI_.data(), vector_length_); + own::span codeQ_span(codeQ_.data(), vector_length_); + own::span codeI_span(codeI_.data(), vector_length_); if (Zero_padding == 0) // if no zero_padding { for (unsigned int i = 0; i < sampled_ms_; i++) diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc index 5a31ad0ee..af075c5a7 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc @@ -29,9 +29,10 @@ #if HAS_STD_SPAN #include +namespace own = std; #else #include -using std::span = gsl::span; +namespace own = gsl; #endif GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* configuration, @@ -172,7 +173,7 @@ void GalileoE5aPcpsAcquisition::set_local_code() { galileo_e5_a_code_gen_complex_sampled(code, signal_, gnss_synchro_->PRN, fs_in_, 0); } - std::span code_span(code_.data(), vector_length_); + own::span code_span(code_.data(), vector_length_); for (unsigned int i = 0; i < sampled_ms_; i++) { std::copy_n(code.data(), code_length_, code_span.subspan(i * code_length_, code_length_).data()); diff --git a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc index 0af7954ce..fd9a93a5a 100644 --- a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc @@ -31,9 +31,10 @@ #if HAS_STD_SPAN #include +namespace own = std; #else #include -using std::span = gsl::span; +namespace own = gsl; #endif GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition( @@ -148,7 +149,7 @@ void GlonassL1CaPcpsAcquisition::set_local_code() glonass_l1_ca_code_gen_complex_sampled(code, fs_in_, 0); - std::span code_span(code_.data(), vector_length_); + own::span code_span(code_.data(), vector_length_); for (unsigned int i = 0; i < sampled_ms_; i++) { std::copy_n(code.data(), code_length_, code_span.subspan(i * code_length_, code_length_).data()); diff --git a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc index 508152ffb..35e43680c 100644 --- a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc @@ -30,9 +30,10 @@ #if HAS_STD_SPAN #include +namespace own = std; #else #include -using std::span = gsl::span; +namespace own = gsl; #endif GlonassL2CaPcpsAcquisition::GlonassL2CaPcpsAcquisition( @@ -147,7 +148,7 @@ void GlonassL2CaPcpsAcquisition::set_local_code() glonass_l2_ca_code_gen_complex_sampled(code, fs_in_, 0); - std::span code_span(code_.data(), vector_length_); + own::span code_span(code_.data(), vector_length_); for (unsigned int i = 0; i < sampled_ms_; i++) { std::copy_n(code.data(), code_length_, code_span.subspan(i * code_length_, code_length_).data()); diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc index a5a65d26a..2f8a11150 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc @@ -33,12 +33,12 @@ #if HAS_STD_SPAN #include +namespace own = std; #else #include -using std::span = gsl::span; +namespace own = gsl; #endif - GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( ConfigurationInterface* configuration, const std::string& role, @@ -163,7 +163,7 @@ void GpsL1CaPcpsAcquisition::set_local_code() { gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, acq_parameters_.fs_in, 0); } - std::span code_span(code_.data(), vector_length_); + own::span code_span(code_.data(), vector_length_); for (unsigned int i = 0; i < sampled_ms_; i++) { std::copy_n(code.data(), code_length_, code_span.subspan(i * code_length_, code_length_).data()); diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.cc index 9627af978..2d0bc316c 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.cc @@ -29,9 +29,10 @@ #if HAS_STD_SPAN #include +namespace own = std; #else #include -using std::span = gsl::span; +namespace own = gsl; #endif GpsL1CaPcpsOpenClAcquisition::GpsL1CaPcpsOpenClAcquisition( @@ -204,7 +205,7 @@ void GpsL1CaPcpsOpenClAcquisition::set_local_code() gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0); - std::span code_span(code_.data(), vector_length_); + own::span code_span(code_.data(), vector_length_); for (unsigned int i = 0; i < sampled_ms_; i++) { std::copy_n(code.data(), code_length_, code_span.subspan(i * code_length_, code_length_).data()); diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc index aafc2d373..61a40ab9c 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc @@ -30,9 +30,10 @@ #if HAS_STD_SPAN #include +namespace own = std; #else #include -using std::span = gsl::span; +namespace own = gsl; #endif GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition( @@ -230,7 +231,7 @@ void GpsL1CaPcpsQuickSyncAcquisition::set_local_code() gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0); - std::span code_span(code_.data(), vector_length_); + own::span code_span(code_.data(), vector_length_); for (unsigned int i = 0; i < (sampled_ms_ / folding_factor_); i++) { std::copy_n(code.data(), code_length_, code_span.subspan(i * code_length_, code_length_).data()); diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc index 768cfc1b8..eb742c513 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc @@ -29,9 +29,10 @@ #if HAS_STD_SPAN #include +namespace own = std; #else #include -using std::span = gsl::span; +namespace own = gsl; #endif GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition( @@ -192,7 +193,7 @@ void GpsL1CaPcpsTongAcquisition::set_local_code() gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0); - std::span code_span(code_.data(), vector_length_); + own::span code_span(code_.data(), vector_length_); for (unsigned int i = 0; i < sampled_ms_; i++) { std::copy_n(code.data(), code_length_, code_span.subspan(i * code_length_, code_length_).data()); diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc index 23a7c6f8a..720cdccb2 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc @@ -31,9 +31,10 @@ #if HAS_STD_SPAN #include +namespace own = std; #else #include -using std::span = gsl::span; +namespace own = gsl; #endif GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition( @@ -162,7 +163,7 @@ void GpsL2MPcpsAcquisition::set_local_code() gps_l2c_m_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_); } - std::span code_span(code_.data(), vector_length_); + own::span code_span(code_.data(), vector_length_); for (unsigned int i = 0; i < num_codes_; i++) { std::copy_n(code.data(), code_length_, code_span.subspan(i * code_length_, code_length_).data()); diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc index a892f5f2d..e893d21a2 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc @@ -28,12 +28,12 @@ #include "gps_l5_signal.h" #include #include - #if HAS_STD_SPAN #include +namespace own = std; #else #include -using std::span = gsl::span; +namespace own = gsl; #endif GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition( @@ -164,7 +164,7 @@ void GpsL5iPcpsAcquisition::set_local_code() gps_l5i_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_); } - std::span code_span(code_.data(), vector_length_); + own::span code_span(code_.data(), vector_length_); for (unsigned int i = 0; i < num_codes_; i++) { std::copy_n(code.data(), code_length_, code_span.subspan(i * code_length_, code_length_).data()); diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc index 23a063b88..734951fe0 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc @@ -252,7 +252,7 @@ bool pcps_acquisition::is_fdma() } -void pcps_acquisition::update_local_carrier(std::span carrier_vector, float freq) +void pcps_acquisition::update_local_carrier(own::span carrier_vector, float freq) { float phase_step_rad; if (acq_parameters.use_automatic_resampler) diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h index 86ef450c9..4e8e4ca1b 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h @@ -64,9 +64,10 @@ #if HAS_STD_SPAN #include +namespace own = std; #else #include -using std::span = gsl::span; +namespace own = gsl; #endif #if GNURADIO_USES_STD_POINTERS @@ -262,7 +263,7 @@ private: Gnss_Synchro* d_gnss_synchro; arma::fmat grid_; arma::fmat narrow_grid_; - void update_local_carrier(std::span carrier_vector, float freq); + void update_local_carrier(own::span carrier_vector, float freq); void update_grid_doppler_wipeoffs(); void update_grid_doppler_wipeoffs_step2(); void acquisition_core(uint64_t samp_count); diff --git a/src/algorithms/libs/beidou_b1i_signal_processing.cc b/src/algorithms/libs/beidou_b1i_signal_processing.cc index f0b404459..1039e391f 100644 --- a/src/algorithms/libs/beidou_b1i_signal_processing.cc +++ b/src/algorithms/libs/beidou_b1i_signal_processing.cc @@ -26,7 +26,7 @@ const auto AUX_CEIL = [](float x) { return static_cast(static_cast((x) + 1)); }; -void beidou_b1i_code_gen_int(std::span _dest, int32_t _prn, uint32_t _chip_shift) +void beidou_b1i_code_gen_int(own::span _dest, int32_t _prn, uint32_t _chip_shift) { const uint32_t _code_length = 2046; std::bitset<_code_length> G1{}; @@ -101,12 +101,12 @@ void beidou_b1i_code_gen_int(std::span _dest, int32_t _prn, uint32_t _c } -void beidou_b1i_code_gen_float(std::span _dest, int32_t _prn, uint32_t _chip_shift) +void beidou_b1i_code_gen_float(own::span _dest, int32_t _prn, uint32_t _chip_shift) { const uint32_t _code_length = 2046; std::array b1i_code_int{}; - beidou_b1i_code_gen_int(std::span(b1i_code_int.data(), _code_length), _prn, _chip_shift); + beidou_b1i_code_gen_int(own::span(b1i_code_int.data(), _code_length), _prn, _chip_shift); for (uint32_t ii = 0; ii < _code_length; ++ii) { @@ -115,12 +115,12 @@ void beidou_b1i_code_gen_float(std::span _dest, int32_t _prn, uint32_t _c } -void beidou_b1i_code_gen_complex(std::span> _dest, int32_t _prn, uint32_t _chip_shift) +void beidou_b1i_code_gen_complex(own::span> _dest, int32_t _prn, uint32_t _chip_shift) { const uint32_t _code_length = 2046; std::array b1i_code_int{}; - beidou_b1i_code_gen_int(std::span(b1i_code_int.data(), _code_length), _prn, _chip_shift); + beidou_b1i_code_gen_int(own::span(b1i_code_int.data(), _code_length), _prn, _chip_shift); for (uint32_t ii = 0; ii < _code_length; ++ii) { @@ -132,7 +132,7 @@ void beidou_b1i_code_gen_complex(std::span> _dest, int32_t _ /* * Generates complex GPS L1 C/A code for the desired SV ID and sampled to specific sampling frequency */ -void beidou_b1i_code_gen_complex_sampled(std::span> _dest, uint32_t _prn, int32_t _fs, uint32_t _chip_shift) +void beidou_b1i_code_gen_complex_sampled(own::span> _dest, uint32_t _prn, int32_t _fs, uint32_t _chip_shift) { // This function is based on the GNU software GPS for MATLAB in the Kay Borre book std::array, 2046> _code{}; diff --git a/src/algorithms/libs/beidou_b1i_signal_processing.h b/src/algorithms/libs/beidou_b1i_signal_processing.h index c0cc9e964..d711f5c5c 100644 --- a/src/algorithms/libs/beidou_b1i_signal_processing.h +++ b/src/algorithms/libs/beidou_b1i_signal_processing.h @@ -26,24 +26,25 @@ #include #if HAS_STD_SPAN #include +namespace own = std; #else #include -using std::span = gsl::span; +namespace own = gsl; #endif //! Generates int32_t GPS L1 C/A code for the desired SV ID and code shift -void beidou_b1i_code_gen_int(std::span _dest, int32_t _prn, uint32_t _chip_shift); +void beidou_b1i_code_gen_int(own::span _dest, int32_t _prn, uint32_t _chip_shift); //! Generates float GPS L1 C/A code for the desired SV ID and code shift -void beidou_b1i_code_gen_float(std::span _dest, int32_t _prn, uint32_t _chip_shift); +void beidou_b1i_code_gen_float(own::span _dest, int32_t _prn, uint32_t _chip_shift); //! Generates complex GPS L1 C/A code for the desired SV ID and code shift, and sampled to specific sampling frequency -void beidou_b1i_code_gen_complex(std::span> _dest, int32_t _prn, uint32_t _chip_shift); +void beidou_b1i_code_gen_complex(own::span> _dest, int32_t _prn, uint32_t _chip_shift); //! Generates N complex GPS L1 C/A codes for the desired SV ID and code shift -void beidou_b1i_code_gen_complex_sampled(std::span> _dest, uint32_t _prn, int32_t _fs, uint32_t _chip_shift, uint32_t _ncodes); +void beidou_b1i_code_gen_complex_sampled(own::span> _dest, uint32_t _prn, int32_t _fs, uint32_t _chip_shift, uint32_t _ncodes); //! Generates complex GPS L1 C/A code for the desired SV ID and code shift -void beidou_b1i_code_gen_complex_sampled(std::span> _dest, uint32_t _prn, int32_t _fs, uint32_t _chip_shift); +void beidou_b1i_code_gen_complex_sampled(own::span> _dest, uint32_t _prn, int32_t _fs, uint32_t _chip_shift); #endif // GNSS_SDR_BEIDOU_B1I_SDR_SIGNAL_PROCESSING_H diff --git a/src/algorithms/libs/beidou_b3i_signal_processing.cc b/src/algorithms/libs/beidou_b3i_signal_processing.cc index 82543c7cf..61b59da35 100644 --- a/src/algorithms/libs/beidou_b3i_signal_processing.cc +++ b/src/algorithms/libs/beidou_b3i_signal_processing.cc @@ -26,7 +26,7 @@ const auto AUX_CEIL = [](float x) { return static_cast(static_cast((x) + 1)); }; -void beidou_b3i_code_gen_int(std::span _dest, int32_t _prn, uint32_t _chip_shift) +void beidou_b3i_code_gen_int(own::span _dest, int32_t _prn, uint32_t _chip_shift) { const uint32_t _code_length = 10230; std::bitset<_code_length> G1{}; @@ -168,7 +168,7 @@ void beidou_b3i_code_gen_int(std::span _dest, int32_t _prn, uint32_t _chip_ } -void beidou_b3i_code_gen_float(std::span _dest, int32_t _prn, uint32_t _chip_shift) +void beidou_b3i_code_gen_float(own::span _dest, int32_t _prn, uint32_t _chip_shift) { const uint32_t _code_length = 10230; std::array b3i_code_int{}; @@ -182,7 +182,7 @@ void beidou_b3i_code_gen_float(std::span _dest, int32_t _prn, uint32_t _c } -void beidou_b3i_code_gen_complex(std::span> _dest, int32_t _prn, uint32_t _chip_shift) +void beidou_b3i_code_gen_complex(own::span> _dest, int32_t _prn, uint32_t _chip_shift) { const uint32_t _code_length = 10230; std::array b3i_code_int{}; @@ -196,7 +196,7 @@ void beidou_b3i_code_gen_complex(std::span> _dest, int32_t _ } -void beidou_b3i_code_gen_complex_sampled(std::span> _dest, uint32_t _prn, int _fs, uint32_t _chip_shift) +void beidou_b3i_code_gen_complex_sampled(own::span> _dest, uint32_t _prn, int _fs, uint32_t _chip_shift) { // This function is based on the GNU software GPS for MATLAB in the Kay Borre book std::array, 10230> _code{}; diff --git a/src/algorithms/libs/beidou_b3i_signal_processing.h b/src/algorithms/libs/beidou_b3i_signal_processing.h index d5691cd98..3fd36de92 100644 --- a/src/algorithms/libs/beidou_b3i_signal_processing.h +++ b/src/algorithms/libs/beidou_b3i_signal_processing.h @@ -26,25 +26,26 @@ #include #if HAS_STD_SPAN #include +namespace own = std; #else #include -using std::span = gsl::span; +namespace own = gsl; #endif //! Generates int BeiDou B3I code for the desired SV ID and code shift -void beidou_b3i_code_gen_int(std::span _dest, int32_t _prn, uint32_t _chip_shift); +void beidou_b3i_code_gen_int(own::span _dest, int32_t _prn, uint32_t _chip_shift); //! Generates float BeiDou B3I code for the desired SV ID and code shift -void beidou_b3i_code_gen_float(std::span _dest, int32_t _prn, uint32_t _chip_shift); +void beidou_b3i_code_gen_float(own::span _dest, int32_t _prn, uint32_t _chip_shift); //! Generates complex BeiDou B3I code for the desired SV ID and code shift, and sampled to specific sampling frequency -void beidou_b3i_code_gen_complex(std::span> _dest, int32_t _prn, uint32_t _chip_shift); +void beidou_b3i_code_gen_complex(own::span> _dest, int32_t _prn, uint32_t _chip_shift); //! Generates N complex BeiDou B3I codes for the desired SV ID and code shift -void beidou_b3i_code_gen_complex_sampled(std::span> _dest, uint32_t _prn, int _fs, uint32_t _chip_shift, uint32_t _ncodes); +void beidou_b3i_code_gen_complex_sampled(own::span> _dest, uint32_t _prn, int _fs, uint32_t _chip_shift, uint32_t _ncodes); //! Generates complex BeiDou B3I code for the desired SV ID and code shift -void beidou_b3i_code_gen_complex_sampled(std::span> _dest, uint32_t _prn, int _fs, uint32_t _chip_shift); +void beidou_b3i_code_gen_complex_sampled(own::span> _dest, uint32_t _prn, int _fs, uint32_t _chip_shift); #endif // GNSS_SDR_BEIDOU_B3I_SIGNAL_PROCESSING_H diff --git a/src/algorithms/libs/galileo_e1_signal_processing.cc b/src/algorithms/libs/galileo_e1_signal_processing.cc index ea1d42666..8568b2e48 100644 --- a/src/algorithms/libs/galileo_e1_signal_processing.cc +++ b/src/algorithms/libs/galileo_e1_signal_processing.cc @@ -28,7 +28,7 @@ #include -void galileo_e1_code_gen_int(std::span _dest, const std::array& _Signal, int32_t _prn) +void galileo_e1_code_gen_int(own::span _dest, const std::array& _Signal, int32_t _prn) { std::string _galileo_signal = _Signal.data(); int32_t prn = _prn - 1; @@ -59,7 +59,7 @@ void galileo_e1_code_gen_int(std::span _dest, const std::array& _S } -void galileo_e1_sinboc_11_gen_int(std::span _dest, std::span _prn) +void galileo_e1_sinboc_11_gen_int(own::span _dest, own::span _prn) { const uint32_t _length_in = GALILEO_E1_B_CODE_LENGTH_CHIPS; auto _period = static_cast(_dest.size() / _length_in); @@ -77,7 +77,7 @@ void galileo_e1_sinboc_11_gen_int(std::span _dest, std::span _pr } -void galileo_e1_sinboc_61_gen_int(std::span _dest, std::span _prn) +void galileo_e1_sinboc_61_gen_int(own::span _dest, own::span _prn) { const uint32_t _length_in = GALILEO_E1_B_CODE_LENGTH_CHIPS; auto _period = static_cast(_dest.size() / _length_in); @@ -96,7 +96,7 @@ void galileo_e1_sinboc_61_gen_int(std::span _dest, std::span _pr } -void galileo_e1_code_gen_sinboc11_float(std::span _dest, const std::array& _Signal, uint32_t _prn) +void galileo_e1_code_gen_sinboc11_float(own::span _dest, const std::array& _Signal, uint32_t _prn) { std::string _galileo_signal = _Signal.data(); const auto _codeLength = static_cast(GALILEO_E1_B_CODE_LENGTH_CHIPS); @@ -110,7 +110,7 @@ void galileo_e1_code_gen_sinboc11_float(std::span _dest, const std::array } -void galileo_e1_gen_float(std::span _dest, std::span _prn, const std::array& _Signal) +void galileo_e1_gen_float(own::span _dest, own::span _prn, const std::array& _Signal) { std::string _galileo_signal = _Signal.data(); const uint32_t _codeLength = 12 * GALILEO_E1_B_CODE_LENGTH_CHIPS; @@ -119,8 +119,8 @@ void galileo_e1_gen_float(std::span _dest, std::span _prn, const std std::array sinboc_11{}; std::array sinboc_61{}; - std::span sinboc_11_(sinboc_11.data(), _codeLength); - std::span sinboc_61_(sinboc_61.data(), _codeLength); + own::span sinboc_11_(sinboc_11.data(), _codeLength); + own::span sinboc_61_(sinboc_61.data(), _codeLength); galileo_e1_sinboc_11_gen_int(sinboc_11_, _prn); // generate sinboc(1,1) 12 samples per chip galileo_e1_sinboc_61_gen_int(sinboc_61_, _prn); // generate sinboc(6,1) 12 samples per chip @@ -144,7 +144,7 @@ void galileo_e1_gen_float(std::span _dest, std::span _prn, const std } -void galileo_e1_code_gen_float_sampled(std::span _dest, const std::array& _Signal, +void galileo_e1_code_gen_float_sampled(own::span _dest, const std::array& _Signal, bool _cboc, uint32_t _prn, int32_t _fs, uint32_t _chip_shift, bool _secondary_flag) { @@ -210,7 +210,7 @@ void galileo_e1_code_gen_float_sampled(std::span _dest, const std::array< } -void galileo_e1_code_gen_complex_sampled(std::span> _dest, const std::array& _Signal, +void galileo_e1_code_gen_complex_sampled(own::span> _dest, const std::array& _Signal, bool _cboc, uint32_t _prn, int32_t _fs, uint32_t _chip_shift, bool _secondary_flag) { @@ -234,14 +234,14 @@ void galileo_e1_code_gen_complex_sampled(std::span> _dest, c } -void galileo_e1_code_gen_float_sampled(std::span _dest, const std::array& _Signal, +void galileo_e1_code_gen_float_sampled(own::span _dest, const std::array& _Signal, bool _cboc, uint32_t _prn, int32_t _fs, uint32_t _chip_shift) { galileo_e1_code_gen_float_sampled(_dest, _Signal, _cboc, _prn, _fs, _chip_shift, false); } -void galileo_e1_code_gen_complex_sampled(std::span> _dest, const std::array& _Signal, +void galileo_e1_code_gen_complex_sampled(own::span> _dest, const std::array& _Signal, bool _cboc, uint32_t _prn, int32_t _fs, uint32_t _chip_shift) { galileo_e1_code_gen_complex_sampled(_dest, _Signal, _cboc, _prn, _fs, _chip_shift, false); diff --git a/src/algorithms/libs/galileo_e1_signal_processing.h b/src/algorithms/libs/galileo_e1_signal_processing.h index 4c231e4d0..902715ccb 100644 --- a/src/algorithms/libs/galileo_e1_signal_processing.h +++ b/src/algorithms/libs/galileo_e1_signal_processing.h @@ -26,9 +26,10 @@ #include #if HAS_STD_SPAN #include +namespace own = std; #else #include -using std::span = gsl::span; +namespace own = gsl; #endif @@ -36,14 +37,14 @@ using std::span = gsl::span; * \brief This function generates Galileo E1 code (can select E1B or E1C sinboc). * */ -void galileo_e1_code_gen_sinboc11_float(std::span _dest, const std::array& _Signal, uint32_t _prn); +void galileo_e1_code_gen_sinboc11_float(own::span _dest, const std::array& _Signal, uint32_t _prn); /*! * \brief This function generates Galileo E1 code (can select E1B or E1C, cboc or sinboc * and the sample frequency _fs). * */ -void galileo_e1_code_gen_float_sampled(std::span _dest, const std::array& _Signal, +void galileo_e1_code_gen_float_sampled(own::span _dest, const std::array& _Signal, bool _cboc, uint32_t _prn, int32_t _fs, uint32_t _chip_shift, bool _secondary_flag); @@ -52,7 +53,7 @@ void galileo_e1_code_gen_float_sampled(std::span _dest, const std::array< * and the sample frequency _fs). * */ -void galileo_e1_code_gen_float_sampled(std::span _dest, const std::array& _Signal, +void galileo_e1_code_gen_float_sampled(own::span _dest, const std::array& _Signal, bool _cboc, uint32_t _prn, int32_t _fs, uint32_t _chip_shift); /*! @@ -60,14 +61,14 @@ void galileo_e1_code_gen_float_sampled(std::span _dest, const std::array< * and the sample frequency _fs). * */ -void galileo_e1_code_gen_complex_sampled(std::span> _dest, const std::array& _Signal, +void galileo_e1_code_gen_complex_sampled(own::span> _dest, const std::array& _Signal, bool _cboc, uint32_t _prn, int32_t _fs, uint32_t _chip_shift, bool _secondary_flag); /*! * \brief galileo_e1_code_gen_complex_sampled without _secondary_flag for backward compatibility. */ -void galileo_e1_code_gen_complex_sampled(std::span> _dest, const std::array& _Signal, +void galileo_e1_code_gen_complex_sampled(own::span> _dest, const std::array& _Signal, bool _cboc, uint32_t _prn, int32_t _fs, uint32_t _chip_shift); #endif // GNSS_SDR_GALILEO_E1_SIGNAL_PROCESSING_H diff --git a/src/algorithms/libs/galileo_e5_signal_processing.cc b/src/algorithms/libs/galileo_e5_signal_processing.cc index 89c5e7afc..c76473b3a 100644 --- a/src/algorithms/libs/galileo_e5_signal_processing.cc +++ b/src/algorithms/libs/galileo_e5_signal_processing.cc @@ -27,7 +27,7 @@ #include -void galileo_e5_a_code_gen_complex_primary(std::span> _dest, int32_t _prn, const std::array& _Signal) +void galileo_e5_a_code_gen_complex_primary(own::span> _dest, int32_t _prn, const std::array& _Signal) { uint32_t prn = _prn - 1; uint32_t index = 0; @@ -90,7 +90,7 @@ void galileo_e5_a_code_gen_complex_primary(std::span> _dest, } -void galileo_e5_a_code_gen_complex_sampled(std::span> _dest, const std::array& _Signal, +void galileo_e5_a_code_gen_complex_sampled(own::span> _dest, const std::array& _Signal, uint32_t _prn, int32_t _fs, uint32_t _chip_shift) { uint32_t _samplesPerCode; diff --git a/src/algorithms/libs/galileo_e5_signal_processing.h b/src/algorithms/libs/galileo_e5_signal_processing.h index ba3ad4101..74ceba060 100644 --- a/src/algorithms/libs/galileo_e5_signal_processing.h +++ b/src/algorithms/libs/galileo_e5_signal_processing.h @@ -27,22 +27,23 @@ #include #if HAS_STD_SPAN #include +namespace own = std; #else #include -using std::span = gsl::span; +namespace own = gsl; #endif /*! * \brief Generates Galileo E5a code at 1 sample/chip * bool _pilot generates E5aQ code if true and E5aI (data signal) if false. */ -void galileo_e5_a_code_gen_complex_primary(std::span> _dest, int32_t _prn, const std::array& _Signal); +void galileo_e5_a_code_gen_complex_primary(own::span> _dest, int32_t _prn, const std::array& _Signal); /*! * \brief Generates Galileo E5a complex code, shifted to the desired chip and sampled at a frequency fs * bool _pilot generates E5aQ code if true and E5aI (data signal) if false. */ -void galileo_e5_a_code_gen_complex_sampled(std::span> _dest, +void galileo_e5_a_code_gen_complex_sampled(own::span> _dest, const std::array& _Signal, uint32_t _prn, int32_t _fs, uint32_t _chip_shift); diff --git a/src/algorithms/libs/glonass_l1_signal_processing.cc b/src/algorithms/libs/glonass_l1_signal_processing.cc index 7112f1f67..f53a1b262 100644 --- a/src/algorithms/libs/glonass_l1_signal_processing.cc +++ b/src/algorithms/libs/glonass_l1_signal_processing.cc @@ -25,7 +25,7 @@ const auto AUX_CEIL = [](float x) { return static_cast(static_cast((x) + 1)); }; -void glonass_l1_ca_code_gen_complex(std::span> _dest, uint32_t _chip_shift) +void glonass_l1_ca_code_gen_complex(own::span> _dest, uint32_t _chip_shift) { const uint32_t _code_length = 511; std::bitset<_code_length> G1{}; @@ -91,7 +91,7 @@ void glonass_l1_ca_code_gen_complex(std::span> _dest, uint32 /* * Generates complex GLONASS L1 C/A code for the desired SV ID and sampled to specific sampling frequency */ -void glonass_l1_ca_code_gen_complex_sampled(std::span> _dest, int32_t _fs, uint32_t _chip_shift) +void glonass_l1_ca_code_gen_complex_sampled(own::span> _dest, int32_t _fs, uint32_t _chip_shift) { // This function is based on the GNU software GPS for MATLAB in the Kay Borre book std::array, 511> _code{}; diff --git a/src/algorithms/libs/glonass_l1_signal_processing.h b/src/algorithms/libs/glonass_l1_signal_processing.h index 766aba7ed..946538190 100644 --- a/src/algorithms/libs/glonass_l1_signal_processing.h +++ b/src/algorithms/libs/glonass_l1_signal_processing.h @@ -26,18 +26,19 @@ #include #if HAS_STD_SPAN #include +namespace own = std; #else #include -using std::span = gsl::span; +namespace own = gsl; #endif //! Generates complex GLONASS L1 C/A code for the desired SV ID and code shift, and sampled to specific sampling frequency -void glonass_l1_ca_code_gen_complex(std::span> _dest, uint32_t _chip_shift); +void glonass_l1_ca_code_gen_complex(own::span> _dest, uint32_t _chip_shift); //! Generates N complex GLONASS L1 C/A codes for the desired SV ID and code shift -void glonass_l1_ca_code_gen_complex_sampled(std::span> _dest, int32_t _fs, uint32_t _chip_shift, uint32_t _ncodes); +void glonass_l1_ca_code_gen_complex_sampled(own::span> _dest, int32_t _fs, uint32_t _chip_shift, uint32_t _ncodes); //! Generates complex GLONASS L1 C/A code for the desired SV ID and code shift -void glonass_l1_ca_code_gen_complex_sampled(std::span> _dest, int32_t _fs, uint32_t _chip_shift); +void glonass_l1_ca_code_gen_complex_sampled(own::span> _dest, int32_t _fs, uint32_t _chip_shift); #endif // GNSS_SDR_GLONASS_SDR_SIGNAL_PROCESSING_H diff --git a/src/algorithms/libs/glonass_l2_signal_processing.cc b/src/algorithms/libs/glonass_l2_signal_processing.cc index e54d3f661..51353f620 100644 --- a/src/algorithms/libs/glonass_l2_signal_processing.cc +++ b/src/algorithms/libs/glonass_l2_signal_processing.cc @@ -25,7 +25,7 @@ const auto AUX_CEIL = [](float x) { return static_cast(static_cast((x) + 1)); }; -void glonass_l2_ca_code_gen_complex(std::span> _dest, uint32_t _chip_shift) +void glonass_l2_ca_code_gen_complex(own::span> _dest, uint32_t _chip_shift) { const uint32_t _code_length = 511; std::bitset<_code_length> G1{}; @@ -91,7 +91,7 @@ void glonass_l2_ca_code_gen_complex(std::span> _dest, uint32 /* * Generates complex GLONASS L2 C/A code for the desired SV ID and sampled to specific sampling frequency */ -void glonass_l2_ca_code_gen_complex_sampled(std::span> _dest, int32_t _fs, uint32_t _chip_shift) +void glonass_l2_ca_code_gen_complex_sampled(own::span> _dest, int32_t _fs, uint32_t _chip_shift) { // This function is based on the GNU software GPS for MATLAB in the Kay Borre book std::array, 511> _code{}; diff --git a/src/algorithms/libs/glonass_l2_signal_processing.h b/src/algorithms/libs/glonass_l2_signal_processing.h index 74d74ff57..f0a4acf8b 100644 --- a/src/algorithms/libs/glonass_l2_signal_processing.h +++ b/src/algorithms/libs/glonass_l2_signal_processing.h @@ -26,18 +26,19 @@ #include #if HAS_STD_SPAN #include +namespace own = std; #else #include -using std::span = gsl::span; +namespace own = gsl; #endif //! Generates complex GLONASS L2 C/A code for the desired SV ID and code shift, and sampled to specific sampling frequency -void glonass_l2_ca_code_gen_complex(std::span> _dest, uint32_t _chip_shift); +void glonass_l2_ca_code_gen_complex(own::span> _dest, uint32_t _chip_shift); //! Generates N complex GLONASS L2 C/A codes for the desired SV ID and code shift -void glonass_l2_ca_code_gen_complex_sampled(std::span> _dest, int32_t _fs, uint32_t _chip_shift, uint32_t _ncodes); +void glonass_l2_ca_code_gen_complex_sampled(own::span> _dest, int32_t _fs, uint32_t _chip_shift, uint32_t _ncodes); //! Generates complex GLONASS L2 C/A code for the desired SV ID and code shift -void glonass_l2_ca_code_gen_complex_sampled(std::span> _dest, int32_t _fs, uint32_t _chip_shift); +void glonass_l2_ca_code_gen_complex_sampled(own::span> _dest, int32_t _fs, uint32_t _chip_shift); #endif // GNSS_SDR_GLONASS_L2_SIGNAL_PROCESSING_H diff --git a/src/algorithms/libs/gnss_signal_processing.cc b/src/algorithms/libs/gnss_signal_processing.cc index 2884726bc..06fef9369 100644 --- a/src/algorithms/libs/gnss_signal_processing.cc +++ b/src/algorithms/libs/gnss_signal_processing.cc @@ -28,7 +28,7 @@ const auto AUX_CEIL2 = [](float x) { return static_cast(static_cast((x) + 1)); }; -void complex_exp_gen(std::span> _dest, double _f, double _fs) +void complex_exp_gen(own::span> _dest, double _f, double _fs) { gr::fxpt_nco d_nco; d_nco.set_freq((GPS_TWO_PI * _f) / _fs); @@ -36,7 +36,7 @@ void complex_exp_gen(std::span> _dest, double _f, double _fs } -void complex_exp_gen_conj(std::span> _dest, double _f, double _fs) +void complex_exp_gen_conj(own::span> _dest, double _f, double _fs) { gr::fxpt_nco d_nco; d_nco.set_freq(-(GPS_TWO_PI * _f) / _fs); @@ -44,7 +44,7 @@ void complex_exp_gen_conj(std::span> _dest, double _f, doubl } -void hex_to_binary_converter(std::span _dest, char _from) +void hex_to_binary_converter(own::span _dest, char _from) { switch (_from) { @@ -150,7 +150,7 @@ void hex_to_binary_converter(std::span _dest, char _from) } -void resampler(const std::span _from, std::span _dest, float _fs_in, +void resampler(const own::span _from, own::span _dest, float _fs_in, float _fs_out) { uint32_t _codeValueIndex; @@ -173,7 +173,7 @@ void resampler(const std::span _from, std::span _dest, float _fs_i } -void resampler(std::span> _from, std::span> _dest, float _fs_in, +void resampler(own::span> _from, own::span> _dest, float _fs_in, float _fs_out) { uint32_t _codeValueIndex; diff --git a/src/algorithms/libs/gnss_signal_processing.h b/src/algorithms/libs/gnss_signal_processing.h index e18f3f938..07b7d2121 100644 --- a/src/algorithms/libs/gnss_signal_processing.h +++ b/src/algorithms/libs/gnss_signal_processing.h @@ -28,42 +28,43 @@ #include #if HAS_STD_SPAN #include +namespace own = std; #else #include -using std::span = gsl::span; +namespace own = gsl; #endif /*! * \brief This function generates a complex exponential in _dest. * */ -void complex_exp_gen(std::span> _dest, double _f, double _fs); +void complex_exp_gen(own::span> _dest, double _f, double _fs); /*! * \brief This function generates a conjugate complex exponential in _dest. * */ -void complex_exp_gen_conj(std::span> _dest, double _f, double _fs); +void complex_exp_gen_conj(own::span> _dest, double _f, double _fs); /*! * \brief This function makes a conversion from hex (the input is a char) * to binary (the output are 4 ints with +1 or -1 values). * */ -void hex_to_binary_converter(std::span _dest, char _from); +void hex_to_binary_converter(own::span _dest, char _from); /*! * \brief This function resamples a sequence of float values. * */ -void resampler(const std::span _from, std::span _dest, +void resampler(const own::span _from, own::span _dest, float _fs_in, float _fs_out); /*! * \brief This function resamples a sequence of complex values. * */ -void resampler(std::span> _from, std::span> _dest, +void resampler(own::span> _from, own::span> _dest, float _fs_in, float _fs_out); #endif // GNSS_SDR_GNSS_SIGNAL_PROCESSING_H diff --git a/src/algorithms/libs/gps_l2c_signal.cc b/src/algorithms/libs/gps_l2c_signal.cc index 68c62ed0b..b17591c79 100644 --- a/src/algorithms/libs/gps_l2c_signal.cc +++ b/src/algorithms/libs/gps_l2c_signal.cc @@ -32,7 +32,7 @@ uint32_t gps_l2c_m_shift(uint32_t x) } -void gps_l2c_m_code(std::span _dest, uint32_t _prn) +void gps_l2c_m_code(own::span _dest, uint32_t _prn) { uint32_t x; x = GPS_L2C_M_INIT_REG[_prn - 1]; @@ -44,7 +44,7 @@ void gps_l2c_m_code(std::span _dest, uint32_t _prn) } -void gps_l2c_m_code_gen_complex(std::span> _dest, uint32_t _prn) +void gps_l2c_m_code_gen_complex(own::span> _dest, uint32_t _prn) { std::array _code{}; if (_prn > 0 and _prn < 51) @@ -59,7 +59,7 @@ void gps_l2c_m_code_gen_complex(std::span> _dest, uint32_t _ } -void gps_l2c_m_code_gen_float(std::span _dest, uint32_t _prn) +void gps_l2c_m_code_gen_float(own::span _dest, uint32_t _prn) { std::array _code{}; if (_prn > 0 and _prn < 51) @@ -77,7 +77,7 @@ void gps_l2c_m_code_gen_float(std::span _dest, uint32_t _prn) /* * Generates complex GPS L2C M code for the desired SV ID and sampled to specific sampling frequency */ -void gps_l2c_m_code_gen_complex_sampled(std::span> _dest, uint32_t _prn, int32_t _fs) +void gps_l2c_m_code_gen_complex_sampled(own::span> _dest, uint32_t _prn, int32_t _fs) { std::array _code{}; if (_prn > 0 and _prn < 51) diff --git a/src/algorithms/libs/gps_l2c_signal.h b/src/algorithms/libs/gps_l2c_signal.h index f389b4ce2..82e6e1a20 100644 --- a/src/algorithms/libs/gps_l2c_signal.h +++ b/src/algorithms/libs/gps_l2c_signal.h @@ -26,16 +26,17 @@ #include #if HAS_STD_SPAN #include +namespace own = std; #else #include -using std::span = gsl::span; +namespace own = gsl; #endif //! Generates complex GPS L2C M code for the desired SV ID -void gps_l2c_m_code_gen_complex(std::span> _dest, uint32_t _prn); -void gps_l2c_m_code_gen_float(std::span _dest, uint32_t _prn); +void gps_l2c_m_code_gen_complex(own::span> _dest, uint32_t _prn); +void gps_l2c_m_code_gen_float(own::span _dest, uint32_t _prn); //! Generates complex GPS L2C M code for the desired SV ID, and sampled to specific sampling frequency -void gps_l2c_m_code_gen_complex_sampled(std::span> _dest, uint32_t _prn, int32_t _fs); +void gps_l2c_m_code_gen_complex_sampled(own::span> _dest, uint32_t _prn, int32_t _fs); #endif // GNSS_SDR_GPS_L2C_SIGNAL_H diff --git a/src/algorithms/libs/gps_l5_signal.cc b/src/algorithms/libs/gps_l5_signal.cc index d7e8a671e..88142fe2b 100644 --- a/src/algorithms/libs/gps_l5_signal.cc +++ b/src/algorithms/libs/gps_l5_signal.cc @@ -121,7 +121,7 @@ std::deque make_l5q_xb() } -void make_l5i(std::span _dest, int32_t prn) +void make_l5i(own::span _dest, int32_t prn) { int32_t xb_offset = GPS_L5I_INIT_REG[prn]; @@ -141,7 +141,7 @@ void make_l5i(std::span _dest, int32_t prn) } -void make_l5q(std::span _dest, int32_t prn) +void make_l5q(own::span _dest, int32_t prn) { int32_t xb_offset = GPS_L5Q_INIT_REG[prn]; @@ -161,7 +161,7 @@ void make_l5q(std::span _dest, int32_t prn) } -void gps_l5i_code_gen_complex(std::span> _dest, uint32_t _prn) +void gps_l5i_code_gen_complex(own::span> _dest, uint32_t _prn) { std::array _code{}; if (_prn > 0 and _prn < 51) @@ -176,7 +176,7 @@ void gps_l5i_code_gen_complex(std::span> _dest, uint32_t _pr } -void gps_l5i_code_gen_float(std::span _dest, uint32_t _prn) +void gps_l5i_code_gen_float(own::span _dest, uint32_t _prn) { std::array _code{}; if (_prn > 0 and _prn < 51) @@ -194,7 +194,7 @@ void gps_l5i_code_gen_float(std::span _dest, uint32_t _prn) /* * Generates complex GPS L5i code for the desired SV ID and sampled to specific sampling frequency */ -void gps_l5i_code_gen_complex_sampled(std::span> _dest, uint32_t _prn, int32_t _fs) +void gps_l5i_code_gen_complex_sampled(own::span> _dest, uint32_t _prn, int32_t _fs) { std::array _code{}; if (_prn > 0 and _prn < 51) @@ -236,7 +236,7 @@ void gps_l5i_code_gen_complex_sampled(std::span> _dest, uint } -void gps_l5q_code_gen_complex(std::span> _dest, uint32_t _prn) +void gps_l5q_code_gen_complex(own::span> _dest, uint32_t _prn) { std::array _code{}; if (_prn > 0 and _prn < 51) @@ -251,7 +251,7 @@ void gps_l5q_code_gen_complex(std::span> _dest, uint32_t _pr } -void gps_l5q_code_gen_float(std::span _dest, uint32_t _prn) +void gps_l5q_code_gen_float(own::span _dest, uint32_t _prn) { std::array _code{}; if (_prn > 0 and _prn < 51) @@ -269,7 +269,7 @@ void gps_l5q_code_gen_float(std::span _dest, uint32_t _prn) /* * Generates complex GPS L5Q code for the desired SV ID and sampled to specific sampling frequency */ -void gps_l5q_code_gen_complex_sampled(std::span> _dest, uint32_t _prn, int32_t _fs) +void gps_l5q_code_gen_complex_sampled(own::span> _dest, uint32_t _prn, int32_t _fs) { std::array _code{}; if (_prn > 0 and _prn < 51) diff --git a/src/algorithms/libs/gps_l5_signal.h b/src/algorithms/libs/gps_l5_signal.h index 433c6437a..4b27106b9 100644 --- a/src/algorithms/libs/gps_l5_signal.h +++ b/src/algorithms/libs/gps_l5_signal.h @@ -26,28 +26,29 @@ #include #if HAS_STD_SPAN #include +namespace own = std; #else #include -using std::span = gsl::span; +namespace own = gsl; #endif //! Generates complex GPS L5I code for the desired SV ID -void gps_l5i_code_gen_complex(std::span> _dest, uint32_t _prn); +void gps_l5i_code_gen_complex(own::span> _dest, uint32_t _prn); //! Generates real GPS L5I code for the desired SV ID -void gps_l5i_code_gen_float(std::span _dest, uint32_t _prn); +void gps_l5i_code_gen_float(own::span _dest, uint32_t _prn); //! Generates complex GPS L5Q code for the desired SV ID -void gps_l5q_code_gen_complex(std::span> _dest, uint32_t _prn); +void gps_l5q_code_gen_complex(own::span> _dest, uint32_t _prn); //! Generates real GPS L5Q code for the desired SV ID -void gps_l5q_code_gen_float(std::span _dest, uint32_t _prn); +void gps_l5q_code_gen_float(own::span _dest, uint32_t _prn); //! Generates complex GPS L5I code for the desired SV ID, and sampled to specific sampling frequency -void gps_l5i_code_gen_complex_sampled(std::span> _dest, uint32_t _prn, int32_t _fs); +void gps_l5i_code_gen_complex_sampled(own::span> _dest, uint32_t _prn, int32_t _fs); //! Generates complex GPS L5Q code for the desired SV ID, and sampled to specific sampling frequency -void gps_l5q_code_gen_complex_sampled(std::span> _dest, uint32_t _prn, int32_t _fs); +void gps_l5q_code_gen_complex_sampled(own::span> _dest, uint32_t _prn, int32_t _fs); #endif // GNSS_SDR_GPS_L5_SIGNAL_H diff --git a/src/algorithms/libs/gps_sdr_signal_processing.cc b/src/algorithms/libs/gps_sdr_signal_processing.cc index 26f1ae0b2..b66e5690b 100644 --- a/src/algorithms/libs/gps_sdr_signal_processing.cc +++ b/src/algorithms/libs/gps_sdr_signal_processing.cc @@ -25,7 +25,7 @@ const auto AUX_CEIL = [](float x) { return static_cast(static_cast((x) + 1)); }; -void gps_l1_ca_code_gen_int(std::span _dest, int32_t _prn, uint32_t _chip_shift) +void gps_l1_ca_code_gen_int(own::span _dest, int32_t _prn, uint32_t _chip_shift) { const uint32_t _code_length = 1023; std::bitset<_code_length> G1{}; @@ -110,7 +110,7 @@ void gps_l1_ca_code_gen_int(std::span _dest, int32_t _prn, uint32_t _ch } -void gps_l1_ca_code_gen_float(std::span _dest, int32_t _prn, uint32_t _chip_shift) +void gps_l1_ca_code_gen_float(own::span _dest, int32_t _prn, uint32_t _chip_shift) { const uint32_t _code_length = 1023; std::array ca_code_int{}; @@ -124,7 +124,7 @@ void gps_l1_ca_code_gen_float(std::span _dest, int32_t _prn, uint32_t _ch } -void gps_l1_ca_code_gen_complex(std::span> _dest, int32_t _prn, uint32_t _chip_shift) +void gps_l1_ca_code_gen_complex(own::span> _dest, int32_t _prn, uint32_t _chip_shift) { const uint32_t _code_length = 1023; std::array ca_code_int{}; @@ -142,7 +142,7 @@ void gps_l1_ca_code_gen_complex(std::span> _dest, int32_t _p * Generates complex GPS L1 C/A code for the desired SV ID and sampled to specific sampling frequency * NOTICE: the number of samples is rounded towards zero (integer truncation) */ -void gps_l1_ca_code_gen_complex_sampled(std::span> _dest, uint32_t _prn, int32_t _fs, uint32_t _chip_shift) +void gps_l1_ca_code_gen_complex_sampled(own::span> _dest, uint32_t _prn, int32_t _fs, uint32_t _chip_shift) { // This function is based on the GNU software GPS for MATLAB in the Kay Borre book std::array, 1023> _code{}; diff --git a/src/algorithms/libs/gps_sdr_signal_processing.h b/src/algorithms/libs/gps_sdr_signal_processing.h index 1cc0e55ef..5c3404824 100644 --- a/src/algorithms/libs/gps_sdr_signal_processing.h +++ b/src/algorithms/libs/gps_sdr_signal_processing.h @@ -26,24 +26,25 @@ #include #if HAS_STD_SPAN #include +namespace own = std; #else #include -using std::span = gsl::span; +namespace own = gsl; #endif //! Generates int GPS L1 C/A code for the desired SV ID and code shift -void gps_l1_ca_code_gen_int(std::span _dest, int32_t _prn, uint32_t _chip_shift); +void gps_l1_ca_code_gen_int(own::span _dest, int32_t _prn, uint32_t _chip_shift); //! Generates float GPS L1 C/A code for the desired SV ID and code shift -void gps_l1_ca_code_gen_float(std::span _dest, int32_t _prn, uint32_t _chip_shift); +void gps_l1_ca_code_gen_float(own::span _dest, int32_t _prn, uint32_t _chip_shift); //! Generates complex GPS L1 C/A code for the desired SV ID and code shift, and sampled to specific sampling frequency -void gps_l1_ca_code_gen_complex(std::span> _dest, int32_t _prn, uint32_t _chip_shift); +void gps_l1_ca_code_gen_complex(own::span> _dest, int32_t _prn, uint32_t _chip_shift); //! Generates N complex GPS L1 C/A codes for the desired SV ID and code shift -void gps_l1_ca_code_gen_complex_sampled(std::span> _dest, uint32_t _prn, int32_t _fs, uint32_t _chip_shift, uint32_t _ncodes); +void gps_l1_ca_code_gen_complex_sampled(own::span> _dest, uint32_t _prn, int32_t _fs, uint32_t _chip_shift, uint32_t _ncodes); //! Generates complex GPS L1 C/A code for the desired SV ID and code shift -void gps_l1_ca_code_gen_complex_sampled(std::span> _dest, uint32_t _prn, int32_t _fs, uint32_t _chip_shift); +void gps_l1_ca_code_gen_complex_sampled(own::span> _dest, uint32_t _prn, int32_t _fs, uint32_t _chip_shift); #endif // GNSS_SDR_GPS_SDR_SIGNAL_PROCESSING_H diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.cc b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.cc index 17bc13721..040c85b96 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.cc @@ -80,7 +80,7 @@ GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga( d_ca_codes = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS * NUM_PRNs) * sizeof(int32_t), volk_gnsssdr_get_alignment())); for (uint32_t PRN = 1; PRN <= NUM_PRNs; PRN++) { - gps_l1_ca_code_gen_int(std::span(&d_ca_codes[static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS) * (PRN - 1)], &d_ca_codes[static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS) * (PRN)]), PRN, 0); + gps_l1_ca_code_gen_int(own::span(&d_ca_codes[static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS) * (PRN - 1)], &d_ca_codes[static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS) * (PRN)]), PRN, 0); // The code is generated as a series of 1s and -1s. In order to store the values using only one bit, a -1 is stored as a 0 in the FPGA for (uint32_t k = 0; k < GPS_L1_CA_CODE_LENGTH_CHIPS; k++) diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc index f8b38a5b1..4e1d41aaa 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc @@ -268,7 +268,7 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_cc::start_tracking() d_code_loop_filter.initialize(); // initialize the code filter // generate local reference ALWAYS starting at chip 1 (1 sample per chip) - glonass_l1_ca_code_gen_complex(std::span(d_ca_code.data(), GLONASS_L1_CA_CODE_LENGTH_CHIPS), 0); + glonass_l1_ca_code_gen_complex(own::span(d_ca_code.data(), GLONASS_L1_CA_CODE_LENGTH_CHIPS), 0); multicorrelator_cpu.set_local_code_and_taps(static_cast(GLONASS_L1_CA_CODE_LENGTH_CHIPS), d_ca_code.data(), d_local_code_shift_chips.data()); std::fill_n(d_correlator_outs.begin(), d_n_correlator_taps, gr_complex(0.0, 0.0)); diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc index 1cd0151d6..a744dda13 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc @@ -215,7 +215,7 @@ void Glonass_L2_Ca_Dll_Pll_Tracking_cc::start_tracking() d_code_loop_filter.initialize(); // initialize the code filter // generate local reference ALWAYS starting at chip 1 (1 sample per chip) - glonass_l2_ca_code_gen_complex(std::span(d_ca_code.data(), GLONASS_L2_CA_CODE_LENGTH_CHIPS), 0); + glonass_l2_ca_code_gen_complex(own::span(d_ca_code.data(), GLONASS_L2_CA_CODE_LENGTH_CHIPS), 0); multicorrelator_cpu.set_local_code_and_taps(static_cast(GLONASS_L2_CA_CODE_LENGTH_CHIPS), d_ca_code.data(), d_local_code_shift_chips.data()); std::fill_n(d_correlator_outs.begin(), d_n_correlator_taps, gr_complex(0.0, 0.0)); diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc index 4daaed9fb..0d0be976a 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc @@ -207,7 +207,7 @@ void Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::start_tracking() d_code_loop_filter.initialize(); // initialize the code filter // generate local reference ALWAYS starting at chip 1 (1 sample per chip) - gps_l1_ca_code_gen_complex(std::span(d_ca_code, static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS)), d_acquisition_gnss_synchro->PRN, 0); + gps_l1_ca_code_gen_complex(own::span(d_ca_code, static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS)), d_acquisition_gnss_synchro->PRN, 0); multicorrelator_gpu->set_local_code_and_taps(static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS), d_ca_code, d_local_code_shift_chips, d_n_correlator_taps); diff --git a/src/tests/unit-tests/arithmetic/code_generation_test.cc b/src/tests/unit-tests/arithmetic/code_generation_test.cc index 69e68341b..ec59c4c25 100644 --- a/src/tests/unit-tests/arithmetic/code_generation_test.cc +++ b/src/tests/unit-tests/arithmetic/code_generation_test.cc @@ -43,7 +43,7 @@ TEST(CodeGenerationTest, CodeGenGPSL1Test) for (int i = 0; i < iterations; i++) { - gps_l1_ca_code_gen_complex(std::span>(_dest, 1023), _prn, _chip_shift); + gps_l1_ca_code_gen_complex(own::span>(_dest, 1023), _prn, _chip_shift); } end = std::chrono::system_clock::now(); @@ -72,7 +72,7 @@ TEST(CodeGenerationTest, CodeGenGPSL1SampledTest) for (int i = 0; i < iterations; i++) { - gps_l1_ca_code_gen_complex_sampled(std::span>(_dest, _samplesPerCode), _prn, _fs, _chip_shift); + gps_l1_ca_code_gen_complex_sampled(own::span>(_dest, _samplesPerCode), _prn, _fs, _chip_shift); } end = std::chrono::system_clock::now(); @@ -100,7 +100,7 @@ TEST(CodeGenerationTest, ComplexConjugateTest) for (int i = 0; i < iterations; i++) { - complex_exp_gen_conj(std::span>(_dest, _samplesPerCode), _f, _fs); + complex_exp_gen_conj(own::span>(_dest, _samplesPerCode), _f, _fs); } end = std::chrono::system_clock::now(); diff --git a/src/tests/unit-tests/arithmetic/complex_carrier_test.cc b/src/tests/unit-tests/arithmetic/complex_carrier_test.cc index 77e735693..1ba901475 100644 --- a/src/tests/unit-tests/arithmetic/complex_carrier_test.cc +++ b/src/tests/unit-tests/arithmetic/complex_carrier_test.cc @@ -116,7 +116,7 @@ TEST(ComplexCarrierTest, OwnComplexImplementation) std::chrono::time_point start, end; start = std::chrono::system_clock::now(); - complex_exp_gen(std::span>(output, static_cast(FLAGS_size_carrier_test)), _f, _fs); + complex_exp_gen(own::span>(output, static_cast(FLAGS_size_carrier_test)), _f, _fs); end = std::chrono::system_clock::now(); std::chrono::duration elapsed_seconds = end - start; diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc index fa6c0a2d6..1f803c077 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc @@ -96,7 +96,7 @@ TEST(CpuMulticorrelatorRealCodesTest, MeasureExecutionTime) // local code resampler on GPU // generate local reference (1 sample per chip) - gps_l1_ca_code_gen_float(std::span(d_ca_code, static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(float)), 1, 0); + gps_l1_ca_code_gen_float(own::span(d_ca_code, static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(float)), 1, 0); // generate inut signal std::random_device r; std::default_random_engine e1(r()); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_test.cc index b4c917a13..9dad1c863 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_test.cc @@ -93,7 +93,7 @@ TEST(CpuMulticorrelatorTest, MeasureExecutionTime) // local code resampler on GPU // generate local reference (1 sample per chip) - gps_l1_ca_code_gen_complex(std::span(d_ca_code, static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(gr_complex)), 1, 0); + gps_l1_ca_code_gen_complex(own::span(d_ca_code, static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(gr_complex)), 1, 0); // generate inut signal std::random_device r; std::default_random_engine e1(r()); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gpu_multicorrelator_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gpu_multicorrelator_test.cc index de725e5aa..b20a8cec0 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gpu_multicorrelator_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gpu_multicorrelator_test.cc @@ -85,7 +85,7 @@ TEST(GpuMulticorrelatorTest, MeasureExecutionTime) // --- Perform initializations ------------------------------ // local code resampler on GPU // generate local reference (1 sample per chip) - gps_l1_ca_code_gen_complex(std::span(d_ca_code, static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS)), 1, 0); + gps_l1_ca_code_gen_complex(own::span(d_ca_code, static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS)), 1, 0); // generate inut signal for (int n = 0; n < 2 * d_vector_length; n++) {