1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-16 13:10:35 +00:00

Add warnings to tracking adapters

This commit is contained in:
Antonio Ramos 2018-03-20 10:33:02 +01:00
parent 02deff9b24
commit e94d7296dc
9 changed files with 211 additions and 168 deletions

View File

@ -280,6 +280,7 @@ double prange(const obsd_t *obs, const nav_t *nav, const double *azel,
}
else if (obs->code[j] == CODE_L5X) /* L1 + L5 */
{
//TODO
}
}
else if (sys == SYS_GAL) /* E1 + E5a */

View File

@ -38,6 +38,7 @@
#include "configuration_interface.h"
#include "Galileo_E1.h"
#include "gnss_sdr_flags.h"
#include "display.h"
#include <glog/logging.h>
@ -49,44 +50,37 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking(
{
DLOG(INFO) << "role " << role;
//################# CONFIGURATION PARAMETERS ########################
int fs_in;
int vector_length;
bool dump;
std::string dump_filename;
std::string item_type;
std::string default_item_type = "gr_complex";
float pll_bw_hz;
float pll_bw_narrow_hz;
float dll_bw_hz;
float dll_bw_narrow_hz;
float early_late_space_chips;
float very_early_late_space_chips;
float early_late_space_narrow_chips;
float very_early_late_space_narrow_chips;
unified_ = configuration->property(role + ".unified", false);
item_type = configuration->property(role + ".item_type", default_item_type);
std::string item_type = configuration->property(role + ".item_type", default_item_type);
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
dump = configuration->property(role + ".dump", false);
pll_bw_hz = configuration->property(role + ".pll_bw_hz", 5.0);
int fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
bool dump = configuration->property(role + ".dump", false);
float pll_bw_hz = configuration->property(role + ".pll_bw_hz", 5.0);
if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast<float>(FLAGS_pll_bw_hz);
dll_bw_hz = configuration->property(role + ".dll_bw_hz", 0.5);
float dll_bw_hz = configuration->property(role + ".dll_bw_hz", 0.5);
if (FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast<float>(FLAGS_dll_bw_hz);
pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz", 2.0);
dll_bw_narrow_hz = configuration->property(role + ".dll_bw_narrow_hz", 0.25);
int extend_correlation_symbols;
extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", 1);
early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.15);
very_early_late_space_chips = configuration->property(role + ".very_early_late_space_chips", 0.6);
early_late_space_narrow_chips = configuration->property(role + ".early_late_space_narrow_chips", 0.15);
very_early_late_space_narrow_chips = configuration->property(role + ".very_early_late_space_narrow_chips", 0.6);
float pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz", 2.0);
float dll_bw_narrow_hz = configuration->property(role + ".dll_bw_narrow_hz", 0.25);
int extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", 1);
float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.15);
float very_early_late_space_chips = configuration->property(role + ".very_early_late_space_chips", 0.6);
float early_late_space_narrow_chips = configuration->property(role + ".early_late_space_narrow_chips", 0.15);
float very_early_late_space_narrow_chips = configuration->property(role + ".very_early_late_space_narrow_chips", 0.6);
bool track_pilot = configuration->property(role + ".track_pilot", false);
if (extend_correlation_symbols < 1)
{
extend_correlation_symbols = 1;
std::cout << TEXT_RED << "WARNING: Galileo E1. extend_correlation_symbols must be bigger than 0. Coherent integration has been set to 1 symbol (4 ms)" << TEXT_RESET << std::endl;
}
else if (!track_pilot and extend_correlation_symbols > 1)
{
extend_correlation_symbols = 1;
std::cout << TEXT_RED << "WARNING: Extended coherent integration is not allowed in Galileo E1 when tracking the data component. Coherent integration has been set to 4 ms (1 symbol)" << TEXT_RESET << std::endl;
}
std::string default_dump_filename = "./track_ch";
dump_filename = configuration->property(role + ".dump_filename",
default_dump_filename); //unused!
vector_length = std::round(fs_in / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS));
std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); //unused!
int vector_length = std::round(fs_in / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS));
//################# MAKE TRACKING GNURadio object ###################
if (item_type.compare("gr_complex") == 0)
@ -138,7 +132,6 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking(
}
channel_ = 0;
DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")";
}

