1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-11-04 00:56:23 +00:00

Merge branch 'next' of https://github.com/gnss-sdr/gnss-sdr into next

This commit is contained in:
Carles Fernandez 2019-09-16 23:53:43 +02:00
commit ed3480ebe3
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
18 changed files with 116 additions and 46 deletions

View File

@ -52,7 +52,7 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga(
Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga(); Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga();
DLOG(INFO) << "role " << role; DLOG(INFO) << "role " << role;
//################# CONFIGURATION PARAMETERS ######################## //################# CONFIGURATION PARAMETERS ########################
int32_t fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); int32_t fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 12500000);
int32_t fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); int32_t fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
trk_param_fpga.fs_in = fs_in; trk_param_fpga.fs_in = fs_in;
bool dump = configuration->property(role + ".dump", false); bool dump = configuration->property(role + ".dump", false);
@ -130,7 +130,7 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga(
trk_param_fpga.enable_fll_steady_state = enable_fll_steady_state; trk_param_fpga.enable_fll_steady_state = enable_fll_steady_state;
float fll_bw_hz = configuration->property(role + ".fll_bw_hz", 35.0); float fll_bw_hz = configuration->property(role + ".fll_bw_hz", 35.0);
trk_param_fpga.fll_bw_hz = fll_bw_hz; trk_param_fpga.fll_bw_hz = fll_bw_hz;
float pull_in_time_s = configuration->property(role + ".pull_in_time_s", 2.0); float pull_in_time_s = configuration->property(role + ".pull_in_time_s", trk_param_fpga.pull_in_time_s);
trk_param_fpga.pull_in_time_s = pull_in_time_s; trk_param_fpga.pull_in_time_s = pull_in_time_s;
int32_t extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", 1); int32_t extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", 1);
@ -171,6 +171,12 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga(
trk_param_fpga.max_carrier_lock_fail = configuration->property(role + ".max_carrier_lock_fail", trk_param_fpga.max_carrier_lock_fail); trk_param_fpga.max_carrier_lock_fail = configuration->property(role + ".max_carrier_lock_fail", trk_param_fpga.max_carrier_lock_fail);
trk_param_fpga.carrier_lock_th = configuration->property(role + ".carrier_lock_th", trk_param_fpga.carrier_lock_th); trk_param_fpga.carrier_lock_th = configuration->property(role + ".carrier_lock_th", trk_param_fpga.carrier_lock_th);
// tracking lock tests smoother parameters
trk_param_fpga.cn0_smoother_samples = configuration->property(role + ".cn0_smoother_samples", trk_param_fpga.cn0_smoother_samples);
trk_param_fpga.cn0_smoother_alpha = configuration->property(role + ".cn0_smoother_alpha", trk_param_fpga.cn0_smoother_alpha);
trk_param_fpga.carrier_lock_test_smoother_samples = configuration->property(role + ".carrier_lock_test_smoother_samples", trk_param_fpga.carrier_lock_test_smoother_samples);
trk_param_fpga.carrier_lock_test_smoother_alpha = configuration->property(role + ".carrier_lock_test_smoother_alpha", trk_param_fpga.carrier_lock_test_smoother_alpha);
// FPGA configuration parameters // FPGA configuration parameters
std::string default_device_name = "/dev/uio"; std::string default_device_name = "/dev/uio";
std::string device_name = configuration->property(role + ".devicename", default_device_name); std::string device_name = configuration->property(role + ".devicename", default_device_name);
@ -255,12 +261,6 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga(
trk_param_fpga.extend_fpga_integration_periods = 1; // (number of FPGA integrations that are combined in the SW) trk_param_fpga.extend_fpga_integration_periods = 1; // (number of FPGA integrations that are combined in the SW)
trk_param_fpga.fpga_integration_period = 1; // (number of symbols that are effectively integrated in the FPGA) trk_param_fpga.fpga_integration_period = 1; // (number of symbols that are effectively integrated in the FPGA)
// tracking lock tests smoother parameters
trk_param_fpga.cn0_smoother_samples = configuration->property(role + ".cn0_smoother_samples", trk_param_fpga.cn0_smoother_samples);
trk_param_fpga.cn0_smoother_alpha = configuration->property(role + ".cn0_smoother_alpha", trk_param_fpga.cn0_smoother_alpha);
trk_param_fpga.carrier_lock_test_smoother_samples = configuration->property(role + ".carrier_lock_test_smoother_samples", trk_param_fpga.carrier_lock_test_smoother_samples);
trk_param_fpga.carrier_lock_test_smoother_alpha = configuration->property(role + ".carrier_lock_test_smoother_alpha", trk_param_fpga.carrier_lock_test_smoother_alpha);
//################# MAKE TRACKING GNURadio object ################### //################# MAKE TRACKING GNURadio object ###################
tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_param_fpga); tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_param_fpga);
channel_ = 0; channel_ = 0;

