2011-11-22 17:21:54 +00:00
|
|
|
/*!
|
|
|
|
* \file tracking_discriminators.h
|
2011-12-28 21:36:45 +00:00
|
|
|
* \brief Interface of a library with a set of code tracking and carrier
|
|
|
|
* tracking discriminators.
|
2012-09-12 15:03:38 +00:00
|
|
|
* \authors <ul>
|
|
|
|
* <li> Javier Arribas, 2011. jarribas(at)cttc.es
|
|
|
|
* <li> Luis Esteve, 2012. luis(at)epsilon-formacion.com
|
|
|
|
* </ul>
|
2011-11-22 17:21:54 +00:00
|
|
|
*
|
2011-12-28 21:36:45 +00:00
|
|
|
* Library with a set of code tracking and carrier tracking discriminators
|
|
|
|
* that is used by the tracking algorithms.
|
2011-11-22 17:21:54 +00:00
|
|
|
*
|
|
|
|
* -------------------------------------------------------------------------
|
|
|
|
*
|
2019-07-26 10:38:20 +00:00
|
|
|
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
|
2011-11-22 17:21:54 +00:00
|
|
|
*
|
|
|
|
* GNSS-SDR is a software defined Global Navigation
|
|
|
|
* Satellite Systems receiver
|
|
|
|
*
|
|
|
|
* This file is part of GNSS-SDR.
|
|
|
|
*
|
|
|
|
* GNSS-SDR is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
2015-01-08 18:49:59 +00:00
|
|
|
* (at your option) any later version.
|
2011-11-22 17:21:54 +00:00
|
|
|
*
|
|
|
|
* GNSS-SDR is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2018-05-13 20:49:11 +00:00
|
|
|
* along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
|
2011-11-22 17:21:54 +00:00
|
|
|
*
|
|
|
|
* -------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
2011-12-28 03:05:37 +00:00
|
|
|
#ifndef GNSS_SDR_TRACKING_DISCRIMINATORS_H_
|
|
|
|
#define GNSS_SDR_TRACKING_DISCRIMINATORS_H_
|
2011-11-22 17:21:54 +00:00
|
|
|
|
|
|
|
#include <gnuradio/gr_complex.h>
|
|
|
|
|
2011-12-28 21:36:45 +00:00
|
|
|
/*! brief FLL four quadrant arctan discriminator
|
|
|
|
*
|
|
|
|
* FLL four quadrant arctan discriminator:
|
|
|
|
* \f{equation}
|
2016-05-02 21:46:30 +00:00
|
|
|
* \frac{\phi_2-\phi_1}{t_2-t1}=\frac{ATAN2(cross,dot)}{t_1-t_2},
|
2011-12-28 21:36:45 +00:00
|
|
|
* \f}
|
|
|
|
* where \f$cross=I_{PS1}Q_{PS2}-I_{PS2}Q_{PS1}\f$ and \f$dot=I_{PS1}I_{PS2}+Q_{PS1}Q_{PS2}\f$,
|
|
|
|
* \f$I_{PS1},Q_{PS1}\f$ are the inphase and quadrature prompt correlator outputs respectively at sample time \f$t_1\f$, and
|
|
|
|
* \f$I_{PS2},Q_{PS2}\f$ are the inphase and quadrature prompt correlator outputs respectively at sample time \f$t_2\f$. The output is in [radians/second].
|
|
|
|
*/
|
2015-11-26 17:44:04 +00:00
|
|
|
double fll_four_quadrant_atan(gr_complex prompt_s1, gr_complex prompt_s2, double t1, double t2);
|
2011-11-22 17:21:54 +00:00
|
|
|
|
2019-09-13 06:56:37 +00:00
|
|
|
|
2019-05-15 15:38:45 +00:00
|
|
|
/*
|
|
|
|
* FLL differential arctan discriminator:
|
|
|
|
* \f{equation}
|
|
|
|
* e_{atan}(k)=\frac{1}{t_1-t_2}\text{phase_unwrap}(\tan^-1(\frac{Q(k)}{I(k)})-\tan^-1(\frac{Q(k-1)}{I(k-1)}))
|
|
|
|
* \f}
|
|
|
|
* The output is in [radians/second].
|
|
|
|
*/
|
|
|
|
double fll_diff_atan(gr_complex prompt_s1, gr_complex prompt_s2, double t1, double t2);
|
|
|
|
|
2019-09-13 06:56:37 +00:00
|
|
|
|
2019-05-15 15:38:45 +00:00
|
|
|
/*! \brief Phase unwrapping function, input is [rad]
|
|
|
|
*/
|
|
|
|
double phase_unwrap(double phase_rad);
|
2011-12-28 21:36:45 +00:00
|
|
|
|
2019-09-13 06:56:37 +00:00
|
|
|
|
2011-12-28 21:36:45 +00:00
|
|
|
/*! \brief PLL four quadrant arctan discriminator
|
|
|
|
*
|
|
|
|
* PLL four quadrant arctan discriminator:
|
|
|
|
* \f{equation}
|
2016-05-02 21:46:30 +00:00
|
|
|
* \phi=ATAN2(Q_{PS},I_{PS}),
|
2011-12-28 21:36:45 +00:00
|
|
|
* \f}
|
|
|
|
* where \f$I_{PS1},Q_{PS1}\f$ are the inphase and quadrature prompt correlator outputs respectively. The output is in [radians].
|
|
|
|
*/
|
2015-11-26 17:44:04 +00:00
|
|
|
double pll_four_quadrant_atan(gr_complex prompt_s1);
|
2011-11-22 17:21:54 +00:00
|
|
|
|
2011-12-28 21:36:45 +00:00
|
|
|
|
|
|
|
/*! \brief PLL Costas loop two quadrant arctan discriminator
|
|
|
|
*
|
|
|
|
* PLL Costas loop two quadrant arctan discriminator:
|
|
|
|
* \f{equation}
|
2016-05-02 21:46:30 +00:00
|
|
|
* \phi=ATAN\left(\frac{Q_{PS}}{I_{PS}}\right),
|
2011-12-28 21:36:45 +00:00
|
|
|
* \f}
|
|
|
|
* where \f$I_{PS1},Q_{PS1}\f$ are the inphase and quadrature prompt correlator outputs respectively. The output is in [radians].
|
|
|
|
*/
|
2015-11-26 17:44:04 +00:00
|
|
|
double pll_cloop_two_quadrant_atan(gr_complex prompt_s1);
|
2011-11-22 17:21:54 +00:00
|
|
|
|
2011-12-28 21:36:45 +00:00
|
|
|
|
|
|
|
/*! \brief DLL Noncoherent Early minus Late envelope normalized discriminator
|
|
|
|
*
|
|
|
|
* DLL Noncoherent Early minus Late envelope normalized discriminator:
|
|
|
|
* \f{equation}
|
2016-05-02 21:46:30 +00:00
|
|
|
* error=\frac{E-L}{E+L},
|
2011-12-28 21:36:45 +00:00
|
|
|
* \f}
|
2012-09-12 15:03:38 +00:00
|
|
|
* where \f$E=\sqrt{I_{ES}^2+Q_{ES}^2}\f$ is the Early correlator output absolute value and
|
|
|
|
* \f$L=\sqrt{I_{LS}^2+Q_{LS}^2}\f$ is the Late correlator output absolute value. The output is in [chips].
|
2011-12-28 21:36:45 +00:00
|
|
|
*/
|
2015-11-26 17:44:04 +00:00
|
|
|
double dll_nc_e_minus_l_normalized(gr_complex early_s1, gr_complex late_s1);
|
2011-11-22 17:21:54 +00:00
|
|
|
|
|
|
|
|
2012-08-28 13:38:33 +00:00
|
|
|
/*! \brief DLL Noncoherent Very Early Minus Late Power (VEMLP) normalized discriminator
|
|
|
|
*
|
2012-09-12 15:03:38 +00:00
|
|
|
* DLL Noncoherent Very Early Minus Late Power (VEMLP) normalized discriminator, using the outputs
|
|
|
|
* of four correlators, Very Early (VE), Early (E), Late (L) and Very Late (VL):
|
2012-08-28 13:38:33 +00:00
|
|
|
* \f{equation}
|
|
|
|
* error=\frac{E-L}{E+L},
|
|
|
|
* \f}
|
|
|
|
* where \f$E=\sqrt{I_{VE}^2+Q_{VE}^2+I_{E}^2+Q_{E}^2}\f$ and
|
|
|
|
* \f$L=\sqrt{I_{VL}^2+Q_{VL}^2+I_{L}^2+Q_{L}^2}\f$ . The output is in [chips].
|
|
|
|
*/
|
2015-11-26 17:44:04 +00:00
|
|
|
double dll_nc_vemlp_normalized(gr_complex very_early_s1, gr_complex early_s1, gr_complex late_s1, gr_complex very_late_s1);
|
2012-08-28 13:38:33 +00:00
|
|
|
|
|
|
|
|
2011-11-22 17:21:54 +00:00
|
|
|
#endif
|