View File

@ -40,6 +40,7 @@
#include "configuration_interface.h"
#include "Galileo_E5a.h"
#include "gnss_sdr_flags.h"
#include "display.h"
#include <glog/logging.h>
using google::LogMessage;
@ -50,56 +51,64 @@ GalileoE5aDllPllTracking::GalileoE5aDllPllTracking(
{
DLOG(INFO) << "role " << role;
//################# CONFIGURATION PARAMETERS ########################
int fs_in;
int vector_length;
int f_if;
bool dump;
std::string dump_filename;
std::string item_type;
std::string default_item_type = "gr_complex";
float pll_bw_hz;
float dll_bw_hz;
float pll_bw_narrow_hz;
float dll_bw_narrow_hz;
int ti_ms;
float early_late_space_chips;
item_type = configuration->property(role + ".item_type", default_item_type);
//vector_length = configuration->property(role + ".vector_length", 2048);
std::string item_type = configuration->property(role + ".item_type", default_item_type);
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 12000000);
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
f_if = configuration->property(role + ".if", 0);
dump = configuration->property(role + ".dump", false);
pll_bw_hz = configuration->property(role + ".pll_bw_hz", 20.0);
int fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
bool dump = configuration->property(role + ".dump", false);
unified_ = configuration->property(role + ".unified", false);
float pll_bw_hz = configuration->property(role + ".pll_bw_hz", 20.0);
if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast<float>(FLAGS_pll_bw_hz);
dll_bw_hz = configuration->property(role + ".dll_bw_hz", 20.0);
float dll_bw_hz = configuration->property(role + ".dll_bw_hz", 20.0);
if (FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast<float>(FLAGS_dll_bw_hz);
pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz", 5.0);
dll_bw_narrow_hz = configuration->property(role + ".dll_bw_narrow_hz", 2.0);
ti_ms = configuration->property(role + ".ti_ms", 3);
early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5);
float pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz", 5.0);
float dll_bw_narrow_hz = configuration->property(role + ".dll_bw_narrow_hz", 2.0);
int ti_ms = configuration->property(role + ".ti_ms", 3);
float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5);
std::string default_dump_filename = "./track_ch";
dump_filename = configuration->property(role + ".dump_filename",
default_dump_filename); //unused!
vector_length = std::round(fs_in / (Galileo_E5a_CODE_CHIP_RATE_HZ / Galileo_E5a_CODE_LENGTH_CHIPS));
std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); //unused!
int vector_length = std::round(fs_in / (Galileo_E5a_CODE_CHIP_RATE_HZ / Galileo_E5a_CODE_LENGTH_CHIPS));
int 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);
bool track_pilot = configuration->property(role + ".track_pilot", false);
if (extend_correlation_symbols < 1)
{
extend_correlation_symbols = 1;
std::cout << TEXT_RED << "WARNING: Galileo E5a. extend_correlation_symbols must be bigger than 0. Coherent integration has been set to 1 symbol (1 ms)" << TEXT_RESET << std::endl;
}
else if (!track_pilot and extend_correlation_symbols > Galileo_E5a_I_SECONDARY_CODE_LENGTH)
{
extend_correlation_symbols = Galileo_E5a_I_SECONDARY_CODE_LENGTH;
std::cout << TEXT_RED << "WARNING: Galileo E5a. extend_correlation_symbols must be lower than 21 when tracking the data component. Coherent integration has been set to 20 symbols (20 ms)" << TEXT_RESET << std::endl;
}
//################# MAKE TRACKING GNURadio object ###################
if (item_type.compare("gr_complex") == 0)
{
item_size_ = sizeof(gr_complex);
if (unified_)
{
char sig_[3] = "5X";
item_size_ = sizeof(gr_complex);
tracking_unified_ = dll_pll_veml_make_tracking(
fs_in, vector_length, dump, dump_filename,
pll_bw_hz, dll_bw_hz,
pll_bw_narrow_hz, dll_bw_narrow_hz,
early_late_space_chips,
early_late_space_chips,
early_late_space_narrow_chips,
early_late_space_narrow_chips,
extend_correlation_symbols,
track_pilot, 'E', sig_);
}
else
{
tracking_ = galileo_e5a_dll_pll_make_tracking_cc(
f_if,
fs_in,
vector_length,
dump,
dump_filename,
pll_bw_hz,
dll_bw_hz,
pll_bw_narrow_hz,
dll_bw_narrow_hz,
ti_ms,
0, fs_in, vector_length, dump, dump_filename,
pll_bw_hz, dll_bw_hz, pll_bw_narrow_hz,
dll_bw_narrow_hz, ti_ms,
early_late_space_chips);
}
}
else
{
item_size_ = sizeof(gr_complex);
@ -117,6 +126,9 @@ GalileoE5aDllPllTracking::~GalileoE5aDllPllTracking()
void GalileoE5aDllPllTracking::start_tracking()
{
if (unified_)
tracking_unified_->start_tracking();
else
tracking_->start_tracking();
}
@ -126,12 +138,18 @@ void GalileoE5aDllPllTracking::start_tracking()
void GalileoE5aDllPllTracking::set_channel(unsigned int channel)
{
channel_ = channel;
if (unified_)
tracking_unified_->set_channel(channel);
else
tracking_->set_channel(channel);
}
void GalileoE5aDllPllTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{
if (unified_)
tracking_unified_->set_gnss_synchro(p_gnss_synchro);
else
tracking_->set_gnss_synchro(p_gnss_synchro);
}
@ -153,10 +171,16 @@ void GalileoE5aDllPllTracking::disconnect(gr::top_block_sptr top_block)
gr::basic_block_sptr GalileoE5aDllPllTracking::get_left_block()
{
if (unified_)
return tracking_unified_;
else
return tracking_;
}
gr::basic_block_sptr GalileoE5aDllPllTracking::get_right_block()
{
if (unified_)
return tracking_unified_;
else
return tracking_;
}

View File

@ -41,6 +41,7 @@
#include "tracking_interface.h"
#include "galileo_e5a_dll_pll_tracking_cc.h"
#include "dll_pll_veml_tracking.h"
#include <string>
class ConfigurationInterface;
@ -94,11 +95,13 @@ public:
private:
galileo_e5a_dll_pll_tracking_cc_sptr tracking_;
dll_pll_veml_tracking_sptr tracking_unified_;
size_t item_size_;
unsigned int channel_;
std::string role_;
unsigned int in_streams_;
unsigned int out_streams_;
bool unified_;
};
#endif /* GNSS_SDR_GALILEO_E5A_DLL_PLL_TRACKING_H_ */

