mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-18 21:23:02 +00:00
Fix a bug in signal sources that made the number of samples parameter ignored when too large (Fixes: #396)
This commit is contained in:
parent
bb540c7b48
commit
fb8e5e5c47
@ -79,6 +79,8 @@ SPDX-FileCopyrightText: 2011-2020 Carles Fernandez-Prades <carles.fernandez@cttc
|
||||
- Updated version of the Contributor Covenant to version 2.0.
|
||||
- Added a Matlab script to quantize the input signal with a given number of bits
|
||||
per sample.
|
||||
- Fixed a bug in signal sources that made the number of samples parameter
|
||||
ignored when too large (that is, larger than 2^31-1).
|
||||
|
||||
|
||||
|
||||
|
@ -51,8 +51,8 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(const ConfigurationInterface *con
|
||||
double default_manual_gain_rx2 = 64.0;
|
||||
uint64_t default_bandwidth = 12500000;
|
||||
std::string default_rf_port_select("A_BALANCED");
|
||||
freq_ = configuration->property(role + ".freq", GPS_L1_FREQ_HZ);
|
||||
sample_rate_ = configuration->property(role + ".sampling_frequency", 12500000);
|
||||
freq_ = configuration->property(role + ".freq", static_cast<uint64_t>(GPS_L1_FREQ_HZ));
|
||||
sample_rate_ = configuration->property(role + ".sampling_frequency", 12500000ULL);
|
||||
bandwidth_ = configuration->property(role + ".bandwidth", default_bandwidth);
|
||||
quadrature_ = configuration->property(role + ".quadrature", true);
|
||||
rf_dc_ = configuration->property(role + ".rf_dc", true);
|
||||
@ -78,11 +78,11 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(const ConfigurationInterface *con
|
||||
Fpass_ = configuration->property(role + ".Fpass", 0.0);
|
||||
Fstop_ = configuration->property(role + ".Fstop", 0.0);
|
||||
enable_dds_lo_ = configuration->property(role + ".enable_dds_lo", false);
|
||||
freq_dds_tx_hz_ = configuration->property(role + ".freq_dds_tx_hz", 10000);
|
||||
freq_rf_tx_hz_ = configuration->property(role + ".freq_rf_tx_hz", GPS_L1_FREQ_HZ - GPS_L5_FREQ_HZ - freq_dds_tx_hz_);
|
||||
freq_dds_tx_hz_ = configuration->property(role + ".freq_dds_tx_hz", 10000ULL);
|
||||
freq_rf_tx_hz_ = configuration->property(role + ".freq_rf_tx_hz", static_cast<uint64_t>(GPS_L1_FREQ_HZ - GPS_L5_FREQ_HZ - freq_dds_tx_hz_));
|
||||
scale_dds_dbfs_ = configuration->property(role + ".scale_dds_dbfs", -3.0);
|
||||
tx_attenuation_db_ = configuration->property(role + ".tx_attenuation_db", default_tx_attenuation_db);
|
||||
tx_bandwidth_ = configuration->property(role + ".tx_bandwidth", 500000);
|
||||
tx_bandwidth_ = configuration->property(role + ".tx_bandwidth", 500000ULL);
|
||||
phase_dds_deg_ = configuration->property(role + ".phase_dds_deg", 0.0);
|
||||
|
||||
rf_shutdown_ = configuration->property(role + ".rf_shutdown", FLAGS_rf_shutdown);
|
||||
|
@ -41,8 +41,8 @@ FileSignalSource::FileSignalSource(const ConfigurationInterface* configuration,
|
||||
|
||||
double default_seconds_to_skip = 0.0;
|
||||
size_t header_size = 0;
|
||||
samples_ = configuration->property(role + ".samples", 0);
|
||||
sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0);
|
||||
samples_ = configuration->property(role + ".samples", 0ULL);
|
||||
sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0LL);
|
||||
filename_ = configuration->property(role + ".filename", default_filename);
|
||||
|
||||
// override value with commandline flag, if present
|
||||
|
@ -41,9 +41,9 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(const ConfigurationInterface *configu
|
||||
std::string default_gain_mode("slow_attack");
|
||||
double default_tx_attenuation_db = -10.0;
|
||||
uri_ = configuration->property(role + ".device_address", std::string("192.168.2.1"));
|
||||
freq_ = configuration->property(role + ".freq", GPS_L1_FREQ_HZ);
|
||||
sample_rate_ = configuration->property(role + ".sampling_frequency", 2600000);
|
||||
bandwidth_ = configuration->property(role + ".bandwidth", 2000000);
|
||||
freq_ = configuration->property(role + ".freq", static_cast<uint64_t>(GPS_L1_FREQ_HZ));
|
||||
sample_rate_ = configuration->property(role + ".sampling_frequency", 2600000ULL);
|
||||
bandwidth_ = configuration->property(role + ".bandwidth", 2000000ULL);
|
||||
rx1_en_ = configuration->property(role + ".rx1_enable", true);
|
||||
rx2_en_ = configuration->property(role + ".rx2_enable", false);
|
||||
buffer_size_ = configuration->property(role + ".buffer_size", 0xA0000);
|
||||
@ -71,18 +71,18 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(const ConfigurationInterface *configu
|
||||
Fstop_ = configuration->property(role + ".Fstop", 0.0);
|
||||
|
||||
item_type_ = configuration->property(role + ".item_type", default_item_type);
|
||||
samples_ = configuration->property(role + ".samples", 0);
|
||||
samples_ = configuration->property(role + ".samples", 0LL);
|
||||
dump_ = configuration->property(role + ".dump", false);
|
||||
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file);
|
||||
|
||||
// AD9361 Local Oscillator generation for dual band operation
|
||||
enable_dds_lo_ = configuration->property(role + ".enable_dds_lo", false);
|
||||
freq_dds_tx_hz_ = configuration->property(role + ".freq_dds_tx_hz", 10000);
|
||||
freq_rf_tx_hz_ = configuration->property(role + ".freq_rf_tx_hz", GPS_L1_FREQ_HZ - GPS_L2_FREQ_HZ - freq_dds_tx_hz_);
|
||||
freq_dds_tx_hz_ = configuration->property(role + ".freq_dds_tx_hz", 10000ULL);
|
||||
freq_rf_tx_hz_ = configuration->property(role + ".freq_rf_tx_hz", static_cast<uint64_t>(GPS_L1_FREQ_HZ - GPS_L2_FREQ_HZ - freq_dds_tx_hz_));
|
||||
scale_dds_dbfs_ = configuration->property(role + ".scale_dds_dbfs", 0.0);
|
||||
phase_dds_deg_ = configuration->property(role + ".phase_dds_deg", 0.0);
|
||||
tx_attenuation_db_ = configuration->property(role + ".tx_attenuation_db", default_tx_attenuation_db);
|
||||
tx_bandwidth_ = configuration->property(role + ".tx_bandwidth", 500000);
|
||||
tx_bandwidth_ = configuration->property(role + ".tx_bandwidth", 500000ULL);
|
||||
|
||||
rf_shutdown_ = configuration->property(role + ".rf_shutdown", FLAGS_rf_shutdown);
|
||||
|
||||
|
@ -40,8 +40,8 @@ MultichannelFileSignalSource::MultichannelFileSignalSource(const ConfigurationIn
|
||||
|
||||
double default_seconds_to_skip = 0.0;
|
||||
size_t header_size = 0;
|
||||
samples_ = configuration->property(role + ".samples", 0);
|
||||
sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0);
|
||||
samples_ = configuration->property(role + ".samples", 0ULL);
|
||||
sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0LL);
|
||||
n_channels_ = configuration->property(role + ".total_channels", 1);
|
||||
|
||||
for (unsigned int n = 0; n < n_channels_; n++)
|
||||
|
@ -39,8 +39,8 @@ NsrFileSignalSource::NsrFileSignalSource(const ConfigurationInterface* configura
|
||||
std::string default_item_type = "byte";
|
||||
std::string default_dump_filename = "../data/my_capture_dump.dat";
|
||||
|
||||
samples_ = configuration->property(role + ".samples", 0);
|
||||
sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0);
|
||||
samples_ = configuration->property(role + ".samples", 0ULL);
|
||||
sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0LL);
|
||||
filename_ = configuration->property(role + ".filename", default_filename);
|
||||
|
||||
// override value with commandline flag, if present
|
||||
|
@ -37,7 +37,7 @@ OsmosdrSignalSource::OsmosdrSignalSource(const ConfigurationInterface* configura
|
||||
std::string empty = "";
|
||||
std::string default_dump_file = "./data/signal_source.dat";
|
||||
std::string default_item_type = "gr_complex";
|
||||
samples_ = configuration->property(role + ".samples", 0);
|
||||
samples_ = configuration->property(role + ".samples", 0LL);
|
||||
dump_ = configuration->property(role + ".dump", false);
|
||||
dump_filename_ = configuration->property(role + ".dump_filename",
|
||||
default_dump_file);
|
||||
|
@ -34,9 +34,9 @@ PlutosdrSignalSource::PlutosdrSignalSource(const ConfigurationInterface* configu
|
||||
std::string default_dump_file = "./data/signal_source.dat";
|
||||
std::string default_gain_mode("slow_attack");
|
||||
uri_ = configuration->property(role + ".device_address", std::string("192.168.2.1"));
|
||||
freq_ = configuration->property(role + ".freq", GPS_L1_FREQ_HZ);
|
||||
sample_rate_ = configuration->property(role + ".sampling_frequency", 3000000);
|
||||
bandwidth_ = configuration->property(role + ".bandwidth", 2000000);
|
||||
freq_ = configuration->property(role + ".freq", static_cast<uint64_t>(GPS_L1_FREQ_HZ));
|
||||
sample_rate_ = configuration->property(role + ".sampling_frequency", 3000000ULL);
|
||||
bandwidth_ = configuration->property(role + ".bandwidth", 2000000ULL);
|
||||
buffer_size_ = configuration->property(role + ".buffer_size", 0xA0000);
|
||||
quadrature_ = configuration->property(role + ".quadrature", true);
|
||||
rf_dc_ = configuration->property(role + ".rf_dc", true);
|
||||
@ -57,7 +57,7 @@ PlutosdrSignalSource::PlutosdrSignalSource(const ConfigurationInterface* configu
|
||||
Fpass_ = configuration->property(role + ".Fpass", 0.0);
|
||||
Fstop_ = configuration->property(role + ".Fstop", 0.0);
|
||||
item_type_ = configuration->property(role + ".item_type", default_item_type);
|
||||
samples_ = configuration->property(role + ".samples", 0);
|
||||
samples_ = configuration->property(role + ".samples", 0LL);
|
||||
dump_ = configuration->property(role + ".dump", false);
|
||||
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file);
|
||||
|
||||
|
@ -42,7 +42,7 @@ RtlTcpSignalSource::RtlTcpSignalSource(const ConfigurationInterface* configurati
|
||||
std::string empty = "";
|
||||
std::string default_dump_file = "./data/signal_source.dat";
|
||||
std::string default_item_type = "gr_complex";
|
||||
samples_ = configuration->property(role + ".samples", 0);
|
||||
samples_ = configuration->property(role + ".samples", 0ULL);
|
||||
dump_ = configuration->property(role + ".dump", false);
|
||||
dump_filename_ = configuration->property(role + ".dump_filename",
|
||||
default_dump_file);
|
||||
|
@ -38,8 +38,8 @@ SpirFileSignalSource::SpirFileSignalSource(const ConfigurationInterface* configu
|
||||
std::string default_item_type = "int";
|
||||
std::string default_dump_filename = "../data/my_capture_dump.dat";
|
||||
|
||||
samples_ = configuration->property(role + ".samples", 0);
|
||||
sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0);
|
||||
samples_ = configuration->property(role + ".samples", 0ULL);
|
||||
sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0LL);
|
||||
filename_ = configuration->property(role + ".filename", default_filename);
|
||||
|
||||
// override value with commandline flag, if present
|
||||
|
@ -35,8 +35,8 @@ SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(const ConfigurationInte
|
||||
std::string default_dump_filename = "../data/my_capture_dump.dat";
|
||||
item_type_ = "int";
|
||||
|
||||
samples_ = configuration->property(role + ".samples", 0);
|
||||
sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0);
|
||||
samples_ = configuration->property(role + ".samples", 0ULL);
|
||||
sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0LL);
|
||||
filename_ = configuration->property(role + ".filename", default_filename);
|
||||
repeat_ = configuration->property(role + ".repeat", false);
|
||||
dump_ = configuration->property(role + ".dump", false);
|
||||
@ -47,7 +47,7 @@ SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(const ConfigurationInte
|
||||
n_channels_ = configuration->property(role + ".total_channels", 1);
|
||||
sel_ch_ = configuration->property(role + ".sel_ch", 1);
|
||||
item_size_ = sizeof(int32_t);
|
||||
int64_t bytes_seek = configuration->property(role + ".bytes_to_skip", 65536);
|
||||
int64_t bytes_seek = configuration->property(role + ".bytes_to_skip", 65536LL);
|
||||
double sample_size_byte = static_cast<double>(adc_bits_) / 4.0;
|
||||
|
||||
if (sel_ch_ > n_channels_)
|
||||
|
@ -43,8 +43,8 @@ TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(
|
||||
std::string default_item_type = "byte";
|
||||
std::string default_dump_filename = "../data/my_capture_dump.dat";
|
||||
|
||||
samples_ = configuration->property(role + ".samples", 0);
|
||||
sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0);
|
||||
samples_ = configuration->property(role + ".samples", 0ULL);
|
||||
sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0LL);
|
||||
filename_ = configuration->property(role + ".filename", default_filename);
|
||||
|
||||
// override value with commandline flag, if present
|
||||
|
@ -47,8 +47,8 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(
|
||||
std::string default_sample_type = "real";
|
||||
double default_seconds_to_skip = 0.0;
|
||||
|
||||
samples_ = configuration->property(role + ".samples", 0);
|
||||
sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0);
|
||||
samples_ = configuration->property(role + ".samples", 0ULL);
|
||||
sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0LL);
|
||||
filename_ = configuration->property(role + ".filename", default_filename);
|
||||
|
||||
// override value with commandline flag, if present
|
||||
|
Loading…
Reference in New Issue
Block a user