mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-31 07:13:03 +00:00 
			
		
		
		
	Added some const
git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@227 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
		| @@ -38,7 +38,7 @@ | ||||
| void complex_exp_gen(std::complex<float>* _dest, double _f, double _fs, unsigned int _samps) | ||||
| { | ||||
| 	double phase = 0; | ||||
| 	double phase_step = (GPS_TWO_PI*_f)/_fs; | ||||
| 	const double phase_step = (GPS_TWO_PI * _f) / _fs; | ||||
| 	for(unsigned int i = 0; i < _samps; i++) | ||||
| 	{ | ||||
| 		_dest[i] = std::complex<float>(cos(phase), sin(phase)); | ||||
| @@ -150,28 +150,23 @@ void hex_to_binary_converter(int * _dest, char _from) | ||||
| 	} | ||||
| } | ||||
|  | ||||
|  | ||||
| void resampler(std::complex<float>* _from, std::complex<float>* _dest, float _fs_in, | ||||
| 		float _fs_out, unsigned int _length_in, unsigned int _length_out) | ||||
| { | ||||
|  | ||||
| 	unsigned int _codeValueIndex; | ||||
| 	//--- Find time constants -------------------------------------------------- | ||||
|     float _t_in = 1/_fs_in;  // Incoming sampling  period in sec | ||||
|     float _t_out = 1/_fs_out;   // Out sampling period in sec | ||||
|  | ||||
|     const float _t_in = 1/_fs_in;  // Incoming sampling  period in sec | ||||
|     const float _t_out = 1/_fs_out;   // Out sampling period in sec | ||||
|     for (unsigned int i=0; i<_length_out; i++) | ||||
|         { | ||||
|             //=== Digitizing ======================================================= | ||||
|  | ||||
|             //--- Make index array to read sampled values ------------------------- | ||||
|  | ||||
|             //--- compute index array to read sampled values ------------------------- | ||||
|             _codeValueIndex = ceil((_t_out * ((float)i + 1)) / _t_in) - 1; | ||||
|  | ||||
|             if (i == _length_out - 1) | ||||
|                 { | ||||
|                     //--- Correct the last index (due to number rounding issues) ----------- | ||||
|                     _dest[i] = _from[_length_in - 1]; | ||||
|  | ||||
|                 } | ||||
|             else | ||||
|                 { | ||||
| @@ -179,5 +174,4 @@ void resampler(std::complex<float>* _from, std::complex<float>* _dest, float _fs | ||||
|                     _dest[i] = _from[_codeValueIndex]; | ||||
|                 } | ||||
|         } | ||||
|  | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Carles Fernandez
					Carles Fernandez