View File

@ -47,7 +47,7 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga(
Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga(); Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga();
DLOG(INFO) << "role " << role; DLOG(INFO) << "role " << role;
// ################# CONFIGURATION PARAMETERS ######################## // ################# CONFIGURATION PARAMETERS ########################
int32_t fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 12000000); int32_t fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 12500000);
int32_t fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); int32_t fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
trk_param_fpga.fs_in = fs_in; trk_param_fpga.fs_in = fs_in;
bool dump = configuration->property(role + ".dump", false); bool dump = configuration->property(role + ".dump", false);
@ -121,7 +121,7 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga(
trk_param_fpga.enable_fll_steady_state = enable_fll_steady_state; trk_param_fpga.enable_fll_steady_state = enable_fll_steady_state;
float fll_bw_hz = configuration->property(role + ".fll_bw_hz", 35.0); float fll_bw_hz = configuration->property(role + ".fll_bw_hz", 35.0);
trk_param_fpga.fll_bw_hz = fll_bw_hz; trk_param_fpga.fll_bw_hz = fll_bw_hz;
float pull_in_time_s = configuration->property(role + ".pull_in_time_s", 2.0); float pull_in_time_s = configuration->property(role + ".pull_in_time_s", trk_param_fpga.pull_in_time_s);
trk_param_fpga.pull_in_time_s = pull_in_time_s; trk_param_fpga.pull_in_time_s = pull_in_time_s;
float pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz", 5.0); float pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz", 5.0);
@ -133,7 +133,7 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga(
int32_t vector_length = std::round(fs_in / (GALILEO_E5A_CODE_CHIP_RATE_CPS / GALILEO_E5A_CODE_LENGTH_CHIPS)); int32_t vector_length = std::round(fs_in / (GALILEO_E5A_CODE_CHIP_RATE_CPS / GALILEO_E5A_CODE_LENGTH_CHIPS));
trk_param_fpga.vector_length = vector_length; trk_param_fpga.vector_length = vector_length;
int32_t extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", 1); int32_t extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", 1);
float early_late_space_narrow_chips = configuration->property(role + ".early_late_space_narrow_chips", 0.15); float early_late_space_narrow_chips = configuration->property(role + ".early_late_space_narrow_chips", 0.5);
trk_param_fpga.early_late_space_narrow_chips = early_late_space_narrow_chips; trk_param_fpga.early_late_space_narrow_chips = early_late_space_narrow_chips;
bool track_pilot = configuration->property(role + ".track_pilot", false); bool track_pilot = configuration->property(role + ".track_pilot", false);
d_track_pilot = track_pilot; d_track_pilot = track_pilot;
@ -164,6 +164,12 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga(
trk_param_fpga.max_carrier_lock_fail = configuration->property(role + ".max_carrier_lock_fail", trk_param_fpga.max_carrier_lock_fail); trk_param_fpga.max_carrier_lock_fail = configuration->property(role + ".max_carrier_lock_fail", trk_param_fpga.max_carrier_lock_fail);
trk_param_fpga.carrier_lock_th = configuration->property(role + ".carrier_lock_th", trk_param_fpga.carrier_lock_th); trk_param_fpga.carrier_lock_th = configuration->property(role + ".carrier_lock_th", trk_param_fpga.carrier_lock_th);
// tracking lock tests smoother parameters
trk_param_fpga.cn0_smoother_samples = configuration->property(role + ".cn0_smoother_samples", trk_param_fpga.cn0_smoother_samples);
trk_param_fpga.cn0_smoother_alpha = configuration->property(role + ".cn0_smoother_alpha", trk_param_fpga.cn0_smoother_alpha);
trk_param_fpga.carrier_lock_test_smoother_samples = configuration->property(role + ".carrier_lock_test_smoother_samples", trk_param_fpga.carrier_lock_test_smoother_samples);
trk_param_fpga.carrier_lock_test_smoother_alpha = configuration->property(role + ".carrier_lock_test_smoother_alpha", trk_param_fpga.carrier_lock_test_smoother_alpha);
d_data_codes = nullptr; d_data_codes = nullptr;
// FPGA configuration parameters // FPGA configuration parameters
@ -262,12 +268,6 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga(
} }
} }
// tracking lock tests smoother parameters
trk_param_fpga.cn0_smoother_samples = configuration->property(role + ".cn0_smoother_samples", trk_param_fpga.cn0_smoother_samples);
trk_param_fpga.cn0_smoother_alpha = configuration->property(role + ".cn0_smoother_alpha", trk_param_fpga.cn0_smoother_alpha);
trk_param_fpga.carrier_lock_test_smoother_samples = configuration->property(role + ".carrier_lock_test_smoother_samples", trk_param_fpga.carrier_lock_test_smoother_samples);
trk_param_fpga.carrier_lock_test_smoother_alpha = configuration->property(role + ".carrier_lock_test_smoother_alpha", trk_param_fpga.carrier_lock_test_smoother_alpha);
// ################# MAKE TRACKING GNURadio object ################### // ################# MAKE TRACKING GNURadio object ###################
tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_param_fpga); tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_param_fpga);
channel_ = 0; channel_ = 0;

