1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-02-06 06:00:09 +00:00

Merge branch 'next' of https://github.com/gnss-sdr/gnss-sdr into glonass

This commit is contained in:
Carles Fernandez 2017-12-04 18:40:10 +01:00
commit ee37dabb1f
3 changed files with 109 additions and 97 deletions

View File

@ -30,8 +30,8 @@
* ------------------------------------------------------------------------- * -------------------------------------------------------------------------
*/ */
#ifndef GNSS_GPS_L2C_SIGNAL_H_ #ifndef GNSS_SDR_GPS_L2C_SIGNAL_H_
#define GNSS_GPS_L2C_SIGNAL_H_ #define GNSS_SDR_GPS_L2C_SIGNAL_H_
#include <complex> #include <complex>

View File

@ -1,13 +1,13 @@
/*! /*!
* \file gps_l2c_signal.cc * \file gps_l5_signal.cc
* \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, 2015. jarribas(at)cttc.es * \author Javier Arribas, 2017. jarribas(at)cttc.es
* *
* Detailed description of the file here if needed. * 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 * GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver * Satellite Systems receiver
@ -35,55 +35,61 @@
#include <cmath> #include <cmath>
#include <cinttypes> #include <cinttypes>
#include <complex> #include <complex>
#include "GPS_L5.h" #include "GPS_L5.h"
using namespace std;
std::deque<bool> l5i_xa_shift(std::deque<bool> xa) std::deque<bool> l5i_xa_shift(std::deque<bool> xa)
{ {
if (xa==std::deque<bool>{1,1,1,1,1,1,1,1,1,1,1,0,1}) if (xa == std::deque<bool>{1,1,1,1,1,1,1,1,1,1,1,0,1})
{ {
return std::deque<bool>{1,1,1,1,1,1,1,1,1,1,1,1,1}; return std::deque<bool>{1,1,1,1,1,1,1,1,1,1,1,1,1};
}else{ }
std::deque<bool> out(xa.begin(), xa.end()-1); else
{
std::deque<bool> out(xa.begin(), xa.end() - 1);
out.push_front(xa[12] xor xa[11] xor xa[9] xor xa[8]); out.push_front(xa[12] xor xa[11] xor xa[9] xor xa[8]);
return out; return out;
} }
} }
std::deque<bool> l5q_xa_shift(std::deque<bool> xa) std::deque<bool> l5q_xa_shift(std::deque<bool> xa)
{ {
if (xa==std::deque<bool>{1,1,1,1,1,1,1,1,1,1,1,0,1}) if (xa == std::deque<bool>{1,1,1,1,1,1,1,1,1,1,1,0,1})
{ {
return std::deque<bool>{1,1,1,1,1,1,1,1,1,1,1,1,1}; return std::deque<bool>{1,1,1,1,1,1,1,1,1,1,1,1,1};
}else{ }
std::deque<bool> out(xa.begin(), xa.end()-1); else
{
std::deque<bool> out(xa.begin(), xa.end() - 1);
out.push_front(xa[12] xor xa[11] xor xa[9] xor xa[8]); out.push_front(xa[12] xor xa[11] xor xa[9] xor xa[8]);
return out; return out;
} }
} }
std::deque<bool> l5i_xb_shift(std::deque<bool> xb) std::deque<bool> l5i_xb_shift(std::deque<bool> xb)
{ {
std::deque<bool> out(xb.begin(), xb.end()-1); std::deque<bool> 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]); 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; return out;
} }
std::deque<bool> l5q_xb_shift(std::deque<bool> xb) std::deque<bool> l5q_xb_shift(std::deque<bool> xb)
{ {
std::deque<bool> out(xb.begin(), xb.end()-1); std::deque<bool> 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]); 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; return out;
} }
std::deque<bool> make_l5i_xa() std::deque<bool> make_l5i_xa()
{ {
std::deque<bool> xa={1,1,1,1,1,1,1,1,1,1,1,1,1}; std::deque<bool> xa = {1,1,1,1,1,1,1,1,1,1,1,1,1};
std::deque<bool> y(GPS_L5i_CODE_LENGTH_CHIPS,0); std::deque<bool> y(GPS_L5i_CODE_LENGTH_CHIPS, 0);
for (int i=0; i<GPS_L5i_CODE_LENGTH_CHIPS; i++) for (int i = 0; i < GPS_L5i_CODE_LENGTH_CHIPS; i++)
{ {
y[i] = xa[12]; y[i] = xa[12];
xa = l5i_xa_shift(xa); xa = l5i_xa_shift(xa);
@ -91,12 +97,13 @@ std::deque<bool> make_l5i_xa()
return y; return y;
} }
std::deque<bool> make_l5i_xb() std::deque<bool> make_l5i_xb()
{ {
std::deque<bool> xb={1,1,1,1,1,1,1,1,1,1,1,1,1}; std::deque<bool> xb = {1,1,1,1,1,1,1,1,1,1,1,1,1};
std::deque<bool> y(GPS_L5i_CODE_LENGTH_CHIPS,0); std::deque<bool> y(GPS_L5i_CODE_LENGTH_CHIPS,0);
for (int i=0; i<GPS_L5i_CODE_LENGTH_CHIPS; i++) for (int i = 0; i < GPS_L5i_CODE_LENGTH_CHIPS; i++)
{ {
y[i] = xb[12]; y[i] = xb[12];
xb = l5i_xb_shift(xb); xb = l5i_xb_shift(xb);
@ -104,12 +111,13 @@ std::deque<bool> make_l5i_xb()
return y; return y;
} }
std::deque<bool> make_l5q_xa() std::deque<bool> make_l5q_xa()
{ {
std::deque<bool> xa={1,1,1,1,1,1,1,1,1,1,1,1,1}; std::deque<bool> xa = {1,1,1,1,1,1,1,1,1,1,1,1,1};
std::deque<bool> y(GPS_L5q_CODE_LENGTH_CHIPS,0); std::deque<bool> y(GPS_L5q_CODE_LENGTH_CHIPS, 0);
for (int i=0; i<GPS_L5q_CODE_LENGTH_CHIPS; i++) for (int i = 0; i < GPS_L5q_CODE_LENGTH_CHIPS; i++)
{ {
y[i] = xa[12]; y[i] = xa[12];
xa = l5q_xa_shift(xa); xa = l5q_xa_shift(xa);
@ -117,12 +125,13 @@ std::deque<bool> make_l5q_xa()
return y; return y;
} }
std::deque<bool> make_l5q_xb() std::deque<bool> make_l5q_xb()
{ {
std::deque<bool> xb={1,1,1,1,1,1,1,1,1,1,1,1,1}; std::deque<bool> xb = {1,1,1,1,1,1,1,1,1,1,1,1,1};
std::deque<bool> y(GPS_L5q_CODE_LENGTH_CHIPS,0); std::deque<bool> y(GPS_L5q_CODE_LENGTH_CHIPS, 0);
for (int i=0; i<GPS_L5q_CODE_LENGTH_CHIPS; i++) for (int i = 0; i < GPS_L5q_CODE_LENGTH_CHIPS; i++)
{ {
y[i] = xb[12]; y[i] = xb[12];
xb = l5q_xb_shift(xb); xb = l5q_xb_shift(xb);
@ -130,44 +139,47 @@ std::deque<bool> make_l5q_xb()
return y; return y;
} }
void make_l5i(int32_t * _dest, int prn) void make_l5i(int32_t * _dest, int prn)
{ {
int xb_offset = GPS_L5i_INIT_REG[prn]; int xb_offset = GPS_L5i_INIT_REG[prn];
std::deque<bool> xb=make_l5i_xb(); std::deque<bool> xb = make_l5i_xb();
std::deque<bool> xa=make_l5i_xa(); std::deque<bool> xa = make_l5i_xa();
std::deque<bool> xb_shift(GPS_L5i_CODE_LENGTH_CHIPS,0); std::deque<bool> xb_shift(GPS_L5i_CODE_LENGTH_CHIPS, 0);
for (int n=0; n<GPS_L5i_CODE_LENGTH_CHIPS; n++) for (int n = 0; n < GPS_L5i_CODE_LENGTH_CHIPS; n++)
{ {
xb_shift[n]=xb[(xb_offset+n)%GPS_L5i_CODE_LENGTH_CHIPS]; xb_shift[n] = xb[(xb_offset + n) % GPS_L5i_CODE_LENGTH_CHIPS];
} }
std::deque<bool> out_code(GPS_L5i_CODE_LENGTH_CHIPS,0); std::deque<bool> out_code(GPS_L5i_CODE_LENGTH_CHIPS, 0);
for (int n=0; n<GPS_L5i_CODE_LENGTH_CHIPS; n++) for (int n = 0; n < GPS_L5i_CODE_LENGTH_CHIPS; n++)
{ {
_dest[n]=xa[n] xor xb_shift[n]; _dest[n] = xa[n] xor xb_shift[n];
} }
} }
void make_l5q(int32_t * _dest, int prn) 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<bool> xb=make_l5q_xb(); std::deque<bool> xb = make_l5q_xb();
std::deque<bool> xa=make_l5q_xa(); std::deque<bool> xa = make_l5q_xa();
std::deque<bool> xb_shift(GPS_L5q_CODE_LENGTH_CHIPS,0); std::deque<bool> xb_shift(GPS_L5q_CODE_LENGTH_CHIPS, 0);
for (int n=0; n<GPS_L5q_CODE_LENGTH_CHIPS; n++) for (int n = 0; n < GPS_L5q_CODE_LENGTH_CHIPS; n++)
{ {
xb_shift[n]=xb[(xb_offset+n)%GPS_L5q_CODE_LENGTH_CHIPS]; xb_shift[n] = xb[(xb_offset + n) % GPS_L5q_CODE_LENGTH_CHIPS];
} }
std::deque<bool> out_code(GPS_L5q_CODE_LENGTH_CHIPS,0); std::deque<bool> out_code(GPS_L5q_CODE_LENGTH_CHIPS, 0);
for (int n=0; n<GPS_L5q_CODE_LENGTH_CHIPS; n++) for (int n = 0; n < GPS_L5q_CODE_LENGTH_CHIPS; n++)
{ {
_dest[n]=xa[n] xor xb_shift[n]; _dest[n] = xa[n] xor xb_shift[n];
} }
} }
void gps_l5i_code_gen_complex(std::complex<float>* _dest, unsigned int _prn) void gps_l5i_code_gen_complex(std::complex<float>* _dest, unsigned int _prn)
{ {
int32_t* _code = new int32_t[GPS_L5i_CODE_LENGTH_CHIPS]; int32_t* _code = new int32_t[GPS_L5i_CODE_LENGTH_CHIPS];

View File

@ -1,13 +1,13 @@
/*! /*!
* \file gps_l5_signal.h * \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 * \author Javier Arribas, 2017. jarribas(at)cttc.es
* *
* Detailed description of the file here if needed. * 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 * GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver * Satellite Systems receiver
@ -30,8 +30,8 @@
* ------------------------------------------------------------------------- * -------------------------------------------------------------------------
*/ */
#ifndef GNSS_GPS_L5_SIGNAL_H_ #ifndef GNSS_SDR_GPS_L5_SIGNAL_H_
#define GNSS_GPS_L5_SIGNAL_H_ #define GNSS_SDR_GPS_L5_SIGNAL_H_
#include <complex> #include <complex>
@ -49,4 +49,4 @@ void gps_l5i_code_gen_complex_sampled(std::complex<float>* _dest, unsigned int _
void gps_l5q_code_gen_complex_sampled(std::complex<float>* _dest, unsigned int _prn, signed int _fs); void gps_l5q_code_gen_complex_sampled(std::complex<float>* _dest, unsigned int _prn, signed int _fs);
#endif /* GNSS_GPS_L5_SIGNAL_H_ */ #endif /* GNSS_SDR_GPS_L5_SIGNAL_H_ */