View File

@ -40,6 +40,7 @@
#include "configuration_interface.h"
#include "GPS_L1_CA.h"
#include "gnss_sdr_flags.h"
#include "display.h"
#include <glog/logging.h>
using google::LogMessage;
@ -50,16 +51,11 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking(
{
DLOG(INFO) << "role " << role;
//################# CONFIGURATION PARAMETERS ########################
int fs_in;
int vector_length;
bool dump;
std::string dump_filename;
std::string item_type;
std::string default_item_type = "gr_complex";
item_type = configuration->property(role + ".item_type", default_item_type);
std::string item_type = configuration->property(role + ".item_type", default_item_type);
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
dump = configuration->property(role + ".dump", false);
int fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
bool dump = configuration->property(role + ".dump", false);
unified_ = configuration->property(role + ".unified", false);
float pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0);
if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast<float>(FLAGS_pll_bw_hz);
@ -70,10 +66,14 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking(
float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5);
float early_late_space_narrow_chips = configuration->property(role + ".early_late_space_narrow_chips", 0.5);
std::string default_dump_filename = "./track_ch";
dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); //unused!
vector_length = std::round(fs_in / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS));
std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); //unused!
int vector_length = std::round(fs_in / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS));
int symbols_extended_correlator = configuration->property(role + ".extend_correlation_symbols", 1);
if (symbols_extended_correlator < 1) symbols_extended_correlator = 1;
if (symbols_extended_correlator < 1 or symbols_extended_correlator > 20)
{
symbols_extended_correlator = 1;
std::cout << TEXT_RED << "WARNING: GPS L1 C/A. extend_correlation_symbols must be between 1 and 20. Coherent integration has been set to 1 symbol (1 ms)" << TEXT_RESET << std::endl;
}
//################# MAKE TRACKING GNURadio object ###################
if (item_type.compare("gr_complex") == 0)
{
@ -82,14 +82,9 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking(
char sig_[3] = "1C";
item_size_ = sizeof(gr_complex);
tracking_unified_ = dll_pll_veml_make_tracking(
fs_in,
vector_length,
dump,
dump_filename,
pll_bw_hz,
dll_bw_hz,
pll_bw_narrow_hz,
dll_bw_narrow_hz,
fs_in, vector_length, dump,
dump_filename, pll_bw_hz, dll_bw_hz,
pll_bw_narrow_hz, dll_bw_narrow_hz,
early_late_space_chips,
early_late_space_chips,
early_late_space_narrow_chips,
@ -101,13 +96,8 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking(
else
{
tracking_ = gps_l1_ca_dll_pll_make_tracking_cc(
0,
fs_in,
vector_length,
dump,
dump_filename,
pll_bw_hz,
dll_bw_hz,
0, fs_in, vector_length, dump,
dump_filename, pll_bw_hz, dll_bw_hz,
early_late_space_chips);
}
}

View File

@ -39,6 +39,7 @@
#include "configuration_interface.h"
#include "GPS_L5.h"
#include "gnss_sdr_flags.h"
#include "display.h"
#include <glog/logging.h>
@ -50,45 +51,62 @@ GpsL5iDllPllTracking::GpsL5iDllPllTracking(
{
DLOG(INFO) << "role " << role;
//################# CONFIGURATION PARAMETERS ########################
int fs_in;
int vector_length;
int f_if;
bool dump;
std::string dump_filename;
std::string item_type;
std::string default_item_type = "gr_complex";
float pll_bw_hz;
float dll_bw_hz;
float early_late_space_chips;
item_type = configuration->property(role + ".item_type", default_item_type);
std::string item_type = configuration->property(role + ".item_type", default_item_type);
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
f_if = configuration->property(role + ".if", 0);
dump = configuration->property(role + ".dump", false);
pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0);
int fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
bool dump = configuration->property(role + ".dump", false);
unified_ = configuration->property(role + ".unified", false);
float pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0);
if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast<float>(FLAGS_pll_bw_hz);
dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0);
float dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0);
if (FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast<float>(FLAGS_dll_bw_hz);
early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5);
float pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz", 2.0);
float dll_bw_narrow_hz = configuration->property(role + ".dll_bw_narrow_hz", 0.25);
float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5);
std::string default_dump_filename = "./track_ch";
dump_filename = configuration->property(role + ".dump_filename",
default_dump_filename); //unused!
vector_length = std::round(static_cast<double>(fs_in) / (static_cast<double>(GPS_L5i_CODE_RATE_HZ) / static_cast<double>(GPS_L5i_CODE_LENGTH_CHIPS)));
std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); //unused!
int vector_length = std::round(static_cast<double>(fs_in) / (static_cast<double>(GPS_L5i_CODE_RATE_HZ) / static_cast<double>(GPS_L5i_CODE_LENGTH_CHIPS)));
int 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);
bool track_pilot = configuration->property(role + ".track_pilot", false);
if (extend_correlation_symbols < 1)
{
extend_correlation_symbols = 1;
std::cout << TEXT_RED << "WARNING: GPS L5. extend_correlation_symbols must be bigger than 0. Coherent integration has been set to 1 symbol (1 ms)" << TEXT_RESET << std::endl;
}
else if (!track_pilot and extend_correlation_symbols > GPS_L5i_NH_CODE_LENGTH)
{
extend_correlation_symbols = GPS_L5i_NH_CODE_LENGTH;
std::cout << TEXT_RED << "WARNING: GPS L5. extend_correlation_symbols must be lower than 11 when tracking the data component. Coherent integration has been set to 10 symbols (10 ms)" << TEXT_RESET << std::endl;
}
//################# MAKE TRACKING GNURadio object ###################
if (item_type.compare("gr_complex") == 0)
{
item_size_ = sizeof(gr_complex);
if (unified_)
{
char sig_[3] = "L5";
item_size_ = sizeof(gr_complex);
tracking_unified_ = dll_pll_veml_make_tracking(
fs_in, vector_length, dump, dump_filename,
pll_bw_hz, dll_bw_hz,
pll_bw_narrow_hz, dll_bw_narrow_hz,
early_late_space_chips,
early_late_space_chips,
early_late_space_narrow_chips,
early_late_space_narrow_chips,
extend_correlation_symbols,
track_pilot, 'G', sig_);
}
else
{
tracking_ = gps_l5i_dll_pll_make_tracking_cc(
f_if,
fs_in,
vector_length,
dump,
dump_filename,
pll_bw_hz,
dll_bw_hz,
0, fs_in, vector_length, dump,
dump_filename, pll_bw_hz, dll_bw_hz,
early_late_space_chips);
}
}
else
{
item_size_ = sizeof(gr_complex);
@ -106,6 +124,9 @@ GpsL5iDllPllTracking::~GpsL5iDllPllTracking()
void GpsL5iDllPllTracking::start_tracking()
{
if (unified_)
tracking_unified_->start_tracking();
else
tracking_->start_tracking();
}
@ -115,12 +136,18 @@ void GpsL5iDllPllTracking::start_tracking()
void GpsL5iDllPllTracking::set_channel(unsigned int channel)
{
channel_ = channel;
if (unified_)
tracking_unified_->set_channel(channel);
else
tracking_->set_channel(channel);
}
void GpsL5iDllPllTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{
if (unified_)
tracking_unified_->set_gnss_synchro(p_gnss_synchro);
else
tracking_->set_gnss_synchro(p_gnss_synchro);
}
@ -142,10 +169,16 @@ void GpsL5iDllPllTracking::disconnect(gr::top_block_sptr top_block)
gr::basic_block_sptr GpsL5iDllPllTracking::get_left_block()
{
if (unified_)
return tracking_unified_;
else
return tracking_;
}
gr::basic_block_sptr GpsL5iDllPllTracking::get_right_block()
{
if (unified_)
return tracking_unified_;
else
return tracking_;
}

View File

@ -34,11 +34,12 @@
* -------------------------------------------------------------------------
*/
#ifndef GNSS_SDR_gps_l5i_dll_pll_tracking_H_
#define GNSS_SDR_gps_l5i_dll_pll_tracking_H_
#ifndef GNSS_SDR_GPS_L5i_DLL_PLL_TRACKING_H_
#define GNSS_SDR_GPS_L5i_DLL_PLL_TRACKING_H_
#include "tracking_interface.h"
#include "gps_l5i_dll_pll_tracking_cc.h"
#include "dll_pll_veml_tracking.h"
#include <string>
class ConfigurationInterface;
@ -92,11 +93,13 @@ public:
private:
gps_l5i_dll_pll_tracking_cc_sptr tracking_;
dll_pll_veml_tracking_sptr tracking_unified_;
size_t item_size_;
unsigned int channel_;
std::string role_;
unsigned int in_streams_;
unsigned int out_streams_;
bool unified_;
};
#endif // GNSS_SDR_gps_l5i_dll_pll_tracking_H_
#endif // GNSS_SDR_GPS_L5i_DLL_PLL_TRACKING_H_