View File

@ -52,7 +52,7 @@ GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga(
Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga(); Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga();
DLOG(INFO) << "role " << role; DLOG(INFO) << "role " << role;
// ################# CONFIGURATION PARAMETERS ######################## // ################# CONFIGURATION PARAMETERS ########################
int32_t fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); int32_t fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 12500000);
int32_t fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); int32_t fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
trk_param_fpga.fs_in = fs_in; trk_param_fpga.fs_in = fs_in;
trk_param_fpga.high_dyn = configuration->property(role + ".high_dyn", false); trk_param_fpga.high_dyn = configuration->property(role + ".high_dyn", false);
@ -130,7 +130,7 @@ GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga(
trk_param_fpga.enable_fll_steady_state = enable_fll_steady_state; trk_param_fpga.enable_fll_steady_state = enable_fll_steady_state;
float fll_bw_hz = configuration->property(role + ".fll_bw_hz", 35.0); float fll_bw_hz = configuration->property(role + ".fll_bw_hz", 35.0);
trk_param_fpga.fll_bw_hz = fll_bw_hz; trk_param_fpga.fll_bw_hz = fll_bw_hz;
float pull_in_time_s = configuration->property(role + ".pull_in_time_s", 2.0); float pull_in_time_s = configuration->property(role + ".pull_in_time_s", trk_param_fpga.pull_in_time_s);
trk_param_fpga.pull_in_time_s = pull_in_time_s; trk_param_fpga.pull_in_time_s = pull_in_time_s;
float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5);
@ -172,6 +172,12 @@ GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga(
trk_param_fpga.max_carrier_lock_fail = configuration->property(role + ".max_carrier_lock_fail", trk_param_fpga.max_carrier_lock_fail); trk_param_fpga.max_carrier_lock_fail = configuration->property(role + ".max_carrier_lock_fail", trk_param_fpga.max_carrier_lock_fail);
trk_param_fpga.carrier_lock_th = configuration->property(role + ".carrier_lock_th", trk_param_fpga.carrier_lock_th); trk_param_fpga.carrier_lock_th = configuration->property(role + ".carrier_lock_th", trk_param_fpga.carrier_lock_th);
// tracking lock tests smoother parameters
trk_param_fpga.cn0_smoother_samples = configuration->property(role + ".cn0_smoother_samples", trk_param_fpga.cn0_smoother_samples);
trk_param_fpga.cn0_smoother_alpha = configuration->property(role + ".cn0_smoother_alpha", trk_param_fpga.cn0_smoother_alpha);
trk_param_fpga.carrier_lock_test_smoother_samples = configuration->property(role + ".carrier_lock_test_smoother_samples", trk_param_fpga.carrier_lock_test_smoother_samples);
trk_param_fpga.carrier_lock_test_smoother_alpha = configuration->property(role + ".carrier_lock_test_smoother_alpha", trk_param_fpga.carrier_lock_test_smoother_alpha);
// FPGA configuration parameters // FPGA configuration parameters
std::string default_device_name = "/dev/uio"; std::string default_device_name = "/dev/uio";
std::string device_name = configuration->property(role + ".devicename", default_device_name); std::string device_name = configuration->property(role + ".devicename", default_device_name);
@ -216,12 +222,6 @@ GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga(
} }
} }
// tracking lock tests smoother parameters
trk_param_fpga.cn0_smoother_samples = configuration->property(role + ".cn0_smoother_samples", trk_param_fpga.cn0_smoother_samples);
trk_param_fpga.cn0_smoother_alpha = configuration->property(role + ".cn0_smoother_alpha", trk_param_fpga.cn0_smoother_alpha);
trk_param_fpga.carrier_lock_test_smoother_samples = configuration->property(role + ".carrier_lock_test_smoother_samples", trk_param_fpga.carrier_lock_test_smoother_samples);
trk_param_fpga.carrier_lock_test_smoother_alpha = configuration->property(role + ".carrier_lock_test_smoother_alpha", trk_param_fpga.carrier_lock_test_smoother_alpha);
// ################# MAKE TRACKING GNURadio object ################### // ################# MAKE TRACKING GNURadio object ###################
tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_param_fpga); tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_param_fpga);
channel_ = 0; channel_ = 0;

