1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-14 20:20:35 +00:00

Fix for using std::span when available, and gsl::span as a fallback

This commit is contained in:
Carles Fernandez 2020-05-07 23:11:11 +02:00
parent eaee82280a
commit 1d703b4b48
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
47 changed files with 174 additions and 149 deletions

View File

@ -32,9 +32,10 @@
#if HAS_STD_SPAN
#include <span>
namespace own = std;
#else
#include <gsl/gsl>
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<gr_complex> code_span(code_.data(), vector_length_);
own::span<gr_complex> 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());

View File

@ -29,9 +29,10 @@
#if HAS_STD_SPAN
#include <span>
namespace own = std;
#else
#include <gsl/gsl>
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<gr_complex> code_span(code_.data(), vector_length_);
own::span<gr_complex> 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());

View File

@ -29,9 +29,10 @@
#if HAS_STD_SPAN
#include <span>
namespace own = std;
#else
#include <gsl/gsl>
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<gr_complex> code_span(code_.data(), vector_length_);
own::span<gr_complex> 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());

View File

@ -30,9 +30,10 @@
#if HAS_STD_SPAN
#include <span>
namespace own = std;
#else
#include <gsl/gsl>
using std::span = gsl::span;
namespace own = gsl;
#endif
GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
@ -188,7 +189,7 @@ void GalileoE1PcpsAmbiguousAcquisition::set_local_code()
}
}
std::span<gr_complex> code__span(code_.data(), vector_length_);
own::span<gr_complex> 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());

View File

@ -29,9 +29,10 @@
#if HAS_STD_SPAN
#include <span>
namespace own = std;
#else
#include <gsl/gsl>
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<gr_complex> code_span(code_.data(), vector_length_);
own::span<gr_complex> 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());

View File

@ -29,9 +29,10 @@
#if HAS_STD_SPAN
#include <span>
namespace own = std;
#else
#include <gsl/gsl>
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<gr_complex> code_span(code_.data(), vector_length_);
own::span<gr_complex> 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());

View File

@ -35,9 +35,10 @@
#if HAS_STD_SPAN
#include <span>
namespace own = std;
#else
#include <gsl/gsl>
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<gr_complex> codeQ_span(codeQ_.data(), vector_length_);
std::span<gr_complex> codeI_span(codeI_.data(), vector_length_);
own::span<gr_complex> codeQ_span(codeQ_.data(), vector_length_);
own::span<gr_complex> codeI_span(codeI_.data(), vector_length_);
if (Zero_padding == 0) // if no zero_padding
{
for (unsigned int i = 0; i < sampled_ms_; i++)

View File

@ -29,9 +29,10 @@
#if HAS_STD_SPAN
#include <span>
namespace own = std;
#else
#include <gsl/gsl>
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<gr_complex> code_span(code_.data(), vector_length_);
own::span<gr_complex> 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());

View File

@ -31,9 +31,10 @@
#if HAS_STD_SPAN
#include <span>
namespace own = std;
#else
#include <gsl/gsl>
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<gr_complex> code_span(code_.data(), vector_length_);
own::span<gr_complex> 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());

View File

@ -30,9 +30,10 @@
#if HAS_STD_SPAN
#include <span>
namespace own = std;
#else
#include <gsl/gsl>
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<gr_complex> code_span(code_.data(), vector_length_);
own::span<gr_complex> 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());

View File

@ -33,12 +33,12 @@
#if HAS_STD_SPAN
#include <span>
namespace own = std;
#else
#include <gsl/gsl>
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<gr_complex> code_span(code_.data(), vector_length_);
own::span<gr_complex> 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());

View File

@ -29,9 +29,10 @@
#if HAS_STD_SPAN
#include <span>
namespace own = std;
#else
#include <gsl/gsl>
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<gr_complex> code_span(code_.data(), vector_length_);
own::span<gr_complex> 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());

View File

@ -30,9 +30,10 @@
#if HAS_STD_SPAN
#include <span>
namespace own = std;
#else
#include <gsl/gsl>
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<gr_complex> code_span(code_.data(), vector_length_);
own::span<gr_complex> 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());

View File

@ -29,9 +29,10 @@
#if HAS_STD_SPAN
#include <span>
namespace own = std;
#else
#include <gsl/gsl>
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<gr_complex> code_span(code_.data(), vector_length_);
own::span<gr_complex> 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());

View File

@ -31,9 +31,10 @@
#if HAS_STD_SPAN
#include <span>
namespace own = std;
#else
#include <gsl/gsl>
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<gr_complex> code_span(code_.data(), vector_length_);
own::span<gr_complex> 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());

View File

@ -28,12 +28,12 @@
#include "gps_l5_signal.h"
#include <glog/logging.h>
#include <algorithm>
#if HAS_STD_SPAN
#include <span>
namespace own = std;
#else
#include <gsl/gsl>
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<gr_complex> code_span(code_.data(), vector_length_);
own::span<gr_complex> 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());

View File