View File

@ -39,6 +39,7 @@
#include "lock_detectors.h"
#include "control_message_factory.h"
#include "MATH_CONSTANTS.h"
#include "gnss_sdr_flags.h"
#include "Galileo_E1.h"
#include "galileo_e1_signal_processing.h"
@ -365,11 +366,11 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(
// CN0 estimation and lock detector buffers
d_cn0_estimation_counter = 0;
d_Prompt_buffer = new gr_complex[DLL_PLL_CN0_ESTIMATION_SAMPLES];
d_Prompt_buffer = new gr_complex[FLAGS_cn0_samples];
d_carrier_lock_test = 1.0;
d_CN0_SNV_dB_Hz = 0.0;
d_carrier_lock_fail_counter = 0;
d_carrier_lock_threshold = DLL_PLL_CARRIER_LOCK_THRESHOLD;
d_carrier_lock_threshold = FLAGS_carrier_lock_th;
clear_tracking_vars();
@ -635,7 +636,7 @@ bool dll_pll_veml_tracking::acquire_secondary()
bool dll_pll_veml_tracking::cn0_and_tracking_lock_status()
{
// ####### CN0 ESTIMATION AND LOCK DETECTORS ######
if (d_cn0_estimation_counter < DLL_PLL_CN0_ESTIMATION_SAMPLES)
if (d_cn0_estimation_counter < FLAGS_cn0_samples)
{
// fill buffer with prompt correlator output values
d_Prompt_buffer[d_cn0_estimation_counter] = d_P_accu;
@ -646,11 +647,11 @@ bool dll_pll_veml_tracking::cn0_and_tracking_lock_status()
{
d_cn0_estimation_counter = 0;
// Code lock indicator
d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, DLL_PLL_CN0_ESTIMATION_SAMPLES, static_cast<long>(d_fs_in), static_cast<double>(d_code_length_chips));
d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, static_cast<long>(d_fs_in), static_cast<double>(d_code_length_chips));
// Carrier lock indicator
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, DLL_PLL_CN0_ESTIMATION_SAMPLES);
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, FLAGS_cn0_samples);
// Loss of lock detection
if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < DLL_PLL_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++;
}
@ -658,7 +659,7 @@ bool dll_pll_veml_tracking::cn0_and_tracking_lock_status()
{
if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--;
}
if (d_carrier_lock_fail_counter > DLL_PLL_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;
LOG(INFO) << "Loss of lock in channel " << d_channel << "!";
@ -1074,6 +1075,21 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused)
d_Prompt_buffer_deque.clear();
d_current_symbol = 0;
d_synchonizing = false;
if (d_enable_extended_integration)
{
// UPDATE INTEGRATION TIME
d_extend_correlation_symbols_count = 0;
float new_correlation_time = static_cast<float>(d_extend_correlation_symbols) * static_cast<float>(d_code_period);
d_carrier_loop_filter.set_pdi(new_correlation_time);
d_code_loop_filter.set_pdi(new_correlation_time);
d_state = 3; // next state is the extended correlator integrator
LOG(INFO) << "Enabled " << d_extend_correlation_symbols << " [symbols] extended correlator for CH "
<< d_channel
<< " : Satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN);
std::cout << "Enabled " << d_extend_correlation_symbols << " [symbols] extended correlator for CH "
<< d_channel
<< " : Satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << std::endl;
// Set narrow taps delay values [chips]
d_code_loop_filter.set_DLL_BW(d_dll_bw_narrow_hz);
d_carrier_loop_filter.set_PLL_BW(d_pll_bw_narrow_hz);
@ -1089,21 +1105,6 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused)
d_local_code_shift_chips[0] = -d_early_late_spc_narrow_chips * static_cast<float>(d_code_samples_per_chip);
d_local_code_shift_chips[2] = d_early_late_spc_narrow_chips * static_cast<float>(d_code_samples_per_chip);
}
// UPDATE INTEGRATION TIME
if (d_enable_extended_integration)
{
d_extend_correlation_symbols_count = 0;
float new_correlation_time = static_cast<float>(d_extend_correlation_symbols) * static_cast<float>(d_code_period);
d_carrier_loop_filter.set_pdi(new_correlation_time);
d_code_loop_filter.set_pdi(new_correlation_time);
d_state = 3; // next state is the extended correlator integrator
LOG(INFO) << "Enabled " << d_extend_correlation_symbols << " [symbols] extended correlator for CH "
<< d_channel
<< " : Satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN);
std::cout << "Enabled " << d_extend_correlation_symbols << " [symbols] extended correlator for CH "
<< d_channel
<< " : Satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << std::endl;
}
else
{

View File

@ -32,11 +32,6 @@
#ifndef GNSS_SDR_DLL_PLL_VEML_TRACKING_H
#define GNSS_SDR_DLL_PLL_VEML_TRACKING_H
#define DLL_PLL_CN0_ESTIMATION_SAMPLES 20
#define DLL_PLL_MINIMUM_VALID_CN0 25
#define DLL_PLL_MAXIMUM_LOCK_FAIL_COUNTER 50
#define DLL_PLL_CARRIER_LOCK_THRESHOLD 0.85
#include "gnss_synchro.h"
#include "tracking_2nd_DLL_filter.h"
#include "tracking_2nd_PLL_filter.h"