mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2026-09-05 00:48:54 +00:00
Merge branch 'next' into has-fixes
This commit is contained in:
@@ -7,30 +7,12 @@
|
||||
|
||||
set(ACQ_ADAPTER_SOURCES
|
||||
pcps_acquisition_adapter.cc
|
||||
base_pcps_acquisition_custom.cc
|
||||
gps_l1_ca_pcps_assisted_acquisition.cc
|
||||
gps_l1_ca_pcps_acquisition_fine_doppler.cc
|
||||
gps_l1_ca_pcps_tong_acquisition.cc
|
||||
gps_l1_ca_pcps_quicksync_acquisition.cc
|
||||
galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc
|
||||
galileo_e1_pcps_quicksync_ambiguous_acquisition.cc
|
||||
galileo_e1_pcps_tong_ambiguous_acquisition.cc
|
||||
galileo_e1_pcps_8ms_ambiguous_acquisition.cc
|
||||
galileo_e5a_noncoherent_iq_acquisition_caf.cc
|
||||
pcps_acquisition_adapter_custom.cc
|
||||
)
|
||||
|
||||
set(ACQ_ADAPTER_HEADERS
|
||||
pcps_acquisition_adapter.h
|
||||
base_pcps_acquisition_custom.h
|
||||
gps_l1_ca_pcps_assisted_acquisition.h
|
||||
gps_l1_ca_pcps_acquisition_fine_doppler.h
|
||||
gps_l1_ca_pcps_tong_acquisition.h
|
||||
gps_l1_ca_pcps_quicksync_acquisition.h
|
||||
galileo_e1_pcps_cccwsr_ambiguous_acquisition.h
|
||||
galileo_e1_pcps_quicksync_ambiguous_acquisition.h
|
||||
galileo_e1_pcps_tong_ambiguous_acquisition.h
|
||||
galileo_e1_pcps_8ms_ambiguous_acquisition.h
|
||||
galileo_e5a_noncoherent_iq_acquisition_caf.h
|
||||
pcps_acquisition_adapter_custom.h
|
||||
)
|
||||
|
||||
if(ENABLE_FPGA)
|
||||
@@ -42,16 +24,6 @@ if(ENABLE_FPGA)
|
||||
)
|
||||
endif()
|
||||
|
||||
if(ENABLE_OPENCL)
|
||||
set(ACQ_ADAPTER_SOURCES
|
||||
${ACQ_ADAPTER_SOURCES}
|
||||
gps_l1_ca_pcps_opencl_acquisition.cc
|
||||
)
|
||||
set(ACQ_ADAPTER_HEADERS ${ACQ_ADAPTER_HEADERS}
|
||||
gps_l1_ca_pcps_opencl_acquisition.h
|
||||
)
|
||||
endif()
|
||||
|
||||
list(SORT ACQ_ADAPTER_HEADERS)
|
||||
list(SORT ACQ_ADAPTER_SOURCES)
|
||||
|
||||
|
||||
@@ -1,298 +0,0 @@
|
||||
/*!
|
||||
* \file base_ca_pcps_acquisition_custom.h
|
||||
* \brief Adapts a PCPS acquisition block to an AcquisitionInterface
|
||||
* \authors <ul>
|
||||
* <li> Mathieu Favreau, 2025. favreau.mathieu(at)hotmail.com
|
||||
* </ul>
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2025 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "base_pcps_acquisition_custom.h"
|
||||
#include "configuration_interface.h"
|
||||
#include "gnss_sdr_flags.h"
|
||||
#include <boost/math/distributions/exponential.hpp>
|
||||
|
||||
#if USE_GLOG_AND_GFLAGS
|
||||
#include <glog/logging.h>
|
||||
#else
|
||||
#include <absl/log/log.h>
|
||||
#endif
|
||||
|
||||
|
||||
namespace
|
||||
{
|
||||
const std::string default_dump_filename("./acquisition.dat");
|
||||
|
||||
Acq_Conf get_acq_conf(
|
||||
const ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
double chip_rate,
|
||||
double code_length_chips,
|
||||
double opt_freq,
|
||||
uint32_t ms_per_code,
|
||||
uint32_t max_sampled_ms,
|
||||
const ThresholdComputeInterface& threshold_compute)
|
||||
{
|
||||
Acq_Conf acq_parameters;
|
||||
acq_parameters.ms_per_code = ms_per_code;
|
||||
acq_parameters.sampled_ms = ms_per_code; // Set as default value
|
||||
acq_parameters.dump_filename = default_dump_filename; // Set as default value
|
||||
acq_parameters.SetFromConfiguration(configuration, role, chip_rate, opt_freq);
|
||||
|
||||
#if USE_GLOG_AND_GFLAGS
|
||||
if (FLAGS_doppler_max != 0)
|
||||
{
|
||||
acq_parameters.doppler_max = FLAGS_doppler_max;
|
||||
}
|
||||
if (FLAGS_doppler_step != 0)
|
||||
{
|
||||
acq_parameters.doppler_step = FLAGS_doppler_step;
|
||||
}
|
||||
#else
|
||||
if (absl::GetFlag(FLAGS_doppler_max) != 0)
|
||||
{
|
||||
acq_parameters.doppler_max = absl::GetFlag(FLAGS_doppler_max);
|
||||
}
|
||||
if (absl::GetFlag(FLAGS_doppler_step) != 0)
|
||||
{
|
||||
acq_parameters.doppler_step = absl::GetFlag(FLAGS_doppler_step);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (acq_parameters.sampled_ms > max_sampled_ms)
|
||||
{
|
||||
acq_parameters.sampled_ms = max_sampled_ms;
|
||||
DLOG(INFO) << "Coherent integration time should be " << max_sampled_ms << " ms or less. Changing to " << max_sampled_ms << "ms ";
|
||||
std::cout << "Too high coherent integration time. Changing to " << max_sampled_ms << "ms\n";
|
||||
}
|
||||
|
||||
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;
|
||||
acq_parameters.threshold = threshold_compute.calculate_threshold(acq_parameters);
|
||||
|
||||
return acq_parameters;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
|
||||
float ThresholdComputeBasic::calculate_threshold(const Acq_Conf& acq_parameters) const
|
||||
{
|
||||
return acq_parameters.threshold;
|
||||
}
|
||||
|
||||
float ThresholdComputeDoppler::calculate_threshold(const Acq_Conf& acq_parameters) const
|
||||
{
|
||||
if (acq_parameters.pfa != 0)
|
||||
{
|
||||
// Calculate the threshold
|
||||
unsigned int frequency_bins = 0;
|
||||
for (int doppler = -acq_parameters.doppler_max; doppler <= acq_parameters.doppler_max; doppler += acq_parameters.doppler_step)
|
||||
{
|
||||
frequency_bins++;
|
||||
}
|
||||
|
||||
const auto ncells = acq_parameters.vector_length * frequency_bins;
|
||||
const auto exponent = 1 / static_cast<double>(ncells);
|
||||
const auto val = pow(1.0 - acq_parameters.pfa, exponent);
|
||||
const auto lambda = static_cast<double>(acq_parameters.vector_length);
|
||||
boost::math::exponential_distribution<double> mydist(lambda);
|
||||
const auto threshold = static_cast<float>(quantile(mydist, val));
|
||||
|
||||
return threshold;
|
||||
}
|
||||
|
||||
return acq_parameters.threshold;
|
||||
}
|
||||
|
||||
ThresholdComputeQuickSync::ThresholdComputeQuickSync(uint32_t folding_factor) : folding_factor_(folding_factor)
|
||||
{
|
||||
}
|
||||
|
||||
float ThresholdComputeQuickSync::calculate_threshold(const Acq_Conf& acq_parameters) const
|
||||
{
|
||||
if (acq_parameters.pfa != 0)
|
||||
{
|
||||
// Calculate the threshold
|
||||
unsigned int frequency_bins = 0;
|
||||
for (int doppler = -acq_parameters.doppler_max; doppler <= acq_parameters.doppler_max; doppler += static_cast<int>(acq_parameters.doppler_step))
|
||||
{
|
||||
frequency_bins++;
|
||||
}
|
||||
|
||||
const auto ncells = (acq_parameters.code_length / folding_factor_) * frequency_bins;
|
||||
const auto exponent = 1.0 / static_cast<double>(ncells);
|
||||
const auto val = pow(1.0 - acq_parameters.pfa, exponent);
|
||||
const auto lambda = static_cast<double>(acq_parameters.code_length) / static_cast<double>(folding_factor_);
|
||||
boost::math::exponential_distribution<double> mydist(lambda);
|
||||
const auto threshold = static_cast<float>(quantile(mydist, val));
|
||||
return threshold;
|
||||
}
|
||||
|
||||
return acq_parameters.threshold;
|
||||
}
|
||||
|
||||
BasePcpsAcquisitionCustom::BasePcpsAcquisitionCustom(
|
||||
const ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams,
|
||||
double chip_rate,
|
||||
double code_length_chips,
|
||||
unsigned int ms_per_code,
|
||||
bool use_stream_to_vector,
|
||||
const ThresholdComputeInterface& threshold_compute,
|
||||
uint32_t max_sampled_ms)
|
||||
: acq_parameters_(get_acq_conf(configuration, role, chip_rate, code_length_chips, 0, ms_per_code, max_sampled_ms, threshold_compute)),
|
||||
gnss_synchro_(nullptr),
|
||||
channel_(0),
|
||||
code_(acq_parameters_.vector_length),
|
||||
role_(role),
|
||||
is_type_gr_complex_(acq_parameters_.item_type == "gr_complex"),
|
||||
item_size_(is_type_gr_complex_ ? sizeof(gr_complex) : 0),
|
||||
use_stream_to_vector_(use_stream_to_vector)
|
||||
{
|
||||
DLOG(INFO) << "role " << role_;
|
||||
|
||||
if (is_type_gr_complex_)
|
||||
{
|
||||
if (use_stream_to_vector_)
|
||||
{
|
||||
stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, acq_parameters_.vector_length);
|
||||
DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id() << ")";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(WARNING) << acq_parameters_.item_type << " unknown acquisition item type";
|
||||
}
|
||||
|
||||
if (in_streams > 1)
|
||||
{
|
||||
LOG(ERROR) << "This implementation only supports one input stream";
|
||||
}
|
||||
if (out_streams > 0)
|
||||
{
|
||||
LOG(ERROR) << "This implementation does not provide an output stream";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BasePcpsAcquisitionCustom::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (is_type_gr_complex_ && use_stream_to_vector_)
|
||||
{
|
||||
top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BasePcpsAcquisitionCustom::disconnect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (is_type_gr_complex_ && use_stream_to_vector_)
|
||||
{
|
||||
top_block->disconnect(stream_to_vector_, 0, acquisition_cc_, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
gr::basic_block_sptr BasePcpsAcquisitionCustom::get_left_block()
|
||||
{
|
||||
if (use_stream_to_vector_)
|
||||
{
|
||||
return stream_to_vector_;
|
||||
}
|
||||
return acquisition_cc_;
|
||||
}
|
||||
|
||||
|
||||
gr::basic_block_sptr BasePcpsAcquisitionCustom::get_right_block()
|
||||
{
|
||||
return acquisition_cc_;
|
||||
}
|
||||
|
||||
|
||||
void BasePcpsAcquisitionCustom::set_gnss_synchro(Gnss_Synchro* gnss_synchro)
|
||||
{
|
||||
gnss_synchro_ = gnss_synchro;
|
||||
|
||||
if (is_type_gr_complex_)
|
||||
{
|
||||
acquisition_cc_->set_gnss_synchro(gnss_synchro);
|
||||
}
|
||||
}
|
||||
|
||||
void BasePcpsAcquisitionCustom::set_channel(unsigned int channel)
|
||||
{
|
||||
channel_ = channel;
|
||||
|
||||
if (is_type_gr_complex_)
|
||||
{
|
||||
acquisition_cc_->set_channel(channel);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BasePcpsAcquisitionCustom::set_channel_fsm(std::weak_ptr<ChannelFsm> channel_fsm)
|
||||
{
|
||||
if (is_type_gr_complex_)
|
||||
{
|
||||
acquisition_cc_->set_channel_fsm(channel_fsm);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
signed int BasePcpsAcquisitionCustom::mag()
|
||||
{
|
||||
if (is_type_gr_complex_)
|
||||
{
|
||||
return acquisition_cc_->mag();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void BasePcpsAcquisitionCustom::reset()
|
||||
{
|
||||
if (is_type_gr_complex_)
|
||||
{
|
||||
acquisition_cc_->set_active(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BasePcpsAcquisitionCustom::stop_acquisition()
|
||||
{
|
||||
if (is_type_gr_complex_)
|
||||
{
|
||||
acquisition_cc_->set_active(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BasePcpsAcquisitionCustom::set_local_code()
|
||||
{
|
||||
if (is_type_gr_complex())
|
||||
{
|
||||
const auto code_length = acq_parameters_.code_length;
|
||||
std::vector<std::complex<float>> code(code_length);
|
||||
code_gen_complex_sampled(code, gnss_synchro_->PRN, acq_parameters_.fs_in);
|
||||
|
||||
own::span<gr_complex> code_span(code_.data(), acq_parameters_.vector_length);
|
||||
for (unsigned int i = 0; i < acq_parameters_.num_codes; i++)
|
||||
{
|
||||
std::copy_n(code.data(), code_length, code_span.subspan(i * code_length, code_length).data());
|
||||
}
|
||||
|
||||
acquisition_cc_->set_local_code(code_.data());
|
||||
}
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
/*!
|
||||
* \file galileo_e1_pcps_8ms_ambiguous_acquisition.cc
|
||||
* \brief Adapts a Galileo PCPS 8ms acquisition block to an
|
||||
* AcquisitionInterface for Galileo E1 Signals
|
||||
* \author Marc Molina, 2013. marc.molina.pena(at)gmail.com
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "galileo_e1_pcps_8ms_ambiguous_acquisition.h"
|
||||
#include "Galileo_E1.h"
|
||||
#include "galileo_e1_signal_replica.h"
|
||||
#include "galileo_pcps_8ms_acquisition_cc.h"
|
||||
#include <boost/math/distributions/exponential.hpp>
|
||||
|
||||
#if USE_GLOG_AND_GFLAGS
|
||||
#include <glog/logging.h>
|
||||
#else
|
||||
#include <absl/log/log.h>
|
||||
#endif
|
||||
|
||||
|
||||
GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition(
|
||||
const ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams)
|
||||
: BasePcpsAcquisitionCustom(
|
||||
configuration,
|
||||
role,
|
||||
in_streams,
|
||||
out_streams,
|
||||
GALILEO_E1_CODE_CHIP_RATE_CPS,
|
||||
GALILEO_E1_B_CODE_LENGTH_CHIPS,
|
||||
GALILEO_E1_CODE_PERIOD_MS,
|
||||
true,
|
||||
ThresholdComputeDoppler()),
|
||||
cboc_(configuration->property(role + ".cboc", false))
|
||||
{
|
||||
if (is_type_gr_complex())
|
||||
{
|
||||
acquisition_cc_ = galileo_pcps_8ms_make_acquisition_cc(acq_parameters_);
|
||||
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GalileoE1Pcps8msAmbiguousAcquisition::code_gen_complex_sampled(own::span<std::complex<float>> dest, uint32_t prn, int32_t sampling_freq)
|
||||
{
|
||||
std::array<char, 3> Signal_{};
|
||||
Signal_[0] = gnss_synchro_->Signal[0];
|
||||
Signal_[1] = gnss_synchro_->Signal[1];
|
||||
Signal_[2] = '\0';
|
||||
|
||||
galileo_e1_code_gen_complex_sampled(dest, Signal_, cboc_, prn, sampling_freq, 0, false);
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
/*!
|
||||
* \file galileo_e1_pcps_8ms_ambiguous_acquisition.h
|
||||
* \brief Adapts a PCPS 8ms acquisition block to an
|
||||
* AcquisitionInterface for Galileo E1 Signals
|
||||
* \author Marc Molina, 2013. marc.molina.pena(at)gmail.com
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef GNSS_SDR_GALILEO_E1_PCPS_8MS_AMBIGUOUS_ACQUISITION_H
|
||||
#define GNSS_SDR_GALILEO_E1_PCPS_8MS_AMBIGUOUS_ACQUISITION_H
|
||||
|
||||
#include "base_pcps_acquisition_custom.h"
|
||||
|
||||
/** \addtogroup Acquisition
|
||||
* \{ */
|
||||
/** \addtogroup Acq_adapters
|
||||
* \{ */
|
||||
|
||||
/*!
|
||||
* \brief Adapts a PCPS 8ms acquisition block to an
|
||||
* AcquisitionInterface for Galileo E1 Signals
|
||||
*/
|
||||
class GalileoE1Pcps8msAmbiguousAcquisition : public BasePcpsAcquisitionCustom
|
||||
{
|
||||
public:
|
||||
GalileoE1Pcps8msAmbiguousAcquisition(const ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams);
|
||||
|
||||
~GalileoE1Pcps8msAmbiguousAcquisition() = default;
|
||||
|
||||
/*!
|
||||
* \brief Returns "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition"
|
||||
*/
|
||||
inline std::string implementation() override
|
||||
{
|
||||
return "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition";
|
||||
}
|
||||
|
||||
private:
|
||||
void code_gen_complex_sampled(own::span<std::complex<float>> dest, uint32_t prn, int32_t sampling_freq) override;
|
||||
|
||||
const bool cboc_;
|
||||
};
|
||||
|
||||
|
||||
/** \} */
|
||||
/** \} */
|
||||
#endif // GNSS_SDR_GALILEO_E1_PCPS_8MS_AMBIGUOUS_ACQUISITION_H
|
||||
@@ -1,71 +0,0 @@
|
||||
/*!
|
||||
* \file galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc
|
||||
* \brief Adapts a PCPS CCCWSR acquisition block to an AcquisitionInterface for
|
||||
* Galileo E1 Signals
|
||||
* \author Marc Molina, 2013. marc.molina.pena(at)gmail.com
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "galileo_e1_pcps_cccwsr_ambiguous_acquisition.h"
|
||||
#include "Galileo_E1.h"
|
||||
#include "configuration_interface.h"
|
||||
#include "galileo_e1_signal_replica.h"
|
||||
#include "pcps_cccwsr_acquisition_cc.h"
|
||||
#include <boost/math/distributions/exponential.hpp>
|
||||
|
||||
#if USE_GLOG_AND_GFLAGS
|
||||
#include <glog/logging.h>
|
||||
#else
|
||||
#include <absl/log/log.h>
|
||||
#endif
|
||||
|
||||
GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition(
|
||||
const ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams)
|
||||
: BasePcpsAcquisitionCustom(
|
||||
configuration,
|
||||
role,
|
||||
in_streams,
|
||||
out_streams,
|
||||
GALILEO_E1_CODE_CHIP_RATE_CPS,
|
||||
GALILEO_E1_B_CODE_LENGTH_CHIPS,
|
||||
GALILEO_E1_CODE_PERIOD_MS,
|
||||
true,
|
||||
ThresholdComputeBasic()),
|
||||
code_pilot_(acq_parameters_.vector_length),
|
||||
cboc_(configuration->property(role + ".cboc", false))
|
||||
{
|
||||
if (is_type_gr_complex())
|
||||
{
|
||||
acquisition_cc_ = pcps_cccwsr_make_acquisition_cc(acq_parameters_);
|
||||
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_local_code()
|
||||
{
|
||||
if (is_type_gr_complex())
|
||||
{
|
||||
auto& code_data_ = code_;
|
||||
|
||||
std::array<char, 3> signal = {{'1', 'B', '\0'}};
|
||||
galileo_e1_code_gen_complex_sampled(code_data_, signal, cboc_, gnss_synchro_->PRN, acq_parameters_.fs_in, 0, false);
|
||||
|
||||
std::array<char, 3> signal_C = {{'1', 'C', '\0'}};
|
||||
galileo_e1_code_gen_complex_sampled(code_pilot_, signal_C, cboc_, gnss_synchro_->PRN, acq_parameters_.fs_in, 0, false);
|
||||
|
||||
acquisition_cc_->set_local_code(code_data_.data(), code_pilot_.data());
|
||||
}
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
/*!
|
||||
* \file galileo_e1_pcps_cccwsr_ambiguous_acquisition.h
|
||||
* \brief Adapts a PCPS CCCWSR acquisition block to an AcquisitionInterface for
|
||||
* Galileo E1 Signals
|
||||
* \author Marc Molina, 2013. marc.molina.pena(at)gmail.com
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef GNSS_SDR_GALILEO_E1_PCPS_CCCWSR_AMBIGUOUS_ACQUISITION_H
|
||||
#define GNSS_SDR_GALILEO_E1_PCPS_CCCWSR_AMBIGUOUS_ACQUISITION_H
|
||||
|
||||
#include "base_pcps_acquisition_custom.h"
|
||||
|
||||
/** \addtogroup Acquisition
|
||||
* \{ */
|
||||
/** \addtogroup Acq_adapters
|
||||
* \{ */
|
||||
|
||||
/*!
|
||||
* \brief Adapts a PCPS CCCWSR acquisition block to an AcquisitionInterface
|
||||
* for Galileo E1 Signals
|
||||
*/
|
||||
class GalileoE1PcpsCccwsrAmbiguousAcquisition : public BasePcpsAcquisitionCustom
|
||||
{
|
||||
public:
|
||||
GalileoE1PcpsCccwsrAmbiguousAcquisition(
|
||||
const ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams);
|
||||
|
||||
~GalileoE1PcpsCccwsrAmbiguousAcquisition() = default;
|
||||
|
||||
/*!
|
||||
* \brief Returns "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition"
|
||||
*/
|
||||
inline std::string implementation() override
|
||||
{
|
||||
return "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition";
|
||||
}
|
||||
|
||||
void set_local_code() override;
|
||||
|
||||
private:
|
||||
// We don't implement this function since we override set_local_code
|
||||
void code_gen_complex_sampled(own::span<std::complex<float>> /*dest*/, uint32_t /*prn*/, int32_t /*sampling_freq*/) override {}
|
||||
|
||||
std::vector<std::complex<float>> code_pilot_;
|
||||
const bool cboc_;
|
||||
};
|
||||
|
||||
|
||||
/** \} */
|
||||
/** \} */
|
||||
#endif // GNSS_SDR_GALILEO_E1_PCPS_CCCWSR_AMBIGUOUS_ACQUISITION_H
|
||||
-93
@@ -1,93 +0,0 @@
|
||||
/*!
|
||||
* \file galileo_e1_pcps_quicksync_ambiguous_acquisition.cc
|
||||
* \brief Adapts a PCPS acquisition block to an AcquisitionInterface for
|
||||
* Galileo E1 Signals using the QuickSync Algorithm
|
||||
* \author Damian Miralles, 2014. dmiralles2009@gmail.com
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "galileo_e1_pcps_quicksync_ambiguous_acquisition.h"
|
||||
#include "Galileo_E1.h"
|
||||
#include "configuration_interface.h"
|
||||
#include "galileo_e1_signal_replica.h"
|
||||
#include "pcps_quicksync_acquisition_cc.h"
|
||||
#include <boost/math/distributions/exponential.hpp>
|
||||
|
||||
#if USE_GLOG_AND_GFLAGS
|
||||
#include <glog/logging.h>
|
||||
#else
|
||||
#include <absl/log/log.h>
|
||||
#endif
|
||||
|
||||
namespace
|
||||
{
|
||||
uint32_t get_folding_factor(const ConfigurationInterface* configuration, const std::string& 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 addition, it is important to point
|
||||
out that by making the folding factor smaller we were able to get QuickSync work with
|
||||
Galileo. Future work should be directed to test this assumption statistically. */
|
||||
|
||||
// return static_cast<unsigned int>(ceil(sqrt(log2(code_length_))));
|
||||
return configuration->property(role + ".folding_factor", 2);
|
||||
}
|
||||
} // namespace
|
||||
|
||||
|
||||
GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcquisition(
|
||||
const ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams)
|
||||
: GalileoE1PcpsQuickSyncAmbiguousAcquisition(configuration, role, in_streams, out_streams, get_folding_factor(configuration, role))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcquisition(
|
||||
const ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams,
|
||||
uint32_t folding_factor)
|
||||
: BasePcpsAcquisitionCustom(
|
||||
configuration,
|
||||
role,
|
||||
in_streams,
|
||||
out_streams,
|
||||
GALILEO_E1_CODE_CHIP_RATE_CPS,
|
||||
GALILEO_E1_B_CODE_LENGTH_CHIPS,
|
||||
GALILEO_E1_CODE_PERIOD_MS * folding_factor,
|
||||
true,
|
||||
ThresholdComputeQuickSync(folding_factor)),
|
||||
cboc_(configuration->property(role + ".cboc", false))
|
||||
{
|
||||
if (is_type_gr_complex())
|
||||
{
|
||||
// const auto samples_per_ms = static_cast<int>(round(code_length_ / acq_parameters_.sampled_ms));
|
||||
const unsigned int max_dwells = acq_parameters_.bit_transition_flag ? 2 : acq_parameters_.max_dwells;
|
||||
acquisition_cc_ = pcps_quicksync_make_acquisition_cc(acq_parameters_, folding_factor, max_dwells);
|
||||
DLOG(INFO) << "acquisition_quicksync(" << acquisition_cc_->unique_id() << ")";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GalileoE1PcpsQuickSyncAmbiguousAcquisition::code_gen_complex_sampled(own::span<std::complex<float>> dest, uint32_t prn, int32_t sampling_freq)
|
||||
{
|
||||
std::array<char, 3> Signal_{};
|
||||
Signal_[0] = gnss_synchro_->Signal[0];
|
||||
Signal_[1] = gnss_synchro_->Signal[1];
|
||||
Signal_[2] = '\0';
|
||||
|
||||
galileo_e1_code_gen_complex_sampled(dest, Signal_, cboc_, prn, sampling_freq, 0, false);
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
/*!
|
||||
* \file galileo_e1_pcps_quicksync_ambiguous_acquisition.h
|
||||
* \brief Adapts a PCPS acquisition block to an AcquisitionInterface for Galileo E1 Signals
|
||||
* \date June, 2014
|
||||
* \author Damian Miralles Sanchez. dmiralles2009@gmail.com
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef GNSS_SDR_GALILEO_E1_PCPS_QUICKSYNC_AMBIGUOUS_ACQUISITION_H
|
||||
#define GNSS_SDR_GALILEO_E1_PCPS_QUICKSYNC_AMBIGUOUS_ACQUISITION_H
|
||||
|
||||
#include "base_pcps_acquisition_custom.h"
|
||||
|
||||
/** \addtogroup Acquisition
|
||||
* \{ */
|
||||
/** \addtogroup Acq_adapters
|
||||
* \{ */
|
||||
|
||||
/*!
|
||||
* \brief This class adapts a PCPS acquisition block to an
|
||||
* AcquisitionInterface for Galileo E1 Signals
|
||||
*/
|
||||
class GalileoE1PcpsQuickSyncAmbiguousAcquisition : public BasePcpsAcquisitionCustom
|
||||
{
|
||||
public:
|
||||
GalileoE1PcpsQuickSyncAmbiguousAcquisition(
|
||||
const ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams);
|
||||
|
||||
~GalileoE1PcpsQuickSyncAmbiguousAcquisition() = default;
|
||||
|
||||
/*!
|
||||
* \brief Returns "Galileo_E1_PCPS_Ambiguous_Acquisition"
|
||||
*/
|
||||
inline std::string implementation() override
|
||||
{
|
||||
return "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition";
|
||||
}
|
||||
|
||||
private:
|
||||
GalileoE1PcpsQuickSyncAmbiguousAcquisition(
|
||||
const ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams,
|
||||
uint32_t folding_factor);
|
||||
|
||||
void code_gen_complex_sampled(own::span<std::complex<float>> dest, uint32_t prn, int32_t sampling_freq) override;
|
||||
|
||||
const bool cboc_;
|
||||
};
|
||||
|
||||
|
||||
/** \} */
|
||||
/** \} */
|
||||
#endif // GNSS_SDR_GALILEO_E1_PCPS_QUICKSYNC_AMBIGUOUS_ACQUISITION_H
|
||||
@@ -1,69 +0,0 @@
|
||||
/*!
|
||||
* \file galileo_e1_pcps_tong_ambiguous_acquisition.cc
|
||||
* \brief Adapts a PCPS Tong acquisition block to an Acq1uisitionInterface for
|
||||
* Galileo E1 Signals
|
||||
* \author Marc Molina, 2013. marc.molina.pena(at)gmail.com
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "galileo_e1_pcps_tong_ambiguous_acquisition.h"
|
||||
#include "Galileo_E1.h"
|
||||
#include "galileo_e1_signal_replica.h"
|
||||
#include "pcps_tong_acquisition_cc.h"
|
||||
#include <boost/math/distributions/exponential.hpp>
|
||||
|
||||
#if USE_GLOG_AND_GFLAGS
|
||||
#include <glog/logging.h>
|
||||
#else
|
||||
#include <absl/log/log.h>
|
||||
#endif
|
||||
|
||||
|
||||
GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition(
|
||||
const ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams)
|
||||
: BasePcpsAcquisitionCustom(
|
||||
configuration,
|
||||
role,
|
||||
in_streams,
|
||||
out_streams,
|
||||
GALILEO_E1_CODE_CHIP_RATE_CPS,
|
||||
GALILEO_E1_B_CODE_LENGTH_CHIPS,
|
||||
GALILEO_E1_CODE_PERIOD_MS,
|
||||
true,
|
||||
ThresholdComputeDoppler()),
|
||||
cboc_(configuration->property(role + ".cboc", false))
|
||||
{
|
||||
if (is_type_gr_complex())
|
||||
{
|
||||
const auto tong_init_val = configuration->property(role + ".tong_init_val", 1U);
|
||||
const auto tong_max_val = configuration->property(role + ".tong_max_val", 2U);
|
||||
const auto tong_max_dwells = configuration->property(role + ".tong_max_dwells", tong_max_val + 1U);
|
||||
|
||||
acquisition_cc_ = pcps_tong_make_acquisition_cc(acq_parameters_, tong_init_val, tong_max_val, tong_max_dwells);
|
||||
|
||||
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GalileoE1PcpsTongAmbiguousAcquisition::code_gen_complex_sampled(own::span<std::complex<float>> dest, uint32_t prn, int32_t sampling_freq)
|
||||
{
|
||||
std::array<char, 3> Signal_{};
|
||||
Signal_[0] = gnss_synchro_->Signal[0];
|
||||
Signal_[1] = gnss_synchro_->Signal[1];
|
||||
Signal_[2] = '\0';
|
||||
|
||||
galileo_e1_code_gen_complex_sampled(dest, Signal_, cboc_, prn, sampling_freq, 0, false);
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
/*!
|
||||
* \file galileo_e1_pcps_tong_ambiguous_acquisition.h
|
||||
* \brief Adapts a PCPS Tong acquisition block to an AcquisitionInterface for
|
||||
* Galileo E1 Signals
|
||||
* \author Marc Molina, 2013. marc.molina.pena(at)gmail.com
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef GNSS_SDR_GALILEO_E1_PCPS_TONG_AMBIGUOUS_ACQUISITION_H
|
||||
#define GNSS_SDR_GALILEO_E1_PCPS_TONG_AMBIGUOUS_ACQUISITION_H
|
||||
|
||||
#include "base_pcps_acquisition_custom.h"
|
||||
|
||||
/** \addtogroup Acquisition
|
||||
* \{ */
|
||||
/** \addtogroup Acq_adapters
|
||||
* \{ */
|
||||
|
||||
/*!
|
||||
* \brief Adapts a PCPS Tong acquisition block to an AcquisitionInterface
|
||||
* for Galileo E1 Signals
|
||||
*/
|
||||
class GalileoE1PcpsTongAmbiguousAcquisition : public BasePcpsAcquisitionCustom
|
||||
{
|
||||
public:
|
||||
GalileoE1PcpsTongAmbiguousAcquisition(
|
||||
const ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams);
|
||||
|
||||
~GalileoE1PcpsTongAmbiguousAcquisition() = default;
|
||||
|
||||
/*!
|
||||
* \brief Returns "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition"
|
||||
*/
|
||||
inline std::string implementation() override
|
||||
{
|
||||
return "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition";
|
||||
}
|
||||
|
||||
private:
|
||||
void code_gen_complex_sampled(own::span<std::complex<float>> dest, uint32_t prn, int32_t sampling_freq) override;
|
||||
|
||||
const bool cboc_;
|
||||
};
|
||||
|
||||
|
||||
/** \} */
|
||||
/** \} */
|
||||
#endif // GNSS_SDR_GALILEO_E1_PCPS_TONG_AMBIGUOUS_ACQUISITION_H
|
||||
@@ -1,150 +0,0 @@
|
||||
/*!
|
||||
* \file galileo_e5a_noncoherent_iq_acquisition_caf.cc
|
||||
* \brief Adapts a PCPS acquisition block to an AcquisitionInterface for
|
||||
* Galileo E5a data and pilot Signals
|
||||
* \author Marc Sales, 2014. marcsales92(at)gmail.com
|
||||
* \based on work from:
|
||||
* <ul>
|
||||
* <li> Javier Arribas, 2011. jarribas(at)cttc.es
|
||||
* <li> Luis Esteve, 2012. luis(at)epsilon-formacion.com
|
||||
* <li> Marc Molina, 2013. marc.molina.pena@gmail.com
|
||||
* </ul>
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "galileo_e5a_noncoherent_iq_acquisition_caf.h"
|
||||
#include "Galileo_E5a.h"
|
||||
#include "configuration_interface.h"
|
||||
#include "galileo_e5_signal_replica.h"
|
||||
#include "galileo_e5a_noncoherent_iq_acquisition_caf_cc.h"
|
||||
#include <boost/math/distributions/exponential.hpp>
|
||||
#include <algorithm>
|
||||
|
||||
#if USE_GLOG_AND_GFLAGS
|
||||
#include <glog/logging.h>
|
||||
#else
|
||||
#include <absl/log/log.h>
|
||||
#endif
|
||||
|
||||
#if HAS_STD_SPAN
|
||||
#include <span>
|
||||
namespace own = std;
|
||||
#else
|
||||
#include <gsl-lite/gsl-lite.hpp>
|
||||
namespace own = gsl_lite;
|
||||
#endif
|
||||
|
||||
namespace
|
||||
{
|
||||
int get_zero_padding(const ConfigurationInterface* configuration, const std::string& role)
|
||||
{
|
||||
return configuration->property(role + ".Zero_padding", 0);
|
||||
}
|
||||
|
||||
uint32_t get_max_sampled_ms(const ConfigurationInterface* configuration, const std::string& role)
|
||||
{
|
||||
const auto zero_padding = get_zero_padding(configuration, role);
|
||||
|
||||
if (zero_padding > 0)
|
||||
{
|
||||
DLOG(INFO) << "Zero padding activated. Changing to 1ms code + 1ms zero padding ";
|
||||
std::cout << "Zero padding activated. Changing to 1ms code + 1ms zero padding\n";
|
||||
return 2;
|
||||
}
|
||||
|
||||
return 3;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf(
|
||||
const ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams)
|
||||
: BasePcpsAcquisitionCustom(
|
||||
configuration,
|
||||
role,
|
||||
in_streams,
|
||||
out_streams,
|
||||
GALILEO_E5A_CODE_CHIP_RATE_CPS,
|
||||
GALILEO_E5A_CODE_LENGTH_CHIPS,
|
||||
GALILEO_E5A_CODE_PERIOD_MS,
|
||||
false,
|
||||
ThresholdComputeDoppler(),
|
||||
get_max_sampled_ms(configuration, role)),
|
||||
zero_padding_(get_zero_padding(configuration, role)),
|
||||
caf_window_hz_(configuration->property(role + ".CAF_window_hz", 0)),
|
||||
codeQ_(acq_parameters_.vector_length)
|
||||
{
|
||||
if (is_type_gr_complex())
|
||||
{
|
||||
const auto sig = configuration->property("Channel.signal", std::string("5X"));
|
||||
const auto both_signal_components = (sig.at(0) == '5' && sig.at(1) == 'X');
|
||||
|
||||
acquisition_cc_ = galileo_e5a_noncoherentIQ_make_acquisition_caf_cc(
|
||||
acq_parameters_, both_signal_components, caf_window_hz_, zero_padding_);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GalileoE5aNoncoherentIQAcquisitionCaf::set_local_code()
|
||||
{
|
||||
if (is_type_gr_complex())
|
||||
{
|
||||
const auto code_length = acq_parameters_.code_length;
|
||||
const auto vector_length = acq_parameters_.vector_length;
|
||||
|
||||
auto& codeI_ = code_;
|
||||
std::vector<std::complex<float>> codeI(code_length);
|
||||
std::vector<std::complex<float>> codeQ(code_length);
|
||||
|
||||
if (gnss_synchro_->Signal[0] == '5' && gnss_synchro_->Signal[1] == 'X')
|
||||
{
|
||||
std::array<char, 3> a = {{'5', 'I', '\0'}};
|
||||
galileo_e5_a_code_gen_complex_sampled(codeI, gnss_synchro_->PRN, a, acq_parameters_.fs_in, 0);
|
||||
|
||||
std::array<char, 3> b = {{'5', 'Q', '\0'}};
|
||||
galileo_e5_a_code_gen_complex_sampled(codeQ, gnss_synchro_->PRN, b, acq_parameters_.fs_in, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::array<char, 3> signal_type_ = {{'5', 'X', '\0'}};
|
||||
galileo_e5_a_code_gen_complex_sampled(codeI, gnss_synchro_->PRN, signal_type_, acq_parameters_.fs_in, 0);
|
||||
}
|
||||
// WARNING: 3ms are coherently integrated. Secondary sequence (1,1,1)
|
||||
// is generated, and modulated in the 'block'.
|
||||
own::span<gr_complex> codeI_span(codeI_.data(), vector_length);
|
||||
own::span<gr_complex> codeQ_span(codeQ_.data(), vector_length);
|
||||
if (zero_padding_ == 0) // if no zero_padding
|
||||
{
|
||||
for (unsigned int i = 0; i < acq_parameters_.sampled_ms; i++)
|
||||
{
|
||||
std::copy_n(codeI.data(), code_length, codeI_span.subspan(i * code_length, code_length).data());
|
||||
if (gnss_synchro_->Signal[0] == '5' && gnss_synchro_->Signal[1] == 'X')
|
||||
{
|
||||
std::copy_n(codeQ.data(), code_length, codeQ_span.subspan(i * code_length, code_length).data());
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 1ms code + 1ms zero padding
|
||||
std::copy_n(codeI.data(), code_length, codeI_.data());
|
||||
if (gnss_synchro_->Signal[0] == '5' && gnss_synchro_->Signal[1] == 'X')
|
||||
{
|
||||
std::copy_n(codeQ.data(), code_length, codeQ_.data());
|
||||
}
|
||||
}
|
||||
|
||||
acquisition_cc_->set_local_code(codeI_.data(), codeQ_.data());
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
/*!
|
||||
* \file galileo_e5a_noncoherent_iq_acquisition_caf.h
|
||||
* \brief Adapts a PCPS acquisition block to an AcquisitionInterface for
|
||||
* Galileo E5a data and pilot Signals
|
||||
* \author Marc Sales, 2014. marcsales92(at)gmail.com
|
||||
* \based on work from:
|
||||
* <ul>
|
||||
* <li> Javier Arribas, 2011. jarribas(at)cttc.es
|
||||
* <li> Luis Esteve, 2012. luis(at)epsilon-formacion.com
|
||||
* <li> Marc Molina, 2013. marc.molina.pena@gmail.com
|
||||
* </ul>
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef GNSS_SDR_GALILEO_E5A_NONCOHERENT_IQ_ACQUISITION_CAF_H
|
||||
#define GNSS_SDR_GALILEO_E5A_NONCOHERENT_IQ_ACQUISITION_CAF_H
|
||||
|
||||
#include "base_pcps_acquisition_custom.h"
|
||||
|
||||
/** \addtogroup Acquisition
|
||||
* \{ */
|
||||
/** \addtogroup Acq_adapters
|
||||
* \{ */
|
||||
|
||||
class GalileoE5aNoncoherentIQAcquisitionCaf : public BasePcpsAcquisitionCustom
|
||||
{
|
||||
public:
|
||||
GalileoE5aNoncoherentIQAcquisitionCaf(const ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams);
|
||||
|
||||
~GalileoE5aNoncoherentIQAcquisitionCaf() = default;
|
||||
|
||||
/*!
|
||||
* \brief Returns "Galileo_E5a_Noncoherent_IQ_Acquisition_CAF"
|
||||
*/
|
||||
inline std::string implementation() override
|
||||
{
|
||||
return "Galileo_E5a_Noncoherent_IQ_Acquisition_CAF";
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Sets local Galileo E5a code for PCPS acquisition algorithm.
|
||||
*/
|
||||
void set_local_code() override;
|
||||
|
||||
private:
|
||||
// We don't implement this function since we override set_local_code
|
||||
void code_gen_complex_sampled(own::span<std::complex<float>> /*dest*/, uint32_t /*prn*/, int32_t /*sampling_freq*/) override {}
|
||||
|
||||
const int zero_padding_;
|
||||
const int caf_window_hz_;
|
||||
|
||||
std::vector<std::complex<float>> codeQ_;
|
||||
};
|
||||
|
||||
|
||||
/** \} */
|
||||
/** \} */
|
||||
#endif // GNSS_SDR_GALILEO_E5A_NONCOHERENT_IQ_ACQUISITION_CAF_H
|
||||
@@ -1,62 +0,0 @@
|
||||
/*!
|
||||
* \file gps_l1_ca_pcps_acquisition.cc
|
||||
* \brief Adapts a PCPS acquisition block to an AcquisitionInterface for
|
||||
* GPS L1 C/A Signals
|
||||
* \authors <ul>
|
||||
* <li> Javier Arribas, 2011. jarribas(at)cttc.es
|
||||
* <li> Luis Esteve, 2012. luis(at)epsilon-formacion.com
|
||||
* </ul>
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "gps_l1_ca_pcps_acquisition_fine_doppler.h"
|
||||
#include "GPS_L1_CA.h"
|
||||
#include "acq_conf.h"
|
||||
#include "gps_sdr_signal_replica.h"
|
||||
#include "pcps_acquisition_fine_doppler_cc.h"
|
||||
|
||||
#if USE_GLOG_AND_GFLAGS
|
||||
#include <glog/logging.h>
|
||||
#else
|
||||
#include <absl/log/log.h>
|
||||
#endif
|
||||
|
||||
GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler(
|
||||
const ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams)
|
||||
: BasePcpsAcquisitionCustom(
|
||||
configuration,
|
||||
role,
|
||||
in_streams,
|
||||
out_streams,
|
||||
GPS_L1_CA_CODE_RATE_CPS,
|
||||
GPS_L1_CA_CODE_LENGTH_CHIPS,
|
||||
GPS_L1_CA_CODE_PERIOD_MS,
|
||||
false,
|
||||
ThresholdComputeBasic())
|
||||
{
|
||||
if (is_type_gr_complex())
|
||||
{
|
||||
Acq_Conf acq_parameters = acq_parameters_;
|
||||
acq_parameters.samples_per_ms = static_cast<float>(acq_parameters.vector_length);
|
||||
acquisition_cc_ = pcps_make_acquisition_fine_doppler_cc(acq_parameters);
|
||||
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaPcpsAcquisitionFineDoppler::code_gen_complex_sampled(own::span<std::complex<float>> dest, uint32_t prn, int32_t sampling_freq)
|
||||
{
|
||||
gps_l1_ca_code_gen_complex_sampled(dest, prn, sampling_freq, 0);
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
/*!
|
||||
* \file gps_l1_ca_pcps_acquisition_fine_doppler.h
|
||||
* \brief Adapts a PCPS acquisition block with fine Doppler estimation to an AcquisitionInterface for
|
||||
* GPS L1 C/A signals
|
||||
* \authors <ul>
|
||||
* <li> Javier Arribas, 2013. jarribas(at)cttc.es
|
||||
* </ul> *
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_FINE_DOPPLER_H
|
||||
#define GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_FINE_DOPPLER_H
|
||||
|
||||
#include "base_pcps_acquisition_custom.h"
|
||||
|
||||
/** \addtogroup Acquisition
|
||||
* \{ */
|
||||
/** \addtogroup Acq_adapters
|
||||
* \{ */
|
||||
|
||||
|
||||
/*!
|
||||
* \brief This class Adapts a PCPS acquisition block with fine Doppler estimation to an AcquisitionInterface for
|
||||
* GPS L1 C/A signals
|
||||
*/
|
||||
class GpsL1CaPcpsAcquisitionFineDoppler : public BasePcpsAcquisitionCustom
|
||||
{
|
||||
public:
|
||||
GpsL1CaPcpsAcquisitionFineDoppler(const ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams);
|
||||
|
||||
~GpsL1CaPcpsAcquisitionFineDoppler() = default;
|
||||
|
||||
/*!
|
||||
* \brief Returns "GPS_L1_CA_PCPS_Acquisition_Fine_Doppler"
|
||||
*/
|
||||
inline std::string implementation() override
|
||||
{
|
||||
return "GPS_L1_CA_PCPS_Acquisition_Fine_Doppler";
|
||||
}
|
||||
|
||||
private:
|
||||
void code_gen_complex_sampled(own::span<std::complex<float>> dest, uint32_t prn, int32_t sampling_freq) override;
|
||||
};
|
||||
|
||||
|
||||
/** \} */
|
||||
/** \} */
|
||||
#endif // GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_FINE_DOPPLER_H
|
||||
@@ -1,59 +0,0 @@
|
||||
/*!
|
||||
* \file gps_l1_ca_pcps_acquisition.cc
|
||||
* \brief Adapts a PCPS acquisition block to an AcquisitionInterface for
|
||||
* GPS L1 C/A Signals
|
||||
* \authors <ul>
|
||||
* <li> Javier Arribas, 2011. jarribas(at)cttc.es
|
||||
* <li> Luis Esteve, 2012. luis(at)epsilon-formacion.com
|
||||
* </ul>
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "gps_l1_ca_pcps_assisted_acquisition.h"
|
||||
#include "GPS_L1_CA.h"
|
||||
#include "gps_sdr_signal_replica.h"
|
||||
#include "pcps_assisted_acquisition_cc.h"
|
||||
|
||||
#if USE_GLOG_AND_GFLAGS
|
||||
#include <glog/logging.h>
|
||||
#else
|
||||
#include <absl/log/log.h>
|
||||
#endif
|
||||
|
||||
GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition(
|
||||
const ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams)
|
||||
: BasePcpsAcquisitionCustom(
|
||||
configuration,
|
||||
role,
|
||||
in_streams,
|
||||
out_streams,
|
||||
GPS_L1_CA_CODE_RATE_CPS,
|
||||
GPS_L1_CA_CODE_LENGTH_CHIPS,
|
||||
GPS_L1_CA_CODE_PERIOD_MS,
|
||||
false,
|
||||
ThresholdComputeBasic())
|
||||
{
|
||||
if (is_type_gr_complex())
|
||||
{
|
||||
acquisition_cc_ = pcps_make_assisted_acquisition_cc(acq_parameters_);
|
||||
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaPcpsAssistedAcquisition::code_gen_complex_sampled(own::span<std::complex<float>> dest, uint32_t prn, int32_t sampling_freq)
|
||||
{
|
||||
gps_l1_ca_code_gen_complex_sampled(dest, prn, sampling_freq, 0);
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
/*!
|
||||
* \file gps_l1_ca_pcps_assisted_acquisition.h
|
||||
* \brief Adapts a PCPS Assisted acquisition block to an AcquisitionInterface for
|
||||
* GPS L1 C/A signals
|
||||
* \authors <ul>
|
||||
* <li> Javier Arribas, 2011. jarribas(at)cttc.es
|
||||
* </ul>
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef GNSS_SDR_GPS_L1_CA_PCPS_ASSISTED_ACQUISITION_H
|
||||
#define GNSS_SDR_GPS_L1_CA_PCPS_ASSISTED_ACQUISITION_H
|
||||
|
||||
#include "base_pcps_acquisition_custom.h"
|
||||
|
||||
/** \addtogroup Acquisition
|
||||
* \{ */
|
||||
/** \addtogroup Acq_adapters
|
||||
* \{ */
|
||||
|
||||
|
||||
/*!
|
||||
* \brief This class adapts a PCPS acquisition block to an AcquisitionInterface
|
||||
* for GPS L1 C/A signals
|
||||
*/
|
||||
class GpsL1CaPcpsAssistedAcquisition : public BasePcpsAcquisitionCustom
|
||||
{
|
||||
public:
|
||||
GpsL1CaPcpsAssistedAcquisition(
|
||||
const ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams);
|
||||
|
||||
~GpsL1CaPcpsAssistedAcquisition() = default;
|
||||
|
||||
/*!
|
||||
* \brief Returns "GPS_L1_CA_PCPS_Assisted_Acquisition"
|
||||
*/
|
||||
inline std::string implementation() override
|
||||
{
|
||||
return "GPS_L1_CA_PCPS_Assisted_Acquisition";
|
||||
}
|
||||
|
||||
private:
|
||||
void code_gen_complex_sampled(own::span<std::complex<float>> dest, uint32_t prn, int32_t sampling_freq) override;
|
||||
};
|
||||
|
||||
|
||||
/** \} */
|
||||
/** \} */
|
||||
#endif // GNSS_SDR_GPS_L1_CA_PCPS_ASSISTED_ACQUISITION_H
|
||||
@@ -1,65 +0,0 @@
|
||||
/*!
|
||||
* \file gps_l1_ca_pcps_opencl_acquisition.cc
|
||||
* \brief Adapts an OpenCL PCPS acquisition block to an
|
||||
* AcquisitionInterface for GPS L1 C/A signals
|
||||
* \author Marc Molina, 2013. marc.molina.pena(at)gmail.com
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "gps_l1_ca_pcps_opencl_acquisition.h"
|
||||
#include "GPS_L1_CA.h"
|
||||
#include "configuration_interface.h"
|
||||
#include "gnss_sdr_flags.h"
|
||||
#include "gps_sdr_signal_replica.h"
|
||||
#include "pcps_opencl_acquisition_cc.h"
|
||||
#include <boost/math/distributions/exponential.hpp>
|
||||
#include <algorithm>
|
||||
|
||||
#if USE_GLOG_AND_GFLAGS
|
||||
#include <glog/logging.h>
|
||||
#else
|
||||
#include <absl/log/log.h>
|
||||
#endif
|
||||
|
||||
|
||||
GpsL1CaPcpsOpenClAcquisition::GpsL1CaPcpsOpenClAcquisition(
|
||||
const ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams)
|
||||
: BasePcpsAcquisitionCustom(
|
||||
configuration,
|
||||
role,
|
||||
in_streams,
|
||||
out_streams,
|
||||
GPS_L1_CA_CODE_RATE_CPS,
|
||||
GPS_L1_CA_CODE_LENGTH_CHIPS,
|
||||
GPS_L1_CA_CODE_PERIOD_MS,
|
||||
true,
|
||||
ThresholdComputeDoppler()),
|
||||
opencl_ready_(false)
|
||||
{
|
||||
if (is_type_gr_complex())
|
||||
{
|
||||
const unsigned int max_dwells = acq_parameters_.bit_transition_flag ? 2 : acq_parameters_.max_dwells;
|
||||
auto acquisition_cc = pcps_make_opencl_acquisition_cc(acq_parameters_, max_dwells);
|
||||
opencl_ready_ = acquisition_cc->opencl_ready();
|
||||
acquisition_cc_ = std::move(acquisition_cc);
|
||||
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaPcpsOpenClAcquisition::code_gen_complex_sampled(own::span<std::complex<float>> dest, uint32_t prn, int32_t sampling_freq)
|
||||
{
|
||||
gps_l1_ca_code_gen_complex_sampled(dest, prn, sampling_freq, 0);
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
/*!
|
||||
* \file gps_l1_ca_pcps_opencl_acquisition.h
|
||||
* \brief Adapts an OpenCL PCPS acquisition block to an
|
||||
* AcquisitionInterface for GPS L1 C/A signals
|
||||
* \author Marc Molina, 2013. marc.molina.pena(at)gmail.com
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef GNSS_SDR_GPS_L1_CA_PCPS_OPENCL_ACQUISITION_H
|
||||
#define GNSS_SDR_GPS_L1_CA_PCPS_OPENCL_ACQUISITION_H
|
||||
|
||||
#include "base_pcps_acquisition_custom.h"
|
||||
|
||||
/** \addtogroup Acquisition
|
||||
* \{ */
|
||||
/** \addtogroup Acq_adapters
|
||||
* \{ */
|
||||
|
||||
/*!
|
||||
* \brief This class adapts an OpenCL PCPS acquisition block to an
|
||||
* AcquisitionInterface for GPS L1 C/A signals
|
||||
*/
|
||||
class GpsL1CaPcpsOpenClAcquisition : public BasePcpsAcquisitionCustom
|
||||
{
|
||||
public:
|
||||
GpsL1CaPcpsOpenClAcquisition(const ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams);
|
||||
|
||||
~GpsL1CaPcpsOpenClAcquisition() = default;
|
||||
|
||||
/*!
|
||||
* \brief Returns "GPS_L1_CA_PCPS_OpenCl_Acquisition"
|
||||
*/
|
||||
inline std::string implementation() override
|
||||
{
|
||||
return "GPS_L1_CA_PCPS_OpenCl_Acquisition";
|
||||
}
|
||||
|
||||
inline bool opencl_ready() const
|
||||
{
|
||||
return opencl_ready_;
|
||||
}
|
||||
|
||||
private:
|
||||
void code_gen_complex_sampled(own::span<std::complex<float>> dest, uint32_t prn, int32_t sampling_freq) override;
|
||||
|
||||
bool opencl_ready_;
|
||||
};
|
||||
|
||||
|
||||
/** \} */
|
||||
/** \} */
|
||||
#endif // GNSS_SDR_GPS_L1_CA_PCPS_OPENCL_ACQUISITION_H
|
||||
@@ -1,85 +0,0 @@
|
||||
/*!
|
||||
* \file gps_l1_ca_pcps_quicksync_acquisition.cc
|
||||
* \brief Adapts a PCPS acquisition block to an AcquisitionInterface for
|
||||
* GPS L1 C/A signals using the QuickSync Algorithm
|
||||
* \author Damian Miralles, 2014. dmiralles2009@gmail.com
|
||||
*
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "gps_l1_ca_pcps_quicksync_acquisition.h"
|
||||
#include "GPS_L1_CA.h"
|
||||
#include "configuration_interface.h"
|
||||
#include "gps_sdr_signal_replica.h"
|
||||
#include "pcps_quicksync_acquisition_cc.h"
|
||||
#include <boost/math/distributions/exponential.hpp>
|
||||
|
||||
#if USE_GLOG_AND_GFLAGS
|
||||
#include <glog/logging.h>
|
||||
#else
|
||||
#include <absl/log/log.h>
|
||||
#endif
|
||||
|
||||
namespace
|
||||
{
|
||||
uint32_t get_folding_factor(const ConfigurationInterface* configuration, const std::string& role)
|
||||
{
|
||||
const int64_t fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", static_cast<int64_t>(4000000));
|
||||
const auto fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
const auto code_length = static_cast<unsigned int>(round(fs_in / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)));
|
||||
const auto folding_factor = static_cast<unsigned int>(ceil(sqrt(log2(code_length))));
|
||||
return configuration->property(role + ".folding_factor", folding_factor);
|
||||
}
|
||||
} // namespace
|
||||
|
||||
|
||||
GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition(
|
||||
const ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams)
|
||||
: GpsL1CaPcpsQuickSyncAcquisition(configuration, role, in_streams, out_streams, get_folding_factor(configuration, role))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition(
|
||||
const ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams,
|
||||
uint32_t folding_factor)
|
||||
: BasePcpsAcquisitionCustom(
|
||||
configuration,
|
||||
role,
|
||||
in_streams,
|
||||
out_streams,
|
||||
GPS_L1_CA_CODE_RATE_CPS,
|
||||
GPS_L1_CA_CODE_LENGTH_CHIPS,
|
||||
GPS_L1_CA_CODE_PERIOD_MS * folding_factor,
|
||||
true,
|
||||
ThresholdComputeQuickSync(folding_factor))
|
||||
{
|
||||
if (is_type_gr_complex())
|
||||
{
|
||||
// const int samples_per_ms = round(code_length_ / acq_parameters_.sampled_ms);
|
||||
const unsigned int max_dwells = acq_parameters_.bit_transition_flag ? 2 : acq_parameters_.max_dwells;
|
||||
acquisition_cc_ = pcps_quicksync_make_acquisition_cc(acq_parameters_, folding_factor, max_dwells);
|
||||
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaPcpsQuickSyncAcquisition::code_gen_complex_sampled(own::span<std::complex<float>> dest, uint32_t prn, int32_t sampling_freq)
|
||||
{
|
||||
gps_l1_ca_code_gen_complex_sampled(dest, prn, sampling_freq, 0);
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
/*!
|
||||
* \file gps_l1_ca_pcps_quicksync_acquisition.h
|
||||
* \brief Adapts a PCPS acquisition block to an AcquisitionInterface for GPS L1 C/A signals implementing the QuickSync Algorithm.
|
||||
* \date June, 2014
|
||||
* \author Damian Miralles Sanchez. dmiralles2009@gmail.com
|
||||
*
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef GNSS_SDR_GPS_L1_CA_PCPS_QUICKSYNC_ACQUISITION_H
|
||||
#define GNSS_SDR_GPS_L1_CA_PCPS_QUICKSYNC_ACQUISITION_H
|
||||
|
||||
#include "base_pcps_acquisition_custom.h"
|
||||
|
||||
/** \addtogroup Acquisition
|
||||
* \{ */
|
||||
/** \addtogroup Acq_adapters
|
||||
* \{ */
|
||||
|
||||
/*!
|
||||
* \brief This class adapts a PCPS acquisition block to an AcquisitionInterface
|
||||
* for GPS L1 C/A signals
|
||||
*/
|
||||
class GpsL1CaPcpsQuickSyncAcquisition : public BasePcpsAcquisitionCustom
|
||||
{
|
||||
public:
|
||||
GpsL1CaPcpsQuickSyncAcquisition(
|
||||
const ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams);
|
||||
|
||||
~GpsL1CaPcpsQuickSyncAcquisition() = default;
|
||||
|
||||
/*!
|
||||
* \brief Returns "GPS_L1_CA_PCPS_QuickSync_Acquisition"
|
||||
*/
|
||||
inline std::string implementation() override
|
||||
{
|
||||
return "GPS_L1_CA_PCPS_QuickSync_Acquisition";
|
||||
}
|
||||
|
||||
private:
|
||||
GpsL1CaPcpsQuickSyncAcquisition(
|
||||
const ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams,
|
||||
uint32_t folding_factor);
|
||||
|
||||
void code_gen_complex_sampled(own::span<std::complex<float>> dest, uint32_t prn, int32_t sampling_freq) override;
|
||||
};
|
||||
|
||||
|
||||
/** \} */
|
||||
/** \} */
|
||||
#endif // GNSS_SDR_GPS_L1_CA_PCPS_QUICKSYNC_ACQUISITION_H
|
||||
@@ -1,61 +0,0 @@
|
||||
/*!
|
||||
* \file gps_l1_ca_pcps_tong_acquisition.cc
|
||||
* \brief Adapts a PCPS Tong acquisition block to an AcquisitionInterface for
|
||||
* GPS L1 C/A signals
|
||||
* \author Marc Molina, 2013. marc.molina.pena(at)gmail.com
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "gps_l1_ca_pcps_tong_acquisition.h"
|
||||
#include "GPS_L1_CA.h"
|
||||
#include "gps_sdr_signal_replica.h"
|
||||
#include "pcps_tong_acquisition_cc.h"
|
||||
#include <boost/math/distributions/exponential.hpp>
|
||||
|
||||
#if USE_GLOG_AND_GFLAGS
|
||||
#include <glog/logging.h>
|
||||
#else
|
||||
#include <absl/log/log.h>
|
||||
#endif
|
||||
|
||||
|
||||
GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition(
|
||||
const ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams)
|
||||
: BasePcpsAcquisitionCustom(
|
||||
configuration,
|
||||
role,
|
||||
in_streams,
|
||||
out_streams,
|
||||
GPS_L1_CA_CODE_RATE_CPS,
|
||||
GPS_L1_CA_CODE_LENGTH_CHIPS,
|
||||
GPS_L1_CA_CODE_PERIOD_MS,
|
||||
true,
|
||||
ThresholdComputeDoppler())
|
||||
{
|
||||
if (is_type_gr_complex())
|
||||
{
|
||||
const auto tong_init_val = configuration->property(role + ".tong_init_val", 1U);
|
||||
const auto tong_max_val = configuration->property(role + ".tong_max_val", 2U);
|
||||
const auto tong_max_dwells = configuration->property(role + ".tong_max_dwells", tong_max_val + 1U);
|
||||
acquisition_cc_ = pcps_tong_make_acquisition_cc(acq_parameters_, tong_init_val, tong_max_val, tong_max_dwells);
|
||||
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaPcpsTongAcquisition::code_gen_complex_sampled(own::span<std::complex<float>> dest, uint32_t prn, int32_t sampling_freq)
|
||||
{
|
||||
gps_l1_ca_code_gen_complex_sampled(dest, prn, sampling_freq, 0);
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
/*!
|
||||
* \file gps_l1_ca_pcps_tong_acquisition.h
|
||||
* \brief Adapts a PCPS Tong acquisition block to an AcquisitionInterface for
|
||||
* GPS L1 C/A signals
|
||||
* \author Marc Molina, 2013. marc.molina.pena(at)gmail.com
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef GNSS_SDR_GPS_L1_CA_TONG_ACQUISITION_H
|
||||
#define GNSS_SDR_GPS_L1_CA_TONG_ACQUISITION_H
|
||||
|
||||
#include "base_pcps_acquisition_custom.h"
|
||||
|
||||
/** \addtogroup Acquisition
|
||||
* \{ */
|
||||
/** \addtogroup Acq_adapters
|
||||
* \{ */
|
||||
|
||||
/*!
|
||||
* \brief This class adapts a PCPS Tong acquisition block to an
|
||||
* AcquisitionInterface for GPS L1 C/A signals
|
||||
*/
|
||||
class GpsL1CaPcpsTongAcquisition : public BasePcpsAcquisitionCustom
|
||||
{
|
||||
public:
|
||||
GpsL1CaPcpsTongAcquisition(const ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams);
|
||||
|
||||
~GpsL1CaPcpsTongAcquisition() = default;
|
||||
|
||||
/*!
|
||||
* \brief Returns "GPS_L1_CA_PCPS_Tong_Acquisition"
|
||||
*/
|
||||
inline std::string implementation() override
|
||||
{
|
||||
return "GPS_L1_CA_PCPS_Tong_Acquisition";
|
||||
}
|
||||
|
||||
private:
|
||||
void code_gen_complex_sampled(own::span<std::complex<float>> dest, uint32_t prn, int32_t sampling_freq) override;
|
||||
};
|
||||
|
||||
|
||||
/** \} */
|
||||
/** \} */
|
||||
#endif // GNSS_SDR_GPS_L1_CA_TONG_ACQUISITION_H
|
||||
@@ -0,0 +1,567 @@
|
||||
/*!
|
||||
* \file base_ca_pcps_acquisition_custom.h
|
||||
* \brief Adapts a PCPS acquisition block to an AcquisitionInterface
|
||||
* \authors <ul>
|
||||
* <li> Mathieu Favreau, 2025. favreau.mathieu(at)hotmail.com
|
||||
* </ul>
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2025 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "pcps_acquisition_adapter_custom.h"
|
||||
#include "GPS_L1_CA.h"
|
||||
#include "Galileo_E1.h"
|
||||
#include "Galileo_E5a.h"
|
||||
#include "configuration_interface.h"
|
||||
#include "galileo_e1_signal_replica.h"
|
||||
#include "galileo_e5_signal_replica.h"
|
||||
#include "galileo_e5a_noncoherent_iq_acquisition_caf_cc.h"
|
||||
#include "galileo_pcps_8ms_acquisition_cc.h"
|
||||
#include "gnss_sdr_flags.h"
|
||||
#include "gnss_sdr_make_unique.h" // for std::make_unique in C++11
|
||||
#include "gps_sdr_signal_replica.h"
|
||||
#include "pcps_acquisition_fine_doppler_cc.h"
|
||||
#include "pcps_assisted_acquisition_cc.h"
|
||||
#include "pcps_cccwsr_acquisition_cc.h"
|
||||
#include "pcps_quicksync_acquisition_cc.h"
|
||||
#include "pcps_tong_acquisition_cc.h"
|
||||
#include "signal_flag.h"
|
||||
#include <boost/math/distributions/exponential.hpp>
|
||||
#include <boost/optional.hpp>
|
||||
#include <memory>
|
||||
#include <stdexcept>
|
||||
|
||||
#if OPENCL_BLOCKS
|
||||
#include "pcps_opencl_acquisition_cc.h"
|
||||
#endif
|
||||
|
||||
#if USE_GLOG_AND_GFLAGS
|
||||
#include <glog/logging.h>
|
||||
#else
|
||||
#include <absl/log/log.h>
|
||||
#endif
|
||||
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
class ThresholdComputeInterface
|
||||
{
|
||||
public:
|
||||
virtual ~ThresholdComputeInterface() = default;
|
||||
virtual float calculate_threshold(const Acq_Conf& acq_parameters) const = 0;
|
||||
};
|
||||
|
||||
class ThresholdComputeBasic : public ThresholdComputeInterface
|
||||
{
|
||||
public:
|
||||
float calculate_threshold(const Acq_Conf& acq_parameters) const override;
|
||||
};
|
||||
|
||||
class ThresholdComputeDoppler : public ThresholdComputeInterface
|
||||
{
|
||||
public:
|
||||
float calculate_threshold(const Acq_Conf& acq_parameters) const override;
|
||||
};
|
||||
|
||||
class ThresholdComputeQuickSync : public ThresholdComputeInterface
|
||||
{
|
||||
public:
|
||||
float calculate_threshold(const Acq_Conf& acq_parameters) const override;
|
||||
};
|
||||
|
||||
float ThresholdComputeBasic::calculate_threshold(const Acq_Conf& acq_parameters) const
|
||||
{
|
||||
return acq_parameters.threshold;
|
||||
}
|
||||
|
||||
float ThresholdComputeDoppler::calculate_threshold(const Acq_Conf& acq_parameters) const
|
||||
{
|
||||
if (acq_parameters.pfa != 0)
|
||||
{
|
||||
// Calculate the threshold
|
||||
unsigned int frequency_bins = 0;
|
||||
for (int doppler = -acq_parameters.doppler_max; doppler <= acq_parameters.doppler_max; doppler += acq_parameters.doppler_step)
|
||||
{
|
||||
frequency_bins++;
|
||||
}
|
||||
|
||||
const auto ncells = acq_parameters.vector_length * frequency_bins;
|
||||
const auto exponent = 1 / static_cast<double>(ncells);
|
||||
const auto val = pow(1.0 - acq_parameters.pfa, exponent);
|
||||
const auto lambda = static_cast<double>(acq_parameters.vector_length);
|
||||
boost::math::exponential_distribution<double> mydist(lambda);
|
||||
const auto threshold = static_cast<float>(quantile(mydist, val));
|
||||
|
||||
return threshold;
|
||||
}
|
||||
|
||||
return acq_parameters.threshold;
|
||||
}
|
||||
|
||||
|
||||
float ThresholdComputeQuickSync::calculate_threshold(const Acq_Conf& acq_parameters) const
|
||||
{
|
||||
if (acq_parameters.pfa != 0)
|
||||
{
|
||||
// Calculate the threshold
|
||||
unsigned int frequency_bins = 0;
|
||||
for (int doppler = -acq_parameters.doppler_max; doppler <= acq_parameters.doppler_max; doppler += static_cast<int>(acq_parameters.doppler_step))
|
||||
{
|
||||
frequency_bins++;
|
||||
}
|
||||
|
||||
const auto ncells = (acq_parameters.code_length / acq_parameters.folding_factor) * frequency_bins;
|
||||
const auto exponent = 1.0 / static_cast<double>(ncells);
|
||||
const auto val = pow(1.0 - acq_parameters.pfa, exponent);
|
||||
const auto lambda = static_cast<double>(acq_parameters.code_length) / static_cast<double>(acq_parameters.folding_factor);
|
||||
boost::math::exponential_distribution<double> mydist(lambda);
|
||||
const auto threshold = static_cast<float>(quantile(mydist, val));
|
||||
return threshold;
|
||||
}
|
||||
|
||||
return acq_parameters.threshold;
|
||||
}
|
||||
|
||||
const std::string default_dump_filename("./acquisition.dat");
|
||||
|
||||
Acq_Conf get_acq_conf(
|
||||
const ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
const std::string& implementation,
|
||||
signal_flag sig_flag)
|
||||
{
|
||||
Acq_Conf acq_parameters;
|
||||
double chip_rate;
|
||||
double code_length_chips;
|
||||
uint32_t ms_per_code;
|
||||
|
||||
switch (sig_flag)
|
||||
{
|
||||
case GPS_1C:
|
||||
chip_rate = GPS_L1_CA_CODE_RATE_CPS;
|
||||
code_length_chips = GPS_L1_CA_CODE_LENGTH_CHIPS;
|
||||
ms_per_code = GPS_L1_CA_CODE_PERIOD_MS;
|
||||
break;
|
||||
case GAL_1B:
|
||||
chip_rate = GALILEO_E1_CODE_CHIP_RATE_CPS;
|
||||
code_length_chips = GALILEO_E1_B_CODE_LENGTH_CHIPS;
|
||||
ms_per_code = GALILEO_E1_CODE_PERIOD_MS;
|
||||
acq_parameters.cboc = configuration->property(role + ".cboc", false);
|
||||
break;
|
||||
case GAL_E5a:
|
||||
chip_rate = GALILEO_E5A_CODE_CHIP_RATE_CPS;
|
||||
code_length_chips = GALILEO_E5A_CODE_LENGTH_CHIPS;
|
||||
ms_per_code = GALILEO_E5A_CODE_PERIOD_MS;
|
||||
break;
|
||||
default:
|
||||
throw std::runtime_error("Invalid signal");
|
||||
}
|
||||
|
||||
std::unique_ptr<ThresholdComputeInterface> threshold_compute;
|
||||
boost::optional<uint32_t> default_folding_factor;
|
||||
uint32_t max_sampled_ms = std::numeric_limits<uint32_t>::max();
|
||||
|
||||
if (implementation == "GPS_L1_CA_PCPS_QuickSync_Acquisition")
|
||||
{
|
||||
const auto fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", static_cast<int64_t>(4000000));
|
||||
const auto fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
const auto code_length = static_cast<unsigned int>(round(fs_in / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)));
|
||||
default_folding_factor = static_cast<unsigned int>(ceil(sqrt(log2(code_length))));
|
||||
}
|
||||
else if (implementation == "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition")
|
||||
{
|
||||
default_folding_factor = 2;
|
||||
}
|
||||
else if (implementation == "Galileo_E5a_Noncoherent_IQ_Acquisition_CAF")
|
||||
{
|
||||
acq_parameters.zero_padding = configuration->property(role + ".Zero_padding", 0);
|
||||
|
||||
if (acq_parameters.zero_padding > 0)
|
||||
{
|
||||
DLOG(INFO) << "Zero padding activated. Changing to 1ms code + 1ms zero padding ";
|
||||
std::cout << "Zero padding activated. Changing to 1ms code + 1ms zero padding\n";
|
||||
max_sampled_ms = 2;
|
||||
}
|
||||
|
||||
max_sampled_ms = 3;
|
||||
}
|
||||
|
||||
if (default_folding_factor)
|
||||
{
|
||||
acq_parameters.folding_factor = configuration->property(role + ".folding_factor", *default_folding_factor);
|
||||
ms_per_code *= acq_parameters.folding_factor;
|
||||
threshold_compute = std::make_unique<ThresholdComputeQuickSync>();
|
||||
}
|
||||
else if (implementation == "GPS_L1_CA_PCPS_Assisted_Acquisition" ||
|
||||
implementation == "GPS_L1_CA_PCPS_Acquisition_Fine_Doppler" ||
|
||||
implementation == "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition")
|
||||
{
|
||||
threshold_compute = std::make_unique<ThresholdComputeBasic>();
|
||||
}
|
||||
else
|
||||
{
|
||||
threshold_compute = std::make_unique<ThresholdComputeDoppler>();
|
||||
}
|
||||
|
||||
acq_parameters.ms_per_code = ms_per_code;
|
||||
acq_parameters.sampled_ms = ms_per_code; // Set as default value
|
||||
acq_parameters.dump_filename = default_dump_filename; // Set as default value
|
||||
acq_parameters.SetFromConfiguration(configuration, role, chip_rate, 0);
|
||||
|
||||
if (implementation == "GPS_L1_CA_PCPS_Acquisition_Fine_Doppler")
|
||||
{
|
||||
acq_parameters.samples_per_ms = static_cast<float>(acq_parameters.vector_length);
|
||||
}
|
||||
|
||||
#if USE_GLOG_AND_GFLAGS
|
||||
if (FLAGS_doppler_max != 0)
|
||||
{
|
||||
acq_parameters.doppler_max = FLAGS_doppler_max;
|
||||
}
|
||||
if (FLAGS_doppler_step != 0)
|
||||
{
|
||||
acq_parameters.doppler_step = FLAGS_doppler_step;
|
||||
}
|
||||
#else
|
||||
if (absl::GetFlag(FLAGS_doppler_max) != 0)
|
||||
{
|
||||
acq_parameters.doppler_max = absl::GetFlag(FLAGS_doppler_max);
|
||||
}
|
||||
if (absl::GetFlag(FLAGS_doppler_step) != 0)
|
||||
{
|
||||
acq_parameters.doppler_step = absl::GetFlag(FLAGS_doppler_step);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (acq_parameters.sampled_ms > max_sampled_ms)
|
||||
{
|
||||
acq_parameters.sampled_ms = max_sampled_ms;
|
||||
DLOG(INFO) << "Coherent integration time should be " << max_sampled_ms << " ms or less. Changing to " << max_sampled_ms << "ms ";
|
||||
std::cout << "Too high coherent integration time. Changing to " << max_sampled_ms << "ms\n";
|
||||
}
|
||||
|
||||
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;
|
||||
acq_parameters.threshold = threshold_compute->calculate_threshold(acq_parameters);
|
||||
|
||||
return acq_parameters;
|
||||
}
|
||||
|
||||
bool use_stream_to_vector(const std::string& implementation)
|
||||
{
|
||||
if (implementation == "GPS_L1_CA_PCPS_Acquisition_Fine_Doppler" ||
|
||||
implementation == "GPS_L1_CA_PCPS_Assisted_Acquisition" ||
|
||||
implementation == "Galileo_E5a_Noncoherent_IQ_Acquisition_CAF")
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
acquisition_impl_interface_sptr get_acquisition_impl(const ConfigurationInterface* configuration, const std::string& role, const std::string& implementation, const Acq_Conf& acq_parameters)
|
||||
{
|
||||
if (implementation == "GPS_L1_CA_PCPS_Acquisition_Fine_Doppler")
|
||||
{
|
||||
return pcps_make_acquisition_fine_doppler_cc(acq_parameters);
|
||||
}
|
||||
else if (implementation == "GPS_L1_CA_PCPS_Assisted_Acquisition")
|
||||
{
|
||||
return pcps_make_assisted_acquisition_cc(acq_parameters);
|
||||
}
|
||||
else if (implementation == "GPS_L1_CA_PCPS_QuickSync_Acquisition" ||
|
||||
implementation == "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition")
|
||||
{
|
||||
const unsigned int max_dwells = acq_parameters.bit_transition_flag ? 2 : acq_parameters.max_dwells;
|
||||
return pcps_quicksync_make_acquisition_cc(acq_parameters, acq_parameters.folding_factor, max_dwells);
|
||||
}
|
||||
else if (implementation == "GPS_L1_CA_PCPS_Tong_Acquisition" ||
|
||||
implementation == "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition")
|
||||
{
|
||||
const auto tong_init_val = configuration->property(role + ".tong_init_val", 1U);
|
||||
const auto tong_max_val = configuration->property(role + ".tong_max_val", 2U);
|
||||
const auto tong_max_dwells = configuration->property(role + ".tong_max_dwells", tong_max_val + 1U);
|
||||
return pcps_tong_make_acquisition_cc(acq_parameters, tong_init_val, tong_max_val, tong_max_dwells);
|
||||
}
|
||||
#if OPENCL_BLOCKS
|
||||
else if (implementation == "GPS_L1_CA_PCPS_OpenCl_Acquisition")
|
||||
{
|
||||
const unsigned int max_dwells = acq_parameters.bit_transition_flag ? 2 : acq_parameters.max_dwells;
|
||||
return pcps_make_opencl_acquisition_cc(acq_parameters, max_dwells);
|
||||
}
|
||||
#endif
|
||||
else if (implementation == "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition")
|
||||
{
|
||||
return galileo_pcps_8ms_make_acquisition_cc(acq_parameters);
|
||||
}
|
||||
else if (implementation == "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition")
|
||||
{
|
||||
return pcps_cccwsr_make_acquisition_cc(acq_parameters);
|
||||
}
|
||||
else if (implementation == "Galileo_E5a_Noncoherent_IQ_Acquisition_CAF")
|
||||
{
|
||||
const auto sig = configuration->property("Channel.signal", std::string("5X"));
|
||||
const auto both_signal_components = (sig.at(0) == '5' && sig.at(1) == 'X');
|
||||
const auto caf_window_hz = configuration->property(role + ".CAF_window_hz", 0);
|
||||
return galileo_e5a_noncoherentIQ_make_acquisition_caf_cc(acq_parameters, both_signal_components, caf_window_hz, acq_parameters.zero_padding);
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
} // namespace
|
||||
|
||||
|
||||
PcpsAcquisitionAdapterCustom::PcpsAcquisitionAdapterCustom(
|
||||
const ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
const std::string& implementation,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams,
|
||||
signal_flag sig_flag)
|
||||
: acq_parameters_(get_acq_conf(configuration, role, implementation, sig_flag)),
|
||||
acquisition_cc_(get_acquisition_impl(configuration, role, implementation, acq_parameters_)),
|
||||
gnss_synchro_(nullptr),
|
||||
channel_(0),
|
||||
code_(acq_parameters_.vector_length),
|
||||
sig_flag_(sig_flag),
|
||||
role_(role),
|
||||
implementation_(implementation),
|
||||
is_type_gr_complex_(acq_parameters_.item_type == "gr_complex"),
|
||||
item_size_(is_type_gr_complex_ ? sizeof(gr_complex) : 0),
|
||||
use_stream_to_vector_(use_stream_to_vector(implementation))
|
||||
{
|
||||
DLOG(INFO) << "role " << role_;
|
||||
|
||||
if (is_type_gr_complex_)
|
||||
{
|
||||
if (use_stream_to_vector_)
|
||||
{
|
||||
stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, acq_parameters_.vector_length);
|
||||
DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id() << ")";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(WARNING) << acq_parameters_.item_type << " unknown acquisition item type";
|
||||
}
|
||||
|
||||
if (in_streams > 1)
|
||||
{
|
||||
LOG(ERROR) << "This implementation only supports one input stream";
|
||||
}
|
||||
if (out_streams > 0)
|
||||
{
|
||||
LOG(ERROR) << "This implementation does not provide an output stream";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void PcpsAcquisitionAdapterCustom::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (is_type_gr_complex_ && use_stream_to_vector_)
|
||||
{
|
||||
top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void PcpsAcquisitionAdapterCustom::disconnect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (is_type_gr_complex_ && use_stream_to_vector_)
|
||||
{
|
||||
top_block->disconnect(stream_to_vector_, 0, acquisition_cc_, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
gr::basic_block_sptr PcpsAcquisitionAdapterCustom::get_left_block()
|
||||
{
|
||||
if (use_stream_to_vector_)
|
||||
{
|
||||
return stream_to_vector_;
|
||||
}
|
||||
return acquisition_cc_;
|
||||
}
|
||||
|
||||
|
||||
gr::basic_block_sptr PcpsAcquisitionAdapterCustom::get_right_block()
|
||||
{
|
||||
return acquisition_cc_;
|
||||
}
|
||||
|
||||
|
||||
void PcpsAcquisitionAdapterCustom::set_gnss_synchro(Gnss_Synchro* gnss_synchro)
|
||||
{
|
||||
gnss_synchro_ = gnss_synchro;
|
||||
|
||||
if (is_type_gr_complex_)
|
||||
{
|
||||
acquisition_cc_->set_gnss_synchro(gnss_synchro);
|
||||
}
|
||||
}
|
||||
|
||||
void PcpsAcquisitionAdapterCustom::set_channel(unsigned int channel)
|
||||
{
|
||||
channel_ = channel;
|
||||
|
||||
if (is_type_gr_complex_)
|
||||
{
|
||||
acquisition_cc_->set_channel(channel);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void PcpsAcquisitionAdapterCustom::set_channel_fsm(std::weak_ptr<ChannelFsm> channel_fsm)
|
||||
{
|
||||
if (is_type_gr_complex_)
|
||||
{
|
||||
acquisition_cc_->set_channel_fsm(channel_fsm);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
signed int PcpsAcquisitionAdapterCustom::mag()
|
||||
{
|
||||
if (is_type_gr_complex_)
|
||||
{
|
||||
return acquisition_cc_->mag();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void PcpsAcquisitionAdapterCustom::reset()
|
||||
{
|
||||
if (is_type_gr_complex_)
|
||||
{
|
||||
acquisition_cc_->set_active(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void PcpsAcquisitionAdapterCustom::stop_acquisition()
|
||||
{
|
||||
if (is_type_gr_complex_)
|
||||
{
|
||||
acquisition_cc_->set_active(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void PcpsAcquisitionAdapterCustom::set_local_code()
|
||||
{
|
||||
if (is_type_gr_complex_)
|
||||
{
|
||||
if (implementation_ == "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition")
|
||||
{
|
||||
std::vector<std::complex<float>> code_pilot_(acq_parameters_.vector_length);
|
||||
auto& code_data_ = code_;
|
||||
|
||||
std::array<char, 3> signal = {{'1', 'B', '\0'}};
|
||||
galileo_e1_code_gen_complex_sampled(code_data_, signal, acq_parameters_.cboc, gnss_synchro_->PRN, acq_parameters_.fs_in, 0, false);
|
||||
|
||||
std::array<char, 3> signal_C = {{'1', 'C', '\0'}};
|
||||
galileo_e1_code_gen_complex_sampled(code_pilot_, signal_C, acq_parameters_.cboc, gnss_synchro_->PRN, acq_parameters_.fs_in, 0, false);
|
||||
|
||||
acquisition_cc_->set_local_code(code_data_.data(), code_pilot_.data());
|
||||
}
|
||||
else if (implementation_ == "Galileo_E5a_Noncoherent_IQ_Acquisition_CAF")
|
||||
{
|
||||
const auto code_length = acq_parameters_.code_length;
|
||||
const auto vector_length = acq_parameters_.vector_length;
|
||||
|
||||
auto& codeI_ = code_;
|
||||
std::vector<std::complex<float>> codeQ_(code_length);
|
||||
std::vector<std::complex<float>> codeI(code_length);
|
||||
std::vector<std::complex<float>> codeQ(code_length);
|
||||
|
||||
if (gnss_synchro_->Signal[0] == '5' && gnss_synchro_->Signal[1] == 'X')
|
||||
{
|
||||
std::array<char, 3> a = {{'5', 'I', '\0'}};
|
||||
galileo_e5_a_code_gen_complex_sampled(codeI, gnss_synchro_->PRN, a, acq_parameters_.fs_in, 0);
|
||||
|
||||
std::array<char, 3> b = {{'5', 'Q', '\0'}};
|
||||
galileo_e5_a_code_gen_complex_sampled(codeQ, gnss_synchro_->PRN, b, acq_parameters_.fs_in, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::array<char, 3> signal_type_ = {{'5', 'X', '\0'}};
|
||||
galileo_e5_a_code_gen_complex_sampled(codeI, gnss_synchro_->PRN, signal_type_, acq_parameters_.fs_in, 0);
|
||||
}
|
||||
// WARNING: 3ms are coherently integrated. Secondary sequence (1,1,1)
|
||||
// is generated, and modulated in the 'block'.
|
||||
own::span<gr_complex> codeI_span(codeI_.data(), vector_length);
|
||||
own::span<gr_complex> codeQ_span(codeQ_.data(), vector_length);
|
||||
if (acq_parameters_.zero_padding == 0) // if no zero_padding
|
||||
{
|
||||
for (unsigned int i = 0; i < acq_parameters_.sampled_ms; i++)
|
||||
{
|
||||
std::copy_n(codeI.data(), code_length, codeI_span.subspan(i * code_length, code_length).data());
|
||||
if (gnss_synchro_->Signal[0] == '5' && gnss_synchro_->Signal[1] == 'X')
|
||||
{
|
||||
std::copy_n(codeQ.data(), code_length, codeQ_span.subspan(i * code_length, code_length).data());
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 1ms code + 1ms zero padding
|
||||
std::copy_n(codeI.data(), code_length, codeI_.data());
|
||||
if (gnss_synchro_->Signal[0] == '5' && gnss_synchro_->Signal[1] == 'X')
|
||||
{
|
||||
std::copy_n(codeQ.data(), code_length, codeQ_.data());
|
||||
}
|
||||
}
|
||||
|
||||
acquisition_cc_->set_local_code(codeI_.data(), codeQ_.data());
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto code_length = acq_parameters_.code_length;
|
||||
std::vector<std::complex<float>> code(code_length);
|
||||
code_gen_complex_sampled(code, gnss_synchro_->PRN, acq_parameters_.fs_in);
|
||||
|
||||
own::span<gr_complex> code_span(code_.data(), acq_parameters_.vector_length);
|
||||
for (unsigned int i = 0; i < acq_parameters_.num_codes; i++)
|
||||
{
|
||||
std::copy_n(code.data(), code_length, code_span.subspan(i * code_length, code_length).data());
|
||||
}
|
||||
|
||||
acquisition_cc_->set_local_code(code_.data());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PcpsAcquisitionAdapterCustom::code_gen_complex_sampled(own::span<std::complex<float>> dest, uint32_t prn, int32_t sampling_freq)
|
||||
{
|
||||
switch (sig_flag_)
|
||||
{
|
||||
case GPS_1C:
|
||||
gps_l1_ca_code_gen_complex_sampled(dest, prn, sampling_freq, 0);
|
||||
break;
|
||||
case GAL_1B:
|
||||
{
|
||||
std::array<char, 3> Signal_{};
|
||||
Signal_[0] = gnss_synchro_->Signal[0];
|
||||
Signal_[1] = gnss_synchro_->Signal[1];
|
||||
Signal_[2] = '\0';
|
||||
|
||||
galileo_e1_code_gen_complex_sampled(dest, Signal_, acq_parameters_.cboc, prn, sampling_freq, 0, false);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw std::runtime_error("Invalid signal");
|
||||
}
|
||||
}
|
||||
+18
-51
@@ -16,16 +16,16 @@
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef GNSS_SDR_BASE_PCPS_ACQUISITION_CUSTOM_H
|
||||
#define GNSS_SDR_BASE_PCPS_ACQUISITION_CUSTOM_H
|
||||
#ifndef GNSS_SDR_PCPS_ACQUISITION_ADAPTER_CUSTOM_H
|
||||
#define GNSS_SDR_PCPS_ACQUISITION_ADAPTER_CUSTOM_H
|
||||
|
||||
#include "acquisition_impl_interface.h"
|
||||
#include "channel_fsm.h"
|
||||
#include "gnss_synchro.h"
|
||||
#include "pcps_acquisition.h"
|
||||
#include "signal_flag.h"
|
||||
#include <gnuradio/blocks/stream_to_vector.h>
|
||||
#include <volk_gnsssdr/volk_gnsssdr_alloc.h>
|
||||
#include <limits>
|
||||
|
||||
/** \addtogroup Acquisition
|
||||
* Classes for GNSS signal acquisition
|
||||
@@ -37,56 +37,25 @@
|
||||
|
||||
class ConfigurationInterface;
|
||||
|
||||
class ThresholdComputeInterface
|
||||
{
|
||||
public:
|
||||
virtual float calculate_threshold(const Acq_Conf& acq_parameters) const = 0;
|
||||
};
|
||||
|
||||
class ThresholdComputeBasic : public ThresholdComputeInterface
|
||||
{
|
||||
public:
|
||||
float calculate_threshold(const Acq_Conf& acq_parameters) const override;
|
||||
};
|
||||
|
||||
class ThresholdComputeDoppler : public ThresholdComputeInterface
|
||||
{
|
||||
public:
|
||||
float calculate_threshold(const Acq_Conf& acq_parameters) const override;
|
||||
};
|
||||
|
||||
class ThresholdComputeQuickSync : public ThresholdComputeInterface
|
||||
{
|
||||
public:
|
||||
explicit ThresholdComputeQuickSync(uint32_t folding_factor);
|
||||
|
||||
float calculate_threshold(const Acq_Conf& acq_parameters) const override;
|
||||
|
||||
private:
|
||||
const uint32_t folding_factor_;
|
||||
};
|
||||
|
||||
/*!
|
||||
* \brief This class adapts a PCPS acquisition block to an AcquisitionInterface
|
||||
*/
|
||||
class BasePcpsAcquisitionCustom : public AcquisitionInterface
|
||||
class PcpsAcquisitionAdapterCustom : public AcquisitionInterface
|
||||
{
|
||||
public:
|
||||
BasePcpsAcquisitionCustom(const ConfigurationInterface* configuration,
|
||||
PcpsAcquisitionAdapterCustom(const ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
const std::string& implementation,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams,
|
||||
double chip_rate,
|
||||
double code_length_chips,
|
||||
unsigned int ms_per_code,
|
||||
bool use_stream_to_vector,
|
||||
const ThresholdComputeInterface& threshold_compute,
|
||||
uint32_t max_sampled_ms = std::numeric_limits<uint32_t>::max());
|
||||
signal_flag sig_flag);
|
||||
|
||||
~BasePcpsAcquisitionCustom() = default;
|
||||
~PcpsAcquisitionAdapterCustom() = default;
|
||||
|
||||
inline std::string role() override { return role_; }
|
||||
|
||||
inline std::string implementation() override { return implementation_; }
|
||||
|
||||
inline size_t item_size() override { return item_size_; }
|
||||
|
||||
void connect(gr::top_block_sptr top_block) override;
|
||||
@@ -134,23 +103,21 @@ public:
|
||||
void set_local_code() override;
|
||||
|
||||
|
||||
protected:
|
||||
bool is_type_gr_complex() const { return is_type_gr_complex_; }
|
||||
private:
|
||||
/*!
|
||||
* \brief Generate code
|
||||
*/
|
||||
void code_gen_complex_sampled(own::span<std::complex<float>> dest, uint32_t prn, int32_t sampling_freq);
|
||||
|
||||
const Acq_Conf acq_parameters_;
|
||||
acquisition_impl_interface_sptr acquisition_cc_;
|
||||
Gnss_Synchro* gnss_synchro_;
|
||||
unsigned int channel_;
|
||||
volk_gnsssdr::vector<std::complex<float>> code_;
|
||||
|
||||
private:
|
||||
/*!
|
||||
* \brief Generate code
|
||||
*/
|
||||
virtual void code_gen_complex_sampled(own::span<std::complex<float>> dest, uint32_t prn, int32_t sampling_freq) = 0;
|
||||
|
||||
gr::blocks::stream_to_vector::sptr stream_to_vector_;
|
||||
const signal_flag sig_flag_;
|
||||
const std::string role_;
|
||||
const std::string implementation_;
|
||||
const bool is_type_gr_complex_;
|
||||
const size_t item_size_;
|
||||
const bool use_stream_to_vector_;
|
||||
@@ -159,4 +126,4 @@ private:
|
||||
|
||||
/** \} */
|
||||
/** \} */
|
||||
#endif // GNSS_SDR_BASE_PCPS_ACQUISITION_H
|
||||
#endif // GNSS_SDR_PCPS_ACQUISITION_ADAPTER_CUSTOM_H
|
||||
@@ -75,10 +75,12 @@ public:
|
||||
bool use_automatic_resampler{false};
|
||||
bool enable_monitor_output{false};
|
||||
|
||||
// Galileo only
|
||||
// Specific to some implementations
|
||||
bool acquire_pilot{false};
|
||||
bool acquire_iq{false};
|
||||
bool cboc{false};
|
||||
int zero_padding{0};
|
||||
uint32_t folding_factor{0};
|
||||
|
||||
// Not part of the configuration interface
|
||||
uint32_t num_codes{0};
|
||||
|
||||
@@ -42,12 +42,7 @@
|
||||
#include "fir_filter.h"
|
||||
#include "four_bit_cpx_file_signal_source.h"
|
||||
#include "freq_xlating_fir_filter.h"
|
||||
#include "galileo_e1_pcps_8ms_ambiguous_acquisition.h"
|
||||
#include "galileo_e1_pcps_cccwsr_ambiguous_acquisition.h"
|
||||
#include "galileo_e1_pcps_quicksync_ambiguous_acquisition.h"
|
||||
#include "galileo_e1_pcps_tong_ambiguous_acquisition.h"
|
||||
#include "galileo_e1_tcp_connector_tracking.h"
|
||||
#include "galileo_e5a_noncoherent_iq_acquisition_caf.h"
|
||||
#include "galileo_telemetry_decoder_gs.h"
|
||||
#include "glonass_l1_ca_telemetry_decoder_gs.h"
|
||||
#include "glonass_l2_ca_telemetry_decoder_gs.h"
|
||||
@@ -56,10 +51,6 @@
|
||||
#include "gnss_sdr_string_literals.h"
|
||||
#include "gps_l1_ca_gaussian_tracking.h"
|
||||
#include "gps_l1_ca_kf_tracking.h"
|
||||
#include "gps_l1_ca_pcps_acquisition_fine_doppler.h"
|
||||
#include "gps_l1_ca_pcps_assisted_acquisition.h"
|
||||
#include "gps_l1_ca_pcps_quicksync_acquisition.h"
|
||||
#include "gps_l1_ca_pcps_tong_acquisition.h"
|
||||
#include "gps_l1_ca_tcp_connector_tracking.h"
|
||||
#include "gps_l1_ca_telemetry_decoder_gs.h"
|
||||
#include "gps_l2c_telemetry_decoder_gs.h"
|
||||
@@ -79,6 +70,7 @@
|
||||
#include "ntlab_file_signal_source.h"
|
||||
#include "pass_through.h"
|
||||
#include "pcps_acquisition_adapter.h"
|
||||
#include "pcps_acquisition_adapter_custom.h"
|
||||
#include "pulse_blanking_filter.h"
|
||||
#include "rtklib_pvt.h"
|
||||
#include "rtl_tcp_signal_source.h"
|
||||
@@ -113,10 +105,6 @@
|
||||
#include "pcps_acquisition_adapter_fpga.h"
|
||||
#endif
|
||||
|
||||
#if OPENCL_BLOCKS
|
||||
#include "gps_l1_ca_pcps_opencl_acquisition.h"
|
||||
#endif
|
||||
|
||||
#if RAW_ARRAY_DRIVER
|
||||
#include "raw_array_signal_source.h"
|
||||
#endif
|
||||
@@ -425,19 +413,19 @@ std::unique_ptr<AcquisitionInterface> get_acq_block(
|
||||
}
|
||||
else if (implementation == "GPS_L1_CA_PCPS_Assisted_Acquisition")
|
||||
{
|
||||
return std::make_unique<GpsL1CaPcpsAssistedAcquisition>(configuration, role, in_streams, out_streams);
|
||||
return std::make_unique<PcpsAcquisitionAdapterCustom>(configuration, role, implementation, in_streams, out_streams, GPS_1C);
|
||||
}
|
||||
else if (implementation == "GPS_L1_CA_PCPS_Tong_Acquisition")
|
||||
{
|
||||
return std::make_unique<GpsL1CaPcpsTongAcquisition>(configuration, role, in_streams, out_streams);
|
||||
return std::make_unique<PcpsAcquisitionAdapterCustom>(configuration, role, implementation, in_streams, out_streams, GPS_1C);
|
||||
}
|
||||
else if (implementation == "GPS_L1_CA_PCPS_Acquisition_Fine_Doppler")
|
||||
{
|
||||
return std::make_unique<GpsL1CaPcpsAcquisitionFineDoppler>(configuration, role, in_streams, out_streams);
|
||||
return std::make_unique<PcpsAcquisitionAdapterCustom>(configuration, role, implementation, in_streams, out_streams, GPS_1C);
|
||||
}
|
||||
else if (implementation == "GPS_L1_CA_PCPS_QuickSync_Acquisition")
|
||||
{
|
||||
return std::make_unique<GpsL1CaPcpsQuickSyncAcquisition>(configuration, role, in_streams, out_streams);
|
||||
return std::make_unique<PcpsAcquisitionAdapterCustom>(configuration, role, implementation, in_streams, out_streams, GPS_1C);
|
||||
}
|
||||
else if (implementation == "GPS_L2_M_PCPS_Acquisition")
|
||||
{
|
||||
@@ -453,23 +441,23 @@ std::unique_ptr<AcquisitionInterface> get_acq_block(
|
||||
}
|
||||
else if (implementation == "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition")
|
||||
{
|
||||
return std::make_unique<GalileoE1Pcps8msAmbiguousAcquisition>(configuration, role, in_streams, out_streams);
|
||||
return std::make_unique<PcpsAcquisitionAdapterCustom>(configuration, role, implementation, in_streams, out_streams, GAL_1B);
|
||||
}
|
||||
else if (implementation == "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition")
|
||||
{
|
||||
return std::make_unique<GalileoE1PcpsTongAmbiguousAcquisition>(configuration, role, in_streams, out_streams);
|
||||
return std::make_unique<PcpsAcquisitionAdapterCustom>(configuration, role, implementation, in_streams, out_streams, GAL_1B);
|
||||
}
|
||||
else if (implementation == "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition")
|
||||
{
|
||||
return std::make_unique<GalileoE1PcpsCccwsrAmbiguousAcquisition>(configuration, role, in_streams, out_streams);
|
||||
return std::make_unique<PcpsAcquisitionAdapterCustom>(configuration, role, implementation, in_streams, out_streams, GAL_1B);
|
||||
}
|
||||
else if (implementation == "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition")
|
||||
{
|
||||
return std::make_unique<GalileoE1PcpsQuickSyncAmbiguousAcquisition>(configuration, role, in_streams, out_streams);
|
||||
return std::make_unique<PcpsAcquisitionAdapterCustom>(configuration, role, implementation, in_streams, out_streams, GAL_1B);
|
||||
}
|
||||
else if (implementation == "Galileo_E5a_Noncoherent_IQ_Acquisition_CAF")
|
||||
{
|
||||
return std::make_unique<GalileoE5aNoncoherentIQAcquisitionCaf>(configuration, role, in_streams, out_streams);
|
||||
return std::make_unique<PcpsAcquisitionAdapterCustom>(configuration, role, implementation, in_streams, out_streams, GAL_E5a);
|
||||
}
|
||||
else if (implementation == "Galileo_E5a_Pcps_Acquisition")
|
||||
{
|
||||
@@ -510,7 +498,7 @@ std::unique_ptr<AcquisitionInterface> get_acq_block(
|
||||
#if OPENCL_BLOCKS
|
||||
else if (implementation == "GPS_L1_CA_PCPS_OpenCl_Acquisition")
|
||||
{
|
||||
return std::make_unique<GpsL1CaPcpsOpenClAcquisition>(configuration, role, in_streams, out_streams);
|
||||
return std::make_unique<PcpsAcquisitionAdapterCustom>(configuration, role, implementation, in_streams, out_streams, GPS_1C);
|
||||
}
|
||||
#endif
|
||||
#if ENABLE_FPGA
|
||||
|
||||
@@ -18,15 +18,15 @@
|
||||
#include "GPS_L1_CA.h"
|
||||
#include "acquisition_dump_reader.h"
|
||||
#include "acquisition_interface.h"
|
||||
#include "configuration_interface.h"
|
||||
#include "display.h"
|
||||
#include "file_configuration.h"
|
||||
#include "gnss_block_factory.h"
|
||||
#include "gnss_block_interface.h"
|
||||
#include "gnss_sdr_filesystem.h"
|
||||
#include "gnss_sdr_valve.h"
|
||||
#include "gnuplot_i.h"
|
||||
#include "gps_l1_ca_pcps_acquisition_fine_doppler.h"
|
||||
#include "in_memory_configuration.h"
|
||||
#include "pcps_acquisition_adapter.h"
|
||||
#include "signal_generator_flags.h"
|
||||
#include "test_flags.h"
|
||||
#include "tracking_true_obs_reader.h"
|
||||
@@ -37,6 +37,7 @@
|
||||
#include <gnuradio/top_block.h>
|
||||
#include <pmt/pmt.h>
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include <utility>
|
||||
@@ -483,7 +484,7 @@ protected:
|
||||
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue;
|
||||
gr::top_block_sptr top_block;
|
||||
std::shared_ptr<AcquisitionInterface> acquisition;
|
||||
std::unique_ptr<AcquisitionInterface> acquisition;
|
||||
std::shared_ptr<InMemoryConfiguration> config;
|
||||
std::shared_ptr<FileConfiguration> config_f;
|
||||
Gnss_Synchro gnss_synchro;
|
||||
@@ -806,44 +807,18 @@ int AcquisitionPerformanceTest::run_receiver()
|
||||
gnss_synchro = Gnss_Synchro();
|
||||
init();
|
||||
|
||||
int nsamples = floor(config->property("GNSS-SDR.internal_fs_sps", 2000000) * generated_signal_duration_s);
|
||||
const ConfigurationInterface* configuration = config.get();
|
||||
if (configuration == nullptr)
|
||||
{
|
||||
configuration = config_f.get();
|
||||
}
|
||||
int nsamples = floor(configuration->property("GNSS-SDR.internal_fs_sps", 2000000) * generated_signal_duration_s);
|
||||
auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get());
|
||||
if (implementation == "GPS_L1_CA_PCPS_Acquisition")
|
||||
acquisition = block_factory::GetAcqBlock(configuration, "Acquisition", 1, 0);
|
||||
if (!acquisition)
|
||||
{
|
||||
acquisition = std::make_shared<PcpsAcquisitionAdapter>(config.get(), "Acquisition", implementation, 1, 0, GPS_1C);
|
||||
}
|
||||
else if (implementation == "GPS_L1_CA_PCPS_Acquisition_Fine_Doppler")
|
||||
{
|
||||
acquisition = std::make_shared<GpsL1CaPcpsAcquisitionFineDoppler>(config.get(), "Acquisition", 1, 0);
|
||||
}
|
||||
else if (implementation == "Galileo_E1_PCPS_Ambiguous_Acquisition")
|
||||
{
|
||||
acquisition = std::make_shared<PcpsAcquisitionAdapter>(config.get(), "Acquisition", implementation, 1, 0, GAL_1B);
|
||||
}
|
||||
else if (implementation == "GLONASS_L1_CA_PCPS_Acquisition")
|
||||
{
|
||||
acquisition = std::make_shared<PcpsAcquisitionAdapter>(config.get(), "Acquisition", implementation, 1, 0, GLO_1G);
|
||||
}
|
||||
else if (implementation == "GLONASS_L2_CA_PCPS_Acquisition")
|
||||
{
|
||||
acquisition = std::make_shared<PcpsAcquisitionAdapter>(config.get(), "Acquisition", implementation, 1, 0, GLO_2G);
|
||||
}
|
||||
else if (implementation == "GPS_L2_M_PCPS_Acquisition")
|
||||
{
|
||||
acquisition = std::make_shared<PcpsAcquisitionAdapter>(config.get(), "Acquisition", implementation, 1, 0, GPS_2S);
|
||||
}
|
||||
else if (implementation == "Galileo_E5a_Pcps_Acquisition")
|
||||
{
|
||||
acquisition = std::make_shared<PcpsAcquisitionAdapter>(config.get(), "Acquisition", implementation, 1, 0, GAL_E5a);
|
||||
}
|
||||
else if (implementation == "GPS_L5i_PCPS_Acquisition")
|
||||
{
|
||||
acquisition = std::make_shared<PcpsAcquisitionAdapter>(config.get(), "Acquisition", implementation, 1, 0, GPS_L5);
|
||||
}
|
||||
else
|
||||
{
|
||||
bool aux = false;
|
||||
EXPECT_EQ(true, aux);
|
||||
ADD_FAILURE() << "Unknown acquisition implementation: " << implementation;
|
||||
return -1;
|
||||
}
|
||||
|
||||
acquisition->set_gnss_synchro(&gnss_synchro);
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#include "acquisition_interface.h"
|
||||
#include "acquisition_msg_rx.h"
|
||||
#include "dll_pll_tracking_adapter.h"
|
||||
#include "galileo_e5a_noncoherent_iq_acquisition_caf.h"
|
||||
#include "gnss_block_factory.h"
|
||||
#include "gnss_block_interface.h"
|
||||
#include "gnss_satellite.h"
|
||||
@@ -35,7 +34,6 @@
|
||||
#include "in_memory_configuration.h"
|
||||
#include "observable_tests_flags.h"
|
||||
#include "observables_dump_reader.h"
|
||||
#include "pcps_acquisition_adapter.h"
|
||||
#include "signal_generator_flags.h"
|
||||
#include "telemetry_decoder_interface.h"
|
||||
#include "test_flags.h"
|
||||
@@ -59,6 +57,7 @@
|
||||
#include <cmath>
|
||||
#include <exception>
|
||||
#include <iomanip>
|
||||
#include <memory>
|
||||
#include <unistd.h>
|
||||
#include <utility>
|
||||
#if GNSSTK_USES_GPSTK_NAMESPACE
|
||||
@@ -427,7 +426,8 @@ bool HybridObservablesTest::acquire_signal()
|
||||
config->set_property("Acquisition.dump", "false");
|
||||
config->set_property("Acquisition.dump_filename", "./data/acquisition.dat");
|
||||
|
||||
std::shared_ptr<AcquisitionInterface> acquisition;
|
||||
std::unique_ptr<AcquisitionInterface> acquisition;
|
||||
std::string acquisition_implementation;
|
||||
|
||||
std::string System_and_Signal;
|
||||
std::string signal;
|
||||
@@ -445,7 +445,7 @@ bool HybridObservablesTest::acquire_signal()
|
||||
#else
|
||||
config->set_property("Acquisition.max_dwells", std::to_string(absl::GetFlag(FLAGS_external_signal_acquisition_dwells)));
|
||||
#endif
|
||||
acquisition = std::make_shared<PcpsAcquisitionAdapter>(config.get(), "Acquisition", "GPS_L1_CA_PCPS_Acquisition", 1, 0, GPS_1C);
|
||||
acquisition_implementation = "GPS_L1_CA_PCPS_Acquisition";
|
||||
}
|
||||
else if (implementation == "Galileo_E1_DLL_PLL_VEML_Tracking")
|
||||
{
|
||||
@@ -460,7 +460,7 @@ bool HybridObservablesTest::acquire_signal()
|
||||
#else
|
||||
config->set_property("Acquisition.max_dwells", std::to_string(absl::GetFlag(FLAGS_external_signal_acquisition_dwells)));
|
||||
#endif
|
||||
acquisition = std::make_shared<PcpsAcquisitionAdapter>(config.get(), "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 0, GAL_1B);
|
||||
acquisition_implementation = "Galileo_E1_PCPS_Ambiguous_Acquisition";
|
||||
}
|
||||
else if (implementation == "GPS_L2_M_DLL_PLL_Tracking")
|
||||
{
|
||||
@@ -475,7 +475,7 @@ bool HybridObservablesTest::acquire_signal()
|
||||
#else
|
||||
config->set_property("Acquisition.max_dwells", std::to_string(absl::GetFlag(FLAGS_external_signal_acquisition_dwells)));
|
||||
#endif
|
||||
acquisition = std::make_shared<PcpsAcquisitionAdapter>(config.get(), "Acquisition", "GPS_L2_M_PCPS_Acquisition", 1, 0, GPS_2S);
|
||||
acquisition_implementation = "GPS_L2_M_PCPS_Acquisition";
|
||||
}
|
||||
else if (implementation == "Galileo_E5a_DLL_PLL_Tracking_b")
|
||||
{
|
||||
@@ -494,7 +494,7 @@ bool HybridObservablesTest::acquire_signal()
|
||||
config->set_property("Acquisition.CAF_window_hz", "0"); // **Only for E5a** Resolves doppler ambiguity averaging the specified BW in the winner code delay. If set to 0 CAF filter is deactivated. Recommended value 3000 Hz
|
||||
config->set_property("Acquisition.Zero_padding", "0"); // **Only for E5a** Avoids power loss and doppler ambiguity in bit transitions by correlating one code with twice the input data length, ensuring that at least one full code is present without transitions. If set to 1 it is ON, if set to 0 it is OFF.
|
||||
config->set_property("Acquisition.bit_transition_flag", "false");
|
||||
acquisition = std::make_shared<GalileoE5aNoncoherentIQAcquisitionCaf>(config.get(), "Acquisition", 1, 0);
|
||||
acquisition_implementation = "Galileo_E5a_Noncoherent_IQ_Acquisition_CAF";
|
||||
}
|
||||
|
||||
else if (implementation == "Galileo_E5a_DLL_PLL_Tracking")
|
||||
@@ -510,7 +510,7 @@ bool HybridObservablesTest::acquire_signal()
|
||||
#else
|
||||
config->set_property("Acquisition.max_dwells", std::to_string(absl::GetFlag(FLAGS_external_signal_acquisition_dwells)));
|
||||
#endif
|
||||
acquisition = std::make_shared<PcpsAcquisitionAdapter>(config.get(), "Acquisition", "Galileo_E5a_Pcps_Acquisition", 1, 0, GAL_E5a);
|
||||
acquisition_implementation = "Galileo_E5a_Pcps_Acquisition";
|
||||
}
|
||||
else if (implementation == "GPS_L5_DLL_PLL_Tracking")
|
||||
{
|
||||
@@ -525,7 +525,7 @@ bool HybridObservablesTest::acquire_signal()
|
||||
#else
|
||||
config->set_property("Acquisition.max_dwells", std::to_string(absl::GetFlag(FLAGS_external_signal_acquisition_dwells)));
|
||||
#endif
|
||||
acquisition = std::make_shared<PcpsAcquisitionAdapter>(config.get(), "Acquisition", "GPS_L5i_PCPS_Acquisition", 1, 0, GPS_L5);
|
||||
acquisition_implementation = "GPS_L5i_PCPS_Acquisition";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -539,6 +539,14 @@ bool HybridObservablesTest::acquire_signal()
|
||||
config->set_property("Acquisition.threshold", std::to_string(absl::GetFlag(FLAGS_external_signal_acquisition_threshold)));
|
||||
#endif
|
||||
|
||||
config->set_property("Acquisition.implementation", acquisition_implementation);
|
||||
acquisition = block_factory::GetAcqBlock(config.get(), "Acquisition", 1, 0);
|
||||
if (!acquisition)
|
||||
{
|
||||
std::cout << "The test can not instantiate " << acquisition_implementation << "\n";
|
||||
throw(std::exception());
|
||||
}
|
||||
|
||||
acquisition->set_gnss_synchro(&tmp_gnss_synchro);
|
||||
acquisition->set_channel(0);
|
||||
acquisition->set_local_code();
|
||||
|
||||
@@ -24,15 +24,12 @@
|
||||
#include "acquisition_interface.h"
|
||||
#include "acquisition_msg_rx.h"
|
||||
#include "concurrent_queue.h"
|
||||
#include "galileo_e5a_noncoherent_iq_acquisition_caf.h"
|
||||
#include "gnss_block_factory.h"
|
||||
#include "gnss_block_interface.h"
|
||||
#include "gnss_sdr_filesystem.h"
|
||||
#include "gnss_sdr_valve.h"
|
||||
#include "gnuplot_i.h"
|
||||
#include "gps_l1_ca_pcps_acquisition_fine_doppler.h"
|
||||
#include "in_memory_configuration.h"
|
||||
#include "pcps_acquisition_adapter.h"
|
||||
#include "signal_generator_flags.h"
|
||||
#include "test_flags.h"
|
||||
#include "tracking_dump_reader.h"
|
||||
@@ -51,6 +48,7 @@
|
||||
#include <pmt/pmt.h>
|
||||
#include <chrono>
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
@@ -427,7 +425,8 @@ bool TrackingPullInTest::acquire_signal(int SV_ID)
|
||||
config->set_property("Acquisition.dump", "false");
|
||||
config->set_property("Acquisition.dump_filename", "./data/acquisition.dat");
|
||||
|
||||
std::shared_ptr<AcquisitionInterface> acquisition;
|
||||
std::unique_ptr<AcquisitionInterface> acquisition;
|
||||
std::string acquisition_implementation;
|
||||
|
||||
std::string System_and_Signal;
|
||||
std::string signal;
|
||||
@@ -445,8 +444,7 @@ bool TrackingPullInTest::acquire_signal(int SV_ID)
|
||||
#else
|
||||
config->set_property("Acquisition.max_dwells", std::to_string(absl::GetFlag(FLAGS_external_signal_acquisition_dwells)));
|
||||
#endif
|
||||
// acquisition = std::make_shared<GpsL1CaPcpsAcquisitionFineDoppler>(config.get(), "Acquisition", 1, 0);
|
||||
acquisition = std::make_shared<PcpsAcquisitionAdapter>(config.get(), "Acquisition", "GPS_L1_CA_PCPS_Acquisition", 1, 0, GPS_1C);
|
||||
acquisition_implementation = "GPS_L1_CA_PCPS_Acquisition";
|
||||
}
|
||||
else if (implementation == "Galileo_E1_DLL_PLL_VEML_Tracking")
|
||||
{
|
||||
@@ -461,7 +459,7 @@ bool TrackingPullInTest::acquire_signal(int SV_ID)
|
||||
#else
|
||||
config->set_property("Acquisition.max_dwells", std::to_string(absl::GetFlag(FLAGS_external_signal_acquisition_dwells)));
|
||||
#endif
|
||||
acquisition = std::make_shared<PcpsAcquisitionAdapter>(config.get(), "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 0, GAL_1B);
|
||||
acquisition_implementation = "Galileo_E1_PCPS_Ambiguous_Acquisition";
|
||||
}
|
||||
else if (implementation == "GPS_L2_M_DLL_PLL_Tracking")
|
||||
{
|
||||
@@ -476,7 +474,7 @@ bool TrackingPullInTest::acquire_signal(int SV_ID)
|
||||
#else
|
||||
config->set_property("Acquisition.max_dwells", std::to_string(absl::GetFlag(FLAGS_external_signal_acquisition_dwells)));
|
||||
#endif
|
||||
acquisition = std::make_shared<PcpsAcquisitionAdapter>(config.get(), "Acquisition", "GPS_L2_M_PCPS_Acquisition", 1, 0, GPS_2S);
|
||||
acquisition_implementation = "GPS_L2_M_PCPS_Acquisition";
|
||||
}
|
||||
else if (implementation == "Galileo_E5a_DLL_PLL_Tracking_b")
|
||||
{
|
||||
@@ -495,7 +493,7 @@ bool TrackingPullInTest::acquire_signal(int SV_ID)
|
||||
config->set_property("Acquisition.CAF_window_hz", "0"); // **Only for E5a** Resolves doppler ambiguity averaging the specified BW in the winner code delay. If set to 0 CAF filter is deactivated. Recommended value 3000 Hz
|
||||
config->set_property("Acquisition.Zero_padding", "0"); // **Only for E5a** Avoids power loss and doppler ambiguity in bit transitions by correlating one code with twice the input data length, ensuring that at least one full code is present without transitions. If set to 1 it is ON, if set to 0 it is OFF.
|
||||
config->set_property("Acquisition.bit_transition_flag", "false");
|
||||
acquisition = std::make_shared<GalileoE5aNoncoherentIQAcquisitionCaf>(config.get(), "Acquisition", 1, 0);
|
||||
acquisition_implementation = "Galileo_E5a_Noncoherent_IQ_Acquisition_CAF";
|
||||
}
|
||||
|
||||
else if (implementation == "Galileo_E5a_DLL_PLL_Tracking")
|
||||
@@ -511,7 +509,7 @@ bool TrackingPullInTest::acquire_signal(int SV_ID)
|
||||
#else
|
||||
config->set_property("Acquisition.max_dwells", std::to_string(absl::GetFlag(FLAGS_external_signal_acquisition_dwells)));
|
||||
#endif
|
||||
acquisition = std::make_shared<PcpsAcquisitionAdapter>(config.get(), "Acquisition", "Galileo_E5a_Pcps_Acquisition", 1, 0, GAL_E5a);
|
||||
acquisition_implementation = "Galileo_E5a_Pcps_Acquisition";
|
||||
}
|
||||
else if (implementation == "GPS_L5_DLL_PLL_Tracking")
|
||||
{
|
||||
@@ -526,7 +524,7 @@ bool TrackingPullInTest::acquire_signal(int SV_ID)
|
||||
#else
|
||||
config->set_property("Acquisition.max_dwells", std::to_string(absl::GetFlag(FLAGS_external_signal_acquisition_dwells)));
|
||||
#endif
|
||||
acquisition = std::make_shared<PcpsAcquisitionAdapter>(config.get(), "Acquisition", "GPS_L5i_PCPS_Acquisition", 1, 0, GPS_L5);
|
||||
acquisition_implementation = "GPS_L5i_PCPS_Acquisition";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -534,6 +532,14 @@ bool TrackingPullInTest::acquire_signal(int SV_ID)
|
||||
throw(std::exception());
|
||||
}
|
||||
|
||||
config->set_property("Acquisition.implementation", acquisition_implementation);
|
||||
acquisition = block_factory::GetAcqBlock(config.get(), "Acquisition", 1, 0);
|
||||
if (!acquisition)
|
||||
{
|
||||
std::cout << "The test can not instantiate " << acquisition_implementation << "\n";
|
||||
throw(std::exception());
|
||||
}
|
||||
|
||||
acquisition->set_gnss_synchro(&tmp_gnss_synchro);
|
||||
acquisition->set_channel(0);
|
||||
acquisition->set_local_code();
|
||||
|
||||
@@ -34,8 +34,9 @@
|
||||
#include "gps_almanac.h"
|
||||
#include "gps_ephemeris.h"
|
||||
#include "gps_iono.h"
|
||||
#include "gps_l1_ca_pcps_acquisition_fine_doppler.h"
|
||||
#include "gps_utc_model.h"
|
||||
#include "pcps_acquisition_adapter_custom.h"
|
||||
#include "signal_flag.h"
|
||||
#include "signal_source_interface.h" // for SignalSourceInterface
|
||||
#include <boost/any.hpp> // for bad_any_cast
|
||||
#include <boost/exception/exception.hpp>
|
||||
@@ -240,7 +241,8 @@ FrontEndCal_msg_rx::FrontEndCal_msg_rx()
|
||||
this->message_port_register_in(pmt::mp("events"));
|
||||
|
||||
#if HAS_GENERIC_LAMBDA
|
||||
this->set_msg_handler(pmt::mp("events"), [this](auto&& PH1) { msg_handler_channel_events(std::forward<decltype(PH1)>(PH1)); });
|
||||
this->set_msg_handler(pmt::mp("events"), [this](auto&& PH1)
|
||||
{ msg_handler_channel_events(std::forward<decltype(PH1)>(PH1)); });
|
||||
#else
|
||||
#if USE_BOOST_BIND_PLACEHOLDERS
|
||||
this->set_msg_handler(
|
||||
@@ -533,7 +535,7 @@ try
|
||||
configuration->set_property("Acquisition.doppler_max", "10000");
|
||||
configuration->set_property("Acquisition.threshold", "2.0");
|
||||
|
||||
auto acquisition = std::make_shared<GpsL1CaPcpsAcquisitionFineDoppler>(configuration.get(), "Acquisition", 1, 1);
|
||||
auto acquisition = std::make_shared<PcpsAcquisitionAdapterCustom>(configuration.get(), "Acquisition", "GPS_L1_CA_PCPS_Acquisition_Fine_Doppler", 1, 1, GPS_1C);
|
||||
|
||||
acquisition->set_channel(1);
|
||||
acquisition->set_gnss_synchro(&gnss_synchro);
|
||||
|
||||
Reference in New Issue
Block a user