GNSS-SDR  0.0.13
An Open Source GNSS Software Defined Receiver
front_end_cal.h
Go to the documentation of this file.
1 /*!
2  * \file front_end_cal.h
3  * \brief Interface of the Front-end calibration program.
4  * \author Javier Arribas, 2013. jarribas(at)cttc.es
5  *
6  *
7  * -----------------------------------------------------------------------------
8  *
9  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
10  *
11  * GNSS-SDR is a software defined Global Navigation
12  * Satellite Systems receiver
13  *
14  * This file is part of GNSS-SDR.
15  *
16  * SPDX-License-Identifier: GPL-3.0-or-later
17  *
18  * -----------------------------------------------------------------------------
19  */
20 
21 #ifndef GNSS_SDR_FRONT_END_CAL_H
22 #define GNSS_SDR_FRONT_END_CAL_H
23 
24 #include <armadillo>
25 #include <memory>
26 #include <string>
27 
29 
31 {
32 public:
33  FrontEndCal() = default;
34  ~FrontEndCal() = default;
35 
36  /*!
37  * \brief Sets the configuration data required by get_ephemeris function
38  *
39  */
40  void set_configuration(std::shared_ptr<ConfigurationInterface> configuration);
41 
42  /*!
43  * \brief This function connects to a Secure User Location Protocol (SUPL) server to obtain
44  * the current GPS ephemeris and GPS assistance data. It requires the configuration parameters set by
45  * set_configuration function.
46  *
47  */
48  bool get_ephemeris();
49 
50  /*!
51  * \brief This function estimates the GPS L1 satellite Doppler frequency [Hz] using the following data:
52  * 1- Orbital model from the ephemeris
53  * 2- Approximate GPS Time of Week (TOW)
54  * 3- Approximate receiver Latitude and Longitude (WGS-84)
55  *
56  */
57  double estimate_doppler_from_eph(unsigned int PRN, double tow, double lat, double lon, double height) noexcept(false);
58 
59  /*!
60  * \brief This function models the Elonics E4000 + RTL2832 front-end
61  * Inputs:
62  * f_bb_true_Hz - Ideal output frequency in baseband [Hz]
63  * f_in_bb_meas_Hz - measured output frequency in baseband [Hz]
64  * Outputs:
65  * estimated_fs_Hz - Sampling frequency estimation based on the
66  * measurements and the front-end model
67  * estimated_f_if_bb_Hz - Equivalent bb if frequency estimation based on the
68  * measurements and the front-end model
69  * Front-end TUNER Elonics E4000 + RTL2832 sampler For GPS L1 1575.42 MHz
70  *
71  */
72  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);
73 
74 private:
75  std::shared_ptr<ConfigurationInterface> configuration_;
76 
77  /*
78  * LLA2ECEF Convert geodetic coordinates to Earth-centered Earth-fixed
79  * (ECEF) coordinates. P = LLA2ECEF( LLA ) converts an M-by-3 array of geodetic coordinates
80  * (latitude, longitude and altitude), LLA, to an M-by-3 array of ECEF
81  * coordinates, P. LLA is in [degrees degrees meters]. P is in meters.
82  * The default ellipsoid planet is WGS84. Original copyright (c) by Kai Borre.
83  */
84  arma::vec lla2ecef(const arma::vec &lla);
85 
86  /*
87  * GEODETIC2ECEF Convert geodetic to geocentric (ECEF) coordinates
88  * [X, Y, Z] = GEODETIC2ECEF(PHI, LAMBDA, H, ELLIPSOID) converts geodetic
89  * point locations specified by the coordinate arrays PHI (geodetic
90  * latitude in radians), LAMBDA (longitude in radians), and H (ellipsoidal
91  * height) to geocentric Cartesian coordinates X, Y, and Z. The geodetic
92  * coordinates refer to the reference ellipsoid specified by ELLIPSOID (a
93  * row vector with the form [semimajor axis, eccentricity]). H must use
94  * the same units as the semimajor axis; X, Y, and Z will be expressed in
95  * these units also.
96  *
97  * The geocentric Cartesian coordinate system is fixed with respect to the
98  * Earth, with its origin at the center of the ellipsoid and its X-, Y-,
99  * and Z-axes intersecting the surface at the following points:
100  * PHI LAMBDA
101  * X-axis: 0 0 (Equator at the Prime Meridian)
102  * Y-axis: 0 pi/2 (Equator at 90-degrees East
103  * Z-axis: pi/2 0 (North Pole)
104  *
105  * A common synonym is Earth-Centered, Earth-Fixed coordinates, or ECEF.
106  *
107  * See also ECEF2GEODETIC, ECEF2LV, GEODETIC2GEOCENTRICLAT, LV2ECEF.
108  *
109  * Copyright 2004-2009 The MathWorks, Inc.
110  * $Revision: 1.1.6.4 $ $Date: 2009/04/15 23:34:46 $
111  * Reference
112  * ---------
113  * Paul R. Wolf and Bon A. Dewitt, "Elements of Photogrammetry with
114  * Applications in GIS," 3rd Ed., McGraw-Hill, 2000 (Appendix F-3).
115  */
116  arma::vec geodetic2ecef(double phi, double lambda, double h, const arma::vec &ellipsoid);
117 
118  /*
119  * Reads the ephemeris data from an external XML file
120  */
121  bool read_assistance_from_XML();
122 
123  /*
124  * Connects to Secure User Location Protocol (SUPL) server to obtain
125  * the current GPS ephemeris and GPS assistance data.
126  */
127  int Get_SUPL_Assist();
128 
129  const std::string eph_default_xml_filename = "./gps_ephemeris.xml";
130 };
131 
132 #endif
void set_configuration(std::shared_ptr< ConfigurationInterface > configuration)
Sets the configuration data required by get_ephemeris function.
This abstract class represents an interface to configuration parameters.
double estimate_doppler_from_eph(unsigned int PRN, double tow, double lat, double lon, double height) noexcept(false)
This function estimates the GPS L1 satellite Doppler frequency [Hz] using the following data: 1- Orbi...
bool get_ephemeris()
This function connects to a Secure User Location Protocol (SUPL) server to obtain the current GPS eph...
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)
This function models the Elonics E4000 + RTL2832 front-end Inputs: f_bb_true_Hz - Ideal output freque...