mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-07-06 03:52:56 +00:00
Set tracking parameters as commandline flags
This commit is contained in:
parent
2b8ab9dcee
commit
fa51afa923
@ -40,4 +40,13 @@ DEFINE_string(s, "-",
|
|||||||
DEFINE_string(signal_source, "-",
|
DEFINE_string(signal_source, "-",
|
||||||
"If defined, path to the file containing the signal samples (overrides the configuration file)");
|
"If defined, path to the file containing the signal samples (overrides the configuration file)");
|
||||||
|
|
||||||
|
DEFINE_uint32(cn0_samples, 20, "Number of correlator outputs used for CN0 estimation");
|
||||||
|
|
||||||
|
DEFINE_uint32(cn0_min, 25, "Minimum valid CN0 (in dB-Hz)");
|
||||||
|
|
||||||
|
DEFINE_uint32(max_lock_fail, 50, "Number number of lock failures before dropping satellite");
|
||||||
|
|
||||||
|
DEFINE_double(carrier_lock_th, 0.85, "Carrier lock threshold (in rad)");
|
||||||
|
|
||||||
DEFINE_string(RINEX_version, "3.02", "Specifies the RINEX version (2.11 or 3.02)");
|
DEFINE_string(RINEX_version, "3.02", "Specifies the RINEX version (2.11 or 3.02)");
|
||||||
|
|
||||||
|
@ -35,16 +35,22 @@
|
|||||||
#include <gflags/gflags.h>
|
#include <gflags/gflags.h>
|
||||||
|
|
||||||
|
|
||||||
DECLARE_string(c); //<! path to the configuration file
|
DECLARE_string(c); //<! Path to the configuration file
|
||||||
DECLARE_string(config_file); //<! path to the configuration file
|
DECLARE_string(config_file); //<! Path to the configuration file
|
||||||
|
|
||||||
DECLARE_string(log_dir); //<! path to the folder in which logging will be stored
|
DECLARE_string(log_dir); //<! Path to the folder in which logging will be stored
|
||||||
|
|
||||||
// Declare flags for signal sources
|
// Declare flags for signal sources
|
||||||
DECLARE_string(s); //<! path to the file containing the signal samples
|
DECLARE_string(s); //<! Path to the file containing the signal samples
|
||||||
DECLARE_string(signal_source); //<! path to the file containing the signal samples
|
DECLARE_string(signal_source); //<! Path to the file containing the signal samples
|
||||||
|
|
||||||
//PVT
|
// Declare flags for tracking blocks
|
||||||
|
DECLARE_uint32(cn0_samples); //<! Number of correlator outputs used for CN0 estimation
|
||||||
|
DECLARE_uint32(cn0_min); //<! Minimum valid CN0 (in dB-Hz)
|
||||||
|
DECLARE_uint32(max_lock_fail); //<! Number number of lock failures before dropping satellite
|
||||||
|
DECLARE_double(carrier_lock_th); //<! Carrier lock threshold (in rad)
|
||||||
|
|
||||||
|
// Declare flags for PVT
|
||||||
DECLARE_string(RINEX_version); //<! RINEX version
|
DECLARE_string(RINEX_version); //<! RINEX version
|
||||||
|
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ list(SORT TRACKING_GR_BLOCKS_HEADERS)
|
|||||||
add_library(tracking_gr_blocks ${TRACKING_GR_BLOCKS_SOURCES} ${TRACKING_GR_BLOCKS_HEADERS})
|
add_library(tracking_gr_blocks ${TRACKING_GR_BLOCKS_SOURCES} ${TRACKING_GR_BLOCKS_HEADERS})
|
||||||
source_group(Headers FILES ${TRACKING_GR_BLOCKS_HEADERS})
|
source_group(Headers FILES ${TRACKING_GR_BLOCKS_HEADERS})
|
||||||
|
|
||||||
target_link_libraries(tracking_gr_blocks tracking_lib ${GNURADIO_RUNTIME_LIBRARIES} gnss_sp_libs ${Boost_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${MATIO_LIBRARIES} ${OPT_TRACKING_LIBRARIES})
|
target_link_libraries(tracking_gr_blocks tracking_lib ${GNURADIO_RUNTIME_LIBRARIES} gnss_sdr_flags gnss_sp_libs ${Boost_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${MATIO_LIBRARIES} ${OPT_TRACKING_LIBRARIES})
|
||||||
|
|
||||||
if(NOT VOLK_GNSSSDR_FOUND)
|
if(NOT VOLK_GNSSSDR_FOUND)
|
||||||
if(MATIO_FOUND)
|
if(MATIO_FOUND)
|
||||||
|
@ -49,6 +49,7 @@
|
|||||||
#include "lock_detectors.h"
|
#include "lock_detectors.h"
|
||||||
#include "Galileo_E1.h"
|
#include "Galileo_E1.h"
|
||||||
#include "control_message_factory.h"
|
#include "control_message_factory.h"
|
||||||
|
#include "gnss_sdr_flags.h"
|
||||||
|
|
||||||
using google::LogMessage;
|
using google::LogMessage;
|
||||||
|
|
||||||
@ -223,11 +224,11 @@ galileo_e1_dll_pll_veml_tracking_cc::galileo_e1_dll_pll_veml_tracking_cc(
|
|||||||
|
|
||||||
// CN0 estimation and lock detector buffers
|
// CN0 estimation and lock detector buffers
|
||||||
d_cn0_estimation_counter = 0;
|
d_cn0_estimation_counter = 0;
|
||||||
d_Prompt_buffer = new gr_complex[GALILEO_E1_CN0_ESTIMATION_SAMPLES];
|
d_Prompt_buffer = new gr_complex[FLAGS_cn0_samples];
|
||||||
d_carrier_lock_test = 1;
|
d_carrier_lock_test = 1;
|
||||||
d_CN0_SNV_dB_Hz = 0;
|
d_CN0_SNV_dB_Hz = 0;
|
||||||
d_carrier_lock_fail_counter = 0;
|
d_carrier_lock_fail_counter = 0;
|
||||||
d_carrier_lock_threshold = GALILEO_E1_CARRIER_LOCK_THRESHOLD;
|
d_carrier_lock_threshold = FLAGS_carrier_lock_th;
|
||||||
|
|
||||||
systemName["E"] = std::string("Galileo");
|
systemName["E"] = std::string("Galileo");
|
||||||
|
|
||||||
@ -452,7 +453,7 @@ bool galileo_e1_dll_pll_veml_tracking_cc::acquire_secondary()
|
|||||||
bool galileo_e1_dll_pll_veml_tracking_cc::cn0_and_tracking_lock_status()
|
bool galileo_e1_dll_pll_veml_tracking_cc::cn0_and_tracking_lock_status()
|
||||||
{
|
{
|
||||||
// ####### CN0 ESTIMATION AND LOCK DETECTORS ######
|
// ####### CN0 ESTIMATION AND LOCK DETECTORS ######
|
||||||
if (d_cn0_estimation_counter < GALILEO_E1_CN0_ESTIMATION_SAMPLES)
|
if (d_cn0_estimation_counter < FLAGS_cn0_samples)
|
||||||
{
|
{
|
||||||
// fill buffer with prompt correlator output values
|
// fill buffer with prompt correlator output values
|
||||||
d_Prompt_buffer[d_cn0_estimation_counter] = d_P_accu;
|
d_Prompt_buffer[d_cn0_estimation_counter] = d_P_accu;
|
||||||
@ -463,11 +464,11 @@ bool galileo_e1_dll_pll_veml_tracking_cc::cn0_and_tracking_lock_status()
|
|||||||
{
|
{
|
||||||
d_cn0_estimation_counter = 0;
|
d_cn0_estimation_counter = 0;
|
||||||
// Code lock indicator
|
// Code lock indicator
|
||||||
d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, GALILEO_E1_CN0_ESTIMATION_SAMPLES, d_fs_in, Galileo_E1_B_CODE_LENGTH_CHIPS);
|
d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, d_fs_in, Galileo_E1_B_CODE_LENGTH_CHIPS);
|
||||||
// Carrier lock indicator
|
// Carrier lock indicator
|
||||||
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, GALILEO_E1_CN0_ESTIMATION_SAMPLES);
|
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, FLAGS_cn0_samples);
|
||||||
// Loss of lock detection
|
// Loss of lock detection
|
||||||
if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < GALILEO_E1_MINIMUM_VALID_CN0)
|
if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < FLAGS_cn0_min)
|
||||||
{
|
{
|
||||||
d_carrier_lock_fail_counter++;
|
d_carrier_lock_fail_counter++;
|
||||||
}
|
}
|
||||||
@ -475,7 +476,7 @@ bool galileo_e1_dll_pll_veml_tracking_cc::cn0_and_tracking_lock_status()
|
|||||||
{
|
{
|
||||||
if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--;
|
if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--;
|
||||||
}
|
}
|
||||||
if (d_carrier_lock_fail_counter > GALILEO_E1_MAXIMUM_LOCK_FAIL_COUNTER)
|
if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail)
|
||||||
{
|
{
|
||||||
std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl;
|
std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl;
|
||||||
LOG(INFO) << "Loss of lock in channel " << d_channel << "!";
|
LOG(INFO) << "Loss of lock in channel " << d_channel << "!";
|
||||||
|
@ -52,16 +52,10 @@
|
|||||||
#include "GPS_L1_CA.h"
|
#include "GPS_L1_CA.h"
|
||||||
#include "Galileo_E1.h"
|
#include "Galileo_E1.h"
|
||||||
#include "control_message_factory.h"
|
#include "control_message_factory.h"
|
||||||
|
#include "gnss_sdr_flags.h"
|
||||||
#include "tcp_communication.h"
|
#include "tcp_communication.h"
|
||||||
#include "tcp_packet_data.h"
|
#include "tcp_packet_data.h"
|
||||||
|
|
||||||
/*!
|
|
||||||
* \todo Include in definition header file
|
|
||||||
*/
|
|
||||||
#define CN0_ESTIMATION_SAMPLES 20
|
|
||||||
#define MINIMUM_VALID_CN0 25
|
|
||||||
#define MAXIMUM_LOCK_FAIL_COUNTER 50
|
|
||||||
#define CARRIER_LOCK_THRESHOLD 0.85
|
|
||||||
|
|
||||||
using google::LogMessage;
|
using google::LogMessage;
|
||||||
|
|
||||||
@ -177,11 +171,11 @@ Galileo_E1_Tcp_Connector_Tracking_cc::Galileo_E1_Tcp_Connector_Tracking_cc(
|
|||||||
|
|
||||||
// CN0 estimation and lock detector buffers
|
// CN0 estimation and lock detector buffers
|
||||||
d_cn0_estimation_counter = 0;
|
d_cn0_estimation_counter = 0;
|
||||||
d_Prompt_buffer = new gr_complex[CN0_ESTIMATION_SAMPLES];
|
d_Prompt_buffer = new gr_complex[FLAGS_cn0_samples];
|
||||||
d_carrier_lock_test = 1;
|
d_carrier_lock_test = 1;
|
||||||
d_CN0_SNV_dB_Hz = 0;
|
d_CN0_SNV_dB_Hz = 0;
|
||||||
d_carrier_lock_fail_counter = 0;
|
d_carrier_lock_fail_counter = 0;
|
||||||
d_carrier_lock_threshold = CARRIER_LOCK_THRESHOLD;
|
d_carrier_lock_threshold = FLAGS_carrier_lock_th;
|
||||||
systemName["E"] = std::string("Galileo");
|
systemName["E"] = std::string("Galileo");
|
||||||
|
|
||||||
d_acquisition_gnss_synchro = 0;
|
d_acquisition_gnss_synchro = 0;
|
||||||
@ -378,7 +372,7 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attr
|
|||||||
//d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; //rounding error < 1 sample
|
//d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; //rounding error < 1 sample
|
||||||
|
|
||||||
// ####### CN0 ESTIMATION AND LOCK DETECTORS ######
|
// ####### CN0 ESTIMATION AND LOCK DETECTORS ######
|
||||||
if (d_cn0_estimation_counter < CN0_ESTIMATION_SAMPLES)
|
if (d_cn0_estimation_counter < FLAGS_cn0_samples)
|
||||||
{
|
{
|
||||||
// fill buffer with prompt correlator output values
|
// fill buffer with prompt correlator output values
|
||||||
d_Prompt_buffer[d_cn0_estimation_counter] = *d_Prompt;
|
d_Prompt_buffer[d_cn0_estimation_counter] = *d_Prompt;
|
||||||
@ -389,13 +383,13 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attr
|
|||||||
d_cn0_estimation_counter = 0;
|
d_cn0_estimation_counter = 0;
|
||||||
|
|
||||||
// Code lock indicator
|
// Code lock indicator
|
||||||
d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES, d_fs_in, Galileo_E1_B_CODE_LENGTH_CHIPS);
|
d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, d_fs_in, Galileo_E1_B_CODE_LENGTH_CHIPS);
|
||||||
|
|
||||||
// Carrier lock indicator
|
// Carrier lock indicator
|
||||||
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES);
|
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, FLAGS_cn0_samples);
|
||||||
|
|
||||||
// Loss of lock detection
|
// Loss of lock detection
|
||||||
if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < MINIMUM_VALID_CN0)
|
if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < FLAGS_cn0_min)
|
||||||
{
|
{
|
||||||
d_carrier_lock_fail_counter++;
|
d_carrier_lock_fail_counter++;
|
||||||
}
|
}
|
||||||
@ -403,7 +397,7 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attr
|
|||||||
{
|
{
|
||||||
if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--;
|
if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--;
|
||||||
}
|
}
|
||||||
if (d_carrier_lock_fail_counter > MAXIMUM_LOCK_FAIL_COUNTER)
|
if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail)
|
||||||
{
|
{
|
||||||
std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl;
|
std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl;
|
||||||
LOG(INFO) << "Loss of lock in channel " << d_channel << "!";
|
LOG(INFO) << "Loss of lock in channel " << d_channel << "!";
|
||||||
|
@ -49,6 +49,7 @@
|
|||||||
#include "Galileo_E5a.h"
|
#include "Galileo_E5a.h"
|
||||||
#include "Galileo_E1.h"
|
#include "Galileo_E1.h"
|
||||||
#include "control_message_factory.h"
|
#include "control_message_factory.h"
|
||||||
|
#include "gnss_sdr_flags.h"
|
||||||
|
|
||||||
|
|
||||||
using google::LogMessage;
|
using google::LogMessage;
|
||||||
@ -176,11 +177,11 @@ Galileo_E5a_Dll_Pll_Tracking_cc::Galileo_E5a_Dll_Pll_Tracking_cc(
|
|||||||
|
|
||||||
// CN0 estimation and lock detector buffers
|
// CN0 estimation and lock detector buffers
|
||||||
d_cn0_estimation_counter = 0;
|
d_cn0_estimation_counter = 0;
|
||||||
d_Prompt_buffer = new gr_complex[GALILEO_E5A_CN0_ESTIMATION_SAMPLES];
|
d_Prompt_buffer = new gr_complex[FLAGS_cn0_samples];
|
||||||
d_carrier_lock_test = 1;
|
d_carrier_lock_test = 1;
|
||||||
d_CN0_SNV_dB_Hz = 0;
|
d_CN0_SNV_dB_Hz = 0;
|
||||||
d_carrier_lock_fail_counter = 0;
|
d_carrier_lock_fail_counter = 0;
|
||||||
d_carrier_lock_threshold = GALILEO_E5A_CARRIER_LOCK_THRESHOLD;
|
d_carrier_lock_threshold = FLAGS_carrier_lock_th;
|
||||||
|
|
||||||
d_acquisition_gnss_synchro = 0;
|
d_acquisition_gnss_synchro = 0;
|
||||||
d_channel = 0;
|
d_channel = 0;
|
||||||
@ -347,8 +348,8 @@ void Galileo_E5a_Dll_Pll_Tracking_cc::acquire_secondary()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 2. Transform buffer to 1 and -1
|
// 2. Transform buffer to 1 and -1
|
||||||
int in_corr[GALILEO_E5A_CN0_ESTIMATION_SAMPLES];
|
int in_corr[FLAGS_cn0_samples];
|
||||||
for (unsigned int i = 0; i < GALILEO_E5A_CN0_ESTIMATION_SAMPLES; i++)
|
for (unsigned int i = 0; i < FLAGS_cn0_samples; i++)
|
||||||
{
|
{
|
||||||
if (d_Prompt_buffer[i].real() >0)
|
if (d_Prompt_buffer[i].real() >0)
|
||||||
{
|
{
|
||||||
@ -365,7 +366,7 @@ void Galileo_E5a_Dll_Pll_Tracking_cc::acquire_secondary()
|
|||||||
for (unsigned int i = 0; i < Galileo_E5a_Q_SECONDARY_CODE_LENGTH; i++)
|
for (unsigned int i = 0; i < Galileo_E5a_Q_SECONDARY_CODE_LENGTH; i++)
|
||||||
{
|
{
|
||||||
out_corr = 0;
|
out_corr = 0;
|
||||||
for (unsigned int j = 0; j < GALILEO_E5A_CN0_ESTIMATION_SAMPLES; j++)
|
for (unsigned int j = 0; j < FLAGS_cn0_samples; j++)
|
||||||
{
|
{
|
||||||
//reverse replica sign since i*i=-1 (conjugated complex)
|
//reverse replica sign since i*i=-1 (conjugated complex)
|
||||||
out_corr += in_corr[j] * -sec_code_signed[(j + i) % Galileo_E5a_Q_SECONDARY_CODE_LENGTH];
|
out_corr += in_corr[j] * -sec_code_signed[(j + i) % Galileo_E5a_Q_SECONDARY_CODE_LENGTH];
|
||||||
@ -376,10 +377,10 @@ void Galileo_E5a_Dll_Pll_Tracking_cc::acquire_secondary()
|
|||||||
d_secondary_delay = i;
|
d_secondary_delay = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (current_best_ == GALILEO_E5A_CN0_ESTIMATION_SAMPLES) // all bits correlate
|
if (current_best_ == FLAGS_cn0_samples) // all bits correlate
|
||||||
{
|
{
|
||||||
d_secondary_lock = true;
|
d_secondary_lock = true;
|
||||||
d_secondary_delay = (d_secondary_delay + GALILEO_E5A_CN0_ESTIMATION_SAMPLES - 1) % Galileo_E5a_Q_SECONDARY_CODE_LENGTH;
|
d_secondary_delay = (d_secondary_delay + FLAGS_cn0_samples - 1) % Galileo_E5a_Q_SECONDARY_CODE_LENGTH;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -560,7 +561,7 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute
|
|||||||
d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; //rounding error < 1 sample
|
d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; //rounding error < 1 sample
|
||||||
|
|
||||||
// ####### CN0 ESTIMATION AND LOCK DETECTORS ######
|
// ####### CN0 ESTIMATION AND LOCK DETECTORS ######
|
||||||
if (d_cn0_estimation_counter < GALILEO_E5A_CN0_ESTIMATION_SAMPLES-1)
|
if (d_cn0_estimation_counter < FLAGS_cn0_samples-1)
|
||||||
{
|
{
|
||||||
// fill buffer with prompt correlator output values
|
// fill buffer with prompt correlator output values
|
||||||
d_Prompt_buffer[d_cn0_estimation_counter] = d_Prompt;
|
d_Prompt_buffer[d_cn0_estimation_counter] = d_Prompt;
|
||||||
@ -587,7 +588,7 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute
|
|||||||
{
|
{
|
||||||
//std::cout << "Secondary code delay couldn't be resolved." << std::endl;
|
//std::cout << "Secondary code delay couldn't be resolved." << std::endl;
|
||||||
d_carrier_lock_fail_counter++;
|
d_carrier_lock_fail_counter++;
|
||||||
if (d_carrier_lock_fail_counter > GALILEO_E5A_MAXIMUM_LOCK_FAIL_COUNTER)
|
if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail)
|
||||||
{
|
{
|
||||||
std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl;
|
std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl;
|
||||||
LOG(INFO) << "Loss of lock in channel " << d_channel << "!";
|
LOG(INFO) << "Loss of lock in channel " << d_channel << "!";
|
||||||
@ -600,11 +601,11 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute
|
|||||||
else // Secondary lock achieved, monitor carrier lock.
|
else // Secondary lock achieved, monitor carrier lock.
|
||||||
{
|
{
|
||||||
// Code lock indicator
|
// Code lock indicator
|
||||||
d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, GALILEO_E5A_CN0_ESTIMATION_SAMPLES, d_fs_in,d_current_ti_ms * Galileo_E5a_CODE_LENGTH_CHIPS);
|
d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, d_fs_in,d_current_ti_ms * Galileo_E5a_CODE_LENGTH_CHIPS);
|
||||||
// Carrier lock indicator
|
// Carrier lock indicator
|
||||||
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, GALILEO_E5A_CN0_ESTIMATION_SAMPLES);
|
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, FLAGS_cn0_samples);
|
||||||
// Loss of lock detection
|
// Loss of lock detection
|
||||||
if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < GALILEO_E5A_MINIMUM_VALID_CN0)
|
if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < FLAGS_cn0_min)
|
||||||
{
|
{
|
||||||
d_carrier_lock_fail_counter++;
|
d_carrier_lock_fail_counter++;
|
||||||
}
|
}
|
||||||
@ -612,7 +613,7 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute
|
|||||||
{
|
{
|
||||||
if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--;
|
if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--;
|
||||||
|
|
||||||
if (d_carrier_lock_fail_counter > GALILEO_E5A_MAXIMUM_LOCK_FAIL_COUNTER)
|
if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail)
|
||||||
{
|
{
|
||||||
std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl;
|
std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl;
|
||||||
LOG(INFO) << "Loss of lock in channel " << d_channel << "!";
|
LOG(INFO) << "Loss of lock in channel " << d_channel << "!";
|
||||||
|
@ -52,18 +52,10 @@
|
|||||||
#include "tracking_discriminators.h"
|
#include "tracking_discriminators.h"
|
||||||
#include "lock_detectors.h"
|
#include "lock_detectors.h"
|
||||||
#include "GLONASS_L1_CA.h"
|
#include "GLONASS_L1_CA.h"
|
||||||
|
#include "gnss_sdr_flags.h"
|
||||||
#include "control_message_factory.h"
|
#include "control_message_factory.h"
|
||||||
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* \todo Include in definition header file
|
|
||||||
*/
|
|
||||||
#define CN0_ESTIMATION_SAMPLES 10
|
|
||||||
#define MINIMUM_VALID_CN0 25
|
|
||||||
#define MAXIMUM_LOCK_FAIL_COUNTER 50
|
|
||||||
#define CARRIER_LOCK_THRESHOLD 0.85
|
|
||||||
|
|
||||||
|
|
||||||
using google::LogMessage;
|
using google::LogMessage;
|
||||||
|
|
||||||
glonass_l1_ca_dll_pll_c_aid_tracking_cc_sptr
|
glonass_l1_ca_dll_pll_c_aid_tracking_cc_sptr
|
||||||
@ -185,11 +177,11 @@ glonass_l1_ca_dll_pll_c_aid_tracking_cc::glonass_l1_ca_dll_pll_c_aid_tracking_cc
|
|||||||
|
|
||||||
// CN0 estimation and lock detector buffers
|
// CN0 estimation and lock detector buffers
|
||||||
d_cn0_estimation_counter = 0;
|
d_cn0_estimation_counter = 0;
|
||||||
d_Prompt_buffer = new gr_complex[CN0_ESTIMATION_SAMPLES];
|
d_Prompt_buffer = new gr_complex[FLAGS_cn0_samples];
|
||||||
d_carrier_lock_test = 1;
|
d_carrier_lock_test = 1;
|
||||||
d_CN0_SNV_dB_Hz = 0;
|
d_CN0_SNV_dB_Hz = 0;
|
||||||
d_carrier_lock_fail_counter = 0;
|
d_carrier_lock_fail_counter = 0;
|
||||||
d_carrier_lock_threshold = CARRIER_LOCK_THRESHOLD;
|
d_carrier_lock_threshold = FLAGS_carrier_lock_th;
|
||||||
|
|
||||||
systemName["R"] = std::string("Glonass");
|
systemName["R"] = std::string("Glonass");
|
||||||
|
|
||||||
@ -759,7 +751,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __a
|
|||||||
d_rem_code_phase_chips = d_rem_code_phase_samples * (d_code_freq_chips / static_cast<double>(d_fs_in));
|
d_rem_code_phase_chips = d_rem_code_phase_samples * (d_code_freq_chips / static_cast<double>(d_fs_in));
|
||||||
|
|
||||||
// ####### CN0 ESTIMATION AND LOCK DETECTORS #######################################
|
// ####### CN0 ESTIMATION AND LOCK DETECTORS #######################################
|
||||||
if (d_cn0_estimation_counter < CN0_ESTIMATION_SAMPLES)
|
if (d_cn0_estimation_counter < FLAGS_cn0_samples)
|
||||||
{
|
{
|
||||||
// fill buffer with prompt correlator output values
|
// fill buffer with prompt correlator output values
|
||||||
d_Prompt_buffer[d_cn0_estimation_counter] = d_correlator_outs[1]; // prompt
|
d_Prompt_buffer[d_cn0_estimation_counter] = d_correlator_outs[1]; // prompt
|
||||||
@ -769,11 +761,11 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __a
|
|||||||
{
|
{
|
||||||
d_cn0_estimation_counter = 0;
|
d_cn0_estimation_counter = 0;
|
||||||
// Code lock indicator
|
// Code lock indicator
|
||||||
d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES, d_fs_in, GLONASS_L1_CA_CODE_LENGTH_CHIPS);
|
d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, d_fs_in, GLONASS_L1_CA_CODE_LENGTH_CHIPS);
|
||||||
// Carrier lock indicator
|
// Carrier lock indicator
|
||||||
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES);
|
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, FLAGS_cn0_samples);
|
||||||
// Loss of lock detection
|
// Loss of lock detection
|
||||||
if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < MINIMUM_VALID_CN0)
|
if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < FLAGS_cn0_min)
|
||||||
{
|
{
|
||||||
d_carrier_lock_fail_counter++;
|
d_carrier_lock_fail_counter++;
|
||||||
}
|
}
|
||||||
@ -781,7 +773,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __a
|
|||||||
{
|
{
|
||||||
if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--;
|
if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--;
|
||||||
}
|
}
|
||||||
if (d_carrier_lock_fail_counter > MAXIMUM_LOCK_FAIL_COUNTER)
|
if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail)
|
||||||
{
|
{
|
||||||
std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl;
|
std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl;
|
||||||
LOG(INFO) << "Loss of lock in channel " << d_channel << "!";
|
LOG(INFO) << "Loss of lock in channel " << d_channel << "!";
|
||||||
|
@ -53,18 +53,10 @@
|
|||||||
#include "tracking_discriminators.h"
|
#include "tracking_discriminators.h"
|
||||||
#include "lock_detectors.h"
|
#include "lock_detectors.h"
|
||||||
#include "GLONASS_L1_CA.h"
|
#include "GLONASS_L1_CA.h"
|
||||||
|
#include "gnss_sdr_flags.h"
|
||||||
#include "control_message_factory.h"
|
#include "control_message_factory.h"
|
||||||
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* \todo Include in definition header file
|
|
||||||
*/
|
|
||||||
#define CN0_ESTIMATION_SAMPLES 10
|
|
||||||
#define MINIMUM_VALID_CN0 25
|
|
||||||
#define MAXIMUM_LOCK_FAIL_COUNTER 50
|
|
||||||
#define CARRIER_LOCK_THRESHOLD 0.85
|
|
||||||
|
|
||||||
|
|
||||||
using google::LogMessage;
|
using google::LogMessage;
|
||||||
|
|
||||||
glonass_l1_ca_dll_pll_c_aid_tracking_sc_sptr
|
glonass_l1_ca_dll_pll_c_aid_tracking_sc_sptr
|
||||||
@ -187,11 +179,11 @@ glonass_l1_ca_dll_pll_c_aid_tracking_sc::glonass_l1_ca_dll_pll_c_aid_tracking_sc
|
|||||||
|
|
||||||
// CN0 estimation and lock detector buffers
|
// CN0 estimation and lock detector buffers
|
||||||
d_cn0_estimation_counter = 0;
|
d_cn0_estimation_counter = 0;
|
||||||
d_Prompt_buffer = new gr_complex[CN0_ESTIMATION_SAMPLES];
|
d_Prompt_buffer = new gr_complex[FLAGS_cn0_samples];
|
||||||
d_carrier_lock_test = 1;
|
d_carrier_lock_test = 1;
|
||||||
d_CN0_SNV_dB_Hz = 0;
|
d_CN0_SNV_dB_Hz = 0;
|
||||||
d_carrier_lock_fail_counter = 0;
|
d_carrier_lock_fail_counter = 0;
|
||||||
d_carrier_lock_threshold = CARRIER_LOCK_THRESHOLD;
|
d_carrier_lock_threshold = FLAGS_carrier_lock_th;
|
||||||
|
|
||||||
systemName["R"] = std::string("Glonass");
|
systemName["R"] = std::string("Glonass");
|
||||||
|
|
||||||
@ -752,7 +744,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __a
|
|||||||
d_rem_code_phase_chips = d_rem_code_phase_samples * (d_code_freq_chips / static_cast<double>(d_fs_in));
|
d_rem_code_phase_chips = d_rem_code_phase_samples * (d_code_freq_chips / static_cast<double>(d_fs_in));
|
||||||
|
|
||||||
// ####### CN0 ESTIMATION AND LOCK DETECTORS #######################################
|
// ####### CN0 ESTIMATION AND LOCK DETECTORS #######################################
|
||||||
if (d_cn0_estimation_counter < CN0_ESTIMATION_SAMPLES)
|
if (d_cn0_estimation_counter < FLAGS_cn0_samples)
|
||||||
{
|
{
|
||||||
// fill buffer with prompt correlator output values
|
// fill buffer with prompt correlator output values
|
||||||
d_Prompt_buffer[d_cn0_estimation_counter] = lv_cmake(static_cast<float>(d_correlator_outs_16sc[1].real()), static_cast<float>(d_correlator_outs_16sc[1].imag()) ); // prompt
|
d_Prompt_buffer[d_cn0_estimation_counter] = lv_cmake(static_cast<float>(d_correlator_outs_16sc[1].real()), static_cast<float>(d_correlator_outs_16sc[1].imag()) ); // prompt
|
||||||
@ -762,11 +754,11 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __a
|
|||||||
{
|
{
|
||||||
d_cn0_estimation_counter = 0;
|
d_cn0_estimation_counter = 0;
|
||||||
// Code lock indicator
|
// Code lock indicator
|
||||||
d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES, d_fs_in, GLONASS_L1_CA_CODE_LENGTH_CHIPS);
|
d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, d_fs_in, GLONASS_L1_CA_CODE_LENGTH_CHIPS);
|
||||||
// Carrier lock indicator
|
// Carrier lock indicator
|
||||||
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES);
|
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, FLAGS_cn0_samples);
|
||||||
// Loss of lock detection
|
// Loss of lock detection
|
||||||
if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < MINIMUM_VALID_CN0)
|
if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < FLAGS_cn0_min)
|
||||||
{
|
{
|
||||||
d_carrier_lock_fail_counter++;
|
d_carrier_lock_fail_counter++;
|
||||||
}
|
}
|
||||||
@ -774,7 +766,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __a
|
|||||||
{
|
{
|
||||||
if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--;
|
if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--;
|
||||||
}
|
}
|
||||||
if (d_carrier_lock_fail_counter > MAXIMUM_LOCK_FAIL_COUNTER)
|
if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail)
|
||||||
{
|
{
|
||||||
std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl;
|
std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl;
|
||||||
LOG(INFO) << "Loss of lock in channel " << d_channel << "!";
|
LOG(INFO) << "Loss of lock in channel " << d_channel << "!";
|
||||||
|
@ -50,15 +50,10 @@
|
|||||||
#include "tracking_discriminators.h"
|
#include "tracking_discriminators.h"
|
||||||
#include "lock_detectors.h"
|
#include "lock_detectors.h"
|
||||||
#include "GLONASS_L1_CA.h"
|
#include "GLONASS_L1_CA.h"
|
||||||
|
#include "gnss_sdr_flags.h"
|
||||||
#include "control_message_factory.h"
|
#include "control_message_factory.h"
|
||||||
|
|
||||||
|
|
||||||
#define CN0_ESTIMATION_SAMPLES 10
|
|
||||||
#define MINIMUM_VALID_CN0 25
|
|
||||||
#define MAXIMUM_LOCK_FAIL_COUNTER 50
|
|
||||||
#define CARRIER_LOCK_THRESHOLD 0.85
|
|
||||||
|
|
||||||
|
|
||||||
using google::LogMessage;
|
using google::LogMessage;
|
||||||
|
|
||||||
glonass_l1_ca_dll_pll_tracking_cc_sptr
|
glonass_l1_ca_dll_pll_tracking_cc_sptr
|
||||||
@ -158,11 +153,11 @@ Glonass_L1_Ca_Dll_Pll_Tracking_cc::Glonass_L1_Ca_Dll_Pll_Tracking_cc(
|
|||||||
|
|
||||||
// CN0 estimation and lock detector buffers
|
// CN0 estimation and lock detector buffers
|
||||||
d_cn0_estimation_counter = 0;
|
d_cn0_estimation_counter = 0;
|
||||||
d_Prompt_buffer = new gr_complex[CN0_ESTIMATION_SAMPLES];
|
d_Prompt_buffer = new gr_complex[FLAGS_cn0_samples];
|
||||||
d_carrier_lock_test = 1;
|
d_carrier_lock_test = 1;
|
||||||
d_CN0_SNV_dB_Hz = 0;
|
d_CN0_SNV_dB_Hz = 0;
|
||||||
d_carrier_lock_fail_counter = 0;
|
d_carrier_lock_fail_counter = 0;
|
||||||
d_carrier_lock_threshold = CARRIER_LOCK_THRESHOLD;
|
d_carrier_lock_threshold = FLAGS_carrier_lock_th;
|
||||||
|
|
||||||
systemName["R"] = std::string("Glonass");
|
systemName["R"] = std::string("Glonass");
|
||||||
|
|
||||||
@ -619,7 +614,7 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribu
|
|||||||
d_rem_code_phase_chips = d_code_freq_chips * (d_rem_code_phase_samples / static_cast<double>(d_fs_in));
|
d_rem_code_phase_chips = d_code_freq_chips * (d_rem_code_phase_samples / static_cast<double>(d_fs_in));
|
||||||
|
|
||||||
// ####### CN0 ESTIMATION AND LOCK DETECTORS ######
|
// ####### CN0 ESTIMATION AND LOCK DETECTORS ######
|
||||||
if (d_cn0_estimation_counter < CN0_ESTIMATION_SAMPLES)
|
if (d_cn0_estimation_counter < FLAGS_cn0_samples)
|
||||||
{
|
{
|
||||||
// fill buffer with prompt correlator output values
|
// fill buffer with prompt correlator output values
|
||||||
d_Prompt_buffer[d_cn0_estimation_counter] = d_correlator_outs[1]; //prompt
|
d_Prompt_buffer[d_cn0_estimation_counter] = d_correlator_outs[1]; //prompt
|
||||||
@ -629,11 +624,11 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribu
|
|||||||
{
|
{
|
||||||
d_cn0_estimation_counter = 0;
|
d_cn0_estimation_counter = 0;
|
||||||
// Code lock indicator
|
// Code lock indicator
|
||||||
d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES, d_fs_in, GLONASS_L1_CA_CODE_LENGTH_CHIPS);
|
d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, d_fs_in, GLONASS_L1_CA_CODE_LENGTH_CHIPS);
|
||||||
// Carrier lock indicator
|
// Carrier lock indicator
|
||||||
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES);
|
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, FLAGS_cn0_samples);
|
||||||
// Loss of lock detection
|
// Loss of lock detection
|
||||||
if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < MINIMUM_VALID_CN0)
|
if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < FLAGS_cn0_min)
|
||||||
{
|
{
|
||||||
d_carrier_lock_fail_counter++;
|
d_carrier_lock_fail_counter++;
|
||||||
}
|
}
|
||||||
@ -641,7 +636,7 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribu
|
|||||||
{
|
{
|
||||||
if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--;
|
if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--;
|
||||||
}
|
}
|
||||||
if (d_carrier_lock_fail_counter > MAXIMUM_LOCK_FAIL_COUNTER)
|
if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail)
|
||||||
{
|
{
|
||||||
std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl;
|
std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl;
|
||||||
LOG(INFO) << "Loss of lock in channel " << d_channel << "!";
|
LOG(INFO) << "Loss of lock in channel " << d_channel << "!";
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
#include "gps_sdr_signal_processing.h"
|
#include "gps_sdr_signal_processing.h"
|
||||||
#include "tracking_discriminators.h"
|
#include "tracking_discriminators.h"
|
||||||
#include "lock_detectors.h"
|
#include "lock_detectors.h"
|
||||||
|
#include "gnss_sdr_flags.h"
|
||||||
#include "GPS_L1_CA.h"
|
#include "GPS_L1_CA.h"
|
||||||
#include "control_message_factory.h"
|
#include "control_message_factory.h"
|
||||||
|
|
||||||
@ -168,11 +169,11 @@ gps_l1_ca_dll_pll_c_aid_tracking_cc::gps_l1_ca_dll_pll_c_aid_tracking_cc(
|
|||||||
|
|
||||||
// CN0 estimation and lock detector buffers
|
// CN0 estimation and lock detector buffers
|
||||||
d_cn0_estimation_counter = 0;
|
d_cn0_estimation_counter = 0;
|
||||||
d_Prompt_buffer = new gr_complex[GPS_L1_CA_CN0_ESTIMATION_SAMPLES];
|
d_Prompt_buffer = new gr_complex[FLAGS_cn0_samples];
|
||||||
d_carrier_lock_test = 1;
|
d_carrier_lock_test = 1;
|
||||||
d_CN0_SNV_dB_Hz = 0;
|
d_CN0_SNV_dB_Hz = 0;
|
||||||
d_carrier_lock_fail_counter = 0;
|
d_carrier_lock_fail_counter = 0;
|
||||||
d_carrier_lock_threshold = GPS_L1_CA_CARRIER_LOCK_THRESHOLD;
|
d_carrier_lock_threshold = FLAGS_carrier_lock_th;
|
||||||
|
|
||||||
systemName["G"] = std::string("GPS");
|
systemName["G"] = std::string("GPS");
|
||||||
systemName["S"] = std::string("SBAS");
|
systemName["S"] = std::string("SBAS");
|
||||||
@ -731,7 +732,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __attri
|
|||||||
d_rem_code_phase_chips = d_rem_code_phase_samples * (d_code_freq_chips / static_cast<double>(d_fs_in));
|
d_rem_code_phase_chips = d_rem_code_phase_samples * (d_code_freq_chips / static_cast<double>(d_fs_in));
|
||||||
|
|
||||||
// ####### CN0 ESTIMATION AND LOCK DETECTORS #######################################
|
// ####### CN0 ESTIMATION AND LOCK DETECTORS #######################################
|
||||||
if (d_cn0_estimation_counter < GPS_L1_CA_CN0_ESTIMATION_SAMPLES)
|
if (d_cn0_estimation_counter < FLAGS_cn0_samples)
|
||||||
{
|
{
|
||||||
// fill buffer with prompt correlator output values
|
// fill buffer with prompt correlator output values
|
||||||
d_Prompt_buffer[d_cn0_estimation_counter] = d_correlator_outs[1]; // prompt
|
d_Prompt_buffer[d_cn0_estimation_counter] = d_correlator_outs[1]; // prompt
|
||||||
@ -741,11 +742,11 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __attri
|
|||||||
{
|
{
|
||||||
d_cn0_estimation_counter = 0;
|
d_cn0_estimation_counter = 0;
|
||||||
// Code lock indicator
|
// Code lock indicator
|
||||||
d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, GPS_L1_CA_CN0_ESTIMATION_SAMPLES, d_fs_in, GPS_L1_CA_CODE_LENGTH_CHIPS);
|
d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, d_fs_in, GPS_L1_CA_CODE_LENGTH_CHIPS);
|
||||||
// Carrier lock indicator
|
// Carrier lock indicator
|
||||||
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, GPS_L1_CA_CN0_ESTIMATION_SAMPLES);
|
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, FLAGS_cn0_samples);
|
||||||
// Loss of lock detection
|
// Loss of lock detection
|
||||||
if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < GPS_L1_CA_MINIMUM_VALID_CN0)
|
if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < FLAGS_cn0_min)
|
||||||
{
|
{
|
||||||
d_carrier_lock_fail_counter++;
|
d_carrier_lock_fail_counter++;
|
||||||
}
|
}
|
||||||
@ -753,7 +754,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __attri
|
|||||||
{
|
{
|
||||||
if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--;
|
if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--;
|
||||||
}
|
}
|
||||||
if (d_carrier_lock_fail_counter > GPS_L1_CA_MAXIMUM_LOCK_FAIL_COUNTER)
|
if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail)
|
||||||
{
|
{
|
||||||
std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl;
|
std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl;
|
||||||
LOG(INFO) << "Loss of lock in channel " << d_channel << "!";
|
LOG(INFO) << "Loss of lock in channel " << d_channel << "!";
|
||||||
|
@ -46,15 +46,9 @@
|
|||||||
#include "tracking_discriminators.h"
|
#include "tracking_discriminators.h"
|
||||||
#include "lock_detectors.h"
|
#include "lock_detectors.h"
|
||||||
#include "GPS_L1_CA.h"
|
#include "GPS_L1_CA.h"
|
||||||
|
#include "gnss_sdr_flags.h"
|
||||||
#include "control_message_factory.h"
|
#include "control_message_factory.h"
|
||||||
|
|
||||||
/*!
|
|
||||||
* \todo Include in definition header file
|
|
||||||
*/
|
|
||||||
#define CN0_ESTIMATION_SAMPLES 20
|
|
||||||
#define MINIMUM_VALID_CN0 25
|
|
||||||
#define MAXIMUM_LOCK_FAIL_COUNTER 50
|
|
||||||
#define CARRIER_LOCK_THRESHOLD 0.85
|
|
||||||
|
|
||||||
using google::LogMessage;
|
using google::LogMessage;
|
||||||
|
|
||||||
@ -168,11 +162,11 @@ gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::gps_l1_ca_dll_pll_c_aid_tracking_fpga_
|
|||||||
|
|
||||||
// CN0 estimation and lock detector buffers
|
// CN0 estimation and lock detector buffers
|
||||||
d_cn0_estimation_counter = 0;
|
d_cn0_estimation_counter = 0;
|
||||||
d_Prompt_buffer = new gr_complex[CN0_ESTIMATION_SAMPLES];
|
d_Prompt_buffer = new gr_complex[FLAGS_cn0_samples];
|
||||||
d_carrier_lock_test = 1;
|
d_carrier_lock_test = 1;
|
||||||
d_CN0_SNV_dB_Hz = 0;
|
d_CN0_SNV_dB_Hz = 0;
|
||||||
d_carrier_lock_fail_counter = 0;
|
d_carrier_lock_fail_counter = 0;
|
||||||
d_carrier_lock_threshold = CARRIER_LOCK_THRESHOLD;
|
d_carrier_lock_threshold = FLAGS_carrier_lock_th;
|
||||||
|
|
||||||
systemName["G"] = std::string("GPS");
|
systemName["G"] = std::string("GPS");
|
||||||
systemName["S"] = std::string("SBAS");
|
systemName["S"] = std::string("SBAS");
|
||||||
@ -553,7 +547,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::general_work(
|
|||||||
d_rem_code_phase_chips = d_rem_code_phase_samples * (d_code_freq_chips / static_cast<double>(d_fs_in));
|
d_rem_code_phase_chips = d_rem_code_phase_samples * (d_code_freq_chips / static_cast<double>(d_fs_in));
|
||||||
|
|
||||||
// ####### CN0 ESTIMATION AND LOCK DETECTORS #######################################
|
// ####### CN0 ESTIMATION AND LOCK DETECTORS #######################################
|
||||||
if (d_cn0_estimation_counter < CN0_ESTIMATION_SAMPLES)
|
if (d_cn0_estimation_counter < FLAGS_cn0_samples)
|
||||||
{
|
{
|
||||||
// fill buffer with prompt correlator output values
|
// fill buffer with prompt correlator output values
|
||||||
d_Prompt_buffer[d_cn0_estimation_counter] = lv_cmake(static_cast<float>(d_correlator_outs_16sc[1].real()),
|
d_Prompt_buffer[d_cn0_estimation_counter] = lv_cmake(static_cast<float>(d_correlator_outs_16sc[1].real()),
|
||||||
@ -564,11 +558,11 @@ int gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::general_work(
|
|||||||
{
|
{
|
||||||
d_cn0_estimation_counter = 0;
|
d_cn0_estimation_counter = 0;
|
||||||
// Code lock indicator
|
// Code lock indicator
|
||||||
d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES, d_fs_in, GPS_L1_CA_CODE_LENGTH_CHIPS);
|
d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, d_fs_in, GPS_L1_CA_CODE_LENGTH_CHIPS);
|
||||||
// Carrier lock indicator
|
// Carrier lock indicator
|
||||||
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES);
|
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, FLAGS_cn0_samples);
|
||||||
// Loss of lock detection
|
// Loss of lock detection
|
||||||
if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < MINIMUM_VALID_CN0)
|
if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < FLAGS_cn0_min)
|
||||||
{
|
{
|
||||||
d_carrier_lock_fail_counter++;
|
d_carrier_lock_fail_counter++;
|
||||||
}
|
}
|
||||||
@ -579,7 +573,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::general_work(
|
|||||||
d_carrier_lock_fail_counter--;
|
d_carrier_lock_fail_counter--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (d_carrier_lock_fail_counter > MAXIMUM_LOCK_FAIL_COUNTER)
|
if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail)
|
||||||
{
|
{
|
||||||
std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl;
|
std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl;
|
||||||
LOG(INFO) << "Loss of lock in channel " << d_channel << "!";
|
LOG(INFO) << "Loss of lock in channel " << d_channel << "!";
|
||||||
|
@ -45,18 +45,10 @@
|
|||||||
#include "tracking_discriminators.h"
|
#include "tracking_discriminators.h"
|
||||||
#include "lock_detectors.h"
|
#include "lock_detectors.h"
|
||||||
#include "GPS_L1_CA.h"
|
#include "GPS_L1_CA.h"
|
||||||
|
#include "gnss_sdr_flags.h"
|
||||||
#include "control_message_factory.h"
|
#include "control_message_factory.h"
|
||||||
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* \todo Include in definition header file
|
|
||||||
*/
|
|
||||||
#define CN0_ESTIMATION_SAMPLES 20
|
|
||||||
#define MINIMUM_VALID_CN0 25
|
|
||||||
#define MAXIMUM_LOCK_FAIL_COUNTER 50
|
|
||||||
#define CARRIER_LOCK_THRESHOLD 0.85
|
|
||||||
|
|
||||||
|
|
||||||
using google::LogMessage;
|
using google::LogMessage;
|
||||||
|
|
||||||
gps_l1_ca_dll_pll_c_aid_tracking_sc_sptr
|
gps_l1_ca_dll_pll_c_aid_tracking_sc_sptr
|
||||||
@ -179,11 +171,11 @@ gps_l1_ca_dll_pll_c_aid_tracking_sc::gps_l1_ca_dll_pll_c_aid_tracking_sc(
|
|||||||
|
|
||||||
// CN0 estimation and lock detector buffers
|
// CN0 estimation and lock detector buffers
|
||||||
d_cn0_estimation_counter = 0;
|
d_cn0_estimation_counter = 0;
|
||||||
d_Prompt_buffer = new gr_complex[CN0_ESTIMATION_SAMPLES];
|
d_Prompt_buffer = new gr_complex[FLAGS_cn0_samples];
|
||||||
d_carrier_lock_test = 1;
|
d_carrier_lock_test = 1;
|
||||||
d_CN0_SNV_dB_Hz = 0;
|
d_CN0_SNV_dB_Hz = 0;
|
||||||
d_carrier_lock_fail_counter = 0;
|
d_carrier_lock_fail_counter = 0;
|
||||||
d_carrier_lock_threshold = CARRIER_LOCK_THRESHOLD;
|
d_carrier_lock_threshold = FLAGS_carrier_lock_th;
|
||||||
|
|
||||||
systemName["G"] = std::string("GPS");
|
systemName["G"] = std::string("GPS");
|
||||||
systemName["S"] = std::string("SBAS");
|
systemName["S"] = std::string("SBAS");
|
||||||
@ -744,7 +736,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __attri
|
|||||||
d_rem_code_phase_chips = d_rem_code_phase_samples * (d_code_freq_chips / static_cast<double>(d_fs_in));
|
d_rem_code_phase_chips = d_rem_code_phase_samples * (d_code_freq_chips / static_cast<double>(d_fs_in));
|
||||||
|
|
||||||
// ####### CN0 ESTIMATION AND LOCK DETECTORS #######################################
|
// ####### CN0 ESTIMATION AND LOCK DETECTORS #######################################
|
||||||
if (d_cn0_estimation_counter < CN0_ESTIMATION_SAMPLES)
|
if (d_cn0_estimation_counter < FLAGS_cn0_samples)
|
||||||
{
|
{
|
||||||
// fill buffer with prompt correlator output values
|
// fill buffer with prompt correlator output values
|
||||||
d_Prompt_buffer[d_cn0_estimation_counter] = lv_cmake(static_cast<float>(d_correlator_outs_16sc[1].real()), static_cast<float>(d_correlator_outs_16sc[1].imag()) ); // prompt
|
d_Prompt_buffer[d_cn0_estimation_counter] = lv_cmake(static_cast<float>(d_correlator_outs_16sc[1].real()), static_cast<float>(d_correlator_outs_16sc[1].imag()) ); // prompt
|
||||||
@ -754,11 +746,11 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __attri
|
|||||||
{
|
{
|
||||||
d_cn0_estimation_counter = 0;
|
d_cn0_estimation_counter = 0;
|
||||||
// Code lock indicator
|
// Code lock indicator
|
||||||
d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES, d_fs_in, GPS_L1_CA_CODE_LENGTH_CHIPS);
|
d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, d_fs_in, GPS_L1_CA_CODE_LENGTH_CHIPS);
|
||||||
// Carrier lock indicator
|
// Carrier lock indicator
|
||||||
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES);
|
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, FLAGS_cn0_samples);
|
||||||
// Loss of lock detection
|
// Loss of lock detection
|
||||||
if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < MINIMUM_VALID_CN0)
|
if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < FLAGS_cn0_min)
|
||||||
{
|
{
|
||||||
d_carrier_lock_fail_counter++;
|
d_carrier_lock_fail_counter++;
|
||||||
}
|
}
|
||||||
@ -766,7 +758,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __attri
|
|||||||
{
|
{
|
||||||
if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--;
|
if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--;
|
||||||
}
|
}
|
||||||
if (d_carrier_lock_fail_counter > MAXIMUM_LOCK_FAIL_COUNTER)
|
if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail)
|
||||||
{
|
{
|
||||||
std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl;
|
std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl;
|
||||||
LOG(INFO) << "Loss of lock in channel " << d_channel << "!";
|
LOG(INFO) << "Loss of lock in channel " << d_channel << "!";
|
||||||
|
@ -47,6 +47,7 @@
|
|||||||
#include "gps_sdr_signal_processing.h"
|
#include "gps_sdr_signal_processing.h"
|
||||||
#include "tracking_discriminators.h"
|
#include "tracking_discriminators.h"
|
||||||
#include "lock_detectors.h"
|
#include "lock_detectors.h"
|
||||||
|
#include "gnss_sdr_flags.h"
|
||||||
#include "GPS_L1_CA.h"
|
#include "GPS_L1_CA.h"
|
||||||
#include "control_message_factory.h"
|
#include "control_message_factory.h"
|
||||||
|
|
||||||
@ -150,11 +151,11 @@ Gps_L1_Ca_Dll_Pll_Tracking_cc::Gps_L1_Ca_Dll_Pll_Tracking_cc(
|
|||||||
|
|
||||||
// CN0 estimation and lock detector buffers
|
// CN0 estimation and lock detector buffers
|
||||||
d_cn0_estimation_counter = 0;
|
d_cn0_estimation_counter = 0;
|
||||||
d_Prompt_buffer = new gr_complex[GPS_L1_CA_CN0_ESTIMATION_SAMPLES];
|
d_Prompt_buffer = new gr_complex[FLAGS_cn0_samples];
|
||||||
d_carrier_lock_test = 1;
|
d_carrier_lock_test = 1;
|
||||||
d_CN0_SNV_dB_Hz = 0;
|
d_CN0_SNV_dB_Hz = 0;
|
||||||
d_carrier_lock_fail_counter = 0;
|
d_carrier_lock_fail_counter = 0;
|
||||||
d_carrier_lock_threshold = GPS_L1_CA_CARRIER_LOCK_THRESHOLD;
|
d_carrier_lock_threshold = FLAGS_carrier_lock_th;
|
||||||
|
|
||||||
systemName["G"] = std::string("GPS");
|
systemName["G"] = std::string("GPS");
|
||||||
systemName["S"] = std::string("SBAS");
|
systemName["S"] = std::string("SBAS");
|
||||||
@ -609,7 +610,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute__
|
|||||||
d_rem_code_phase_chips = d_code_freq_chips * (d_rem_code_phase_samples / static_cast<double>(d_fs_in));
|
d_rem_code_phase_chips = d_code_freq_chips * (d_rem_code_phase_samples / static_cast<double>(d_fs_in));
|
||||||
|
|
||||||
// ####### CN0 ESTIMATION AND LOCK DETECTORS ######
|
// ####### CN0 ESTIMATION AND LOCK DETECTORS ######
|
||||||
if (d_cn0_estimation_counter < GPS_L1_CA_CN0_ESTIMATION_SAMPLES)
|
if (d_cn0_estimation_counter < FLAGS_cn0_samples)
|
||||||
{
|
{
|
||||||
// fill buffer with prompt correlator output values
|
// fill buffer with prompt correlator output values
|
||||||
d_Prompt_buffer[d_cn0_estimation_counter] = d_correlator_outs[1]; //prompt
|
d_Prompt_buffer[d_cn0_estimation_counter] = d_correlator_outs[1]; //prompt
|
||||||
@ -619,11 +620,11 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute__
|
|||||||
{
|
{
|
||||||
d_cn0_estimation_counter = 0;
|
d_cn0_estimation_counter = 0;
|
||||||
// Code lock indicator
|
// Code lock indicator
|
||||||
d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, GPS_L1_CA_CN0_ESTIMATION_SAMPLES, d_fs_in, GPS_L1_CA_CODE_LENGTH_CHIPS);
|
d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, d_fs_in, GPS_L1_CA_CODE_LENGTH_CHIPS);
|
||||||
// Carrier lock indicator
|
// Carrier lock indicator
|
||||||
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, GPS_L1_CA_CN0_ESTIMATION_SAMPLES);
|
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, FLAGS_cn0_samples);
|
||||||
// Loss of lock detection
|
// Loss of lock detection
|
||||||
if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < GPS_L1_CA_MINIMUM_VALID_CN0)
|
if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < FLAGS_cn0_min)
|
||||||
{
|
{
|
||||||
d_carrier_lock_fail_counter++;
|
d_carrier_lock_fail_counter++;
|
||||||
}
|
}
|
||||||
@ -631,7 +632,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute__
|
|||||||
{
|
{
|
||||||
if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--;
|
if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--;
|
||||||
}
|
}
|
||||||
if (d_carrier_lock_fail_counter > GPS_L1_CA_MAXIMUM_LOCK_FAIL_COUNTER)
|
if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail)
|
||||||
{
|
{
|
||||||
std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl;
|
std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl;
|
||||||
LOG(INFO) << "Loss of lock in channel " << d_channel << "!";
|
LOG(INFO) << "Loss of lock in channel " << d_channel << "!";
|
||||||
|
@ -41,19 +41,11 @@
|
|||||||
#include "lock_detectors.h"
|
#include "lock_detectors.h"
|
||||||
#include "GPS_L1_CA.h"
|
#include "GPS_L1_CA.h"
|
||||||
#include "control_message_factory.h"
|
#include "control_message_factory.h"
|
||||||
|
#include "gnss_sdr_flags.h"
|
||||||
// includes
|
// includes
|
||||||
#include <cuda_profiler_api.h>
|
#include <cuda_profiler_api.h>
|
||||||
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* \todo Include in definition header file
|
|
||||||
*/
|
|
||||||
#define CN0_ESTIMATION_SAMPLES 20
|
|
||||||
#define MINIMUM_VALID_CN0 25
|
|
||||||
#define MAXIMUM_LOCK_FAIL_COUNTER 50
|
|
||||||
#define CARRIER_LOCK_THRESHOLD 0.85
|
|
||||||
|
|
||||||
|
|
||||||
using google::LogMessage;
|
using google::LogMessage;
|
||||||
|
|
||||||
gps_l1_ca_dll_pll_tracking_gpu_cc_sptr
|
gps_l1_ca_dll_pll_tracking_gpu_cc_sptr
|
||||||
@ -155,11 +147,11 @@ Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc(
|
|||||||
|
|
||||||
// CN0 estimation and lock detector buffers
|
// CN0 estimation and lock detector buffers
|
||||||
d_cn0_estimation_counter = 0;
|
d_cn0_estimation_counter = 0;
|
||||||
d_Prompt_buffer = new gr_complex[CN0_ESTIMATION_SAMPLES];
|
d_Prompt_buffer = new gr_complex[FLAGS_cn0_samples];
|
||||||
d_carrier_lock_test = 1;
|
d_carrier_lock_test = 1;
|
||||||
d_CN0_SNV_dB_Hz = 0;
|
d_CN0_SNV_dB_Hz = 0;
|
||||||
d_carrier_lock_fail_counter = 0;
|
d_carrier_lock_fail_counter = 0;
|
||||||
d_carrier_lock_threshold = CARRIER_LOCK_THRESHOLD;
|
d_carrier_lock_threshold = FLAGS_carrier_lock_th;
|
||||||
|
|
||||||
systemName["G"] = std::string("GPS");
|
systemName["G"] = std::string("GPS");
|
||||||
systemName["S"] = std::string("SBAS");
|
systemName["S"] = std::string("SBAS");
|
||||||
@ -413,7 +405,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work (int noutput_items __attribu
|
|||||||
d_rem_code_phase_chips = d_rem_code_phase_samples * (d_code_freq_chips / static_cast<double>(d_fs_in));
|
d_rem_code_phase_chips = d_rem_code_phase_samples * (d_code_freq_chips / static_cast<double>(d_fs_in));
|
||||||
|
|
||||||
// ####### CN0 ESTIMATION AND LOCK DETECTORS #######################################
|
// ####### CN0 ESTIMATION AND LOCK DETECTORS #######################################
|
||||||
if (d_cn0_estimation_counter < CN0_ESTIMATION_SAMPLES)
|
if (d_cn0_estimation_counter < FLAGS_cn0_samples)
|
||||||
{
|
{
|
||||||
// fill buffer with prompt correlator output values
|
// fill buffer with prompt correlator output values
|
||||||
d_Prompt_buffer[d_cn0_estimation_counter] = d_correlator_outs[1]; //prompt
|
d_Prompt_buffer[d_cn0_estimation_counter] = d_correlator_outs[1]; //prompt
|
||||||
@ -423,11 +415,11 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work (int noutput_items __attribu
|
|||||||
{
|
{
|
||||||
d_cn0_estimation_counter = 0;
|
d_cn0_estimation_counter = 0;
|
||||||
// Code lock indicator
|
// Code lock indicator
|
||||||
d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES, d_fs_in, GPS_L1_CA_CODE_LENGTH_CHIPS);
|
d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, d_fs_in, GPS_L1_CA_CODE_LENGTH_CHIPS);
|
||||||
// Carrier lock indicator
|
// Carrier lock indicator
|
||||||
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES);
|
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, FLAGS_cn0_samples);
|
||||||
// Loss of lock detection
|
// Loss of lock detection
|
||||||
if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < MINIMUM_VALID_CN0)
|
if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < FLAGS_cn0_min)
|
||||||
{
|
{
|
||||||
d_carrier_lock_fail_counter++;
|
d_carrier_lock_fail_counter++;
|
||||||
}
|
}
|
||||||
@ -435,7 +427,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work (int noutput_items __attribu
|
|||||||
{
|
{
|
||||||
if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--;
|
if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--;
|
||||||
}
|
}
|
||||||
if (d_carrier_lock_fail_counter > MAXIMUM_LOCK_FAIL_COUNTER)
|
if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail)
|
||||||
{
|
{
|
||||||
std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl;
|
std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl;
|
||||||
LOG(INFO) << "Loss of lock in channel " << d_channel << "!";
|
LOG(INFO) << "Loss of lock in channel " << d_channel << "!";
|
||||||
|
@ -49,16 +49,10 @@
|
|||||||
#include "lock_detectors.h"
|
#include "lock_detectors.h"
|
||||||
#include "GPS_L1_CA.h"
|
#include "GPS_L1_CA.h"
|
||||||
#include "control_message_factory.h"
|
#include "control_message_factory.h"
|
||||||
|
#include "gnss_sdr_flags.h"
|
||||||
#include "tcp_communication.h"
|
#include "tcp_communication.h"
|
||||||
#include "tcp_packet_data.h"
|
#include "tcp_packet_data.h"
|
||||||
|
|
||||||
/*!
|
|
||||||
* \todo Include in definition header file
|
|
||||||
*/
|
|
||||||
#define CN0_ESTIMATION_SAMPLES 20
|
|
||||||
#define MINIMUM_VALID_CN0 25
|
|
||||||
#define MAXIMUM_LOCK_FAIL_COUNTER 50
|
|
||||||
#define CARRIER_LOCK_THRESHOLD 0.85
|
|
||||||
|
|
||||||
using google::LogMessage;
|
using google::LogMessage;
|
||||||
|
|
||||||
@ -165,11 +159,11 @@ Gps_L1_Ca_Tcp_Connector_Tracking_cc::Gps_L1_Ca_Tcp_Connector_Tracking_cc(
|
|||||||
|
|
||||||
// CN0 estimation and lock detector buffers
|
// CN0 estimation and lock detector buffers
|
||||||
d_cn0_estimation_counter = 0;
|
d_cn0_estimation_counter = 0;
|
||||||
d_Prompt_buffer = new gr_complex[CN0_ESTIMATION_SAMPLES];
|
d_Prompt_buffer = new gr_complex[FLAGS_cn0_samples];
|
||||||
d_carrier_lock_test = 1;
|
d_carrier_lock_test = 1;
|
||||||
d_CN0_SNV_dB_Hz = 0;
|
d_CN0_SNV_dB_Hz = 0;
|
||||||
d_carrier_lock_fail_counter = 0;
|
d_carrier_lock_fail_counter = 0;
|
||||||
d_carrier_lock_threshold = CARRIER_LOCK_THRESHOLD;
|
d_carrier_lock_threshold = FLAGS_carrier_lock_th;
|
||||||
|
|
||||||
systemName["G"] = std::string("GPS");
|
systemName["G"] = std::string("GPS");
|
||||||
systemName["R"] = std::string("GLONASS");
|
systemName["R"] = std::string("GLONASS");
|
||||||
@ -419,7 +413,7 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attri
|
|||||||
* \todo Improve the lock detection algorithm!
|
* \todo Improve the lock detection algorithm!
|
||||||
*/
|
*/
|
||||||
// ####### CN0 ESTIMATION AND LOCK DETECTORS ######
|
// ####### CN0 ESTIMATION AND LOCK DETECTORS ######
|
||||||
if (d_cn0_estimation_counter < CN0_ESTIMATION_SAMPLES)
|
if (d_cn0_estimation_counter < FLAGS_cn0_samples)
|
||||||
{
|
{
|
||||||
// fill buffer with prompt correlator output values
|
// fill buffer with prompt correlator output values
|
||||||
d_Prompt_buffer[d_cn0_estimation_counter] = *d_Prompt;
|
d_Prompt_buffer[d_cn0_estimation_counter] = *d_Prompt;
|
||||||
@ -428,11 +422,11 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attri
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
d_cn0_estimation_counter = 0;
|
d_cn0_estimation_counter = 0;
|
||||||
d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES, d_fs_in, GPS_L1_CA_CODE_LENGTH_CHIPS);
|
d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, d_fs_in, GPS_L1_CA_CODE_LENGTH_CHIPS);
|
||||||
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES);
|
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, FLAGS_cn0_samples);
|
||||||
|
|
||||||
// ###### TRACKING UNLOCK NOTIFICATION #####
|
// ###### TRACKING UNLOCK NOTIFICATION #####
|
||||||
if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < MINIMUM_VALID_CN0)
|
if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < FLAGS_cn0_min)
|
||||||
{
|
{
|
||||||
d_carrier_lock_fail_counter++;
|
d_carrier_lock_fail_counter++;
|
||||||
}
|
}
|
||||||
@ -440,7 +434,7 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attri
|
|||||||
{
|
{
|
||||||
if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--;
|
if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--;
|
||||||
}
|
}
|
||||||
if (d_carrier_lock_fail_counter > MAXIMUM_LOCK_FAIL_COUNTER)
|
if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail)
|
||||||
{
|
{
|
||||||
std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl;
|
std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl;
|
||||||
LOG(INFO) << "Loss of lock in channel " << d_channel << "!";
|
LOG(INFO) << "Loss of lock in channel " << d_channel << "!";
|
||||||
|
@ -49,6 +49,7 @@
|
|||||||
#include "lock_detectors.h"
|
#include "lock_detectors.h"
|
||||||
#include "GPS_L2C.h"
|
#include "GPS_L2C.h"
|
||||||
#include "control_message_factory.h"
|
#include "control_message_factory.h"
|
||||||
|
#include "gnss_sdr_flags.h"
|
||||||
|
|
||||||
using google::LogMessage;
|
using google::LogMessage;
|
||||||
|
|
||||||
@ -150,11 +151,11 @@ gps_l2_m_dll_pll_tracking_cc::gps_l2_m_dll_pll_tracking_cc(
|
|||||||
|
|
||||||
// CN0 estimation and lock detector buffers
|
// CN0 estimation and lock detector buffers
|
||||||
d_cn0_estimation_counter = 0;
|
d_cn0_estimation_counter = 0;
|
||||||
d_Prompt_buffer = new gr_complex[GPS_L2M_CN0_ESTIMATION_SAMPLES];
|
d_Prompt_buffer = new gr_complex[FLAGS_cn0_samples];
|
||||||
d_carrier_lock_test = 1;
|
d_carrier_lock_test = 1;
|
||||||
d_CN0_SNV_dB_Hz = 0;
|
d_CN0_SNV_dB_Hz = 0;
|
||||||
d_carrier_lock_fail_counter = 0;
|
d_carrier_lock_fail_counter = 0;
|
||||||
d_carrier_lock_threshold = GPS_L2M_CARRIER_LOCK_THRESHOLD;
|
d_carrier_lock_threshold = FLAGS_carrier_lock_th;
|
||||||
|
|
||||||
systemName["G"] = std::string("GPS");
|
systemName["G"] = std::string("GPS");
|
||||||
|
|
||||||
@ -603,7 +604,7 @@ int gps_l2_m_dll_pll_tracking_cc::general_work (int noutput_items __attribute__(
|
|||||||
d_rem_code_phase_chips = d_code_freq_chips * (d_rem_code_phase_samples / static_cast<double>(d_fs_in));
|
d_rem_code_phase_chips = d_code_freq_chips * (d_rem_code_phase_samples / static_cast<double>(d_fs_in));
|
||||||
|
|
||||||
// ####### CN0 ESTIMATION AND LOCK DETECTORS ######
|
// ####### CN0 ESTIMATION AND LOCK DETECTORS ######
|
||||||
if (d_cn0_estimation_counter < GPS_L2M_CN0_ESTIMATION_SAMPLES)
|
if (d_cn0_estimation_counter < FLAGS_cn0_samples)
|
||||||
{
|
{
|
||||||
// fill buffer with prompt correlator output values
|
// fill buffer with prompt correlator output values
|
||||||
d_Prompt_buffer[d_cn0_estimation_counter] = d_correlator_outs[1];
|
d_Prompt_buffer[d_cn0_estimation_counter] = d_correlator_outs[1];
|
||||||
@ -613,11 +614,11 @@ int gps_l2_m_dll_pll_tracking_cc::general_work (int noutput_items __attribute__(
|
|||||||
{
|
{
|
||||||
d_cn0_estimation_counter = 0;
|
d_cn0_estimation_counter = 0;
|
||||||
// Code lock indicator
|
// Code lock indicator
|
||||||
d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, GPS_L2M_CN0_ESTIMATION_SAMPLES, d_fs_in, GPS_L2_M_CODE_LENGTH_CHIPS);
|
d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, d_fs_in, GPS_L2_M_CODE_LENGTH_CHIPS);
|
||||||
// Carrier lock indicator
|
// Carrier lock indicator
|
||||||
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, GPS_L2M_CN0_ESTIMATION_SAMPLES);
|
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, FLAGS_cn0_samples);
|
||||||
// Loss of lock detection
|
// Loss of lock detection
|
||||||
if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < GPS_L2M_MINIMUM_VALID_CN0)
|
if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < FLAGS_cn0_min)
|
||||||
{
|
{
|
||||||
d_carrier_lock_fail_counter++;
|
d_carrier_lock_fail_counter++;
|
||||||
}
|
}
|
||||||
@ -625,7 +626,7 @@ int gps_l2_m_dll_pll_tracking_cc::general_work (int noutput_items __attribute__(
|
|||||||
{
|
{
|
||||||
if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--;
|
if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--;
|
||||||
}
|
}
|
||||||
if (d_carrier_lock_fail_counter > GPS_L2M_MAXIMUM_LOCK_FAIL_COUNTER)
|
if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail)
|
||||||
{
|
{
|
||||||
std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl;
|
std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl;
|
||||||
LOG(INFO) << "Loss of lock in channel " << d_channel << "!";
|
LOG(INFO) << "Loss of lock in channel " << d_channel << "!";
|
||||||
|
@ -49,6 +49,7 @@
|
|||||||
#include "lock_detectors.h"
|
#include "lock_detectors.h"
|
||||||
#include "GPS_L5.h"
|
#include "GPS_L5.h"
|
||||||
#include "control_message_factory.h"
|
#include "control_message_factory.h"
|
||||||
|
#include "gnss_sdr_flags.h"
|
||||||
|
|
||||||
using google::LogMessage;
|
using google::LogMessage;
|
||||||
|
|
||||||
@ -150,11 +151,11 @@ gps_l5i_dll_pll_tracking_cc::gps_l5i_dll_pll_tracking_cc(
|
|||||||
|
|
||||||
// CN0 estimation and lock detector buffers
|
// CN0 estimation and lock detector buffers
|
||||||
d_cn0_estimation_counter = 0;
|
d_cn0_estimation_counter = 0;
|
||||||
d_Prompt_buffer = new gr_complex[GPS_L5_CN0_ESTIMATION_SAMPLES];
|
d_Prompt_buffer = new gr_complex[FLAGS_cn0_samples];
|
||||||
d_carrier_lock_test = 1;
|
d_carrier_lock_test = 1;
|
||||||
d_CN0_SNV_dB_Hz = 0;
|
d_CN0_SNV_dB_Hz = 0;
|
||||||
d_carrier_lock_fail_counter = 0;
|
d_carrier_lock_fail_counter = 0;
|
||||||
d_carrier_lock_threshold = GPS_L5_CARRIER_LOCK_THRESHOLD;
|
d_carrier_lock_threshold = FLAGS_carrier_lock_th;
|
||||||
|
|
||||||
systemName["G"] = std::string("GPS");
|
systemName["G"] = std::string("GPS");
|
||||||
|
|
||||||
@ -603,7 +604,7 @@ int gps_l5i_dll_pll_tracking_cc::general_work (int noutput_items __attribute__((
|
|||||||
d_rem_code_phase_chips = d_code_freq_chips * (d_rem_code_phase_samples / static_cast<double>(d_fs_in));
|
d_rem_code_phase_chips = d_code_freq_chips * (d_rem_code_phase_samples / static_cast<double>(d_fs_in));
|
||||||
|
|
||||||
// ####### CN0 ESTIMATION AND LOCK DETECTORS ######
|
// ####### CN0 ESTIMATION AND LOCK DETECTORS ######
|
||||||
if (d_cn0_estimation_counter < GPS_L5_CN0_ESTIMATION_SAMPLES)
|
if (d_cn0_estimation_counter < FLAGS_cn0_samples)
|
||||||
{
|
{
|
||||||
// fill buffer with prompt correlator output values
|
// fill buffer with prompt correlator output values
|
||||||
d_Prompt_buffer[d_cn0_estimation_counter] = d_correlator_outs[1];
|
d_Prompt_buffer[d_cn0_estimation_counter] = d_correlator_outs[1];
|
||||||
@ -613,11 +614,11 @@ int gps_l5i_dll_pll_tracking_cc::general_work (int noutput_items __attribute__((
|
|||||||
{
|
{
|
||||||
d_cn0_estimation_counter = 0;
|
d_cn0_estimation_counter = 0;
|
||||||
// Code lock indicator
|
// Code lock indicator
|
||||||
d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, GPS_L5_CN0_ESTIMATION_SAMPLES, d_fs_in, GPS_L5i_CODE_LENGTH_CHIPS);
|
d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, d_fs_in, GPS_L5i_CODE_LENGTH_CHIPS);
|
||||||
// Carrier lock indicator
|
// Carrier lock indicator
|
||||||
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, GPS_L5_CN0_ESTIMATION_SAMPLES);
|
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, FLAGS_cn0_samples);
|
||||||
// Loss of lock detection
|
// Loss of lock detection
|
||||||
if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < GPS_L5_MINIMUM_VALID_CN0)
|
if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < FLAGS_cn0_min)
|
||||||
{
|
{
|
||||||
d_carrier_lock_fail_counter++;
|
d_carrier_lock_fail_counter++;
|
||||||
}
|
}
|
||||||
@ -625,7 +626,7 @@ int gps_l5i_dll_pll_tracking_cc::general_work (int noutput_items __attribute__((
|
|||||||
{
|
{
|
||||||
if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--;
|
if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--;
|
||||||
}
|
}
|
||||||
if (d_carrier_lock_fail_counter > GPS_L5_MAXIMUM_LOCK_FAIL_COUNTER)
|
if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail)
|
||||||
{
|
{
|
||||||
std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl;
|
std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl;
|
||||||
LOG(INFO) << "Loss of lock in channel " << d_channel << "!";
|
LOG(INFO) << "Loss of lock in channel " << d_channel << "!";
|
||||||
|
@ -37,11 +37,6 @@
|
|||||||
#include "MATH_CONSTANTS.h"
|
#include "MATH_CONSTANTS.h"
|
||||||
#include "gnss_frequencies.h"
|
#include "gnss_frequencies.h"
|
||||||
|
|
||||||
#define GPS_L1_CA_CN0_ESTIMATION_SAMPLES 20
|
|
||||||
#define GPS_L1_CA_MINIMUM_VALID_CN0 25
|
|
||||||
#define GPS_L1_CA_MAXIMUM_LOCK_FAIL_COUNTER 50
|
|
||||||
#define GPS_L1_CA_CARRIER_LOCK_THRESHOLD 0.85
|
|
||||||
|
|
||||||
// Physical constants
|
// Physical constants
|
||||||
const double GPS_C_m_s = SPEED_OF_LIGHT; //!< The speed of light, [m/s]
|
const double GPS_C_m_s = SPEED_OF_LIGHT; //!< The speed of light, [m/s]
|
||||||
const double GPS_C_m_ms = 299792.4580; //!< The speed of light, [m/ms]
|
const double GPS_C_m_ms = 299792.4580; //!< The speed of light, [m/ms]
|
||||||
|
@ -40,10 +40,7 @@
|
|||||||
#include "GPS_CNAV.h"
|
#include "GPS_CNAV.h"
|
||||||
|
|
||||||
|
|
||||||
#define GPS_L2M_CN0_ESTIMATION_SAMPLES 10
|
|
||||||
#define GPS_L2M_MINIMUM_VALID_CN0 25
|
|
||||||
#define GPS_L2M_MAXIMUM_LOCK_FAIL_COUNTER 50
|
|
||||||
#define GPS_L2M_CARRIER_LOCK_THRESHOLD 0.75
|
|
||||||
|
|
||||||
|
|
||||||
// Physical constants
|
// Physical constants
|
||||||
|
@ -37,10 +37,6 @@
|
|||||||
#include "gnss_frequencies.h"
|
#include "gnss_frequencies.h"
|
||||||
#include "GPS_CNAV.h"
|
#include "GPS_CNAV.h"
|
||||||
|
|
||||||
#define GPS_L5_CN0_ESTIMATION_SAMPLES 10
|
|
||||||
#define GPS_L5_MINIMUM_VALID_CN0 25
|
|
||||||
#define GPS_L5_MAXIMUM_LOCK_FAIL_COUNTER 50
|
|
||||||
#define GPS_L5_CARRIER_LOCK_THRESHOLD 0.75
|
|
||||||
|
|
||||||
// Physical constants
|
// Physical constants
|
||||||
const double GPS_L5_C_m_s = 299792458.0; //!< The speed of light, [m/s]
|
const double GPS_L5_C_m_s = 299792458.0; //!< The speed of light, [m/s]
|
||||||
|
@ -39,10 +39,6 @@
|
|||||||
#include "MATH_CONSTANTS.h"
|
#include "MATH_CONSTANTS.h"
|
||||||
#include "gnss_frequencies.h"
|
#include "gnss_frequencies.h"
|
||||||
|
|
||||||
#define GALILEO_E1_CN0_ESTIMATION_SAMPLES 20
|
|
||||||
#define GALILEO_E1_MINIMUM_VALID_CN0 25
|
|
||||||
#define GALILEO_E1_MAXIMUM_LOCK_FAIL_COUNTER 50
|
|
||||||
#define GALILEO_E1_CARRIER_LOCK_THRESHOLD 0.85
|
|
||||||
|
|
||||||
// Physical constants
|
// Physical constants
|
||||||
const double GALILEO_PI = 3.1415926535898; //!< Pi as defined in GALILEO ICD
|
const double GALILEO_PI = 3.1415926535898; //!< Pi as defined in GALILEO ICD
|
||||||
|
@ -37,11 +37,6 @@
|
|||||||
#include "MATH_CONSTANTS.h"
|
#include "MATH_CONSTANTS.h"
|
||||||
#include "gnss_frequencies.h"
|
#include "gnss_frequencies.h"
|
||||||
|
|
||||||
#define GALILEO_E5A_CN0_ESTIMATION_SAMPLES 20
|
|
||||||
#define GALILEO_E5A_MINIMUM_VALID_CN0 25
|
|
||||||
#define GALILEO_E5A_MAXIMUM_LOCK_FAIL_COUNTER 50
|
|
||||||
#define GALILEO_E5A_CARRIER_LOCK_THRESHOLD 0.85
|
|
||||||
|
|
||||||
|
|
||||||
// Carrier and code frequencies
|
// Carrier and code frequencies
|
||||||
const double Galileo_E5a_FREQ_HZ = FREQ5; //!< Galileo E5a carrier frequency [Hz]
|
const double Galileo_E5a_FREQ_HZ = FREQ5; //!< Galileo E5a carrier frequency [Hz]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user