mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-11-07 10:43:58 +00:00
Merge branch 'next' of https://github.com/gnss-sdr/gnss-sdr into vtl_experimental
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
# Copyright (C) 2012-2020 (see AUTHORS file for a list of contributors)
|
||||
#
|
||||
# GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
||||
#
|
||||
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
# This file is part of GNSS-SDR.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2010-2020 C. Fernandez-Prades cfernandez(at)cttc.es
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
add_subdirectory(rtklib)
|
||||
|
||||
|
||||
@@ -7,13 +7,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
@@ -26,17 +23,17 @@
|
||||
|
||||
const auto AUX_CEIL = [](float x) { return static_cast<int32_t>(static_cast<int64_t>((x) + 1)); };
|
||||
|
||||
void beidou_b1i_code_gen_int(own::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)
|
||||
{
|
||||
constexpr uint32_t _code_length = 2046;
|
||||
constexpr uint32_t code_length = 2046;
|
||||
const std::array<int32_t, 33> delays = {712 /*PRN1*/, 1581, 1414, 1550, 581, 771, 1311, 1043, 1549, 359, 710, 1579, 1548, 1103, 579, 769, 358, 709, 1411, 1547,
|
||||
1102, 578, 357, 1577, 1410, 1546, 1101, 707, 1576, 1409, 1545, 354 /*PRN32*/,
|
||||
705};
|
||||
const std::array<int32_t, 37> phase1 = {1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 8, 8, 8, 9, 9, 10};
|
||||
const std::array<int32_t, 37> phase2 = {3, 4, 5, 6, 8, 9, 10, 11, 7, 4, 5, 6, 8, 9, 10, 11, 5, 6, 8, 9, 10, 11, 6, 8, 9, 10, 11, 8, 9, 10, 11, 9, 10, 11, 10, 11, 11};
|
||||
|
||||
std::bitset<_code_length> G1{};
|
||||
std::bitset<_code_length> G2{};
|
||||
std::bitset<code_length> G1{};
|
||||
std::bitset<code_length> G2{};
|
||||
|
||||
std::bitset<11> G1_register(std::string("01010101010"));
|
||||
std::bitset<11> G2_register(std::string("01010101010"));
|
||||
@@ -50,7 +47,7 @@ void beidou_b1i_code_gen_int(own::span<int32_t> _dest, int32_t _prn, uint32_t _c
|
||||
int32_t prn_idx;
|
||||
|
||||
// compute delay array index for given PRN number
|
||||
prn_idx = _prn - 1;
|
||||
prn_idx = prn - 1;
|
||||
|
||||
// A simple error check
|
||||
if ((prn_idx < 0) || (prn_idx > 32))
|
||||
@@ -59,7 +56,7 @@ void beidou_b1i_code_gen_int(own::span<int32_t> _dest, int32_t _prn, uint32_t _c
|
||||
}
|
||||
|
||||
// Generate G1 & G2 Register
|
||||
for (lcv = 0; lcv < _code_length; lcv++)
|
||||
for (lcv = 0; lcv < code_length; lcv++)
|
||||
{
|
||||
G1[lcv] = G1_register[0];
|
||||
G2[lcv] = G2_register[-(phase1[prn_idx] - 11)] xor G2_register[-(phase2[prn_idx] - 11)];
|
||||
@@ -78,53 +75,53 @@ void beidou_b1i_code_gen_int(own::span<int32_t> _dest, int32_t _prn, uint32_t _c
|
||||
}
|
||||
|
||||
// Set the delay
|
||||
delay = _code_length - delays[prn_idx] * 0; //**********************************
|
||||
delay += _chip_shift;
|
||||
delay %= _code_length;
|
||||
delay = code_length - delays[prn_idx] * 0; //**********************************
|
||||
delay += chip_shift;
|
||||
delay %= code_length;
|
||||
|
||||
// Generate PRN from G1 and G2 Registers
|
||||
for (lcv = 0; lcv < _code_length; lcv++)
|
||||
for (lcv = 0; lcv < code_length; lcv++)
|
||||
{
|
||||
aux = G1[(lcv + _chip_shift) % _code_length] xor G2[delay];
|
||||
aux = G1[(lcv + chip_shift) % code_length] xor G2[delay];
|
||||
if (aux == true)
|
||||
{
|
||||
_dest[lcv] = 1;
|
||||
dest[lcv] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
_dest[lcv] = -1;
|
||||
dest[lcv] = -1;
|
||||
}
|
||||
|
||||
delay++;
|
||||
delay %= _code_length;
|
||||
delay %= code_length;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void beidou_b1i_code_gen_float(own::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)
|
||||
{
|
||||
constexpr uint32_t _code_length = 2046;
|
||||
std::array<int32_t, _code_length> b1i_code_int{};
|
||||
constexpr uint32_t code_length = 2046;
|
||||
std::array<int32_t, code_length> b1i_code_int{};
|
||||
|
||||
beidou_b1i_code_gen_int(own::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)
|
||||
for (uint32_t ii = 0; ii < code_length; ++ii)
|
||||
{
|
||||
_dest[ii] = static_cast<float>(b1i_code_int[ii]);
|
||||
dest[ii] = static_cast<float>(b1i_code_int[ii]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void beidou_b1i_code_gen_complex(own::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)
|
||||
{
|
||||
constexpr uint32_t _code_length = 2046;
|
||||
std::array<int32_t, _code_length> b1i_code_int{};
|
||||
constexpr uint32_t code_length = 2046;
|
||||
std::array<int32_t, code_length> b1i_code_int{};
|
||||
|
||||
beidou_b1i_code_gen_int(own::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)
|
||||
for (uint32_t ii = 0; ii < code_length; ++ii)
|
||||
{
|
||||
_dest[ii] = std::complex<float>(static_cast<float>(b1i_code_int[ii]), 0.0F);
|
||||
dest[ii] = std::complex<float>(static_cast<float>(b1i_code_int[ii]), 0.0F);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,22 +129,22 @@ void beidou_b1i_code_gen_complex(own::span<std::complex<float>> _dest, int32_t _
|
||||
/*
|
||||
* Generates complex BeiDou B1I code for the desired SV ID and sampled to specific sampling frequency
|
||||
*/
|
||||
void beidou_b1i_code_gen_complex_sampled(own::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 sampling_freq, uint32_t chip_shift)
|
||||
{
|
||||
constexpr int32_t _codeFreqBasis = 2046000; // Hz
|
||||
constexpr int32_t _codeLength = 2046;
|
||||
constexpr float _tc = 1.0 / static_cast<float>(_codeFreqBasis); // B1I chip period in sec
|
||||
constexpr int32_t codeFreqBasis = 2046000; // chips per second
|
||||
constexpr int32_t codeLength = 2046;
|
||||
constexpr float tc = 1.0 / static_cast<float>(codeFreqBasis); // B1I chip period in sec
|
||||
|
||||
const auto _samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / (static_cast<double>(_codeFreqBasis) / static_cast<double>(_codeLength)));
|
||||
const float _ts = 1.0F / static_cast<float>(_fs); // Sampling period in sec
|
||||
const auto samplesPerCode = static_cast<int32_t>(static_cast<double>(sampling_freq) / (static_cast<double>(codeFreqBasis) / static_cast<double>(codeLength)));
|
||||
const float ts = 1.0F / static_cast<float>(sampling_freq); // Sampling period in sec
|
||||
|
||||
std::array<std::complex<float>, 2046> _code{};
|
||||
int32_t _codeValueIndex;
|
||||
std::array<std::complex<float>, 2046> code_aux{};
|
||||
int32_t codeValueIndex;
|
||||
float aux;
|
||||
|
||||
beidou_b1i_code_gen_complex(_code, _prn, _chip_shift); // generate B1I code 1 sample per chip
|
||||
beidou_b1i_code_gen_complex(code_aux, prn, chip_shift); // generate B1I code 1 sample per chip
|
||||
|
||||
for (int32_t i = 0; i < _samplesPerCode; i++)
|
||||
for (int32_t i = 0; i < samplesPerCode; i++)
|
||||
{
|
||||
// === Digitizing ==================================================
|
||||
|
||||
@@ -156,20 +153,20 @@ void beidou_b1i_code_gen_complex_sampled(own::span<std::complex<float>> _dest, u
|
||||
// number of samples per millisecond (because one B1I code period is
|
||||
// one millisecond).
|
||||
|
||||
aux = (_ts * (static_cast<float>(i) + 1)) / _tc;
|
||||
_codeValueIndex = AUX_CEIL(aux) - 1;
|
||||
aux = (ts * (static_cast<float>(i) + 1)) / tc;
|
||||
codeValueIndex = AUX_CEIL(aux) - 1;
|
||||
|
||||
// --- Make the digitized version of the B1I code ------------------
|
||||
// The "upsampled" code is made by selecting values form the B1I code
|
||||
// chip array (caCode) for the time instances of each sample.
|
||||
if (i == _samplesPerCode - 1)
|
||||
// The upsampled code is made by selecting values from the B1I code
|
||||
// chip array for the time instances of each sample.
|
||||
if (i == samplesPerCode - 1)
|
||||
{
|
||||
// --- Correct the last index (due to number rounding issues) -----------
|
||||
_dest[i] = _code[_codeLength - 1];
|
||||
// Correct the last index (due to number rounding issues)
|
||||
dest[i] = code_aux[codeLength - 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
_dest[i] = _code[_codeValueIndex]; // repeat the chip -> upsample
|
||||
dest[i] = code_aux[codeValueIndex]; // repeat the chip -> upsample
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,13 +7,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
@@ -41,19 +38,16 @@ namespace own = gsl;
|
||||
|
||||
|
||||
//! Generates int32_t GPS L1 C/A code for the desired SV ID and code shift
|
||||
void beidou_b1i_code_gen_int(own::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(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(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(own::span<std::complex<float>> _dest, uint32_t _prn, int32_t _fs, uint32_t _chip_shift, uint32_t _ncodes);
|
||||
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
|
||||
void beidou_b1i_code_gen_complex_sampled(own::span<std::complex<float>> _dest, uint32_t _prn, int32_t _fs, uint32_t _chip_shift);
|
||||
void beidou_b1i_code_gen_complex(own::span<std::complex<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_sampled(own::span<std::complex<float>> dest, uint32_t prn, int32_t sampling_freq, uint32_t chip_shift);
|
||||
|
||||
|
||||
/** \} */
|
||||
|
||||
@@ -7,13 +7,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
@@ -26,11 +23,11 @@
|
||||
|
||||
const auto AUX_CEIL = [](float x) { return static_cast<int32_t>(static_cast<int64_t>((x) + 1)); };
|
||||
|
||||
void beidou_b3i_code_gen_int(own::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)
|
||||
{
|
||||
constexpr uint32_t _code_length = 10230;
|
||||
std::bitset<_code_length> G1{};
|
||||
std::bitset<_code_length> G2{};
|
||||
constexpr uint32_t code_length = 10230;
|
||||
std::bitset<code_length> G1{};
|
||||
std::bitset<code_length> G2{};
|
||||
auto G1_register = std::bitset<13>{}.set(); // All true
|
||||
auto G2_register = std::bitset<13>{}.set(); // All true
|
||||
auto G1_register_reset = std::bitset<13>{}.set();
|
||||
@@ -43,7 +40,7 @@ void beidou_b3i_code_gen_int(own::span<int> _dest, int32_t _prn, uint32_t _chip_
|
||||
uint32_t lcv;
|
||||
uint32_t lcv2;
|
||||
uint32_t delay;
|
||||
int32_t prn_idx = _prn - 1;
|
||||
int32_t prn_idx = prn - 1;
|
||||
|
||||
const std::array<std::bitset<13>, 63> G2_register_shifted =
|
||||
{std::bitset<13>(std::string("1010111111111")),
|
||||
@@ -120,7 +117,7 @@ void beidou_b3i_code_gen_int(own::span<int> _dest, int32_t _prn, uint32_t _chip_
|
||||
G2_register = G2_register_shifted[prn_idx];
|
||||
|
||||
// Generate G1 and G2 Register
|
||||
for (lcv = 0; lcv < _code_length; lcv++)
|
||||
for (lcv = 0; lcv < code_length; lcv++)
|
||||
{
|
||||
G1[lcv] = G1_register[0];
|
||||
G2[lcv] = G2_register[0];
|
||||
@@ -145,74 +142,74 @@ void beidou_b3i_code_gen_int(own::span<int> _dest, int32_t _prn, uint32_t _chip_
|
||||
}
|
||||
}
|
||||
|
||||
delay = _code_length;
|
||||
delay += _chip_shift;
|
||||
delay %= _code_length;
|
||||
delay = code_length;
|
||||
delay += chip_shift;
|
||||
delay %= code_length;
|
||||
|
||||
// Generate PRN from G1 and G2 Registers
|
||||
for (lcv = 0; lcv < _code_length; lcv++)
|
||||
for (lcv = 0; lcv < code_length; lcv++)
|
||||
{
|
||||
aux = G1[(lcv + _chip_shift) % _code_length] xor G2[delay];
|
||||
aux = G1[(lcv + chip_shift) % code_length] xor G2[delay];
|
||||
if (aux == true)
|
||||
{
|
||||
_dest[lcv] = 1;
|
||||
dest[lcv] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
_dest[lcv] = -1;
|
||||
dest[lcv] = -1;
|
||||
}
|
||||
|
||||
delay++;
|
||||
delay %= _code_length;
|
||||
delay %= code_length;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void beidou_b3i_code_gen_float(own::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)
|
||||
{
|
||||
constexpr uint32_t _code_length = 10230;
|
||||
std::array<int, _code_length> b3i_code_int{};
|
||||
constexpr uint32_t code_length = 10230;
|
||||
std::array<int, code_length> b3i_code_int{};
|
||||
|
||||
beidou_b3i_code_gen_int(b3i_code_int, _prn, _chip_shift);
|
||||
beidou_b3i_code_gen_int(b3i_code_int, prn, chip_shift);
|
||||
|
||||
for (uint32_t ii = 0; ii < _code_length; ++ii)
|
||||
for (uint32_t ii = 0; ii < code_length; ++ii)
|
||||
{
|
||||
_dest[ii] = static_cast<float>(b3i_code_int[ii]);
|
||||
dest[ii] = static_cast<float>(b3i_code_int[ii]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void beidou_b3i_code_gen_complex(own::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)
|
||||
{
|
||||
constexpr uint32_t _code_length = 10230;
|
||||
std::array<int, _code_length> b3i_code_int{};
|
||||
constexpr uint32_t code_length = 10230;
|
||||
std::array<int, code_length> b3i_code_int{};
|
||||
|
||||
beidou_b3i_code_gen_int(b3i_code_int, _prn, _chip_shift);
|
||||
beidou_b3i_code_gen_int(b3i_code_int, prn, chip_shift);
|
||||
|
||||
for (uint32_t ii = 0; ii < _code_length; ++ii)
|
||||
for (uint32_t ii = 0; ii < code_length; ++ii)
|
||||
{
|
||||
_dest[ii] = std::complex<float>(static_cast<float>(b3i_code_int[ii]), 0.0F);
|
||||
dest[ii] = std::complex<float>(static_cast<float>(b3i_code_int[ii]), 0.0F);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void beidou_b3i_code_gen_complex_sampled(own::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 sampling_freq, uint32_t chip_shift)
|
||||
{
|
||||
constexpr int32_t _codeFreqBasis = 10230000; // Hz
|
||||
constexpr int32_t _codeLength = 10230;
|
||||
constexpr float _tc = 1.0 / static_cast<float>(_codeFreqBasis); // B3I chip period in sec
|
||||
constexpr int32_t codeFreqBasis = 10230000; // chips per second
|
||||
constexpr int32_t codeLength = 10230;
|
||||
constexpr float tc = 1.0 / static_cast<float>(codeFreqBasis); // B3I chip period in sec
|
||||
|
||||
const float _ts = 1.0F / static_cast<float>(_fs); // Sampling period in secs
|
||||
const auto _samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / (static_cast<double>(_codeFreqBasis) / static_cast<double>(_codeLength)));
|
||||
const float ts = 1.0F / static_cast<float>(sampling_freq); // Sampling period in secs
|
||||
const auto samplesPerCode = static_cast<int32_t>(static_cast<double>(sampling_freq) / (static_cast<double>(codeFreqBasis) / static_cast<double>(codeLength)));
|
||||
|
||||
std::array<std::complex<float>, 10230> _code{};
|
||||
std::array<std::complex<float>, 10230> code_aux{};
|
||||
|
||||
int32_t _codeValueIndex;
|
||||
int32_t codeValueIndex;
|
||||
float aux;
|
||||
|
||||
beidou_b3i_code_gen_complex(_code, _prn, _chip_shift); // generate B3I code 1 sample per chip
|
||||
beidou_b3i_code_gen_complex(code_aux, prn, chip_shift); // generate B3I code 1 sample per chip
|
||||
|
||||
for (int32_t i = 0; i < _samplesPerCode; i++)
|
||||
for (int32_t i = 0; i < samplesPerCode; i++)
|
||||
{
|
||||
// === Digitizing ==================================================
|
||||
|
||||
@@ -221,20 +218,20 @@ void beidou_b3i_code_gen_complex_sampled(own::span<std::complex<float>> _dest, u
|
||||
// number of samples per millisecond (because one B3I code period is
|
||||
// one millisecond).
|
||||
|
||||
aux = (_ts * (static_cast<float>(i) + 1)) / _tc;
|
||||
_codeValueIndex = AUX_CEIL(aux) - 1;
|
||||
aux = (ts * (static_cast<float>(i) + 1)) / tc;
|
||||
codeValueIndex = AUX_CEIL(aux) - 1;
|
||||
|
||||
// --- Make the digitized version of the B3I code ------------------
|
||||
// The "upsampled" code is made by selecting values form the B3I code
|
||||
// chip array (caCode) for the time instances of each sample.
|
||||
if (i == _samplesPerCode - 1)
|
||||
// The upsampled code is made by selecting values from the B3I code
|
||||
// chip array for the time instances of each sample.
|
||||
if (i == samplesPerCode - 1)
|
||||
{
|
||||
// --- Correct the last index (due to number rounding issues) -----------
|
||||
_dest[i] = _code[_codeLength - 1];
|
||||
// Correct the last index (due to number rounding issues)
|
||||
dest[i] = code_aux[codeLength - 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
_dest[i] = _code[_codeValueIndex]; // repeat the chip -> upsample
|
||||
dest[i] = code_aux[codeValueIndex]; // repeat the chip -> upsample
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,13 +7,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
@@ -39,19 +36,16 @@ namespace own = gsl;
|
||||
|
||||
|
||||
//! Generates int BeiDou B3I code for the desired SV ID and code shift
|
||||
void beidou_b3i_code_gen_int(own::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(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(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(own::span<std::complex<float>> _dest, uint32_t _prn, int _fs, uint32_t _chip_shift, uint32_t _ncodes);
|
||||
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
|
||||
void beidou_b3i_code_gen_complex_sampled(own::span<std::complex<float>> _dest, uint32_t _prn, int _fs, uint32_t _chip_shift);
|
||||
void beidou_b3i_code_gen_complex(own::span<std::complex<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_sampled(own::span<std::complex<float>> dest, uint32_t prn, int sampling_freq, uint32_t chip_shift);
|
||||
|
||||
|
||||
/** \} */
|
||||
|
||||
@@ -6,13 +6,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
|
||||
@@ -6,13 +6,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
|
||||
@@ -6,13 +6,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
|
||||
@@ -6,13 +6,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
|
||||
@@ -6,13 +6,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
|
||||
@@ -6,13 +6,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
|
||||
@@ -6,13 +6,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
|
||||
@@ -6,13 +6,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
|
||||
@@ -6,13 +6,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
|
||||
@@ -6,13 +6,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
|
||||
@@ -6,13 +6,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
|
||||
@@ -6,13 +6,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
|
||||
@@ -6,13 +6,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
|
||||
@@ -6,13 +6,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
|
||||
@@ -7,13 +7,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
@@ -30,216 +27,216 @@
|
||||
#include <vector>
|
||||
|
||||
|
||||
void galileo_e1_code_gen_int(own::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_id, int32_t prn)
|
||||
{
|
||||
const std::string _galileo_signal = _Signal.data();
|
||||
const int32_t prn = _prn - 1;
|
||||
const std::string galileo_signal = signal_id.data();
|
||||
const int32_t prn_ = prn - 1;
|
||||
int32_t index = 0;
|
||||
|
||||
// A simple error check
|
||||
if ((_prn < 1) || (_prn > 50))
|
||||
if ((prn < 1) || (prn > 50))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_galileo_signal.rfind("1B") != std::string::npos && _galileo_signal.length() >= 2)
|
||||
if (galileo_signal.rfind("1B") != std::string::npos && galileo_signal.length() >= 2)
|
||||
{
|
||||
for (size_t i = 0; i < GALILEO_E1_B_PRIMARY_CODE_STR_LENGTH; i++)
|
||||
{
|
||||
hex_to_binary_converter(_dest.subspan(index, 4), GALILEO_E1_B_PRIMARY_CODE[prn][i]);
|
||||
hex_to_binary_converter(dest.subspan(index, 4), GALILEO_E1_B_PRIMARY_CODE[prn_][i]);
|
||||
index += 4;
|
||||
}
|
||||
}
|
||||
else if (_galileo_signal.rfind("1C") != std::string::npos && _galileo_signal.length() >= 2)
|
||||
else if (galileo_signal.rfind("1C") != std::string::npos && galileo_signal.length() >= 2)
|
||||
{
|
||||
for (size_t i = 0; i < GALILEO_E1_C_PRIMARY_CODE_STR_LENGTH; i++)
|
||||
{
|
||||
hex_to_binary_converter(_dest.subspan(index, 4), GALILEO_E1_C_PRIMARY_CODE[prn][i]);
|
||||
hex_to_binary_converter(dest.subspan(index, 4), GALILEO_E1_C_PRIMARY_CODE[prn_][i]);
|
||||
index += 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void galileo_e1_sinboc_11_gen_int(own::span<int> _dest, own::span<const int> _prn)
|
||||
void galileo_e1_sinboc_11_gen_int(own::span<int> dest, own::span<const int> prn)
|
||||
{
|
||||
constexpr uint32_t _length_in = GALILEO_E1_B_CODE_LENGTH_CHIPS;
|
||||
const auto _period = static_cast<uint32_t>(_dest.size() / _length_in);
|
||||
for (uint32_t i = 0; i < _length_in; i++)
|
||||
constexpr uint32_t length_in = GALILEO_E1_B_CODE_LENGTH_CHIPS;
|
||||
const auto period = static_cast<uint32_t>(dest.size() / length_in);
|
||||
for (uint32_t i = 0; i < length_in; i++)
|
||||
{
|
||||
for (uint32_t j = 0; j < (_period / 2); j++)
|
||||
for (uint32_t j = 0; j < (period / 2); j++)
|
||||
{
|
||||
_dest[i * _period + j] = _prn[i];
|
||||
dest[i * period + j] = prn[i];
|
||||
}
|
||||
for (uint32_t j = (_period / 2); j < _period; j++)
|
||||
for (uint32_t j = (period / 2); j < period; j++)
|
||||
{
|
||||
_dest[i * _period + j] = -_prn[i];
|
||||
dest[i * period + j] = -prn[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void galileo_e1_sinboc_61_gen_int(own::span<int> _dest, own::span<const int> _prn)
|
||||
void galileo_e1_sinboc_61_gen_int(own::span<int> dest, own::span<const int> prn)
|
||||
{
|
||||
constexpr uint32_t _length_in = GALILEO_E1_B_CODE_LENGTH_CHIPS;
|
||||
const auto _period = static_cast<uint32_t>(_dest.size() / _length_in);
|
||||
constexpr uint32_t length_in = GALILEO_E1_B_CODE_LENGTH_CHIPS;
|
||||
const auto period = static_cast<uint32_t>(dest.size() / length_in);
|
||||
|
||||
for (uint32_t i = 0; i < _length_in; i++)
|
||||
for (uint32_t i = 0; i < length_in; i++)
|
||||
{
|
||||
for (uint32_t j = 0; j < _period; j += 2)
|
||||
for (uint32_t j = 0; j < period; j += 2)
|
||||
{
|
||||
_dest[i * _period + j] = _prn[i];
|
||||
dest[i * period + j] = prn[i];
|
||||
}
|
||||
for (uint32_t j = 1; j < _period; j += 2)
|
||||
for (uint32_t j = 1; j < period; j += 2)
|
||||
{
|
||||
_dest[i * _period + j] = -_prn[i];
|
||||
dest[i * period + j] = -prn[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void galileo_e1_code_gen_sinboc11_float(own::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_id, uint32_t prn)
|
||||
{
|
||||
const auto _codeLength = static_cast<uint32_t>(GALILEO_E1_B_CODE_LENGTH_CHIPS);
|
||||
const auto codeLength = static_cast<uint32_t>(GALILEO_E1_B_CODE_LENGTH_CHIPS);
|
||||
std::array<int32_t, 4092> primary_code_E1_chips{};
|
||||
galileo_e1_code_gen_int(primary_code_E1_chips, _Signal, _prn); // generate Galileo E1 code, 1 sample per chip
|
||||
for (uint32_t i = 0; i < _codeLength; i++)
|
||||
galileo_e1_code_gen_int(primary_code_E1_chips, signal_id, prn); // generate Galileo E1 code, 1 sample per chip
|
||||
for (uint32_t i = 0; i < codeLength; i++)
|
||||
{
|
||||
_dest[2 * i] = static_cast<float>(primary_code_E1_chips[i]);
|
||||
_dest[2 * i + 1] = -_dest[2 * i];
|
||||
dest[2 * i] = static_cast<float>(primary_code_E1_chips[i]);
|
||||
dest[2 * i + 1] = -dest[2 * i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void galileo_e1_gen_float(own::span<float> _dest, own::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_id)
|
||||
{
|
||||
const auto _codeLength = _dest.size();
|
||||
const auto codeLength = dest.size();
|
||||
const float alpha = std::sqrt(10.0F / 11.0F);
|
||||
const float beta = std::sqrt(1.0F / 11.0F);
|
||||
const std::string _galileo_signal = _Signal.data();
|
||||
const std::string galileo_signal = signal_id.data();
|
||||
|
||||
std::vector<int32_t> sinboc_11(_codeLength);
|
||||
std::vector<int32_t> sinboc_61(_codeLength);
|
||||
std::vector<int32_t> sinboc_11(codeLength);
|
||||
std::vector<int32_t> sinboc_61(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
|
||||
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
|
||||
|
||||
if (_galileo_signal.rfind("1B") != std::string::npos && _galileo_signal.length() >= 2)
|
||||
if (galileo_signal.rfind("1B") != std::string::npos && galileo_signal.length() >= 2)
|
||||
{
|
||||
for (size_t i = 0; i < _codeLength; i++)
|
||||
for (size_t i = 0; i < codeLength; i++)
|
||||
{
|
||||
_dest[i] = alpha * static_cast<float>(sinboc_11[i]) +
|
||||
beta * static_cast<float>(sinboc_61[i]);
|
||||
dest[i] = alpha * static_cast<float>(sinboc_11[i]) +
|
||||
beta * static_cast<float>(sinboc_61[i]);
|
||||
}
|
||||
}
|
||||
else if (_galileo_signal.rfind("1C") != std::string::npos && _galileo_signal.length() >= 2)
|
||||
else if (galileo_signal.rfind("1C") != std::string::npos && galileo_signal.length() >= 2)
|
||||
{
|
||||
for (size_t i = 0; i < _codeLength; i++)
|
||||
for (size_t i = 0; i < codeLength; i++)
|
||||
{
|
||||
_dest[i] = alpha * static_cast<float>(sinboc_11[i]) -
|
||||
beta * static_cast<float>(sinboc_61[i]);
|
||||
dest[i] = alpha * static_cast<float>(sinboc_11[i]) -
|
||||
beta * static_cast<float>(sinboc_61[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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)
|
||||
void galileo_e1_code_gen_float_sampled(own::span<float> dest, const std::array<char, 3>& signal_id,
|
||||
bool cboc, uint32_t prn, int32_t sampling_freq, uint32_t chip_shift,
|
||||
bool secondary_flag)
|
||||
{
|
||||
constexpr int32_t _codeFreqBasis = GALILEO_E1_CODE_CHIP_RATE_CPS; // Hz
|
||||
const int32_t _samplesPerChip = (_cboc == true) ? 12 : 2;
|
||||
const uint32_t _codeLength = _samplesPerChip * GALILEO_E1_B_CODE_LENGTH_CHIPS;
|
||||
const std::string _galileo_signal = _Signal.data();
|
||||
auto _samplesPerCode = static_cast<uint32_t>(static_cast<double>(_fs) / (static_cast<double>(_codeFreqBasis) / GALILEO_E1_B_CODE_LENGTH_CHIPS));
|
||||
const uint32_t delay = ((static_cast<int32_t>(GALILEO_E1_B_CODE_LENGTH_CHIPS) - _chip_shift) % static_cast<int32_t>(GALILEO_E1_B_CODE_LENGTH_CHIPS)) * _samplesPerCode / GALILEO_E1_B_CODE_LENGTH_CHIPS;
|
||||
constexpr int32_t codeFreqBasis = GALILEO_E1_CODE_CHIP_RATE_CPS; // chips per second
|
||||
const int32_t samplesPerChip = (cboc == true) ? 12 : 2;
|
||||
const uint32_t codeLength = samplesPerChip * GALILEO_E1_B_CODE_LENGTH_CHIPS;
|
||||
const std::string galileo_signal = signal_id.data();
|
||||
auto samplesPerCode = static_cast<uint32_t>(static_cast<double>(sampling_freq) / (static_cast<double>(codeFreqBasis) / GALILEO_E1_B_CODE_LENGTH_CHIPS));
|
||||
const uint32_t delay = ((static_cast<int32_t>(GALILEO_E1_B_CODE_LENGTH_CHIPS) - chip_shift) % static_cast<int32_t>(GALILEO_E1_B_CODE_LENGTH_CHIPS)) * samplesPerCode / GALILEO_E1_B_CODE_LENGTH_CHIPS;
|
||||
|
||||
std::vector<int32_t> primary_code_E1_chips(static_cast<int32_t>(GALILEO_E1_B_CODE_LENGTH_CHIPS));
|
||||
|
||||
galileo_e1_code_gen_int(primary_code_E1_chips, _Signal, _prn); // generate Galileo E1 code, 1 sample per chip
|
||||
galileo_e1_code_gen_int(primary_code_E1_chips, signal_id, prn); // generate Galileo E1 code, 1 sample per chip
|
||||
|
||||
std::vector<float> _signal_E1(_codeLength);
|
||||
std::vector<float> signal_E1(codeLength);
|
||||
|
||||
if (_cboc == true)
|
||||
if (cboc == true)
|
||||
{
|
||||
galileo_e1_gen_float(_signal_E1, primary_code_E1_chips, _Signal); // generate cboc 12 samples per chip
|
||||
galileo_e1_gen_float(signal_E1, primary_code_E1_chips, signal_id); // generate cboc 12 samples per chip
|
||||
}
|
||||
else
|
||||
{
|
||||
std::vector<int32_t> _signal_E1_int(static_cast<int32_t>(_codeLength));
|
||||
galileo_e1_sinboc_11_gen_int(_signal_E1_int, primary_code_E1_chips); // generate sinboc(1,1) 2 samples per chip
|
||||
std::vector<int32_t> signal_E1_int(static_cast<int32_t>(codeLength));
|
||||
galileo_e1_sinboc_11_gen_int(signal_E1_int, primary_code_E1_chips); // generate sinboc(1,1) 2 samples per chip
|
||||
|
||||
for (uint32_t ii = 0; ii < _codeLength; ++ii)
|
||||
for (uint32_t ii = 0; ii < codeLength; ++ii)
|
||||
{
|
||||
_signal_E1[ii] = static_cast<float>(_signal_E1_int[ii]);
|
||||
signal_E1[ii] = static_cast<float>(signal_E1_int[ii]);
|
||||
}
|
||||
}
|
||||
|
||||
if (_fs != _samplesPerChip * _codeFreqBasis)
|
||||
if (sampling_freq != samplesPerChip * codeFreqBasis)
|
||||
{
|
||||
std::vector<float> _resampled_signal(_samplesPerCode);
|
||||
std::vector<float> resampled_signal(samplesPerCode);
|
||||
|
||||
resampler(_signal_E1, _resampled_signal, static_cast<float>(_samplesPerChip * _codeFreqBasis), _fs); // resamples code to fs
|
||||
resampler(signal_E1, resampled_signal, static_cast<float>(samplesPerChip * codeFreqBasis), sampling_freq); // resamples code to fs
|
||||
|
||||
_signal_E1 = std::move(_resampled_signal);
|
||||
signal_E1 = std::move(resampled_signal);
|
||||
}
|
||||
|
||||
if (_galileo_signal.rfind("1C") != std::string::npos && _galileo_signal.length() >= 2 && _secondary_flag)
|
||||
if (galileo_signal.rfind("1C") != std::string::npos && galileo_signal.length() >= 2 && secondary_flag)
|
||||
{
|
||||
std::vector<float> _signal_E1C_secondary(static_cast<int32_t>(GALILEO_E1_C_SECONDARY_CODE_LENGTH) * _samplesPerCode);
|
||||
std::vector<float> signal_E1C_secondary(static_cast<int32_t>(GALILEO_E1_C_SECONDARY_CODE_LENGTH) * samplesPerCode);
|
||||
for (uint32_t i = 0; i < static_cast<uint32_t>(GALILEO_E1_C_SECONDARY_CODE_LENGTH); i++)
|
||||
{
|
||||
for (uint32_t k = 0; k < _samplesPerCode; k++)
|
||||
for (uint32_t k = 0; k < samplesPerCode; k++)
|
||||
{
|
||||
_signal_E1C_secondary[i * _samplesPerCode + k] = _signal_E1[k] * (GALILEO_E1_C_SECONDARY_CODE[i] == '0' ? 1.0F : -1.0F);
|
||||
signal_E1C_secondary[i * samplesPerCode + k] = signal_E1[k] * (GALILEO_E1_C_SECONDARY_CODE[i] == '0' ? 1.0F : -1.0F);
|
||||
}
|
||||
}
|
||||
|
||||
_samplesPerCode *= static_cast<int32_t>(GALILEO_E1_C_SECONDARY_CODE_LENGTH);
|
||||
samplesPerCode *= static_cast<int32_t>(GALILEO_E1_C_SECONDARY_CODE_LENGTH);
|
||||
|
||||
_signal_E1 = std::move(_signal_E1C_secondary);
|
||||
signal_E1 = std::move(signal_E1C_secondary);
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < _samplesPerCode; i++)
|
||||
for (uint32_t i = 0; i < samplesPerCode; i++)
|
||||
{
|
||||
_dest[(i + delay) % _samplesPerCode] = _signal_E1[i];
|
||||
dest[(i + delay) % samplesPerCode] = signal_E1[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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)
|
||||
void galileo_e1_code_gen_complex_sampled(own::span<std::complex<float>> dest, const std::array<char, 3>& signal_id,
|
||||
bool cboc, uint32_t prn, int32_t sampling_freq, uint32_t chip_shift,
|
||||
bool secondary_flag)
|
||||
{
|
||||
constexpr int32_t _codeFreqBasis = GALILEO_E1_CODE_CHIP_RATE_CPS; // Hz
|
||||
const std::string _galileo_signal = _Signal.data();
|
||||
auto _samplesPerCode = static_cast<uint32_t>(static_cast<double>(_fs) /
|
||||
(static_cast<double>(_codeFreqBasis) / GALILEO_E1_B_CODE_LENGTH_CHIPS));
|
||||
constexpr int32_t codeFreqBasis = GALILEO_E1_CODE_CHIP_RATE_CPS; // Hz
|
||||
const std::string galileo_signal = signal_id.data();
|
||||
auto samplesPerCode = static_cast<uint32_t>(static_cast<double>(sampling_freq) /
|
||||
(static_cast<double>(codeFreqBasis) / GALILEO_E1_B_CODE_LENGTH_CHIPS));
|
||||
|
||||
if (_galileo_signal.rfind("1C") != std::string::npos && _galileo_signal.length() >= 2 && _secondary_flag)
|
||||
if (galileo_signal.rfind("1C") != std::string::npos && galileo_signal.length() >= 2 && secondary_flag)
|
||||
{
|
||||
_samplesPerCode *= static_cast<int32_t>(GALILEO_E1_C_SECONDARY_CODE_LENGTH);
|
||||
samplesPerCode *= static_cast<int32_t>(GALILEO_E1_C_SECONDARY_CODE_LENGTH);
|
||||
}
|
||||
|
||||
std::vector<float> real_code(_samplesPerCode);
|
||||
galileo_e1_code_gen_float_sampled(real_code, _Signal, _cboc, _prn, _fs, _chip_shift, _secondary_flag);
|
||||
std::vector<float> real_code(samplesPerCode);
|
||||
galileo_e1_code_gen_float_sampled(real_code, signal_id, cboc, prn, sampling_freq, chip_shift, secondary_flag);
|
||||
|
||||
for (uint32_t ii = 0; ii < _samplesPerCode; ++ii)
|
||||
for (uint32_t ii = 0; ii < samplesPerCode; ++ii)
|
||||
{
|
||||
_dest[ii] = std::complex<float>(real_code[ii], 0.0F);
|
||||
dest[ii] = std::complex<float>(real_code[ii], 0.0F);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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)
|
||||
void galileo_e1_code_gen_float_sampled(own::span<float> dest, const std::array<char, 3>& signal_id,
|
||||
bool cboc, uint32_t prn, int32_t sampling_freq, uint32_t chip_shift)
|
||||
{
|
||||
galileo_e1_code_gen_float_sampled(_dest, _Signal, _cboc, _prn, _fs, _chip_shift, false);
|
||||
galileo_e1_code_gen_float_sampled(dest, signal_id, cboc, prn, sampling_freq, chip_shift, false);
|
||||
}
|
||||
|
||||
|
||||
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)
|
||||
void galileo_e1_code_gen_complex_sampled(own::span<std::complex<float>> dest, const std::array<char, 3>& signal_id,
|
||||
bool cboc, uint32_t prn, int32_t sampling_freq, uint32_t chip_shift)
|
||||
{
|
||||
galileo_e1_code_gen_complex_sampled(_dest, _Signal, _cboc, _prn, _fs, _chip_shift, false);
|
||||
galileo_e1_code_gen_complex_sampled(dest, signal_id, cboc, prn, sampling_freq, chip_shift, false);
|
||||
}
|
||||
|
||||
@@ -7,13 +7,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
@@ -43,39 +40,39 @@ namespace own = gsl;
|
||||
* \brief This function generates Galileo E1 code (can select E1B or E1C sinboc).
|
||||
*
|
||||
*/
|
||||
void galileo_e1_code_gen_sinboc11_float(own::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_id, uint32_t prn);
|
||||
|
||||
/*!
|
||||
* \brief This function generates Galileo E1 code (can select E1B or E1C, cboc or sinboc
|
||||
* and the sample frequency _fs).
|
||||
* and the sample frequency sampling_freq).
|
||||
*
|
||||
*/
|
||||
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);
|
||||
void galileo_e1_code_gen_float_sampled(own::span<float> dest, const std::array<char, 3>& signal_id,
|
||||
bool cboc, uint32_t prn, int32_t sampling_freq, uint32_t chip_shift,
|
||||
bool secondary_flag);
|
||||
|
||||
/*!
|
||||
* \brief This function generates Galileo E1 code (can select E1B or E1C, cboc or sinboc
|
||||
* and the sample frequency _fs).
|
||||
* and the sample frequency sampling_freq).
|
||||
*
|
||||
*/
|
||||
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);
|
||||
void galileo_e1_code_gen_float_sampled(own::span<float> dest, const std::array<char, 3>& signal_id,
|
||||
bool cboc, uint32_t prn, int32_t sampling_freq, uint32_t chip_shift);
|
||||
|
||||
/*!
|
||||
* \brief This function generates Galileo E1 code (can select E1B or E1C, cboc or sinboc
|
||||
* and the sample frequency _fs).
|
||||
* and the sample frequency sampling_freq).
|
||||
*
|
||||
*/
|
||||
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);
|
||||
void galileo_e1_code_gen_complex_sampled(own::span<std::complex<float>> dest, const std::array<char, 3>& signal_id,
|
||||
bool cboc, uint32_t prn, int32_t sampling_freq, uint32_t chip_shift,
|
||||
bool secondary_flag);
|
||||
|
||||
/*!
|
||||
* \brief galileo_e1_code_gen_complex_sampled without _secondary_flag for backward compatibility.
|
||||
* \brief galileo_e1_code_gen_complex_sampled without secondary_flag for backward compatibility.
|
||||
*/
|
||||
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);
|
||||
void galileo_e1_code_gen_complex_sampled(own::span<std::complex<float>> dest, const std::array<char, 3>& signal_id,
|
||||
bool cboc, uint32_t prn, int32_t sampling_freq, uint32_t chip_shift);
|
||||
|
||||
|
||||
/** \} */
|
||||
|
||||
@@ -9,13 +9,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
@@ -31,189 +28,189 @@
|
||||
#include <vector>
|
||||
|
||||
|
||||
void galileo_e5_a_code_gen_complex_primary(own::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_id)
|
||||
{
|
||||
const uint32_t prn = _prn - 1;
|
||||
const uint32_t prn_ = prn - 1;
|
||||
uint32_t index = 0;
|
||||
std::array<int32_t, 4> a{};
|
||||
if ((_prn < 1) || (_prn > 50))
|
||||
if ((prn < 1) || (prn > 50))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (_Signal[0] == '5' && _Signal[1] == 'Q')
|
||||
if (signal_id[0] == '5' && signal_id[1] == 'Q')
|
||||
{
|
||||
for (size_t i = 0; i < GALILEO_E5A_Q_PRIMARY_CODE_STR_LENGTH - 1; i++)
|
||||
{
|
||||
hex_to_binary_converter(a, GALILEO_E5A_Q_PRIMARY_CODE[prn][i]);
|
||||
_dest[index] = std::complex<float>(static_cast<float>(a[0]), 0.0);
|
||||
_dest[index + 1] = std::complex<float>(static_cast<float>(a[1]), 0.0);
|
||||
_dest[index + 2] = std::complex<float>(static_cast<float>(a[2]), 0.0);
|
||||
_dest[index + 3] = std::complex<float>(static_cast<float>(a[3]), 0.0);
|
||||
hex_to_binary_converter(a, GALILEO_E5A_Q_PRIMARY_CODE[prn_][i]);
|
||||
dest[index] = std::complex<float>(static_cast<float>(a[0]), 0.0);
|
||||
dest[index + 1] = std::complex<float>(static_cast<float>(a[1]), 0.0);
|
||||
dest[index + 2] = std::complex<float>(static_cast<float>(a[2]), 0.0);
|
||||
dest[index + 3] = std::complex<float>(static_cast<float>(a[3]), 0.0);
|
||||
index = index + 4;
|
||||
}
|
||||
// last 2 bits are filled up zeros
|
||||
hex_to_binary_converter(a, GALILEO_E5A_Q_PRIMARY_CODE[prn][GALILEO_E5A_Q_PRIMARY_CODE_STR_LENGTH - 1]);
|
||||
_dest[index] = std::complex<float>(static_cast<float>(a[0]), 0.0);
|
||||
_dest[index + 1] = std::complex<float>(static_cast<float>(a[1]), 0.0);
|
||||
hex_to_binary_converter(a, GALILEO_E5A_Q_PRIMARY_CODE[prn_][GALILEO_E5A_Q_PRIMARY_CODE_STR_LENGTH - 1]);
|
||||
dest[index] = std::complex<float>(static_cast<float>(a[0]), 0.0);
|
||||
dest[index + 1] = std::complex<float>(static_cast<float>(a[1]), 0.0);
|
||||
}
|
||||
else if (_Signal[0] == '5' && _Signal[1] == 'I')
|
||||
else if (signal_id[0] == '5' && signal_id[1] == 'I')
|
||||
{
|
||||
for (size_t i = 0; i < GALILEO_E5A_I_PRIMARY_CODE_STR_LENGTH - 1; i++)
|
||||
{
|
||||
hex_to_binary_converter(a, GALILEO_E5A_I_PRIMARY_CODE[prn][i]);
|
||||
_dest[index] = std::complex<float>(static_cast<float>(a[0]), 0.0);
|
||||
_dest[index + 1] = std::complex<float>(static_cast<float>(a[1]), 0.0);
|
||||
_dest[index + 2] = std::complex<float>(static_cast<float>(a[2]), 0.0);
|
||||
_dest[index + 3] = std::complex<float>(static_cast<float>(a[3]), 0.0);
|
||||
hex_to_binary_converter(a, GALILEO_E5A_I_PRIMARY_CODE[prn_][i]);
|
||||
dest[index] = std::complex<float>(static_cast<float>(a[0]), 0.0);
|
||||
dest[index + 1] = std::complex<float>(static_cast<float>(a[1]), 0.0);
|
||||
dest[index + 2] = std::complex<float>(static_cast<float>(a[2]), 0.0);
|
||||
dest[index + 3] = std::complex<float>(static_cast<float>(a[3]), 0.0);
|
||||
index = index + 4;
|
||||
}
|
||||
// last 2 bits are filled up zeros
|
||||
hex_to_binary_converter(a, GALILEO_E5A_I_PRIMARY_CODE[prn][GALILEO_E5A_I_PRIMARY_CODE_STR_LENGTH - 1]);
|
||||
_dest[index] = std::complex<float>(static_cast<float>(a[0]), 0.0);
|
||||
_dest[index + 1] = std::complex<float>(static_cast<float>(a[1]), 0.0);
|
||||
hex_to_binary_converter(a, GALILEO_E5A_I_PRIMARY_CODE[prn_][GALILEO_E5A_I_PRIMARY_CODE_STR_LENGTH - 1]);
|
||||
dest[index] = std::complex<float>(static_cast<float>(a[0]), 0.0);
|
||||
dest[index + 1] = std::complex<float>(static_cast<float>(a[1]), 0.0);
|
||||
}
|
||||
else if (_Signal[0] == '5' && _Signal[1] == 'X')
|
||||
else if (signal_id[0] == '5' && signal_id[1] == 'X')
|
||||
{
|
||||
std::array<int32_t, 4> b{};
|
||||
for (size_t i = 0; i < GALILEO_E5A_I_PRIMARY_CODE_STR_LENGTH - 1; i++)
|
||||
{
|
||||
hex_to_binary_converter(a, GALILEO_E5A_I_PRIMARY_CODE[prn][i]);
|
||||
hex_to_binary_converter(b, GALILEO_E5A_Q_PRIMARY_CODE[prn][i]);
|
||||
_dest[index] = std::complex<float>(static_cast<float>(a[0]), static_cast<float>(b[0]));
|
||||
_dest[index + 1] = std::complex<float>(static_cast<float>(a[1]), static_cast<float>(b[1]));
|
||||
_dest[index + 2] = std::complex<float>(static_cast<float>(a[2]), static_cast<float>(b[2]));
|
||||
_dest[index + 3] = std::complex<float>(static_cast<float>(a[3]), static_cast<float>(b[3]));
|
||||
hex_to_binary_converter(a, GALILEO_E5A_I_PRIMARY_CODE[prn_][i]);
|
||||
hex_to_binary_converter(b, GALILEO_E5A_Q_PRIMARY_CODE[prn_][i]);
|
||||
dest[index] = std::complex<float>(static_cast<float>(a[0]), static_cast<float>(b[0]));
|
||||
dest[index + 1] = std::complex<float>(static_cast<float>(a[1]), static_cast<float>(b[1]));
|
||||
dest[index + 2] = std::complex<float>(static_cast<float>(a[2]), static_cast<float>(b[2]));
|
||||
dest[index + 3] = std::complex<float>(static_cast<float>(a[3]), static_cast<float>(b[3]));
|
||||
index = index + 4;
|
||||
}
|
||||
// last 2 bits are filled up zeros
|
||||
hex_to_binary_converter(a, GALILEO_E5A_I_PRIMARY_CODE[prn][GALILEO_E5A_I_PRIMARY_CODE_STR_LENGTH - 1]);
|
||||
hex_to_binary_converter(b, GALILEO_E5A_Q_PRIMARY_CODE[prn][GALILEO_E5A_Q_PRIMARY_CODE_STR_LENGTH - 1]);
|
||||
_dest[index] = std::complex<float>(static_cast<float>(a[0]), static_cast<float>(b[0]));
|
||||
_dest[index + 1] = std::complex<float>(static_cast<float>(a[1]), static_cast<float>(b[1]));
|
||||
hex_to_binary_converter(a, GALILEO_E5A_I_PRIMARY_CODE[prn_][GALILEO_E5A_I_PRIMARY_CODE_STR_LENGTH - 1]);
|
||||
hex_to_binary_converter(b, GALILEO_E5A_Q_PRIMARY_CODE[prn_][GALILEO_E5A_Q_PRIMARY_CODE_STR_LENGTH - 1]);
|
||||
dest[index] = std::complex<float>(static_cast<float>(a[0]), static_cast<float>(b[0]));
|
||||
dest[index + 1] = std::complex<float>(static_cast<float>(a[1]), static_cast<float>(b[1]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void galileo_e5_a_code_gen_complex_sampled(own::span<std::complex<float>> _dest,
|
||||
uint32_t _prn,
|
||||
const std::array<char, 3>& _Signal,
|
||||
int32_t _fs,
|
||||
uint32_t _chip_shift)
|
||||
void galileo_e5_a_code_gen_complex_sampled(own::span<std::complex<float>> dest,
|
||||
uint32_t prn,
|
||||
const std::array<char, 3>& signal_id,
|
||||
int32_t sampling_freq,
|
||||
uint32_t chip_shift)
|
||||
{
|
||||
constexpr uint32_t _codeLength = GALILEO_E5A_CODE_LENGTH_CHIPS;
|
||||
constexpr int32_t _codeFreqBasis = GALILEO_E5A_CODE_CHIP_RATE_CPS;
|
||||
constexpr uint32_t codeLength = GALILEO_E5A_CODE_LENGTH_CHIPS;
|
||||
constexpr int32_t codeFreqBasis = GALILEO_E5A_CODE_CHIP_RATE_CPS;
|
||||
|
||||
const auto _samplesPerCode = static_cast<uint32_t>(static_cast<double>(_fs) / (static_cast<double>(_codeFreqBasis) / static_cast<double>(_codeLength)));
|
||||
const uint32_t delay = ((_codeLength - _chip_shift) % _codeLength) * _samplesPerCode / _codeLength;
|
||||
const auto samplesPerCode = static_cast<uint32_t>(static_cast<double>(sampling_freq) / (static_cast<double>(codeFreqBasis) / static_cast<double>(codeLength)));
|
||||
const uint32_t delay = ((codeLength - chip_shift) % codeLength) * samplesPerCode / codeLength;
|
||||
|
||||
std::vector<std::complex<float>> _code(_codeLength);
|
||||
galileo_e5_a_code_gen_complex_primary(_code, _prn, _Signal);
|
||||
std::vector<std::complex<float>> code_aux(codeLength);
|
||||
galileo_e5_a_code_gen_complex_primary(code_aux, prn, signal_id);
|
||||
|
||||
if (_fs != _codeFreqBasis)
|
||||
if (sampling_freq != codeFreqBasis)
|
||||
{
|
||||
std::vector<std::complex<float>> _resampled_signal(_samplesPerCode);
|
||||
resampler(_code, _resampled_signal, _codeFreqBasis, _fs); // resamples code to fs
|
||||
_code = std::move(_resampled_signal);
|
||||
std::vector<std::complex<float>> resampled_signal_aux(samplesPerCode);
|
||||
resampler(code_aux, resampled_signal_aux, codeFreqBasis, sampling_freq); // resamples code to sampling_freq
|
||||
code_aux = std::move(resampled_signal_aux);
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < _samplesPerCode; i++)
|
||||
for (uint32_t i = 0; i < samplesPerCode; i++)
|
||||
{
|
||||
_dest[(i + delay) % _samplesPerCode] = _code[i];
|
||||
dest[(i + delay) % samplesPerCode] = code_aux[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void galileo_e5_b_code_gen_complex_primary(own::span<std::complex<float>> _dest,
|
||||
int32_t _prn,
|
||||
const std::array<char, 3>& _Signal)
|
||||
void galileo_e5_b_code_gen_complex_primary(own::span<std::complex<float>> dest,
|
||||
int32_t prn,
|
||||
const std::array<char, 3>& signal_id)
|
||||
{
|
||||
const uint32_t prn = _prn - 1;
|
||||
const uint32_t prn_ = prn - 1;
|
||||
uint32_t index = 0;
|
||||
std::array<int32_t, 4> a{};
|
||||
if ((_prn < 1) || (_prn > 50))
|
||||
if ((prn < 1) || (prn > 50))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (_Signal[0] == '7' && _Signal[1] == 'Q')
|
||||
if (signal_id[0] == '7' && signal_id[1] == 'Q')
|
||||
{
|
||||
for (size_t i = 0; i < GALILEO_E5B_Q_PRIMARY_CODE_STR_LENGTH - 1; i++)
|
||||
{
|
||||
hex_to_binary_converter(a, GALILEO_E5B_Q_PRIMARY_CODE[prn][i]);
|
||||
_dest[index] = std::complex<float>(static_cast<float>(a[0]), 0.0);
|
||||
_dest[index + 1] = std::complex<float>(static_cast<float>(a[1]), 0.0);
|
||||
_dest[index + 2] = std::complex<float>(static_cast<float>(a[2]), 0.0);
|
||||
_dest[index + 3] = std::complex<float>(static_cast<float>(a[3]), 0.0);
|
||||
hex_to_binary_converter(a, GALILEO_E5B_Q_PRIMARY_CODE[prn_][i]);
|
||||
dest[index] = std::complex<float>(static_cast<float>(a[0]), 0.0);
|
||||
dest[index + 1] = std::complex<float>(static_cast<float>(a[1]), 0.0);
|
||||
dest[index + 2] = std::complex<float>(static_cast<float>(a[2]), 0.0);
|
||||
dest[index + 3] = std::complex<float>(static_cast<float>(a[3]), 0.0);
|
||||
index = index + 4;
|
||||
}
|
||||
// last 2 bits are filled up zeros
|
||||
hex_to_binary_converter(a, GALILEO_E5B_Q_PRIMARY_CODE[prn][GALILEO_E5B_Q_PRIMARY_CODE_STR_LENGTH - 1]);
|
||||
_dest[index] = std::complex<float>(static_cast<float>(a[0]), 0.0);
|
||||
_dest[index + 1] = std::complex<float>(static_cast<float>(a[1]), 0.0);
|
||||
hex_to_binary_converter(a, GALILEO_E5B_Q_PRIMARY_CODE[prn_][GALILEO_E5B_Q_PRIMARY_CODE_STR_LENGTH - 1]);
|
||||
dest[index] = std::complex<float>(static_cast<float>(a[0]), 0.0);
|
||||
dest[index + 1] = std::complex<float>(static_cast<float>(a[1]), 0.0);
|
||||
}
|
||||
else if (_Signal[0] == '7' && _Signal[1] == 'I')
|
||||
else if (signal_id[0] == '7' && signal_id[1] == 'I')
|
||||
{
|
||||
for (size_t i = 0; i < GALILEO_E5B_I_PRIMARY_CODE_STR_LENGTH - 1; i++)
|
||||
{
|
||||
hex_to_binary_converter(a, GALILEO_E5B_I_PRIMARY_CODE[prn][i]);
|
||||
_dest[index] = std::complex<float>(static_cast<float>(a[0]), 0.0);
|
||||
_dest[index + 1] = std::complex<float>(static_cast<float>(a[1]), 0.0);
|
||||
_dest[index + 2] = std::complex<float>(static_cast<float>(a[2]), 0.0);
|
||||
_dest[index + 3] = std::complex<float>(static_cast<float>(a[3]), 0.0);
|
||||
hex_to_binary_converter(a, GALILEO_E5B_I_PRIMARY_CODE[prn_][i]);
|
||||
dest[index] = std::complex<float>(static_cast<float>(a[0]), 0.0);
|
||||
dest[index + 1] = std::complex<float>(static_cast<float>(a[1]), 0.0);
|
||||
dest[index + 2] = std::complex<float>(static_cast<float>(a[2]), 0.0);
|
||||
dest[index + 3] = std::complex<float>(static_cast<float>(a[3]), 0.0);
|
||||
index = index + 4;
|
||||
}
|
||||
// last 2 bits are filled up zeros
|
||||
hex_to_binary_converter(a, GALILEO_E5B_I_PRIMARY_CODE[prn][GALILEO_E5B_I_PRIMARY_CODE_STR_LENGTH - 1]);
|
||||
_dest[index] = std::complex<float>(static_cast<float>(a[0]), 0.0);
|
||||
_dest[index + 1] = std::complex<float>(static_cast<float>(a[1]), 0.0);
|
||||
hex_to_binary_converter(a, GALILEO_E5B_I_PRIMARY_CODE[prn_][GALILEO_E5B_I_PRIMARY_CODE_STR_LENGTH - 1]);
|
||||
dest[index] = std::complex<float>(static_cast<float>(a[0]), 0.0);
|
||||
dest[index + 1] = std::complex<float>(static_cast<float>(a[1]), 0.0);
|
||||
}
|
||||
else if (_Signal[0] == '7' && _Signal[1] == 'X')
|
||||
else if (signal_id[0] == '7' && signal_id[1] == 'X')
|
||||
{
|
||||
std::array<int32_t, 4> b{};
|
||||
for (size_t i = 0; i < GALILEO_E5B_I_PRIMARY_CODE_STR_LENGTH - 1; i++)
|
||||
{
|
||||
hex_to_binary_converter(a, GALILEO_E5B_I_PRIMARY_CODE[prn][i]);
|
||||
hex_to_binary_converter(b, GALILEO_E5B_Q_PRIMARY_CODE[prn][i]);
|
||||
_dest[index] = std::complex<float>(static_cast<float>(a[0]), static_cast<float>(b[0]));
|
||||
_dest[index + 1] = std::complex<float>(static_cast<float>(a[1]), static_cast<float>(b[1]));
|
||||
_dest[index + 2] = std::complex<float>(static_cast<float>(a[2]), static_cast<float>(b[2]));
|
||||
_dest[index + 3] = std::complex<float>(static_cast<float>(a[3]), static_cast<float>(b[3]));
|
||||
hex_to_binary_converter(a, GALILEO_E5B_I_PRIMARY_CODE[prn_][i]);
|
||||
hex_to_binary_converter(b, GALILEO_E5B_Q_PRIMARY_CODE[prn_][i]);
|
||||
dest[index] = std::complex<float>(static_cast<float>(a[0]), static_cast<float>(b[0]));
|
||||
dest[index + 1] = std::complex<float>(static_cast<float>(a[1]), static_cast<float>(b[1]));
|
||||
dest[index + 2] = std::complex<float>(static_cast<float>(a[2]), static_cast<float>(b[2]));
|
||||
dest[index + 3] = std::complex<float>(static_cast<float>(a[3]), static_cast<float>(b[3]));
|
||||
index = index + 4;
|
||||
}
|
||||
// last 2 bits are filled up zeros
|
||||
hex_to_binary_converter(a, GALILEO_E5B_I_PRIMARY_CODE[prn][GALILEO_E5B_I_PRIMARY_CODE_STR_LENGTH - 1]);
|
||||
hex_to_binary_converter(b, GALILEO_E5B_Q_PRIMARY_CODE[prn][GALILEO_E5B_Q_PRIMARY_CODE_STR_LENGTH - 1]);
|
||||
_dest[index] = std::complex<float>(static_cast<float>(a[0]), static_cast<float>(b[0]));
|
||||
_dest[index + 1] = std::complex<float>(static_cast<float>(a[1]), static_cast<float>(b[1]));
|
||||
hex_to_binary_converter(a, GALILEO_E5B_I_PRIMARY_CODE[prn_][GALILEO_E5B_I_PRIMARY_CODE_STR_LENGTH - 1]);
|
||||
hex_to_binary_converter(b, GALILEO_E5B_Q_PRIMARY_CODE[prn_][GALILEO_E5B_Q_PRIMARY_CODE_STR_LENGTH - 1]);
|
||||
dest[index] = std::complex<float>(static_cast<float>(a[0]), static_cast<float>(b[0]));
|
||||
dest[index + 1] = std::complex<float>(static_cast<float>(a[1]), static_cast<float>(b[1]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void galileo_e5_b_code_gen_complex_sampled(own::span<std::complex<float>> _dest,
|
||||
uint32_t _prn,
|
||||
const std::array<char, 3>& _Signal,
|
||||
int32_t _fs,
|
||||
uint32_t _chip_shift)
|
||||
void galileo_e5_b_code_gen_complex_sampled(own::span<std::complex<float>> dest,
|
||||
uint32_t prn,
|
||||
const std::array<char, 3>& signal_id,
|
||||
int32_t sampling_freq,
|
||||
uint32_t chip_shift)
|
||||
{
|
||||
constexpr uint32_t _codeLength = GALILEO_E5B_CODE_LENGTH_CHIPS;
|
||||
constexpr int32_t _codeFreqBasis = GALILEO_E5B_CODE_CHIP_RATE_CPS;
|
||||
constexpr uint32_t codeLength = GALILEO_E5B_CODE_LENGTH_CHIPS;
|
||||
constexpr int32_t codeFreqBasis = GALILEO_E5B_CODE_CHIP_RATE_CPS;
|
||||
|
||||
const auto _samplesPerCode = static_cast<uint32_t>(static_cast<double>(_fs) / (static_cast<double>(_codeFreqBasis) / static_cast<double>(_codeLength)));
|
||||
const uint32_t delay = ((_codeLength - _chip_shift) % _codeLength) * _samplesPerCode / _codeLength;
|
||||
const auto samplesPerCode = static_cast<uint32_t>(static_cast<double>(sampling_freq) / (static_cast<double>(codeFreqBasis) / static_cast<double>(codeLength)));
|
||||
const uint32_t delay = ((codeLength - chip_shift) % codeLength) * samplesPerCode / codeLength;
|
||||
|
||||
std::vector<std::complex<float>> _code(_codeLength);
|
||||
galileo_e5_b_code_gen_complex_primary(_code, _prn, _Signal);
|
||||
std::vector<std::complex<float>> code_aux(codeLength);
|
||||
galileo_e5_b_code_gen_complex_primary(code_aux, prn, signal_id);
|
||||
|
||||
if (_fs != _codeFreqBasis)
|
||||
if (sampling_freq != codeFreqBasis)
|
||||
{
|
||||
std::vector<std::complex<float>> _resampled_signal(_samplesPerCode);
|
||||
resampler(_code, _resampled_signal, _codeFreqBasis, _fs); // resamples code to fs
|
||||
_code = std::move(_resampled_signal);
|
||||
std::vector<std::complex<float>> resampled_signal_aux(samplesPerCode);
|
||||
resampler(code_aux, resampled_signal_aux, codeFreqBasis, sampling_freq); // resamples code to sampling_freq
|
||||
code_aux = std::move(resampled_signal_aux);
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < _samplesPerCode; i++)
|
||||
for (uint32_t i = 0; i < samplesPerCode; i++)
|
||||
{
|
||||
_dest[(i + delay) % _samplesPerCode] = _code[i];
|
||||
dest[(i + delay) % samplesPerCode] = code_aux[i];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,13 +9,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
@@ -44,39 +41,39 @@ namespace own = gsl;
|
||||
/*!
|
||||
* \brief Generates Galileo E5a code at 1 sample/chip
|
||||
*/
|
||||
void galileo_e5_a_code_gen_complex_primary(own::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_id);
|
||||
|
||||
|
||||
/*!
|
||||
* \brief Generates Galileo E5a complex code, shifted to the desired chip and
|
||||
* sampled at a frequency fs
|
||||
* sampled at a frequency sampling_freq
|
||||
*/
|
||||
void galileo_e5_a_code_gen_complex_sampled(own::span<std::complex<float>> _dest,
|
||||
uint32_t _prn,
|
||||
const std::array<char, 3>& _Signal,
|
||||
int32_t _fs,
|
||||
uint32_t _chip_shift);
|
||||
void galileo_e5_a_code_gen_complex_sampled(own::span<std::complex<float>> dest,
|
||||
uint32_t prn,
|
||||
const std::array<char, 3>& signal_id,
|
||||
int32_t sampling_freq,
|
||||
uint32_t chip_shift);
|
||||
|
||||
|
||||
/*!
|
||||
* \brief Generates Galileo E5b code at 1 sample/chip
|
||||
*/
|
||||
void galileo_e5_b_code_gen_complex_primary(own::span<std::complex<float>> _dest,
|
||||
int32_t _prn,
|
||||
const std::array<char, 3>& _Signal);
|
||||
void galileo_e5_b_code_gen_complex_primary(own::span<std::complex<float>> dest,
|
||||
int32_t prn,
|
||||
const std::array<char, 3>& signal_id);
|
||||
|
||||
|
||||
/*!
|
||||
* \brief Generates Galileo E5b complex code, shifted to the desired chip and
|
||||
* sampled at a frequency fs
|
||||
* sampled at a frequency sampling_freq
|
||||
*/
|
||||
void galileo_e5_b_code_gen_complex_sampled(own::span<std::complex<float>> _dest,
|
||||
uint32_t _prn,
|
||||
const std::array<char, 3>& _Signal,
|
||||
int32_t _fs,
|
||||
uint32_t _chip_shift);
|
||||
void galileo_e5_b_code_gen_complex_sampled(own::span<std::complex<float>> dest,
|
||||
uint32_t prn,
|
||||
const std::array<char, 3>& signal_id,
|
||||
int32_t sampling_freq,
|
||||
uint32_t chip_shift);
|
||||
|
||||
|
||||
/** \} */
|
||||
|
||||
@@ -7,13 +7,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
@@ -26,222 +23,222 @@
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
void galileo_e6_b_code_gen_complex_primary(own::span<std::complex<float>> _dest,
|
||||
int32_t _prn)
|
||||
void galileo_e6_b_code_gen_complex_primary(own::span<std::complex<float>> dest,
|
||||
int32_t prn)
|
||||
{
|
||||
const uint32_t prn = _prn - 1;
|
||||
const uint32_t prn_ = prn - 1;
|
||||
uint32_t index = 0;
|
||||
std::array<int32_t, 4> a{};
|
||||
if ((_prn < 1) || (_prn > 50))
|
||||
if ((prn < 1) || (prn > 50))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < GALILEO_E6_B_PRIMARY_CODE_STR_LENGTH - 1; i++)
|
||||
{
|
||||
hex_to_binary_converter(a, GALILEO_E6_B_PRIMARY_CODE[prn][i]);
|
||||
_dest[index] = std::complex<float>(static_cast<float>(a[0]), 0.0);
|
||||
_dest[index + 1] = std::complex<float>(static_cast<float>(a[1]), 0.0);
|
||||
_dest[index + 2] = std::complex<float>(static_cast<float>(a[2]), 0.0);
|
||||
_dest[index + 3] = std::complex<float>(static_cast<float>(a[3]), 0.0);
|
||||
hex_to_binary_converter(a, GALILEO_E6_B_PRIMARY_CODE[prn_][i]);
|
||||
dest[index] = std::complex<float>(static_cast<float>(a[0]), 0.0);
|
||||
dest[index + 1] = std::complex<float>(static_cast<float>(a[1]), 0.0);
|
||||
dest[index + 2] = std::complex<float>(static_cast<float>(a[2]), 0.0);
|
||||
dest[index + 3] = std::complex<float>(static_cast<float>(a[3]), 0.0);
|
||||
index = index + 4;
|
||||
}
|
||||
// last bit is filled up with a zero
|
||||
hex_to_binary_converter(a, GALILEO_E6_B_PRIMARY_CODE[prn][GALILEO_E6_B_PRIMARY_CODE_STR_LENGTH - 1]);
|
||||
_dest[index] = std::complex<float>(static_cast<float>(a[0]), 0.0);
|
||||
_dest[index + 1] = std::complex<float>(static_cast<float>(a[1]), 0.0);
|
||||
_dest[index + 2] = std::complex<float>(static_cast<float>(a[2]), 0.0);
|
||||
hex_to_binary_converter(a, GALILEO_E6_B_PRIMARY_CODE[prn_][GALILEO_E6_B_PRIMARY_CODE_STR_LENGTH - 1]);
|
||||
dest[index] = std::complex<float>(static_cast<float>(a[0]), 0.0);
|
||||
dest[index + 1] = std::complex<float>(static_cast<float>(a[1]), 0.0);
|
||||
dest[index + 2] = std::complex<float>(static_cast<float>(a[2]), 0.0);
|
||||
}
|
||||
|
||||
|
||||
void galileo_e6_b_code_gen_float_primary(own::span<float> _dest, int32_t _prn)
|
||||
void galileo_e6_b_code_gen_float_primary(own::span<float> dest, int32_t prn)
|
||||
{
|
||||
const uint32_t prn = _prn - 1;
|
||||
const uint32_t prn_ = prn - 1;
|
||||
uint32_t index = 0;
|
||||
std::array<int32_t, 4> a{};
|
||||
if ((_prn < 1) || (_prn > 50))
|
||||
if ((prn < 1) || (prn > 50))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < GALILEO_E6_B_PRIMARY_CODE_STR_LENGTH - 1; i++)
|
||||
{
|
||||
hex_to_binary_converter(a, GALILEO_E6_B_PRIMARY_CODE[prn][i]);
|
||||
_dest[index] = static_cast<float>(a[0]);
|
||||
_dest[index + 1] = static_cast<float>(a[1]);
|
||||
_dest[index + 2] = static_cast<float>(a[2]);
|
||||
_dest[index + 3] = static_cast<float>(a[3]);
|
||||
hex_to_binary_converter(a, GALILEO_E6_B_PRIMARY_CODE[prn_][i]);
|
||||
dest[index] = static_cast<float>(a[0]);
|
||||
dest[index + 1] = static_cast<float>(a[1]);
|
||||
dest[index + 2] = static_cast<float>(a[2]);
|
||||
dest[index + 3] = static_cast<float>(a[3]);
|
||||
index = index + 4;
|
||||
}
|
||||
// last bit is filled up with a zero
|
||||
hex_to_binary_converter(a, GALILEO_E6_B_PRIMARY_CODE[prn][GALILEO_E6_B_PRIMARY_CODE_STR_LENGTH - 1]);
|
||||
_dest[index] = static_cast<float>(a[0]);
|
||||
_dest[index + 1] = static_cast<float>(a[1]);
|
||||
_dest[index + 2] = static_cast<float>(a[2]);
|
||||
hex_to_binary_converter(a, GALILEO_E6_B_PRIMARY_CODE[prn_][GALILEO_E6_B_PRIMARY_CODE_STR_LENGTH - 1]);
|
||||
dest[index] = static_cast<float>(a[0]);
|
||||
dest[index + 1] = static_cast<float>(a[1]);
|
||||
dest[index + 2] = static_cast<float>(a[2]);
|
||||
}
|
||||
|
||||
|
||||
void galileo_e6_b_code_gen_complex_sampled(own::span<std::complex<float>> _dest,
|
||||
uint32_t _prn,
|
||||
int32_t _fs,
|
||||
uint32_t _chip_shift)
|
||||
void galileo_e6_b_code_gen_complex_sampled(own::span<std::complex<float>> dest,
|
||||
uint32_t prn,
|
||||
int32_t sampling_freq,
|
||||
uint32_t chip_shift)
|
||||
{
|
||||
constexpr uint32_t _codeLength = GALILEO_E6_B_CODE_LENGTH_CHIPS;
|
||||
constexpr int32_t _codeFreqBasis = GALILEO_E6_B_CODE_CHIP_RATE_CPS;
|
||||
constexpr uint32_t codeLength = GALILEO_E6_B_CODE_LENGTH_CHIPS;
|
||||
constexpr int32_t codeFreqBasis = GALILEO_E6_B_CODE_CHIP_RATE_CPS;
|
||||
|
||||
const auto _samplesPerCode = static_cast<uint32_t>(static_cast<double>(_fs) / (static_cast<double>(_codeFreqBasis) / static_cast<double>(_codeLength)));
|
||||
const uint32_t delay = ((_codeLength - _chip_shift) % _codeLength) * _samplesPerCode / _codeLength;
|
||||
const auto samplesPerCode = static_cast<uint32_t>(static_cast<double>(sampling_freq) / (static_cast<double>(codeFreqBasis) / static_cast<double>(codeLength)));
|
||||
const uint32_t delay = ((codeLength - chip_shift) % codeLength) * samplesPerCode / codeLength;
|
||||
|
||||
std::vector<std::complex<float>> _code(_codeLength);
|
||||
galileo_e6_b_code_gen_complex_primary(_code, _prn);
|
||||
std::vector<std::complex<float>> code_aux(codeLength);
|
||||
galileo_e6_b_code_gen_complex_primary(code_aux, prn);
|
||||
|
||||
if (_fs != _codeFreqBasis)
|
||||
if (sampling_freq != codeFreqBasis)
|
||||
{
|
||||
std::vector<std::complex<float>> _resampled_signal(_samplesPerCode);
|
||||
resampler(_code, _resampled_signal, _codeFreqBasis, _fs); // resamples code to fs
|
||||
_code = std::move(_resampled_signal);
|
||||
std::vector<std::complex<float>> resampled_signal_aux(samplesPerCode);
|
||||
resampler(code_aux, resampled_signal_aux, codeFreqBasis, sampling_freq); // resamples code to sampling_freq
|
||||
code_aux = std::move(resampled_signal_aux);
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < _samplesPerCode; i++)
|
||||
for (uint32_t i = 0; i < samplesPerCode; i++)
|
||||
{
|
||||
_dest[(i + delay) % _samplesPerCode] = _code[i];
|
||||
dest[(i + delay) % samplesPerCode] = code_aux[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void galileo_e6_c_code_gen_complex_primary(own::span<std::complex<float>> _dest,
|
||||
int32_t _prn)
|
||||
void galileo_e6_c_code_gen_complex_primary(own::span<std::complex<float>> dest,
|
||||
int32_t prn)
|
||||
{
|
||||
const uint32_t prn = _prn - 1;
|
||||
const uint32_t prn_ = prn - 1;
|
||||
uint32_t index = 0;
|
||||
std::array<int32_t, 4> a{};
|
||||
if ((_prn < 1) || (_prn > 50))
|
||||
if ((prn < 1) || (prn > 50))
|
||||
{
|
||||
return;
|
||||
}
|
||||
for (size_t i = 0; i < GALILEO_E6_C_PRIMARY_CODE_STR_LENGTH - 1; i++)
|
||||
{
|
||||
hex_to_binary_converter(a, GALILEO_E6_C_PRIMARY_CODE[prn][i]);
|
||||
_dest[index] = std::complex<float>(static_cast<float>(a[0]), 0.0);
|
||||
_dest[index + 1] = std::complex<float>(static_cast<float>(a[1]), 0.0);
|
||||
_dest[index + 2] = std::complex<float>(static_cast<float>(a[2]), 0.0);
|
||||
_dest[index + 3] = std::complex<float>(static_cast<float>(a[3]), 0.0);
|
||||
hex_to_binary_converter(a, GALILEO_E6_C_PRIMARY_CODE[prn_][i]);
|
||||
dest[index] = std::complex<float>(static_cast<float>(a[0]), 0.0);
|
||||
dest[index + 1] = std::complex<float>(static_cast<float>(a[1]), 0.0);
|
||||
dest[index + 2] = std::complex<float>(static_cast<float>(a[2]), 0.0);
|
||||
dest[index + 3] = std::complex<float>(static_cast<float>(a[3]), 0.0);
|
||||
index = index + 4;
|
||||
}
|
||||
// last bit is filled up with a zero
|
||||
hex_to_binary_converter(a, GALILEO_E6_C_PRIMARY_CODE[prn][GALILEO_E6_C_PRIMARY_CODE_STR_LENGTH - 1]);
|
||||
_dest[index] = std::complex<float>(static_cast<float>(a[0]), 0.0);
|
||||
_dest[index + 1] = std::complex<float>(static_cast<float>(a[1]), 0.0);
|
||||
_dest[index + 2] = std::complex<float>(static_cast<float>(a[2]), 0.0);
|
||||
hex_to_binary_converter(a, GALILEO_E6_C_PRIMARY_CODE[prn_][GALILEO_E6_C_PRIMARY_CODE_STR_LENGTH - 1]);
|
||||
dest[index] = std::complex<float>(static_cast<float>(a[0]), 0.0);
|
||||
dest[index + 1] = std::complex<float>(static_cast<float>(a[1]), 0.0);
|
||||
dest[index + 2] = std::complex<float>(static_cast<float>(a[2]), 0.0);
|
||||
}
|
||||
|
||||
|
||||
void galileo_e6_c_code_gen_float_primary(own::span<float> _dest, int32_t _prn)
|
||||
void galileo_e6_c_code_gen_float_primary(own::span<float> dest, int32_t prn)
|
||||
{
|
||||
const uint32_t prn = _prn - 1;
|
||||
const uint32_t prn_ = prn - 1;
|
||||
uint32_t index = 0;
|
||||
std::array<int32_t, 4> a{};
|
||||
if ((_prn < 1) || (_prn > 50))
|
||||
if ((prn < 1) || (prn > 50))
|
||||
{
|
||||
return;
|
||||
}
|
||||
for (size_t i = 0; i < GALILEO_E6_C_PRIMARY_CODE_STR_LENGTH - 1; i++)
|
||||
{
|
||||
hex_to_binary_converter(a, GALILEO_E6_C_PRIMARY_CODE[prn][i]);
|
||||
_dest[index] = static_cast<float>(a[0]);
|
||||
_dest[index + 1] = static_cast<float>(a[1]);
|
||||
_dest[index + 2] = static_cast<float>(a[2]);
|
||||
_dest[index + 3] = static_cast<float>(a[3]);
|
||||
hex_to_binary_converter(a, GALILEO_E6_C_PRIMARY_CODE[prn_][i]);
|
||||
dest[index] = static_cast<float>(a[0]);
|
||||
dest[index + 1] = static_cast<float>(a[1]);
|
||||
dest[index + 2] = static_cast<float>(a[2]);
|
||||
dest[index + 3] = static_cast<float>(a[3]);
|
||||
index = index + 4;
|
||||
}
|
||||
// last bit is filled up with a zero
|
||||
hex_to_binary_converter(a, GALILEO_E6_C_PRIMARY_CODE[prn][GALILEO_E6_C_PRIMARY_CODE_STR_LENGTH - 1]);
|
||||
_dest[index] = static_cast<float>(a[0]);
|
||||
_dest[index + 1] = static_cast<float>(a[1]);
|
||||
_dest[index + 2] = static_cast<float>(a[2]);
|
||||
hex_to_binary_converter(a, GALILEO_E6_C_PRIMARY_CODE[prn_][GALILEO_E6_C_PRIMARY_CODE_STR_LENGTH - 1]);
|
||||
dest[index] = static_cast<float>(a[0]);
|
||||
dest[index + 1] = static_cast<float>(a[1]);
|
||||
dest[index + 2] = static_cast<float>(a[2]);
|
||||
}
|
||||
|
||||
|
||||
void galileo_e6_c_code_gen_complex_sampled(own::span<std::complex<float>> _dest,
|
||||
uint32_t _prn,
|
||||
int32_t _fs,
|
||||
uint32_t _chip_shift)
|
||||
void galileo_e6_c_code_gen_complex_sampled(own::span<std::complex<float>> dest,
|
||||
uint32_t prn,
|
||||
int32_t sampling_freq,
|
||||
uint32_t chip_shift)
|
||||
{
|
||||
constexpr uint32_t _codeLength = GALILEO_E6_C_CODE_LENGTH_CHIPS;
|
||||
constexpr int32_t _codeFreqBasis = GALILEO_E6_C_CODE_CHIP_RATE_CPS;
|
||||
constexpr uint32_t codeLength = GALILEO_E6_C_CODE_LENGTH_CHIPS;
|
||||
constexpr int32_t codeFreqBasis = GALILEO_E6_C_CODE_CHIP_RATE_CPS;
|
||||
|
||||
const auto _samplesPerCode = static_cast<uint32_t>(static_cast<double>(_fs) / (static_cast<double>(_codeFreqBasis) / static_cast<double>(_codeLength)));
|
||||
const uint32_t delay = ((_codeLength - _chip_shift) % _codeLength) * _samplesPerCode / _codeLength;
|
||||
const auto samplesPerCode = static_cast<uint32_t>(static_cast<double>(sampling_freq) / (static_cast<double>(codeFreqBasis) / static_cast<double>(codeLength)));
|
||||
const uint32_t delay = ((codeLength - chip_shift) % codeLength) * samplesPerCode / codeLength;
|
||||
|
||||
std::vector<std::complex<float>> _code(_codeLength);
|
||||
galileo_e6_c_code_gen_complex_primary(_code, _prn);
|
||||
std::vector<std::complex<float>> code_aux(codeLength);
|
||||
galileo_e6_c_code_gen_complex_primary(code_aux, prn);
|
||||
|
||||
if (_fs != _codeFreqBasis)
|
||||
if (sampling_freq != codeFreqBasis)
|
||||
{
|
||||
std::vector<std::complex<float>> _resampled_signal(_samplesPerCode);
|
||||
resampler(_code, _resampled_signal, _codeFreqBasis, _fs); // resamples code to fs
|
||||
_code = std::move(_resampled_signal);
|
||||
std::vector<std::complex<float>> resampled_signal_aux(samplesPerCode);
|
||||
resampler(code_aux, resampled_signal_aux, codeFreqBasis, sampling_freq); // resamples code to sampling_freq
|
||||
code_aux = std::move(resampled_signal_aux);
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < _samplesPerCode; i++)
|
||||
for (uint32_t i = 0; i < samplesPerCode; i++)
|
||||
{
|
||||
_dest[(i + delay) % _samplesPerCode] = _code[i];
|
||||
dest[(i + delay) % samplesPerCode] = code_aux[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void galileo_e6_c_secondary_code_gen_complex(own::span<std::complex<float>> _dest,
|
||||
int32_t _prn)
|
||||
void galileo_e6_c_secondary_code_gen_complex(own::span<std::complex<float>> dest,
|
||||
int32_t prn)
|
||||
{
|
||||
const uint32_t prn = _prn - 1;
|
||||
const uint32_t prn_ = prn - 1;
|
||||
uint32_t index = 0;
|
||||
std::array<int32_t, 4> a{};
|
||||
if ((_prn < 1) || (_prn > 50))
|
||||
if ((prn < 1) || (prn > 50))
|
||||
{
|
||||
return;
|
||||
}
|
||||
for (size_t i = 0; i < GALILEO_E6_C_SECONDARY_CODE_STR_LENGTH; i++)
|
||||
{
|
||||
hex_to_binary_converter(a, GALILEO_E6_C_SECONDARY_CODE[prn][i]);
|
||||
_dest[index] = std::complex<float>(static_cast<float>(a[0]), 0.0);
|
||||
_dest[index + 1] = std::complex<float>(static_cast<float>(a[1]), 0.0);
|
||||
_dest[index + 2] = std::complex<float>(static_cast<float>(a[2]), 0.0);
|
||||
_dest[index + 3] = std::complex<float>(static_cast<float>(a[3]), 0.0);
|
||||
hex_to_binary_converter(a, GALILEO_E6_C_SECONDARY_CODE[prn_][i]);
|
||||
dest[index] = std::complex<float>(static_cast<float>(a[0]), 0.0);
|
||||
dest[index + 1] = std::complex<float>(static_cast<float>(a[1]), 0.0);
|
||||
dest[index + 2] = std::complex<float>(static_cast<float>(a[2]), 0.0);
|
||||
dest[index + 3] = std::complex<float>(static_cast<float>(a[3]), 0.0);
|
||||
index = index + 4;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void galileo_e6_c_secondary_code_gen_float(own::span<float> _dest,
|
||||
int32_t _prn)
|
||||
void galileo_e6_c_secondary_code_gen_float(own::span<float> dest,
|
||||
int32_t prn)
|
||||
{
|
||||
const uint32_t prn = _prn - 1;
|
||||
const uint32_t prn_ = prn - 1;
|
||||
uint32_t index = 0;
|
||||
std::array<int32_t, 4> a{};
|
||||
if ((_prn < 1) || (_prn > 50))
|
||||
if ((prn < 1) || (prn > 50))
|
||||
{
|
||||
return;
|
||||
}
|
||||
for (size_t i = 0; i < GALILEO_E6_C_SECONDARY_CODE_STR_LENGTH; i++)
|
||||
{
|
||||
hex_to_binary_converter(a, GALILEO_E6_C_SECONDARY_CODE[prn][i]);
|
||||
_dest[index] = static_cast<float>(a[0]);
|
||||
_dest[index + 1] = static_cast<float>(a[1]);
|
||||
_dest[index + 2] = static_cast<float>(a[2]);
|
||||
_dest[index + 3] = static_cast<float>(a[3]);
|
||||
hex_to_binary_converter(a, GALILEO_E6_C_SECONDARY_CODE[prn_][i]);
|
||||
dest[index] = static_cast<float>(a[0]);
|
||||
dest[index + 1] = static_cast<float>(a[1]);
|
||||
dest[index + 2] = static_cast<float>(a[2]);
|
||||
dest[index + 3] = static_cast<float>(a[3]);
|
||||
index = index + 4;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
std::string galileo_e6_c_secondary_code(int32_t _prn)
|
||||
std::string galileo_e6_c_secondary_code(int32_t prn)
|
||||
{
|
||||
std::string dest(static_cast<size_t>(GALILEO_E6_C_SECONDARY_CODE_LENGTH_CHIPS), '0');
|
||||
const uint32_t prn = _prn - 1;
|
||||
const uint32_t prn_ = prn - 1;
|
||||
uint32_t index = 0;
|
||||
for (size_t i = 0; i < GALILEO_E6_C_SECONDARY_CODE_STR_LENGTH; i++)
|
||||
{
|
||||
std::string aux = hex_to_binary_string(GALILEO_E6_C_SECONDARY_CODE[prn][i]);
|
||||
std::string aux = hex_to_binary_string(GALILEO_E6_C_SECONDARY_CODE[prn_][i]);
|
||||
dest[index] = aux[0];
|
||||
dest[index + 1] = aux[1];
|
||||
dest[index + 2] = aux[2];
|
||||
|
||||
@@ -7,13 +7,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
@@ -43,67 +40,67 @@ namespace own = gsl;
|
||||
/*!
|
||||
* \brief Generates Galileo E6B code at 1 sample/chip
|
||||
*/
|
||||
void galileo_e6_b_code_gen_complex_primary(own::span<std::complex<float>> _dest,
|
||||
int32_t _prn);
|
||||
void galileo_e6_b_code_gen_complex_primary(own::span<std::complex<float>> dest,
|
||||
int32_t prn);
|
||||
|
||||
|
||||
/*!
|
||||
* \brief Generates Galileo E6B code at 1 sample/chip
|
||||
*/
|
||||
void galileo_e6_b_code_gen_float_primary(own::span<float> _dest, int32_t _prn);
|
||||
void galileo_e6_b_code_gen_float_primary(own::span<float> dest, int32_t prn);
|
||||
|
||||
|
||||
/*!
|
||||
* \brief Generates Galileo E6B complex code, shifted to the desired chip and
|
||||
* sampled at a frequency fs
|
||||
* sampled at a frequency sampling_freq
|
||||
*/
|
||||
void galileo_e6_b_code_gen_complex_sampled(own::span<std::complex<float>> _dest,
|
||||
uint32_t _prn,
|
||||
int32_t _fs,
|
||||
uint32_t _chip_shift);
|
||||
void galileo_e6_b_code_gen_complex_sampled(own::span<std::complex<float>> dest,
|
||||
uint32_t prn,
|
||||
int32_t sampling_freq,
|
||||
uint32_t chip_shift);
|
||||
|
||||
|
||||
/*!
|
||||
* \brief Generates Galileo E6C codes at 1 sample/chip
|
||||
*/
|
||||
void galileo_e6_c_code_gen_complex_primary(own::span<std::complex<float>> _dest,
|
||||
int32_t _prn);
|
||||
void galileo_e6_c_code_gen_complex_primary(own::span<std::complex<float>> dest,
|
||||
int32_t prn);
|
||||
|
||||
|
||||
/*!
|
||||
* \brief Generates Galileo E6C codes at 1 sample/chip
|
||||
*/
|
||||
void galileo_e6_c_code_gen_float_primary(own::span<float> _dest, int32_t _prn);
|
||||
void galileo_e6_c_code_gen_float_primary(own::span<float> dest, int32_t prn);
|
||||
|
||||
|
||||
/*!
|
||||
* \brief Generates Galileo E6C complex codes, shifted to the desired chip and
|
||||
* sampled at a frequency fs
|
||||
* sampled at a frequency sampling_freq
|
||||
*/
|
||||
void galileo_e6_c_code_gen_complex_sampled(own::span<std::complex<float>> _dest,
|
||||
uint32_t _prn,
|
||||
int32_t _fs,
|
||||
uint32_t _chip_shift);
|
||||
void galileo_e6_c_code_gen_complex_sampled(own::span<std::complex<float>> dest,
|
||||
uint32_t prn,
|
||||
int32_t sampling_freq,
|
||||
uint32_t chip_shift);
|
||||
|
||||
|
||||
/*!
|
||||
* \brief Generates Galileo E6C secondary codes at 1 sample/chip
|
||||
*/
|
||||
void galileo_e6_c_secondary_code_gen_complex(own::span<std::complex<float>> _dest,
|
||||
int32_t _prn);
|
||||
void galileo_e6_c_secondary_code_gen_complex(own::span<std::complex<float>> dest,
|
||||
int32_t prn);
|
||||
|
||||
|
||||
/*!
|
||||
* \brief Generates Galileo E6C secondary codes at 1 sample/chip
|
||||
*/
|
||||
void galileo_e6_c_secondary_code_gen_float(own::span<float> _dest,
|
||||
int32_t _prn);
|
||||
void galileo_e6_c_secondary_code_gen_float(own::span<float> dest,
|
||||
int32_t prn);
|
||||
|
||||
|
||||
/*!
|
||||
* \brief Generates a string with Galileo E6C secondary codes at 1 sample/chip
|
||||
*/
|
||||
std::string galileo_e6_c_secondary_code(int32_t _prn);
|
||||
std::string galileo_e6_c_secondary_code(int32_t prn);
|
||||
|
||||
|
||||
/** \} */
|
||||
|
||||
@@ -7,13 +7,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
|
||||
@@ -7,13 +7,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
|
||||
@@ -7,13 +7,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
@@ -25,10 +22,10 @@
|
||||
|
||||
const auto AUX_CEIL = [](float x) { return static_cast<int32_t>(static_cast<int64_t>((x) + 1)); };
|
||||
|
||||
void glonass_l1_ca_code_gen_complex(own::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{};
|
||||
const uint32_t code_length = 511;
|
||||
std::bitset<code_length> G1{};
|
||||
auto G1_register = std::bitset<9>{}.set(); // All true
|
||||
bool feedback1;
|
||||
bool aux;
|
||||
@@ -37,7 +34,7 @@ void glonass_l1_ca_code_gen_complex(own::span<std::complex<float>> _dest, uint32
|
||||
uint32_t lcv2;
|
||||
|
||||
/* Generate G1 Register */
|
||||
for (lcv = 0; lcv < _code_length; lcv++)
|
||||
for (lcv = 0; lcv < code_length; lcv++)
|
||||
{
|
||||
G1[lcv] = G1_register[2];
|
||||
|
||||
@@ -52,38 +49,38 @@ void glonass_l1_ca_code_gen_complex(own::span<std::complex<float>> _dest, uint32
|
||||
}
|
||||
|
||||
/* Generate PRN from G1 Register */
|
||||
for (lcv = 0; lcv < _code_length; lcv++)
|
||||
for (lcv = 0; lcv < code_length; lcv++)
|
||||
{
|
||||
aux = G1[lcv];
|
||||
if (aux == true)
|
||||
{
|
||||
_dest[lcv] = std::complex<float>(1, 0);
|
||||
dest[lcv] = std::complex<float>(1, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
_dest[lcv] = std::complex<float>(-1, 0);
|
||||
dest[lcv] = std::complex<float>(-1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/* Set the delay */
|
||||
delay = _code_length;
|
||||
delay += _chip_shift;
|
||||
delay %= _code_length;
|
||||
delay = code_length;
|
||||
delay += chip_shift;
|
||||
delay %= code_length;
|
||||
|
||||
/* Generate PRN from G1 and G2 Registers */
|
||||
for (lcv = 0; lcv < _code_length; lcv++)
|
||||
for (lcv = 0; lcv < code_length; lcv++)
|
||||
{
|
||||
aux = G1[(lcv + _chip_shift) % _code_length];
|
||||
aux = G1[(lcv + chip_shift) % code_length];
|
||||
if (aux == true)
|
||||
{
|
||||
_dest[lcv] = std::complex<float>(1, 0);
|
||||
dest[lcv] = std::complex<float>(1, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
_dest[lcv] = std::complex<float>(-1, 0);
|
||||
dest[lcv] = std::complex<float>(-1, 0);
|
||||
}
|
||||
delay++;
|
||||
delay %= _code_length;
|
||||
delay %= code_length;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,44 +88,44 @@ void glonass_l1_ca_code_gen_complex(own::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(own::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 sampling_freq, uint32_t chip_shift)
|
||||
{
|
||||
constexpr int32_t _codeFreqBasis = 511000; // Hz
|
||||
constexpr int32_t _codeLength = 511;
|
||||
constexpr float _tc = 1.0 / static_cast<float>(_codeFreqBasis); // C/A chip period in sec
|
||||
constexpr int32_t codeFreqBasis = 511000; // chips per second
|
||||
constexpr int32_t codeLength = 511;
|
||||
constexpr float tc = 1.0 / static_cast<float>(codeFreqBasis); // C/A chip period in sec
|
||||
|
||||
const float _ts = 1.0F / static_cast<float>(_fs); // Sampling period in sec
|
||||
const auto _samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / (static_cast<double>(_codeFreqBasis) / static_cast<double>(_codeLength)));
|
||||
const float ts = 1.0F / static_cast<float>(sampling_freq); // Sampling period in sec
|
||||
const auto samplesPerCode = static_cast<int32_t>(static_cast<double>(sampling_freq) / (static_cast<double>(codeFreqBasis) / static_cast<double>(codeLength)));
|
||||
|
||||
std::array<std::complex<float>, 511> _code{};
|
||||
int32_t _codeValueIndex;
|
||||
std::array<std::complex<float>, 511> code_aux{};
|
||||
int32_t codeValueIndex;
|
||||
float aux;
|
||||
|
||||
glonass_l1_ca_code_gen_complex(_code, _chip_shift); // generate C/A code 1 sample per chip
|
||||
glonass_l1_ca_code_gen_complex(code_aux, chip_shift); // generate C/A code 1 sample per chip
|
||||
|
||||
for (int32_t i = 0; i < _samplesPerCode; i++)
|
||||
for (int32_t i = 0; i < samplesPerCode; i++)
|
||||
{
|
||||
// === Digitizing ==================================================
|
||||
|
||||
// --- Make index array to read C/A code values --------------------
|
||||
// The length of the index array depends on the sampling frequency -
|
||||
// number of samples per millisecond (because one C/A code period is one
|
||||
// millisecond).
|
||||
// number of samples per millisecond (because one C/A code period is
|
||||
// one millisecond).
|
||||
|
||||
aux = (_ts * (static_cast<float>(i) + 1)) / _tc;
|
||||
_codeValueIndex = AUX_CEIL(aux) - 1;
|
||||
aux = (ts * (static_cast<float>(i) + 1)) / tc;
|
||||
codeValueIndex = AUX_CEIL(aux) - 1;
|
||||
|
||||
// --- Make the digitized version of the C/A code ------------------
|
||||
// The "upsampled" code is made by selecting values form the CA code
|
||||
// chip array (caCode) for the time instances of each sample.
|
||||
if (i == _samplesPerCode - 1)
|
||||
if (i == samplesPerCode - 1)
|
||||
{
|
||||
// --- Correct the last index (due to number rounding issues) -----------
|
||||
_dest[i] = _code[_codeLength - 1];
|
||||
// Correct the last index (due to number rounding issues)
|
||||
dest[i] = code_aux[codeLength - 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
_dest[i] = _code[_codeValueIndex]; // repeat the chip -> upsample
|
||||
dest[i] = code_aux[codeValueIndex]; // repeat the chip -> upsample
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,13 +7,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
@@ -38,14 +35,11 @@ namespace own = gsl;
|
||||
* \{ */
|
||||
|
||||
|
||||
//! 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(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(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(own::span<std::complex<float>> _dest, int32_t _fs, uint32_t _chip_shift);
|
||||
void glonass_l1_ca_code_gen_complex(own::span<std::complex<float>> dest, uint32_t chip_shift);
|
||||
|
||||
//! 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_sampled(own::span<std::complex<float>> dest, int32_t sampling_freq, uint32_t chip_shift);
|
||||
|
||||
|
||||
/** \} */
|
||||
|
||||
@@ -7,13 +7,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
@@ -25,10 +22,10 @@
|
||||
|
||||
const auto AUX_CEIL = [](float x) { return static_cast<int32_t>(static_cast<int64_t>((x) + 1)); };
|
||||
|
||||
void glonass_l2_ca_code_gen_complex(own::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{};
|
||||
const uint32_t code_length = 511;
|
||||
std::bitset<code_length> G1{};
|
||||
auto G1_register = std::bitset<9>{}.set(); // All true
|
||||
bool feedback1;
|
||||
bool aux;
|
||||
@@ -37,7 +34,7 @@ void glonass_l2_ca_code_gen_complex(own::span<std::complex<float>> _dest, uint32
|
||||
uint32_t lcv2;
|
||||
|
||||
/* Generate G1 Register */
|
||||
for (lcv = 0; lcv < _code_length; lcv++)
|
||||
for (lcv = 0; lcv < code_length; lcv++)
|
||||
{
|
||||
G1[lcv] = G1_register[2];
|
||||
|
||||
@@ -52,38 +49,38 @@ void glonass_l2_ca_code_gen_complex(own::span<std::complex<float>> _dest, uint32
|
||||
}
|
||||
|
||||
/* Generate PRN from G1 Register */
|
||||
for (lcv = 0; lcv < _code_length; lcv++)
|
||||
for (lcv = 0; lcv < code_length; lcv++)
|
||||
{
|
||||
aux = G1[lcv];
|
||||
if (aux == true)
|
||||
{
|
||||
_dest[lcv] = std::complex<float>(1, 0);
|
||||
dest[lcv] = std::complex<float>(1, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
_dest[lcv] = std::complex<float>(-1, 0);
|
||||
dest[lcv] = std::complex<float>(-1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/* Set the delay */
|
||||
delay = _code_length;
|
||||
delay += _chip_shift;
|
||||
delay %= _code_length;
|
||||
delay = code_length;
|
||||
delay += chip_shift;
|
||||
delay %= code_length;
|
||||
|
||||
/* Generate PRN from G1 and G2 Registers */
|
||||
for (lcv = 0; lcv < _code_length; lcv++)
|
||||
for (lcv = 0; lcv < code_length; lcv++)
|
||||
{
|
||||
aux = G1[(lcv + _chip_shift) % _code_length];
|
||||
aux = G1[(lcv + chip_shift) % code_length];
|
||||
if (aux == true)
|
||||
{
|
||||
_dest[lcv] = std::complex<float>(1, 0);
|
||||
dest[lcv] = std::complex<float>(1, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
_dest[lcv] = std::complex<float>(-1, 0);
|
||||
dest[lcv] = std::complex<float>(-1, 0);
|
||||
}
|
||||
delay++;
|
||||
delay %= _code_length;
|
||||
delay %= code_length;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,44 +88,44 @@ void glonass_l2_ca_code_gen_complex(own::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(own::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 sampling_freq, uint32_t chip_shift)
|
||||
{
|
||||
constexpr int32_t _codeFreqBasis = 511000; // Hz
|
||||
constexpr int32_t _codeLength = 511;
|
||||
constexpr float _tc = 1.0 / static_cast<float>(_codeFreqBasis); // C/A chip period in sec
|
||||
constexpr int32_t codeFreqBasis = 511000; // chips per second
|
||||
constexpr int32_t codeLength = 511;
|
||||
constexpr float tc = 1.0 / static_cast<float>(codeFreqBasis); // C/A chip period in sec
|
||||
|
||||
const auto _samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / (static_cast<double>(_codeFreqBasis) / static_cast<double>(_codeLength)));
|
||||
const float _ts = 1.0F / static_cast<float>(_fs); // Sampling period in sec
|
||||
const auto samplesPerCode = static_cast<int32_t>(static_cast<double>(sampling_freq) / (static_cast<double>(codeFreqBasis) / static_cast<double>(codeLength)));
|
||||
const float ts = 1.0F / static_cast<float>(sampling_freq); // Sampling period in sec
|
||||
|
||||
std::array<std::complex<float>, 511> _code{};
|
||||
int32_t _codeValueIndex;
|
||||
std::array<std::complex<float>, 511> code_aux{};
|
||||
int32_t codeValueIndex;
|
||||
float aux;
|
||||
|
||||
glonass_l2_ca_code_gen_complex(_code, _chip_shift); // generate C/A code 1 sample per chip
|
||||
glonass_l2_ca_code_gen_complex(code_aux, chip_shift); // generate C/A code 1 sample per chip
|
||||
|
||||
for (int32_t i = 0; i < _samplesPerCode; i++)
|
||||
for (int32_t i = 0; i < samplesPerCode; i++)
|
||||
{
|
||||
// === Digitizing ==================================================
|
||||
|
||||
// --- Make index array to read C/A code values --------------------
|
||||
// The length of the index array depends on the sampling frequency -
|
||||
// number of samples per millisecond (because one C/A code period is one
|
||||
// millisecond).
|
||||
// number of samples per millisecond (because one C/A code period is
|
||||
// one millisecond).
|
||||
|
||||
aux = (_ts * (static_cast<float>(i) + 1)) / _tc;
|
||||
_codeValueIndex = AUX_CEIL(aux) - 1;
|
||||
aux = (ts * (static_cast<float>(i) + 1)) / tc;
|
||||
codeValueIndex = AUX_CEIL(aux) - 1;
|
||||
|
||||
// --- Make the digitized version of the C/A code ------------------
|
||||
// The "upsampled" code is made by selecting values form the CA code
|
||||
// chip array (caCode) for the time instances of each sample.
|
||||
if (i == _samplesPerCode - 1)
|
||||
if (i == samplesPerCode - 1)
|
||||
{
|
||||
// --- Correct the last index (due to number rounding issues) -----------
|
||||
_dest[i] = _code[_codeLength - 1];
|
||||
// Correct the last index (due to number rounding issues)
|
||||
dest[i] = code_aux[codeLength - 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
_dest[i] = _code[_codeValueIndex]; // repeat the chip -> upsample
|
||||
dest[i] = code_aux[codeValueIndex]; // repeat the chip -> upsample
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,13 +7,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
@@ -38,14 +35,11 @@ namespace own = gsl;
|
||||
* \{ */
|
||||
|
||||
|
||||
//! 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(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(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(own::span<std::complex<float>> _dest, int32_t _fs, uint32_t _chip_shift);
|
||||
void glonass_l2_ca_code_gen_complex(own::span<std::complex<float>> dest, uint32_t chip_shift);
|
||||
|
||||
//! 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_sampled(own::span<std::complex<float>> dest, int32_t sampling_freq, uint32_t chip_shift);
|
||||
|
||||
|
||||
/** \} */
|
||||
|
||||
@@ -6,13 +6,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
|
||||
@@ -6,13 +6,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
@@ -46,7 +43,7 @@ namespace errorlib = boost::system;
|
||||
bool gnss_sdr_create_directory(const std::string& foldername)
|
||||
{
|
||||
std::string new_folder;
|
||||
for (auto& folder : fs::path(foldername))
|
||||
for (const auto& folder : fs::path(foldername))
|
||||
{
|
||||
new_folder += folder.string();
|
||||
errorlib::error_code ec;
|
||||
|
||||
@@ -6,13 +6,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
|
||||
@@ -6,13 +6,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
|
||||
@@ -6,13 +6,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
|
||||
@@ -9,13 +9,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
|
||||
@@ -7,13 +7,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
@@ -27,121 +24,121 @@
|
||||
|
||||
const auto AUX_CEIL2 = [](float x) { return static_cast<int32_t>(static_cast<int64_t>((x) + 1)); };
|
||||
|
||||
void complex_exp_gen(own::span<std::complex<float>> _dest, double _f, double _fs)
|
||||
void complex_exp_gen(own::span<std::complex<float>> dest, double freq, double sampling_freq)
|
||||
{
|
||||
gr::fxpt_nco d_nco;
|
||||
d_nco.set_freq(static_cast<float>((TWO_PI * _f) / _fs));
|
||||
d_nco.sincos(_dest.data(), _dest.size(), 1);
|
||||
d_nco.set_freq(static_cast<float>((TWO_PI * freq) / sampling_freq));
|
||||
d_nco.sincos(dest.data(), dest.size(), 1);
|
||||
}
|
||||
|
||||
|
||||
void complex_exp_gen_conj(own::span<std::complex<float>> _dest, double _f, double _fs)
|
||||
void complex_exp_gen_conj(own::span<std::complex<float>> dest, double freq, double sampling_freq)
|
||||
{
|
||||
gr::fxpt_nco d_nco;
|
||||
d_nco.set_freq(-static_cast<float>((TWO_PI * _f) / _fs));
|
||||
d_nco.sincos(_dest.data(), _dest.size(), 1);
|
||||
d_nco.set_freq(-static_cast<float>((TWO_PI * freq) / sampling_freq));
|
||||
d_nco.sincos(dest.data(), dest.size(), 1);
|
||||
}
|
||||
|
||||
|
||||
void hex_to_binary_converter(own::span<int32_t> _dest, char _from)
|
||||
void hex_to_binary_converter(own::span<int32_t> dest, char from)
|
||||
{
|
||||
switch (_from)
|
||||
switch (from)
|
||||
{
|
||||
case '0':
|
||||
_dest[0] = 1;
|
||||
_dest[1] = 1;
|
||||
_dest[2] = 1;
|
||||
_dest[3] = 1;
|
||||
dest[0] = 1;
|
||||
dest[1] = 1;
|
||||
dest[2] = 1;
|
||||
dest[3] = 1;
|
||||
break;
|
||||
case '1':
|
||||
_dest[0] = 1;
|
||||
_dest[1] = 1;
|
||||
_dest[2] = 1;
|
||||
_dest[3] = -1;
|
||||
dest[0] = 1;
|
||||
dest[1] = 1;
|
||||
dest[2] = 1;
|
||||
dest[3] = -1;
|
||||
break;
|
||||
case '2':
|
||||
_dest[0] = 1;
|
||||
_dest[1] = 1;
|
||||
_dest[2] = -1;
|
||||
_dest[3] = 1;
|
||||
dest[0] = 1;
|
||||
dest[1] = 1;
|
||||
dest[2] = -1;
|
||||
dest[3] = 1;
|
||||
break;
|
||||
case '3':
|
||||
_dest[0] = 1;
|
||||
_dest[1] = 1;
|
||||
_dest[2] = -1;
|
||||
_dest[3] = -1;
|
||||
dest[0] = 1;
|
||||
dest[1] = 1;
|
||||
dest[2] = -1;
|
||||
dest[3] = -1;
|
||||
break;
|
||||
case '4':
|
||||
_dest[0] = 1;
|
||||
_dest[1] = -1;
|
||||
_dest[2] = 1;
|
||||
_dest[3] = 1;
|
||||
dest[0] = 1;
|
||||
dest[1] = -1;
|
||||
dest[2] = 1;
|
||||
dest[3] = 1;
|
||||
break;
|
||||
case '5':
|
||||
_dest[0] = 1;
|
||||
_dest[1] = -1;
|
||||
_dest[2] = 1;
|
||||
_dest[3] = -1;
|
||||
dest[0] = 1;
|
||||
dest[1] = -1;
|
||||
dest[2] = 1;
|
||||
dest[3] = -1;
|
||||
break;
|
||||
case '6':
|
||||
_dest[0] = 1;
|
||||
_dest[1] = -1;
|
||||
_dest[2] = -1;
|
||||
_dest[3] = 1;
|
||||
dest[0] = 1;
|
||||
dest[1] = -1;
|
||||
dest[2] = -1;
|
||||
dest[3] = 1;
|
||||
break;
|
||||
case '7':
|
||||
_dest[0] = 1;
|
||||
_dest[1] = -1;
|
||||
_dest[2] = -1;
|
||||
_dest[3] = -1;
|
||||
dest[0] = 1;
|
||||
dest[1] = -1;
|
||||
dest[2] = -1;
|
||||
dest[3] = -1;
|
||||
break;
|
||||
case '8':
|
||||
_dest[0] = -1;
|
||||
_dest[1] = 1;
|
||||
_dest[2] = 1;
|
||||
_dest[3] = 1;
|
||||
dest[0] = -1;
|
||||
dest[1] = 1;
|
||||
dest[2] = 1;
|
||||
dest[3] = 1;
|
||||
break;
|
||||
case '9':
|
||||
_dest[0] = -1;
|
||||
_dest[1] = 1;
|
||||
_dest[2] = 1;
|
||||
_dest[3] = -1;
|
||||
dest[0] = -1;
|
||||
dest[1] = 1;
|
||||
dest[2] = 1;
|
||||
dest[3] = -1;
|
||||
break;
|
||||
case 'A':
|
||||
_dest[0] = -1;
|
||||
_dest[1] = 1;
|
||||
_dest[2] = -1;
|
||||
_dest[3] = 1;
|
||||
dest[0] = -1;
|
||||
dest[1] = 1;
|
||||
dest[2] = -1;
|
||||
dest[3] = 1;
|
||||
break;
|
||||
case 'B':
|
||||
_dest[0] = -1;
|
||||
_dest[1] = 1;
|
||||
_dest[2] = -1;
|
||||
_dest[3] = -1;
|
||||
dest[0] = -1;
|
||||
dest[1] = 1;
|
||||
dest[2] = -1;
|
||||
dest[3] = -1;
|
||||
break;
|
||||
case 'C':
|
||||
_dest[0] = -1;
|
||||
_dest[1] = -1;
|
||||
_dest[2] = 1;
|
||||
_dest[3] = 1;
|
||||
dest[0] = -1;
|
||||
dest[1] = -1;
|
||||
dest[2] = 1;
|
||||
dest[3] = 1;
|
||||
break;
|
||||
case 'D':
|
||||
_dest[0] = -1;
|
||||
_dest[1] = -1;
|
||||
_dest[2] = 1;
|
||||
_dest[3] = -1;
|
||||
dest[0] = -1;
|
||||
dest[1] = -1;
|
||||
dest[2] = 1;
|
||||
dest[3] = -1;
|
||||
break;
|
||||
case 'E':
|
||||
_dest[0] = -1;
|
||||
_dest[1] = -1;
|
||||
_dest[2] = -1;
|
||||
_dest[3] = 1;
|
||||
dest[0] = -1;
|
||||
dest[1] = -1;
|
||||
dest[2] = -1;
|
||||
dest[3] = 1;
|
||||
break;
|
||||
case 'F':
|
||||
_dest[0] = -1;
|
||||
_dest[1] = -1;
|
||||
_dest[2] = -1;
|
||||
_dest[3] = -1;
|
||||
dest[0] = -1;
|
||||
dest[1] = -1;
|
||||
dest[2] = -1;
|
||||
dest[3] = -1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -149,143 +146,145 @@ void hex_to_binary_converter(own::span<int32_t> _dest, char _from)
|
||||
}
|
||||
|
||||
|
||||
std::string hex_to_binary_string(char _from)
|
||||
std::string hex_to_binary_string(char from)
|
||||
{
|
||||
std::string _dest("0000");
|
||||
switch (_from)
|
||||
std::string dest("0000");
|
||||
switch (from)
|
||||
{
|
||||
case '0':
|
||||
_dest[0] = '0';
|
||||
_dest[1] = '0';
|
||||
_dest[2] = '0';
|
||||
_dest[3] = '0';
|
||||
dest[0] = '0';
|
||||
dest[1] = '0';
|
||||
dest[2] = '0';
|
||||
dest[3] = '0';
|
||||
break;
|
||||
case '1':
|
||||
_dest[0] = '0';
|
||||
_dest[1] = '0';
|
||||
_dest[2] = '0';
|
||||
_dest[3] = '1';
|
||||
dest[0] = '0';
|
||||
dest[1] = '0';
|
||||
dest[2] = '0';
|
||||
dest[3] = '1';
|
||||
break;
|
||||
case '2':
|
||||
_dest[0] = '0';
|
||||
_dest[1] = '0';
|
||||
_dest[2] = '1';
|
||||
_dest[3] = '0';
|
||||
dest[0] = '0';
|
||||
dest[1] = '0';
|
||||
dest[2] = '1';
|
||||
dest[3] = '0';
|
||||
break;
|
||||
case '3':
|
||||
_dest[0] = '0';
|
||||
_dest[1] = '0';
|
||||
_dest[2] = '1';
|
||||
_dest[3] = '1';
|
||||
dest[0] = '0';
|
||||
dest[1] = '0';
|
||||
dest[2] = '1';
|
||||
dest[3] = '1';
|
||||
break;
|
||||
case '4':
|
||||
_dest[0] = '0';
|
||||
_dest[1] = '1';
|
||||
_dest[2] = '0';
|
||||
_dest[3] = '0';
|
||||
dest[0] = '0';
|
||||
dest[1] = '1';
|
||||
dest[2] = '0';
|
||||
dest[3] = '0';
|
||||
break;
|
||||
case '5':
|
||||
_dest[0] = '0';
|
||||
_dest[1] = '1';
|
||||
_dest[2] = '0';
|
||||
_dest[3] = '1';
|
||||
dest[0] = '0';
|
||||
dest[1] = '1';
|
||||
dest[2] = '0';
|
||||
dest[3] = '1';
|
||||
break;
|
||||
case '6':
|
||||
_dest[0] = '0';
|
||||
_dest[1] = '1';
|
||||
_dest[2] = '1';
|
||||
_dest[3] = '0';
|
||||
dest[0] = '0';
|
||||
dest[1] = '1';
|
||||
dest[2] = '1';
|
||||
dest[3] = '0';
|
||||
break;
|
||||
case '7':
|
||||
_dest[0] = '0';
|
||||
_dest[1] = '1';
|
||||
_dest[2] = '1';
|
||||
_dest[3] = '1';
|
||||
dest[0] = '0';
|
||||
dest[1] = '1';
|
||||
dest[2] = '1';
|
||||
dest[3] = '1';
|
||||
break;
|
||||
case '8':
|
||||
_dest[0] = '1';
|
||||
_dest[1] = '0';
|
||||
_dest[2] = '0';
|
||||
_dest[3] = '0';
|
||||
dest[0] = '1';
|
||||
dest[1] = '0';
|
||||
dest[2] = '0';
|
||||
dest[3] = '0';
|
||||
break;
|
||||
case '9':
|
||||
_dest[0] = '1';
|
||||
_dest[1] = '0';
|
||||
_dest[2] = '0';
|
||||
_dest[3] = '1';
|
||||
dest[0] = '1';
|
||||
dest[1] = '0';
|
||||
dest[2] = '0';
|
||||
dest[3] = '1';
|
||||
break;
|
||||
case 'A':
|
||||
_dest[0] = '1';
|
||||
_dest[1] = '0';
|
||||
_dest[2] = '1';
|
||||
_dest[3] = '0';
|
||||
dest[0] = '1';
|
||||
dest[1] = '0';
|
||||
dest[2] = '1';
|
||||
dest[3] = '0';
|
||||
break;
|
||||
case 'B':
|
||||
_dest[0] = '1';
|
||||
_dest[1] = '0';
|
||||
_dest[2] = '1';
|
||||
_dest[3] = '1';
|
||||
dest[0] = '1';
|
||||
dest[1] = '0';
|
||||
dest[2] = '1';
|
||||
dest[3] = '1';
|
||||
break;
|
||||
case 'C':
|
||||
_dest[0] = '1';
|
||||
_dest[1] = '1';
|
||||
_dest[2] = '0';
|
||||
_dest[3] = '0';
|
||||
dest[0] = '1';
|
||||
dest[1] = '1';
|
||||
dest[2] = '0';
|
||||
dest[3] = '0';
|
||||
break;
|
||||
case 'D':
|
||||
_dest[0] = '1';
|
||||
_dest[1] = '1';
|
||||
_dest[2] = '0';
|
||||
_dest[3] = '1';
|
||||
dest[0] = '1';
|
||||
dest[1] = '1';
|
||||
dest[2] = '0';
|
||||
dest[3] = '1';
|
||||
break;
|
||||
case 'E':
|
||||
_dest[0] = '1';
|
||||
_dest[1] = '1';
|
||||
_dest[2] = '1';
|
||||
_dest[3] = '0';
|
||||
dest[0] = '1';
|
||||
dest[1] = '1';
|
||||
dest[2] = '1';
|
||||
dest[3] = '0';
|
||||
break;
|
||||
case 'F':
|
||||
_dest[0] = '1';
|
||||
_dest[1] = '1';
|
||||
_dest[2] = '1';
|
||||
_dest[3] = '1';
|
||||
dest[0] = '1';
|
||||
dest[1] = '1';
|
||||
dest[2] = '1';
|
||||
dest[3] = '1';
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return _dest;
|
||||
return dest;
|
||||
}
|
||||
|
||||
|
||||
void resampler(const own::span<float> _from, own::span<float> _dest, float _fs_in,
|
||||
float _fs_out)
|
||||
void resampler(const own::span<float> from, own::span<float> dest, float fs_in,
|
||||
float fs_out)
|
||||
{
|
||||
uint32_t _codeValueIndex;
|
||||
uint32_t codeValueIndex;
|
||||
float aux;
|
||||
const float _t_out = 1.0F / _fs_out; // Output sampling period
|
||||
for (size_t i = 0; i < _dest.size() - 1; i++)
|
||||
const float t_out = 1.0F / fs_out; // Output sampling period
|
||||
const size_t dest_size = dest.size();
|
||||
for (size_t i = 0; i < dest_size - 1; i++)
|
||||
{
|
||||
aux = (_t_out * (static_cast<float>(i) + 1.0F)) * _fs_in;
|
||||
_codeValueIndex = AUX_CEIL2(aux) - 1;
|
||||
_dest[i] = _from[_codeValueIndex];
|
||||
aux = (t_out * (static_cast<float>(i) + 1.0F)) * fs_in;
|
||||
codeValueIndex = AUX_CEIL2(aux) - 1;
|
||||
dest[i] = from[codeValueIndex];
|
||||
}
|
||||
// Correct the last index (due to number rounding issues)
|
||||
_dest[_dest.size() - 1] = _from[_from.size() - 1];
|
||||
dest[dest_size - 1] = from[from.size() - 1];
|
||||
}
|
||||
|
||||
|
||||
void resampler(own::span<const std::complex<float>> _from, own::span<std::complex<float>> _dest, float _fs_in,
|
||||
float _fs_out)
|
||||
void resampler(own::span<const std::complex<float>> from, own::span<std::complex<float>> dest, float fs_in,
|
||||
float fs_out)
|
||||
{
|
||||
uint32_t _codeValueIndex;
|
||||
uint32_t codeValueIndex;
|
||||
float aux;
|
||||
const float _t_out = 1.0F / _fs_out; // Output sampling period
|
||||
for (size_t i = 0; i < _dest.size() - 1; i++)
|
||||
const float t_out = 1.0F / fs_out; // Output sampling period
|
||||
const size_t dest_size = dest.size();
|
||||
for (size_t i = 0; i < dest_size - 1; i++)
|
||||
{
|
||||
aux = (_t_out * (static_cast<float>(i) + 1.0F)) * _fs_in;
|
||||
_codeValueIndex = AUX_CEIL2(aux) - 1;
|
||||
_dest[i] = _from[_codeValueIndex];
|
||||
aux = (t_out * (static_cast<float>(i) + 1.0F)) * fs_in;
|
||||
codeValueIndex = AUX_CEIL2(aux) - 1;
|
||||
dest[i] = from[codeValueIndex];
|
||||
}
|
||||
// Correct the last index (due to number rounding issues)
|
||||
_dest[_dest.size() - 1] = _from[_from.size() - 1];
|
||||
dest[dest_size - 1] = from[from.size() - 1];
|
||||
}
|
||||
|
||||
@@ -7,13 +7,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
@@ -40,44 +37,44 @@ namespace own = gsl;
|
||||
|
||||
|
||||
/*!
|
||||
* \brief This function generates a complex exponential in _dest.
|
||||
* \brief This function generates a complex exponential in dest.
|
||||
*
|
||||
*/
|
||||
void complex_exp_gen(own::span<std::complex<float>> _dest, double _f, double _fs);
|
||||
void complex_exp_gen(own::span<std::complex<float>> dest, double freq, double sampling_freq);
|
||||
|
||||
/*!
|
||||
* \brief This function generates a conjugate complex exponential in _dest.
|
||||
* \brief This function generates a conjugate complex exponential in dest.
|
||||
*
|
||||
*/
|
||||
void complex_exp_gen_conj(own::span<std::complex<float>> _dest, double _f, double _fs);
|
||||
void complex_exp_gen_conj(own::span<std::complex<float>> dest, double freq, double sampling_freq);
|
||||
|
||||
/*!
|
||||
* \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(own::span<int32_t> _dest, char _from);
|
||||
void hex_to_binary_converter(own::span<int32_t> dest, char from);
|
||||
|
||||
/*!
|
||||
* \brief This function makes a conversion from hex (the input is a char)
|
||||
* to binary (the output is a string of 4 char with 0 or 1 values).
|
||||
*
|
||||
*/
|
||||
std::string hex_to_binary_string(char _from);
|
||||
std::string hex_to_binary_string(char from);
|
||||
|
||||
/*!
|
||||
* \brief This function resamples a sequence of float values.
|
||||
*
|
||||
*/
|
||||
void resampler(const own::span<float> _from, own::span<float> _dest,
|
||||
float _fs_in, float _fs_out);
|
||||
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(own::span<const std::complex<float>> _from, own::span<std::complex<float>> _dest,
|
||||
float _fs_in, float _fs_out);
|
||||
void resampler(own::span<const std::complex<float>> from, own::span<std::complex<float>> dest,
|
||||
float fs_in, float fs_out);
|
||||
|
||||
|
||||
/** \} */
|
||||
|
||||
@@ -6,13 +6,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
@@ -31,43 +28,43 @@ uint32_t gps_l2c_m_shift(uint32_t x)
|
||||
}
|
||||
|
||||
|
||||
void gps_l2c_m_code(own::span<int32_t> _dest, uint32_t _prn)
|
||||
void gps_l2c_m_code(own::span<int32_t> dest, uint32_t prn)
|
||||
{
|
||||
uint32_t x = GPS_L2C_M_INIT_REG[_prn - 1];
|
||||
uint32_t x = GPS_L2C_M_INIT_REG[prn - 1];
|
||||
for (int32_t n = 0; n < GPS_L2_M_CODE_LENGTH_CHIPS; n++)
|
||||
{
|
||||
_dest[n] = static_cast<int8_t>(x & 1U);
|
||||
dest[n] = static_cast<int32_t>(x & 1U);
|
||||
x = gps_l2c_m_shift(x);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void gps_l2c_m_code_gen_complex(own::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)
|
||||
std::array<int32_t, GPS_L2_M_CODE_LENGTH_CHIPS> code_aux{};
|
||||
if (prn > 0 and prn < 51)
|
||||
{
|
||||
gps_l2c_m_code(_code, _prn);
|
||||
gps_l2c_m_code(code_aux, prn);
|
||||
}
|
||||
|
||||
for (int32_t i = 0; i < GPS_L2_M_CODE_LENGTH_CHIPS; i++)
|
||||
{
|
||||
_dest[i] = std::complex<float>(0.0, 1.0F - 2.0F * _code[i]);
|
||||
dest[i] = std::complex<float>(0.0, 1.0F - 2.0F * code_aux[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void gps_l2c_m_code_gen_float(own::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)
|
||||
std::array<int32_t, GPS_L2_M_CODE_LENGTH_CHIPS> code_aux{};
|
||||
if (prn > 0 and prn < 51)
|
||||
{
|
||||
gps_l2c_m_code(_code, _prn);
|
||||
gps_l2c_m_code(code_aux, prn);
|
||||
}
|
||||
|
||||
for (int32_t i = 0; i < GPS_L2_M_CODE_LENGTH_CHIPS; i++)
|
||||
{
|
||||
_dest[i] = 1.0 - 2.0 * static_cast<float>(_code[i]);
|
||||
dest[i] = 1.0 - 2.0 * static_cast<float>(code_aux[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,37 +72,37 @@ 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(own::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 sampling_freq)
|
||||
{
|
||||
constexpr int32_t _codeLength = GPS_L2_M_CODE_LENGTH_CHIPS;
|
||||
constexpr float _tc = 1.0F / static_cast<float>(GPS_L2_M_CODE_RATE_CPS); // L2C chip period in sec
|
||||
constexpr int32_t codeLength = GPS_L2_M_CODE_LENGTH_CHIPS;
|
||||
constexpr float tc = 1.0F / static_cast<float>(GPS_L2_M_CODE_RATE_CPS); // L2C chip period in sec
|
||||
|
||||
const auto _samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / (static_cast<double>(GPS_L2_M_CODE_RATE_CPS) / static_cast<double>(_codeLength)));
|
||||
const float _ts = 1.0F / static_cast<float>(_fs); // Sampling period in sec
|
||||
int32_t _codeValueIndex;
|
||||
const auto samplesPerCode = static_cast<int32_t>(static_cast<double>(sampling_freq) / (static_cast<double>(GPS_L2_M_CODE_RATE_CPS) / static_cast<double>(codeLength)));
|
||||
const float ts = 1.0F / static_cast<float>(sampling_freq); // Sampling period in sec
|
||||
int32_t codeValueIndex;
|
||||
|
||||
std::array<int32_t, GPS_L2_M_CODE_LENGTH_CHIPS> _code{};
|
||||
if (_prn > 0 and _prn < 51)
|
||||
std::array<int32_t, GPS_L2_M_CODE_LENGTH_CHIPS> code_aux{};
|
||||
if (prn > 0 and prn < 51)
|
||||
{
|
||||
gps_l2c_m_code(_code, _prn);
|
||||
gps_l2c_m_code(code_aux, prn);
|
||||
}
|
||||
|
||||
for (int32_t i = 0; i < _samplesPerCode; i++)
|
||||
for (int32_t i = 0; i < samplesPerCode; i++)
|
||||
{
|
||||
// === Digitizing ==================================================
|
||||
|
||||
// --- Make index array to read L2C code values --------------------
|
||||
_codeValueIndex = std::ceil((_ts * (static_cast<float>(i) + 1.0F)) / _tc) - 1;
|
||||
codeValueIndex = std::ceil((ts * (static_cast<float>(i) + 1.0F)) / tc) - 1;
|
||||
|
||||
// --- Make the digitized version of the L2C code ------------------
|
||||
if (i == _samplesPerCode - 1)
|
||||
if (i == samplesPerCode - 1)
|
||||
{
|
||||
// --- Correct the last index (due to number rounding issues) -----------
|
||||
_dest[i] = std::complex<float>(0.0, 1.0F - 2.0F * _code[_codeLength - 1]);
|
||||
// Correct the last index (due to number rounding issues)
|
||||
dest[i] = std::complex<float>(0.0, 1.0F - 2.0F * code_aux[codeLength - 1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
_dest[i] = std::complex<float>(0.0, 1.0F - 2.0F * _code[_codeValueIndex]); // repeat the chip -> upsample
|
||||
dest[i] = std::complex<float>(0.0, 1.0F - 2.0F * code_aux[codeValueIndex]); // repeat the chip -> upsample
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,13 +6,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
@@ -38,11 +35,13 @@ namespace own = gsl;
|
||||
|
||||
|
||||
//! Generates complex GPS L2C M code for the desired SV ID
|
||||
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);
|
||||
void gps_l2c_m_code_gen_complex(own::span<std::complex<float>> dest, uint32_t prn);
|
||||
|
||||
//! Generates float GPS L2C M code for the desired SV ID
|
||||
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(own::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 sampling_freq);
|
||||
|
||||
|
||||
/** \} */
|
||||
|
||||
@@ -6,13 +6,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
@@ -120,7 +117,7 @@ std::deque<bool> make_l5q_xb()
|
||||
}
|
||||
|
||||
|
||||
void make_l5i(own::span<int32_t> _dest, int32_t prn)
|
||||
void make_l5i(own::span<int32_t> dest, int32_t prn)
|
||||
{
|
||||
const int32_t xb_offset = GPS_L5I_INIT_REG[prn];
|
||||
|
||||
@@ -135,12 +132,12 @@ void make_l5i(own::span<int32_t> _dest, int32_t prn)
|
||||
|
||||
for (int32_t n = 0; n < GPS_L5I_CODE_LENGTH_CHIPS; n++)
|
||||
{
|
||||
_dest[n] = xa[n] xor xb_shift[n];
|
||||
dest[n] = xa[n] xor xb_shift[n];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void make_l5q(own::span<int32_t> _dest, int32_t prn)
|
||||
void make_l5q(own::span<int32_t> dest, int32_t prn)
|
||||
{
|
||||
const int32_t xb_offset = GPS_L5Q_INIT_REG[prn];
|
||||
|
||||
@@ -155,37 +152,37 @@ void make_l5q(own::span<int32_t> _dest, int32_t prn)
|
||||
|
||||
for (int32_t n = 0; n < GPS_L5Q_CODE_LENGTH_CHIPS; n++)
|
||||
{
|
||||
_dest[n] = xa[n] xor xb_shift[n];
|
||||
dest[n] = xa[n] xor xb_shift[n];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void gps_l5i_code_gen_complex(own::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)
|
||||
std::array<int32_t, GPS_L5I_CODE_LENGTH_CHIPS> code_aux{};
|
||||
if (prn > 0 and prn < 51)
|
||||
{
|
||||
make_l5i(_code, _prn - 1);
|
||||
make_l5i(code_aux, prn - 1);
|
||||
}
|
||||
|
||||
for (int32_t i = 0; i < GPS_L5I_CODE_LENGTH_CHIPS; i++)
|
||||
{
|
||||
_dest[i] = std::complex<float>(1.0F - 2.0F * static_cast<float>(_code[i]), 0.0);
|
||||
dest[i] = std::complex<float>(1.0F - 2.0F * static_cast<float>(code_aux[i]), 0.0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void gps_l5i_code_gen_float(own::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)
|
||||
std::array<int32_t, GPS_L5I_CODE_LENGTH_CHIPS> code_aux{};
|
||||
if (prn > 0 and prn < 51)
|
||||
{
|
||||
make_l5i(_code, _prn - 1);
|
||||
make_l5i(code_aux, prn - 1);
|
||||
}
|
||||
|
||||
for (int32_t i = 0; i < GPS_L5I_CODE_LENGTH_CHIPS; i++)
|
||||
{
|
||||
_dest[i] = 1.0F - 2.0F * static_cast<float>(_code[i]);
|
||||
dest[i] = 1.0F - 2.0F * static_cast<float>(code_aux[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,68 +190,68 @@ void gps_l5i_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(own::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 sampling_freq)
|
||||
{
|
||||
constexpr int32_t _codeLength = GPS_L5I_CODE_LENGTH_CHIPS;
|
||||
constexpr float _tc = 1.0 / static_cast<float>(GPS_L5I_CODE_RATE_CPS); // L5I primary chip period in sec
|
||||
constexpr int32_t codeLength = GPS_L5I_CODE_LENGTH_CHIPS;
|
||||
constexpr float tc = 1.0 / static_cast<float>(GPS_L5I_CODE_RATE_CPS); // L5I primary chip period in sec
|
||||
|
||||
const auto _samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / (static_cast<double>(GPS_L5I_CODE_RATE_CPS) / static_cast<double>(_codeLength)));
|
||||
const float _ts = 1.0F / static_cast<float>(_fs); // Sampling period in sec
|
||||
int32_t _codeValueIndex;
|
||||
const auto samplesPerCode = static_cast<int32_t>(static_cast<double>(sampling_freq) / (static_cast<double>(GPS_L5I_CODE_RATE_CPS) / static_cast<double>(codeLength)));
|
||||
const float ts = 1.0F / static_cast<float>(sampling_freq); // Sampling period in sec
|
||||
int32_t codeValueIndex;
|
||||
|
||||
std::array<int32_t, GPS_L5I_CODE_LENGTH_CHIPS> _code{};
|
||||
if (_prn > 0 and _prn < 51)
|
||||
std::array<int32_t, GPS_L5I_CODE_LENGTH_CHIPS> code_aux{};
|
||||
if (prn > 0 and prn < 51)
|
||||
{
|
||||
make_l5i(_code, _prn - 1);
|
||||
make_l5i(code_aux, prn - 1);
|
||||
}
|
||||
|
||||
for (int32_t i = 0; i < _samplesPerCode; i++)
|
||||
for (int32_t i = 0; i < samplesPerCode; i++)
|
||||
{
|
||||
// === Digitizing ==================================================
|
||||
|
||||
// --- Make index array to read L5 code values ---------------------
|
||||
_codeValueIndex = static_cast<int32_t>(std::ceil(_ts * static_cast<float>(i + 1.0F) / _tc)) - 1;
|
||||
codeValueIndex = static_cast<int32_t>(std::ceil(ts * static_cast<float>(i + 1.0F) / tc)) - 1;
|
||||
|
||||
// --- Make the digitized version of the L5I code ------------------
|
||||
if (i == _samplesPerCode - 1)
|
||||
if (i == samplesPerCode - 1)
|
||||
{
|
||||
// --- Correct the last index (due to number rounding issues) -----------
|
||||
_dest[i] = std::complex<float>(1.0F - 2.0F * _code[_codeLength - 1], 0.0);
|
||||
dest[i] = std::complex<float>(1.0F - 2.0F * code_aux[codeLength - 1], 0.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
_dest[i] = std::complex<float>(1.0F - 2.0F * _code[_codeValueIndex], 0.0); // repeat the chip -> upsample
|
||||
dest[i] = std::complex<float>(1.0F - 2.0F * code_aux[codeValueIndex], 0.0); // repeat the chip -> upsample
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void gps_l5q_code_gen_complex(own::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)
|
||||
std::array<int32_t, GPS_L5Q_CODE_LENGTH_CHIPS> code_aux{};
|
||||
if (prn > 0 and prn < 51)
|
||||
{
|
||||
make_l5q(_code, _prn - 1);
|
||||
make_l5q(code_aux, prn - 1);
|
||||
}
|
||||
|
||||
for (int32_t i = 0; i < GPS_L5Q_CODE_LENGTH_CHIPS; i++)
|
||||
{
|
||||
_dest[i] = std::complex<float>(0.0, 1.0F - 2.0F * static_cast<float>(_code[i]));
|
||||
dest[i] = std::complex<float>(0.0, 1.0F - 2.0F * static_cast<float>(code_aux[i]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void gps_l5q_code_gen_float(own::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)
|
||||
std::array<int32_t, GPS_L5Q_CODE_LENGTH_CHIPS> code_aux{};
|
||||
if (prn > 0 and prn < 51)
|
||||
{
|
||||
make_l5q(_code, _prn - 1);
|
||||
make_l5q(code_aux, prn - 1);
|
||||
}
|
||||
|
||||
for (int32_t i = 0; i < GPS_L5Q_CODE_LENGTH_CHIPS; i++)
|
||||
{
|
||||
_dest[i] = 1.0 - 2.0 * static_cast<float>(_code[i]);
|
||||
dest[i] = 1.0 - 2.0 * static_cast<float>(code_aux[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -262,40 +259,40 @@ void gps_l5q_code_gen_float(own::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(own::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 sampling_freq)
|
||||
{
|
||||
std::array<int32_t, GPS_L5Q_CODE_LENGTH_CHIPS> _code{};
|
||||
if (_prn > 0 and _prn < 51)
|
||||
std::array<int32_t, GPS_L5Q_CODE_LENGTH_CHIPS> code_aux{};
|
||||
if (prn > 0 and prn < 51)
|
||||
{
|
||||
make_l5q(_code, _prn - 1);
|
||||
make_l5q(code_aux, prn - 1);
|
||||
}
|
||||
|
||||
int32_t _codeValueIndex;
|
||||
constexpr int32_t _codeLength = GPS_L5Q_CODE_LENGTH_CHIPS;
|
||||
int32_t codeValueIndex;
|
||||
constexpr int32_t codeLength = GPS_L5Q_CODE_LENGTH_CHIPS;
|
||||
|
||||
// --- Find number of samples per spreading code ---------------------------
|
||||
const auto _samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / (static_cast<double>(GPS_L5Q_CODE_RATE_CPS) / static_cast<double>(_codeLength)));
|
||||
const auto samplesPerCode = static_cast<int32_t>(static_cast<double>(sampling_freq) / (static_cast<double>(GPS_L5Q_CODE_RATE_CPS) / static_cast<double>(codeLength)));
|
||||
|
||||
// --- Find time constants -------------------------------------------------
|
||||
const float _ts = 1.0F / static_cast<float>(_fs); // Sampling period in sec
|
||||
constexpr float _tc = 1.0F / static_cast<float>(GPS_L5Q_CODE_RATE_CPS); // L5Q chip period in sec
|
||||
const float ts = 1.0F / static_cast<float>(sampling_freq); // Sampling period in sec
|
||||
constexpr float tc = 1.0F / static_cast<float>(GPS_L5Q_CODE_RATE_CPS); // L5Q chip period in sec
|
||||
|
||||
for (int32_t i = 0; i < _samplesPerCode; i++)
|
||||
for (int32_t i = 0; i < samplesPerCode; i++)
|
||||
{
|
||||
// === Digitizing ==================================================
|
||||
|
||||
// --- Make index array to read L5 code values ---------------------
|
||||
_codeValueIndex = static_cast<int32_t>(std::ceil(_ts * static_cast<float>(i + 1.0F) / _tc)) - 1;
|
||||
codeValueIndex = static_cast<int32_t>(std::ceil(ts * static_cast<float>(i + 1.0F) / tc)) - 1;
|
||||
|
||||
// --- Make the digitized version of the L5Q code ------------------
|
||||
if (i == _samplesPerCode - 1)
|
||||
if (i == samplesPerCode - 1)
|
||||
{
|
||||
// --- Correct the last index (due to number rounding issues) -----------
|
||||
_dest[i] = std::complex<float>(0.0, 1.0F - 2.0F * _code[_codeLength - 1]);
|
||||
dest[i] = std::complex<float>(0.0, 1.0F - 2.0F * code_aux[codeLength - 1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
_dest[i] = std::complex<float>(0.0, 1.0F - 2.0F * _code[_codeValueIndex]); // repeat the chip -> upsample
|
||||
dest[i] = std::complex<float>(0.0, 1.0F - 2.0F * code_aux[codeValueIndex]); // repeat the chip -> upsample
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,13 +6,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
@@ -38,22 +35,22 @@ namespace own = gsl;
|
||||
|
||||
|
||||
//! Generates complex GPS L5I code for the desired SV ID
|
||||
void gps_l5i_code_gen_complex(own::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(own::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(own::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(own::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(own::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 sampling_freq);
|
||||
|
||||
//! Generates complex GPS L5Q code for the desired SV ID, and sampled to specific sampling frequency
|
||||
void gps_l5q_code_gen_complex_sampled(own::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 sampling_freq);
|
||||
|
||||
|
||||
/** \} */
|
||||
|
||||
@@ -7,13 +7,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
@@ -25,11 +22,11 @@
|
||||
|
||||
const auto AUX_CEIL = [](float x) { return static_cast<int32_t>(static_cast<int64_t>((x) + 1)); };
|
||||
|
||||
void gps_l1_ca_code_gen_int(own::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)
|
||||
{
|
||||
constexpr uint32_t _code_length = 1023;
|
||||
std::bitset<_code_length> G1{};
|
||||
std::bitset<_code_length> G2{};
|
||||
constexpr uint32_t code_length = 1023;
|
||||
std::bitset<code_length> G1{};
|
||||
std::bitset<code_length> G2{};
|
||||
auto G1_register = std::bitset<10>{}.set(); // All true
|
||||
auto G2_register = std::bitset<10>{}.set(); // All true
|
||||
uint32_t lcv;
|
||||
@@ -47,13 +44,13 @@ void gps_l1_ca_code_gen_int(own::span<int32_t> _dest, int32_t _prn, uint32_t _ch
|
||||
355, 1012, 176, 603, 130, 359, 595, 68, 386 /*PRN138*/};
|
||||
|
||||
// compute delay array index for given PRN number
|
||||
if (120 <= _prn && _prn <= 138)
|
||||
if (120 <= prn && prn <= 138)
|
||||
{
|
||||
prn_idx = _prn - 88; // SBAS PRNs are at array indices 31 to 50 (offset: -120+33-1 =-88)
|
||||
prn_idx = prn - 88; // SBAS PRNs are at array indices 31 to 50 (offset: -120+33-1 =-88)
|
||||
}
|
||||
else
|
||||
{
|
||||
prn_idx = _prn - 1;
|
||||
prn_idx = prn - 1;
|
||||
}
|
||||
|
||||
// A simple error check
|
||||
@@ -63,7 +60,7 @@ void gps_l1_ca_code_gen_int(own::span<int32_t> _dest, int32_t _prn, uint32_t _ch
|
||||
}
|
||||
|
||||
// Generate G1 & G2 Register
|
||||
for (lcv = 0; lcv < _code_length; lcv++)
|
||||
for (lcv = 0; lcv < code_length; lcv++)
|
||||
{
|
||||
G1[lcv] = G1_register[0];
|
||||
G2[lcv] = G2_register[0];
|
||||
@@ -82,52 +79,52 @@ void gps_l1_ca_code_gen_int(own::span<int32_t> _dest, int32_t _prn, uint32_t _ch
|
||||
}
|
||||
|
||||
// Set the delay
|
||||
delay = _code_length - delays[prn_idx];
|
||||
delay += _chip_shift;
|
||||
delay %= _code_length;
|
||||
delay = code_length - delays[prn_idx];
|
||||
delay += chip_shift;
|
||||
delay %= code_length;
|
||||
|
||||
// Generate PRN from G1 and G2 Registers
|
||||
for (lcv = 0; lcv < _code_length; lcv++)
|
||||
for (lcv = 0; lcv < code_length; lcv++)
|
||||
{
|
||||
aux = G1[(lcv + _chip_shift) % _code_length] xor G2[delay];
|
||||
aux = G1[(lcv + chip_shift) % code_length] xor G2[delay];
|
||||
if (aux == true)
|
||||
{
|
||||
_dest[lcv] = 1;
|
||||
dest[lcv] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
_dest[lcv] = -1;
|
||||
dest[lcv] = -1;
|
||||
}
|
||||
delay++;
|
||||
delay %= _code_length;
|
||||
delay %= code_length;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void gps_l1_ca_code_gen_float(own::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)
|
||||
{
|
||||
constexpr uint32_t _code_length = 1023;
|
||||
std::array<int32_t, _code_length> ca_code_int{};
|
||||
constexpr uint32_t code_length = 1023;
|
||||
std::array<int32_t, code_length> ca_code_int{};
|
||||
|
||||
gps_l1_ca_code_gen_int(ca_code_int, _prn, _chip_shift);
|
||||
gps_l1_ca_code_gen_int(ca_code_int, prn, chip_shift);
|
||||
|
||||
for (uint32_t ii = 0; ii < _code_length; ++ii)
|
||||
for (uint32_t ii = 0; ii < code_length; ++ii)
|
||||
{
|
||||
_dest[ii] = static_cast<float>(ca_code_int[ii]);
|
||||
dest[ii] = static_cast<float>(ca_code_int[ii]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void gps_l1_ca_code_gen_complex(own::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)
|
||||
{
|
||||
constexpr uint32_t _code_length = 1023;
|
||||
std::array<int32_t, _code_length> ca_code_int{};
|
||||
constexpr uint32_t code_length = 1023;
|
||||
std::array<int32_t, code_length> ca_code_int{};
|
||||
|
||||
gps_l1_ca_code_gen_int(ca_code_int, _prn, _chip_shift);
|
||||
gps_l1_ca_code_gen_int(ca_code_int, prn, chip_shift);
|
||||
|
||||
for (uint32_t ii = 0; ii < _code_length; ++ii)
|
||||
for (uint32_t ii = 0; ii < code_length; ++ii)
|
||||
{
|
||||
_dest[ii] = std::complex<float>(0.0F, static_cast<float>(ca_code_int[ii]));
|
||||
dest[ii] = std::complex<float>(0.0F, static_cast<float>(ca_code_int[ii]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,22 +133,22 @@ void gps_l1_ca_code_gen_complex(own::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(own::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 sampling_freq, uint32_t chip_shift)
|
||||
{
|
||||
// This function is based on the GNU software GPS for MATLAB in the Kay Borre book
|
||||
constexpr int32_t _codeFreqBasis = 1023000; // Hz
|
||||
constexpr int32_t _codeLength = 1023;
|
||||
constexpr float _tc = 1.0F / static_cast<float>(_codeFreqBasis); // C/A chip period in sec
|
||||
constexpr int32_t codeFreqBasis = 1023000; // chips per second
|
||||
constexpr int32_t codeLength = 1023;
|
||||
constexpr float tc = 1.0F / static_cast<float>(codeFreqBasis); // C/A chip period in sec
|
||||
|
||||
const auto _samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / (static_cast<double>(_codeFreqBasis) / static_cast<double>(_codeLength)));
|
||||
const float _ts = 1.0F / static_cast<float>(_fs); // Sampling period in sec
|
||||
std::array<std::complex<float>, 1023> _code{};
|
||||
int32_t _codeValueIndex;
|
||||
const auto samplesPerCode = static_cast<int32_t>(static_cast<double>(sampling_freq) / (static_cast<double>(codeFreqBasis) / static_cast<double>(codeLength)));
|
||||
const float ts = 1.0F / static_cast<float>(sampling_freq); // Sampling period in sec
|
||||
std::array<std::complex<float>, 1023> code_aux{};
|
||||
int32_t codeValueIndex;
|
||||
float aux;
|
||||
|
||||
gps_l1_ca_code_gen_complex(_code, _prn, _chip_shift); // generate C/A code 1 sample per chip
|
||||
gps_l1_ca_code_gen_complex(code_aux, prn, chip_shift); // generate C/A code 1 sample per chip
|
||||
|
||||
for (int32_t i = 0; i < _samplesPerCode; i++)
|
||||
for (int32_t i = 0; i < samplesPerCode; i++)
|
||||
{
|
||||
// === Digitizing ==================================================
|
||||
|
||||
@@ -160,20 +157,20 @@ void gps_l1_ca_code_gen_complex_sampled(own::span<std::complex<float>> _dest, ui
|
||||
// number of samples per millisecond (because one C/A code period is one
|
||||
// millisecond).
|
||||
|
||||
aux = (_ts * (static_cast<float>(i) + 1)) / _tc;
|
||||
_codeValueIndex = AUX_CEIL(aux) - 1;
|
||||
aux = (ts * (static_cast<float>(i) + 1)) / tc;
|
||||
codeValueIndex = AUX_CEIL(aux) - 1;
|
||||
|
||||
// --- Make the digitized version of the C/A code -------------------
|
||||
// The "upsampled" code is made by selecting values form the CA code
|
||||
// chip array (caCode) for the time instances of each sample.
|
||||
if (i == _samplesPerCode - 1)
|
||||
if (i == samplesPerCode - 1)
|
||||
{
|
||||
// --- Correct the last index (due to number rounding issues)
|
||||
_dest[i] = _code[_codeLength - 1];
|
||||
dest[i] = code_aux[codeLength - 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
_dest[i] = _code[_codeValueIndex]; // repeat the chip -> upsample
|
||||
dest[i] = code_aux[codeValueIndex]; // repeat the chip -> upsample
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,13 +7,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
@@ -39,19 +36,16 @@ namespace own = gsl;
|
||||
|
||||
|
||||
//! Generates int GPS L1 C/A code for the desired SV ID and code shift
|
||||
void gps_l1_ca_code_gen_int(own::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(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(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(own::span<std::complex<float>> _dest, uint32_t _prn, int32_t _fs, uint32_t _chip_shift, uint32_t _ncodes);
|
||||
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
|
||||
void gps_l1_ca_code_gen_complex_sampled(own::span<std::complex<float>> _dest, uint32_t _prn, int32_t _fs, 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 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_sampled(own::span<std::complex<float>> dest, uint32_t prn, int32_t sampling_freq, uint32_t chip_shift);
|
||||
|
||||
|
||||
/** \} */
|
||||
|
||||
@@ -8,13 +8,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
|
||||
@@ -8,13 +8,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
|
||||
@@ -7,13 +7,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
|
||||
@@ -7,13 +7,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
# Copyright (C) 2012-2020 (see AUTHORS file for a list of contributors)
|
||||
#
|
||||
# GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
||||
#
|
||||
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
# This file is part of GNSS-SDR.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2010-2020 C. Fernandez-Prades cfernandez(at)cttc.es
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
set(RTKLIB_LIB_SOURCES
|
||||
|
||||
@@ -5,13 +5,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
|
||||
@@ -5,13 +5,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
@@ -304,8 +304,8 @@ void readsp3b(FILE *fp, char type, int *sats __attribute__((unused)), int ns, co
|
||||
/* compare precise ephemeris -------------------------------------------------*/
|
||||
int cmppeph(const void *p1, const void *p2)
|
||||
{
|
||||
auto *q1 = static_cast<const peph_t *>(p1);
|
||||
auto *q2 = static_cast<const peph_t *>(p2);
|
||||
const auto *q1 = static_cast<const peph_t *>(p1);
|
||||
const auto *q2 = static_cast<const peph_t *>(p2);
|
||||
double tt = timediff(q1->time, q2->time);
|
||||
return tt < -1e-9 ? -1 : (tt > 1e-9 ? 1 : q1->index - q2->index);
|
||||
}
|
||||
|
||||
@@ -3309,8 +3309,8 @@ int geterp(const erp_t *erp, gtime_t time, double *erpv)
|
||||
/* compare ephemeris ---------------------------------------------------------*/
|
||||
int cmpeph(const void *p1, const void *p2)
|
||||
{
|
||||
auto *q1 = static_cast<const eph_t *>(p1);
|
||||
auto *q2 = static_cast<const eph_t *>(p2);
|
||||
const auto *q1 = static_cast<const eph_t *>(p1);
|
||||
const auto *q2 = static_cast<const eph_t *>(p2);
|
||||
return q1->ttr.time != q2->ttr.time ? static_cast<int>(q1->ttr.time - q2->ttr.time) : (q1->toe.time != q2->toe.time ? static_cast<int>(q1->toe.time - q2->toe.time) : q1->sat - q2->sat);
|
||||
}
|
||||
|
||||
@@ -3359,8 +3359,8 @@ void uniqeph(nav_t *nav)
|
||||
/* compare glonass ephemeris -------------------------------------------------*/
|
||||
int cmpgeph(const void *p1, const void *p2)
|
||||
{
|
||||
auto *q1 = static_cast<const geph_t *>(p1);
|
||||
auto *q2 = static_cast<const geph_t *>(p2);
|
||||
const auto *q1 = static_cast<const geph_t *>(p1);
|
||||
const auto *q2 = static_cast<const geph_t *>(p2);
|
||||
return q1->tof.time != q2->tof.time ? static_cast<int>(q1->tof.time - q2->tof.time) : (q1->toe.time != q2->toe.time ? static_cast<int>(q1->toe.time - q2->toe.time) : q1->sat - q2->sat);
|
||||
}
|
||||
|
||||
@@ -3410,8 +3410,8 @@ void uniqgeph(nav_t *nav)
|
||||
/* compare sbas ephemeris ----------------------------------------------------*/
|
||||
int cmpseph(const void *p1, const void *p2)
|
||||
{
|
||||
auto *q1 = static_cast<const seph_t *>(p1);
|
||||
auto *q2 = static_cast<const seph_t *>(p2);
|
||||
const auto *q1 = static_cast<const seph_t *>(p1);
|
||||
const auto *q2 = static_cast<const seph_t *>(p2);
|
||||
return q1->tof.time != q2->tof.time ? static_cast<int>(q1->tof.time - q2->tof.time) : (q1->t0.time != q2->t0.time ? static_cast<int>(q1->t0.time - q2->t0.time) : q1->sat - q2->sat);
|
||||
}
|
||||
|
||||
@@ -3488,8 +3488,8 @@ void uniqnav(nav_t *nav)
|
||||
/* compare observation data -------------------------------------------------*/
|
||||
int cmpobs(const void *p1, const void *p2)
|
||||
{
|
||||
auto *q1 = static_cast<const obsd_t *>(p1);
|
||||
auto *q2 = static_cast<const obsd_t *>(p2);
|
||||
const auto *q1 = static_cast<const obsd_t *>(p1);
|
||||
const auto *q2 = static_cast<const obsd_t *>(p2);
|
||||
double tt = timediff(q1->time, q2->time);
|
||||
if (fabs(tt) > DTTOL)
|
||||
{
|
||||
|
||||
@@ -26,8 +26,6 @@
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
@@ -26,8 +26,6 @@
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
@@ -26,8 +26,6 @@
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
@@ -730,8 +730,8 @@ void readmsgs(const char *file, int sel, gtime_t ts, gtime_t te,
|
||||
/* compare sbas messages -----------------------------------------------------*/
|
||||
int cmpmsgs(const void *p1, const void *p2)
|
||||
{
|
||||
auto *q1 = static_cast<const sbsmsg_t *>(p1);
|
||||
auto *q2 = static_cast<const sbsmsg_t *>(p2);
|
||||
const auto *q1 = static_cast<const sbsmsg_t *>(p1);
|
||||
const auto *q2 = static_cast<const sbsmsg_t *>(p2);
|
||||
return q1->week != q2->week ? q1->week - q2->week : (q1->tow < q2->tow ? -1 : (q1->tow > q2->tow ? 1 : q1->prn - q2->prn));
|
||||
}
|
||||
|
||||
|
||||
@@ -982,8 +982,8 @@ int readsoldata(FILE *fp, gtime_t ts, gtime_t te, double tint, int qflag,
|
||||
/* compare solution data -----------------------------------------------------*/
|
||||
int cmpsol(const void *p1, const void *p2)
|
||||
{
|
||||
auto *q1 = static_cast<const sol_t *>(p1);
|
||||
auto *q2 = static_cast<const sol_t *>(p2);
|
||||
const auto *q1 = static_cast<const sol_t *>(p1);
|
||||
const auto *q2 = static_cast<const sol_t *>(p2);
|
||||
double tt = timediff(q1->time, q2->time);
|
||||
return tt < -0.0 ? -1 : (tt > 0.0 ? 1 : 0);
|
||||
}
|
||||
@@ -1211,8 +1211,8 @@ void freesolstatbuf(solstatbuf_t *solstatbuf)
|
||||
/* compare solution status ---------------------------------------------------*/
|
||||
int cmpsolstat(const void *p1, const void *p2)
|
||||
{
|
||||
auto *q1 = static_cast<const solstat_t *>(p1);
|
||||
auto *q2 = static_cast<const solstat_t *>(p2);
|
||||
const auto *q1 = static_cast<const solstat_t *>(p1);
|
||||
const auto *q2 = static_cast<const solstat_t *>(p2);
|
||||
double tt = timediff(q1->time, q2->time);
|
||||
return tt < -0.0 ? -1 : (tt > 0.0 ? 1 : 0);
|
||||
}
|
||||
@@ -1802,6 +1802,46 @@ int outnmea_gsa(unsigned char *buff, const sol_t *sol,
|
||||
}
|
||||
p += std::snprintf(p, MSG_TAIL, "*%02X%c%c", sum, 0x0D, 0x0A);
|
||||
}
|
||||
/* BDGSA: beidou */
|
||||
for (sat = 1, nsat = 0; sat <= MAXSAT && nsat < 12; sat++)
|
||||
{
|
||||
if (!ssat[sat - 1].vs || ssat[sat - 1].azel[1] <= 0.0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (satsys(sat, prn + nsat) != SYS_BDS)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
azel[i + nsat * 2] = ssat[sat - 1].azel[i];
|
||||
}
|
||||
nsat++;
|
||||
}
|
||||
if (nsat > 0)
|
||||
{
|
||||
s = p;
|
||||
p += std::snprintf(p, MAXSOLBUF, "$BDGSA,A,%d", sol->stat <= 0 ? 1 : 3);
|
||||
for (i = 0; i < 12; i++)
|
||||
{
|
||||
if (i < nsat)
|
||||
{
|
||||
p += std::snprintf(p, MAX_LENGTH_INT + 2, ",%02d", prn[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
p += std::snprintf(p, COMMA_LENGTH, ",");
|
||||
}
|
||||
}
|
||||
dops(nsat, azel, 0.0, dop);
|
||||
p += std::snprintf(p, MAXSOLBUF - (p - s), ",%3.1f,%3.1f,%3.1f,3", dop[1], dop[2], dop[3]);
|
||||
for (q = s + 1, sum = 0; *q; q++)
|
||||
{
|
||||
sum ^= *q; /* check-sum */
|
||||
}
|
||||
p += std::snprintf(p, MSG_TAIL, "*%02X%c%c", sum, 0x0D, 0x0A);
|
||||
}
|
||||
return p - reinterpret_cast<char *>(buff);
|
||||
}
|
||||
|
||||
@@ -1980,6 +2020,51 @@ int outnmea_gsv(unsigned char *buff, const sol_t *sol,
|
||||
}
|
||||
p += std::snprintf(p, MSG_TAIL, "*%02X%c%c", sum, 0x0D, 0x0A);
|
||||
}
|
||||
/* BDGSV: beidou */
|
||||
for (sat = 1, n = 0; sat < MAXSAT && n < 12; sat++)
|
||||
{
|
||||
if (satsys(sat, &prn) != SYS_BDS)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (ssat[sat - 1].vs && ssat[sat - 1].azel[1] > 0.0)
|
||||
{
|
||||
sats[n++] = sat;
|
||||
}
|
||||
}
|
||||
nmsg = n <= 0 ? 0 : (n - 1) / 4 + 1;
|
||||
|
||||
for (i = k = 0; i < nmsg; i++)
|
||||
{
|
||||
s = p;
|
||||
p += std::snprintf(p, MAXSOLBUF, "$BDGSV,%d,%d,%02d", nmsg, i + 1, n);
|
||||
|
||||
for (j = 0; j < 4; j++, k++)
|
||||
{
|
||||
if (k < n)
|
||||
{
|
||||
satsys(sats[k], &prn); /* 1-63 */
|
||||
az = ssat[sats[k] - 1].azel[0] * R2D;
|
||||
if (az < 0.0)
|
||||
{
|
||||
az += 360.0;
|
||||
}
|
||||
el = ssat[sats[k] - 1].azel[1] * R2D;
|
||||
snr = ssat[sats[k] - 1].snr[0] * 0.25;
|
||||
p += std::snprintf(p, MAXSOLBUF - (s - p), ",%02d,%02.0f,%03.0f,%02.0f", prn, el, az, snr);
|
||||
}
|
||||
else
|
||||
{
|
||||
p += std::snprintf(p, MAXSOLBUF - (s - p), ",,,,");
|
||||
}
|
||||
}
|
||||
p += std::snprintf(p, MAXSOLBUF - (s - p), ",1");
|
||||
for (q = s + 1, sum = 0; *q; q++)
|
||||
{
|
||||
sum ^= *q; /* check-sum */
|
||||
}
|
||||
p += std::snprintf(p, MSG_TAIL, "*%02X%c%c", sum, 0x0D, 0x0A);
|
||||
}
|
||||
return p - reinterpret_cast<char *>(buff);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
*-----------------------------------------------------------------------------*/
|
||||
*------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef GNSS_SDR_RTKLIB_SOLUTION_H
|
||||
#define GNSS_SDR_RTKLIB_SOLUTION_H
|
||||
|
||||
@@ -5,13 +5,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
|
||||
@@ -5,13 +5,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
#
|
||||
# Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
#
|
||||
# GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
||||
#
|
||||
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
# This file is part of GNSS-SDR.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2010-2020 C. Fernandez-Prades cfernandez(at)cttc.es
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
########################################################################
|
||||
# Project setup
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
#
|
||||
# Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
#
|
||||
# GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
||||
#
|
||||
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
# This file is part of GNSS-SDR.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# SPDX-FileCopyrightText: 2010-2020 C. Fernandez-Prades cfernandez(at)cttc.es
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
########################################################################
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
#!/usr/bin/env python
|
||||
# Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
#
|
||||
# GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
||||
#
|
||||
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
# This file is part of GNSS-SDR.
|
||||
#
|
||||
# Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# This script is used to compare the generic kernels to the highest performing kernel, for each operation
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
/* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
||||
*
|
||||
/*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
/* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
||||
*
|
||||
/*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
/* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
||||
*
|
||||
/*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
/* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
||||
*
|
||||
/*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
|
||||
@@ -4,12 +4,10 @@
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
# Copyright (C) 2019 (see AUTHORS file for a list of contributors)
|
||||
#
|
||||
# GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
||||
#
|
||||
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
# This file is part of GNSS-SDR.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# SPDX-FileCopyrightText: 2019-2020 C. Fernandez-Prades cfernandez(at)cttc.es
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
# Original code from https://github.com/vector-of-bool/CMakeCM and modified
|
||||
# by C. Fernandez. The original code is distributed under the OSI-approved
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
# Copyright (C) 2015-2020 (see AUTHORS file for a list of contributors)
|
||||
#
|
||||
# GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
||||
#
|
||||
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
# This file is part of GNSS-SDR.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright (C) 2015-2020 (see AUTHORS file for a list of contributors)
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE)
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
# Copyright (C) 2015-2020 (see AUTHORS file for a list of contributors)
|
||||
#
|
||||
# GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
||||
#
|
||||
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
# This file is part of GNSS-SDR.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright (C) 2015-2020 (see AUTHORS file for a list of contributors)
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
if(DEFINED __INCLUDED_VOLK_ADD_TEST)
|
||||
return()
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
# Copyright (C) 2015-2020 (see AUTHORS file for a list of contributors)
|
||||
#
|
||||
# GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
||||
#
|
||||
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
# This file is part of GNSS-SDR.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright (C) 2015-2020 (see AUTHORS file for a list of contributors)
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
if(DEFINED __INCLUDED_VOLK_BOOST_CMAKE)
|
||||
return()
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
# Copyright (C) 2014-2020 (see AUTHORS file for a list of contributors)
|
||||
#
|
||||
# GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
||||
#
|
||||
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
# This file is part of GNSS-SDR.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright (C) 2015-2020 (see AUTHORS file for a list of contributors)
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
if(DEFINED __INCLUDED_VOLK_BUILD_TYPES_CMAKE)
|
||||
return()
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
# Copyright (C) 2015-2020 (see AUTHORS file for a list of contributors)
|
||||
#
|
||||
# GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
||||
#
|
||||
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
# This file is part of GNSS-SDR.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright (C) 2015-2020 (see AUTHORS file for a list of contributors)
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
get_filename_component(VOLK_GNSSSDR_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
# Copyright (C) 2015-2020 (see AUTHORS file for a list of contributors)
|
||||
#
|
||||
# GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
||||
#
|
||||
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
# This file is part of GNSS-SDR.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright (C) 2015-2020 (see AUTHORS file for a list of contributors)
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
set(MAJOR_VERSION @VERSION_INFO_MAJOR_VERSION@)
|
||||
set(MINOR_VERSION @VERSION_INFO_MINOR_VERSION@)
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
# Copyright (C) 2015-2020 (see AUTHORS file for a list of contributors)
|
||||
#
|
||||
# GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
||||
#
|
||||
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
# This file is part of GNSS-SDR.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright (C) 2015-2020 (see AUTHORS file for a list of contributors)
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
if(DEFINED __INCLUDED_VOLK_PYTHON_CMAKE)
|
||||
return()
|
||||
@@ -74,7 +72,14 @@ else()
|
||||
message(STATUS "User set python executable ${PYTHON_EXECUTABLE}")
|
||||
find_package(PythonInterp ${VOLK_PYTHON_MIN_VERSION} REQUIRED)
|
||||
else()
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
set(_previous ${CMAKE_FIND_FRAMEWORK})
|
||||
set(CMAKE_FIND_FRAMEWORK LAST)
|
||||
endif()
|
||||
find_package(Python3 COMPONENTS Interpreter)
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
set(CMAKE_FIND_FRAMEWORK ${_previous})
|
||||
endif()
|
||||
if(Python3_FOUND)
|
||||
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
|
||||
set(PYTHON_VERSION_MAJOR ${Python3_VERSION_MAJOR})
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
# Copyright (C) 2014-2020 (see AUTHORS file for a list of contributors)
|
||||
#
|
||||
# GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
||||
#
|
||||
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
# This file is part of GNSS-SDR.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright (C) 2015-2020 (see AUTHORS file for a list of contributors)
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
if(DEFINED __INCLUDED_VOLK_VERSION_CMAKE)
|
||||
return()
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
# Copyright (C) 2011-2020 (see AUTHORS file for a list of contributors)
|
||||
#
|
||||
# GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
||||
#
|
||||
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
# This file is part of GNSS-SDR.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright (C) 2011-2020 (see AUTHORS file for a list of contributors)
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Linux)
|
||||
set(CMAKE_SYSTEM_PROCESSOR aarch64)
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
# Copyright (C) 2011-2020 (see AUTHORS file for a list of contributors)
|
||||
#
|
||||
# GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
||||
#
|
||||
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
# This file is part of GNSS-SDR.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright (C) 2011-2020 (see AUTHORS file for a list of contributors)
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Linux)
|
||||
set(CMAKE_SYSTEM_PROCESSOR arm)
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
# Copyright (C) 2011-2020 (see AUTHORS file for a list of contributors)
|
||||
#
|
||||
# GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
||||
#
|
||||
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
# This file is part of GNSS-SDR.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright (C) 2011-2020 (see AUTHORS file for a list of contributors)
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
########################################################################
|
||||
# Toolchain file for building native on a ARM Cortex A8 w/ NEON
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
# Copyright (C) 2011-2020 (see AUTHORS file for a list of contributors)
|
||||
#
|
||||
# GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
||||
#
|
||||
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
# This file is part of GNSS-SDR.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright (C) 2011-2020 (see AUTHORS file for a list of contributors)
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
########################################################################
|
||||
# Toolchain file for building native on a ARM Cortex A72 w/ NEON
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
# Copyright (C) 2011-2020 (see AUTHORS file for a list of contributors)
|
||||
#
|
||||
# GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
||||
#
|
||||
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
# This file is part of GNSS-SDR.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright (C) 2011-2020 (see AUTHORS file for a list of contributors)
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
########################################################################
|
||||
# Toolchain file for building native on a ARM Cortex A72 w/ NEON
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
# Copyright (C) 2011-2020 (see AUTHORS file for a list of contributors)
|
||||
#
|
||||
# GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
||||
#
|
||||
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
# This file is part of GNSS-SDR.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright (C) 2011-2020 (see AUTHORS file for a list of contributors)
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
########################################################################
|
||||
# Toolchain file for building native on a ARM Cortex A8 w/ NEON
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
# Copyright (C) 2011-2020 (see AUTHORS file for a list of contributors)
|
||||
#
|
||||
# GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
||||
#
|
||||
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
# This file is part of GNSS-SDR.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright (C) 2011-2020 (see AUTHORS file for a list of contributors)
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
########################################################################
|
||||
# Toolchain file for building native on a ARM Cortex A8 w/ NEON
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
# Copyright (C) 2011-2020 (see AUTHORS file for a list of contributors)
|
||||
#
|
||||
# GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
||||
#
|
||||
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
# This file is part of GNSS-SDR.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright (C) 2011-2020 (see AUTHORS file for a list of contributors)
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
########################################################################
|
||||
# Toolchain file for building native on a ARM Cortex A8 w/ NEON
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
# Copyright (C) 2011-2020 (see AUTHORS file for a list of contributors)
|
||||
#
|
||||
# GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
||||
#
|
||||
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
# This file is part of GNSS-SDR.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright (C) 2011-2020 (see AUTHORS file for a list of contributors)
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Linux)
|
||||
string(REGEX MATCH "sysroots/([a-zA-Z0-9]+)" CMAKE_SYSTEM_PROCESSOR $ENV{SDKTARGETSYSROOT})
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
# Copyright (C) 2011-2020 (see AUTHORS file for a list of contributors)
|
||||
#
|
||||
# GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
||||
#
|
||||
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
# This file is part of GNSS-SDR.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright (C) 2015-2020 (see AUTHORS file for a list of contributors)
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||
message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@ typedef struct
|
||||
int dgh : 1; // Data Gathering Hint instruction.
|
||||
int rng : 1; // True random number generator support.
|
||||
int bti : 1; // Branch target identification.
|
||||
int mte : 1; // Memory tagging extension.
|
||||
|
||||
// Make sure to update Aarch64FeaturesEnum below if you add a field here.
|
||||
} Aarch64Features;
|
||||
@@ -132,6 +133,7 @@ typedef enum
|
||||
AARCH64_DGH,
|
||||
AARCH64_RNG,
|
||||
AARCH64_BTI,
|
||||
AARCH64_MTE,
|
||||
AARCH64_LAST_,
|
||||
} Aarch64FeaturesEnum;
|
||||
|
||||
|
||||
@@ -68,6 +68,7 @@ CPU_FEATURES_START_CPP_NAMESPACE
|
||||
#define AARCH64_HWCAP2_DGH (1UL << 15)
|
||||
#define AARCH64_HWCAP2_RNG (1UL << 16)
|
||||
#define AARCH64_HWCAP2_BTI (1UL << 17)
|
||||
#define AARCH64_HWCAP2_MTE (1UL << 18)
|
||||
|
||||
// http://elixir.free-electrons.com/linux/latest/source/arch/arm/include/uapi/asm/hwcap.h
|
||||
#define ARM_HWCAP_SWP (1UL << 0)
|
||||
|
||||
@@ -62,7 +62,8 @@
|
||||
FEATURE(AARCH64_BF16, bf16, "bf16", 0, AARCH64_HWCAP2_BF16) \
|
||||
FEATURE(AARCH64_DGH, dgh, "dgh", 0, AARCH64_HWCAP2_DGH) \
|
||||
FEATURE(AARCH64_RNG, rng, "rng", 0, AARCH64_HWCAP2_RNG) \
|
||||
FEATURE(AARCH64_BTI, bti, "bti", 0, AARCH64_HWCAP2_BTI)
|
||||
FEATURE(AARCH64_BTI, bti, "bti", 0, AARCH64_HWCAP2_BTI) \
|
||||
FEATURE(AARCH64_MTE, mte, "mte", 0, AARCH64_HWCAP2_MTE)
|
||||
#define DEFINE_TABLE_FEATURE_TYPE Aarch64Features
|
||||
#include "define_tables.h"
|
||||
|
||||
|
||||
@@ -157,6 +157,7 @@ CPU revision : 3)");
|
||||
EXPECT_FALSE(info.features.dgh);
|
||||
EXPECT_FALSE(info.features.rng);
|
||||
EXPECT_FALSE(info.features.bti);
|
||||
EXPECT_FALSE(info.features.mte);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
# Copyright (C) 2012-2020 (see AUTHORS file for a list of contributors)
|
||||
#
|
||||
# GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
||||
#
|
||||
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
# This file is part of GNSS-SDR.
|
||||
#
|
||||
# Copyright (C) 2012-2020 (see AUTHORS file for a list of contributors)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
/*! \page extending_volk Extending VOLK
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
# Copyright (C) 2012-2020 (see AUTHORS file for a list of contributors)
|
||||
#
|
||||
# GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
||||
#
|
||||
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
# This file is part of GNSS-SDR.
|
||||
#
|
||||
# Copyright (C) 2012-2020 (see AUTHORS file for a list of contributors)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
/*! \page kernels Kernels
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
# Copyright (C) 2012-2020 (see AUTHORS file for a list of contributors)
|
||||
#
|
||||
# GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
||||
#
|
||||
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
# This file is part of GNSS-SDR.
|
||||
#
|
||||
# Copyright (C) 2012-2020 (see AUTHORS file for a list of contributors)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
/*! \mainpage VOLK_GNSSSDR
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
# Copyright (C) 2012-2020 (see AUTHORS file for a list of contributors)
|
||||
#
|
||||
# GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
||||
#
|
||||
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
# This file is part of GNSS-SDR.
|
||||
#
|
||||
# Copyright (C) 2012-2020 (see AUTHORS file for a list of contributors)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
/*! \page concepts_terms_and_techniques Concepts, Terms, and Techniques
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
# Copyright (C) 2012-2020 (see AUTHORS file for a list of contributors)
|
||||
#
|
||||
# GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
||||
#
|
||||
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
# This file is part of GNSS-SDR.
|
||||
#
|
||||
# Copyright (C) 2012-2020 (see AUTHORS file for a list of contributors)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
/*! \page using_volk_gnsssdr Using VOLK_GNSSSDR
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user