From e4ded155ca317ca1bc5b387834b432f53f2f5ab3 Mon Sep 17 00:00:00 2001 From: Gastd Date: Thu, 1 Jun 2017 20:49:44 -0300 Subject: [PATCH] Add chip shift to glonass ca code --- src/algorithms/libs/glonass_l1_signal_processing.cc | 8 +++++--- src/algorithms/libs/glonass_l1_signal_processing.h | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/algorithms/libs/glonass_l1_signal_processing.cc b/src/algorithms/libs/glonass_l1_signal_processing.cc index ff3ab5a2d..d19b349ab 100644 --- a/src/algorithms/libs/glonass_l1_signal_processing.cc +++ b/src/algorithms/libs/glonass_l1_signal_processing.cc @@ -34,7 +34,7 @@ auto auxCeil = [](float x){ return static_cast(static_cast((x)+1)); }; -void glonass_l1_ca_code_gen_complex(std::complex* _dest/*, signed int _prn, unsigned int _chip_shift*/) +void glonass_l1_ca_code_gen_complex(std::complex* _dest,/* signed int _prn,*/ unsigned int _chip_shift) { const unsigned int _code_length = 511; bool G1[_code_length]; @@ -76,13 +76,15 @@ void glonass_l1_ca_code_gen_complex(std::complex* _dest/*, signed int _pr _dest[lcv] = std::complex(-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 */ -void glonass_l1_ca_code_gen_complex_sampled(std::complex* _dest, unsigned int _prn, signed int _fs, unsigned int _chip_shift) +void glonass_l1_ca_code_gen_complex_sampled(std::complex* _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 std::complex _code[511]; @@ -99,7 +101,7 @@ void glonass_l1_ca_code_gen_complex_sampled(std::complex* _dest, unsigned //--- Find time constants -------------------------------------------------- _ts = 1.0 / static_cast(_fs); // Sampling period in sec _tc = 1.0 / static_cast(_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++) { diff --git a/src/algorithms/libs/glonass_l1_signal_processing.h b/src/algorithms/libs/glonass_l1_signal_processing.h index b181d68ae..40fcd6ad1 100644 --- a/src/algorithms/libs/glonass_l1_signal_processing.h +++ b/src/algorithms/libs/glonass_l1_signal_processing.h @@ -36,12 +36,12 @@ #include //!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* _dest/*, signed int _prn, unsigned int _chip_shift*/); +void glonass_l1_ca_code_gen_complex(std::complex* _dest, /*signed int _prn,*/ unsigned int _chip_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* _dest, unsigned int _prn, signed int _fs, unsigned int _chip_shift, unsigned int _ncodes); +void glonass_l1_ca_code_gen_complex_sampled(std::complex* _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 -void glonass_l1_ca_code_gen_complex_sampled(std::complex* _dest, unsigned int _prn, signed int _fs, unsigned int _chip_shift); +void glonass_l1_ca_code_gen_complex_sampled(std::complex* _dest,/* unsigned int _prn,*/ signed int _fs, unsigned int _chip_shift); #endif /* GNSS_SDR_GPS_SDR_SIGNAL_PROCESSING_H_ */