@ -252,7 +252,7 @@ bool pcps_acquisition::is_fdma()
}
void pcps_acquisition::update_local_carrier(std::span<gr_complex> carrier_vector, float freq)
void pcps_acquisition::update_local_carrier(own::span<gr_complex> carrier_vector, float freq)
{
float phase_step_rad;
if (acq_parameters.use_automatic_resampler)

View File

@ -64,9 +64,10 @@
#if HAS_STD_SPAN
#include <span>
namespace own = std;
#else
#include <gsl/gsl>
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<gr_complex> carrier_vector, float freq);
void update_local_carrier(own::span<gr_complex> carrier_vector, float freq);
void update_grid_doppler_wipeoffs();
void update_grid_doppler_wipeoffs_step2();
void acquisition_core(uint64_t samp_count);

View File

@ -26,7 +26,7 @@
const auto AUX_CEIL = [](float x) { return static_cast<int32_t>(static_cast<int64_t>((x) + 1)); };
void beidou_b1i_code_gen_int(std::span<int32_t> _dest, int32_t _prn, uint32_t _chip_shift)
void beidou_b1i_code_gen_int(own::span<int32_t> _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<int32_t> _dest, int32_t _prn, uint32_t _c
}
void beidou_b1i_code_gen_float(std::span<float> _dest, int32_t _prn, uint32_t _chip_shift)
void beidou_b1i_code_gen_float(own::span<float> _dest, int32_t _prn, uint32_t _chip_shift)
{
const uint32_t _code_length = 2046;
std::array<int32_t, _code_length> b1i_code_int{};
beidou_b1i_code_gen_int(std::span<int32_t>(b1i_code_int.data(), _code_length), _prn, _chip_shift);
beidou_b1i_code_gen_int(own::span<int32_t>(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<float> _dest, int32_t _prn, uint32_t _c
}
void beidou_b1i_code_gen_complex(std::span<std::complex<float>> _dest, int32_t _prn, uint32_t _chip_shift)
void beidou_b1i_code_gen_complex(own::span<std::complex<float>> _dest, int32_t _prn, uint32_t _chip_shift)
{
const uint32_t _code_length = 2046;
std::array<int32_t, _code_length> b1i_code_int{};
beidou_b1i_code_gen_int(std::span<int32_t>(b1i_code_int.data(), _code_length), _prn, _chip_shift);
beidou_b1i_code_gen_int(own::span<int32_t>(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<std::complex<float>> _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<std::complex<float>> _dest, uint32_t _prn, int32_t _fs, uint32_t _chip_shift)
void beidou_b1i_code_gen_complex_sampled(own::span<std::complex<float>> _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<std::complex<float>, 2046> _code{};

View File

@ -26,24 +26,25 @@
#include <cstdint>
#if HAS_STD_SPAN
#include <span>
namespace own = std;
#else
#include <gsl/gsl>
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<int32_t> _dest, int32_t _prn, uint32_t _chip_shift);
void beidou_b1i_code_gen_int(own::span<int32_t> _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<float> _dest, int32_t _prn, uint32_t _chip_shift);
void beidou_b1i_code_gen_float(own::span<float> _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<std::complex<float>> _dest, int32_t _prn, uint32_t _chip_shift);
void beidou_b1i_code_gen_complex(own::span<std::complex<float>> _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<std::complex<float>> _dest, uint32_t _prn, int32_t _fs, uint32_t _chip_shift, uint32_t _ncodes);
void beidou_b1i_code_gen_complex_sampled(own::span<std::complex<float>> _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<std::complex<float>> _dest, uint32_t _prn, int32_t _fs, uint32_t _chip_shift);
void beidou_b1i_code_gen_complex_sampled(own::span<std::complex<float>> _dest, uint32_t _prn, int32_t _fs, uint32_t _chip_shift);
#endif // GNSS_SDR_BEIDOU_B1I_SDR_SIGNAL_PROCESSING_H

View File

@ -26,7 +26,7 @@
const auto AUX_CEIL = [](float x) { return static_cast<int32_t>(static_cast<int64_t>((x) + 1)); };
void beidou_b3i_code_gen_int(std::span<int> _dest, int32_t _prn, uint32_t _chip_shift)
void beidou_b3i_code_gen_int(own::span<int> _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<int> _dest, int32_t _prn, uint32_t _chip_
}
void beidou_b3i_code_gen_float(std::span<float> _dest, int32_t _prn, uint32_t _chip_shift)
void beidou_b3i_code_gen_float(own::span<float> _dest, int32_t _prn, uint32_t _chip_shift)
{
const uint32_t _code_length = 10230;
std::array<int, _code_length> b3i_code_int{};
@ -182,7 +182,7 @@ void beidou_b3i_code_gen_float(std::span<float> _dest, int32_t _prn, uint32_t _c
}
void beidou_b3i_code_gen_complex(std::span<std::complex<float>> _dest, int32_t _prn, uint32_t _chip_shift)
void beidou_b3i_code_gen_complex(own::span<std::complex<float>> _dest, int32_t _prn, uint32_t _chip_shift)
{
const uint32_t _code_length = 10230;
std::array<int, _code_length> b3i_code_int{};
@ -196,7 +196,7 @@ void beidou_b3i_code_gen_complex(std::span<std::complex<float>> _dest, int32_t _
}
void beidou_b3i_code_gen_complex_sampled(std::span<std::complex<float>> _dest, uint32_t _prn, int _fs, uint32_t _chip_shift)
void beidou_b3i_code_gen_complex_sampled(own::span<std::complex<float>> _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<std::complex<float>, 10230> _code{};

View File

@ -26,25 +26,26 @@
#include <cstdint>
#if HAS_STD_SPAN
#include <span>
namespace own = std;
#else
#include <gsl/gsl>
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<int> _dest, int32_t _prn, uint32_t _chip_shift);
void beidou_b3i_code_gen_int(own::span<int> _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<float> _dest, int32_t _prn, uint32_t _chip_shift);
void beidou_b3i_code_gen_float(own::span<float> _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<std::complex<float>> _dest, int32_t _prn, uint32_t _chip_shift);
void beidou_b3i_code_gen_complex(own::span<std::complex<float>> _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<std::complex<float>> _dest, uint32_t _prn, int _fs, uint32_t _chip_shift, uint32_t _ncodes);
void beidou_b3i_code_gen_complex_sampled(own::span<std::complex<float>> _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<std::complex<float>> _dest, uint32_t _prn, int _fs, uint32_t _chip_shift);
void beidou_b3i_code_gen_complex_sampled(own::span<std::complex<float>> _dest, uint32_t _prn, int _fs, uint32_t _chip_shift);
#endif // GNSS_SDR_BEIDOU_B3I_SIGNAL_PROCESSING_H

View File

@ -28,7 +28,7 @@
#include <vector>
void galileo_e1_code_gen_int(std::span<int> _dest, const std::array<char, 3>& _Signal, int32_t _prn)
void galileo_e1_code_gen_int(own::span<int> _dest, const std::array<char, 3>& _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<int> _dest, const std::array<char, 3>& _S
}
void galileo_e1_sinboc_11_gen_int(std::span<int> _dest, std::span<const int> _prn)
void galileo_e1_sinboc_11_gen_int(own::span<int> _dest, own::span<const int> _prn)
{
const uint32_t _length_in = GALILEO_E1_B_CODE_LENGTH_CHIPS;
auto _period = static_cast<uint32_t>(_dest.size() / _length_in);
@ -77,7 +77,7 @@ void galileo_e1_sinboc_11_gen_int(std::span<int> _dest, std::span<const int> _pr
}
void galileo_e1_sinboc_61_gen_int(std::span<int> _dest, std::span<const int> _prn)
void galileo_e1_sinboc_61_gen_int(own::span<int> _dest, own::span<const int> _prn)
{
const uint32_t _length_in = GALILEO_E1_B_CODE_LENGTH_CHIPS;
auto _period = static_cast<uint32_t>(_dest.size() / _length_in);
@ -96,7 +96,7 @@ void galileo_e1_sinboc_61_gen_int(std::span<int> _dest, std::span<const int> _pr
}
void galileo_e1_code_gen_sinboc11_float(std::span<float> _dest, const std::array<char, 3>& _Signal, uint32_t _prn)
void galileo_e1_code_gen_sinboc11_float(own::span<float> _dest, const std::array<char, 3>& _Signal, uint32_t _prn)
{
std::string _galileo_signal = _Signal.data();
const auto _codeLength = static_cast<uint32_t>(GALILEO_E1_B_CODE_LENGTH_CHIPS);
@ -110,7 +110,7 @@ void galileo_e1_code_gen_sinboc11_float(std::span<float> _dest, const std::array
}
void galileo_e1_gen_float(std::span<float> _dest, std::span<int> _prn, const std::array<char, 3>& _Signal)
void galileo_e1_gen_float(own::span<float> _dest, own::span<int> _prn, const std::array<char, 3>& _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<float> _dest, std::span<int> _prn, const std
std::array<int32_t, 12 * 4092> sinboc_11{};
std::array<int32_t, 12 * 4092> sinboc_61{};
std::span<int32_t> sinboc_11_(sinboc_11.data(), _codeLength);
std::span<int32_t> sinboc_61_(sinboc_61.data(), _codeLength);
own::span<int32_t> sinboc_11_(sinboc_11.data(), _codeLength);
own::span<int32_t> 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<float> _dest, std::span<int> _prn, const std
}
void galileo_e1_code_gen_float_sampled(std::span<float> _dest, const std::array<char, 3>& _Signal,
void galileo_e1_code_gen_float_sampled(own::span<float> _dest, const std::array<char, 3>& _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<float> _dest, const std::array<
}
void galileo_e1_code_gen_complex_sampled(std::span<std::complex<float>> _dest, const std::array<char, 3>& _Signal,
void galileo_e1_code_gen_complex_sampled(own::span<std::complex<float>> _dest, const std::array<char, 3>& _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<std::complex<float>> _dest, c
}
void galileo_e1_code_gen_float_sampled(std::span<float> _dest, const std::array<char, 3>& _Signal,
void galileo_e1_code_gen_float_sampled(own::span<float> _dest, const std::array<char, 3>& _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<std::complex<float>> _dest, const std::array<char, 3>& _Signal,
void galileo_e1_code_gen_complex_sampled(own::span<std::complex<float>> _dest, const std::array<char, 3>& _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);

View File

@ -26,9 +26,10 @@
#include <cstdint>
#if HAS_STD_SPAN
#include <span>
namespace own = std;
#else
#include <gsl/gsl>
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<float> _dest, const std::array<char, 3>& _Signal, uint32_t _prn);
void galileo_e1_code_gen_sinboc11_float(own::span<float> _dest, const std::array<char, 3>& _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<float> _dest, const std::array<char, 3>& _Signal,
void galileo_e1_code_gen_float_sampled(own::span<float> _dest, const std::array<char, 3>& _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<float> _dest, const std::array<
* and the sample frequency _fs).
*
*/
void galileo_e1_code_gen_float_sampled(std::span<float> _dest, const std::array<char, 3>& _Signal,
void galileo_e1_code_gen_float_sampled(own::span<float> _dest, const std::array<char, 3>& _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<float> _dest, const std::array<
* and the sample frequency _fs).
*
*/
void galileo_e1_code_gen_complex_sampled(std::span<std::complex<float>> _dest, const std::array<char, 3>& _Signal,
void galileo_e1_code_gen_complex_sampled(own::span<std::complex<float>> _dest, const std::array<char, 3>& _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<std::complex<float>> _dest, const std::array<char, 3>& _Signal,
void galileo_e1_code_gen_complex_sampled(own::span<std::complex<float>> _dest, const std::array<char, 3>& _Signal,
bool _cboc, uint32_t _prn, int32_t _fs, uint32_t _chip_shift);
#endif // GNSS_SDR_GALILEO_E1_SIGNAL_PROCESSING_H

View File

@ -27,7 +27,7 @@
#include <vector>
void galileo_e5_a_code_gen_complex_primary(std::span<std::complex<float>> _dest, int32_t _prn, const std::array<char, 3>& _Signal)
void galileo_e5_a_code_gen_complex_primary(own::span<std::complex<float>> _dest, int32_t _prn, const std::array<char, 3>& _Signal)
{
uint32_t prn = _prn - 1;
uint32_t index = 0;
@ -90,7 +90,7 @@ void galileo_e5_a_code_gen_complex_primary(std::span<std::complex<float>> _dest,
}
void galileo_e5_a_code_gen_complex_sampled(std::span<std::complex<float>> _dest, const std::array<char, 3>& _Signal,
void galileo_e5_a_code_gen_complex_sampled(own::span<std::complex<float>> _dest, const std::array<char, 3>& _Signal,
uint32_t _prn, int32_t _fs, uint32_t _chip_shift)
{
uint32_t _samplesPerCode;

View File

@ -27,22 +27,23 @@
#include <cstdint>
#if HAS_STD_SPAN
#include <span>
namespace own = std;
#else
#include <gsl/gsl>
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<std::complex<float>> _dest, int32_t _prn, const std::array<char, 3>& _Signal);
void galileo_e5_a_code_gen_complex_primary(own::span<std::complex<float>> _dest, int32_t _prn, const std::array<char, 3>& _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<std::complex<float>> _dest,
void galileo_e5_a_code_gen_complex_sampled(own::span<std::complex<float>> _dest,
const std::array<char, 3>& _Signal, uint32_t _prn, int32_t _fs, uint32_t _chip_shift);

View File

@ -25,7 +25,7 @@
const auto AUX_CEIL = [](float x) { return static_cast<int32_t>(static_cast<int64_t>((x) + 1)); };
void glonass_l1_ca_code_gen_complex(std::span<std::complex<float>> _dest, uint32_t _chip_shift)
void glonass_l1_ca_code_gen_complex(own::span<std::complex<float>> _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<std::complex<float>> _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<std::complex<float>> _dest, int32_t _fs, uint32_t _chip_shift)
void glonass_l1_ca_code_gen_complex_sampled(own::span<std::complex<float>> _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<std::complex<float>, 511> _code{};

View File

@ -26,18 +26,19 @@
#include <cstdint>
#if HAS_STD_SPAN
#include <span>
namespace own = std;
#else
#include <gsl/gsl>
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<std::complex<float>> _dest, uint32_t _chip_shift);
void glonass_l1_ca_code_gen_complex(own::span<std::complex<float>> _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<std::complex<float>> _dest, int32_t _fs, uint32_t _chip_shift, uint32_t _ncodes);
void glonass_l1_ca_code_gen_complex_sampled(own::span<std::complex<float>> _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<std::complex<float>> _dest, int32_t _fs, uint32_t _chip_shift);
void glonass_l1_ca_code_gen_complex_sampled(own::span<std::complex<float>> _dest, int32_t _fs, uint32_t _chip_shift);
#endif // GNSS_SDR_GLONASS_SDR_SIGNAL_PROCESSING_H

View File

@ -25,7 +25,7 @@
const auto AUX_CEIL = [](float x) { return static_cast<int32_t>(static_cast<int64_t>((x) + 1)); };
void glonass_l2_ca_code_gen_complex(std::span<std::complex<float>> _dest, uint32_t _chip_shift)
void glonass_l2_ca_code_gen_complex(own::span<std::complex<float>> _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<std::complex<float>> _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<std::complex<float>> _dest, int32_t _fs, uint32_t _chip_shift)
void glonass_l2_ca_code_gen_complex_sampled(own::span<std::complex<float>> _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<std::complex<float>, 511> _code{};

View File

@ -26,18 +26,19 @@
#include <cstdint>
#if HAS_STD_SPAN
#include <span>
namespace own = std;
#else
#include <gsl/gsl>
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<std::complex<float>> _dest, uint32_t _chip_shift);
void glonass_l2_ca_code_gen_complex(own::span<std::complex<float>> _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<std::complex<float>> _dest, int32_t _fs, uint32_t _chip_shift, uint32_t _ncodes);
void glonass_l2_ca_code_gen_complex_sampled(own::span<std::complex<float>> _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<std::complex<float>> _dest, int32_t _fs, uint32_t _chip_shift);
void glonass_l2_ca_code_gen_complex_sampled(own::span<std::complex<float>> _dest, int32_t _fs, uint32_t _chip_shift);
#endif // GNSS_SDR_GLONASS_L2_SIGNAL_PROCESSING_H

View File

@ -28,7 +28,7 @@
const auto AUX_CEIL2 = [](float x) { return static_cast<int32_t>(static_cast<int64_t>((x) + 1)); };
void complex_exp_gen(std::span<std::complex<float>> _dest, double _f, double _fs)
void complex_exp_gen(own::span<std::complex<float>> _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<std::complex<float>> _dest, double _f, double _fs
}
void complex_exp_gen_conj(std::span<std::complex<float>> _dest, double _f, double _fs)
void complex_exp_gen_conj(own::span<std::complex<float>> _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<std::complex<float>> _dest, double _f, doubl
}
void hex_to_binary_converter(std::span<int32_t> _dest, char _from)
void hex_to_binary_converter(own::span<int32_t> _dest, char _from)
{
switch (_from)
{
@ -150,7 +150,7 @@ void hex_to_binary_converter(std::span<int32_t> _dest, char _from)
}
void resampler(const std::span<float> _from, std::span<float> _dest, float _fs_in,
void resampler(const own::span<float> _from, own::span<float> _dest, float _fs_in,
float _fs_out)
{
uint32_t _codeValueIndex;
@ -173,7 +173,7 @@ void resampler(const std::span<float> _from, std::span<float> _dest, float _fs_i
}
void resampler(std::span<const std::complex<float>> _from, std::span<std::complex<float>> _dest, float _fs_in,
void resampler(own::span<const std::complex<float>> _from, own::span<std::complex<float>> _dest, float _fs_in,
float _fs_out)
{
uint32_t _codeValueIndex;

View File

@ -28,42 +28,43 @@
#include <cstdint>
#if HAS_STD_SPAN
#include <span>
namespace own = std;
#else
#include <gsl/gsl>
using std::span = gsl::span;
namespace own = gsl;
#endif
/*!
* \brief This function generates a complex exponential in _dest.
*
*/
void complex_exp_gen(std::span<std::complex<float>> _dest, double _f, double _fs);
void complex_exp_gen(own::span<std::complex<float>> _dest, double _f, double _fs);
/*!
* \brief This function generates a conjugate complex exponential in _dest.
*
*/
void complex_exp_gen_conj(std::span<std::complex<float>> _dest, double _f, double _fs);
void complex_exp_gen_conj(own::span<std::complex<float>> _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<int32_t> _dest, char _from);
void hex_to_binary_converter(own::span<int32_t> _dest, char _from);
/*!
* \brief This function resamples a sequence of float values.
*
*/
void resampler(const std::span<float> _from, std::span<float> _dest,
void resampler(const own::span<float> _from, own::span<float> _dest,
float _fs_in, float _fs_out);
/*!
* \brief This function resamples a sequence of complex values.
*
*/
void resampler(std::span<const std::complex<float>> _from, std::span<std::complex<float>> _dest,
void resampler(own::span<const std::complex<float>> _from, own::span<std::complex<float>> _dest,
float _fs_in, float _fs_out);
#endif // GNSS_SDR_GNSS_SIGNAL_PROCESSING_H

View File

@ -32,7 +32,7 @@ uint32_t gps_l2c_m_shift(uint32_t x)
}
void gps_l2c_m_code(std::span<int32_t> _dest, uint32_t _prn)
void gps_l2c_m_code(own::span<int32_t> _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<int32_t> _dest, uint32_t _prn)
}
void gps_l2c_m_code_gen_complex(std::span<std::complex<float>> _dest, uint32_t _prn)
void gps_l2c_m_code_gen_complex(own::span<std::complex<float>> _dest, uint32_t _prn)
{
std::array<int32_t, GPS_L2_M_CODE_LENGTH_CHIPS> _code{};
if (_prn > 0 and _prn < 51)
@ -59,7 +59,7 @@ void gps_l2c_m_code_gen_complex(std::span<std::complex<float>> _dest, uint32_t _
}
void gps_l2c_m_code_gen_float(std::span<float> _dest, uint32_t _prn)
void gps_l2c_m_code_gen_float(own::span<float> _dest, uint32_t _prn)
{
std::array<int32_t, GPS_L2_M_CODE_LENGTH_CHIPS> _code{};
if (_prn > 0 and _prn < 51)
@ -77,7 +77,7 @@ void gps_l2c_m_code_gen_float(std::span<float> _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<std::complex<float>> _dest, uint32_t _prn, int32_t _fs)
void gps_l2c_m_code_gen_complex_sampled(own::span<std::complex<float>> _dest, uint32_t _prn, int32_t _fs)
{
std::array<int32_t, GPS_L2_M_CODE_LENGTH_CHIPS> _code{};
if (_prn > 0 and _prn < 51)

View File

@ -26,16 +26,17 @@
#include <cstdint>
#if HAS_STD_SPAN
#include <span>
namespace own = std;
#else
#include <gsl/gsl>
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<std::complex<float>> _dest, uint32_t _prn);
void gps_l2c_m_code_gen_float(std::span<float> _dest, uint32_t _prn);
void gps_l2c_m_code_gen_complex(own::span<std::complex<float>> _dest, uint32_t _prn);
void gps_l2c_m_code_gen_float(own::span<float> _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<std::complex<float>> _dest, uint32_t _prn, int32_t _fs);
void gps_l2c_m_code_gen_complex_sampled(own::span<std::complex<float>> _dest, uint32_t _prn, int32_t _fs);
#endif // GNSS_SDR_GPS_L2C_SIGNAL_H

View File

@ -121,7 +121,7 @@ std::deque<bool> make_l5q_xb()
}
void make_l5i(std::span<int32_t> _dest, int32_t prn)
void make_l5i(own::span<int32_t> _dest, int32_t prn)
{
int32_t xb_offset = GPS_L5I_INIT_REG[prn];
@ -141,7 +141,7 @@ void make_l5i(std::span<int32_t> _dest, int32_t prn)
}
void make_l5q(std::span<int32_t> _dest, int32_t prn)
void make_l5q(own::span<int32_t> _dest, int32_t prn)
{
int32_t xb_offset = GPS_L5Q_INIT_REG[prn];
@ -161,7 +161,7 @@ void make_l5q(std::span<int32_t> _dest, int32_t prn)
}
void gps_l5i_code_gen_complex(std::span<std::complex<float>> _dest, uint32_t _prn)
void gps_l5i_code_gen_complex(own::span<std::complex<float>> _dest, uint32_t _prn)
{
std::array<int32_t, GPS_L5I_CODE_LENGTH_CHIPS> _code{};
if (_prn > 0 and _prn < 51)
@ -176,7 +176,7 @@ void gps_l5i_code_gen_complex(std::span<std::complex<float>> _dest, uint32_t _pr
}
void gps_l5i_code_gen_float(std::span<float> _dest, uint32_t _prn)
void gps_l5i_code_gen_float(own::span<float> _dest, uint32_t _prn)
{
std::array<int32_t, GPS_L5I_CODE_LENGTH_CHIPS> _code{};
if (_prn > 0 and _prn < 51)
@ -194,7 +194,7 @@ void gps_l5i_code_gen_float(std::span<float> _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<std::complex<float>> _dest, uint32_t _prn, int32_t _fs)
void gps_l5i_code_gen_complex_sampled(own::span<std::complex<float>> _dest, uint32_t _prn, int32_t _fs)
{
std::array<int32_t, GPS_L5I_CODE_LENGTH_CHIPS> _code{};
if (_prn > 0 and _prn < 51)
@ -236,7 +236,7 @@ void gps_l5i_code_gen_complex_sampled(std::span<std::complex<float>> _dest, uint
}
void gps_l5q_code_gen_complex(std::span<std::complex<float>> _dest, uint32_t _prn)
void gps_l5q_code_gen_complex(own::span<std::complex<float>> _dest, uint32_t _prn)
{
std::array<int32_t, GPS_L5Q_CODE_LENGTH_CHIPS> _code{};
if (_prn > 0 and _prn < 51)
@ -251,7 +251,7 @@ void gps_l5q_code_gen_complex(std::span<std::complex<float>> _dest, uint32_t _pr
}
void gps_l5q_code_gen_float(std::span<float> _dest, uint32_t _prn)
void gps_l5q_code_gen_float(own::span<float> _dest, uint32_t _prn)
{
std::array<int32_t, GPS_L5Q_CODE_LENGTH_CHIPS> _code{};
if (_prn > 0 and _prn < 51)
@ -269,7 +269,7 @@ void gps_l5q_code_gen_float(std::span<float> _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<std::complex<float>> _dest, uint32_t _prn, int32_t _fs)
void gps_l5q_code_gen_complex_sampled(own::span<std::complex<float>> _dest, uint32_t _prn, int32_t _fs)
{
std::array<int32_t, GPS_L5Q_CODE_LENGTH_CHIPS> _code{};
if (_prn > 0 and _prn < 51)

View File

@ -26,28 +26,29 @@
#include <cstdint>
#if HAS_STD_SPAN
#include <span>
namespace own = std;
#else
#include <gsl/gsl>
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<std::complex<float>> _dest, uint32_t _prn);
void gps_l5i_code_gen_complex(own::span<std::complex<float>> _dest, uint32_t _prn);
//! Generates real GPS L5I code for the desired SV ID
void gps_l5i_code_gen_float(std::span<float> _dest, uint32_t _prn);
void gps_l5i_code_gen_float(own::span<float> _dest, uint32_t _prn);
//! Generates complex GPS L5Q code for the desired SV ID
void gps_l5q_code_gen_complex(std::span<std::complex<float>> _dest, uint32_t _prn);
void gps_l5q_code_gen_complex(own::span<std::complex<float>> _dest, uint32_t _prn);
//! Generates real GPS L5Q code for the desired SV ID
void gps_l5q_code_gen_float(std::span<float> _dest, uint32_t _prn);
void gps_l5q_code_gen_float(own::span<float> _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<std::complex<float>> _dest, uint32_t _prn, int32_t _fs);
void gps_l5i_code_gen_complex_sampled(own::span<std::complex<float>> _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<std::complex<float>> _dest, uint32_t _prn, int32_t _fs);
void gps_l5q_code_gen_complex_sampled(own::span<std::complex<float>> _dest, uint32_t _prn, int32_t _fs);
#endif // GNSS_SDR_GPS_L5_SIGNAL_H

View File

@ -25,7 +25,7 @@
const auto AUX_CEIL = [](float x) { return static_cast<int32_t>(static_cast<int64_t>((x) + 1)); };
void gps_l1_ca_code_gen_int(std::span<int32_t> _dest, int32_t _prn, uint32_t _chip_shift)
void gps_l1_ca_code_gen_int(own::span<int32_t> _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<int32_t> _dest, int32_t _prn, uint32_t _ch
}
void gps_l1_ca_code_gen_float(std::span<float> _dest, int32_t _prn, uint32_t _chip_shift)
void gps_l1_ca_code_gen_float(own::span<float> _dest, int32_t _prn, uint32_t _chip_shift)
{
const uint32_t _code_length = 1023;
std::array<int32_t, _code_length> ca_code_int{};
@ -124,7 +124,7 @@ void gps_l1_ca_code_gen_float(std::span<float> _dest, int32_t _prn, uint32_t _ch
}
void gps_l1_ca_code_gen_complex(std::span<std::complex<float>> _dest, int32_t _prn, uint32_t _chip_shift)
void gps_l1_ca_code_gen_complex(own::span<std::complex<float>> _dest, int32_t _prn, uint32_t _chip_shift)
{
const uint32_t _code_length = 1023;
std::array<int32_t, _code_length> ca_code_int{};
@ -142,7 +142,7 @@ void gps_l1_ca_code_gen_complex(std::span<std::complex<float>> _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<std::complex<float>> _dest, uint32_t _prn, int32_t _fs, uint32_t _chip_shift)
void gps_l1_ca_code_gen_complex_sampled(own::span<std::complex<float>> _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<std::complex<float>, 1023> _code{};

View File

@ -26,24 +26,25 @@
#include <cstdint>
#if HAS_STD_SPAN
#include <span>
namespace own = std;
#else
#include <gsl/gsl>
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<int32_t> _dest, int32_t _prn, uint32_t _chip_shift);
void gps_l1_ca_code_gen_int(own::span<int32_t> _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<float> _dest, int32_t _prn, uint32_t _chip_shift);
void gps_l1_ca_code_gen_float(own::span<float> _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<std::complex<float>> _dest, int32_t _prn, uint32_t _chip_shift);
void gps_l1_ca_code_gen_complex(own::span<std::complex<float>> _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<std::complex<float>> _dest, uint32_t _prn, int32_t _fs, uint32_t _chip_shift, uint32_t _ncodes);
void gps_l1_ca_code_gen_complex_sampled(own::span<std::complex<float>> _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<std::complex<float>> _dest, uint32_t _prn, int32_t _fs, uint32_t _chip_shift);
void gps_l1_ca_code_gen_complex_sampled(own::span<std::complex<float>> _dest, uint32_t _prn, int32_t _fs, uint32_t _chip_shift);
#endif // GNSS_SDR_GPS_SDR_SIGNAL_PROCESSING_H

View File

@ -80,7 +80,7 @@ GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga(
d_ca_codes = static_cast<int32_t*>(volk_gnsssdr_malloc(static_cast<int32_t>(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<int32_t>(&d_ca_codes[static_cast<int32_t>(GPS_L1_CA_CODE_LENGTH_CHIPS) * (PRN - 1)], &d_ca_codes[static_cast<int32_t>(GPS_L1_CA_CODE_LENGTH_CHIPS) * (PRN)]), PRN, 0);
gps_l1_ca_code_gen_int(own::span<int32_t>(&d_ca_codes[static_cast<int32_t>(GPS_L1_CA_CODE_LENGTH_CHIPS) * (PRN - 1)], &d_ca_codes[static_cast<int32_t>(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++)

View File

@ -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<gr_complex>(d_ca_code.data(), GLONASS_L1_CA_CODE_LENGTH_CHIPS), 0);
glonass_l1_ca_code_gen_complex(own::span<gr_complex>(d_ca_code.data(), GLONASS_L1_CA_CODE_LENGTH_CHIPS), 0);
multicorrelator_cpu.set_local_code_and_taps(static_cast<int32_t>(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));

View File

@ -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<gr_complex>(d_ca_code.data(), GLONASS_L2_CA_CODE_LENGTH_CHIPS), 0);
glonass_l2_ca_code_gen_complex(own::span<gr_complex>(d_ca_code.data(), GLONASS_L2_CA_CODE_LENGTH_CHIPS), 0);
multicorrelator_cpu.set_local_code_and_taps(static_cast<int32_t>(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));

View File

@ -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<gr_complex>(d_ca_code, static_cast<int32_t>(GPS_L1_CA_CODE_LENGTH_CHIPS)), d_acquisition_gnss_synchro->PRN, 0);
gps_l1_ca_code_gen_complex(own::span<gr_complex>(d_ca_code, static_cast<int32_t>(GPS_L1_CA_CODE_LENGTH_CHIPS)), d_acquisition_gnss_synchro->PRN, 0);
multicorrelator_gpu->set_local_code_and_taps(static_cast<int32_t>(GPS_L1_CA_CODE_LENGTH_CHIPS), d_ca_code, d_local_code_shift_chips, d_n_correlator_taps);

View File

@ -43,7 +43,7 @@ TEST(CodeGenerationTest, CodeGenGPSL1Test)
for (int i = 0; i < iterations; i++)
{
gps_l1_ca_code_gen_complex(std::span<std::complex<float>>(_dest, 1023), _prn, _chip_shift);
gps_l1_ca_code_gen_complex(own::span<std::complex<float>>(_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<std::complex<float>>(_dest, _samplesPerCode), _prn, _fs, _chip_shift);
gps_l1_ca_code_gen_complex_sampled(own::span<std::complex<float>>(_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<std::complex<float>>(_dest, _samplesPerCode), _f, _fs);
complex_exp_gen_conj(own::span<std::complex<float>>(_dest, _samplesPerCode), _f, _fs);
}
end = std::chrono::system_clock::now();

View File

@ -116,7 +116,7 @@ TEST(ComplexCarrierTest, OwnComplexImplementation)
std::chrono::time_point<std::chrono::system_clock> start, end;
start = std::chrono::system_clock::now();
complex_exp_gen(std::span<std::complex<float>>(output, static_cast<unsigned int>(FLAGS_size_carrier_test)), _f, _fs);
complex_exp_gen(own::span<std::complex<float>>(output, static_cast<unsigned int>(FLAGS_size_carrier_test)), _f, _fs);
end = std::chrono::system_clock::now();
std::chrono::duration<double> elapsed_seconds = end - start;

View File

@ -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<float>(d_ca_code, static_cast<int>(GPS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(float)), 1, 0);
gps_l1_ca_code_gen_float(own::span<float>(d_ca_code, static_cast<int>(GPS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(float)), 1, 0);
// generate inut signal
std::random_device r;
std::default_random_engine e1(r());

View File

@ -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<gr_complex>(d_ca_code, static_cast<int>(GPS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(gr_complex)), 1, 0);
gps_l1_ca_code_gen_complex(own::span<gr_complex>(d_ca_code, static_cast<int>(GPS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(gr_complex)), 1, 0);
// generate inut signal
std::random_device r;
std::default_random_engine e1(r());

View File

@ -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<gr_complex>(d_ca_code, static_cast<int>(GPS_L1_CA_CODE_LENGTH_CHIPS)), 1, 0);
gps_l1_ca_code_gen_complex(own::span<gr_complex>(d_ca_code, static_cast<int>(GPS_L1_CA_CODE_LENGTH_CHIPS)), 1, 0);
// generate inut signal
for (int n = 0; n < 2 * d_vector_length; n++)
{