1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-06-18 11:09:56 +00:00

Move Q components to imaginary part

This commit is contained in:
Carles Fernandez 2019-09-28 13:41:24 +02:00
parent 690f60037e
commit 677711a238
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
4 changed files with 13 additions and 13 deletions

View File

@ -51,16 +51,16 @@ void galileo_e5_a_code_gen_complex_primary(gsl::span<std::complex<float>> _dest,
for (size_t i = 0; i < GALILEO_E5A_Q_PRIMARY_CODE[prn].length() - 1; i++)
{
hex_to_binary_converter(a, GALILEO_E5A_Q_PRIMARY_CODE[prn][i]);
_dest[index] = std::complex<float>(0.0, static_cast<float>(a[0]));
_dest[index + 1] = std::complex<float>(0.0, static_cast<float>(a[1]));
_dest[index + 2] = std::complex<float>(0.0, static_cast<float>(a[2]));
_dest[index + 3] = std::complex<float>(0.0, static_cast<float>(a[3]));
_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[prn].length() - 1]);
_dest[index] = std::complex<float>(0.0, static_cast<float>(a[0]));
_dest[index + 1] = std::complex<float>(0.0, static_cast<float>(a[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')
{

View File

@ -65,7 +65,7 @@ void gps_l2c_m_code_gen_complex(gsl::span<std::complex<float>> _dest, uint32_t _
for (int32_t i = 0; i < GPS_L2_M_CODE_LENGTH_CHIPS; i++)
{
_dest[i] = std::complex<float>(1.0 - 2.0 * _code[i], 0.0);
_dest[i] = std::complex<float>(0.0, 1.0 - 2.0 * _code[i]);
}
}
@ -120,11 +120,11 @@ void gps_l2c_m_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, ui
if (i == _samplesPerCode - 1)
{
// --- Correct the last index (due to number rounding issues) -----------
_dest[i] = std::complex<float>(1.0 - 2.0 * _code[_codeLength - 1], 0);
_dest[i] = std::complex<float>(0.0, 1.0 - 2.0 * _code[_codeLength - 1]);
}
else
{
_dest[i] = std::complex<float>(1.0 - 2.0 * _code[_codeValueIndex], 0); // repeat the chip -> upsample
_dest[i] = std::complex<float>(0.0, 1.0 - 2.0 * _code[_codeValueIndex]); // repeat the chip -> upsample
}
}
}

View File

@ -257,7 +257,7 @@ void gps_l5q_code_gen_complex(gsl::span<std::complex<float>> _dest, uint32_t _pr
for (int32_t i = 0; i < GPS_L5Q_CODE_LENGTH_CHIPS; i++)
{
_dest[i] = std::complex<float>(1.0 - 2.0 * static_cast<float>(_code[i]), 0.0);
_dest[i] = std::complex<float>(0.0, 1.0 - 2.0 * static_cast<float>(_code[i]));
}
}
@ -312,11 +312,11 @@ void gps_l5q_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, uint
if (i == _samplesPerCode - 1)
{
// --- Correct the last index (due to number rounding issues) -----------
_dest[i] = std::complex<float>(1.0 - 2.0 * _code[_codeLength - 1], 0);
_dest[i] = std::complex<float>(0.0, 1.0 - 2.0 * _code[_codeLength - 1]);
}
else
{
_dest[i] = std::complex<float>(1.0 - 2.0 * _code[_codeValueIndex], 0); // repeat the chip -> upsample
_dest[i] = std::complex<float>(0.0, 1.0 - 2.0 * _code[_codeValueIndex]); // repeat the chip -> upsample
}
}
}

View File

@ -144,7 +144,7 @@ void gps_l1_ca_code_gen_complex(gsl::span<std::complex<float>> _dest, int32_t _p
for (uint32_t ii = 0; ii < _code_length; ++ii)
{
_dest[ii] = std::complex<float>(static_cast<float>(ca_code_int[ii]), 0.0F);
_dest[ii] = std::complex<float>(0.0F, static_cast<float>(ca_code_int[ii]));
}
}