1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-01-19 05:33:02 +00:00

Improve acquisition adapters constructors: prefer member initializers of the constructor instead of in the constructor body

This commit is contained in:
Carles Fernandez 2022-12-09 12:00:28 +01:00
parent 8bd0292b1a
commit aadc9e6a26
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
15 changed files with 202 additions and 224 deletions

View File

@ -40,30 +40,28 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition(
: configuration_(configuration),
gnss_synchro_(nullptr),
role_(role),
item_size_(sizeof(gr_complex)),
threshold_(0.0),
channel_(0),
doppler_max_(configuration_->property(role + ".doppler_max", 5000)),
doppler_step_(0),
sampled_ms_(configuration_->property(role + ".coherent_integration_time_ms", 4)),
max_dwells_(configuration_->property(role + ".max_dwells", 1)),
in_streams_(in_streams),
out_streams_(out_streams),
dump_(configuration_->property(role + ".dump", false))
{
const std::string default_item_type("gr_complex");
const std::string default_dump_filename("../data/acquisition.dat");
DLOG(INFO) << "role " << role;
item_type_ = configuration_->property(role + ".item_type",
default_item_type);
item_type_ = configuration_->property(role_ + ".item_type", default_item_type);
int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
dump_filename_ = configuration_->property(role_ + ".dump_filename", default_dump_filename);
if (FLAGS_doppler_max != 0)
{
doppler_max_ = FLAGS_doppler_max;
}
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4);
if (sampled_ms_ % 4 != 0)
{
@ -73,11 +71,6 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition(
<< sampled_ms_ << " ms will be used.";
}
max_dwells_ = configuration_->property(role + ".max_dwells", 1);
dump_filename_ = configuration_->property(role + ".dump_filename",
default_dump_filename);
// -- Find number of samples per spreading code (4 ms) -----------------
code_length_ = static_cast<unsigned int>(round(
fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS)));
@ -90,9 +83,9 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition(
bool enable_monitor_output = configuration->property("AcquisitionMonitor.enable_monitor", false);
DLOG(INFO) << "role " << role_;
if (item_type_ == "gr_complex")
{
item_size_ = sizeof(gr_complex);
acquisition_cc_ = galileo_pcps_8ms_make_acquisition_cc(sampled_ms_, max_dwells_,
doppler_max_, fs_in_, samples_per_ms, code_length_,
dump_, dump_filename_, enable_monitor_output);
@ -104,7 +97,9 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition(
}
else
{
item_size_ = sizeof(gr_complex);
item_size_ = 0;
acquisition_cc_ = nullptr;
stream_to_vector_ = nullptr;
LOG(WARNING) << item_type_ << " unknown acquisition item type";
}

View File

@ -37,31 +37,31 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams) : gnss_synchro_(nullptr),
configuration_(configuration),
role_(role),
threshold_(0.0),
doppler_center_(0),
channel_(0),
doppler_step_(0),
in_streams_(in_streams),
out_streams_(out_streams)
unsigned int out_streams)
: gnss_synchro_(nullptr),
configuration_(configuration),
role_(role),
threshold_(0.0),
doppler_center_(0),
channel_(0),
doppler_step_(0),
in_streams_(in_streams),
out_streams_(out_streams),
acquire_pilot_(configuration->property(role + ".acquire_pilot", false))
{
acq_parameters_.ms_per_code = 4;
acq_parameters_.SetFromConfiguration(configuration_, role, GALILEO_E1_CODE_CHIP_RATE_CPS, GALILEO_E1_OPT_ACQ_FS_SPS);
acq_parameters_.SetFromConfiguration(configuration_, role_, GALILEO_E1_CODE_CHIP_RATE_CPS, GALILEO_E1_OPT_ACQ_FS_SPS);
DLOG(INFO) << "role " << role;
doppler_step_ = static_cast<unsigned int>(acq_parameters_.doppler_step);
item_type_ = acq_parameters_.item_type;
item_size_ = acq_parameters_.it_size;
fs_in_ = acq_parameters_.fs_in;
if (FLAGS_doppler_max != 0)
{
acq_parameters_.doppler_max = FLAGS_doppler_max;
}
doppler_max_ = acq_parameters_.doppler_max;
doppler_step_ = static_cast<unsigned int>(acq_parameters_.doppler_step);
item_type_ = acq_parameters_.item_type;
item_size_ = acq_parameters_.it_size;
fs_in_ = acq_parameters_.fs_in;
acquire_pilot_ = configuration->property(role + ".acquire_pilot", false);
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS)));
vector_length_ = static_cast<unsigned int>(std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2.0 : 1.0));
@ -69,6 +69,7 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
sampled_ms_ = acq_parameters_.sampled_ms;
DLOG(INFO) << "role " << role_;
acquisition_ = pcps_make_acquisition(acq_parameters_);
DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")";