View File

@ -134,13 +134,13 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga(
trk_param_fpga.enable_fll_steady_state = enable_fll_steady_state; trk_param_fpga.enable_fll_steady_state = enable_fll_steady_state;
float fll_bw_hz = configuration->property(role + ".fll_bw_hz", 35.0); float fll_bw_hz = configuration->property(role + ".fll_bw_hz", 35.0);
trk_param_fpga.fll_bw_hz = fll_bw_hz; trk_param_fpga.fll_bw_hz = fll_bw_hz;
float pull_in_time_s = configuration->property(role + ".pull_in_time_s", 2.0); float pull_in_time_s = configuration->property(role + ".pull_in_time_s", trk_param_fpga.pull_in_time_s);
trk_param_fpga.pull_in_time_s = pull_in_time_s; trk_param_fpga.pull_in_time_s = pull_in_time_s;
int32_t vector_length = std::round(static_cast<double>(fs_in) / (static_cast<double>(GPS_L5I_CODE_RATE_CPS) / static_cast<double>(GPS_L5I_CODE_LENGTH_CHIPS))); int32_t vector_length = std::round(static_cast<double>(fs_in) / (static_cast<double>(GPS_L5I_CODE_RATE_CPS) / static_cast<double>(GPS_L5I_CODE_LENGTH_CHIPS)));
trk_param_fpga.vector_length = vector_length; trk_param_fpga.vector_length = vector_length;
int32_t extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", 1); int32_t extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", 1);
float early_late_space_narrow_chips = configuration->property(role + ".early_late_space_narrow_chips", 0.15); float early_late_space_narrow_chips = configuration->property(role + ".early_late_space_narrow_chips", 0.5);
trk_param_fpga.early_late_space_narrow_chips = early_late_space_narrow_chips; trk_param_fpga.early_late_space_narrow_chips = early_late_space_narrow_chips;
bool track_pilot = configuration->property(role + ".track_pilot", false); bool track_pilot = configuration->property(role + ".track_pilot", false);
if (extend_correlation_symbols < 1) if (extend_correlation_symbols < 1)
@ -178,6 +178,12 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga(
int32_t device_base = configuration->property(role + ".device_base", 27); int32_t device_base = configuration->property(role + ".device_base", 27);
trk_param_fpga.device_base = device_base; trk_param_fpga.device_base = device_base;
// tracking lock tests smoother parameters
trk_param_fpga.cn0_smoother_samples = configuration->property(role + ".cn0_smoother_samples", trk_param_fpga.cn0_smoother_samples);
trk_param_fpga.cn0_smoother_alpha = configuration->property(role + ".cn0_smoother_alpha", trk_param_fpga.cn0_smoother_alpha);
trk_param_fpga.carrier_lock_test_smoother_samples = configuration->property(role + ".carrier_lock_test_smoother_samples", trk_param_fpga.carrier_lock_test_smoother_samples);
trk_param_fpga.carrier_lock_test_smoother_alpha = configuration->property(role + ".carrier_lock_test_smoother_alpha", trk_param_fpga.carrier_lock_test_smoother_alpha);
// ################# PRE-COMPUTE ALL THE CODES ################# // ################# PRE-COMPUTE ALL THE CODES #################
uint32_t code_samples_per_chip = 1; uint32_t code_samples_per_chip = 1;
auto code_length_chips = static_cast<uint32_t>(GPS_L5I_CODE_LENGTH_CHIPS); auto code_length_chips = static_cast<uint32_t>(GPS_L5I_CODE_LENGTH_CHIPS);
@ -286,12 +292,6 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga(
} }
} }
// tracking lock tests smoother parameters
trk_param_fpga.cn0_smoother_samples = configuration->property(role + ".cn0_smoother_samples", trk_param_fpga.cn0_smoother_samples);
trk_param_fpga.cn0_smoother_alpha = configuration->property(role + ".cn0_smoother_alpha", trk_param_fpga.cn0_smoother_alpha);
trk_param_fpga.carrier_lock_test_smoother_samples = configuration->property(role + ".carrier_lock_test_smoother_samples", trk_param_fpga.carrier_lock_test_smoother_samples);
trk_param_fpga.carrier_lock_test_smoother_alpha = configuration->property(role + ".carrier_lock_test_smoother_alpha", trk_param_fpga.carrier_lock_test_smoother_alpha);
// ################# MAKE TRACKING GNURadio object ################### // ################# MAKE TRACKING GNURadio object ###################
tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_param_fpga); tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_param_fpga);
channel_ = 0; channel_ = 0;

