diff --git a/src/algorithms/libs/beidou_b3i_signal_processing.cc b/src/algorithms/libs/beidou_b3i_signal_processing.cc index a08cdd7b4..56a04d123 100644 --- a/src/algorithms/libs/beidou_b3i_signal_processing.cc +++ b/src/algorithms/libs/beidou_b3i_signal_processing.cc @@ -35,11 +35,11 @@ #include #include -auto auxCeil = [](float x) { return static_cast(static_cast((x) + 1)); }; +auto auxCeil = [](float x) { return static_cast(static_cast((x) + 1)); }; -void beidou_b3i_code_gen_int(gsl::span _dest, signed int _prn, unsigned int _chip_shift) +void beidou_b3i_code_gen_int(gsl::span _dest, int32_t _prn, uint32_t _chip_shift) { - const unsigned int _code_length = 10230; + const uint32_t _code_length = 10230; std::bitset<_code_length> G1{}; std::bitset<_code_length> G2{}; auto G1_register = std::bitset<13>{}.set(); // All true @@ -175,54 +175,54 @@ void beidou_b3i_code_gen_int(gsl::span _dest, signed int _prn, unsigned int } -void beidou_b3i_code_gen_float(gsl::span _dest, signed int _prn, unsigned int _chip_shift) +void beidou_b3i_code_gen_float(gsl::span _dest, int32_t _prn, uint32_t _chip_shift) { - const unsigned int _code_length = 10230; + const uint32_t _code_length = 10230; std::array b3i_code_int{}; beidou_b3i_code_gen_int(b3i_code_int, _prn, _chip_shift); - for (unsigned int ii = 0; ii < _code_length; ++ii) + for (uint32_t ii = 0; ii < _code_length; ++ii) { _dest[ii] = static_cast(b3i_code_int[ii]); } } -void beidou_b3i_code_gen_complex(gsl::span> _dest, signed int _prn, unsigned int _chip_shift) +void beidou_b3i_code_gen_complex(gsl::span> _dest, int32_t _prn, uint32_t _chip_shift) { - const unsigned int _code_length = 10230; + const uint32_t _code_length = 10230; std::array b3i_code_int{}; beidou_b3i_code_gen_int(b3i_code_int, _prn, _chip_shift); - for (unsigned int ii = 0; ii < _code_length; ++ii) + for (uint32_t ii = 0; ii < _code_length; ++ii) { _dest[ii] = std::complex(static_cast(b3i_code_int[ii]), 0.0F); } } -void beidou_b3i_code_gen_complex_sampled(gsl::span> _dest, unsigned int _prn, int _fs, unsigned int _chip_shift) +void beidou_b3i_code_gen_complex_sampled(gsl::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{}; - signed int _samplesPerCode, _codeValueIndex; + int32_t _samplesPerCode, _codeValueIndex; float _ts; float _tc; float aux; - const signed int _codeFreqBasis = 10230000; // Hz - const signed int _codeLength = 10230; + const int32_t _codeFreqBasis = 10230000; // Hz + const int32_t _codeLength = 10230; //--- Find number of samples per spreading code ---------------------------- - _samplesPerCode = static_cast(static_cast(_fs) / static_cast(_codeFreqBasis / _codeLength)); + _samplesPerCode = static_cast(static_cast(_fs) / static_cast(_codeFreqBasis / _codeLength)); //--- Find time constants -------------------------------------------------- _ts = 1.0 / static_cast(_fs); // Sampling period in sec _tc = 1.0 / static_cast(_codeFreqBasis); // C/A chip period in sec beidou_b3i_code_gen_complex(_code, _prn, _chip_shift); // generate C/A code 1 sample per chip - for (signed int i = 0; i < _samplesPerCode; i++) + for (int32_t i = 0; i < _samplesPerCode; i++) { //=== Digitizing ======================================================= diff --git a/src/algorithms/libs/beidou_b3i_signal_processing.h b/src/algorithms/libs/beidou_b3i_signal_processing.h index 7093407ce..58509e64b 100644 --- a/src/algorithms/libs/beidou_b3i_signal_processing.h +++ b/src/algorithms/libs/beidou_b3i_signal_processing.h @@ -47,18 +47,18 @@ namespace gsl = std; #endif //! Generates int BeiDou B3I code for the desired SV ID and code shift -void beidou_b3i_code_gen_int(gsl::span _dest, signed int _prn, unsigned int _chip_shift); +void beidou_b3i_code_gen_int(gsl::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(gsl::span _dest, signed int _prn, unsigned int _chip_shift); +void beidou_b3i_code_gen_float(gsl::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(gsl::span> _dest, signed int _prn, unsigned int _chip_shift); +void beidou_b3i_code_gen_complex(gsl::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(gsl::span> _dest, unsigned int _prn, int _fs, unsigned int _chip_shift, unsigned int _ncodes); +void beidou_b3i_code_gen_complex_sampled(gsl::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(gsl::span> _dest, unsigned int _prn, int _fs, unsigned int _chip_shift); +void beidou_b3i_code_gen_complex_sampled(gsl::span> _dest, uint32_t _prn, int _fs, uint32_t _chip_shift); #endif /* GNSS_SDR_BEIDOU_B3I_SIGNAL_PROCESSING_H_ */