View File

@ -34,26 +34,25 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams) : gnss_synchro_(nullptr),
role_(role),
doppler_center_(0),
channel_(0),
doppler_step_(0),
in_streams_(in_streams),
out_streams_(out_streams)
unsigned int out_streams)
: gnss_synchro_(nullptr),
role_(role),
doppler_center_(0),
channel_(0),
doppler_step_(0),
in_streams_(in_streams),
out_streams_(out_streams),
acquire_pilot_(configuration->property(role + ".acquire_pilot", false))
{
acq_parameters_.SetFromConfiguration(configuration, role, fpga_downsampling_factor, fpga_buff_num, fpga_blk_exp, GALILEO_E1_CODE_CHIP_RATE_CPS, GALILEO_E1_B_CODE_LENGTH_CHIPS);
DLOG(INFO) << "role " << role;
acq_parameters_.SetFromConfiguration(configuration, role_, fpga_downsampling_factor, fpga_buff_num, fpga_blk_exp, GALILEO_E1_CODE_CHIP_RATE_CPS, GALILEO_E1_B_CODE_LENGTH_CHIPS);
doppler_step_ = static_cast<unsigned int>(acq_parameters_.doppler_step);
fs_in_ = acq_parameters_.fs_in;
if (FLAGS_doppler_max != 0)
{
acq_parameters_.doppler_max = FLAGS_doppler_max;
}
doppler_max_ = acq_parameters_.doppler_max;
doppler_step_ = static_cast<unsigned int>(acq_parameters_.doppler_step);
fs_in_ = acq_parameters_.fs_in;
acquire_pilot_ = configuration->property(role + ".acquire_pilot", false); // could be true in future versions
uint32_t code_length = acq_parameters_.code_length;
uint32_t nsamples_total = acq_parameters_.samples_per_code;
@ -131,6 +130,7 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
acq_parameters_.all_fft_codes = d_all_fft_codes_.data();
DLOG(INFO) << "role " << role_;
acquisition_fpga_ = pcps_make_acquisition_fpga(acq_parameters_);
if (in_streams_ > 1)

View File

@ -32,29 +32,28 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition
: configuration_(configuration),
role_(role),
gnss_synchro_(nullptr),
item_size_(sizeof(gr_complex)),
threshold_(0.0),
channel_(0),
doppler_max_(configuration_->property(role + ".doppler_max", 5000)),
doppler_step_(0),
sampled_ms_(configuration_->property(role + ".coherent_integration_time_ms", 4)),
max_dwells_(configuration_->property(role + ".max_dwells", 1)),
in_streams_(in_streams),
out_streams_(out_streams),
dump_(configuration_->property(role + ".dump", false))
{
const std::string default_item_type("gr_complex");
const std::string default_dump_filename("../data/acquisition.dat");
DLOG(INFO) << "role " << role;
item_type_ = configuration_->property(role + ".item_type", default_item_type);
item_type_ = configuration_->property(role_ + ".item_type", default_item_type);
int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
dump_filename_ = configuration_->property(role_ + ".dump_filename", default_dump_filename);
if (FLAGS_doppler_max != 0)
{
doppler_max_ = FLAGS_doppler_max;
}
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4);
if (sampled_ms_ % 4 != 0)
{
@ -64,11 +63,6 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition
<< sampled_ms_ << " ms will be used.";
}
max_dwells_ = configuration_->property(role + ".max_dwells", 1);
dump_filename_ = configuration_->property(role + ".dump_filename",
default_dump_filename);
// -- Find number of samples per spreading code (4 ms) -----------------
code_length_ = static_cast<unsigned int>(round(
fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS)));
@ -82,9 +76,9 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition
bool enable_monitor_output = configuration_->property("AcquisitionMonitor.enable_monitor", false);
DLOG(INFO) << "role " << role_;
if (item_type_ == "gr_complex")
{
item_size_ = sizeof(gr_complex);
acquisition_cc_ = pcps_cccwsr_make_acquisition_cc(sampled_ms_, max_dwells_,
doppler_max_, fs_in_, samples_per_ms, code_length_,
dump_, dump_filename_, enable_monitor_output);
@ -96,7 +90,8 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition
}
else
{
item_size_ = sizeof(gr_complex);
item_size_ = 0;
acquisition_cc_ = nullptr;
LOG(WARNING) << item_type_ << " unknown acquisition item type";
}

View File