View File

@ -849,7 +849,7 @@ bool dll_pll_veml_tracking::cn0_and_tracking_lock_status(double coh_integration_
d_Prompt_buffer[d_cn0_estimation_counter % trk_parameters.cn0_samples] = d_P_accu; d_Prompt_buffer[d_cn0_estimation_counter % trk_parameters.cn0_samples] = d_P_accu;
d_cn0_estimation_counter++; d_cn0_estimation_counter++;
// Code lock indicator // Code lock indicator
float d_CN0_SNV_dB_Hz_raw = cn0_svn_estimator(d_Prompt_buffer.data(), trk_parameters.cn0_samples, static_cast<float>(coh_integration_time_s)); float d_CN0_SNV_dB_Hz_raw = cn0_mm_estimator(d_Prompt_buffer.data(), trk_parameters.cn0_samples, static_cast<float>(coh_integration_time_s));
d_CN0_SNV_dB_Hz = d_cn0_smoother.smooth(d_CN0_SNV_dB_Hz_raw); d_CN0_SNV_dB_Hz = d_cn0_smoother.smooth(d_CN0_SNV_dB_Hz_raw);
// Carrier lock indicator // Carrier lock indicator
d_carrier_lock_test = d_carrier_lock_test_smoother.smooth(carrier_lock_detector(d_Prompt_buffer.data(), 1)); d_carrier_lock_test = d_carrier_lock_test_smoother.smooth(carrier_lock_detector(d_Prompt_buffer.data(), 1));

View File

@ -607,7 +607,7 @@ bool dll_pll_veml_tracking_fpga::cn0_and_tracking_lock_status(double coh_integra
d_Prompt_buffer[d_cn0_estimation_counter % trk_parameters.cn0_samples] = d_P_accu; d_Prompt_buffer[d_cn0_estimation_counter % trk_parameters.cn0_samples] = d_P_accu;
d_cn0_estimation_counter++; d_cn0_estimation_counter++;
// Code lock indicator // Code lock indicator
float d_CN0_SNV_dB_Hz_raw = cn0_svn_estimator(d_Prompt_buffer.data(), trk_parameters.cn0_samples, static_cast<float>(coh_integration_time_s)); float d_CN0_SNV_dB_Hz_raw = cn0_mm_estimator(d_Prompt_buffer.data(), trk_parameters.cn0_samples, static_cast<float>(coh_integration_time_s));
d_CN0_SNV_dB_Hz = d_cn0_smoother.smooth(d_CN0_SNV_dB_Hz_raw); d_CN0_SNV_dB_Hz = d_cn0_smoother.smooth(d_CN0_SNV_dB_Hz_raw);
// Carrier lock indicator // Carrier lock indicator
d_carrier_lock_test = d_carrier_lock_test_smoother.smooth(carrier_lock_detector(d_Prompt_buffer.data(), 1)); d_carrier_lock_test = d_carrier_lock_test_smoother.smooth(carrier_lock_detector(d_Prompt_buffer.data(), 1));

View File

@ -414,7 +414,7 @@ int Galileo_E1_Tcp_Connector_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.data(), FLAGS_cn0_samples, GALILEO_E1_CODE_PERIOD_S); d_CN0_SNV_dB_Hz = cn0_mm_estimator(d_Prompt_buffer.data(), FLAGS_cn0_samples, GALILEO_E1_CODE_PERIOD_S);
// Carrier lock indicator // Carrier lock indicator
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer.data(), FLAGS_cn0_samples); d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer.data(), FLAGS_cn0_samples);

