mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-11-04 09:13:05 +00:00 
			
		
		
		
	Expose some tracking parameters to the configuration
Replace GPS_L5i_DLL_PLL_Tracking by GPS_L5_DLL_PLL_Tracking since now it can also track the Q component. Old name still recognized for backward compatibility Fix typo in flag documentation
This commit is contained in:
		@@ -54,7 +54,7 @@ DEFINE_int32(cn0_samples, 20, "Number of correlator outputs used for CN0 estimat
 | 
			
		||||
 | 
			
		||||
DEFINE_int32(cn0_min, 25, "Minimum valid CN0 (in dB-Hz).");
 | 
			
		||||
 | 
			
		||||
DEFINE_int32(max_lock_fail, 50, "Number number of lock failures before dropping satellite.");
 | 
			
		||||
DEFINE_int32(max_lock_fail, 50, "Maximum number of lock failures before dropping a satellite.");
 | 
			
		||||
 | 
			
		||||
DEFINE_double(carrier_lock_th, 0.85, "Carrier lock threshold (in rad).");
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -50,7 +50,7 @@ DECLARE_int32(doppler_step);  //<! If defined, sets the frequency step in the se
 | 
			
		||||
// Declare flags for tracking blocks
 | 
			
		||||
DECLARE_int32(cn0_samples);       //<! Number of correlator outputs used for CN0 estimation.
 | 
			
		||||
DECLARE_int32(cn0_min);           //<! Minimum valid CN0 (in dB-Hz).
 | 
			
		||||
DECLARE_int32(max_lock_fail);     //<! Number number of lock failures before dropping satellite.
 | 
			
		||||
DECLARE_int32(max_lock_fail);     //<! Maximum number of lock failures before dropping a satellite.
 | 
			
		||||
DECLARE_double(carrier_lock_th);  //<! Carrier lock threshold (in rad).
 | 
			
		||||
DECLARE_double(dll_bw_hz);        //<! Bandwidth of the DLL low pass filter, in Hz (overrides the configuration file).
 | 
			
		||||
DECLARE_double(pll_bw_hz);        //<! Bandwidth of the PLL low pass filter, in Hz (overrides the configuration file).
 | 
			
		||||
 
 | 
			
		||||
@@ -35,7 +35,7 @@ set(TRACKING_ADAPTER_SOURCES
 | 
			
		||||
     gps_l2_m_dll_pll_tracking.cc
 | 
			
		||||
     glonass_l1_ca_dll_pll_tracking.cc
 | 
			
		||||
     glonass_l1_ca_dll_pll_c_aid_tracking.cc
 | 
			
		||||
     gps_l5i_dll_pll_tracking.cc
 | 
			
		||||
     gps_l5_dll_pll_tracking.cc
 | 
			
		||||
     glonass_l2_ca_dll_pll_tracking.cc
 | 
			
		||||
     glonass_l2_ca_dll_pll_c_aid_tracking.cc
 | 
			
		||||
     ${OPT_TRACKING_ADAPTERS}
 | 
			
		||||
 
 | 
			
		||||
@@ -102,6 +102,19 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking(
 | 
			
		||||
    trk_param.system = 'E';
 | 
			
		||||
    char sig_[3] = "1B";
 | 
			
		||||
    std::memcpy(trk_param.signal, sig_, 3);
 | 
			
		||||
    int cn0_samples = configuration->property(role + ".cn0_samples", 20);
 | 
			
		||||
    if (FLAGS_cn0_samples != 20) cn0_samples = FLAGS_cn0_samples;
 | 
			
		||||
    trk_param.cn0_samples = cn0_samples;
 | 
			
		||||
    int cn0_min = configuration->property(role + ".cn0_min", 25);
 | 
			
		||||
    if (FLAGS_cn0_min != 25) cn0_min = FLAGS_cn0_min;
 | 
			
		||||
    trk_param.cn0_min = cn0_min;
 | 
			
		||||
    int max_lock_fail = configuration->property(role + ".max_lock_fail", 50);
 | 
			
		||||
    if (FLAGS_max_lock_fail != 50) max_lock_fail = FLAGS_max_lock_fail;
 | 
			
		||||
    trk_param.max_lock_fail = max_lock_fail;
 | 
			
		||||
    double carrier_lock_th = configuration->property(role + ".carrier_lock_th", 0.85);
 | 
			
		||||
    if (FLAGS_carrier_lock_th != 0.85) carrier_lock_th = FLAGS_carrier_lock_th;
 | 
			
		||||
    trk_param.carrier_lock_th = carrier_lock_th;
 | 
			
		||||
 | 
			
		||||
    //################# MAKE TRACKING GNURadio object ###################
 | 
			
		||||
    if (item_type.compare("gr_complex") == 0)
 | 
			
		||||
        {
 | 
			
		||||
 
 | 
			
		||||
@@ -101,6 +101,19 @@ GalileoE5aDllPllTracking::GalileoE5aDllPllTracking(
 | 
			
		||||
    trk_param.system = 'E';
 | 
			
		||||
    char sig_[3] = "5X";
 | 
			
		||||
    std::memcpy(trk_param.signal, sig_, 3);
 | 
			
		||||
    int cn0_samples = configuration->property(role + ".cn0_samples", 20);
 | 
			
		||||
    if (FLAGS_cn0_samples != 20) cn0_samples = FLAGS_cn0_samples;
 | 
			
		||||
    trk_param.cn0_samples = cn0_samples;
 | 
			
		||||
    int cn0_min = configuration->property(role + ".cn0_min", 25);
 | 
			
		||||
    if (FLAGS_cn0_min != 25) cn0_min = FLAGS_cn0_min;
 | 
			
		||||
    trk_param.cn0_min = cn0_min;
 | 
			
		||||
    int max_lock_fail = configuration->property(role + ".max_lock_fail", 50);
 | 
			
		||||
    if (FLAGS_max_lock_fail != 50) max_lock_fail = FLAGS_max_lock_fail;
 | 
			
		||||
    trk_param.max_lock_fail = max_lock_fail;
 | 
			
		||||
    double carrier_lock_th = configuration->property(role + ".carrier_lock_th", 0.85);
 | 
			
		||||
    if (FLAGS_carrier_lock_th != 0.85) carrier_lock_th = FLAGS_carrier_lock_th;
 | 
			
		||||
    trk_param.carrier_lock_th = carrier_lock_th;
 | 
			
		||||
 | 
			
		||||
    //################# MAKE TRACKING GNURadio object ###################
 | 
			
		||||
    if (item_type.compare("gr_complex") == 0)
 | 
			
		||||
        {
 | 
			
		||||
 
 | 
			
		||||
@@ -105,6 +105,19 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking(
 | 
			
		||||
    trk_param.system = 'G';
 | 
			
		||||
    char sig_[3] = "1C";
 | 
			
		||||
    std::memcpy(trk_param.signal, sig_, 3);
 | 
			
		||||
    int cn0_samples = configuration->property(role + ".cn0_samples", 20);
 | 
			
		||||
    if (FLAGS_cn0_samples != 20) cn0_samples = FLAGS_cn0_samples;
 | 
			
		||||
    trk_param.cn0_samples = cn0_samples;
 | 
			
		||||
    int cn0_min = configuration->property(role + ".cn0_min", 25);
 | 
			
		||||
    if (FLAGS_cn0_min != 25) cn0_min = FLAGS_cn0_min;
 | 
			
		||||
    trk_param.cn0_min = cn0_min;
 | 
			
		||||
    int max_lock_fail = configuration->property(role + ".max_lock_fail", 50);
 | 
			
		||||
    if (FLAGS_max_lock_fail != 50) max_lock_fail = FLAGS_max_lock_fail;
 | 
			
		||||
    trk_param.max_lock_fail = max_lock_fail;
 | 
			
		||||
    double carrier_lock_th = configuration->property(role + ".carrier_lock_th", 0.85);
 | 
			
		||||
    if (FLAGS_carrier_lock_th != 0.85) carrier_lock_th = FLAGS_carrier_lock_th;
 | 
			
		||||
    trk_param.carrier_lock_th = carrier_lock_th;
 | 
			
		||||
 | 
			
		||||
    //################# MAKE TRACKING GNURadio object ###################
 | 
			
		||||
    if (item_type.compare("gr_complex") == 0)
 | 
			
		||||
        {
 | 
			
		||||
 
 | 
			
		||||
@@ -92,6 +92,19 @@ GpsL2MDllPllTracking::GpsL2MDllPllTracking(
 | 
			
		||||
    trk_param.system = 'G';
 | 
			
		||||
    char sig_[3] = "2S";
 | 
			
		||||
    std::memcpy(trk_param.signal, sig_, 3);
 | 
			
		||||
    int cn0_samples = configuration->property(role + ".cn0_samples", 20);
 | 
			
		||||
    if (FLAGS_cn0_samples != 20) cn0_samples = FLAGS_cn0_samples;
 | 
			
		||||
    trk_param.cn0_samples = cn0_samples;
 | 
			
		||||
    int cn0_min = configuration->property(role + ".cn0_min", 25);
 | 
			
		||||
    if (FLAGS_cn0_min != 25) cn0_min = FLAGS_cn0_min;
 | 
			
		||||
    trk_param.cn0_min = cn0_min;
 | 
			
		||||
    int max_lock_fail = configuration->property(role + ".max_lock_fail", 50);
 | 
			
		||||
    if (FLAGS_max_lock_fail != 50) max_lock_fail = FLAGS_max_lock_fail;
 | 
			
		||||
    trk_param.max_lock_fail = max_lock_fail;
 | 
			
		||||
    double carrier_lock_th = configuration->property(role + ".carrier_lock_th", 0.85);
 | 
			
		||||
    if (FLAGS_carrier_lock_th != 0.85) carrier_lock_th = FLAGS_carrier_lock_th;
 | 
			
		||||
    trk_param.carrier_lock_th = carrier_lock_th;
 | 
			
		||||
 | 
			
		||||
    //################# MAKE TRACKING GNURadio object ###################
 | 
			
		||||
    if (item_type.compare("gr_complex") == 0)
 | 
			
		||||
        {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*!
 | 
			
		||||
 * \file gps_l5i_dll_pll_tracking.cc
 | 
			
		||||
 * \file gps_l5_dll_pll_tracking.cc
 | 
			
		||||
 * \brief  Interface of an adapter of a DLL+PLL tracking loop block
 | 
			
		||||
 * for GPS L5i to a TrackingInterface
 | 
			
		||||
 * for GPS L5 to a TrackingInterface
 | 
			
		||||
 * \author Javier Arribas, 2017. jarribas(at)cttc.es
 | 
			
		||||
 *
 | 
			
		||||
 * Code DLL + carrier PLL according to the algorithms described in:
 | 
			
		||||
@@ -35,7 +35,7 @@
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#include "gps_l5i_dll_pll_tracking.h"
 | 
			
		||||
#include "gps_l5_dll_pll_tracking.h"
 | 
			
		||||
#include "configuration_interface.h"
 | 
			
		||||
#include "GPS_L5.h"
 | 
			
		||||
#include "gnss_sdr_flags.h"
 | 
			
		||||
@@ -45,7 +45,7 @@
 | 
			
		||||
 | 
			
		||||
using google::LogMessage;
 | 
			
		||||
 | 
			
		||||
GpsL5iDllPllTracking::GpsL5iDllPllTracking(
 | 
			
		||||
GpsL5DllPllTracking::GpsL5DllPllTracking(
 | 
			
		||||
    ConfigurationInterface* configuration, std::string role,
 | 
			
		||||
    unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
 | 
			
		||||
{
 | 
			
		||||
@@ -101,6 +101,19 @@ GpsL5iDllPllTracking::GpsL5iDllPllTracking(
 | 
			
		||||
    trk_param.system = 'G';
 | 
			
		||||
    char sig_[3] = "L5";
 | 
			
		||||
    std::memcpy(trk_param.signal, sig_, 3);
 | 
			
		||||
    int cn0_samples = configuration->property(role + ".cn0_samples", 20);
 | 
			
		||||
    if (FLAGS_cn0_samples != 20) cn0_samples = FLAGS_cn0_samples;
 | 
			
		||||
    trk_param.cn0_samples = cn0_samples;
 | 
			
		||||
    int cn0_min = configuration->property(role + ".cn0_min", 25);
 | 
			
		||||
    if (FLAGS_cn0_min != 25) cn0_min = FLAGS_cn0_min;
 | 
			
		||||
    trk_param.cn0_min = cn0_min;
 | 
			
		||||
    int max_lock_fail = configuration->property(role + ".max_lock_fail", 50);
 | 
			
		||||
    if (FLAGS_max_lock_fail != 50) max_lock_fail = FLAGS_max_lock_fail;
 | 
			
		||||
    trk_param.max_lock_fail = max_lock_fail;
 | 
			
		||||
    double carrier_lock_th = configuration->property(role + ".carrier_lock_th", 0.85);
 | 
			
		||||
    if (FLAGS_carrier_lock_th != 0.85) carrier_lock_th = FLAGS_carrier_lock_th;
 | 
			
		||||
    trk_param.carrier_lock_th = carrier_lock_th;
 | 
			
		||||
 | 
			
		||||
    //################# MAKE TRACKING GNURadio object ###################
 | 
			
		||||
    if (item_type.compare("gr_complex") == 0)
 | 
			
		||||
        {
 | 
			
		||||
@@ -117,12 +130,12 @@ GpsL5iDllPllTracking::GpsL5iDllPllTracking(
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
GpsL5iDllPllTracking::~GpsL5iDllPllTracking()
 | 
			
		||||
GpsL5DllPllTracking::~GpsL5DllPllTracking()
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
void GpsL5iDllPllTracking::start_tracking()
 | 
			
		||||
void GpsL5DllPllTracking::start_tracking()
 | 
			
		||||
{
 | 
			
		||||
    tracking_->start_tracking();
 | 
			
		||||
}
 | 
			
		||||
@@ -131,20 +144,20 @@ void GpsL5iDllPllTracking::start_tracking()
 | 
			
		||||
/*
 | 
			
		||||
 * Set tracking channel unique ID
 | 
			
		||||
 */
 | 
			
		||||
void GpsL5iDllPllTracking::set_channel(unsigned int channel)
 | 
			
		||||
void GpsL5DllPllTracking::set_channel(unsigned int channel)
 | 
			
		||||
{
 | 
			
		||||
    channel_ = channel;
 | 
			
		||||
    tracking_->set_channel(channel);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
void GpsL5iDllPllTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
 | 
			
		||||
void GpsL5DllPllTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
 | 
			
		||||
{
 | 
			
		||||
    tracking_->set_gnss_synchro(p_gnss_synchro);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
void GpsL5iDllPllTracking::connect(gr::top_block_sptr top_block)
 | 
			
		||||
void GpsL5DllPllTracking::connect(gr::top_block_sptr top_block)
 | 
			
		||||
{
 | 
			
		||||
    if (top_block)
 | 
			
		||||
        { /* top_block is not null */
 | 
			
		||||
@@ -153,7 +166,7 @@ void GpsL5iDllPllTracking::connect(gr::top_block_sptr top_block)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
void GpsL5iDllPllTracking::disconnect(gr::top_block_sptr top_block)
 | 
			
		||||
void GpsL5DllPllTracking::disconnect(gr::top_block_sptr top_block)
 | 
			
		||||
{
 | 
			
		||||
    if (top_block)
 | 
			
		||||
        { /* top_block is not null */
 | 
			
		||||
@@ -162,13 +175,13 @@ void GpsL5iDllPllTracking::disconnect(gr::top_block_sptr top_block)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
gr::basic_block_sptr GpsL5iDllPllTracking::get_left_block()
 | 
			
		||||
gr::basic_block_sptr GpsL5DllPllTracking::get_left_block()
 | 
			
		||||
{
 | 
			
		||||
    return tracking_;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
gr::basic_block_sptr GpsL5iDllPllTracking::get_right_block()
 | 
			
		||||
gr::basic_block_sptr GpsL5DllPllTracking::get_right_block()
 | 
			
		||||
{
 | 
			
		||||
    return tracking_;
 | 
			
		||||
}
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*!
 | 
			
		||||
 * \file gps_l5idll_pll_tracking.h
 | 
			
		||||
 * \file gps_l5_dll_pll_tracking.h
 | 
			
		||||
 * \brief  Interface of an adapter of a DLL+PLL tracking loop block
 | 
			
		||||
 * for GPS L5i to a TrackingInterface
 | 
			
		||||
 * for GPS L5 to a TrackingInterface
 | 
			
		||||
 * \author Javier Arribas, 2017. jarribas(at)cttc.es
 | 
			
		||||
 *
 | 
			
		||||
 * Code DLL + carrier PLL according to the algorithms described in:
 | 
			
		||||
@@ -34,8 +34,8 @@
 | 
			
		||||
 * -------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef GNSS_SDR_GPS_L5i_DLL_PLL_TRACKING_H_
 | 
			
		||||
#define GNSS_SDR_GPS_L5i_DLL_PLL_TRACKING_H_
 | 
			
		||||
#ifndef GNSS_SDR_GPS_L5_DLL_PLL_TRACKING_H_
 | 
			
		||||
#define GNSS_SDR_GPS_L5_DLL_PLL_TRACKING_H_
 | 
			
		||||
 | 
			
		||||
#include "tracking_interface.h"
 | 
			
		||||
#include "dll_pll_veml_tracking.h"
 | 
			
		||||
@@ -46,25 +46,25 @@ class ConfigurationInterface;
 | 
			
		||||
/*!
 | 
			
		||||
 * \brief This class implements a code DLL + carrier PLL tracking loop
 | 
			
		||||
 */
 | 
			
		||||
class GpsL5iDllPllTracking : public TrackingInterface
 | 
			
		||||
class GpsL5DllPllTracking : public TrackingInterface
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
    GpsL5iDllPllTracking(ConfigurationInterface* configuration,
 | 
			
		||||
    GpsL5DllPllTracking(ConfigurationInterface* configuration,
 | 
			
		||||
        std::string role,
 | 
			
		||||
        unsigned int in_streams,
 | 
			
		||||
        unsigned int out_streams);
 | 
			
		||||
 | 
			
		||||
    virtual ~GpsL5iDllPllTracking();
 | 
			
		||||
    virtual ~GpsL5DllPllTracking();
 | 
			
		||||
 | 
			
		||||
    inline std::string role() override
 | 
			
		||||
    {
 | 
			
		||||
        return role_;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    //! Returns "GPS_L5i_DLL_PLL_Tracking"
 | 
			
		||||
    //! Returns "GPS_L5_DLL_PLL_Tracking"
 | 
			
		||||
    inline std::string implementation() override
 | 
			
		||||
    {
 | 
			
		||||
        return "GPS_L5i_DLL_PLL_Tracking";
 | 
			
		||||
        return "GPS_L5_DLL_PLL_Tracking";
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    inline size_t item_size() override
 | 
			
		||||
@@ -99,4 +99,4 @@ private:
 | 
			
		||||
    unsigned int out_streams_;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#endif  // GNSS_SDR_GPS_L5i_DLL_PLL_TRACKING_H_
 | 
			
		||||
#endif  // GNSS_SDR_GPS_L5_DLL_PLL_TRACKING_H_
 | 
			
		||||
@@ -48,7 +48,6 @@
 | 
			
		||||
#include "gps_l2c_signal.h"
 | 
			
		||||
#include "GPS_L5.h"
 | 
			
		||||
#include "gps_l5_signal.h"
 | 
			
		||||
#include "gnss_sdr_flags.h"
 | 
			
		||||
#include <boost/lexical_cast.hpp>
 | 
			
		||||
#include <glog/logging.h>
 | 
			
		||||
#include <gnuradio/io_signature.h>
 | 
			
		||||
@@ -93,6 +92,18 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(dllpllconf_t conf_) : gr::block("dl
 | 
			
		||||
    d_secondary_code_length = 0;
 | 
			
		||||
    d_secondary_code_string = nullptr;
 | 
			
		||||
    signal_type = std::string(trk_parameters.signal);
 | 
			
		||||
 | 
			
		||||
    std::map<std::string, std::string> map_signal_pretty_name;
 | 
			
		||||
    map_signal_pretty_name["1C"] = "L1 C/A";
 | 
			
		||||
    map_signal_pretty_name["1B"] = "E1";
 | 
			
		||||
    map_signal_pretty_name["1G"] = "L1 C/A";
 | 
			
		||||
    map_signal_pretty_name["2S"] = "L2C";
 | 
			
		||||
    map_signal_pretty_name["2G"] = "L2 C/A";
 | 
			
		||||
    map_signal_pretty_name["5X"] = "E5a";
 | 
			
		||||
    map_signal_pretty_name["L5"] = "L5";
 | 
			
		||||
 | 
			
		||||
    signal_pretty_name = map_signal_pretty_name[signal_type];
 | 
			
		||||
 | 
			
		||||
    if (trk_parameters.system == 'G')
 | 
			
		||||
        {
 | 
			
		||||
            systemName = "GPS";
 | 
			
		||||
@@ -135,17 +146,19 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(dllpllconf_t conf_) : gr::block("dl
 | 
			
		||||
                    d_code_length_chips = static_cast<unsigned int>(GPS_L5i_CODE_LENGTH_CHIPS);
 | 
			
		||||
                    // GPS L5 does not have pilot secondary code
 | 
			
		||||
                    d_secondary = true;
 | 
			
		||||
                    interchange_iq = false;
 | 
			
		||||
                    if (trk_parameters.track_pilot)
 | 
			
		||||
                        {
 | 
			
		||||
                            d_secondary_code_length = static_cast<unsigned int>(GPS_L5q_NH_CODE_LENGTH);
 | 
			
		||||
                            d_secondary_code_string = const_cast<std::string *>(&GPS_L5q_NH_CODE_STR);
 | 
			
		||||
                            interchange_iq = true;
 | 
			
		||||
                            signal_pretty_name = signal_pretty_name + "Q";
 | 
			
		||||
                            //interchange_iq = true;
 | 
			
		||||
                        }
 | 
			
		||||
                    else
 | 
			
		||||
                        {
 | 
			
		||||
                            d_secondary_code_length = static_cast<unsigned int>(GPS_L5i_NH_CODE_LENGTH);
 | 
			
		||||
                            d_secondary_code_string = const_cast<std::string *>(&GPS_L5i_NH_CODE_STR);
 | 
			
		||||
                            interchange_iq = false;
 | 
			
		||||
                            signal_pretty_name = signal_pretty_name + "I";
 | 
			
		||||
                        }
 | 
			
		||||
                }
 | 
			
		||||
            else
 | 
			
		||||
@@ -180,10 +193,12 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(dllpllconf_t conf_) : gr::block("dl
 | 
			
		||||
                            d_secondary = true;
 | 
			
		||||
                            d_secondary_code_length = static_cast<unsigned int>(Galileo_E1_C_SECONDARY_CODE_LENGTH);
 | 
			
		||||
                            d_secondary_code_string = const_cast<std::string *>(&Galileo_E1_C_SECONDARY_CODE);
 | 
			
		||||
                            signal_pretty_name = signal_pretty_name + "C";
 | 
			
		||||
                        }
 | 
			
		||||
                    else
 | 
			
		||||
                        {
 | 
			
		||||
                            d_secondary = false;
 | 
			
		||||
                            signal_pretty_name = signal_pretty_name + "B";
 | 
			
		||||
                        }
 | 
			
		||||
                    interchange_iq = false;  // Note that E1-B and E1-C are in anti-phase, NOT IN QUADRATURE. See Galileo ICD.
 | 
			
		||||
                }
 | 
			
		||||
@@ -197,16 +212,18 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(dllpllconf_t conf_) : gr::block("dl
 | 
			
		||||
                    d_code_samples_per_chip = 1;
 | 
			
		||||
                    d_code_length_chips = static_cast<unsigned int>(Galileo_E5a_CODE_LENGTH_CHIPS);
 | 
			
		||||
                    d_secondary = true;
 | 
			
		||||
                    interchange_iq = false;
 | 
			
		||||
                    if (trk_parameters.track_pilot)
 | 
			
		||||
                        {
 | 
			
		||||
                            interchange_iq = true;
 | 
			
		||||
                            d_secondary_code_length = static_cast<unsigned int>(Galileo_E5a_Q_SECONDARY_CODE_LENGTH);
 | 
			
		||||
                            signal_pretty_name = signal_pretty_name + "Q";
 | 
			
		||||
                            // interchange_iq = true;
 | 
			
		||||
                        }
 | 
			
		||||
                    else
 | 
			
		||||
                        {
 | 
			
		||||
                            interchange_iq = false;
 | 
			
		||||
                            d_secondary_code_length = static_cast<unsigned int>(Galileo_E5a_I_SECONDARY_CODE_LENGTH);
 | 
			
		||||
                            d_secondary_code_string = const_cast<std::string *>(&Galileo_E5a_I_SECONDARY_CODE);
 | 
			
		||||
                            signal_pretty_name = signal_pretty_name + "I";
 | 
			
		||||
                        }
 | 
			
		||||
                }
 | 
			
		||||
            else
 | 
			
		||||
@@ -338,11 +355,11 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(dllpllconf_t conf_) : gr::block("dl
 | 
			
		||||
 | 
			
		||||
    // CN0 estimation and lock detector buffers
 | 
			
		||||
    d_cn0_estimation_counter = 0;
 | 
			
		||||
    d_Prompt_buffer = new gr_complex[FLAGS_cn0_samples];
 | 
			
		||||
    d_Prompt_buffer = new gr_complex[trk_parameters.cn0_samples];
 | 
			
		||||
    d_carrier_lock_test = 1.0;
 | 
			
		||||
    d_CN0_SNV_dB_Hz = 0.0;
 | 
			
		||||
    d_carrier_lock_fail_counter = 0;
 | 
			
		||||
    d_carrier_lock_threshold = FLAGS_carrier_lock_th;
 | 
			
		||||
    d_carrier_lock_threshold = trk_parameters.carrier_lock_th;
 | 
			
		||||
 | 
			
		||||
    clear_tracking_vars();
 | 
			
		||||
 | 
			
		||||
@@ -361,16 +378,6 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(dllpllconf_t conf_) : gr::block("dl
 | 
			
		||||
    d_code_phase_samples = 0.0;
 | 
			
		||||
    d_last_prompt = gr_complex(0.0, 0.0);
 | 
			
		||||
    d_state = 0;  // initial state: standby
 | 
			
		||||
 | 
			
		||||
    map_signal_pretty_name["1C"] = "L1 C/A";
 | 
			
		||||
    map_signal_pretty_name["1B"] = "E1";
 | 
			
		||||
    map_signal_pretty_name["1G"] = "L1 C/A";
 | 
			
		||||
    map_signal_pretty_name["2S"] = "L2C";
 | 
			
		||||
    map_signal_pretty_name["2G"] = "L2 C/A";
 | 
			
		||||
    map_signal_pretty_name["5X"] = "E5a";
 | 
			
		||||
    map_signal_pretty_name["L5"] = "L5";
 | 
			
		||||
 | 
			
		||||
    signal_pretty_name = map_signal_pretty_name[signal_type];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -618,7 +625,8 @@ bool dll_pll_veml_tracking::acquire_secondary()
 | 
			
		||||
bool dll_pll_veml_tracking::cn0_and_tracking_lock_status(double coh_integration_time_s)
 | 
			
		||||
{
 | 
			
		||||
    // ####### CN0 ESTIMATION AND LOCK DETECTORS ######
 | 
			
		||||
    if (d_cn0_estimation_counter < FLAGS_cn0_samples)
 | 
			
		||||
 | 
			
		||||
    if (d_cn0_estimation_counter < trk_parameters.cn0_samples)
 | 
			
		||||
        {
 | 
			
		||||
            // fill buffer with prompt correlator output values
 | 
			
		||||
            d_Prompt_buffer[d_cn0_estimation_counter] = d_P_accu;
 | 
			
		||||
@@ -629,11 +637,11 @@ bool dll_pll_veml_tracking::cn0_and_tracking_lock_status(double coh_integration_
 | 
			
		||||
        {
 | 
			
		||||
            d_cn0_estimation_counter = 0;
 | 
			
		||||
            // Code lock indicator
 | 
			
		||||
            d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, coh_integration_time_s);
 | 
			
		||||
            d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, trk_parameters.cn0_samples, coh_integration_time_s);
 | 
			
		||||
            // Carrier lock indicator
 | 
			
		||||
            d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, FLAGS_cn0_samples);
 | 
			
		||||
            d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, trk_parameters.cn0_samples);
 | 
			
		||||
            // Loss of lock detection
 | 
			
		||||
            if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < FLAGS_cn0_min)
 | 
			
		||||
            if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < trk_parameters.cn0_min)
 | 
			
		||||
                {
 | 
			
		||||
                    d_carrier_lock_fail_counter++;
 | 
			
		||||
                }
 | 
			
		||||
@@ -641,7 +649,7 @@ bool dll_pll_veml_tracking::cn0_and_tracking_lock_status(double coh_integration_
 | 
			
		||||
                {
 | 
			
		||||
                    if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--;
 | 
			
		||||
                }
 | 
			
		||||
            if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail)
 | 
			
		||||
            if (d_carrier_lock_fail_counter > trk_parameters.max_lock_fail)
 | 
			
		||||
                {
 | 
			
		||||
                    std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl;
 | 
			
		||||
                    LOG(INFO) << "Loss of lock in channel " << d_channel << "!";
 | 
			
		||||
@@ -1242,7 +1250,7 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused)
 | 
			
		||||
                d_L_accu = *d_Late;
 | 
			
		||||
 | 
			
		||||
                // Check lock status
 | 
			
		||||
                if (!cn0_and_tracking_lock_status(static_cast<double>(d_correlation_length_ms) / 1000.0))
 | 
			
		||||
                if (!cn0_and_tracking_lock_status(d_code_period))
 | 
			
		||||
                    {
 | 
			
		||||
                        clear_tracking_vars();
 | 
			
		||||
                        d_state = 0;  // loss-of-lock detected
 | 
			
		||||
@@ -1420,7 +1428,7 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused)
 | 
			
		||||
                save_correlation_results();
 | 
			
		||||
 | 
			
		||||
                // check lock status
 | 
			
		||||
                if (!cn0_and_tracking_lock_status((static_cast<double>(d_correlation_length_ms) / 1000.0) * static_cast<double>(trk_parameters.extend_correlation_symbols)))
 | 
			
		||||
                if (!cn0_and_tracking_lock_status(d_code_period * static_cast<double>(trk_parameters.extend_correlation_symbols)))
 | 
			
		||||
                    {
 | 
			
		||||
                        clear_tracking_vars();
 | 
			
		||||
                        d_state = 0;  // loss-of-lock detected
 | 
			
		||||
 
 | 
			
		||||
@@ -56,6 +56,10 @@ typedef struct
 | 
			
		||||
    float early_late_space_narrow_chips;
 | 
			
		||||
    float very_early_late_space_narrow_chips;
 | 
			
		||||
    int extend_correlation_symbols;
 | 
			
		||||
    int cn0_samples;
 | 
			
		||||
    int cn0_min;
 | 
			
		||||
    int max_lock_fail;
 | 
			
		||||
    double carrier_lock_th;
 | 
			
		||||
    bool track_pilot;
 | 
			
		||||
    char system;
 | 
			
		||||
    char signal[3];
 | 
			
		||||
@@ -119,7 +123,6 @@ private:
 | 
			
		||||
    std::string systemName;
 | 
			
		||||
    std::string signal_type;
 | 
			
		||||
    std::string *d_secondary_code_string;
 | 
			
		||||
    std::map<std::string, std::string> map_signal_pretty_name;
 | 
			
		||||
    std::string signal_pretty_name;
 | 
			
		||||
 | 
			
		||||
    //tracking state machine
 | 
			
		||||
 
 | 
			
		||||
@@ -91,7 +91,7 @@
 | 
			
		||||
#include "glonass_l1_ca_dll_pll_c_aid_tracking.h"
 | 
			
		||||
#include "glonass_l2_ca_dll_pll_tracking.h"
 | 
			
		||||
#include "glonass_l2_ca_dll_pll_c_aid_tracking.h"
 | 
			
		||||
#include "gps_l5i_dll_pll_tracking.h"
 | 
			
		||||
#include "gps_l5_dll_pll_tracking.h"
 | 
			
		||||
#include "gps_l1_ca_telemetry_decoder.h"
 | 
			
		||||
#include "gps_l2c_telemetry_decoder.h"
 | 
			
		||||
#include "gps_l5_telemetry_decoder.h"
 | 
			
		||||
@@ -250,13 +250,13 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetObservables(std::shared
 | 
			
		||||
    GPS_channels += configuration->property("Channels_2S.count", 0);
 | 
			
		||||
    GPS_channels += configuration->property("Channels_L5.count", 0);
 | 
			
		||||
    unsigned int Glonass_channels = configuration->property("Channels_1G.count", 0);
 | 
			
		||||
    unsigned int extra_channels = 1; // For monitor channel sample counter
 | 
			
		||||
    unsigned int extra_channels = 1;  // For monitor channel sample counter
 | 
			
		||||
    return GetBlock(configuration, "Observables", implementation,
 | 
			
		||||
            Galileo_channels +
 | 
			
		||||
        Galileo_channels +
 | 
			
		||||
            GPS_channels +
 | 
			
		||||
            Glonass_channels +
 | 
			
		||||
            extra_channels,
 | 
			
		||||
            Galileo_channels +
 | 
			
		||||
        Galileo_channels +
 | 
			
		||||
            GPS_channels +
 | 
			
		||||
            Glonass_channels);
 | 
			
		||||
}
 | 
			
		||||
@@ -617,7 +617,6 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_1G(
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
//********* GLONASS L2 C/A CHANNEL *****************
 | 
			
		||||
std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_2G(
 | 
			
		||||
    std::shared_ptr<ConfigurationInterface> configuration,
 | 
			
		||||
@@ -687,7 +686,6 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_2G(
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
//********* GPS L5  CHANNEL *****************
 | 
			
		||||
std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_L5(
 | 
			
		||||
    std::shared_ptr<ConfigurationInterface> configuration,
 | 
			
		||||
@@ -779,7 +777,7 @@ std::unique_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> GNSSBlockFacto
 | 
			
		||||
                                  Channels_1B_count +
 | 
			
		||||
                                  Channels_5X_count +
 | 
			
		||||
                                  Channels_1G_count +
 | 
			
		||||
								  Channels_2G_count +
 | 
			
		||||
                                  Channels_2G_count +
 | 
			
		||||
                                  Channels_L5_count;
 | 
			
		||||
 | 
			
		||||
    std::unique_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> channels(new std::vector<std::unique_ptr<GNSSBlockInterface>>(total_channels));
 | 
			
		||||
@@ -1437,9 +1435,9 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetBlock(
 | 
			
		||||
                out_streams));
 | 
			
		||||
            block = std::move(block_);
 | 
			
		||||
        }
 | 
			
		||||
    else if (implementation.compare("GPS_L5i_DLL_PLL_Tracking") == 0)
 | 
			
		||||
    else if ((implementation.compare("GPS_L5i_DLL_PLL_Tracking") == 0) or (implementation.compare("GPS_L5_DLL_PLL_Tracking") == 0))
 | 
			
		||||
        {
 | 
			
		||||
            std::unique_ptr<GNSSBlockInterface> block_(new GpsL5iDllPllTracking(configuration.get(), role, in_streams,
 | 
			
		||||
            std::unique_ptr<GNSSBlockInterface> block_(new GpsL5DllPllTracking(configuration.get(), role, in_streams,
 | 
			
		||||
                out_streams));
 | 
			
		||||
            block = std::move(block_);
 | 
			
		||||
        }
 | 
			
		||||
@@ -1766,9 +1764,9 @@ std::unique_ptr<TrackingInterface> GNSSBlockFactory::GetTrkBlock(
 | 
			
		||||
                out_streams));
 | 
			
		||||
            block = std::move(block_);
 | 
			
		||||
        }
 | 
			
		||||
    else if (implementation.compare("GPS_L5i_DLL_PLL_Tracking") == 0)
 | 
			
		||||
    else if ((implementation.compare("GPS_L5i_DLL_PLL_Tracking") == 0) or (implementation.compare("GPS_L5_DLL_PLL_Tracking") == 0))
 | 
			
		||||
        {
 | 
			
		||||
            std::unique_ptr<TrackingInterface> block_(new GpsL5iDllPllTracking(configuration.get(), role, in_streams,
 | 
			
		||||
            std::unique_ptr<TrackingInterface> block_(new GpsL5DllPllTracking(configuration.get(), role, in_streams,
 | 
			
		||||
                out_streams));
 | 
			
		||||
            block = std::move(block_);
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user