Fix QuickSync acquisition

This commit is contained in:
Carles Fernandez
2026-09-26 11:38:18 +02:00
parent a967539ecb
commit 28acfb7d9d
4 changed files with 27 additions and 4 deletions
@@ -262,6 +262,12 @@ Acq_Conf get_acq_conf(
acq_parameters.num_codes = acq_parameters.sampled_ms / ms_per_code;
acq_parameters.code_length = static_cast<unsigned int>(round(acq_parameters.fs_in / (chip_rate / code_length_chips)));
acq_parameters.vector_length = acq_parameters.code_length * acq_parameters.num_codes;
if (default_folding_factor)
{
// QuickSync folds folding_factor^2 chunks of code_length / folding_factor
// samples, so each input vector must hold folding_factor full code periods
acq_parameters.vector_length *= acq_parameters.folding_factor;
}
acq_parameters.threshold = threshold_compute->calculate_threshold(acq_parameters);
if (implementation == "GPS_L1_CA_PCPS_Acquisition_Fine_Doppler")
@@ -24,6 +24,8 @@
#include <cmath>
#include <exception>
#include <sstream>
#include <stdexcept>
#include <string>
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
@@ -73,6 +75,15 @@ pcps_quicksync_acquisition_cc::pcps_quicksync_acquisition_cc(const Acq_Conf& con
d_magnitude_folded(d_fft_size),
d_possible_delay(d_folding_factor)
{
// Each call to general_work() processes d_samples_per_code * d_folding_factor
// samples from a single input item, so the item must be at least that long
if (static_cast<int64_t>(d_vector_length) < static_cast<int64_t>(d_samples_per_code) * static_cast<int64_t>(d_folding_factor))
{
throw std::invalid_argument("pcps_quicksync_acquisition_cc: input vector length (" + std::to_string(d_vector_length) +
" samples) is shorter than folding_factor code periods (" +
std::to_string(static_cast<int64_t>(d_samples_per_code) * static_cast<int64_t>(d_folding_factor)) + " samples)");
}
this->message_port_register_out(pmt::mp("events"));
// Create the d_code vector, which would store the values of the code in its
@@ -502,8 +502,6 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::wait_message()
while (!stop)
{
acquisition->reset();
begin = std::chrono::system_clock::now();
channel_internal_queue.wait_and_pop(message);
@@ -514,6 +512,11 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::wait_message()
mean_acq_time_us += elapsed_seconds.count() * 1e6;
process_message();
if (!stop)
{
acquisition->reset(); // arm the next realization
}
}
}
@@ -491,8 +491,6 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::wait_message()
while (!stop)
{
acquisition->reset();
start = std::chrono::system_clock::now();
channel_internal_queue.wait_and_pop(message);
@@ -503,6 +501,11 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::wait_message()
mean_acq_time_us += elapsed_seconds.count() * 1e6;
process_message();
if (!stop)
{
acquisition->reset(); // arm the next realization
}
}
}