mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-12-14 20:20:35 +00:00
Add chip shift to glonass ca code
This commit is contained in:
parent
5ad65ab0e1
commit
e78f80d459
@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
auto auxCeil = [](float x){ return static_cast<int>(static_cast<long>((x)+1)); };
|
auto auxCeil = [](float x){ return static_cast<int>(static_cast<long>((x)+1)); };
|
||||||
|
|
||||||
void glonass_l1_ca_code_gen_complex(std::complex<float>* _dest/*, signed int _prn, unsigned int _chip_shift*/)
|
void glonass_l1_ca_code_gen_complex(std::complex<float>* _dest,/* signed int _prn,*/ unsigned int _chip_shift)
|
||||||
{
|
{
|
||||||
const unsigned int _code_length = 511;
|
const unsigned int _code_length = 511;
|
||||||
bool G1[_code_length];
|
bool G1[_code_length];
|
||||||
@ -76,13 +76,15 @@ void glonass_l1_ca_code_gen_complex(std::complex<float>* _dest/*, signed int _pr
|
|||||||
_dest[lcv] = std::complex<float>(-1, 0);
|
_dest[lcv] = std::complex<float>(-1, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* TODO: Implement the chip shifting*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Generates complex GLONASS L1 C/A code for the desired SV ID and sampled to specific sampling frequency
|
* 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(std::complex<float>* _dest, unsigned int _prn, signed int _fs, unsigned int _chip_shift)
|
void glonass_l1_ca_code_gen_complex_sampled(std::complex<float>* _dest,/* unsigned int _prn,*/ signed int _fs, unsigned int _chip_shift)
|
||||||
{
|
{
|
||||||
// This function is based on the GNU software GPS for MATLAB in the Kay Borre book
|
// This function is based on the GNU software GPS for MATLAB in the Kay Borre book
|
||||||
std::complex<float> _code[511];
|
std::complex<float> _code[511];
|
||||||
@ -99,7 +101,7 @@ void glonass_l1_ca_code_gen_complex_sampled(std::complex<float>* _dest, unsigned
|
|||||||
//--- Find time constants --------------------------------------------------
|
//--- Find time constants --------------------------------------------------
|
||||||
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
|
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
|
||||||
_tc = 1.0 / static_cast<float>(_codeFreqBasis); // C/A chip period in sec
|
_tc = 1.0 / static_cast<float>(_codeFreqBasis); // C/A chip period in sec
|
||||||
glonass_l1_ca_code_gen_complex(_code); //generate C/A code 1 sample per chip
|
glonass_l1_ca_code_gen_complex(_code, _chip_shift); //generate C/A code 1 sample per chip
|
||||||
|
|
||||||
for (signed int i = 0; i < _samplesPerCode; i++)
|
for (signed int i = 0; i < _samplesPerCode; i++)
|
||||||
{
|
{
|
||||||
|
@ -36,12 +36,12 @@
|
|||||||
#include <complex>
|
#include <complex>
|
||||||
|
|
||||||
//!Generates complex GLONASS L1 C/A code for the desired SV ID and code shift, and sampled to specific sampling frequency
|
//!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(std::complex<float>* _dest/*, signed int _prn, unsigned int _chip_shift*/);
|
void glonass_l1_ca_code_gen_complex(std::complex<float>* _dest, /*signed int _prn,*/ unsigned int _chip_shift);
|
||||||
|
|
||||||
//! Generates N complex GLONASS L1 C/A codes for the desired SV ID and code 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(std::complex<float>* _dest, unsigned int _prn, signed int _fs, unsigned int _chip_shift, unsigned int _ncodes);
|
void glonass_l1_ca_code_gen_complex_sampled(std::complex<float>* _dest,/* unsigned int _prn,*/ signed int _fs, unsigned int _chip_shift, unsigned int _ncodes);
|
||||||
|
|
||||||
//! Generates complex GLONASS L1 C/A code for the desired SV ID and code shift
|
//! Generates complex GLONASS L1 C/A code for the desired SV ID and code shift
|
||||||
void glonass_l1_ca_code_gen_complex_sampled(std::complex<float>* _dest, unsigned int _prn, signed int _fs, unsigned int _chip_shift);
|
void glonass_l1_ca_code_gen_complex_sampled(std::complex<float>* _dest,/* unsigned int _prn,*/ signed int _fs, unsigned int _chip_shift);
|
||||||
|
|
||||||
#endif /* GNSS_SDR_GPS_SDR_SIGNAL_PROCESSING_H_ */
|
#endif /* GNSS_SDR_GPS_SDR_SIGNAL_PROCESSING_H_ */
|
||||||
|
Loading…
Reference in New Issue
Block a user