mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-31 15:23:04 +00:00 
			
		
		
		
	some cleaning and optimization
This commit is contained in:
		| @@ -30,7 +30,7 @@ | ||||
|  * ------------------------------------------------------------------------- | ||||
|  */ | ||||
|  | ||||
| #include "GPS_L2C.h" | ||||
| #include <gps_l2c_signal.h> | ||||
| #include <stdlib.h> | ||||
| #include <stdint.h> | ||||
| #include <cmath> | ||||
| @@ -95,6 +95,8 @@ void gps_l2c_m_code_gen_complex_sampled(std::complex<float>* _dest, unsigned int | ||||
|     _ts = 1/(float)_fs;   // Sampling period in sec | ||||
|     _tc = 1/(float)_codeFreqBasis;  // C/A chip period in sec | ||||
|  | ||||
|     float aux; | ||||
|  | ||||
|     for (signed int i = 0; i < _samplesPerCode; i++) | ||||
|         { | ||||
|             //=== Digitizing ======================================================= | ||||
| @@ -105,7 +107,9 @@ void gps_l2c_m_code_gen_complex_sampled(std::complex<float>* _dest, unsigned int | ||||
|             // millisecond). | ||||
|     	//TODO: Check this formula! Seems to start with an extra sample | ||||
|  | ||||
|             _codeValueIndex = ceil((_ts * ((float)i + 1)) / _tc) - 1; | ||||
|             // _codeValueIndex = ceil((_ts * ((float)i + 1)) / _tc) - 1; | ||||
|             aux = (_ts * (i + 1)) / _tc; | ||||
|             _codeValueIndex = static_cast<int>(static_cast<long>(aux)) - 1; | ||||
|  | ||||
|             //--- Make the digitized version of the C/A code ----------------------- | ||||
|             // The "upsampled" code is made by selecting values form the CA code | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Carles Fernandez
					Carles Fernandez