View File

@ -762,7 +762,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at
{ {
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.data(), CN0_ESTIMATION_SAMPLES, GLONASS_L1_CA_CODE_PERIOD_S); d_CN0_SNV_dB_Hz = cn0_mm_estimator(d_Prompt_buffer.data(), CN0_ESTIMATION_SAMPLES, GLONASS_L1_CA_CODE_PERIOD_S);
// Carrier lock indicator // Carrier lock indicator
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer.data(), CN0_ESTIMATION_SAMPLES); d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer.data(), CN0_ESTIMATION_SAMPLES);
// Loss of lock detection // Loss of lock detection

View File

@ -753,7 +753,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at
{ {
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.data(), CN0_ESTIMATION_SAMPLES, GLONASS_L1_CA_CODE_PERIOD_S); d_CN0_SNV_dB_Hz = cn0_mm_estimator(d_Prompt_buffer.data(), CN0_ESTIMATION_SAMPLES, GLONASS_L1_CA_CODE_PERIOD_S);
// Carrier lock indicator // Carrier lock indicator
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer.data(), CN0_ESTIMATION_SAMPLES); d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer.data(), CN0_ESTIMATION_SAMPLES);
// Loss of lock detection // Loss of lock detection

View File

@ -621,7 +621,7 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut
{ {
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.data(), CN0_ESTIMATION_SAMPLES, GLONASS_L1_CA_CODE_PERIOD_S); d_CN0_SNV_dB_Hz = cn0_mm_estimator(d_Prompt_buffer.data(), CN0_ESTIMATION_SAMPLES, GLONASS_L1_CA_CODE_PERIOD_S);
// Carrier lock indicator // Carrier lock indicator
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer.data(), CN0_ESTIMATION_SAMPLES); d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer.data(), CN0_ESTIMATION_SAMPLES);
// Loss of lock detection // Loss of lock detection

View File

@ -760,7 +760,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at
{ {
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.data(), CN0_ESTIMATION_SAMPLES, GLONASS_L2_CA_CODE_PERIOD_S); d_CN0_SNV_dB_Hz = cn0_mm_estimator(d_Prompt_buffer.data(), CN0_ESTIMATION_SAMPLES, GLONASS_L2_CA_CODE_PERIOD_S);
// Carrier lock indicator // Carrier lock indicator
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer.data(), CN0_ESTIMATION_SAMPLES); d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer.data(), CN0_ESTIMATION_SAMPLES);
// Loss of lock detection // Loss of lock detection

View File

@ -751,7 +751,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at
{ {
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.data(), CN0_ESTIMATION_SAMPLES, GLONASS_L2_CA_CODE_PERIOD_S); d_CN0_SNV_dB_Hz = cn0_mm_estimator(d_Prompt_buffer.data(), CN0_ESTIMATION_SAMPLES, GLONASS_L2_CA_CODE_PERIOD_S);
// Carrier lock indicator // Carrier lock indicator
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer.data(), CN0_ESTIMATION_SAMPLES); d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer.data(), CN0_ESTIMATION_SAMPLES);
// Loss of lock detection // Loss of lock detection

View File

