diff --git a/src/algorithms/libs/gps_l2c_signal.h b/src/algorithms/libs/gps_l2c_signal.h index 8179ec5b9..a5f48a230 100644 --- a/src/algorithms/libs/gps_l2c_signal.h +++ b/src/algorithms/libs/gps_l2c_signal.h @@ -30,8 +30,8 @@ * ------------------------------------------------------------------------- */ -#ifndef GNSS_GPS_L2C_SIGNAL_H_ -#define GNSS_GPS_L2C_SIGNAL_H_ +#ifndef GNSS_SDR_GPS_L2C_SIGNAL_H_ +#define GNSS_SDR_GPS_L2C_SIGNAL_H_ #include diff --git a/src/algorithms/libs/gps_l5_signal.cc b/src/algorithms/libs/gps_l5_signal.cc index 96aedf803..33396ca23 100644 --- a/src/algorithms/libs/gps_l5_signal.cc +++ b/src/algorithms/libs/gps_l5_signal.cc @@ -1,13 +1,13 @@ /*! - * \file gps_l2c_signal.cc - * \brief This class implements signal generators for the GPS L2C signals - * \author Javier Arribas, 2015. jarribas(at)cttc.es + * \file gps_l5_signal.cc + * \brief This class implements signal generators for the GPS L5 signals + * \author Javier Arribas, 2017. jarribas(at)cttc.es * * Detailed description of the file here if needed. * * ------------------------------------------------------------------------- * - * Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors) + * Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors) * * GNSS-SDR is a software defined Global Navigation * Satellite Systems receiver @@ -35,139 +35,151 @@ #include #include #include - #include "GPS_L5.h" -using namespace std; std::deque l5i_xa_shift(std::deque xa) { - if (xa==std::deque{1,1,1,1,1,1,1,1,1,1,1,0,1}) - { - return std::deque{1,1,1,1,1,1,1,1,1,1,1,1,1}; - }else{ - std::deque out(xa.begin(), xa.end()-1); - out.push_front(xa[12] xor xa[11] xor xa[9] xor xa[8]); - return out; - } + if (xa == std::deque{1,1,1,1,1,1,1,1,1,1,1,0,1}) + { + return std::deque{1,1,1,1,1,1,1,1,1,1,1,1,1}; + } + else + { + std::deque out(xa.begin(), xa.end() - 1); + out.push_front(xa[12] xor xa[11] xor xa[9] xor xa[8]); + return out; + } } + std::deque l5q_xa_shift(std::deque xa) { - if (xa==std::deque{1,1,1,1,1,1,1,1,1,1,1,0,1}) - { - return std::deque{1,1,1,1,1,1,1,1,1,1,1,1,1}; - }else{ - std::deque out(xa.begin(), xa.end()-1); - out.push_front(xa[12] xor xa[11] xor xa[9] xor xa[8]); - return out; - } + if (xa == std::deque{1,1,1,1,1,1,1,1,1,1,1,0,1}) + { + return std::deque{1,1,1,1,1,1,1,1,1,1,1,1,1}; + } + else + { + std::deque out(xa.begin(), xa.end() - 1); + out.push_front(xa[12] xor xa[11] xor xa[9] xor xa[8]); + return out; + } } + std::deque l5i_xb_shift(std::deque xb) - { - std::deque out(xb.begin(), xb.end()-1); - out.push_front(xb[12] xor xb[11] xor xb[7] xor xb[6] xor xb[5] xor xb[3] xor xb[2] xor xb[0]); - return out; - } +{ + std::deque out(xb.begin(), xb.end() - 1); + out.push_front(xb[12] xor xb[11] xor xb[7] xor xb[6] xor xb[5] xor xb[3] xor xb[2] xor xb[0]); + return out; +} + std::deque l5q_xb_shift(std::deque xb) - { - std::deque out(xb.begin(), xb.end()-1); - out.push_front(xb[12] xor xb[11] xor xb[7] xor xb[6] xor xb[5] xor xb[3] xor xb[2] xor xb[0]); - return out; - } +{ + std::deque out(xb.begin(), xb.end()-1); + out.push_front(xb[12] xor xb[11] xor xb[7] xor xb[6] xor xb[5] xor xb[3] xor xb[2] xor xb[0]); + return out; +} + std::deque make_l5i_xa() { - std::deque xa={1,1,1,1,1,1,1,1,1,1,1,1,1}; - std::deque y(GPS_L5i_CODE_LENGTH_CHIPS,0); + std::deque xa = {1,1,1,1,1,1,1,1,1,1,1,1,1}; + std::deque y(GPS_L5i_CODE_LENGTH_CHIPS, 0); - for (int i=0; i make_l5i_xb() { - std::deque xb={1,1,1,1,1,1,1,1,1,1,1,1,1}; - std::deque y(GPS_L5i_CODE_LENGTH_CHIPS,0); + std::deque xb = {1,1,1,1,1,1,1,1,1,1,1,1,1}; + std::deque y(GPS_L5i_CODE_LENGTH_CHIPS,0); - for (int i=0; i make_l5q_xa() { - std::deque xa={1,1,1,1,1,1,1,1,1,1,1,1,1}; - std::deque y(GPS_L5q_CODE_LENGTH_CHIPS,0); + std::deque xa = {1,1,1,1,1,1,1,1,1,1,1,1,1}; + std::deque y(GPS_L5q_CODE_LENGTH_CHIPS, 0); - for (int i=0; i make_l5q_xb() { - std::deque xb={1,1,1,1,1,1,1,1,1,1,1,1,1}; - std::deque y(GPS_L5q_CODE_LENGTH_CHIPS,0); + std::deque xb = {1,1,1,1,1,1,1,1,1,1,1,1,1}; + std::deque y(GPS_L5q_CODE_LENGTH_CHIPS, 0); - for (int i=0; i xb=make_l5i_xb(); - std::deque xa=make_l5i_xa(); - std::deque xb_shift(GPS_L5i_CODE_LENGTH_CHIPS,0); + std::deque xb = make_l5i_xb(); + std::deque xa = make_l5i_xa(); + std::deque xb_shift(GPS_L5i_CODE_LENGTH_CHIPS, 0); - for (int n=0; n out_code(GPS_L5i_CODE_LENGTH_CHIPS,0); - for (int n=0; n out_code(GPS_L5i_CODE_LENGTH_CHIPS, 0); + for (int n = 0; n < GPS_L5i_CODE_LENGTH_CHIPS; n++) + { + _dest[n] = xa[n] xor xb_shift[n]; + } } + void make_l5q(int32_t * _dest, int prn) { - int xb_offset = GPS_L5q_INIT_REG[prn]; + int xb_offset = GPS_L5q_INIT_REG[prn]; - std::deque xb=make_l5q_xb(); - std::deque xa=make_l5q_xa(); - std::deque xb_shift(GPS_L5q_CODE_LENGTH_CHIPS,0); + std::deque xb = make_l5q_xb(); + std::deque xa = make_l5q_xa(); + std::deque xb_shift(GPS_L5q_CODE_LENGTH_CHIPS, 0); - for (int n=0; n out_code(GPS_L5q_CODE_LENGTH_CHIPS,0); - for (int n=0; n out_code(GPS_L5q_CODE_LENGTH_CHIPS, 0); + for (int n = 0; n < GPS_L5q_CODE_LENGTH_CHIPS; n++) + { + _dest[n] = xa[n] xor xb_shift[n]; + } } + void gps_l5i_code_gen_complex(std::complex* _dest, unsigned int _prn) { int32_t* _code = new int32_t[GPS_L5i_CODE_LENGTH_CHIPS]; diff --git a/src/algorithms/libs/gps_l5_signal.h b/src/algorithms/libs/gps_l5_signal.h index 49b91f190..e9fee4e4b 100644 --- a/src/algorithms/libs/gps_l5_signal.h +++ b/src/algorithms/libs/gps_l5_signal.h @@ -1,13 +1,13 @@ /*! * \file gps_l5_signal.h - * \brief This class implements signal generators for the GPS L2C signals + * \brief This class implements signal generators for the GPS L5 signals * \author Javier Arribas, 2017. jarribas(at)cttc.es * * Detailed description of the file here if needed. * * ------------------------------------------------------------------------- * - * Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors) + * Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors) * * GNSS-SDR is a software defined Global Navigation * Satellite Systems receiver @@ -30,8 +30,8 @@ * ------------------------------------------------------------------------- */ -#ifndef GNSS_GPS_L5_SIGNAL_H_ -#define GNSS_GPS_L5_SIGNAL_H_ +#ifndef GNSS_SDR_GPS_L5_SIGNAL_H_ +#define GNSS_SDR_GPS_L5_SIGNAL_H_ #include @@ -49,4 +49,4 @@ void gps_l5i_code_gen_complex_sampled(std::complex* _dest, unsigned int _ void gps_l5q_code_gen_complex_sampled(std::complex* _dest, unsigned int _prn, signed int _fs); -#endif /* GNSS_GPS_L5_SIGNAL_H_ */ +#endif /* GNSS_SDR_GPS_L5_SIGNAL_H_ */