2013-08-02 16:00:12 +00:00
|
|
|
/*!
|
|
|
|
* \file front_end_cal.h
|
|
|
|
* \brief Interface of the Front-end calibration program.
|
|
|
|
* \author Javier Arribas, 2013. jarribas(at)cttc.es
|
|
|
|
*
|
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2013-08-02 16:00:12 +00:00
|
|
|
*
|
2020-12-30 12:35:06 +00:00
|
|
|
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
2013-08-02 16:00:12 +00:00
|
|
|
* This file is part of GNSS-SDR.
|
|
|
|
*
|
2020-12-30 12:35:06 +00:00
|
|
|
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
2020-02-08 00:20:02 +00:00
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
2013-08-02 16:00:12 +00:00
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2013-08-02 16:00:12 +00:00
|
|
|
*/
|
|
|
|
|
2020-02-08 09:10:46 +00:00
|
|
|
#ifndef GNSS_SDR_FRONT_END_CAL_H
|
|
|
|
#define GNSS_SDR_FRONT_END_CAL_H
|
2013-08-02 16:00:12 +00:00
|
|
|
|
2018-12-09 21:00:09 +00:00
|
|
|
#include <armadillo>
|
2019-03-06 12:49:14 +00:00
|
|
|
#include <memory>
|
|
|
|
#include <string>
|
2014-03-17 19:19:08 +00:00
|
|
|
|
2019-03-06 12:49:14 +00:00
|
|
|
class ConfigurationInterface;
|
2013-07-05 17:00:48 +00:00
|
|
|
|
|
|
|
class FrontEndCal
|
|
|
|
{
|
2019-07-21 17:32:52 +00:00
|
|
|
public:
|
|
|
|
FrontEndCal() = default;
|
|
|
|
~FrontEndCal() = default;
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Sets the configuration data required by get_ephemeris function
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void set_configuration(std::shared_ptr<ConfigurationInterface> configuration);
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief This function connects to a Secure User Location Protocol (SUPL) server to obtain
|
|
|
|
* the current GPS ephemeris and GPS assistance data. It requires the configuration parameters set by
|
|
|
|
* set_configuration function.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
bool get_ephemeris();
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief This function estimates the GPS L1 satellite Doppler frequency [Hz] using the following data:
|
|
|
|
* 1- Orbital model from the ephemeris
|
|
|
|
* 2- Approximate GPS Time of Week (TOW)
|
|
|
|
* 3- Approximate receiver Latitude and Longitude (WGS-84)
|
|
|
|
*
|
|
|
|
*/
|
2020-02-26 17:16:04 +00:00
|
|
|
double estimate_doppler_from_eph(unsigned int PRN, double tow, double lat, double lon, double height) noexcept(false);
|
2019-07-21 17:32:52 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief This function models the Elonics E4000 + RTL2832 front-end
|
|
|
|
* Inputs:
|
|
|
|
* f_bb_true_Hz - Ideal output frequency in baseband [Hz]
|
|
|
|
* f_in_bb_meas_Hz - measured output frequency in baseband [Hz]
|
|
|
|
* Outputs:
|
|
|
|
* estimated_fs_Hz - Sampling frequency estimation based on the
|
|
|
|
* measurements and the front-end model
|
|
|
|
* estimated_f_if_bb_Hz - Equivalent bb if frequency estimation based on the
|
|
|
|
* measurements and the front-end model
|
|
|
|
* Front-end TUNER Elonics E4000 + RTL2832 sampler For GPS L1 1575.42 MHz
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void GPS_L1_front_end_model_E4000(double f_bb_true_Hz, double f_bb_meas_Hz, double fs_nominal_hz, double *estimated_fs_Hz, double *estimated_f_if_Hz, double *f_osc_err_ppm);
|
|
|
|
|
2013-07-05 17:00:48 +00:00
|
|
|
private:
|
2014-04-03 21:59:14 +00:00
|
|
|
std::shared_ptr<ConfigurationInterface> configuration_;
|
2013-08-02 16:00:12 +00:00
|
|
|
|
2019-07-21 17:32:52 +00:00
|
|
|
/*
|
|
|
|
* LLA2ECEF Convert geodetic coordinates to Earth-centered Earth-fixed
|
2013-08-02 16:00:12 +00:00
|
|
|
* (ECEF) coordinates. P = LLA2ECEF( LLA ) converts an M-by-3 array of geodetic coordinates
|
|
|
|
* (latitude, longitude and altitude), LLA, to an M-by-3 array of ECEF
|
|
|
|
* coordinates, P. LLA is in [degrees degrees meters]. P is in meters.
|
|
|
|
* The default ellipsoid planet is WGS84. Original copyright (c) by Kai Borre.
|
|
|
|
*/
|
2018-03-03 01:03:39 +00:00
|
|
|
arma::vec lla2ecef(const arma::vec &lla);
|
2019-07-21 17:32:52 +00:00
|
|
|
|
|
|
|
/*
|
2013-08-02 16:00:12 +00:00
|
|
|
* GEODETIC2ECEF Convert geodetic to geocentric (ECEF) coordinates
|
|
|
|
* [X, Y, Z] = GEODETIC2ECEF(PHI, LAMBDA, H, ELLIPSOID) converts geodetic
|
|
|
|
* point locations specified by the coordinate arrays PHI (geodetic
|
|
|
|
* latitude in radians), LAMBDA (longitude in radians), and H (ellipsoidal
|
|
|
|
* height) to geocentric Cartesian coordinates X, Y, and Z. The geodetic
|
|
|
|
* coordinates refer to the reference ellipsoid specified by ELLIPSOID (a
|
|
|
|
* row vector with the form [semimajor axis, eccentricity]). H must use
|
|
|
|
* the same units as the semimajor axis; X, Y, and Z will be expressed in
|
|
|
|
* these units also.
|
|
|
|
*
|
|
|
|
* The geocentric Cartesian coordinate system is fixed with respect to the
|
|
|
|
* Earth, with its origin at the center of the ellipsoid and its X-, Y-,
|
|
|
|
* and Z-axes intersecting the surface at the following points:
|
|
|
|
* PHI LAMBDA
|
|
|
|
* X-axis: 0 0 (Equator at the Prime Meridian)
|
|
|
|
* Y-axis: 0 pi/2 (Equator at 90-degrees East
|
|
|
|
* Z-axis: pi/2 0 (North Pole)
|
|
|
|
*
|
|
|
|
* A common synonym is Earth-Centered, Earth-Fixed coordinates, or ECEF.
|
|
|
|
*
|
|
|
|
* See also ECEF2GEODETIC, ECEF2LV, GEODETIC2GEOCENTRICLAT, LV2ECEF.
|
|
|
|
*
|
|
|
|
* Copyright 2004-2009 The MathWorks, Inc.
|
|
|
|
* $Revision: 1.1.6.4 $ $Date: 2009/04/15 23:34:46 $
|
|
|
|
* Reference
|
|
|
|
* ---------
|
|
|
|
* Paul R. Wolf and Bon A. Dewitt, "Elements of Photogrammetry with
|
|
|
|
* Applications in GIS," 3rd Ed., McGraw-Hill, 2000 (Appendix F-3).
|
|
|
|
*/
|
2018-03-03 01:03:39 +00:00
|
|
|
arma::vec geodetic2ecef(double phi, double lambda, double h, const arma::vec &ellipsoid);
|
2019-07-21 17:32:52 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Reads the ephemeris data from an external XML file
|
2013-08-02 16:00:12 +00:00
|
|
|
*/
|
|
|
|
bool read_assistance_from_XML();
|
2019-07-21 17:32:52 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Connects to Secure User Location Protocol (SUPL) server to obtain
|
2013-08-02 16:00:12 +00:00
|
|
|
* the current GPS ephemeris and GPS assistance data.
|
|
|
|
*/
|
|
|
|
int Get_SUPL_Assist();
|
2013-08-01 14:01:07 +00:00
|
|
|
|
2014-04-28 14:27:47 +00:00
|
|
|
const std::string eph_default_xml_filename = "./gps_ephemeris.xml";
|
2013-07-05 17:00:48 +00:00
|
|
|
};
|
2013-08-02 16:00:12 +00:00
|
|
|
|
|
|
|
#endif
|