@ -621,7 +621,7 @@ int Glonass_L2_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut
{ {
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.data(), CN0_ESTIMATION_SAMPLES, GLONASS_L2_CA_CODE_PERIOD_S); d_CN0_SNV_dB_Hz = cn0_mm_estimator(d_Prompt_buffer.data(), CN0_ESTIMATION_SAMPLES, GLONASS_L2_CA_CODE_PERIOD_S);
// Carrier lock indicator // Carrier lock indicator
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer.data(), CN0_ESTIMATION_SAMPLES); d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer.data(), CN0_ESTIMATION_SAMPLES);
// Loss of lock detection // Loss of lock detection

View File

@ -436,7 +436,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work(int noutput_items __attribut
{ {
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.data(), FLAGS_cn0_samples, GPS_L1_CA_CODE_PERIOD_S); d_CN0_SNV_dB_Hz = cn0_mm_estimator(d_Prompt_buffer.data(), FLAGS_cn0_samples, GPS_L1_CA_CODE_PERIOD_S);
// Carrier lock indicator // Carrier lock indicator
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer.data(), FLAGS_cn0_samples); d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer.data(), FLAGS_cn0_samples);
// Loss of lock detection // Loss of lock detection

View File

@ -794,7 +794,7 @@ int Gps_L1_Ca_Kf_Tracking_cc::general_work(int noutput_items __attribute__((unus
{ {
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.data(), FLAGS_cn0_samples, GPS_L1_CA_CODE_PERIOD_S); d_CN0_SNV_dB_Hz = cn0_mm_estimator(d_Prompt_buffer.data(), FLAGS_cn0_samples, GPS_L1_CA_CODE_PERIOD_S);
// Carrier lock indicator // Carrier lock indicator
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer.data(), FLAGS_cn0_samples); d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer.data(), FLAGS_cn0_samples);
// Loss of lock detection // Loss of lock detection

View File

@ -450,7 +450,7 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attrib
else else
{ {
d_cn0_estimation_counter = 0; d_cn0_estimation_counter = 0;
d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer.data(), FLAGS_cn0_samples, GPS_L1_CA_CODE_PERIOD_S); d_CN0_SNV_dB_Hz = cn0_mm_estimator(d_Prompt_buffer.data(), FLAGS_cn0_samples, GPS_L1_CA_CODE_PERIOD_S);
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer.data(), FLAGS_cn0_samples); d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer.data(), FLAGS_cn0_samples);
// ###### TRACKING UNLOCK NOTIFICATION ##### // ###### TRACKING UNLOCK NOTIFICATION #####

View File

@ -85,6 +85,53 @@ float cn0_svn_estimator(const gr_complex* Prompt_buffer, int length, float coh_i
} }
/*
* Signal-to-Noise (SNR) (\f$\rho\f$) estimator using the Moments Method:
* \f{equation}
* \hat{\rho}=\frac{\hat{P}_s}{\hat{P}_n}=\frac{\sqrt{2*\hat{M}_2^2 - \hat{M}_4 }}{\hat{M}_2-\sqrt{2*\hat{M}_2^2 - \hat{M}_4 }},
* \f}
* where \f$\hat{P}_s=\left(\frac{1}{N}\sum^{N-1}_{i=0}|Re(Pc(i))|\right)^2\f$ is the estimation of the signal power,
* \f$ \hat{M}_2=\frac{1}{N}\sum^{N-1}_{i=0}|Pc(i)|^2 \f$, \f$\hat{M}_4 = \frac{1}{N}\sum^{N-1}_{i=0}|Pc(i)|^4 \f$, \f$|\cdot|\f$ is the absolute value,
* \f$Re(\cdot)\f$ stands for the real part of the value, and \f$Pc(i)\f$ is the prompt correlator output for the sample index i.
*
* The SNR value is converted to CN0 [dB-Hz], taking to account the coherent integration time, using the following formula:
* \f{equation}
* CN0_{dB}=10*log(\hat{\rho})-10*log(T_{int}),
* \f}
* where \f$T_{int}\f$ is the coherent integration time, in seconds.
*
*/
float cn0_mm_estimator(const gr_complex* Prompt_buffer, int length, float coh_integration_time_s)
{
float SNR_aux = 0.0;
float SNR_dB_Hz = 0.0;
float Psig = 0.0;
float m_2 = 0.0;
float m_4 = 0.0;
float aux;
auto n = static_cast<float>(length);
for (int i = 0; i < length; i++)
{
Psig += std::abs(Prompt_buffer[i].real());
aux = Prompt_buffer[i].imag() * Prompt_buffer[i].imag() + Prompt_buffer[i].real() * Prompt_buffer[i].real();
m_2 += aux;
m_4 += (aux * aux);
}
Psig /= n;
Psig = Psig * Psig;
m_2 /= n;
m_4 /= n;
aux = std::sqrt(2.0 * m_2 * m_2 - m_4);
SNR_aux = aux / (m_2 - aux);
SNR_dB_Hz = 10.0 * std::log10(SNR_aux) - 10.0 * std::log10(coh_integration_time_s);
if (std::isnan(SNR_dB_Hz))
{
SNR_dB_Hz = Psig / (m_2 - Psig);
}
return SNR_dB_Hz;
}
/* /*
* The estimate of the cosine of twice the carrier phase error is given by * The estimate of the cosine of twice the carrier phase error is given by
* \f{equation} * \f{equation}

View File

@ -51,7 +51,7 @@
#include <gnuradio/gr_complex.h> #include <gnuradio/gr_complex.h>
/*! \brief CN0_SNV is a Carrier-to-Noise (CN0) estimator /*! \brief cn0_svn_estimator is a Carrier-to-Noise (CN0) estimator
* based on the Signal-to-Noise Variance (SNV) estimator * based on the Signal-to-Noise Variance (SNV) estimator
* *
* Signal-to-Noise (SNR) (\f$\rho\f$) estimator using the Signal-to-Noise Variance (SNV) estimator: * Signal-to-Noise (SNR) (\f$\rho\f$) estimator using the Signal-to-Noise Variance (SNV) estimator:
@ -75,6 +75,29 @@
float cn0_svn_estimator(const gr_complex* Prompt_buffer, int length, float coh_integration_time_s); float cn0_svn_estimator(const gr_complex* Prompt_buffer, int length, float coh_integration_time_s);
/*! \brief cn0_mm_estimator is a Carrier-to-Noise (CN0) estimator
* based on the Moments Method (MM)
*
* Signal-to-Noise (SNR) (\f$\rho\f$) estimator using the Moments Method:
* \f{equation}
* \hat{\rho}=\frac{\hat{P}_s}{\hat{P}_n}=\frac{\sqrt{2*\hat{M}_2^2 - \hat{M}_4 }}{\hat{M}_2-\sqrt{2*\hat{M}_2^2 - \hat{M}_4 }},
* \f}
* where \f$\hat{P}_s=\left(\frac{1}{N}\sum^{N-1}_{i=0}|Re(Pc(i))|\right)^2\f$ is the estimation of the signal power,
* \f$ \hat{M}_2=\frac{1}{N}sum^{N-1}_{i=0}|Pc(i)|^2 \f$, \f$\hat{M}_4 = \frac{1}{N}sum^{N-1}_{i=0}|Pc(i)|^4 \f$, \f$|\cdot|\f$ is the absolute value,
* \f$Re(\cdot)\f$ stands for the real part of the value, and \f$Pc(i)\f$ is the prompt correlator output for the sample index i.
*
* The SNR value is converted to CN0 [dB-Hz], taking to account the coherent integration time, using the following formula:
* \f{equation}
* CN0_{dB}=10*log(\hat{\rho})-10*log(T_{int}),
* \f}
* where \f$T_{int}\f$ is the coherent integration time, in seconds.
* Ref: D. R. Pauluzzi, N. C. Beaulieu, "A comparison of SNR estimation
* techniques for the AWGN channel," IEEE Trans. on Comm., vol. 48,
* no. 10, pp. 16811691, Oct. 2000.
*/
float cn0_mm_estimator(const gr_complex* Prompt_buffer, int length, float coh_integration_time_s);
/*! \brief A carrier lock detector /*! \brief A carrier lock detector
* *
* The Carrier Phase Lock Detector block uses the estimate of the cosine of twice the carrier phase error is given by * The Carrier Phase Lock Detector block uses the estimate of the cosine of twice the carrier phase error is given by