@ -40,30 +40,28 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui
: configuration_(configuration),
role_(role),
gnss_synchro_(nullptr),
item_size_(sizeof(gr_complex)),
threshold_(0.0),
channel_(0),
doppler_max_(configuration_->property(role + ".doppler_max", 5000)),
doppler_step_(0),
sampled_ms_(configuration_->property(role + ".coherent_integration_time_ms", 8)),
in_streams_(in_streams),
out_streams_(out_streams),
bit_transition_flag_(configuration_->property(role + ".bit_transition_flag", false)),
dump_(configuration_->property(role + ".dump", false))
{
const std::string default_item_type("gr_complex");
const std::string default_dump_filename("../data/acquisition.dat");
DLOG(INFO) << "role " << role;
item_type_ = configuration_->property(role + ".item_type",
default_item_type);
item_type_ = configuration_->property(role + ".item_type", default_item_type);
int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
if (FLAGS_doppler_max != 0)
{
doppler_max_ = FLAGS_doppler_max;
}
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 8);
/* --- Find number of samples per spreading code (4 ms) -----------------*/
code_length_ = static_cast<unsigned int>(round(
@ -71,6 +69,7 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui
auto samples_per_ms = static_cast<int>(round(code_length_ / 4.0));
DLOG(INFO) << "role " << role;
/*Calculate the folding factor value based on the formula described in the paper.
This may be a bug, but acquisition also work by variying the folding factor at va-
lues different that the expressed in the paper. In adition, it is important to point
@ -100,7 +99,6 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui
}
// vector_length_ = (sampled_ms_/folding_factor_) * code_length_;
vector_length_ = sampled_ms_ * samples_per_ms;
bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
if (!bit_transition_flag_)
{
@ -111,8 +109,6 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui
max_dwells_ = 2;
}
dump_filename_ = configuration_->property(role + ".dump_filename",
default_dump_filename);
bool enable_monitor_output = configuration_->property("AcquisitionMonitor.enable_monitor", false);
@ -124,7 +120,6 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui
<< ", Code Length: " << code_length_;
if (item_type_ == "gr_complex")
{
item_size_ = sizeof(gr_complex);
acquisition_cc_ = pcps_quicksync_make_acquisition_cc(folding_factor_,
sampled_ms_, max_dwells_, doppler_max_, fs_in_,
samples_per_ms, code_length_, bit_transition_flag_,
@ -138,7 +133,8 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui
}
else
{
item_size_ = sizeof(gr_complex);
acquisition_cc_ = nullptr;
item_size_ = 0;
LOG(WARNING) << item_type_ << " unknown acquisition item type";
}

View File

@ -40,10 +40,15 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition(
: configuration_(configuration),
gnss_synchro_(nullptr),
role_(role),
item_size_(sizeof(gr_complex)),
threshold_(0.0),
channel_(0),
doppler_max_(configuration_->property(role + ".doppler_max", 5000)),
doppler_step_(0),
sampled_ms_(configuration_->property(role + ".coherent_integration_time_ms", 4)),
tong_init_val_(configuration->property(role + ".tong_init_val", 1)),
tong_max_val_(configuration->property(role + ".tong_max_val", 2)),
tong_max_dwells_(configuration->property(role + ".tong_max_dwells", tong_max_val_ + 1)),
in_streams_(in_streams),
out_streams_(out_streams),
dump_(configuration_->property(role + ".dump", false))
@ -51,19 +56,12 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition(
const std::string default_item_type("gr_complex");
const std::string default_dump_filename("../data/acquisition.dat");
DLOG(INFO) << "role " << role;
item_type_ = configuration_->property(role + ".item_type",
default_item_type);
DLOG(INFO) << "role " << role_;
item_type_ = configuration_->property(role_ + ".item_type", default_item_type);
int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
if (FLAGS_doppler_max != 0)
{
doppler_max_ = FLAGS_doppler_max;
}
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4);
dump_filename_ = configuration_->property(role_ + ".dump_filename", default_dump_filename);
if (sampled_ms_ % 4 != 0)
{
@ -73,12 +71,10 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition(
<< sampled_ms_ << " ms will be used.";
}
tong_init_val_ = configuration->property(role + ".tong_init_val", 1);
tong_max_val_ = configuration->property(role + ".tong_max_val", 2);
tong_max_dwells_ = configuration->property(role + ".tong_max_dwells", tong_max_val_ + 1);
dump_filename_ = configuration_->property(role + ".dump_filename",
default_dump_filename);
if (FLAGS_doppler_max != 0)
{
doppler_max_ = FLAGS_doppler_max;
}
bool enable_monitor_output = configuration_->property("AcquisitionMonitor.enable_monitor", false);
@ -95,7 +91,6 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition(
if (item_type_ == "gr_complex")
{
item_size_ = sizeof(gr_complex);
acquisition_cc_ = pcps_tong_make_acquisition_cc(sampled_ms_, doppler_max_,
fs_in_, samples_per_ms, code_length_, tong_init_val_,
tong_max_val_, tong_max_dwells_, dump_, dump_filename_, enable_monitor_output);
@ -108,7 +103,8 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition(
}
else
{
item_size_ = sizeof(gr_complex);
item_size_ = 0;
acquisition_cc_ = nullptr;
LOG(WARNING) << item_type_ << " unknown acquisition item type";
}

View File

@ -46,21 +46,24 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf(
: configuration_(configuration),
role_(role),
gnss_synchro_(nullptr),
item_size_(sizeof(gr_complex)),
threshold_(0.0),
Zero_padding(configuration_->property(role + ".Zero_padding", 0)),
CAF_window_hz_(configuration_->property(role + ".CAF_window_hz", 0)),
channel_(0),
doppler_max_(configuration_->property(role + ".doppler_max", 5000)),
doppler_step_(0),
sampled_ms_(configuration_->property(role + ".coherent_integration_time_ms", 1)),
max_dwells_(configuration_->property(role + ".max_dwells", 1)),
in_streams_(in_streams),
out_streams_(out_streams),
bit_transition_flag_(configuration_->property(role + ".bit_transition_flag", false)),
dump_(configuration_->property(role + ".dump", false))
{
const std::string default_item_type("gr_complex");
const std::string default_dump_filename("../data/acquisition.dat");
DLOG(INFO) << "role " << role;
item_type_ = configuration_->property(role + ".item_type", default_item_type);
item_type_ = configuration_->property(role_ + ".item_type", default_item_type);
dump_filename_ = configuration_->property(role_ + ".dump_filename", default_dump_filename);
int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 32000000);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
@ -68,9 +71,8 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf(
{
doppler_max_ = FLAGS_doppler_max;
}
CAF_window_hz_ = configuration_->property(role + ".CAF_window_hz", 0);
Zero_padding = configuration_->property(role + ".Zero_padding", 0);
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1);
DLOG(INFO) << "role " << role_;
if (sampled_ms_ > 3)
{
sampled_ms_ = 3;
@ -84,10 +86,6 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf(
std::cout << "Zero padding activated. Changing to 1ms code + 1ms zero padding\n";
}
max_dwells_ = configuration_->property(role + ".max_dwells", 1);
dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
// -- Find number of samples per spreading code (1ms)-------------------------
code_length_ = static_cast<int>(round(static_cast<double>(fs_in_) / GALILEO_E5A_CODE_CHIP_RATE_CPS * static_cast<double>(GALILEO_E5A_CODE_LENGTH_CHIPS)));
@ -106,14 +104,14 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf(
}
if (item_type_ == "gr_complex")
{
item_size_ = sizeof(gr_complex);
acquisition_cc_ = galileo_e5a_noncoherentIQ_make_acquisition_caf_cc(sampled_ms_, max_dwells_,
doppler_max_, fs_in_, code_length_, code_length_, bit_transition_flag_,
dump_, dump_filename_, both_signal_components, CAF_window_hz_, Zero_padding, enable_monitor_output);
}
else
{
item_size_ = sizeof(gr_complex);
item_size_ = 0;
acquisition_cc_ = nullptr;
LOG(WARNING) << item_type_ << " unknown acquisition item type";
}

View File

@ -37,32 +37,31 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(
const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams) : gnss_synchro_(nullptr),
role_(role),
threshold_(0.0),
doppler_center_(0),
channel_(0),
doppler_step_(0),
in_streams_(in_streams),
out_streams_(out_streams)
unsigned int out_streams)
: gnss_synchro_(nullptr),
role_(role),
threshold_(0.0),
doppler_center_(0),
channel_(0),
doppler_step_(0),
in_streams_(in_streams),
out_streams_(out_streams),
acq_pilot_(configuration->property(role + ".acquire_pilot", false)),
acq_iq_(configuration->property(role + ".acquire_iq", false))
{
acq_parameters_.ms_per_code = 1;
acq_parameters_.SetFromConfiguration(configuration, role, GALILEO_E5A_CODE_CHIP_RATE_CPS, GALILEO_E5A_OPT_ACQ_FS_SPS);
DLOG(INFO) << "Role " << role;
acq_parameters_.SetFromConfiguration(configuration, role_, GALILEO_E5A_CODE_CHIP_RATE_CPS, GALILEO_E5A_OPT_ACQ_FS_SPS);
doppler_step_ = static_cast<unsigned int>(acq_parameters_.doppler_step);
item_type_ = acq_parameters_.item_type;
item_size_ = acq_parameters_.it_size;
fs_in_ = acq_parameters_.fs_in;
if (FLAGS_doppler_max != 0)
{
acq_parameters_.doppler_max = FLAGS_doppler_max;
}
doppler_max_ = acq_parameters_.doppler_max;
doppler_step_ = static_cast<unsigned int>(acq_parameters_.doppler_step);
item_type_ = acq_parameters_.item_type;
item_size_ = acq_parameters_.it_size;
fs_in_ = acq_parameters_.fs_in;
acq_pilot_ = configuration->property(role + ".acquire_pilot", false);
acq_iq_ = configuration->property(role + ".acquire_iq", false);
if (acq_iq_)
{
acq_pilot_ = false;
@ -74,6 +73,7 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(
sampled_ms_ = acq_parameters_.sampled_ms;
DLOG(INFO) << "Role " << role_;
acquisition_ = pcps_make_acquisition(acq_parameters_);
DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")";

View File

@ -33,28 +33,27 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(
const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams) : gnss_synchro_(nullptr),
role_(role),
doppler_center_(0),
channel_(0),
doppler_step_(0),
in_streams_(in_streams),
out_streams_(out_streams)
unsigned int out_streams)
: gnss_synchro_(nullptr),
role_(role),
doppler_center_(0),
channel_(0),
doppler_step_(0),
in_streams_(in_streams),
out_streams_(out_streams),
acq_pilot_(configuration->property(role + ".acquire_pilot", false)),
acq_iq_(configuration->property(role + ".acquire_iq", false))
{
acq_parameters_.SetFromConfiguration(configuration, role, fpga_downsampling_factor, fpga_buff_num, fpga_blk_exp, GALILEO_E5A_CODE_CHIP_RATE_CPS, GALILEO_E5A_CODE_LENGTH_CHIPS);
DLOG(INFO) << "Role " << role;
acq_parameters_.SetFromConfiguration(configuration, role_, fpga_downsampling_factor, fpga_buff_num, fpga_blk_exp, GALILEO_E5A_CODE_CHIP_RATE_CPS, GALILEO_E5A_CODE_LENGTH_CHIPS);
doppler_step_ = static_cast<unsigned int>(acq_parameters_.doppler_step);
fs_in_ = acq_parameters_.fs_in;
if (FLAGS_doppler_max != 0)
{
acq_parameters_.doppler_max = FLAGS_doppler_max;
}
doppler_max_ = acq_parameters_.doppler_max;
doppler_step_ = static_cast<unsigned int>(acq_parameters_.doppler_step);
fs_in_ = acq_parameters_.fs_in;
acq_pilot_ = configuration->property(role + ".acquire_pilot", false);
acq_iq_ = configuration->property(role + ".acquire_iq", false);
if (acq_iq_)
{
acq_pilot_ = false;
@ -138,6 +137,7 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(
acq_parameters_.all_fft_codes = d_all_fft_codes_.data();
DLOG(INFO) << "role " << role_;
acquisition_fpga_ = pcps_make_acquisition_fpga(acq_parameters_);
if (in_streams_ > 1)

View File

@ -37,32 +37,31 @@ namespace own = gsl;
GalileoE5bPcpsAcquisition::GalileoE5bPcpsAcquisition(const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams) : gnss_synchro_(nullptr),
role_(role),
threshold_(0.0),
doppler_center_(0),
channel_(0),
doppler_step_(0),
in_streams_(in_streams),
out_streams_(out_streams)
unsigned int out_streams)
: gnss_synchro_(nullptr),
role_(role),
threshold_(0.0),
doppler_center_(0),
channel_(0),
doppler_step_(0),
in_streams_(in_streams),
out_streams_(out_streams),
acq_pilot_(configuration->property(role + ".acquire_pilot", false)),
acq_iq_(configuration->property(role + ".acquire_iq", false))
{
acq_parameters_.ms_per_code = 1;
acq_parameters_.SetFromConfiguration(configuration, role, GALILEO_E5B_CODE_CHIP_RATE_CPS, GALILEO_E5B_OPT_ACQ_FS_SPS);
DLOG(INFO) << "Role " << role;
acq_parameters_.SetFromConfiguration(configuration, role_, GALILEO_E5B_CODE_CHIP_RATE_CPS, GALILEO_E5B_OPT_ACQ_FS_SPS);
doppler_step_ = static_cast<unsigned int>(acq_parameters_.doppler_step);
item_type_ = acq_parameters_.item_type;
item_size_ = acq_parameters_.it_size;
fs_in_ = acq_parameters_.fs_in;
if (FLAGS_doppler_max != 0)
{
acq_parameters_.doppler_max = FLAGS_doppler_max;
}
doppler_max_ = acq_parameters_.doppler_max;
doppler_step_ = static_cast<unsigned int>(acq_parameters_.doppler_step);
item_type_ = acq_parameters_.item_type;
item_size_ = acq_parameters_.it_size;
fs_in_ = acq_parameters_.fs_in;
acq_pilot_ = configuration->property(role + ".acquire_pilot", false);
acq_iq_ = configuration->property(role + ".acquire_iq", false);
if (acq_iq_)
{
acq_pilot_ = false;
@ -74,6 +73,7 @@ GalileoE5bPcpsAcquisition::GalileoE5bPcpsAcquisition(const ConfigurationInterfac
sampled_ms_ = acq_parameters_.sampled_ms;
DLOG(INFO) << "role " << role_;
acquisition_ = pcps_make_acquisition(acq_parameters_);
DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")";

View File

@ -32,26 +32,27 @@
GalileoE5bPcpsAcquisitionFpga::GalileoE5bPcpsAcquisitionFpga(const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams) : gnss_synchro_(nullptr),
role_(role),
doppler_center_(0),
channel_(0),
doppler_step_(0),
in_streams_(in_streams),
out_streams_(out_streams)
unsigned int out_streams)
: gnss_synchro_(nullptr),
role_(role),
doppler_center_(0),
channel_(0),
doppler_step_(0),
in_streams_(in_streams),
out_streams_(out_streams),
acq_pilot_(configuration->property(role + ".acquire_pilot", false)),
acq_iq_(configuration->property(role + ".acquire_iq", false))
{
acq_parameters_.SetFromConfiguration(configuration, role, fpga_downsampling_factor, fpga_buff_num, fpga_blk_exp, GALILEO_E5B_CODE_CHIP_RATE_CPS, GALILEO_E5B_CODE_LENGTH_CHIPS);
acq_parameters_.SetFromConfiguration(configuration, role_, fpga_downsampling_factor, fpga_buff_num, fpga_blk_exp, GALILEO_E5B_CODE_CHIP_RATE_CPS, GALILEO_E5B_CODE_LENGTH_CHIPS);
doppler_step_ = static_cast<unsigned int>(acq_parameters_.doppler_step);
fs_in_ = acq_parameters_.fs_in;
if (FLAGS_doppler_max != 0)
{
acq_parameters_.doppler_max = FLAGS_doppler_max;
}
doppler_max_ = acq_parameters_.doppler_max;
doppler_step_ = static_cast<unsigned int>(acq_parameters_.doppler_step);
fs_in_ = acq_parameters_.fs_in;
acq_pilot_ = configuration->property(role + ".acquire_pilot", false);
acq_iq_ = configuration->property(role + ".acquire_iq", false);
if (acq_iq_)
{
acq_pilot_ = false;

View File

@ -31,36 +31,39 @@ GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler(
const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams) : role_(role),
doppler_max_(configuration->property(role + ".doppler_max", 5000)),
in_streams_(in_streams),
out_streams_(out_streams),
dump_(configuration->property(role + ".dump", false))
unsigned int out_streams)
: role_(role),
gnss_synchro_(nullptr),
item_size_(sizeof(gr_complex)),
threshold_(0.0),
doppler_max_(configuration->property(role + ".doppler_max", 5000)),
max_dwells_(configuration->property(role + ".max_dwells", 1)),
channel_(0),
doppler_step_(0),
sampled_ms_(configuration->property(role + ".coherent_integration_time_ms", 1)),
in_streams_(in_streams),
out_streams_(out_streams),
dump_(configuration->property(role + ".dump", false))
{
const std::string default_item_type("gr_complex");
std::string default_dump_filename = "./acquisition.mat";
DLOG(INFO) << "role " << role;
Acq_Conf acq_parameters = Acq_Conf();
item_type_ = configuration->property(role + ".item_type", default_item_type);
item_type_ = configuration->property(role_ + ".item_type", default_item_type);
int64_t fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in_ = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
acq_parameters.fs_in = fs_in_;
acq_parameters.samples_per_chip = static_cast<unsigned int>(ceil(GPS_L1_CA_CHIP_PERIOD_S * static_cast<float>(acq_parameters.fs_in)));
acq_parameters.dump = dump_;
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
dump_filename_ = configuration->property(role_ + ".dump_filename", default_dump_filename);
acq_parameters.dump_filename = dump_filename_;
if (FLAGS_doppler_max != 0)
{
doppler_max_ = FLAGS_doppler_max;
}
acq_parameters.doppler_max = doppler_max_;
sampled_ms_ = configuration->property(role + ".coherent_integration_time_ms", 1);
acq_parameters.sampled_ms = sampled_ms_;
max_dwells_ = configuration->property(role + ".max_dwells", 1);
acq_parameters.max_dwells = max_dwells_;
acq_parameters.blocking_on_standby = configuration->property(role + ".blocking_on_standby", false);
// -- Find number of samples per spreading code -------------------------
@ -68,22 +71,18 @@ GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler(
acq_parameters.samples_per_ms = static_cast<float>(vector_length_);
code_ = std::vector<std::complex<float>>(vector_length_);
DLOG(INFO) << "role " << role_;
if (item_type_ == "gr_complex")
{
item_size_ = sizeof(gr_complex);
acquisition_cc_ = pcps_make_acquisition_fine_doppler_cc(acq_parameters);
}
else
{
item_size_ = sizeof(gr_complex);
item_size_ = 0;
acquisition_cc_ = nullptr;
LOG(WARNING) << item_type_ << " unknown acquisition item type";
}
channel_ = 0;
threshold_ = 0.0;
doppler_step_ = 0;
gnss_synchro_ = nullptr;
if (in_streams_ > 1)
{
LOG(ERROR) << "This implementation only supports one input stream";

View File

@ -30,18 +30,24 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition(
const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams) : role_(role),
doppler_max_(configuration->property(role + ".doppler_max", 5000)),
in_streams_(in_streams),
out_streams_(out_streams),
dump_(configuration->property(role + ".dump", false))
unsigned int out_streams)
: role_(role),
gnss_synchro_(nullptr),
item_size_(sizeof(gr_complex)),
threshold_(0.0),
doppler_max_(configuration->property(role + ".doppler_max", 5000)),
max_dwells_(configuration->property(role + ".max_dwells", 1)),
channel_(0),
doppler_step_(0),
sampled_ms_(configuration->property(role + ".coherent_integration_time_ms", 1)),
in_streams_(in_streams),
out_streams_(out_streams),
dump_(configuration->property(role + ".dump", false))
{
const std::string default_item_type("gr_complex");
std::string default_dump_filename = "./data/acquisition.dat";
DLOG(INFO) << "role " << role;
item_type_ = configuration->property(role + ".item_type", default_item_type);
dump_filename_ = configuration->property(role_ + ".dump_filename", default_dump_filename);
item_type_ = configuration->property(role_ + ".item_type", default_item_type);
int64_t fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in_ = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
@ -49,10 +55,8 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition(
{
doppler_max_ = FLAGS_doppler_max;
}
doppler_min_ = configuration->property(role + ".doppler_min", -doppler_max_);
sampled_ms_ = configuration->property(role + ".coherent_integration_time_ms", 1);
max_dwells_ = configuration->property(role + ".max_dwells", 1);
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
doppler_min_ = configuration->property(role_ + ".doppler_min", -doppler_max_);
bool enable_monitor_output = configuration->property("AcquisitionMonitor.enable_monitor", false);
// --- Find number of samples per spreading code -------------------------
@ -60,24 +64,20 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition(
code_ = std::vector<std::complex<float>>(vector_length_);
DLOG(INFO) << "role " << role_;
if (item_type_ == "gr_complex")
{
item_size_ = sizeof(gr_complex);
acquisition_cc_ = pcps_make_assisted_acquisition_cc(max_dwells_, sampled_ms_,
doppler_max_, doppler_min_, fs_in_, vector_length_,
dump_, dump_filename_, enable_monitor_output);
}
else
{
item_size_ = sizeof(gr_complex);
item_size_ = 0;
acquisition_cc_ = nullptr;
LOG(WARNING) << item_type_ << " unknown acquisition item type";
}
channel_ = 0;
threshold_ = 0.0;
doppler_step_ = 0;
gnss_synchro_ = nullptr;
if (in_streams_ > 1)
{
LOG(ERROR) << "This implementation only supports one input stream";

View File

@ -41,20 +41,20 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition(
: configuration_(configuration),
role_(role),
gnss_synchro_(nullptr),
item_size_(sizeof(gr_complex)),
threshold_(0.0),
channel_(0),
doppler_max_(configuration->property(role + ".doppler_max", 5000)),
doppler_step_(0),
sampled_ms_(configuration_->property(role + ".coherent_integration_time_ms", 4)),
in_streams_(in_streams),
out_streams_(out_streams),
bit_transition_flag_(configuration_->property(role + ".bit_transition_flag", false)),
dump_(configuration_->property(role + ".dump", false))
{
const std::string default_item_type("gr_complex");
std::string default_dump_filename = "./data/acquisition.dat";
DLOG(INFO) << "role " << role;
item_type_ = configuration_->property(role + ".item_type", default_item_type);
item_type_ = configuration_->property(role_ + ".item_type", default_item_type);
int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
@ -62,14 +62,13 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition(
{
doppler_max_ = FLAGS_doppler_max;
}
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4);
// -- Find number of samples per spreading code -------------------------
code_length_ = static_cast<unsigned int>(round(fs_in_ / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)));
/* Calculate the folding factor value based on the calculations */
/* Calculate the folding factor value */
auto temp = static_cast<unsigned int>(ceil(sqrt(log2(code_length_))));
folding_factor_ = configuration_->property(role + ".folding_factor", temp);
folding_factor_ = configuration_->property(role_ + ".folding_factor", temp);
if (sampled_ms_ % folding_factor_ != 0)
{
@ -90,23 +89,24 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition(
}
vector_length_ = code_length_ * sampled_ms_;
bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
if (!bit_transition_flag_)
{
max_dwells_ = configuration_->property(role + ".max_dwells", 1);
max_dwells_ = configuration_->property(role_ + ".max_dwells", 1);
}
else
{
max_dwells_ = 2;
}
dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
dump_filename_ = configuration_->property(role_ + ".dump_filename", default_dump_filename);
bool enable_monitor_output = configuration_->property("AcquisitionMonitor.enable_monitor", false);
int samples_per_ms = round(code_length_);
code_ = std::vector<std::complex<float>>(code_length_);
DLOG(INFO) << "role " << role_;
/* Object relevant information for debugging */
LOG(INFO) << "Implementation: " << this->implementation()
<< ", Vector Length: " << vector_length_
@ -117,7 +117,6 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition(
if (item_type_ == "gr_complex")
{
item_size_ = sizeof(gr_complex);
acquisition_cc_ = pcps_quicksync_make_acquisition_cc(folding_factor_,
sampled_ms_, max_dwells_, doppler_max_, fs_in_,
samples_per_ms, code_length_, bit_transition_flag_,
@ -131,7 +130,8 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition(
}
else
{
item_size_ = sizeof(gr_complex);
item_size_ = 0;
acquisition_cc_ = nullptr;
LOG(WARNING) << item_type_ << " unknown acquisition item type";
}

View File

@ -40,10 +40,15 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition(
: configuration_(configuration),
gnss_synchro_(nullptr),
role_(role),
item_size_(sizeof(gr_complex)),
threshold_(0.0),
channel_(0),
doppler_max_(configuration->property(role + ".doppler_max", 5000)),
doppler_step_(0),
sampled_ms_(configuration_->property(role + ".coherent_integration_time_ms", 1)),
tong_init_val_(configuration->property(role + ".tong_init_val", 1)),
tong_max_val_(configuration->property(role + ".tong_max_val", 2)),
tong_max_dwells_(configuration->property(role + ".tong_max_dwells", tong_max_val_ + 1)),
in_streams_(in_streams),
out_streams_(out_streams),
dump_(configuration_->property(role + ".dump", false))
@ -51,25 +56,17 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition(
const std::string default_item_type("gr_complex");
std::string default_dump_filename = "./data/acquisition.dat";
DLOG(INFO) << "role " << role;
item_type_ = configuration_->property(role + ".item_type", default_item_type);
DLOG(INFO) << "role " << role_;
item_type_ = configuration_->property(role_ + ".item_type", default_item_type);
int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
dump_filename_ = configuration_->property(role_ + ".dump_filename", default_dump_filename);
if (FLAGS_doppler_max != 0)
{
doppler_max_ = FLAGS_doppler_max;
}
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1);
tong_init_val_ = configuration->property(role + ".tong_init_val", 1);
tong_max_val_ = configuration->property(role + ".tong_max_val", 2);
tong_max_dwells_ = configuration->property(role + ".tong_max_dwells", tong_max_val_ + 1);
dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
bool enable_monitor_output = configuration_->property("AcquisitionMonitor.enable_monitor", false);
// -- Find number of samples per spreading code -------------------------
@ -81,7 +78,6 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition(
if (item_type_ == "gr_complex")
{
item_size_ = sizeof(gr_complex);
acquisition_cc_ = pcps_tong_make_acquisition_cc(sampled_ms_, doppler_max_, fs_in_,
code_length_, code_length_, tong_init_val_, tong_max_val_, tong_max_dwells_,
dump_, dump_filename_, enable_monitor_output);
@ -93,7 +89,8 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition(
}
else
{
item_size_ = sizeof(gr_complex);
acquisition_cc_ = nullptr;
item_size_ = 0;
LOG(WARNING) << item_type_ << " unknown acquisition item type";
}