mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-31 15:23:04 +00:00 
			
		
		
		
	Move Q components to imaginary part
This commit is contained in:
		| @@ -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++) |             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]); |                     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] = std::complex<float>(static_cast<float>(a[0]), 0.0); | ||||||
|                     _dest[index + 1] = std::complex<float>(0.0, static_cast<float>(a[1])); |                     _dest[index + 1] = std::complex<float>(static_cast<float>(a[1]), 0.0); | ||||||
|                     _dest[index + 2] = std::complex<float>(0.0, static_cast<float>(a[2])); |                     _dest[index + 2] = std::complex<float>(static_cast<float>(a[2]), 0.0); | ||||||
|                     _dest[index + 3] = std::complex<float>(0.0, static_cast<float>(a[3])); |                     _dest[index + 3] = std::complex<float>(static_cast<float>(a[3]), 0.0); | ||||||
|                     index = index + 4; |                     index = index + 4; | ||||||
|                 } |                 } | ||||||
|             // last 2 bits are filled up zeros |             // 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]); |             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] = std::complex<float>(static_cast<float>(a[0]), 0.0); | ||||||
|             _dest[index + 1] = std::complex<float>(0.0, static_cast<float>(a[1])); |             _dest[index + 1] = std::complex<float>(static_cast<float>(a[1]), 0.0); | ||||||
|         } |         } | ||||||
|     else if (_Signal[0] == '5' && _Signal[1] == 'I') |     else if (_Signal[0] == '5' && _Signal[1] == 'I') | ||||||
|         { |         { | ||||||
|   | |||||||
| @@ -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++) |     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) |             if (i == _samplesPerCode - 1) | ||||||
|                 { |                 { | ||||||
|                     // --- Correct the last index (due to number rounding issues) ----------- |                     // --- 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 |             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 | ||||||
|                 } |                 } | ||||||
|         } |         } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -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++) |     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) |             if (i == _samplesPerCode - 1) | ||||||
|                 { |                 { | ||||||
|                     // --- Correct the last index (due to number rounding issues) ----------- |                     // --- 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 |             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 | ||||||
|                 } |                 } | ||||||
|         } |         } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -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) |     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])); | ||||||
|         } |         } | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Carles Fernandez
					Carles Fernandez