1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-01-18 21:23:02 +00:00
This commit is contained in:
Carles Fernandez 2019-07-28 14:00:20 +02:00
commit 9094f4b4f5
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
76 changed files with 513 additions and 494 deletions

View File

@ -121,7 +121,7 @@ Rtklib_Pvt::Rtklib_Pvt(ConfigurationInterface* configuration,
int rtcm_MT1077_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1077_rate_ms", rtcm_MSM_rate_ms), pvt_output_parameters.output_rate_ms); int rtcm_MT1077_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1077_rate_ms", rtcm_MSM_rate_ms), pvt_output_parameters.output_rate_ms);
int rtcm_MT1087_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1087_rate_ms", rtcm_MSM_rate_ms), pvt_output_parameters.output_rate_ms); int rtcm_MT1087_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1087_rate_ms", rtcm_MSM_rate_ms), pvt_output_parameters.output_rate_ms);
int rtcm_MT1097_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1097_rate_ms", rtcm_MSM_rate_ms), pvt_output_parameters.output_rate_ms); int rtcm_MT1097_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1097_rate_ms", rtcm_MSM_rate_ms), pvt_output_parameters.output_rate_ms);
//std::map<int, int> rtcm_msg_rate_ms;
pvt_output_parameters.rtcm_msg_rate_ms[1019] = rtcm_MT1019_rate_ms; pvt_output_parameters.rtcm_msg_rate_ms[1019] = rtcm_MT1019_rate_ms;
pvt_output_parameters.rtcm_msg_rate_ms[1020] = rtcm_MT1020_rate_ms; pvt_output_parameters.rtcm_msg_rate_ms[1020] = rtcm_MT1020_rate_ms;
pvt_output_parameters.rtcm_msg_rate_ms[1045] = rtcm_MT1045_rate_ms; pvt_output_parameters.rtcm_msg_rate_ms[1045] = rtcm_MT1045_rate_ms;
@ -644,7 +644,7 @@ Rtklib_Pvt::Rtklib_Pvt(ConfigurationInterface* configuration,
If the baseline length is very short like 1 m, the iteration may be effective to handle If the baseline length is very short like 1 m, the iteration may be effective to handle
the nonlinearity of measurement equation. */ the nonlinearity of measurement equation. */
/// Statistics // Statistics
double bias_0 = configuration->property(role + ".bias_0", 30.0); double bias_0 = configuration->property(role + ".bias_0", 30.0);
double iono_0 = configuration->property(role + ".iono_0", 0.03); double iono_0 = configuration->property(role + ".iono_0", 0.03);

View File

@ -175,9 +175,9 @@ int Nmea_Printer::init_serial(const std::string& serial_device)
* Opens the serial device and sets the default baud rate for a NMEA transmission (9600,8,N,1) * Opens the serial device and sets the default baud rate for a NMEA transmission (9600,8,N,1)
*/ */
int fd = 0; int fd = 0;
struct termios options // clang-format off
{ struct termios options{};
}; // clang-format on
int64_t BAUD; int64_t BAUD;
int64_t DATABITS; int64_t DATABITS;
int64_t STOPBITS; int64_t STOPBITS;

View File

@ -1379,7 +1379,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, co
{ {
line += std::string("N: GNSS NAV DATA"); line += std::string("N: GNSS NAV DATA");
line += std::string(4, ' '); line += std::string(4, ' ');
//! \todo Add here other systems... //todo Add here other systems...
line += std::string("G: GPS"); line += std::string("G: GPS");
line += std::string(14, ' '); line += std::string(14, ' ');
// ... // ...
@ -1744,7 +1744,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Beidou_Dnav_Iono&
{ {
line += std::string("N: GNSS NAV DATA"); line += std::string("N: GNSS NAV DATA");
line += std::string(4, ' '); line += std::string(4, ' ');
//! \todo Add here other systems... //todo: Add here other systems...
line += std::string("F: BDS"); line += std::string("F: BDS");
line += std::string(14, ' '); line += std::string(14, ' ');
// ... // ...
@ -11771,7 +11771,7 @@ int32_t Rinex_Printer::signalStrength(const double snr)
boost::posix_time::ptime Rinex_Printer::compute_UTC_time(const Gps_Navigation_Message& nav_msg) boost::posix_time::ptime Rinex_Printer::compute_UTC_time(const Gps_Navigation_Message& nav_msg)
{ {
// if we are processing a file -> wait to leap second to resolve the ambiguity else take the week from the local system time // if we are processing a file -> wait to leap second to resolve the ambiguity else take the week from the local system time
//: idea resolve the ambiguity with the leap second http://www.colorado.edu/geography/gcraft/notes/gps/gpseow.htm // idea: resolve the ambiguity with the leap second http://www.colorado.edu/geography/gcraft/notes/gps/gpseow.htm
const double utc_t = nav_msg.utc_time(nav_msg.d_TOW); const double utc_t = nav_msg.utc_time(nav_msg.d_TOW);
boost::posix_time::time_duration t = boost::posix_time::milliseconds(static_cast<int64_t>((utc_t + 604800 * static_cast<double>(nav_msg.i_GPS_week)) * 1000)); boost::posix_time::time_duration t = boost::posix_time::milliseconds(static_cast<int64_t>((utc_t + 604800 * static_cast<double>(nav_msg.i_GPS_week)) * 1000));
if (nav_msg.i_GPS_week < 512) if (nav_msg.i_GPS_week < 512)

View File

@ -1887,13 +1887,13 @@ int32_t Rtcm::read_MT1020(const std::string& message, Glonass_Gnav_Ephemeris& gl
index += 1; index += 1;
if (glonass_gnav_alm_health) if (glonass_gnav_alm_health)
{ {
} //Avoid comiler warning } // Avoid compiler warning
glonass_gnav_alm_health_ind = static_cast<int32_t>(Rtcm::bin_to_uint(message_bin.substr(index, 1))); glonass_gnav_alm_health_ind = static_cast<int32_t>(Rtcm::bin_to_uint(message_bin.substr(index, 1)));
index += 1; index += 1;
if (glonass_gnav_alm_health_ind) if (glonass_gnav_alm_health_ind)
{ {
} //Avoid comiler warning } // Avoid compiler warning
glonass_gnav_eph.d_P_1 = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 2))); glonass_gnav_eph.d_P_1 = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 2)));
glonass_gnav_eph.d_P_1 = (glonass_gnav_eph.d_P_1 + 1) * 15; glonass_gnav_eph.d_P_1 = (glonass_gnav_eph.d_P_1 + 1) * 15;

View File

@ -384,7 +384,9 @@ int Rtcm_Printer::init_serial(const std::string& serial_device)
* Opens the serial device and sets the default baud rate for a RTCM transmission (9600,8,N,1) * Opens the serial device and sets the default baud rate for a RTCM transmission (9600,8,N,1)
*/ */
int32_t fd = 0; int32_t fd = 0;
// clang-format off
struct termios options{}; struct termios options{};
// clang-format on
int64_t BAUD; int64_t BAUD;
int64_t DATABITS; int64_t DATABITS;
int64_t STOPBITS; int64_t STOPBITS;

View File

@ -94,7 +94,6 @@ Rtklib_Solver::Rtklib_Solver(int nchannels, std::string dump_filename, bool flag
d_dump_filename = std::move(dump_filename); d_dump_filename = std::move(dump_filename);
d_flag_dump_enabled = flag_dump_to_file; d_flag_dump_enabled = flag_dump_to_file;
d_flag_dump_mat_enabled = flag_dump_to_mat; d_flag_dump_mat_enabled = flag_dump_to_mat;
count_valid_position = 0;
this->set_averaging_flag(false); this->set_averaging_flag(false);
rtk_ = rtk; rtk_ = rtk;
@ -443,9 +442,9 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
int valid_obs = 0; // valid observations counter int valid_obs = 0; // valid observations counter
int glo_valid_obs = 0; // GLONASS L1/L2 valid observations counter int glo_valid_obs = 0; // GLONASS L1/L2 valid observations counter
std::array<obsd_t, MAXOBS> obs_data{}; obs_data.fill({});
std::vector<eph_t> eph_data(MAXOBS); eph_data.fill({});
std::vector<geph_t> geph_data(MAXOBS); geph_data.fill({});
// Workaround for NAV/CNAV clash problem // Workaround for NAV/CNAV clash problem
bool gps_dual_band = false; bool gps_dual_band = false;
@ -914,7 +913,13 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
} }
/* update carrier wave length using native function call in RTKlib */ /* update carrier wave length using native function call in RTKlib */
uniqnav(&nav_data); for (int i = 0; i < MAXSAT; i++)
{
for (int j = 0; j < NFREQ; j++)
{
nav_data.lam[i][j] = satwavelen(i + 1, j, &nav_data);
}
}
result = rtkpos(&rtk_, obs_data.data(), valid_obs + glo_valid_obs, &nav_data); result = rtkpos(&rtk_, obs_data.data(), valid_obs + glo_valid_obs, &nav_data);

View File

@ -126,8 +126,6 @@ public:
Beidou_Dnav_Iono beidou_dnav_iono; Beidou_Dnav_Iono beidou_dnav_iono;
std::map<int, Beidou_Dnav_Almanac> beidou_dnav_almanac_map; std::map<int, Beidou_Dnav_Almanac> beidou_dnav_almanac_map;
int count_valid_position;
private: private:
rtk_t rtk_{}; rtk_t rtk_{};
std::string d_dump_filename; std::string d_dump_filename;
@ -137,6 +135,9 @@ private:
bool d_flag_dump_mat_enabled; bool d_flag_dump_mat_enabled;
int d_nchannels; // Number of available channels for positioning int d_nchannels; // Number of available channels for positioning
std::array<double, 4> dop_{}; std::array<double, 4> dop_{};
std::array<obsd_t, MAXOBS> obs_data{};
std::array<eph_t, MAXOBS> eph_data{};
std::array<geph_t, MAXOBS> geph_data{};
Monitor_Pvt monitor_pvt{}; Monitor_Pvt monitor_pvt{};
}; };

View File

@ -98,6 +98,7 @@ target_link_libraries(acquisition_adapters
algorithms_libs algorithms_libs
gnss_sdr_flags gnss_sdr_flags
acquisition_gr_blocks acquisition_gr_blocks
acquisition_libs
channel_libs channel_libs
core_system_parameters core_system_parameters
Gnuradio::blocks Gnuradio::blocks
@ -108,7 +109,6 @@ target_link_libraries(acquisition_adapters
Glog::glog Glog::glog
Gnuradio::fft Gnuradio::fft
Volkgnsssdr::volkgnsssdr Volkgnsssdr::volkgnsssdr
acquisition_libs
) )
target_include_directories(acquisition_adapters target_include_directories(acquisition_adapters

View File

@ -6,7 +6,7 @@
* *
* ------------------------------------------------------------------------- * -------------------------------------------------------------------------
* *
* Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
* *
* GNSS-SDR is a software defined Global Navigation * GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver * Satellite Systems receiver
@ -212,6 +212,7 @@ void GalileoE1PcpsAmbiguousAcquisition::set_doppler_step(unsigned int doppler_st
acquisition_->set_doppler_step(doppler_step_); acquisition_->set_doppler_step(doppler_step_);
} }
void GalileoE1PcpsAmbiguousAcquisition::set_doppler_center(int doppler_center) void GalileoE1PcpsAmbiguousAcquisition::set_doppler_center(int doppler_center)
{ {
doppler_center_ = doppler_center; doppler_center_ = doppler_center;
@ -396,6 +397,7 @@ gr::basic_block_sptr GalileoE1PcpsAmbiguousAcquisition::get_right_block()
return acquisition_; return acquisition_;
} }
void GalileoE1PcpsAmbiguousAcquisition::set_resampler_latency(uint32_t latency_samples) void GalileoE1PcpsAmbiguousAcquisition::set_resampler_latency(uint32_t latency_samples)
{ {
acquisition_->set_resampler_latency(latency_samples); acquisition_->set_resampler_latency(latency_samples);

View File

@ -34,7 +34,6 @@
#include "configuration_interface.h" #include "configuration_interface.h"
#include "galileo_e1_signal_processing.h" #include "galileo_e1_signal_processing.h"
#include "gnss_sdr_flags.h" #include "gnss_sdr_flags.h"
#include "gnss_synchro.h"
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/fft/fft.h> // for fft_complex #include <gnuradio/fft/fft.h> // for fft_complex
#include <gnuradio/gr_complex.h> // for gr_complex #include <gnuradio/gr_complex.h> // for gr_complex
@ -116,13 +115,13 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
{ {
// set local signal generator to Galileo E1 pilot component (1C) // set local signal generator to Galileo E1 pilot component (1C)
std::array<char, 3> pilot_signal = {{'1', 'C', '\0'}}; std::array<char, 3> pilot_signal = {{'1', 'C', '\0'}};
galileo_e1_code_gen_complex_sampled(gsl::span<std::complex<float>>(code.data(), nsamples_total), pilot_signal, galileo_e1_code_gen_complex_sampled(code, pilot_signal,
cboc, PRN, fs_in, 0, false); cboc, PRN, fs_in, 0, false);
} }
else else
{ {
std::array<char, 3> data_signal = {{'1', 'B', '\0'}}; std::array<char, 3> data_signal = {{'1', 'B', '\0'}};
galileo_e1_code_gen_complex_sampled(gsl::span<std::complex<float>>(code.data(), nsamples_total), data_signal, galileo_e1_code_gen_complex_sampled(code, data_signal,
cboc, PRN, fs_in, 0, false); cboc, PRN, fs_in, 0, false);
} }
@ -213,6 +212,7 @@ void GalileoE1PcpsAmbiguousAcquisitionFpga::set_doppler_step(unsigned int dopple
acquisition_fpga_->set_doppler_step(doppler_step_); acquisition_fpga_->set_doppler_step(doppler_step_);
} }
void GalileoE1PcpsAmbiguousAcquisitionFpga::set_doppler_center(int doppler_center) void GalileoE1PcpsAmbiguousAcquisitionFpga::set_doppler_center(int doppler_center)
{ {
doppler_center_ = doppler_center; doppler_center_ = doppler_center;
@ -220,6 +220,7 @@ void GalileoE1PcpsAmbiguousAcquisitionFpga::set_doppler_center(int doppler_cente
acquisition_fpga_->set_doppler_center(doppler_center_); acquisition_fpga_->set_doppler_center(doppler_center_);
} }
void GalileoE1PcpsAmbiguousAcquisitionFpga::set_gnss_synchro(Gnss_Synchro* gnss_synchro) void GalileoE1PcpsAmbiguousAcquisitionFpga::set_gnss_synchro(Gnss_Synchro* gnss_synchro)
{ {
gnss_synchro_ = gnss_synchro; gnss_synchro_ = gnss_synchro;

View File

@ -186,7 +186,6 @@ signed int GalileoE1PcpsCccwsrAmbiguousAcquisition::mag()
void GalileoE1PcpsCccwsrAmbiguousAcquisition::init() void GalileoE1PcpsCccwsrAmbiguousAcquisition::init()
{ {
acquisition_cc_->init(); acquisition_cc_->init();
//set_local_code();
} }
@ -199,12 +198,12 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_local_code()
std::array<char, 3> signal = {{'1', 'B', '\0'}}; std::array<char, 3> signal = {{'1', 'B', '\0'}};
galileo_e1_code_gen_complex_sampled(gsl::span<gr_complex>(code_data_.data(), vector_length_), signal, galileo_e1_code_gen_complex_sampled(code_data_, signal,
cboc, gnss_synchro_->PRN, fs_in_, 0, false); cboc, gnss_synchro_->PRN, fs_in_, 0, false);
std::array<char, 3> signal_C = {{'1', 'C', '\0'}}; std::array<char, 3> signal_C = {{'1', 'C', '\0'}};
galileo_e1_code_gen_complex_sampled(gsl::span<gr_complex>(code_pilot_.data(), vector_length_), signal_C, galileo_e1_code_gen_complex_sampled(code_pilot_, signal_C,
cboc, gnss_synchro_->PRN, fs_in_, 0, false); cboc, gnss_synchro_->PRN, fs_in_, 0, false);
acquisition_cc_->set_local_code(code_data_.data(), code_pilot_.data()); acquisition_cc_->set_local_code(code_data_.data(), code_pilot_.data());

View File

@ -209,7 +209,6 @@ signed int GalileoE5aNoncoherentIQAcquisitionCaf::mag()
void GalileoE5aNoncoherentIQAcquisitionCaf::init() void GalileoE5aNoncoherentIQAcquisitionCaf::init()
{ {
acquisition_cc_->init(); acquisition_cc_->init();
//set_local_code();
} }
@ -223,17 +222,17 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_local_code()
if (gnss_synchro_->Signal[0] == '5' && gnss_synchro_->Signal[1] == 'X') if (gnss_synchro_->Signal[0] == '5' && gnss_synchro_->Signal[1] == 'X')
{ {
std::array<char, 3> a = {{'5', 'I', '\0'}}; std::array<char, 3> a = {{'5', 'I', '\0'}};
galileo_e5_a_code_gen_complex_sampled(gsl::span<std::complex<float>>(codeI.data(), code_length_), a, galileo_e5_a_code_gen_complex_sampled(codeI, a,
gnss_synchro_->PRN, fs_in_, 0); gnss_synchro_->PRN, fs_in_, 0);
std::array<char, 3> b = {{'5', 'Q', '\0'}}; std::array<char, 3> b = {{'5', 'Q', '\0'}};
galileo_e5_a_code_gen_complex_sampled(gsl::span<std::complex<float>>(codeQ.data(), code_length_), b, galileo_e5_a_code_gen_complex_sampled(codeQ, b,
gnss_synchro_->PRN, fs_in_, 0); gnss_synchro_->PRN, fs_in_, 0);
} }
else else
{ {
std::array<char, 3> signal_type_ = {{'5', 'X', '\0'}}; std::array<char, 3> signal_type_ = {{'5', 'X', '\0'}};
galileo_e5_a_code_gen_complex_sampled(gsl::span<std::complex<float>>(codeI.data(), code_length_), signal_type_, galileo_e5_a_code_gen_complex_sampled(codeI, signal_type_,
gnss_synchro_->PRN, fs_in_, 0); gnss_synchro_->PRN, fs_in_, 0);
} }
// WARNING: 3ms are coherently integrated. Secondary sequence (1,1,1) // WARNING: 3ms are coherently integrated. Secondary sequence (1,1,1)

View File

@ -85,7 +85,6 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con
blocking_ = configuration_->property(role + ".blocking", true); blocking_ = configuration_->property(role + ".blocking", true);
acq_parameters_.blocking = blocking_; acq_parameters_.blocking = blocking_;
acq_parameters_.use_automatic_resampler = configuration_->property("GNSS-SDR.use_acquisition_resampler", false); acq_parameters_.use_automatic_resampler = configuration_->property("GNSS-SDR.use_acquisition_resampler", false);
if (acq_parameters_.use_automatic_resampler == true and item_type_ != "gr_complex") if (acq_parameters_.use_automatic_resampler == true and item_type_ != "gr_complex")
{ {
@ -351,6 +350,7 @@ gr::basic_block_sptr GalileoE5aPcpsAcquisition::get_right_block()
return acquisition_; return acquisition_;
} }
void GalileoE5aPcpsAcquisition::set_resampler_latency(uint32_t latency_samples) void GalileoE5aPcpsAcquisition::set_resampler_latency(uint32_t latency_samples)
{ {
acquisition_->set_resampler_latency(latency_samples); acquisition_->set_resampler_latency(latency_samples);

View File

@ -34,7 +34,6 @@
#include "configuration_interface.h" #include "configuration_interface.h"
#include "galileo_e5_signal_processing.h" #include "galileo_e5_signal_processing.h"
#include "gnss_sdr_flags.h" #include "gnss_sdr_flags.h"
#include "gnss_synchro.h"
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/fft/fft.h> // for fft_complex #include <gnuradio/fft/fft.h> // for fft_complex
#include <gnuradio/gr_complex.h> // for gr_complex #include <gnuradio/gr_complex.h> // for gr_complex
@ -128,7 +127,7 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf
signal_[1] = 'I'; signal_[1] = 'I';
} }
galileo_e5_a_code_gen_complex_sampled(gsl::span<std::complex<float>>(code.data(), nsamples_total), signal_, PRN, fs_in, 0); galileo_e5_a_code_gen_complex_sampled(code, signal_, PRN, fs_in, 0);
for (uint32_t s = code_length; s < 2 * code_length; s++) for (uint32_t s = code_length; s < 2 * code_length; s++)
{ {
@ -216,6 +215,7 @@ void GalileoE5aPcpsAcquisitionFpga::set_doppler_step(unsigned int doppler_step)
acquisition_fpga_->set_doppler_step(doppler_step_); acquisition_fpga_->set_doppler_step(doppler_step_);
} }
void GalileoE5aPcpsAcquisitionFpga::set_doppler_center(int doppler_center) void GalileoE5aPcpsAcquisitionFpga::set_doppler_center(int doppler_center)
{ {
doppler_center_ = doppler_center; doppler_center_ = doppler_center;
@ -223,6 +223,7 @@ void GalileoE5aPcpsAcquisitionFpga::set_doppler_center(int doppler_center)
acquisition_fpga_->set_doppler_center(doppler_center_); acquisition_fpga_->set_doppler_center(doppler_center_);
} }
void GalileoE5aPcpsAcquisitionFpga::set_gnss_synchro(Gnss_Synchro* gnss_synchro) void GalileoE5aPcpsAcquisitionFpga::set_gnss_synchro(Gnss_Synchro* gnss_synchro)
{ {
gnss_synchro_ = gnss_synchro; gnss_synchro_ = gnss_synchro;

View File

@ -151,13 +151,12 @@ signed int GpsL1CaPcpsAcquisitionFineDoppler::mag()
void GpsL1CaPcpsAcquisitionFineDoppler::init() void GpsL1CaPcpsAcquisitionFineDoppler::init()
{ {
acquisition_cc_->init(); acquisition_cc_->init();
//set_local_code();
} }
void GpsL1CaPcpsAcquisitionFineDoppler::set_local_code() void GpsL1CaPcpsAcquisitionFineDoppler::set_local_code()
{ {
gps_l1_ca_code_gen_complex_sampled(gsl::span<std::complex<float>>(code_.data(), vector_length_), gnss_synchro_->PRN, fs_in_, 0); gps_l1_ca_code_gen_complex_sampled(code_, gnss_synchro_->PRN, fs_in_, 0);
acquisition_cc_->set_local_code(code_.data()); acquisition_cc_->set_local_code(code_.data());
} }

View File

@ -36,7 +36,6 @@
#include "GPS_L1_CA.h" #include "GPS_L1_CA.h"
#include "configuration_interface.h" #include "configuration_interface.h"
#include "gnss_sdr_flags.h" #include "gnss_sdr_flags.h"
#include "gnss_synchro.h"
#include "gps_sdr_signal_processing.h" #include "gps_sdr_signal_processing.h"
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/fft/fft.h> #include <gnuradio/fft/fft.h>
@ -103,7 +102,7 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
// temporary maxima search // temporary maxima search
for (uint32_t PRN = 1; PRN <= NUM_PRNs; PRN++) for (uint32_t PRN = 1; PRN <= NUM_PRNs; PRN++)
{ {
gps_l1_ca_code_gen_complex_sampled(gsl::span<std::complex<float>>(code.data(), nsamples_total), PRN, fs_in, 0); // generate PRN code gps_l1_ca_code_gen_complex_sampled(code, PRN, fs_in, 0); // generate PRN code
for (uint32_t s = code_length; s < 2 * code_length; s++) for (uint32_t s = code_length; s < 2 * code_length; s++)
{ {
@ -192,6 +191,7 @@ void GpsL1CaPcpsAcquisitionFpga::set_doppler_step(unsigned int doppler_step)
acquisition_fpga_->set_doppler_step(doppler_step_); acquisition_fpga_->set_doppler_step(doppler_step_);
} }
void GpsL1CaPcpsAcquisitionFpga::set_doppler_center(int doppler_center) void GpsL1CaPcpsAcquisitionFpga::set_doppler_center(int doppler_center)
{ {
doppler_center_ = doppler_center; doppler_center_ = doppler_center;
@ -199,6 +199,7 @@ void GpsL1CaPcpsAcquisitionFpga::set_doppler_center(int doppler_center)
acquisition_fpga_->set_doppler_center(doppler_center_); acquisition_fpga_->set_doppler_center(doppler_center_);
} }
void GpsL1CaPcpsAcquisitionFpga::set_gnss_synchro(Gnss_Synchro* gnss_synchro) void GpsL1CaPcpsAcquisitionFpga::set_gnss_synchro(Gnss_Synchro* gnss_synchro)
{ {
gnss_synchro_ = gnss_synchro; gnss_synchro_ = gnss_synchro;

View File

@ -37,6 +37,7 @@
#include "channel_fsm.h" #include "channel_fsm.h"
#include "gnss_synchro.h"
#include "pcps_acquisition_fpga.h" #include "pcps_acquisition_fpga.h"
#include <memory> #include <memory>
#include <string> #include <string>

View File

@ -143,15 +143,16 @@ signed int GpsL1CaPcpsAssistedAcquisition::mag()
void GpsL1CaPcpsAssistedAcquisition::init() void GpsL1CaPcpsAssistedAcquisition::init()
{ {
acquisition_cc_->init(); acquisition_cc_->init();
//set_local_code();
} }
void GpsL1CaPcpsAssistedAcquisition::set_local_code() void GpsL1CaPcpsAssistedAcquisition::set_local_code()
{ {
gps_l1_ca_code_gen_complex_sampled(gsl::span<gr_complex>(code_.get(), vector_length_), gnss_synchro_->PRN, fs_in_, 0); gps_l1_ca_code_gen_complex_sampled(code_, gnss_synchro_->PRN, fs_in_, 0);
acquisition_cc_->set_local_code(code_.get()); acquisition_cc_->set_local_code(code_.get());
} }
void GpsL1CaPcpsAssistedAcquisition::reset() void GpsL1CaPcpsAssistedAcquisition::reset()
{ {
acquisition_cc_->set_active(true); acquisition_cc_->set_active(true);

View File

@ -198,7 +198,6 @@ signed int GpsL1CaPcpsOpenClAcquisition::mag()
void GpsL1CaPcpsOpenClAcquisition::init() void GpsL1CaPcpsOpenClAcquisition::init()
{ {
acquisition_cc_->init(); acquisition_cc_->init();
//set_local_code();
} }
@ -233,7 +232,6 @@ void GpsL1CaPcpsOpenClAcquisition::reset()
float GpsL1CaPcpsOpenClAcquisition::calculate_threshold(float pfa) float GpsL1CaPcpsOpenClAcquisition::calculate_threshold(float pfa)
{ {
// Calculate the threshold // Calculate the threshold
unsigned int frequency_bins = 0; unsigned int frequency_bins = 0;
for (int doppler = static_cast<int>(-doppler_max_); doppler <= static_cast<int>(doppler_max_); doppler += doppler_step_) for (int doppler = static_cast<int>(-doppler_max_); doppler <= static_cast<int>(doppler_max_); doppler += doppler_step_)
{ {

View File

@ -224,7 +224,6 @@ signed int GpsL1CaPcpsQuickSyncAcquisition::mag()
void GpsL1CaPcpsQuickSyncAcquisition::init() void GpsL1CaPcpsQuickSyncAcquisition::init()
{ {
acquisition_cc_->init(); acquisition_cc_->init();
//set_local_code();
} }

View File

@ -186,7 +186,6 @@ signed int GpsL1CaPcpsTongAcquisition::mag()
void GpsL1CaPcpsTongAcquisition::init() void GpsL1CaPcpsTongAcquisition::init()
{ {
acquisition_cc_->init(); acquisition_cc_->init();
//set_local_code();
} }

View File

@ -8,7 +8,7 @@
* *
* ------------------------------------------------------------------------- * -------------------------------------------------------------------------
* *
* Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
* *
* GNSS-SDR is a software defined Global Navigation * GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver * Satellite Systems receiver
@ -211,6 +211,7 @@ void GpsL2MPcpsAcquisition::set_doppler_step(unsigned int doppler_step)
acquisition_->set_doppler_step(doppler_step_); acquisition_->set_doppler_step(doppler_step_);
} }
void GpsL2MPcpsAcquisition::set_doppler_center(int doppler_center) void GpsL2MPcpsAcquisition::set_doppler_center(int doppler_center)
{ {
doppler_center_ = doppler_center; doppler_center_ = doppler_center;
@ -218,6 +219,7 @@ void GpsL2MPcpsAcquisition::set_doppler_center(int doppler_center)
acquisition_->set_doppler_center(doppler_center_); acquisition_->set_doppler_center(doppler_center_);
} }
void GpsL2MPcpsAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro) void GpsL2MPcpsAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro)
{ {
gnss_synchro_ = gnss_synchro; gnss_synchro_ = gnss_synchro;
@ -235,7 +237,6 @@ signed int GpsL2MPcpsAcquisition::mag()
void GpsL2MPcpsAcquisition::init() void GpsL2MPcpsAcquisition::init()
{ {
acquisition_->init(); acquisition_->init();
//set_local_code();
} }

View File

@ -105,7 +105,7 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga(
for (unsigned int PRN = 1; PRN <= NUM_PRNs; PRN++) for (unsigned int PRN = 1; PRN <= NUM_PRNs; PRN++)
{ {
gps_l2c_m_code_gen_complex_sampled(gsl::span<std::complex<float>>(code.data(), nsamples_total), PRN, fs_in_); gps_l2c_m_code_gen_complex_sampled(code, PRN, fs_in_);
// fill in zero padding // fill in zero padding
for (unsigned int s = code_length; s < nsamples_total; s++) for (unsigned int s = code_length; s < nsamples_total; s++)
{ {
@ -204,7 +204,6 @@ signed int GpsL2MPcpsAcquisitionFpga::mag()
void GpsL2MPcpsAcquisitionFpga::init() void GpsL2MPcpsAcquisitionFpga::init()
{ {
acquisition_fpga_->init(); acquisition_fpga_->init();
//set_local_code();
} }

View File

@ -206,6 +206,7 @@ void GpsL5iPcpsAcquisition::set_doppler_step(unsigned int doppler_step)
acquisition_->set_doppler_step(doppler_step_); acquisition_->set_doppler_step(doppler_step_);
} }
void GpsL5iPcpsAcquisition::set_doppler_center(int doppler_center) void GpsL5iPcpsAcquisition::set_doppler_center(int doppler_center)
{ {
doppler_center_ = doppler_center; doppler_center_ = doppler_center;
@ -213,6 +214,7 @@ void GpsL5iPcpsAcquisition::set_doppler_center(int doppler_center)
acquisition_->set_doppler_center(doppler_center_); acquisition_->set_doppler_center(doppler_center_);
} }
void GpsL5iPcpsAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro) void GpsL5iPcpsAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro)
{ {
gnss_synchro_ = gnss_synchro; gnss_synchro_ = gnss_synchro;

View File

@ -36,7 +36,6 @@
#include "GPS_L5.h" #include "GPS_L5.h"
#include "configuration_interface.h" #include "configuration_interface.h"
#include "gnss_sdr_flags.h" #include "gnss_sdr_flags.h"
#include "gnss_synchro.h"
#include "gps_l5_signal.h" #include "gps_l5_signal.h"
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/fft/fft.h> // for fft_complex #include <gnuradio/fft/fft.h> // for fft_complex
@ -107,7 +106,7 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga(
for (uint32_t PRN = 1; PRN <= NUM_PRNs; PRN++) for (uint32_t PRN = 1; PRN <= NUM_PRNs; PRN++)
{ {
gps_l5i_code_gen_complex_sampled(gsl::span<gr_complex>(code.data(), nsamples_total), PRN, fs_in); gps_l5i_code_gen_complex_sampled(code, PRN, fs_in);
for (uint32_t s = code_length; s < 2 * code_length; s++) for (uint32_t s = code_length; s < 2 * code_length; s++)
{ {
@ -196,6 +195,7 @@ void GpsL5iPcpsAcquisitionFpga::set_doppler_step(unsigned int doppler_step)
acquisition_fpga_->set_doppler_step(doppler_step_); acquisition_fpga_->set_doppler_step(doppler_step_);
} }
void GpsL5iPcpsAcquisitionFpga::set_doppler_center(int doppler_center) void GpsL5iPcpsAcquisitionFpga::set_doppler_center(int doppler_center)
{ {
doppler_center_ = doppler_center; doppler_center_ = doppler_center;
@ -203,6 +203,7 @@ void GpsL5iPcpsAcquisitionFpga::set_doppler_center(int doppler_center)
acquisition_fpga_->set_doppler_center(doppler_center_); acquisition_fpga_->set_doppler_center(doppler_center_);
} }
void GpsL5iPcpsAcquisitionFpga::set_gnss_synchro(Gnss_Synchro* gnss_synchro) void GpsL5iPcpsAcquisitionFpga::set_gnss_synchro(Gnss_Synchro* gnss_synchro)
{ {
gnss_synchro_ = gnss_synchro; gnss_synchro_ = gnss_synchro;
@ -221,6 +222,7 @@ void GpsL5iPcpsAcquisitionFpga::init()
acquisition_fpga_->init(); acquisition_fpga_->init();
} }
void GpsL5iPcpsAcquisitionFpga::set_local_code() void GpsL5iPcpsAcquisitionFpga::set_local_code()
{ {
acquisition_fpga_->set_local_code(); acquisition_fpga_->set_local_code();

View File

@ -36,6 +36,7 @@
#define GNSS_SDR_GPS_L5I_PCPS_ACQUISITION_FPGA_H_ #define GNSS_SDR_GPS_L5I_PCPS_ACQUISITION_FPGA_H_
#include "channel_fsm.h" #include "channel_fsm.h"
#include "gnss_synchro.h"
#include "pcps_acquisition_fpga.h" #include "pcps_acquisition_fpga.h"
#include <memory> #include <memory>
#include <string> #include <string>

View File

@ -236,6 +236,8 @@ void Channel::assist_acquisition_doppler(double Carrier_Doppler_hz)
{ {
acq_->set_doppler_center(static_cast<int>(Carrier_Doppler_hz)); acq_->set_doppler_center(static_cast<int>(Carrier_Doppler_hz));
} }
void Channel::start_acquisition() void Channel::start_acquisition()
{ {
std::lock_guard<std::mutex> lk(mx); std::lock_guard<std::mutex> lk(mx);

View File

@ -152,10 +152,10 @@ void beidou_b1i_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, u
const int32_t _codeFreqBasis = 2046000; // Hz const int32_t _codeFreqBasis = 2046000; // Hz
const int32_t _codeLength = 2046; const int32_t _codeLength = 2046;
//--- Find number of samples per spreading code ---------------------------- // --- Find number of samples per spreading code ---------------------------
_samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / static_cast<double>(_codeFreqBasis / _codeLength)); _samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / static_cast<double>(_codeFreqBasis / _codeLength));
//--- Find time constants -------------------------------------------------- // --- Find time constants -------------------------------------------------
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec _ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
_tc = 1.0 / static_cast<float>(_codeFreqBasis); // C/A chip period in sec _tc = 1.0 / static_cast<float>(_codeFreqBasis); // C/A chip period in sec
@ -163,18 +163,17 @@ void beidou_b1i_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, u
for (int32_t i = 0; i < _samplesPerCode; i++) for (int32_t i = 0; i < _samplesPerCode; i++)
{ {
//=== Digitizing ======================================================= // === Digitizing ==================================================
//--- Make index array to read C/A code values ------------------------- // --- Make index array to read C/A code values --------------------
// The length of the index array depends on the sampling frequency - // The length of the index array depends on the sampling frequency -
// number of samples per millisecond (because one C/A code period is one // number of samples per millisecond (because one C/A code period is one
// millisecond). // millisecond).
// _codeValueIndex = ceil((_ts * ((float)i + 1)) / _tc) - 1;
aux = (_ts * (i + 1)) / _tc; aux = (_ts * (i + 1)) / _tc;
_codeValueIndex = auxCeil(aux) - 1; _codeValueIndex = auxCeil(aux) - 1;
//--- Make the digitized version of the C/A code ----------------------- // --- Make the digitized version of the C/A code ------------------
// The "upsampled" code is made by selecting values form the CA code // The "upsampled" code is made by selecting values form the CA code
// chip array (caCode) for the time instances of each sample. // chip array (caCode) for the time instances of each sample.
if (i == _samplesPerCode - 1) if (i == _samplesPerCode - 1)

View File

@ -214,19 +214,19 @@ void beidou_b3i_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, u
const int32_t _codeFreqBasis = 10230000; // Hz const int32_t _codeFreqBasis = 10230000; // Hz
const int32_t _codeLength = 10230; const int32_t _codeLength = 10230;
//--- Find number of samples per spreading code ---------------------------- // --- Find number of samples per spreading code ---------------------------
_samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / static_cast<double>(_codeFreqBasis / _codeLength)); _samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / static_cast<double>(_codeFreqBasis / _codeLength));
//--- Find time constants -------------------------------------------------- // --- Find time constants -------------------------------------------------
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec _ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
_tc = 1.0 / static_cast<float>(_codeFreqBasis); // C/A chip period in sec _tc = 1.0 / static_cast<float>(_codeFreqBasis); // C/A chip period in sec
beidou_b3i_code_gen_complex(_code, _prn, _chip_shift); // generate C/A code 1 sample per chip beidou_b3i_code_gen_complex(_code, _prn, _chip_shift); // generate C/A code 1 sample per chip
for (int32_t i = 0; i < _samplesPerCode; i++) for (int32_t i = 0; i < _samplesPerCode; i++)
{ {
//=== Digitizing ======================================================= // === Digitizing ==================================================
//--- Make index array to read C/A code values ------------------------- // --- Make index array to read C/A code values --------------------
// The length of the index array depends on the sampling frequency - // The length of the index array depends on the sampling frequency -
// number of samples per millisecond (because one C/A code period is one // number of samples per millisecond (because one C/A code period is one
// millisecond). // millisecond).
@ -234,7 +234,7 @@ void beidou_b3i_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, u
aux = (_ts * (i + 1)) / _tc; aux = (_ts * (i + 1)) / _tc;
_codeValueIndex = auxCeil(aux) - 1; _codeValueIndex = auxCeil(aux) - 1;
//--- Make the digitized version of the C/A code ----------------------- // --- Make the digitized version of the C/A code ------------------
// The "upsampled" code is made by selecting values form the CA code // The "upsampled" code is made by selecting values form the CA code
// chip array (caCode) for the time instances of each sample. // chip array (caCode) for the time instances of each sample.
if (i == _samplesPerCode - 1) if (i == _samplesPerCode - 1)

View File

@ -112,10 +112,10 @@ void glonass_l1_ca_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest
const int32_t _codeFreqBasis = 511000; // Hz const int32_t _codeFreqBasis = 511000; // Hz
const int32_t _codeLength = 511; const int32_t _codeLength = 511;
//--- Find number of samples per spreading code ---------------------------- // --- Find number of samples per spreading code ---------------------------
_samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / static_cast<double>(_codeFreqBasis / _codeLength)); _samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / static_cast<double>(_codeFreqBasis / _codeLength));
//--- Find time constants -------------------------------------------------- // --- Find time constants -------------------------------------------------
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec _ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
_tc = 1.0 / static_cast<float>(_codeFreqBasis); // C/A chip period in sec _tc = 1.0 / static_cast<float>(_codeFreqBasis); // C/A chip period in sec
@ -123,9 +123,9 @@ void glonass_l1_ca_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest
for (int32_t i = 0; i < _samplesPerCode; i++) for (int32_t i = 0; i < _samplesPerCode; i++)
{ {
//=== Digitizing ======================================================= // === Digitizing ==================================================
//--- Make index array to read C/A code values ------------------------- // --- Make index array to read C/A code values --------------------
// The length of the index array depends on the sampling frequency - // The length of the index array depends on the sampling frequency -
// number of samples per millisecond (because one C/A code period is one // number of samples per millisecond (because one C/A code period is one
// millisecond). // millisecond).
@ -133,7 +133,7 @@ void glonass_l1_ca_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest
aux = (_ts * (i + 1)) / _tc; aux = (_ts * (i + 1)) / _tc;
_codeValueIndex = auxCeil(aux) - 1; _codeValueIndex = auxCeil(aux) - 1;
//--- Make the digitized version of the C/A code ----------------------- // --- Make the digitized version of the C/A code ------------------
// The "upsampled" code is made by selecting values form the CA code // The "upsampled" code is made by selecting values form the CA code
// chip array (caCode) for the time instances of each sample. // chip array (caCode) for the time instances of each sample.
if (i == _samplesPerCode - 1) if (i == _samplesPerCode - 1)

View File

@ -112,10 +112,10 @@ void glonass_l2_ca_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest
const int32_t _codeFreqBasis = 511000; // Hz const int32_t _codeFreqBasis = 511000; // Hz
const int32_t _codeLength = 511; const int32_t _codeLength = 511;
//--- Find number of samples per spreading code ---------------------------- // --- Find number of samples per spreading code ---------------------------
_samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / static_cast<double>(_codeFreqBasis / _codeLength)); _samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / static_cast<double>(_codeFreqBasis / _codeLength));
//--- Find time constants -------------------------------------------------- // --- Find time constants -------------------------------------------------
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec _ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
_tc = 1.0 / static_cast<float>(_codeFreqBasis); // C/A chip period in sec _tc = 1.0 / static_cast<float>(_codeFreqBasis); // C/A chip period in sec
@ -123,9 +123,9 @@ void glonass_l2_ca_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest
for (int32_t i = 0; i < _samplesPerCode; i++) for (int32_t i = 0; i < _samplesPerCode; i++)
{ {
//=== Digitizing ======================================================= // === Digitizing ==================================================
//--- Make index array to read C/A code values ------------------------- // --- Make index array to read C/A code values --------------------
// The length of the index array depends on the sampling frequency - // The length of the index array depends on the sampling frequency -
// number of samples per millisecond (because one C/A code period is one // number of samples per millisecond (because one C/A code period is one
// millisecond). // millisecond).
@ -133,7 +133,7 @@ void glonass_l2_ca_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest
aux = (_ts * (i + 1)) / _tc; aux = (_ts * (i + 1)) / _tc;
_codeValueIndex = auxCeil(aux) - 1; _codeValueIndex = auxCeil(aux) - 1;
//--- Make the digitized version of the C/A code ----------------------- // --- Make the digitized version of the C/A code ------------------
// The "upsampled" code is made by selecting values form the CA code // The "upsampled" code is made by selecting values form the CA code
// chip array (caCode) for the time instances of each sample. // chip array (caCode) for the time instances of each sample.
if (i == _samplesPerCode - 1) if (i == _samplesPerCode - 1)

View File

@ -41,17 +41,17 @@ template <class T>
class Gnss_circular_deque class Gnss_circular_deque
{ {
public: public:
Gnss_circular_deque(); // Default constructor Gnss_circular_deque(); //!< Default constructor
Gnss_circular_deque(const unsigned int max_size, const unsigned int nchann); // nchann = number of channels; max_size = channel capacity Gnss_circular_deque(const unsigned int max_size, const unsigned int nchann); //!< nchann = number of channels; max_size = channel capacity
unsigned int size(const unsigned int ch); // Returns the number of available elements in a channel unsigned int size(const unsigned int ch); //!< Returns the number of available elements in a channel
T& at(const unsigned int ch, const unsigned int pos); // Returns a reference to an element T& at(const unsigned int ch, const unsigned int pos); //!< Returns a reference to an element
T& front(const unsigned int ch); // Returns a reference to the first element in the deque T& front(const unsigned int ch); //!< Returns a reference to the first element in the deque
T& back(const unsigned int ch); // Returns a reference to the last element in the deque T& back(const unsigned int ch); //!< Returns a reference to the last element in the deque
void push_back(const unsigned int ch, const T& new_data); // Inserts an element at the end of the deque void push_back(const unsigned int ch, const T& new_data); //!< Inserts an element at the end of the deque
void pop_front(const unsigned int ch); // Removes the first element of the deque void pop_front(const unsigned int ch); //!< Removes the first element of the deque
void clear(const unsigned int ch); // Removes all the elements of the deque (Sets size to 0). Capacity is not modified void clear(const unsigned int ch); //!< Removes all the elements of the deque (Sets size to 0). Capacity is not modified
void reset(const unsigned int max_size, const unsigned int nchann); // Removes all the elements in all the channels. Re-sets the number of channels and their capacity void reset(const unsigned int max_size, const unsigned int nchann); //!< Removes all the elements in all the channels. Re-sets the number of channels and their capacity
void reset(); // Removes all the channels (Sets nchann to 0) void reset(); //!< Removes all the channels (Sets nchann to 0)
private: private:
std::vector<boost::circular_buffer<T>> d_data; std::vector<boost::circular_buffer<T>> d_data;
@ -64,18 +64,21 @@ Gnss_circular_deque<T>::Gnss_circular_deque()
reset(); reset();
} }
template <class T> template <class T>
Gnss_circular_deque<T>::Gnss_circular_deque(const unsigned int max_size, const unsigned int nchann) Gnss_circular_deque<T>::Gnss_circular_deque(const unsigned int max_size, const unsigned int nchann)
{ {
reset(max_size, nchann); reset(max_size, nchann);
} }
template <class T> template <class T>
unsigned int Gnss_circular_deque<T>::size(const unsigned int ch) unsigned int Gnss_circular_deque<T>::size(const unsigned int ch)
{ {
return d_data.at(ch).size(); return d_data.at(ch).size();
} }
template <class T> template <class T>
T& Gnss_circular_deque<T>::back(const unsigned int ch) T& Gnss_circular_deque<T>::back(const unsigned int ch)
{ {
@ -96,12 +99,14 @@ T& Gnss_circular_deque<T>::at(const unsigned int ch, const unsigned int pos)
return d_data.at(ch).at(pos); return d_data.at(ch).at(pos);
} }
template <class T> template <class T>
void Gnss_circular_deque<T>::clear(const unsigned int ch) void Gnss_circular_deque<T>::clear(const unsigned int ch)
{ {
d_data.at(ch).clear(); d_data.at(ch).clear();
} }
template <class T> template <class T>
void Gnss_circular_deque<T>::reset(const unsigned int max_size, const unsigned int nchann) void Gnss_circular_deque<T>::reset(const unsigned int max_size, const unsigned int nchann)
{ {
@ -115,18 +120,21 @@ void Gnss_circular_deque<T>::reset(const unsigned int max_size, const unsigned i
} }
} }
template <class T> template <class T>
void Gnss_circular_deque<T>::reset() void Gnss_circular_deque<T>::reset()
{ {
d_data.clear(); d_data.clear();
} }
template <class T> template <class T>
void Gnss_circular_deque<T>::pop_front(const unsigned int ch) void Gnss_circular_deque<T>::pop_front(const unsigned int ch)
{ {
d_data.at(ch).pop_front(); d_data.at(ch).pop_front();
} }
template <class T> template <class T>
void Gnss_circular_deque<T>::push_back(const unsigned int ch, const T& new_data) void Gnss_circular_deque<T>::push_back(const unsigned int ch, const T& new_data)
{ {

View File

@ -165,13 +165,13 @@ void resampler(const gsl::span<float> _from, gsl::span<float> _dest, float _fs_i
{ {
uint32_t _codeValueIndex; uint32_t _codeValueIndex;
float aux; float aux;
//--- Find time constants -------------------------------------------------- // --- Find time constants -------------------------------------------------
const float _t_in = 1 / _fs_in; // Incoming sampling period in sec const float _t_in = 1 / _fs_in; // Incoming sampling period in sec
const float _t_out = 1 / _fs_out; // Out sampling period in sec const float _t_out = 1 / _fs_out; // Out sampling period in sec
for (uint32_t i = 0; i < _dest.size() - 1; i++) for (uint32_t i = 0; i < _dest.size() - 1; i++)
{ {
//=== Digitizing =================================================== // === Digitizing ==================================================
//--- compute index array to read sampled values ------------------- // --- compute index array to read sampled values ------------------
aux = (_t_out * (i + 1)) / _t_in; aux = (_t_out * (i + 1)) / _t_in;
_codeValueIndex = auxCeil2(aux) - 1; _codeValueIndex = auxCeil2(aux) - 1;
@ -188,13 +188,13 @@ void resampler(gsl::span<const std::complex<float>> _from, gsl::span<std::comple
{ {
uint32_t _codeValueIndex; uint32_t _codeValueIndex;
float aux; float aux;
//--- Find time constants -------------------------------------------------- // --- Find time constants -------------------------------------------------
const float _t_in = 1 / _fs_in; // Incoming sampling period in sec const float _t_in = 1 / _fs_in; // Incoming sampling period in sec
const float _t_out = 1 / _fs_out; // Out sampling period in sec const float _t_out = 1 / _fs_out; // Out sampling period in sec
for (uint32_t i = 0; i < _dest.size() - 1; i++) for (uint32_t i = 0; i < _dest.size() - 1; i++)
{ {
//=== Digitizing =================================================== // === Digitizing ==================================================
//--- compute index array to read sampled values ------------------- // --- compute index array to read sampled values ------------------
aux = (_t_out * (i + 1)) / _t_in; aux = (_t_out * (i + 1)) / _t_in;
_codeValueIndex = auxCeil2(aux) - 1; _codeValueIndex = auxCeil2(aux) - 1;

View File

@ -101,21 +101,21 @@ void gps_l2c_m_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, ui
float _tc; float _tc;
const int32_t _codeLength = GPS_L2_M_CODE_LENGTH_CHIPS; const int32_t _codeLength = GPS_L2_M_CODE_LENGTH_CHIPS;
//--- Find number of samples per spreading code ---------------------------- // --- Find number of samples per spreading code ---------------------------
_samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / (static_cast<double>(GPS_L2_M_CODE_RATE_HZ) / static_cast<double>(_codeLength))); _samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / (static_cast<double>(GPS_L2_M_CODE_RATE_HZ) / static_cast<double>(_codeLength)));
//--- Find time constants -------------------------------------------------- // --- Find time constants -------------------------------------------------
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec _ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
_tc = 1.0 / static_cast<float>(GPS_L2_M_CODE_RATE_HZ); // L2C chip period in sec _tc = 1.0 / static_cast<float>(GPS_L2_M_CODE_RATE_HZ); // L2C chip period in sec
for (int32_t i = 0; i < _samplesPerCode; i++) for (int32_t i = 0; i < _samplesPerCode; i++)
{ {
//=== Digitizing ======================================================= // === Digitizing ==================================================
//--- Make index array to read L2C code values ------------------------- // --- Make index array to read L2C code values --------------------
_codeValueIndex = std::ceil((_ts * (static_cast<float>(i) + 1)) / _tc) - 1; _codeValueIndex = std::ceil((_ts * (static_cast<float>(i) + 1)) / _tc) - 1;
//--- Make the digitized version of the L2C code ----------------------- // --- Make the digitized version of the L2C code ------------------
if (i == _samplesPerCode - 1) if (i == _samplesPerCode - 1)
{ {
// --- Correct the last index (due to number rounding issues) ----------- // --- Correct the last index (due to number rounding issues) -----------

View File

@ -218,21 +218,21 @@ void gps_l5i_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, uint
float _tc; float _tc;
const int32_t _codeLength = GPS_L5I_CODE_LENGTH_CHIPS; const int32_t _codeLength = GPS_L5I_CODE_LENGTH_CHIPS;
//--- Find number of samples per spreading code ---------------------------- // --- Find number of samples per spreading code ---------------------------
_samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / (static_cast<double>(GPS_L5I_CODE_RATE_HZ) / static_cast<double>(_codeLength))); _samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / (static_cast<double>(GPS_L5I_CODE_RATE_HZ) / static_cast<double>(_codeLength)));
//--- Find time constants -------------------------------------------------- // --- Find time constants -------------------------------------------------
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec _ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
_tc = 1.0 / static_cast<float>(GPS_L5I_CODE_RATE_HZ); // L5I primary chip period in sec _tc = 1.0 / static_cast<float>(GPS_L5I_CODE_RATE_HZ); // L5I primary chip period in sec
for (int32_t i = 0; i < _samplesPerCode; i++) for (int32_t i = 0; i < _samplesPerCode; i++)
{ {
//=== Digitizing ======================================================= // === Digitizing ==================================================
//--- Make index array to read L5 code values ------------------------- // --- Make index array to read L5 code values ---------------------
_codeValueIndex = static_cast<int32_t>(std::ceil(_ts * static_cast<float>(i + 1) / _tc)) - 1; _codeValueIndex = static_cast<int32_t>(std::ceil(_ts * static_cast<float>(i + 1) / _tc)) - 1;
//--- Make the digitized version of the L5I code ----------------------- // --- Make the digitized version of the L5I code ------------------
if (i == _samplesPerCode - 1) if (i == _samplesPerCode - 1)
{ {
// --- Correct the last index (due to number rounding issues) ----------- // --- Correct the last index (due to number rounding issues) -----------
@ -292,21 +292,21 @@ void gps_l5q_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, uint
float _tc; float _tc;
const int32_t _codeLength = GPS_L5Q_CODE_LENGTH_CHIPS; const int32_t _codeLength = GPS_L5Q_CODE_LENGTH_CHIPS;
//--- Find number of samples per spreading code ---------------------------- // --- Find number of samples per spreading code ---------------------------
_samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / (static_cast<double>(GPS_L5Q_CODE_RATE_HZ) / static_cast<double>(_codeLength))); _samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / (static_cast<double>(GPS_L5Q_CODE_RATE_HZ) / static_cast<double>(_codeLength)));
//--- Find time constants -------------------------------------------------- // --- Find time constants -------------------------------------------------
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec _ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
_tc = 1.0 / static_cast<float>(GPS_L5Q_CODE_RATE_HZ); // L5Q chip period in sec _tc = 1.0 / static_cast<float>(GPS_L5Q_CODE_RATE_HZ); // L5Q chip period in sec
for (int32_t i = 0; i < _samplesPerCode; i++) for (int32_t i = 0; i < _samplesPerCode; i++)
{ {
//=== Digitizing ======================================================= // === Digitizing ==================================================
//--- Make index array to read L5 code values ------------------------- // --- Make index array to read L5 code values ---------------------
_codeValueIndex = static_cast<int32_t>(std::ceil(_ts * static_cast<float>(i + 1) / _tc)) - 1; _codeValueIndex = static_cast<int32_t>(std::ceil(_ts * static_cast<float>(i + 1) / _tc)) - 1;
//--- Make the digitized version of the L5Q code ----------------------- // --- Make the digitized version of the L5Q code ------------------
if (i == _samplesPerCode - 1) if (i == _samplesPerCode - 1)
{ {
// --- Correct the last index (due to number rounding issues) ----------- // --- Correct the last index (due to number rounding issues) -----------

View File

@ -162,19 +162,19 @@ void gps_l1_ca_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, ui
const int32_t _codeFreqBasis = 1023000; // Hz const int32_t _codeFreqBasis = 1023000; // Hz
const int32_t _codeLength = 1023; const int32_t _codeLength = 1023;
//--- Find number of samples per spreading code ---------------------------- // --- Find number of samples per spreading code ---------------------------
_samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / static_cast<double>(_codeFreqBasis / _codeLength)); _samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / static_cast<double>(_codeFreqBasis / _codeLength));
//--- Find time constants -------------------------------------------------- // --- Find time constants -------------------------------------------------
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec _ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
_tc = 1.0 / static_cast<float>(_codeFreqBasis); // C/A chip period in sec _tc = 1.0 / static_cast<float>(_codeFreqBasis); // C/A chip period in sec
gps_l1_ca_code_gen_complex(_code, _prn, _chip_shift); // generate C/A code 1 sample per chip gps_l1_ca_code_gen_complex(_code, _prn, _chip_shift); // generate C/A code 1 sample per chip
for (int32_t i = 0; i < _samplesPerCode; i++) for (int32_t i = 0; i < _samplesPerCode; i++)
{ {
//=== Digitizing =================================================== // === Digitizing ==================================================
//--- Make index array to read C/A code values --------------------- // --- Make index array to read C/A code values --------------------
// The length of the index array depends on the sampling frequency - // The length of the index array depends on the sampling frequency -
// number of samples per millisecond (because one C/A code period is one // number of samples per millisecond (because one C/A code period is one
// millisecond). // millisecond).

View File

@ -45,6 +45,7 @@
#include <iostream> // for cerr, cout #include <iostream> // for cerr, cout
#include <limits> // for numeric_limits #include <limits> // for numeric_limits
#include <utility> // for move #include <utility> // for move
#include <vector> // for vector
#if HAS_STD_FILESYSTEM #if HAS_STD_FILESYSTEM
#include <system_error> #include <system_error>
@ -475,7 +476,7 @@ void hybrid_observables_gs::update_TOW(const std::vector<Gnss_Synchro> &data)
std::vector<Gnss_Synchro>::const_iterator it; std::vector<Gnss_Synchro>::const_iterator it;
if (!T_rx_TOW_set) if (!T_rx_TOW_set)
{ {
//uint32_t TOW_ref = std::numeric_limits<uint32_t>::max(); // int32_t TOW_ref = std::numeric_limits<uint32_t>::max();
uint32_t TOW_ref = 0U; uint32_t TOW_ref = 0U;
for (it = data.cbegin(); it != data.cend(); it++) for (it = data.cbegin(); it != data.cend(); it++)
{ {

View File

@ -41,7 +41,6 @@
#include <cstdint> // for int32_t #include <cstdint> // for int32_t
#include <fstream> // for string, ofstream #include <fstream> // for string, ofstream
#include <memory> // for shared_ptr #include <memory> // for shared_ptr
#include <vector> // for vector
class Gnss_Synchro; class Gnss_Synchro;
class hybrid_observables_gs; class hybrid_observables_gs;

View File

@ -85,7 +85,9 @@ private:
int fifo_items; int fifo_items;
int d_sock_raw; int d_sock_raw;
int d_udp_port; int d_udp_port;
// clang-format off
struct sockaddr_in si_me{}; struct sockaddr_in si_me{};
// clang-format on
std::string d_src_device; std::string d_src_device;
std::string d_origin_address; std::string d_origin_address;
int d_udp_payload_size; int d_udp_payload_size;

View File

@ -287,7 +287,7 @@ void beidou_b1i_telemetry_decoder_gs::set_satellite(const Gnss_Satellite &satell
// Update satellite information for DNAV decoder // Update satellite information for DNAV decoder
sat_prn = d_satellite.get_PRN(); sat_prn = d_satellite.get_PRN();
d_nav.i_satellite_PRN = sat_prn; d_nav.i_satellite_PRN = sat_prn;
d_nav.i_signal_type = 1; //!< BDS: data source (0:unknown,1:B1I,2:B1Q,3:B2I,4:B2Q,5:B3I,6:B3Q) d_nav.i_signal_type = 1; // BDS: data source (0:unknown,1:B1I,2:B1Q,3:B2I,4:B2Q,5:B3I,6:B3Q)
// Update tel dec parameters for D2 NAV Messages // Update tel dec parameters for D2 NAV Messages
if (sat_prn > 0 and sat_prn < 6) if (sat_prn > 0 and sat_prn < 6)

View File

@ -387,6 +387,7 @@ void beidou_b3i_telemetry_decoder_gs::set_channel(int32_t channel)
} }
} }
void beidou_b3i_telemetry_decoder_gs::reset() void beidou_b3i_telemetry_decoder_gs::reset()
{ {
d_last_valid_preamble = d_sample_counter; d_last_valid_preamble = d_sample_counter;
@ -397,6 +398,7 @@ void beidou_b3i_telemetry_decoder_gs::reset()
return; return;
} }
int beidou_b3i_telemetry_decoder_gs::general_work( int beidou_b3i_telemetry_decoder_gs::general_work(
int noutput_items __attribute__((unused)), int noutput_items __attribute__((unused)),
gr_vector_int &ninput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)),

View File

@ -46,8 +46,9 @@
#define LMORE 5 // #define LMORE 5 //
sbas_l1_telemetry_decoder_gs_sptr sbas_l1_telemetry_decoder_gs_sptr sbas_l1_make_telemetry_decoder_gs(
sbas_l1_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump) const Gnss_Satellite &satellite,
bool dump)
{ {
return sbas_l1_telemetry_decoder_gs_sptr(new sbas_l1_telemetry_decoder_gs(satellite, dump)); return sbas_l1_telemetry_decoder_gs_sptr(new sbas_l1_telemetry_decoder_gs(satellite, dump));
} }
@ -114,9 +115,6 @@ sbas_l1_telemetry_decoder_gs::Sample_Aligner::Sample_Aligner()
} }
sbas_l1_telemetry_decoder_gs::Sample_Aligner::~Sample_Aligner() = default;
void sbas_l1_telemetry_decoder_gs::Sample_Aligner::reset() void sbas_l1_telemetry_decoder_gs::Sample_Aligner::reset()
{ {
d_past_sample = 0; d_past_sample = 0;
@ -194,19 +192,12 @@ sbas_l1_telemetry_decoder_gs::Symbol_Aligner_And_Decoder::Symbol_Aligner_And_Dec
const int32_t nn = 2; const int32_t nn = 2;
std::array<int32_t, nn> g_encoder{121, 91}; std::array<int32_t, nn> g_encoder{121, 91};
d_vd1 = new Viterbi_Decoder(g_encoder.data(), d_KK, nn); d_vd1 = std::make_shared<Viterbi_Decoder>(g_encoder.data(), d_KK, nn);
d_vd2 = new Viterbi_Decoder(g_encoder.data(), d_KK, nn); d_vd1 = std::make_shared<Viterbi_Decoder>(g_encoder.data(), d_KK, nn);
d_past_symbol = 0; d_past_symbol = 0;
} }
sbas_l1_telemetry_decoder_gs::Symbol_Aligner_And_Decoder::~Symbol_Aligner_And_Decoder()
{
delete d_vd1;
delete d_vd2;
}
void sbas_l1_telemetry_decoder_gs::Symbol_Aligner_And_Decoder::reset() void sbas_l1_telemetry_decoder_gs::Symbol_Aligner_And_Decoder::reset()
{ {
d_past_symbol = 0; d_past_symbol = 0;
@ -229,11 +220,11 @@ bool sbas_l1_telemetry_decoder_gs::Symbol_Aligner_And_Decoder::get_bits(const st
symbols_vd2.push_back(*symbol_it); symbols_vd2.push_back(*symbol_it);
} }
// arrays for decoded bits // arrays for decoded bits
auto *bits_vd1 = new int32_t[nbits_requested]; std::vector<int32_t> bits_vd1(nbits_requested);
auto *bits_vd2 = new int32_t[nbits_requested]; std::vector<int32_t> bits_vd2(nbits_requested);
// decode // decode
float metric_vd1 = d_vd1->decode_continuous(symbols_vd1.data(), traceback_depth, bits_vd1, nbits_requested, nbits_decoded); float metric_vd1 = d_vd1->decode_continuous(symbols_vd1.data(), traceback_depth, bits_vd1.data(), nbits_requested, nbits_decoded);
float metric_vd2 = d_vd2->decode_continuous(symbols_vd2.data(), traceback_depth, bits_vd2, nbits_requested, nbits_decoded); float metric_vd2 = d_vd2->decode_continuous(symbols_vd2.data(), traceback_depth, bits_vd2.data(), nbits_requested, nbits_decoded);
// choose the bits with the better metric // choose the bits with the better metric
for (int32_t i = 0; i < nbits_decoded; i++) for (int32_t i = 0; i < nbits_decoded; i++)
{ {
@ -247,8 +238,6 @@ bool sbas_l1_telemetry_decoder_gs::Symbol_Aligner_And_Decoder::get_bits(const st
} }
} }
d_past_symbol = symbols.back(); d_past_symbol = symbols.back();
delete[] bits_vd1;
delete[] bits_vd2;
return metric_vd1 > metric_vd2; return metric_vd1 > metric_vd2;
} }

View File

@ -5,7 +5,7 @@
* *
* ------------------------------------------------------------------------- * -------------------------------------------------------------------------
* *
* Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
* *
* GNSS-SDR is a software defined Global Navigation * GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver * Satellite Systems receiver
@ -40,6 +40,7 @@
#include <cstdint> #include <cstdint>
#include <deque> #include <deque>
#include <fstream> #include <fstream>
#include <memory>
#include <string> #include <string>
#include <utility> // for pair #include <utility> // for pair
#include <vector> #include <vector>
@ -50,12 +51,13 @@ class sbas_l1_telemetry_decoder_gs;
using sbas_l1_telemetry_decoder_gs_sptr = boost::shared_ptr<sbas_l1_telemetry_decoder_gs>; using sbas_l1_telemetry_decoder_gs_sptr = boost::shared_ptr<sbas_l1_telemetry_decoder_gs>;
sbas_l1_telemetry_decoder_gs_sptr sbas_l1_telemetry_decoder_gs_sptr sbas_l1_make_telemetry_decoder_gs(
sbas_l1_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump); const Gnss_Satellite &satellite,
bool dump);
/*! /*!
* \brief This class implements a block that decodes the SBAS integrity and corrections data defined in RTCA MOPS DO-229 * \brief This class implements a block that decodes the SBAS integrity and
* * corrections data defined in RTCA MOPS DO-229
*/ */
class sbas_l1_telemetry_decoder_gs : public gr::block class sbas_l1_telemetry_decoder_gs : public gr::block
{ {
@ -67,6 +69,7 @@ public:
{ {
return; return;
} }
/*! /*!
* \brief This is where all signal processing takes place * \brief This is where all signal processing takes place
*/ */
@ -74,8 +77,10 @@ public:
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
private: private:
friend sbas_l1_telemetry_decoder_gs_sptr friend sbas_l1_telemetry_decoder_gs_sptr sbas_l1_make_telemetry_decoder_gs(
sbas_l1_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump); const Gnss_Satellite &satellite,
bool dump);
sbas_l1_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump); sbas_l1_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump);
void viterbi_decoder(double *page_part_symbols, int32_t *page_part_bits); void viterbi_decoder(double *page_part_symbols, int32_t *page_part_bits);
@ -103,7 +108,7 @@ private:
{ {
public: public:
Sample_Aligner(); Sample_Aligner();
~Sample_Aligner(); ~Sample_Aligner() = default;
void reset(); void reset();
/* /*
* samples length must be a multiple of two * samples length must be a multiple of two
@ -125,14 +130,14 @@ private:
{ {
public: public:
Symbol_Aligner_And_Decoder(); Symbol_Aligner_And_Decoder();
~Symbol_Aligner_And_Decoder(); ~Symbol_Aligner_And_Decoder() = default;
void reset(); void reset();
bool get_bits(const std::vector<double> &symbols, std::vector<int32_t> &bits); bool get_bits(const std::vector<double> &symbols, std::vector<int32_t> &bits);
private: private:
int32_t d_KK; int32_t d_KK;
Viterbi_Decoder *d_vd1; std::shared_ptr<Viterbi_Decoder> d_vd1;
Viterbi_Decoder *d_vd2; std::shared_ptr<Viterbi_Decoder> d_vd2;
double d_past_symbol; double d_past_symbol;
} d_symbol_aligner_and_decoder; } d_symbol_aligner_and_decoder;
@ -157,7 +162,7 @@ private:
void get_valid_frames(const std::vector<msg_candiate_int_t> &msg_candidates, std::vector<msg_candiate_char_t> &valid_msgs); void get_valid_frames(const std::vector<msg_candiate_int_t> &msg_candidates, std::vector<msg_candiate_char_t> &valid_msgs);
private: private:
typedef boost::crc_optimal<24, 0x1864CFBu, 0x0, 0x0, false, false> crc_24_q_type; typedef boost::crc_optimal<24, 0x1864CFBU, 0x0, 0x0, false, false> crc_24_q_type;
crc_24_q_type d_checksum_agent; crc_24_q_type d_checksum_agent;
void zerropad_front_and_convert_to_bytes(const std::vector<int32_t> &msg_candidate, std::vector<uint8_t> &bytes); void zerropad_front_and_convert_to_bytes(const std::vector<int32_t> &msg_candidate, std::vector<uint8_t> &bytes);
void zerropad_back_and_convert_to_bytes(const std::vector<int32_t> &msg_candidate, std::vector<uint8_t> &bytes); void zerropad_back_and_convert_to_bytes(const std::vector<int32_t> &msg_candidate, std::vector<uint8_t> &bytes);

View File

@ -92,6 +92,7 @@ public:
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override; void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
void start_tracking() override; void start_tracking() override;
/*! /*!
* \brief Stop running tracking * \brief Stop running tracking
*/ */

View File

@ -89,6 +89,7 @@ public:
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override; void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
void start_tracking() override; void start_tracking() override;
/*! /*!
* \brief Stop running tracking * \brief Stop running tracking
*/ */

View File

@ -61,7 +61,6 @@ GlonassL1CaDllPllCAidTracking::GlonassL1CaDllPllCAidTracking(
float dll_bw_narrow_hz; float dll_bw_narrow_hz;
float early_late_space_chips; float early_late_space_chips;
item_type_ = configuration->property(role + ".item_type", default_item_type); item_type_ = configuration->property(role + ".item_type", default_item_type);
//vector_length = configuration->property(role + ".vector_length", 2048);
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
dump = configuration->property(role + ".dump", false); dump = configuration->property(role + ".dump", false);

View File

@ -91,6 +91,7 @@ public:
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override; void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
void start_tracking() override; void start_tracking() override;
/*! /*!
* \brief Stop running tracking * \brief Stop running tracking
*/ */

View File

@ -59,7 +59,6 @@ GlonassL2CaDllPllCAidTracking::GlonassL2CaDllPllCAidTracking(
float dll_bw_narrow_hz; float dll_bw_narrow_hz;
float early_late_space_chips; float early_late_space_chips;
item_type_ = configuration->property(role + ".item_type", default_item_type); item_type_ = configuration->property(role + ".item_type", default_item_type);
//vector_length = configuration->property(role + ".vector_length", 2048);
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
dump = configuration->property(role + ".dump", false); dump = configuration->property(role + ".dump", false);

View File

@ -91,6 +91,7 @@ public:
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override; void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
void start_tracking() override; void start_tracking() override;
/*! /*!
* \brief Stop running tracking * \brief Stop running tracking
*/ */

View File

@ -90,6 +90,7 @@ public:
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override; void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
void start_tracking() override; void start_tracking() override;
/*! /*!
* \brief Stop running tracking * \brief Stop running tracking
*/ */

View File

@ -214,7 +214,6 @@ GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga(
} }
} }
// ################# MAKE TRACKING GNURadio object ################### // ################# MAKE TRACKING GNURadio object ###################
tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_param_fpga); tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_param_fpga);
channel_ = 0; channel_ = 0;

View File

@ -115,6 +115,16 @@ GpsL1CaKfTracking::GpsL1CaKfTracking(
} }
channel_ = 0; channel_ = 0;
DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")"; DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")";
if (in_streams_ == 0)
{
in_streams_ = 1;
// Avoid compiler warning
}
if (out_streams_ == 0)
{
out_streams_ = 1;
// Avoid compiler warning
}
} }

View File

@ -89,6 +89,7 @@ public:
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override; void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
void start_tracking() override; void start_tracking() override;
/*! /*!
* \brief Stop running tracking * \brief Stop running tracking
*/ */

View File

@ -175,6 +175,7 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga(
trk_param_fpga.device_name = device_name; trk_param_fpga.device_name = device_name;
uint32_t device_base = configuration->property(role + ".device_base", 27); uint32_t device_base = configuration->property(role + ".device_base", 27);
trk_param_fpga.device_base = device_base; trk_param_fpga.device_base = device_base;
// ################# PRE-COMPUTE ALL THE CODES ################# // ################# PRE-COMPUTE ALL THE CODES #################
uint32_t code_samples_per_chip = 1; uint32_t code_samples_per_chip = 1;
auto code_length_chips = static_cast<uint32_t>(GPS_L5I_CODE_LENGTH_CHIPS); auto code_length_chips = static_cast<uint32_t>(GPS_L5I_CODE_LENGTH_CHIPS);

View File

@ -326,7 +326,6 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl
d_symbols_per_bit = 0; d_symbols_per_bit = 0;
} }
} }
else else
{ {
LOG(WARNING) << "Invalid System argument when instantiating tracking blocks"; LOG(WARNING) << "Invalid System argument when instantiating tracking blocks";
@ -1537,8 +1536,6 @@ void dll_pll_veml_tracking::set_channel(uint32_t channel)
{ {
try try
{ {
//trk_parameters.dump_filename.append(boost::lexical_cast<std::string>(d_channel));
//trk_parameters.dump_filename.append(".dat");
d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
d_dump_file.open(dump_filename_.c_str(), std::ios::out | std::ios::binary); d_dump_file.open(dump_filename_.c_str(), std::ios::out | std::ios::binary);
LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << dump_filename_.c_str(); LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << dump_filename_.c_str();

View File

@ -85,6 +85,7 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga &
{ {
// prevent telemetry symbols accumulation in output buffers // prevent telemetry symbols accumulation in output buffers
this->set_max_noutput_items(1); this->set_max_noutput_items(1);
trk_parameters = conf_; trk_parameters = conf_;
// Telemetry bit synchronization message port input // Telemetry bit synchronization message port input
this->message_port_register_out(pmt::mp("events")); this->message_port_register_out(pmt::mp("events"));
@ -514,6 +515,7 @@ void dll_pll_veml_tracking_fpga::start_tracking()
m_condition.notify_one(); m_condition.notify_one();
} }
dll_pll_veml_tracking_fpga::~dll_pll_veml_tracking_fpga() dll_pll_veml_tracking_fpga::~dll_pll_veml_tracking_fpga()
{ {
if (d_dump_file.is_open()) if (d_dump_file.is_open())
@ -606,7 +608,6 @@ bool dll_pll_veml_tracking_fpga::cn0_and_tracking_lock_status(double coh_integra
float d_CN0_SNV_dB_Hz_raw = cn0_svn_estimator(d_Prompt_buffer.data(), trk_parameters.cn0_samples, static_cast<float>(coh_integration_time_s)); float d_CN0_SNV_dB_Hz_raw = cn0_svn_estimator(d_Prompt_buffer.data(), trk_parameters.cn0_samples, static_cast<float>(coh_integration_time_s));
d_CN0_SNV_dB_Hz = d_cn0_smoother.smooth(d_CN0_SNV_dB_Hz_raw); d_CN0_SNV_dB_Hz = d_cn0_smoother.smooth(d_CN0_SNV_dB_Hz_raw);
// Carrier lock indicator // Carrier lock indicator
//d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer.data(), trk_parameters.cn0_samples);
d_carrier_lock_test = d_carrier_lock_test_smoother.smooth(carrier_lock_detector(d_Prompt_buffer.data(), 1)); d_carrier_lock_test = d_carrier_lock_test_smoother.smooth(carrier_lock_detector(d_Prompt_buffer.data(), 1));
// Loss of lock detection // Loss of lock detection
if (!d_pull_in_transitory) if (!d_pull_in_transitory)
@ -789,15 +790,12 @@ void dll_pll_veml_tracking_fpga::update_tracking_vars()
// ################## CARRIER AND CODE NCO BUFFER ALIGNMENT ####################### // ################## CARRIER AND CODE NCO BUFFER ALIGNMENT #######################
// keep alignment parameters for the next input buffer // keep alignment parameters for the next input buffer
// Compute the next buffer length based in the new period of the PRN sequence and the code phase error estimation // Compute the next buffer length based in the new period of the PRN sequence and the code phase error estimation
//T_prn_samples_prev = T_prn_samples;
T_prn_samples = T_prn_seconds * trk_parameters.fs_in; T_prn_samples = T_prn_seconds * trk_parameters.fs_in;
//K_blk_samples = T_prn_samples + d_rem_code_phase_samples; // initially d_rem_code_phase_samples is zero. It is updated at the end of this function
K_blk_samples = T_prn_samples * d_current_fpga_integration_period + d_rem_code_phase_samples; // initially d_rem_code_phase_samples is zero. It is updated at the end of this function K_blk_samples = T_prn_samples * d_current_fpga_integration_period + d_rem_code_phase_samples; // initially d_rem_code_phase_samples is zero. It is updated at the end of this function
auto actual_blk_length = static_cast<int32_t>(std::floor(K_blk_samples)); auto actual_blk_length = static_cast<int32_t>(std::floor(K_blk_samples));
//d_next_integration_length_samples = 2 * actual_blk_length - d_current_integration_length_samples;
d_next_integration_length_samples = actual_blk_length; d_next_integration_length_samples = actual_blk_length;
//################### PLL COMMANDS #################################################
// ################## PLL COMMANDS #################################################
// carrier phase step (NCO phase increment per sample) [rads/sample] // carrier phase step (NCO phase increment per sample) [rads/sample]
d_carrier_phase_step_rad = PI_2 * d_carrier_doppler_hz / trk_parameters.fs_in; d_carrier_phase_step_rad = PI_2 * d_carrier_doppler_hz / trk_parameters.fs_in;
// carrier phase rate step (NCO phase increment rate per sample) [rads/sample^2] // carrier phase rate step (NCO phase increment rate per sample) [rads/sample^2]
@ -831,7 +829,7 @@ void dll_pll_veml_tracking_fpga::update_tracking_vars()
// std::cout << fmod(b, PI_2) / fmod(a, PI_2) << std::endl; // std::cout << fmod(b, PI_2) / fmod(a, PI_2) << std::endl;
d_acc_carrier_phase_rad -= (d_carrier_phase_step_rad * static_cast<double>(d_current_integration_length_samples) + 0.5 * d_carrier_phase_rate_step_rad * static_cast<double>(d_current_integration_length_samples) * static_cast<double>(d_current_integration_length_samples)); d_acc_carrier_phase_rad -= (d_carrier_phase_step_rad * static_cast<double>(d_current_integration_length_samples) + 0.5 * d_carrier_phase_rate_step_rad * static_cast<double>(d_current_integration_length_samples) * static_cast<double>(d_current_integration_length_samples));
//################### DLL COMMANDS ################################################# // ################## DLL COMMANDS #################################################
// code phase step (Code resampler phase increment per sample) [chips/sample] // code phase step (Code resampler phase increment per sample) [chips/sample]
d_code_phase_step_chips = d_code_freq_chips / trk_parameters.fs_in; d_code_phase_step_chips = d_code_freq_chips / trk_parameters.fs_in;
if (trk_parameters.high_dyn) if (trk_parameters.high_dyn)
@ -1301,8 +1299,6 @@ void dll_pll_veml_tracking_fpga::set_channel(uint32_t channel)
{ {
try try
{ {
//trk_parameters.dump_filename.append(boost::lexical_cast<std::string>(d_channel));
//trk_parameters.dump_filename.append(".dat");
d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
d_dump_file.open(dump_filename_.c_str(), std::ios::out | std::ios::binary); d_dump_file.open(dump_filename_.c_str(), std::ios::out | std::ios::binary);
LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << dump_filename_.c_str(); LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << dump_filename_.c_str();
@ -1506,13 +1502,10 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
case 1: // Pull-in case 1: // Pull-in
{ {
d_worker_is_done = false; d_worker_is_done = false;
boost::mutex::scoped_lock lock(d_mutex); boost::mutex::scoped_lock lock(d_mutex);
while (!d_worker_is_done) m_condition.wait(lock); while (!d_worker_is_done) m_condition.wait(lock);
// Signal alignment (skip samples until the incoming signal is aligned with local replica) // Signal alignment (skip samples until the incoming signal is aligned with local replica)
int64_t acq_trk_diff_samples; int64_t acq_trk_diff_samples;
double acq_trk_diff_seconds; double acq_trk_diff_seconds;
double delta_trk_to_acq_prn_start_samples; double delta_trk_to_acq_prn_start_samples;
@ -1533,7 +1526,6 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
else else
{ {
// test mode // test mode
acq_trk_diff_samples = -static_cast<int64_t>(counter_value) + static_cast<int64_t>(d_acq_sample_stamp); acq_trk_diff_samples = -static_cast<int64_t>(counter_value) + static_cast<int64_t>(d_acq_sample_stamp);
acq_trk_diff_seconds = static_cast<double>(acq_trk_diff_samples) / trk_parameters.fs_in; acq_trk_diff_seconds = static_cast<double>(acq_trk_diff_samples) / trk_parameters.fs_in;
delta_trk_to_acq_prn_start_samples = static_cast<double>(acq_trk_diff_samples) + d_acq_code_phase_samples; delta_trk_to_acq_prn_start_samples = static_cast<double>(acq_trk_diff_samples) + d_acq_code_phase_samples;
@ -1541,9 +1533,7 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
absolute_samples_offset = static_cast<uint64_t>(delta_trk_to_acq_prn_start_samples); absolute_samples_offset = static_cast<uint64_t>(delta_trk_to_acq_prn_start_samples);
} }
multicorrelator_fpga->set_initial_sample(absolute_samples_offset); multicorrelator_fpga->set_initial_sample(absolute_samples_offset);
//d_absolute_samples_offset = absolute_samples_offset;
d_sample_counter = absolute_samples_offset; d_sample_counter = absolute_samples_offset;
d_sample_counter_next = d_sample_counter; d_sample_counter_next = d_sample_counter;
@ -1583,7 +1573,6 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
do_correlation_step(); do_correlation_step();
// Save single correlation step variables // Save single correlation step variables
if (d_veml) if (d_veml)
{ {
d_VE_accu = *d_Very_Early; d_VE_accu = *d_Very_Early;
@ -1602,7 +1591,6 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
} }
// Check lock status // Check lock status
if (!cn0_and_tracking_lock_status(d_code_period)) if (!cn0_and_tracking_lock_status(d_code_period))
{ {
clear_tracking_vars(); clear_tracking_vars();
@ -1751,7 +1739,6 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
} }
} }
} }
break; break;
} }
case 3: // coherent integration (correlation time extension) case 3: // coherent integration (correlation time extension)
@ -1843,7 +1830,6 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
} }
break; break;
} }
case 5: // coherent integration (correlation time extension) case 5: // coherent integration (correlation time extension)
{ {
d_sample_counter = d_sample_counter_next; d_sample_counter = d_sample_counter_next;
@ -1889,8 +1875,6 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
break; break;
} }
case 6: // narrow tracking IN THE FPGA case 6: // narrow tracking IN THE FPGA
{ {
d_sample_counter = d_sample_counter_next; d_sample_counter = d_sample_counter_next;
@ -1956,6 +1940,8 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
} }
break; break;
} }
default:
break;
} }
} }

View File

@ -1163,6 +1163,8 @@ void GNSSFlowgraph::remove_signal(const Gnss_Signal& gs)
break; break;
} }
} }
// project Doppler from primary frequency to secondary frequency // project Doppler from primary frequency to secondary frequency
double GNSSFlowgraph::project_doppler(std::string searched_signal, double primary_freq_doppler_hz) double GNSSFlowgraph::project_doppler(std::string searched_signal, double primary_freq_doppler_hz)
{ {
@ -1182,6 +1184,7 @@ double GNSSFlowgraph::project_doppler(std::string searched_signal, double primar
} }
} }
void GNSSFlowgraph::acquisition_manager(unsigned int who) void GNSSFlowgraph::acquisition_manager(unsigned int who)
{ {
unsigned int current_channel; unsigned int current_channel;
@ -1285,7 +1288,6 @@ void GNSSFlowgraph::acquisition_manager(unsigned int who)
void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what)
{ {
//todo: the acquisition events are initiated from the acquisition success or failure queued msg. If the acquisition is disabled for non-assisted secondary freq channels, the engine stops.. //todo: the acquisition events are initiated from the acquisition success or failure queued msg. If the acquisition is disabled for non-assisted secondary freq channels, the engine stops..
std::lock_guard<std::mutex> lock(signal_list_mutex); std::lock_guard<std::mutex> lock(signal_list_mutex);
DLOG(INFO) << "Received " << what << " from " << who; DLOG(INFO) << "Received " << what << " from " << who;
unsigned int sat = 0; unsigned int sat = 0;