From dc4c7b95515bf25906b8ef90450f597a4f84cbff Mon Sep 17 00:00:00 2001 From: Javier Arribas Date: Fri, 2 Mar 2018 11:30:36 +0100 Subject: [PATCH 01/82] Adding AD9361 fpga signal source --- CMakeLists.txt | 1 + cmake/Modules/Findlibiio.cmake | 32 ++ .../signal_source/adapters/CMakeLists.txt | 24 ++ .../adapters/ad9361_fpga_signal_source.cc | 299 ++++++++++++++++++ .../adapters/ad9361_fpga_signal_source.h | 109 +++++++ src/core/receiver/CMakeLists.txt | 5 + src/core/receiver/gnss_block_factory.cc | 13 + 7 files changed, 483 insertions(+) create mode 100644 cmake/Modules/Findlibiio.cmake create mode 100644 src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc create mode 100644 src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 1dcd4d375..669c2ae43 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,6 +50,7 @@ option(ENABLE_ARRAY "Enable the use of CTTC's antenna array front-end as signal option(ENABLE_GN3S "Enable the use of the GN3S dongle as signal source (experimental)" OFF) option(ENABLE_PLUTOSDR "Enable the use of ADALM-PLUTO Evaluation Boards (Analog Devices Inc.), requires gr-iio" OFF) option(ENABLE_FMCOMMS2 "Enable the use of FMCOMMS4-EBZ + ZedBoard hardware, requires gr-iio" OFF) +option(ENABLE_AD9361 "Enable the use of AD9361 directo to FPGA hardware, requires gr-iio" OFF) # Performance analysis tools option(ENABLE_GPERFTOOLS "Enable linking to Gperftools libraries (tcmalloc and profiler)" OFF) diff --git a/cmake/Modules/Findlibiio.cmake b/cmake/Modules/Findlibiio.cmake new file mode 100644 index 000000000..a708d7062 --- /dev/null +++ b/cmake/Modules/Findlibiio.cmake @@ -0,0 +1,32 @@ +INCLUDE(FindPkgConfig) +PKG_CHECK_MODULES(PC_LIBIIO libiio) + +FIND_PATH( + LIBIIO_INCLUDE_DIRS + NAMES gnuradio/iio/api.h + HINTS $ENV{LIBIIO_DIR}/include + ${PC_LIBIIO_INCLUDEDIR} + PATHS ${CMAKE_INSTALL_PREFIX}/include + /usr/local/include + /usr/include +) + +FIND_LIBRARY( + LIBIIO_LIBRARIES + NAMES libiio.so + HINTS $ENV{LIBIIO_DIR}/lib + ${PC_LIBIIO_LIBDIR} + PATHS ${CMAKE_INSTALL_PREFIX}/lib + ${CMAKE_INSTALL_PREFIX}/lib64 + /usr/local/lib + /usr/local/lib64 + /usr/lib + /usr/lib64 + /usr/lib/x86_64-linux-gnu +) + +message("find libiio:") +message(${LIBIIO_LIBRARIES}) +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBIIO DEFAULT_MSG LIBIIO_LIBRARIES LIBIIO_INCLUDE_DIRS) +MARK_AS_ADVANCED(LIBIIO_LIBRARIES LIBIIO_INCLUDE_DIRS) diff --git a/src/algorithms/signal_source/adapters/CMakeLists.txt b/src/algorithms/signal_source/adapters/CMakeLists.txt index 2fb8f4be8..ededc5dc7 100644 --- a/src/algorithms/signal_source/adapters/CMakeLists.txt +++ b/src/algorithms/signal_source/adapters/CMakeLists.txt @@ -35,6 +35,20 @@ if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) endif(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) +if(ENABLE_AD9361) + find_package(libiio REQUIRED) + if(NOT LIBIIO_FOUND) + message(STATUS "gnuradio-iio not found, its installation is required.") + message(STATUS "Please build and install the following projects:") + message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio") + message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") + message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") + message(FATAL_ERROR "gnuradio-iio required for building gnss-sdr with this option enabled") + endif(NOT LIBIIO_FOUND) + set(OPT_LIBRARIES ${OPT_LIBRARIES} ${LIBIIO_LIBRARIES}) + set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${LIBIIO_INCLUDE_DIRS}) +endif(ENABLE_AD9361) + if(ENABLE_PLUTOSDR) ############################################## @@ -55,6 +69,16 @@ if(ENABLE_FMCOMMS2) endif(IIO_FOUND) endif(ENABLE_FMCOMMS2) +if(ENABLE_AD9361) + ############################################### + # AD9361 DIRECT TO FPGA Hardware + ############################################### + if(LIBIIO_FOUND) + set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} ad9361_fpga_signal_source.cc) + endif(LIBIIO_FOUND) +endif(ENABLE_AD9361) + + if(ENABLE_GN3S) ############################################## diff --git a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc new file mode 100644 index 000000000..3aaf74a79 --- /dev/null +++ b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc @@ -0,0 +1,299 @@ +/*! + * \file ad9361_fpga_signal_source.cc + * \brief signal source for Analog Devices front-end AD9361 connected directly to FPGA accelerators. + * This source implements only the AD9361 control. It is NOT compatible with conventional SDR acquisition and tracking blocks. + * Please use the fmcomms2 source if conventional SDR acquisition and tracking is selected in the configuration file. + * \author Javier Arribas, jarribas(at)cttc.es + * + * ------------------------------------------------------------------------- + * + * Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors) + * + * GNSS-SDR is a software defined Global Navigation + * Satellite Systems receiver + * + * This file is part of GNSS-SDR. + * + * GNSS-SDR is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GNSS-SDR is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNSS-SDR. If not, see . + * + * ------------------------------------------------------------------------- + */ + +#include "ad9361_fpga_signal_source.h" +#include "configuration_interface.h" +#include "GPS_L1_CA.h" +#include +#include +#include +#include + +#ifdef __APPLE__ +#include +#else +#include +#endif + + +/* RX is input, TX is output */ +enum iodev { RX, TX }; + +/* common RX and TX streaming params */ +struct stream_cfg { + long long bw_hz; // Analog banwidth in Hz + long long fs_hz; // Baseband sample rate in Hz + long long lo_hz; // Local oscillator frequency in Hz + const char* rfport; // Port name +}; + + +using google::LogMessage; + + +/* static scratch mem for strings */ +static char tmpstr[64]; + +/* IIO structs required for streaming */ +static struct iio_context *ctx = NULL; +static struct iio_channel *rx0_i = NULL; +static struct iio_channel *rx0_q = NULL; + +/* check return value of attr_write function */ +static void errchk(int v, const char* what) { + if (v < 0) { fprintf(stderr, "Error %d writing to channel \"%s\"\nvalue may not be supported.\n", v, what); } +} + +/* write attribute: long long int */ +static void wr_ch_lli(struct iio_channel *chn, const char* what, long long val) +{ + errchk(iio_channel_attr_write_longlong(chn, what, val), what); +} + +/* write attribute: string */ +static void wr_ch_str(struct iio_channel *chn, const char* what, const char* str) +{ + errchk(iio_channel_attr_write(chn, what, str), what); +} + + +/* helper function generating channel names */ +static char* get_ch_name(const char* type, int id) +{ + snprintf(tmpstr, sizeof(tmpstr), "%s%d", type, id); + return tmpstr; +} + +/* returns ad9361 phy device */ +static struct iio_device* get_ad9361_phy(struct iio_context *ctx) +{ + struct iio_device *dev = iio_context_find_device(ctx, "ad9361-phy"); + return dev; +} + +/* finds AD9361 streaming IIO devices */ +static bool get_ad9361_stream_dev(struct iio_context *ctx, enum iodev d, struct iio_device **dev) +{ + switch (d) { + case TX: *dev = iio_context_find_device(ctx, "cf-ad9361-dds-core-lpc"); return *dev != NULL; + case RX: *dev = iio_context_find_device(ctx, "cf-ad9361-lpc"); return *dev != NULL; + default: return false; + } +} + +/* finds AD9361 streaming IIO channels */ +static bool get_ad9361_stream_ch(struct iio_context *ctx, enum iodev d, struct iio_device *dev, int chid, struct iio_channel **chn) +{ + *chn = iio_device_find_channel(dev, get_ch_name("voltage", chid), d == TX); + if (!*chn) + *chn = iio_device_find_channel(dev, get_ch_name("altvoltage", chid), d == TX); + return *chn != NULL; +} + +/* finds AD9361 phy IIO configuration channel with id chid */ +static bool get_phy_chan(struct iio_context *ctx, enum iodev d, int chid, struct iio_channel **chn) +{ + switch (d) { + case RX: *chn = iio_device_find_channel(get_ad9361_phy(ctx), get_ch_name("voltage", chid), false); return *chn != NULL; + case TX: *chn = iio_device_find_channel(get_ad9361_phy(ctx), get_ch_name("voltage", chid), true); return *chn != NULL; + default: return false; + } +} + +/* finds AD9361 local oscillator IIO configuration channels */ +static bool get_lo_chan(struct iio_context *ctx, enum iodev d, struct iio_channel **chn) +{ + switch (d) { + // LO chan is always output, i.e. true + case RX: *chn = iio_device_find_channel(get_ad9361_phy(ctx), get_ch_name("altvoltage", 0), true); return *chn != NULL; + case TX: *chn = iio_device_find_channel(get_ad9361_phy(ctx), get_ch_name("altvoltage", 1), true); return *chn != NULL; + default: return false; + } +} + + +/* applies streaming configuration through IIO */ +bool cfg_ad9361_streaming_ch(struct iio_context *ctx, struct stream_cfg *cfg, enum iodev type, int chid) +{ + struct iio_channel *chn = NULL; + + // Configure phy and lo channels + printf("* Acquiring AD9361 phy channel %d\n", chid); + if (!get_phy_chan(ctx, type, chid, &chn)) { return false; } + wr_ch_str(chn, "rf_port_select", cfg->rfport); + wr_ch_lli(chn, "rf_bandwidth", cfg->bw_hz); + wr_ch_lli(chn, "sampling_frequency", cfg->fs_hz); + + // Configure LO channel + printf("* Acquiring AD9361 %s lo channel\n", type == TX ? "TX" : "RX"); + if (!get_lo_chan(ctx, type, &chn)) { return false; } + wr_ch_lli(chn, "frequency", cfg->lo_hz); + return true; +} + + +Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(ConfigurationInterface* configuration, + std::string role, unsigned int in_stream, unsigned int out_stream, + boost::shared_ptr queue) : + role_(role), in_stream_(in_stream), out_stream_(out_stream), + queue_(queue) +{ + std::string default_item_type = "gr_complex"; + std::string default_dump_file = "./data/signal_source.dat"; + uri_ = configuration->property(role + ".device_address", std::string("192.168.2.1")); + freq_ = configuration->property(role + ".freq", GPS_L1_FREQ_HZ); + sample_rate_ = configuration->property(role + ".sampling_frequency", 2600000); + bandwidth_ = configuration->property(role + ".bandwidth", 2000000); + rx1_en_ = configuration->property(role + ".rx1_enable", true); + rx2_en_ = configuration->property(role + ".rx2_enable", false); + buffer_size_ = configuration->property(role + ".buffer_size", 0xA0000); + quadrature_ = configuration->property(role + ".quadrature", true); + rf_dc_ = configuration->property(role + ".rf_dc", true); + bb_dc_ = configuration->property(role + ".bb_dc", true); + gain_mode_rx1_ = configuration->property(role + ".gain_mode_rx1", std::string("manual")); + gain_mode_rx2_ = configuration->property(role + ".gain_mode_rx2", std::string("manual")); + rf_gain_rx1_ = configuration->property(role + ".gain_rx1", 64.0); + rf_gain_rx2_ = configuration->property(role + ".gain_rx2", 64.0); + rf_port_select_ = configuration->property(role + ".rf_port_select", std::string("A_BALANCED")); + filter_file_ = configuration->property(role + ".filter_file", std::string("")); + filter_auto_ = configuration->property(role + ".filter_auto", true); + item_type_ = configuration->property(role + ".item_type", default_item_type); + samples_ = configuration->property(role + ".samples", 0); + dump_ = configuration->property(role + ".dump", false); + dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file); + + item_size_ = sizeof(gr_complex); + + std::cout << "device address: " << uri_ << std::endl; + std::cout << "LO frequency : " << freq_ << " Hz" << std::endl; + std::cout << "sample rate: " << sample_rate_ << " Hz" << std::endl; + + + // AD9361 Frontend IC device operation + + // Streaming devices + struct iio_device *rx; + + // RX stream config + // Stream configurations + struct stream_cfg rxcfg; + rxcfg.bw_hz = bandwidth_; // 2 MHz rf bandwidth + rxcfg.fs_hz = sample_rate_; // 2.5 MS/s rx sample rate + rxcfg.lo_hz = freq_; // 2.5 GHz rf frequency + rxcfg.rfport = rf_port_select_.c_str(); // port A (select for rf freq.) + + + std::cout<<"AD9361 Acquiring IIO context\n"; + ctx = iio_create_default_context(); + if (!ctx) + { + std::cout<<"No context\n"; + throw std::runtime_error("AD9361 IIO No context"); + } + + if (iio_context_get_devices_count(ctx) <= 0) + { + std::cout<<"No devices\n"; + throw std::runtime_error("AD9361 IIO No devices"); + } + + std::cout<<"* Acquiring AD9361 streaming devices\n"; + + if(!get_ad9361_stream_dev(ctx, RX, &rx)) + { + std::cout<<"No rx dev found\n"; + throw std::runtime_error("AD9361 IIO No rx dev found"); + }; + + std::cout<<"* Configuring AD9361 for streaming\n"; + if (!cfg_ad9361_streaming_ch(ctx, &rxcfg, RX, 0)) + { + std::cout<<"RX port 0 not found\n"; + throw std::runtime_error("AD9361 IIO RX port 0 not found"); + } + + std::cout<<"* Initializing AD9361 IIO streaming channels\n"; + if (!get_ad9361_stream_ch(ctx, RX, rx, 0, &rx0_i)) + { + std::cout<<"RX chan i not found\n"; + throw std::runtime_error("RX chan i not found"); + } + + if (!get_ad9361_stream_ch(ctx, RX, rx, 1, &rx0_q)) + { + std::cout<<"RX chan q not found\n"; + throw std::runtime_error("RX chan q not found"); + } + + std::cout<<"* Enabling IIO streaming channels\n"; + iio_channel_enable(rx0_i); + iio_channel_enable(rx0_q); + +} + + +Ad9361FpgaSignalSource::~Ad9361FpgaSignalSource() +{ + /* cleanup and exit */ + std::cout<<"* AD9361 Disabling streaming channels\n"; + if (rx0_i) { iio_channel_disable(rx0_i); } + if (rx0_q) { iio_channel_disable(rx0_q); } + + std::cout<<"* AD9361 Destroying context\n"; + if (ctx) { iio_context_destroy(ctx); } +} + + +void Ad9361FpgaSignalSource::connect(gr::top_block_sptr top_block) +{ + DLOG(INFO) << "AD9361 FPGA source nothing to connect"; +} + + +void Ad9361FpgaSignalSource::disconnect(gr::top_block_sptr top_block) +{ + DLOG(INFO) << "AD9361 FPGA source nothing to disconnect"; +} + + +gr::basic_block_sptr Ad9361FpgaSignalSource::get_left_block() +{ + LOG(WARNING) << "Trying to get signal source left block."; + return gr::basic_block_sptr(); +} + + +gr::basic_block_sptr Ad9361FpgaSignalSource::get_right_block() +{ + LOG(WARNING) << "Trying to get AD9361 FPGA signal source right block."; + return gr::basic_block_sptr(); +} diff --git a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h new file mode 100644 index 000000000..ff6b796b7 --- /dev/null +++ b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h @@ -0,0 +1,109 @@ +/*! + * \file ad9361_fpga_signal_source.h + * \brief signal source for Analog Devices front-end AD9361 connected directly to FPGA accelerators. + * This source implements only the AD9361 control. It is NOT compatible with conventional SDR acquisition and tracking blocks. + * Please use the fmcomms2 source if conventional SDR acquisition and tracking is selected in the configuration file. + * + * ------------------------------------------------------------------------- + * + * Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors) + * + * GNSS-SDR is a software defined Global Navigation + * Satellite Systems receiver + * + * This file is part of GNSS-SDR. + * + * GNSS-SDR is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GNSS-SDR is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNSS-SDR. If not, see . + * + * ------------------------------------------------------------------------- + */ + +#ifndef GNSS_SDR_AD9361_FPGA_SIGNAL_SOURCE_H_ +#define GNSS_SDR_AD9361_FPGA_SIGNAL_SOURCE_H_ + +#include "gnss_block_interface.h" + +#include +#include +#include + +class ConfigurationInterface; + +class Ad9361FpgaSignalSource: public GNSSBlockInterface +{ +public: + Ad9361FpgaSignalSource(ConfigurationInterface* configuration, + std::string role, unsigned int in_stream, + unsigned int out_stream, boost::shared_ptr queue); + + virtual ~Ad9361FpgaSignalSource(); + + inline std::string role() override + { + return role_; + } + + /*! + * \brief Returns "Ad9361_Fpga_Signal_Source" + */ + inline std::string implementation() override + { + return "Ad9361_Fpga_Signal_Source"; + } + + inline size_t item_size() override + { + return item_size_; + } + + void connect(gr::top_block_sptr top_block) override; + void disconnect(gr::top_block_sptr top_block) override; + gr::basic_block_sptr get_left_block() override; + gr::basic_block_sptr get_right_block() override; + +private: + std::string role_; + + // Front-end settings + std::string uri_;//device direction + unsigned long freq_; //frequency of local oscilator + unsigned long sample_rate_; + unsigned long bandwidth_; + unsigned long buffer_size_; //reception buffer + bool rx1_en_; + bool rx2_en_; + bool quadrature_; + bool rf_dc_; + bool bb_dc_; + std::string gain_mode_rx1_; + std::string gain_mode_rx2_; + double rf_gain_rx1_; + double rf_gain_rx2_; + std::string rf_port_select_; + std::string filter_file_; + bool filter_auto_; + + unsigned int in_stream_; + unsigned int out_stream_; + + std::string item_type_; + size_t item_size_; + long samples_; + bool dump_; + std::string dump_filename_; + + boost::shared_ptr queue_; +}; + +#endif /*GNSS_SDR_AD9361_FPGA_SIGNAL_SOURCE_H_*/ diff --git a/src/core/receiver/CMakeLists.txt b/src/core/receiver/CMakeLists.txt index 0e12422a6..c922cdf3d 100644 --- a/src/core/receiver/CMakeLists.txt +++ b/src/core/receiver/CMakeLists.txt @@ -90,6 +90,11 @@ if(ENABLE_FMCOMMS2) set(OPT_RECEIVER_INCLUDE_DIRS ${OPT_RECEIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) endif(ENABLE_FMCOMMS2) +if(ENABLE_AD9361) + add_definitions(-DAD9361_DRIVER=1) + set(OPT_RECEIVER_INCLUDE_DIRS ${OPT_RECEIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) +endif(ENABLE_AD9361) + if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13" ) add_definitions( -DGR_GREATER_38=1 ) endif(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13" ) diff --git a/src/core/receiver/gnss_block_factory.cc b/src/core/receiver/gnss_block_factory.cc index 1ebab2595..e7d096fab 100644 --- a/src/core/receiver/gnss_block_factory.cc +++ b/src/core/receiver/gnss_block_factory.cc @@ -132,6 +132,10 @@ #include "fmcomms2_signal_source.h" #endif +#if AD9361_DRIVER +#include "ad9361_fpga_signal_source.h" +#endif + #if FLEXIBAND_DRIVER #include "flexiband_signal_source.h" #endif @@ -1080,6 +1084,15 @@ std::unique_ptr GNSSBlockFactory::GetBlock( } #endif +#if AD9361_DRIVER + else if (implementation.compare("Ad9361_Fpga_Signal_Source") == 0) + { + std::unique_ptr block_(new Ad9361FpgaSignalSource(configuration.get(), role, in_streams, + out_streams, queue)); + block = std::move(block_); + } +#endif + #if FLEXIBAND_DRIVER else if (implementation.compare("Flexiband_Signal_Source") == 0) { From 288dd481e776cf68f8147331b7396baaac8c143b Mon Sep 17 00:00:00 2001 From: Javier Arribas Date: Fri, 2 Mar 2018 12:23:10 +0100 Subject: [PATCH 02/82] Updating FPGA acquisition modules --- .../gps_l1_ca_pcps_acquisition_fpga.cc | 51 ++---- .../gps_pcps_acquisition_fpga_sc.cc | 65 +++---- .../gps_pcps_acquisition_fpga_sc.h | 18 +- .../libs/gps_fpga_acquisition_8sc.cc | 161 ++++++++---------- .../libs/gps_fpga_acquisition_8sc.h | 21 +-- 5 files changed, 126 insertions(+), 190 deletions(-) diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc index 4b373edb3..00ff2008c 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc @@ -32,12 +32,10 @@ */ #include "gps_l1_ca_pcps_acquisition_fpga.h" -#include #include #include #include "GPS_L1_CA.h" #include "configuration_interface.h" -#include "gnss_sdr_flags.h" using google::LogMessage; @@ -57,57 +55,46 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( unsigned int nsamples_total; unsigned int select_queue_Fpga; std::string device_name; - configuration_ = configuration; - std::string default_item_type = "cshort"; std::string default_dump_filename = "./data/acquisition.dat"; - DLOG(INFO) << "role " << role; - - item_type_ = configuration_->property(role + ".item_type", default_item_type); - - long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); - fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); + item_type_ = configuration_->property(role + ".item_type", + default_item_type); + fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", 2048000); ifreq = configuration_->property(role + ".if", 0); dump = configuration_->property(role + ".dump", false); doppler_max_ = configuration_->property(role + ".doppler_max", 5000); - if (FLAGS_doppler_max != 0 ) doppler_max_ = FLAGS_doppler_max; - sampled_ms = configuration_->property(role + ".coherent_integration_time_ms", 1); - + sampled_ms = configuration_->property( + role + ".coherent_integration_time_ms", 1); // note : the FPGA is implemented according to bit transition flag = 0. Setting bit transition flag to 1 has no effect. - bit_transition_flag = configuration_->property(role + ".bit_transition_flag", false); - + bit_transition_flag = configuration_->property( + role + ".bit_transition_flag", false); // note : the FPGA is implemented according to use_CFAR_algorithm = 0. Setting use_CFAR_algorithm to 1 has no effect. - use_CFAR_algorithm_flag = configuration_->property(role + ".use_CFAR_algorithm", false); - + use_CFAR_algorithm_flag = configuration_->property( + role + ".use_CFAR_algorithm", false); // note : the FPGA does not use the max_dwells variable. max_dwells_ = configuration_->property(role + ".max_dwells", 1); - - dump_filename = configuration_->property(role + ".dump_filename", default_dump_filename); - + dump_filename = configuration_->property(role + ".dump_filename", + default_dump_filename); //--- Find number of samples per spreading code ------------------------- code_length = round( fs_in / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); - // code length has the same value as d_fft_size float nbits; nbits = ceilf(log2f(code_length)); nsamples_total = pow(2, nbits); - //vector_length_ = code_length_ * sampled_ms_; vector_length_ = nsamples_total * sampled_ms; - // if( bit_transition_flag_ ) // { // vector_length_ *= 2; // } - - select_queue_Fpga = configuration_->property(role + ".select_queue_Fpga", 0); - - std::string default_device_name = "/dev/uio0"; - device_name = configuration_->property(role + ".devicename", default_device_name); - + select_queue_Fpga = configuration_->property(role + ".select_queue_Fpga", + 0); + std::string default_device_name = "/dev/uio0"; + device_name = configuration_->property(role + ".devicename", + default_device_name); if (item_type_.compare("cshort") == 0) { item_size_ = sizeof(lv_16sc_t); @@ -121,10 +108,8 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( } else { - LOG(WARNING) << "item_type configured to " << item_type_ << "but FPGA implementation only accepts cshort"; - throw std::invalid_argument( "Wrong input_type configuration. Should be cshort" ); + LOG(FATAL) << item_type_ << " FPGA only accepts chsort"; } - channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; @@ -192,7 +177,6 @@ signed int GpsL1CaPcpsAcquisitionFpga::mag() void GpsL1CaPcpsAcquisitionFpga::init() { gps_acquisition_fpga_sc_->init(); - set_local_code(); } @@ -230,7 +214,6 @@ float GpsL1CaPcpsAcquisitionFpga::calculate_threshold(float pfa) double lambda = double(vector_length_); boost::math::exponential_distribution mydist(lambda); float threshold = static_cast(quantile(mydist, val)); - return threshold; } diff --git a/src/algorithms/acquisition/gnuradio_blocks/gps_pcps_acquisition_fpga_sc.cc b/src/algorithms/acquisition/gnuradio_blocks/gps_pcps_acquisition_fpga_sc.cc index cc491f3c0..53b54686d 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/gps_pcps_acquisition_fpga_sc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/gps_pcps_acquisition_fpga_sc.cc @@ -39,7 +39,10 @@ #include #include #include "control_message_factory.h" -#include "GPS_L1_CA.h" //GPS_TWO_PI +#include "GPS_L1_CA.h" + +#include + using google::LogMessage; void wait3(int seconds) @@ -74,12 +77,13 @@ gps_pcps_acquisition_fpga_sc::gps_pcps_acquisition_fpga_sc( unsigned int select_queue_Fpga, std::string device_name, bool dump, std::string dump_filename) : - gr::block("pcps_acquisition_fpga_sc", + //gr::block("pcps_acquisition_fpga_sc", + gr::block("gps_pcps_acquisition_fpga_sc", gr::io_signature::make(0, 0, sizeof(lv_16sc_t)), gr::io_signature::make(0, 0, 0)) { this->message_port_register_out(pmt::mp("events")); - d_sample_counter = 0; // SAMPLE COUNTER + d_sample_counter = 0; // sample counter d_active = false; d_state = 0; d_samples_per_code = samples_per_code; @@ -94,16 +98,13 @@ gps_pcps_acquisition_fpga_sc::gps_pcps_acquisition_fpga_sc( d_threshold = 0.0; d_doppler_step = 250; d_channel = 0; - // For dumping samples into a file d_dump = dump; d_dump_filename = dump_filename; - d_gnss_synchro = 0; - // instantiate HW accelerator class acquisition_fpga_8sc = std::make_shared < gps_fpga_acquisition_8sc> - (device_name, vector_length, d_fft_size, nsamples_total, fs_in, freq, sampled_ms, select_queue_Fpga); + (device_name, vector_length, d_fft_size, doppler_max, nsamples_total, fs_in, freq, sampled_ms, select_queue_Fpga); } @@ -113,7 +114,6 @@ gps_pcps_acquisition_fpga_sc::~gps_pcps_acquisition_fpga_sc() { d_dump_file.close(); } - acquisition_fpga_8sc->free(); } @@ -134,14 +134,11 @@ void gps_pcps_acquisition_fpga_sc::init() d_gnss_synchro->Acq_doppler_hz = 0.0; d_gnss_synchro->Acq_samplestamp_samples = 0; d_mag = 0.0; - d_num_doppler_bins = ceil( static_cast(static_cast(d_doppler_max) - static_cast(-d_doppler_max)) / static_cast(d_doppler_step)); - - acquisition_fpga_8sc->open_device(); - + //acquisition_fpga_8sc->open_device(); acquisition_fpga_8sc->init(); } @@ -167,34 +164,28 @@ void gps_pcps_acquisition_fpga_sc::set_state(int state) } + + void gps_pcps_acquisition_fpga_sc::set_active(bool active) { float temp_peak_to_noise_level = 0.0; float peak_to_noise_level = 0.0; float input_power; float test_statistics = 0.0; - acquisition_fpga_8sc->block_samples(); // block the samples to run the acquisition this is only necessary for the tests - + //printf("ACQ : Block samples for PRN %d\n", d_gnss_synchro->PRN); +// acquisition_fpga_8sc->block_samples(); // block the samples to run the acquisition this is only necessary for the tests d_active = active; - int acquisition_message = -1; //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL - d_state = 1; - // initialize acquisition algorithm int doppler; uint32_t indext = 0; float magt = 0.0; //int effective_fft_size = ( d_bit_transition_flag ? d_fft_size/2 : d_fft_size ); int effective_fft_size = d_fft_size; - //float fft_normalization_factor = static_cast(d_fft_size) * static_cast(d_fft_size); - d_mag = 0.0; - unsigned int initial_sample; - d_well_count++; - DLOG(INFO) << "Channel: " << d_channel << " , doing acquisition of satellite: " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN << " ,sample stamp: " @@ -207,26 +198,20 @@ void gps_pcps_acquisition_fpga_sc::set_active(bool active) doppler_index++) { - doppler = -static_cast(d_doppler_max) - + d_doppler_step * doppler_index; + doppler = -static_cast(d_doppler_max) + d_doppler_step * doppler_index; acquisition_fpga_8sc->set_phase_step(doppler_index); acquisition_fpga_8sc->run_acquisition(); // runs acquisition and waits until it is finished - acquisition_fpga_8sc->read_acquisition_results(&indext, &magt, &initial_sample, &input_power); - d_sample_counter = initial_sample; - temp_peak_to_noise_level = static_cast(magt) / static_cast(input_power); if (peak_to_noise_level < temp_peak_to_noise_level) { peak_to_noise_level = temp_peak_to_noise_level; d_mag = magt; - input_power = (input_power - d_mag) / (effective_fft_size - 1); - d_gnss_synchro->Acq_delay_samples = static_cast(indext % d_samples_per_code); d_gnss_synchro->Acq_doppler_hz = @@ -234,14 +219,12 @@ void gps_pcps_acquisition_fpga_sc::set_active(bool active) d_gnss_synchro->Acq_samplestamp_samples = d_sample_counter; test_statistics = d_mag / input_power; } - // Record results to file if required if (d_dump) { std::stringstream filename; //std::streamsize n = 2 * sizeof(float) * (d_fft_size); // complex file write filename.str(""); - boost::filesystem::path p = d_dump_filename; filename << p.parent_path().string() << boost::filesystem::path::preferred_separator @@ -250,19 +233,21 @@ void gps_pcps_acquisition_fpga_sc::set_active(bool active) << d_gnss_synchro->Signal << "_sat_" << d_gnss_synchro->PRN << "_doppler_" << doppler << p.extension().string(); - DLOG(INFO) << "Writing ACQ out to " << filename.str(); - d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary); d_dump_file.close(); } + } + + //printf("ACQ : unblocking samples for satellite %d\n", d_gnss_synchro->PRN); +// acquisition_fpga_8sc->unblock_samples(); // unblock samples before sending positive or negative acquisition message to let the samples flow when the + // set local code function is called if (test_statistics > d_threshold) { d_state = 2; // Positive acquisition - // 6.1- Declare positive acquisition using a message port DLOG(INFO) << "positive acquisition"; DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " @@ -274,10 +259,8 @@ void gps_pcps_acquisition_fpga_sc::set_active(bool active) DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; DLOG(INFO) << "magnitude " << d_mag; DLOG(INFO) << "input signal power " << input_power; - d_active = false; d_state = 0; - acquisition_message = 1; this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message)); @@ -285,7 +268,6 @@ void gps_pcps_acquisition_fpga_sc::set_active(bool active) else { d_state = 3; // Negative acquisition - // 6.2- Declare negative acquisition using a message port DLOG(INFO) << "negative acquisition"; DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " @@ -297,25 +279,18 @@ void gps_pcps_acquisition_fpga_sc::set_active(bool active) DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; DLOG(INFO) << "magnitude " << d_mag; DLOG(INFO) << "input signal power " << input_power; - d_active = false; d_state = 0; - acquisition_message = 2; this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message)); } - - acquisition_fpga_8sc->unblock_samples(); - - acquisition_fpga_8sc->close_device(); - DLOG(INFO) << "Done. Consumed 1 item."; } int gps_pcps_acquisition_fpga_sc::general_work(int noutput_items, - gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, + gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items __attribute__((unused)), gr_vector_void_star &output_items __attribute__((unused))) { // general work not used with the acquisition diff --git a/src/algorithms/acquisition/gnuradio_blocks/gps_pcps_acquisition_fpga_sc.h b/src/algorithms/acquisition/gnuradio_blocks/gps_pcps_acquisition_fpga_sc.h index 561609109..a8316c634 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/gps_pcps_acquisition_fpga_sc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/gps_pcps_acquisition_fpga_sc.h @@ -46,8 +46,8 @@ * ------------------------------------------------------------------------- */ -#ifndef GNSS_SDR_PCPS_ACQUISITION_FPGA_SC_H_ -#define GNSS_SDR_PCPS_ACQUISITION_FPGA_SC_H_ +#ifndef GNSS_SDR_GPS_PCPS_ACQUISITION_FPGA_SC_H_ +#define GNSS_SDR_GPS_PCPS_ACQUISITION_FPGA_SC_H_ #include #include @@ -57,6 +57,8 @@ #include "gnss_synchro.h" #include "gps_fpga_acquisition_8sc.h" +#include + class gps_pcps_acquisition_fpga_sc; typedef boost::shared_ptr gps_pcps_acquisition_fpga_sc_sptr; @@ -95,7 +97,6 @@ private: bool bit_transition_flag, bool use_CFAR_algorithm_flag, unsigned int select_queue_Fpga, std::string device_name, bool dump, std::string dump_filename); - int d_samples_per_code; float d_threshold; unsigned int d_doppler_max; @@ -105,15 +106,16 @@ private: unsigned int d_fft_size; unsigned long int d_sample_counter; unsigned int d_num_doppler_bins; - Gnss_Synchro *d_gnss_synchro; float d_mag;bool d_bit_transition_flag;bool d_use_CFAR_algorithm_flag; - std::ofstream d_dump_file;bool d_active; + std::ofstream d_dump_file; + bool d_active; int d_state;bool d_dump; unsigned int d_channel; std::string d_dump_filename; - std::shared_ptr acquisition_fpga_8sc; + //void set_active2(bool active); + boost::thread d_acq_thread; public: /*! @@ -155,6 +157,8 @@ public: * active mode * \param active - bool that activates/deactivates the block. */ + + void set_active(bool active); /*! @@ -212,4 +216,4 @@ public: }; -#endif /* GNSS_SDR_PCPS_ACQUISITION_SC_H_*/ +#endif /* GNSS_SDR_GPS_PCPS_ACQUISITION_SC_H_*/ diff --git a/src/algorithms/acquisition/libs/gps_fpga_acquisition_8sc.cc b/src/algorithms/acquisition/libs/gps_fpga_acquisition_8sc.cc index ca80ee6ff..16280e1d4 100644 --- a/src/algorithms/acquisition/libs/gps_fpga_acquisition_8sc.cc +++ b/src/algorithms/acquisition/libs/gps_fpga_acquisition_8sc.cc @@ -60,8 +60,10 @@ // logging #include +// volk #include +// GPS L1 #include "GPS_L1_CA.h" #define PAGE_SIZE 0x10000 @@ -78,15 +80,15 @@ bool gps_fpga_acquisition_8sc::init() bool gps_fpga_acquisition_8sc::set_local_code(unsigned int PRN) { - // select the code with the chosen PRN gps_fpga_acquisition_8sc::fpga_configure_acquisition_local_code( - &d_all_fft_codes[d_vector_length * PRN]); + &d_all_fft_codes[d_nsamples_total * (PRN - 1)]); return true; } gps_fpga_acquisition_8sc::gps_fpga_acquisition_8sc(std::string device_name, unsigned int vector_length, unsigned int nsamples, + unsigned int doppler_max, unsigned int nsamples_total, long fs_in, long freq, unsigned int sampled_ms, unsigned select_queue) { @@ -97,48 +99,33 @@ gps_fpga_acquisition_8sc::gps_fpga_acquisition_8sc(std::string device_name, d_vector_length = vector_length; d_nsamples = nsamples; // number of samples not including padding d_select_queue = select_queue; - - d_doppler_max = 0; + d_nsamples_total = nsamples_total; + d_doppler_max = doppler_max; d_doppler_step = 0; d_fd = 0; // driver descriptor d_map_base = nullptr; // driver memory map - - // compute all the possible code ffts - // Direct FFT d_fft_if = new gr::fft::fft_complex(vector_length, true); - // allocate memory to compute all the PRNs // and compute all the possible codes std::complex* code = new std::complex[nsamples_total]; // buffer for the local code - std::complex * code_total = new gr_complex[vector_length]; // buffer for the local code repeate every number of ms - - gr_complex* d_fft_codes_padded = static_cast(volk_gnsssdr_malloc(vector_length * sizeof(gr_complex), volk_gnsssdr_get_alignment())); - - d_all_fft_codes = new lv_16sc_t[vector_length * NUM_PRNs]; // memory containing all the possible fft codes for PRN 0 to 32 - + gr_complex* d_fft_codes_padded = static_cast(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_all_fft_codes = new lv_16sc_t[nsamples_total * NUM_PRNs]; // memory containing all the possible fft codes for PRN 0 to 32 float max; // temporary maxima search - - for (unsigned int PRN = 0; PRN < NUM_PRNs; PRN++) + for (unsigned int PRN = 1; PRN <= NUM_PRNs; PRN++) { gps_l1_ca_code_gen_complex_sampled(code, PRN, fs_in, 0); // generate PRN code - - for (unsigned int i = 0; i < sampled_ms; i++) + // fill in zero padding + for (int s=nsamples;sget_inbuf() + offset, code_total, sizeof(gr_complex) * vector_length); // copy to FFT buffer - + memcpy(d_fft_if->get_inbuf() + offset, code, sizeof(gr_complex) * nsamples_total); // copy to FFT buffer d_fft_if->execute(); // Run the FFT of local code - - volk_32fc_conjugate_32fc(d_fft_codes_padded, d_fft_if->get_outbuf(), vector_length); // conjugate values - + volk_32fc_conjugate_32fc(d_fft_codes_padded, d_fft_if->get_outbuf(), nsamples_total); // conjugate values max = 0; // initialize maximum value - - for (unsigned int i = 0; i < vector_length; i++) // search for maxima + for (unsigned int i = 0; i < nsamples_total; i++) // search for maxima { if (std::abs(d_fft_codes_padded[i].real()) > max) { @@ -149,35 +136,65 @@ gps_fpga_acquisition_8sc::gps_fpga_acquisition_8sc(std::string device_name, max = std::abs(d_fft_codes_padded[i].imag()); } } - - for (unsigned int i = 0; i < vector_length; i++) // map the FFT to the dynamic range of the fixed point values an copy to buffer containing all FFTs + for (unsigned int i = 0; i < nsamples_total; i++) // map the FFT to the dynamic range of the fixed point values an copy to buffer containing all FFTs { - d_all_fft_codes[i + vector_length * PRN] = lv_16sc_t(static_cast(d_fft_codes_padded[i].real() * (pow(2, 7) - 1) / max), + d_all_fft_codes[i + nsamples_total * (PRN -1)] = lv_16sc_t(static_cast(d_fft_codes_padded[i].real() * (pow(2, 7) - 1) / max), static_cast(d_fft_codes_padded[i].imag() * (pow(2, 7) - 1) / max)); + } - + } + // open communication with HW accelerator + //printf("opening device %s\n", d_device_name.c_str()); + if ((d_fd = open(d_device_name.c_str(), O_RDWR | O_SYNC)) == -1) + { + LOG(WARNING) << "Cannot open deviceio" << d_device_name; + //std::cout << "acquisition cannot open deviceio"; } - + d_map_base = reinterpret_cast(mmap(NULL, PAGE_SIZE, + PROT_READ | PROT_WRITE, MAP_SHARED, d_fd, 0)); + if (d_map_base == reinterpret_cast(-1)) + { + LOG(WARNING) << "Cannot map the FPGA acquisition module into user memory"; + //std::cout << "acquisition : could not map the fpga registers to the driver" << std::endl; + } + // sanity check : check test register + // we only nee to do this when the class is created + // but the device is not opened yet when the class is create + // because we need to open and close the device every time we run an acquisition + // since the same device may be used by more than one class (gps acquisition, galileo + // acquisition, etc ..) + unsigned writeval = TEST_REGISTER_ACQ_WRITEVAL; + unsigned readval; + readval = gps_fpga_acquisition_8sc::fpga_acquisition_test_register(writeval); + if (writeval != readval) + { + LOG(WARNING) << "Acquisition test register sanity check failed"; + //std:: cout << "Acquisition test register sanity check failed" << std::endl; + } + else + { + //std::cout << "Acquisition test register sanity check success !" << std::endl; + LOG(INFO) << "Acquisition test register sanity check success !"; + } + gps_fpga_acquisition_8sc::reset_acquisition(); + DLOG(INFO) << "Acquisition FPGA class created"; // temporary buffers that we can delete delete[] code; - delete[] code_total; delete d_fft_if; delete[] d_fft_codes_padded; } - gps_fpga_acquisition_8sc::~gps_fpga_acquisition_8sc() { + close_device(); delete[] d_all_fft_codes; } - bool gps_fpga_acquisition_8sc::free() { return true; } - unsigned gps_fpga_acquisition_8sc::fpga_acquisition_test_register(unsigned writeval) { unsigned readval; @@ -189,31 +206,31 @@ unsigned gps_fpga_acquisition_8sc::fpga_acquisition_test_register(unsigned write return readval; } - void gps_fpga_acquisition_8sc::fpga_configure_acquisition_local_code(lv_16sc_t fft_local_code[]) { - short int local_code; + unsigned short local_code; unsigned int k, tmp, tmp2; - + unsigned int fft_data; // clear memory address counter d_map_base[4] = 0x10000000; + // write local code for (k = 0; k < d_vector_length; k++) { tmp = fft_local_code[k].real(); tmp2 = fft_local_code[k].imag(); local_code = (tmp & 0xFF) | ((tmp2 * 256) & 0xFF00); // put together the real part and the imaginary part - d_map_base[4] = 0x0C000000 | (local_code & 0xFFFF); + fft_data = 0x0C000000 | (local_code & 0xFFFF); + d_map_base[4] = fft_data; } } - void gps_fpga_acquisition_8sc::run_acquisition(void) { // enable interrupts int reenable = 1; write(d_fd, reinterpret_cast(&reenable), sizeof(int)); - - d_map_base[5] = 0; // writing anything to reg 4 launches the acquisition process + // launch the acquisition process + d_map_base[6] = 1; // writing anything to reg 6 launches the acquisition process int irq_count; ssize_t nb; @@ -221,26 +238,24 @@ void gps_fpga_acquisition_8sc::run_acquisition(void) nb = read(d_fd, &irq_count, sizeof(irq_count)); if (nb != sizeof(irq_count)) { - printf("Tracking_module Read failed to retrieve 4 bytes!\n"); - printf("Tracking_module Interrupt number %d\n", irq_count); + printf("acquisition module Read failed to retrieve 4 bytes!\n"); + printf("acquisition module Interrupt number %d\n", irq_count); } } - void gps_fpga_acquisition_8sc::configure_acquisition() { d_map_base[0] = d_select_queue; d_map_base[1] = d_vector_length; d_map_base[2] = d_nsamples; + d_map_base[5] = (int) log2((float) d_vector_length); // log2 FFTlength } - void gps_fpga_acquisition_8sc::set_phase_step(unsigned int doppler_index) { float phase_step_rad_real; float phase_step_rad_int_temp; int32_t phase_step_rad_int; - int doppler = static_cast(-d_doppler_max) + d_doppler_step * doppler_index; float phase_step_rad = GPS_TWO_PI * (d_freq + doppler) / static_cast(d_fs_in); // The doppler step can never be outside the range -pi to +pi, otherwise there would be aliasing @@ -250,22 +265,19 @@ void gps_fpga_acquisition_8sc::set_phase_step(unsigned int doppler_index) phase_step_rad_real = phase_step_rad / (GPS_TWO_PI / 2); // avoid saturation of the fixed point representation in the fpga // (only the positive value can saturate due to the 2's complement representation) - if (phase_step_rad_real == 1.0) + if (phase_step_rad_real >= 1.0) { phase_step_rad_real = MAX_PHASE_STEP_RAD; } phase_step_rad_int_temp = phase_step_rad_real * 4; // * 2^2 phase_step_rad_int = (int32_t) (phase_step_rad_int_temp * (536870912)); // * 2^29 (in total it makes x2^31 in two steps to avoid the warnings - d_map_base[3] = phase_step_rad_int; } - void gps_fpga_acquisition_8sc::read_acquisition_results(uint32_t* max_index, float* max_magnitude, unsigned *initial_sample, float *power_sum) { unsigned readval = 0; - readval = d_map_base[0]; readval = d_map_base[1]; *initial_sample = readval; readval = d_map_base[2]; @@ -276,7 +288,6 @@ void gps_fpga_acquisition_8sc::read_acquisition_results(uint32_t* max_index, *max_index = readval; } - void gps_fpga_acquisition_8sc::block_samples() { d_map_base[14] = 1; // block the samples @@ -288,44 +299,6 @@ void gps_fpga_acquisition_8sc::unblock_samples() d_map_base[14] = 0; // unblock the samples } - -void gps_fpga_acquisition_8sc::open_device() -{ - - if ((d_fd = open(d_device_name.c_str(), O_RDWR | O_SYNC)) == -1) - { - LOG(WARNING) << "Cannot open deviceio" << d_device_name; - } - - d_map_base = reinterpret_cast(mmap(NULL, PAGE_SIZE, - PROT_READ | PROT_WRITE, MAP_SHARED, d_fd, 0)); - - if (d_map_base == reinterpret_cast(-1)) - { - LOG(WARNING) << "Cannot map the FPGA acquisition module into user memory"; - } - - // sanity check : check test register - // we only nee to do this when the class is created - // but the device is not opened yet when the class is create - // because we need to open and close the device every time we run an acquisition - // since the same device may be used by more than one class (gps acquisition, galileo - // acquisition, etc ..) - unsigned writeval = TEST_REGISTER_ACQ_WRITEVAL; - unsigned readval; - readval = gps_fpga_acquisition_8sc::fpga_acquisition_test_register(writeval); - - if (writeval != readval) - { - LOG(WARNING) << "Acquisition test register sanity check failed"; - } - else - { - LOG(INFO) << "Acquisition test register sanity check success !"; - } -} - - void gps_fpga_acquisition_8sc::close_device() { unsigned * aux = const_cast(d_map_base); @@ -336,3 +309,7 @@ void gps_fpga_acquisition_8sc::close_device() close(d_fd); } +void gps_fpga_acquisition_8sc::reset_acquisition(void) +{ + d_map_base[6] = 2; // writing a 2 to d_map_base[6] resets the multicorrelator +} diff --git a/src/algorithms/acquisition/libs/gps_fpga_acquisition_8sc.h b/src/algorithms/acquisition/libs/gps_fpga_acquisition_8sc.h index 4f48af3bc..609abf0d9 100644 --- a/src/algorithms/acquisition/libs/gps_fpga_acquisition_8sc.h +++ b/src/algorithms/acquisition/libs/gps_fpga_acquisition_8sc.h @@ -2,7 +2,7 @@ * \file fpga_acquisition_8sc.h * \brief High optimized FPGA vector correlator class for lv_16sc_t (short int complex). * \authors
    - *
  • Marc Majoral, 2017. mmajoral(at)cttc.cat + *
  • Marc Majoral, 2017. mmajoral(at)cttc.cat *
* * Class that controls and executes a high optimized vector correlator @@ -33,11 +33,10 @@ * ------------------------------------------------------------------------- */ -#ifndef GNSS_SDR_FPGA_ACQUISITION_8SC_H_ -#define GNSS_SDR_FPGA_ACQUISITION_8SC_H_ +#ifndef GNSS_GPS_SDR_FPGA_ACQUISITION_8SC_H_ +#define GNSS_GPS_SDR_FPGA_ACQUISITION_8SC_H_ #include - #include #include @@ -49,6 +48,7 @@ class gps_fpga_acquisition_8sc public: gps_fpga_acquisition_8sc(std::string device_name, unsigned int vector_length, unsigned int nsamples, + unsigned int doppler_max, unsigned int nsamples_total, long fs_in, long freq, unsigned int sampled_ms, unsigned select_queue); ~gps_fpga_acquisition_8sc();bool init();bool set_local_code( @@ -60,9 +60,7 @@ public: unsigned *initial_sample, float *power_sum); void block_samples(); void unblock_samples(); - void open_device(); - void close_device(); - + //void open_device(); /*! * \brief Set maximum Doppler grid search * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz]. @@ -71,7 +69,6 @@ public: { d_doppler_max = doppler_max; } - /*! * \brief Set Doppler steps for the grid search * \param doppler_step - Frequency bin of the search grid [Hz]. @@ -86,23 +83,23 @@ private: long d_freq; long d_fs_in; gr::fft::fft_complex* d_fft_if; // function used to run the fft of the local codes - // data related to the hardware module and the driver int d_fd; // driver descriptor volatile unsigned *d_map_base; // driver memory map lv_16sc_t *d_all_fft_codes; // memory that contains all the code ffts unsigned int d_vector_length; // number of samples incluing padding and number of ms + unsigned int d_nsamples_total; // number of samples including padding unsigned int d_nsamples; // number of samples not including padding unsigned int d_select_queue; // queue selection std::string d_device_name; // HW device name unsigned int d_doppler_max; // max doppler unsigned int d_doppler_step; // doppler step - // FPGA private functions unsigned fpga_acquisition_test_register(unsigned writeval); void fpga_configure_acquisition_local_code(lv_16sc_t fft_local_code[]); void configure_acquisition(); - + void reset_acquisition(void); + void close_device(); }; -#endif /* GNSS_SDR_FPGA_MULTICORRELATOR_H_ */ +#endif /* GNSS_GPS_SDR_FPGA_MULTICORRELATOR_H_ */ From c2fc4b9854536962ae7027106f59b766d43a72b3 Mon Sep 17 00:00:00 2001 From: Javier Arribas Date: Fri, 2 Mar 2018 17:40:13 +0100 Subject: [PATCH 03/82] Updating GPS L1 FPGA tracking adapters --- .../tracking/adapters/CMakeLists.txt | 2 +- .../gps_l1_ca_dll_pll_c_aid_tracking_fpga.cc | 228 ----- .../gps_l1_ca_dll_pll_tracking_fpga.cc | 155 +++ ...ga.h => gps_l1_ca_dll_pll_tracking_fpga.h} | 38 +- .../tracking/gnuradio_blocks/CMakeLists.txt | 2 +- ...ps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.cc | 947 ------------------ ...gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.h | 185 ---- .../gps_l1_ca_dll_pll_tracking_fpga_sc.cc | 586 +++++++++++ .../gps_l1_ca_dll_pll_tracking_fpga_sc.h | 200 ++++ src/algorithms/tracking/libs/CMakeLists.txt | 2 + .../tracking/libs/fpga_multicorrelator_8sc.cc | 126 ++- .../tracking/libs/fpga_multicorrelator_8sc.h | 41 +- .../fpga_multicorrelator_real_codes_8sc.cc | 148 +++ .../fpga_multicorrelator_real_codes_8sc.h | 73 ++ src/core/receiver/gnss_block_factory.cc | 10 +- .../gps_l1_ca_dll_pll_tracking_test_fpga.cc | 11 +- 16 files changed, 1304 insertions(+), 1450 deletions(-) delete mode 100644 src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking_fpga.cc create mode 100644 src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.cc rename src/algorithms/tracking/adapters/{gps_l1_ca_dll_pll_c_aid_tracking_fpga.h => gps_l1_ca_dll_pll_tracking_fpga.h} (72%) delete mode 100644 src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.cc delete mode 100644 src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.h create mode 100644 src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.cc create mode 100644 src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.h create mode 100644 src/algorithms/tracking/libs/fpga_multicorrelator_real_codes_8sc.cc create mode 100644 src/algorithms/tracking/libs/fpga_multicorrelator_real_codes_8sc.h diff --git a/src/algorithms/tracking/adapters/CMakeLists.txt b/src/algorithms/tracking/adapters/CMakeLists.txt index 437626d06..98fcfc99e 100644 --- a/src/algorithms/tracking/adapters/CMakeLists.txt +++ b/src/algorithms/tracking/adapters/CMakeLists.txt @@ -22,7 +22,7 @@ if(ENABLE_CUDA) endif(ENABLE_CUDA) if(ENABLE_FPGA) - SET(OPT_TRACKING_ADAPTERS ${OPT_TRACKING_ADAPTERS} gps_l1_ca_dll_pll_c_aid_tracking_fpga.cc) + SET(OPT_TRACKING_ADAPTERS ${OPT_TRACKING_ADAPTERS} gps_l1_ca_dll_pll_tracking_fpga.cc) endif(ENABLE_FPGA) set(TRACKING_ADAPTER_SOURCES diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking_fpga.cc b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking_fpga.cc deleted file mode 100644 index 36d53d086..000000000 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking_fpga.cc +++ /dev/null @@ -1,228 +0,0 @@ -/*! - * \file gps_l1_ca_dll_pll_c_aid_tracking_fpga.cc - * \brief Implementation of an adapter of a DLL+PLL tracking loop block - * for GPS L1 C/A to a TrackingInterface - * \author Marc Majoral, 2017. mmajoral(at)cttc.cat - * Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com - * Javier Arribas, 2011. jarribas(at)cttc.es - * - * Code DLL + carrier PLL according to the algorithms described in: - * K.Borre, D.M.Akos, N.Bertelsen, P.Rinder, and S.H.Jensen, - * A Software-Defined GPS and Galileo Receiver. A Single-Frequency - * Approach, Birkhauser, 2007 - * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * GNSS-SDR is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GNSS-SDR is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNSS-SDR. If not, see . - * - * ------------------------------------------------------------------------- - */ - -#include "gps_l1_ca_dll_pll_c_aid_tracking_fpga.h" -#include -#include "GPS_L1_CA.h" -#include "configuration_interface.h" -#include "gnss_sdr_flags.h" - - -using google::LogMessage; - -GpsL1CaDllPllCAidTrackingFpga::GpsL1CaDllPllCAidTrackingFpga( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - role_(role), in_streams_(in_streams), out_streams_(out_streams) -{ - DLOG(INFO) << "role " << role; - //################# CONFIGURATION PARAMETERS ######################## - int fs_in; - int vector_length; - int f_if; - bool dump; - std::string dump_filename; - std::string default_item_type = "cshort"; - float pll_bw_hz; - float pll_bw_narrow_hz; - float dll_bw_hz; - float dll_bw_narrow_hz; - float early_late_space_chips; - std::string device_name; - unsigned int device_base; - - item_type_ = configuration->property(role + ".item_type", default_item_type); - int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); - fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); - f_if = configuration->property(role + ".if", 0); - dump = configuration->property(role + ".dump", false); - pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0); - if(FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); - dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); - if(FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast(FLAGS_dll_bw_hz); - pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz", 20.0); - dll_bw_narrow_hz = configuration->property(role + ".dll_bw_narrow_hz", 2.0); - int extend_correlation_ms; - extend_correlation_ms = configuration->property(role + ".extend_correlation_ms", 1); - - early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); - std::string default_dump_filename = "./track_ch"; - dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); - std::string default_device_name = "/dev/uio"; - device_name = configuration->property(role + ".devicename", default_device_name); - device_base = configuration->property(role + ".device_base", 1); - vector_length = std::round(fs_in / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); - - //################# MAKE TRACKING GNURadio object ################### - - if (item_type_.compare("cshort") == 0) - { - item_size_ = sizeof(lv_16sc_t); - tracking_fpga_sc = gps_l1_ca_dll_pll_c_aid_make_tracking_fpga_sc( - f_if, fs_in, vector_length, dump, dump_filename, pll_bw_hz, - dll_bw_hz, pll_bw_narrow_hz, dll_bw_narrow_hz, - extend_correlation_ms, early_late_space_chips, device_name, - device_base); - DLOG(INFO) << "tracking(" << tracking_fpga_sc->unique_id() << ")"; - } - else - { - - item_size_ = sizeof(lv_16sc_t); - // LOG(WARNING) << item_type_ << " unknown tracking item type"; - LOG(WARNING) << item_type_ - << " the tracking item type for the FPGA tracking test has to be cshort"; - } - - channel_ = 0; -} - - -GpsL1CaDllPllCAidTrackingFpga::~GpsL1CaDllPllCAidTrackingFpga() -{ - LOG(INFO) << "gspl1cadllpllcaidtrackingfpga destructor called"; -} - - -void GpsL1CaDllPllCAidTrackingFpga::start_tracking() -{ - if (item_type_.compare("cshort") == 0) - { - tracking_fpga_sc->start_tracking(); - } - else - { - // LOG(WARNING) << item_type_ << " unknown tracking item type"; - LOG(WARNING) << item_type_ - << " the tracking item type for the FPGA tracking test has to be cshort"; - } -} - - -/* - * Set tracking channel unique ID - */ -void GpsL1CaDllPllCAidTrackingFpga::set_channel(unsigned int channel) -{ - channel_ = channel; - - if (item_type_.compare("cshort") == 0) - { - tracking_fpga_sc->set_channel(channel); - } - else - { - // LOG(WARNING) << item_type_ << " unknown tracking item type"; - LOG(WARNING) << item_type_ - << " the tracking item type for the FPGA tracking test has to be cshort"; - } -} - - -void GpsL1CaDllPllCAidTrackingFpga::set_gnss_synchro( - Gnss_Synchro* p_gnss_synchro) -{ - if (item_type_.compare("cshort") == 0) - { - tracking_fpga_sc->set_gnss_synchro(p_gnss_synchro); - } - else - { - // LOG(WARNING) << item_type_ << " unknown tracking item type"; - LOG(WARNING) << item_type_ - << " the tracking item type for the FPGA tracking test has to be cshort"; - } -} - - -void GpsL1CaDllPllCAidTrackingFpga::connect(gr::top_block_sptr top_block) -{ - if (top_block) - { /* top_block is not null */ - }; - //nothing to connect, now the tracking uses gr_sync_decimator -} - - -void GpsL1CaDllPllCAidTrackingFpga::disconnect(gr::top_block_sptr top_block) -{ - if (top_block) - { /* top_block is not null */ - }; - //nothing to disconnect, now the tracking uses gr_sync_decimator -} - - -// CONVERT TO SOURCE -gr::basic_block_sptr GpsL1CaDllPllCAidTrackingFpga::get_left_block() -{ - if (item_type_.compare("cshort") == 0) - { - return tracking_fpga_sc; - } - else - { - //LOG(WARNING) << item_type_ << " unknown tracking item type"; - LOG(WARNING) << item_type_ - << " the tracking item type for the FPGA tracking test has to be cshort"; - return nullptr; - } -} - - -gr::basic_block_sptr GpsL1CaDllPllCAidTrackingFpga::get_right_block() -{ - if (item_type_.compare("cshort") == 0) - { - return tracking_fpga_sc; - } - else - { - //LOG(WARNING) << item_type_ << " unknown tracking item type"; - LOG(WARNING) << item_type_ - << " the tracking item type for the FPGA tracking test has to be cshort"; - return nullptr; - } -} - - -void GpsL1CaDllPllCAidTrackingFpga::reset(void) -{ - tracking_fpga_sc->reset(); -} - diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.cc b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.cc new file mode 100644 index 000000000..336e93eb8 --- /dev/null +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.cc @@ -0,0 +1,155 @@ +/*! + * \file gps_l1_ca_dll_pll_tracking.cc + * \brief Implementation of an adapter of a DLL+PLL tracking loop block + * for GPS L1 C/A to a TrackingInterface + * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com + * Javier Arribas, 2011. jarribas(at)cttc.es + * + * Code DLL + carrier PLL according to the algorithms described in: + * K.Borre, D.M.Akos, N.Bertelsen, P.Rinder, and S.H.Jensen, + * A Software-Defined GPS and Galileo Receiver. A Single-Frequency + * Approach, Birkhauser, 2007 + * + * ------------------------------------------------------------------------- + * + * Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors) + * + * GNSS-SDR is a software defined Global Navigation + * Satellite Systems receiver + * + * This file is part of GNSS-SDR. + * + * GNSS-SDR is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GNSS-SDR is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNSS-SDR. If not, see . + * + * ------------------------------------------------------------------------- + */ + + +#include "gps_l1_ca_dll_pll_tracking_fpga.h" +#include +#include "GPS_L1_CA.h" +#include "configuration_interface.h" + + +using google::LogMessage; + +GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga( + ConfigurationInterface* configuration, std::string role, + unsigned int in_streams, unsigned int out_streams) : + role_(role), in_streams_(in_streams), out_streams_(out_streams) +{ + DLOG(INFO) << "role " << role; + //################# CONFIGURATION PARAMETERS ######################## + int fs_in; + int vector_length; + int f_if; + bool dump; + std::string dump_filename; + std::string item_type; + //std::string default_item_type = "gr_complex"; + std::string default_item_type = "cshort"; + float pll_bw_hz; + float dll_bw_hz; + float early_late_space_chips; + item_type = configuration->property(role + ".item_type", default_item_type); + int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); + std::string device_name; + unsigned int device_base; + std::string default_device_name = "/dev/uio"; + device_name = configuration->property(role + ".devicename", default_device_name); + device_base = configuration->property(role + ".device_base", 1); + fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); + f_if = configuration->property(role + ".if", 0); + dump = configuration->property(role + ".dump", false); + pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0); + dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); + early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); + std::string default_dump_filename = "./track_ch"; + dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); //unused! + vector_length = std::round(fs_in / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); + if (item_type.compare("cshort") == 0) + { + item_size_ = sizeof(lv_16sc_t); + tracking_fpga_sc = gps_l1_ca_dll_pll_make_tracking_fpga_sc( + f_if, fs_in, vector_length, dump, dump_filename, pll_bw_hz, + dll_bw_hz, early_late_space_chips, device_name, + device_base); + DLOG(INFO) << "tracking(" << tracking_fpga_sc->unique_id() + << ")"; + } + else + { + + item_size_ = sizeof(lv_16sc_t); + // LOG(WARNING) << item_type_ << " unknown tracking item type"; + LOG(WARNING) << item_type + << " the tracking item type for the FPGA tracking test has to be cshort"; + } + channel_ = 0; + DLOG(INFO) << "tracking(" << tracking_fpga_sc->unique_id() << ")"; +} + +GpsL1CaDllPllTrackingFpga::~GpsL1CaDllPllTrackingFpga() +{} + +void GpsL1CaDllPllTrackingFpga::start_tracking() +{ + tracking_fpga_sc->start_tracking(); +} + +/* + * Set tracking channel unique ID + */ +void GpsL1CaDllPllTrackingFpga::set_channel(unsigned int channel) +{ + channel_ = channel; + tracking_fpga_sc->set_channel(channel); +} + +void GpsL1CaDllPllTrackingFpga::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) +{ + tracking_fpga_sc->set_gnss_synchro(p_gnss_synchro); +} + +void GpsL1CaDllPllTrackingFpga::connect(gr::top_block_sptr top_block) +{ + if(top_block) { /* top_block is not null */}; + //nothing to connect, now the tracking uses gr_sync_decimator +} + + +void GpsL1CaDllPllTrackingFpga::disconnect(gr::top_block_sptr top_block) +{ + if(top_block) { /* top_block is not null */}; + //nothing to disconnect, now the tracking uses gr_sync_decimator +} + + +gr::basic_block_sptr GpsL1CaDllPllTrackingFpga::get_left_block() +{ + return tracking_fpga_sc; +} + + +gr::basic_block_sptr GpsL1CaDllPllTrackingFpga::get_right_block() +{ + return tracking_fpga_sc; +} + + +void GpsL1CaDllPllTrackingFpga::reset(void) +{ + // tracking_fpga_sc->reset(); + +} diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking_fpga.h b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.h similarity index 72% rename from src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking_fpga.h rename to src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.h index c828f9c3d..f45e3f802 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking_fpga.h +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.h @@ -1,9 +1,8 @@ /*! - * \file gps_l1_ca_dll_pll_c_aid_tracking_fpga.h + * \file gps_l1_ca_dll_pll_tracking.h * \brief Interface of an adapter of a DLL+PLL tracking loop block * for GPS L1 C/A to a TrackingInterface - * \author Marc Majoral, 2017. mmajoral(at)cttc.cat - * Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com + * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * Javier Arribas, 2011. jarribas(at)cttc.es * * Code DLL + carrier PLL according to the algorithms described in: @@ -13,7 +12,7 @@ * * ------------------------------------------------------------------------- * - * Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors) + * Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors) * * GNSS-SDR is a software defined Global Navigation * Satellite Systems receiver @@ -36,36 +35,38 @@ * ------------------------------------------------------------------------- */ -#ifndef GNSS_SDR_GPS_L1_CA_DLL_PLL_C_AID_TRACKING_FPGA__H_ -#define GNSS_SDR_GPS_L1_CA_DLL_PLL_C_AID_TRACKING_FPGA__H_ +#ifndef GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_FPGA_H_ +#define GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_FPGA_H_ #include #include "tracking_interface.h" -#include "gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.h" +#include "gps_l1_ca_dll_pll_tracking_fpga_sc.h" + class ConfigurationInterface; /*! * \brief This class implements a code DLL + carrier PLL tracking loop */ -class GpsL1CaDllPllCAidTrackingFpga : public TrackingInterface +class GpsL1CaDllPllTrackingFpga : public TrackingInterface { public: - GpsL1CaDllPllCAidTrackingFpga(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, + GpsL1CaDllPllTrackingFpga(ConfigurationInterface* configuration, + std::string role, + unsigned int in_streams, unsigned int out_streams); - virtual ~GpsL1CaDllPllCAidTrackingFpga(); + virtual ~GpsL1CaDllPllTrackingFpga(); inline std::string role() override { return role_; } - //! Returns "GPS_L1_CA_DLL_PLL_C_Aid_Tracking_Fpga" + //! Returns "GPS_L1_CA_DLL_PLL_Tracking_Fpga" inline std::string implementation() override { - return "GPS_L1_CA_DLL_PLL_C_Aid_Tracking_Fpga"; + return "GPS_L1_CA_DLL_PLL_Tracking_Fpga"; } inline size_t item_size() override @@ -75,7 +76,6 @@ public: void connect(gr::top_block_sptr top_block) override; void disconnect(gr::top_block_sptr top_block) override; - // CONVERT TO SOURCE gr::basic_block_sptr get_left_block() override; gr::basic_block_sptr get_right_block() override; @@ -92,16 +92,16 @@ public: void start_tracking() override; - void reset(void); - + void reset(void); + private: - gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc_sptr tracking_fpga_sc; + //gps_l1_ca_dll_pll_tracking_cc_sptr tracking_; + gps_l1_ca_dll_pll_tracking_fpga_sc_sptr tracking_fpga_sc; size_t item_size_; - std::string item_type_; unsigned int channel_; std::string role_; unsigned int in_streams_; unsigned int out_streams_; }; -#endif // GNSS_SDR_GPS_L1_CA_DLL_PLL_C_AID_TRACKING_FPGA__H_ +#endif // GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_FPGA_H_ diff --git a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt index 4c4a2a550..b764548ef 100644 --- a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt @@ -23,7 +23,7 @@ if(ENABLE_CUDA) endif(ENABLE_CUDA) if(ENABLE_FPGA) - set(OPT_TRACKING_BLOCKS ${OPT_TRACKING_BLOCKS} gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.cc) + set(OPT_TRACKING_BLOCKS ${OPT_TRACKING_BLOCKS} gps_l1_ca_dll_pll_tracking_fpga_sc.cc) endif(ENABLE_FPGA) set(TRACKING_GR_BLOCKS_SOURCES diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.cc deleted file mode 100644 index a8e0d0428..000000000 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.cc +++ /dev/null @@ -1,947 +0,0 @@ -/*! - * \file gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.cc - * \brief Implementation of a code DLL + carrier PLL tracking block - * \author Marc Majoral, 2017. mmajoral(at)cttc.cat - * Javier Arribas, 2015. jarribas(at)cttc.es - * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * GNSS-SDR is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GNSS-SDR is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNSS-SDR. If not, see . - * - * ------------------------------------------------------------------------- - */ - -#include "gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.h" -#include "gnss_synchro.h" -#include "gps_sdr_signal_processing.h" -#include "tracking_discriminators.h" -#include "lock_detectors.h" -#include "GPS_L1_CA.h" -#include "gnss_sdr_flags.h" -#include "control_message_factory.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -using google::LogMessage; - -gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc_sptr gps_l1_ca_dll_pll_c_aid_make_tracking_fpga_sc( - long if_freq, long fs_in, unsigned int vector_length, bool dump, - std::string dump_filename, float pll_bw_hz, float dll_bw_hz, - float pll_bw_narrow_hz, float dll_bw_narrow_hz, - int extend_correlation_ms, float early_late_space_chips, - std::string device_name, unsigned int device_base) -{ - return gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc_sptr( - new gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc(if_freq, fs_in, - vector_length, dump, dump_filename, pll_bw_hz, dll_bw_hz, - pll_bw_narrow_hz, dll_bw_narrow_hz, extend_correlation_ms, - early_late_space_chips, device_name, device_base)); -} - - -void gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::msg_handler_preamble_index( - pmt::pmt_t msg) -{ - DLOG(INFO) << "Extended correlation enabled for Tracking CH " - << d_channel << ": Satellite " - << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN); - if (d_enable_extended_integration == false) //avoid re-setting preamble indicator - { - d_preamble_timestamp_s = pmt::to_double(msg); - d_enable_extended_integration = true; - d_preamble_synchronized = false; - } -} - - -gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc( - long if_freq, long fs_in, unsigned int vector_length, bool dump, - std::string dump_filename, float pll_bw_hz, float dll_bw_hz, - float pll_bw_narrow_hz, float dll_bw_narrow_hz, - int extend_correlation_ms, float early_late_space_chips, - std::string device_name, unsigned int device_base) : - gr::block("gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc", - gr::io_signature::make(0, 0, sizeof(lv_16sc_t)), - gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) - -{ - // Telemetry bit synchronization message port input - this->message_port_register_in(pmt::mp("preamble_timestamp_s")); - this->set_msg_handler(pmt::mp("preamble_timestamp_s"), - boost::bind( - &gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::msg_handler_preamble_index, - this, _1)); - this->message_port_register_out(pmt::mp("events")); - // initialize internal vars - d_dump = dump; - d_if_freq = if_freq; - d_fs_in = fs_in; - d_vector_length = vector_length; - d_dump_filename = dump_filename; - d_correlation_length_samples = static_cast(d_vector_length); - - // Initialize tracking ========================================== - d_pll_bw_hz = pll_bw_hz; - d_dll_bw_hz = dll_bw_hz; - d_pll_bw_narrow_hz = pll_bw_narrow_hz; - d_dll_bw_narrow_hz = dll_bw_narrow_hz; - d_code_loop_filter.set_DLL_BW(d_dll_bw_hz); - d_carrier_loop_filter.set_params(10.0, d_pll_bw_hz, 2); - d_extend_correlation_ms = extend_correlation_ms; - - // --- DLL variables -------------------------------------------------------- - d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips) - - // Initialization of local code replica - // Get space for a vector with the C/A code replica sampled 1x/chip - d_ca_code = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(gr_complex), volk_gnsssdr_get_alignment())); - d_ca_code_16sc = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(lv_16sc_t), volk_gnsssdr_get_alignment())); - - // correlator outputs (scalar) - d_n_correlator_taps = 3; // Early, Prompt, and Late - - d_correlator_outs_16sc = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(lv_16sc_t), - volk_gnsssdr_get_alignment())); - - for (int n = 0; n < d_n_correlator_taps; n++) - { - d_correlator_outs_16sc[n] = lv_cmake(0, 0); - } - - d_local_code_shift_chips = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(float), volk_gnsssdr_get_alignment())); - - // Set TAPs delay values [chips] - d_local_code_shift_chips[0] = -d_early_late_spc_chips; - d_local_code_shift_chips[1] = 0.0; - d_local_code_shift_chips[2] = d_early_late_spc_chips; - - // create multicorrelator class - multicorrelator_fpga_8sc = std::make_shared (d_n_correlator_taps, device_name, device_base); - - //--- Perform initializations ------------------------------ - // define initial code frequency basis of NCO - d_code_freq_chips = GPS_L1_CA_CODE_RATE_HZ; - // define residual code phase (in chips) - d_rem_code_phase_samples = 0.0; - // define residual carrier phase - d_rem_carrier_phase_rad = 0.0; - - // sample synchronization - d_sample_counter = 0; //(from trk to tlm) - d_acq_sample_stamp = 0; - d_enable_tracking = false; - d_pull_in = false; - - // CN0 estimation and lock detector buffers - d_cn0_estimation_counter = 0; - d_Prompt_buffer = new gr_complex[FLAGS_cn0_samples]; - d_carrier_lock_test = 1; - d_CN0_SNV_dB_Hz = 0; - d_carrier_lock_fail_counter = 0; - d_carrier_lock_threshold = FLAGS_carrier_lock_th; - - systemName["G"] = std::string("GPS"); - systemName["S"] = std::string("SBAS"); - - set_relative_rate(1.0 / static_cast(d_vector_length)); - - d_acquisition_gnss_synchro = 0; - d_channel = 0; - d_acq_code_phase_samples = 0.0; - d_acq_carrier_doppler_hz = 0.0; - d_carrier_doppler_hz = 0.0; - d_acc_carrier_phase_cycles = 0.0; - d_code_phase_samples = 0.0; - d_enable_extended_integration = false; - d_preamble_synchronized = false; - d_rem_code_phase_integer_samples = 0; - d_code_error_chips_Ti = 0.0; - d_pll_to_dll_assist_secs_Ti = 0.0; - d_rem_code_phase_chips = 0.0; - d_code_phase_step_chips = 0.0; - d_carrier_phase_step_rad = 0.0; - d_code_error_filt_chips_s = 0.0; - d_code_error_filt_chips_Ti = 0.0; - d_preamble_timestamp_s = 0.0; - d_carr_phase_error_secs_Ti = 0.0; - //set_min_output_buffer((long int)300); -} - - -void gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::start_tracking() -{ - /* - * correct the code phase according to the delay between acq and trk - */ - d_acq_code_phase_samples = d_acquisition_gnss_synchro->Acq_delay_samples; - d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz; - d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples; - - long int acq_trk_diff_samples; - double acq_trk_diff_seconds; - acq_trk_diff_samples = static_cast(d_sample_counter) - static_cast(d_acq_sample_stamp); - DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples; - acq_trk_diff_seconds = static_cast(acq_trk_diff_samples) / static_cast(d_fs_in); - // Doppler effect - // Fd=(C/(C+Vr))*F - double radial_velocity = (GPS_L1_FREQ_HZ + d_acq_carrier_doppler_hz) / GPS_L1_FREQ_HZ; - // new chip and prn sequence periods based on acq Doppler - double T_chip_mod_seconds; - double T_prn_mod_seconds; - double T_prn_mod_samples; - d_code_freq_chips = radial_velocity * GPS_L1_CA_CODE_RATE_HZ; - d_code_phase_step_chips = static_cast(d_code_freq_chips) / static_cast(d_fs_in); - T_chip_mod_seconds = 1.0 / d_code_freq_chips; - T_prn_mod_seconds = T_chip_mod_seconds * GPS_L1_CA_CODE_LENGTH_CHIPS; - T_prn_mod_samples = T_prn_mod_seconds * static_cast(d_fs_in); - - d_correlation_length_samples = round(T_prn_mod_samples); - - double T_prn_true_seconds = GPS_L1_CA_CODE_LENGTH_CHIPS / GPS_L1_CA_CODE_RATE_HZ; - double T_prn_true_samples = T_prn_true_seconds * static_cast(d_fs_in); - double T_prn_diff_seconds = T_prn_true_seconds - T_prn_mod_seconds; - double N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds; - double corrected_acq_phase_samples, delay_correction_samples; - corrected_acq_phase_samples = fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast(d_fs_in)), T_prn_true_samples); - if (corrected_acq_phase_samples < 0) - { - corrected_acq_phase_samples = T_prn_mod_samples + corrected_acq_phase_samples; - } - delay_correction_samples = d_acq_code_phase_samples - corrected_acq_phase_samples; - - d_acq_code_phase_samples = corrected_acq_phase_samples; - - d_carrier_doppler_hz = d_acq_carrier_doppler_hz; - - d_carrier_phase_step_rad = GPS_TWO_PI * d_carrier_doppler_hz / static_cast(d_fs_in); - - // DLL/PLL filter initialization - d_carrier_loop_filter.initialize(d_acq_carrier_doppler_hz); // The carrier loop filter implements the Doppler accumulator - d_code_loop_filter.initialize(); // initialize the code filter - - // generate local reference ALWAYS starting at chip 1 (1 sample per chip) - gps_l1_ca_code_gen_complex(d_ca_code, d_acquisition_gnss_synchro->PRN, 0); - volk_gnsssdr_32fc_convert_16ic(d_ca_code_16sc, d_ca_code, static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS)); - - multicorrelator_fpga_8sc->set_local_code_and_taps(static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS), d_ca_code_16sc, d_local_code_shift_chips); - for (int n = 0; n < d_n_correlator_taps; n++) - { - d_correlator_outs_16sc[n] = lv_16sc_t(0, 0); - } - - d_carrier_lock_fail_counter = 0; - d_rem_code_phase_samples = 0.0; - d_rem_carrier_phase_rad = 0.0; - d_rem_code_phase_chips = 0.0; - d_acc_carrier_phase_cycles = 0.0; - d_pll_to_dll_assist_secs_Ti = 0.0; - d_code_phase_samples = d_acq_code_phase_samples; - - std::string sys_ = &d_acquisition_gnss_synchro->System; - sys = sys_.substr(0, 1); - - // DEBUG OUTPUT - std::cout << "Tracking start on channel " << d_channel << " for satellite " - << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) - << std::endl; - LOG(INFO) << "Starting tracking of satellite " - << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) - << " on channel " << d_channel; - - // enable tracking - d_pull_in = true; - d_enable_tracking = true; - d_enable_extended_integration = false; - d_preamble_synchronized = false; - - // lock the channel - multicorrelator_fpga_8sc->lock_channel(); - - LOG(INFO) << "PULL-IN Doppler [Hz]=" << d_carrier_doppler_hz - << " Code Phase correction [samples]=" << delay_correction_samples - << " PULL-IN Code Phase [samples]=" << d_acq_code_phase_samples; -} - - -gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::~gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc() -{ - if (d_dump_file.is_open()) - { - try - { - d_dump_file.close(); - } - catch(const std::exception & ex) - { - LOG(WARNING)<< "Exception in destructor " << ex.what(); - } - } - - if(d_dump) - { - if(d_channel == 0) - { - std::cout << "Writing .mat files ..."; - } - gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::save_matfile(); - if(d_channel == 0) - { - std::cout << " done." << std::endl; - } - } - - try - { - volk_gnsssdr_free(d_local_code_shift_chips); - volk_gnsssdr_free(d_ca_code); - volk_gnsssdr_free(d_ca_code_16sc); - volk_gnsssdr_free(d_correlator_outs_16sc); - delete[] d_Prompt_buffer; - multicorrelator_fpga_8sc->free(); - } - catch(const std::exception & ex) - { - LOG(WARNING) << "Exception in destructor " << ex.what(); - } -} - - -int gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::general_work( - int noutput_items __attribute__((unused)), - gr_vector_int &ninput_items __attribute__((unused)), - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - // samples offset - int samples_offset; - - // Block input data and block output stream pointers - Gnss_Synchro **out = reinterpret_cast(&output_items[0]); - - Gnss_Synchro current_synchro_data = Gnss_Synchro(); - - // process vars - double code_error_filt_secs_Ti = 0.0; - double CURRENT_INTEGRATION_TIME_S = 0.0; - double CORRECTED_INTEGRATION_TIME_S = 0.0; - - if (d_enable_tracking == true) - { - // Fill the acquisition data - current_synchro_data = *d_acquisition_gnss_synchro; - // Receiver signal alignment - if (d_pull_in == true) - { - double acq_trk_shif_correction_samples; - int acq_to_trk_delay_samples; - acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp; - acq_trk_shif_correction_samples = d_correlation_length_samples - fmod( static_cast(acq_to_trk_delay_samples), static_cast(d_correlation_length_samples)); - samples_offset = round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); - current_synchro_data.Tracking_sample_counter = d_sample_counter + samples_offset; - d_sample_counter += samples_offset; // count for the processed samples - d_pull_in = false; - d_acc_carrier_phase_cycles -= d_carrier_phase_step_rad * samples_offset / GPS_TWO_PI; - current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_cycles * GPS_TWO_PI; - current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; - current_synchro_data.fs = d_fs_in; - *out[0] = current_synchro_data; - //consume_each(samples_offset); // shift input to perform alignment with local replica - multicorrelator_fpga_8sc->set_initial_sample(samples_offset); - - return 1; - } - - // ################# CARRIER WIPEOFF AND CORRELATORS ############################## - // perform carrier wipe-off and compute Early, Prompt and Late correlation - multicorrelator_fpga_8sc->set_output_vectors(d_correlator_outs_16sc); - - multicorrelator_fpga_8sc->Carrier_wipeoff_multicorrelator_resampler( - d_rem_carrier_phase_rad, d_carrier_phase_step_rad, - d_rem_code_phase_chips, d_code_phase_step_chips, - d_correlation_length_samples); - - // ####### coherent intergration extension - // keep the last symbols - d_E_history.push_back(d_correlator_outs_16sc[0]); // save early output - d_P_history.push_back(d_correlator_outs_16sc[1]); // save prompt output - d_L_history.push_back(d_correlator_outs_16sc[2]); // save late output - - if (static_cast(d_P_history.size()) > d_extend_correlation_ms) - { - d_E_history.pop_front(); - d_P_history.pop_front(); - d_L_history.pop_front(); - } - - bool enable_dll_pll; - if (d_enable_extended_integration == true) - { - long int symbol_diff = round(1000.0 * ((static_cast(d_sample_counter) + d_rem_code_phase_samples) / static_cast(d_fs_in) - d_preamble_timestamp_s)); - if (symbol_diff > 0 and symbol_diff % d_extend_correlation_ms == 0) - { - // compute coherent integration and enable tracking loop - // perform coherent integration using correlator output history - // std::cout<<"##### RESET COHERENT INTEGRATION ####"<PRN) - << " pll_bw = " << d_pll_bw_hz - << " [Hz], pll_narrow_bw = " - << d_pll_bw_narrow_hz << " [Hz]" - << std::endl << " dll_bw = " - << d_dll_bw_hz - << " [Hz], dll_narrow_bw = " - << d_dll_bw_narrow_hz << " [Hz]" - << std::endl; - } - // UPDATE INTEGRATION TIME - CURRENT_INTEGRATION_TIME_S = static_cast(d_extend_correlation_ms) * GPS_L1_CA_CODE_PERIOD; - enable_dll_pll = true; - } - else - { - if (d_preamble_synchronized == true) - { - // continue extended coherent correlation - // Compute the next buffer length based on the period of the PRN sequence and the code phase error estimation - double T_chip_seconds = 1.0 / d_code_freq_chips; - double T_prn_seconds = T_chip_seconds * GPS_L1_CA_CODE_LENGTH_CHIPS; - double T_prn_samples = T_prn_seconds * static_cast(d_fs_in); - int K_prn_samples = round(T_prn_samples); - double K_T_prn_error_samples = K_prn_samples - T_prn_samples; - - d_rem_code_phase_samples = d_rem_code_phase_samples - K_T_prn_error_samples; - d_rem_code_phase_integer_samples = round(d_rem_code_phase_samples); // round to a discrete number of samples - d_correlation_length_samples = K_prn_samples + d_rem_code_phase_integer_samples; - d_rem_code_phase_samples = d_rem_code_phase_samples - d_rem_code_phase_integer_samples; - // code phase step (Code resampler phase increment per sample) [chips/sample] - d_code_phase_step_chips = d_code_freq_chips / static_cast(d_fs_in); - // remnant code phase [chips] - d_rem_code_phase_chips = d_rem_code_phase_samples * (d_code_freq_chips / static_cast(d_fs_in)); - d_rem_carrier_phase_rad = fmod(d_rem_carrier_phase_rad + d_carrier_phase_step_rad * static_cast(d_correlation_length_samples), GPS_TWO_PI); - - // UPDATE ACCUMULATED CARRIER PHASE - CORRECTED_INTEGRATION_TIME_S = (static_cast(d_correlation_length_samples) / static_cast(d_fs_in)); - d_acc_carrier_phase_cycles -= d_carrier_phase_step_rad * d_correlation_length_samples / GPS_TWO_PI; - - // disable tracking loop and inform telemetry decoder - enable_dll_pll = false; - } - else - { - // perform basic (1ms) correlation - // UPDATE INTEGRATION TIME - CURRENT_INTEGRATION_TIME_S = static_cast(d_correlation_length_samples) / static_cast(d_fs_in); - enable_dll_pll = true; - } - } - } - else - { - // UPDATE INTEGRATION TIME - CURRENT_INTEGRATION_TIME_S = static_cast(d_correlation_length_samples) / static_cast(d_fs_in); - enable_dll_pll = true; - } - - if (enable_dll_pll == true) - { - // ################## PLL ########################################################## - // Update PLL discriminator [rads/Ti -> Secs/Ti] - d_carr_phase_error_secs_Ti = pll_cloop_two_quadrant_atan(std::complex(d_correlator_outs_16sc[1].real(), d_correlator_outs_16sc[1].imag())) / GPS_TWO_PI; //prompt output - - // Carrier discriminator filter - // NOTICE: The carrier loop filter includes the Carrier Doppler accumulator, as described in Kaplan - // Input [s/Ti] -> output [Hz] - d_carrier_doppler_hz = d_carrier_loop_filter.get_carrier_error(0.0, d_carr_phase_error_secs_Ti, CURRENT_INTEGRATION_TIME_S); - // PLL to DLL assistance [Secs/Ti] - d_pll_to_dll_assist_secs_Ti = (d_carrier_doppler_hz * CURRENT_INTEGRATION_TIME_S) / GPS_L1_FREQ_HZ; - // code Doppler frequency update - d_code_freq_chips = GPS_L1_CA_CODE_RATE_HZ + ((d_carrier_doppler_hz * GPS_L1_CA_CODE_RATE_HZ) / GPS_L1_FREQ_HZ); - - // ################## DLL ########################################################## - // DLL discriminator - d_code_error_chips_Ti = dll_nc_e_minus_l_normalized( - std::complex( - d_correlator_outs_16sc[0].real(), - d_correlator_outs_16sc[0].imag()), - std::complex( - d_correlator_outs_16sc[2].real(), - d_correlator_outs_16sc[2].imag())); // [chips/Ti] //early and late - // Code discriminator filter - d_code_error_filt_chips_s = d_code_loop_filter.get_code_nco(d_code_error_chips_Ti); // input [chips/Ti] -> output [chips/second] - d_code_error_filt_chips_Ti = d_code_error_filt_chips_s * CURRENT_INTEGRATION_TIME_S; - code_error_filt_secs_Ti = d_code_error_filt_chips_Ti / d_code_freq_chips; // [s/Ti] - - // ################## CARRIER AND CODE NCO BUFFER ALIGNEMENT ####################### - // 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 - double T_chip_seconds = 1.0 / d_code_freq_chips; - double T_prn_seconds = T_chip_seconds * GPS_L1_CA_CODE_LENGTH_CHIPS; - double T_prn_samples = T_prn_seconds * static_cast(d_fs_in); - double K_prn_samples = round(T_prn_samples); - double K_T_prn_error_samples = K_prn_samples - T_prn_samples; - - d_rem_code_phase_samples = d_rem_code_phase_samples - K_T_prn_error_samples + code_error_filt_secs_Ti * static_cast(d_fs_in); //(code_error_filt_secs_Ti + d_pll_to_dll_assist_secs_Ti) * static_cast(d_fs_in); - d_rem_code_phase_integer_samples = round(d_rem_code_phase_samples); // round to a discrete number of samples - d_correlation_length_samples = K_prn_samples+ d_rem_code_phase_integer_samples; - d_rem_code_phase_samples = d_rem_code_phase_samples - d_rem_code_phase_integer_samples; - - //################### PLL COMMANDS ################################################# - //carrier phase step (NCO phase increment per sample) [rads/sample] - d_carrier_phase_step_rad = GPS_TWO_PI * d_carrier_doppler_hz / static_cast(d_fs_in); - d_acc_carrier_phase_cycles -= d_carrier_phase_step_rad * d_correlation_length_samples / GPS_TWO_PI; - // UPDATE ACCUMULATED CARRIER PHASE - CORRECTED_INTEGRATION_TIME_S = (static_cast(d_correlation_length_samples) / static_cast(d_fs_in)); - //remnant carrier phase [rad] - d_rem_carrier_phase_rad = fmod(d_rem_carrier_phase_rad + GPS_TWO_PI * d_carrier_doppler_hz * CORRECTED_INTEGRATION_TIME_S, GPS_TWO_PI); - - //################### DLL COMMANDS ################################################# - //code phase step (Code resampler phase increment per sample) [chips/sample] - d_code_phase_step_chips = d_code_freq_chips / static_cast(d_fs_in); - //remnant code phase [chips] - d_rem_code_phase_chips = d_rem_code_phase_samples * (d_code_freq_chips / static_cast(d_fs_in)); - - // ####### CN0 ESTIMATION AND LOCK DETECTORS ####################################### - if (d_cn0_estimation_counter < FLAGS_cn0_samples) - { - // fill buffer with prompt correlator output values - d_Prompt_buffer[d_cn0_estimation_counter] = lv_cmake(static_cast(d_correlator_outs_16sc[1].real()), - static_cast(d_correlator_outs_16sc[1].imag())); // prompt - d_cn0_estimation_counter++; - } - else - { - d_cn0_estimation_counter = 0; - // Code lock indicator - d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, d_fs_in, GPS_L1_CA_CODE_LENGTH_CHIPS); - // Carrier lock indicator - d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, FLAGS_cn0_samples); - // Loss of lock detection - if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < FLAGS_cn0_min) - { - d_carrier_lock_fail_counter++; - } - else - { - if (d_carrier_lock_fail_counter > 0) - { - d_carrier_lock_fail_counter--; - } - } - if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) - { - std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl; - LOG(INFO) << "Loss of lock in channel " << d_channel << "!"; - this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); //3 -> loss of lock - d_carrier_lock_fail_counter = 0; - d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine - multicorrelator_fpga_8sc->unlock_channel(); - } - } - // ########### Output the tracking data to navigation and PVT ########## - current_synchro_data.Prompt_I = static_cast((d_correlator_outs_16sc[1]).real()); - current_synchro_data.Prompt_Q = static_cast((d_correlator_outs_16sc[1]).imag()); - current_synchro_data.Tracking_sample_counter = d_sample_counter + d_correlation_length_samples; - current_synchro_data.Code_phase_samples = d_rem_code_phase_samples; - current_synchro_data.Carrier_phase_rads = GPS_TWO_PI * d_acc_carrier_phase_cycles; - current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; - current_synchro_data.CN0_dB_hz = d_CN0_SNV_dB_Hz; - current_synchro_data.Flag_valid_symbol_output = true; - if (d_preamble_synchronized == true) - { - current_synchro_data.correlation_length_ms = d_extend_correlation_ms; - } - else - { - current_synchro_data.correlation_length_ms = 1; - } - } - else - { - current_synchro_data.Prompt_I = static_cast((d_correlator_outs_16sc[1]).real()); - current_synchro_data.Prompt_Q = static_cast((d_correlator_outs_16sc[1]).imag()); - current_synchro_data.Tracking_sample_counter = d_sample_counter + d_correlation_length_samples; - current_synchro_data.Code_phase_samples = d_rem_code_phase_samples; - current_synchro_data.Carrier_phase_rads = GPS_TWO_PI * d_acc_carrier_phase_cycles; - current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; // todo: project the carrier doppler - current_synchro_data.CN0_dB_hz = d_CN0_SNV_dB_Hz; - } - } - else - { - for (int n = 0; n < d_n_correlator_taps; n++) - { - d_correlator_outs_16sc[n] = lv_cmake(0, 0); - } - - current_synchro_data.System = {'G'}; - current_synchro_data.Tracking_sample_counter = d_sample_counter + d_correlation_length_samples; - } - - current_synchro_data.fs = d_fs_in; - *out[0] = current_synchro_data; - - if (d_dump) - { - // MULTIPLEXED FILE RECORDING - Record results to file - float prompt_I; - float prompt_Q; - float tmp_E, tmp_P, tmp_L; - double tmp_double; - prompt_I = d_correlator_outs_16sc[1].real(); - prompt_Q = d_correlator_outs_16sc[1].imag(); - tmp_E = std::abs(std::complex(d_correlator_outs_16sc[0].real(), d_correlator_outs_16sc[0].imag())); - tmp_P = std::abs(std::complex(d_correlator_outs_16sc[1].real(), d_correlator_outs_16sc[1].imag())); - tmp_L = std::abs(std::complex(d_correlator_outs_16sc[2].real(), d_correlator_outs_16sc[2].imag())); - try - { - // EPR - d_dump_file.write(reinterpret_cast(&tmp_E), sizeof(float)); - d_dump_file.write(reinterpret_cast(&tmp_P), sizeof(float)); - d_dump_file.write(reinterpret_cast(&tmp_L), sizeof(float)); - // PROMPT I and Q (to analyze navigation symbols) - d_dump_file.write(reinterpret_cast(&prompt_I), sizeof(float)); - d_dump_file.write(reinterpret_cast(&prompt_Q), sizeof(float)); - // PRN start sample stamp - //tmp_float=(float)d_sample_counter; - d_dump_file.write(reinterpret_cast(&d_sample_counter), sizeof(unsigned long int)); - // accumulated carrier phase - d_dump_file.write(reinterpret_cast(&d_acc_carrier_phase_cycles), sizeof(double)); - - // carrier and code frequency - d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(double)); - d_dump_file.write(reinterpret_cast(&d_code_freq_chips), sizeof(double)); - - //PLL commands - d_dump_file.write(reinterpret_cast(&d_carr_phase_error_secs_Ti), sizeof(double)); - d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(double)); - - //DLL commands - d_dump_file.write(reinterpret_cast(&d_code_error_chips_Ti), sizeof(double)); - d_dump_file.write(reinterpret_cast(&d_code_error_filt_chips_Ti), sizeof(double)); - - // CN0 and carrier lock test - d_dump_file.write(reinterpret_cast(&d_CN0_SNV_dB_Hz), sizeof(double)); - d_dump_file.write(reinterpret_cast(&d_carrier_lock_test), sizeof(double)); - - // AUX vars (for debug purposes) - tmp_double = d_code_error_chips_Ti * CURRENT_INTEGRATION_TIME_S; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); - tmp_double = static_cast(d_sample_counter + d_correlation_length_samples); - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); - - // PRN - unsigned int prn_ = d_acquisition_gnss_synchro->PRN; - d_dump_file.write(reinterpret_cast(&prn_), sizeof(unsigned int)); - } - catch (const std::ifstream::failure* e) - { - LOG(WARNING) << "Exception writing trk dump file " << e->what(); - } - } - - //consume_each(d_correlation_length_samples); // this is necessary in gr::block derivates - d_sample_counter += d_correlation_length_samples; //count for the processed samples - - if (d_enable_tracking) - { - return 1; - }else{ - return 0; - } -} - - -void gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::set_channel(unsigned int channel) -{ - d_channel = channel; - multicorrelator_fpga_8sc->set_channel(d_channel); - LOG(INFO) << "Tracking Channel set to " << d_channel; - // ############# ENABLE DATA FILE LOG ################# - if (d_dump == true) - { - if (d_dump_file.is_open() == false) - { - try - { - d_dump_filename.append(boost::lexical_cast(d_channel)); - d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); - d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); - LOG(INFO) << "Tracking dump enabled on channel " - << d_channel << " Log file: " - << d_dump_filename.c_str(); - } - catch (const std::ifstream::failure* e) - { - LOG(WARNING) << "channel " << d_channel - << " Exception opening trk dump file " - << e->what(); - } - } - } -} - - -int gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::save_matfile() -{ - // READ DUMP FILE - std::ifstream::pos_type size; - int number_of_double_vars = 11; - int number_of_float_vars = 5; - int epoch_size_bytes = sizeof(unsigned long int) + sizeof(double) * number_of_double_vars + - sizeof(float) * number_of_float_vars + sizeof(unsigned int); - std::ifstream dump_file; - dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); - try - { - dump_file.open(d_dump_filename.c_str(), std::ios::binary | std::ios::ate); - } - catch(const std::ifstream::failure &e) - { - std::cerr << "Problem opening dump file:" << e.what() << std::endl; - return 1; - } - // count number of epochs and rewind - long int num_epoch = 0; - if (dump_file.is_open()) - { - size = dump_file.tellg(); - num_epoch = static_cast(size) / static_cast(epoch_size_bytes); - dump_file.seekg(0, std::ios::beg); - } - else - { - return 1; - } - float * abs_E = new float [num_epoch]; - float * abs_P = new float [num_epoch]; - float * abs_L = new float [num_epoch]; - float * Prompt_I = new float [num_epoch]; - float * Prompt_Q = new float [num_epoch]; - unsigned long int * PRN_start_sample_count = new unsigned long int [num_epoch]; - double * acc_carrier_phase_rad = new double [num_epoch]; - double * carrier_doppler_hz = new double [num_epoch]; - double * code_freq_chips = new double [num_epoch]; - double * carr_error_hz = new double [num_epoch]; - double * carr_error_filt_hz = new double [num_epoch]; - double * code_error_chips = new double [num_epoch]; - double * code_error_filt_chips = new double [num_epoch]; - double * CN0_SNV_dB_Hz = new double [num_epoch]; - double * carrier_lock_test = new double [num_epoch]; - double * aux1 = new double [num_epoch]; - double * aux2 = new double [num_epoch]; - unsigned int * PRN = new unsigned int [num_epoch]; - - try - { - if (dump_file.is_open()) - { - for(long int i = 0; i < num_epoch; i++) - { - dump_file.read(reinterpret_cast(&abs_E[i]), sizeof(float)); - dump_file.read(reinterpret_cast(&abs_P[i]), sizeof(float)); - dump_file.read(reinterpret_cast(&abs_L[i]), sizeof(float)); - dump_file.read(reinterpret_cast(&Prompt_I[i]), sizeof(float)); - dump_file.read(reinterpret_cast(&Prompt_Q[i]), sizeof(float)); - dump_file.read(reinterpret_cast(&PRN_start_sample_count[i]), sizeof(unsigned long int)); - dump_file.read(reinterpret_cast(&acc_carrier_phase_rad[i]), sizeof(double)); - dump_file.read(reinterpret_cast(&carrier_doppler_hz[i]), sizeof(double)); - dump_file.read(reinterpret_cast(&code_freq_chips[i]), sizeof(double)); - dump_file.read(reinterpret_cast(&carr_error_hz[i]), sizeof(double)); - dump_file.read(reinterpret_cast(&carr_error_filt_hz[i]), sizeof(double)); - dump_file.read(reinterpret_cast(&code_error_chips[i]), sizeof(double)); - dump_file.read(reinterpret_cast(&code_error_filt_chips[i]), sizeof(double)); - dump_file.read(reinterpret_cast(&CN0_SNV_dB_Hz[i]), sizeof(double)); - dump_file.read(reinterpret_cast(&carrier_lock_test[i]), sizeof(double)); - dump_file.read(reinterpret_cast(&aux1[i]), sizeof(double)); - dump_file.read(reinterpret_cast(&aux2[i]), sizeof(double)); - dump_file.read(reinterpret_cast(&PRN[i]), sizeof(unsigned int)); - } - } - dump_file.close(); - } - catch (const std::ifstream::failure &e) - { - std::cerr << "Problem reading dump file:" << e.what() << std::endl; - delete[] abs_E; - delete[] abs_P; - delete[] abs_L; - delete[] Prompt_I; - delete[] Prompt_Q; - delete[] PRN_start_sample_count; - delete[] acc_carrier_phase_rad; - delete[] carrier_doppler_hz; - delete[] code_freq_chips; - delete[] carr_error_hz; - delete[] carr_error_filt_hz; - delete[] code_error_chips; - delete[] code_error_filt_chips; - delete[] CN0_SNV_dB_Hz; - delete[] carrier_lock_test; - delete[] aux1; - delete[] aux2; - delete[] PRN; - return 1; - } - - // WRITE MAT FILE - mat_t *matfp; - matvar_t *matvar; - std::string filename = d_dump_filename; - filename.erase(filename.length() - 4, 4); - filename.append(".mat"); - matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); - if(reinterpret_cast(matfp) != NULL) - { - size_t dims[2] = {1, static_cast(num_epoch)}; - matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarFree(matvar); - - matvar = Mat_VarCreate("abs_P", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_P, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarFree(matvar); - - matvar = Mat_VarCreate("abs_L", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_L, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarFree(matvar); - - matvar = Mat_VarCreate("Prompt_I", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, Prompt_I, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarFree(matvar); - - matvar = Mat_VarCreate("Prompt_Q", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, Prompt_Q, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarFree(matvar); - - matvar = Mat_VarCreate("PRN_start_sample_count", MAT_C_UINT64, MAT_T_UINT64, 2, dims, PRN_start_sample_count, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarFree(matvar); - - matvar = Mat_VarCreate("acc_carrier_phase_rad", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, acc_carrier_phase_rad, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarFree(matvar); - - matvar = Mat_VarCreate("carrier_doppler_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carrier_doppler_hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarFree(matvar); - - matvar = Mat_VarCreate("code_freq_chips", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, code_freq_chips, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarFree(matvar); - - matvar = Mat_VarCreate("carr_error_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carr_error_hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarFree(matvar); - - matvar = Mat_VarCreate("carr_error_filt_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carr_error_filt_hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarFree(matvar); - - matvar = Mat_VarCreate("code_error_chips", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, code_error_chips, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarFree(matvar); - - matvar = Mat_VarCreate("code_error_filt_chips", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, code_error_filt_chips, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarFree(matvar); - - matvar = Mat_VarCreate("CN0_SNV_dB_Hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, CN0_SNV_dB_Hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarFree(matvar); - - matvar = Mat_VarCreate("carrier_lock_test", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carrier_lock_test, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarFree(matvar); - - matvar = Mat_VarCreate("aux1", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, aux1, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarFree(matvar); - - matvar = Mat_VarCreate("aux2", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, aux2, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarFree(matvar); - - matvar = Mat_VarCreate("PRN", MAT_C_UINT32, MAT_T_UINT32, 2, dims, PRN, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarFree(matvar); - } - Mat_Close(matfp); - delete[] abs_E; - delete[] abs_P; - delete[] abs_L; - delete[] Prompt_I; - delete[] Prompt_Q; - delete[] PRN_start_sample_count; - delete[] acc_carrier_phase_rad; - delete[] carrier_doppler_hz; - delete[] code_freq_chips; - delete[] carr_error_hz; - delete[] carr_error_filt_hz; - delete[] code_error_chips; - delete[] code_error_filt_chips; - delete[] CN0_SNV_dB_Hz; - delete[] carrier_lock_test; - delete[] aux1; - delete[] aux2; - delete[] PRN; - return 0; -} - -void gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::set_gnss_synchro( - Gnss_Synchro* p_gnss_synchro) -{ - d_acquisition_gnss_synchro = p_gnss_synchro; -} - - -void gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::reset(void) -{ - multicorrelator_fpga_8sc->unlock_channel(); -} diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.h deleted file mode 100644 index d1a3db6d5..000000000 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.h +++ /dev/null @@ -1,185 +0,0 @@ -/*! - * \file gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.h - * \brief Interface of a code DLL + carrier PLL tracking block - * \author Marc Majoral, 2017. mmajoral(at)cttc.cat - * Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com - * Javier Arribas, 2011. jarribas(at)cttc.es - * - * Code DLL + carrier PLL according to the algorithms described in: - * K.Borre, D.M.Akos, N.Bertelsen, P.Rinder, and S.H.Jensen, - * A Software-Defined GPS and Galileo Receiver. A Single-Frequency Approach, - * Birkhauser, 2007 - * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * GNSS-SDR is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GNSS-SDR is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNSS-SDR. If not, see . - * - * ------------------------------------------------------------------------- - */ - -#ifndef GNSS_SDR_GPS_L1_CA_DLL_PLL_C_AID_TRACKING_FPGA_SC_H -#define GNSS_SDR_GPS_L1_CA_DLL_PLL_C_AID_TRACKING_FPGA_SC_H - -#include "gps_sdr_signal_processing.h" -#include "gnss_synchro.h" -#include "tracking_2nd_DLL_filter.h" -#include "tracking_FLL_PLL_filter.h" -#include "fpga_multicorrelator_8sc.h" -#include -#include -#include -#include -#include -#include -#include - -class gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc; - -typedef boost::shared_ptr gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc_sptr; - -gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc_sptr -gps_l1_ca_dll_pll_c_aid_make_tracking_fpga_sc(long if_freq, long fs_in, unsigned -int vector_length, bool dump, std::string dump_filename, float pll_bw_hz, - float dll_bw_hz, float pll_bw_narrow_hz, float dll_bw_narrow_hz, - int extend_correlation_ms, float early_late_space_chips, - std::string device_name, unsigned int device_base); - -/*! - * \brief This class implements a DLL + PLL tracking loop block - */ -class gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc : public gr::block -{ -public: - ~gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc(); - - void set_channel(unsigned int channel); - void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro); - void start_tracking(); - - int general_work(int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - void reset(void); - -private: - friend gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc_sptr - gps_l1_ca_dll_pll_c_aid_make_tracking_fpga_sc(long if_freq, long fs_in, - unsigned - int vector_length, bool dump, std::string dump_filename, - float pll_bw_hz, float dll_bw_hz, float pll_bw_narrow_hz, - float dll_bw_narrow_hz, int extend_correlation_ms, - float early_late_space_chips, std::string device_name, - unsigned int device_base); - - gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc(long if_freq, long fs_in, unsigned - int vector_length, bool dump, std::string dump_filename, float pll_bw_hz, - float dll_bw_hz, float pll_bw_narrow_hz, float dll_bw_narrow_hz, - int extend_correlation_ms, float early_late_space_chips, - std::string device_name, unsigned int device_base); - - // tracking configuration vars - unsigned int d_vector_length;bool d_dump; - - Gnss_Synchro* d_acquisition_gnss_synchro; - unsigned int d_channel; - - long d_if_freq; - long d_fs_in; - - double d_early_late_spc_chips; - int d_n_correlator_taps; - - gr_complex* d_ca_code; - lv_16sc_t* d_ca_code_16sc; - float* d_local_code_shift_chips; - lv_16sc_t* d_correlator_outs_16sc; - //fpga_multicorrelator_8sc multicorrelator_fpga_8sc; - std::shared_ptr multicorrelator_fpga_8sc; - - // remaining code phase and carrier phase between tracking loops - double d_rem_code_phase_samples; - double d_rem_code_phase_chips; - double d_rem_carrier_phase_rad; - int d_rem_code_phase_integer_samples; - - // PLL and DLL filter library - Tracking_2nd_DLL_filter d_code_loop_filter; - Tracking_FLL_PLL_filter d_carrier_loop_filter; - - // acquisition - double d_acq_code_phase_samples; - double d_acq_carrier_doppler_hz; - - // tracking vars - float d_dll_bw_hz; - float d_pll_bw_hz; - float d_dll_bw_narrow_hz; - float d_pll_bw_narrow_hz; - double d_code_freq_chips; - double d_code_phase_step_chips; - double d_carrier_doppler_hz; - double d_carrier_phase_step_rad; - double d_acc_carrier_phase_cycles; - double d_code_phase_samples; - double d_pll_to_dll_assist_secs_Ti; - double d_carr_phase_error_secs_Ti; - double d_code_error_chips_Ti; - double d_preamble_timestamp_s; - int d_extend_correlation_ms;bool d_enable_extended_integration;bool d_preamble_synchronized; - double d_code_error_filt_chips_s; - double d_code_error_filt_chips_Ti; - void msg_handler_preamble_index(pmt::pmt_t msg); - - // symbol history to detect bit transition - std::deque d_E_history; - std::deque d_P_history; - std::deque d_L_history; - - //Integration period in samples - int d_correlation_length_samples; - - //processing samples counters - unsigned long int d_sample_counter; - unsigned long int d_acq_sample_stamp; - - // CN0 estimation and lock detector - int d_cn0_estimation_counter; - gr_complex* d_Prompt_buffer; - double d_carrier_lock_test; - double d_CN0_SNV_dB_Hz; - double d_carrier_lock_threshold; - int d_carrier_lock_fail_counter; - - // control vars - bool d_enable_tracking;bool d_pull_in; - - // file dump - std::string d_dump_filename; - std::ofstream d_dump_file; - - std::map systemName; - std::string sys; - - int save_matfile(); -}; - -#endif //GNSS_SDR_GPS_L1_CA_DLL_PLL_C_AID_TRACKING_FPGA_SC_H diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.cc new file mode 100644 index 000000000..a6ebb9bec --- /dev/null +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.cc @@ -0,0 +1,586 @@ +/*! + * \file gps_l1_ca_dll_pll_tracking_cc.cc + * \brief Implementation of a code DLL + carrier PLL tracking block + * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com + * Javier Arribas, 2011. jarribas(at)cttc.es + * + * Code DLL + carrier PLL according to the algorithms described in: + * [1] K.Borre, D.M.Akos, N.Bertelsen, P.Rinder, and S.H.Jensen, + * A Software-Defined GPS and Galileo Receiver. A Single-Frequency + * Approach, Birkhauser, 2007 + * + * ------------------------------------------------------------------------- + * + * Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors) + * + * GNSS-SDR is a software defined Global Navigation + * Satellite Systems receiver + * + * This file is part of GNSS-SDR. + * + * GNSS-SDR is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GNSS-SDR is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNSS-SDR. If not, see . + * + * ------------------------------------------------------------------------- + */ + +#include "gps_l1_ca_dll_pll_tracking_fpga_sc.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include "gps_sdr_signal_processing.h" +#include "tracking_discriminators.h" +#include "lock_detectors.h" +#include "GPS_L1_CA.h" +#include "control_message_factory.h" + + +/*! + * \todo Include in definition header file + */ +#define CN0_ESTIMATION_SAMPLES 20 +#define MINIMUM_VALID_CN0 25 +#define MAXIMUM_LOCK_FAIL_COUNTER 50 +#define CARRIER_LOCK_THRESHOLD 0.85 + + +using google::LogMessage; + +gps_l1_ca_dll_pll_tracking_fpga_sc_sptr +gps_l1_ca_dll_pll_make_tracking_fpga_sc( + long if_freq, + long fs_in, + unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float early_late_space_chips, + std::string device_name, + unsigned int device_base) +{ + return gps_l1_ca_dll_pll_tracking_fpga_sc_sptr(new Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc(if_freq, + fs_in, vector_length, dump, dump_filename, pll_bw_hz, dll_bw_hz, early_late_space_chips, device_name, device_base)); +} + +Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc::Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc( + long if_freq, + long fs_in, + unsigned int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float early_late_space_chips, + std::string device_name, + unsigned int device_base) : + gr::block("Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc", gr::io_signature::make(0, 0, sizeof(lv_16sc_t)), + gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) +{ + // Telemetry bit synchronization message port input + this->message_port_register_in(pmt::mp("preamble_timestamp_s")); + this->message_port_register_out(pmt::mp("events")); + + // initialize internal vars + d_dump = dump; + d_if_freq = if_freq; + d_fs_in = fs_in; + d_vector_length = vector_length; + d_dump_filename = dump_filename; + d_current_prn_length_samples = static_cast(d_vector_length); + d_correlation_length_samples = static_cast(d_vector_length); + + // Initialize tracking ========================================== + d_code_loop_filter.set_DLL_BW(dll_bw_hz); + d_carrier_loop_filter.set_PLL_BW(pll_bw_hz); + + //--- DLL variables -------------------------------------------------------- + d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips) + + // Initialization of local code replica + // Get space for a vector with the C/A code replica sampled 1x/chip + //d_ca_code = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(float), volk_gnsssdr_get_alignment())); + //d_ca_code_16sc = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(lv_16sc_t), volk_gnsssdr_get_alignment())); + //d_ca_code_16sc = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(int), volk_gnsssdr_get_alignment())); + + // correlator outputs (scalar) + d_n_correlator_taps = 3; // Early, Prompt, and Late + d_correlator_outs = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + for (int n = 0; n < d_n_correlator_taps; n++) + { + d_correlator_outs[n] = gr_complex(0,0); + } + d_local_code_shift_chips = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(float), volk_gnsssdr_get_alignment())); + + // Set TAPs delay values [chips] + d_local_code_shift_chips[0] = - d_early_late_spc_chips; + d_local_code_shift_chips[1] = 0.0; + d_local_code_shift_chips[2] = d_early_late_spc_chips; + + // create multicorrelator class + multicorrelator_fpga_8sc = std::make_shared (d_n_correlator_taps, device_name, device_base); + + //--- Perform initializations ------------------------------ + // define initial code frequency basis of NCO + d_code_freq_chips = GPS_L1_CA_CODE_RATE_HZ; + // define residual code phase (in chips) + d_rem_code_phase_samples = 0.0; + // define residual carrier phase + d_rem_carr_phase_rad = 0.0; + + // sample synchronization + d_sample_counter = 0; + d_acq_sample_stamp = 0; + + d_enable_tracking = false; + d_pull_in = false; + + // CN0 estimation and lock detector buffers + d_cn0_estimation_counter = 0; + d_Prompt_buffer = new gr_complex[CN0_ESTIMATION_SAMPLES]; + d_carrier_lock_test = 1; + d_CN0_SNV_dB_Hz = 0; + d_carrier_lock_fail_counter = 0; + d_carrier_lock_threshold = CARRIER_LOCK_THRESHOLD; + + systemName["G"] = std::string("GPS"); + systemName["S"] = std::string("SBAS"); + + d_acquisition_gnss_synchro = 0; + d_channel = 0; + d_acq_code_phase_samples = 0.0; + d_acq_carrier_doppler_hz = 0.0; + d_carrier_doppler_hz = 0.0; + d_acc_carrier_phase_rad = 0.0; + d_code_phase_samples = 0.0; + d_rem_code_phase_chips = 0.0; + d_code_phase_step_chips = 0.0; + d_carrier_phase_step_rad = 0.0; + + set_relative_rate(1.0 / static_cast(d_vector_length)); + + d_first_time = 1; + + + +} + +void Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc::start_tracking() +{ + /* + * correct the code phase according to the delay between acq and trk + */ + + //printf("TRK : start tracking for satellite %d\n", d_acquisition_gnss_synchro->PRN); + d_acq_code_phase_samples = d_acquisition_gnss_synchro->Acq_delay_samples; + d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz; + d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples; + long int acq_trk_diff_samples; + double acq_trk_diff_seconds; + acq_trk_diff_samples = static_cast(d_sample_counter) - static_cast(d_acq_sample_stamp); //-d_vector_length; + DLOG(INFO) << "Number of samples between Acquisition and Tracking = " << acq_trk_diff_samples; + acq_trk_diff_seconds = static_cast(acq_trk_diff_samples) / static_cast(d_fs_in); + // Doppler effect + // Fd=(C/(C+Vr))*F + double radial_velocity = (GPS_L1_FREQ_HZ + d_acq_carrier_doppler_hz) / GPS_L1_FREQ_HZ; + // new chip and prn sequence periods based on acq Doppler + double T_chip_mod_seconds; + double T_prn_mod_seconds; + double T_prn_mod_samples; + d_code_freq_chips = radial_velocity * GPS_L1_CA_CODE_RATE_HZ; + d_code_phase_step_chips = static_cast(d_code_freq_chips) / static_cast(d_fs_in); + T_chip_mod_seconds = 1/d_code_freq_chips; + T_prn_mod_seconds = T_chip_mod_seconds * GPS_L1_CA_CODE_LENGTH_CHIPS; + T_prn_mod_samples = T_prn_mod_seconds * static_cast(d_fs_in); + d_current_prn_length_samples = round(T_prn_mod_samples); + double T_prn_true_seconds = GPS_L1_CA_CODE_LENGTH_CHIPS / GPS_L1_CA_CODE_RATE_HZ; + double T_prn_true_samples = T_prn_true_seconds * static_cast(d_fs_in); + double T_prn_diff_seconds = T_prn_true_seconds - T_prn_mod_seconds; + double N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds; + double corrected_acq_phase_samples, delay_correction_samples; + corrected_acq_phase_samples = fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast(d_fs_in)), T_prn_true_samples); + if (corrected_acq_phase_samples < 0) + { + corrected_acq_phase_samples = T_prn_mod_samples + corrected_acq_phase_samples; + } + delay_correction_samples = d_acq_code_phase_samples - corrected_acq_phase_samples; + d_acq_code_phase_samples = corrected_acq_phase_samples; + d_carrier_doppler_hz = d_acq_carrier_doppler_hz; + d_carrier_phase_step_rad = GPS_TWO_PI * d_carrier_doppler_hz / static_cast(d_fs_in); + // DLL/PLL filter initialization + d_carrier_loop_filter.initialize(); // initialize the carrier filter + d_code_loop_filter.initialize(); // initialize the code filter + // generate local reference ALWAYS starting at chip 1 (1 sample per chip) + //gps_l1_ca_code_gen_float(d_ca_code, d_acquisition_gnss_synchro->PRN, 0); + //gps_l1_ca_code_gen_int(d_ca_code_16sc, d_acquisition_gnss_synchro->PRN, 0); +/* for (int n = 0; n < static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS); n++) + { + d_ca_code_16sc[n] = d_ca_code[n]; + } */ + //multicorrelator_fpga_8sc->set_local_code_and_taps(static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS), d_ca_code_16sc, d_local_code_shift_chips, d_acquisition_gnss_synchro->PRN); + multicorrelator_fpga_8sc->set_local_code_and_taps(static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS), d_local_code_shift_chips, d_acquisition_gnss_synchro->PRN); + for (int n = 0; n < d_n_correlator_taps; n++) + { + d_correlator_outs[n] = gr_complex(0,0); + } + d_carrier_lock_fail_counter = 0; + d_rem_code_phase_samples = 0; + d_rem_carr_phase_rad = 0.0; + d_rem_code_phase_chips = 0.0; + d_acc_carrier_phase_rad = 0.0; + d_code_phase_samples = d_acq_code_phase_samples; + std::string sys_ = &d_acquisition_gnss_synchro->System; + sys = sys_.substr(0,1); + //std::cout << "Tracking of GPS L1 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; + LOG(INFO) << "Starting tracking of satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; + // enable tracking + d_pull_in = true; + multicorrelator_fpga_8sc->lock_channel(); + d_enable_tracking = true; //do it in the end to avoid starting running tracking before finishing this function + LOG(INFO) << "PULL-IN Doppler [Hz]=" << d_carrier_doppler_hz + << " Code Phase correction [samples]=" << delay_correction_samples + << " PULL-IN Code Phase [samples]=" << d_acq_code_phase_samples; + d_first_time = 1; +} + +Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc::~Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc() +{ + if (d_dump_file.is_open()) + { + try + { + d_dump_file.close(); + } + catch(const std::exception & ex) + { + LOG(WARNING) << "Exception in destructor " << ex.what(); + } + } + try + { + volk_gnsssdr_free(d_local_code_shift_chips); + volk_gnsssdr_free(d_correlator_outs); + //volk_gnsssdr_free(d_ca_code); + delete[] d_Prompt_buffer; + //multicorrelator_cpu.free(); + //volk_gnsssdr_free(d_ca_code_16sc); + multicorrelator_fpga_8sc->free(); + } + catch(const std::exception & ex) + { + LOG(WARNING) << "Exception in destructor " << ex.what(); + } +} + +int Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) +{ + + // debug + int secondary_sample_counter; + int counter_corr_0_in; + int counter_corr_0_out; + int sample_counter; + + // samples offset +// int samples_offset; + unsigned absolute_samples_offset; +// int kk2; + // process vars + double carr_error_hz = 0.0; + double carr_error_filt_hz = 0.0; + double code_error_chips = 0.0; + double code_error_filt_chips = 0.0; + + int next_prn_length_samples = d_current_prn_length_samples; +// int offset_prn_samples = 0; + + // Block input data and block output stream pointers + Gnss_Synchro **out = reinterpret_cast(&output_items[0]); + + // GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder + Gnss_Synchro current_synchro_data = Gnss_Synchro(); + + if (d_enable_tracking == true) + { + // Fill the acquisition data + current_synchro_data = *d_acquisition_gnss_synchro; + // Receiver signal alignment + if (d_pull_in == true) + { + d_pull_in = false; + unsigned counter_value = multicorrelator_fpga_8sc->read_sample_counter(); + unsigned num_frames = ceil((counter_value - current_synchro_data.Acq_samplestamp_samples - current_synchro_data.Acq_delay_samples)/d_correlation_length_samples); + absolute_samples_offset = current_synchro_data.Acq_delay_samples + current_synchro_data.Acq_samplestamp_samples + num_frames*d_correlation_length_samples; + multicorrelator_fpga_8sc->set_initial_sample(absolute_samples_offset); + d_sample_counter = absolute_samples_offset; + current_synchro_data.Tracking_sample_counter = absolute_samples_offset; + } + else + { + // continue as from the previous point + d_sample_counter = d_sample_counter_next; + } + d_sample_counter_next = d_sample_counter + d_current_prn_length_samples; + + // ################# CARRIER WIPEOFF AND CORRELATORS ############################## + // perform carrier wipe-off and compute Early, Prompt and Late correlation + multicorrelator_fpga_8sc->set_output_vectors(d_correlator_outs); + multicorrelator_fpga_8sc->Carrier_wipeoff_multicorrelator_resampler( + d_rem_carr_phase_rad, d_carrier_phase_step_rad, + d_rem_code_phase_chips, d_code_phase_step_chips, + d_current_prn_length_samples); + d_previous_sample_counter = d_debug_sample_counter; + d_previous_counter_corr_0_in = d_counter_corr_0_in; + d_previous_counter_corr_0_out = d_counter_corr_0_out; + multicorrelator_fpga_8sc->read_sample_counters(&sample_counter, &secondary_sample_counter, &counter_corr_0_in, &counter_corr_0_out); + d_debug_sample_counter = sample_counter; + d_counter_corr_0_in = counter_corr_0_in; + d_counter_corr_0_out = counter_corr_0_out; + d_counter_corr_0_in_inc = counter_corr_0_in - d_previous_counter_corr_0_in; + d_counter_corr_0_out_inc = counter_corr_0_out - d_previous_counter_corr_0_out; + d_sample_counter_inc = d_debug_sample_counter - d_previous_sample_counter; + + // ################## PLL ########################################################## + // PLL discriminator + // Update PLL discriminator [rads/Ti -> Secs/Ti] + carr_error_hz = pll_cloop_two_quadrant_atan(d_correlator_outs[1]) / GPS_TWO_PI; // prompt output + // Carrier discriminator filter + carr_error_filt_hz = d_carrier_loop_filter.get_carrier_nco(carr_error_hz); + // New carrier Doppler frequency estimation + d_carrier_doppler_hz = d_acq_carrier_doppler_hz + carr_error_filt_hz; + // New code Doppler frequency estimation + d_code_freq_chips = GPS_L1_CA_CODE_RATE_HZ + ((d_carrier_doppler_hz * GPS_L1_CA_CODE_RATE_HZ) / GPS_L1_FREQ_HZ); + + // ################## DLL ########################################################## + // DLL discriminator + code_error_chips = dll_nc_e_minus_l_normalized(d_correlator_outs[0], d_correlator_outs[2]); // [chips/Ti] //early and late + // Code discriminator filter + code_error_filt_chips = d_code_loop_filter.get_code_nco(code_error_chips); // [chips/second] + double T_chip_seconds = 1.0 / static_cast(d_code_freq_chips); + double T_prn_seconds = T_chip_seconds * GPS_L1_CA_CODE_LENGTH_CHIPS; + double code_error_filt_secs = (T_prn_seconds * code_error_filt_chips*T_chip_seconds); //[seconds] + + // ################## CARRIER AND CODE NCO BUFFER ALIGNEMENT ####################### + // 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 + double T_prn_samples = T_prn_seconds * static_cast(d_fs_in); + double K_blk_samples = T_prn_samples + d_rem_code_phase_samples + code_error_filt_secs * static_cast(d_fs_in); + next_prn_length_samples = round(K_blk_samples); +// offset_prn_samples = next_prn_length_samples - d_current_prn_length_samples; + + //################### PLL COMMANDS ################################################# + // carrier phase step (NCO phase increment per sample) [rads/sample] + d_carrier_phase_step_rad = GPS_TWO_PI * d_carrier_doppler_hz / static_cast(d_fs_in); + // remnant carrier phase to prevent overflow in the code NCO + d_rem_carr_phase_rad = d_rem_carr_phase_rad + d_carrier_phase_step_rad * d_current_prn_length_samples; + d_rem_carr_phase_rad = fmod(d_rem_carr_phase_rad, GPS_TWO_PI); + // carrier phase accumulator + d_acc_carrier_phase_rad -= d_carrier_phase_step_rad * d_current_prn_length_samples; + + //################### DLL COMMANDS ################################################# + // code phase step (Code resampler phase increment per sample) [chips/sample] + d_code_phase_step_chips = d_code_freq_chips / static_cast(d_fs_in); + // remnant code phase [chips] + d_rem_code_phase_samples = K_blk_samples - next_prn_length_samples; // rounding error < 1 sample + d_rem_code_phase_chips = d_code_freq_chips * (d_rem_code_phase_samples / static_cast(d_fs_in)); + + // ####### CN0 ESTIMATION AND LOCK DETECTORS ###### + if (d_cn0_estimation_counter < CN0_ESTIMATION_SAMPLES) + { + // fill buffer with prompt correlator output values + d_Prompt_buffer[d_cn0_estimation_counter] = d_correlator_outs[1]; //prompt + d_cn0_estimation_counter++; + } + else + { + d_cn0_estimation_counter = 0; + // Code lock indicator + d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES, d_fs_in, GPS_L1_CA_CODE_LENGTH_CHIPS); + // Carrier lock indicator + d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES); + // Loss of lock detection + if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < MINIMUM_VALID_CN0) + { + d_carrier_lock_fail_counter++; + } + else + { + if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--; + } + if (d_carrier_lock_fail_counter > MAXIMUM_LOCK_FAIL_COUNTER) + { + std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl; + d_debug_loss_of_track = 1; + LOG(INFO) << "Loss of lock in channel " << d_channel << "!"; + this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); // 3 -> loss of lock + d_carrier_lock_fail_counter = 0; + d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine + multicorrelator_fpga_8sc->unlock_channel(); + + + } + } + + // ########### Output the tracking data to navigation and PVT ########## + current_synchro_data.Prompt_I = static_cast((d_correlator_outs[1]).real()); + current_synchro_data.Prompt_Q = static_cast((d_correlator_outs[1]).imag()); + current_synchro_data.Tracking_sample_counter = d_sample_counter + d_current_prn_length_samples; + current_synchro_data.Code_phase_samples = d_rem_code_phase_samples; + current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_rad; + current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; + current_synchro_data.CN0_dB_hz = d_CN0_SNV_dB_Hz; + current_synchro_data.Flag_valid_symbol_output = true; + current_synchro_data.correlation_length_ms = 1; + } + else + { + for (int n = 0; n < d_n_correlator_taps; n++) + { + d_correlator_outs[n] = gr_complex(0,0); + } + + current_synchro_data.Tracking_sample_counter =d_sample_counter + d_current_prn_length_samples; + current_synchro_data.System = {'G'}; + current_synchro_data.correlation_length_ms = 1; + } + + //assign the GNURadio block output data + current_synchro_data.fs = d_fs_in; + *out[0] = current_synchro_data; + if (d_enable_tracking == true) // in the FPGA case dump data only when tracking is enabled, otherwise the dumped data is useless + { + if(d_dump) + { + // MULTIPLEXED FILE RECORDING - Record results to file + float prompt_I; + float prompt_Q; + float tmp_E, tmp_P, tmp_L; + double tmp_double; + unsigned long int tmp_long; + prompt_I = d_correlator_outs[1].real(); + prompt_Q = d_correlator_outs[1].imag(); + tmp_E = std::abs(d_correlator_outs[0]); + tmp_P = std::abs(d_correlator_outs[1]); + tmp_L = std::abs(d_correlator_outs[2]); + try + { + // EPR + d_dump_file.write(reinterpret_cast(&tmp_E), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_P), sizeof(float)); + d_dump_file.write(reinterpret_cast(&tmp_L), sizeof(float)); + // PROMPT I and Q (to analyze navigation symbols) + d_dump_file.write(reinterpret_cast(&prompt_I), sizeof(float)); + d_dump_file.write(reinterpret_cast(&prompt_Q), sizeof(float)); + // PRN start sample stamp + tmp_long = d_sample_counter + d_current_prn_length_samples; + d_dump_file.write(reinterpret_cast(&tmp_long), sizeof(unsigned long int)); + // accumulated carrier phase + d_dump_file.write(reinterpret_cast(&d_acc_carrier_phase_rad), sizeof(double)); + + // carrier and code frequency + d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_code_freq_chips), sizeof(double)); + + // PLL commands + d_dump_file.write(reinterpret_cast(&carr_error_hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&carr_error_filt_hz), sizeof(double)); + + // DLL commands + d_dump_file.write(reinterpret_cast(&code_error_chips), sizeof(double)); + d_dump_file.write(reinterpret_cast(&code_error_filt_chips), sizeof(double)); + + // CN0 and carrier lock test + d_dump_file.write(reinterpret_cast(&d_CN0_SNV_dB_Hz), sizeof(double)); + d_dump_file.write(reinterpret_cast(&d_carrier_lock_test), sizeof(double)); + + // AUX vars (for debug purposes) + tmp_double = d_rem_code_phase_samples; + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + tmp_double = static_cast(d_sample_counter); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + + // PRN + unsigned int prn_ = d_acquisition_gnss_synchro->PRN; + d_dump_file.write(reinterpret_cast(&prn_), sizeof(unsigned int)); + + } + catch (const std::ifstream::failure &e) + { + LOG(WARNING) << "Exception writing trk dump file " << e.what(); + } + + + } + } + + + d_current_prn_length_samples = next_prn_length_samples; + d_sample_counter += d_current_prn_length_samples; // count for the processed samples + + if (d_enable_tracking == true) + { + return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false + //return 0; // debug + } + else + { + return 0; + } + +} + + + +void Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc::set_channel(unsigned int channel) +{ + d_channel = channel; + multicorrelator_fpga_8sc->set_channel(d_channel); + LOG(INFO) << "Tracking Channel set to " << d_channel; + + // ############# ENABLE DATA FILE LOG ################# + if (d_dump == true) + { + if (d_dump_file.is_open() == false) + { + try + { + d_dump_filename.append(boost::lexical_cast(d_channel)); + d_dump_filename.append(".dat"); + d_dump_file.exceptions (std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); + LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); + } + catch (const std::ifstream::failure &e) + { + LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); + } + } + } +} + + +void Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) +{ + d_acquisition_gnss_synchro = p_gnss_synchro; +} + +void Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc::reset(void) +{ + multicorrelator_fpga_8sc->unlock_channel(); +} diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.h new file mode 100644 index 000000000..c497c08f2 --- /dev/null +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.h @@ -0,0 +1,200 @@ +/*! + * \file gps_l1_ca_dll_pll_tracking_cc.h + * \brief Interface of a code DLL + carrier PLL tracking block + * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com + * Javier Arribas, 2011. jarribas(at)cttc.es + * Cillian O'Driscoll, 2017. cillian.odriscoll(at)gmail.com + * + * Code DLL + carrier PLL according to the algorithms described in: + * K.Borre, D.M.Akos, N.Bertelsen, P.Rinder, and S.H.Jensen, + * A Software-Defined GPS and Galileo Receiver. A Single-Frequency Approach, + * Birkhauser, 2007 + * + * ------------------------------------------------------------------------- + * + * Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors) + * + * GNSS-SDR is a software defined Global Navigation + * Satellite Systems receiver + * + * This file is part of GNSS-SDR. + * + * GNSS-SDR is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GNSS-SDR is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNSS-SDR. If not, see . + * + * ------------------------------------------------------------------------- + */ + +#ifndef GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_FPGA_SC_H +#define GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_FPGA_SC_H + +#include +#include +#include +#include +#include "gnss_synchro.h" +#include "tracking_2nd_DLL_filter.h" +#include "tracking_2nd_PLL_filter.h" +#include "fpga_multicorrelator_8sc.h" + +class Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc; + +typedef boost::shared_ptr + gps_l1_ca_dll_pll_tracking_fpga_sc_sptr; + +gps_l1_ca_dll_pll_tracking_fpga_sc_sptr +gps_l1_ca_dll_pll_make_tracking_fpga_sc(long if_freq, + long fs_in, unsigned + int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float early_late_space_chips, + std::string device_name, + unsigned int device_base); + + + +/*! + * \brief This class implements a DLL + PLL tracking loop block + */ +class Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc: public gr::block +{ +public: + ~Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc(); + + void set_channel(unsigned int channel); + void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro); + void start_tracking(); + + int general_work (int noutput_items, gr_vector_int &ninput_items, + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + + void reset(void); + +private: + friend gps_l1_ca_dll_pll_tracking_fpga_sc_sptr + gps_l1_ca_dll_pll_make_tracking_fpga_sc(long if_freq, + long fs_in, unsigned + int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float early_late_space_chips, + std::string device_name, + unsigned int device_base); + + Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc(long if_freq, + long fs_in, unsigned + int vector_length, + bool dump, + std::string dump_filename, + float pll_bw_hz, + float dll_bw_hz, + float early_late_space_chips, + std::string device_name, + unsigned int device_base); + + // tracking configuration vars + unsigned int d_vector_length; + bool d_dump; + + Gnss_Synchro* d_acquisition_gnss_synchro; + unsigned int d_channel; + + long d_if_freq; + long d_fs_in; + + double d_early_late_spc_chips; + + // remaining code phase and carrier phase between tracking loops + double d_rem_code_phase_samples; + double d_rem_code_phase_chips; + double d_rem_carr_phase_rad; + + // PLL and DLL filter library + Tracking_2nd_DLL_filter d_code_loop_filter; + Tracking_2nd_PLL_filter d_carrier_loop_filter; + + // acquisition + double d_acq_code_phase_samples; + double d_acq_carrier_doppler_hz; + // correlator + int d_n_correlator_taps; + //float* d_ca_code; + //int* d_ca_code_16sc; + + float* d_local_code_shift_chips; + gr_complex* d_correlator_outs; + std::shared_ptr multicorrelator_fpga_8sc; + + // tracking vars + double d_code_freq_chips; + double d_code_phase_step_chips; + double d_carrier_doppler_hz; + double d_carrier_phase_step_rad; + double d_acc_carrier_phase_rad; + double d_code_phase_samples; + + //PRN period in samples + int d_current_prn_length_samples; + + //processing samples counters + unsigned long int d_sample_counter; + unsigned long int d_acq_sample_stamp; + + // CN0 estimation and lock detector + int d_cn0_estimation_counter; + gr_complex* d_Prompt_buffer; + double d_carrier_lock_test; + double d_CN0_SNV_dB_Hz; + double d_carrier_lock_threshold; + int d_carrier_lock_fail_counter; + + // control vars + bool d_enable_tracking; + bool d_pull_in; + + // file dump + std::string d_dump_filename; + std::ofstream d_dump_file; + + std::map systemName; + std::string sys; + + // extra + int d_correlation_length_samples; + unsigned long int d_sample_counter_next; + double d_rem_carrier_phase_rad; + + double d_K_blk_samples_previous; + int d_offset_sample_previous; + int d_first_time; + + int d_kk = 0; + int d_numsamples_debug = 990; + int d_previous_sample_counter = 0; + int d_debug_sample_counter = 0; + int d_previous_counter_corr_0_in = 0; + int d_previous_counter_corr_0_out = 0; + int d_counter_corr_0_in_inc = 0; + int d_counter_corr_0_out_inc = 0; + int d_counter_corr_0_in = 0; + int d_counter_corr_0_out = 0; + int d_sample_counter_inc = 0; + int d_debug_loss_of_track = 0; +}; + +#endif //GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_FPGA_SC_H diff --git a/src/algorithms/tracking/libs/CMakeLists.txt b/src/algorithms/tracking/libs/CMakeLists.txt index 5c5ce7a2a..1cc68dabb 100644 --- a/src/algorithms/tracking/libs/CMakeLists.txt +++ b/src/algorithms/tracking/libs/CMakeLists.txt @@ -47,6 +47,7 @@ set(TRACKING_LIB_SOURCES if(ENABLE_FPGA) SET(TRACKING_LIB_SOURCES ${TRACKING_LIB_SOURCES} fpga_multicorrelator_8sc.cc) + SET(TRACKING_LIB_SOURCES ${TRACKING_LIB_SOURCES} fpga_multicorrelator_real_codes_8sc.cc) endif(ENABLE_FPGA) include_directories( @@ -54,6 +55,7 @@ include_directories( ${CMAKE_SOURCE_DIR}/src/core/system_parameters ${CMAKE_SOURCE_DIR}/src/core/interfaces ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/libs ${VOLK_INCLUDE_DIRS} ${GLOG_INCLUDE_DIRS} ${GFlags_INCLUDE_DIRS} diff --git a/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.cc b/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.cc index cec90a8f3..dd6f208ce 100644 --- a/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.cc +++ b/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.cc @@ -35,6 +35,7 @@ */ #include "fpga_multicorrelator_8sc.h" + #include // FPGA stuff @@ -63,6 +64,12 @@ // string manipulation #include +// constants +#include "GPS_L1_CA.h" + +#include "gps_sdr_signal_processing.h" + +#define NUM_PRNs 32 #define PAGE_SIZE 0x10000 #define MAX_LENGTH_DEVICEIO_NAME 50 #define CODE_RESAMPLER_NUM_BITS_PRECISION 20 @@ -77,38 +84,39 @@ #define LOCAL_CODE_FPGA_ENABLE_WRITE_MEMORY 0x0C000000 #define TEST_REGISTER_TRACK_WRITEVAL 0x55AA +int fpga_multicorrelator_8sc::read_sample_counter() +{ + return d_map_base[7]; +} + void fpga_multicorrelator_8sc::set_initial_sample(int samples_offset) { d_initial_sample_counter = samples_offset; + d_map_base[13] = d_initial_sample_counter; } - - + +//bool fpga_multicorrelator_8sc::set_local_code_and_taps(int code_length_chips, +// const int* local_code_in, float *shifts_chips, int PRN) bool fpga_multicorrelator_8sc::set_local_code_and_taps(int code_length_chips, - const lv_16sc_t* local_code_in, float *shifts_chips) + float *shifts_chips, int PRN) { - d_local_code_in = local_code_in; + //d_local_code_in = local_code_in; d_shifts_chips = shifts_chips; d_code_length_chips = code_length_chips; - - fpga_multicorrelator_8sc::fpga_configure_tracking_gps_local_code(); - + fpga_multicorrelator_8sc::fpga_configure_tracking_gps_local_code(PRN); return true; } - -bool fpga_multicorrelator_8sc::set_output_vectors(lv_16sc_t* corr_out) +bool fpga_multicorrelator_8sc::set_output_vectors(gr_complex* corr_out) { // Save CPU pointers d_corr_out = corr_out; - return true; } - void fpga_multicorrelator_8sc::update_local_code(float rem_code_phase_chips) { d_rem_code_phase_chips = rem_code_phase_chips; - fpga_multicorrelator_8sc::fpga_compute_code_shift_parameters(); fpga_multicorrelator_8sc::fpga_configure_code_parameters_in_fpga(); } @@ -120,32 +128,31 @@ bool fpga_multicorrelator_8sc::Carrier_wipeoff_multicorrelator_resampler( int signal_length_samples) { update_local_code(rem_code_phase_chips); - d_rem_carrier_phase_in_rad = rem_carrier_phase_in_rad; d_code_phase_step_chips = code_phase_step_chips; d_phase_step_rad = phase_step_rad; d_correlator_length_samples = signal_length_samples; - - fpga_multicorrelator_8sc::fpga_compute_signal_parameters_in_fpga(); - fpga_multicorrelator_8sc::fpga_configure_signal_parameters_in_fpga(); + +// if (first_time == 1) +// { + fpga_multicorrelator_8sc::fpga_compute_signal_parameters_in_fpga(); + fpga_multicorrelator_8sc::fpga_configure_signal_parameters_in_fpga(); +// first_time = 0; +// } + fpga_multicorrelator_8sc::fpga_launch_multicorrelator_fpga(); - int irq_count; ssize_t nb; - // wait for interrupt nb = read(d_device_descriptor, &irq_count, sizeof(irq_count)); if (nb != sizeof(irq_count)) { printf("Tracking_module Read failed to retrive 4 bytes!\n"); printf("Tracking_module Interrupt number %d\n", irq_count); } - fpga_multicorrelator_8sc::read_tracking_gps_results(); - return true; } - fpga_multicorrelator_8sc::fpga_multicorrelator_8sc(int n_correlators, std::string device_name, unsigned int device_base) { @@ -161,7 +168,7 @@ fpga_multicorrelator_8sc::fpga_multicorrelator_8sc(int n_correlators, d_initial_interp_counter = static_cast(volk_gnsssdr_malloc( n_correlators * sizeof(unsigned), volk_gnsssdr_get_alignment())); - d_local_code_in = nullptr; + //d_local_code_in = nullptr; d_shifts_chips = nullptr; d_corr_out = nullptr; d_code_length_chips = 0; @@ -172,22 +179,32 @@ fpga_multicorrelator_8sc::fpga_multicorrelator_8sc(int n_correlators, d_rem_carr_phase_rad_int = 0; d_phase_step_rad_int = 0; d_initial_sample_counter = 0; - d_channel = 0; d_correlator_length_samples = 0; + + // pre-compute all the codes + d_ca_codes = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS*NUM_PRNs) * sizeof(int), volk_gnsssdr_get_alignment())); + for (unsigned int PRN = 1; PRN <= NUM_PRNs; PRN++) + { + //gps_l1_ca_code_gen_int(&d_ca_codes[GPS_L1_CA_CODE_LENGTH_CHIPS*(PRN -1)], PRN, 0); + gps_l1_ca_code_gen_int(&d_ca_codes[(int(GPS_L1_CA_CODE_LENGTH_CHIPS)) * (PRN - 1)], PRN, 0); + } + DLOG(INFO) << "TRACKING FPGA CLASS CREATED"; + } fpga_multicorrelator_8sc::~fpga_multicorrelator_8sc() { - close(d_device_descriptor); + delete[] d_ca_codes; + close_device(); } bool fpga_multicorrelator_8sc::free() { - // unlock the hardware - fpga_multicorrelator_8sc::unlock_channel(); // unlock the channel + // unlock the channel + fpga_multicorrelator_8sc::unlock_channel(); // free the FPGA dynamically created variables if (d_initial_index != nullptr) @@ -209,23 +226,19 @@ bool fpga_multicorrelator_8sc::free() void fpga_multicorrelator_8sc::set_channel(unsigned int channel) { char device_io_name[MAX_LENGTH_DEVICEIO_NAME]; // driver io name - d_channel = channel; // open the device corresponding to the assigned channel std::string mergedname; std::stringstream devicebasetemp; - int numdevice = d_device_base + d_channel; devicebasetemp << numdevice; mergedname = d_device_name + devicebasetemp.str(); strcpy(device_io_name, mergedname.c_str()); - printf("Opening Device Name : %s\n", device_io_name); if ((d_device_descriptor = open(device_io_name, O_RDWR | O_SYNC)) == -1) { LOG(WARNING) << "Cannot open deviceio" << device_io_name; } - d_map_base = reinterpret_cast(mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, d_device_descriptor, 0)); @@ -263,12 +276,11 @@ unsigned fpga_multicorrelator_8sc::fpga_acquisition_test_register( } -void fpga_multicorrelator_8sc::fpga_configure_tracking_gps_local_code(void) +void fpga_multicorrelator_8sc::fpga_configure_tracking_gps_local_code(int PRN) { int k, s; unsigned code_chip; unsigned select_fpga_correlator; - select_fpga_correlator = 0; for (s = 0; s < d_n_correlators; s++) @@ -276,7 +288,8 @@ void fpga_multicorrelator_8sc::fpga_configure_tracking_gps_local_code(void) d_map_base[11] = LOCAL_CODE_FPGA_CLEAR_ADDRESS_COUNTER; for (k = 0; k < d_code_length_chips; k++) { - if (lv_creal(d_local_code_in[k]) == 1) + //if (d_local_code_in[k] == 1) + if (d_ca_codes[((int(GPS_L1_CA_CODE_LENGTH_CHIPS)) * (PRN - 1)) + k] == 1) { code_chip = 1; } @@ -301,18 +314,16 @@ void fpga_multicorrelator_8sc::fpga_compute_code_shift_parameters(void) for (i = 0; i < d_n_correlators; i++) { - // initial index calculation temp_calculation = floor( - d_shifts_chips[i] + d_rem_code_phase_chips); + d_shifts_chips[i] - d_rem_code_phase_chips); + if (temp_calculation < 0) { temp_calculation = temp_calculation + d_code_length_chips; // % operator does not work as in Matlab with negative numbers } d_initial_index[i] = static_cast( (static_cast(temp_calculation)) % d_code_length_chips); - - // initial interpolator counter calculation - temp_calculation = fmod(d_shifts_chips[i] + d_rem_code_phase_chips, - 1.0); + temp_calculation = fmod(d_shifts_chips[i] - d_rem_code_phase_chips, + 1.0); if (temp_calculation < 0) { temp_calculation = temp_calculation + 1.0; // fmod operator does not work as in Matlab with negative numbers @@ -339,7 +350,6 @@ void fpga_multicorrelator_8sc::fpga_compute_signal_parameters_in_fpga(void) float d_rem_carrier_phase_in_rad_temp; d_code_phase_step_chips_num = static_cast( roundf(MAX_CODE_RESAMPLER_COUNTER * d_code_phase_step_chips)); - if (d_rem_carrier_phase_in_rad > M_PI) { d_rem_carrier_phase_in_rad_temp = -2 * M_PI @@ -354,11 +364,9 @@ void fpga_multicorrelator_8sc::fpga_compute_signal_parameters_in_fpga(void) { d_rem_carrier_phase_in_rad_temp = d_rem_carrier_phase_in_rad; } - d_rem_carr_phase_rad_int = static_cast( roundf( (fabs(d_rem_carrier_phase_in_rad_temp) / M_PI) * pow(2, PHASE_CARR_NBITS_FRAC))); - if (d_rem_carrier_phase_in_rad_temp < 0) { d_rem_carr_phase_rad_int = -d_rem_carr_phase_rad_int; @@ -379,7 +387,6 @@ void fpga_multicorrelator_8sc::fpga_configure_signal_parameters_in_fpga(void) d_map_base[7] = d_correlator_length_samples - 1; d_map_base[9] = d_rem_carr_phase_rad_int; d_map_base[10] = d_phase_step_rad_int; - d_map_base[13] = d_initial_sample_counter; } @@ -389,7 +396,8 @@ void fpga_multicorrelator_8sc::fpga_launch_multicorrelator_fpga(void) int reenable = 1; write(d_device_descriptor, reinterpret_cast(&reenable), sizeof(int)); - d_map_base[14] = 0; // writing anything to reg 14 launches the tracking + // writing 1 to reg 14 launches the tracking + d_map_base[14] = 1; } @@ -414,8 +422,7 @@ void fpga_multicorrelator_8sc::read_tracking_gps_results(void) readval_imag = -2097152 + readval_imag; } readval_imag = readval_imag * 2; // the results are shifted two bits to the left due to the complex multiplier in the FPGA - - d_corr_out[k] = lv_cmake(readval_real, readval_imag); + d_corr_out[k] = gr_complex(readval_real,readval_imag); } } @@ -426,6 +433,20 @@ void fpga_multicorrelator_8sc::unlock_channel(void) d_map_base[12] = 1; // unlock the channel } +void fpga_multicorrelator_8sc::close_device() +{ + unsigned * aux = const_cast(d_map_base); + if (munmap(static_cast(aux), PAGE_SIZE) == -1) + { + printf("Failed to unmap memory uio\n"); + } +/* else + { + printf("memory uio unmapped\n"); + } */ + close(d_device_descriptor); +} + void fpga_multicorrelator_8sc::lock_channel(void) { @@ -433,3 +454,16 @@ void fpga_multicorrelator_8sc::lock_channel(void) d_map_base[12] = 0; // lock the channel } +void fpga_multicorrelator_8sc::read_sample_counters(int *sample_counter, int *secondary_sample_counter, int *counter_corr_0_in, int *counter_corr_0_out) +{ + *sample_counter = d_map_base[11]; + *secondary_sample_counter = d_map_base[8]; + *counter_corr_0_in = d_map_base[10]; + *counter_corr_0_out = d_map_base[9]; + +} + +void fpga_multicorrelator_8sc::reset_multicorrelator(void) +{ + d_map_base[14] = 2; // writing a 2 to d_map_base[14] resets the multicorrelator +} diff --git a/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.h b/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.h index 801ae5332..0b726e121 100644 --- a/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.h +++ b/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.h @@ -37,6 +37,7 @@ #ifndef GNSS_SDR_FPGA_MULTICORRELATOR_8SC_H_ #define GNSS_SDR_FPGA_MULTICORRELATOR_8SC_H_ +#include #include #define MAX_LENGTH_DEVICEIO_NAME 50 @@ -49,22 +50,30 @@ class fpga_multicorrelator_8sc public: fpga_multicorrelator_8sc(int n_correlators, std::string device_name, unsigned int device_base); - ~fpga_multicorrelator_8sc();bool set_local_code_and_taps( - int code_length_chips, const lv_16sc_t* local_code_in, - float *shifts_chips);bool set_output_vectors(lv_16sc_t* corr_out); + ~fpga_multicorrelator_8sc(); + bool set_output_vectors(gr_complex* corr_out); +// bool set_local_code_and_taps( +// int code_length_chips, const int* local_code_in, +// float *shifts_chips, int PRN); + bool set_local_code_and_taps( + int code_length_chips, + float *shifts_chips, int PRN); + bool set_output_vectors(lv_16sc_t* corr_out); void update_local_code(float rem_code_phase_chips);bool Carrier_wipeoff_multicorrelator_resampler( float rem_carrier_phase_in_rad, float phase_step_rad, float rem_code_phase_chips, float code_phase_step_chips, int signal_length_samples);bool free(); - void set_channel(unsigned int channel); void set_initial_sample(int samples_offset); + int read_sample_counter(); void lock_channel(void); void unlock_channel(void); - + void read_sample_counters(int *sample_counter, int *secondary_sample_counter, int *counter_corr_0_in, int *counter_corr_0_out); // debug + + private: - const lv_16sc_t *d_local_code_in; - lv_16sc_t *d_corr_out; + //const int *d_local_code_in; + gr_complex * d_corr_out; float *d_shifts_chips; int d_code_length_chips; int d_n_correlators; @@ -94,21 +103,23 @@ private: std::string d_device_name; unsigned int d_device_base; - // results - //int *d_readval_real; - //int *d_readval_imag; - // FPGA private functions + + int* d_ca_codes; + + // private functions unsigned fpga_acquisition_test_register(unsigned writeval); - void fpga_configure_tracking_gps_local_code(void); + void fpga_configure_tracking_gps_local_code(int PRN); void fpga_compute_code_shift_parameters(void); void fpga_configure_code_parameters_in_fpga(void); void fpga_compute_signal_parameters_in_fpga(void); void fpga_configure_signal_parameters_in_fpga(void); void fpga_launch_multicorrelator_fpga(void); void read_tracking_gps_results(void); - - //void unlock_channel(void); - + void reset_multicorrelator(void); + void close_device(void); + + // debug + //unsigned int first_time = 1; }; #endif /* GNSS_SDR_FPGA_MULTICORRELATOR_H_ */ diff --git a/src/algorithms/tracking/libs/fpga_multicorrelator_real_codes_8sc.cc b/src/algorithms/tracking/libs/fpga_multicorrelator_real_codes_8sc.cc new file mode 100644 index 000000000..942cadaff --- /dev/null +++ b/src/algorithms/tracking/libs/fpga_multicorrelator_real_codes_8sc.cc @@ -0,0 +1,148 @@ +/*! + * \file fpga_multicorrelator_real_codes_8sc.cc + * \brief High optimized CPU vector multiTAP correlator class with real-valued local codes + * \authors
    + *
  • Javier Arribas, 2015. jarribas(at)cttc.es + *
  • Cillian O'Driscoll, 2017. cillian.odriscoll(at)gmail.com + *
+ * + * Class that implements a high optimized vector multiTAP correlator class for CPUs + * + * ------------------------------------------------------------------------- + * + * Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors) + * + * GNSS-SDR is a software defined Global Navigation + * Satellite Systems receiver + * + * This file is part of GNSS-SDR. + * + * GNSS-SDR is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GNSS-SDR is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNSS-SDR. If not, see . + * + * ------------------------------------------------------------------------- + */ + +//#include "cpu_multicorrelator_real_codes.h" +#include "fpga_multicorrelator_real_codes_8sc.h" +#include +#include +#include + + +fpga_multicorrelator_real_codes_8sc::fpga_multicorrelator_real_codes_8sc() +{ + d_sig_in = nullptr; + d_local_code_in = nullptr; + d_shifts_chips = nullptr; + d_corr_out = nullptr; + d_local_codes_resampled = nullptr; + d_code_length_chips = 0; + d_n_correlators = 0; +} + + +fpga_multicorrelator_real_codes_8sc::~fpga_multicorrelator_real_codes_8sc() +{ + if(d_local_codes_resampled != nullptr) + { + fpga_multicorrelator_real_codes_8sc::free(); + } +} + + +bool fpga_multicorrelator_real_codes_8sc::init( + int max_signal_length_samples, + int n_correlators) +{ + // ALLOCATE MEMORY FOR INTERNAL vectors + size_t size = max_signal_length_samples * sizeof(float); + + d_local_codes_resampled = static_cast(volk_gnsssdr_malloc(n_correlators * sizeof(float*), volk_gnsssdr_get_alignment())); + for (int n = 0; n < n_correlators; n++) + { + d_local_codes_resampled[n] = static_cast(volk_gnsssdr_malloc(size, volk_gnsssdr_get_alignment())); + } + d_n_correlators = n_correlators; + return true; +} + + + +bool fpga_multicorrelator_real_codes_8sc::set_local_code_and_taps( + int code_length_chips, + const float* local_code_in, + float *shifts_chips) +{ + d_local_code_in = local_code_in; + d_shifts_chips = shifts_chips; + d_code_length_chips = code_length_chips; + return true; +} + + +bool fpga_multicorrelator_real_codes_8sc::set_input_output_vectors(std::complex* corr_out, const std::complex* sig_in) +{ + // Save CPU pointers + d_sig_in = sig_in; + d_corr_out = corr_out; + return true; +} + + +void fpga_multicorrelator_real_codes_8sc::update_local_code(int correlator_length_samples, float rem_code_phase_chips, float code_phase_step_chips) +{ + volk_gnsssdr_32f_xn_resampler_32f_xn(d_local_codes_resampled, + d_local_code_in, + rem_code_phase_chips, + code_phase_step_chips, + d_shifts_chips, + d_code_length_chips, + d_n_correlators, + correlator_length_samples); +} + + +bool fpga_multicorrelator_real_codes_8sc::Carrier_wipeoff_multicorrelator_resampler( + float rem_carrier_phase_in_rad, + float phase_step_rad, + float rem_code_phase_chips, + float code_phase_step_chips, + int signal_length_samples) +{ + update_local_code(signal_length_samples, rem_code_phase_chips, code_phase_step_chips); + // Regenerate phase at each call in order to avoid numerical issues + lv_32fc_t phase_offset_as_complex[1]; + phase_offset_as_complex[0] = lv_cmake(std::cos(rem_carrier_phase_in_rad), -std::sin(rem_carrier_phase_in_rad)); + // call VOLK_GNSSSDR kernel + volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn(d_corr_out, d_sig_in, std::exp(lv_32fc_t(0, - phase_step_rad)), phase_offset_as_complex, (const float**)d_local_codes_resampled, d_n_correlators, signal_length_samples); + return true; +} + + +bool fpga_multicorrelator_real_codes_8sc::free() +{ + // Free memory + if (d_local_codes_resampled != nullptr) + { + for (int n = 0; n < d_n_correlators; n++) + { + volk_gnsssdr_free(d_local_codes_resampled[n]); + } + volk_gnsssdr_free(d_local_codes_resampled); + d_local_codes_resampled = nullptr; + } + return true; +} + + diff --git a/src/algorithms/tracking/libs/fpga_multicorrelator_real_codes_8sc.h b/src/algorithms/tracking/libs/fpga_multicorrelator_real_codes_8sc.h new file mode 100644 index 000000000..94d855ff8 --- /dev/null +++ b/src/algorithms/tracking/libs/fpga_multicorrelator_real_codes_8sc.h @@ -0,0 +1,73 @@ +/*! + * \file fpga_multicorrelator_real_codes_8sc.h + * \brief High optimized CPU vector multiTAP correlator class using real-valued local codes + * \authors
    + *
  • Javier Arribas, 2015. jarribas(at)cttc.es + *
  • Cillian O'Driscoll, 2017, cillian.odriscoll(at)gmail.com + *
+ * + * Class that implements a high optimized vector multiTAP correlator class for CPUs + * + * ------------------------------------------------------------------------- + * + * Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors) + * + * GNSS-SDR is a software defined Global Navigation + * Satellite Systems receiver + * + * This file is part of GNSS-SDR. + * + * GNSS-SDR is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GNSS-SDR is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNSS-SDR. If not, see . + * + * ------------------------------------------------------------------------- + */ + +//#ifndef GNSS_SDR_CPU_MULTICORRELATOR_REAL_CODES_H_ +//#define GNSS_SDR_CPU_MULTICORRELATOR_REAL_CODES_H_ + +#ifndef GNSS_SDR_FPGA_MULTICORRELATOR_REAL_CODES_8SC_H_ +#define GNSS_SDR_FPGA_MULTICORRELATOR_REAL_CODES_8SC_H_ + + +#include + +/*! + * \brief Class that implements carrier wipe-off and correlators. + */ +class fpga_multicorrelator_real_codes_8sc +{ +public: + fpga_multicorrelator_real_codes_8sc(); + ~fpga_multicorrelator_real_codes_8sc(); + bool init(int max_signal_length_samples, int n_correlators); + bool set_local_code_and_taps(int code_length_chips, const float* local_code_in, float *shifts_chips); + bool set_input_output_vectors(std::complex* corr_out, const std::complex* sig_in); + void update_local_code(int correlator_length_samples, float rem_code_phase_chips, float code_phase_step_chips); + bool Carrier_wipeoff_multicorrelator_resampler(float rem_carrier_phase_in_rad, float phase_step_rad, float rem_code_phase_chips, float code_phase_step_chips, int signal_length_samples); + bool free(); + +private: + // Allocate the device input vectors + const std::complex *d_sig_in; + float **d_local_codes_resampled; + const float *d_local_code_in; + std::complex *d_corr_out; + float *d_shifts_chips; + int d_code_length_chips; + int d_n_correlators; +}; + + +#endif /* GNSS_SDR_FPGA_MULTICORRELATOR_REAL_CODES_8SC_H_ */ + diff --git a/src/core/receiver/gnss_block_factory.cc b/src/core/receiver/gnss_block_factory.cc index e7d096fab..d64dcb9a9 100644 --- a/src/core/receiver/gnss_block_factory.cc +++ b/src/core/receiver/gnss_block_factory.cc @@ -100,8 +100,8 @@ #include "rtklib_pvt.h" #if ENABLE_FPGA -#include "gps_l1_ca_dll_pll_c_aid_tracking_fpga.h" #include "gps_l1_ca_pcps_acquisition_fpga.h" +#include "gps_l1_ca_dll_pll_tracking_fpga.h" #endif #if OPENCL_BLOCKS @@ -1318,9 +1318,9 @@ std::unique_ptr GNSSBlockFactory::GetBlock( block = std::move(block_); } #if ENABLE_FPGA - else if (implementation.compare("GPS_L1_CA_DLL_PLL_C_Aid_Tracking_Fpga") == 0) + else if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking_Fpga") == 0) { - std::unique_ptr block_(new GpsL1CaDllPllCAidTrackingFpga(configuration.get(), role, in_streams, + std::unique_ptr block_(new GpsL1CaDllPllTrackingFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } @@ -1607,9 +1607,9 @@ std::unique_ptr GNSSBlockFactory::GetTrkBlock( block = std::move(block_); } #if ENABLE_FPGA - else if (implementation.compare("GPS_L1_CA_DLL_PLL_C_Aid_Tracking_Fpga") == 0) + else if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking_Fpga") == 0) { - std::unique_ptr block_(new GpsL1CaDllPllCAidTrackingFpga(configuration.get(), role, in_streams, + std::unique_ptr block_(new GpsL1CaDllPllTrackingFpga(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc index da2b3eb9c..91c611d2d 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc @@ -33,6 +33,7 @@ #include #include +#include #include #include #include // to test the FPGA we have to create a simultaneous task to send the samples using the DMA and stop the test @@ -53,7 +54,8 @@ #include "tracking_interface.h" #include "in_memory_configuration.h" #include "gnss_synchro.h" -#include "gps_l1_ca_dll_pll_c_aid_tracking_fpga.h" +//#include "gps_l1_ca_dll_pll_c_aid_tracking_fpga.h" +#include "gps_l1_ca_dll_pll_tracking_fpga.h" #include "tracking_true_obs_reader.h" #include "tracking_dump_reader.h" #include "signal_generator_flags.h" @@ -310,8 +312,10 @@ void GpsL1CADllPllTrackingTestFpga::configure_receiver() config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(baseband_sampling_freq)); // Set Tracking + //config->set_property("Tracking_1C.implementation", + // "GPS_L1_CA_DLL_PLL_C_Aid_Tracking_Fpga"); config->set_property("Tracking_1C.implementation", - "GPS_L1_CA_DLL_PLL_C_Aid_Tracking_Fpga"); + "GPS_L1_CA_DLL_PLL_Tracking_Fpga"); config->set_property("Tracking_1C.item_type", "cshort"); config->set_property("Tracking_1C.if", "0"); config->set_property("Tracking_1C.dump", "true"); @@ -467,7 +471,8 @@ TEST_F(GpsL1CADllPllTrackingTestFpga, ValidationOfResultsFpga) }) << "Failure opening true observables file"; top_block = gr::make_top_block("Tracking test"); - std::shared_ptr tracking = std::make_shared (config.get(), "Tracking_1C", 1, 1); + //std::shared_ptr tracking = std::make_shared (config.get(), "Tracking_1C", 1, 1); + std::shared_ptr tracking = std::make_shared (config.get(), "Tracking_1C", 1, 1); boost::shared_ptr msg_rx = GpsL1CADllPllTrackingTestFpga_msg_rx_make(); From 376de5807fd0fd7d044a15b2395d147258cae902 Mon Sep 17 00:00:00 2001 From: mmajoral Date: Tue, 20 Mar 2018 18:06:20 +0100 Subject: [PATCH 04/82] Added FPGA-related changes --- src/core/receiver/control_thread.cc | 7 ++++++ src/core/receiver/gnss_flowgraph.cc | 33 ++++++++++++++++++++++++++++- src/core/receiver/gnss_flowgraph.h | 2 ++ 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index db3e3841b..15646a4d3 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -138,6 +138,13 @@ void ControlThread::run() keyboard_thread_ = boost::thread(&ControlThread::keyboard_listener, this); sysv_queue_thread_ = boost::thread(&ControlThread::sysv_queue_listener, this); + bool enable_FPGA = configuration_->property("Channel.enable_FPGA", false); + + if (enable_FPGA == true) + { + flowgraph_->start_acquisition_helper(); + } + // Main loop to read and process the control messages while (flowgraph_->running() && !stop_) { diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index e379220a5..b30c18c8d 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -107,6 +107,8 @@ void GNSSFlowgraph::connect() } for (int i = 0; i < sources_count_; i++) + { + if (configuration_->property(sig_source_.at(i)->role() + ".enable_FPGA", false)==false) { try { @@ -120,9 +122,12 @@ void GNSSFlowgraph::connect() return; } } + } // Signal Source > Signal conditioner > for (unsigned int i = 0; i < sig_conditioner_.size(); i++) + { + if (configuration_->property(sig_conditioner_.at(i)->role() + ".enable_FPGA", false)==false) { try { @@ -136,6 +141,7 @@ void GNSSFlowgraph::connect() return; } } + } for (unsigned int i = 0; i < channels_count_; i++) { @@ -184,6 +190,10 @@ void GNSSFlowgraph::connect() for (int i = 0; i < sources_count_; i++) { + //FPGA Accelerators do not need signal sources or conditioners + //as the samples are feed directly to the FPGA fabric, so, if enabled, do not connect any source + if (configuration_->property(sig_source_.at(i)->role() + ".enable_FPGA", false)==false) + { try { //TODO: Remove this array implementation and create generic multistream connector @@ -244,12 +254,17 @@ void GNSSFlowgraph::connect() return; } } + } DLOG(INFO) << "Signal source connected to signal conditioner"; // Signal conditioner (selected_signal_source) >> channels (i) (dependent of their associated SignalSource_ID) int selected_signal_conditioner_ID; for (unsigned int i = 0; i < channels_count_; i++) { + + bool FPGA_enabled = configuration_->property(sig_conditioner_.at(selected_signal_conditioner_ID)->role() + ".enable_FPGA", false); + if (FPGA_enabled == false) + { selected_signal_conditioner_ID = configuration_->property("Channel" + boost::lexical_cast(i) + ".RF_channel_ID", 0); try { @@ -265,7 +280,7 @@ void GNSSFlowgraph::connect() } DLOG(INFO) << "signal conditioner " << selected_signal_conditioner_ID << " connected to channel " << i; - + } // Signal Source > Signal conditioner >> Channels >> Observables try { @@ -285,7 +300,10 @@ void GNSSFlowgraph::connect() if (channels_state_[i] == 1) { + if (FPGA_enabled == false) + { channels_.at(i)->start_acquisition(); + } available_GNSS_signals_.pop_front(); LOG(INFO) << "Channel " << i << " assigned to " << channels_.at(i)->get_signal(); LOG(INFO) << "Channel " << i << " connected to observables and ready for acquisition"; @@ -295,11 +313,14 @@ void GNSSFlowgraph::connect() LOG(INFO) << "Channel " << i << " connected to observables in standby mode"; } //connect the sample counter to the channel 0 + if (FPGA_enabled == false) + { if (i == 0) { ch_out_sample_counter = gnss_sdr_make_sample_counter(); top_block_->connect(channels_.at(i)->get_right_block(), 0, ch_out_sample_counter, 0); } + } } /* @@ -326,6 +347,16 @@ void GNSSFlowgraph::connect() top_block_->dump(); } +void GNSSFlowgraph::start_acquisition_helper() +{ + for (unsigned int i = 0; i < channels_count_; i++) + { + if (channels_state_[i] == 1) + { + channels_.at(i)->start_acquisition(); + } + } +} void GNSSFlowgraph::wait() { diff --git a/src/core/receiver/gnss_flowgraph.h b/src/core/receiver/gnss_flowgraph.h index 615ee0dc4..a0f09e4bf 100644 --- a/src/core/receiver/gnss_flowgraph.h +++ b/src/core/receiver/gnss_flowgraph.h @@ -86,6 +86,8 @@ public: void wait(); + void start_acquisition_helper(); + /*! * \brief Applies an action to the flowgraph * From ec09016750f2634d9c8eb8d4e8de32f2d4e651d5 Mon Sep 17 00:00:00 2001 From: Javier Arribas Date: Tue, 27 Mar 2018 14:24:07 +0200 Subject: [PATCH 05/82] Adding Local Oscillator generation for dual band operation using AD9361 FPGA source. Bug fix in FPGA flowgraph --- .../adapters/ad9361_fpga_signal_source.cc | 182 ++++++++++++++++++ .../adapters/ad9361_fpga_signal_source.h | 8 + .../signal_source/libs/ad9361_manager.cc | 166 ++++++++++++++++ .../signal_source/libs/ad9361_manager.h | 130 +++++++++++++ src/core/receiver/gnss_flowgraph.cc | 3 +- 5 files changed, 488 insertions(+), 1 deletion(-) create mode 100644 src/algorithms/signal_source/libs/ad9361_manager.cc create mode 100644 src/algorithms/signal_source/libs/ad9361_manager.h diff --git a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc index 3aaf74a79..ff6860499 100644 --- a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc +++ b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc @@ -33,6 +33,7 @@ #include "ad9361_fpga_signal_source.h" #include "configuration_interface.h" #include "GPS_L1_CA.h" +#include "GPS_L2C.h" #include #include #include @@ -191,6 +192,13 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(ConfigurationInterface* configura dump_ = configuration->property(role + ".dump", false); dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file); + enable_dds_lo_=configuration->property(role + ".enable_dds_lo", false); + freq_rf_tx_hz_=configuration->property(role + ".freq_rf_tx_hz", GPS_L1_FREQ_HZ-GPS_L2_FREQ_HZ-1000); + freq_dds_tx_hz_=configuration->property(role + ".freq_dds_tx_hz", 1000); + scale_dds_dbfs_=configuration->property(role + ".scale_dds_dbfs", -3.0); + phase_dds_deg_=configuration->property(role + ".phase_dds_deg", 0.0); + tx_attenuation_db_=configuration->property(role + ".tx_attenuation_db", 0.0); + item_size_ = sizeof(gr_complex); std::cout << "device address: " << uri_ << std::endl; @@ -199,6 +207,8 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(ConfigurationInterface* configura // AD9361 Frontend IC device operation + int ret; + // Streaming devices struct iio_device *rx; @@ -258,6 +268,151 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(ConfigurationInterface* configura iio_channel_enable(rx0_i); iio_channel_enable(rx0_q); + + + struct iio_device *ad9361_phy; + ad9361_phy= iio_context_find_device(ctx, "ad9361-phy"); + ret=iio_device_attr_write(ad9361_phy,"trx_rate_governor","nominal"); + if (ret < 0) { + std::cout<<"Failed to set trx_rate_governor: "<. + * + * ------------------------------------------------------------------------- + */ +#include "ad9361_manager.h" +#include +#include //only for snprintf +#include +#include + +/* check return value of attr_write function */ +static void errchk(int v, const char* what) { + if (v < 0) + { + LOG(WARNING)<<"Error "<rfport); + wr_ch_lli(chn, "rf_bandwidth", cfg->bw_hz); + wr_ch_lli(chn, "sampling_frequency", cfg->fs_hz); + + // Configure LO channel + LOG(INFO)<<"* Acquiring AD9361 "<lo_hz); + return true; +} + + +static bool set_dds_cw_tone(struct iio_device *dac1, struct iio_channel *chn, double freq_hz, double scale_dbfs, double phase_deg) +{ + + //ENABLE DDS + int ret; + ret = iio_channel_attr_write_bool(iio_device_find_channel(dac1, "altvoltage0", true), "raw", true); + if (ret < 0) { + std::cout<<"Failed to toggle DDS: "<. + * + * ------------------------------------------------------------------------- + */ + +#ifndef __AD9361_MANAGER__ +#define __AD9361_MANAGER__ + + +#ifdef __APPLE__ +#include +#else +#include +#endif + + + +/* RX is input, TX is output */ +enum iodev { RX, TX }; + +/* common RX and TX streaming params */ +struct stream_cfg { + long long bw_hz; // Analog banwidth in Hz + long long fs_hz; // Baseband sample rate in Hz + long long lo_hz; // Local oscillator frequency in Hz + const char* rfport; // Port name +}; + + +enum dds_tone_type { + TX1_T1_I, + TX1_T2_I, + TX1_T1_Q, + TX1_T2_Q, + TX2_T1_I, + TX2_T2_I, + TX2_T1_Q, + TX2_T2_Q, + TX3_T1_I, + TX3_T2_I, + TX3_T1_Q, + TX3_T2_Q, + TX4_T1_I, + TX4_T2_I, + TX4_T1_Q, + TX4_T2_Q +}; + +enum dds_widget_type { + WIDGET_FREQUENCY, + WIDGET_SCALE, + WIDGET_PHASE +}; + +#define DDS_DISABLED 0 +#define DDS_ONE_TONE 1 +#define DDS_TWO_TONE 2 +#define DDS_INDEPDENT 3 +#define DDS_BUFFER 4 + + +/* static scratch mem for strings */ +static char tmpstr[64]; + +/* IIO structs required for streaming */ +static struct iio_context *ctx = NULL; +static struct iio_channel *rx0_i = NULL; +static struct iio_channel *rx0_q = NULL; + +/* check return value of attr_write function */ +static void errchk(int v, const char* what); + +/* write attribute: long long int */ +static void wr_ch_lli(struct iio_channel *chn, const char* what, long long val); + +/* write attribute: string */ +static void wr_ch_str(struct iio_channel *chn, const char* what, const char* str); + +/* helper function generating channel names */ +static char* get_ch_name(const char* type, int id); + +/* returns ad9361 phy device */ +static struct iio_device* get_ad9361_phy(struct iio_context *ctx); + +/* finds AD9361 streaming IIO devices */ +static bool get_ad9361_stream_dev(struct iio_context *ctx, enum iodev d, struct iio_device **dev); + +/* finds AD9361 streaming IIO channels */ +static bool get_ad9361_stream_ch(struct iio_context *ctx, enum iodev d, struct iio_device *dev, int chid, struct iio_channel **chn); + +/* finds AD9361 phy IIO configuration channel with id chid */ +static bool get_phy_chan(struct iio_context *ctx, enum iodev d, int chid, struct iio_channel **chn); + +/* finds AD9361 local oscillator IIO configuration channels */ +static bool get_lo_chan(struct iio_context *ctx, enum iodev d, struct iio_channel **chn); + +/* applies streaming configuration through IIO */ +bool cfg_ad9361_streaming_ch(struct iio_context *ctx, struct stream_cfg *cfg, enum iodev type, int chid); + + +static bool set_dds_cw_tone(struct iio_device *dac1, double freq_hz, double scale_dbfs, double phase_deg); + +#endif diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index b30c18c8d..8ba25be7f 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -262,7 +262,8 @@ void GNSSFlowgraph::connect() for (unsigned int i = 0; i < channels_count_; i++) { - bool FPGA_enabled = configuration_->property(sig_conditioner_.at(selected_signal_conditioner_ID)->role() + ".enable_FPGA", false); + bool FPGA_enabled = configuration_->property(sig_source_.at(0)->role() + ".enable_FPGA", false); + if (FPGA_enabled == false) { selected_signal_conditioner_ID = configuration_->property("Channel" + boost::lexical_cast(i) + ".RF_channel_ID", 0); From 428a2eb1b5565e101e09a7514e8a53b0253cdf5e Mon Sep 17 00:00:00 2001 From: Javier Arribas Date: Tue, 27 Mar 2018 14:44:56 +0200 Subject: [PATCH 06/82] Removing unused files --- .../signal_source/libs/ad9361_manager.cc | 166 ------------------ .../signal_source/libs/ad9361_manager.h | 130 -------------- 2 files changed, 296 deletions(-) delete mode 100644 src/algorithms/signal_source/libs/ad9361_manager.cc delete mode 100644 src/algorithms/signal_source/libs/ad9361_manager.h diff --git a/src/algorithms/signal_source/libs/ad9361_manager.cc b/src/algorithms/signal_source/libs/ad9361_manager.cc deleted file mode 100644 index 370d3e531..000000000 --- a/src/algorithms/signal_source/libs/ad9361_manager.cc +++ /dev/null @@ -1,166 +0,0 @@ -/*! - * \file ad9361_manager.cc - * \brief An Analog Devices AD9361 front-end configuration library wrapper for configure some functions via iiod link. - * \author Javier Arribas, jarribas(at)cttc.es - * - * This file contains information taken from librtlsdr: - * http://git.osmocom.org/rtl-sdr/ - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * GNSS-SDR is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GNSS-SDR is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNSS-SDR. If not, see . - * - * ------------------------------------------------------------------------- - */ -#include "ad9361_manager.h" -#include -#include //only for snprintf -#include -#include - -/* check return value of attr_write function */ -static void errchk(int v, const char* what) { - if (v < 0) - { - LOG(WARNING)<<"Error "<rfport); - wr_ch_lli(chn, "rf_bandwidth", cfg->bw_hz); - wr_ch_lli(chn, "sampling_frequency", cfg->fs_hz); - - // Configure LO channel - LOG(INFO)<<"* Acquiring AD9361 "<lo_hz); - return true; -} - - -static bool set_dds_cw_tone(struct iio_device *dac1, struct iio_channel *chn, double freq_hz, double scale_dbfs, double phase_deg) -{ - - //ENABLE DDS - int ret; - ret = iio_channel_attr_write_bool(iio_device_find_channel(dac1, "altvoltage0", true), "raw", true); - if (ret < 0) { - std::cout<<"Failed to toggle DDS: "<. - * - * ------------------------------------------------------------------------- - */ - -#ifndef __AD9361_MANAGER__ -#define __AD9361_MANAGER__ - - -#ifdef __APPLE__ -#include -#else -#include -#endif - - - -/* RX is input, TX is output */ -enum iodev { RX, TX }; - -/* common RX and TX streaming params */ -struct stream_cfg { - long long bw_hz; // Analog banwidth in Hz - long long fs_hz; // Baseband sample rate in Hz - long long lo_hz; // Local oscillator frequency in Hz - const char* rfport; // Port name -}; - - -enum dds_tone_type { - TX1_T1_I, - TX1_T2_I, - TX1_T1_Q, - TX1_T2_Q, - TX2_T1_I, - TX2_T2_I, - TX2_T1_Q, - TX2_T2_Q, - TX3_T1_I, - TX3_T2_I, - TX3_T1_Q, - TX3_T2_Q, - TX4_T1_I, - TX4_T2_I, - TX4_T1_Q, - TX4_T2_Q -}; - -enum dds_widget_type { - WIDGET_FREQUENCY, - WIDGET_SCALE, - WIDGET_PHASE -}; - -#define DDS_DISABLED 0 -#define DDS_ONE_TONE 1 -#define DDS_TWO_TONE 2 -#define DDS_INDEPDENT 3 -#define DDS_BUFFER 4 - - -/* static scratch mem for strings */ -static char tmpstr[64]; - -/* IIO structs required for streaming */ -static struct iio_context *ctx = NULL; -static struct iio_channel *rx0_i = NULL; -static struct iio_channel *rx0_q = NULL; - -/* check return value of attr_write function */ -static void errchk(int v, const char* what); - -/* write attribute: long long int */ -static void wr_ch_lli(struct iio_channel *chn, const char* what, long long val); - -/* write attribute: string */ -static void wr_ch_str(struct iio_channel *chn, const char* what, const char* str); - -/* helper function generating channel names */ -static char* get_ch_name(const char* type, int id); - -/* returns ad9361 phy device */ -static struct iio_device* get_ad9361_phy(struct iio_context *ctx); - -/* finds AD9361 streaming IIO devices */ -static bool get_ad9361_stream_dev(struct iio_context *ctx, enum iodev d, struct iio_device **dev); - -/* finds AD9361 streaming IIO channels */ -static bool get_ad9361_stream_ch(struct iio_context *ctx, enum iodev d, struct iio_device *dev, int chid, struct iio_channel **chn); - -/* finds AD9361 phy IIO configuration channel with id chid */ -static bool get_phy_chan(struct iio_context *ctx, enum iodev d, int chid, struct iio_channel **chn); - -/* finds AD9361 local oscillator IIO configuration channels */ -static bool get_lo_chan(struct iio_context *ctx, enum iodev d, struct iio_channel **chn); - -/* applies streaming configuration through IIO */ -bool cfg_ad9361_streaming_ch(struct iio_context *ctx, struct stream_cfg *cfg, enum iodev type, int chid); - - -static bool set_dds_cw_tone(struct iio_device *dac1, double freq_hz, double scale_dbfs, double phase_deg); - -#endif From 982af827b4c973ec14aeb23cd7618750ec5a99d5 Mon Sep 17 00:00:00 2001 From: Javier Arribas Date: Tue, 27 Mar 2018 19:00:25 +0200 Subject: [PATCH 07/82] Group all ad9361 configuration calls in one library --- .../adapters/ad9361_fpga_signal_source.cc | 371 +-------- .../signal_source/libs/CMakeLists.txt | 47 +- .../signal_source/libs/ad9361_manager.cc | 704 ++++++++++++++++++ .../signal_source/libs/ad9361_manager.h | 127 ++++ 4 files changed, 898 insertions(+), 351 deletions(-) create mode 100644 src/algorithms/signal_source/libs/ad9361_manager.cc create mode 100644 src/algorithms/signal_source/libs/ad9361_manager.h diff --git a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc index ff6860499..cf9130767 100644 --- a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc +++ b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc @@ -32,6 +32,7 @@ #include "ad9361_fpga_signal_source.h" #include "configuration_interface.h" +#include "ad9361_manager.h" #include "GPS_L1_CA.h" #include "GPS_L2C.h" #include @@ -45,123 +46,6 @@ #include #endif - -/* RX is input, TX is output */ -enum iodev { RX, TX }; - -/* common RX and TX streaming params */ -struct stream_cfg { - long long bw_hz; // Analog banwidth in Hz - long long fs_hz; // Baseband sample rate in Hz - long long lo_hz; // Local oscillator frequency in Hz - const char* rfport; // Port name -}; - - -using google::LogMessage; - - -/* static scratch mem for strings */ -static char tmpstr[64]; - -/* IIO structs required for streaming */ -static struct iio_context *ctx = NULL; -static struct iio_channel *rx0_i = NULL; -static struct iio_channel *rx0_q = NULL; - -/* check return value of attr_write function */ -static void errchk(int v, const char* what) { - if (v < 0) { fprintf(stderr, "Error %d writing to channel \"%s\"\nvalue may not be supported.\n", v, what); } -} - -/* write attribute: long long int */ -static void wr_ch_lli(struct iio_channel *chn, const char* what, long long val) -{ - errchk(iio_channel_attr_write_longlong(chn, what, val), what); -} - -/* write attribute: string */ -static void wr_ch_str(struct iio_channel *chn, const char* what, const char* str) -{ - errchk(iio_channel_attr_write(chn, what, str), what); -} - - -/* helper function generating channel names */ -static char* get_ch_name(const char* type, int id) -{ - snprintf(tmpstr, sizeof(tmpstr), "%s%d", type, id); - return tmpstr; -} - -/* returns ad9361 phy device */ -static struct iio_device* get_ad9361_phy(struct iio_context *ctx) -{ - struct iio_device *dev = iio_context_find_device(ctx, "ad9361-phy"); - return dev; -} - -/* finds AD9361 streaming IIO devices */ -static bool get_ad9361_stream_dev(struct iio_context *ctx, enum iodev d, struct iio_device **dev) -{ - switch (d) { - case TX: *dev = iio_context_find_device(ctx, "cf-ad9361-dds-core-lpc"); return *dev != NULL; - case RX: *dev = iio_context_find_device(ctx, "cf-ad9361-lpc"); return *dev != NULL; - default: return false; - } -} - -/* finds AD9361 streaming IIO channels */ -static bool get_ad9361_stream_ch(struct iio_context *ctx, enum iodev d, struct iio_device *dev, int chid, struct iio_channel **chn) -{ - *chn = iio_device_find_channel(dev, get_ch_name("voltage", chid), d == TX); - if (!*chn) - *chn = iio_device_find_channel(dev, get_ch_name("altvoltage", chid), d == TX); - return *chn != NULL; -} - -/* finds AD9361 phy IIO configuration channel with id chid */ -static bool get_phy_chan(struct iio_context *ctx, enum iodev d, int chid, struct iio_channel **chn) -{ - switch (d) { - case RX: *chn = iio_device_find_channel(get_ad9361_phy(ctx), get_ch_name("voltage", chid), false); return *chn != NULL; - case TX: *chn = iio_device_find_channel(get_ad9361_phy(ctx), get_ch_name("voltage", chid), true); return *chn != NULL; - default: return false; - } -} - -/* finds AD9361 local oscillator IIO configuration channels */ -static bool get_lo_chan(struct iio_context *ctx, enum iodev d, struct iio_channel **chn) -{ - switch (d) { - // LO chan is always output, i.e. true - case RX: *chn = iio_device_find_channel(get_ad9361_phy(ctx), get_ch_name("altvoltage", 0), true); return *chn != NULL; - case TX: *chn = iio_device_find_channel(get_ad9361_phy(ctx), get_ch_name("altvoltage", 1), true); return *chn != NULL; - default: return false; - } -} - - -/* applies streaming configuration through IIO */ -bool cfg_ad9361_streaming_ch(struct iio_context *ctx, struct stream_cfg *cfg, enum iodev type, int chid) -{ - struct iio_channel *chn = NULL; - - // Configure phy and lo channels - printf("* Acquiring AD9361 phy channel %d\n", chid); - if (!get_phy_chan(ctx, type, chid, &chn)) { return false; } - wr_ch_str(chn, "rf_port_select", cfg->rfport); - wr_ch_lli(chn, "rf_bandwidth", cfg->bw_hz); - wr_ch_lli(chn, "sampling_frequency", cfg->fs_hz); - - // Configure LO channel - printf("* Acquiring AD9361 %s lo channel\n", type == TX ? "TX" : "RX"); - if (!get_lo_chan(ctx, type, &chn)) { return false; } - wr_ch_lli(chn, "frequency", cfg->lo_hz); - return true; -} - - Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(ConfigurationInterface* configuration, std::string role, unsigned int in_stream, unsigned int out_stream, boost::shared_ptr queue) : @@ -170,7 +54,6 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(ConfigurationInterface* configura { std::string default_item_type = "gr_complex"; std::string default_dump_file = "./data/signal_source.dat"; - uri_ = configuration->property(role + ".device_address", std::string("192.168.2.1")); freq_ = configuration->property(role + ".freq", GPS_L1_FREQ_HZ); sample_rate_ = configuration->property(role + ".sampling_frequency", 2600000); bandwidth_ = configuration->property(role + ".bandwidth", 2000000); @@ -205,212 +88,24 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(ConfigurationInterface* configura std::cout << "LO frequency : " << freq_ << " Hz" << std::endl; std::cout << "sample rate: " << sample_rate_ << " Hz" << std::endl; - - // AD9361 Frontend IC device operation - int ret; - - - // Streaming devices - struct iio_device *rx; - - // RX stream config - // Stream configurations - struct stream_cfg rxcfg; - rxcfg.bw_hz = bandwidth_; // 2 MHz rf bandwidth - rxcfg.fs_hz = sample_rate_; // 2.5 MS/s rx sample rate - rxcfg.lo_hz = freq_; // 2.5 GHz rf frequency - rxcfg.rfport = rf_port_select_.c_str(); // port A (select for rf freq.) - - - std::cout<<"AD9361 Acquiring IIO context\n"; - ctx = iio_create_default_context(); - if (!ctx) - { - std::cout<<"No context\n"; - throw std::runtime_error("AD9361 IIO No context"); - } - - if (iio_context_get_devices_count(ctx) <= 0) - { - std::cout<<"No devices\n"; - throw std::runtime_error("AD9361 IIO No devices"); - } - - std::cout<<"* Acquiring AD9361 streaming devices\n"; - - if(!get_ad9361_stream_dev(ctx, RX, &rx)) - { - std::cout<<"No rx dev found\n"; - throw std::runtime_error("AD9361 IIO No rx dev found"); - }; - - std::cout<<"* Configuring AD9361 for streaming\n"; - if (!cfg_ad9361_streaming_ch(ctx, &rxcfg, RX, 0)) - { - std::cout<<"RX port 0 not found\n"; - throw std::runtime_error("AD9361 IIO RX port 0 not found"); - } - - std::cout<<"* Initializing AD9361 IIO streaming channels\n"; - if (!get_ad9361_stream_ch(ctx, RX, rx, 0, &rx0_i)) - { - std::cout<<"RX chan i not found\n"; - throw std::runtime_error("RX chan i not found"); - } - - if (!get_ad9361_stream_ch(ctx, RX, rx, 1, &rx0_q)) - { - std::cout<<"RX chan q not found\n"; - throw std::runtime_error("RX chan q not found"); - } - - std::cout<<"* Enabling IIO streaming channels\n"; - iio_channel_enable(rx0_i); - iio_channel_enable(rx0_q); - - - - struct iio_device *ad9361_phy; - ad9361_phy= iio_context_find_device(ctx, "ad9361-phy"); - ret=iio_device_attr_write(ad9361_phy,"trx_rate_governor","nominal"); - if (ret < 0) { - std::cout<<"Failed to set trx_rate_governor: "<. # +if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) + find_package(iio REQUIRED) + if(NOT IIO_FOUND) + message(STATUS "gnuradio-iio not found, its installation is required.") + message(STATUS "Please build and install the following projects:") + message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio") + message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") + message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") + message(FATAL_ERROR "gnuradio-iio required for building gnss-sdr with this option enabled") + endif(NOT IIO_FOUND) + set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES}) + set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) + +endif(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) + +if(ENABLE_FMCOMMS2 OR ENABLE_AD9361) + find_package(libiio REQUIRED) + if(NOT LIBIIO_FOUND) + message(STATUS "gnuradio-iio not found, its installation is required.") + message(STATUS "Please build and install the following projects:") + message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio") + message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") + message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") + message(FATAL_ERROR "gnuradio-iio required for building gnss-sdr with this option enabled") + endif(NOT LIBIIO_FOUND) + set(OPT_LIBRARIES ${OPT_LIBRARIES} ${LIBIIO_LIBRARIES}) + set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${LIBIIO_INCLUDE_DIRS}) + + ############################################### + # FMCOMMS2 based SDR Hardware + ############################################### + if(IIO_FOUND) + set(OPT_SIGNAL_SOURCE_LIB_SOURCES ad9361_manager.cc) + endif(IIO_FOUND) + +endif(ENABLE_FMCOMMS2 OR ENABLE_AD9361) + set (SIGNAL_SOURCE_LIB_SOURCES rtl_tcp_commands.cc - rtl_tcp_dongle_info.cc) + rtl_tcp_dongle_info.cc + ${OPT_SIGNAL_SOURCE_LIB_SOURCES}) include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${Boost_INCLUDE_DIRS} + ${OPT_DRIVER_INCLUDE_DIRS} ) + file(GLOB SIGNAL_SOURCE_LIB_HEADERS "*.h") list(SORT SIGNAL_SOURCE_LIB_HEADERS) add_library(signal_source_lib ${SIGNAL_SOURCE_LIB_SOURCES} ${SIGNAL_SOURCE_LIB_HEADERS}) -source_group(Headers FILES ${SIGNAL_SOURCE_LIB_HEADERS}) \ No newline at end of file +source_group(Headers FILES ${SIGNAL_SOURCE_LIB_HEADERS}) + +target_link_libraries(signal_source_lib ${OPT_LIBRARIES}) + diff --git a/src/algorithms/signal_source/libs/ad9361_manager.cc b/src/algorithms/signal_source/libs/ad9361_manager.cc new file mode 100644 index 000000000..66a95ee14 --- /dev/null +++ b/src/algorithms/signal_source/libs/ad9361_manager.cc @@ -0,0 +1,704 @@ +/*! + * \file ad9361_manager.cc + * \brief An Analog Devices AD9361 front-end configuration library wrapper for configure some functions via iiod link. + * \author Javier Arribas, jarribas(at)cttc.es + * + * This file contains information taken from librtlsdr: + * http://git.osmocom.org/rtl-sdr/ + * ------------------------------------------------------------------------- + * + * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) + * + * GNSS-SDR is a software defined Global Navigation + * Satellite Systems receiver + * + * This file is part of GNSS-SDR. + * + * GNSS-SDR is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GNSS-SDR is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNSS-SDR. If not, see . + * + * ------------------------------------------------------------------------- + */ +#include "ad9361_manager.h" +#include +#include +#include +#include + +/* check return value of attr_write function */ +void errchk(int v, const char* what) { + if (v < 0) + { + LOG(WARNING)<<"Error "<rfport); + wr_ch_lli(chn, "rf_bandwidth", cfg->bw_hz); + wr_ch_lli(chn, "sampling_frequency", cfg->fs_hz); + + // Configure LO channel + //LOG(INFO)<<"* Acquiring AD9361 "<lo_hz); + return true; +} + + +bool config_ad9361_rx_local(unsigned long bandwidth_, + unsigned long sample_rate_, + unsigned long freq_, + std::string rf_port_select_, + std::string gain_mode_rx1_, + std::string gain_mode_rx2_, + double rf_gain_rx1_, + double rf_gain_rx2_) + +{ + // RX stream config + // Stream configurations + struct stream_cfg rxcfg; + rxcfg.bw_hz = bandwidth_; // 2 MHz rf bandwidth + rxcfg.fs_hz = sample_rate_; // 2.5 MS/s rx sample rate + rxcfg.lo_hz = freq_; // 2.5 GHz rf frequency + rxcfg.rfport = rf_port_select_.c_str(); // port A (select for rf freq.) + + std::cout<<"AD9361 Acquiring IIO LOCAL context\n"; + struct iio_context *ctx; + // Streaming devices + struct iio_device *rx; + struct iio_channel *rx0_i; + struct iio_channel *rx0_q; + + ctx = iio_create_default_context(); + if (!ctx) + { + std::cout<<"No context\n"; + throw std::runtime_error("AD9361 IIO No context"); + } + + if (iio_context_get_devices_count(ctx) <= 0) + { + std::cout<<"No devices\n"; + throw std::runtime_error("AD9361 IIO No devices"); + } + + std::cout<<"* Acquiring AD9361 streaming devices\n"; + + if(!get_ad9361_stream_dev(ctx, RX, &rx)) + { + std::cout<<"No rx dev found\n"; + throw std::runtime_error("AD9361 IIO No rx dev found"); + }; + + std::cout<<"* Configuring AD9361 for streaming\n"; + if (!cfg_ad9361_streaming_ch(ctx, &rxcfg, RX, 0)) + { + std::cout<<"RX port 0 not found\n"; + throw std::runtime_error("AD9361 IIO RX port 0 not found"); + } + + std::cout<<"* Initializing AD9361 IIO streaming channels\n"; + if (!get_ad9361_stream_ch(ctx, RX, rx, 0, &rx0_i)) + { + std::cout<<"RX chan i not found\n"; + throw std::runtime_error("RX chan i not found"); + } + + if (!get_ad9361_stream_ch(ctx, RX, rx, 1, &rx0_q)) + { + std::cout<<"RX chan q not found\n"; + throw std::runtime_error("RX chan q not found"); + } + + std::cout<<"* Enabling IIO streaming channels\n"; + iio_channel_enable(rx0_i); + iio_channel_enable(rx0_q); + + struct iio_device *ad9361_phy; + ad9361_phy= iio_context_find_device(ctx, "ad9361-phy"); + int ret; + ret=iio_device_attr_write(ad9361_phy,"trx_rate_governor","nominal"); + if (ret < 0) { + std::cout<<"Failed to set trx_rate_governor: "<. + * + * ------------------------------------------------------------------------- + */ + +#ifndef __AD9361_MANAGER__ +#define __AD9361_MANAGER__ + +#include + +#ifdef __APPLE__ +#include +#else +#include +#endif + +/* RX is input, TX is output */ +enum iodev { RX, TX }; + +/* common RX and TX streaming params */ +struct stream_cfg { + long long bw_hz; // Analog banwidth in Hz + long long fs_hz; // Baseband sample rate in Hz + long long lo_hz; // Local oscillator frequency in Hz + const char* rfport; // Port name +}; + + +/* check return value of attr_write function */ +void errchk(int v, const char* what); + +/* write attribute: long long int */ +void wr_ch_lli(struct iio_channel *chn, const char* what, long long val); + +/* write attribute: string */ +void wr_ch_str(struct iio_channel *chn, const char* what, const char* str); + +/* helper function generating channel names */ +char* get_ch_name(const char* type, int id, char* tmpstr); + +/* returns ad9361 phy device */ +struct iio_device* get_ad9361_phy(struct iio_context *ctx); + +/* finds AD9361 streaming IIO devices */ +bool get_ad9361_stream_dev(struct iio_context *ctx, enum iodev d, struct iio_device **dev); + +/* finds AD9361 streaming IIO channels */ +bool get_ad9361_stream_ch(struct iio_context *ctx, enum iodev d, struct iio_device *dev, int chid, struct iio_channel **chn); + +/* finds AD9361 phy IIO configuration channel with id chid */ +bool get_phy_chan(struct iio_context *ctx, enum iodev d, int chid, struct iio_channel **chn); + +/* finds AD9361 local oscillator IIO configuration channels */ +bool get_lo_chan(struct iio_context *ctx, enum iodev d, struct iio_channel **chn); + +/* applies streaming configuration through IIO */ +bool cfg_ad9361_streaming_ch(struct iio_context *ctx, struct stream_cfg *cfg, enum iodev type, int chid); + + +bool config_ad9361_rx_local(unsigned long bandwidth_, + unsigned long sample_rate_, + unsigned long freq_, + std::string rf_port_select_, + std::string gain_mode_rx1_, + std::string gain_mode_rx2_, + double rf_gain_rx1_, + double rf_gain_rx2_); + +bool config_ad9361_rx_remote(std::string remote_host, + unsigned long bandwidth_, + unsigned long sample_rate_, + unsigned long freq_, + std::string rf_port_select_, + std::string gain_mode_rx1_, + std::string gain_mode_rx2_, + double rf_gain_rx1_, + double rf_gain_rx2_); + +bool config_ad9361_lo_local(unsigned long bandwidth_, + unsigned long sample_rate_, + unsigned long freq_rf_tx_hz_, + double tx_attenuation_db_, + long long freq_dds_tx_hz_, + double scale_dds_dbfs_); + +bool config_ad9361_lo_remote(std::string remote_host, + unsigned long bandwidth_, + unsigned long sample_rate_, + unsigned long freq_rf_tx_hz_, + double tx_attenuation_db_, + long long freq_dds_tx_hz_, + double scale_dds_dbfs_); + + +bool ad9361_disable_lo_remote(std::string remote_host); + +bool ad9361_disable_lo_local(); + + +#endif From e1635a735d997b525bb5797f21d4916c1b45d735 Mon Sep 17 00:00:00 2001 From: mmajoral Date: Thu, 5 Apr 2018 15:05:46 +0200 Subject: [PATCH 08/82] Added the class switch_FPGA, which controls the switch in the FPGA that connects the analog frontend and the DMA to the queues of the HW accelerators. Removed some unused variables in the tracking. --- .../adapters/ad9361_fpga_signal_source.cc | 6 + .../adapters/ad9361_fpga_signal_source.h | 3 + .../signal_source/libs/CMakeLists.txt | 4 + .../signal_source/libs/fpga_switch.cc | 136 ++++++++++++++++ .../signal_source/libs/fpga_switch.h | 61 ++++++++ .../gps_l1_ca_dll_pll_tracking_fpga_sc.cc | 27 +--- .../gps_l1_ca_dll_pll_tracking_fpga_sc.h | 2 - src/algorithms/tracking/libs/CMakeLists.txt | 1 - .../tracking/libs/fpga_multicorrelator_8sc.cc | 27 +--- .../tracking/libs/fpga_multicorrelator_8sc.h | 12 +- .../fpga_multicorrelator_real_codes_8sc.cc | 148 ------------------ .../fpga_multicorrelator_real_codes_8sc.h | 73 --------- 12 files changed, 231 insertions(+), 269 deletions(-) create mode 100644 src/algorithms/signal_source/libs/fpga_switch.cc create mode 100644 src/algorithms/signal_source/libs/fpga_switch.h delete mode 100644 src/algorithms/tracking/libs/fpga_multicorrelator_real_codes_8sc.cc delete mode 100644 src/algorithms/tracking/libs/fpga_multicorrelator_real_codes_8sc.h diff --git a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc index cf9130767..cba4e5439 100644 --- a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc +++ b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc @@ -108,6 +108,12 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(ConfigurationInterface* configura scale_dds_dbfs_); } + // turn switch to A/D position + std::string default_device_name = "/dev/uio13"; + std::string device_name = configuration->property(role + ".devicename", default_device_name); + int switch_position = configuration->property(role + ".switch_position", 0); + switch_fpga = std::make_shared (device_name); + switch_fpga->set_switch_position(switch_position); } diff --git a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h index 5371f7faf..6110a63c3 100644 --- a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h +++ b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h @@ -33,6 +33,7 @@ #define GNSS_SDR_AD9361_FPGA_SIGNAL_SOURCE_H_ #include "gnss_block_interface.h" +#include "fpga_switch.h" #include #include @@ -112,6 +113,8 @@ private: std::string dump_filename_; boost::shared_ptr queue_; + + std::shared_ptr switch_fpga; }; #endif /*GNSS_SDR_AD9361_FPGA_SIGNAL_SOURCE_H_*/ diff --git a/src/algorithms/signal_source/libs/CMakeLists.txt b/src/algorithms/signal_source/libs/CMakeLists.txt index 45131f918..5617be70a 100644 --- a/src/algorithms/signal_source/libs/CMakeLists.txt +++ b/src/algorithms/signal_source/libs/CMakeLists.txt @@ -58,6 +58,10 @@ set (SIGNAL_SOURCE_LIB_SOURCES rtl_tcp_dongle_info.cc ${OPT_SIGNAL_SOURCE_LIB_SOURCES}) +if(ENABLE_FPGA) + SET(SIGNAL_SOURCE_LIB_SOURCES ${SIGNAL_SOURCE_LIB_SOURCES} fpga_switch.cc) +endif(ENABLE_FPGA) + include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${Boost_INCLUDE_DIRS} diff --git a/src/algorithms/signal_source/libs/fpga_switch.cc b/src/algorithms/signal_source/libs/fpga_switch.cc new file mode 100644 index 000000000..e349a3c53 --- /dev/null +++ b/src/algorithms/signal_source/libs/fpga_switch.cc @@ -0,0 +1,136 @@ +/*! + * \file fpga_switch.cc + * \brief Switch that connects the HW accelerator queues to the analog front end or the DMA. + * \authors
    + *
  • Marc Majoral, 2017. mmajoral(at)cttc.cat + *
  • Javier Arribas, 2015. jarribas(at)cttc.es + *
+ * + * Class that controls a switch in the FPGA + * + * + * ------------------------------------------------------------------------- + * + * Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors) + * + * GNSS-SDR is a software defined Global Navigation + * Satellite Systems receiver + * + * This file is part of GNSS-SDR. + * + * GNSS-SDR is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GNSS-SDR is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNSS-SDR. If not, see . + * + * ------------------------------------------------------------------------- + */ + +#include "fpga_switch.h" + +#include + +// FPGA stuff +#include + +// libraries used by DMA test code and GIPO test code +#include +#include +#include +#include + +// libraries used by DMA test code +#include +#include +#include +#include + +// libraries used by GPIO test code +#include +#include +#include + +// logging +#include + +// string manipulation +#include + +// constants +#define PAGE_SIZE 0x10000 +#define TEST_REGISTER_TRACK_WRITEVAL 0x55AA + +fpga_switch::fpga_switch(std::string device_name) +{ + if ((d_device_descriptor = open(device_name.c_str(), O_RDWR | O_SYNC)) == -1) + { + LOG(WARNING) << "Cannot open deviceio" << device_name; + printf("switch memory successfully mapped\n"); + } + d_map_base = reinterpret_cast(mmap(NULL, PAGE_SIZE, + PROT_READ | PROT_WRITE, MAP_SHARED, d_device_descriptor, 0)); + + if (d_map_base == reinterpret_cast(-1)) + { + LOG(WARNING) << "Cannot map the FPGA switch module into tracking memory"; + printf("could not map switch memory\n"); + } + + // sanity check : check test register + unsigned writeval = TEST_REGISTER_TRACK_WRITEVAL; + unsigned readval; + readval = fpga_switch::fpga_switch_test_register(writeval); + if (writeval != readval) + { + LOG(WARNING) << "Test register sanity check failed"; + } + else + { + LOG(INFO) << "Test register sanity check success !"; + } + + DLOG(INFO) << "Switch FPGA class created"; +} + +fpga_switch::~fpga_switch() +{ + close_device(); +} + +void fpga_switch::set_switch_position(int switch_position) +{ + d_map_base[0] = switch_position; +} + +unsigned fpga_switch::fpga_switch_test_register( + unsigned writeval) +{ + unsigned readval; + // write value to test register + d_map_base[3] = writeval; + // read value from test register + readval = d_map_base[3]; + // return read value + return readval; +} + +void fpga_switch::close_device() +{ + unsigned * aux = const_cast(d_map_base); + if (munmap(static_cast(aux), PAGE_SIZE) == -1) + { + printf("Failed to unmap memory uio\n"); + } + + close(d_device_descriptor); +} + + diff --git a/src/algorithms/signal_source/libs/fpga_switch.h b/src/algorithms/signal_source/libs/fpga_switch.h new file mode 100644 index 000000000..c3ce2fbba --- /dev/null +++ b/src/algorithms/signal_source/libs/fpga_switch.h @@ -0,0 +1,61 @@ +/*! + * \file fpga_switch.h + * \brief Switch that connects the HW accelerator queues to the analog front end or the DMA. + * \authors
    + *
  • Marc Majoral, 2017. mmajoral(at)cttc.cat + *
  • Javier Arribas, 2016. jarribas(at)cttc.es + *
+ * + * Class that controls a switch in the FPGA + * + * + * ------------------------------------------------------------------------- + * + * Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors) + * + * GNSS-SDR is a software defined Global Navigation + * Satellite Systems receiver + * + * This file is part of GNSS-SDR. + * + * GNSS-SDR is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GNSS-SDR is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNSS-SDR. If not, see . + * + * ------------------------------------------------------------------------- + */ + +#ifndef GNSS_SDR_FPGA_SWITCH_H_ +#define GNSS_SDR_FPGA_SWITCH_H_ + +#include + +#define MAX_LENGTH_DEVICEIO_NAME 50 + +class fpga_switch +{ +public: + fpga_switch(std::string device_name); + ~fpga_switch(); + void set_switch_position(int switch_position); + +private: + int d_device_descriptor; // driver descriptor + volatile unsigned *d_map_base; // driver memory map + + // private functions + unsigned fpga_switch_test_register(unsigned writeval); + void close_device(void); + +}; + +#endif /* GNSS_SDR_FPGA_SWITCH_H_ */ diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.cc index a6ebb9bec..f346ff8bc 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.cc @@ -173,11 +173,6 @@ Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc::Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc( d_carrier_phase_step_rad = 0.0; set_relative_rate(1.0 / static_cast(d_vector_length)); - - d_first_time = 1; - - - } void Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc::start_tracking() @@ -246,16 +241,14 @@ void Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc::start_tracking() d_code_phase_samples = d_acq_code_phase_samples; std::string sys_ = &d_acquisition_gnss_synchro->System; sys = sys_.substr(0,1); - //std::cout << "Tracking of GPS L1 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; + std::cout << "Tracking of GPS L1 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; LOG(INFO) << "Starting tracking of satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; // enable tracking d_pull_in = true; - multicorrelator_fpga_8sc->lock_channel(); d_enable_tracking = true; //do it in the end to avoid starting running tracking before finishing this function LOG(INFO) << "PULL-IN Doppler [Hz]=" << d_carrier_doppler_hz << " Code Phase correction [samples]=" << delay_correction_samples << " PULL-IN Code Phase [samples]=" << d_acq_code_phase_samples; - d_first_time = 1; } Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc::~Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc() @@ -275,10 +268,7 @@ Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc::~Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc() { volk_gnsssdr_free(d_local_code_shift_chips); volk_gnsssdr_free(d_correlator_outs); - //volk_gnsssdr_free(d_ca_code); delete[] d_Prompt_buffer; - //multicorrelator_cpu.free(); - //volk_gnsssdr_free(d_ca_code_16sc); multicorrelator_fpga_8sc->free(); } catch(const std::exception & ex) @@ -297,8 +287,6 @@ int Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc::general_work (int noutput_items __attrib int counter_corr_0_out; int sample_counter; - // samples offset -// int samples_offset; unsigned absolute_samples_offset; // int kk2; // process vars @@ -308,7 +296,6 @@ int Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc::general_work (int noutput_items __attrib double code_error_filt_chips = 0.0; int next_prn_length_samples = d_current_prn_length_samples; -// int offset_prn_samples = 0; // Block input data and block output stream pointers Gnss_Synchro **out = reinterpret_cast(&output_items[0]); @@ -324,6 +311,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc::general_work (int noutput_items __attrib if (d_pull_in == true) { d_pull_in = false; + multicorrelator_fpga_8sc->lock_channel(); unsigned counter_value = multicorrelator_fpga_8sc->read_sample_counter(); unsigned num_frames = ceil((counter_value - current_synchro_data.Acq_samplestamp_samples - current_synchro_data.Acq_delay_samples)/d_correlation_length_samples); absolute_samples_offset = current_synchro_data.Acq_delay_samples + current_synchro_data.Acq_samplestamp_samples + num_frames*d_correlation_length_samples; @@ -382,7 +370,6 @@ int Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc::general_work (int noutput_items __attrib double T_prn_samples = T_prn_seconds * static_cast(d_fs_in); double K_blk_samples = T_prn_samples + d_rem_code_phase_samples + code_error_filt_secs * static_cast(d_fs_in); next_prn_length_samples = round(K_blk_samples); -// offset_prn_samples = next_prn_length_samples - d_current_prn_length_samples; //################### PLL COMMANDS ################################################# // carrier phase step (NCO phase increment per sample) [rads/sample] @@ -426,15 +413,12 @@ int Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc::general_work (int noutput_items __attrib if (d_carrier_lock_fail_counter > MAXIMUM_LOCK_FAIL_COUNTER) { std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl; - d_debug_loss_of_track = 1; LOG(INFO) << "Loss of lock in channel " << d_channel << "!"; this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); // 3 -> loss of lock d_carrier_lock_fail_counter = 0; d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine multicorrelator_fpga_8sc->unlock_channel(); - - - } + } } // ########### Output the tracking data to navigation and PVT ########## @@ -535,14 +519,13 @@ int Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc::general_work (int noutput_items __attrib if (d_enable_tracking == true) { - return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false - //return 0; // debug + return 1; } else { return 0; } - + } diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.h index c497c08f2..f7d2141c9 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.h +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.h @@ -181,7 +181,6 @@ private: double d_K_blk_samples_previous; int d_offset_sample_previous; - int d_first_time; int d_kk = 0; int d_numsamples_debug = 990; @@ -194,7 +193,6 @@ private: int d_counter_corr_0_in = 0; int d_counter_corr_0_out = 0; int d_sample_counter_inc = 0; - int d_debug_loss_of_track = 0; }; #endif //GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_FPGA_SC_H diff --git a/src/algorithms/tracking/libs/CMakeLists.txt b/src/algorithms/tracking/libs/CMakeLists.txt index 1cc68dabb..88c4eb2a5 100644 --- a/src/algorithms/tracking/libs/CMakeLists.txt +++ b/src/algorithms/tracking/libs/CMakeLists.txt @@ -47,7 +47,6 @@ set(TRACKING_LIB_SOURCES if(ENABLE_FPGA) SET(TRACKING_LIB_SOURCES ${TRACKING_LIB_SOURCES} fpga_multicorrelator_8sc.cc) - SET(TRACKING_LIB_SOURCES ${TRACKING_LIB_SOURCES} fpga_multicorrelator_real_codes_8sc.cc) endif(ENABLE_FPGA) include_directories( diff --git a/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.cc b/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.cc index dd6f208ce..ce2275422 100644 --- a/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.cc +++ b/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.cc @@ -95,23 +95,18 @@ void fpga_multicorrelator_8sc::set_initial_sample(int samples_offset) d_map_base[13] = d_initial_sample_counter; } -//bool fpga_multicorrelator_8sc::set_local_code_and_taps(int code_length_chips, -// const int* local_code_in, float *shifts_chips, int PRN) -bool fpga_multicorrelator_8sc::set_local_code_and_taps(int code_length_chips, +void fpga_multicorrelator_8sc::set_local_code_and_taps(int code_length_chips, float *shifts_chips, int PRN) { - //d_local_code_in = local_code_in; + d_shifts_chips = shifts_chips; d_code_length_chips = code_length_chips; fpga_multicorrelator_8sc::fpga_configure_tracking_gps_local_code(PRN); - return true; } -bool fpga_multicorrelator_8sc::set_output_vectors(gr_complex* corr_out) +void fpga_multicorrelator_8sc::set_output_vectors(gr_complex* corr_out) { - // Save CPU pointers d_corr_out = corr_out; - return true; } void fpga_multicorrelator_8sc::update_local_code(float rem_code_phase_chips) @@ -122,24 +117,20 @@ void fpga_multicorrelator_8sc::update_local_code(float rem_code_phase_chips) } -bool fpga_multicorrelator_8sc::Carrier_wipeoff_multicorrelator_resampler( +void fpga_multicorrelator_8sc::Carrier_wipeoff_multicorrelator_resampler( float rem_carrier_phase_in_rad, float phase_step_rad, float rem_code_phase_chips, float code_phase_step_chips, int signal_length_samples) { + + update_local_code(rem_code_phase_chips); d_rem_carrier_phase_in_rad = rem_carrier_phase_in_rad; d_code_phase_step_chips = code_phase_step_chips; d_phase_step_rad = phase_step_rad; d_correlator_length_samples = signal_length_samples; - -// if (first_time == 1) -// { - fpga_multicorrelator_8sc::fpga_compute_signal_parameters_in_fpga(); - fpga_multicorrelator_8sc::fpga_configure_signal_parameters_in_fpga(); -// first_time = 0; -// } - + fpga_multicorrelator_8sc::fpga_compute_signal_parameters_in_fpga(); + fpga_multicorrelator_8sc::fpga_configure_signal_parameters_in_fpga(); fpga_multicorrelator_8sc::fpga_launch_multicorrelator_fpga(); int irq_count; ssize_t nb; @@ -150,7 +141,6 @@ bool fpga_multicorrelator_8sc::Carrier_wipeoff_multicorrelator_resampler( printf("Tracking_module Interrupt number %d\n", irq_count); } fpga_multicorrelator_8sc::read_tracking_gps_results(); - return true; } fpga_multicorrelator_8sc::fpga_multicorrelator_8sc(int n_correlators, @@ -186,7 +176,6 @@ fpga_multicorrelator_8sc::fpga_multicorrelator_8sc(int n_correlators, d_ca_codes = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS*NUM_PRNs) * sizeof(int), volk_gnsssdr_get_alignment())); for (unsigned int PRN = 1; PRN <= NUM_PRNs; PRN++) { - //gps_l1_ca_code_gen_int(&d_ca_codes[GPS_L1_CA_CODE_LENGTH_CHIPS*(PRN -1)], PRN, 0); gps_l1_ca_code_gen_int(&d_ca_codes[(int(GPS_L1_CA_CODE_LENGTH_CHIPS)) * (PRN - 1)], PRN, 0); } DLOG(INFO) << "TRACKING FPGA CLASS CREATED"; diff --git a/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.h b/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.h index 0b726e121..9bf44536e 100644 --- a/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.h +++ b/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.h @@ -51,15 +51,19 @@ public: fpga_multicorrelator_8sc(int n_correlators, std::string device_name, unsigned int device_base); ~fpga_multicorrelator_8sc(); - bool set_output_vectors(gr_complex* corr_out); + //bool set_output_vectors(gr_complex* corr_out); + void set_output_vectors(gr_complex* corr_out); // bool set_local_code_and_taps( // int code_length_chips, const int* local_code_in, // float *shifts_chips, int PRN); - bool set_local_code_and_taps( + //bool set_local_code_and_taps( + void set_local_code_and_taps( int code_length_chips, float *shifts_chips, int PRN); - bool set_output_vectors(lv_16sc_t* corr_out); - void update_local_code(float rem_code_phase_chips);bool Carrier_wipeoff_multicorrelator_resampler( + //bool set_output_vectors(lv_16sc_t* corr_out); + void update_local_code(float rem_code_phase_chips); + //bool Carrier_wipeoff_multicorrelator_resampler( + void Carrier_wipeoff_multicorrelator_resampler( float rem_carrier_phase_in_rad, float phase_step_rad, float rem_code_phase_chips, float code_phase_step_chips, int signal_length_samples);bool free(); diff --git a/src/algorithms/tracking/libs/fpga_multicorrelator_real_codes_8sc.cc b/src/algorithms/tracking/libs/fpga_multicorrelator_real_codes_8sc.cc deleted file mode 100644 index 942cadaff..000000000 --- a/src/algorithms/tracking/libs/fpga_multicorrelator_real_codes_8sc.cc +++ /dev/null @@ -1,148 +0,0 @@ -/*! - * \file fpga_multicorrelator_real_codes_8sc.cc - * \brief High optimized CPU vector multiTAP correlator class with real-valued local codes - * \authors
    - *
  • Javier Arribas, 2015. jarribas(at)cttc.es - *
  • Cillian O'Driscoll, 2017. cillian.odriscoll(at)gmail.com - *
- * - * Class that implements a high optimized vector multiTAP correlator class for CPUs - * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * GNSS-SDR is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GNSS-SDR is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNSS-SDR. If not, see . - * - * ------------------------------------------------------------------------- - */ - -//#include "cpu_multicorrelator_real_codes.h" -#include "fpga_multicorrelator_real_codes_8sc.h" -#include -#include -#include - - -fpga_multicorrelator_real_codes_8sc::fpga_multicorrelator_real_codes_8sc() -{ - d_sig_in = nullptr; - d_local_code_in = nullptr; - d_shifts_chips = nullptr; - d_corr_out = nullptr; - d_local_codes_resampled = nullptr; - d_code_length_chips = 0; - d_n_correlators = 0; -} - - -fpga_multicorrelator_real_codes_8sc::~fpga_multicorrelator_real_codes_8sc() -{ - if(d_local_codes_resampled != nullptr) - { - fpga_multicorrelator_real_codes_8sc::free(); - } -} - - -bool fpga_multicorrelator_real_codes_8sc::init( - int max_signal_length_samples, - int n_correlators) -{ - // ALLOCATE MEMORY FOR INTERNAL vectors - size_t size = max_signal_length_samples * sizeof(float); - - d_local_codes_resampled = static_cast(volk_gnsssdr_malloc(n_correlators * sizeof(float*), volk_gnsssdr_get_alignment())); - for (int n = 0; n < n_correlators; n++) - { - d_local_codes_resampled[n] = static_cast(volk_gnsssdr_malloc(size, volk_gnsssdr_get_alignment())); - } - d_n_correlators = n_correlators; - return true; -} - - - -bool fpga_multicorrelator_real_codes_8sc::set_local_code_and_taps( - int code_length_chips, - const float* local_code_in, - float *shifts_chips) -{ - d_local_code_in = local_code_in; - d_shifts_chips = shifts_chips; - d_code_length_chips = code_length_chips; - return true; -} - - -bool fpga_multicorrelator_real_codes_8sc::set_input_output_vectors(std::complex* corr_out, const std::complex* sig_in) -{ - // Save CPU pointers - d_sig_in = sig_in; - d_corr_out = corr_out; - return true; -} - - -void fpga_multicorrelator_real_codes_8sc::update_local_code(int correlator_length_samples, float rem_code_phase_chips, float code_phase_step_chips) -{ - volk_gnsssdr_32f_xn_resampler_32f_xn(d_local_codes_resampled, - d_local_code_in, - rem_code_phase_chips, - code_phase_step_chips, - d_shifts_chips, - d_code_length_chips, - d_n_correlators, - correlator_length_samples); -} - - -bool fpga_multicorrelator_real_codes_8sc::Carrier_wipeoff_multicorrelator_resampler( - float rem_carrier_phase_in_rad, - float phase_step_rad, - float rem_code_phase_chips, - float code_phase_step_chips, - int signal_length_samples) -{ - update_local_code(signal_length_samples, rem_code_phase_chips, code_phase_step_chips); - // Regenerate phase at each call in order to avoid numerical issues - lv_32fc_t phase_offset_as_complex[1]; - phase_offset_as_complex[0] = lv_cmake(std::cos(rem_carrier_phase_in_rad), -std::sin(rem_carrier_phase_in_rad)); - // call VOLK_GNSSSDR kernel - volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn(d_corr_out, d_sig_in, std::exp(lv_32fc_t(0, - phase_step_rad)), phase_offset_as_complex, (const float**)d_local_codes_resampled, d_n_correlators, signal_length_samples); - return true; -} - - -bool fpga_multicorrelator_real_codes_8sc::free() -{ - // Free memory - if (d_local_codes_resampled != nullptr) - { - for (int n = 0; n < d_n_correlators; n++) - { - volk_gnsssdr_free(d_local_codes_resampled[n]); - } - volk_gnsssdr_free(d_local_codes_resampled); - d_local_codes_resampled = nullptr; - } - return true; -} - - diff --git a/src/algorithms/tracking/libs/fpga_multicorrelator_real_codes_8sc.h b/src/algorithms/tracking/libs/fpga_multicorrelator_real_codes_8sc.h deleted file mode 100644 index 94d855ff8..000000000 --- a/src/algorithms/tracking/libs/fpga_multicorrelator_real_codes_8sc.h +++ /dev/null @@ -1,73 +0,0 @@ -/*! - * \file fpga_multicorrelator_real_codes_8sc.h - * \brief High optimized CPU vector multiTAP correlator class using real-valued local codes - * \authors
    - *
  • Javier Arribas, 2015. jarribas(at)cttc.es - *
  • Cillian O'Driscoll, 2017, cillian.odriscoll(at)gmail.com - *
- * - * Class that implements a high optimized vector multiTAP correlator class for CPUs - * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * GNSS-SDR is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GNSS-SDR is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNSS-SDR. If not, see . - * - * ------------------------------------------------------------------------- - */ - -//#ifndef GNSS_SDR_CPU_MULTICORRELATOR_REAL_CODES_H_ -//#define GNSS_SDR_CPU_MULTICORRELATOR_REAL_CODES_H_ - -#ifndef GNSS_SDR_FPGA_MULTICORRELATOR_REAL_CODES_8SC_H_ -#define GNSS_SDR_FPGA_MULTICORRELATOR_REAL_CODES_8SC_H_ - - -#include - -/*! - * \brief Class that implements carrier wipe-off and correlators. - */ -class fpga_multicorrelator_real_codes_8sc -{ -public: - fpga_multicorrelator_real_codes_8sc(); - ~fpga_multicorrelator_real_codes_8sc(); - bool init(int max_signal_length_samples, int n_correlators); - bool set_local_code_and_taps(int code_length_chips, const float* local_code_in, float *shifts_chips); - bool set_input_output_vectors(std::complex* corr_out, const std::complex* sig_in); - void update_local_code(int correlator_length_samples, float rem_code_phase_chips, float code_phase_step_chips); - bool Carrier_wipeoff_multicorrelator_resampler(float rem_carrier_phase_in_rad, float phase_step_rad, float rem_code_phase_chips, float code_phase_step_chips, int signal_length_samples); - bool free(); - -private: - // Allocate the device input vectors - const std::complex *d_sig_in; - float **d_local_codes_resampled; - const float *d_local_code_in; - std::complex *d_corr_out; - float *d_shifts_chips; - int d_code_length_chips; - int d_n_correlators; -}; - - -#endif /* GNSS_SDR_FPGA_MULTICORRELATOR_REAL_CODES_8SC_H_ */ - From 0dac9489d532268c935c68656d3a06a645734ca5 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 9 Apr 2018 21:09:25 +0200 Subject: [PATCH 09/82] Improve C/N0 estimation --- .../tracking/gnuradio_blocks/dll_pll_veml_tracking.cc | 8 ++++---- .../tracking/gnuradio_blocks/dll_pll_veml_tracking.h | 2 +- .../galileo_e1_tcp_connector_tracking_cc.cc | 2 +- .../glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc | 2 +- .../glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc | 2 +- .../glonass_l1_ca_dll_pll_tracking_cc.cc | 2 +- .../glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc | 2 +- .../glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc | 2 +- .../glonass_l2_ca_dll_pll_tracking_cc.cc | 2 +- .../gps_l1_ca_dll_pll_c_aid_tracking_cc.cc | 5 +++-- .../gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.cc | 2 +- .../gps_l1_ca_dll_pll_c_aid_tracking_sc.cc | 2 +- .../gps_l1_ca_dll_pll_tracking_gpu_cc.cc | 2 +- .../gps_l1_ca_tcp_connector_tracking_cc.cc | 2 +- src/algorithms/tracking/libs/lock_detectors.cc | 10 +++++----- src/algorithms/tracking/libs/lock_detectors.h | 8 ++++---- 16 files changed, 28 insertions(+), 27 deletions(-) diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index 4ae6f8195..d7fcdc160 100755 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -606,7 +606,7 @@ bool dll_pll_veml_tracking::acquire_secondary() } -bool dll_pll_veml_tracking::cn0_and_tracking_lock_status() +bool dll_pll_veml_tracking::cn0_and_tracking_lock_status(double coh_integration_time_s) { // ####### CN0 ESTIMATION AND LOCK DETECTORS ###### if (d_cn0_estimation_counter < FLAGS_cn0_samples) @@ -620,7 +620,7 @@ bool dll_pll_veml_tracking::cn0_and_tracking_lock_status() { d_cn0_estimation_counter = 0; // Code lock indicator - d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, static_cast(trk_parameters.fs_in), static_cast(d_code_length_chips)); + d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, coh_integration_time_s); // Carrier lock indicator d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, FLAGS_cn0_samples); // Loss of lock detection @@ -1233,7 +1233,7 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused) d_L_accu = *d_Late; // Check lock status - if (!cn0_and_tracking_lock_status()) + if (!cn0_and_tracking_lock_status(static_cast(d_correlation_length_ms) * 1000.0)) { clear_tracking_vars(); d_state = 0; // loss-of-lock detected @@ -1411,7 +1411,7 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused) save_correlation_results(); // check lock status - if (!cn0_and_tracking_lock_status()) + if (!cn0_and_tracking_lock_status(static_cast(d_correlation_length_ms) * 1000.0 * static_cast(trk_parameters.extend_correlation_symbols))) { clear_tracking_vars(); d_state = 0; // loss-of-lock detected diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h index e9e41ccbc..5d8ec0133 100755 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h @@ -88,7 +88,7 @@ private: dll_pll_veml_tracking(dllpllconf_t conf_); - bool cn0_and_tracking_lock_status(); + bool cn0_and_tracking_lock_status(double coh_integration_time_s); bool acquire_secondary(); void do_correlation_step(const gr_complex *input_samples); void run_dll_pll(); diff --git a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc index a7c0062a2..61c77c9e2 100644 --- a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc @@ -381,7 +381,7 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri d_cn0_estimation_counter = 0; // Code lock indicator - d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, d_fs_in, Galileo_E1_B_CODE_LENGTH_CHIPS); + d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, Galileo_E1_CODE_PERIOD); // Carrier lock indicator d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, FLAGS_cn0_samples); diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc index df57be51e..3fc22a696 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc @@ -762,7 +762,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at { d_cn0_estimation_counter = 0; // Code lock indicator - d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES, d_fs_in, GLONASS_L1_CA_CODE_LENGTH_CHIPS); + d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES, GLONASS_L1_CA_CODE_PERIOD); // Carrier lock indicator d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES); // Loss of lock detection diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc index 313756921..a7acbfe21 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc @@ -753,7 +753,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at { d_cn0_estimation_counter = 0; // Code lock indicator - d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES, d_fs_in, GLONASS_L1_CA_CODE_LENGTH_CHIPS); + d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES, GLONASS_L1_CA_CODE_PERIOD); // Carrier lock indicator d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES); // Loss of lock detection diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc index d35b6159c..78de7f9b1 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc @@ -622,7 +622,7 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut { d_cn0_estimation_counter = 0; // Code lock indicator - d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES, d_fs_in, GLONASS_L1_CA_CODE_LENGTH_CHIPS); + d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES, GLONASS_L1_CA_CODE_PERIOD); // Carrier lock indicator d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES); // Loss of lock detection diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc index 53f8f704b..48f149716 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc @@ -759,7 +759,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at { d_cn0_estimation_counter = 0; // Code lock indicator - d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES, d_fs_in, GLONASS_L2_CA_CODE_LENGTH_CHIPS); + d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES, GLONASS_L2_CA_CODE_PERIOD); // Carrier lock indicator d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES); // Loss of lock detection diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc index decc5d5ca..92d17ab5e 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc @@ -751,7 +751,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at { d_cn0_estimation_counter = 0; // Code lock indicator - d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES, d_fs_in, GLONASS_L2_CA_CODE_LENGTH_CHIPS); + d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES, GLONASS_L2_CA_CODE_PERIOD); // Carrier lock indicator d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES); // Loss of lock detection diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc index f6428bc5c..2989718e6 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc @@ -622,7 +622,7 @@ int Glonass_L2_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut { d_cn0_estimation_counter = 0; // Code lock indicator - d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES, d_fs_in, GLONASS_L2_CA_CODE_LENGTH_CHIPS); + d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES, GLONASS_L2_CA_CODE_PERIOD); // Carrier lock indicator d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES); // Loss of lock detection diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc index c242a10b8..a5b92111b 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc @@ -741,7 +741,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __attrib { d_cn0_estimation_counter = 0; // Code lock indicator - d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, d_fs_in, GPS_L1_CA_CODE_LENGTH_CHIPS); + d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, GPS_L1_CA_CODE_PERIOD); // Carrier lock indicator d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, FLAGS_cn0_samples); // Loss of lock detection @@ -842,7 +842,8 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __attrib // PLL commands tmp_float = 1.0 / (d_carr_phase_error_secs_Ti * CURRENT_INTEGRATION_TIME_S); d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float)); - tmp_float = 1.0 / (d_code_error_filt_chips_Ti * CURRENT_INTEGRATION_TIME_S);; + tmp_float = 1.0 / (d_code_error_filt_chips_Ti * CURRENT_INTEGRATION_TIME_S); + ; d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float)); // DLL commands tmp_float = d_code_error_chips_Ti * CURRENT_INTEGRATION_TIME_S; diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.cc index 1d1561a21..85f5c2e1c 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.cc @@ -558,7 +558,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::general_work( { d_cn0_estimation_counter = 0; // Code lock indicator - d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, d_fs_in, GPS_L1_CA_CODE_LENGTH_CHIPS); + d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, GPS_L1_CA_CODE_PERIOD); // Carrier lock indicator d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, FLAGS_cn0_samples); // Loss of lock detection diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc index 9a4332f06..9a01f1109 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc @@ -743,7 +743,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __attrib { d_cn0_estimation_counter = 0; // Code lock indicator - d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, d_fs_in, GPS_L1_CA_CODE_LENGTH_CHIPS); + d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, GPS_L1_CA_CODE_PERIOD); // Carrier lock indicator d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, FLAGS_cn0_samples); // Loss of lock detection diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc index 759128d0b..00fc6bd98 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc @@ -413,7 +413,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work(int noutput_items __attribut { d_cn0_estimation_counter = 0; // Code lock indicator - d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, d_fs_in, GPS_L1_CA_CODE_LENGTH_CHIPS); + d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, GPS_L1_CA_CODE_PERIOD); // Carrier lock indicator d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, FLAGS_cn0_samples); // Loss of lock detection diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc index cd4c86652..d447d4985 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc @@ -418,7 +418,7 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attrib else { d_cn0_estimation_counter = 0; - d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, d_fs_in, GPS_L1_CA_CODE_LENGTH_CHIPS); + d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, GPS_L1_CA_CODE_PERIOD); d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, FLAGS_cn0_samples); // ###### TRACKING UNLOCK NOTIFICATION ##### diff --git a/src/algorithms/tracking/libs/lock_detectors.cc b/src/algorithms/tracking/libs/lock_detectors.cc index 4457e361f..5194c4c3b 100644 --- a/src/algorithms/tracking/libs/lock_detectors.cc +++ b/src/algorithms/tracking/libs/lock_detectors.cc @@ -58,14 +58,14 @@ * \f$\hat{P}_{tot}=\frac{1}{N}\sum^{N-1}_{i=0}|Pc(i)|^2\f$ is the estimator of the total power, \f$|\cdot|\f$ is the absolute value, * \f$Re(\cdot)\f$ stands for the real part of the value, and \f$Pc(i)\f$ is the prompt correlator output for the sample index i. * - * The SNR value is converted to CN0 [dB-Hz], taking to account the receiver bandwidth and the PRN code gain, using the following formula: + * The SNR value is converted to CN0 [dB-Hz], taking to account the coherent integration time, using the following formula: * \f{equation} - * CN0_{dB}=10*log(\hat{\rho})+10*log(\frac{f_s}{2})-10*log(L_{PRN}), + * CN0_{dB}=10*log(\hat{\rho})-10*log(2 * T_{int}), * \f} - * where \f$f_s\f$ is the sampling frequency and \f$L_{PRN}\f$ is the PRN sequence length. + * where \f$T_{int}\f$ is the coherent integration time, in seconds. * */ -float cn0_svn_estimator(gr_complex* Prompt_buffer, int length, long fs_in, double code_length) +float cn0_svn_estimator(const gr_complex* Prompt_buffer, int length, double coh_integration_time_s) { double SNR = 0.0; double SNR_dB_Hz = 0.0; @@ -80,7 +80,7 @@ float cn0_svn_estimator(gr_complex* Prompt_buffer, int length, long fs_in, doubl Psig = Psig * Psig; Ptot /= static_cast(length); SNR = Psig / (Ptot - Psig); - SNR_dB_Hz = 10.0 * log10(SNR) + 10.0 * log10(static_cast(fs_in) / 2.0) - 10.0 * log10(code_length); + SNR_dB_Hz = 10.0 * log10(SNR) - 10.0 * log10(2.0 * coh_integration_time_s); return static_cast(SNR_dB_Hz); } diff --git a/src/algorithms/tracking/libs/lock_detectors.h b/src/algorithms/tracking/libs/lock_detectors.h index 22ec4945e..4955393d2 100644 --- a/src/algorithms/tracking/libs/lock_detectors.h +++ b/src/algorithms/tracking/libs/lock_detectors.h @@ -62,17 +62,17 @@ * \f$\hat{P}_{tot}=\frac{1}{N}\sum^{N-1}_{i=0}|Pc(i)|^2\f$ is the estimator of the total power, \f$|\cdot|\f$ is the absolute value, * \f$Re(\cdot)\f$ stands for the real part of the value, and \f$Pc(i)\f$ is the prompt correlator output for the sample index i. * - * The SNR value is converted to CN0 [dB-Hz], taking to account the receiver bandwidth and the PRN code gain, using the following formula: + * The SNR value is converted to CN0 [dB-Hz], taking to account the coherent integration time, using the following formula: * \f{equation} - * CN0_{dB}=10*log(\hat{\rho})+10*log(\frac{f_s}{2})-10*log(L_{PRN}), + * CN0_{dB}=10*log(\hat{\rho})-10*log(2 * T_{int}), * \f} - * where \f$f_s\f$ is the sampling frequency and \f$L_{PRN}\f$ is the PRN sequence length. + * where \f$T_{int}\f$ is the coherent integration time, in seconds. * Ref: Marco Pini, Emanuela Falletti and Maurizio Fantino, "Performance * Evaluation of C/N0 Estimators using a Real Time GNSS Software Receiver," * IEEE 10th International Symposium on Spread Spectrum Techniques and * Applications, pp.28-30, August 2008. */ -float cn0_svn_estimator(gr_complex* Prompt_buffer, int length, long fs_in, double code_length); +float cn0_svn_estimator(const gr_complex* Prompt_buffer, int length, double coh_integration_time_s); /*! \brief A carrier lock detector From d4a13f2bbd1624b9525b0ccc8dbdc3f730774192 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 9 Apr 2018 22:14:15 +0200 Subject: [PATCH 10/82] Fix CN0 estimation --- .../tracking/gnuradio_blocks/dll_pll_veml_tracking.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index d7fcdc160..8feeb7c5b 100755 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -1233,7 +1233,7 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused) d_L_accu = *d_Late; // Check lock status - if (!cn0_and_tracking_lock_status(static_cast(d_correlation_length_ms) * 1000.0)) + if (!cn0_and_tracking_lock_status(static_cast(d_correlation_length_ms) / 1000.0)) { clear_tracking_vars(); d_state = 0; // loss-of-lock detected @@ -1411,7 +1411,7 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused) save_correlation_results(); // check lock status - if (!cn0_and_tracking_lock_status(static_cast(d_correlation_length_ms) * 1000.0 * static_cast(trk_parameters.extend_correlation_symbols))) + if (!cn0_and_tracking_lock_status((static_cast(d_correlation_length_ms) / 1000.0) * static_cast(trk_parameters.extend_correlation_symbols))) { clear_tracking_vars(); d_state = 0; // loss-of-lock detected From 80de8a9770b02731aff30d246f270a777c0048e3 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 9 Apr 2018 23:10:50 +0200 Subject: [PATCH 11/82] Fix C/N0 estimation --- src/algorithms/tracking/libs/lock_detectors.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/algorithms/tracking/libs/lock_detectors.cc b/src/algorithms/tracking/libs/lock_detectors.cc index 5194c4c3b..966dd48f1 100644 --- a/src/algorithms/tracking/libs/lock_detectors.cc +++ b/src/algorithms/tracking/libs/lock_detectors.cc @@ -80,7 +80,7 @@ float cn0_svn_estimator(const gr_complex* Prompt_buffer, int length, double coh_ Psig = Psig * Psig; Ptot /= static_cast(length); SNR = Psig / (Ptot - Psig); - SNR_dB_Hz = 10.0 * log10(SNR) - 10.0 * log10(2.0 * coh_integration_time_s); + SNR_dB_Hz = 10.0 * log10(SNR) - 10.0 * log10(coh_integration_time_s); return static_cast(SNR_dB_Hz); } From c175ebf4ddfded3cd8476741d163847cb9501fcb Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 10 Apr 2018 19:54:59 +0200 Subject: [PATCH 12/82] Minor fixes --- .../tracking/gnuradio_blocks/dll_pll_veml_tracking.cc | 8 ++++---- src/algorithms/tracking/libs/lock_detectors.cc | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index 8feeb7c5b..e121a36dd 100755 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -1318,12 +1318,12 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused) d_carrier_loop_filter.set_pdi(new_correlation_time); d_code_loop_filter.set_pdi(new_correlation_time); d_state = 3; // next state is the extended correlator integrator - LOG(INFO) << "Enabled " << trk_parameters.extend_correlation_symbols << " [symbols] extended correlator for CH " + LOG(INFO) << "Enabled " << trk_parameters.extend_correlation_symbols * static_cast(d_code_period * 1000.0) << " ms extended correlator in channel " << d_channel - << " : Satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN); - std::cout << "Enabled " << trk_parameters.extend_correlation_symbols << " [symbols] extended correlator for CH " + << " for satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN); + std::cout << "Enabled " << trk_parameters.extend_correlation_symbols * static_cast(d_code_period * 1000.0) << " ms extended correlator in channel " << d_channel - << " : Satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << std::endl; + << " for satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << std::endl; // Set narrow taps delay values [chips] d_code_loop_filter.set_DLL_BW(trk_parameters.dll_bw_narrow_hz); d_carrier_loop_filter.set_PLL_BW(trk_parameters.pll_bw_narrow_hz); diff --git a/src/algorithms/tracking/libs/lock_detectors.cc b/src/algorithms/tracking/libs/lock_detectors.cc index 966dd48f1..44201a4fb 100644 --- a/src/algorithms/tracking/libs/lock_detectors.cc +++ b/src/algorithms/tracking/libs/lock_detectors.cc @@ -60,7 +60,7 @@ * * The SNR value is converted to CN0 [dB-Hz], taking to account the coherent integration time, using the following formula: * \f{equation} - * CN0_{dB}=10*log(\hat{\rho})-10*log(2 * T_{int}), + * CN0_{dB}=10*log(\hat{\rho})-10*log(T_{int}), * \f} * where \f$T_{int}\f$ is the coherent integration time, in seconds. * From bdd1a0e97706ebbd70eff2facc539005a6adde20 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 11 Apr 2018 01:22:11 +0200 Subject: [PATCH 13/82] Add more friendy messages Move general_work to the bottom, so it is easier to find --- .../gnuradio_blocks/dll_pll_veml_tracking.cc | 22 +- .../gnuradio_blocks/dll_pll_veml_tracking.h | 2 + .../galileo_e1_tcp_connector_tracking_cc.cc | 80 +-- ...glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc | 68 +-- ...glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc | 68 +-- .../glonass_l1_ca_dll_pll_tracking_cc.cc | 66 +-- ...glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc | 68 +-- ...glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc | 68 +-- .../glonass_l2_ca_dll_pll_tracking_cc.cc | 66 +-- .../gps_l1_ca_dll_pll_c_aid_tracking_cc.cc | 68 +-- ...ps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.cc | 509 +++++++++--------- .../gps_l1_ca_dll_pll_c_aid_tracking_sc.cc | 66 +-- .../gps_l1_ca_dll_pll_tracking_gpu_cc.cc | 66 +-- .../gps_l1_ca_tcp_connector_tracking_cc.cc | 80 +-- 14 files changed, 652 insertions(+), 645 deletions(-) diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index 4ae6f8195..272825bd3 100755 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -362,6 +362,14 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(dllpllconf_t conf_) : gr::block("dl d_code_phase_samples = 0.0; d_last_prompt = gr_complex(0.0, 0.0); d_state = 0; // initial state: standby + + signal_pretty_name["1C"] = "L1 C/A"; + signal_pretty_name["1B"] = "E1"; + signal_pretty_name["1G"] = "L1 C/A"; + signal_pretty_name["2S"] = "L2C"; + signal_pretty_name["2G"] = "L2 C/A"; + signal_pretty_name["5X"] = "E5a"; + signal_pretty_name["L5"] = "L5"; } @@ -504,7 +512,7 @@ void dll_pll_veml_tracking::start_tracking() d_code_loop_filter.set_pdi(static_cast(d_code_period)); // DEBUG OUTPUT - std::cout << "Tracking of " << systemName << " " << signal_type << " signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << std::endl; + std::cout << "Tracking of " << systemName << " " << signal_pretty_name[signal_type] << " signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << std::endl; LOG(INFO) << "Starting tracking of satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; // enable tracking pull-in @@ -1256,8 +1264,8 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused) next_state = acquire_secondary(); if (next_state) { - std::cout << "Secondary code locked for CH " << d_channel - << " : Satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << std::endl; + std::cout << systemName << " " << signal_pretty_name[signal_type] << " secondary code locked in channel " << d_channel + << " for satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << std::endl; } d_Prompt_buffer_deque.pop_front(); @@ -1318,12 +1326,12 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused) d_carrier_loop_filter.set_pdi(new_correlation_time); d_code_loop_filter.set_pdi(new_correlation_time); d_state = 3; // next state is the extended correlator integrator - LOG(INFO) << "Enabled " << trk_parameters.extend_correlation_symbols << " [symbols] extended correlator for CH " + LOG(INFO) << "Enabled " << trk_parameters.extend_correlation_symbols * static_cast(d_code_period * 1000.0) << " ms extended correlator in channel " << d_channel - << " : Satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN); - std::cout << "Enabled " << trk_parameters.extend_correlation_symbols << " [symbols] extended correlator for CH " + << " for satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN); + std::cout << "Enabled " << trk_parameters.extend_correlation_symbols * static_cast(d_code_period * 1000.0) << " ms extended correlator in channel " << d_channel - << " : Satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << std::endl; + << " for satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << std::endl; // Set narrow taps delay values [chips] d_code_loop_filter.set_DLL_BW(trk_parameters.dll_bw_narrow_hz); d_carrier_loop_filter.set_PLL_BW(trk_parameters.pll_bw_narrow_hz); diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h index e9e41ccbc..89f71a99a 100755 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h @@ -38,6 +38,7 @@ #include #include #include +#include typedef struct { @@ -118,6 +119,7 @@ private: std::string systemName; std::string signal_type; std::string *d_secondary_code_string; + std::map signal_pretty_name; //tracking state machine int d_state; diff --git a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc index a7c0062a2..49777f199 100644 --- a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc @@ -224,7 +224,7 @@ void Galileo_E1_Tcp_Connector_Tracking_cc::start_tracking() // DEBUG OUTPUT std::cout << "Tracking of Galileo E1 signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; - LOG(INFO) << "Starting tracking of satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; + LOG(INFO) << "Tracking of Galileo E1 signal for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; // enable tracking d_pull_in = true; @@ -263,6 +263,45 @@ Galileo_E1_Tcp_Connector_Tracking_cc::~Galileo_E1_Tcp_Connector_Tracking_cc() } +void Galileo_E1_Tcp_Connector_Tracking_cc::set_channel(unsigned int channel) +{ + d_channel = channel; + LOG(INFO) << "Tracking Channel set to " << d_channel; + // ############# ENABLE DATA FILE LOG ################# + if (d_dump == true) + { + if (d_dump_file.is_open() == false) + { + try + { + d_dump_filename.append(boost::lexical_cast(d_channel)); + d_dump_filename.append(".dat"); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); + LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); + } + catch (const std::ifstream::failure &e) + { + LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); + } + } + } + + //! Listen for connections on a TCP port + if (d_listen_connection == true) + { + d_port = d_port_ch0 + d_channel; + d_listen_connection = d_tcp_com.listen_tcp_connection(d_port, d_port_ch0); + } +} + + +void Galileo_E1_Tcp_Connector_Tracking_cc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) +{ + d_acquisition_gnss_synchro = p_gnss_synchro; +} + + int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { @@ -514,42 +553,3 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri return 0; } } - - -void Galileo_E1_Tcp_Connector_Tracking_cc::set_channel(unsigned int channel) -{ - d_channel = channel; - LOG(INFO) << "Tracking Channel set to " << d_channel; - // ############# ENABLE DATA FILE LOG ################# - if (d_dump == true) - { - if (d_dump_file.is_open() == false) - { - try - { - d_dump_filename.append(boost::lexical_cast(d_channel)); - d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); - d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); - LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); - } - catch (const std::ifstream::failure &e) - { - LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); - } - } - } - - //! Listen for connections on a TCP port - if (d_listen_connection == true) - { - d_port = d_port_ch0 + d_channel; - d_listen_connection = d_tcp_com.listen_tcp_connection(d_port, d_port_ch0); - } -} - - -void Galileo_E1_Tcp_Connector_Tracking_cc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) -{ - d_acquisition_gnss_synchro = p_gnss_synchro; -} diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc index df57be51e..9e93616bb 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc @@ -295,8 +295,8 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_cc::start_tracking() sys = sys_.substr(0, 1); // DEBUG OUTPUT - std::cout << "Tracking start on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; - LOG(INFO) << "Starting tracking of satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; + std::cout << "Tracking of GLONASS L1 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; + LOG(INFO) << "Tracking of GLONASS L1 C/A signal for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; // enable tracking d_pull_in = true; @@ -558,6 +558,38 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile() } +void glonass_l1_ca_dll_pll_c_aid_tracking_cc::set_channel(unsigned int channel) +{ + d_channel = channel; + LOG(INFO) << "Tracking Channel set to " << d_channel; + // ############# ENABLE DATA FILE LOG ################# + if (d_dump == true) + { + if (d_dump_file.is_open() == false) + { + try + { + d_dump_filename.append(boost::lexical_cast(d_channel)); + d_dump_filename.append(".dat"); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); + LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str() << std::endl; + } + catch (const std::ifstream::failure *e) + { + LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e->what() << std::endl; + } + } + } +} + + +void glonass_l1_ca_dll_pll_c_aid_tracking_cc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) +{ + d_acquisition_gnss_synchro = p_gnss_synchro; +} + + int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { @@ -895,35 +927,3 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false } - - -void glonass_l1_ca_dll_pll_c_aid_tracking_cc::set_channel(unsigned int channel) -{ - d_channel = channel; - LOG(INFO) << "Tracking Channel set to " << d_channel; - // ############# ENABLE DATA FILE LOG ################# - if (d_dump == true) - { - if (d_dump_file.is_open() == false) - { - try - { - d_dump_filename.append(boost::lexical_cast(d_channel)); - d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); - d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); - LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str() << std::endl; - } - catch (const std::ifstream::failure *e) - { - LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e->what() << std::endl; - } - } - } -} - - -void glonass_l1_ca_dll_pll_c_aid_tracking_cc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) -{ - d_acquisition_gnss_synchro = p_gnss_synchro; -} diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc index 313756921..ebfc2516a 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc @@ -292,8 +292,8 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_sc::start_tracking() sys = sys_.substr(0, 1); // DEBUG OUTPUT - std::cout << "Tracking start on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; - LOG(INFO) << "Starting tracking of satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; + std::cout << "Tracking of GLONASS L1 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; + LOG(INFO) << "Tracking of GLONASS L1 C/A signal for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; // enable tracking d_pull_in = true; @@ -551,6 +551,38 @@ glonass_l1_ca_dll_pll_c_aid_tracking_sc::~glonass_l1_ca_dll_pll_c_aid_tracking_s } +void glonass_l1_ca_dll_pll_c_aid_tracking_sc::set_channel(unsigned int channel) +{ + d_channel = channel; + LOG(INFO) << "Tracking Channel set to " << d_channel; + // ############# ENABLE DATA FILE LOG ################# + if (d_dump == true) + { + if (d_dump_file.is_open() == false) + { + try + { + d_dump_filename.append(boost::lexical_cast(d_channel)); + d_dump_filename.append(".dat"); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); + LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str() << std::endl; + } + catch (const std::ifstream::failure *e) + { + LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e->what() << std::endl; + } + } + } +} + + +void glonass_l1_ca_dll_pll_c_aid_tracking_sc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) +{ + d_acquisition_gnss_synchro = p_gnss_synchro; +} + + int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { @@ -886,35 +918,3 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false } - - -void glonass_l1_ca_dll_pll_c_aid_tracking_sc::set_channel(unsigned int channel) -{ - d_channel = channel; - LOG(INFO) << "Tracking Channel set to " << d_channel; - // ############# ENABLE DATA FILE LOG ################# - if (d_dump == true) - { - if (d_dump_file.is_open() == false) - { - try - { - d_dump_filename.append(boost::lexical_cast(d_channel)); - d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); - d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); - LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str() << std::endl; - } - catch (const std::ifstream::failure *e) - { - LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e->what() << std::endl; - } - } - } -} - - -void glonass_l1_ca_dll_pll_c_aid_tracking_sc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) -{ - d_acquisition_gnss_synchro = p_gnss_synchro; -} diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc index d35b6159c..278b320e3 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc @@ -253,7 +253,7 @@ void Glonass_L1_Ca_Dll_Pll_Tracking_cc::start_tracking() // DEBUG OUTPUT std::cout << "Tracking of GLONASS L1 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; - LOG(INFO) << "Starting tracking of satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; + LOG(INFO) << "Tracking of GLONASS L1 C/A signal for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; // enable tracking d_pull_in = true; @@ -512,6 +512,38 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::save_matfile() } +void Glonass_L1_Ca_Dll_Pll_Tracking_cc::set_channel(unsigned int channel) +{ + d_channel = channel; + LOG(INFO) << "Tracking Channel set to " << d_channel; + // ############# ENABLE DATA FILE LOG ################# + if (d_dump == true) + { + if (d_dump_file.is_open() == false) + { + try + { + d_dump_filename.append(boost::lexical_cast(d_channel)); + d_dump_filename.append(".dat"); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); + LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); + } + catch (const std::ifstream::failure &e) + { + LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); + } + } + } +} + + +void Glonass_L1_Ca_Dll_Pll_Tracking_cc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) +{ + d_acquisition_gnss_synchro = p_gnss_synchro; +} + + int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { @@ -738,35 +770,3 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut d_sample_counter += d_current_prn_length_samples; // count for the processed samples return 1; // output tracking result ALWAYS even in the case of d_enable_tracking==false } - - -void Glonass_L1_Ca_Dll_Pll_Tracking_cc::set_channel(unsigned int channel) -{ - d_channel = channel; - LOG(INFO) << "Tracking Channel set to " << d_channel; - // ############# ENABLE DATA FILE LOG ################# - if (d_dump == true) - { - if (d_dump_file.is_open() == false) - { - try - { - d_dump_filename.append(boost::lexical_cast(d_channel)); - d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); - d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); - LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); - } - catch (const std::ifstream::failure &e) - { - LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); - } - } - } -} - - -void Glonass_L1_Ca_Dll_Pll_Tracking_cc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) -{ - d_acquisition_gnss_synchro = p_gnss_synchro; -} diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc index 53f8f704b..1b269f709 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc @@ -292,8 +292,8 @@ void glonass_l2_ca_dll_pll_c_aid_tracking_cc::start_tracking() sys = sys_.substr(0, 1); // DEBUG OUTPUT - std::cout << "Tracking start on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; - LOG(INFO) << "Starting tracking of satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; + std::cout << "Tracking of GLONASS L2 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; + LOG(INFO) << "Tracking of GLONASS L2 C/A signal for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; // enable tracking d_pull_in = true; @@ -555,6 +555,38 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_cc::save_matfile() } +void glonass_l2_ca_dll_pll_c_aid_tracking_cc::set_channel(unsigned int channel) +{ + d_channel = channel; + LOG(INFO) << "Tracking Channel set to " << d_channel; + // ############# ENABLE DATA FILE LOG ################# + if (d_dump == true) + { + if (d_dump_file.is_open() == false) + { + try + { + d_dump_filename.append(boost::lexical_cast(d_channel)); + d_dump_filename.append(".dat"); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); + LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str() << std::endl; + } + catch (const std::ifstream::failure *e) + { + LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e->what() << std::endl; + } + } + } +} + + +void glonass_l2_ca_dll_pll_c_aid_tracking_cc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) +{ + d_acquisition_gnss_synchro = p_gnss_synchro; +} + + int glonass_l2_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { @@ -892,35 +924,3 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false } - - -void glonass_l2_ca_dll_pll_c_aid_tracking_cc::set_channel(unsigned int channel) -{ - d_channel = channel; - LOG(INFO) << "Tracking Channel set to " << d_channel; - // ############# ENABLE DATA FILE LOG ################# - if (d_dump == true) - { - if (d_dump_file.is_open() == false) - { - try - { - d_dump_filename.append(boost::lexical_cast(d_channel)); - d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); - d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); - LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str() << std::endl; - } - catch (const std::ifstream::failure *e) - { - LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e->what() << std::endl; - } - } - } -} - - -void glonass_l2_ca_dll_pll_c_aid_tracking_cc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) -{ - d_acquisition_gnss_synchro = p_gnss_synchro; -} diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc index decc5d5ca..80c7e6a80 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc @@ -290,8 +290,8 @@ void glonass_l2_ca_dll_pll_c_aid_tracking_sc::start_tracking() sys = sys_.substr(0, 1); // DEBUG OUTPUT - std::cout << "Tracking start on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; - LOG(INFO) << "Starting tracking of satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; + std::cout << "Tracking of GLONASS L2 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; + LOG(INFO) << "Tracking of GLONASS L2 C/A signal for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; // enable tracking d_pull_in = true; @@ -549,6 +549,38 @@ glonass_l2_ca_dll_pll_c_aid_tracking_sc::~glonass_l2_ca_dll_pll_c_aid_tracking_s } +void glonass_l2_ca_dll_pll_c_aid_tracking_sc::set_channel(unsigned int channel) +{ + d_channel = channel; + LOG(INFO) << "Tracking Channel set to " << d_channel; + // ############# ENABLE DATA FILE LOG ################# + if (d_dump == true) + { + if (d_dump_file.is_open() == false) + { + try + { + d_dump_filename.append(boost::lexical_cast(d_channel)); + d_dump_filename.append(".dat"); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); + LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str() << std::endl; + } + catch (const std::ifstream::failure *e) + { + LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e->what() << std::endl; + } + } + } +} + + +void glonass_l2_ca_dll_pll_c_aid_tracking_sc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) +{ + d_acquisition_gnss_synchro = p_gnss_synchro; +} + + int glonass_l2_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { @@ -884,35 +916,3 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false } - - -void glonass_l2_ca_dll_pll_c_aid_tracking_sc::set_channel(unsigned int channel) -{ - d_channel = channel; - LOG(INFO) << "Tracking Channel set to " << d_channel; - // ############# ENABLE DATA FILE LOG ################# - if (d_dump == true) - { - if (d_dump_file.is_open() == false) - { - try - { - d_dump_filename.append(boost::lexical_cast(d_channel)); - d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); - d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); - LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str() << std::endl; - } - catch (const std::ifstream::failure *e) - { - LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e->what() << std::endl; - } - } - } -} - - -void glonass_l2_ca_dll_pll_c_aid_tracking_sc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) -{ - d_acquisition_gnss_synchro = p_gnss_synchro; -} diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc index f6428bc5c..77c7776ed 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc @@ -253,7 +253,7 @@ void Glonass_L2_Ca_Dll_Pll_Tracking_cc::start_tracking() // DEBUG OUTPUT std::cout << "Tracking of GLONASS L2 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; - LOG(INFO) << "Starting tracking of satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; + LOG(INFO) << "Tracking of GLONASS L2 C/A signal for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; // enable tracking d_pull_in = true; @@ -512,6 +512,38 @@ int Glonass_L2_Ca_Dll_Pll_Tracking_cc::save_matfile() } +void Glonass_L2_Ca_Dll_Pll_Tracking_cc::set_channel(unsigned int channel) +{ + d_channel = channel; + LOG(INFO) << "Tracking Channel set to " << d_channel; + // ############# ENABLE DATA FILE LOG ################# + if (d_dump == true) + { + if (d_dump_file.is_open() == false) + { + try + { + d_dump_filename.append(boost::lexical_cast(d_channel)); + d_dump_filename.append(".dat"); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); + LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); + } + catch (const std::ifstream::failure &e) + { + LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); + } + } + } +} + + +void Glonass_L2_Ca_Dll_Pll_Tracking_cc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) +{ + d_acquisition_gnss_synchro = p_gnss_synchro; +} + + int Glonass_L2_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { @@ -738,35 +770,3 @@ int Glonass_L2_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut d_sample_counter += d_current_prn_length_samples; // count for the processed samples return 1; // output tracking result ALWAYS even in the case of d_enable_tracking==false } - - -void Glonass_L2_Ca_Dll_Pll_Tracking_cc::set_channel(unsigned int channel) -{ - d_channel = channel; - LOG(INFO) << "Tracking Channel set to " << d_channel; - // ############# ENABLE DATA FILE LOG ################# - if (d_dump == true) - { - if (d_dump_file.is_open() == false) - { - try - { - d_dump_filename.append(boost::lexical_cast(d_channel)); - d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); - d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); - LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); - } - catch (const std::ifstream::failure &e) - { - LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); - } - } - } -} - - -void Glonass_L2_Ca_Dll_Pll_Tracking_cc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) -{ - d_acquisition_gnss_synchro = p_gnss_synchro; -} diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc index c242a10b8..461334537 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc @@ -276,7 +276,7 @@ void gps_l1_ca_dll_pll_c_aid_tracking_cc::start_tracking() // DEBUG OUTPUT std::cout << "Tracking of GPS L1 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; - LOG(INFO) << "Starting tracking of satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; + LOG(INFO) << "Tracking of GPS L1 C/A signal for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; // enable tracking d_pull_in = true; @@ -538,6 +538,38 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile() } +void gps_l1_ca_dll_pll_c_aid_tracking_cc::set_channel(unsigned int channel) +{ + d_channel = channel; + LOG(INFO) << "Tracking Channel set to " << d_channel; + // ############# ENABLE DATA FILE LOG ################# + if (d_dump == true) + { + if (d_dump_file.is_open() == false) + { + try + { + d_dump_filename.append(boost::lexical_cast(d_channel)); + d_dump_filename.append(".dat"); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); + LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); + } + catch (const std::ifstream::failure *e) + { + LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e->what() << std::endl; + } + } + } +} + + +void gps_l1_ca_dll_pll_c_aid_tracking_cc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) +{ + d_acquisition_gnss_synchro = p_gnss_synchro; +} + + int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { @@ -842,7 +874,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __attrib // PLL commands tmp_float = 1.0 / (d_carr_phase_error_secs_Ti * CURRENT_INTEGRATION_TIME_S); d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float)); - tmp_float = 1.0 / (d_code_error_filt_chips_Ti * CURRENT_INTEGRATION_TIME_S);; + tmp_float = 1.0 / (d_code_error_filt_chips_Ti * CURRENT_INTEGRATION_TIME_S); d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float)); // DLL commands tmp_float = d_code_error_chips_Ti * CURRENT_INTEGRATION_TIME_S; @@ -881,35 +913,3 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __attrib return 0; } } - - -void gps_l1_ca_dll_pll_c_aid_tracking_cc::set_channel(unsigned int channel) -{ - d_channel = channel; - LOG(INFO) << "Tracking Channel set to " << d_channel; - // ############# ENABLE DATA FILE LOG ################# - if (d_dump == true) - { - if (d_dump_file.is_open() == false) - { - try - { - d_dump_filename.append(boost::lexical_cast(d_channel)); - d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); - d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); - LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); - } - catch (const std::ifstream::failure *e) - { - LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e->what() << std::endl; - } - } - } -} - - -void gps_l1_ca_dll_pll_c_aid_tracking_cc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) -{ - d_acquisition_gnss_synchro = p_gnss_synchro; -} diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.cc index 1d1561a21..8112feaf3 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.cc @@ -268,12 +268,8 @@ void gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::start_tracking() sys = sys_.substr(0, 1); // DEBUG OUTPUT - std::cout << "Tracking start on channel " << d_channel << " for satellite " - << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) - << std::endl; - LOG(INFO) << "Starting tracking of satellite " - << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) - << " on channel " << d_channel; + std::cout << "Tracking of GPS L1 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; + LOG(INFO) << "Tracking of GPS L1 C/A signal for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; // enable tracking d_pull_in = true; @@ -333,6 +329,257 @@ gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::~gps_l1_ca_dll_pll_c_aid_tracking_fpga } +void gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::set_channel(unsigned int channel) +{ + d_channel = channel; + multicorrelator_fpga_8sc->set_channel(d_channel); + LOG(INFO) << "Tracking Channel set to " << d_channel; + // ############# ENABLE DATA FILE LOG ################# + if (d_dump == true) + { + if (d_dump_file.is_open() == false) + { + try + { + d_dump_filename.append(boost::lexical_cast(d_channel)); + d_dump_filename.append(".dat"); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); + LOG(INFO) << "Tracking dump enabled on channel " + << d_channel << " Log file: " + << d_dump_filename.c_str(); + } + catch (const std::ifstream::failure *e) + { + LOG(WARNING) << "channel " << d_channel + << " Exception opening trk dump file " + << e->what(); + } + } + } +} + + +int gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::save_matfile() +{ + // READ DUMP FILE + std::ifstream::pos_type size; + int number_of_double_vars = 11; + int number_of_float_vars = 5; + int epoch_size_bytes = sizeof(unsigned long int) + sizeof(double) * number_of_double_vars + + sizeof(float) * number_of_float_vars + sizeof(unsigned int); + std::ifstream dump_file; + dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + try + { + dump_file.open(d_dump_filename.c_str(), std::ios::binary | std::ios::ate); + } + catch (const std::ifstream::failure &e) + { + std::cerr << "Problem opening dump file:" << e.what() << std::endl; + return 1; + } + // count number of epochs and rewind + long int num_epoch = 0; + if (dump_file.is_open()) + { + size = dump_file.tellg(); + num_epoch = static_cast(size) / static_cast(epoch_size_bytes); + dump_file.seekg(0, std::ios::beg); + } + else + { + return 1; + } + float *abs_E = new float[num_epoch]; + float *abs_P = new float[num_epoch]; + float *abs_L = new float[num_epoch]; + float *Prompt_I = new float[num_epoch]; + float *Prompt_Q = new float[num_epoch]; + unsigned long int *PRN_start_sample_count = new unsigned long int[num_epoch]; + double *acc_carrier_phase_rad = new double[num_epoch]; + double *carrier_doppler_hz = new double[num_epoch]; + double *code_freq_chips = new double[num_epoch]; + double *carr_error_hz = new double[num_epoch]; + double *carr_error_filt_hz = new double[num_epoch]; + double *code_error_chips = new double[num_epoch]; + double *code_error_filt_chips = new double[num_epoch]; + double *CN0_SNV_dB_Hz = new double[num_epoch]; + double *carrier_lock_test = new double[num_epoch]; + double *aux1 = new double[num_epoch]; + double *aux2 = new double[num_epoch]; + unsigned int *PRN = new unsigned int[num_epoch]; + + try + { + if (dump_file.is_open()) + { + for (long int i = 0; i < num_epoch; i++) + { + dump_file.read(reinterpret_cast(&abs_E[i]), sizeof(float)); + dump_file.read(reinterpret_cast(&abs_P[i]), sizeof(float)); + dump_file.read(reinterpret_cast(&abs_L[i]), sizeof(float)); + dump_file.read(reinterpret_cast(&Prompt_I[i]), sizeof(float)); + dump_file.read(reinterpret_cast(&Prompt_Q[i]), sizeof(float)); + dump_file.read(reinterpret_cast(&PRN_start_sample_count[i]), sizeof(unsigned long int)); + dump_file.read(reinterpret_cast(&acc_carrier_phase_rad[i]), sizeof(double)); + dump_file.read(reinterpret_cast(&carrier_doppler_hz[i]), sizeof(double)); + dump_file.read(reinterpret_cast(&code_freq_chips[i]), sizeof(double)); + dump_file.read(reinterpret_cast(&carr_error_hz[i]), sizeof(double)); + dump_file.read(reinterpret_cast(&carr_error_filt_hz[i]), sizeof(double)); + dump_file.read(reinterpret_cast(&code_error_chips[i]), sizeof(double)); + dump_file.read(reinterpret_cast(&code_error_filt_chips[i]), sizeof(double)); + dump_file.read(reinterpret_cast(&CN0_SNV_dB_Hz[i]), sizeof(double)); + dump_file.read(reinterpret_cast(&carrier_lock_test[i]), sizeof(double)); + dump_file.read(reinterpret_cast(&aux1[i]), sizeof(double)); + dump_file.read(reinterpret_cast(&aux2[i]), sizeof(double)); + dump_file.read(reinterpret_cast(&PRN[i]), sizeof(unsigned int)); + } + } + dump_file.close(); + } + catch (const std::ifstream::failure &e) + { + std::cerr << "Problem reading dump file:" << e.what() << std::endl; + delete[] abs_E; + delete[] abs_P; + delete[] abs_L; + delete[] Prompt_I; + delete[] Prompt_Q; + delete[] PRN_start_sample_count; + delete[] acc_carrier_phase_rad; + delete[] carrier_doppler_hz; + delete[] code_freq_chips; + delete[] carr_error_hz; + delete[] carr_error_filt_hz; + delete[] code_error_chips; + delete[] code_error_filt_chips; + delete[] CN0_SNV_dB_Hz; + delete[] carrier_lock_test; + delete[] aux1; + delete[] aux2; + delete[] PRN; + return 1; + } + + // WRITE MAT FILE + mat_t *matfp; + matvar_t *matvar; + std::string filename = d_dump_filename; + filename.erase(filename.length() - 4, 4); + filename.append(".mat"); + matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); + if (reinterpret_cast(matfp) != NULL) + { + size_t dims[2] = {1, static_cast(num_epoch)}; + matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("abs_P", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_P, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("abs_L", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_L, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("Prompt_I", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, Prompt_I, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("Prompt_Q", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, Prompt_Q, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("PRN_start_sample_count", MAT_C_UINT64, MAT_T_UINT64, 2, dims, PRN_start_sample_count, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("acc_carrier_phase_rad", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, acc_carrier_phase_rad, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("carrier_doppler_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carrier_doppler_hz, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("code_freq_chips", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, code_freq_chips, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("carr_error_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carr_error_hz, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("carr_error_filt_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carr_error_filt_hz, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("code_error_chips", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, code_error_chips, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("code_error_filt_chips", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, code_error_filt_chips, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("CN0_SNV_dB_Hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, CN0_SNV_dB_Hz, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("carrier_lock_test", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carrier_lock_test, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("aux1", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, aux1, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("aux2", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, aux2, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("PRN", MAT_C_UINT32, MAT_T_UINT32, 2, dims, PRN, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + } + Mat_Close(matfp); + delete[] abs_E; + delete[] abs_P; + delete[] abs_L; + delete[] Prompt_I; + delete[] Prompt_Q; + delete[] PRN_start_sample_count; + delete[] acc_carrier_phase_rad; + delete[] carrier_doppler_hz; + delete[] code_freq_chips; + delete[] carr_error_hz; + delete[] carr_error_filt_hz; + delete[] code_error_chips; + delete[] code_error_filt_chips; + delete[] CN0_SNV_dB_Hz; + delete[] carrier_lock_test; + delete[] aux1; + delete[] aux2; + delete[] PRN; + return 0; +} + + +void gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::set_gnss_synchro( + Gnss_Synchro *p_gnss_synchro) +{ + d_acquisition_gnss_synchro = p_gnss_synchro; +} + + +void gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::reset(void) +{ + multicorrelator_fpga_8sc->unlock_channel(); +} + + int gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::general_work( int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), @@ -703,253 +950,3 @@ int gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::general_work( return 0; } } - - -void gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::set_channel(unsigned int channel) -{ - d_channel = channel; - multicorrelator_fpga_8sc->set_channel(d_channel); - LOG(INFO) << "Tracking Channel set to " << d_channel; - // ############# ENABLE DATA FILE LOG ################# - if (d_dump == true) - { - if (d_dump_file.is_open() == false) - { - try - { - d_dump_filename.append(boost::lexical_cast(d_channel)); - d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); - d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); - LOG(INFO) << "Tracking dump enabled on channel " - << d_channel << " Log file: " - << d_dump_filename.c_str(); - } - catch (const std::ifstream::failure *e) - { - LOG(WARNING) << "channel " << d_channel - << " Exception opening trk dump file " - << e->what(); - } - } - } -} - - -int gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::save_matfile() -{ - // READ DUMP FILE - std::ifstream::pos_type size; - int number_of_double_vars = 11; - int number_of_float_vars = 5; - int epoch_size_bytes = sizeof(unsigned long int) + sizeof(double) * number_of_double_vars + - sizeof(float) * number_of_float_vars + sizeof(unsigned int); - std::ifstream dump_file; - dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); - try - { - dump_file.open(d_dump_filename.c_str(), std::ios::binary | std::ios::ate); - } - catch (const std::ifstream::failure &e) - { - std::cerr << "Problem opening dump file:" << e.what() << std::endl; - return 1; - } - // count number of epochs and rewind - long int num_epoch = 0; - if (dump_file.is_open()) - { - size = dump_file.tellg(); - num_epoch = static_cast(size) / static_cast(epoch_size_bytes); - dump_file.seekg(0, std::ios::beg); - } - else - { - return 1; - } - float *abs_E = new float[num_epoch]; - float *abs_P = new float[num_epoch]; - float *abs_L = new float[num_epoch]; - float *Prompt_I = new float[num_epoch]; - float *Prompt_Q = new float[num_epoch]; - unsigned long int *PRN_start_sample_count = new unsigned long int[num_epoch]; - double *acc_carrier_phase_rad = new double[num_epoch]; - double *carrier_doppler_hz = new double[num_epoch]; - double *code_freq_chips = new double[num_epoch]; - double *carr_error_hz = new double[num_epoch]; - double *carr_error_filt_hz = new double[num_epoch]; - double *code_error_chips = new double[num_epoch]; - double *code_error_filt_chips = new double[num_epoch]; - double *CN0_SNV_dB_Hz = new double[num_epoch]; - double *carrier_lock_test = new double[num_epoch]; - double *aux1 = new double[num_epoch]; - double *aux2 = new double[num_epoch]; - unsigned int *PRN = new unsigned int[num_epoch]; - - try - { - if (dump_file.is_open()) - { - for (long int i = 0; i < num_epoch; i++) - { - dump_file.read(reinterpret_cast(&abs_E[i]), sizeof(float)); - dump_file.read(reinterpret_cast(&abs_P[i]), sizeof(float)); - dump_file.read(reinterpret_cast(&abs_L[i]), sizeof(float)); - dump_file.read(reinterpret_cast(&Prompt_I[i]), sizeof(float)); - dump_file.read(reinterpret_cast(&Prompt_Q[i]), sizeof(float)); - dump_file.read(reinterpret_cast(&PRN_start_sample_count[i]), sizeof(unsigned long int)); - dump_file.read(reinterpret_cast(&acc_carrier_phase_rad[i]), sizeof(double)); - dump_file.read(reinterpret_cast(&carrier_doppler_hz[i]), sizeof(double)); - dump_file.read(reinterpret_cast(&code_freq_chips[i]), sizeof(double)); - dump_file.read(reinterpret_cast(&carr_error_hz[i]), sizeof(double)); - dump_file.read(reinterpret_cast(&carr_error_filt_hz[i]), sizeof(double)); - dump_file.read(reinterpret_cast(&code_error_chips[i]), sizeof(double)); - dump_file.read(reinterpret_cast(&code_error_filt_chips[i]), sizeof(double)); - dump_file.read(reinterpret_cast(&CN0_SNV_dB_Hz[i]), sizeof(double)); - dump_file.read(reinterpret_cast(&carrier_lock_test[i]), sizeof(double)); - dump_file.read(reinterpret_cast(&aux1[i]), sizeof(double)); - dump_file.read(reinterpret_cast(&aux2[i]), sizeof(double)); - dump_file.read(reinterpret_cast(&PRN[i]), sizeof(unsigned int)); - } - } - dump_file.close(); - } - catch (const std::ifstream::failure &e) - { - std::cerr << "Problem reading dump file:" << e.what() << std::endl; - delete[] abs_E; - delete[] abs_P; - delete[] abs_L; - delete[] Prompt_I; - delete[] Prompt_Q; - delete[] PRN_start_sample_count; - delete[] acc_carrier_phase_rad; - delete[] carrier_doppler_hz; - delete[] code_freq_chips; - delete[] carr_error_hz; - delete[] carr_error_filt_hz; - delete[] code_error_chips; - delete[] code_error_filt_chips; - delete[] CN0_SNV_dB_Hz; - delete[] carrier_lock_test; - delete[] aux1; - delete[] aux2; - delete[] PRN; - return 1; - } - - // WRITE MAT FILE - mat_t *matfp; - matvar_t *matvar; - std::string filename = d_dump_filename; - filename.erase(filename.length() - 4, 4); - filename.append(".mat"); - matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); - if (reinterpret_cast(matfp) != NULL) - { - size_t dims[2] = {1, static_cast(num_epoch)}; - matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarFree(matvar); - - matvar = Mat_VarCreate("abs_P", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_P, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarFree(matvar); - - matvar = Mat_VarCreate("abs_L", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_L, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarFree(matvar); - - matvar = Mat_VarCreate("Prompt_I", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, Prompt_I, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarFree(matvar); - - matvar = Mat_VarCreate("Prompt_Q", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, Prompt_Q, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarFree(matvar); - - matvar = Mat_VarCreate("PRN_start_sample_count", MAT_C_UINT64, MAT_T_UINT64, 2, dims, PRN_start_sample_count, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarFree(matvar); - - matvar = Mat_VarCreate("acc_carrier_phase_rad", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, acc_carrier_phase_rad, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarFree(matvar); - - matvar = Mat_VarCreate("carrier_doppler_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carrier_doppler_hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarFree(matvar); - - matvar = Mat_VarCreate("code_freq_chips", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, code_freq_chips, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarFree(matvar); - - matvar = Mat_VarCreate("carr_error_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carr_error_hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarFree(matvar); - - matvar = Mat_VarCreate("carr_error_filt_hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carr_error_filt_hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarFree(matvar); - - matvar = Mat_VarCreate("code_error_chips", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, code_error_chips, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarFree(matvar); - - matvar = Mat_VarCreate("code_error_filt_chips", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, code_error_filt_chips, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarFree(matvar); - - matvar = Mat_VarCreate("CN0_SNV_dB_Hz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, CN0_SNV_dB_Hz, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarFree(matvar); - - matvar = Mat_VarCreate("carrier_lock_test", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, carrier_lock_test, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarFree(matvar); - - matvar = Mat_VarCreate("aux1", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, aux1, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarFree(matvar); - - matvar = Mat_VarCreate("aux2", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, aux2, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarFree(matvar); - - matvar = Mat_VarCreate("PRN", MAT_C_UINT32, MAT_T_UINT32, 2, dims, PRN, 0); - Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE - Mat_VarFree(matvar); - } - Mat_Close(matfp); - delete[] abs_E; - delete[] abs_P; - delete[] abs_L; - delete[] Prompt_I; - delete[] Prompt_Q; - delete[] PRN_start_sample_count; - delete[] acc_carrier_phase_rad; - delete[] carrier_doppler_hz; - delete[] code_freq_chips; - delete[] carr_error_hz; - delete[] carr_error_filt_hz; - delete[] code_error_chips; - delete[] code_error_filt_chips; - delete[] CN0_SNV_dB_Hz; - delete[] carrier_lock_test; - delete[] aux1; - delete[] aux2; - delete[] PRN; - return 0; -} - -void gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::set_gnss_synchro( - Gnss_Synchro *p_gnss_synchro) -{ - d_acquisition_gnss_synchro = p_gnss_synchro; -} - - -void gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::reset(void) -{ - multicorrelator_fpga_8sc->unlock_channel(); -} diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc index 9a4332f06..9e6e136c9 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc @@ -277,7 +277,7 @@ void gps_l1_ca_dll_pll_c_aid_tracking_sc::start_tracking() // DEBUG OUTPUT std::cout << "Tracking of GPS L1 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; - LOG(INFO) << "Starting tracking of satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; + LOG(INFO) << "Tracking of GPS L1 C/A signal for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; // enable tracking d_pull_in = true; @@ -541,6 +541,38 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile() } +void gps_l1_ca_dll_pll_c_aid_tracking_sc::set_channel(unsigned int channel) +{ + d_channel = channel; + LOG(INFO) << "Tracking Channel set to " << d_channel; + // ############# ENABLE DATA FILE LOG ################# + if (d_dump == true) + { + if (d_dump_file.is_open() == false) + { + try + { + d_dump_filename.append(boost::lexical_cast(d_channel)); + d_dump_filename.append(".dat"); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); + LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); + } + catch (const std::ifstream::failure *e) + { + LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e->what(); + } + } + } +} + + +void gps_l1_ca_dll_pll_c_aid_tracking_sc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) +{ + d_acquisition_gnss_synchro = p_gnss_synchro; +} + + int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { @@ -883,35 +915,3 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __attrib return 0; } } - - -void gps_l1_ca_dll_pll_c_aid_tracking_sc::set_channel(unsigned int channel) -{ - d_channel = channel; - LOG(INFO) << "Tracking Channel set to " << d_channel; - // ############# ENABLE DATA FILE LOG ################# - if (d_dump == true) - { - if (d_dump_file.is_open() == false) - { - try - { - d_dump_filename.append(boost::lexical_cast(d_channel)); - d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); - d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); - LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); - } - catch (const std::ifstream::failure *e) - { - LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e->what(); - } - } - } -} - - -void gps_l1_ca_dll_pll_c_aid_tracking_sc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) -{ - d_acquisition_gnss_synchro = p_gnss_synchro; -} diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc index 759128d0b..914f08e5a 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc @@ -245,7 +245,7 @@ void Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::start_tracking() // DEBUG OUTPUT std::cout << "Tracking of GPS L1 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; - LOG(INFO) << "Starting tracking of satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; + LOG(INFO) << "Tracking of GPS L1 C/A signal for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; // enable tracking d_pull_in = true; @@ -287,6 +287,38 @@ Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::~Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc() } +void Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::set_channel(unsigned int channel) +{ + d_channel = channel; + LOG(INFO) << "Tracking Channel set to " << d_channel; + // ############# ENABLE DATA FILE LOG ################# + if (d_dump == true) + { + if (d_dump_file.is_open() == false) + { + try + { + d_dump_filename.append(boost::lexical_cast(d_channel)); + d_dump_filename.append(".dat"); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); + LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); + } + catch (const std::ifstream::failure *e) + { + LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e->what(); + } + } + } +} + + +void Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) +{ + d_acquisition_gnss_synchro = p_gnss_synchro; +} + + int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { @@ -539,35 +571,3 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work(int noutput_items __attribut return 0; } } - - -void Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::set_channel(unsigned int channel) -{ - d_channel = channel; - LOG(INFO) << "Tracking Channel set to " << d_channel; - // ############# ENABLE DATA FILE LOG ################# - if (d_dump == true) - { - if (d_dump_file.is_open() == false) - { - try - { - d_dump_filename.append(boost::lexical_cast(d_channel)); - d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); - d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); - LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); - } - catch (const std::ifstream::failure *e) - { - LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e->what(); - } - } - } -} - - -void Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) -{ - d_acquisition_gnss_synchro = p_gnss_synchro; -} diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc index cd4c86652..ed85d234b 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc @@ -252,7 +252,7 @@ void Gps_L1_Ca_Tcp_Connector_Tracking_cc::start_tracking() // DEBUG OUTPUT std::cout << "Tracking of GPS L1 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; - LOG(INFO) << "Starting tracking of satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; + LOG(INFO) << "Tracking of GPS L1 C/A signal for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; // enable tracking d_pull_in = true; @@ -293,6 +293,45 @@ Gps_L1_Ca_Tcp_Connector_Tracking_cc::~Gps_L1_Ca_Tcp_Connector_Tracking_cc() } +void Gps_L1_Ca_Tcp_Connector_Tracking_cc::set_channel(unsigned int channel) +{ + d_channel = channel; + LOG(INFO) << "Tracking Channel set to " << d_channel; + // ############# ENABLE DATA FILE LOG ################# + if (d_dump == true) + { + if (d_dump_file.is_open() == false) + { + try + { + d_dump_filename.append(boost::lexical_cast(d_channel)); + d_dump_filename.append(".dat"); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); + LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); + } + catch (const std::ifstream::failure &e) + { + LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); + } + } + } + + //! Listen for connections on a TCP port + if (d_listen_connection == true) + { + d_port = d_port_ch0 + d_channel; + d_listen_connection = d_tcp_com.listen_tcp_connection(d_port, d_port_ch0); + } +} + + +void Gps_L1_Ca_Tcp_Connector_Tracking_cc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) +{ + d_acquisition_gnss_synchro = p_gnss_synchro; +} + + int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { @@ -553,42 +592,3 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attrib return 0; } } - - -void Gps_L1_Ca_Tcp_Connector_Tracking_cc::set_channel(unsigned int channel) -{ - d_channel = channel; - LOG(INFO) << "Tracking Channel set to " << d_channel; - // ############# ENABLE DATA FILE LOG ################# - if (d_dump == true) - { - if (d_dump_file.is_open() == false) - { - try - { - d_dump_filename.append(boost::lexical_cast(d_channel)); - d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); - d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); - LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); - } - catch (const std::ifstream::failure &e) - { - LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); - } - } - } - - //! Listen for connections on a TCP port - if (d_listen_connection == true) - { - d_port = d_port_ch0 + d_channel; - d_listen_connection = d_tcp_com.listen_tcp_connection(d_port, d_port_ch0); - } -} - - -void Gps_L1_Ca_Tcp_Connector_Tracking_cc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) -{ - d_acquisition_gnss_synchro = p_gnss_synchro; -} From 6c55c3a93f257e88f4e0300b009d3919e9fd7339 Mon Sep 17 00:00:00 2001 From: Antonio Ramos Date: Wed, 11 Apr 2018 17:41:27 +0200 Subject: [PATCH 14/82] Improve performance --- .../gnuradio_blocks/hybrid_observables_cc.cc | 49 +++++++++---------- .../gnuradio_blocks/hybrid_observables_cc.h | 2 +- 2 files changed, 25 insertions(+), 26 deletions(-) diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc index 4b6ccfb1d..0dbda3661 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc @@ -67,7 +67,7 @@ hybrid_observables_cc::hybrid_observables_cc(unsigned int nchannels_in, d_latency = 0.08; // 80 ms valid_channels.resize(d_nchannels, false); d_num_valid_channels = 0; - d_gnss_synchro_history = new Gnss_circular_deque(static_cast(max_delta * 1000.0), d_nchannels); + d_gnss_synchro_history = new Gnss_circular_deque(static_cast(max_delta * 1000.0 * 2.0), d_nchannels); // ############# ENABLE DATA FILE LOG ################# if (d_dump) @@ -306,21 +306,18 @@ bool hybrid_observables_cc::interpolate_data(Gnss_Synchro &out, const unsigned i { return false; } - std::pair ind = find_interp_elements(ch, ti); + find_interp_elements(ch, ti); //Linear interpolation: y(t) = y(t1) + (y(t2) - y(t1)) * (t - t1) / (t2 - t1) // CARRIER PHASE INTERPOLATION - - out.Carrier_phase_rads = d_gnss_synchro_history->at(ch, ind.first).Carrier_phase_rads + (d_gnss_synchro_history->at(ch, ind.second).Carrier_phase_rads - d_gnss_synchro_history->at(ch, ind.first).Carrier_phase_rads) * (ti - d_gnss_synchro_history->at(ch, ind.first).RX_time) / (d_gnss_synchro_history->at(ch, ind.second).RX_time - d_gnss_synchro_history->at(ch, ind.first).RX_time); + out.Carrier_phase_rads = d_gnss_synchro_history->at(ch, 0).Carrier_phase_rads + (d_gnss_synchro_history->at(ch, 1).Carrier_phase_rads - d_gnss_synchro_history->at(ch, 0).Carrier_phase_rads) * (ti - d_gnss_synchro_history->at(ch, 0).RX_time) / (d_gnss_synchro_history->at(ch, 1).RX_time - d_gnss_synchro_history->at(ch, 0).RX_time); // CARRIER DOPPLER INTERPOLATION - - out.Carrier_Doppler_hz = d_gnss_synchro_history->at(ch, ind.first).Carrier_Doppler_hz + (d_gnss_synchro_history->at(ch, ind.second).Carrier_Doppler_hz - d_gnss_synchro_history->at(ch, ind.first).Carrier_Doppler_hz) * (ti - d_gnss_synchro_history->at(ch, ind.first).RX_time) / (d_gnss_synchro_history->at(ch, ind.second).RX_time - d_gnss_synchro_history->at(ch, ind.first).RX_time); + out.Carrier_Doppler_hz = d_gnss_synchro_history->at(ch, 0).Carrier_Doppler_hz + (d_gnss_synchro_history->at(ch, 1).Carrier_Doppler_hz - d_gnss_synchro_history->at(ch, 0).Carrier_Doppler_hz) * (ti - d_gnss_synchro_history->at(ch, 0).RX_time) / (d_gnss_synchro_history->at(ch, 1).RX_time - d_gnss_synchro_history->at(ch, 0).RX_time); // TOW INTERPOLATION - - out.TOW_at_current_symbol_s = d_gnss_synchro_history->at(ch, ind.first).TOW_at_current_symbol_s + (d_gnss_synchro_history->at(ch, ind.second).TOW_at_current_symbol_s - d_gnss_synchro_history->at(ch, ind.first).TOW_at_current_symbol_s) * (ti - d_gnss_synchro_history->at(ch, ind.first).RX_time) / (d_gnss_synchro_history->at(ch, ind.second).RX_time - d_gnss_synchro_history->at(ch, ind.first).RX_time); + out.TOW_at_current_symbol_s = d_gnss_synchro_history->at(ch, 0).TOW_at_current_symbol_s + (d_gnss_synchro_history->at(ch, 1).TOW_at_current_symbol_s - d_gnss_synchro_history->at(ch, 0).TOW_at_current_symbol_s) * (ti - d_gnss_synchro_history->at(ch, 0).RX_time) / (d_gnss_synchro_history->at(ch, 1).RX_time - d_gnss_synchro_history->at(ch, 0).RX_time); return true; } @@ -338,38 +335,40 @@ double hybrid_observables_cc::compute_T_rx_s(const Gnss_Synchro &a) } } -std::pair hybrid_observables_cc::find_interp_elements(const unsigned int &ch, const double &ti) +void hybrid_observables_cc::find_interp_elements(const unsigned int &ch, const double &ti) { unsigned int closest = 0; double dif = std::numeric_limits::max(); double dt = 0.0; for (unsigned int i = 0; i < d_gnss_synchro_history->size(ch); i++) { - dt = ti - d_gnss_synchro_history->at(ch, i).RX_time; - if (dt < dif and dt > 0.0) + dt = std::fabs(ti - d_gnss_synchro_history->at(ch, i).RX_time); + if (dt < dif) { - dif = dt; closest = i; + dif = dt; + } + else + { + break; } } - unsigned int index1; - unsigned int index2; - if (closest == 0) + if (ti > d_gnss_synchro_history->at(ch, closest).RX_time) { - index1 = 0; - index2 = 1; - } - else if (closest == (d_gnss_synchro_history->size(ch) - 1)) - { - index1 = d_gnss_synchro_history->size(ch) - 2; - index2 = d_gnss_synchro_history->size(ch) - 1; + while (closest > 0) + { + d_gnss_synchro_history->pop_front(ch); + closest--; + } } else { - index1 = closest; - index2 = closest + 1; + while (closest > 1) + { + d_gnss_synchro_history->pop_front(ch); + closest--; + } } - return std::pair(index1, index2); } diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.h b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.h index 64f929857..5772464e2 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.h +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.h @@ -68,7 +68,7 @@ private: void clean_history(unsigned int pos); double compute_T_rx_s(const Gnss_Synchro& a); bool interpolate_data(Gnss_Synchro& out, const unsigned int& ch, const double& ti); - std::pair find_interp_elements(const unsigned int& ch, const double& ti); + void find_interp_elements(const unsigned int& ch, const double& ti); void correct_TOW_and_compute_prange(std::vector& data); int save_matfile(); From 6de28277edf9ef487905cde13a409aadde16ccaa Mon Sep 17 00:00:00 2001 From: Antonio Ramos Date: Thu, 12 Apr 2018 10:57:12 +0200 Subject: [PATCH 15/82] Fine tune buffer parameters --- .../observables/gnuradio_blocks/hybrid_observables_cc.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc index 0dbda3661..274dc0732 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc @@ -63,11 +63,11 @@ hybrid_observables_cc::hybrid_observables_cc(unsigned int nchannels_in, d_dump_filename = dump_filename; T_rx_s = 0.0; T_rx_step_s = 0.001; // 1 ms - max_delta = 3.5; // 3.5 s - d_latency = 0.08; // 80 ms + max_delta = 1.5; // 1.5 s + d_latency = 0.175; // 175 ms valid_channels.resize(d_nchannels, false); d_num_valid_channels = 0; - d_gnss_synchro_history = new Gnss_circular_deque(static_cast(max_delta * 1000.0 * 2.0), d_nchannels); + d_gnss_synchro_history = new Gnss_circular_deque(static_cast(max_delta * 1000.0), d_nchannels); // ############# ENABLE DATA FILE LOG ################# if (d_dump) From f92dd4dc839c7fec9b1d4da5781e505f10a1e170 Mon Sep 17 00:00:00 2001 From: Antonio Ramos Date: Thu, 12 Apr 2018 11:03:52 +0200 Subject: [PATCH 16/82] New correlation procedure --- .../gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc | 11 +++++++++-- .../gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.h | 4 ++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc index 09f4e2621..fd42488d0 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc @@ -107,6 +107,8 @@ gps_l1_ca_telemetry_decoder_cc::gps_l1_ca_telemetry_decoder_cc( d_TOW_at_current_symbol_ms = 0; d_symbol_history.resize(GPS_CA_PREAMBLE_LENGTH_SYMBOLS + 1); // Change fixed buffer size d_symbol_history.clear(); // Clear all the elements in the buffer + d_make_correlation = true; + d_symbol_counter_corr = 0; } @@ -170,7 +172,7 @@ int gps_l1_ca_telemetry_decoder_cc::general_work(int noutput_items __attribute__ unsigned int required_symbols = GPS_CA_PREAMBLE_LENGTH_SYMBOLS; d_flag_preamble = false; - if (d_symbol_history.size() > required_symbols) + if (d_symbol_history.size() > required_symbols and d_make_correlation) { //******* preamble correlation ******** for (unsigned int i = 0; i < GPS_CA_PREAMBLE_LENGTH_SYMBOLS; i++) @@ -186,7 +188,12 @@ int gps_l1_ca_telemetry_decoder_cc::general_work(int noutput_items __attribute__ corr_value += d_preambles_symbols[i] * d_symbol_history.at(i).correlation_length_ms; } } - if (corr_value >= GPS_CA_PREAMBLE_LENGTH_SYMBOLS) break; + if (corr_value >= GPS_CA_PREAMBLE_LENGTH_SYMBOLS) + { + d_symbol_counter_corr = 0; + d_make_correlation = false; + break; + } } } diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.h index 22a9526a2..8e3600e3a 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.h @@ -84,6 +84,10 @@ private: double d_symbol_accumulator; short int d_symbol_accumulator_counter; + // symbol counting + bool d_make_correlation; + unsigned int d_symbol_counter_corr; + //bits and frame unsigned short int d_frame_bit_index; unsigned int d_GPS_frame_4bytes; From ad220dd279943408f417cb23c109881634813563 Mon Sep 17 00:00:00 2001 From: Antonio Ramos Date: Thu, 12 Apr 2018 17:01:07 +0200 Subject: [PATCH 17/82] Minor changes --- .../gps_l1_ca_telemetry_decoder_cc.cc | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc index fd42488d0..0c79165c2 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc @@ -172,7 +172,7 @@ int gps_l1_ca_telemetry_decoder_cc::general_work(int noutput_items __attribute__ unsigned int required_symbols = GPS_CA_PREAMBLE_LENGTH_SYMBOLS; d_flag_preamble = false; - if (d_symbol_history.size() > required_symbols and d_make_correlation) + if ((d_symbol_history.size() > required_symbols) and (d_make_correlation or !d_flag_frame_sync)) { //******* preamble correlation ******** for (unsigned int i = 0; i < GPS_CA_PREAMBLE_LENGTH_SYMBOLS; i++) @@ -181,24 +181,22 @@ int gps_l1_ca_telemetry_decoder_cc::general_work(int noutput_items __attribute__ { if (d_symbol_history.at(i).Prompt_I < 0) // symbols clipping { - corr_value -= d_preambles_symbols[i] * d_symbol_history.at(i).correlation_length_ms; + corr_value -= d_preambles_symbols[i]; } else { - corr_value += d_preambles_symbols[i] * d_symbol_history.at(i).correlation_length_ms; + corr_value += d_preambles_symbols[i]; } } - if (corr_value >= GPS_CA_PREAMBLE_LENGTH_SYMBOLS) - { - d_symbol_counter_corr = 0; - d_make_correlation = false; - break; - } + } + if (std::abs(corr_value) >= GPS_CA_PREAMBLE_LENGTH_SYMBOLS) + { + d_symbol_counter_corr++; } } //******* frame sync ****************** - if (abs(corr_value) == GPS_CA_PREAMBLE_LENGTH_SYMBOLS) + if (std::abs(corr_value) == GPS_CA_PREAMBLE_LENGTH_SYMBOLS) { //TODO: Rewrite with state machine if (d_stat == 0) @@ -215,12 +213,14 @@ int gps_l1_ca_telemetry_decoder_cc::general_work(int noutput_items __attribute__ } else if (d_stat == 1) //check 6 seconds of preamble separation { - preamble_diff_ms = round(((static_cast(d_symbol_history.at(0).Tracking_sample_counter) - d_preamble_time_samples) / static_cast(d_symbol_history.at(0).fs)) * 1000.0); - if (abs(preamble_diff_ms - GPS_SUBFRAME_MS) < 1) + preamble_diff_ms = std::round(((static_cast(d_symbol_history.at(0).Tracking_sample_counter) - d_preamble_time_samples) / static_cast(d_symbol_history.at(0).fs)) * 1000.0); + if (std::abs(preamble_diff_ms - GPS_SUBFRAME_MS) < 1) { DLOG(INFO) << "Preamble confirmation for SAT " << this->d_satellite; d_GPS_FSM.Event_gps_word_preamble(); d_flag_preamble = true; + d_make_correlation = false; + d_symbol_counter_corr = 0; d_preamble_time_samples = d_symbol_history.at(0).Tracking_sample_counter; // record the PRN start sample index associated to the preamble if (!d_flag_frame_sync) { @@ -245,6 +245,11 @@ int gps_l1_ca_telemetry_decoder_cc::general_work(int noutput_items __attribute__ } else { + d_symbol_counter_corr++; + if (d_symbol_counter_corr > (GPS_SUBFRAME_MS - GPS_CA_TELEMETRY_SYMBOLS_PER_BIT)) + { + d_make_correlation = true; + } if (d_stat == 1) { preamble_diff_ms = round(((static_cast(d_symbol_history.at(0).Tracking_sample_counter) - static_cast(d_preamble_time_samples)) / static_cast(d_symbol_history.at(0).fs)) * 1000.0); @@ -254,6 +259,8 @@ int gps_l1_ca_telemetry_decoder_cc::general_work(int noutput_items __attribute__ d_stat = 0; //lost of frame sync d_flag_frame_sync = false; flag_TOW_set = false; + d_make_correlation = true; + d_symbol_counter_corr = 0; } } } From fcdf123e0ecb6a2d24328f05a8dac5bbe979e14f Mon Sep 17 00:00:00 2001 From: Antonio Ramos Date: Thu, 12 Apr 2018 17:14:57 +0200 Subject: [PATCH 18/82] Correct name --- src/algorithms/libs/gnss_circular_deque.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/algorithms/libs/gnss_circular_deque.h b/src/algorithms/libs/gnss_circular_deque.h index e1b73c87d..d9694e722 100644 --- a/src/algorithms/libs/gnss_circular_deque.h +++ b/src/algorithms/libs/gnss_circular_deque.h @@ -2,7 +2,7 @@ * \file gnss_circular_deque.h * \brief This class implements a circular deque for Gnss_Synchro * - * \author Luis Esteve, 2018. antonio.ramos(at)cttc.es + * \author Antonio Ramos, 2018. antonio.ramosdet(at)gmail.com * * Detailed description of the file here if needed. * From 52cc6ab04dacc6aa8fa5c706541d4abd0e9bcb13 Mon Sep 17 00:00:00 2001 From: Antonio Ramos Date: Thu, 12 Apr 2018 18:01:12 +0200 Subject: [PATCH 19/82] Remove telemetry -> tracking msg port --- src/algorithms/channel/adapters/channel.cc | 4 ---- .../gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.cc | 2 -- .../gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.cc | 2 -- .../gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.cc | 5 ----- .../gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.cc | 5 ----- .../gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc | 5 ----- .../gnuradio_blocks/gps_l2c_telemetry_decoder_cc.cc | 2 -- .../gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc | 2 -- .../gnuradio_blocks/sbas_l1_telemetry_decoder_cc.cc | 2 -- .../tracking/gnuradio_blocks/dll_pll_veml_tracking.cc | 1 - .../gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc | 2 -- .../gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc | 2 -- .../gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc | 2 -- .../gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc | 2 -- 14 files changed, 38 deletions(-) diff --git a/src/algorithms/channel/adapters/channel.cc b/src/algorithms/channel/adapters/channel.cc index 5a6284888..f7cec1949 100644 --- a/src/algorithms/channel/adapters/channel.cc +++ b/src/algorithms/channel/adapters/channel.cc @@ -108,8 +108,6 @@ Channel::Channel(ConfigurationInterface* configuration, unsigned int channel, // Destructor Channel::~Channel() {} - - void Channel::connect(gr::top_block_sptr top_block) { if (connected_) @@ -137,8 +135,6 @@ void Channel::connect(gr::top_block_sptr top_block) DLOG(INFO) << "tracking -> telemetry_decoder"; // Message ports - top_block->msg_connect(nav_->get_left_block(), pmt::mp("preamble_timestamp_s"), trk_->get_right_block(), pmt::mp("preamble_timestamp_s")); - DLOG(INFO) << "MSG FEEDBACK CHANNEL telemetry_decoder -> tracking"; top_block->msg_connect(acq_->get_right_block(), pmt::mp("events"), channel_msg_rx, pmt::mp("events")); top_block->msg_connect(trk_->get_right_block(), pmt::mp("events"), channel_msg_rx, pmt::mp("events")); diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.cc index a774577a5..286ca0c68 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.cc @@ -106,8 +106,6 @@ galileo_e1b_telemetry_decoder_cc::galileo_e1b_telemetry_decoder_cc( bool dump) : gr::block("galileo_e1b_telemetry_decoder_cc", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { - // Telemetry Bit transition synchronization port out - this->message_port_register_out(pmt::mp("preamble_timestamp_s")); // Ephemeris data port out this->message_port_register_out(pmt::mp("telemetry")); // initialize internal vars diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.cc index 640cbf009..8e032956e 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.cc @@ -183,8 +183,6 @@ galileo_e5a_telemetry_decoder_cc::galileo_e5a_telemetry_decoder_cc( gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { - // Telemetry Bit transition synchronization port out - this->message_port_register_out(pmt::mp("preamble_timestamp_s")); // Ephemeris data port out this->message_port_register_out(pmt::mp("telemetry")); // initialize internal vars diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.cc index 0bd2fae54..ca6dc8681 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.cc @@ -54,8 +54,6 @@ glonass_l1_ca_telemetry_decoder_cc::glonass_l1_ca_telemetry_decoder_cc( bool dump) : gr::block("glonass_l1_ca_telemetry_decoder_cc", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { - // Telemetry Bit transition synchronization port out - this->message_port_register_out(pmt::mp("preamble_timestamp_s")); // Ephemeris data port out this->message_port_register_out(pmt::mp("telemetry")); // initialize internal vars @@ -285,9 +283,6 @@ int glonass_l1_ca_telemetry_decoder_cc::general_work(int noutput_items __attribu LOG(INFO) << "Starting string decoder for GLONASS L1 C/A SAT " << this->d_satellite; d_preamble_index = d_sample_counter; //record the preamble sample stamp d_stat = 2; - // send asynchronous message to tracking to inform of frame sync and extend correlation time - pmt::pmt_t value = pmt::from_double(static_cast(d_preamble_time_samples) / static_cast(d_symbol_history.at(0).fs) - 0.001); - this->message_port_pub(pmt::mp("preamble_timestamp_s"), value); } else { diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.cc index 2b168a89c..e2a362974 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.cc @@ -53,8 +53,6 @@ glonass_l2_ca_telemetry_decoder_cc::glonass_l2_ca_telemetry_decoder_cc( bool dump) : gr::block("glonass_l2_ca_telemetry_decoder_cc", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { - // Telemetry Bit transition synchronization port out - this->message_port_register_out(pmt::mp("preamble_timestamp_s")); // Ephemeris data port out this->message_port_register_out(pmt::mp("telemetry")); // initialize internal vars @@ -284,9 +282,6 @@ int glonass_l2_ca_telemetry_decoder_cc::general_work(int noutput_items __attribu LOG(INFO) << "Starting string decoder for GLONASS L2 C/A SAT " << this->d_satellite; d_preamble_index = d_sample_counter; //record the preamble sample stamp d_stat = 2; - // send asynchronous message to tracking to inform of frame sync and extend correlation time - pmt::pmt_t value = pmt::from_double(static_cast(d_preamble_time_samples) / static_cast(d_symbol_history.at(0).fs) - 0.001); - this->message_port_pub(pmt::mp("preamble_timestamp_s"), value); } else { diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc index 0c79165c2..955d180d7 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc @@ -54,8 +54,6 @@ gps_l1_ca_telemetry_decoder_cc::gps_l1_ca_telemetry_decoder_cc( bool dump) : gr::block("gps_navigation_cc", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { - // Telemetry Bit transition synchronization port out - this->message_port_register_out(pmt::mp("preamble_timestamp_s")); // Ephemeris data port out this->message_port_register_out(pmt::mp("telemetry")); // initialize internal vars @@ -224,9 +222,6 @@ int gps_l1_ca_telemetry_decoder_cc::general_work(int noutput_items __attribute__ d_preamble_time_samples = d_symbol_history.at(0).Tracking_sample_counter; // record the PRN start sample index associated to the preamble if (!d_flag_frame_sync) { - // send asynchronous message to tracking to inform of frame sync and extend correlation time - pmt::pmt_t value = pmt::from_double(static_cast(d_preamble_time_samples) / static_cast(d_symbol_history.at(0).fs) - 0.001); - this->message_port_pub(pmt::mp("preamble_timestamp_s"), value); d_flag_frame_sync = true; if (corr_value < 0) { diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.cc index 0325041d3..dee30987e 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.cc @@ -55,8 +55,6 @@ gps_l2c_telemetry_decoder_cc::gps_l2c_telemetry_decoder_cc( gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { - // Telemetry Bit transition synchronization port out - this->message_port_register_out(pmt::mp("preamble_timestamp_s")); // Ephemeris data port out this->message_port_register_out(pmt::mp("telemetry")); // initialize internal vars diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc index af9666c03..1cfd20162 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc @@ -56,8 +56,6 @@ gps_l5_telemetry_decoder_cc::gps_l5_telemetry_decoder_cc( gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { - // Telemetry Bit transition synchronization port out - this->message_port_register_out(pmt::mp("preamble_timestamp_s")); // Ephemeris data port out this->message_port_register_out(pmt::mp("telemetry")); // initialize internal vars diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.cc index 672dbb101..194db3c11 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.cc @@ -59,8 +59,6 @@ sbas_l1_telemetry_decoder_cc::sbas_l1_telemetry_decoder_cc( gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { - // Telemetry Bit transition synchronization port out - this->message_port_register_out(pmt::mp("preamble_timestamp_s")); // Ephemeris data port out this->message_port_register_out(pmt::mp("telemetry")); // initialize internal vars diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index 4ae6f8195..cd7986d2a 100755 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -82,7 +82,6 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(dllpllconf_t conf_) : gr::block("dl { trk_parameters = conf_; // Telemetry bit synchronization message port input - this->message_port_register_in(pmt::mp("preamble_timestamp_s")); this->message_port_register_out(pmt::mp("events")); this->set_relative_rate(1.0 / static_cast(trk_parameters.vector_length)); diff --git a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc index a7c0062a2..563a5ea22 100644 --- a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc @@ -99,8 +99,6 @@ Galileo_E1_Tcp_Connector_Tracking_cc::Galileo_E1_Tcp_Connector_Tracking_cc( size_t port_ch0) : gr::block("Galileo_E1_Tcp_Connector_Tracking_cc", gr::io_signature::make(1, 1, sizeof(gr_complex)), gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { - // Telemetry bit synchronization message port input - this->message_port_register_in(pmt::mp("preamble_timestamp_s")); this->message_port_register_out(pmt::mp("events")); this->set_relative_rate(1.0 / vector_length); // initialize internal vars diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc index d35b6159c..15f58228c 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc @@ -94,8 +94,6 @@ Glonass_L1_Ca_Dll_Pll_Tracking_cc::Glonass_L1_Ca_Dll_Pll_Tracking_cc( float early_late_space_chips) : gr::block("Glonass_L1_Ca_Dll_Pll_Tracking_cc", gr::io_signature::make(1, 1, sizeof(gr_complex)), gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { - // Telemetry bit synchronization message port input - this->message_port_register_in(pmt::mp("preamble_timestamp_s")); this->message_port_register_out(pmt::mp("events")); // initialize internal vars diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc index f6428bc5c..f6b62fade 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc @@ -94,8 +94,6 @@ Glonass_L2_Ca_Dll_Pll_Tracking_cc::Glonass_L2_Ca_Dll_Pll_Tracking_cc( float early_late_space_chips) : gr::block("Glonass_L2_Ca_Dll_Pll_Tracking_cc", gr::io_signature::make(1, 1, sizeof(gr_complex)), gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { - // Telemetry bit synchronization message port input - this->message_port_register_in(pmt::mp("preamble_timestamp_s")); this->message_port_register_out(pmt::mp("events")); // initialize internal vars diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc index cd4c86652..62b93ecd1 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc @@ -91,8 +91,6 @@ Gps_L1_Ca_Tcp_Connector_Tracking_cc::Gps_L1_Ca_Tcp_Connector_Tracking_cc( size_t port_ch0) : gr::block("Gps_L1_Ca_Tcp_Connector_Tracking_cc", gr::io_signature::make(1, 1, sizeof(gr_complex)), gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { - // Telemetry bit synchronization message port input - this->message_port_register_in(pmt::mp("preamble_timestamp_s")); this->message_port_register_out(pmt::mp("events")); // initialize internal vars d_dump = dump; From 2138c1340bfef2c698f0982fa5fb0335fb1860a0 Mon Sep 17 00:00:00 2001 From: Javier Arribas Date: Thu, 12 Apr 2018 18:03:30 +0200 Subject: [PATCH 20/82] Removing debug code in trk FPGA accelerators --- .../gps_l1_ca_dll_pll_tracking_fpga_sc.cc | 17 ----------------- .../gps_l1_ca_dll_pll_tracking_fpga_sc.h | 11 ----------- 2 files changed, 28 deletions(-) diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.cc index f346ff8bc..b8a52b8c5 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.cc @@ -281,14 +281,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc::general_work (int noutput_items __attrib gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { - // debug - int secondary_sample_counter; - int counter_corr_0_in; - int counter_corr_0_out; - int sample_counter; - unsigned absolute_samples_offset; -// int kk2; // process vars double carr_error_hz = 0.0; double carr_error_filt_hz = 0.0; @@ -333,16 +326,6 @@ int Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc::general_work (int noutput_items __attrib d_rem_carr_phase_rad, d_carrier_phase_step_rad, d_rem_code_phase_chips, d_code_phase_step_chips, d_current_prn_length_samples); - d_previous_sample_counter = d_debug_sample_counter; - d_previous_counter_corr_0_in = d_counter_corr_0_in; - d_previous_counter_corr_0_out = d_counter_corr_0_out; - multicorrelator_fpga_8sc->read_sample_counters(&sample_counter, &secondary_sample_counter, &counter_corr_0_in, &counter_corr_0_out); - d_debug_sample_counter = sample_counter; - d_counter_corr_0_in = counter_corr_0_in; - d_counter_corr_0_out = counter_corr_0_out; - d_counter_corr_0_in_inc = counter_corr_0_in - d_previous_counter_corr_0_in; - d_counter_corr_0_out_inc = counter_corr_0_out - d_previous_counter_corr_0_out; - d_sample_counter_inc = d_debug_sample_counter - d_previous_sample_counter; // ################## PLL ########################################################## // PLL discriminator diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.h index f7d2141c9..161d87530 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.h +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.h @@ -182,17 +182,6 @@ private: double d_K_blk_samples_previous; int d_offset_sample_previous; - int d_kk = 0; - int d_numsamples_debug = 990; - int d_previous_sample_counter = 0; - int d_debug_sample_counter = 0; - int d_previous_counter_corr_0_in = 0; - int d_previous_counter_corr_0_out = 0; - int d_counter_corr_0_in_inc = 0; - int d_counter_corr_0_out_inc = 0; - int d_counter_corr_0_in = 0; - int d_counter_corr_0_out = 0; - int d_sample_counter_inc = 0; }; #endif //GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_FPGA_SC_H From 51d19fd298d11db4542ba975fd68423e149ef2a5 Mon Sep 17 00:00:00 2001 From: Antonio Ramos Date: Thu, 12 Apr 2018 18:36:52 +0200 Subject: [PATCH 21/82] Change hybrid observables forecast --- .../gnuradio_blocks/hybrid_observables_cc.cc | 238 +++++++++--------- 1 file changed, 123 insertions(+), 115 deletions(-) diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc index 274dc0732..593e01b6b 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc @@ -372,14 +372,13 @@ void hybrid_observables_cc::find_interp_elements(const unsigned int &ch, const d } -void hybrid_observables_cc::forecast(int noutput_items __attribute__((unused)), - gr_vector_int &ninput_items_required) +void hybrid_observables_cc::forecast(int noutput_items, gr_vector_int &ninput_items_required) { for (unsigned int i = 0; i < d_nchannels; i++) { ninput_items_required[i] = 0; } - ninput_items_required[d_nchannels] = 1; + ninput_items_required[d_nchannels] = noutput_items; } @@ -459,152 +458,161 @@ int hybrid_observables_cc::general_work(int noutput_items __attribute__((unused) Gnss_Synchro **out = reinterpret_cast(&output_items[0]); unsigned int i; + unsigned int returned_elements = 0; int total_input_items = 0; for (i = 0; i < d_nchannels; i++) { total_input_items += ninput_items[i]; } - consume(d_nchannels, 1); - T_rx_s += T_rx_step_s; - - ////////////////////////////////////////////////////////////////////////// - if ((total_input_items == 0) and (d_num_valid_channels == 0)) + for (int epoch = 0; epoch < ninput_items[d_nchannels]; epoch++) { - return 0; - } - ////////////////////////////////////////////////////////////////////////// + T_rx_s += T_rx_step_s; - if (total_input_items > 0) - { - for (i = 0; i < d_nchannels; i++) + ////////////////////////////////////////////////////////////////////////// + if ((total_input_items == 0) and (d_num_valid_channels == 0)) { - if (ninput_items[i] > 0) + consume(d_nchannels, epoch + 1); + return returned_elements; + } + ////////////////////////////////////////////////////////////////////////// + + if (total_input_items > 0 and epoch == 0) + { + for (i = 0; i < d_nchannels; i++) { - // Add the new Gnss_Synchros to their corresponding deque - for (int aux = 0; aux < ninput_items[i]; aux++) + if (ninput_items[i] > 0) { - if (in[i][aux].Flag_valid_word) + // Add the new Gnss_Synchros to their corresponding deque + for (int aux = 0; aux < ninput_items[i]; aux++) { - d_gnss_synchro_history->push_back(i, in[i][aux]); - d_gnss_synchro_history->back(i).RX_time = compute_T_rx_s(in[i][aux]); - // Check if the last Gnss_Synchro comes from the same satellite as the previous ones - if (d_gnss_synchro_history->size(i) > 1) + if (in[i][aux].Flag_valid_word) { - if (d_gnss_synchro_history->front(i).PRN != d_gnss_synchro_history->back(i).PRN) + d_gnss_synchro_history->push_back(i, in[i][aux]); + d_gnss_synchro_history->back(i).RX_time = compute_T_rx_s(in[i][aux]); + // Check if the last Gnss_Synchro comes from the same satellite as the previous ones + if (d_gnss_synchro_history->size(i) > 1) { - d_gnss_synchro_history->clear(i); + if (d_gnss_synchro_history->front(i).PRN != d_gnss_synchro_history->back(i).PRN) + { + d_gnss_synchro_history->clear(i); + } } } } + consume(i, ninput_items[i]); } - consume(i, ninput_items[i]); } } - } - for (i = 0; i < d_nchannels; i++) - { - if (d_gnss_synchro_history->size(i) > 2) + for (i = 0; i < d_nchannels; i++) { - valid_channels[i] = true; - } - else - { - valid_channels[i] = false; - } - } - d_num_valid_channels = valid_channels.count(); - // Check if there is any valid channel after reading the new incoming Gnss_Synchro data - if (d_num_valid_channels == 0) - { - return 0; - } - - for (i = 0; i < d_nchannels; i++) //Discard observables with T_rx higher than the threshold - { - if (valid_channels[i]) - { - clean_history(i); - if (d_gnss_synchro_history->size(i) < 2) + if (d_gnss_synchro_history->size(i) > 2) { - valid_channels[i] = false; - } - } - } - - // Check if there is any valid channel after computing the time distance between the Gnss_Synchro data and the receiver time - d_num_valid_channels = valid_channels.count(); - double T_rx_s_out = T_rx_s - d_latency; - if ((d_num_valid_channels == 0) or (T_rx_s_out < 0.0)) - { - return 0; - } - - std::vector epoch_data; - for (i = 0; i < d_nchannels; i++) - { - if (valid_channels[i]) - { - Gnss_Synchro interpolated_gnss_synchro = d_gnss_synchro_history->back(i); - if (interpolate_data(interpolated_gnss_synchro, i, T_rx_s_out)) - { - epoch_data.push_back(interpolated_gnss_synchro); + valid_channels[i] = true; } else { valid_channels[i] = false; } } - } - d_num_valid_channels = valid_channels.count(); - if (d_num_valid_channels == 0) - { - return 0; - } - correct_TOW_and_compute_prange(epoch_data); - std::vector::iterator it = epoch_data.begin(); - for (i = 0; i < d_nchannels; i++) - { - if (valid_channels[i]) + d_num_valid_channels = valid_channels.count(); + // Check if there is any valid channel after reading the new incoming Gnss_Synchro data + if (d_num_valid_channels == 0) { - out[i][0] = (*it); - out[i][0].Flag_valid_pseudorange = true; - it++; + consume(d_nchannels, epoch + 1); + return returned_elements; } - else + + for (i = 0; i < d_nchannels; i++) //Discard observables with T_rx higher than the threshold { - out[i][0] = Gnss_Synchro(); - out[i][0].Flag_valid_pseudorange = false; - } - } - if (d_dump) - { - // MULTIPLEXED FILE RECORDING - Record results to file - try - { - double tmp_double; - for (i = 0; i < d_nchannels; i++) + if (valid_channels[i]) { - tmp_double = out[i][0].RX_time; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); - tmp_double = out[i][0].TOW_at_current_symbol_s; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); - tmp_double = out[i][0].Carrier_Doppler_hz; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); - tmp_double = out[i][0].Carrier_phase_rads / GPS_TWO_PI; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); - tmp_double = out[i][0].Pseudorange_m; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); - tmp_double = static_cast(out[i][0].PRN); - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); - tmp_double = static_cast(out[i][0].Flag_valid_pseudorange); - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + clean_history(i); + if (d_gnss_synchro_history->size(i) < 2) + { + valid_channels[i] = false; + } } } - catch (const std::ifstream::failure &e) + + // Check if there is any valid channel after computing the time distance between the Gnss_Synchro data and the receiver time + d_num_valid_channels = valid_channels.count(); + double T_rx_s_out = T_rx_s - d_latency; + if ((d_num_valid_channels == 0) or (T_rx_s_out < 0.0)) { - LOG(WARNING) << "Exception writing observables dump file " << e.what(); - d_dump = false; + consume(d_nchannels, epoch + 1); + return returned_elements; } + + std::vector epoch_data; + for (i = 0; i < d_nchannels; i++) + { + if (valid_channels[i]) + { + Gnss_Synchro interpolated_gnss_synchro = d_gnss_synchro_history->back(i); + if (interpolate_data(interpolated_gnss_synchro, i, T_rx_s_out)) + { + epoch_data.push_back(interpolated_gnss_synchro); + } + else + { + valid_channels[i] = false; + } + } + } + d_num_valid_channels = valid_channels.count(); + if (d_num_valid_channels == 0) + { + consume(d_nchannels, epoch + 1); + return returned_elements; + } + correct_TOW_and_compute_prange(epoch_data); + std::vector::iterator it = epoch_data.begin(); + for (i = 0; i < d_nchannels; i++) + { + if (valid_channels[i]) + { + out[i][0] = (*it); + out[i][0].Flag_valid_pseudorange = true; + it++; + } + else + { + out[i][0] = Gnss_Synchro(); + out[i][0].Flag_valid_pseudorange = false; + } + } + if (d_dump) + { + // MULTIPLEXED FILE RECORDING - Record results to file + try + { + double tmp_double; + for (i = 0; i < d_nchannels; i++) + { + tmp_double = out[i][0].RX_time; + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + tmp_double = out[i][0].TOW_at_current_symbol_s; + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + tmp_double = out[i][0].Carrier_Doppler_hz; + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + tmp_double = out[i][0].Carrier_phase_rads / GPS_TWO_PI; + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + tmp_double = out[i][0].Pseudorange_m; + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + tmp_double = static_cast(out[i][0].PRN); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + tmp_double = static_cast(out[i][0].Flag_valid_pseudorange); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + } + } + catch (const std::ifstream::failure &e) + { + LOG(WARNING) << "Exception writing observables dump file " << e.what(); + d_dump = false; + } + } + returned_elements++; } - return 1; + consume(d_nchannels, ninput_items[d_nchannels]); + return returned_elements; } From 2681ffab8175727a32f2f27a83dfb346f480ebe6 Mon Sep 17 00:00:00 2001 From: Javier Arribas Date: Thu, 12 Apr 2018 18:46:55 +0200 Subject: [PATCH 22/82] Removing unused msg port --- .../gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.cc index b8a52b8c5..7f8a4233b 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.cc @@ -93,7 +93,6 @@ Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc::Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc( gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { // Telemetry bit synchronization message port input - this->message_port_register_in(pmt::mp("preamble_timestamp_s")); this->message_port_register_out(pmt::mp("events")); // initialize internal vars From 525d8877319f5bfba84da757ff861a59aae8850c Mon Sep 17 00:00:00 2001 From: Antonio Ramos Date: Thu, 12 Apr 2018 18:51:43 +0200 Subject: [PATCH 23/82] Fix bug --- .../gnuradio_blocks/hybrid_observables_cc.cc | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc index 593e01b6b..0fdd85c31 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc @@ -571,14 +571,14 @@ int hybrid_observables_cc::general_work(int noutput_items __attribute__((unused) { if (valid_channels[i]) { - out[i][0] = (*it); - out[i][0].Flag_valid_pseudorange = true; + out[i][epoch] = (*it); + out[i][epoch].Flag_valid_pseudorange = true; it++; } else { - out[i][0] = Gnss_Synchro(); - out[i][0].Flag_valid_pseudorange = false; + out[i][epoch] = Gnss_Synchro(); + out[i][epoch].Flag_valid_pseudorange = false; } } if (d_dump) @@ -589,19 +589,19 @@ int hybrid_observables_cc::general_work(int noutput_items __attribute__((unused) double tmp_double; for (i = 0; i < d_nchannels; i++) { - tmp_double = out[i][0].RX_time; + tmp_double = out[i][epoch].RX_time; d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); - tmp_double = out[i][0].TOW_at_current_symbol_s; + tmp_double = out[i][epoch].TOW_at_current_symbol_s; d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); - tmp_double = out[i][0].Carrier_Doppler_hz; + tmp_double = out[i][epoch].Carrier_Doppler_hz; d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); - tmp_double = out[i][0].Carrier_phase_rads / GPS_TWO_PI; + tmp_double = out[i][epoch].Carrier_phase_rads / GPS_TWO_PI; d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); - tmp_double = out[i][0].Pseudorange_m; + tmp_double = out[i][epoch].Pseudorange_m; d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); - tmp_double = static_cast(out[i][0].PRN); + tmp_double = static_cast(out[i][epoch].PRN); d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); - tmp_double = static_cast(out[i][0].Flag_valid_pseudorange); + tmp_double = static_cast(out[i][epoch].Flag_valid_pseudorange); d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); } } From 6dfacb1676a1dd66e060a55b6285782907dfbd5d Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 12 Apr 2018 20:44:15 +0200 Subject: [PATCH 24/82] Fix building for clang-900.0.39.2 (OSX 10.12), tnx to michaelld --- .../volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt index d4ea0c46f..f9634c801 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt @@ -62,6 +62,7 @@ endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") # Enable C++17 support in GCC >= 8.0.0 # Enable C++14 support in 8.0.0 > GCC >= 6.1.1 # Fallback to C++11 when using GCC < 6.1.1 + if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1") set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11") @@ -75,8 +76,8 @@ if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -Wall -Wextra") #Add warning flags: For "-Wall" see http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) -# Enable C++17 support in Clang >= 6.0.0 or AppleClang >= 900 -# Enable C++14 support in 6.0.0 > Clang >= 3.5.0 or 900 > AppleClang >= 600 +# Enable C++17 support in Clang >= 6.0.0 +# Enable C++14 support in 6.0.0 > Clang >= 3.5.0 or AppleClang >= 600 # Fallback to C++11 if older version if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") if(CMAKE_SYSTEM_NAME MATCHES "Darwin") @@ -84,11 +85,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") if(CLANG_VERSION VERSION_LESS "600") set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11") else(CLANG_VERSION VERSION_LESS "600") - if(CLANG_VERSION VERSION_LESS "900") - set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14") - else(CLANG_VERSION VERSION_LESS "900") - set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++17") - endif(CLANG_VERSION VERSION_LESS "900") + set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14") endif(CLANG_VERSION VERSION_LESS "600") else(CMAKE_SYSTEM_NAME MATCHES "Darwin") if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0") From 1094e870bc7c6dadb136a115c5a8c89311e6f5ae Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 12 Apr 2018 20:45:13 +0200 Subject: [PATCH 25/82] Accessing maps is not so cheap, so doing in the constructor --- .../gnuradio_blocks/dll_pll_veml_tracking.cc | 20 ++++++++++--------- .../gnuradio_blocks/dll_pll_veml_tracking.h | 3 ++- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index d10af3177..087e48199 100755 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -362,13 +362,15 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(dllpllconf_t conf_) : gr::block("dl d_last_prompt = gr_complex(0.0, 0.0); d_state = 0; // initial state: standby - signal_pretty_name["1C"] = "L1 C/A"; - signal_pretty_name["1B"] = "E1"; - signal_pretty_name["1G"] = "L1 C/A"; - signal_pretty_name["2S"] = "L2C"; - signal_pretty_name["2G"] = "L2 C/A"; - signal_pretty_name["5X"] = "E5a"; - signal_pretty_name["L5"] = "L5"; + map_signal_pretty_name["1C"] = "L1 C/A"; + map_signal_pretty_name["1B"] = "E1"; + map_signal_pretty_name["1G"] = "L1 C/A"; + map_signal_pretty_name["2S"] = "L2C"; + map_signal_pretty_name["2G"] = "L2 C/A"; + map_signal_pretty_name["5X"] = "E5a"; + map_signal_pretty_name["L5"] = "L5"; + + signal_pretty_name = map_signal_pretty_name[signal_type]; } @@ -511,7 +513,7 @@ void dll_pll_veml_tracking::start_tracking() d_code_loop_filter.set_pdi(static_cast(d_code_period)); // DEBUG OUTPUT - std::cout << "Tracking of " << systemName << " " << signal_pretty_name[signal_type] << " signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << std::endl; + std::cout << "Tracking of " << systemName << " " << signal_pretty_name << " signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << std::endl; LOG(INFO) << "Starting tracking of satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; // enable tracking pull-in @@ -1263,7 +1265,7 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused) next_state = acquire_secondary(); if (next_state) { - std::cout << systemName << " " << signal_pretty_name[signal_type] << " secondary code locked in channel " << d_channel + std::cout << systemName << " " << signal_pretty_name << " secondary code locked in channel " << d_channel << " for satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << std::endl; } diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h index 89f71a99a..0b8392d2d 100755 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h @@ -119,7 +119,8 @@ private: std::string systemName; std::string signal_type; std::string *d_secondary_code_string; - std::map signal_pretty_name; + std::map map_signal_pretty_name; + std::string signal_pretty_name; //tracking state machine int d_state; From 31e634635ce96a0ba863e91943069d8a79f01823 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 13 Apr 2018 11:07:58 +0200 Subject: [PATCH 26/82] Move general_work to the bottom of the file --- .../gnuradio_blocks/pcps_acquisition.cc | 156 ++++++++-------- .../galileo_e1b_telemetry_decoder_cc.cc | 70 ++++---- .../galileo_e5a_telemetry_decoder_cc.cc | 70 ++++---- .../glonass_l1_ca_telemetry_decoder_cc.cc | 70 ++++---- .../glonass_l2_ca_telemetry_decoder_cc.cc | 70 ++++---- .../gps_l1_ca_telemetry_decoder_cc.cc | 76 ++++---- .../gps_l2c_telemetry_decoder_cc.cc | 70 ++++---- .../gps_l5_telemetry_decoder_cc.cc | 74 ++++---- .../sbas_l1_telemetry_decoder_cc.cc | 168 +++++++++--------- 9 files changed, 411 insertions(+), 413 deletions(-) diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc index 0eb0cd3dd..62e55dd31 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc @@ -335,84 +335,6 @@ void pcps_acquisition::send_negative_acquisition() } -int pcps_acquisition::general_work(int noutput_items __attribute__((unused)), - gr_vector_int& ninput_items, gr_vector_const_void_star& input_items, - gr_vector_void_star& output_items __attribute__((unused))) -{ - /* - * By J.Arribas, L.Esteve and M.Molina - * Acquisition strategy (Kay Borre book + CFAR threshold): - * 1. Compute the input signal power estimation - * 2. Doppler serial search loop - * 3. Perform the FFT-based circular convolution (parallel time search) - * 4. Record the maximum peak and the associated synchronization parameters - * 5. Compute the test statistics and compare to the threshold - * 6. Declare positive or negative acquisition using a message port - */ - - gr::thread::scoped_lock lk(d_setlock); - if (!d_active or d_worker_active) - { - d_sample_counter += d_fft_size * ninput_items[0]; - consume_each(ninput_items[0]); - if (d_step_two) - { - d_doppler_center_step_two = static_cast(d_gnss_synchro->Acq_doppler_hz); - update_grid_doppler_wipeoffs_step2(); - d_state = 0; - d_active = true; - } - return 0; - } - - switch (d_state) - { - case 0: - { - //restart acquisition variables - d_gnss_synchro->Acq_delay_samples = 0.0; - d_gnss_synchro->Acq_doppler_hz = 0.0; - d_gnss_synchro->Acq_samplestamp_samples = 0; - d_well_count = 0; - d_mag = 0.0; - d_input_power = 0.0; - d_test_statistics = 0.0; - d_state = 1; - d_sample_counter += d_fft_size * ninput_items[0]; // sample counter - consume_each(ninput_items[0]); - break; - } - - case 1: - { - // Copy the data to the core and let it know that new data is available - if (d_cshort) - { - memcpy(d_data_buffer_sc, input_items[0], d_fft_size * sizeof(lv_16sc_t)); - } - else - { - memcpy(d_data_buffer, input_items[0], d_fft_size * sizeof(gr_complex)); - } - if (acq_parameters.blocking) - { - lk.unlock(); - acquisition_core(d_sample_counter); - } - else - { - gr::thread::thread d_worker(&pcps_acquisition::acquisition_core, this, d_sample_counter); - d_worker_active = true; - } - d_sample_counter += d_fft_size; - consume_each(1); - break; - } - } - return 0; -} - - void pcps_acquisition::acquisition_core(unsigned long int samp_count) { gr::thread::scoped_lock lk(d_setlock); @@ -686,3 +608,81 @@ void pcps_acquisition::acquisition_core(unsigned long int samp_count) } d_worker_active = false; } + + +int pcps_acquisition::general_work(int noutput_items __attribute__((unused)), + gr_vector_int& ninput_items, gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items __attribute__((unused))) +{ + /* + * By J.Arribas, L.Esteve and M.Molina + * Acquisition strategy (Kay Borre book + CFAR threshold): + * 1. Compute the input signal power estimation + * 2. Doppler serial search loop + * 3. Perform the FFT-based circular convolution (parallel time search) + * 4. Record the maximum peak and the associated synchronization parameters + * 5. Compute the test statistics and compare to the threshold + * 6. Declare positive or negative acquisition using a message port + */ + + gr::thread::scoped_lock lk(d_setlock); + if (!d_active or d_worker_active) + { + d_sample_counter += d_fft_size * ninput_items[0]; + consume_each(ninput_items[0]); + if (d_step_two) + { + d_doppler_center_step_two = static_cast(d_gnss_synchro->Acq_doppler_hz); + update_grid_doppler_wipeoffs_step2(); + d_state = 0; + d_active = true; + } + return 0; + } + + switch (d_state) + { + case 0: + { + //restart acquisition variables + d_gnss_synchro->Acq_delay_samples = 0.0; + d_gnss_synchro->Acq_doppler_hz = 0.0; + d_gnss_synchro->Acq_samplestamp_samples = 0; + d_well_count = 0; + d_mag = 0.0; + d_input_power = 0.0; + d_test_statistics = 0.0; + d_state = 1; + d_sample_counter += d_fft_size * ninput_items[0]; // sample counter + consume_each(ninput_items[0]); + break; + } + + case 1: + { + // Copy the data to the core and let it know that new data is available + if (d_cshort) + { + memcpy(d_data_buffer_sc, input_items[0], d_fft_size * sizeof(lv_16sc_t)); + } + else + { + memcpy(d_data_buffer, input_items[0], d_fft_size * sizeof(gr_complex)); + } + if (acq_parameters.blocking) + { + lk.unlock(); + acquisition_core(d_sample_counter); + } + else + { + gr::thread::thread d_worker(&pcps_acquisition::acquisition_core, this, d_sample_counter); + d_worker_active = true; + } + d_sample_counter += d_fft_size; + consume_each(1); + break; + } + } + return 0; +} diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.cc index 286ca0c68..6f2242454 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.cc @@ -272,6 +272,41 @@ void galileo_e1b_telemetry_decoder_cc::decode_word(double *page_part_symbols, in } +void galileo_e1b_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) +{ + d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); + DLOG(INFO) << "Setting decoder Finite State Machine to satellite " << d_satellite; + DLOG(INFO) << "Navigation Satellite set to " << d_satellite; +} + + +void galileo_e1b_telemetry_decoder_cc::set_channel(int channel) +{ + d_channel = channel; + LOG(INFO) << "Navigation channel set to " << channel; + // ############# ENABLE DATA FILE LOG ################# + if (d_dump == true) + { + if (d_dump_file.is_open() == false) + { + try + { + d_dump_filename = "telemetry"; + d_dump_filename.append(boost::lexical_cast(d_channel)); + d_dump_filename.append(".dat"); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); + LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); + } + catch (const std::ifstream::failure &e) + { + LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); + } + } + } +} + + int galileo_e1b_telemetry_decoder_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { @@ -467,38 +502,3 @@ int galileo_e1b_telemetry_decoder_cc::general_work(int noutput_items __attribute //std::cout<<"GPS L1 TLM output on CH="<d_channel << " SAMPLE STAMP="<(d_channel)); - d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); - d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); - LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); - } - catch (const std::ifstream::failure &e) - { - LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); - } - } - } -} diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.cc index 8e032956e..c828fb859 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.cc @@ -245,6 +245,41 @@ galileo_e5a_telemetry_decoder_cc::~galileo_e5a_telemetry_decoder_cc() } +void galileo_e5a_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) +{ + d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); + DLOG(INFO) << "Setting decoder Finite State Machine to satellite " << d_satellite; + DLOG(INFO) << "Navigation Satellite set to " << d_satellite; +} + + +void galileo_e5a_telemetry_decoder_cc::set_channel(int channel) +{ + d_channel = channel; + LOG(INFO) << "Navigation channel set to " << channel; + // ############# ENABLE DATA FILE LOG ################# + if (d_dump == true) + { + if (d_dump_file.is_open() == false) + { + try + { + d_dump_filename = "telemetry"; + d_dump_filename.append(boost::lexical_cast(d_channel)); + d_dump_filename.append(".dat"); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); + LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); + } + catch (const std::ifstream::failure &e) + { + LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); + } + } + } +} + + int galileo_e5a_telemetry_decoder_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { @@ -491,38 +526,3 @@ int galileo_e5a_telemetry_decoder_cc::general_work(int noutput_items __attribute return 0; } } - - -void galileo_e5a_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) -{ - d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); - DLOG(INFO) << "Setting decoder Finite State Machine to satellite " << d_satellite; - DLOG(INFO) << "Navigation Satellite set to " << d_satellite; -} - - -void galileo_e5a_telemetry_decoder_cc::set_channel(int channel) -{ - d_channel = channel; - LOG(INFO) << "Navigation channel set to " << channel; - // ############# ENABLE DATA FILE LOG ################# - if (d_dump == true) - { - if (d_dump_file.is_open() == false) - { - try - { - d_dump_filename = "telemetry"; - d_dump_filename.append(boost::lexical_cast(d_channel)); - d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); - d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); - LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); - } - catch (const std::ifstream::failure &e) - { - LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); - } - } - } -} diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.cc index ca6dc8681..09429a7e1 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.cc @@ -221,6 +221,41 @@ void glonass_l1_ca_telemetry_decoder_cc::decode_string(double *frame_symbols, in } +void glonass_l1_ca_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) +{ + d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); + DLOG(INFO) << "Setting decoder Finite State Machine to satellite " << d_satellite; + DLOG(INFO) << "Navigation Satellite set to " << d_satellite; +} + + +void glonass_l1_ca_telemetry_decoder_cc::set_channel(int channel) +{ + d_channel = channel; + LOG(INFO) << "Navigation channel set to " << channel; + // ############# ENABLE DATA FILE LOG ################# + if (d_dump == true) + { + if (d_dump_file.is_open() == false) + { + try + { + d_dump_filename = "telemetry"; + d_dump_filename.append(boost::lexical_cast(d_channel)); + d_dump_filename.append(".dat"); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); + LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); + } + catch (const std::ifstream::failure &e) + { + LOG(WARNING) << "channel " << d_channel << ": exception opening Glonass TLM dump file. " << e.what(); + } + } + } +} + + int glonass_l1_ca_telemetry_decoder_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { @@ -408,38 +443,3 @@ int glonass_l1_ca_telemetry_decoder_cc::general_work(int noutput_items __attribu return 1; } - - -void glonass_l1_ca_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) -{ - d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); - DLOG(INFO) << "Setting decoder Finite State Machine to satellite " << d_satellite; - DLOG(INFO) << "Navigation Satellite set to " << d_satellite; -} - - -void glonass_l1_ca_telemetry_decoder_cc::set_channel(int channel) -{ - d_channel = channel; - LOG(INFO) << "Navigation channel set to " << channel; - // ############# ENABLE DATA FILE LOG ################# - if (d_dump == true) - { - if (d_dump_file.is_open() == false) - { - try - { - d_dump_filename = "telemetry"; - d_dump_filename.append(boost::lexical_cast(d_channel)); - d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); - d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); - LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); - } - catch (const std::ifstream::failure &e) - { - LOG(WARNING) << "channel " << d_channel << ": exception opening Glonass TLM dump file. " << e.what(); - } - } - } -} diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.cc index e2a362974..b446b6e7e 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.cc @@ -220,6 +220,41 @@ void glonass_l2_ca_telemetry_decoder_cc::decode_string(double *frame_symbols, in } +void glonass_l2_ca_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) +{ + d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); + DLOG(INFO) << "Setting decoder Finite State Machine to satellite " << d_satellite; + DLOG(INFO) << "Navigation Satellite set to " << d_satellite; +} + + +void glonass_l2_ca_telemetry_decoder_cc::set_channel(int channel) +{ + d_channel = channel; + LOG(INFO) << "Navigation channel set to " << channel; + // ############# ENABLE DATA FILE LOG ################# + if (d_dump == true) + { + if (d_dump_file.is_open() == false) + { + try + { + d_dump_filename = "telemetry"; + d_dump_filename.append(boost::lexical_cast(d_channel)); + d_dump_filename.append(".dat"); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); + LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); + } + catch (const std::ifstream::failure &e) + { + LOG(WARNING) << "channel " << d_channel << ": exception opening Glonass TLM dump file. " << e.what(); + } + } + } +} + + int glonass_l2_ca_telemetry_decoder_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { @@ -407,38 +442,3 @@ int glonass_l2_ca_telemetry_decoder_cc::general_work(int noutput_items __attribu return 1; } - - -void glonass_l2_ca_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) -{ - d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); - DLOG(INFO) << "Setting decoder Finite State Machine to satellite " << d_satellite; - DLOG(INFO) << "Navigation Satellite set to " << d_satellite; -} - - -void glonass_l2_ca_telemetry_decoder_cc::set_channel(int channel) -{ - d_channel = channel; - LOG(INFO) << "Navigation channel set to " << channel; - // ############# ENABLE DATA FILE LOG ################# - if (d_dump == true) - { - if (d_dump_file.is_open() == false) - { - try - { - d_dump_filename = "telemetry"; - d_dump_filename.append(boost::lexical_cast(d_channel)); - d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); - d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); - LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); - } - catch (const std::ifstream::failure &e) - { - LOG(WARNING) << "channel " << d_channel << ": exception opening Glonass TLM dump file. " << e.what(); - } - } - } -} diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc index 955d180d7..1070dca28 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc @@ -152,6 +152,44 @@ bool gps_l1_ca_telemetry_decoder_cc::gps_word_parityCheck(unsigned int gpsword) } +void gps_l1_ca_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) +{ + d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); + DLOG(INFO) << "Setting decoder Finite State Machine to satellite " << d_satellite; + d_GPS_FSM.i_satellite_PRN = d_satellite.get_PRN(); + DLOG(INFO) << "Navigation Satellite set to " << d_satellite; +} + + +void gps_l1_ca_telemetry_decoder_cc::set_channel(int channel) +{ + d_channel = channel; + d_GPS_FSM.i_channel_ID = channel; + DLOG(INFO) << "Navigation channel set to " << channel; + // ############# ENABLE DATA FILE LOG ################# + if (d_dump == true) + { + if (d_dump_file.is_open() == false) + { + try + { + d_dump_filename = "telemetry"; + d_dump_filename.append(boost::lexical_cast(d_channel)); + d_dump_filename.append(".dat"); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); + LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel + << " Log file: " << d_dump_filename.c_str(); + } + catch (const std::ifstream::failure &e) + { + LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); + } + } + } +} + + int gps_l1_ca_telemetry_decoder_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { @@ -411,41 +449,3 @@ int gps_l1_ca_telemetry_decoder_cc::general_work(int noutput_items __attribute__ return 1; } - - -void gps_l1_ca_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) -{ - d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); - DLOG(INFO) << "Setting decoder Finite State Machine to satellite " << d_satellite; - d_GPS_FSM.i_satellite_PRN = d_satellite.get_PRN(); - DLOG(INFO) << "Navigation Satellite set to " << d_satellite; -} - - -void gps_l1_ca_telemetry_decoder_cc::set_channel(int channel) -{ - d_channel = channel; - d_GPS_FSM.i_channel_ID = channel; - DLOG(INFO) << "Navigation channel set to " << channel; - // ############# ENABLE DATA FILE LOG ################# - if (d_dump == true) - { - if (d_dump_file.is_open() == false) - { - try - { - d_dump_filename = "telemetry"; - d_dump_filename.append(boost::lexical_cast(d_channel)); - d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); - d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); - LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel - << " Log file: " << d_dump_filename.c_str(); - } - catch (const std::ifstream::failure &e) - { - LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); - } - } - } -} diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.cc index dee30987e..f06d19b6f 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.cc @@ -90,6 +90,41 @@ gps_l2c_telemetry_decoder_cc::~gps_l2c_telemetry_decoder_cc() } +void gps_l2c_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) +{ + d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); + DLOG(INFO) << "GPS L2C CNAV telemetry decoder in channel " << this->d_channel << " set to satellite " << d_satellite; +} + + +void gps_l2c_telemetry_decoder_cc::set_channel(int channel) +{ + d_channel = channel; + LOG(INFO) << "GPS L2C CNAV channel set to " << channel; + // ############# ENABLE DATA FILE LOG ################# + if (d_dump == true) + { + if (d_dump_file.is_open() == false) + { + try + { + d_dump_filename = "telemetry_L2CM_"; + d_dump_filename.append(boost::lexical_cast(d_channel)); + d_dump_filename.append(".dat"); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); + LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel + << " Log file: " << d_dump_filename.c_str(); + } + catch (const std::ifstream::failure &e) + { + LOG(WARNING) << "channel " << d_channel << " Exception opening Telemetry GPS L2 dump file " << e.what(); + } + } + } +} + + int gps_l2c_telemetry_decoder_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { @@ -193,38 +228,3 @@ int gps_l2c_telemetry_decoder_cc::general_work(int noutput_items __attribute__(( out[0] = current_synchro_data; return 1; } - - -void gps_l2c_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) -{ - d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); - DLOG(INFO) << "GPS L2C CNAV telemetry decoder in channel " << this->d_channel << " set to satellite " << d_satellite; -} - - -void gps_l2c_telemetry_decoder_cc::set_channel(int channel) -{ - d_channel = channel; - LOG(INFO) << "GPS L2C CNAV channel set to " << channel; - // ############# ENABLE DATA FILE LOG ################# - if (d_dump == true) - { - if (d_dump_file.is_open() == false) - { - try - { - d_dump_filename = "telemetry_L2CM_"; - d_dump_filename.append(boost::lexical_cast(d_channel)); - d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); - d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); - LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel - << " Log file: " << d_dump_filename.c_str(); - } - catch (const std::ifstream::failure &e) - { - LOG(WARNING) << "channel " << d_channel << " Exception opening Telemetry GPS L2 dump file " << e.what(); - } - } - } -} diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc index 1cfd20162..0793428fa 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc @@ -100,6 +100,43 @@ gps_l5_telemetry_decoder_cc::~gps_l5_telemetry_decoder_cc() } +void gps_l5_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) +{ + d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); + LOG(INFO) << "GPS L5 CNAV telemetry decoder in channel " << this->d_channel << " set to satellite " << d_satellite; + d_CNAV_Message.reset(); +} + + +void gps_l5_telemetry_decoder_cc::set_channel(int channel) +{ + d_channel = channel; + d_CNAV_Message.reset(); + LOG(INFO) << "GPS L5 CNAV channel set to " << channel; + // ############# ENABLE DATA FILE LOG ################# + if (d_dump == true) + { + if (d_dump_file.is_open() == false) + { + try + { + d_dump_filename = "telemetry_L5_"; + d_dump_filename.append(boost::lexical_cast(d_channel)); + d_dump_filename.append(".dat"); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); + LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel + << " Log file: " << d_dump_filename.c_str(); + } + catch (const std::ifstream::failure &e) + { + LOG(WARNING) << "channel " << d_channel << " Exception opening Telemetry GPS L5 dump file " << e.what(); + } + } + } +} + + int gps_l5_telemetry_decoder_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { @@ -243,40 +280,3 @@ int gps_l5_telemetry_decoder_cc::general_work(int noutput_items __attribute__((u out[0] = current_synchro_data; return 1; } - - -void gps_l5_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) -{ - d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); - LOG(INFO) << "GPS L5 CNAV telemetry decoder in channel " << this->d_channel << " set to satellite " << d_satellite; - d_CNAV_Message.reset(); -} - - -void gps_l5_telemetry_decoder_cc::set_channel(int channel) -{ - d_channel = channel; - d_CNAV_Message.reset(); - LOG(INFO) << "GPS L5 CNAV channel set to " << channel; - // ############# ENABLE DATA FILE LOG ################# - if (d_dump == true) - { - if (d_dump_file.is_open() == false) - { - try - { - d_dump_filename = "telemetry_L5_"; - d_dump_filename.append(boost::lexical_cast(d_channel)); - d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); - d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); - LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel - << " Log file: " << d_dump_filename.c_str(); - } - catch (const std::ifstream::failure &e) - { - LOG(WARNING) << "channel " << d_channel << " Exception opening Telemetry GPS L5 dump file " << e.what(); - } - } - } -} diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.cc index 194db3c11..830a02636 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.cc @@ -87,88 +87,6 @@ sbas_l1_telemetry_decoder_cc::~sbas_l1_telemetry_decoder_cc() } -int sbas_l1_telemetry_decoder_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) -{ - VLOG(FLOW) << "general_work(): " - << "noutput_items=" << noutput_items << "\toutput_items real size=" << output_items.size() << "\tninput_items size=" << ninput_items.size() << "\tinput_items real size=" << input_items.size() << "\tninput_items[0]=" << ninput_items[0]; - // get pointers on in- and output gnss-synchro objects - Gnss_Synchro *out = reinterpret_cast(output_items[0]); // Get the output buffer pointer - const Gnss_Synchro *in = reinterpret_cast(input_items[0]); // Get the input buffer pointer - - Gnss_Synchro current_symbol; //structure to save the synchronization information and send the output object to the next block - //1. Copy the current tracking output - current_symbol = in[0]; - // copy correlation samples into samples vector - d_sample_buf.push_back(current_symbol.Prompt_I); //add new symbol to the symbol queue - - // store the time stamp of the first sample in the processed sample block - double sample_stamp = static_cast(in[0].Tracking_sample_counter) / static_cast(in[0].fs); - - // decode only if enough samples in buffer - if (d_sample_buf.size() >= d_block_size) - { - // align correlation samples in pairs - // and obtain the symbols by summing the paired correlation samples - std::vector symbols; - bool sample_alignment = d_sample_aligner.get_symbols(d_sample_buf, symbols); - - // align symbols in pairs - // and obtain the bits by decoding the symbol pairs - std::vector bits; - bool symbol_alignment = d_symbol_aligner_and_decoder.get_bits(symbols, bits); - - // search for preambles - // and extract the corresponding message candidates - std::vector msg_candidates; - d_frame_detector.get_frame_candidates(bits, msg_candidates); - - // verify checksum - // and return the valid messages - std::vector valid_msgs; - d_crc_verifier.get_valid_frames(msg_candidates, valid_msgs); - - // compute message sample stamp - // and fill messages in SBAS raw message objects - //std::vector sbas_raw_msgs; - for (std::vector::const_iterator it = valid_msgs.cbegin(); - it != valid_msgs.cend(); ++it) - { - int message_sample_offset = - (sample_alignment ? 0 : -1) + d_samples_per_symbol * (symbol_alignment ? -1 : 0) + d_samples_per_symbol * d_symbols_per_bit * it->first; - double message_sample_stamp = sample_stamp + static_cast(message_sample_offset) / 1000.0; - VLOG(EVENT) << "message_sample_stamp=" << message_sample_stamp - << " (sample_stamp=" << sample_stamp - << " sample_alignment=" << sample_alignment - << " symbol_alignment=" << symbol_alignment - << " relative_preamble_start=" << it->first - << " message_sample_offset=" << message_sample_offset - << ")"; - //Sbas_Raw_Msg sbas_raw_msg(message_sample_stamp, this->d_satellite.get_PRN(), it->second); - //sbas_raw_msgs.push_back(sbas_raw_msg); - } - - // parse messages - // and send them to the SBAS raw message queue - //for(std::vector::iterator it = sbas_raw_msgs.begin(); it != sbas_raw_msgs.end(); it++) - // { - //std::cout << "SBAS message type " << it->get_msg_type() << " from PRN" << it->get_prn() << " received" << std::endl; - //sbas_telemetry_data.update(*it); - // } - - // clear all processed samples in the input buffer - d_sample_buf.clear(); - } - - // UPDATE GNSS SYNCHRO DATA - // actually the SBAS telemetry decoder doesn't support ranging - current_symbol.Flag_valid_word = false; // indicate to observable block that this synchro object isn't valid for pseudorange computation - out[0] = current_symbol; - consume_each(1); // tell scheduler input items consumed - return 1; // tell scheduler output items produced -} - - void sbas_l1_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) { d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); @@ -184,7 +102,6 @@ void sbas_l1_telemetry_decoder_cc::set_channel(int channel) // ### helper class for sample alignment ### - sbas_l1_telemetry_decoder_cc::sample_aligner::sample_aligner() { d_n_smpls_in_history = 3; @@ -403,12 +320,11 @@ void sbas_l1_telemetry_decoder_cc::frame_detector::get_frame_candidates(const st // ### helper class for checking the CRC of the message candidates ### - - void sbas_l1_telemetry_decoder_cc::crc_verifier::reset() { } + void sbas_l1_telemetry_decoder_cc::crc_verifier::get_valid_frames(const std::vector msg_candidates, std::vector &valid_msgs) { std::stringstream ss; @@ -500,3 +416,85 @@ void sbas_l1_telemetry_decoder_cc::crc_verifier::zerropad_front_and_convert_to_b << std::setfill('0') << std::hex << static_cast(byte) << std::setfill(' ') << std::resetiosflags(std::ios::hex); } + + +int sbas_l1_telemetry_decoder_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) +{ + VLOG(FLOW) << "general_work(): " + << "noutput_items=" << noutput_items << "\toutput_items real size=" << output_items.size() << "\tninput_items size=" << ninput_items.size() << "\tinput_items real size=" << input_items.size() << "\tninput_items[0]=" << ninput_items[0]; + // get pointers on in- and output gnss-synchro objects + Gnss_Synchro *out = reinterpret_cast(output_items[0]); // Get the output buffer pointer + const Gnss_Synchro *in = reinterpret_cast(input_items[0]); // Get the input buffer pointer + + Gnss_Synchro current_symbol; //structure to save the synchronization information and send the output object to the next block + //1. Copy the current tracking output + current_symbol = in[0]; + // copy correlation samples into samples vector + d_sample_buf.push_back(current_symbol.Prompt_I); //add new symbol to the symbol queue + + // store the time stamp of the first sample in the processed sample block + double sample_stamp = static_cast(in[0].Tracking_sample_counter) / static_cast(in[0].fs); + + // decode only if enough samples in buffer + if (d_sample_buf.size() >= d_block_size) + { + // align correlation samples in pairs + // and obtain the symbols by summing the paired correlation samples + std::vector symbols; + bool sample_alignment = d_sample_aligner.get_symbols(d_sample_buf, symbols); + + // align symbols in pairs + // and obtain the bits by decoding the symbol pairs + std::vector bits; + bool symbol_alignment = d_symbol_aligner_and_decoder.get_bits(symbols, bits); + + // search for preambles + // and extract the corresponding message candidates + std::vector msg_candidates; + d_frame_detector.get_frame_candidates(bits, msg_candidates); + + // verify checksum + // and return the valid messages + std::vector valid_msgs; + d_crc_verifier.get_valid_frames(msg_candidates, valid_msgs); + + // compute message sample stamp + // and fill messages in SBAS raw message objects + //std::vector sbas_raw_msgs; + for (std::vector::const_iterator it = valid_msgs.cbegin(); + it != valid_msgs.cend(); ++it) + { + int message_sample_offset = + (sample_alignment ? 0 : -1) + d_samples_per_symbol * (symbol_alignment ? -1 : 0) + d_samples_per_symbol * d_symbols_per_bit * it->first; + double message_sample_stamp = sample_stamp + static_cast(message_sample_offset) / 1000.0; + VLOG(EVENT) << "message_sample_stamp=" << message_sample_stamp + << " (sample_stamp=" << sample_stamp + << " sample_alignment=" << sample_alignment + << " symbol_alignment=" << symbol_alignment + << " relative_preamble_start=" << it->first + << " message_sample_offset=" << message_sample_offset + << ")"; + //Sbas_Raw_Msg sbas_raw_msg(message_sample_stamp, this->d_satellite.get_PRN(), it->second); + //sbas_raw_msgs.push_back(sbas_raw_msg); + } + + // parse messages + // and send them to the SBAS raw message queue + //for(std::vector::iterator it = sbas_raw_msgs.begin(); it != sbas_raw_msgs.end(); it++) + // { + //std::cout << "SBAS message type " << it->get_msg_type() << " from PRN" << it->get_prn() << " received" << std::endl; + //sbas_telemetry_data.update(*it); + // } + + // clear all processed samples in the input buffer + d_sample_buf.clear(); + } + + // UPDATE GNSS SYNCHRO DATA + // actually the SBAS telemetry decoder doesn't support ranging + current_symbol.Flag_valid_word = false; // indicate to observable block that this synchro object isn't valid for pseudorange computation + out[0] = current_symbol; + consume_each(1); // tell scheduler input items consumed + return 1; // tell scheduler output items produced +} From c01d8d0dd90d6a8121691d849c7dc2514fa4ade7 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 13 Apr 2018 11:39:05 +0200 Subject: [PATCH 27/82] Move general_work to the bottom of the file --- .../rtl_tcp_signal_source_c.cc | 70 +++++++++---------- .../unpack_spir_gss6450_samples.cc | 29 ++++---- 2 files changed, 50 insertions(+), 49 deletions(-) diff --git a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc index e874e8a14..4ec4420ce 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc @@ -158,41 +158,6 @@ rtl_tcp_signal_source_c::~rtl_tcp_signal_source_c() } -int rtl_tcp_signal_source_c::work(int noutput_items, - gr_vector_const_void_star & /*input_items*/, - gr_vector_void_star &output_items) -{ - gr_complex *out = reinterpret_cast(output_items[0]); - int i = 0; - if (io_service_.stopped()) - { - return -1; - } - - { - boost::mutex::scoped_lock lock(mutex_); - not_empty_.wait(lock, boost::bind(&rtl_tcp_signal_source_c::not_empty, - this)); - - for (; i < noutput_items && unread_ > 1; i++) - { - float re = buffer_[--unread_]; - float im = buffer_[--unread_]; - if (flip_iq_) - { - out[i] = gr_complex(im, re); - } - else - { - out[i] = gr_complex(re, im); - } - } - } - not_full_.notify_one(); - return i == 0 ? -1 : i; -} - - void rtl_tcp_signal_source_c::set_frequency(int frequency) { boost::system::error_code ec = @@ -359,3 +324,38 @@ void rtl_tcp_signal_source_c::handle_read(const boost::system::error_code &ec, this, _1, _2)); } } + + +int rtl_tcp_signal_source_c::work(int noutput_items, + gr_vector_const_void_star & /*input_items*/, + gr_vector_void_star &output_items) +{ + gr_complex *out = reinterpret_cast(output_items[0]); + int i = 0; + if (io_service_.stopped()) + { + return -1; + } + + { + boost::mutex::scoped_lock lock(mutex_); + not_empty_.wait(lock, boost::bind(&rtl_tcp_signal_source_c::not_empty, + this)); + + for (; i < noutput_items && unread_ > 1; i++) + { + float re = buffer_[--unread_]; + float im = buffer_[--unread_]; + if (flip_iq_) + { + out[i] = gr_complex(im, re); + } + else + { + out[i] = gr_complex(re, im); + } + } + } + not_full_.notify_one(); + return i == 0 ? -1 : i; +} diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.cc b/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.cc index a5bca6ee7..bd725b219 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.cc @@ -57,6 +57,21 @@ unpack_spir_gss6450_samples::~unpack_spir_gss6450_samples() } +int unpack_spir_gss6450_samples::compute_two_complement(unsigned long data) +{ + int res = 0; + if (static_cast(data) < two_compl_thres) + { + res = static_cast(data); + } + else + { + res = static_cast(data) - adc_bits_two_pow; + } + return res; +} + + int unpack_spir_gss6450_samples::work(int noutput_items, gr_vector_const_void_star& input_items, gr_vector_void_star& output_items) { @@ -86,17 +101,3 @@ int unpack_spir_gss6450_samples::work(int noutput_items, } return noutput_items; } - -int unpack_spir_gss6450_samples::compute_two_complement(unsigned long data) -{ - int res = 0; - if (static_cast(data) < two_compl_thres) - { - res = static_cast(data); - } - else - { - res = static_cast(data) - adc_bits_two_pow; - } - return res; -} From 44c6d8622ce1c57a8c6274e547464a53dad6c31a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 13 Apr 2018 12:11:41 +0200 Subject: [PATCH 28/82] Make the test to correctly fail if no kml file is generated --- src/tests/system-tests/position_test.cc | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/tests/system-tests/position_test.cc b/src/tests/system-tests/position_test.cc index 350055d2f..bf0925dda 100644 --- a/src/tests/system-tests/position_test.cc +++ b/src/tests/system-tests/position_test.cc @@ -277,8 +277,8 @@ int StaticPositionSystemTest::configure_receiver() const float dll_bw_narrow_hz = 2.0; const int extend_correlation_ms = 1; - const int display_rate_ms = 1000; - const int output_rate_ms = 1000; + const int display_rate_ms = 500; + const int output_rate_ms = 500; config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(sampling_rate_internal)); @@ -358,10 +358,10 @@ int StaticPositionSystemTest::configure_receiver() config->set_property("Tracking_1C.pll_bw_hz", std::to_string(pll_bw_hz)); config->set_property("Tracking_1C.dll_bw_hz", std::to_string(dll_bw_hz)); config->set_property("Tracking_1C.early_late_space_chips", std::to_string(early_late_space_chips)); - + config->set_property("Tracking_1Cearly_late_space_narrow_chips", std::to_string(early_late_space_chips / 5.0)); config->set_property("Tracking_1C.pll_bw_narrow_hz", std::to_string(pll_bw_narrow_hz)); config->set_property("Tracking_1C.dll_bw_narrow_hz", std::to_string(dll_bw_narrow_hz)); - config->set_property("Tracking_1C.extend_correlation_ms", std::to_string(extend_correlation_ms)); + config->set_property("Tracking_1C.extend_correlation_symbols", std::to_string(extend_correlation_ms)); // Set Telemetry config->set_property("TelemetryDecoder_1C.implementation", "GPS_L1_CA_Telemetry_Decoder"); @@ -454,6 +454,7 @@ int StaticPositionSystemTest::run_receiver() void StaticPositionSystemTest::check_results() { std::fstream myfile(StaticPositionSystemTest::generated_kml_file, std::ios_base::in); + ASSERT_TRUE(myfile.is_open()) << "No valid kml file could be opened"; std::string line; std::vector pos_e; @@ -466,6 +467,7 @@ void StaticPositionSystemTest::check_results() while (is_header) { std::getline(myfile, line); + ASSERT_FALSE(myfile.eof()) << "No valid kml file found."; std::size_t found = line.find(""); if (found != std::string::npos) is_header = false; } @@ -474,7 +476,11 @@ void StaticPositionSystemTest::check_results() //read data while (is_data) { - std::getline(myfile, line); + if (!std::getline(myfile, line)) + { + is_data = false; + break; + } std::size_t found = line.find(""); if (found != std::string::npos) is_data = false; @@ -504,6 +510,7 @@ void StaticPositionSystemTest::check_results() } } myfile.close(); + ASSERT_FALSE(pos_e.size() == 0) << "KML file is empty"; double sigma_E_2_precision = std::pow(compute_stdev_precision(pos_e), 2.0); double sigma_N_2_precision = std::pow(compute_stdev_precision(pos_n), 2.0); From 26467a0f29dfc10448166616b600f707c226182a Mon Sep 17 00:00:00 2001 From: Antonio Ramos Date: Fri, 13 Apr 2018 12:30:06 +0200 Subject: [PATCH 29/82] Increase fixed latency in order to avoid loss of observables --- .../observables/gnuradio_blocks/hybrid_observables_cc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc index 0fdd85c31..06f0efdcd 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc @@ -64,7 +64,7 @@ hybrid_observables_cc::hybrid_observables_cc(unsigned int nchannels_in, T_rx_s = 0.0; T_rx_step_s = 0.001; // 1 ms max_delta = 1.5; // 1.5 s - d_latency = 0.175; // 175 ms + d_latency = 0.3; // 300 ms valid_channels.resize(d_nchannels, false); d_num_valid_channels = 0; d_gnss_synchro_history = new Gnss_circular_deque(static_cast(max_delta * 1000.0), d_nchannels); From 1428630e79c32a4930f1f0dea72fc94bf71f8905 Mon Sep 17 00:00:00 2001 From: Antonio Ramos Date: Fri, 13 Apr 2018 15:27:14 +0200 Subject: [PATCH 30/82] Add RX time counter --- src/algorithms/libs/CMakeLists.txt | 67 ++-- src/algorithms/libs/gnss_sdr_time_counter.cc | 126 ++++++++ src/algorithms/libs/gnss_sdr_time_counter.h | 65 ++++ src/core/receiver/gnss_flowgraph.cc | 311 ++++++++++--------- src/core/receiver/gnss_flowgraph.h | 6 + 5 files changed, 412 insertions(+), 163 deletions(-) create mode 100644 src/algorithms/libs/gnss_sdr_time_counter.cc create mode 100644 src/algorithms/libs/gnss_sdr_time_counter.h diff --git a/src/algorithms/libs/CMakeLists.txt b/src/algorithms/libs/CMakeLists.txt index ac182801e..fd34bf693 100644 --- a/src/algorithms/libs/CMakeLists.txt +++ b/src/algorithms/libs/CMakeLists.txt @@ -18,27 +18,52 @@ add_subdirectory(rtklib) -set(GNSS_SPLIBS_SOURCES - gps_l2c_signal.cc - gps_l5_signal.cc - galileo_e1_signal_processing.cc - gnss_sdr_valve.cc - gnss_sdr_sample_counter.cc - gnss_signal_processing.cc - gps_sdr_signal_processing.cc - glonass_l1_signal_processing.cc - glonass_l2_signal_processing.cc - pass_through.cc - galileo_e5_signal_processing.cc - complex_byte_to_float_x2.cc - byte_x2_to_complex_byte.cc - cshort_to_float_x2.cc - short_x2_to_cshort.cc - complex_float_to_complex_byte.cc - conjugate_cc.cc - conjugate_sc.cc - conjugate_ic.cc -) +if(ENABLE_FPGA) + set(GNSS_SPLIBS_SOURCES + gps_l2c_signal.cc + gps_l5_signal.cc + galileo_e1_signal_processing.cc + gnss_sdr_valve.cc + gnss_sdr_sample_counter.cc + gnss_sdr_time_counter.cc + gnss_signal_processing.cc + gps_sdr_signal_processing.cc + glonass_l1_signal_processing.cc + glonass_l2_signal_processing.cc + pass_through.cc + galileo_e5_signal_processing.cc + complex_byte_to_float_x2.cc + byte_x2_to_complex_byte.cc + cshort_to_float_x2.cc + short_x2_to_cshort.cc + complex_float_to_complex_byte.cc + conjugate_cc.cc + conjugate_sc.cc + conjugate_ic.cc + ) +else(ENABLE_FPGA) + set(GNSS_SPLIBS_SOURCES + gps_l2c_signal.cc + gps_l5_signal.cc + galileo_e1_signal_processing.cc + gnss_sdr_valve.cc + gnss_sdr_sample_counter.cc + gnss_signal_processing.cc + gps_sdr_signal_processing.cc + glonass_l1_signal_processing.cc + glonass_l2_signal_processing.cc + pass_through.cc + galileo_e5_signal_processing.cc + complex_byte_to_float_x2.cc + byte_x2_to_complex_byte.cc + cshort_to_float_x2.cc + short_x2_to_cshort.cc + complex_float_to_complex_byte.cc + conjugate_cc.cc + conjugate_sc.cc + conjugate_ic.cc + ) +endif(ENABLE_FPGA) if(OPENCL_FOUND) set(GNSS_SPLIBS_SOURCES ${GNSS_SPLIBS_SOURCES} diff --git a/src/algorithms/libs/gnss_sdr_time_counter.cc b/src/algorithms/libs/gnss_sdr_time_counter.cc new file mode 100644 index 000000000..f94aadcab --- /dev/null +++ b/src/algorithms/libs/gnss_sdr_time_counter.cc @@ -0,0 +1,126 @@ +/*! + * \file gnss_sdr_time_counter.cc + * \brief Simple block to report the current receiver time based on the output of the tracking or telemetry blocks + * \author Antonio Ramos 2018. antonio.ramos(at)gmail.com + * + * + * ------------------------------------------------------------------------- + * + * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) + * + * GNSS-SDR is a software defined Global Navigation + * Satellite Systems receiver + * + * This file is part of GNSS-SDR. + * + * GNSS-SDR is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GNSS-SDR is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNSS-SDR. If not, see . + * + * ------------------------------------------------------------------------- + */ + +#include "gnss_sdr_time_counter.h" +#include "gnss_synchro.h" +#include +#include +#include +#include + +gnss_sdr_time_counter::gnss_sdr_time_counter() : gr::block("time_counter", + gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), + gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) +{ + set_max_noutput_items(1); + current_T_rx_ms = 0; + current_s = 0; + current_m = 0; + current_h = 0; + current_days = 0; + report_interval_ms = 1000; // default reporting 1 second + flag_m = false; + flag_h = false; + flag_days = false; +} + + +gnss_sdr_time_counter_sptr gnss_sdr_make_time_counter() +{ + gnss_sdr_time_counter_sptr counter_(new gnss_sdr_time_counter()); + return counter_; +} + + +int gnss_sdr_time_counter::general_work(int noutput_items __attribute__((unused)), + gr_vector_const_void_star &input_items __attribute__((unused)), + gr_vector_void_star &output_items) +{ + Gnss_Synchro *out = reinterpret_cast(output_items[0]); + const Gnss_Synchro *in = reinterpret_cast(input_items[0]); + out[0] = in[0]; + if ((current_T_rx_ms % report_interval_ms) == 0) + { + current_s++; + if ((current_s % 60) == 0) + { + current_s = 0; + current_m++; + flag_m = true; + if ((current_m % 60) == 0) + { + current_m = 0; + current_h++; + flag_h = true; + if ((current_h % 24) == 0) + { + current_h = 0; + current_days++; + flag_days = true; + } + } + } + + if (flag_days) + { + std::string day; + if (current_days == 1) + { + day = " day "; + } + else + { + day = " days "; + } + std::cout << "Current receiver time: " << current_days << day << current_h << " h " << current_m << " min " << current_s << " s" << std::endl; + } + else + { + if (flag_h) + { + std::cout << "Current receiver time: " << current_h << " h " << current_m << " min " << current_s << " s" << std::endl; + } + else + { + if (flag_m) + { + std::cout << "Current receiver time: " << current_m << " min " << current_s << " s" << std::endl; + } + else + { + std::cout << "Current receiver time: " << current_s << " s" << std::endl; + } + } + } + } + current_T_rx_ms++; + return 1; +} diff --git a/src/algorithms/libs/gnss_sdr_time_counter.h b/src/algorithms/libs/gnss_sdr_time_counter.h new file mode 100644 index 000000000..c0692252e --- /dev/null +++ b/src/algorithms/libs/gnss_sdr_time_counter.h @@ -0,0 +1,65 @@ +/*! + * \file gnss_sdr_time_counter.h + * \brief Simple block to report the current receiver time based on the output of the tracking or telemetry blocks + * \author Antonio Ramos 2018. antonio.ramosdet(at)gmail.com + * + * + * ------------------------------------------------------------------------- + * + * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) + * + * GNSS-SDR is a software defined Global Navigation + * Satellite Systems receiver + * + * This file is part of GNSS-SDR. + * + * GNSS-SDR is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GNSS-SDR is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNSS-SDR. If not, see . + * + * ------------------------------------------------------------------------- + */ +#ifndef GNSS_SDR_TIME_COUNTER_H_ +#define GNSS_SDR_TIME_COUNTER_H_ + +#include +#include + + +class gnss_sdr_time_counter; + +typedef boost::shared_ptr gnss_sdr_time_counter_sptr; + +gnss_sdr_time_counter_sptr gnss_sdr_make_time_counter(); + +class gnss_sdr_time_counter : public gr::block +{ +private: + gnss_sdr_time_counter(); + long long int current_T_rx_ms; // Receiver time in ms since the beginning of the run + unsigned int current_s; // Receiver time in seconds, modulo 60 + bool flag_m; // True if the receiver has been running for at least 1 minute + unsigned int current_m; // Receiver time in minutes, modulo 60 + bool flag_h; // True if the receiver has been running for at least 1 hour + unsigned int current_h; // Receiver time in hours, modulo 24 + bool flag_days; // True if the receiver has been running for at least 1 day + unsigned int current_days; // Receiver time in days since the beginning of the run + int report_interval_ms; + +public: + friend gnss_sdr_time_counter_sptr gnss_sdr_make_time_counter(); + int general_work(int noutput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); +}; + +#endif /*GNSS_SDR_SAMPLE_COUNTER_H_*/ diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index 0c5a42f9c..67e9fc698 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -62,8 +62,6 @@ GNSSFlowgraph::GNSSFlowgraph(std::shared_ptr configurati GNSSFlowgraph::~GNSSFlowgraph() {} - - void GNSSFlowgraph::start() { if (running_) @@ -108,41 +106,41 @@ void GNSSFlowgraph::connect() } for (int i = 0; i < sources_count_; i++) - { - if (configuration_->property(sig_source_.at(i)->role() + ".enable_FPGA", false)==false) { - try + if (configuration_->property(sig_source_.at(i)->role() + ".enable_FPGA", false) == false) { - sig_source_.at(i)->connect(top_block_); - } - catch (const std::exception& e) - { - LOG(INFO) << "Can't connect signal source block " << i << " internally"; - LOG(ERROR) << e.what(); - top_block_->disconnect_all(); - return; + try + { + sig_source_.at(i)->connect(top_block_); + } + catch (const std::exception& e) + { + LOG(INFO) << "Can't connect signal source block " << i << " internally"; + LOG(ERROR) << e.what(); + top_block_->disconnect_all(); + return; + } } } - } // Signal Source > Signal conditioner > for (unsigned int i = 0; i < sig_conditioner_.size(); i++) - { - if (configuration_->property(sig_conditioner_.at(i)->role() + ".enable_FPGA", false)==false) { - try + if (configuration_->property(sig_conditioner_.at(i)->role() + ".enable_FPGA", false) == false) { - sig_conditioner_.at(i)->connect(top_block_); - } - catch (const std::exception& e) - { - LOG(INFO) << "Can't connect signal conditioner block " << i << " internally"; - LOG(ERROR) << e.what(); - top_block_->disconnect_all(); - return; + try + { + sig_conditioner_.at(i)->connect(top_block_); + } + catch (const std::exception& e) + { + LOG(INFO) << "Can't connect signal conditioner block " << i << " internally"; + LOG(ERROR) << e.what(); + top_block_->disconnect_all(); + return; + } } } - } for (unsigned int i = 0; i < channels_count_; i++) { @@ -191,144 +189,173 @@ void GNSSFlowgraph::connect() for (int i = 0; i < sources_count_; i++) { - //FPGA Accelerators do not need signal sources or conditioners - //as the samples are feed directly to the FPGA fabric, so, if enabled, do not connect any source - if (configuration_->property(sig_source_.at(i)->role() + ".enable_FPGA", false)==false) - { - try + //FPGA Accelerators do not need signal sources or conditioners + //as the samples are feed directly to the FPGA fabric, so, if enabled, do not connect any source + if (configuration_->property(sig_source_.at(i)->role() + ".enable_FPGA", false) == false) { - //TODO: Remove this array implementation and create generic multistream connector - //(if a signal source has more than 1 stream, then connect it to the multistream signal conditioner) - if (sig_source_.at(i)->implementation().compare("Raw_Array_Signal_Source") == 0) + try { - //Multichannel Array - std::cout << "ARRAY MODE" << std::endl; - for (int j = 0; j < GNSS_SDR_ARRAY_SIGNAL_CONDITIONER_CHANNELS; j++) + //TODO: Remove this array implementation and create generic multistream connector + //(if a signal source has more than 1 stream, then connect it to the multistream signal conditioner) + if (sig_source_.at(i)->implementation().compare("Raw_Array_Signal_Source") == 0) { - std::cout << "connecting ch " << j << std::endl; - top_block_->connect(sig_source_.at(i)->get_right_block(), j, sig_conditioner_.at(i)->get_left_block(), j); - } - } - else - { - //TODO: Create a class interface for SignalSources, derived from GNSSBlockInterface. - //Include GetRFChannels in the interface to avoid read config parameters here - //read the number of RF channels for each front-end - RF_Channels = configuration_->property(sig_source_.at(i)->role() + ".RF_channels", 1); - - for (int j = 0; j < RF_Channels; j++) - { - //Connect the multichannel signal source to multiple signal conditioners - // GNURADIO max_streams=-1 means infinite ports! - LOG(INFO) << "sig_source_.at(i)->get_right_block()->output_signature()->max_streams()=" << sig_source_.at(i)->get_right_block()->output_signature()->max_streams(); - LOG(INFO) << "sig_conditioner_.at(signal_conditioner_ID)->get_left_block()->input_signature()=" << sig_conditioner_.at(signal_conditioner_ID)->get_left_block()->input_signature()->max_streams(); - - if (sig_source_.at(i)->get_right_block()->output_signature()->max_streams() > 1) + //Multichannel Array + std::cout << "ARRAY MODE" << std::endl; + for (int j = 0; j < GNSS_SDR_ARRAY_SIGNAL_CONDITIONER_CHANNELS; j++) { - LOG(INFO) << "connecting sig_source_ " << i << " stream " << j << " to conditioner " << j; - top_block_->connect(sig_source_.at(i)->get_right_block(), j, sig_conditioner_.at(signal_conditioner_ID)->get_left_block(), 0); + std::cout << "connecting ch " << j << std::endl; + top_block_->connect(sig_source_.at(i)->get_right_block(), j, sig_conditioner_.at(i)->get_left_block(), j); } - else + } + else + { + //TODO: Create a class interface for SignalSources, derived from GNSSBlockInterface. + //Include GetRFChannels in the interface to avoid read config parameters here + //read the number of RF channels for each front-end + RF_Channels = configuration_->property(sig_source_.at(i)->role() + ".RF_channels", 1); + + for (int j = 0; j < RF_Channels; j++) { - if (j == 0) + //Connect the multichannel signal source to multiple signal conditioners + // GNURADIO max_streams=-1 means infinite ports! + LOG(INFO) << "sig_source_.at(i)->get_right_block()->output_signature()->max_streams()=" << sig_source_.at(i)->get_right_block()->output_signature()->max_streams(); + LOG(INFO) << "sig_conditioner_.at(signal_conditioner_ID)->get_left_block()->input_signature()=" << sig_conditioner_.at(signal_conditioner_ID)->get_left_block()->input_signature()->max_streams(); + + if (sig_source_.at(i)->get_right_block()->output_signature()->max_streams() > 1) { - // RF_channel 0 backward compatibility with single channel sources - LOG(INFO) << "connecting sig_source_ " << i << " stream " << 0 << " to conditioner " << j; - top_block_->connect(sig_source_.at(i)->get_right_block(), 0, sig_conditioner_.at(signal_conditioner_ID)->get_left_block(), 0); + LOG(INFO) << "connecting sig_source_ " << i << " stream " << j << " to conditioner " << j; + top_block_->connect(sig_source_.at(i)->get_right_block(), j, sig_conditioner_.at(signal_conditioner_ID)->get_left_block(), 0); } else { - // Multiple channel sources using multiple output blocks of single channel (requires RF_channel selector in call) - LOG(INFO) << "connecting sig_source_ " << i << " stream " << j << " to conditioner " << j; - top_block_->connect(sig_source_.at(i)->get_right_block(j), 0, sig_conditioner_.at(signal_conditioner_ID)->get_left_block(), 0); + if (j == 0) + { + // RF_channel 0 backward compatibility with single channel sources + LOG(INFO) << "connecting sig_source_ " << i << " stream " << 0 << " to conditioner " << j; + top_block_->connect(sig_source_.at(i)->get_right_block(), 0, sig_conditioner_.at(signal_conditioner_ID)->get_left_block(), 0); + } + else + { + // Multiple channel sources using multiple output blocks of single channel (requires RF_channel selector in call) + LOG(INFO) << "connecting sig_source_ " << i << " stream " << j << " to conditioner " << j; + top_block_->connect(sig_source_.at(i)->get_right_block(j), 0, sig_conditioner_.at(signal_conditioner_ID)->get_left_block(), 0); + } } + signal_conditioner_ID++; } - signal_conditioner_ID++; } } + catch (const std::exception& e) + { + LOG(WARNING) << "Can't connect signal source " << i << " to signal conditioner " << i; + LOG(ERROR) << e.what(); + top_block_->disconnect_all(); + return; + } + } + } + DLOG(INFO) << "Signal source connected to signal conditioner"; + bool FPGA_enabled = configuration_->property(sig_source_.at(0)->role() + ".enable_FPGA", false); + +#if ENABLE_FPGA + + if (FPGA_enabled == false) + { + //connect the signal source to sample counter + //connect the sample counter to Observables + try + { + double fs = static_cast(configuration_->property("GNSS-SDR.internal_fs_sps", 0)); + if (fs == 0.0) + { + LOG(WARNING) << "Set GNSS-SDR.internal_fs_sps in configuration file"; + std::cout << "Set GNSS-SDR.internal_fs_sps in configuration file" << std::endl; + throw(std::invalid_argument("Set GNSS-SDR.internal_fs_sps in configuration")); + } + ch_out_sample_counter = gnss_sdr_make_sample_counter(fs, sig_conditioner_.at(0)->get_right_block()->output_signature()->sizeof_stream_item(0)); + top_block_->connect(sig_conditioner_.at(0)->get_right_block(), 0, ch_out_sample_counter, 0); + top_block_->connect(ch_out_sample_counter, 0, observables_->get_left_block(), channels_count_); //extra port for the sample counter pulse } catch (const std::exception& e) { - LOG(WARNING) << "Can't connect signal source " << i << " to signal conditioner " << i; + LOG(WARNING) << "Can't connect sample counter"; + LOG(ERROR) << e.what(); + top_block_->disconnect_all(); + return; + } + } + else + { + //create a software-defined 1kHz gnss_synchro pulse for the observables block + try + { + //null source + null_source_ = gr::blocks::null_source::make(sizeof(Gnss_Synchro)); + //throttle 1kHz + throttle_ = gr::blocks::throttle::make(sizeof(Gnss_Synchro), 1000); // 1000 samples per second (1kHz) + time_counter_ = gnss_sdr_make_time_counter(); + top_block_->connect(null_source_, 0, throttle_, 0); + top_block_->connect(throttle_, 0, time_counter_, 0); + top_block_->connect(time_counter_, 0, observables_->get_left_block(), channels_count_); + } + catch (const std::exception& e) + { + LOG(WARNING) << "Can't connect sample counter"; LOG(ERROR) << e.what(); top_block_->disconnect_all(); return; } } - } - DLOG(INFO) << "Signal source connected to signal conditioner"; - bool FPGA_enabled = configuration_->property(sig_source_.at(0)->role() + ".enable_FPGA", false); +#else - if (FPGA_enabled==false) - { - //connect the signal source to sample counter - //connect the sample counter to Observables - try - { - double fs = static_cast(configuration_->property("GNSS-SDR.internal_fs_sps", 0)); - if (fs == 0.0) - { - LOG(WARNING) << "Set GNSS-SDR.internal_fs_sps in configuration file"; - std::cout << "Set GNSS-SDR.internal_fs_sps in configuration file" << std::endl; - throw(std::invalid_argument("Set GNSS-SDR.internal_fs_sps in configuration")); - } - ch_out_sample_counter = gnss_sdr_make_sample_counter(fs, sig_conditioner_.at(0)->get_right_block()->output_signature()->sizeof_stream_item(0)); - top_block_->connect(sig_conditioner_.at(0)->get_right_block(), 0, ch_out_sample_counter, 0); - top_block_->connect(ch_out_sample_counter, 0, observables_->get_left_block(), channels_count_); //extra port for the sample counter pulse - } - catch (const std::exception& e) - { - LOG(WARNING) << "Can't connect sample counter"; - LOG(ERROR) << e.what(); - top_block_->disconnect_all(); - return; - } - }else{ - //create a software-defined 1kHz gnss_synchro pulse for the observables block - try - { - //null source - null_source_= gr::blocks::null_source::make(sizeof(Gnss_Synchro)); - //throttle 1kHz - throttle_ = gr::blocks::throttle::make(sizeof(Gnss_Synchro),1000);// 1000 samples per second (1kHz) - top_block_->connect(null_source_, 0, throttle_, 0); - top_block_->connect(throttle_, 0, observables_->get_left_block(), channels_count_); //extra port for the sample counter pulse + //connect the signal source to sample counter + //connect the sample counter to Observables + try + { + double fs = static_cast(configuration_->property("GNSS-SDR.internal_fs_sps", 0)); + if (fs == 0.0) + { + LOG(WARNING) << "Set GNSS-SDR.internal_fs_sps in configuration file"; + std::cout << "Set GNSS-SDR.internal_fs_sps in configuration file" << std::endl; + throw(std::invalid_argument("Set GNSS-SDR.internal_fs_sps in configuration")); + } + ch_out_sample_counter = gnss_sdr_make_sample_counter(fs, sig_conditioner_.at(0)->get_right_block()->output_signature()->sizeof_stream_item(0)); + top_block_->connect(sig_conditioner_.at(0)->get_right_block(), 0, ch_out_sample_counter, 0); + top_block_->connect(ch_out_sample_counter, 0, observables_->get_left_block(), channels_count_); //extra port for the sample counter pulse + } + catch (const std::exception& e) + { + LOG(WARNING) << "Can't connect sample counter"; + LOG(ERROR) << e.what(); + top_block_->disconnect_all(); + return; + } - } - catch (const std::exception& e) - { - LOG(WARNING) << "Can't connect sample counter"; - LOG(ERROR) << e.what(); - top_block_->disconnect_all(); - return; - } - } +#endif // Signal conditioner (selected_signal_source) >> channels (i) (dependent of their associated SignalSource_ID) int selected_signal_conditioner_ID; for (unsigned int i = 0; i < channels_count_; i++) { - - - if (FPGA_enabled == false) - { - selected_signal_conditioner_ID = configuration_->property("Channel" + boost::lexical_cast(i) + ".RF_channel_ID", 0); - try + if (FPGA_enabled == false) { - top_block_->connect(sig_conditioner_.at(selected_signal_conditioner_ID)->get_right_block(), 0, - channels_.at(i)->get_left_block(), 0); - } - catch (const std::exception& e) - { - LOG(WARNING) << "Can't connect signal conditioner " << selected_signal_conditioner_ID << " to channel " << i; - LOG(ERROR) << e.what(); - top_block_->disconnect_all(); - return; - } + selected_signal_conditioner_ID = configuration_->property("Channel" + boost::lexical_cast(i) + ".RF_channel_ID", 0); + try + { + top_block_->connect(sig_conditioner_.at(selected_signal_conditioner_ID)->get_right_block(), 0, + channels_.at(i)->get_left_block(), 0); + } + catch (const std::exception& e) + { + LOG(WARNING) << "Can't connect signal conditioner " << selected_signal_conditioner_ID << " to channel " << i; + LOG(ERROR) << e.what(); + top_block_->disconnect_all(); + return; + } - DLOG(INFO) << "signal conditioner " << selected_signal_conditioner_ID << " connected to channel " << i; - } + DLOG(INFO) << "signal conditioner " << selected_signal_conditioner_ID << " connected to channel " << i; + } // Signal Source > Signal conditioner >> Channels >> Observables try { @@ -348,10 +375,10 @@ void GNSSFlowgraph::connect() if (channels_state_[i] == 1) { - if (FPGA_enabled == false) - { - channels_.at(i)->start_acquisition(); - } + if (FPGA_enabled == false) + { + channels_.at(i)->start_acquisition(); + } available_GNSS_signals_.pop_front(); LOG(INFO) << "Channel " << i << " assigned to " << channels_.at(i)->get_signal(); LOG(INFO) << "Channel " << i << " connected to observables and ready for acquisition"; @@ -491,12 +518,12 @@ void GNSSFlowgraph::set_configuration(std::shared_ptr co void GNSSFlowgraph::start_acquisition_helper() { for (unsigned int i = 0; i < channels_count_; i++) - { - if (channels_state_[i] == 1) - { - channels_.at(i)->start_acquisition(); - } - } + { + if (channels_state_[i] == 1) + { + channels_.at(i)->start_acquisition(); + } + } } void GNSSFlowgraph::init() diff --git a/src/core/receiver/gnss_flowgraph.h b/src/core/receiver/gnss_flowgraph.h index 84a426920..d2d95dc29 100644 --- a/src/core/receiver/gnss_flowgraph.h +++ b/src/core/receiver/gnss_flowgraph.h @@ -49,6 +49,9 @@ #include #include +#if ENABLE_FPGA +#include "gnss_sdr_time_counter.h" +#endif class GNSSBlockInterface; class ChannelInterface; @@ -144,6 +147,9 @@ private: std::vector> channels_; gnss_sdr_sample_counter_sptr ch_out_sample_counter; +#if ENABLE_FPGA + gnss_sdr_time_counter_sptr time_counter_; +#endif gr::blocks::null_source::sptr null_source_; gr::blocks::throttle::sptr throttle_; gr::top_block_sptr top_block_; From ab534e77911275f86370663bdb72c0b88a06c423 Mon Sep 17 00:00:00 2001 From: Javier Date: Fri, 13 Apr 2018 18:31:35 +0200 Subject: [PATCH 31/82] Fix build bug --- src/algorithms/signal_source/libs/CMakeLists.txt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/algorithms/signal_source/libs/CMakeLists.txt b/src/algorithms/signal_source/libs/CMakeLists.txt index 5617be70a..10fdd0d4c 100644 --- a/src/algorithms/signal_source/libs/CMakeLists.txt +++ b/src/algorithms/signal_source/libs/CMakeLists.txt @@ -53,13 +53,12 @@ if(ENABLE_FMCOMMS2 OR ENABLE_AD9361) endif(ENABLE_FMCOMMS2 OR ENABLE_AD9361) -set (SIGNAL_SOURCE_LIB_SOURCES - rtl_tcp_commands.cc - rtl_tcp_dongle_info.cc - ${OPT_SIGNAL_SOURCE_LIB_SOURCES}) +if(ENABLE_AD9361) + set(OPT_SIGNAL_SOURCE_LIB_SOURCES ad9361_manager.cc) +endif(ENABLE_AD9361) if(ENABLE_FPGA) - SET(SIGNAL_SOURCE_LIB_SOURCES ${SIGNAL_SOURCE_LIB_SOURCES} fpga_switch.cc) + SET(OPT_SIGNAL_SOURCE_LIB_SOURCES ${OPT_SIGNAL_SOURCE_LIB_SOURCES} fpga_switch.cc) endif(ENABLE_FPGA) include_directories( @@ -68,6 +67,10 @@ include_directories( ${OPT_DRIVER_INCLUDE_DIRS} ) +set (SIGNAL_SOURCE_LIB_SOURCES + rtl_tcp_commands.cc + rtl_tcp_dongle_info.cc + ${OPT_SIGNAL_SOURCE_LIB_SOURCES}) file(GLOB SIGNAL_SOURCE_LIB_HEADERS "*.h") list(SORT SIGNAL_SOURCE_LIB_HEADERS) From fec1e374075df1851bd8b0a28de227015c859c4f Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 14 Apr 2018 11:19:52 +0200 Subject: [PATCH 32/82] Fix Typo --- src/tests/system-tests/position_test.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/tests/system-tests/position_test.cc b/src/tests/system-tests/position_test.cc index bf0925dda..4018552bc 100644 --- a/src/tests/system-tests/position_test.cc +++ b/src/tests/system-tests/position_test.cc @@ -358,7 +358,7 @@ int StaticPositionSystemTest::configure_receiver() config->set_property("Tracking_1C.pll_bw_hz", std::to_string(pll_bw_hz)); config->set_property("Tracking_1C.dll_bw_hz", std::to_string(dll_bw_hz)); config->set_property("Tracking_1C.early_late_space_chips", std::to_string(early_late_space_chips)); - config->set_property("Tracking_1Cearly_late_space_narrow_chips", std::to_string(early_late_space_chips / 5.0)); + config->set_property("Tracking_1C.pll_bw_narrow_hz", std::to_string(pll_bw_narrow_hz)); config->set_property("Tracking_1C.dll_bw_narrow_hz", std::to_string(dll_bw_narrow_hz)); config->set_property("Tracking_1C.extend_correlation_symbols", std::to_string(extend_correlation_ms)); @@ -366,7 +366,6 @@ int StaticPositionSystemTest::configure_receiver() // Set Telemetry config->set_property("TelemetryDecoder_1C.implementation", "GPS_L1_CA_Telemetry_Decoder"); config->set_property("TelemetryDecoder_1C.dump", "false"); - config->set_property("TelemetryDecoder_1C.decimation_factor", std::to_string(decimation_factor)); // Set Observables config->set_property("Observables.implementation", "Hybrid_Observables"); From b1695375a854bda08df9c2f509b3af574171417a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 14 Apr 2018 16:04:33 +0200 Subject: [PATCH 33/82] Improve finding of gnuradio-iio library --- cmake/Modules/Findiio.cmake | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/cmake/Modules/Findiio.cmake b/cmake/Modules/Findiio.cmake index 817e9f9f7..a1d526ae5 100644 --- a/cmake/Modules/Findiio.cmake +++ b/cmake/Modules/Findiio.cmake @@ -22,6 +22,28 @@ FIND_LIBRARY( /usr/local/lib64 /usr/lib /usr/lib64 + /usr/lib/x86_64-linux-gnu + /usr/lib/gcc/alpha-linux-gnu + /usr/lib/gcc/aarch64-linux-gnu + /usr/lib/gcc/arm-linux-gnueabi + /usr/lib/gcc/arm-linux-gnueabihf + /usr/lib/gcc/hppa-linux-gnu + /usr/lib/gcc/i686-gnu + /usr/lib/gcc/i686-linux-gnu + /usr/lib/gcc/x86_64-kfreebsd-gnu + /usr/lib/gcc/i686-kfreebsd-gnu + /usr/lib/gcc/m68k-linux-gnu + /usr/lib/gcc/mips-linux-gnu + /usr/lib/gcc/mips64el-linux-gnuabi64 + /usr/lib/gcc/mipsel-linux-gnu + /usr/lib/gcc/powerpc-linux-gnu + /usr/lib/gcc/powerpc-linux-gnuspe + /usr/lib/gcc/powerpc64-linux-gnu + /usr/lib/gcc/powerpc64le-linux-gnu + /usr/lib/gcc/s390x-linux-gnu + /usr/lib/gcc/sparc64-linux-gnu + /usr/lib/gcc/x86_64-linux-gnux32 + /usr/lib/gcc/sh4-linux-gnu ) INCLUDE(FindPackageHandleStandardArgs) From bce730f68da4c93d05a26aceed409e23d8acedb1 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 14 Apr 2018 16:12:21 +0200 Subject: [PATCH 34/82] Improve finding of gnuradio-iio and libiio libraries --- cmake/Modules/Findiio.cmake | 42 +++++++++++++++++----------------- cmake/Modules/Findlibiio.cmake | 42 +++++++++++++++++----------------- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/cmake/Modules/Findiio.cmake b/cmake/Modules/Findiio.cmake index a1d526ae5..fc7af0d45 100644 --- a/cmake/Modules/Findiio.cmake +++ b/cmake/Modules/Findiio.cmake @@ -23,27 +23,27 @@ FIND_LIBRARY( /usr/lib /usr/lib64 /usr/lib/x86_64-linux-gnu - /usr/lib/gcc/alpha-linux-gnu - /usr/lib/gcc/aarch64-linux-gnu - /usr/lib/gcc/arm-linux-gnueabi - /usr/lib/gcc/arm-linux-gnueabihf - /usr/lib/gcc/hppa-linux-gnu - /usr/lib/gcc/i686-gnu - /usr/lib/gcc/i686-linux-gnu - /usr/lib/gcc/x86_64-kfreebsd-gnu - /usr/lib/gcc/i686-kfreebsd-gnu - /usr/lib/gcc/m68k-linux-gnu - /usr/lib/gcc/mips-linux-gnu - /usr/lib/gcc/mips64el-linux-gnuabi64 - /usr/lib/gcc/mipsel-linux-gnu - /usr/lib/gcc/powerpc-linux-gnu - /usr/lib/gcc/powerpc-linux-gnuspe - /usr/lib/gcc/powerpc64-linux-gnu - /usr/lib/gcc/powerpc64le-linux-gnu - /usr/lib/gcc/s390x-linux-gnu - /usr/lib/gcc/sparc64-linux-gnu - /usr/lib/gcc/x86_64-linux-gnux32 - /usr/lib/gcc/sh4-linux-gnu + /usr/lib/alpha-linux-gnu + /usr/lib/aarch64-linux-gnu + /usr/lib/arm-linux-gnueabi + /usr/lib/arm-linux-gnueabihf + /usr/lib/hppa-linux-gnu + /usr/lib/i686-gnu + /usr/lib/i686-linux-gnu + /usr/lib/x86_64-kfreebsd-gnu + /usr/lib/i686-kfreebsd-gnu + /usr/lib/m68k-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/mipsel-linux-gnu + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc-linux-gnuspe + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib/sparc64-linux-gnu + /usr/lib/x86_64-linux-gnux32 + /usr/lib/sh4-linux-gnu ) INCLUDE(FindPackageHandleStandardArgs) diff --git a/cmake/Modules/Findlibiio.cmake b/cmake/Modules/Findlibiio.cmake index 4ce6ca9c5..22eccf4b2 100644 --- a/cmake/Modules/Findlibiio.cmake +++ b/cmake/Modules/Findlibiio.cmake @@ -24,27 +24,27 @@ FIND_LIBRARY( /usr/lib /usr/lib64 /usr/lib/x86_64-linux-gnu - /usr/lib/gcc/alpha-linux-gnu - /usr/lib/gcc/aarch64-linux-gnu - /usr/lib/gcc/arm-linux-gnueabi - /usr/lib/gcc/arm-linux-gnueabihf - /usr/lib/gcc/hppa-linux-gnu - /usr/lib/gcc/i686-gnu - /usr/lib/gcc/i686-linux-gnu - /usr/lib/gcc/x86_64-kfreebsd-gnu - /usr/lib/gcc/i686-kfreebsd-gnu - /usr/lib/gcc/m68k-linux-gnu - /usr/lib/gcc/mips-linux-gnu - /usr/lib/gcc/mips64el-linux-gnuabi64 - /usr/lib/gcc/mipsel-linux-gnu - /usr/lib/gcc/powerpc-linux-gnu - /usr/lib/gcc/powerpc-linux-gnuspe - /usr/lib/gcc/powerpc64-linux-gnu - /usr/lib/gcc/powerpc64le-linux-gnu - /usr/lib/gcc/s390x-linux-gnu - /usr/lib/gcc/sparc64-linux-gnu - /usr/lib/gcc/x86_64-linux-gnux32 - /usr/lib/gcc/sh4-linux-gnu + /usr/lib/alpha-linux-gnu + /usr/lib/aarch64-linux-gnu + /usr/lib/arm-linux-gnueabi + /usr/lib/arm-linux-gnueabihf + /usr/lib/hppa-linux-gnu + /usr/lib/i686-gnu + /usr/lib/i686-linux-gnu + /usr/lib/x86_64-kfreebsd-gnu + /usr/lib/i686-kfreebsd-gnu + /usr/lib/m68k-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/mipsel-linux-gnu + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc-linux-gnuspe + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib/sparc64-linux-gnu + /usr/lib/x86_64-linux-gnux32 + /usr/lib/sh4-linux-gnu /Library/Frameworks/iio.framework/ ) From ddb7a6f3e0eb7d9cff863ae5d12f85e433d57621 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 14 Apr 2018 17:54:36 +0200 Subject: [PATCH 35/82] Fix detection of libiio package --- cmake/Modules/Findlibiio.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Modules/Findlibiio.cmake b/cmake/Modules/Findlibiio.cmake index 22eccf4b2..c3fa42366 100644 --- a/cmake/Modules/Findlibiio.cmake +++ b/cmake/Modules/Findlibiio.cmake @@ -14,7 +14,7 @@ FIND_PATH( FIND_LIBRARY( LIBIIO_LIBRARIES - NAMES libiio.so iio + NAMES iio libiio.so.0 HINTS $ENV{LIBIIO_DIR}/lib ${PC_LIBIIO_LIBDIR} PATHS ${CMAKE_INSTALL_PREFIX}/lib From 6740ac42c82c1709d38d28f040367c609304bd6a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 14 Apr 2018 18:16:38 +0200 Subject: [PATCH 36/82] Fix detection of libiio-dev package --- cmake/Modules/Findlibiio.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Modules/Findlibiio.cmake b/cmake/Modules/Findlibiio.cmake index c3fa42366..334dcf8d7 100644 --- a/cmake/Modules/Findlibiio.cmake +++ b/cmake/Modules/Findlibiio.cmake @@ -3,7 +3,7 @@ PKG_CHECK_MODULES(PC_LIBIIO libiio) FIND_PATH( LIBIIO_INCLUDE_DIRS - NAMES gnuradio/iio/api.h + NAMES iio.h HINTS $ENV{LIBIIO_DIR}/include ${PC_LIBIIO_INCLUDEDIR} PATHS ${CMAKE_INSTALL_PREFIX}/include From 4db5f9165f4fcc002c99657a2eb7689b21ed4837 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 18 Apr 2018 11:18:58 +0200 Subject: [PATCH 37/82] Fix bug counting channels when using Gal E5a configurations --- src/core/receiver/gnss_flowgraph.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index eec75d2f0..adda1183d 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -556,10 +556,9 @@ void GNSSFlowgraph::set_signals_list() */ unsigned int total_channels = configuration_->property("Channels_1C.count", 0) + - configuration_->property("Channels_2S.count", 0) + configuration_->property("Channels_1B.count", 0) + - configuration_->property("Channels_5X.count", 0) + configuration_->property("Channels_1G.count", 0) + + configuration_->property("Channels_2S.count", 0) + configuration_->property("Channels_2G.count", 0) + configuration_->property("Channels_5X.count", 0) + configuration_->property("Channels_L5.count", 0); From 6a3770c7629e2cd92f9d3694ec7262e0453e5ece Mon Sep 17 00:00:00 2001 From: mmajoral Date: Thu, 19 Apr 2018 12:09:08 +0200 Subject: [PATCH 38/82] - set output vectors is only done in the class constructor, no need to do it continuously - no need to multiply by two the results of the multicorrelator HW accelerators --- .../gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.cc | 3 ++- src/algorithms/tracking/libs/fpga_multicorrelator_8sc.cc | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.cc index 7f8a4233b..069b426db 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.cc @@ -172,6 +172,8 @@ Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc::Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc( d_carrier_phase_step_rad = 0.0; set_relative_rate(1.0 / static_cast(d_vector_length)); + + multicorrelator_fpga_8sc->set_output_vectors(d_correlator_outs); } void Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc::start_tracking() @@ -320,7 +322,6 @@ int Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc::general_work (int noutput_items __attrib // ################# CARRIER WIPEOFF AND CORRELATORS ############################## // perform carrier wipe-off and compute Early, Prompt and Late correlation - multicorrelator_fpga_8sc->set_output_vectors(d_correlator_outs); multicorrelator_fpga_8sc->Carrier_wipeoff_multicorrelator_resampler( d_rem_carr_phase_rad, d_carrier_phase_step_rad, d_rem_code_phase_chips, d_code_phase_step_chips, diff --git a/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.cc b/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.cc index dba1da094..9c9e6af0b 100644 --- a/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.cc +++ b/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.cc @@ -403,14 +403,12 @@ void fpga_multicorrelator_8sc::read_tracking_gps_results(void) { readval_real = -2097152 + readval_real; } - readval_real = readval_real * 2; // the results are shifted two bits to the left due to the complex multiplier in the FPGA readval_imag = d_map_base[1 + d_n_correlators + k]; if (readval_imag >= 1048576) // 0x100000 (21 bits two's complement) { readval_imag = -2097152 + readval_imag; } - readval_imag = readval_imag * 2; // the results are shifted two bits to the left due to the complex multiplier in the FPGA d_corr_out[k] = gr_complex(readval_real,readval_imag); } } From 514fde256aa9a7b57131a864a8bf373c5fa20d13 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 20 Apr 2018 12:50:32 +0200 Subject: [PATCH 39/82] Fix assignment of a channel to a given satellite with ChannelN.satellite=PRN --- src/core/receiver/gnss_flowgraph.cc | 158 ++++++++++++++-------------- 1 file changed, 81 insertions(+), 77 deletions(-) diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index adda1183d..255cb7609 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -9,7 +9,7 @@ * * ------------------------------------------------------------------------- * - * Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors) + * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) * * GNSS-SDR is a software defined Global Navigation * Satellite Systems receiver @@ -61,6 +61,8 @@ GNSSFlowgraph::GNSSFlowgraph(std::shared_ptr configurati GNSSFlowgraph::~GNSSFlowgraph() {} + + void GNSSFlowgraph::start() { if (running_) @@ -93,10 +95,9 @@ void GNSSFlowgraph::stop() void GNSSFlowgraph::connect() { - /* Connects the blocks in the flowgraph - * - * Signal Source > Signal conditioner >> Channels >> Observables >> PVT - */ + // Connects the blocks in the flowgraph + // Signal Source > Signal conditioner >> Channels >> Observables >> PVT + LOG(INFO) << "Connecting flowgraph"; if (connected_) { @@ -184,8 +185,8 @@ void GNSSFlowgraph::connect() { try { - //TODO: Remove this array implementation and create generic multistream connector - //(if a signal source has more than 1 stream, then connect it to the multistream signal conditioner) + // TODO: Remove this array implementation and create generic multistream connector + // (if a signal source has more than 1 stream, then connect it to the multistream signal conditioner) if (sig_source_.at(i)->implementation().compare("Raw_Array_Signal_Source") == 0) { //Multichannel Array @@ -198,14 +199,14 @@ void GNSSFlowgraph::connect() } else { - //TODO: Create a class interface for SignalSources, derived from GNSSBlockInterface. - //Include GetRFChannels in the interface to avoid read config parameters here - //read the number of RF channels for each front-end + // TODO: Create a class interface for SignalSources, derived from GNSSBlockInterface. + // Include GetRFChannels in the interface to avoid read config parameters here + // read the number of RF channels for each front-end RF_Channels = configuration_->property(sig_source_.at(i)->role() + ".RF_channels", 1); for (int j = 0; j < RF_Channels; j++) { - //Connect the multichannel signal source to multiple signal conditioners + // Connect the multichannel signal source to multiple signal conditioners // GNURADIO max_streams=-1 means infinite ports! LOG(INFO) << "sig_source_.at(i)->get_right_block()->output_signature()->max_streams()=" << sig_source_.at(i)->get_right_block()->output_signature()->max_streams(); LOG(INFO) << "sig_conditioner_.at(signal_conditioner_ID)->get_left_block()->input_signature()=" << sig_conditioner_.at(signal_conditioner_ID)->get_left_block()->input_signature()->max_streams(); @@ -244,8 +245,8 @@ void GNSSFlowgraph::connect() } DLOG(INFO) << "Signal source connected to signal conditioner"; - //connect the signal source to sample counter - //connect the sample counter to Observables + // connect the signal source to sample counter + // connect the sample counter to Observables try { double fs = static_cast(configuration_->property("GNSS-SDR.internal_fs_sps", 0)); @@ -267,7 +268,6 @@ void GNSSFlowgraph::connect() return; } - // Signal conditioner (selected_signal_source) >> channels (i) (dependent of their associated SignalSource_ID) int selected_signal_conditioner_ID; for (unsigned int i = 0; i < channels_count_; i++) @@ -301,26 +301,46 @@ void GNSSFlowgraph::connect() top_block_->disconnect_all(); return; } + } - std::string gnss_signal = channels_.at(i)->get_signal().get_signal_str(); // use channel's implicit signal! - channels_.at(i)->set_signal(search_next_signal(gnss_signal, false)); - - if (channels_state_[i] == 1) + // Put channels fixed to a given satellite at the beginning of the vector, then the rest + std::vector vector_of_channels; + for (unsigned int i = 0; i < channels_count_; i++) + { + unsigned int sat = configuration_->property("Channel" + boost::lexical_cast(i) + ".satellite", 0); + if (sat == 0) { - channels_.at(i)->start_acquisition(); - available_GNSS_signals_.pop_front(); - LOG(INFO) << "Channel " << i << " assigned to " << channels_.at(i)->get_signal(); - LOG(INFO) << "Channel " << i << " connected to observables and ready for acquisition"; + vector_of_channels.push_back(i); } else { - LOG(INFO) << "Channel " << i << " connected to observables in standby mode"; + auto it = vector_of_channels.begin(); + it = vector_of_channels.insert(it, i); } } - /* - * Connect the observables output of each channel to the PVT block - */ + // Assign satellites to channels in the initialization + for (unsigned int& i : vector_of_channels) + { + std::string gnss_signal = channels_.at(i)->get_signal().get_signal_str(); // use channel's implicit signal + unsigned int sat = configuration_->property("Channel" + boost::lexical_cast(i) + ".satellite", 0); + if (sat == 0) + { + channels_.at(i)->set_signal(search_next_signal(gnss_signal, true)); + } + else + { + std::string gnss_system; + if ((gnss_signal.compare("1C") == 0) or (gnss_signal.compare("2S") == 0) or (gnss_signal.compare("L5") == 0)) gnss_system = "GPS"; + if ((gnss_signal.compare("1B") == 0) or (gnss_signal.compare("5X") == 0)) gnss_system = "Galileo"; + if ((gnss_signal.compare("1G") == 0) or (gnss_signal.compare("2G") == 0)) gnss_system = "Glonass"; + Gnss_Signal signal_value = Gnss_Signal(Gnss_Satellite(gnss_system, sat), gnss_signal); + available_GNSS_signals_.remove(signal_value); + channels_.at(i)->set_signal(signal_value); + } + } + + // Connect the observables output of each channel to the PVT block try { for (unsigned int i = 0; i < channels_count_; i++) @@ -337,6 +357,21 @@ void GNSSFlowgraph::connect() return; } + // Activate acquisition in enabled channels + for (unsigned int i = 0; i < channels_count_; i++) + { + LOG(INFO) << "Channel " << i << " assigned to " << channels_.at(i)->get_signal(); + if (channels_state_[i] == 1) + { + channels_.at(i)->start_acquisition(); + LOG(INFO) << "Channel " << i << " connected to observables and ready for acquisition"; + } + else + { + LOG(INFO) << "Channel " << i << " connected to observables in standby mode"; + } + } + connected_ = true; LOG(INFO) << "Flowgraph connected"; top_block_->dump(); @@ -374,12 +409,16 @@ bool GNSSFlowgraph::send_telemetry_msg(pmt::pmt_t msg) void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) { DLOG(INFO) << "Received " << what << " from " << who << ". Number of applied actions = " << applied_actions_; + unsigned int sat = configuration_->property("Channel" + boost::lexical_cast(who) + ".satellite", 0); switch (what) { case 0: DLOG(INFO) << "Channel " << who << " ACQ FAILED satellite " << channels_.at(who)->get_signal().get_satellite() << ", Signal " << channels_.at(who)->get_signal().get_signal_str(); - available_GNSS_signals_.push_back(channels_.at(who)->get_signal()); - channels_.at(who)->set_signal(search_next_signal(channels_.at(who)->get_signal().get_signal_str(), true)); + if (sat == 0) + { + available_GNSS_signals_.push_back(channels_.at(who)->get_signal()); + channels_.at(who)->set_signal(search_next_signal(channels_.at(who)->get_signal().get_signal_str(), true)); + } DLOG(INFO) << "Channel " << who << " Starting acquisition " << channels_.at(who)->get_signal().get_satellite() << ", Signal " << channels_.at(who)->get_signal().get_signal_str(); channels_.at(who)->start_acquisition(); break; @@ -390,10 +429,14 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) acq_channels_count_--; for (unsigned int i = 0; i < channels_count_; i++) { + unsigned int sat_ = configuration_->property("Channel" + boost::lexical_cast(i) + ".satellite", 0); if (!available_GNSS_signals_.empty() && (acq_channels_count_ < max_acq_channels_) && (channels_state_[i] == 0)) { channels_state_[i] = 1; - channels_.at(i)->set_signal(search_next_signal(channels_.at(i)->get_signal().get_signal_str(), true)); + if (sat_ == 0) + { + channels_.at(i)->set_signal(search_next_signal(channels_.at(i)->get_signal().get_signal_str(), true)); + } acq_channels_count_++; DLOG(INFO) << "Channel " << i << " Starting acquisition " << channels_.at(i)->get_signal().get_satellite() << ", Signal " << channels_.at(i)->get_signal().get_signal_str(); channels_.at(i)->start_acquisition(); @@ -417,7 +460,10 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) { channels_state_[who] = 0; LOG(INFO) << "Channel " << who << " Idle state"; - available_GNSS_signals_.push_back(channels_.at(who)->get_signal()); + if (sat == 0) + { + available_GNSS_signals_.push_back(channels_.at(who)->get_signal()); + } } break; @@ -436,7 +482,6 @@ void GNSSFlowgraph::set_configuration(std::shared_ptr co LOG(WARNING) << "Unable to update configuration while flowgraph running"; return; } - if (connected_) { LOG(WARNING) << "Unable to update configuration while flowgraph connected"; @@ -541,20 +586,10 @@ void GNSSFlowgraph::init() void GNSSFlowgraph::set_signals_list() { - /* - * Sets a sequential list of GNSS satellites - */ + // Set a sequential list of GNSS satellites std::set::const_iterator available_gnss_prn_iter; - /* - * \TODO Describe GNSS satellites more nicely, with RINEX notation - * See http://igscb.jpl.nasa.gov/igscb/data/format/rinex301.pdf (page 5) - */ - - /* - * Read GNSS-SDR default GNSS system and signal - */ - + // Read GNSS systems and signals unsigned int total_channels = configuration_->property("Channels_1C.count", 0) + configuration_->property("Channels_1B.count", 0) + configuration_->property("Channels_1G.count", 0) + @@ -563,11 +598,7 @@ void GNSSFlowgraph::set_signals_list() configuration_->property("Channels_5X.count", 0) + configuration_->property("Channels_L5.count", 0); - /* - * Loop to create the list of GNSS Signals - * To add signals from other systems, add another loop 'for' - */ - + // Create the lists of GNSS satellites std::set available_gps_prn = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32}; @@ -689,6 +720,7 @@ void GNSSFlowgraph::set_signals_list() std::string("L5"))); } } + if (configuration_->property("Channels_SBAS.count", 0) > 0) { /* @@ -704,7 +736,6 @@ void GNSSFlowgraph::set_signals_list() } } - if (configuration_->property("Channels_1B.count", 0) > 0) { /* @@ -764,39 +795,12 @@ void GNSSFlowgraph::set_signals_list() std::string("2G"))); } } - /* - * Ordering the list of signals from configuration file - */ - std::list::iterator gnss_it = available_GNSS_signals_.begin(); - - // Pre-assignation if not defined at ChannelX.signal=1C ...? In what order? - - for (unsigned int i = 0; i < total_channels; i++) - { - std::string gnss_signal = (configuration_->property("Channel" + boost::lexical_cast(i) + ".signal", std::string("1C"))); - std::string gnss_system; - if ((gnss_signal.compare("1C") == 0) or (gnss_signal.compare("2S") == 0) or (gnss_signal.compare("L5") == 0)) gnss_system = "GPS"; - if ((gnss_signal.compare("1B") == 0) or (gnss_signal.compare("5X") == 0)) gnss_system = "Galileo"; - if ((gnss_signal.compare("1G") == 0) or (gnss_signal.compare("2G") == 0)) gnss_system = "Glonass"; - unsigned int sat = configuration_->property("Channel" + boost::lexical_cast(i) + ".satellite", 0); - LOG(INFO) << "Channel " << i << " system " << gnss_system << ", signal " << gnss_signal << ", sat " << sat; - if (sat == 0) // 0 = not PRN in configuration file - { - gnss_it++; - } - else - { - Gnss_Signal signal_value = Gnss_Signal(Gnss_Satellite(gnss_system, sat), gnss_signal); - available_GNSS_signals_.remove(signal_value); - gnss_it = available_GNSS_signals_.insert(gnss_it, signal_value); - } - } } void GNSSFlowgraph::set_channels_state() { - max_acq_channels_ = (configuration_->property("Channels.in_acquisition", channels_count_)); + max_acq_channels_ = configuration_->property("Channels.in_acquisition", channels_count_); if (max_acq_channels_ > channels_count_) { max_acq_channels_ = channels_count_; From b4cb0cc76bfb0b2249158c18babe1d810489044a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 20 Apr 2018 12:56:32 +0200 Subject: [PATCH 40/82] Improve wording --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7a87240cb..262feeb0c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -75,7 +75,7 @@ the actual username of your GitHub account): 4. Your forked repository https://github.com/YOUR_USERNAME/gnss-sdr will receive the default name of `origin`. You can also add the original -gnss-sdr repository, which is usually called `upstream`: +gnss-sdr repository, which is usually referred to as `upstream`: $ cd gnss-sdr $ git remote add upstream https://github.com/gnss-sdr/gnss-sdr.git From 2cd1bed90c8de81f40236d7739e16d3aa6e02963 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 20 Apr 2018 13:20:10 +0200 Subject: [PATCH 41/82] Fix headers and documentation --- src/core/receiver/gnss_flowgraph.cc | 25 +++++++++++-------------- src/core/receiver/gnss_flowgraph.h | 21 ++++++++++++--------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index 255cb7609..4df4c0727 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -1,12 +1,10 @@ /*! * \file gnss_flowgraph.cc - * \brief Implementation of a GNSS receiver flowgraph + * \brief Implementation of a GNSS receiver flow graph * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * Luis Esteve, 2012. luis(at)epsilon-formacion.com * Carles Fernandez-Prades, 2014. cfernandez(at)cttc.es * - * Detailed description of the file here if needed. - * * ------------------------------------------------------------------------- * * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) @@ -95,7 +93,7 @@ void GNSSFlowgraph::stop() void GNSSFlowgraph::connect() { - // Connects the blocks in the flowgraph + // Connects the blocks in the flow graph // Signal Source > Signal conditioner >> Channels >> Observables >> PVT LOG(INFO) << "Connecting flowgraph"; @@ -401,7 +399,7 @@ bool GNSSFlowgraph::send_telemetry_msg(pmt::pmt_t msg) /* - * Applies an action to the flowgraph + * Applies an action to the flow graph * * \param[in] who Who generated the action * \param[in] what What is the action 0: acquisition failed @@ -509,9 +507,9 @@ void GNSSFlowgraph::init() { std::cout << "Creating source " << i << std::endl; sig_source_.push_back(block_factory_->GetSignalSource(configuration_, queue_, i)); - //TODO: Create a class interface for SignalSources, derived from GNSSBlockInterface. - //Include GetRFChannels in the interface to avoid read config parameters here - //read the number of RF channels for each front-end + // TODO: Create a class interface for SignalSources, derived from GNSSBlockInterface. + // Include GetRFChannels in the interface to avoid read config parameters here + // read the number of RF channels for each front-end RF_Channels = configuration_->property(sig_source_.at(i)->role() + ".RF_channels", 1); std::cout << "RF Channels " << RF_Channels << std::endl; for (int j = 0; j < RF_Channels; j++) @@ -523,11 +521,11 @@ void GNSSFlowgraph::init() } else { - //backwards compatibility for old config files + // backwards compatibility for old config files sig_source_.push_back(block_factory_->GetSignalSource(configuration_, queue_, -1)); - //TODO: Create a class interface for SignalSources, derived from GNSSBlockInterface. - //Include GetRFChannels in the interface to avoid read config parameters here - //read the number of RF channels for each front-end + // TODO: Create a class interface for SignalSources, derived from GNSSBlockInterface. + // Include GetRFChannels in the interface to avoid read config parameters here + // read the number of RF channels for each front-end RF_Channels = configuration_->property(sig_source_.at(0)->role() + ".RF_channels", 0); if (RF_Channels != 0) { @@ -539,7 +537,7 @@ void GNSSFlowgraph::init() } else { - //old config file, single signal source and single channel, not specified + // old config file, single signal source and single channel, not specified sig_conditioner_.push_back(block_factory_->GetSignalConditioner(configuration_, -1)); } } @@ -566,7 +564,6 @@ void GNSSFlowgraph::init() std::shared_ptr>> channels = block_factory_->GetChannels(configuration_, queue_); - //todo:check smart pointer coherence... channels_count_ = channels->size(); for (unsigned int i = 0; i < channels_count_; i++) { diff --git a/src/core/receiver/gnss_flowgraph.h b/src/core/receiver/gnss_flowgraph.h index 7f8891f29..df041c8e8 100644 --- a/src/core/receiver/gnss_flowgraph.h +++ b/src/core/receiver/gnss_flowgraph.h @@ -1,12 +1,12 @@ /*! * \file gnss_flowgraph.h - * \brief Interface of a GNSS receiver flowgraph. + * \brief Interface of a GNSS receiver flow graph. * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * Luis Esteve, 2011. luis(at)epsilon-formacion.com * Carles Fernandez-Prades, 2014. cfernandez(at)cttc.es * * It contains a signal source, - * a signal conditioner, a set of channels, a pvt and an output filter. + * a signal conditioner, a set of channels, an observables block and a pvt. * * ------------------------------------------------------------------------- * @@ -53,7 +53,7 @@ class ChannelInterface; class ConfigurationInterface; class GNSSBlockFactory; -/*! \brief This class represents a GNSS flowgraph. +/*! \brief This class represents a GNSS flow graph. * * It contains a signal source, * a signal conditioner, a set of channels, a PVT and an output filter. @@ -62,7 +62,7 @@ class GNSSFlowgraph { public: /*! - * \brief Constructor that initializes the receiver flowgraph + * \brief Constructor that initializes the receiver flow graph */ GNSSFlowgraph(std::shared_ptr configuration, gr::msg_queue::sptr queue); @@ -71,14 +71,14 @@ public: */ virtual ~GNSSFlowgraph(); - //! \brief Start the flowgraph + //! \brief Start the flow graph void start(); - //! \brief Stop the flowgraph + //! \brief Stop the flow graph void stop(); /*! - * \brief Connects the defined blocks in the flowgraph + * \brief Connects the defined blocks in the flow graph * * Signal Source > Signal conditioner > Channels >> Observables >> PVT > Output filter */ @@ -87,10 +87,10 @@ public: void wait(); /*! - * \brief Applies an action to the flowgraph + * \brief Applies an action to the flow graph * * \param[in] who Who generated the action - * \param[in] what What is the action 0: acquisition failed + * \param[in] what What is the action. 0: acquisition failed; 1: acquisition success; 2: tracking lost */ void apply_action(unsigned int who, unsigned int what); @@ -100,14 +100,17 @@ public: { return applied_actions_; } + bool connected() { return connected_; } + bool running() { return running_; } + /*! * \brief Sends a GNURadio asynchronous message from telemetry to PVT * From a584e8e51dfcba0a433820cf762ec2d462a7bca3 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 22 Apr 2018 19:49:13 +0200 Subject: [PATCH 42/82] Add mutex to protect list of available signals Disconnect the flowgraph when leaving --- src/core/receiver/gnss_flowgraph.cc | 214 ++++++++++++++++++++++++++-- src/core/receiver/gnss_flowgraph.h | 8 +- 2 files changed, 206 insertions(+), 16 deletions(-) diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index 4df4c0727..3303d15b6 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -58,7 +58,13 @@ GNSSFlowgraph::GNSSFlowgraph(std::shared_ptr configurati } -GNSSFlowgraph::~GNSSFlowgraph() {} +GNSSFlowgraph::~GNSSFlowgraph() +{ + if (connected_) + { + GNSSFlowgraph::disconnect(); + } +} void GNSSFlowgraph::start() @@ -376,6 +382,183 @@ void GNSSFlowgraph::connect() } +void GNSSFlowgraph::disconnect() +{ + LOG(INFO) << "Disconnecting flowgraph"; + + if (!connected_) + { + LOG(INFO) << "flowgraph was not connected"; + return; + } + + // Signal Source (i) > Signal conditioner (i) > + int RF_Channels = 0; + int signal_conditioner_ID = 0; + + for (int i = 0; i < sources_count_; i++) + { + try + { + // TODO: Remove this array implementation and create generic multistream connector + // (if a signal source has more than 1 stream, then connect it to the multistream signal conditioner) + if (sig_source_.at(i)->implementation().compare("Raw_Array_Signal_Source") == 0) + { + //Multichannel Array + for (int j = 0; j < GNSS_SDR_ARRAY_SIGNAL_CONDITIONER_CHANNELS; j++) + { + top_block_->disconnect(sig_source_.at(i)->get_right_block(), j, sig_conditioner_.at(i)->get_left_block(), j); + } + } + else + { + // TODO: Create a class interface for SignalSources, derived from GNSSBlockInterface. + // Include GetRFChannels in the interface to avoid read config parameters here + // read the number of RF channels for each front-end + RF_Channels = configuration_->property(sig_source_.at(i)->role() + ".RF_channels", 1); + + for (int j = 0; j < RF_Channels; j++) + { + if (sig_source_.at(i)->get_right_block()->output_signature()->max_streams() > 1) + { + top_block_->disconnect(sig_source_.at(i)->get_right_block(), j, sig_conditioner_.at(signal_conditioner_ID)->get_left_block(), 0); + } + else + { + if (j == 0) + { + // RF_channel 0 backward compatibility with single channel sources + top_block_->disconnect(sig_source_.at(i)->get_right_block(), 0, sig_conditioner_.at(signal_conditioner_ID)->get_left_block(), 0); + } + else + { + // Multiple channel sources using multiple output blocks of single channel (requires RF_channel selector in call) + top_block_->disconnect(sig_source_.at(i)->get_right_block(j), 0, sig_conditioner_.at(signal_conditioner_ID)->get_left_block(), 0); + } + } + signal_conditioner_ID++; + } + } + } + catch (const std::exception& e) + { + LOG(INFO) << "Can't disconnect signal source " << i << " to signal conditioner " << i << ": " << e.what(); + } + } + + try + { + top_block_->disconnect(sig_conditioner_.at(0)->get_right_block(), 0, ch_out_sample_counter, 0); + top_block_->disconnect(ch_out_sample_counter, 0, observables_->get_left_block(), channels_count_); //extra port for the sample counter pulse + } + catch (const std::exception& e) + { + LOG(INFO) << "Can't disconnect sample counter: " << e.what(); + } + + // Signal conditioner (selected_signal_source) >> channels (i) (dependent of their associated SignalSource_ID) + int selected_signal_conditioner_ID; + for (unsigned int i = 0; i < channels_count_; i++) + { + selected_signal_conditioner_ID = configuration_->property("Channel" + boost::lexical_cast(i) + ".RF_channel_ID", 0); + try + { + top_block_->disconnect(sig_conditioner_.at(selected_signal_conditioner_ID)->get_right_block(), 0, + channels_.at(i)->get_left_block(), 0); + } + catch (const std::exception& e) + { + LOG(INFO) << "Can't disconnect signal conditioner " << selected_signal_conditioner_ID << " to channel " << i << ": " << e.what(); + } + + // Signal Source > Signal conditioner >> Channels >> Observables + try + { + top_block_->disconnect(channels_.at(i)->get_right_block(), 0, + observables_->get_left_block(), i); + } + catch (const std::exception& e) + { + LOG(INFO) << "Can't disconnect channel " << i << " to observables: " << e.what(); + } + } + + try + { + for (unsigned int i = 0; i < channels_count_; i++) + { + top_block_->disconnect(observables_->get_right_block(), i, pvt_->get_left_block(), i); + top_block_->msg_disconnect(channels_.at(i)->get_right_block(), pmt::mp("telemetry"), pvt_->get_left_block(), pmt::mp("telemetry")); + } + } + catch (const std::exception& e) + { + LOG(INFO) << "Can't disconnect observables to PVT: " << e.what(); + } + + for (int i = 0; i < sources_count_; i++) + { + try + { + sig_source_.at(i)->disconnect(top_block_); + } + catch (const std::exception& e) + { + LOG(INFO) << "Can't disconnect signal source block " << i << " internally: " << e.what(); + } + } + + // Signal Source > Signal conditioner > + for (unsigned int i = 0; i < sig_conditioner_.size(); i++) + { + try + { + sig_conditioner_.at(i)->disconnect(top_block_); + } + catch (const std::exception& e) + { + LOG(INFO) << "Can't disconnect signal conditioner block " << i << " internally: " << e.what(); + } + } + + for (unsigned int i = 0; i < channels_count_; i++) + { + try + { + channels_.at(i)->disconnect(top_block_); + } + catch (const std::exception& e) + { + LOG(INFO) << "Can't disconnect channel " << i << " internally: " << e.what(); + } + } + + try + { + observables_->disconnect(top_block_); + } + catch (const std::exception& e) + { + LOG(INFO) << "Can't disconnect observables block internally: " << e.what(); + } + + // Signal Source > Signal conditioner >> Channels >> Observables > PVT + try + { + pvt_->disconnect(top_block_); + } + catch (const std::exception& e) + { + LOG(INFO) << "Can't disconnect PVT block internally: " << e.what(); + } + + DLOG(INFO) << "blocks disconnected internally"; + + connected_ = false; + LOG(INFO) << "Flowgraph disconnected"; +} + + void GNSSFlowgraph::wait() { if (!running_) @@ -411,18 +594,19 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) switch (what) { case 0: - DLOG(INFO) << "Channel " << who << " ACQ FAILED satellite " << channels_.at(who)->get_signal().get_satellite() << ", Signal " << channels_.at(who)->get_signal().get_signal_str(); + DLOG(INFO) << "Channel " << who << " ACQ FAILED satellite " << channels_[who]->get_signal().get_satellite() << ", Signal " << channels_[who]->get_signal().get_signal_str(); if (sat == 0) { - available_GNSS_signals_.push_back(channels_.at(who)->get_signal()); - channels_.at(who)->set_signal(search_next_signal(channels_.at(who)->get_signal().get_signal_str(), true)); + std::lock_guard lock(signal_list_mutex); + available_GNSS_signals_.push_back(channels_[who]->get_signal()); + channels_[who]->set_signal(search_next_signal(channels_[who]->get_signal().get_signal_str(), true)); } - DLOG(INFO) << "Channel " << who << " Starting acquisition " << channels_.at(who)->get_signal().get_satellite() << ", Signal " << channels_.at(who)->get_signal().get_signal_str(); - channels_.at(who)->start_acquisition(); + DLOG(INFO) << "Channel " << who << " Starting acquisition " << channels_[who]->get_signal().get_satellite() << ", Signal " << channels_[who]->get_signal().get_signal_str(); + channels_[who]->start_acquisition(); break; case 1: - LOG(INFO) << "Channel " << who << " ACQ SUCCESS satellite " << channels_.at(who)->get_signal().get_satellite(); + LOG(INFO) << "Channel " << who << " ACQ SUCCESS satellite " << channels_[who]->get_signal().get_satellite(); channels_state_[who] = 2; acq_channels_count_--; for (unsigned int i = 0; i < channels_count_; i++) @@ -433,26 +617,27 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) channels_state_[i] = 1; if (sat_ == 0) { - channels_.at(i)->set_signal(search_next_signal(channels_.at(i)->get_signal().get_signal_str(), true)); + std::lock_guard lock(signal_list_mutex); + channels_[i]->set_signal(search_next_signal(channels_[i]->get_signal().get_signal_str(), true)); } acq_channels_count_++; - DLOG(INFO) << "Channel " << i << " Starting acquisition " << channels_.at(i)->get_signal().get_satellite() << ", Signal " << channels_.at(i)->get_signal().get_signal_str(); - channels_.at(i)->start_acquisition(); + DLOG(INFO) << "Channel " << i << " Starting acquisition " << channels_[i]->get_signal().get_satellite() << ", Signal " << channels_[i]->get_signal().get_signal_str(); + channels_[i]->start_acquisition(); } DLOG(INFO) << "Channel " << i << " in state " << channels_state_[i]; } break; case 2: - LOG(INFO) << "Channel " << who << " TRK FAILED satellite " << channels_.at(who)->get_signal().get_satellite(); + LOG(INFO) << "Channel " << who << " TRK FAILED satellite " << channels_[who]->get_signal().get_satellite(); DLOG(INFO) << "Number of channels in acquisition = " << acq_channels_count_; if (acq_channels_count_ < max_acq_channels_) { channels_state_[who] = 1; acq_channels_count_++; - LOG(INFO) << "Channel " << who << " Starting acquisition " << channels_.at(who)->get_signal().get_satellite() << ", Signal " << channels_.at(who)->get_signal().get_signal_str(); - channels_.at(who)->start_acquisition(); + LOG(INFO) << "Channel " << who << " Starting acquisition " << channels_[who]->get_signal().get_satellite() << ", Signal " << channels_[who]->get_signal().get_signal_str(); + channels_[who]->start_acquisition(); } else { @@ -460,7 +645,8 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) LOG(INFO) << "Channel " << who << " Idle state"; if (sat == 0) { - available_GNSS_signals_.push_back(channels_.at(who)->get_signal()); + std::lock_guard lock(signal_list_mutex); + available_GNSS_signals_.push_back(channels_[who]->get_signal()); } } break; diff --git a/src/core/receiver/gnss_flowgraph.h b/src/core/receiver/gnss_flowgraph.h index df041c8e8..a6915e97e 100644 --- a/src/core/receiver/gnss_flowgraph.h +++ b/src/core/receiver/gnss_flowgraph.h @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -67,9 +68,9 @@ public: GNSSFlowgraph(std::shared_ptr configuration, gr::msg_queue::sptr queue); /*! - * \brief Virtual destructor + * \brief Destructor */ - virtual ~GNSSFlowgraph(); + ~GNSSFlowgraph(); //! \brief Start the flow graph void start(); @@ -84,6 +85,8 @@ public: */ void connect(); + void disconnect(); + void wait(); /*! @@ -147,6 +150,7 @@ private: gr::msg_queue::sptr queue_; std::list available_GNSS_signals_; std::vector channels_state_; + std::mutex signal_list_mutex; }; #endif /*GNSS_SDR_GNSS_FLOWGRAPH_H_*/ From bed15db08d4759c92e3582e6005f88385c47b5be Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 22 Apr 2018 22:51:02 +0200 Subject: [PATCH 43/82] Use volk_gnsssdr to reserve memory --- .../telemetry_decoder/gnuradio_blocks/CMakeLists.txt | 7 ++++++- .../gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc | 9 ++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt b/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt index 335ae52df..26dae1cdf 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt @@ -37,10 +37,15 @@ include_directories( ${GFlags_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${VOLK_GNSSSDR_INCLUDE_DIRS} ) file(GLOB TELEMETRY_DECODER_GR_BLOCKS_HEADERS "*.h") list(SORT TELEMETRY_DECODER_GR_BLOCKS_HEADERS) add_library(telemetry_decoder_gr_blocks ${TELEMETRY_DECODER_GR_BLOCKS_SOURCES} ${TELEMETRY_DECODER_GR_BLOCKS_HEADERS}) source_group(Headers FILES ${TELEMETRY_DECODER_GR_BLOCKS_HEADERS}) -target_link_libraries(telemetry_decoder_gr_blocks telemetry_decoder_libswiftcnav telemetry_decoder_lib gnss_system_parameters ${GNURADIO_RUNTIME_LIBRARIES}) +target_link_libraries(telemetry_decoder_gr_blocks telemetry_decoder_libswiftcnav telemetry_decoder_lib gnss_system_parameters ${GNURADIO_RUNTIME_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES}) + +if(NOT VOLK_GNSSSDR_FOUND) + add_dependencies(telemetry_decoder_gr_blocks volk_gnsssdr_module) +endif(NOT VOLK_GNSSSDR_FOUND) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc index 1070dca28..5c0071307 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc @@ -32,8 +32,9 @@ #include "gps_l1_ca_telemetry_decoder_cc.h" #include "control_message_factory.h" #include -#include #include +#include +#include #ifndef _rotl @@ -63,10 +64,8 @@ gps_l1_ca_telemetry_decoder_cc::gps_l1_ca_telemetry_decoder_cc( // set the preamble unsigned short int preambles_bits[GPS_CA_PREAMBLE_LENGTH_BITS] = GPS_PREAMBLE; - //memcpy((unsigned short int*)this->d_preambles_bits, (unsigned short int*)preambles_bits, GPS_CA_PREAMBLE_LENGTH_BITS*sizeof(unsigned short int)); - // preamble bits to sampled symbols - d_preambles_symbols = static_cast(malloc(sizeof(signed int) * GPS_CA_PREAMBLE_LENGTH_SYMBOLS)); + d_preambles_symbols = static_cast(volk_gnsssdr_malloc(GPS_CA_PREAMBLE_LENGTH_SYMBOLS * sizeof(int), volk_gnsssdr_get_alignment())); int n = 0; for (int i = 0; i < GPS_CA_PREAMBLE_LENGTH_BITS; i++) { @@ -112,7 +111,7 @@ gps_l1_ca_telemetry_decoder_cc::gps_l1_ca_telemetry_decoder_cc( gps_l1_ca_telemetry_decoder_cc::~gps_l1_ca_telemetry_decoder_cc() { - delete d_preambles_symbols; + volk_gnsssdr_free(d_preambles_symbols); if (d_dump_file.is_open() == true) { try From 9339ec4874af8c11644d874ca3531e2e7952a497 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 22 Apr 2018 22:53:33 +0200 Subject: [PATCH 44/82] Display channel number when decoding data --- .../gnuradio_blocks/gps_l2c_telemetry_decoder_cc.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.cc index f06d19b6f..c27214c52 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.cc @@ -166,20 +166,20 @@ int gps_l2c_telemetry_decoder_cc::general_work(int noutput_items __attribute__(( { // get ephemeris object for this SV std::shared_ptr tmp_obj = std::make_shared(d_CNAV_Message.get_ephemeris()); - std::cout << TEXT_BLUE << "New GPS CNAV message received: ephemeris from satellite " << d_satellite << TEXT_RESET << std::endl; + std::cout << TEXT_BLUE << "New GPS CNAV message received in channel " << d_channel << ": ephemeris from satellite " << d_satellite << TEXT_RESET << std::endl; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); } if (d_CNAV_Message.have_new_iono() == true) { std::shared_ptr tmp_obj = std::make_shared(d_CNAV_Message.get_iono()); - std::cout << TEXT_BLUE << "New GPS CNAV message received: iono model parameters from satellite " << d_satellite << TEXT_RESET << std::endl; + std::cout << TEXT_BLUE << "New GPS CNAV message received in channel " << d_channel << ": iono model parameters from satellite " << d_satellite << TEXT_RESET << std::endl; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); } if (d_CNAV_Message.have_new_utc_model() == true) { std::shared_ptr tmp_obj = std::make_shared(d_CNAV_Message.get_utc_model()); - std::cout << TEXT_BLUE << "New GPS CNAV message received: UTC model parameters from satellite " << d_satellite << TEXT_RESET << std::endl; + std::cout << TEXT_BLUE << "New GPS CNAV message received in channel " << d_channel << ": UTC model parameters from satellite " << d_satellite << TEXT_RESET << std::endl; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); } From 61fbbc9abb393422e5bd9dd6640ca6c639213c9e Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 22 Apr 2018 23:07:34 +0200 Subject: [PATCH 45/82] Add color to GPS L5 CNAV message demodulation --- .../gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc | 14 +++++++------- .../gnuradio_blocks/gps_l5_telemetry_decoder_cc.h | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc index 0793428fa..1f2a8decf 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc @@ -1,7 +1,6 @@ /*! * \file gps_l5_telemetry_decoder_cc.cc - * \brief Implementation of a NAV message demodulator block based on - * Kay Borre book MATLAB-based GPS receiver + * \brief Implementation of a CNAV message demodulator block * \author Antonio Ramos, 2017. antonio.ramos(at)cttc.es * * ------------------------------------------------------------------------- @@ -31,12 +30,13 @@ #include "gps_l5_telemetry_decoder_cc.h" +#include "display.h" #include "gnss_synchro.h" #include "gps_cnav_ephemeris.h" #include "gps_cnav_iono.h" -#include -#include #include +#include +#include #include #include #include @@ -218,20 +218,20 @@ int gps_l5_telemetry_decoder_cc::general_work(int noutput_items __attribute__((u { // get ephemeris object for this SV std::shared_ptr tmp_obj = std::make_shared(d_CNAV_Message.get_ephemeris()); - std::cout << "New GPS L5 CNAV message received: ephemeris from satellite " << d_satellite << std::endl; + std::cout << TEXT_MAGENTA << "New GPS L5 CNAV message received in channel " << d_channel << ": ephemeris from satellite " << d_satellite << TEXT_RESET << std::endl; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); } if (d_CNAV_Message.have_new_iono() == true) { std::shared_ptr tmp_obj = std::make_shared(d_CNAV_Message.get_iono()); - std::cout << "New GPS L5 CNAV message received: iono model parameters from satellite " << d_satellite << std::endl; + std::cout << TEXT_MAGENTA << "New GPS L5 CNAV message received in channel " << d_channel << ": iono model parameters from satellite " << d_satellite << TEXT_RESET << std::endl; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); } if (d_CNAV_Message.have_new_utc_model() == true) { std::shared_ptr tmp_obj = std::make_shared(d_CNAV_Message.get_utc_model()); - std::cout << "New GPS L5 CNAV message received: UTC model parameters from satellite " << d_satellite << std::endl; + std::cout << TEXT_MAGENTA << "New GPS L5 CNAV message received in channel " << d_channel << ": UTC model parameters from satellite " << d_satellite << TEXT_RESET << std::endl; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); } diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.h index 59f0bf108..8afa6569e 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.h @@ -1,7 +1,6 @@ /*! * \file gps_l5_telemetry_decoder_cc.h - * \brief Interface of a CNAV message demodulator block based on - * Kay Borre book MATLAB-based GPS receiver + * \brief Interface of a CNAV message demodulator block * \author Antonio Ramos, 2017. antonio.ramos(at)cttc.es * ------------------------------------------------------------------------- * @@ -42,7 +41,8 @@ #include #include -extern "C" { +extern "C" +{ #include "cnav_msg.h" #include "edc.h" #include "bits.h" From 616812867feb62df72dc66aa56f4161c4c1388e5 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 22 Apr 2018 23:10:05 +0200 Subject: [PATCH 46/82] Report channel when decoding a NAV message --- .../telemetry_decoder/libs/gps_l1_ca_subframe_fsm.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/algorithms/telemetry_decoder/libs/gps_l1_ca_subframe_fsm.cc b/src/algorithms/telemetry_decoder/libs/gps_l1_ca_subframe_fsm.cc index d4980a532..e7379f7e0 100644 --- a/src/algorithms/telemetry_decoder/libs/gps_l1_ca_subframe_fsm.cc +++ b/src/algorithms/telemetry_decoder/libs/gps_l1_ca_subframe_fsm.cc @@ -39,13 +39,16 @@ //************ GPS WORD TO SUBFRAME DECODER STATE MACHINE ********** - struct Ev_gps_word_valid : sc::event { }; + + struct Ev_gps_word_invalid : sc::event { }; + + struct Ev_gps_word_preamble : sc::event { }; @@ -245,16 +248,20 @@ void GpsL1CaSubframeFsm::gps_word_to_subframe(int position) std::memcpy(&d_subframe[position * GPS_WORD_LENGTH], &d_GPS_frame_4bytes, sizeof(char) * GPS_WORD_LENGTH); } + void GpsL1CaSubframeFsm::clear_flag_new_subframe() { d_flag_new_subframe = false; } + + void GpsL1CaSubframeFsm::gps_subframe_to_nav_msg() { //int subframe_ID; // NEW GPS SUBFRAME HAS ARRIVED! d_subframe_ID = d_nav.subframe_decoder(this->d_subframe); //decode the subframe - std::cout << "New GPS NAV message received: subframe " + std::cout << "New GPS NAV message received in channel " << i_channel_ID << ": " + << "subframe " << d_subframe_ID << " from satellite " << Gnss_Satellite(std::string("GPS"), i_satellite_PRN) << std::endl; d_nav.i_satellite_PRN = i_satellite_PRN; @@ -263,6 +270,7 @@ void GpsL1CaSubframeFsm::gps_subframe_to_nav_msg() d_flag_new_subframe = true; } + void GpsL1CaSubframeFsm::Event_gps_word_valid() { this->process_event(Ev_gps_word_valid()); From 6f9fafcef06a82ae70d707752f42438a4bfbe823 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 23 Apr 2018 07:41:13 +0200 Subject: [PATCH 47/82] Disconnect flowgraph when finished --- src/core/receiver/control_thread.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index db3e3841b..b2d1838f4 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -148,6 +148,7 @@ void ControlThread::run() std::cout << "Stopping GNSS-SDR, please wait!" << std::endl; flowgraph_->stop(); stop_ = true; + flowgraph_->disconnect(); //Join keyboard thread #ifdef OLD_BOOST From 3e0587b28c0551e86633056844cbff9ca19c67c1 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 23 Apr 2018 07:41:53 +0200 Subject: [PATCH 48/82] Display channel when decoding GNAV messages --- .../glonass_l2_ca_telemetry_decoder_cc.cc | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.cc index b446b6e7e..a57307850 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.cc @@ -31,9 +31,10 @@ #include "glonass_l2_ca_telemetry_decoder_cc.h" +#include "display.h" #include -#include #include +#include #define CRC_ERROR_LIMIT 6 @@ -180,11 +181,11 @@ void glonass_l2_ca_telemetry_decoder_cc::decode_string(double *frame_symbols, in // 3. Check operation executed correctly if (d_nav.flag_CRC_test == true) { - LOG(INFO) << "GLONASS GNAV CRC correct on channel " << d_channel << " from satellite " << d_satellite; + LOG(INFO) << "GLONASS GNAV CRC correct in channel " << d_channel << " from satellite " << d_satellite; } else { - LOG(INFO) << "GLONASS GNAV CRC error on channel " << d_channel << " from satellite " << d_satellite; + LOG(INFO) << "GLONASS GNAV CRC error in channel " << d_channel << " from satellite " << d_satellite; } // 4. Push the new navigation data to the queues if (d_nav.have_new_ephemeris() == true) @@ -193,26 +194,29 @@ void glonass_l2_ca_telemetry_decoder_cc::decode_string(double *frame_symbols, in d_nav.gnav_ephemeris.i_satellite_freq_channel = d_satellite.get_rf_link(); std::shared_ptr tmp_obj = std::make_shared(d_nav.get_ephemeris()); this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); - LOG(INFO) << "GLONASS GNAV Ephemeris have been received on channel" << d_channel << " from satellite " << d_satellite; + LOG(INFO) << "GLONASS GNAV Ephemeris have been received in channel" << d_channel << " from satellite " << d_satellite; + std::cout << TEXT_CYAN << "New GLONASS L2 GNAV message received in channel " << d_channel << ": ephemeris from satellite " << d_satellite << TEXT_RESET << std::endl; } if (d_nav.have_new_utc_model() == true) { // get object for this SV (mandatory) std::shared_ptr tmp_obj = std::make_shared(d_nav.get_utc_model()); this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); - LOG(INFO) << "GLONASS GNAV UTC Model have been received on channel" << d_channel << " from satellite " << d_satellite; + LOG(INFO) << "GLONASS GNAV UTC Model have been received in channel" << d_channel << " from satellite " << d_satellite; + std::cout << TEXT_CYAN << "New GLONASS L2 GNAV message received in channel " << d_channel << ": UTC model parameters from satellite " << d_satellite << TEXT_RESET << std::endl; } if (d_nav.have_new_almanac() == true) { unsigned int slot_nbr = d_nav.i_alm_satellite_slot_number; std::shared_ptr tmp_obj = std::make_shared(d_nav.get_almanac(slot_nbr)); this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); - LOG(INFO) << "GLONASS GNAV Almanac have been received on channel" << d_channel << " in slot number " << slot_nbr; + LOG(INFO) << "GLONASS GNAV Almanac have been received in channel" << d_channel << " in slot number " << slot_nbr; + std::cout << TEXT_CYAN << "New GLONASS L2 GNAV almanac received in channel " << d_channel << " from satellite " << d_satellite << TEXT_RESET << std::endl; } // 5. Update satellite information on system if (d_nav.flag_update_slot_number == true) { - LOG(INFO) << "GLONASS GNAV Slot Number Identified on channel " << d_channel; + LOG(INFO) << "GLONASS GNAV Slot Number Identified in channel " << d_channel; d_satellite.update_PRN(d_nav.gnav_ephemeris.d_n); d_satellite.what_block(d_satellite.get_system(), d_nav.gnav_ephemeris.d_n); d_nav.flag_update_slot_number = false; From 1b852336c6918ce3a0a1082992a61284210a141a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 23 Apr 2018 07:52:49 +0200 Subject: [PATCH 49/82] Improve memory management in Viterbi decoder --- .../galileo_e1b_telemetry_decoder_cc.cc | 65 ++++++++----------- .../galileo_e1b_telemetry_decoder_cc.h | 9 +++ .../galileo_e5a_telemetry_decoder_cc.cc | 64 +++++++----------- .../galileo_e5a_telemetry_decoder_cc.h | 9 +++ 4 files changed, 68 insertions(+), 79 deletions(-) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.cc index 6f2242454..b9aee4196 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.cc @@ -37,6 +37,7 @@ #include #include #include +#include #include @@ -54,38 +55,8 @@ galileo_e1b_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump void galileo_e1b_telemetry_decoder_cc::viterbi_decoder(double *page_part_symbols, int *page_part_bits) { - int CodeLength = 240; - int DataLength; - int nn, KK, mm, max_states; - int g_encoder[2]; - - nn = 2; // Coding rate 1/n - KK = 7; // Constraint Length - g_encoder[0] = 121; // Polynomial G1 - g_encoder[1] = 91; // Polynomial G2 - - mm = KK - 1; - max_states = 1 << mm; /* 2^mm */ - DataLength = (CodeLength / nn) - mm; - - /* create appropriate transition matrices */ - int *out0, *out1, *state0, *state1; - out0 = static_cast(calloc(max_states, sizeof(int))); - out1 = static_cast(calloc(max_states, sizeof(int))); - state0 = static_cast(calloc(max_states, sizeof(int))); - state1 = static_cast(calloc(max_states, sizeof(int))); - - nsc_transit(out0, state0, 0, g_encoder, KK, nn); - nsc_transit(out1, state1, 1, g_encoder, KK, nn); - Viterbi(page_part_bits, out0, state0, out1, state1, page_part_symbols, KK, nn, DataLength); - - /* Clean up memory */ - free(out0); - free(out1); - free(state0); - free(state1); } @@ -122,7 +93,7 @@ galileo_e1b_telemetry_decoder_cc::galileo_e1b_telemetry_decoder_cc( memcpy(static_cast(this->d_preambles_bits), static_cast(preambles_bits), GALILEO_INAV_PREAMBLE_LENGTH_BITS * sizeof(unsigned short int)); // preamble bits to sampled symbols - d_preambles_symbols = static_cast(malloc(sizeof(signed int) * d_symbols_per_preamble)); + d_preambles_symbols = static_cast(volk_gnsssdr_malloc(d_symbols_per_preamble * sizeof(int), volk_gnsssdr_get_alignment())); int n = 0; for (int i = 0; i < GALILEO_INAV_PREAMBLE_LENGTH_BITS; i++) { @@ -153,12 +124,28 @@ galileo_e1b_telemetry_decoder_cc::galileo_e1b_telemetry_decoder_cc( d_flag_preamble = false; d_channel = 0; flag_TOW_set = false; + + // vars for Viterbi decoder + int max_states = 1 << mm; /* 2^mm */ + g_encoder[0] = 121; // Polynomial G1 + g_encoder[1] = 91; // Polynomial G2 + out0 = static_cast(volk_gnsssdr_malloc(max_states * sizeof(int), volk_gnsssdr_get_alignment())); + out1 = static_cast(volk_gnsssdr_malloc(max_states * sizeof(int), volk_gnsssdr_get_alignment())); + state0 = static_cast(volk_gnsssdr_malloc(max_states * sizeof(int), volk_gnsssdr_get_alignment())); + state1 = static_cast(volk_gnsssdr_malloc(max_states * sizeof(int), volk_gnsssdr_get_alignment())); + /* create appropriate transition matrices */ + nsc_transit(out0, state0, 0, g_encoder, KK, nn); + nsc_transit(out1, state1, 1, g_encoder, KK, nn); } galileo_e1b_telemetry_decoder_cc::~galileo_e1b_telemetry_decoder_cc() { - delete d_preambles_symbols; + volk_gnsssdr_free(d_preambles_symbols); + volk_gnsssdr_free(out0); + volk_gnsssdr_free(out1); + volk_gnsssdr_free(state0); + volk_gnsssdr_free(state1); if (d_dump_file.is_open() == true) { try @@ -213,13 +200,13 @@ void galileo_e1b_telemetry_decoder_cc::decode_word(double *page_part_symbols, in d_nav.split_page(page_String, flag_even_word_arrived); if (d_nav.flag_CRC_test == true) { - LOG(INFO) << "Galileo E1 CRC correct on channel " << d_channel << " from satellite " << d_satellite; + LOG(INFO) << "Galileo E1 CRC correct in channel " << d_channel << " from satellite " << d_satellite; //std::cout << "Galileo E1 CRC correct on channel " << d_channel << " from satellite " << d_satellite << std::endl; } else { - std::cout << "Galileo E1 CRC error on channel " << d_channel << " from satellite " << d_satellite << std::endl; - LOG(INFO) << "Galileo E1 CRC error on channel " << d_channel << " from satellite " << d_satellite; + std::cout << "Galileo E1 CRC error in channel " << d_channel << " from satellite " << d_satellite << std::endl; + LOG(INFO) << "Galileo E1 CRC error in channel " << d_channel << " from satellite " << d_satellite; } flag_even_word_arrived = 0; } @@ -235,21 +222,21 @@ void galileo_e1b_telemetry_decoder_cc::decode_word(double *page_part_symbols, in { // get object for this SV (mandatory) std::shared_ptr tmp_obj = std::make_shared(d_nav.get_ephemeris()); - std::cout << "New Galileo E1 I/NAV message received: ephemeris from satellite " << d_satellite << std::endl; + std::cout << "New Galileo E1 I/NAV message received in channel " << d_channel << ": ephemeris from satellite " << d_satellite << std::endl; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); } if (d_nav.have_new_iono_and_GST() == true) { // get object for this SV (mandatory) std::shared_ptr tmp_obj = std::make_shared(d_nav.get_iono()); - std::cout << "New Galileo E1 I/NAV message received: iono/GST model parameters from satellite " << d_satellite << std::endl; + std::cout << "New Galileo E1 I/NAV message received in channel " << d_channel << ": iono/GST model parameters from satellite " << d_satellite << std::endl; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); } if (d_nav.have_new_utc_model() == true) { // get object for this SV (mandatory) std::shared_ptr tmp_obj = std::make_shared(d_nav.get_utc_model()); - std::cout << "New Galileo E1 I/NAV message received: UTC model parameters from satellite " << d_satellite << std::endl; + std::cout << "New Galileo E1 I/NAV message received in channel " << d_channel << ": UTC model parameters from satellite " << d_satellite << std::endl; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); } if (d_nav.have_new_almanac() == true) @@ -257,7 +244,7 @@ void galileo_e1b_telemetry_decoder_cc::decode_word(double *page_part_symbols, in std::shared_ptr tmp_obj = std::make_shared(d_nav.get_almanac()); this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); //debug - std::cout << "Galileo E1 I/NAV almanac received!" << std::endl; + std::cout << "Galileo E1 I/NAV almanac received in channel " << d_channel << " from satellite " << d_satellite << std::endl; DLOG(INFO) << "GPS_to_Galileo time conversion:"; DLOG(INFO) << "A0G=" << tmp_obj->A_0G_10; DLOG(INFO) << "A1G=" << tmp_obj->A_1G_10; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.h index 33900b7d1..6caf0aa6c 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.h @@ -112,6 +112,15 @@ private: std::string d_dump_filename; std::ofstream d_dump_file; + + // vars for Viterbi decoder + int *out0, *out1, *state0, *state1; + int g_encoder[2]; + const int nn = 2; // Coding rate 1/n + const int KK = 7; // Constraint Length + int mm = KK - 1; + const int CodeLength = 240; + int DataLength = (CodeLength / nn) - mm; }; #endif diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.cc index c828fb859..647647698 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.cc @@ -37,9 +37,11 @@ #include "galileo_e5a_telemetry_decoder_cc.h" #include "control_message_factory.h" #include "convolutional.h" +#include "display.h" #include #include #include +#include #include #include @@ -58,42 +60,8 @@ galileo_e5a_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump void galileo_e5a_telemetry_decoder_cc::viterbi_decoder(double *page_part_symbols, int *page_part_bits) { - // int CodeLength = 240; - int CodeLength = 488; - int DataLength; - int nn, KK, mm, max_states; - int g_encoder[2]; - - nn = 2; // Coding rate 1/n - KK = 7; // Constraint Length - g_encoder[0] = 121; // Polynomial G1 - g_encoder[1] = 91; // Polynomial G2 - // g_encoder[0] = 171; // Polynomial G1 - // g_encoder[1] = 133; // Polynomial G2 - - mm = KK - 1; - max_states = 1 << mm; // 2^mm - DataLength = (CodeLength / nn) - mm; - - //create appropriate transition matrices - - int *out0, *out1, *state0, *state1; - out0 = static_cast(calloc(max_states, sizeof(int))); - out1 = static_cast(calloc(max_states, sizeof(int))); - state0 = static_cast(calloc(max_states, sizeof(int))); - state1 = static_cast(calloc(max_states, sizeof(int))); - - nsc_transit(out0, state0, 0, g_encoder, KK, nn); - nsc_transit(out1, state1, 1, g_encoder, KK, nn); - Viterbi(page_part_bits, out0, state0, out1, state1, page_part_symbols, KK, nn, DataLength); - - //Clean up memory - free(out0); - free(out1); - free(state0); - free(state1); } @@ -147,32 +115,32 @@ void galileo_e5a_telemetry_decoder_cc::decode_word(double *page_symbols, int fra d_nav.split_page(page_String); if (d_nav.flag_CRC_test == true) { - LOG(INFO) << "Galileo E5a CRC correct on channel " << d_channel << " from satellite " << d_satellite; + LOG(INFO) << "Galileo E5a CRC correct in channel " << d_channel << " from satellite " << d_satellite; //std::cout << "Galileo E5a CRC correct on channel " << d_channel << " from satellite " << d_satellite << std::endl; } else { - std::cout << "Galileo E5a CRC error on channel " << d_channel << " from satellite " << d_satellite << std::endl; - LOG(INFO) << "Galileo E5a CRC error on channel " << d_channel << " from satellite " << d_satellite; + std::cout << "Galileo E5a CRC error in channel " << d_channel << " from satellite " << d_satellite << std::endl; + LOG(INFO) << "Galileo E5a CRC error in channel " << d_channel << " from satellite " << d_satellite; } // 4. Push the new navigation data to the queues if (d_nav.have_new_ephemeris() == true) { std::shared_ptr tmp_obj = std::make_shared(d_nav.get_ephemeris()); - std::cout << "New Galileo E5a F/NAV message received: ephemeris from satellite " << d_satellite << std::endl; + std::cout << TEXT_MAGENTA << "New Galileo E5a F/NAV message received in channel " << d_channel << ": ephemeris from satellite " << d_satellite << TEXT_RESET << std::endl; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); } if (d_nav.have_new_iono_and_GST() == true) { std::shared_ptr tmp_obj = std::make_shared(d_nav.get_iono()); - std::cout << "New Galileo E5a F/NAV message received: iono/GST model parameters from satellite " << d_satellite << std::endl; + std::cout << TEXT_MAGENTA << "New Galileo E5a F/NAV message received in channel " << d_channel << ": iono/GST model parameters from satellite " << d_satellite << TEXT_RESET << std::endl; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); } if (d_nav.have_new_utc_model() == true) { std::shared_ptr tmp_obj = std::make_shared(d_nav.get_utc_model()); - std::cout << "New Galileo E5a F/NAV message received: UTC model parameters from satellite " << d_satellite << std::endl; + std::cout << TEXT_MAGENTA << "New Galileo E5a F/NAV message received in channel " << d_channel << ": UTC model parameters from satellite " << d_satellite << TEXT_RESET << std::endl; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); } } @@ -226,11 +194,27 @@ galileo_e5a_telemetry_decoder_cc::galileo_e5a_telemetry_decoder_cc( flag_bit_start = false; new_symbol = false; required_symbols = GALILEO_FNAV_SYMBOLS_PER_PAGE + GALILEO_FNAV_PREAMBLE_LENGTH_BITS; + + // vars for Viterbi decoder + int max_states = 1 << mm; /* 2^mm */ + g_encoder[0] = 121; // Polynomial G1 + g_encoder[1] = 91; // Polynomial G2 + out0 = static_cast(volk_gnsssdr_malloc(max_states * sizeof(int), volk_gnsssdr_get_alignment())); + out1 = static_cast(volk_gnsssdr_malloc(max_states * sizeof(int), volk_gnsssdr_get_alignment())); + state0 = static_cast(volk_gnsssdr_malloc(max_states * sizeof(int), volk_gnsssdr_get_alignment())); + state1 = static_cast(volk_gnsssdr_malloc(max_states * sizeof(int), volk_gnsssdr_get_alignment())); + /* create appropriate transition matrices */ + nsc_transit(out0, state0, 0, g_encoder, KK, nn); + nsc_transit(out1, state1, 1, g_encoder, KK, nn); } galileo_e5a_telemetry_decoder_cc::~galileo_e5a_telemetry_decoder_cc() { + volk_gnsssdr_free(out0); + volk_gnsssdr_free(out1); + volk_gnsssdr_free(state0); + volk_gnsssdr_free(state1); if (d_dump_file.is_open() == true) { try diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.h index 5579f701a..5c004f18b 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.h @@ -112,6 +112,15 @@ private: Gnss_Satellite d_satellite; // navigation message vars Galileo_Fnav_Message d_nav; + + // vars for Viterbi decoder + int *out0, *out1, *state0, *state1; + int g_encoder[2]; + const int nn = 2; // Coding rate 1/n + const int KK = 7; // Constraint Length + int mm = KK - 1; + const int CodeLength = 488; + int DataLength = (CodeLength / nn) - mm; }; #endif /* GNSS_SDR_GALILEO_E5A_TELEMETRY_DECODER_CC_H_ */ From 2c972b517b9652a5ad5818453f5c7bd33b7744a6 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 23 Apr 2018 07:53:47 +0200 Subject: [PATCH 50/82] Display info when decoding GNAV messages --- .../glonass_l1_ca_telemetry_decoder_cc.cc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.cc index 09429a7e1..a99daba1e 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.cc @@ -181,11 +181,11 @@ void glonass_l1_ca_telemetry_decoder_cc::decode_string(double *frame_symbols, in // 3. Check operation executed correctly if (d_nav.flag_CRC_test == true) { - LOG(INFO) << "GLONASS GNAV CRC correct on channel " << d_channel << " from satellite " << d_satellite; + LOG(INFO) << "GLONASS GNAV CRC correct in channel " << d_channel << " from satellite " << d_satellite; } else { - LOG(INFO) << "GLONASS GNAV CRC error on channel " << d_channel << " from satellite " << d_satellite; + LOG(INFO) << "GLONASS GNAV CRC error in channel " << d_channel << " from satellite " << d_satellite; } // 4. Push the new navigation data to the queues if (d_nav.have_new_ephemeris() == true) @@ -194,26 +194,29 @@ void glonass_l1_ca_telemetry_decoder_cc::decode_string(double *frame_symbols, in d_nav.gnav_ephemeris.i_satellite_freq_channel = d_satellite.get_rf_link(); std::shared_ptr tmp_obj = std::make_shared(d_nav.get_ephemeris()); this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); - LOG(INFO) << "GLONASS GNAV Ephemeris have been received on channel" << d_channel << " from satellite " << d_satellite; + LOG(INFO) << "GLONASS GNAV Ephemeris have been received in channel" << d_channel << " from satellite " << d_satellite; + std::cout << "New GLONASS L1 GNAV message received in channel " << d_channel << ": ephemeris from satellite " << d_satellite << std::endl; } if (d_nav.have_new_utc_model() == true) { // get object for this SV (mandatory) std::shared_ptr tmp_obj = std::make_shared(d_nav.get_utc_model()); this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); - LOG(INFO) << "GLONASS GNAV UTC Model have been received on channel" << d_channel << " from satellite " << d_satellite; + LOG(INFO) << "GLONASS GNAV UTC Model have been received in channel" << d_channel << " from satellite " << d_satellite; + std::cout << "New GLONASS L1 GNAV message received in channel " << d_channel << ": UTC model parameters from satellite " << d_satellite << std::endl; } if (d_nav.have_new_almanac() == true) { unsigned int slot_nbr = d_nav.i_alm_satellite_slot_number; std::shared_ptr tmp_obj = std::make_shared(d_nav.get_almanac(slot_nbr)); this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); - LOG(INFO) << "GLONASS GNAV Almanac have been received on channel" << d_channel << " in slot number " << slot_nbr; + LOG(INFO) << "GLONASS GNAV Almanac have been received in channel" << d_channel << " in slot number " << slot_nbr; + std::cout << "New GLONASS L1 GNAV almanac received in channel " << d_channel << " from satellite " << d_satellite << std::endl; } // 5. Update satellite information on system if (d_nav.flag_update_slot_number == true) { - LOG(INFO) << "GLONASS GNAV Slot Number Identified on channel " << d_channel; + LOG(INFO) << "GLONASS GNAV Slot Number Identified in channel " << d_channel; d_satellite.update_PRN(d_nav.gnav_ephemeris.d_n); d_satellite.what_block(d_satellite.get_system(), d_nav.gnav_ephemeris.d_n); d_nav.flag_update_slot_number = false; From c0375c99ff1d0af815f61651dd489596dc2aa594 Mon Sep 17 00:00:00 2001 From: Javier Arribas Date: Mon, 23 Apr 2018 12:37:43 +0200 Subject: [PATCH 51/82] Adding GPS L1 C/A CN0 control in GPS DLL/PLL unit test --- .../gps_l1_ca_dll_pll_tracking_test.cc | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc index 89f70f914..0d0bf4cf0 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc @@ -54,7 +54,8 @@ #include "test_flags.h" DEFINE_bool(plot_gps_l1_tracking_test, false, "Plots results of GpsL1CADllPllTrackingTest with gnuplot"); - +DEFINE_double(CN0_dBHz, std::numeric_limits::infinity(), "Enable noise generator and set the CN0 [dB-Hz]"); +DEFINE_int32(extend_correlation_symbols, 1, "Set the tracking coherent correlation to N symbols (up to 20 for GPS L1 C/A)"); // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GpsL1CADllPllTrackingTest_msg_rx; @@ -121,7 +122,7 @@ public: std::string p3; std::string p4; std::string p5; - + std::string p6; std::string implementation = "GPS_L1_CA_DLL_PLL_Tracking"; //"GPS_L1_CA_DLL_PLL_C_Aid_Tracking"; const int baseband_sampling_freq = FLAGS_fs_gen_sps; @@ -183,6 +184,7 @@ int GpsL1CADllPllTrackingTest::configure_generator() p3 = std::string("-rinex_obs_file=") + FLAGS_filename_rinex_obs; // RINEX 2.10 observation file output p4 = std::string("-sig_out_file=") + FLAGS_filename_raw_data; // Baseband signal output file. Will be stored in int8_t IQ multiplexed samples p5 = std::string("-sampling_freq=") + std::to_string(baseband_sampling_freq); //Baseband sampling frequency [MSps] + p6 = std::string("-CN0_dBHz=") + std::to_string(FLAGS_CN0_dBHz); // Signal generator CN0 return 0; } @@ -191,7 +193,7 @@ int GpsL1CADllPllTrackingTest::generate_signal() { int child_status; - char* const parmList[] = {&generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], &p4[0], &p5[0], NULL}; + char* const parmList[] = {&generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], &p4[0], &p5[0],&p6[0], NULL}; int pid; if ((pid = fork()) == -1) @@ -223,12 +225,12 @@ void GpsL1CADllPllTrackingTest::configure_receiver() config->set_property("Tracking_1C.implementation", implementation); config->set_property("Tracking_1C.item_type", "gr_complex"); config->set_property("Tracking_1C.pll_bw_hz", "20.0"); - config->set_property("Tracking_1C.dll_bw_hz", "2.0"); + config->set_property("Tracking_1C.dll_bw_hz", "1.5"); config->set_property("Tracking_1C.early_late_space_chips", "0.5"); - config->set_property("Tracking_1C.pll_bw_narrow_hz", "20.0"); - config->set_property("Tracking_1C.dll_bw_narrow_hz", "2.0"); + config->set_property("Tracking_1C.extend_correlation_symbols", std::to_string(FLAGS_extend_correlation_symbols)); + config->set_property("Tracking_1C.pll_bw_narrow_hz", "2.0"); + config->set_property("Tracking_1C.dll_bw_narrow_hz", "1.0"); config->set_property("Tracking_1C.early_late_space_narrow_chips", "0.5"); - config->set_property("Tracking_1C.extend_correlation_ms", "1"); config->set_property("Tracking_1C.dump", "true"); config->set_property("Tracking_1C.dump_filename", "./tracking_ch_"); } @@ -471,6 +473,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) std::vector late; std::vector promptI; std::vector promptQ; + std::vector CN0_dBHz; epoch_counter = 0; while (trk_dump.read_binary_obs()) @@ -488,6 +491,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) late.push_back(trk_dump.abs_L); promptI.push_back(trk_dump.prompt_I); promptQ.push_back(trk_dump.prompt_Q); + CN0_dBHz.push_back(trk_dump.CN0_SNV_dB_Hz); } // Align initial measurements and cut the tracking pull-in transitory @@ -555,6 +559,17 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) g2.savetops("Constellation"); g2.savetopdf("Constellation", 18); g2.showonscreen(); // window output + + Gnuplot g3("linespoints"); + g3.set_title("GPS L1 C/A tracking CN0 output (satellite PRN #" + std::to_string(FLAGS_test_satellite_PRN) + ")"); + g3.set_grid(); + g3.set_xlabel("Time [s]"); + g3.set_ylabel("Reported CN0 [dB-Hz]"); + g3.cmd("set key box opaque"); + g3.plot_xy(timevec, CN0_dBHz, "Prompt", decimate); + g3.savetops("CN0_output"); + g3.savetopdf("CN0_output", 18); + g3.showonscreen(); // window output } catch (const GnuplotException& ge) { From 8b8e4887b857ee926cacc57d55a49bd8e8e9a662 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 24 Apr 2018 18:34:37 +0200 Subject: [PATCH 52/82] Fix experiment --- src/utils/reproducibility/ieee-access18/L2-access18.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/reproducibility/ieee-access18/L2-access18.conf b/src/utils/reproducibility/ieee-access18/L2-access18.conf index 57e1af0a3..e4bc4ae44 100644 --- a/src/utils/reproducibility/ieee-access18/L2-access18.conf +++ b/src/utils/reproducibility/ieee-access18/L2-access18.conf @@ -56,7 +56,7 @@ Resampler.item_type=gr_complex Channels_2S.count=10 -Channels.in_acquisition=1 +;Channels.in_acquisition=1 Channel0.signal=2S Channel1.signal=2S From 512bf3f4cf9d0925953520d664f1266c25263293 Mon Sep 17 00:00:00 2001 From: mmajoral Date: Fri, 27 Apr 2018 20:00:50 +0200 Subject: [PATCH 53/82] Created a generic gnuradio block acquisition class for the FPGA. --- .../gps_l1_ca_pcps_acquisition_fpga.cc | 236 +++++++------- .../gps_l1_ca_pcps_acquisition_fpga.h | 41 +-- .../gnuradio_blocks/CMakeLists.txt | 2 +- .../gps_pcps_acquisition_fpga_sc.cc | 298 ------------------ .../gps_pcps_acquisition_fpga_sc.h | 219 ------------- .../gnuradio_blocks/pcps_acquisition_fpga.cc | 247 +++++++++++++++ .../gnuradio_blocks/pcps_acquisition_fpga.h | 216 +++++++++++++ .../acquisition/libs/CMakeLists.txt | 2 +- ...acquisition_8sc.cc => fpga_acquisition.cc} | 140 +++----- ...a_acquisition_8sc.h => fpga_acquisition.h} | 33 +- 10 files changed, 655 insertions(+), 779 deletions(-) delete mode 100644 src/algorithms/acquisition/gnuradio_blocks/gps_pcps_acquisition_fpga_sc.cc delete mode 100644 src/algorithms/acquisition/gnuradio_blocks/gps_pcps_acquisition_fpga_sc.h create mode 100644 src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc create mode 100644 src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h rename src/algorithms/acquisition/libs/{gps_fpga_acquisition_8sc.cc => fpga_acquisition.cc} (55%) rename src/algorithms/acquisition/libs/{gps_fpga_acquisition_8sc.h => fpga_acquisition.h} (78%) diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc index 00ff2008c..f585fdbc0 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc @@ -1,14 +1,18 @@ + /*! * \file gps_l1_ca_pcps_acquisition_fpga.cc - * \brief Adapts a PCPS acquisition block to an FPGA Acquisition Interface for - * GPS L1 C/A signals. This file is based on the file gps_l1_ca_pcps_acquisition.cc + * \brief Adapts a PCPS acquisition block to an FPGA AcquisitionInterface + * for GPS L1 C/A signals * \authors
    - *
  • Marc Majoral, 2017. mmajoral(at)cttc.cat + *
  • Marc Majoral, 2018. mmajoral(at)cttc.es + *
  • Javier Arribas, 2011. jarribas(at)cttc.es + *
  • Luis Esteve, 2012. luis(at)epsilon-formacion.com + *
  • Marc Molina, 2013. marc.molina.pena(at)gmail.com *
* * ------------------------------------------------------------------------- * - * Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors) + * Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors) * * GNSS-SDR is a software defined Global Navigation * Satellite Systems receiver @@ -30,88 +34,109 @@ * * ------------------------------------------------------------------------- */ - -#include "gps_l1_ca_pcps_acquisition_fpga.h" -#include +#include +#include +#include #include -#include "GPS_L1_CA.h" +#include "gps_l1_ca_pcps_acquisition_fpga.h" #include "configuration_interface.h" +#include "gps_sdr_signal_processing.h" +#include "GPS_L1_CA.h" +#include "gnss_sdr_flags.h" + +#define NUM_PRNs 32 using google::LogMessage; GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, std::string role, + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { - unsigned int code_length; - bool bit_transition_flag; - bool use_CFAR_algorithm_flag; - unsigned int sampled_ms; - long fs_in; - long ifreq; - bool dump; - std::string dump_filename; - unsigned int nsamples_total; - unsigned int select_queue_Fpga; - std::string device_name; + pcpsconf_fpga_t acq_parameters; configuration_ = configuration; - std::string default_item_type = "cshort"; - std::string default_dump_filename = "./data/acquisition.dat"; + std::string default_item_type = "gr_complex"; + DLOG(INFO) << "role " << role; - item_type_ = configuration_->property(role + ".item_type", - default_item_type); - fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", 2048000); - ifreq = configuration_->property(role + ".if", 0); - dump = configuration_->property(role + ".dump", false); + + long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); + fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); + acq_parameters.fs_in = fs_in_; + if_ = configuration_->property(role + ".if", 0); + acq_parameters.freq = if_; doppler_max_ = configuration_->property(role + ".doppler_max", 5000); - sampled_ms = configuration_->property( - role + ".coherent_integration_time_ms", 1); - // note : the FPGA is implemented according to bit transition flag = 0. Setting bit transition flag to 1 has no effect. - bit_transition_flag = configuration_->property( - role + ".bit_transition_flag", false); - // note : the FPGA is implemented according to use_CFAR_algorithm = 0. Setting use_CFAR_algorithm to 1 has no effect. - use_CFAR_algorithm_flag = configuration_->property( - role + ".use_CFAR_algorithm", false); - // note : the FPGA does not use the max_dwells variable. - max_dwells_ = configuration_->property(role + ".max_dwells", 1); - dump_filename = configuration_->property(role + ".dump_filename", - default_dump_filename); - //--- Find number of samples per spreading code ------------------------- - code_length = round( - fs_in / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); - // code length has the same value as d_fft_size - float nbits; - nbits = ceilf(log2f(code_length)); - nsamples_total = pow(2, nbits); - //vector_length_ = code_length_ * sampled_ms_; - vector_length_ = nsamples_total * sampled_ms; - // if( bit_transition_flag_ ) - // { - // vector_length_ *= 2; - // } - select_queue_Fpga = configuration_->property(role + ".select_queue_Fpga", - 0); - std::string default_device_name = "/dev/uio0"; - device_name = configuration_->property(role + ".devicename", - default_device_name); - if (item_type_.compare("cshort") == 0) + if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; + acq_parameters.doppler_max = doppler_max_; + sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1); + acq_parameters.sampled_ms = sampled_ms_; + code_length_ = static_cast(std::round(static_cast(fs_in_) / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS))); + + // The FPGA can only use FFT lengths that are a power of two. + float nbits = ceilf(log2f((float) code_length_)); + unsigned int nsamples_total = pow(2, nbits); + vector_length_ = nsamples_total * sampled_ms_; + unsigned int select_queue_Fpga = configuration_->property(role + ".select_queue_Fpga",0); + acq_parameters.select_queue_Fpga = select_queue_Fpga; + std::string default_device_name = "/dev/uio0"; + std::string device_name = configuration_->property(role + ".devicename", default_device_name); + acq_parameters.device_name = device_name; + acq_parameters.samples_per_ms = nsamples_total; + acq_parameters.samples_per_code = nsamples_total; + + // compute all the GPS L1 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time + // a channel is assigned) + + // Direct FFT + gr::fft::fft_complex* fft_if = new gr::fft::fft_complex(vector_length_, true); + // allocate memory to compute all the PRNs + // and compute all the possible codes + std::complex* code = new std::complex[nsamples_total]; // buffer for the local code + gr_complex* fft_codes_padded = static_cast(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_all_fft_codes = new lv_16sc_t[nsamples_total * NUM_PRNs]; // memory containing all the possible fft codes for PRN 0 to 32 + float max; // temporary maxima search + + for (unsigned int PRN = 1; PRN <= NUM_PRNs; PRN++) { - item_size_ = sizeof(lv_16sc_t); - gps_acquisition_fpga_sc_ = gps_pcps_make_acquisition_fpga_sc( - sampled_ms, max_dwells_, doppler_max_, ifreq, fs_in, - code_length, code_length, vector_length_, nsamples_total, - bit_transition_flag, use_CFAR_algorithm_flag, - select_queue_Fpga, device_name, dump, dump_filename); - DLOG(INFO) << "acquisition(" - << gps_acquisition_fpga_sc_->unique_id() << ")"; - } - else - { - LOG(FATAL) << item_type_ << " FPGA only accepts chsort"; - } + gps_l1_ca_code_gen_complex_sampled(code, PRN, fs_in_, 0); // generate PRN code + // fill in zero padding + for (int s=code_length_;sget_inbuf() + offset, code, sizeof(gr_complex) * nsamples_total); // copy to FFT buffer + fft_if->execute(); // Run the FFT of local code + volk_32fc_conjugate_32fc(fft_codes_padded, fft_if->get_outbuf(), nsamples_total); // conjugate values + max = 0; // initialize maximum value + for (unsigned int i = 0; i < nsamples_total; i++) // search for maxima + { + if (std::abs(fft_codes_padded[i].real()) > max) + { + max = std::abs(fft_codes_padded[i].real()); + } + if (std::abs(fft_codes_padded[i].imag()) > max) + { + max = std::abs(fft_codes_padded[i].imag()); + } + } + for (unsigned int i = 0; i < nsamples_total; i++) // map the FFT to the dynamic range of the fixed point values an copy to buffer containing all FFTs + { + d_all_fft_codes[i + nsamples_total * (PRN -1)] = lv_16sc_t(static_cast(floor(fft_codes_padded[i].real() * (pow(2, 7) - 1) / max)), + static_cast(floor(fft_codes_padded[i].imag() * (pow(2, 7) - 1) / max))); + + } + } + + acq_parameters.all_fft_codes = d_all_fft_codes; + //acq_parameters + // temporary buffers that we can delete + delete[] code; + delete fft_if; + delete[] fft_codes_padded; + + acquisition_fpga_ = pcps_make_acquisition(acq_parameters); + DLOG(INFO) << "acquisition(" << acquisition_fpga_->unique_id() << ")"; + channel_ = 0; - threshold_ = 0.0; doppler_step_ = 0; gnss_synchro_ = 0; } @@ -119,123 +144,94 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( GpsL1CaPcpsAcquisitionFpga::~GpsL1CaPcpsAcquisitionFpga() { + //delete[] code_; + delete[] d_all_fft_codes; } void GpsL1CaPcpsAcquisitionFpga::set_channel(unsigned int channel) { channel_ = channel; - gps_acquisition_fpga_sc_->set_channel(channel_); + acquisition_fpga_->set_channel(channel_); } void GpsL1CaPcpsAcquisitionFpga::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + ".pfa", 0.0); - - if (pfa == 0.0) - { - threshold_ = threshold; - } - else - { - threshold_ = calculate_threshold(pfa); - } - - DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; - gps_acquisition_fpga_sc_->set_threshold(threshold_); + DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold; + acquisition_fpga_->set_threshold(threshold); } void GpsL1CaPcpsAcquisitionFpga::set_doppler_max(unsigned int doppler_max) { doppler_max_ = doppler_max; - gps_acquisition_fpga_sc_->set_doppler_max(doppler_max_); + acquisition_fpga_->set_doppler_max(doppler_max_); } void GpsL1CaPcpsAcquisitionFpga::set_doppler_step(unsigned int doppler_step) { doppler_step_ = doppler_step; - gps_acquisition_fpga_sc_->set_doppler_step(doppler_step_); + acquisition_fpga_->set_doppler_step(doppler_step_); } void GpsL1CaPcpsAcquisitionFpga::set_gnss_synchro(Gnss_Synchro* gnss_synchro) { gnss_synchro_ = gnss_synchro; - gps_acquisition_fpga_sc_->set_gnss_synchro(gnss_synchro_); + acquisition_fpga_->set_gnss_synchro(gnss_synchro_); } signed int GpsL1CaPcpsAcquisitionFpga::mag() { - return gps_acquisition_fpga_sc_->mag(); + return acquisition_fpga_->mag(); } void GpsL1CaPcpsAcquisitionFpga::init() { - gps_acquisition_fpga_sc_->init(); + acquisition_fpga_->init(); } void GpsL1CaPcpsAcquisitionFpga::set_local_code() { - gps_acquisition_fpga_sc_->set_local_code(); + acquisition_fpga_->set_local_code(); } void GpsL1CaPcpsAcquisitionFpga::reset() { - gps_acquisition_fpga_sc_->set_active(true); + acquisition_fpga_->set_active(true); } void GpsL1CaPcpsAcquisitionFpga::set_state(int state) { - gps_acquisition_fpga_sc_->set_state(state); -} - - -float GpsL1CaPcpsAcquisitionFpga::calculate_threshold(float pfa) -{ - //Calculate the threshold - unsigned int frequency_bins = 0; - for (int doppler = static_cast(-doppler_max_); doppler <= static_cast(doppler_max_); - doppler += doppler_step_) - { - frequency_bins++; - } - DLOG(INFO) << "Channel " << channel_ << " Pfa = " << pfa; - unsigned int ncells = vector_length_ * frequency_bins; - double exponent = 1 / static_cast(ncells); - double val = pow(1.0 - pfa, exponent); - double lambda = double(vector_length_); - boost::math::exponential_distribution mydist(lambda); - float threshold = static_cast(quantile(mydist, val)); - return threshold; + acquisition_fpga_->set_state(state); } void GpsL1CaPcpsAcquisitionFpga::connect(gr::top_block_sptr top_block) { - //nothing to connect + // nothing to connect } void GpsL1CaPcpsAcquisitionFpga::disconnect(gr::top_block_sptr top_block) { - //nothing to disconnect + // nothing to disconnect } gr::basic_block_sptr GpsL1CaPcpsAcquisitionFpga::get_left_block() { - return gps_acquisition_fpga_sc_; + return acquisition_fpga_; } gr::basic_block_sptr GpsL1CaPcpsAcquisitionFpga::get_right_block() { - return gps_acquisition_fpga_sc_; + return acquisition_fpga_; } diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h index 2c8f9eed4..d65e677e7 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h @@ -1,14 +1,17 @@ /*! * \file gps_l1_ca_pcps_acquisition_fpga.h - * \brief Adapts a PCPS acquisition block to an AcquisitionInterface for - * GPS L1 C/A signals. This file is based on the file gps_l1_ca_pcps_acquisition.h + * \brief Adapts a PCPS acquisition block that uses the FPGA to + * an AcquisitionInterface for GPS L1 C/A signals * \authors
    - *
  • Marc Majoral, 2017. mmajoral(at)cttc.cat + *
  • Marc Majoral, 2018. mmajoral(at)cttc.es + *
  • Javier Arribas, 2011. jarribas(at)cttc.es + *
  • Luis Esteve, 2012. luis(at)epsilon-formacion.com + *
  • Marc Molina, 2013. marc.molina.pena(at)gmail.com *
* * ------------------------------------------------------------------------- * - * Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors) + * Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors) * * GNSS-SDR is a software defined Global Navigation * Satellite Systems receiver @@ -34,14 +37,11 @@ #ifndef GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_FPGA_H_ #define GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_FPGA_H_ -#include -#include -#include -#include "gnss_synchro.h" #include "acquisition_interface.h" -#include "gps_pcps_acquisition_fpga_sc.h" -#include "complex_byte_to_float_x2.h" -#include +#include "gnss_synchro.h" +#include "pcps_acquisition_fpga.h" +#include + class ConfigurationInterface; @@ -68,12 +68,13 @@ public: */ inline std::string implementation() override { - return "GPS_L1_CA_PCPS_Acquisition_Fpga"; + return "GPS_L1_CA_PCPS_Acquisition"; } inline size_t item_size() override { - return item_size_; + size_t item_size = sizeof(lv_16sc_t); + return item_size; } void connect(gr::top_block_sptr top_block) override; @@ -135,21 +136,21 @@ public: private: ConfigurationInterface* configuration_; - gps_pcps_acquisition_fpga_sc_sptr gps_acquisition_fpga_sc_; - size_t item_size_; - std::string item_type_; + pcps_acquisition_fpga_sptr acquisition_fpga_; unsigned int vector_length_; + unsigned int code_length_; unsigned int channel_; - float threshold_; unsigned int doppler_max_; unsigned int doppler_step_; - unsigned int max_dwells_; + unsigned int sampled_ms_; + long fs_in_; + long if_; Gnss_Synchro* gnss_synchro_; std::string role_; unsigned int in_streams_; unsigned int out_streams_; + lv_16sc_t *d_all_fft_codes; // memory that contains all the code ffts - float calculate_threshold(float pfa); }; -#endif /* GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_H_ */ +#endif /* GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_FPGA_H_ */ diff --git a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt index ca02bb952..9bfd4fc73 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt @@ -29,7 +29,7 @@ set(ACQ_GR_BLOCKS_SOURCES ) if(ENABLE_FPGA) - set(ACQ_GR_BLOCKS_SOURCES ${ACQ_GR_BLOCKS_SOURCES} gps_pcps_acquisition_fpga_sc.cc) + set(ACQ_GR_BLOCKS_SOURCES ${ACQ_GR_BLOCKS_SOURCES} pcps_acquisition_fpga.cc) endif(ENABLE_FPGA) if(OPENCL_FOUND) diff --git a/src/algorithms/acquisition/gnuradio_blocks/gps_pcps_acquisition_fpga_sc.cc b/src/algorithms/acquisition/gnuradio_blocks/gps_pcps_acquisition_fpga_sc.cc deleted file mode 100644 index 53b54686d..000000000 --- a/src/algorithms/acquisition/gnuradio_blocks/gps_pcps_acquisition_fpga_sc.cc +++ /dev/null @@ -1,298 +0,0 @@ -/*! - * \file gps_pcps_acquisition_fpga_sc.cc - * \brief This class implements a Parallel Code Phase Search Acquisition in the FPGA. - * This file is based on the file gps_pcps_acquisition_sc.cc - * \authors
    - *
  • Marc Majoral, 2017. mmajoral(at)cttc.cat - *
- * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * GNSS-SDR is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GNSS-SDR is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNSS-SDR. If not, see . - * - * ------------------------------------------------------------------------- - */ - -#include "gps_pcps_acquisition_fpga_sc.h" -#include -#include -#include -#include -#include -#include -#include "control_message_factory.h" -#include "GPS_L1_CA.h" - -#include - -using google::LogMessage; - -void wait3(int seconds) -{ - boost::this_thread::sleep_for(boost::chrono::seconds - { seconds }); -} - - -gps_pcps_acquisition_fpga_sc_sptr gps_pcps_make_acquisition_fpga_sc( - unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, int samples_per_ms, - int samples_per_code, int vector_length, unsigned int nsamples_total, - bool bit_transition_flag, bool use_CFAR_algorithm_flag, - unsigned int select_queue_Fpga, std::string device_name, bool dump, - std::string dump_filename) -{ - return gps_pcps_acquisition_fpga_sc_sptr( - new gps_pcps_acquisition_fpga_sc(sampled_ms, max_dwells, - doppler_max, freq, fs_in, samples_per_ms, samples_per_code, - vector_length, nsamples_total, bit_transition_flag, - use_CFAR_algorithm_flag, select_queue_Fpga, device_name, - dump, dump_filename)); -} - - -gps_pcps_acquisition_fpga_sc::gps_pcps_acquisition_fpga_sc( - unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, int samples_per_ms, - int samples_per_code, int vector_length, unsigned int nsamples_total, - bool bit_transition_flag, bool use_CFAR_algorithm_flag, - unsigned int select_queue_Fpga, std::string device_name, bool dump, - std::string dump_filename) : - - //gr::block("pcps_acquisition_fpga_sc", - gr::block("gps_pcps_acquisition_fpga_sc", - gr::io_signature::make(0, 0, sizeof(lv_16sc_t)), - gr::io_signature::make(0, 0, 0)) -{ - this->message_port_register_out(pmt::mp("events")); - d_sample_counter = 0; // sample counter - d_active = false; - d_state = 0; - d_samples_per_code = samples_per_code; - d_max_dwells = max_dwells; // Note : d_max_dwells is not used in the FPGA implementation - d_well_count = 0; - d_doppler_max = doppler_max; - d_fft_size = sampled_ms * samples_per_ms; - d_mag = 0; - d_num_doppler_bins = 0; - d_bit_transition_flag = bit_transition_flag; // Note : bit transition flag is ignored and assumed 0 in the FPGA implementation - d_use_CFAR_algorithm_flag = use_CFAR_algorithm_flag; // Note : user CFAR algorithm flag is ignored and assumed 0 in the FPGA implementation - d_threshold = 0.0; - d_doppler_step = 250; - d_channel = 0; - // For dumping samples into a file - d_dump = dump; - d_dump_filename = dump_filename; - d_gnss_synchro = 0; - // instantiate HW accelerator class - acquisition_fpga_8sc = std::make_shared < gps_fpga_acquisition_8sc> - (device_name, vector_length, d_fft_size, doppler_max, nsamples_total, fs_in, freq, sampled_ms, select_queue_Fpga); -} - - -gps_pcps_acquisition_fpga_sc::~gps_pcps_acquisition_fpga_sc() -{ - if (d_dump) - { - d_dump_file.close(); - } - acquisition_fpga_8sc->free(); -} - - -void gps_pcps_acquisition_fpga_sc::set_local_code() -{ - acquisition_fpga_8sc->set_local_code(d_gnss_synchro->PRN); -} - - -void gps_pcps_acquisition_fpga_sc::init() -{ - d_gnss_synchro->Flag_valid_acquisition = false; - d_gnss_synchro->Flag_valid_symbol_output = false; - d_gnss_synchro->Flag_valid_pseudorange = false; - d_gnss_synchro->Flag_valid_word = false; - d_gnss_synchro->Acq_delay_samples = 0.0; - d_gnss_synchro->Acq_doppler_hz = 0.0; - d_gnss_synchro->Acq_samplestamp_samples = 0; - d_mag = 0.0; - d_num_doppler_bins = ceil( - static_cast(static_cast(d_doppler_max) - - static_cast(-d_doppler_max)) - / static_cast(d_doppler_step)); - //acquisition_fpga_8sc->open_device(); - acquisition_fpga_8sc->init(); -} - - -void gps_pcps_acquisition_fpga_sc::set_state(int state) -{ - d_state = state; - if (d_state == 1) - { - d_gnss_synchro->Acq_delay_samples = 0.0; - d_gnss_synchro->Acq_doppler_hz = 0.0; - d_gnss_synchro->Acq_samplestamp_samples = 0; - d_well_count = 0; - d_mag = 0.0; - } - else if (d_state == 0) - { - } - else - { - LOG(ERROR) << "State can only be set to 0 or 1"; - } -} - - - - -void gps_pcps_acquisition_fpga_sc::set_active(bool active) -{ - float temp_peak_to_noise_level = 0.0; - float peak_to_noise_level = 0.0; - float input_power; - float test_statistics = 0.0; - //printf("ACQ : Block samples for PRN %d\n", d_gnss_synchro->PRN); -// acquisition_fpga_8sc->block_samples(); // block the samples to run the acquisition this is only necessary for the tests - d_active = active; - int acquisition_message = -1; //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL - d_state = 1; - // initialize acquisition algorithm - int doppler; - uint32_t indext = 0; - float magt = 0.0; - //int effective_fft_size = ( d_bit_transition_flag ? d_fft_size/2 : d_fft_size ); - int effective_fft_size = d_fft_size; - d_mag = 0.0; - unsigned int initial_sample; - d_well_count++; - DLOG(INFO) << "Channel: " << d_channel - << " , doing acquisition of satellite: " << d_gnss_synchro->System - << " " << d_gnss_synchro->PRN << " ,sample stamp: " - << d_sample_counter << ", threshold: " << ", threshold: " - << d_threshold << ", doppler_max: " << d_doppler_max - << ", doppler_step: " << d_doppler_step; - - // Doppler frequency search loop - for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; - doppler_index++) - { - - doppler = -static_cast(d_doppler_max) + d_doppler_step * doppler_index; - - acquisition_fpga_8sc->set_phase_step(doppler_index); - acquisition_fpga_8sc->run_acquisition(); // runs acquisition and waits until it is finished - acquisition_fpga_8sc->read_acquisition_results(&indext, &magt, - &initial_sample, &input_power); - d_sample_counter = initial_sample; - temp_peak_to_noise_level = static_cast(magt) / static_cast(input_power); - if (peak_to_noise_level < temp_peak_to_noise_level) - { - peak_to_noise_level = temp_peak_to_noise_level; - d_mag = magt; - input_power = (input_power - d_mag) - / (effective_fft_size - 1); - d_gnss_synchro->Acq_delay_samples = - static_cast(indext % d_samples_per_code); - d_gnss_synchro->Acq_doppler_hz = - static_cast(doppler); - d_gnss_synchro->Acq_samplestamp_samples = d_sample_counter; - test_statistics = d_mag / input_power; - } - // Record results to file if required - if (d_dump) - { - std::stringstream filename; - //std::streamsize n = 2 * sizeof(float) * (d_fft_size); // complex file write - filename.str(""); - boost::filesystem::path p = d_dump_filename; - filename << p.parent_path().string() - << boost::filesystem::path::preferred_separator - << p.stem().string() << "_" - << d_gnss_synchro->System << "_" - << d_gnss_synchro->Signal << "_sat_" - << d_gnss_synchro->PRN << "_doppler_" << doppler - << p.extension().string(); - DLOG(INFO) << "Writing ACQ out to " << filename.str(); - d_dump_file.open(filename.str().c_str(), - std::ios::out | std::ios::binary); - d_dump_file.close(); - } - - } - - - //printf("ACQ : unblocking samples for satellite %d\n", d_gnss_synchro->PRN); -// acquisition_fpga_8sc->unblock_samples(); // unblock samples before sending positive or negative acquisition message to let the samples flow when the - // set local code function is called - if (test_statistics > d_threshold) - { - d_state = 2; // Positive acquisition - // 6.1- Declare positive acquisition using a message port - DLOG(INFO) << "positive acquisition"; - DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " - << d_gnss_synchro->PRN; - DLOG(INFO) << "sample_stamp " << d_sample_counter; - DLOG(INFO) << "test statistics value " << test_statistics; - DLOG(INFO) << "test statistics threshold " << d_threshold; - DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; - DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; - DLOG(INFO) << "magnitude " << d_mag; - DLOG(INFO) << "input signal power " << input_power; - d_active = false; - d_state = 0; - acquisition_message = 1; - this->message_port_pub(pmt::mp("events"), - pmt::from_long(acquisition_message)); - } - else - { - d_state = 3; // Negative acquisition - // 6.2- Declare negative acquisition using a message port - DLOG(INFO) << "negative acquisition"; - DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " - << d_gnss_synchro->PRN; - DLOG(INFO) << "sample_stamp " << d_sample_counter; - DLOG(INFO) << "test statistics value " << test_statistics; - DLOG(INFO) << "test statistics threshold " << d_threshold; - DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; - DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; - DLOG(INFO) << "magnitude " << d_mag; - DLOG(INFO) << "input signal power " << input_power; - d_active = false; - d_state = 0; - acquisition_message = 2; - this->message_port_pub(pmt::mp("events"), - pmt::from_long(acquisition_message)); - } - DLOG(INFO) << "Done. Consumed 1 item."; -} - - -int gps_pcps_acquisition_fpga_sc::general_work(int noutput_items, - gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items __attribute__((unused)), - gr_vector_void_star &output_items __attribute__((unused))) -{ - // general work not used with the acquisition - return noutput_items; -} diff --git a/src/algorithms/acquisition/gnuradio_blocks/gps_pcps_acquisition_fpga_sc.h b/src/algorithms/acquisition/gnuradio_blocks/gps_pcps_acquisition_fpga_sc.h deleted file mode 100644 index a8316c634..000000000 --- a/src/algorithms/acquisition/gnuradio_blocks/gps_pcps_acquisition_fpga_sc.h +++ /dev/null @@ -1,219 +0,0 @@ -/*! - * \file gps_pcps_acquisition_fpga_sc.h - * \brief This class implements a Parallel Code Phase Search Acquisition in the FPGA. - * This file is based on the file gps_pcps_acquisition_sc.h - * - * Acquisition strategy (Kay Borre book + CFAR threshold). - *
    - *
  1. Compute the input signal power estimation - *
  2. Doppler serial search loop - *
  3. Perform the FFT-based circular convolution (parallel time search) - *
  4. Record the maximum peak and the associated synchronization parameters - *
  5. Compute the test statistics and compare to the threshold - *
  6. Declare positive or negative acquisition using a message port - *
- * - * Kay Borre book: K.Borre, D.M.Akos, N.Bertelsen, P.Rinder, and S.H.Jensen, - * "A Software-Defined GPS and Galileo Receiver. A Single-Frequency - * Approach", Birkhauser, 2007. pp 81-84 - * - * \authors
    - *
  • Marc Majoral, 2017. mmajoral(at)cttc.cat - *
- * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * GNSS-SDR is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GNSS-SDR is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNSS-SDR. If not, see . - * - * ------------------------------------------------------------------------- - */ - -#ifndef GNSS_SDR_GPS_PCPS_ACQUISITION_FPGA_SC_H_ -#define GNSS_SDR_GPS_PCPS_ACQUISITION_FPGA_SC_H_ - -#include -#include -#include -#include -#include -#include "gnss_synchro.h" -#include "gps_fpga_acquisition_8sc.h" - -#include - -class gps_pcps_acquisition_fpga_sc; - -typedef boost::shared_ptr gps_pcps_acquisition_fpga_sc_sptr; - -gps_pcps_acquisition_fpga_sc_sptr -gps_pcps_make_acquisition_fpga_sc(unsigned int sampled_ms, - unsigned int max_dwells, unsigned int doppler_max, long freq, - long fs_in, int samples_per_ms, int samples_per_code, - int vector_length_, unsigned int nsamples_total_, - bool bit_transition_flag, bool use_CFAR_algorithm_flag, - unsigned int select_queue_Fpga, std::string device_name, bool dump, - std::string dump_filename); - -/*! - * \brief This class implements a Parallel Code Phase Search Acquisition. - * - * Check \ref Navitec2012 "An Open Source Galileo E1 Software Receiver", - * Algorithm 1, for a pseudocode description of this implementation. - */ -class gps_pcps_acquisition_fpga_sc : public gr::block -{ -private: - friend gps_pcps_acquisition_fpga_sc_sptr - gps_pcps_make_acquisition_fpga_sc(unsigned int sampled_ms, - unsigned int max_dwells, unsigned int doppler_max, long freq, - long fs_in, int samples_per_ms, int samples_per_code, - int vector_length, unsigned int nsamples_total, - bool bit_transition_flag, bool use_CFAR_algorithm_flag, - unsigned int select_queue_Fpga, std::string device_name, bool dump, - std::string dump_filename); - - gps_pcps_acquisition_fpga_sc(unsigned int sampled_ms, - unsigned int max_dwells, unsigned int doppler_max, long freq, - long fs_in, int samples_per_ms, int samples_per_code, - int vector_length, unsigned int nsamples_total, - bool bit_transition_flag, bool use_CFAR_algorithm_flag, - unsigned int select_queue_Fpga, std::string device_name, bool dump, - std::string dump_filename); - int d_samples_per_code; - float d_threshold; - unsigned int d_doppler_max; - unsigned int d_doppler_step; - unsigned int d_max_dwells; - unsigned int d_well_count; - unsigned int d_fft_size; - unsigned long int d_sample_counter; - unsigned int d_num_doppler_bins; - Gnss_Synchro *d_gnss_synchro; - float d_mag;bool d_bit_transition_flag;bool d_use_CFAR_algorithm_flag; - std::ofstream d_dump_file; - bool d_active; - int d_state;bool d_dump; - unsigned int d_channel; - std::string d_dump_filename; - std::shared_ptr acquisition_fpga_8sc; - //void set_active2(bool active); - boost::thread d_acq_thread; - -public: - /*! - * \brief Default destructor. - */ - ~gps_pcps_acquisition_fpga_sc(); - - /*! - * \brief Set acquisition/tracking common Gnss_Synchro object pointer - * to exchange synchronization data between acquisition and tracking blocks. - * \param p_gnss_synchro Satellite information shared by the processing blocks. - */ - inline void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) - { - d_gnss_synchro = p_gnss_synchro; - } - - /*! - * \brief Returns the maximum peak of grid search. - */ - inline unsigned int mag() const - { - return d_mag; - } - - /*! - * \brief Initializes acquisition algorithm. - */ - void init(); - - /*! - * \brief Sets local code for PCPS acquisition algorithm. - * \param code - Pointer to the PRN code. - */ - void set_local_code(); - - /*! - * \brief Starts acquisition algorithm, turning from standby mode to - * active mode - * \param active - bool that activates/deactivates the block. - */ - - - void set_active(bool active); - - /*! - * \brief If set to 1, ensures that acquisition starts at the - * first available sample. - * \param state - int=1 forces start of acquisition - */ - void set_state(int state); - - /*! - * \brief Set acquisition channel unique ID - * \param channel - receiver channel. - */ - inline void set_channel(unsigned int channel) - { - d_channel = channel; - } - - /*! - * \brief Set statistics threshold of PCPS algorithm. - * \param threshold - Threshold for signal detection (check \ref Navitec2012, - * Algorithm 1, for a definition of this threshold). - */ - inline void set_threshold(float threshold) - { - d_threshold = threshold; - } - - /*! - * \brief Set maximum Doppler grid search - * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz]. - */ - inline void set_doppler_max(unsigned int doppler_max) - { - d_doppler_max = doppler_max; - acquisition_fpga_8sc->set_doppler_max(doppler_max); - } - - /*! - * \brief Set Doppler steps for the grid search - * \param doppler_step - Frequency bin of the search grid [Hz]. - */ - inline void set_doppler_step(unsigned int doppler_step) - { - d_doppler_step = doppler_step; - acquisition_fpga_8sc->set_doppler_step(doppler_step); - } - - /*! - * \brief Parallel Code Phase Search Acquisition signal processing. - */ - int general_work(int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - -}; - -#endif /* GNSS_SDR_GPS_PCPS_ACQUISITION_SC_H_*/ diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc new file mode 100644 index 000000000..4f21ffa7a --- /dev/null +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc @@ -0,0 +1,247 @@ +/*! + * \file pcps_acquisition_fpga.cc + * \brief This class implements a Parallel Code Phase Search Acquisition in the FPGA + * + * Note: The CFAR algorithm is not implemented in the FPGA. + * Note 2: The bit transition flag is not implemented in the FPGA + * + * \authors
    + *
  • Marc Majoral, 2017. mmajoral(at)cttc.cat + *
  • Javier Arribas, 2011. jarribas(at)cttc.es + *
  • Luis Esteve, 2012. luis(at)epsilon-formacion.com + *
  • Marc Molina, 2013. marc.molina.pena@gmail.com + *
  • Cillian O'Driscoll, 2017. cillian(at)ieee.org + *
+ * + * ------------------------------------------------------------------------- + * + * Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors) + * + * GNSS-SDR is a software defined Global Navigation + * Satellite Systems receiver + * + * This file is part of GNSS-SDR. + * + * GNSS-SDR is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GNSS-SDR is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNSS-SDR. If not, see . + * + * ------------------------------------------------------------------------- + */ + +#include "pcps_acquisition_fpga.h" +#include "GPS_L1_CA.h" // for GPS_TWO_PI +#include "GLONASS_L1_L2_CA.h" // for GLONASS_TWO_PI" +#include +#include + +using google::LogMessage; + +pcps_acquisition_fpga_sptr pcps_make_acquisition(pcpsconf_fpga_t conf_) +{ + return pcps_acquisition_fpga_sptr(new pcps_acquisition_fpga(conf_)); +} + + +pcps_acquisition_fpga::pcps_acquisition_fpga(pcpsconf_fpga_t conf_) : gr::block("pcps_acquisition_fpga", + gr::io_signature::make(0, 0, 0), + gr::io_signature::make(0, 0, 0)) +{ + this->message_port_register_out(pmt::mp("events")); + + acq_parameters = conf_; + d_sample_counter = 0; // SAMPLE COUNTER + d_active = false; + d_state = 0; + d_fft_size = acq_parameters.sampled_ms * acq_parameters.samples_per_ms; + d_mag = 0; + d_input_power = 0.0; + d_num_doppler_bins = 0; + d_threshold = 0.0; + d_doppler_step = 0; + d_test_statistics = 0.0; + d_channel = 0; + d_gnss_synchro = 0; + + acquisition_fpga = std::make_shared + (acq_parameters.device_name, d_fft_size, acq_parameters.doppler_max, acq_parameters.samples_per_ms, + acq_parameters.fs_in, acq_parameters.freq, acq_parameters.sampled_ms, acq_parameters.select_queue_Fpga, acq_parameters.all_fft_codes); + +} + + +pcps_acquisition_fpga::~pcps_acquisition_fpga() +{ + acquisition_fpga->free(); +} + + +void pcps_acquisition_fpga::set_local_code() +{ + acquisition_fpga->set_local_code(d_gnss_synchro->PRN); +} + + +void pcps_acquisition_fpga::init() +{ + d_gnss_synchro->Flag_valid_acquisition = false; + d_gnss_synchro->Flag_valid_symbol_output = false; + d_gnss_synchro->Flag_valid_pseudorange = false; + d_gnss_synchro->Flag_valid_word = false; + d_gnss_synchro->Acq_delay_samples = 0.0; + d_gnss_synchro->Acq_doppler_hz = 0.0; + d_gnss_synchro->Acq_samplestamp_samples = 0; + d_mag = 0.0; + d_input_power = 0.0; + d_num_doppler_bins = static_cast(std::ceil(static_cast(static_cast(acq_parameters.doppler_max) - static_cast(-acq_parameters.doppler_max)) / static_cast(d_doppler_step))); + + acquisition_fpga->init(); +} + + +void pcps_acquisition_fpga::set_state(int state) +{ + d_state = state; + if (d_state == 1) + { + d_gnss_synchro->Acq_delay_samples = 0.0; + d_gnss_synchro->Acq_doppler_hz = 0.0; + d_gnss_synchro->Acq_samplestamp_samples = 0; + //d_well_count = 0; + d_mag = 0.0; + d_input_power = 0.0; + d_test_statistics = 0.0; + d_active = true; + } + else if (d_state == 0) + { + } + else + { + LOG(ERROR) << "State can only be set to 0 or 1"; + } +} + + +void pcps_acquisition_fpga::send_positive_acquisition() +{ + // 6.1- Declare positive acquisition using a message port + //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL + DLOG(INFO) << "positive acquisition" + << ", satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN + << ", sample_stamp " << d_sample_counter + << ", test statistics value " << d_test_statistics + << ", test statistics threshold " << d_threshold + << ", code phase " << d_gnss_synchro->Acq_delay_samples + << ", doppler " << d_gnss_synchro->Acq_doppler_hz + << ", magnitude " << d_mag + << ", input signal power " << d_input_power; + + this->message_port_pub(pmt::mp("events"), pmt::from_long(1)); +} + + +void pcps_acquisition_fpga::send_negative_acquisition() +{ + // 6.2- Declare negative acquisition using a message port + //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL + DLOG(INFO) << "negative acquisition" + << ", satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN + << ", sample_stamp " << d_sample_counter + << ", test statistics value " << d_test_statistics + << ", test statistics threshold " << d_threshold + << ", code phase " << d_gnss_synchro->Acq_delay_samples + << ", doppler " << d_gnss_synchro->Acq_doppler_hz + << ", magnitude " << d_mag + << ", input signal power " << d_input_power; + + this->message_port_pub(pmt::mp("events"), pmt::from_long(2)); +} + + +void pcps_acquisition_fpga::set_active(bool active) +{ + d_active = active; + + // initialize acquisition algorithm + uint32_t indext = 0; + float magt = 0.0; + int effective_fft_size = d_fft_size; + float fft_normalization_factor = static_cast(d_fft_size) * static_cast(d_fft_size); + + d_input_power = 0.0; + d_mag = 0.0; + //d_well_count++; + + DLOG(INFO) << "Channel: " << d_channel + << " , doing acquisition of satellite: " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN + << " ,sample stamp: " << d_sample_counter << ", threshold: " + << d_threshold << ", doppler_max: " << acq_parameters.doppler_max + << ", doppler_step: " << d_doppler_step + // no CFAR algorithm in the FPGA + << ", use_CFAR_algorithm_flag: false"; + + unsigned int initial_sample; + float input_power_all = 0.0; + float input_power_computed = 0.0; + for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) + { + // doppler search steps + int doppler = -static_cast(acq_parameters.doppler_max) + d_doppler_step * doppler_index; + + acquisition_fpga->set_phase_step(doppler_index); + acquisition_fpga->run_acquisition(); // runs acquisition and waits until it is finished + acquisition_fpga->read_acquisition_results(&indext, &magt, + &initial_sample, &d_input_power); + d_sample_counter = initial_sample; + + if (d_mag < magt) + { + d_mag = magt; + + input_power_all = d_input_power / (effective_fft_size - 1); + input_power_computed = (d_input_power - d_mag) / (effective_fft_size - 1); + d_input_power = (d_input_power - d_mag) / (effective_fft_size - 1); + + d_gnss_synchro->Acq_delay_samples = static_cast(indext % acq_parameters.samples_per_code); + d_gnss_synchro->Acq_doppler_hz = static_cast(doppler); + d_gnss_synchro->Acq_samplestamp_samples = d_sample_counter; + + d_test_statistics = (d_mag / d_input_power); //* correction_factor; + } + + // In the case of the FPGA the option of dumping the results of the acquisition to a file is not available + // because the IFFT vector is not available + } + + if (d_test_statistics > d_threshold) + { + d_active = false; + send_positive_acquisition(); + d_state = 0; // Positive acquisition + } + else + { + d_state = 0; + d_active = false; + send_negative_acquisition(); + } +} + + +int pcps_acquisition_fpga::general_work(int noutput_items __attribute__((unused)), + gr_vector_int& ninput_items, gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items __attribute__((unused))) +{ + // the general work is not used with the acquisition that uses the FPGA + return noutput_items; +} diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h new file mode 100644 index 000000000..d140f538c --- /dev/null +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h @@ -0,0 +1,216 @@ +/*! + * \file pcps_acquisition_fpga.h + * \brief This class implements a Parallel Code Phase Search Acquisition in the FPGA. + * + * Note: The CFAR algorithm is not implemented in the FPGA. + * Note 2: The bit transition flag is not implemented in the FPGA + * + * Acquisition strategy (Kay Borre book + CFAR threshold). + *
    + *
  1. Compute the input signal power estimation + *
  2. Doppler serial search loop + *
  3. Perform the FFT-based circular convolution (parallel time search) + *
  4. Record the maximum peak and the associated synchronization parameters + *
  5. Compute the test statistics and compare to the threshold + *
  6. Declare positive or negative acquisition using a message queue + *
+ * + * Kay Borre book: K.Borre, D.M.Akos, N.Bertelsen, P.Rinder, and S.H.Jensen, + * "A Software-Defined GPS and Galileo Receiver. A Single-Frequency + * Approach", Birkhauser, 2007. pp 81-84 + * + * \authors
    + *
  • Marc Majoral, 2017. mmajoral(at)cttc.cat + *
  • Javier Arribas, 2011. jarribas(at)cttc.es + *
  • Luis Esteve, 2012. luis(at)epsilon-formacion.com + *
  • Marc Molina, 2013. marc.molina.pena@gmail.com + *
  • Cillian O'Driscoll, 2017. cillian(at)ieee.org + *
  • Antonio Ramos, 2017. antonio.ramos@cttc.es + *
+ * + * ------------------------------------------------------------------------- + * + * Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors) + * + * GNSS-SDR is a software defined Global Navigation + * Satellite Systems receiver + * + * This file is part of GNSS-SDR. + * + * GNSS-SDR is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GNSS-SDR is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNSS-SDR. If not, see . + * + * ------------------------------------------------------------------------- + */ + +#ifndef GNSS_SDR_PCPS_ACQUISITION_FPGA_H_ +#define GNSS_SDR_PCPS_ACQUISITION_FPGA_H_ + +#include "gnss_synchro.h" +#include +#include "fpga_acquisition.h" + +typedef struct +{ + /* pcps acquisition configuration */ + unsigned int sampled_ms; + unsigned int doppler_max; + long freq; + long fs_in; + int samples_per_ms; + int samples_per_code; + std::string dump_filename; + unsigned int select_queue_Fpga; + std::string device_name; + unsigned int code_length; + lv_16sc_t *all_fft_codes; // memory that contains all the code ffts + +} pcpsconf_fpga_t; + +class pcps_acquisition_fpga; + +typedef boost::shared_ptr pcps_acquisition_fpga_sptr; + +pcps_acquisition_fpga_sptr +pcps_make_acquisition(pcpsconf_fpga_t conf_); + +/*! + * \brief This class implements a Parallel Code Phase Search Acquisition that uses the FPGA. + * + * Check \ref Navitec2012 "An Open Source Galileo E1 Software Receiver", + * Algorithm 1, for a pseudocode description of this implementation. + */ +class pcps_acquisition_fpga : public gr::block +{ +private: + friend pcps_acquisition_fpga_sptr + + pcps_make_acquisition(pcpsconf_fpga_t conf_); + + pcps_acquisition_fpga(pcpsconf_fpga_t conf_); + + void send_negative_acquisition(); + + void send_positive_acquisition(); + + pcpsconf_fpga_t acq_parameters; + bool d_active; + float d_threshold; + float d_mag; + float d_input_power; + float d_test_statistics; + int d_state; + unsigned int d_channel; + unsigned int d_doppler_step; + unsigned int d_fft_size; + unsigned int d_num_doppler_bins; + unsigned long int d_sample_counter; + Gnss_Synchro* d_gnss_synchro; + std::shared_ptr acquisition_fpga; + + + +public: + ~pcps_acquisition_fpga(); + + /*! + * \brief Set acquisition/tracking common Gnss_Synchro object pointer + * to exchange synchronization data between acquisition and tracking blocks. + * \param p_gnss_synchro Satellite information shared by the processing blocks. + */ + inline void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) + { + d_gnss_synchro = p_gnss_synchro; + } + + /*! + * \brief Returns the maximum peak of grid search. + */ + inline unsigned int mag() const + { + return d_mag; + } + + /*! + * \brief Initializes acquisition algorithm. + */ + void init(); + + /*! + * \brief Sets local code for PCPS acquisition algorithm. + * \param code - Pointer to the PRN code. + */ + void set_local_code(); + + /*! + * \brief If set to 1, ensures that acquisition starts at the + * first available sample. + * \param state - int=1 forces start of acquisition + */ + void set_state(int state); + + /*! + * \brief Starts acquisition algorithm, turning from standby mode to + * active mode + * \param active - bool that activates/deactivates the block. + */ + void set_active(bool active); + + /*! + * \brief Set acquisition channel unique ID + * \param channel - receiver channel. + */ + inline void set_channel(unsigned int channel) + { + d_channel = channel; + } + + /*! + * \brief Set statistics threshold of PCPS algorithm. + * \param threshold - Threshold for signal detection (check \ref Navitec2012, + * Algorithm 1, for a definition of this threshold). + */ + inline void set_threshold(float threshold) + { + d_threshold = threshold; + } + + /*! + * \brief Set maximum Doppler grid search + * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz]. + */ + inline void set_doppler_max(unsigned int doppler_max) + { + acq_parameters.doppler_max = doppler_max; + acquisition_fpga->set_doppler_max(doppler_max); + } + + /*! + * \brief Set Doppler steps for the grid search + * \param doppler_step - Frequency bin of the search grid [Hz]. + */ + inline void set_doppler_step(unsigned int doppler_step) + { + d_doppler_step = doppler_step; + acquisition_fpga->set_doppler_step(doppler_step); + } + + /*! + * \brief Parallel Code Phase Search Acquisition signal processing. + */ + int general_work(int noutput_items, gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; + +#endif /* GNSS_SDR_PCPS_ACQUISITION_FPGA_H_*/ diff --git a/src/algorithms/acquisition/libs/CMakeLists.txt b/src/algorithms/acquisition/libs/CMakeLists.txt index 53feb9366..f4adf131c 100644 --- a/src/algorithms/acquisition/libs/CMakeLists.txt +++ b/src/algorithms/acquisition/libs/CMakeLists.txt @@ -18,7 +18,7 @@ set(ACQUISITION_LIB_SOURCES - gps_fpga_acquisition_8sc.cc + fpga_acquisition.cc ) include_directories( diff --git a/src/algorithms/acquisition/libs/gps_fpga_acquisition_8sc.cc b/src/algorithms/acquisition/libs/fpga_acquisition.cc similarity index 55% rename from src/algorithms/acquisition/libs/gps_fpga_acquisition_8sc.cc rename to src/algorithms/acquisition/libs/fpga_acquisition.cc index 16280e1d4..213183ba5 100644 --- a/src/algorithms/acquisition/libs/gps_fpga_acquisition_8sc.cc +++ b/src/algorithms/acquisition/libs/fpga_acquisition.cc @@ -1,12 +1,12 @@ /*! - * \file gps_fpga_acquisition_8sc.cc + * \file fpga_acquisition.cc * \brief High optimized FPGA vector correlator class * \authors
    - *
  • Marc Majoral, 2017. mmajoral(at)cttc.cat - *
+ *
  • Marc Majoral, 2018. mmajoral(at)cttc.cat + * * - * Class that controls and executes a high optimized vector correlator - * class in the FPGA + * Class that controls and executes a high optimized acquisition HW + * accelerator in the FPGA * * ------------------------------------------------------------------------- * @@ -33,65 +33,46 @@ * ------------------------------------------------------------------------- */ -#include "gps_fpga_acquisition_8sc.h" +#include "fpga_acquisition.h" #include "gps_sdr_signal_processing.h" -#include -// allocate memory dynamically -#include - -// libraries used by DMA test code and GIPO test code -#include +// libraries used by the GIPO #include -#include -#include - -// libraries used by DMA test code -#include -#include -#include -#include - -// libraries used by GPIO test code -#include -#include #include // logging #include -// volk -#include - // GPS L1 #include "GPS_L1_CA.h" #define PAGE_SIZE 0x10000 #define MAX_PHASE_STEP_RAD 0.999999999534339 // 1 - pow(2,-31); -#define NUM_PRNs 32 -#define TEST_REGISTER_ACQ_WRITEVAL 0x55AA +#define TEST_REG_SANITY_CHECK 0x55AA -bool gps_fpga_acquisition_8sc::init() +bool fpga_acquisition::init() { // configure the acquisition with the main initialization values - gps_fpga_acquisition_8sc::configure_acquisition(); + fpga_acquisition::configure_acquisition(); return true; } -bool gps_fpga_acquisition_8sc::set_local_code(unsigned int PRN) +bool fpga_acquisition::set_local_code(unsigned int PRN) { // select the code with the chosen PRN - gps_fpga_acquisition_8sc::fpga_configure_acquisition_local_code( + fpga_acquisition::fpga_configure_acquisition_local_code( &d_all_fft_codes[d_nsamples_total * (PRN - 1)]); return true; } -gps_fpga_acquisition_8sc::gps_fpga_acquisition_8sc(std::string device_name, - unsigned int vector_length, unsigned int nsamples, +fpga_acquisition::fpga_acquisition(std::string device_name, + unsigned int nsamples, unsigned int doppler_max, unsigned int nsamples_total, long fs_in, long freq, - unsigned int sampled_ms, unsigned select_queue) + unsigned int sampled_ms, unsigned select_queue, + lv_16sc_t *all_fft_codes) { + unsigned int vector_length = nsamples_total*sampled_ms; // initial values d_device_name = device_name; d_freq = freq; @@ -104,98 +85,49 @@ gps_fpga_acquisition_8sc::gps_fpga_acquisition_8sc(std::string device_name, d_doppler_step = 0; d_fd = 0; // driver descriptor d_map_base = nullptr; // driver memory map - // Direct FFT - d_fft_if = new gr::fft::fft_complex(vector_length, true); - // allocate memory to compute all the PRNs - // and compute all the possible codes - std::complex* code = new std::complex[nsamples_total]; // buffer for the local code - gr_complex* d_fft_codes_padded = static_cast(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); - d_all_fft_codes = new lv_16sc_t[nsamples_total * NUM_PRNs]; // memory containing all the possible fft codes for PRN 0 to 32 - float max; // temporary maxima search - for (unsigned int PRN = 1; PRN <= NUM_PRNs; PRN++) - { - gps_l1_ca_code_gen_complex_sampled(code, PRN, fs_in, 0); // generate PRN code - // fill in zero padding - for (int s=nsamples;sget_inbuf() + offset, code, sizeof(gr_complex) * nsamples_total); // copy to FFT buffer - d_fft_if->execute(); // Run the FFT of local code - volk_32fc_conjugate_32fc(d_fft_codes_padded, d_fft_if->get_outbuf(), nsamples_total); // conjugate values - max = 0; // initialize maximum value - for (unsigned int i = 0; i < nsamples_total; i++) // search for maxima - { - if (std::abs(d_fft_codes_padded[i].real()) > max) - { - max = std::abs(d_fft_codes_padded[i].real()); - } - if (std::abs(d_fft_codes_padded[i].imag()) > max) - { - max = std::abs(d_fft_codes_padded[i].imag()); - } - } - for (unsigned int i = 0; i < nsamples_total; i++) // map the FFT to the dynamic range of the fixed point values an copy to buffer containing all FFTs - { - d_all_fft_codes[i + nsamples_total * (PRN -1)] = lv_16sc_t(static_cast(d_fft_codes_padded[i].real() * (pow(2, 7) - 1) / max), - static_cast(d_fft_codes_padded[i].imag() * (pow(2, 7) - 1) / max)); + d_all_fft_codes = all_fft_codes; - } - } // open communication with HW accelerator - //printf("opening device %s\n", d_device_name.c_str()); if ((d_fd = open(d_device_name.c_str(), O_RDWR | O_SYNC)) == -1) { LOG(WARNING) << "Cannot open deviceio" << d_device_name; - //std::cout << "acquisition cannot open deviceio"; } d_map_base = reinterpret_cast(mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, d_fd, 0)); + if (d_map_base == reinterpret_cast(-1)) { LOG(WARNING) << "Cannot map the FPGA acquisition module into user memory"; - //std::cout << "acquisition : could not map the fpga registers to the driver" << std::endl; } + // sanity check : check test register - // we only nee to do this when the class is created - // but the device is not opened yet when the class is create - // because we need to open and close the device every time we run an acquisition - // since the same device may be used by more than one class (gps acquisition, galileo - // acquisition, etc ..) - unsigned writeval = TEST_REGISTER_ACQ_WRITEVAL; + unsigned writeval = TEST_REG_SANITY_CHECK; unsigned readval; - readval = gps_fpga_acquisition_8sc::fpga_acquisition_test_register(writeval); + readval = fpga_acquisition::fpga_acquisition_test_register(writeval); if (writeval != readval) { LOG(WARNING) << "Acquisition test register sanity check failed"; - //std:: cout << "Acquisition test register sanity check failed" << std::endl; } else { - //std::cout << "Acquisition test register sanity check success !" << std::endl; LOG(INFO) << "Acquisition test register sanity check success !"; } - gps_fpga_acquisition_8sc::reset_acquisition(); + fpga_acquisition::reset_acquisition(); DLOG(INFO) << "Acquisition FPGA class created"; - // temporary buffers that we can delete - delete[] code; - delete d_fft_if; - delete[] d_fft_codes_padded; + } -gps_fpga_acquisition_8sc::~gps_fpga_acquisition_8sc() +fpga_acquisition::~fpga_acquisition() { close_device(); - delete[] d_all_fft_codes; } -bool gps_fpga_acquisition_8sc::free() +bool fpga_acquisition::free() { return true; } -unsigned gps_fpga_acquisition_8sc::fpga_acquisition_test_register(unsigned writeval) +unsigned fpga_acquisition::fpga_acquisition_test_register(unsigned writeval) { unsigned readval; // write value to test register @@ -206,7 +138,7 @@ unsigned gps_fpga_acquisition_8sc::fpga_acquisition_test_register(unsigned write return readval; } -void gps_fpga_acquisition_8sc::fpga_configure_acquisition_local_code(lv_16sc_t fft_local_code[]) +void fpga_acquisition::fpga_configure_acquisition_local_code(lv_16sc_t fft_local_code[]) { unsigned short local_code; unsigned int k, tmp, tmp2; @@ -224,7 +156,7 @@ void gps_fpga_acquisition_8sc::fpga_configure_acquisition_local_code(lv_16sc_t f } } -void gps_fpga_acquisition_8sc::run_acquisition(void) +void fpga_acquisition::run_acquisition(void) { // enable interrupts int reenable = 1; @@ -243,7 +175,7 @@ void gps_fpga_acquisition_8sc::run_acquisition(void) } } -void gps_fpga_acquisition_8sc::configure_acquisition() +void fpga_acquisition::configure_acquisition() { d_map_base[0] = d_select_queue; d_map_base[1] = d_vector_length; @@ -251,7 +183,7 @@ void gps_fpga_acquisition_8sc::configure_acquisition() d_map_base[5] = (int) log2((float) d_vector_length); // log2 FFTlength } -void gps_fpga_acquisition_8sc::set_phase_step(unsigned int doppler_index) +void fpga_acquisition::set_phase_step(unsigned int doppler_index) { float phase_step_rad_real; float phase_step_rad_int_temp; @@ -274,7 +206,7 @@ void gps_fpga_acquisition_8sc::set_phase_step(unsigned int doppler_index) d_map_base[3] = phase_step_rad_int; } -void gps_fpga_acquisition_8sc::read_acquisition_results(uint32_t* max_index, +void fpga_acquisition::read_acquisition_results(uint32_t* max_index, float* max_magnitude, unsigned *initial_sample, float *power_sum) { unsigned readval = 0; @@ -288,18 +220,18 @@ void gps_fpga_acquisition_8sc::read_acquisition_results(uint32_t* max_index, *max_index = readval; } -void gps_fpga_acquisition_8sc::block_samples() +void fpga_acquisition::block_samples() { d_map_base[14] = 1; // block the samples } -void gps_fpga_acquisition_8sc::unblock_samples() +void fpga_acquisition::unblock_samples() { d_map_base[14] = 0; // unblock the samples } -void gps_fpga_acquisition_8sc::close_device() +void fpga_acquisition::close_device() { unsigned * aux = const_cast(d_map_base); if (munmap(static_cast(aux), PAGE_SIZE) == -1) @@ -309,7 +241,7 @@ void gps_fpga_acquisition_8sc::close_device() close(d_fd); } -void gps_fpga_acquisition_8sc::reset_acquisition(void) +void fpga_acquisition::reset_acquisition(void) { d_map_base[6] = 2; // writing a 2 to d_map_base[6] resets the multicorrelator } diff --git a/src/algorithms/acquisition/libs/gps_fpga_acquisition_8sc.h b/src/algorithms/acquisition/libs/fpga_acquisition.h similarity index 78% rename from src/algorithms/acquisition/libs/gps_fpga_acquisition_8sc.h rename to src/algorithms/acquisition/libs/fpga_acquisition.h index 609abf0d9..45cae5475 100644 --- a/src/algorithms/acquisition/libs/gps_fpga_acquisition_8sc.h +++ b/src/algorithms/acquisition/libs/fpga_acquisition.h @@ -1,12 +1,12 @@ /*! - * \file fpga_acquisition_8sc.h - * \brief High optimized FPGA vector correlator class for lv_16sc_t (short int complex). + * \file fpga_acquisition.h + * \brief High optimized FPGA vector correlator class * \authors
      - *
    • Marc Majoral, 2017. mmajoral(at)cttc.cat + *
    • Marc Majoral, 2018. mmajoral(at)cttc.cat *
    * - * Class that controls and executes a high optimized vector correlator - * class in the FPGA + * Class that controls and executes a high optimized acquisition HW + * accelerator in the FPGA * * ------------------------------------------------------------------------- * @@ -33,26 +33,26 @@ * ------------------------------------------------------------------------- */ -#ifndef GNSS_GPS_SDR_FPGA_ACQUISITION_8SC_H_ -#define GNSS_GPS_SDR_FPGA_ACQUISITION_8SC_H_ +#ifndef GNSS_SDR_FPGA_ACQUISITION_H_ +#define GNSS_SDR_FPGA_ACQUISITION_H_ #include -#include #include /*! * \brief Class that implements carrier wipe-off and correlators. */ -class gps_fpga_acquisition_8sc +class fpga_acquisition { public: - gps_fpga_acquisition_8sc(std::string device_name, - unsigned int vector_length, unsigned int nsamples, + fpga_acquisition(std::string device_name, + unsigned int nsamples, unsigned int doppler_max, unsigned int nsamples_total, long fs_in, long freq, - unsigned int sampled_ms, unsigned select_queue); - ~gps_fpga_acquisition_8sc();bool init();bool set_local_code( - unsigned int PRN); //int code_length_chips, const lv_16sc_t* local_code_in, float *shifts_chips); + unsigned int sampled_ms, unsigned select_queue, + lv_16sc_t *all_fft_codes); + ~fpga_acquisition();bool init();bool set_local_code( + unsigned int PRN); bool free(); void run_acquisition(void); void set_phase_step(unsigned int doppler_index); @@ -60,7 +60,7 @@ public: unsigned *initial_sample, float *power_sum); void block_samples(); void unblock_samples(); - //void open_device(); + /*! * \brief Set maximum Doppler grid search * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz]. @@ -69,6 +69,7 @@ public: { d_doppler_max = doppler_max; } + /*! * \brief Set Doppler steps for the grid search * \param doppler_step - Frequency bin of the search grid [Hz]. @@ -102,4 +103,4 @@ private: void close_device(); }; -#endif /* GNSS_GPS_SDR_FPGA_MULTICORRELATOR_H_ */ +#endif /* GNSS_SDR_FPGA_ACQUISITION_H_ */ From 1573c40938eb9fa77391893e9c790bb5ce2465c8 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 28 Apr 2018 12:33:46 +0200 Subject: [PATCH 54/82] Expose some tracking parameters to the configuration Replace GPS_L5i_DLL_PLL_Tracking by GPS_L5_DLL_PLL_Tracking since now it can also track the Q component. Old name still recognized for backward compatibility Fix typo in flag documentation --- src/algorithms/libs/gnss_sdr_flags.cc | 2 +- src/algorithms/libs/gnss_sdr_flags.h | 2 +- .../tracking/adapters/CMakeLists.txt | 2 +- .../galileo_e1_dll_pll_veml_tracking.cc | 13 +++++ .../adapters/galileo_e5a_dll_pll_tracking.cc | 13 +++++ .../adapters/gps_l1_ca_dll_pll_tracking.cc | 13 +++++ .../adapters/gps_l2_m_dll_pll_tracking.cc | 13 +++++ ...tracking.cc => gps_l5_dll_pll_tracking.cc} | 37 ++++++++---- ...l_tracking.h => gps_l5_dll_pll_tracking.h} | 20 +++---- .../gnuradio_blocks/dll_pll_veml_tracking.cc | 56 +++++++++++-------- .../gnuradio_blocks/dll_pll_veml_tracking.h | 5 +- src/core/receiver/gnss_block_factory.cc | 20 +++---- 12 files changed, 135 insertions(+), 61 deletions(-) rename src/algorithms/tracking/adapters/{gps_l5i_dll_pll_tracking.cc => gps_l5_dll_pll_tracking.cc} (81%) rename src/algorithms/tracking/adapters/{gps_l5i_dll_pll_tracking.h => gps_l5_dll_pll_tracking.h} (85%) diff --git a/src/algorithms/libs/gnss_sdr_flags.cc b/src/algorithms/libs/gnss_sdr_flags.cc index db6e37757..38fe3858f 100644 --- a/src/algorithms/libs/gnss_sdr_flags.cc +++ b/src/algorithms/libs/gnss_sdr_flags.cc @@ -54,7 +54,7 @@ DEFINE_int32(cn0_samples, 20, "Number of correlator outputs used for CN0 estimat DEFINE_int32(cn0_min, 25, "Minimum valid CN0 (in dB-Hz)."); -DEFINE_int32(max_lock_fail, 50, "Number number of lock failures before dropping satellite."); +DEFINE_int32(max_lock_fail, 50, "Maximum number of lock failures before dropping a satellite."); DEFINE_double(carrier_lock_th, 0.85, "Carrier lock threshold (in rad)."); diff --git a/src/algorithms/libs/gnss_sdr_flags.h b/src/algorithms/libs/gnss_sdr_flags.h index c0c67383d..762e94fe8 100644 --- a/src/algorithms/libs/gnss_sdr_flags.h +++ b/src/algorithms/libs/gnss_sdr_flags.h @@ -50,7 +50,7 @@ DECLARE_int32(doppler_step); //property(role + ".cn0_samples", 20); + if (FLAGS_cn0_samples != 20) cn0_samples = FLAGS_cn0_samples; + trk_param.cn0_samples = cn0_samples; + int cn0_min = configuration->property(role + ".cn0_min", 25); + if (FLAGS_cn0_min != 25) cn0_min = FLAGS_cn0_min; + trk_param.cn0_min = cn0_min; + int max_lock_fail = configuration->property(role + ".max_lock_fail", 50); + if (FLAGS_max_lock_fail != 50) max_lock_fail = FLAGS_max_lock_fail; + trk_param.max_lock_fail = max_lock_fail; + double carrier_lock_th = configuration->property(role + ".carrier_lock_th", 0.85); + if (FLAGS_carrier_lock_th != 0.85) carrier_lock_th = FLAGS_carrier_lock_th; + trk_param.carrier_lock_th = carrier_lock_th; + //################# MAKE TRACKING GNURadio object ################### if (item_type.compare("gr_complex") == 0) { diff --git a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc index e4de78c22..0e95e1004 100644 --- a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc @@ -101,6 +101,19 @@ GalileoE5aDllPllTracking::GalileoE5aDllPllTracking( trk_param.system = 'E'; char sig_[3] = "5X"; std::memcpy(trk_param.signal, sig_, 3); + int cn0_samples = configuration->property(role + ".cn0_samples", 20); + if (FLAGS_cn0_samples != 20) cn0_samples = FLAGS_cn0_samples; + trk_param.cn0_samples = cn0_samples; + int cn0_min = configuration->property(role + ".cn0_min", 25); + if (FLAGS_cn0_min != 25) cn0_min = FLAGS_cn0_min; + trk_param.cn0_min = cn0_min; + int max_lock_fail = configuration->property(role + ".max_lock_fail", 50); + if (FLAGS_max_lock_fail != 50) max_lock_fail = FLAGS_max_lock_fail; + trk_param.max_lock_fail = max_lock_fail; + double carrier_lock_th = configuration->property(role + ".carrier_lock_th", 0.85); + if (FLAGS_carrier_lock_th != 0.85) carrier_lock_th = FLAGS_carrier_lock_th; + trk_param.carrier_lock_th = carrier_lock_th; + //################# MAKE TRACKING GNURadio object ################### if (item_type.compare("gr_complex") == 0) { diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc index c43c1de8a..f0257d5b8 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc @@ -105,6 +105,19 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking( trk_param.system = 'G'; char sig_[3] = "1C"; std::memcpy(trk_param.signal, sig_, 3); + int cn0_samples = configuration->property(role + ".cn0_samples", 20); + if (FLAGS_cn0_samples != 20) cn0_samples = FLAGS_cn0_samples; + trk_param.cn0_samples = cn0_samples; + int cn0_min = configuration->property(role + ".cn0_min", 25); + if (FLAGS_cn0_min != 25) cn0_min = FLAGS_cn0_min; + trk_param.cn0_min = cn0_min; + int max_lock_fail = configuration->property(role + ".max_lock_fail", 50); + if (FLAGS_max_lock_fail != 50) max_lock_fail = FLAGS_max_lock_fail; + trk_param.max_lock_fail = max_lock_fail; + double carrier_lock_th = configuration->property(role + ".carrier_lock_th", 0.85); + if (FLAGS_carrier_lock_th != 0.85) carrier_lock_th = FLAGS_carrier_lock_th; + trk_param.carrier_lock_th = carrier_lock_th; + //################# MAKE TRACKING GNURadio object ################### if (item_type.compare("gr_complex") == 0) { diff --git a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc index 7ed9444a6..794983979 100644 --- a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc @@ -92,6 +92,19 @@ GpsL2MDllPllTracking::GpsL2MDllPllTracking( trk_param.system = 'G'; char sig_[3] = "2S"; std::memcpy(trk_param.signal, sig_, 3); + int cn0_samples = configuration->property(role + ".cn0_samples", 20); + if (FLAGS_cn0_samples != 20) cn0_samples = FLAGS_cn0_samples; + trk_param.cn0_samples = cn0_samples; + int cn0_min = configuration->property(role + ".cn0_min", 25); + if (FLAGS_cn0_min != 25) cn0_min = FLAGS_cn0_min; + trk_param.cn0_min = cn0_min; + int max_lock_fail = configuration->property(role + ".max_lock_fail", 50); + if (FLAGS_max_lock_fail != 50) max_lock_fail = FLAGS_max_lock_fail; + trk_param.max_lock_fail = max_lock_fail; + double carrier_lock_th = configuration->property(role + ".carrier_lock_th", 0.85); + if (FLAGS_carrier_lock_th != 0.85) carrier_lock_th = FLAGS_carrier_lock_th; + trk_param.carrier_lock_th = carrier_lock_th; + //################# MAKE TRACKING GNURadio object ################### if (item_type.compare("gr_complex") == 0) { diff --git a/src/algorithms/tracking/adapters/gps_l5i_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc similarity index 81% rename from src/algorithms/tracking/adapters/gps_l5i_dll_pll_tracking.cc rename to src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc index 38ab6f55e..f41797fe6 100644 --- a/src/algorithms/tracking/adapters/gps_l5i_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc @@ -1,7 +1,7 @@ /*! - * \file gps_l5i_dll_pll_tracking.cc + * \file gps_l5_dll_pll_tracking.cc * \brief Interface of an adapter of a DLL+PLL tracking loop block - * for GPS L5i to a TrackingInterface + * for GPS L5 to a TrackingInterface * \author Javier Arribas, 2017. jarribas(at)cttc.es * * Code DLL + carrier PLL according to the algorithms described in: @@ -35,7 +35,7 @@ */ -#include "gps_l5i_dll_pll_tracking.h" +#include "gps_l5_dll_pll_tracking.h" #include "configuration_interface.h" #include "GPS_L5.h" #include "gnss_sdr_flags.h" @@ -45,7 +45,7 @@ using google::LogMessage; -GpsL5iDllPllTracking::GpsL5iDllPllTracking( +GpsL5DllPllTracking::GpsL5DllPllTracking( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { @@ -101,6 +101,19 @@ GpsL5iDllPllTracking::GpsL5iDllPllTracking( trk_param.system = 'G'; char sig_[3] = "L5"; std::memcpy(trk_param.signal, sig_, 3); + int cn0_samples = configuration->property(role + ".cn0_samples", 20); + if (FLAGS_cn0_samples != 20) cn0_samples = FLAGS_cn0_samples; + trk_param.cn0_samples = cn0_samples; + int cn0_min = configuration->property(role + ".cn0_min", 25); + if (FLAGS_cn0_min != 25) cn0_min = FLAGS_cn0_min; + trk_param.cn0_min = cn0_min; + int max_lock_fail = configuration->property(role + ".max_lock_fail", 50); + if (FLAGS_max_lock_fail != 50) max_lock_fail = FLAGS_max_lock_fail; + trk_param.max_lock_fail = max_lock_fail; + double carrier_lock_th = configuration->property(role + ".carrier_lock_th", 0.85); + if (FLAGS_carrier_lock_th != 0.85) carrier_lock_th = FLAGS_carrier_lock_th; + trk_param.carrier_lock_th = carrier_lock_th; + //################# MAKE TRACKING GNURadio object ################### if (item_type.compare("gr_complex") == 0) { @@ -117,12 +130,12 @@ GpsL5iDllPllTracking::GpsL5iDllPllTracking( } -GpsL5iDllPllTracking::~GpsL5iDllPllTracking() +GpsL5DllPllTracking::~GpsL5DllPllTracking() { } -void GpsL5iDllPllTracking::start_tracking() +void GpsL5DllPllTracking::start_tracking() { tracking_->start_tracking(); } @@ -131,20 +144,20 @@ void GpsL5iDllPllTracking::start_tracking() /* * Set tracking channel unique ID */ -void GpsL5iDllPllTracking::set_channel(unsigned int channel) +void GpsL5DllPllTracking::set_channel(unsigned int channel) { channel_ = channel; tracking_->set_channel(channel); } -void GpsL5iDllPllTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) +void GpsL5DllPllTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) { tracking_->set_gnss_synchro(p_gnss_synchro); } -void GpsL5iDllPllTracking::connect(gr::top_block_sptr top_block) +void GpsL5DllPllTracking::connect(gr::top_block_sptr top_block) { if (top_block) { /* top_block is not null */ @@ -153,7 +166,7 @@ void GpsL5iDllPllTracking::connect(gr::top_block_sptr top_block) } -void GpsL5iDllPllTracking::disconnect(gr::top_block_sptr top_block) +void GpsL5DllPllTracking::disconnect(gr::top_block_sptr top_block) { if (top_block) { /* top_block is not null */ @@ -162,13 +175,13 @@ void GpsL5iDllPllTracking::disconnect(gr::top_block_sptr top_block) } -gr::basic_block_sptr GpsL5iDllPllTracking::get_left_block() +gr::basic_block_sptr GpsL5DllPllTracking::get_left_block() { return tracking_; } -gr::basic_block_sptr GpsL5iDllPllTracking::get_right_block() +gr::basic_block_sptr GpsL5DllPllTracking::get_right_block() { return tracking_; } diff --git a/src/algorithms/tracking/adapters/gps_l5i_dll_pll_tracking.h b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.h similarity index 85% rename from src/algorithms/tracking/adapters/gps_l5i_dll_pll_tracking.h rename to src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.h index 31a6d41f9..119776b9f 100644 --- a/src/algorithms/tracking/adapters/gps_l5i_dll_pll_tracking.h +++ b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.h @@ -1,7 +1,7 @@ /*! - * \file gps_l5idll_pll_tracking.h + * \file gps_l5_dll_pll_tracking.h * \brief Interface of an adapter of a DLL+PLL tracking loop block - * for GPS L5i to a TrackingInterface + * for GPS L5 to a TrackingInterface * \author Javier Arribas, 2017. jarribas(at)cttc.es * * Code DLL + carrier PLL according to the algorithms described in: @@ -34,8 +34,8 @@ * ------------------------------------------------------------------------- */ -#ifndef GNSS_SDR_GPS_L5i_DLL_PLL_TRACKING_H_ -#define GNSS_SDR_GPS_L5i_DLL_PLL_TRACKING_H_ +#ifndef GNSS_SDR_GPS_L5_DLL_PLL_TRACKING_H_ +#define GNSS_SDR_GPS_L5_DLL_PLL_TRACKING_H_ #include "tracking_interface.h" #include "dll_pll_veml_tracking.h" @@ -46,25 +46,25 @@ class ConfigurationInterface; /*! * \brief This class implements a code DLL + carrier PLL tracking loop */ -class GpsL5iDllPllTracking : public TrackingInterface +class GpsL5DllPllTracking : public TrackingInterface { public: - GpsL5iDllPllTracking(ConfigurationInterface* configuration, + GpsL5DllPllTracking(ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams); - virtual ~GpsL5iDllPllTracking(); + virtual ~GpsL5DllPllTracking(); inline std::string role() override { return role_; } - //! Returns "GPS_L5i_DLL_PLL_Tracking" + //! Returns "GPS_L5_DLL_PLL_Tracking" inline std::string implementation() override { - return "GPS_L5i_DLL_PLL_Tracking"; + return "GPS_L5_DLL_PLL_Tracking"; } inline size_t item_size() override @@ -99,4 +99,4 @@ private: unsigned int out_streams_; }; -#endif // GNSS_SDR_GPS_L5i_DLL_PLL_TRACKING_H_ +#endif // GNSS_SDR_GPS_L5_DLL_PLL_TRACKING_H_ diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index d53eaad66..515e21ada 100755 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -48,7 +48,6 @@ #include "gps_l2c_signal.h" #include "GPS_L5.h" #include "gps_l5_signal.h" -#include "gnss_sdr_flags.h" #include #include #include @@ -93,6 +92,18 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(dllpllconf_t conf_) : gr::block("dl d_secondary_code_length = 0; d_secondary_code_string = nullptr; signal_type = std::string(trk_parameters.signal); + + std::map map_signal_pretty_name; + map_signal_pretty_name["1C"] = "L1 C/A"; + map_signal_pretty_name["1B"] = "E1"; + map_signal_pretty_name["1G"] = "L1 C/A"; + map_signal_pretty_name["2S"] = "L2C"; + map_signal_pretty_name["2G"] = "L2 C/A"; + map_signal_pretty_name["5X"] = "E5a"; + map_signal_pretty_name["L5"] = "L5"; + + signal_pretty_name = map_signal_pretty_name[signal_type]; + if (trk_parameters.system == 'G') { systemName = "GPS"; @@ -135,17 +146,19 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(dllpllconf_t conf_) : gr::block("dl d_code_length_chips = static_cast(GPS_L5i_CODE_LENGTH_CHIPS); // GPS L5 does not have pilot secondary code d_secondary = true; + interchange_iq = false; if (trk_parameters.track_pilot) { d_secondary_code_length = static_cast(GPS_L5q_NH_CODE_LENGTH); d_secondary_code_string = const_cast(&GPS_L5q_NH_CODE_STR); - interchange_iq = true; + signal_pretty_name = signal_pretty_name + "Q"; + //interchange_iq = true; } else { d_secondary_code_length = static_cast(GPS_L5i_NH_CODE_LENGTH); d_secondary_code_string = const_cast(&GPS_L5i_NH_CODE_STR); - interchange_iq = false; + signal_pretty_name = signal_pretty_name + "I"; } } else @@ -180,10 +193,12 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(dllpllconf_t conf_) : gr::block("dl d_secondary = true; d_secondary_code_length = static_cast(Galileo_E1_C_SECONDARY_CODE_LENGTH); d_secondary_code_string = const_cast(&Galileo_E1_C_SECONDARY_CODE); + signal_pretty_name = signal_pretty_name + "C"; } else { d_secondary = false; + signal_pretty_name = signal_pretty_name + "B"; } interchange_iq = false; // Note that E1-B and E1-C are in anti-phase, NOT IN QUADRATURE. See Galileo ICD. } @@ -197,16 +212,18 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(dllpllconf_t conf_) : gr::block("dl d_code_samples_per_chip = 1; d_code_length_chips = static_cast(Galileo_E5a_CODE_LENGTH_CHIPS); d_secondary = true; + interchange_iq = false; if (trk_parameters.track_pilot) { - interchange_iq = true; d_secondary_code_length = static_cast(Galileo_E5a_Q_SECONDARY_CODE_LENGTH); + signal_pretty_name = signal_pretty_name + "Q"; + // interchange_iq = true; } else { - interchange_iq = false; d_secondary_code_length = static_cast(Galileo_E5a_I_SECONDARY_CODE_LENGTH); d_secondary_code_string = const_cast(&Galileo_E5a_I_SECONDARY_CODE); + signal_pretty_name = signal_pretty_name + "I"; } } else @@ -338,11 +355,11 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(dllpllconf_t conf_) : gr::block("dl // CN0 estimation and lock detector buffers d_cn0_estimation_counter = 0; - d_Prompt_buffer = new gr_complex[FLAGS_cn0_samples]; + d_Prompt_buffer = new gr_complex[trk_parameters.cn0_samples]; d_carrier_lock_test = 1.0; d_CN0_SNV_dB_Hz = 0.0; d_carrier_lock_fail_counter = 0; - d_carrier_lock_threshold = FLAGS_carrier_lock_th; + d_carrier_lock_threshold = trk_parameters.carrier_lock_th; clear_tracking_vars(); @@ -361,16 +378,6 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(dllpllconf_t conf_) : gr::block("dl d_code_phase_samples = 0.0; d_last_prompt = gr_complex(0.0, 0.0); d_state = 0; // initial state: standby - - map_signal_pretty_name["1C"] = "L1 C/A"; - map_signal_pretty_name["1B"] = "E1"; - map_signal_pretty_name["1G"] = "L1 C/A"; - map_signal_pretty_name["2S"] = "L2C"; - map_signal_pretty_name["2G"] = "L2 C/A"; - map_signal_pretty_name["5X"] = "E5a"; - map_signal_pretty_name["L5"] = "L5"; - - signal_pretty_name = map_signal_pretty_name[signal_type]; } @@ -618,7 +625,8 @@ bool dll_pll_veml_tracking::acquire_secondary() bool dll_pll_veml_tracking::cn0_and_tracking_lock_status(double coh_integration_time_s) { // ####### CN0 ESTIMATION AND LOCK DETECTORS ###### - if (d_cn0_estimation_counter < FLAGS_cn0_samples) + + if (d_cn0_estimation_counter < trk_parameters.cn0_samples) { // fill buffer with prompt correlator output values d_Prompt_buffer[d_cn0_estimation_counter] = d_P_accu; @@ -629,11 +637,11 @@ bool dll_pll_veml_tracking::cn0_and_tracking_lock_status(double coh_integration_ { d_cn0_estimation_counter = 0; // Code lock indicator - d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, coh_integration_time_s); + d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, trk_parameters.cn0_samples, coh_integration_time_s); // Carrier lock indicator - d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, FLAGS_cn0_samples); + d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, trk_parameters.cn0_samples); // Loss of lock detection - if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < FLAGS_cn0_min) + if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < trk_parameters.cn0_min) { d_carrier_lock_fail_counter++; } @@ -641,7 +649,7 @@ bool dll_pll_veml_tracking::cn0_and_tracking_lock_status(double coh_integration_ { if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--; } - if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) + if (d_carrier_lock_fail_counter > trk_parameters.max_lock_fail) { std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl; LOG(INFO) << "Loss of lock in channel " << d_channel << "!"; @@ -1242,7 +1250,7 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused) d_L_accu = *d_Late; // Check lock status - if (!cn0_and_tracking_lock_status(static_cast(d_correlation_length_ms) / 1000.0)) + if (!cn0_and_tracking_lock_status(d_code_period)) { clear_tracking_vars(); d_state = 0; // loss-of-lock detected @@ -1420,7 +1428,7 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused) save_correlation_results(); // check lock status - if (!cn0_and_tracking_lock_status((static_cast(d_correlation_length_ms) / 1000.0) * static_cast(trk_parameters.extend_correlation_symbols))) + if (!cn0_and_tracking_lock_status(d_code_period * static_cast(trk_parameters.extend_correlation_symbols))) { clear_tracking_vars(); d_state = 0; // loss-of-lock detected diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h index 6d1719173..5a77abe40 100755 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h @@ -56,6 +56,10 @@ typedef struct float early_late_space_narrow_chips; float very_early_late_space_narrow_chips; int extend_correlation_symbols; + int cn0_samples; + int cn0_min; + int max_lock_fail; + double carrier_lock_th; bool track_pilot; char system; char signal[3]; @@ -119,7 +123,6 @@ private: std::string systemName; std::string signal_type; std::string *d_secondary_code_string; - std::map map_signal_pretty_name; std::string signal_pretty_name; //tracking state machine diff --git a/src/core/receiver/gnss_block_factory.cc b/src/core/receiver/gnss_block_factory.cc index 0cf956706..bbc88df91 100644 --- a/src/core/receiver/gnss_block_factory.cc +++ b/src/core/receiver/gnss_block_factory.cc @@ -91,7 +91,7 @@ #include "glonass_l1_ca_dll_pll_c_aid_tracking.h" #include "glonass_l2_ca_dll_pll_tracking.h" #include "glonass_l2_ca_dll_pll_c_aid_tracking.h" -#include "gps_l5i_dll_pll_tracking.h" +#include "gps_l5_dll_pll_tracking.h" #include "gps_l1_ca_telemetry_decoder.h" #include "gps_l2c_telemetry_decoder.h" #include "gps_l5_telemetry_decoder.h" @@ -250,13 +250,13 @@ std::unique_ptr GNSSBlockFactory::GetObservables(std::shared GPS_channels += configuration->property("Channels_2S.count", 0); GPS_channels += configuration->property("Channels_L5.count", 0); unsigned int Glonass_channels = configuration->property("Channels_1G.count", 0); - unsigned int extra_channels = 1; // For monitor channel sample counter + unsigned int extra_channels = 1; // For monitor channel sample counter return GetBlock(configuration, "Observables", implementation, - Galileo_channels + + Galileo_channels + GPS_channels + Glonass_channels + extra_channels, - Galileo_channels + + Galileo_channels + GPS_channels + Glonass_channels); } @@ -617,7 +617,6 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1G( } - //********* GLONASS L2 C/A CHANNEL ***************** std::unique_ptr GNSSBlockFactory::GetChannel_2G( std::shared_ptr configuration, @@ -687,7 +686,6 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2G( } - //********* GPS L5 CHANNEL ***************** std::unique_ptr GNSSBlockFactory::GetChannel_L5( std::shared_ptr configuration, @@ -779,7 +777,7 @@ std::unique_ptr>> GNSSBlockFacto Channels_1B_count + Channels_5X_count + Channels_1G_count + - Channels_2G_count + + Channels_2G_count + Channels_L5_count; std::unique_ptr>> channels(new std::vector>(total_channels)); @@ -1437,9 +1435,9 @@ std::unique_ptr GNSSBlockFactory::GetBlock( out_streams)); block = std::move(block_); } - else if (implementation.compare("GPS_L5i_DLL_PLL_Tracking") == 0) + else if ((implementation.compare("GPS_L5i_DLL_PLL_Tracking") == 0) or (implementation.compare("GPS_L5_DLL_PLL_Tracking") == 0)) { - std::unique_ptr block_(new GpsL5iDllPllTracking(configuration.get(), role, in_streams, + std::unique_ptr block_(new GpsL5DllPllTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } @@ -1766,9 +1764,9 @@ std::unique_ptr GNSSBlockFactory::GetTrkBlock( out_streams)); block = std::move(block_); } - else if (implementation.compare("GPS_L5i_DLL_PLL_Tracking") == 0) + else if ((implementation.compare("GPS_L5i_DLL_PLL_Tracking") == 0) or (implementation.compare("GPS_L5_DLL_PLL_Tracking") == 0)) { - std::unique_ptr block_(new GpsL5iDllPllTracking(configuration.get(), role, in_streams, + std::unique_ptr block_(new GpsL5DllPllTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } From a92e6de3d99d6cec0a7353ab57ab539006bc4580 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 29 Apr 2018 01:19:48 +0200 Subject: [PATCH 55/82] Add support for aarch64 --- .../cmake/Modules/VolkAddTest.cmake | 33 +++++---- .../arm_cortex_a15_hardfp_native.cmake | 8 +++ .../arm_cortex_a9_hardfp_native.cmake | 8 +++ .../volk_gnsssdr/cmake/msvc/sys/time.h | 72 +++++++++++++++++++ .../volk_gnsssdr/gen/archs.xml | 14 +++- .../volk_gnsssdr/gen/machines.xml | 10 ++- .../volk_gnsssdr_16i_resamplerxnpuppet_16i.h | 2 +- .../volk_gnsssdr_16i_xn_resampler_16i_xn.h | 2 +- ...nsssdr_16ic_16i_rotator_dot_prod_16ic_xn.h | 12 ++-- ...dr_16ic_16i_rotator_dotprodxnpuppet_16ic.h | 4 +- .../volk_gnsssdr_16ic_conjugate_16ic.h | 4 +- .../volk_gnsssdr_16ic_convert_32fc.h | 4 +- .../volk_gnsssdr_16ic_resampler_fast_16ic.h | 4 +- ...lk_gnsssdr_16ic_resamplerfastpuppet_16ic.h | 4 +- ..._gnsssdr_16ic_resamplerfastxnpuppet_16ic.h | 2 +- ...volk_gnsssdr_16ic_resamplerxnpuppet_16ic.h | 2 +- .../volk_gnsssdr_16ic_rotatorpuppet_16ic.h | 8 +-- .../volk_gnsssdr_16ic_s32fc_x2_rotator_16ic.h | 8 +-- .../volk_gnsssdr_16ic_x2_dot_prod_16ic.h | 12 ++-- .../volk_gnsssdr_16ic_x2_dot_prod_16ic_xn.h | 12 ++-- ...olk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic.h | 6 +- .../volk_gnsssdr_16ic_x2_multiply_16ic.h | 4 +- ...gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn.h | 12 ++-- ...sdr_16ic_x2_rotator_dotprodxnpuppet_16ic.h | 4 +- .../volk_gnsssdr_16ic_xn_resampler_16ic_xn.h | 2 +- ...k_gnsssdr_16ic_xn_resampler_fast_16ic_xn.h | 4 +- .../volk_gnsssdr_32f_index_max_32u.h | 4 +- .../volk_gnsssdr_32f_resamplerxnpuppet_32f.h | 2 +- .../volk_gnsssdr_32f_sincos_32fc.h | 4 +- .../volk_gnsssdr_32f_xn_resampler_32f_xn.h | 2 +- .../volk_gnsssdr_32fc_convert_16ic.h | 4 +- .../volk_gnsssdr_32fc_convert_8ic.h | 4 +- ...volk_gnsssdr_32fc_resamplerxnpuppet_32fc.h | 2 +- ...gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn.h | 4 +- ...sdr_32fc_x2_rotator_dotprodxnpuppet_32fc.h | 2 +- .../volk_gnsssdr_32fc_xn_resampler_32fc_xn.h | 2 +- .../volk_gnsssdr_8ic_conjugate_8ic.h | 4 +- .../volk_gnsssdr_8ic_x2_dot_prod_8ic.h | 4 +- .../volk_gnsssdr_s32f_sincos_32fc.h | 4 +- .../volk_gnsssdr_s32f_sincospuppet_32fc.h | 4 +- .../volk_gnsssdr/lib/CMakeLists.txt | 34 ++++++++- .../volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.c | 53 +++++++++++++- 42 files changed, 289 insertions(+), 101 deletions(-) create mode 100644 src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Toolchains/arm_cortex_a15_hardfp_native.cmake create mode 100644 src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Toolchains/arm_cortex_a9_hardfp_native.cmake create mode 100644 src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/msvc/sys/time.h diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkAddTest.cmake b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkAddTest.cmake index e78a3e30e..ea6b82ba1 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkAddTest.cmake +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkAddTest.cmake @@ -176,20 +176,19 @@ function(VOLK_ADD_TEST test_name executable_name) #set them in the PATH to run tests. The following appends the #path of a target dependency. # - #NOTE: get_target_property LOCATION is being deprecated as of - #CMake 3.2.0, which just prints a warning & notes that this - #functionality will be removed in the future. Leave it here for - #now until someone can figure out how to do this in Windows. - foreach(target ${test_name} ${VOLK_TEST_TARGET_DEPS}) - get_target_property(location "${target}" LOCATION) - if(location) - get_filename_component(path ${location} PATH) - string(REGEX REPLACE "\\$\\(.*\\)" ${CMAKE_BUILD_TYPE} path ${path}) - list(APPEND libpath ${path}) - endif(location) - endforeach(target) + #create a list of target directories to be determined by the + #"add_test" command, via the $ operator; make sure the + #test's directory is first, since it ($1) is prepended to PATH. + unset(TARGET_DIR_LIST) + foreach(target ${executable_name} ${VOLK_TEST_TARGET_DEPS}) + list(APPEND TARGET_DIR_LIST "$") + endforeach() + #replace list separator with the path separator (escaped) + string(REPLACE ";" "\\\\;" TARGET_DIR_LIST "${TARGET_DIR_LIST}") - list(APPEND libpath ${DLL_PATHS} "%PATH%") + #add command line argument (TARGET_DIR_LIST) to path and append current path + list(INSERT libpath 0 "%1") + list(APPEND libpath "%PATH%") #replace list separator with the path separator (escaped) string(REPLACE ";" "\\;" libpath "${libpath}") @@ -204,14 +203,18 @@ function(VOLK_ADD_TEST test_name executable_name) file(APPEND ${bat_file} "SET ${environ}\n") endforeach(environ) + set(VOLK_TEST_ARGS "${test_name}") + #redo the test args to have a space between each string(REPLACE ";" " " VOLK_TEST_ARGS "${VOLK_TEST_ARGS}") #finally: append the test name to execute - file(APPEND ${bat_file} ${test_name} " " ${VOLK_TEST_ARGS} "\n") + file(APPEND ${bat_file} "${executable_name} ${VOLK_TEST_ARGS}\n") file(APPEND ${bat_file} "\n") - add_test(${test_name} ${bat_file}) + add_test(NAME qa_${test_name} + COMMAND ${bat_file} ${TARGET_DIR_LIST} + ) endif(WIN32) endfunction(VOLK_ADD_TEST) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Toolchains/arm_cortex_a15_hardfp_native.cmake b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Toolchains/arm_cortex_a15_hardfp_native.cmake new file mode 100644 index 000000000..274e63aea --- /dev/null +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Toolchains/arm_cortex_a15_hardfp_native.cmake @@ -0,0 +1,8 @@ +######################################################################## +# Toolchain file for building native on a ARM Cortex A8 w/ NEON +# Usage: cmake -DCMAKE_TOOLCHAIN_FILE= +######################################################################## +set(CMAKE_CXX_COMPILER g++) +set(CMAKE_C_COMPILER gcc) +set(CMAKE_CXX_FLAGS "-march=armv7-a -mtune=cortex-a15 -mfpu=neon -mfloat-abi=hard" CACHE STRING "" FORCE) +set(CMAKE_C_FLAGS ${CMAKE_CXX_FLAGS} CACHE STRING "" FORCE) #same flags for C sources diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Toolchains/arm_cortex_a9_hardfp_native.cmake b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Toolchains/arm_cortex_a9_hardfp_native.cmake new file mode 100644 index 000000000..b8302c872 --- /dev/null +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Toolchains/arm_cortex_a9_hardfp_native.cmake @@ -0,0 +1,8 @@ +######################################################################## +# Toolchain file for building native on a ARM Cortex A8 w/ NEON +# Usage: cmake -DCMAKE_TOOLCHAIN_FILE= +######################################################################## +set(CMAKE_CXX_COMPILER g++) +set(CMAKE_C_COMPILER gcc) +set(CMAKE_CXX_FLAGS "-march=armv7-a -mtune=cortex-a9 -mfpu=neon -mfloat-abi=hard" CACHE STRING "" FORCE) +set(CMAKE_C_FLAGS ${CMAKE_CXX_FLAGS} CACHE STRING "" FORCE) #same flags for C sources diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/msvc/sys/time.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/msvc/sys/time.h new file mode 100644 index 000000000..fc62a7041 --- /dev/null +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/msvc/sys/time.h @@ -0,0 +1,72 @@ +#ifndef _MSC_VER // [ +#error "Use this header only with Microsoft Visual C++ compilers!" +#endif // _MSC_VER ] + +#ifndef _MSC_SYS_TIME_H_ +#define _MSC_SYS_TIME_H_ + +#ifndef NOMINMAX +#define NOMINMAX +#endif + +//http://social.msdn.microsoft.com/Forums/en/vcgeneral/thread/430449b3-f6dd-4e18-84de-eebd26a8d668 +#include < time.h > +#include //I've omitted this line. +#if defined(_MSC_VER) || defined(_MSC_EXTENSIONS) +#define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64 +#else +#define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL +#endif + +#if _MSC_VER < 1900 +struct timespec +{ + time_t tv_sec; /* Seconds since 00:00:00 GMT, */ + + /* 1 January 1970 */ + + long tv_nsec; /* Additional nanoseconds since */ + + /* tv_sec */ +}; +#endif + +struct timezone +{ + int tz_minuteswest; /* minutes W of Greenwich */ + int tz_dsttime; /* type of dst correction */ +}; + +static inline int gettimeofday(struct timeval *tv, struct timezone *tz) +{ + FILETIME ft; + unsigned __int64 tmpres = 0; + static int tzflag; + + if (NULL != tv) + { + GetSystemTimeAsFileTime(&ft); + + tmpres |= ft.dwHighDateTime; + tmpres <<= 32; + tmpres |= ft.dwLowDateTime; + + /*converting file time to unix epoch*/ + tmpres -= DELTA_EPOCH_IN_MICROSECS; + tv->tv_sec = (long)(tmpres / 1000000UL); + tv->tv_usec = (long)(tmpres % 1000000UL); + } + + if (NULL != tz) + { + if (!tzflag) + { + _tzset(); + tzflag++; + } + tz->tz_minuteswest = _timezone / 60; + tz->tz_dsttime = _daylight; + } + + return 0; +} diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/archs.xml b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/archs.xml index ff1de1e15..a8bee46a2 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/archs.xml +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/archs.xml @@ -13,12 +13,24 @@ - -mfpu=neon -funsafe-math-optimizations 16 + + -mfpu=neon + -funsafe-math-optimizations + 16 + + + + + -funsafe-math-optimizations + 16 + + + -m32 diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/machines.xml b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/machines.xml index b60f336cd..e7c6eaf20 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/machines.xml +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/machines.xml @@ -5,7 +5,15 @@ -generic neon softfp|hardfp orc| +generic neon orc| + + + +generic neon neonv7 softfp|hardfp orc| + + + +generic neon neonv8 diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16i_resamplerxnpuppet_16i.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16i_resamplerxnpuppet_16i.h index ffce85d32..12e95411e 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16i_resamplerxnpuppet_16i.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16i_resamplerxnpuppet_16i.h @@ -249,7 +249,7 @@ static inline void volk_gnsssdr_16i_resamplerxnpuppet_16i_a_avx(int16_t* result, #endif -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 static inline void volk_gnsssdr_16i_resamplerxnpuppet_16i_neon(int16_t* result, const int16_t* local_code, unsigned int num_points) { int code_length_chips = 2046; diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16i_xn_resampler_16i_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16i_xn_resampler_16i_xn.h index 3628ccf8c..7547ca5d8 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16i_xn_resampler_16i_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16i_xn_resampler_16i_xn.h @@ -526,7 +526,7 @@ static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_u_avx(int16_t** result, #endif -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_neon(int16_t** result, const int16_t* local_code, float rem_code_phase_chips, float code_phase_step_chips, float* shifts_chips, unsigned int code_length_chips, int num_out_vectors, unsigned int num_points) { diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn.h index fbf7e31f1..71d4d3c86 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn.h @@ -1049,7 +1049,7 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_avx2(lv_16sc } #endif /* LV_HAVE_AVX2 */ -//#ifdef LV_HAVE_NEON +//#ifdef LV_HAVE_NEONV7 //#include //static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_neon(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const int16_t** in_a, int num_a_vectors, unsigned int num_points) @@ -1228,10 +1228,10 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_avx2(lv_16sc //} //} -//#endif [> LV_HAVE_NEON <] +//#endif [> LV_HAVE_NEONV7 <] -//#ifdef LV_HAVE_NEON +//#ifdef LV_HAVE_NEONV7 //#include //#include @@ -1419,10 +1419,10 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_avx2(lv_16sc //} //} -//#endif [> LV_HAVE_NEON <] +//#endif [> LV_HAVE_NEONV7 <] -//#ifdef LV_HAVE_NEON +//#ifdef LV_HAVE_NEONV7 //#include //#include @@ -1601,6 +1601,6 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_avx2(lv_16sc //} //} -//#endif [> LV_HAVE_NEON <] +//#endif [> LV_HAVE_NEONV7 <] #endif /*INCLUDED_volk_gnsssdr_16ic_16i_dot_prod_16ic_xn_H*/ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic.h index 6880b8d11..7466ac2c2 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic.h @@ -317,7 +317,7 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_u_avx2(lv_ //#endif // AVX2 -//#ifdef LV_HAVE_NEON +//#ifdef LV_HAVE_NEONV7 //static inline void volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_neon(lv_16sc_t* result, const lv_16sc_t* local_code, const lv_16sc_t* in, unsigned int num_points) //{ //// phases must be normalized. Phase rotator expects a complex exponential input! @@ -348,7 +348,7 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_u_avx2(lv_ //#endif // NEON -//#ifdef LV_HAVE_NEON +//#ifdef LV_HAVE_NEONV7 //static inline void volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_neon_vma(lv_16sc_t* result, const lv_16sc_t* local_code, const lv_16sc_t* in, unsigned int num_points) //{ //// phases must be normalized. Phase rotator expects a complex exponential input! diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_conjugate_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_conjugate_16ic.h index b294d5ca9..cefef96c6 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_conjugate_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_conjugate_16ic.h @@ -202,7 +202,7 @@ static inline void volk_gnsssdr_16ic_conjugate_16ic_u_avx2(lv_16sc_t* cVector, c // // -//#ifdef LV_HAVE_NEON +//#ifdef LV_HAVE_NEONV7 //#include // //static inline void volk_gnsssdr_16ic_conjugate_16ic_neon(lv_16sc_t* cVector, const lv_16sc_t* aVector, unsigned int num_points) @@ -228,6 +228,6 @@ static inline void volk_gnsssdr_16ic_conjugate_16ic_u_avx2(lv_16sc_t* cVector, c // *c++ = lv_conj(*a++); // } //} -//#endif /* LV_HAVE_NEON */ +//#endif /* LV_HAVE_NEONV7 */ #endif /* INCLUDED_volk_gnsssdr_16ic_conjugate_16ic_H */ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_convert_32fc.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_convert_32fc.h index 5d66452e0..eaaedaba5 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_convert_32fc.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_convert_32fc.h @@ -180,7 +180,7 @@ static inline void volk_gnsssdr_16ic_convert_32fc_a_axv(lv_32fc_t* outputVector, #endif /* LV_HAVE_AVX */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_16ic_convert_32fc_neon(lv_32fc_t* outputVector, const lv_16sc_t* inputVector, unsigned int num_points) @@ -210,6 +210,6 @@ static inline void volk_gnsssdr_16ic_convert_32fc_neon(lv_32fc_t* outputVector, _in++; } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ #endif /* INCLUDED_volk_gnsssdr_32fc_convert_16ic_H */ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resampler_fast_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resampler_fast_16ic.h index cca2efa0d..d2f43e708 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resampler_fast_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resampler_fast_16ic.h @@ -256,7 +256,7 @@ static inline void volk_gnsssdr_16ic_resampler_fast_16ic_u_sse2(lv_16sc_t* resul #endif /* LV_HAVE_SSE2 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_16ic_resampler_fast_16ic_neon(lv_16sc_t* result, const lv_16sc_t* local_code, float rem_code_phase_chips, float code_phase_step_chips, int code_length_chips, unsigned int num_output_samples) //, int* scratch_buffer, float* scratch_buffer_float) @@ -342,6 +342,6 @@ static inline void volk_gnsssdr_16ic_resampler_fast_16ic_neon(lv_16sc_t* result, } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ #endif /*INCLUDED_volk_gnsssdr_16ic_resampler_fast_16ic_H*/ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerfastpuppet_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerfastpuppet_16ic.h index 038e70108..03032e01d 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerfastpuppet_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerfastpuppet_16ic.h @@ -72,7 +72,7 @@ static inline void volk_gnsssdr_16ic_resamplerfastpuppet_16ic_u_sse2(lv_16sc_t* #endif /* LV_HAVE_SSE2 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 static inline void volk_gnsssdr_16ic_resamplerfastpuppet_16ic_neon(lv_16sc_t* result, const lv_16sc_t* local_code, unsigned int num_points) { @@ -82,6 +82,6 @@ static inline void volk_gnsssdr_16ic_resamplerfastpuppet_16ic_neon(lv_16sc_t* re volk_gnsssdr_16ic_resampler_fast_16ic_neon(result, local_code, rem_code_phase_chips, code_phase_step_chips, code_length_chips, num_points); } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ #endif // INCLUDED_volk_gnsssdr_16ic_resamplerfastpuppet_16ic_H diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerfastxnpuppet_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerfastxnpuppet_16ic.h index 934af8e88..9eff06510 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerfastxnpuppet_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerfastxnpuppet_16ic.h @@ -128,7 +128,7 @@ static inline void volk_gnsssdr_16ic_resamplerfastxnpuppet_16ic_u_sse2(lv_16sc_t #endif -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 static inline void volk_gnsssdr_16ic_resamplerfastxnpuppet_16ic_neon(lv_16sc_t* result, const lv_16sc_t* local_code, unsigned int num_points) { float code_phase_step_chips = 0.1; diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerxnpuppet_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerxnpuppet_16ic.h index 4582d6961..8ca8e7e33 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerxnpuppet_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerxnpuppet_16ic.h @@ -250,7 +250,7 @@ static inline void volk_gnsssdr_16ic_resamplerxnpuppet_16ic_a_avx(lv_16sc_t* res #endif -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 static inline void volk_gnsssdr_16ic_resamplerxnpuppet_16ic_neon(lv_16sc_t* result, const lv_16sc_t* local_code, unsigned int num_points) { int code_length_chips = 2046; diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_rotatorpuppet_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_rotatorpuppet_16ic.h index 245eed773..0438931e0 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_rotatorpuppet_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_rotatorpuppet_16ic.h @@ -137,7 +137,7 @@ static inline void volk_gnsssdr_16ic_rotatorpuppet_16ic_u_sse3_reload(lv_16sc_t* #endif /* LV_HAVE_SSE3 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 static inline void volk_gnsssdr_16ic_rotatorpuppet_16ic_neon(lv_16sc_t* outVector, const lv_16sc_t* inVector, unsigned int num_points) { // phases must be normalized. Phase rotator expects a complex exponential input! @@ -150,10 +150,10 @@ static inline void volk_gnsssdr_16ic_rotatorpuppet_16ic_neon(lv_16sc_t* outVecto volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon(outVector, inVector, phase_inc[0], phase, num_points); } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 static inline void volk_gnsssdr_16ic_rotatorpuppet_16ic_neon_reload(lv_16sc_t* outVector, const lv_16sc_t* inVector, unsigned int num_points) { // phases must be normalized. Phase rotator expects a complex exponential input! @@ -166,7 +166,7 @@ static inline void volk_gnsssdr_16ic_rotatorpuppet_16ic_neon_reload(lv_16sc_t* o volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon_reload(outVector, inVector, phase_inc[0], phase, num_points); } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ #endif /* INCLUDED_volk_gnsssdr_16ic_rotatorpuppet_16ic_H */ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_s32fc_x2_rotator_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_s32fc_x2_rotator_16ic.h index 0de39ebc3..b43a5d95e 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_s32fc_x2_rotator_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_s32fc_x2_rotator_16ic.h @@ -645,7 +645,7 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_u_sse3_reload(lv_16sc #endif /* LV_HAVE_SSE3 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon(lv_16sc_t* outVector, const lv_16sc_t* inVector, const lv_32fc_t phase_inc, lv_32fc_t* phase, unsigned int num_points) @@ -778,10 +778,10 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon(lv_16sc_t* outVe } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon_reload(lv_16sc_t* outVector, const lv_16sc_t* inVector, const lv_32fc_t phase_inc, lv_32fc_t* phase, unsigned int num_points) @@ -972,6 +972,6 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon_reload(lv_16sc_t } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ #endif /* INCLUDED_volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_H */ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dot_prod_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dot_prod_16ic.h index ccf815d56..d7563e1f5 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dot_prod_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dot_prod_16ic.h @@ -393,7 +393,7 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_a_axv2(lv_16sc_t* out, con #endif /* LV_HAVE_AVX2 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_neon(lv_16sc_t* out, const lv_16sc_t* in_a, const lv_16sc_t* in_b, unsigned int num_points) @@ -462,10 +462,10 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_neon(lv_16sc_t* out, const } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_neon_vma(lv_16sc_t* out, const lv_16sc_t* in_a, const lv_16sc_t* in_b, unsigned int num_points) @@ -515,10 +515,10 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_neon_vma(lv_16sc_t* out, c } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_neon_optvma(lv_16sc_t* out, const lv_16sc_t* in_a, const lv_16sc_t* in_b, unsigned int num_points) @@ -569,6 +569,6 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_neon_optvma(lv_16sc_t* out } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ #endif /*INCLUDED_volk_gnsssdr_16ic_x2_dot_prod_16ic_H*/ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dot_prod_16ic_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dot_prod_16ic_xn.h index 065fc75a8..5410222d0 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dot_prod_16ic_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dot_prod_16ic_xn.h @@ -489,7 +489,7 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_u_avx2(lv_16sc_t* resul #endif /* LV_HAVE_AVX2 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) @@ -575,10 +575,10 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon(lv_16sc_t* result, } } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon_vma(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) @@ -653,10 +653,10 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon_vma(lv_16sc_t* res } } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon_optvma(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) @@ -736,6 +736,6 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon_optvma(lv_16sc_t* } } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ #endif /*INCLUDED_volk_gnsssdr_16ic_xn_dot_prod_16ic_xn_H*/ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic.h index ad2ec4a77..9faf03be6 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic.h @@ -188,7 +188,7 @@ static inline void volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic_u_avx2(lv_16sc_t* r #endif /* LV_HAVE_AVX2 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 static inline void volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic_neon(lv_16sc_t* result, const lv_16sc_t* local_code, const lv_16sc_t* in, unsigned int num_points) { @@ -213,7 +213,7 @@ static inline void volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic_neon(lv_16sc_t* res #endif // NEON -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 static inline void volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic_neon_vma(lv_16sc_t* result, const lv_16sc_t* local_code, const lv_16sc_t* in, unsigned int num_points) { @@ -237,7 +237,7 @@ static inline void volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic_neon_vma(lv_16sc_t* #endif // NEON -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 static inline void volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic_neon_optvma(lv_16sc_t* result, const lv_16sc_t* local_code, const lv_16sc_t* in, unsigned int num_points) { diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_multiply_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_multiply_16ic.h index 9548f8954..29d4f5465 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_multiply_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_multiply_16ic.h @@ -292,7 +292,7 @@ static inline void volk_gnsssdr_16ic_x2_multiply_16ic_a_avx2(lv_16sc_t* out, con #endif /* LV_HAVE_AVX2 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_16ic_x2_multiply_16ic_neon(lv_16sc_t* out, const lv_16sc_t* in_a, const lv_16sc_t* in_b, unsigned int num_points) @@ -338,6 +338,6 @@ static inline void volk_gnsssdr_16ic_x2_multiply_16ic_neon(lv_16sc_t* out, const *out++ = (*a_ptr++) * (*b_ptr++); } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7*/ #endif /*INCLUDED_volk_gnsssdr_16ic_x2_multiply_16ic_H*/ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn.h index 60b5b7b38..44444efd5 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn.h @@ -1300,7 +1300,7 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_avx2_reload(l #endif /* LV_HAVE_AVX2 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) @@ -1486,10 +1486,10 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon(lv_16sc_t* } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include #include @@ -1683,10 +1683,10 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon_vma(lv_16s } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include #include @@ -1872,6 +1872,6 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon_optvma(lv_ } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ #endif /*INCLUDED_volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_H*/ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic.h index 9b30bdbbd..8196c09a6 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic.h @@ -317,7 +317,7 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic_u_avx2_relo #endif // AVX2 -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 static inline void volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic_neon(lv_16sc_t* result, const lv_16sc_t* local_code, const lv_16sc_t* in, unsigned int num_points) { // phases must be normalized. Phase rotator expects a complex exponential input! @@ -348,7 +348,7 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic_neon(lv_16s #endif // NEON -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 static inline void volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic_neon_vma(lv_16sc_t* result, const lv_16sc_t* local_code, const lv_16sc_t* in, unsigned int num_points) { // phases must be normalized. Phase rotator expects a complex exponential input! diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_xn_resampler_16ic_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_xn_resampler_16ic_xn.h index 661f4ace9..64eeb6d4a 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_xn_resampler_16ic_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_xn_resampler_16ic_xn.h @@ -525,7 +525,7 @@ static inline void volk_gnsssdr_16ic_xn_resampler_16ic_xn_u_avx(lv_16sc_t** resu #endif -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_16ic_xn_resampler_16ic_xn_neon(lv_16sc_t** result, const lv_16sc_t* local_code, float rem_code_phase_chips, float code_phase_step_chips, float* shifts_chips, unsigned int code_length_chips, int num_out_vectors, unsigned int num_points) { diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn.h index 112c213df..68b75f813 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn.h @@ -285,7 +285,7 @@ static inline void volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn_u_sse2(lv_16sc_t* #endif /* LV_HAVE_SSE2 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn_neon(lv_16sc_t** result, const lv_16sc_t* local_code, float* rem_code_phase_chips, float code_phase_step_chips, unsigned int code_length_chips, int num_out_vectors, unsigned int num_output_samples) @@ -384,6 +384,6 @@ static inline void volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn_neon(lv_16sc_t** } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ #endif /*INCLUDED_volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn_H*/ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_index_max_32u.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_index_max_32u.h index ace8271ea..af22131f1 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_index_max_32u.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_index_max_32u.h @@ -481,7 +481,7 @@ static inline void volk_gnsssdr_32f_index_max_32u_generic(uint32_t* target, cons #endif /*LV_HAVE_GENERIC*/ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_32f_index_max_32u_neon(uint32_t* target, const float* src0, uint32_t num_points) @@ -546,6 +546,6 @@ static inline void volk_gnsssdr_32f_index_max_32u_neon(uint32_t* target, const f } } -#endif /*LV_HAVE_NEON*/ +#endif /*LV_HAVE_NEONV7*/ #endif /*INCLUDED_volk_gnsssdr_32f_index_max_32u_H*/ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_resamplerxnpuppet_32f.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_resamplerxnpuppet_32f.h index b425ecb9b..b27579ff3 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_resamplerxnpuppet_32f.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_resamplerxnpuppet_32f.h @@ -246,7 +246,7 @@ static inline void volk_gnsssdr_32f_resamplerxnpuppet_32f_u_avx(float* result, c } #endif -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 static inline void volk_gnsssdr_32f_resamplerxnpuppet_32f_neon(float* result, const float* local_code, unsigned int num_points) { int code_length_chips = 2046; diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_sincos_32fc.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_sincos_32fc.h index b067c5f3d..8936901b0 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_sincos_32fc.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_sincos_32fc.h @@ -642,7 +642,7 @@ static inline void volk_gnsssdr_32f_sincos_32fc_generic_fxpt(lv_32fc_t* out, con #endif /* LV_HAVE_GENERIC */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include /* Adapted from http://gruntthepeon.free.fr/ssemath/neon_mathfun.h, original code from Julien Pommier */ /* Based on algorithms from the cephes library http://www.netlib.org/cephes/ */ @@ -747,7 +747,7 @@ static inline void volk_gnsssdr_32f_sincos_32fc_neon(lv_32fc_t* out, const float } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ #endif /* INCLUDED_volk_gnsssdr_32f_sincos_32fc_H */ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_xn_resampler_32f_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_xn_resampler_32f_xn.h index f130032ea..ef009d1cf 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_xn_resampler_32f_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_xn_resampler_32f_xn.h @@ -527,7 +527,7 @@ static inline void volk_gnsssdr_32f_xn_resampler_32f_xn_u_avx(float** result, co #endif -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_32f_xn_resampler_32f_xn_neon(float** result, const float* local_code, float rem_code_phase_chips, float code_phase_step_chips, float* shifts_chips, unsigned int code_length_chips, int num_out_vectors, unsigned int num_points) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_convert_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_convert_16ic.h index 892a7c0e8..afb79afcc 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_convert_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_convert_16ic.h @@ -386,7 +386,7 @@ static inline void volk_gnsssdr_32fc_convert_16ic_a_avx2(lv_16sc_t* outputVector #endif /* LV_HAVE_AVX2 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_32fc_convert_16ic_neon(lv_16sc_t* outputVector, const lv_32fc_t* inputVector, unsigned int num_points) @@ -450,7 +450,7 @@ static inline void volk_gnsssdr_32fc_convert_16ic_neon(lv_16sc_t* outputVector, } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ #ifdef LV_HAVE_GENERIC diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_convert_8ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_convert_8ic.h index ab8d32e32..82bc4940e 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_convert_8ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_convert_8ic.h @@ -373,7 +373,7 @@ static inline void volk_gnsssdr_32fc_convert_8ic_a_sse2(lv_8sc_t* outputVector, #endif /* LV_HAVE_SSE2 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_32fc_convert_8ic_neon(lv_8sc_t* outputVector, const lv_32fc_t* inputVector, unsigned int num_points) @@ -464,6 +464,6 @@ static inline void volk_gnsssdr_32fc_convert_8ic_neon(lv_8sc_t* outputVector, co } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ #endif /* INCLUDED_volk_gnsssdr_32fc_convert_8ic_H */ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_resamplerxnpuppet_32fc.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_resamplerxnpuppet_32fc.h index 1655b5ccd..598e3b821 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_resamplerxnpuppet_32fc.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_resamplerxnpuppet_32fc.h @@ -306,7 +306,7 @@ static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_u_avx2(lv_32fc_t* re #endif -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_neon(lv_32fc_t* result, const lv_32fc_t* local_code, unsigned int num_points) { int code_length_chips = 2046; diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn.h index c3c77233a..257ae2900 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn.h @@ -647,7 +647,7 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_a_avx(lv_32fc_t #endif /* LV_HAVE_AVX */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_neon(lv_32fc_t* result, const lv_32fc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const lv_32fc_t** in_a, int num_a_vectors, unsigned int num_points) @@ -800,6 +800,6 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_neon(lv_32fc_t* (*phase) = _phase; } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ #endif /* INCLUDED_volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_H */ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc.h index 846539fc9..9bbe75662 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc.h @@ -220,7 +220,7 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc_a_avx(lv_32 #endif // AVX -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 static inline void volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc_neon(lv_32fc_t* result, const lv_32fc_t* local_code, const lv_32fc_t* in, unsigned int num_points) { // phases must be normalized. Phase rotator expects a complex exponential input! diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_xn_resampler_32fc_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_xn_resampler_32fc_xn.h index 3e6227a17..aaa43fec7 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_xn_resampler_32fc_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_xn_resampler_32fc_xn.h @@ -682,7 +682,7 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_a_avx2(lv_32fc_t** res #endif -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_neon(lv_32fc_t** result, const lv_32fc_t* local_code, float rem_code_phase_chips, float code_phase_step_chips, float* shifts_chips, unsigned int code_length_chips, int num_out_vectors, unsigned int num_points) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_conjugate_8ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_conjugate_8ic.h index 177b1114d..814788d61 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_conjugate_8ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_conjugate_8ic.h @@ -348,7 +348,7 @@ static inline void volk_gnsssdr_8ic_conjugate_8ic_u_orc(lv_8sc_t* cVector, const #endif /* LV_HAVE_ORC */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_8ic_conjugate_8ic_neon(lv_8sc_t* cVector, const lv_8sc_t* aVector, unsigned int num_points) @@ -374,6 +374,6 @@ static inline void volk_gnsssdr_8ic_conjugate_8ic_neon(lv_8sc_t* cVector, const *c++ = lv_conj(*a++); } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ #endif /* INCLUDED_volk_gnsssdr_8ic_conjugate_8ic_H */ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_x2_dot_prod_8ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_x2_dot_prod_8ic.h index 88a689f8b..33102b385 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_x2_dot_prod_8ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_x2_dot_prod_8ic.h @@ -436,7 +436,7 @@ static inline void volk_gnsssdr_8ic_x2_dot_prod_8ic_u_orc(lv_8sc_t* result, cons #endif /* LV_HAVE_ORC */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_8ic_x2_dot_prod_8ic_neon(lv_8sc_t* result, const lv_8sc_t* in_a, const lv_8sc_t* in_b, unsigned int num_points) @@ -495,6 +495,6 @@ static inline void volk_gnsssdr_8ic_x2_dot_prod_8ic_neon(lv_8sc_t* result, const *result += dotProduct; } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ #endif /*INCLUDED_volk_gnsssdr_8ic_x2_dot_prod_8ic_H*/ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_s32f_sincos_32fc.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_s32f_sincos_32fc.h index d6d58e4d0..50ac028d0 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_s32f_sincos_32fc.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_s32f_sincos_32fc.h @@ -833,7 +833,7 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_u_avx2(lv_32fc_t *out, const fl #endif /* LV_HAVE_AVX2 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include /* Adapted from http://gruntthepeon.free.fr/ssemath/neon_mathfun.h, original code from Julien Pommier */ /* Based on algorithms from the cephes library http://www.netlib.org/cephes/ */ @@ -948,6 +948,6 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_neon(lv_32fc_t *out, const floa (*phase) = _phase; } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ #endif /* INCLUDED_volk_gnsssdr_s32f_sincos_32fc_H */ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_s32f_sincospuppet_32fc.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_s32f_sincospuppet_32fc.h index e4f7c942f..9b1595e9d 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_s32f_sincospuppet_32fc.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_s32f_sincospuppet_32fc.h @@ -103,13 +103,13 @@ static inline void volk_gnsssdr_s32f_sincospuppet_32fc_u_avx2(lv_32fc_t* out, co #endif /* LV_HAVE_AVX2 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 static inline void volk_gnsssdr_s32f_sincospuppet_32fc_neon(lv_32fc_t* out, const float phase_inc, unsigned int num_points) { float phase[1]; phase[0] = 3; volk_gnsssdr_s32f_sincos_32fc_neon(out, phase_inc, phase, num_points); } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ #endif /* INCLUDED_volk_gnsssdr_s32f_sincospuppet_32fc_H */ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt index bf0bdd3a2..c6bf3c949 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt @@ -256,6 +256,36 @@ if(NOT CPU_IS_x86) OVERRULE_ARCH(avx "Architecture is not x86 or x86_64") endif(NOT CPU_IS_x86) +######################################################################## +# Select neon based on ARM ISA version +######################################################################## + +# First, compile a test program to see if compiler supports neon. + +include(CheckCSourceCompiles) + +check_c_source_compiles("#include \nint main(){ uint8_t *dest; uint8x8_t res; vst1_u8(dest, res); }" + neon_compile_result) + +if(neon_compile_result) + check_c_source_compiles("int main(){asm volatile(\"vrev32.8 q0, q0\");}" + have_neonv7_result ) + check_c_source_compiles("int main(){asm volatile(\"sub v1.4s,v1.4s,v1.4s\");}" + have_neonv8_result ) + + if (have_neonv7_result) + OVERRULE_ARCH(neonv8 "CPU is armv7") + endif() + + if (have_neonv8_result) + OVERRULE_ARCH(neonv7 "CPU is armv8") + endif() +else(neon_compile_result) + OVERRULE_ARCH(neon "Compiler doesn't support NEON") + OVERRULE_ARCH(neonv7 "Compiler doesn't support NEON") + OVERRULE_ARCH(neonv8 "Compiler doesn't support NEON") +endif(neon_compile_result) + ######################################################################## # implement overruling in the ORC case, # since ORC always passes flag detection @@ -423,7 +453,7 @@ include_directories( # on by default, but let users turn it off ######################################################################## if(${CMAKE_VERSION} VERSION_GREATER "2.8.9") - set(ASM_ARCHS_AVAILABLE "neon") + set(ASM_ARCHS_AVAILABLE "neonv7" "neonv8") set(FULL_C_FLAGS "${CMAKE_C_FLAGS}" "${CMAKE_CXX_COMPILER_ARG1}") @@ -432,7 +462,7 @@ if(${CMAKE_VERSION} VERSION_GREATER "2.8.9") # set up the assembler flags and include the source files foreach(ARCH ${ASM_ARCHS_AVAILABLE}) string(REGEX MATCH "${ARCH}" ASM_ARCH "${available_archs}") - if( ASM_ARCH STREQUAL "neon" ) + if( ASM_ARCH STREQUAL "neonv7" ) message(STATUS "---- Adding ASM files") # we always use ATT syntax message(STATUS "-- Detected neon architecture; enabling ASM") # setup architecture specific assembler flags diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.c b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.c index f04f2d9ff..d690bc993 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.c +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.c @@ -128,12 +128,12 @@ static inline unsigned int get_avx2_enabled(void) #include #include #include -#define VOLK_CPU_ARM +#define VOLK_CPU_ARMV7 #endif -static int has_neon(void) +static int has_neonv7(void) { -#if defined(VOLK_CPU_ARM) +#if defined(VOLK_CPU_ARMV7) FILE *auxvec_f; unsigned long auxvec[2]; unsigned int found_neon = 0; @@ -156,6 +156,53 @@ static int has_neon(void) return 0; #endif } + +//\todo: Fix this to really check for neon on aarch64 +//neon detection is linux specific +#if defined(__aarch64__) && defined(__linux__) +#include +#include +#include +#define VOLK_CPU_ARMV8 +#endif + +static int has_neonv8(void) +{ +#if defined(VOLK_CPU_ARMV8) + FILE *auxvec_f; + unsigned long auxvec[2]; + unsigned int found_neon = 0; + auxvec_f = fopen("/proc/self/auxv", "rb"); + if (!auxvec_f) return 0; + + size_t r = 1; + //so auxv is basically 32b of ID and 32b of value + //so it goes like this + while (!found_neon && r) + { + r = fread(auxvec, sizeof(unsigned long), 2, auxvec_f); + if ((auxvec[0] == AT_HWCAP) && (auxvec[1] & HWCAP_ASIMD)) + found_neon = 1; + } + + fclose(auxvec_f); + return found_neon; +#else + return 0; +#endif +} + +static int has_neon(void) +{ +#if defined(VOLK_CPU_ARMV8) || defined(VOLK_CPU_ARMV7) + if (has_neonv7() || has_neonv8()) + return 1; + else + return 0; +#else + return 0; +#endif +} // clang-format off %for arch in archs: From 01429132bd581500b2875d9c070a21add4d7da4d Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 29 Apr 2018 02:51:50 +0200 Subject: [PATCH 56/82] Avoid clash of redefined macros with Volk --- .../acquisition/gnuradio_blocks/pcps_acquisition.cc | 2 +- src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h | 2 +- .../volk_gnsssdr/tmpl/volk_gnsssdr_config_fixed.tmpl.h | 4 ++-- .../glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc | 1 - .../gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.h | 2 +- .../glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc | 1 - .../gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.h | 2 +- .../gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc | 1 - .../gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.cc | 1 - .../gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.h | 2 +- .../gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc | 1 - .../gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.h | 2 +- 12 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc index 62e55dd31..dd2243a23 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h index 97e314fdb..3836b0c38 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h @@ -56,7 +56,7 @@ #include #include #include -#include +#include #include typedef struct diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_config_fixed.tmpl.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_config_fixed.tmpl.h index 4159bdef7..84be60772 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_config_fixed.tmpl.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_config_fixed.tmpl.h @@ -21,9 +21,9 @@ // clang-format off %for i, arch in enumerate(archs): -//#ifndef LV_${arch.name.upper()} +#ifndef LV_${arch.name.upper()} #define LV_${arch.name.upper()} ${i} -//#endif +#endif %endfor // clang-format on #endif /*INCLUDED_VOLK_GNSSSDR_CONFIG_FIXED*/ diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc index c7540b169..1f429eee3 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc @@ -49,7 +49,6 @@ #include #include #include -#include #include #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.h b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.h index 8a26c0e73..11ed0e145 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.h +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.h @@ -47,7 +47,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc index 9b653dfa8..b8bd3de86 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc @@ -47,7 +47,6 @@ #include #include #include -#include #include #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.h b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.h index 6ee493185..38cf9d8b9 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.h +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.h @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc index ee5843ee9..295f894d6 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc @@ -39,7 +39,6 @@ #include #include #include -#include #include #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.cc index 14d5683c8..5f9a6ec23 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.cc @@ -42,7 +42,6 @@ #include #include #include -#include #include #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.h index fd6630eef..1bd8bb0c1 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.h +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.h @@ -46,7 +46,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc index 37898c14c..fdfd0c04d 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc @@ -40,7 +40,6 @@ #include #include #include -#include #include #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.h index ec68aed0f..0e690f74f 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.h +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.h @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include #include #include From e74b72b9dff6094da56997a0f4d1ed6ff4bc4617 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 29 Apr 2018 04:16:56 +0200 Subject: [PATCH 57/82] Reorder includes --- .../gps_l1_ca_dll_pll_tracking_gpu_cc.cc | 15 ++++++------- .../gps_l1_ca_dll_pll_tracking_gpu_cc.h | 11 +++++----- .../gps_l1_ca_tcp_connector_tracking_cc.cc | 22 +++++++++---------- .../gps_l1_ca_tcp_connector_tracking_cc.h | 8 +++---- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc index f39448ce3..e1f0c31c3 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc @@ -29,21 +29,20 @@ */ #include "gps_l1_ca_dll_pll_tracking_gpu_cc.h" -#include -#include -#include -#include -#include -#include -#include #include "gps_sdr_signal_processing.h" #include "tracking_discriminators.h" #include "lock_detectors.h" #include "GPS_L1_CA.h" #include "control_message_factory.h" #include "gnss_sdr_flags.h" -// includes +#include #include +#include +#include +#include +#include +#include +#include using google::LogMessage; diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.h index 2743f5c99..be8959f49 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.h @@ -36,14 +36,15 @@ #ifndef GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_GPU_CC_H #define GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_GPU_CC_H -#include -#include -#include -#include +#include "cuda_multicorrelator.h" #include "gnss_synchro.h" #include "tracking_2nd_DLL_filter.h" #include "tracking_FLL_PLL_filter.h" -#include "cuda_multicorrelator.h" +#include +#include +#include +#include + class Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc; diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc index 1eb6e960a..a650238cc 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc @@ -36,22 +36,22 @@ */ #include "gps_l1_ca_tcp_connector_tracking_cc.h" -#include -#include -#include +#include "control_message_factory.h" +#include "gnss_sdr_flags.h" +#include "gps_sdr_signal_processing.h" +#include "GPS_L1_CA.h" +#include "lock_detectors.h" +#include "tcp_communication.h" +#include "tcp_packet_data.h" +#include "tracking_discriminators.h" #include #include #include #include #include -#include "gps_sdr_signal_processing.h" -#include "tracking_discriminators.h" -#include "lock_detectors.h" -#include "GPS_L1_CA.h" -#include "control_message_factory.h" -#include "gnss_sdr_flags.h" -#include "tcp_communication.h" -#include "tcp_packet_data.h" +#include +#include +#include using google::LogMessage; diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.h index 89140e4b6..21bf6f02c 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.h @@ -37,13 +37,13 @@ #ifndef GNSS_SDR_GPS_L1_CA_TCP_CONNECTOR_TRACKING_CC_H #define GNSS_SDR_GPS_L1_CA_TCP_CONNECTOR_TRACKING_CC_H +#include "cpu_multicorrelator.h" +#include "gnss_synchro.h" +#include "tcp_communication.h" +#include #include #include #include -#include -#include "gnss_synchro.h" -#include "cpu_multicorrelator.h" -#include "tcp_communication.h" class Gps_L1_Ca_Tcp_Connector_Tracking_cc; From 471bb17b3cfa8d7cd22ff9b24e284d903a23a807 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 29 Apr 2018 10:23:19 +0200 Subject: [PATCH 58/82] Improve readability --- src/algorithms/channel/libs/channel_fsm.cc | 9 +++++++++ .../channel/libs/channel_msg_receiver_cc.cc | 5 +++-- .../adapters/array_signal_conditioner.cc | 15 +++++++++------ .../conditioner/adapters/signal_conditioner.cc | 16 ++++++++++------ 4 files changed, 31 insertions(+), 14 deletions(-) diff --git a/src/algorithms/channel/libs/channel_fsm.cc b/src/algorithms/channel/libs/channel_fsm.cc index 310a784ef..027ec8564 100644 --- a/src/algorithms/channel/libs/channel_fsm.cc +++ b/src/algorithms/channel/libs/channel_fsm.cc @@ -33,6 +33,7 @@ #include "control_message_factory.h" #include +using google::LogMessage; ChannelFsm::ChannelFsm() { @@ -135,35 +136,41 @@ bool ChannelFsm::Event_failed_tracking_standby() } } + void ChannelFsm::set_acquisition(std::shared_ptr acquisition) { std::lock_guard lk(mx); acq_ = acquisition; } + void ChannelFsm::set_tracking(std::shared_ptr tracking) { std::lock_guard lk(mx); trk_ = tracking; } + void ChannelFsm::set_queue(gr::msg_queue::sptr queue) { std::lock_guard lk(mx); queue_ = queue; } + void ChannelFsm::set_channel(unsigned int channel) { std::lock_guard lk(mx); channel_ = channel; } + void ChannelFsm::start_acquisition() { acq_->reset(); } + void ChannelFsm::start_tracking() { trk_->start_tracking(); @@ -174,6 +181,7 @@ void ChannelFsm::start_tracking() } } + void ChannelFsm::request_satellite() { std::unique_ptr cmf(new ControlMessageFactory()); @@ -183,6 +191,7 @@ void ChannelFsm::request_satellite() } } + void ChannelFsm::notify_stop_tracking() { std::unique_ptr cmf(new ControlMessageFactory()); diff --git a/src/algorithms/channel/libs/channel_msg_receiver_cc.cc b/src/algorithms/channel/libs/channel_msg_receiver_cc.cc index 9b1056bd6..217f9c0eb 100644 --- a/src/algorithms/channel/libs/channel_msg_receiver_cc.cc +++ b/src/algorithms/channel/libs/channel_msg_receiver_cc.cc @@ -42,6 +42,7 @@ channel_msg_receiver_cc_sptr channel_msg_receiver_make_cc(std::shared_ptrEvent_valid_acquisition(); break; - case 2: //negative acquisition + case 2: // negative acquisition if (d_repeat == true) { result = d_channel_fsm->Event_failed_acquisition_repeat(); diff --git a/src/algorithms/conditioner/adapters/array_signal_conditioner.cc b/src/algorithms/conditioner/adapters/array_signal_conditioner.cc index 91cf3abba..e0c6e9beb 100644 --- a/src/algorithms/conditioner/adapters/array_signal_conditioner.cc +++ b/src/algorithms/conditioner/adapters/array_signal_conditioner.cc @@ -37,12 +37,15 @@ using google::LogMessage; // Constructor ArraySignalConditioner::ArraySignalConditioner(ConfigurationInterface *configuration, - std::shared_ptr data_type_adapt, std::shared_ptr in_filt, - std::shared_ptr res, std::string role, std::string implementation) : data_type_adapt_(data_type_adapt), - in_filt_(in_filt), - res_(res), - role_(role), - implementation_(implementation) + std::shared_ptr data_type_adapt, + std::shared_ptr in_filt, + std::shared_ptr res, + std::string role, + std::string implementation) : data_type_adapt_(data_type_adapt), + in_filt_(in_filt), + res_(res), + role_(role), + implementation_(implementation) { connected_ = false; if (configuration) diff --git a/src/algorithms/conditioner/adapters/signal_conditioner.cc b/src/algorithms/conditioner/adapters/signal_conditioner.cc index b29a56c99..0f47b3a11 100644 --- a/src/algorithms/conditioner/adapters/signal_conditioner.cc +++ b/src/algorithms/conditioner/adapters/signal_conditioner.cc @@ -37,12 +37,15 @@ using google::LogMessage; // Constructor SignalConditioner::SignalConditioner(ConfigurationInterface *configuration, - std::shared_ptr data_type_adapt, std::shared_ptr in_filt, - std::shared_ptr res, std::string role, std::string implementation) : data_type_adapt_(data_type_adapt), - in_filt_(in_filt), - res_(res), - role_(role), - implementation_(implementation) + std::shared_ptr data_type_adapt, + std::shared_ptr in_filt, + std::shared_ptr res, + std::string role, + std::string implementation) : data_type_adapt_(data_type_adapt), + in_filt_(in_filt), + res_(res), + role_(role), + implementation_(implementation) { connected_ = false; if (configuration) @@ -101,6 +104,7 @@ gr::basic_block_sptr SignalConditioner::get_left_block() return data_type_adapt_->get_left_block(); } + gr::basic_block_sptr SignalConditioner::get_right_block() { return res_->get_right_block(); From 223d6a357b40f0d7f21d2cc0a6ac1eb4748e08e1 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 29 Apr 2018 12:02:40 +0200 Subject: [PATCH 59/82] Add header --- cmake/Modules/FindGFORTRAN.cmake | 16 ++++++++++++ cmake/Modules/FindGFlags.cmake | 25 +++++++++++++------ cmake/Modules/FindGLOG.cmake | 17 +++++++++++++ cmake/Modules/FindGPSTK.cmake | 17 +++++++++++++ cmake/Modules/FindGnuradio.cmake | 17 +++++++++++++ cmake/Modules/FindGperftools.cmake | 17 +++++++++++++ cmake/Modules/FindGrDbfcttc.cmake | 17 +++++++++++++ cmake/Modules/FindGrGN3S.cmake | 17 +++++++++++++ cmake/Modules/FindGrOsmoSDR.cmake | 17 +++++++++++++ cmake/Modules/FindLibOsmoSDR.cmake | 17 +++++++++++++ cmake/Modules/FindLog4cpp.cmake | 17 +++++++++++++ cmake/Modules/FindMATIO.cmake | 17 +++++++++++++ cmake/Modules/FindORC.cmake | 17 +++++++++++++ cmake/Modules/FindOpenBLAS.cmake | 17 +++++++++++++ cmake/Modules/FindOpenCL.cmake | 17 +++++++++++++ cmake/Modules/FindTeleorbit.cmake | 17 +++++++++++++ cmake/Modules/FindUHD.cmake | 17 +++++++++++++ cmake/Modules/FindVolk.cmake | 17 +++++++++++++ cmake/Modules/FindVolkGnssSdr.cmake | 17 +++++++++++++ cmake/Modules/Findiio.cmake | 17 +++++++++++++ cmake/Modules/Findlibiio.cmake | 17 +++++++++++++ cmake/Modules/SetupPython.cmake | 17 +++++++++++++ cmake/Modules/TestForARM.cmake | 17 +++++++++++++ cmake/Modules/TestForSSE.cmake | 18 +++++++++++++ cmake/Toolchains/oe-sdk_cross.cmake | 17 +++++++++++++ cmake/Toolchains/zynq-7000.cmake | 19 +++++++++++++- cmake/cmake_uninstall.cmake.in | 19 +++++++++++++- .../volk_gnsssdr/cmake/Modules/FindORC.cmake | 21 +++++++++++++--- .../cmake/Modules/VolkAddTest.cmake | 24 ++++++++---------- .../cmake/Modules/VolkBoost.cmake | 16 ++++++------ .../cmake/Modules/VolkBuildTypes.cmake | 16 ++++++------ .../cmake/Modules/VolkGnsssdrConfig.cmake.in | 17 +++++++++++++ .../Modules/VolkGnsssdrConfigVersion.cmake.in | 16 ++++++------ .../cmake/Modules/VolkPython.cmake | 16 ++++++------ .../cmake/Modules/VolkVersion.cmake | 16 ++++++------ .../arm_cortex_a15_hardfp_native.cmake | 17 +++++++++++++ .../arm_cortex_a9_hardfp_native.cmake | 17 +++++++++++++ .../cmake/cmake_uninstall.cmake.in | 18 +++++++++++++ .../volk_gnsssdr/cmake/msvc/config.h | 19 ++++++++++++++ 39 files changed, 613 insertions(+), 71 deletions(-) diff --git a/cmake/Modules/FindGFORTRAN.cmake b/cmake/Modules/FindGFORTRAN.cmake index b676fec0f..c9a7c2c6f 100644 --- a/cmake/Modules/FindGFORTRAN.cmake +++ b/cmake/Modules/FindGFORTRAN.cmake @@ -1,3 +1,19 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . find_library(GFORTRAN NAMES gfortran PATHS /usr/lib diff --git a/cmake/Modules/FindGFlags.cmake b/cmake/Modules/FindGFlags.cmake index 804c908b2..61fa165db 100644 --- a/cmake/Modules/FindGFlags.cmake +++ b/cmake/Modules/FindGFlags.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + # - Try to find GFlags # # The following variables are optionally searched for defaults @@ -9,14 +26,6 @@ # GFlags_LIBS # GFlags_LIBRARY_DIRS -# - Try to find GFlags -# -# -# The following are set after configuration is done: -# GFlags_FOUND -# GFlags_INCLUDE_DIRS -# GFlags_LIBS -# GFlags_LIBRARY_DIRS cmake_minimum_required(VERSION 2.6) if(APPLE) diff --git a/cmake/Modules/FindGLOG.cmake b/cmake/Modules/FindGLOG.cmake index 68b012c8d..4ae4aa5d7 100644 --- a/cmake/Modules/FindGLOG.cmake +++ b/cmake/Modules/FindGLOG.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + # - Try to find the Google Glog library # # This module defines the following variables diff --git a/cmake/Modules/FindGPSTK.cmake b/cmake/Modules/FindGPSTK.cmake index 37ea1dbf0..7c3e79d96 100644 --- a/cmake/Modules/FindGPSTK.cmake +++ b/cmake/Modules/FindGPSTK.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + # - Find gpstk library # Find the native gpstk includes and library # This module defines diff --git a/cmake/Modules/FindGnuradio.cmake b/cmake/Modules/FindGnuradio.cmake index 8b540bee0..a0110b7a3 100644 --- a/cmake/Modules/FindGnuradio.cmake +++ b/cmake/Modules/FindGnuradio.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + ######################################################################## # Find GNU Radio ######################################################################## diff --git a/cmake/Modules/FindGperftools.cmake b/cmake/Modules/FindGperftools.cmake index 5a97a29c5..5ad0ec303 100644 --- a/cmake/Modules/FindGperftools.cmake +++ b/cmake/Modules/FindGperftools.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + # Tries to find Gperftools. # # Usage of this module as follows: diff --git a/cmake/Modules/FindGrDbfcttc.cmake b/cmake/Modules/FindGrDbfcttc.cmake index 5624f8003..d68813480 100644 --- a/cmake/Modules/FindGrDbfcttc.cmake +++ b/cmake/Modules/FindGrDbfcttc.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + ######################################################################## # Find GR-DBFCTTC Module ######################################################################## diff --git a/cmake/Modules/FindGrGN3S.cmake b/cmake/Modules/FindGrGN3S.cmake index 0f1c2cbc5..7147bf65c 100644 --- a/cmake/Modules/FindGrGN3S.cmake +++ b/cmake/Modules/FindGrGN3S.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + ######################################################################## # Find GR-GN3S Module ######################################################################## diff --git a/cmake/Modules/FindGrOsmoSDR.cmake b/cmake/Modules/FindGrOsmoSDR.cmake index a67e1817e..c9d4199c8 100644 --- a/cmake/Modules/FindGrOsmoSDR.cmake +++ b/cmake/Modules/FindGrOsmoSDR.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + # Tries to find gr-osmosdr. # # Usage of this module as follows: diff --git a/cmake/Modules/FindLibOsmoSDR.cmake b/cmake/Modules/FindLibOsmoSDR.cmake index d024e0629..5e52fa0b0 100644 --- a/cmake/Modules/FindLibOsmoSDR.cmake +++ b/cmake/Modules/FindLibOsmoSDR.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + # Tries to find libosmosdr. # # Usage of this module as follows: diff --git a/cmake/Modules/FindLog4cpp.cmake b/cmake/Modules/FindLog4cpp.cmake index 8bddbcd76..8f1254561 100644 --- a/cmake/Modules/FindLog4cpp.cmake +++ b/cmake/Modules/FindLog4cpp.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + # - Find Log4cpp # Find the native LOG4CPP includes and library # diff --git a/cmake/Modules/FindMATIO.cmake b/cmake/Modules/FindMATIO.cmake index e1cb458d8..78ce0f14d 100644 --- a/cmake/Modules/FindMATIO.cmake +++ b/cmake/Modules/FindMATIO.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + # FindMATIO # # Try to find MATIO library diff --git a/cmake/Modules/FindORC.cmake b/cmake/Modules/FindORC.cmake index 9d0da9ee2..ea580334c 100644 --- a/cmake/Modules/FindORC.cmake +++ b/cmake/Modules/FindORC.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + FIND_PACKAGE(PkgConfig) PKG_CHECK_MODULES(PC_ORC "orc-0.4 > 0.4.22") diff --git a/cmake/Modules/FindOpenBLAS.cmake b/cmake/Modules/FindOpenBLAS.cmake index d8751b216..360f1c781 100644 --- a/cmake/Modules/FindOpenBLAS.cmake +++ b/cmake/Modules/FindOpenBLAS.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + # - Try to find OpenBLAS library (not headers!) # # The following environment variable is optionally searched diff --git a/cmake/Modules/FindOpenCL.cmake b/cmake/Modules/FindOpenCL.cmake index 1229090a9..4ae5d6aca 100644 --- a/cmake/Modules/FindOpenCL.cmake +++ b/cmake/Modules/FindOpenCL.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + # # This file taken from FindOpenCL project @ http://gitorious.com/findopencl # diff --git a/cmake/Modules/FindTeleorbit.cmake b/cmake/Modules/FindTeleorbit.cmake index 0d2d3c505..0e46255df 100644 --- a/cmake/Modules/FindTeleorbit.cmake +++ b/cmake/Modules/FindTeleorbit.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + INCLUDE(FindPkgConfig) PKG_CHECK_MODULES(PC_TELEORBIT teleorbit) diff --git a/cmake/Modules/FindUHD.cmake b/cmake/Modules/FindUHD.cmake index 3534e6b87..5a359cece 100644 --- a/cmake/Modules/FindUHD.cmake +++ b/cmake/Modules/FindUHD.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + ######################################################################## # Find the library for the USRP Hardware Driver ######################################################################## diff --git a/cmake/Modules/FindVolk.cmake b/cmake/Modules/FindVolk.cmake index 9621e16f7..37906c8ef 100644 --- a/cmake/Modules/FindVolk.cmake +++ b/cmake/Modules/FindVolk.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + ######################################################################## # Find VOLK (Vector-Optimized Library of Kernels) ######################################################################## diff --git a/cmake/Modules/FindVolkGnssSdr.cmake b/cmake/Modules/FindVolkGnssSdr.cmake index b5890966b..a41584481 100644 --- a/cmake/Modules/FindVolkGnssSdr.cmake +++ b/cmake/Modules/FindVolkGnssSdr.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + ######################################################################## # Find VOLK (Vector-Optimized Library of Kernels) GNSS-SDR library ######################################################################## diff --git a/cmake/Modules/Findiio.cmake b/cmake/Modules/Findiio.cmake index fc7af0d45..ac3e4b1c3 100644 --- a/cmake/Modules/Findiio.cmake +++ b/cmake/Modules/Findiio.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + INCLUDE(FindPkgConfig) PKG_CHECK_MODULES(PC_IIO gnuradio-iio) diff --git a/cmake/Modules/Findlibiio.cmake b/cmake/Modules/Findlibiio.cmake index 334dcf8d7..9b39f82e3 100644 --- a/cmake/Modules/Findlibiio.cmake +++ b/cmake/Modules/Findlibiio.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + INCLUDE(FindPkgConfig) PKG_CHECK_MODULES(PC_LIBIIO libiio) diff --git a/cmake/Modules/SetupPython.cmake b/cmake/Modules/SetupPython.cmake index d3c2b3a12..c876d7bc5 100644 --- a/cmake/Modules/SetupPython.cmake +++ b/cmake/Modules/SetupPython.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + ######################################################################## # Setup the python interpreter: # This allows the user to specify a specific interpreter, diff --git a/cmake/Modules/TestForARM.cmake b/cmake/Modules/TestForARM.cmake index 437a75e1a..0106690ae 100644 --- a/cmake/Modules/TestForARM.cmake +++ b/cmake/Modules/TestForARM.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + ############################################################################## # check if the compiler defines the architecture as ARM and set the # version, if found. diff --git a/cmake/Modules/TestForSSE.cmake b/cmake/Modules/TestForSSE.cmake index 1280f83b3..868340c59 100644 --- a/cmake/Modules/TestForSSE.cmake +++ b/cmake/Modules/TestForSSE.cmake @@ -1,3 +1,21 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + + ############################################################################### # Test for availability of SSE # diff --git a/cmake/Toolchains/oe-sdk_cross.cmake b/cmake/Toolchains/oe-sdk_cross.cmake index 06f589c34..e0006d8fd 100644 --- a/cmake/Toolchains/oe-sdk_cross.cmake +++ b/cmake/Toolchains/oe-sdk_cross.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + ########################################################## # Toolchain file for Open Embedded ########################################################## diff --git a/cmake/Toolchains/zynq-7000.cmake b/cmake/Toolchains/zynq-7000.cmake index 9ce876e56..b804fb943 100644 --- a/cmake/Toolchains/zynq-7000.cmake +++ b/cmake/Toolchains/zynq-7000.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + ########################################################## # Toolchain file for Zynq-7000 devices ########################################################## @@ -23,4 +40,4 @@ set(CMAKE_CXX_FLAGS ${ZYNQ_FLAGS} CACHE STRING "" FORCE) set(CMAKE_LIBRARY_PATH ${CMAKE_SYSROOT}/usr/lib ${CMAKE_SYSROOT}/usr/lib/arm-linux-gnueabihf) -set(CMAKE_INSTALL_PREFIX ${CMAKE_SYSROOT}/usr CACHE STRING "" FORCE) \ No newline at end of file +set(CMAKE_INSTALL_PREFIX ${CMAKE_SYSROOT}/usr CACHE STRING "" FORCE) diff --git a/cmake/cmake_uninstall.cmake.in b/cmake/cmake_uninstall.cmake.in index 2c34c8199..bb9201eb6 100644 --- a/cmake/cmake_uninstall.cmake.in +++ b/cmake/cmake_uninstall.cmake.in @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") @@ -18,4 +35,4 @@ foreach(file ${files}) else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") message(STATUS "File $ENV{DESTDIR}${file} does not exist.") endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") -endforeach(file) \ No newline at end of file +endforeach(file) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/FindORC.cmake b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/FindORC.cmake index 8e8e4f292..ddd103a05 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/FindORC.cmake +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/FindORC.cmake @@ -1,9 +1,24 @@ +# Copyright (C) 2015-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + + FIND_PACKAGE(PkgConfig) PKG_CHECK_MODULES(PC_ORC "orc-0.4 > 0.4.22") - - - FIND_PROGRAM(ORCC_EXECUTABLE orcc HINTS ${PC_ORC_TOOLSDIR} PATHS ${ORC_ROOT}/bin ${CMAKE_INSTALL_PREFIX}/bin) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkAddTest.cmake b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkAddTest.cmake index ea6b82ba1..727230715 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkAddTest.cmake +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkAddTest.cmake @@ -1,21 +1,19 @@ -# Copyright 2015 Free Software Foundation, Inc. +# Copyright (C) 2015-2018 (see AUTHORS file for a list of contributors) # -# This file is part of Volk +# This file is part of GNSS-SDR. # -# Volk is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # -# Volk is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -# License for more details. +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with Volk; see the file COPYING. If not, write to the Free -# Software Foundation, Inc., 51 Franklin Street, Boston, MA -# 02110-1301, USA. +# along with GNSS-SDR. If not, see . if(DEFINED __INCLUDED_VOLK_ADD_TEST) return() diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkBoost.cmake b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkBoost.cmake index dd0c6940f..c875492b4 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkBoost.cmake +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkBoost.cmake @@ -1,21 +1,19 @@ -# Copyright 2010-2011 Free Software Foundation, Inc. +# Copyright (C) 2015-2018 (see AUTHORS file for a list of contributors) # -# This file is part of GNU Radio +# This file is part of GNSS-SDR. # -# GNU Radio is free software; you can redistribute it and/or modify +# GNSS-SDR is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # -# GNU Radio is distributed in the hope that it will be useful, +# GNSS-SDR is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. +# along with GNSS-SDR. If not, see . if(DEFINED __INCLUDED_VOLK_BOOST_CMAKE) return() diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkBuildTypes.cmake b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkBuildTypes.cmake index 5b0c2cc17..1d0e810b1 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkBuildTypes.cmake +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkBuildTypes.cmake @@ -1,21 +1,19 @@ -# Copyright 2014 Free Software Foundation, Inc. +# Copyright (C) 2014-2018 (see AUTHORS file for a list of contributors) # -# This file is part of VOLK +# This file is part of GNSS-SDR. # -# VOLK is free software; you can redistribute it and/or modify +# GNSS-SDR is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # -# VOLK is distributed in the hope that it will be useful, +# GNSS-SDR is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. +# along with GNSS-SDR. If not, see . if(DEFINED __INCLUDED_VOLK_BUILD_TYPES_CMAKE) return() diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfig.cmake.in b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfig.cmake.in index f07b02d50..1f41de730 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfig.cmake.in +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfig.cmake.in @@ -1,3 +1,20 @@ +# Copyright (C) 2015-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + INCLUDE(FindPkgConfig) PKG_CHECK_MODULES(PC_VOLK_GNSSSDR volk_gnsssdr) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfigVersion.cmake.in b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfigVersion.cmake.in index 84dbe0b29..d7403f913 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfigVersion.cmake.in +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfigVersion.cmake.in @@ -1,21 +1,19 @@ -# Copyright 2014 Free Software Foundation, Inc. +# Copyright (C) 2015-2018 (see AUTHORS file for a list of contributors) # -# This file is part of VOLK. +# This file is part of GNSS-SDR. # -# VOLK is free software; you can redistribute it and/or modify +# GNSS-SDR is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # -# VOLK is distributed in the hope that it will be useful, +# GNSS-SDR is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with VOLK; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. +# along with GNSS-SDR. If not, see . set(MAJOR_VERSION @VERSION_INFO_MAJOR_VERSION@) set(MINOR_VERSION @VERSION_INFO_MINOR_VERSION@) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkPython.cmake b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkPython.cmake index dc6571e93..ed7118562 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkPython.cmake +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkPython.cmake @@ -1,21 +1,19 @@ -# Copyright 2010-2011,2013 Free Software Foundation, Inc. +# Copyright (C) 2015-2018 (see AUTHORS file for a list of contributors) # -# This file is part of GNU Radio +# This file is part of GNSS-SDR. # -# GNU Radio is free software; you can redistribute it and/or modify +# GNSS-SDR is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # -# GNU Radio is distributed in the hope that it will be useful, +# GNSS-SDR is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. +# along with GNSS-SDR. If not, see . if(DEFINED __INCLUDED_VOLK_PYTHON_CMAKE) return() diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkVersion.cmake b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkVersion.cmake index 4ed349aac..1cc60fedf 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkVersion.cmake +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkVersion.cmake @@ -1,21 +1,19 @@ -# Copyright 2014 Free Software Foundation, Inc. +# Copyright (C) 2014-2018 (see AUTHORS file for a list of contributors) # -# This file is part of VOLK. +# This file is part of GNSS-SDR. # -# VOLK is free software; you can redistribute it and/or modify +# GNSS-SDR is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # -# VOLK is distributed in the hope that it will be useful, +# GNSS-SDR is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with VOLK; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. +# along with GNSS-SDR. If not, see . if(DEFINED __INCLUDED_VOLK_VERSION_CMAKE) return() diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Toolchains/arm_cortex_a15_hardfp_native.cmake b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Toolchains/arm_cortex_a15_hardfp_native.cmake index 274e63aea..850220b28 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Toolchains/arm_cortex_a15_hardfp_native.cmake +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Toolchains/arm_cortex_a15_hardfp_native.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + ######################################################################## # Toolchain file for building native on a ARM Cortex A8 w/ NEON # Usage: cmake -DCMAKE_TOOLCHAIN_FILE= diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Toolchains/arm_cortex_a9_hardfp_native.cmake b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Toolchains/arm_cortex_a9_hardfp_native.cmake index b8302c872..b4b79185e 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Toolchains/arm_cortex_a9_hardfp_native.cmake +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Toolchains/arm_cortex_a9_hardfp_native.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + ######################################################################## # Toolchain file for building native on a ARM Cortex A8 w/ NEON # Usage: cmake -DCMAKE_TOOLCHAIN_FILE= diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/cmake_uninstall.cmake.in b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/cmake_uninstall.cmake.in index 2c34c8199..7719dec23 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/cmake_uninstall.cmake.in +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/cmake_uninstall.cmake.in @@ -1,3 +1,21 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + + if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/msvc/config.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/msvc/config.h index 5da8f1bff..5b3c7f8f4 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/msvc/config.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/msvc/config.h @@ -1,3 +1,22 @@ +/* + * Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors) + * + * This file is part of GNSS-SDR. + * + * GNSS-SDR is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GNSS-SDR is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNSS-SDR. If not, see . + */ + #ifndef _MSC_VER // [ #error "Use this header only with Microsoft Visual C++ compilers!" #endif // _MSC_VER ] From a2eb5d534406652edc153c713e9a3175a52e10db Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 29 Apr 2018 13:26:21 +0200 Subject: [PATCH 60/82] Improve readability, reorder includes --- ...o_e5a_noncoherent_iq_acquisition_caf_cc.cc | 16 ++++--- .../pcps_opencl_acquisition_cc.cc | 31 ++++++++----- .../pcps_opencl_acquisition_cc.h | 10 ++--- .../input_filter/gnuradio_blocks/notch_cc.cc | 12 +++-- .../gnuradio_blocks/notch_lite_cc.cc | 15 +++++-- .../gnuradio_blocks/pulse_blanking_cc.cc | 11 +++-- .../direct_resampler_conditioner_cb.cc | 15 ++++--- .../direct_resampler_conditioner_cc.cc | 8 +++- .../direct_resampler_conditioner_cs.cc | 14 +++--- .../gnuradio_blocks/signal_generator_c.cc | 45 +++++++++++-------- .../gnuradio_blocks/labsat23_source.cc | 10 ++--- 11 files changed, 118 insertions(+), 69 deletions(-) diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc index 7144a219b..f8fa95f8e 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc @@ -36,12 +36,12 @@ */ #include "galileo_e5a_noncoherent_iq_acquisition_caf_cc.h" -#include -#include +#include "control_message_factory.h" #include +#include #include #include -#include "control_message_factory.h" +#include using google::LogMessage; @@ -62,11 +62,15 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr galileo_e5a_noncoherentIQ_make samples_per_code, bit_transition_flag, dump, dump_filename, both_signal_components_, CAF_window_hz_, Zero_padding_)); } + galileo_e5a_noncoherentIQ_acquisition_caf_cc::galileo_e5a_noncoherentIQ_acquisition_caf_cc( unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, - int samples_per_ms, int samples_per_code, + unsigned int doppler_max, + long freq, + long fs_in, + int samples_per_ms, + int samples_per_code, bool bit_transition_flag, bool dump, std::string dump_filename, @@ -167,6 +171,7 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc::galileo_e5a_noncoherentIQ_acquisit d_gr_stream_buffer = 0; } + galileo_e5a_noncoherentIQ_acquisition_caf_cc::~galileo_e5a_noncoherentIQ_acquisition_caf_cc() { if (d_num_doppler_bins > 0) @@ -267,6 +272,7 @@ void galileo_e5a_noncoherentIQ_acquisition_caf_cc::set_local_code(std::complexFlag_valid_acquisition = false; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc index 17d3628d5..851ec0545 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc @@ -49,18 +49,18 @@ */ #include "pcps_opencl_acquisition_cc.h" -#include -#include -#include -#include -#include -#include -#include -#include #include "control_message_factory.h" #include "opencl/fft_base_kernels.h" #include "opencl/fft_internal.h" #include "GPS_L1_CA.h" //GPS_TWO_PI +#include +#include +#include +#include +#include +#include +#include +#include using google::LogMessage; @@ -78,10 +78,15 @@ pcps_opencl_acquisition_cc_sptr pcps_make_opencl_acquisition_cc( samples_per_code, bit_transition_flag, dump, dump_filename)); } + pcps_opencl_acquisition_cc::pcps_opencl_acquisition_cc( - unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, - int samples_per_ms, int samples_per_code, + unsigned int sampled_ms, + unsigned int max_dwells, + unsigned int doppler_max, + long freq, + long fs_in, + int samples_per_ms, + int samples_per_code, bool bit_transition_flag, bool dump, std::string dump_filename) : gr::block("pcps_opencl_acquisition_cc", @@ -339,6 +344,7 @@ void pcps_opencl_acquisition_cc::init() } } + void pcps_opencl_acquisition_cc::set_local_code(std::complex *code) { if (d_opencl == 0) @@ -374,6 +380,7 @@ void pcps_opencl_acquisition_cc::set_local_code(std::complex *code) } } + void pcps_opencl_acquisition_cc::acquisition_core_volk() { // initialize acquisition algorithm @@ -496,6 +503,7 @@ void pcps_opencl_acquisition_cc::acquisition_core_volk() d_core_working = false; } + void pcps_opencl_acquisition_cc::acquisition_core_opencl() { // initialize acquisition algorithm @@ -687,6 +695,7 @@ void pcps_opencl_acquisition_cc::set_state(int state) } } + int pcps_opencl_acquisition_cc::general_work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items __attribute__((unused))) diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.h index aebc73ef8..00a52b89a 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.h @@ -51,14 +51,14 @@ #ifndef GNSS_SDR_PCPS_OPENCL_ACQUISITION_CC_H_ #define GNSS_SDR_PCPS_OPENCL_ACQUISITION_CC_H_ -#include -#include -#include +#include "gnss_synchro.h" +#include "opencl/fft_internal.h" #include #include #include -#include "opencl/fft_internal.h" -#include "gnss_synchro.h" +#include +#include +#include #ifdef __APPLE__ #include "opencl/cl.hpp" diff --git a/src/algorithms/input_filter/gnuradio_blocks/notch_cc.cc b/src/algorithms/input_filter/gnuradio_blocks/notch_cc.cc index 8ada10c1f..632fd6d87 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/notch_cc.cc +++ b/src/algorithms/input_filter/gnuradio_blocks/notch_cc.cc @@ -45,9 +45,13 @@ notch_sptr make_notch_filter(float pfa, float p_c_factor, } -Notch::Notch(float pfa, float p_c_factor, int length_, int n_segments_est, int n_segments_reset) : gr::block("Notch", - gr::io_signature::make(1, 1, sizeof(gr_complex)), - gr::io_signature::make(1, 1, sizeof(gr_complex))) +Notch::Notch(float pfa, + float p_c_factor, + int length_, + int n_segments_est, + int n_segments_reset) : gr::block("Notch", + gr::io_signature::make(1, 1, sizeof(gr_complex)), + gr::io_signature::make(1, 1, sizeof(gr_complex))) { const int alignment_multiple = volk_get_alignment() / sizeof(gr_complex); set_alignment(std::max(1, alignment_multiple)); @@ -79,6 +83,7 @@ Notch::~Notch() volk_free(power_spect); } + void Notch::forecast(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items_required) { for (unsigned int aux = 0; aux < ninput_items_required.size(); aux++) @@ -87,6 +92,7 @@ void Notch::forecast(int noutput_items __attribute__((unused)), gr_vector_int &n } } + int Notch::general_work(int noutput_items, gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { diff --git a/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.cc b/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.cc index e55cc0e29..82d5f5304 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.cc +++ b/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.cc @@ -43,9 +43,15 @@ notch_lite_sptr make_notch_filter_lite(float p_c_factor, float pfa, int length_, return notch_lite_sptr(new NotchLite(p_c_factor, pfa, length_, n_segments_est, n_segments_reset, n_segments_coeff)); } -NotchLite::NotchLite(float p_c_factor, float pfa, int length_, int n_segments_est, int n_segments_reset, int n_segments_coeff) : gr::block("NotchLite", - gr::io_signature::make(1, 1, sizeof(gr_complex)), - gr::io_signature::make(1, 1, sizeof(gr_complex))) + +NotchLite::NotchLite(float p_c_factor, + float pfa, + int length_, + int n_segments_est, + int n_segments_reset, + int n_segments_coeff) : gr::block("NotchLite", + gr::io_signature::make(1, 1, sizeof(gr_complex)), + gr::io_signature::make(1, 1, sizeof(gr_complex))) { const int alignment_multiple = volk_get_alignment() / sizeof(gr_complex); set_alignment(std::max(1, alignment_multiple)); @@ -74,11 +80,13 @@ NotchLite::NotchLite(float p_c_factor, float pfa, int length_, int n_segments_es d_fft = std::unique_ptr(new gr::fft::fft_complex(length_, true)); } + NotchLite::~NotchLite() { volk_free(power_spect); } + void NotchLite::forecast(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items_required) { for (unsigned int aux = 0; aux < ninput_items_required.size(); aux++) @@ -87,6 +95,7 @@ void NotchLite::forecast(int noutput_items __attribute__((unused)), gr_vector_in } } + int NotchLite::general_work(int noutput_items, gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { diff --git a/src/algorithms/input_filter/gnuradio_blocks/pulse_blanking_cc.cc b/src/algorithms/input_filter/gnuradio_blocks/pulse_blanking_cc.cc index 1a6a0828e..a59d5c2be 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/pulse_blanking_cc.cc +++ b/src/algorithms/input_filter/gnuradio_blocks/pulse_blanking_cc.cc @@ -44,9 +44,12 @@ pulse_blanking_cc_sptr make_pulse_blanking_cc(float pfa, int length_, } -pulse_blanking_cc::pulse_blanking_cc(float pfa, int length_, int n_segments_est, int n_segments_reset) : gr::block("pulse_blanking_cc", - gr::io_signature::make(1, 1, sizeof(gr_complex)), - gr::io_signature::make(1, 1, sizeof(gr_complex))) +pulse_blanking_cc::pulse_blanking_cc(float pfa, + int length_, + int n_segments_est, + int n_segments_reset) : gr::block("pulse_blanking_cc", + gr::io_signature::make(1, 1, sizeof(gr_complex)), + gr::io_signature::make(1, 1, sizeof(gr_complex))) { const int alignment_multiple = volk_get_alignment() / sizeof(gr_complex); set_alignment(std::max(1, alignment_multiple)); @@ -73,6 +76,7 @@ pulse_blanking_cc::~pulse_blanking_cc() volk_free(zeros_); } + void pulse_blanking_cc::forecast(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items_required) { for (unsigned int aux = 0; aux < ninput_items_required.size(); aux++) @@ -81,6 +85,7 @@ void pulse_blanking_cc::forecast(int noutput_items __attribute__((unused)), gr_v } } + int pulse_blanking_cc::general_work(int noutput_items, gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { diff --git a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.cc b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.cc index 9a053b46d..f51a9d45c 100644 --- a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.cc +++ b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.cc @@ -49,13 +49,14 @@ direct_resampler_conditioner_cb_sptr direct_resampler_make_conditioner_cb( direct_resampler_conditioner_cb::direct_resampler_conditioner_cb( - double sample_freq_in, double sample_freq_out) : gr::block("direct_resampler_make_conditioner_cb", gr::io_signature::make(1, 1, sizeof(lv_8sc_t)), gr::io_signature::make(1, 1, sizeof(lv_8sc_t))), - d_sample_freq_in(sample_freq_in), - d_sample_freq_out( - sample_freq_out), - d_phase(0), - d_lphase(0), - d_history(1) + double sample_freq_in, + double sample_freq_out) : gr::block("direct_resampler_make_conditioner_cb", gr::io_signature::make(1, 1, sizeof(lv_8sc_t)), gr::io_signature::make(1, 1, sizeof(lv_8sc_t))), + d_sample_freq_in(sample_freq_in), + d_sample_freq_out( + sample_freq_out), + d_phase(0), + d_lphase(0), + d_history(1) { const double two_32 = 4294967296.0; // Computes the phase step multiplying the resampling ratio by 2^32 = 4294967296 diff --git a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.cc b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.cc index b238a7c0d..b7eb65691 100644 --- a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.cc +++ b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.cc @@ -49,7 +49,13 @@ direct_resampler_conditioner_cc_sptr direct_resampler_make_conditioner_cc( direct_resampler_conditioner_cc::direct_resampler_conditioner_cc( - double sample_freq_in, double sample_freq_out) : gr::block("direct_resampler_conditioner_cc", gr::io_signature::make(1, 1, sizeof(gr_complex)), gr::io_signature::make(1, 1, sizeof(gr_complex))), d_sample_freq_in(sample_freq_in), d_sample_freq_out(sample_freq_out), d_phase(0), d_lphase(0), d_history(1) + double sample_freq_in, + double sample_freq_out) : gr::block("direct_resampler_conditioner_cc", gr::io_signature::make(1, 1, sizeof(gr_complex)), gr::io_signature::make(1, 1, sizeof(gr_complex))), + d_sample_freq_in(sample_freq_in), + d_sample_freq_out(sample_freq_out), + d_phase(0), + d_lphase(0), + d_history(1) { // Computes the phase step multiplying the resampling ratio by 2^32 = 4294967296 const double two_32 = 4294967296.0; diff --git a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.cc b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.cc index 8e7f32d80..32eb06241 100644 --- a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.cc +++ b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.cc @@ -48,13 +48,13 @@ direct_resampler_conditioner_cs_sptr direct_resampler_make_conditioner_cs( direct_resampler_conditioner_cs::direct_resampler_conditioner_cs( - double sample_freq_in, double sample_freq_out) : gr::block("direct_resampler_make_conditioner_cs", gr::io_signature::make(1, 1, sizeof(lv_16sc_t)), gr::io_signature::make(1, 1, sizeof(lv_16sc_t))), - d_sample_freq_in(sample_freq_in), - d_sample_freq_out( - sample_freq_out), - d_phase(0), - d_lphase(0), - d_history(1) + double sample_freq_in, + double sample_freq_out) : gr::block("direct_resampler_make_conditioner_cs", gr::io_signature::make(1, 1, sizeof(lv_16sc_t)), gr::io_signature::make(1, 1, sizeof(lv_16sc_t))), + d_sample_freq_in(sample_freq_in), + d_sample_freq_out(sample_freq_out), + d_phase(0), + d_lphase(0), + d_history(1) { const double two_32 = 4294967296.0; // Computes the phase step multiplying the resampling ratio by 2^32 = 4294967296 diff --git a/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc b/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc index bfb1eb48a..848059434 100644 --- a/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc +++ b/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc @@ -56,32 +56,41 @@ signal_make_generator_c(std::vector signal1, std::vector signal1, std::vector system, const std::vector &PRN, - const std::vector &CN0_dB, const std::vector &doppler_Hz, - const std::vector &delay_chips, const std::vector &delay_sec, bool data_flag, bool noise_flag, - unsigned int fs_in, unsigned int vector_length, float BW_BB) : gr::block("signal_gen_cc", gr::io_signature::make(0, 0, sizeof(gr_complex)), - gr::io_signature::make(1, 1, sizeof(gr_complex) * vector_length)), - signal_(signal1), - system_(system), - PRN_(PRN), - CN0_dB_(CN0_dB), - doppler_Hz_(doppler_Hz), - delay_chips_(delay_chips), - delay_sec_(delay_sec), - data_flag_(data_flag), - noise_flag_(noise_flag), - fs_in_(fs_in), - num_sats_(PRN.size()), - vector_length_(vector_length), - BW_BB_(BW_BB * static_cast(fs_in) / 2.0) +signal_generator_c::signal_generator_c(std::vector signal1, + std::vector system, + const std::vector &PRN, + const std::vector &CN0_dB, + const std::vector &doppler_Hz, + const std::vector &delay_chips, + const std::vector &delay_sec, + bool data_flag, + bool noise_flag, + unsigned int fs_in, + unsigned int vector_length, + float BW_BB) : gr::block("signal_gen_cc", gr::io_signature::make(0, 0, sizeof(gr_complex)), gr::io_signature::make(1, 1, sizeof(gr_complex) * vector_length)), + signal_(signal1), + system_(system), + PRN_(PRN), + CN0_dB_(CN0_dB), + doppler_Hz_(doppler_Hz), + delay_chips_(delay_chips), + delay_sec_(delay_sec), + data_flag_(data_flag), + noise_flag_(noise_flag), + fs_in_(fs_in), + num_sats_(PRN.size()), + vector_length_(vector_length), + BW_BB_(BW_BB * static_cast(fs_in) / 2.0) { init(); generate_codes(); } + void signal_generator_c::init() { work_counter_ = 0; diff --git a/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc b/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc index 118734dde..634b79cff 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc @@ -6,9 +6,6 @@ * ------------------------------------------------------------------------- * * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors) * * GNSS-SDR is a software defined Global Navigation * Satellite Systems receiver @@ -52,9 +49,10 @@ std::string labsat23_source::generate_filename() } -labsat23_source::labsat23_source(const char *signal_file_basename, int channel_selector) : gr::block("labsat23_source", - gr::io_signature::make(0, 0, 0), - gr::io_signature::make(1, 1, sizeof(gr_complex))) +labsat23_source::labsat23_source(const char *signal_file_basename, + int channel_selector) : gr::block("labsat23_source", + gr::io_signature::make(0, 0, 0), + gr::io_signature::make(1, 1, sizeof(gr_complex))) { if (channel_selector < 1 or channel_selector > 2) { From 7832c4f1e56e7a1ef8ea499eb40aa91eb6638d5d Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 29 Apr 2018 18:19:57 +0200 Subject: [PATCH 61/82] Update Armadillo version to 8.500.0 --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 270eaf8d5..ddb36c7c9 100644 --- a/README.md +++ b/README.md @@ -185,9 +185,9 @@ or manually as explained below, and then please follow instructions on how to [d $ sudo apt-get install libopenblas-dev liblapack-dev # For Debian/Ubuntu/LinuxMint $ sudo yum install lapack-devel blas-devel # For Fedora/CentOS/RHEL $ sudo zypper install lapack-devel blas-devel # For OpenSUSE -$ wget http://sourceforge.net/projects/arma/files/armadillo-8.200.2.tar.xz -$ tar xvfz armadillo-8.200.2.tar.xz -$ cd armadillo-8.200.2 +$ wget http://sourceforge.net/projects/arma/files/armadillo-8.500.0.tar.xz +$ tar xvfz armadillo-8.500.0.tar.xz +$ cd armadillo-8.500.0 $ cmake . $ make $ sudo make install From 627848458eb3ec65a15184b6b5adf61b3f41f03f Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 29 Apr 2018 19:23:46 +0200 Subject: [PATCH 62/82] Remove unused variable --- src/core/receiver/gnss_flowgraph.cc | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index 3303d15b6..532aaaf15 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -772,15 +772,6 @@ void GNSSFlowgraph::set_signals_list() // Set a sequential list of GNSS satellites std::set::const_iterator available_gnss_prn_iter; - // Read GNSS systems and signals - unsigned int total_channels = configuration_->property("Channels_1C.count", 0) + - configuration_->property("Channels_1B.count", 0) + - configuration_->property("Channels_1G.count", 0) + - configuration_->property("Channels_2S.count", 0) + - configuration_->property("Channels_2G.count", 0) + - configuration_->property("Channels_5X.count", 0) + - configuration_->property("Channels_L5.count", 0); - // Create the lists of GNSS satellites std::set available_gps_prn = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, From 4433c0c6bea86801c857a7503425a88c2341388a Mon Sep 17 00:00:00 2001 From: mmajoral Date: Mon, 30 Apr 2018 11:59:56 +0200 Subject: [PATCH 63/82] Minor code cleaning. --- .../gps_l1_ca_pcps_acquisition_fpga.cc | 40 +++++++++---------- .../gps_l1_ca_pcps_acquisition_fpga.h | 9 +---- .../gnuradio_blocks/pcps_acquisition_fpga.cc | 13 +++--- .../gnuradio_blocks/pcps_acquisition_fpga.h | 7 +--- .../acquisition/libs/fpga_acquisition.cc | 37 +++++++++++------ 5 files changed, 52 insertions(+), 54 deletions(-) diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc index f585fdbc0..455fac062 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc @@ -1,4 +1,3 @@ - /*! * \file gps_l1_ca_pcps_acquisition_fpga.cc * \brief Adapts a PCPS acquisition block to an FPGA AcquisitionInterface @@ -59,21 +58,21 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( DLOG(INFO) << "role " << role; long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); - fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); - acq_parameters.fs_in = fs_in_; - if_ = configuration_->property(role + ".if", 0); - acq_parameters.freq = if_; + long fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); + acq_parameters.fs_in = fs_in; + long ifreq = configuration_->property(role + ".if", 0); + acq_parameters.freq = ifreq; doppler_max_ = configuration_->property(role + ".doppler_max", 5000); if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; acq_parameters.doppler_max = doppler_max_; - sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1); - acq_parameters.sampled_ms = sampled_ms_; - code_length_ = static_cast(std::round(static_cast(fs_in_) / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS))); + unsigned int sampled_ms = configuration_->property(role + ".coherent_integration_time_ms", 1); + acq_parameters.sampled_ms = sampled_ms; + unsigned int code_length = static_cast(std::round(static_cast(fs_in) / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS))); // The FPGA can only use FFT lengths that are a power of two. - float nbits = ceilf(log2f((float) code_length_)); + float nbits = ceilf(log2f((float) code_length)); unsigned int nsamples_total = pow(2, nbits); - vector_length_ = nsamples_total * sampled_ms_; + unsigned int vector_length = nsamples_total * sampled_ms; unsigned int select_queue_Fpga = configuration_->property(role + ".select_queue_Fpga",0); acq_parameters.select_queue_Fpga = select_queue_Fpga; std::string default_device_name = "/dev/uio0"; @@ -85,20 +84,18 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( // compute all the GPS L1 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time // a channel is assigned) - // Direct FFT - gr::fft::fft_complex* fft_if = new gr::fft::fft_complex(vector_length_, true); - // allocate memory to compute all the PRNs - // and compute all the possible codes + gr::fft::fft_complex* fft_if = new gr::fft::fft_complex(vector_length, true); // Direct FFT + // allocate memory to compute all the PRNs and compute all the possible codes std::complex* code = new std::complex[nsamples_total]; // buffer for the local code gr_complex* fft_codes_padded = static_cast(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); - d_all_fft_codes = new lv_16sc_t[nsamples_total * NUM_PRNs]; // memory containing all the possible fft codes for PRN 0 to 32 + d_all_fft_codes_ = new lv_16sc_t[nsamples_total * NUM_PRNs]; // memory containing all the possible fft codes for PRN 0 to 32 float max; // temporary maxima search for (unsigned int PRN = 1; PRN <= NUM_PRNs; PRN++) { - gps_l1_ca_code_gen_complex_sampled(code, PRN, fs_in_, 0); // generate PRN code + gps_l1_ca_code_gen_complex_sampled(code, PRN, fs_in, 0); // generate PRN code // fill in zero padding - for (int s=code_length_;s(floor(fft_codes_padded[i].real() * (pow(2, 7) - 1) / max)), + d_all_fft_codes_[i + nsamples_total * (PRN -1)] = lv_16sc_t(static_cast(floor(fft_codes_padded[i].real() * (pow(2, 7) - 1) / max)), static_cast(floor(fft_codes_padded[i].imag() * (pow(2, 7) - 1) / max))); } } - acq_parameters.all_fft_codes = d_all_fft_codes; //acq_parameters + + acq_parameters.all_fft_codes = d_all_fft_codes_; + // temporary buffers that we can delete delete[] code; delete fft_if; @@ -144,8 +143,7 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( GpsL1CaPcpsAcquisitionFpga::~GpsL1CaPcpsAcquisitionFpga() { - //delete[] code_; - delete[] d_all_fft_codes; + delete[] d_all_fft_codes_; } diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h index d65e677e7..642e9bf8e 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h @@ -37,10 +37,10 @@ #ifndef GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_FPGA_H_ #define GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_FPGA_H_ +#include #include "acquisition_interface.h" #include "gnss_synchro.h" #include "pcps_acquisition_fpga.h" -#include class ConfigurationInterface; @@ -137,19 +137,14 @@ public: private: ConfigurationInterface* configuration_; pcps_acquisition_fpga_sptr acquisition_fpga_; - unsigned int vector_length_; - unsigned int code_length_; unsigned int channel_; unsigned int doppler_max_; unsigned int doppler_step_; - unsigned int sampled_ms_; - long fs_in_; - long if_; Gnss_Synchro* gnss_synchro_; std::string role_; unsigned int in_streams_; unsigned int out_streams_; - lv_16sc_t *d_all_fft_codes; // memory that contains all the code ffts + lv_16sc_t *d_all_fft_codes_; // memory that contains all the code ffts }; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc index 4f21ffa7a..6a337925e 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc @@ -38,11 +38,10 @@ * ------------------------------------------------------------------------- */ -#include "pcps_acquisition_fpga.h" -#include "GPS_L1_CA.h" // for GPS_TWO_PI -#include "GLONASS_L1_L2_CA.h" // for GLONASS_TWO_PI" + #include #include +#include "pcps_acquisition_fpga.h" using google::LogMessage; @@ -175,12 +174,10 @@ void pcps_acquisition_fpga::set_active(bool active) // initialize acquisition algorithm uint32_t indext = 0; float magt = 0.0; - int effective_fft_size = d_fft_size; float fft_normalization_factor = static_cast(d_fft_size) * static_cast(d_fft_size); d_input_power = 0.0; d_mag = 0.0; - //d_well_count++; DLOG(INFO) << "Channel: " << d_channel << " , doing acquisition of satellite: " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN @@ -208,9 +205,9 @@ void pcps_acquisition_fpga::set_active(bool active) { d_mag = magt; - input_power_all = d_input_power / (effective_fft_size - 1); - input_power_computed = (d_input_power - d_mag) / (effective_fft_size - 1); - d_input_power = (d_input_power - d_mag) / (effective_fft_size - 1); + input_power_all = d_input_power / (d_fft_size - 1); + input_power_computed = (d_input_power - d_mag) / (d_fft_size - 1); + d_input_power = (d_input_power - d_mag) / (d_fft_size - 1); d_gnss_synchro->Acq_delay_samples = static_cast(indext % acq_parameters.samples_per_code); d_gnss_synchro->Acq_doppler_hz = static_cast(doppler); diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h index d140f538c..3014a278a 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h @@ -56,9 +56,10 @@ #ifndef GNSS_SDR_PCPS_ACQUISITION_FPGA_H_ #define GNSS_SDR_PCPS_ACQUISITION_FPGA_H_ -#include "gnss_synchro.h" + #include #include "fpga_acquisition.h" +#include "gnss_synchro.h" typedef struct { @@ -69,10 +70,8 @@ typedef struct long fs_in; int samples_per_ms; int samples_per_code; - std::string dump_filename; unsigned int select_queue_Fpga; std::string device_name; - unsigned int code_length; lv_16sc_t *all_fft_codes; // memory that contains all the code ffts } pcpsconf_fpga_t; @@ -118,8 +117,6 @@ private: Gnss_Synchro* d_gnss_synchro; std::shared_ptr acquisition_fpga; - - public: ~pcps_acquisition_fpga(); diff --git a/src/algorithms/acquisition/libs/fpga_acquisition.cc b/src/algorithms/acquisition/libs/fpga_acquisition.cc index 213183ba5..82f22e050 100644 --- a/src/algorithms/acquisition/libs/fpga_acquisition.cc +++ b/src/algorithms/acquisition/libs/fpga_acquisition.cc @@ -33,9 +33,6 @@ * ------------------------------------------------------------------------- */ -#include "fpga_acquisition.h" -#include "gps_sdr_signal_processing.h" - // libraries used by the GIPO #include #include @@ -46,9 +43,23 @@ // GPS L1 #include "GPS_L1_CA.h" -#define PAGE_SIZE 0x10000 -#define MAX_PHASE_STEP_RAD 0.999999999534339 // 1 - pow(2,-31); -#define TEST_REG_SANITY_CHECK 0x55AA +#include "fpga_acquisition.h" +#include "gps_sdr_signal_processing.h" + +#define PAGE_SIZE 0x10000 // default page size for the multicorrelator memory map +#define MAX_PHASE_STEP_RAD 0.999999999534339 // 1 - pow(2,-31); +#define RESET_ACQUISITION 2 // command to reset the multicorrelator +#define LAUNCH_ACQUISITION 1 // command to launch the multicorrelator +#define TEST_REG_SANITY_CHECK 0x55AA // value to check the presence of the test register (to detect the hw) +#define LOCAL_CODE_CLEAR_MEM 0x10000000 // command to clear the internal memory of the multicorrelator +#define MEM_LOCAL_CODE_WR_ENABLE 0x0C000000 // command to enable the ENA and WR pins of the internal memory of the multicorrelator +#define POW_2_2 4 // 2^2 (used for the conversion of floating point numbers to integers) +#define POW_2_29 536870912 // 2^29 (used for the conversion of floating point numbers to integers) +#define SELECT_LSB 0x00FF // value to select the least significant byte +#define SELECT_MSB 0XFF00 // value to select the most significant byte +#define SELECT_16_BITS 0xFFFF // value to select 16 bits +#define SHL_8_BITS 256 // value used to shift a value 8 bits to the left + bool fpga_acquisition::init() { @@ -144,14 +155,14 @@ void fpga_acquisition::fpga_configure_acquisition_local_code(lv_16sc_t fft_local unsigned int k, tmp, tmp2; unsigned int fft_data; // clear memory address counter - d_map_base[4] = 0x10000000; + d_map_base[4] = LOCAL_CODE_CLEAR_MEM; // write local code for (k = 0; k < d_vector_length; k++) { tmp = fft_local_code[k].real(); tmp2 = fft_local_code[k].imag(); - local_code = (tmp & 0xFF) | ((tmp2 * 256) & 0xFF00); // put together the real part and the imaginary part - fft_data = 0x0C000000 | (local_code & 0xFFFF); + local_code = (tmp & SELECT_LSB) | ((tmp2 * SHL_8_BITS) & SELECT_MSB); // put together the real part and the imaginary part + fft_data = MEM_LOCAL_CODE_WR_ENABLE | (local_code & SELECT_16_BITS); d_map_base[4] = fft_data; } } @@ -162,7 +173,7 @@ void fpga_acquisition::run_acquisition(void) int reenable = 1; write(d_fd, reinterpret_cast(&reenable), sizeof(int)); // launch the acquisition process - d_map_base[6] = 1; // writing anything to reg 6 launches the acquisition process + d_map_base[6] = LAUNCH_ACQUISITION; // writing anything to reg 6 launches the acquisition process int irq_count; ssize_t nb; @@ -201,8 +212,8 @@ void fpga_acquisition::set_phase_step(unsigned int doppler_index) { phase_step_rad_real = MAX_PHASE_STEP_RAD; } - phase_step_rad_int_temp = phase_step_rad_real * 4; // * 2^2 - phase_step_rad_int = (int32_t) (phase_step_rad_int_temp * (536870912)); // * 2^29 (in total it makes x2^31 in two steps to avoid the warnings + phase_step_rad_int_temp = phase_step_rad_real * POW_2_2; // * 2^2 + phase_step_rad_int = (int32_t) (phase_step_rad_int_temp * (POW_2_29)); // * 2^29 (in total it makes x2^31 in two steps to avoid the warnings d_map_base[3] = phase_step_rad_int; } @@ -243,5 +254,5 @@ void fpga_acquisition::close_device() void fpga_acquisition::reset_acquisition(void) { - d_map_base[6] = 2; // writing a 2 to d_map_base[6] resets the multicorrelator + d_map_base[6] = RESET_ACQUISITION; // writing a 2 to d_map_base[6] resets the multicorrelator } From bd8133020183b8790e3221da6093b6d9ef224656 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 30 Apr 2018 19:53:20 +0200 Subject: [PATCH 64/82] Apply code formatting --- src/algorithms/libs/CMakeLists.txt | 146 ++++++------- .../signal_source/libs/CMakeLists.txt | 7 +- .../signal_source/libs/fpga_switch.cc | 17 +- .../signal_source/libs/fpga_switch.h | 9 +- .../tracking/libs/fpga_multicorrelator_8sc.cc | 143 ++++++------ .../tracking/libs/fpga_multicorrelator_8sc.h | 48 ++-- .../gps_l1_ca_dll_pll_tracking_test_fpga.cc | 206 +++++++++--------- 7 files changed, 281 insertions(+), 295 deletions(-) diff --git a/src/algorithms/libs/CMakeLists.txt b/src/algorithms/libs/CMakeLists.txt index fd34bf693..6a3924e19 100644 --- a/src/algorithms/libs/CMakeLists.txt +++ b/src/algorithms/libs/CMakeLists.txt @@ -19,81 +19,81 @@ add_subdirectory(rtklib) if(ENABLE_FPGA) - set(GNSS_SPLIBS_SOURCES - gps_l2c_signal.cc - gps_l5_signal.cc - galileo_e1_signal_processing.cc - gnss_sdr_valve.cc - gnss_sdr_sample_counter.cc - gnss_sdr_time_counter.cc - gnss_signal_processing.cc - gps_sdr_signal_processing.cc - glonass_l1_signal_processing.cc - glonass_l2_signal_processing.cc - pass_through.cc - galileo_e5_signal_processing.cc - complex_byte_to_float_x2.cc - byte_x2_to_complex_byte.cc - cshort_to_float_x2.cc - short_x2_to_cshort.cc - complex_float_to_complex_byte.cc - conjugate_cc.cc - conjugate_sc.cc - conjugate_ic.cc + set(GNSS_SPLIBS_SOURCES + gps_l2c_signal.cc + gps_l5_signal.cc + galileo_e1_signal_processing.cc + gnss_sdr_valve.cc + gnss_sdr_sample_counter.cc + gnss_sdr_time_counter.cc + gnss_signal_processing.cc + gps_sdr_signal_processing.cc + glonass_l1_signal_processing.cc + glonass_l2_signal_processing.cc + pass_through.cc + galileo_e5_signal_processing.cc + complex_byte_to_float_x2.cc + byte_x2_to_complex_byte.cc + cshort_to_float_x2.cc + short_x2_to_cshort.cc + complex_float_to_complex_byte.cc + conjugate_cc.cc + conjugate_sc.cc + conjugate_ic.cc ) else(ENABLE_FPGA) set(GNSS_SPLIBS_SOURCES - gps_l2c_signal.cc - gps_l5_signal.cc - galileo_e1_signal_processing.cc - gnss_sdr_valve.cc - gnss_sdr_sample_counter.cc - gnss_signal_processing.cc - gps_sdr_signal_processing.cc - glonass_l1_signal_processing.cc - glonass_l2_signal_processing.cc - pass_through.cc - galileo_e5_signal_processing.cc - complex_byte_to_float_x2.cc - byte_x2_to_complex_byte.cc - cshort_to_float_x2.cc - short_x2_to_cshort.cc - complex_float_to_complex_byte.cc - conjugate_cc.cc - conjugate_sc.cc - conjugate_ic.cc - ) + gps_l2c_signal.cc + gps_l5_signal.cc + galileo_e1_signal_processing.cc + gnss_sdr_valve.cc + gnss_sdr_sample_counter.cc + gnss_signal_processing.cc + gps_sdr_signal_processing.cc + glonass_l1_signal_processing.cc + glonass_l2_signal_processing.cc + pass_through.cc + galileo_e5_signal_processing.cc + complex_byte_to_float_x2.cc + byte_x2_to_complex_byte.cc + cshort_to_float_x2.cc + short_x2_to_cshort.cc + complex_float_to_complex_byte.cc + conjugate_cc.cc + conjugate_sc.cc + conjugate_ic.cc + ) endif(ENABLE_FPGA) if(OPENCL_FOUND) - set(GNSS_SPLIBS_SOURCES ${GNSS_SPLIBS_SOURCES} - opencl/fft_execute.cc # Needs OpenCL - opencl/fft_setup.cc # Needs OpenCL - opencl/fft_kernelstring.cc # Needs OpenCL - ) + set(GNSS_SPLIBS_SOURCES ${GNSS_SPLIBS_SOURCES} + opencl/fft_execute.cc # Needs OpenCL + opencl/fft_setup.cc # Needs OpenCL + opencl/fft_kernelstring.cc # Needs OpenCL + ) endif(OPENCL_FOUND) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${GNURADIO_BLOCKS_INCLUDE_DIRS} - ${VOLK_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${Boost_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${GNURADIO_BLOCKS_INCLUDE_DIRS} + ${VOLK_INCLUDE_DIRS} + ${VOLK_GNSSSDR_INCLUDE_DIRS} ) if(OPENCL_FOUND) - include_directories( ${OPENCL_INCLUDE_DIRS} ) - if(OS_IS_MACOSX) - set(OPT_LIBRARIES ${OPT_LIBRARIES} "-framework OpenCL") - else(OS_IS_MACOSX) - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${OPENCL_LIBRARIES}) - endif(OS_IS_MACOSX) + include_directories( ${OPENCL_INCLUDE_DIRS} ) + if(OS_IS_MACOSX) + set(OPT_LIBRARIES ${OPT_LIBRARIES} "-framework OpenCL") + else(OS_IS_MACOSX) + set(OPT_LIBRARIES ${OPT_LIBRARIES} ${OPENCL_LIBRARIES}) + endif(OS_IS_MACOSX) endif(OPENCL_FOUND) add_definitions(-DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}") @@ -105,18 +105,18 @@ add_library(gnss_sp_libs ${GNSS_SPLIBS_SOURCES} ${GNSS_SPLIBS_HEADERS}) source_group(Headers FILES ${GNSS_SPLIBS_HEADERS}) target_link_libraries(gnss_sp_libs ${GNURADIO_RUNTIME_LIBRARIES} - ${VOLK_LIBRARIES} ${ORC_LIBRARIES} - ${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES} - ${GFlags_LIBS} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FFT_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - ${OPT_LIBRARIES} - gnss_rx + ${VOLK_LIBRARIES} ${ORC_LIBRARIES} + ${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES} + ${GFlags_LIBS} + ${GNURADIO_BLOCKS_LIBRARIES} + ${GNURADIO_FFT_LIBRARIES} + ${GNURADIO_FILTER_LIBRARIES} + ${OPT_LIBRARIES} + gnss_rx ) if(NOT VOLK_GNSSSDR_FOUND) - add_dependencies(gnss_sp_libs volk_gnsssdr_module) + add_dependencies(gnss_sp_libs volk_gnsssdr_module) endif(NOT VOLK_GNSSSDR_FOUND) if(${GFLAGS_GREATER_20}) @@ -125,4 +125,4 @@ endif(${GFLAGS_GREATER_20}) add_library(gnss_sdr_flags gnss_sdr_flags.cc gnss_sdr_flags.h) source_group(Headers FILES gnss_sdr_flags.h) -target_link_libraries(gnss_sdr_flags ${GFlags_LIBS}) \ No newline at end of file +target_link_libraries(gnss_sdr_flags ${GFlags_LIBS}) diff --git a/src/algorithms/signal_source/libs/CMakeLists.txt b/src/algorithms/signal_source/libs/CMakeLists.txt index 10fdd0d4c..c8f676b49 100644 --- a/src/algorithms/signal_source/libs/CMakeLists.txt +++ b/src/algorithms/signal_source/libs/CMakeLists.txt @@ -28,7 +28,7 @@ if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) endif(NOT IIO_FOUND) set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES}) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) - + endif(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) if(ENABLE_FMCOMMS2 OR ENABLE_AD9361) @@ -43,14 +43,14 @@ if(ENABLE_FMCOMMS2 OR ENABLE_AD9361) endif(NOT LIBIIO_FOUND) set(OPT_LIBRARIES ${OPT_LIBRARIES} ${LIBIIO_LIBRARIES}) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${LIBIIO_INCLUDE_DIRS}) - + ############################################### # FMCOMMS2 based SDR Hardware ############################################### if(IIO_FOUND) set(OPT_SIGNAL_SOURCE_LIB_SOURCES ad9361_manager.cc) endif(IIO_FOUND) - + endif(ENABLE_FMCOMMS2 OR ENABLE_AD9361) if(ENABLE_AD9361) @@ -78,4 +78,3 @@ add_library(signal_source_lib ${SIGNAL_SOURCE_LIB_SOURCES} ${SIGNAL_SOURCE_LIB_H source_group(Headers FILES ${SIGNAL_SOURCE_LIB_HEADERS}) target_link_libraries(signal_source_lib ${OPT_LIBRARIES}) - diff --git a/src/algorithms/signal_source/libs/fpga_switch.cc b/src/algorithms/signal_source/libs/fpga_switch.cc index e349a3c53..aae7da979 100644 --- a/src/algorithms/signal_source/libs/fpga_switch.cc +++ b/src/algorithms/signal_source/libs/fpga_switch.cc @@ -35,7 +35,6 @@ */ #include "fpga_switch.h" - #include // FPGA stuff @@ -76,9 +75,9 @@ fpga_switch::fpga_switch(std::string device_name) printf("switch memory successfully mapped\n"); } d_map_base = reinterpret_cast(mmap(NULL, PAGE_SIZE, - PROT_READ | PROT_WRITE, MAP_SHARED, d_device_descriptor, 0)); + PROT_READ | PROT_WRITE, MAP_SHARED, d_device_descriptor, 0)); - if (d_map_base == reinterpret_cast(-1)) + if (d_map_base == reinterpret_cast(-1)) { LOG(WARNING) << "Cannot map the FPGA switch module into tracking memory"; printf("could not map switch memory\n"); @@ -100,18 +99,21 @@ fpga_switch::fpga_switch(std::string device_name) DLOG(INFO) << "Switch FPGA class created"; } + fpga_switch::~fpga_switch() { close_device(); } + void fpga_switch::set_switch_position(int switch_position) { d_map_base[0] = switch_position; } + unsigned fpga_switch::fpga_switch_test_register( - unsigned writeval) + unsigned writeval) { unsigned readval; // write value to test register @@ -122,15 +124,14 @@ unsigned fpga_switch::fpga_switch_test_register( return readval; } + void fpga_switch::close_device() { - unsigned * aux = const_cast(d_map_base); - if (munmap(static_cast(aux), PAGE_SIZE) == -1) + unsigned *aux = const_cast(d_map_base); + if (munmap(static_cast(aux), PAGE_SIZE) == -1) { printf("Failed to unmap memory uio\n"); } close(d_device_descriptor); } - - diff --git a/src/algorithms/signal_source/libs/fpga_switch.h b/src/algorithms/signal_source/libs/fpga_switch.h index c3ce2fbba..395aff425 100644 --- a/src/algorithms/signal_source/libs/fpga_switch.h +++ b/src/algorithms/signal_source/libs/fpga_switch.h @@ -47,15 +47,14 @@ public: fpga_switch(std::string device_name); ~fpga_switch(); void set_switch_position(int switch_position); - + private: - int d_device_descriptor; // driver descriptor - volatile unsigned *d_map_base; // driver memory map + int d_device_descriptor; // driver descriptor + volatile unsigned *d_map_base; // driver memory map // private functions unsigned fpga_switch_test_register(unsigned writeval); - void close_device(void); - + void close_device(void); }; #endif /* GNSS_SDR_FPGA_SWITCH_H_ */ diff --git a/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.cc b/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.cc index 9c9e6af0b..737e414d9 100644 --- a/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.cc +++ b/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.cc @@ -35,9 +35,7 @@ */ #include "fpga_multicorrelator_8sc.h" - #include - // FPGA stuff #include @@ -65,7 +63,7 @@ #include // constants -#include "GPS_L1_CA.h" +#include "GPS_L1_CA.h" #include "gps_sdr_signal_processing.h" @@ -75,7 +73,7 @@ #define CODE_RESAMPLER_NUM_BITS_PRECISION 20 #define CODE_PHASE_STEP_CHIPS_NUM_NBITS CODE_RESAMPLER_NUM_BITS_PRECISION #define pwrtwo(x) (1 << (x)) -#define MAX_CODE_RESAMPLER_COUNTER pwrtwo(CODE_PHASE_STEP_CHIPS_NUM_NBITS) // 2^CODE_PHASE_STEP_CHIPS_NUM_NBITS +#define MAX_CODE_RESAMPLER_COUNTER pwrtwo(CODE_PHASE_STEP_CHIPS_NUM_NBITS) // 2^CODE_PHASE_STEP_CHIPS_NUM_NBITS #define PHASE_CARR_NBITS 32 #define PHASE_CARR_NBITS_INT 1 #define PHASE_CARR_NBITS_FRAC PHASE_CARR_NBITS - PHASE_CARR_NBITS_INT @@ -86,7 +84,7 @@ int fpga_multicorrelator_8sc::read_sample_counter() { - return d_map_base[7]; + return d_map_base[7]; } void fpga_multicorrelator_8sc::set_initial_sample(int samples_offset) @@ -94,17 +92,16 @@ void fpga_multicorrelator_8sc::set_initial_sample(int samples_offset) d_initial_sample_counter = samples_offset; d_map_base[13] = d_initial_sample_counter; } - -void fpga_multicorrelator_8sc::set_local_code_and_taps(int code_length_chips, - float *shifts_chips, int PRN) -{ +void fpga_multicorrelator_8sc::set_local_code_and_taps(int code_length_chips, + float *shifts_chips, int PRN) +{ d_shifts_chips = shifts_chips; d_code_length_chips = code_length_chips; fpga_multicorrelator_8sc::fpga_configure_tracking_gps_local_code(PRN); } -void fpga_multicorrelator_8sc::set_output_vectors(gr_complex* corr_out) +void fpga_multicorrelator_8sc::set_output_vectors(gr_complex *corr_out) { d_corr_out = corr_out; } @@ -116,21 +113,18 @@ void fpga_multicorrelator_8sc::update_local_code(float rem_code_phase_chips) fpga_multicorrelator_8sc::fpga_configure_code_parameters_in_fpga(); } - void fpga_multicorrelator_8sc::Carrier_wipeoff_multicorrelator_resampler( - float rem_carrier_phase_in_rad, float phase_step_rad, - float rem_code_phase_chips, float code_phase_step_chips, - int signal_length_samples) + float rem_carrier_phase_in_rad, float phase_step_rad, + float rem_code_phase_chips, float code_phase_step_chips, + int signal_length_samples) { - - update_local_code(rem_code_phase_chips); d_rem_carrier_phase_in_rad = rem_carrier_phase_in_rad; d_code_phase_step_chips = code_phase_step_chips; d_phase_step_rad = phase_step_rad; d_correlator_length_samples = signal_length_samples; - fpga_multicorrelator_8sc::fpga_compute_signal_parameters_in_fpga(); - fpga_multicorrelator_8sc::fpga_configure_signal_parameters_in_fpga(); + fpga_multicorrelator_8sc::fpga_compute_signal_parameters_in_fpga(); + fpga_multicorrelator_8sc::fpga_configure_signal_parameters_in_fpga(); fpga_multicorrelator_8sc::fpga_launch_multicorrelator_fpga(); int irq_count; ssize_t nb; @@ -143,8 +137,9 @@ void fpga_multicorrelator_8sc::Carrier_wipeoff_multicorrelator_resampler( fpga_multicorrelator_8sc::read_tracking_gps_results(); } + fpga_multicorrelator_8sc::fpga_multicorrelator_8sc(int n_correlators, - std::string device_name, unsigned int device_base) + std::string device_name, unsigned int device_base) { d_n_correlators = n_correlators; d_device_name = device_name; @@ -153,10 +148,10 @@ fpga_multicorrelator_8sc::fpga_multicorrelator_8sc(int n_correlators, d_map_base = nullptr; // instantiate variable length vectors - d_initial_index = static_cast(volk_gnsssdr_malloc( - n_correlators * sizeof(unsigned), volk_gnsssdr_get_alignment())); - d_initial_interp_counter = static_cast(volk_gnsssdr_malloc( - n_correlators * sizeof(unsigned), volk_gnsssdr_get_alignment())); + d_initial_index = static_cast(volk_gnsssdr_malloc( + n_correlators * sizeof(unsigned), volk_gnsssdr_get_alignment())); + d_initial_interp_counter = static_cast(volk_gnsssdr_malloc( + n_correlators * sizeof(unsigned), volk_gnsssdr_get_alignment())); //d_local_code_in = nullptr; d_shifts_chips = nullptr; @@ -171,21 +166,20 @@ fpga_multicorrelator_8sc::fpga_multicorrelator_8sc(int n_correlators, d_initial_sample_counter = 0; d_channel = 0; d_correlator_length_samples = 0; - + // pre-compute all the codes - d_ca_codes = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS*NUM_PRNs) * sizeof(int), volk_gnsssdr_get_alignment())); + d_ca_codes = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS * NUM_PRNs) * sizeof(int), volk_gnsssdr_get_alignment())); for (unsigned int PRN = 1; PRN <= NUM_PRNs; PRN++) - { - gps_l1_ca_code_gen_int(&d_ca_codes[(int(GPS_L1_CA_CODE_LENGTH_CHIPS)) * (PRN - 1)], PRN, 0); - } + { + gps_l1_ca_code_gen_int(&d_ca_codes[(int(GPS_L1_CA_CODE_LENGTH_CHIPS)) * (PRN - 1)], PRN, 0); + } DLOG(INFO) << "TRACKING FPGA CLASS CREATED"; - } fpga_multicorrelator_8sc::~fpga_multicorrelator_8sc() { - delete[] d_ca_codes; + delete[] d_ca_codes; close_device(); } @@ -193,7 +187,7 @@ fpga_multicorrelator_8sc::~fpga_multicorrelator_8sc() bool fpga_multicorrelator_8sc::free() { // unlock the channel - fpga_multicorrelator_8sc::unlock_channel(); + fpga_multicorrelator_8sc::unlock_channel(); // free the FPGA dynamically created variables if (d_initial_index != nullptr) @@ -214,7 +208,7 @@ bool fpga_multicorrelator_8sc::free() void fpga_multicorrelator_8sc::set_channel(unsigned int channel) { - char device_io_name[MAX_LENGTH_DEVICEIO_NAME]; // driver io name + char device_io_name[MAX_LENGTH_DEVICEIO_NAME]; // driver io name d_channel = channel; // open the device corresponding to the assigned channel @@ -229,12 +223,12 @@ void fpga_multicorrelator_8sc::set_channel(unsigned int channel) LOG(WARNING) << "Cannot open deviceio" << device_io_name; } d_map_base = reinterpret_cast(mmap(NULL, PAGE_SIZE, - PROT_READ | PROT_WRITE, MAP_SHARED, d_device_descriptor, 0)); + PROT_READ | PROT_WRITE, MAP_SHARED, d_device_descriptor, 0)); - if (d_map_base == reinterpret_cast(-1)) + if (d_map_base == reinterpret_cast(-1)) { LOG(WARNING) << "Cannot map the FPGA tracking module " - << d_channel << "into user memory"; + << d_channel << "into user memory"; } // sanity check : check test register @@ -253,7 +247,7 @@ void fpga_multicorrelator_8sc::set_channel(unsigned int channel) unsigned fpga_multicorrelator_8sc::fpga_acquisition_test_register( - unsigned writeval) + unsigned writeval) { unsigned readval; // write value to test register @@ -287,11 +281,9 @@ void fpga_multicorrelator_8sc::fpga_configure_tracking_gps_local_code(int PRN) code_chip = 0; } // copy the local code to the FPGA memory one by one - d_map_base[11] = LOCAL_CODE_FPGA_ENABLE_WRITE_MEMORY - | code_chip | select_fpga_correlator; + d_map_base[11] = LOCAL_CODE_FPGA_ENABLE_WRITE_MEMORY | code_chip | select_fpga_correlator; } - select_fpga_correlator = select_fpga_correlator - + LOCAL_CODE_FPGA_CORRELATOR_SELECT_COUNT; + select_fpga_correlator = select_fpga_correlator + LOCAL_CODE_FPGA_CORRELATOR_SELECT_COUNT; } } @@ -304,20 +296,20 @@ void fpga_multicorrelator_8sc::fpga_compute_code_shift_parameters(void) for (i = 0; i < d_n_correlators; i++) { temp_calculation = floor( - d_shifts_chips[i] - d_rem_code_phase_chips); - + d_shifts_chips[i] - d_rem_code_phase_chips); + if (temp_calculation < 0) { - temp_calculation = temp_calculation + d_code_length_chips; // % operator does not work as in Matlab with negative numbers + temp_calculation = temp_calculation + d_code_length_chips; // % operator does not work as in Matlab with negative numbers } - d_initial_index[i] = static_cast( (static_cast(temp_calculation)) % d_code_length_chips); + d_initial_index[i] = static_cast((static_cast(temp_calculation)) % d_code_length_chips); temp_calculation = fmod(d_shifts_chips[i] - d_rem_code_phase_chips, - 1.0); + 1.0); if (temp_calculation < 0) { - temp_calculation = temp_calculation + 1.0; // fmod operator does not work as in Matlab with negative numbers + temp_calculation = temp_calculation + 1.0; // fmod operator does not work as in Matlab with negative numbers } - d_initial_interp_counter[i] = static_cast( floor( MAX_CODE_RESAMPLER_COUNTER * temp_calculation)); + d_initial_interp_counter[i] = static_cast(floor(MAX_CODE_RESAMPLER_COUNTER * temp_calculation)); } } @@ -330,7 +322,7 @@ void fpga_multicorrelator_8sc::fpga_configure_code_parameters_in_fpga(void) d_map_base[1 + i] = d_initial_index[i]; d_map_base[1 + d_n_correlators + i] = d_initial_interp_counter[i]; } - d_map_base[8] = d_code_length_chips - 1; // number of samples - 1 + d_map_base[8] = d_code_length_chips - 1; // number of samples - 1 } @@ -338,30 +330,27 @@ void fpga_multicorrelator_8sc::fpga_compute_signal_parameters_in_fpga(void) { float d_rem_carrier_phase_in_rad_temp; - d_code_phase_step_chips_num = static_cast( roundf(MAX_CODE_RESAMPLER_COUNTER * d_code_phase_step_chips)); + d_code_phase_step_chips_num = static_cast(roundf(MAX_CODE_RESAMPLER_COUNTER * d_code_phase_step_chips)); if (d_rem_carrier_phase_in_rad > M_PI) { - d_rem_carrier_phase_in_rad_temp = -2 * M_PI - + d_rem_carrier_phase_in_rad; + d_rem_carrier_phase_in_rad_temp = -2 * M_PI + d_rem_carrier_phase_in_rad; } else if (d_rem_carrier_phase_in_rad < -M_PI) { - d_rem_carrier_phase_in_rad_temp = 2 * M_PI - + d_rem_carrier_phase_in_rad; + d_rem_carrier_phase_in_rad_temp = 2 * M_PI + d_rem_carrier_phase_in_rad; } else { d_rem_carrier_phase_in_rad_temp = d_rem_carrier_phase_in_rad; } - d_rem_carr_phase_rad_int = static_cast( roundf( - (fabs(d_rem_carrier_phase_in_rad_temp) / M_PI) - * pow(2, PHASE_CARR_NBITS_FRAC))); + d_rem_carr_phase_rad_int = static_cast(roundf( + (fabs(d_rem_carrier_phase_in_rad_temp) / M_PI) * pow(2, PHASE_CARR_NBITS_FRAC))); if (d_rem_carrier_phase_in_rad_temp < 0) { d_rem_carr_phase_rad_int = -d_rem_carr_phase_rad_int; } - d_phase_step_rad_int = static_cast( roundf( - (fabs(d_phase_step_rad) / M_PI) * pow(2, PHASE_CARR_NBITS_FRAC))); // the FPGA accepts a range for the phase step between -pi and +pi + d_phase_step_rad_int = static_cast(roundf( + (fabs(d_phase_step_rad) / M_PI) * pow(2, PHASE_CARR_NBITS_FRAC))); // the FPGA accepts a range for the phase step between -pi and +pi if (d_phase_step_rad < 0) { @@ -383,10 +372,10 @@ void fpga_multicorrelator_8sc::fpga_launch_multicorrelator_fpga(void) { // enable interrupts int reenable = 1; - write(d_device_descriptor, reinterpret_cast(&reenable), sizeof(int)); + write(d_device_descriptor, reinterpret_cast(&reenable), sizeof(int)); - // writing 1 to reg 14 launches the tracking - d_map_base[14] = 1; + // writing 1 to reg 14 launches the tracking + d_map_base[14] = 1; } @@ -399,17 +388,17 @@ void fpga_multicorrelator_8sc::read_tracking_gps_results(void) for (k = 0; k < d_n_correlators; k++) { readval_real = d_map_base[1 + k]; - if (readval_real >= 1048576) // 0x100000 (21 bits two's complement) + if (readval_real >= 1048576) // 0x100000 (21 bits two's complement) { readval_real = -2097152 + readval_real; } readval_imag = d_map_base[1 + d_n_correlators + k]; - if (readval_imag >= 1048576) // 0x100000 (21 bits two's complement) + if (readval_imag >= 1048576) // 0x100000 (21 bits two's complement) { readval_imag = -2097152 + readval_imag; } - d_corr_out[k] = gr_complex(readval_real,readval_imag); + d_corr_out[k] = gr_complex(readval_real, readval_imag); } } @@ -417,40 +406,42 @@ void fpga_multicorrelator_8sc::read_tracking_gps_results(void) void fpga_multicorrelator_8sc::unlock_channel(void) { // unlock the channel to let the next samples go through - d_map_base[12] = 1; // unlock the channel + d_map_base[12] = 1; // unlock the channel } + void fpga_multicorrelator_8sc::close_device() { - unsigned * aux = const_cast(d_map_base); - if (munmap(static_cast(aux), PAGE_SIZE) == -1) + unsigned *aux = const_cast(d_map_base); + if (munmap(static_cast(aux), PAGE_SIZE) == -1) { printf("Failed to unmap memory uio\n"); } -/* else + /* else { printf("memory uio unmapped\n"); } */ close(d_device_descriptor); } - + void fpga_multicorrelator_8sc::lock_channel(void) { // lock the channel for processing - d_map_base[12] = 0; // lock the channel + d_map_base[12] = 0; // lock the channel } + void fpga_multicorrelator_8sc::read_sample_counters(int *sample_counter, int *secondary_sample_counter, int *counter_corr_0_in, int *counter_corr_0_out) { - *sample_counter = d_map_base[11]; - *secondary_sample_counter = d_map_base[8]; - *counter_corr_0_in = d_map_base[10]; - *counter_corr_0_out = d_map_base[9]; - + *sample_counter = d_map_base[11]; + *secondary_sample_counter = d_map_base[8]; + *counter_corr_0_in = d_map_base[10]; + *counter_corr_0_out = d_map_base[9]; } + void fpga_multicorrelator_8sc::reset_multicorrelator(void) { - d_map_base[14] = 2; // writing a 2 to d_map_base[14] resets the multicorrelator + d_map_base[14] = 2; // writing a 2 to d_map_base[14] resets the multicorrelator } diff --git a/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.h b/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.h index 9bf44536e..1eceb1936 100644 --- a/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.h +++ b/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.h @@ -49,46 +49,46 @@ class fpga_multicorrelator_8sc { public: fpga_multicorrelator_8sc(int n_correlators, std::string device_name, - unsigned int device_base); + unsigned int device_base); ~fpga_multicorrelator_8sc(); - //bool set_output_vectors(gr_complex* corr_out); - void set_output_vectors(gr_complex* corr_out); -// bool set_local_code_and_taps( -// int code_length_chips, const int* local_code_in, -// float *shifts_chips, int PRN); + //bool set_output_vectors(gr_complex* corr_out); + void set_output_vectors(gr_complex *corr_out); + // bool set_local_code_and_taps( + // int code_length_chips, const int* local_code_in, + // float *shifts_chips, int PRN); //bool set_local_code_and_taps( void set_local_code_and_taps( - int code_length_chips, - float *shifts_chips, int PRN); + int code_length_chips, + float *shifts_chips, int PRN); //bool set_output_vectors(lv_16sc_t* corr_out); void update_local_code(float rem_code_phase_chips); //bool Carrier_wipeoff_multicorrelator_resampler( void Carrier_wipeoff_multicorrelator_resampler( - float rem_carrier_phase_in_rad, float phase_step_rad, - float rem_code_phase_chips, float code_phase_step_chips, - int signal_length_samples);bool free(); + float rem_carrier_phase_in_rad, float phase_step_rad, + float rem_code_phase_chips, float code_phase_step_chips, + int signal_length_samples); + bool free(); void set_channel(unsigned int channel); void set_initial_sample(int samples_offset); int read_sample_counter(); void lock_channel(void); void unlock_channel(void); - void read_sample_counters(int *sample_counter, int *secondary_sample_counter, int *counter_corr_0_in, int *counter_corr_0_out); // debug - - + void read_sample_counters(int *sample_counter, int *secondary_sample_counter, int *counter_corr_0_in, int *counter_corr_0_out); // debug + private: //const int *d_local_code_in; - gr_complex * d_corr_out; + gr_complex *d_corr_out; float *d_shifts_chips; int d_code_length_chips; int d_n_correlators; // data related to the hardware module and the driver - int d_device_descriptor; // driver descriptor - volatile unsigned *d_map_base; // driver memory map + int d_device_descriptor; // driver descriptor + volatile unsigned *d_map_base; // driver memory map // configuration data received from the interface - unsigned int d_channel; // channel number - unsigned d_ncorrelators; // number of correlators + unsigned int d_channel; // channel number + unsigned d_ncorrelators; // number of correlators unsigned d_correlator_length_samples; float d_rem_code_phase_chips; float d_code_phase_step_chips; @@ -107,8 +107,7 @@ private: std::string d_device_name; unsigned int d_device_base; - - int* d_ca_codes; + int *d_ca_codes; // private functions unsigned fpga_acquisition_test_register(unsigned writeval); @@ -119,11 +118,8 @@ private: void fpga_configure_signal_parameters_in_fpga(void); void fpga_launch_multicorrelator_fpga(void); void read_tracking_gps_results(void); - void reset_multicorrelator(void); - void close_device(void); - - // debug - //unsigned int first_time = 1; + void reset_multicorrelator(void); + void close_device(void); }; #endif /* GNSS_SDR_FPGA_MULTICORRELATOR_H_ */ diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc index 91c611d2d..797f2c3d9 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc @@ -36,8 +36,8 @@ #include #include #include -#include // to test the FPGA we have to create a simultaneous task to send the samples using the DMA and stop the test -#include // FPGA read input file +#include // to test the FPGA we have to create a simultaneous task to send the samples using the DMA and stop the test +#include // FPGA read input file #include #include #include @@ -61,17 +61,17 @@ #include "signal_generator_flags.h" #include "interleaved_byte_to_complex_short.h" -#define DMA_TRACK_TRANSFER_SIZE 2046 // DMA transfer size for tracking -#define MIN_SAMPLES_REMAINING 20000 // number of remaining samples in the DMA that causes the CPU to stop the flowgraph (it has to be a bit alrger than 2x max packet size) -#define FIVE_SECONDS 5000000 // five seconds in microseconds +#define DMA_TRACK_TRANSFER_SIZE 2046 // DMA transfer size for tracking +#define MIN_SAMPLES_REMAINING 20000 // number of remaining samples in the DMA that causes the CPU to stop the flowgraph (it has to be a bit alrger than 2x max packet size) +#define FIVE_SECONDS 5000000 // five seconds in microseconds void send_tracking_gps_input_samples(FILE *rx_signal_file, - int num_remaining_samples, gr::top_block_sptr top_block) + int num_remaining_samples, gr::top_block_sptr top_block) { - int num_samples_transferred = 0; // number of samples that have been transferred to the DMA so far - static int flowgraph_stopped = 0; // flag to indicate if the flowgraph is stopped already - char *buffer_DMA; // temporary buffer to store the samples to be sent to the DMA - int dma_descr; // DMA descriptor + int num_samples_transferred = 0; // number of samples that have been transferred to the DMA so far + static int flowgraph_stopped = 0; // flag to indicate if the flowgraph is stopped already + char *buffer_DMA; // temporary buffer to store the samples to be sent to the DMA + int dma_descr; // DMA descriptor dma_descr = open("/dev/loop_tx", O_WRONLY); if (dma_descr < 0) { @@ -79,7 +79,7 @@ void send_tracking_gps_input_samples(FILE *rx_signal_file, exit(1); } - buffer_DMA = (char *) malloc(DMA_TRACK_TRANSFER_SIZE); + buffer_DMA = (char *)malloc(DMA_TRACK_TRANSFER_SIZE); if (!buffer_DMA) { fprintf(stderr, "Memory error!"); @@ -98,8 +98,7 @@ void send_tracking_gps_input_samples(FILE *rx_signal_file, } if (num_remaining_samples > DMA_TRACK_TRANSFER_SIZE) { - - fread(buffer_DMA, DMA_TRACK_TRANSFER_SIZE, 1,rx_signal_file); + fread(buffer_DMA, DMA_TRACK_TRANSFER_SIZE, 1, rx_signal_file); assert(DMA_TRACK_TRANSFER_SIZE == write(dma_descr, &buffer_DMA[0], DMA_TRACK_TRANSFER_SIZE)); num_remaining_samples = num_remaining_samples - DMA_TRACK_TRANSFER_SIZE; @@ -121,11 +120,11 @@ void send_tracking_gps_input_samples(FILE *rx_signal_file, // thread that sends the samples to the FPGA -void thread(gr::top_block_sptr top_block, const char * file_name) +void thread(gr::top_block_sptr top_block, const char *file_name) { // file descriptor - FILE *rx_signal_file; // file descriptor - int file_length; // length of the file containing the received samples + FILE *rx_signal_file; // file descriptor + int file_length; // length of the file containing the received samples rx_signal_file = fopen(file_name, "rb"); if (!rx_signal_file) @@ -137,7 +136,7 @@ void thread(gr::top_block_sptr top_block, const char * file_name) file_length = ftell(rx_signal_file); fseek(rx_signal_file, 0, SEEK_SET); - usleep(FIVE_SECONDS); // wait for some time to give time to the other thread to program the device + usleep(FIVE_SECONDS); // wait for some time to give time to the other thread to program the device //send_tracking_gps_input_samples(dma_descr, rx_signal_file, file_length); send_tracking_gps_input_samples(rx_signal_file, file_length, top_block); @@ -163,14 +162,14 @@ private: public: int rx_message; - ~GpsL1CADllPllTrackingTestFpga_msg_rx(); //!< Default destructor + ~GpsL1CADllPllTrackingTestFpga_msg_rx(); //!< Default destructor }; GpsL1CADllPllTrackingTestFpga_msg_rx_sptr GpsL1CADllPllTrackingTestFpga_msg_rx_make() { return GpsL1CADllPllTrackingTestFpga_msg_rx_sptr( - new GpsL1CADllPllTrackingTestFpga_msg_rx()); + new GpsL1CADllPllTrackingTestFpga_msg_rx()); } @@ -181,7 +180,7 @@ void GpsL1CADllPllTrackingTestFpga_msg_rx::msg_handler_events(pmt::pmt_t msg) long int message = pmt::to_long(msg); rx_message = message; } - catch (boost::bad_any_cast& e) + catch (boost::bad_any_cast &e) { LOG(WARNING) << "msg_handler_telemetry Bad any cast!"; rx_message = 0; @@ -189,22 +188,22 @@ void GpsL1CADllPllTrackingTestFpga_msg_rx::msg_handler_events(pmt::pmt_t msg) } -GpsL1CADllPllTrackingTestFpga_msg_rx::GpsL1CADllPllTrackingTestFpga_msg_rx() : - gr::block("GpsL1CADllPllTrackingTestFpga_msg_rx", - gr::io_signature::make(0, 0, 0), - gr::io_signature::make(0, 0, 0)) +GpsL1CADllPllTrackingTestFpga_msg_rx::GpsL1CADllPllTrackingTestFpga_msg_rx() : gr::block("GpsL1CADllPllTrackingTestFpga_msg_rx", + gr::io_signature::make(0, 0, 0), + gr::io_signature::make(0, 0, 0)) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), - boost::bind( - &GpsL1CADllPllTrackingTestFpga_msg_rx::msg_handler_events, - this, _1)); + boost::bind( + &GpsL1CADllPllTrackingTestFpga_msg_rx::msg_handler_events, + this, _1)); rx_message = 0; } GpsL1CADllPllTrackingTestFpga_msg_rx::~GpsL1CADllPllTrackingTestFpga_msg_rx() -{} +{ +} // ########################################################### @@ -226,12 +225,12 @@ public: int configure_generator(); int generate_signal(); - void check_results_doppler(arma::vec & true_time_s, arma::vec & true_value, - arma::vec & meas_time_s, arma::vec & meas_value); - void check_results_acc_carrier_phase(arma::vec & true_time_s, - arma::vec & true_value, arma::vec & meas_time_s, arma::vec & meas_value); - void check_results_codephase(arma::vec & true_time_s, arma::vec & true_value, - arma::vec & meas_time_s, arma::vec & meas_value); + void check_results_doppler(arma::vec &true_time_s, arma::vec &true_value, + arma::vec &meas_time_s, arma::vec &meas_value); + void check_results_acc_carrier_phase(arma::vec &true_time_s, + arma::vec &true_value, arma::vec &meas_time_s, arma::vec &meas_value); + void check_results_codephase(arma::vec &true_time_s, arma::vec &true_value, + arma::vec &meas_time_s, arma::vec &meas_value); GpsL1CADllPllTrackingTestFpga() { @@ -263,16 +262,15 @@ int GpsL1CADllPllTrackingTestFpga::configure_generator() p1 = std::string("-rinex_nav_file=") + FLAGS_rinex_nav_file; if (FLAGS_dynamic_position.empty()) { - p2 = std::string("-static_position=") + FLAGS_static_position - + std::string(",") + std::to_string(FLAGS_duration * 10); + p2 = std::string("-static_position=") + FLAGS_static_position + std::string(",") + std::to_string(FLAGS_duration * 10); } else { p2 = std::string("-obs_pos_file=") + std::string(FLAGS_dynamic_position); } - p3 = std::string("-rinex_obs_file=") + FLAGS_filename_rinex_obs; // RINEX 2.10 observation file output - p4 = std::string("-sig_out_file=") + FLAGS_filename_raw_data; // Baseband signal output file. Will be stored in int8_t IQ multiplexed samples - p5 = std::string("-sampling_freq=") + std::to_string(baseband_sampling_freq); //Baseband sampling frequency [MSps] + p3 = std::string("-rinex_obs_file=") + FLAGS_filename_rinex_obs; // RINEX 2.10 observation file output + p4 = std::string("-sig_out_file=") + FLAGS_filename_raw_data; // Baseband signal output file. Will be stored in int8_t IQ multiplexed samples + p5 = std::string("-sampling_freq=") + std::to_string(baseband_sampling_freq); //Baseband sampling frequency [MSps] return 0; } @@ -281,8 +279,8 @@ int GpsL1CADllPllTrackingTestFpga::generate_signal() { int child_status; - char * const parmList[] = { &generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], - &p4[0], &p5[0], NULL }; + char *const parmList[] = {&generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], + &p4[0], &p5[0], NULL}; int pid; if ((pid = fork()) == -1) @@ -310,12 +308,12 @@ void GpsL1CADllPllTrackingTestFpga::configure_receiver() gnss_synchro.PRN = FLAGS_test_satellite_PRN; config->set_property("GNSS-SDR.internal_fs_sps", - std::to_string(baseband_sampling_freq)); + std::to_string(baseband_sampling_freq)); // Set Tracking //config->set_property("Tracking_1C.implementation", // "GPS_L1_CA_DLL_PLL_C_Aid_Tracking_Fpga"); config->set_property("Tracking_1C.implementation", - "GPS_L1_CA_DLL_PLL_Tracking_Fpga"); + "GPS_L1_CA_DLL_PLL_Tracking_Fpga"); config->set_property("Tracking_1C.item_type", "cshort"); config->set_property("Tracking_1C.if", "0"); config->set_property("Tracking_1C.dump", "true"); @@ -328,8 +326,8 @@ void GpsL1CADllPllTrackingTestFpga::configure_receiver() } -void GpsL1CADllPllTrackingTestFpga::check_results_doppler(arma::vec & true_time_s, - arma::vec & true_value, arma::vec & meas_time_s, arma::vec & meas_value) +void GpsL1CADllPllTrackingTestFpga::check_results_doppler(arma::vec &true_time_s, + arma::vec &true_value, arma::vec &meas_time_s, arma::vec &meas_value) { //1. True value interpolation to match the measurement times arma::vec true_value_interp; @@ -362,13 +360,13 @@ void GpsL1CADllPllTrackingTestFpga::check_results_doppler(arma::vec & true_time_ << ", mean=" << error_mean << ", stdev=" << sqrt(error_var) << " (max,min)=" << max_error << "," << min_error << " [Hz]" << std::endl; - std::cout.precision (ss); + std::cout.precision(ss); } void GpsL1CADllPllTrackingTestFpga::check_results_acc_carrier_phase( - arma::vec & true_time_s, arma::vec & true_value, arma::vec & meas_time_s, - arma::vec & meas_value) + arma::vec &true_time_s, arma::vec &true_value, arma::vec &meas_time_s, + arma::vec &meas_value) { //1. True value interpolation to match the measurement times arma::vec true_value_interp; @@ -401,13 +399,13 @@ void GpsL1CADllPllTrackingTestFpga::check_results_acc_carrier_phase( << ", mean=" << error_mean << ", stdev=" << sqrt(error_var) << " (max,min)=" << max_error << "," << min_error << " [Hz]" << std::endl; - std::cout.precision (ss); + std::cout.precision(ss); } void GpsL1CADllPllTrackingTestFpga::check_results_codephase( - arma::vec & true_time_s, arma::vec & true_value, arma::vec & meas_time_s, - arma::vec & meas_value) + arma::vec &true_time_s, arma::vec &true_value, arma::vec &meas_time_s, + arma::vec &meas_value) { //1. True value interpolation to match the measurement times arma::vec true_value_interp; @@ -439,7 +437,7 @@ void GpsL1CADllPllTrackingTestFpga::check_results_codephase( << ", mean=" << error_mean << ", stdev=" << sqrt(error_var) << " (max,min)=" << max_error << "," << min_error << " [Chips]" << std::endl; - std::cout.precision (ss); + std::cout.precision(ss); } @@ -463,27 +461,29 @@ TEST_F(GpsL1CADllPllTrackingTestFpga, ValidationOfResultsFpga) true_obs_file.append(std::to_string(test_satellite_PRN)); true_obs_file.append(".dat"); ASSERT_NO_THROW( + { + if (true_obs_data.open_obs_file(true_obs_file) == false) { - if (true_obs_data.open_obs_file(true_obs_file) == false) - { - throw std::exception(); - }; - }) << "Failure opening true observables file"; + throw std::exception(); + }; + }) + << "Failure opening true observables file"; top_block = gr::make_top_block("Tracking test"); //std::shared_ptr tracking = std::make_shared (config.get(), "Tracking_1C", 1, 1); - std::shared_ptr tracking = std::make_shared (config.get(), "Tracking_1C", 1, 1); + std::shared_ptr tracking = std::make_shared(config.get(), "Tracking_1C", 1, 1); boost::shared_ptr msg_rx = GpsL1CADllPllTrackingTestFpga_msg_rx_make(); // load acquisition data based on the first epoch of the true observations ASSERT_NO_THROW( + { + if (true_obs_data.read_binary_obs() == false) { - if (true_obs_data.read_binary_obs() == false) - { - throw std::exception(); - }; - }) << "Failure reading true observables file"; + throw std::exception(); + }; + }) + << "Failure reading true observables file"; //restart the epoch counter true_obs_data.restart(); @@ -492,52 +492,54 @@ TEST_F(GpsL1CADllPllTrackingTestFpga, ValidationOfResultsFpga) << " Initial code delay [Chips]=" << true_obs_data.prn_delay_chips << std::endl; - gnss_synchro.Acq_delay_samples = (GPS_L1_CA_CODE_LENGTH_CHIPS - - true_obs_data.prn_delay_chips / GPS_L1_CA_CODE_LENGTH_CHIPS) - * baseband_sampling_freq * GPS_L1_CA_CODE_PERIOD; + gnss_synchro.Acq_delay_samples = (GPS_L1_CA_CODE_LENGTH_CHIPS - true_obs_data.prn_delay_chips / GPS_L1_CA_CODE_LENGTH_CHIPS) * baseband_sampling_freq * GPS_L1_CA_CODE_PERIOD; gnss_synchro.Acq_doppler_hz = true_obs_data.doppler_l1_hz; gnss_synchro.Acq_samplestamp_samples = 0; ASSERT_NO_THROW( - { - tracking->set_channel(gnss_synchro.Channel_ID); - }) << "Failure setting channel."; + { + tracking->set_channel(gnss_synchro.Channel_ID); + }) + << "Failure setting channel."; ASSERT_NO_THROW( - { - tracking->set_gnss_synchro(&gnss_synchro); - }) << "Failure setting gnss_synchro."; + { + tracking->set_gnss_synchro(&gnss_synchro); + }) + << "Failure setting gnss_synchro."; ASSERT_NO_THROW( - { - tracking->connect(top_block); - }) << "Failure connecting tracking to the top_block."; + { + tracking->connect(top_block); + }) + << "Failure connecting tracking to the top_block."; ASSERT_NO_THROW( - { - gr::blocks::null_sink::sptr sink = gr::blocks::null_sink::make(sizeof(Gnss_Synchro)); - top_block->connect(tracking->get_right_block(), 0, sink, 0); - top_block->msg_connect(tracking->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); - }) << "Failure connecting the blocks of tracking test."; + { + gr::blocks::null_sink::sptr sink = gr::blocks::null_sink::make(sizeof(Gnss_Synchro)); + top_block->connect(tracking->get_right_block(), 0, sink, 0); + top_block->msg_connect(tracking->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); + }) + << "Failure connecting the blocks of tracking test."; tracking->start_tracking(); // assemble again the file name in a null terminated string (not available by default in the main program flow) std::string file = "./" + filename_raw_data; - const char * file_name = file.c_str(); + const char *file_name = file.c_str(); // start thread that sends the DMA samples to the FPGA - boost::thread t - { thread, top_block, file_name }; + boost::thread t{thread, top_block, file_name}; EXPECT_NO_THROW( - { - start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait - tracking->reset();// unlock the channel - end = std::chrono::system_clock::now(); - elapsed_seconds = end - start; - }) << "Failure running the top_block."; + { + start = std::chrono::system_clock::now(); + top_block->run(); // Start threads and wait + tracking->reset(); // unlock the channel + end = std::chrono::system_clock::now(); + elapsed_seconds = end - start; + }) + << "Failure running the top_block."; // wait until child thread terminates t.join(); @@ -567,12 +569,13 @@ TEST_F(GpsL1CADllPllTrackingTestFpga, ValidationOfResultsFpga) //load the measured values tracking_dump_reader trk_dump; ASSERT_NO_THROW( + { + if (trk_dump.open_obs_file(std::string("./tracking_ch_0.dat")) == false) { - if (trk_dump.open_obs_file(std::string("./tracking_ch_0.dat")) == false) - { - throw std::exception(); - }; - }) << "Failure opening tracking dump file"; + throw std::exception(); + }; + }) + << "Failure opening tracking dump file"; nepoch = trk_dump.num_epochs(); std::cout << "Measured observation epochs=" << nepoch << std::endl; @@ -585,14 +588,11 @@ TEST_F(GpsL1CADllPllTrackingTestFpga, ValidationOfResultsFpga) epoch_counter = 0; while (trk_dump.read_binary_obs()) { - trk_timestamp_s(epoch_counter) = static_cast(trk_dump.PRN_start_sample_count) - / static_cast(baseband_sampling_freq); + trk_timestamp_s(epoch_counter) = static_cast(trk_dump.PRN_start_sample_count) / static_cast(baseband_sampling_freq); trk_acc_carrier_phase_cycles(epoch_counter) = trk_dump.acc_carrier_phase_rad / GPS_TWO_PI; trk_Doppler_Hz(epoch_counter) = trk_dump.carrier_doppler_hz; - double delay_chips = GPS_L1_CA_CODE_LENGTH_CHIPS - GPS_L1_CA_CODE_LENGTH_CHIPS - * (fmod( (static_cast(trk_dump.PRN_start_sample_count) + trk_dump.aux1) - / static_cast(baseband_sampling_freq), 1.0e-3) / 1.0e-3); + double delay_chips = GPS_L1_CA_CODE_LENGTH_CHIPS - GPS_L1_CA_CODE_LENGTH_CHIPS * (fmod((static_cast(trk_dump.PRN_start_sample_count) + trk_dump.aux1) / static_cast(baseband_sampling_freq), 1.0e-3) / 1.0e-3); trk_prn_delay_chips(epoch_counter) = delay_chips; epoch_counter++; @@ -600,7 +600,7 @@ TEST_F(GpsL1CADllPllTrackingTestFpga, ValidationOfResultsFpga) //Align initial measurements and cut the tracking pull-in transitory double pull_in_offset_s = 1.0; - arma::uvec initial_meas_point = arma::find( trk_timestamp_s >= (true_timestamp_s(0) + pull_in_offset_s), 1, "first"); + arma::uvec initial_meas_point = arma::find(trk_timestamp_s >= (true_timestamp_s(0) + pull_in_offset_s), 1, "first"); trk_timestamp_s = trk_timestamp_s.subvec(initial_meas_point(0), trk_timestamp_s.size() - 1); trk_acc_carrier_phase_cycles = trk_acc_carrier_phase_cycles.subvec(initial_meas_point(0), trk_acc_carrier_phase_cycles.size() - 1); @@ -610,8 +610,8 @@ TEST_F(GpsL1CADllPllTrackingTestFpga, ValidationOfResultsFpga) check_results_doppler(true_timestamp_s, true_Doppler_Hz, trk_timestamp_s, trk_Doppler_Hz); check_results_codephase(true_timestamp_s, true_prn_delay_chips, trk_timestamp_s, trk_prn_delay_chips); check_results_acc_carrier_phase(true_timestamp_s, - true_acc_carrier_phase_cycles, trk_timestamp_s, - trk_acc_carrier_phase_cycles); + true_acc_carrier_phase_cycles, trk_timestamp_s, + trk_acc_carrier_phase_cycles); std::cout << "Signal tracking completed in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } From faf27fff220469a64337af8d9031fbcb71a19332 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 30 Apr 2018 20:15:00 +0200 Subject: [PATCH 65/82] Apply code formatting --- .../gps_l1_ca_pcps_acquisition_fpga.cc | 49 ++++++------- .../gps_l1_ca_pcps_acquisition_fpga.h | 6 +- src/algorithms/libs/CMakeLists.txt | 68 +++++++++---------- 3 files changed, 61 insertions(+), 62 deletions(-) diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc index 455fac062..da4cd4483 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc @@ -33,15 +33,17 @@ * * ------------------------------------------------------------------------- */ -#include + +#include "configuration_interface.h" +#include "gnss_sdr_flags.h" +#include "gps_l1_ca_pcps_acquisition_fpga.h" +#include "gps_sdr_signal_processing.h" +#include "GPS_L1_CA.h" #include #include #include -#include "gps_l1_ca_pcps_acquisition_fpga.h" -#include "configuration_interface.h" -#include "gps_sdr_signal_processing.h" -#include "GPS_L1_CA.h" -#include "gnss_sdr_flags.h" +#include + #define NUM_PRNs 32 @@ -70,10 +72,10 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( unsigned int code_length = static_cast(std::round(static_cast(fs_in) / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS))); // The FPGA can only use FFT lengths that are a power of two. - float nbits = ceilf(log2f((float) code_length)); + float nbits = ceilf(log2f((float)code_length)); unsigned int nsamples_total = pow(2, nbits); unsigned int vector_length = nsamples_total * sampled_ms; - unsigned int select_queue_Fpga = configuration_->property(role + ".select_queue_Fpga",0); + unsigned int select_queue_Fpga = configuration_->property(role + ".select_queue_Fpga", 0); acq_parameters.select_queue_Fpga = select_queue_Fpga; std::string default_device_name = "/dev/uio0"; std::string device_name = configuration_->property(role + ".devicename", default_device_name); @@ -84,27 +86,27 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( // compute all the GPS L1 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time // a channel is assigned) - gr::fft::fft_complex* fft_if = new gr::fft::fft_complex(vector_length, true); // Direct FFT + gr::fft::fft_complex* fft_if = new gr::fft::fft_complex(vector_length, true); // Direct FFT // allocate memory to compute all the PRNs and compute all the possible codes - std::complex* code = new std::complex[nsamples_total]; // buffer for the local code + std::complex* code = new std::complex[nsamples_total]; // buffer for the local code gr_complex* fft_codes_padded = static_cast(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); - d_all_fft_codes_ = new lv_16sc_t[nsamples_total * NUM_PRNs]; // memory containing all the possible fft codes for PRN 0 to 32 - float max; // temporary maxima search + d_all_fft_codes_ = new lv_16sc_t[nsamples_total * NUM_PRNs]; // memory containing all the possible fft codes for PRN 0 to 32 + float max; // temporary maxima search for (unsigned int PRN = 1; PRN <= NUM_PRNs; PRN++) { - gps_l1_ca_code_gen_complex_sampled(code, PRN, fs_in, 0); // generate PRN code + gps_l1_ca_code_gen_complex_sampled(code, PRN, fs_in, 0); // generate PRN code // fill in zero padding - for (int s=code_length;sget_inbuf() + offset, code, sizeof(gr_complex) * nsamples_total); // copy to FFT buffer - fft_if->execute(); // Run the FFT of local code - volk_32fc_conjugate_32fc(fft_codes_padded, fft_if->get_outbuf(), nsamples_total); // conjugate values - max = 0; // initialize maximum value - for (unsigned int i = 0; i < nsamples_total; i++) // search for maxima + memcpy(fft_if->get_inbuf() + offset, code, sizeof(gr_complex) * nsamples_total); // copy to FFT buffer + fft_if->execute(); // Run the FFT of local code + volk_32fc_conjugate_32fc(fft_codes_padded, fft_if->get_outbuf(), nsamples_total); // conjugate values + max = 0; // initialize maximum value + for (unsigned int i = 0; i < nsamples_total; i++) // search for maxima { if (std::abs(fft_codes_padded[i].real()) > max) { @@ -115,13 +117,12 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( max = std::abs(fft_codes_padded[i].imag()); } } - for (unsigned int i = 0; i < nsamples_total; i++) // map the FFT to the dynamic range of the fixed point values an copy to buffer containing all FFTs + for (unsigned int i = 0; i < nsamples_total; i++) // map the FFT to the dynamic range of the fixed point values an copy to buffer containing all FFTs { - d_all_fft_codes_[i + nsamples_total * (PRN -1)] = lv_16sc_t(static_cast(floor(fft_codes_padded[i].real() * (pow(2, 7) - 1) / max)), - static_cast(floor(fft_codes_padded[i].imag() * (pow(2, 7) - 1) / max))); - + d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast(floor(fft_codes_padded[i].real() * (pow(2, 7) - 1) / max)), + static_cast(floor(fft_codes_padded[i].imag() * (pow(2, 7) - 1) / max))); } - } + } //acq_parameters diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h index 642e9bf8e..53ab4af1d 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h @@ -37,11 +37,10 @@ #ifndef GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_FPGA_H_ #define GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_FPGA_H_ -#include #include "acquisition_interface.h" #include "gnss_synchro.h" #include "pcps_acquisition_fpga.h" - +#include class ConfigurationInterface; @@ -144,8 +143,7 @@ private: std::string role_; unsigned int in_streams_; unsigned int out_streams_; - lv_16sc_t *d_all_fft_codes_; // memory that contains all the code ffts - + lv_16sc_t* d_all_fft_codes_; // memory that contains all the code ffts }; #endif /* GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_FPGA_H_ */ diff --git a/src/algorithms/libs/CMakeLists.txt b/src/algorithms/libs/CMakeLists.txt index 6a3924e19..775ac6358 100644 --- a/src/algorithms/libs/CMakeLists.txt +++ b/src/algorithms/libs/CMakeLists.txt @@ -42,7 +42,7 @@ if(ENABLE_FPGA) conjugate_ic.cc ) else(ENABLE_FPGA) - set(GNSS_SPLIBS_SOURCES + set(GNSS_SPLIBS_SOURCES gps_l2c_signal.cc gps_l5_signal.cc galileo_e1_signal_processing.cc @@ -62,38 +62,38 @@ else(ENABLE_FPGA) conjugate_cc.cc conjugate_sc.cc conjugate_ic.cc - ) + ) endif(ENABLE_FPGA) if(OPENCL_FOUND) - set(GNSS_SPLIBS_SOURCES ${GNSS_SPLIBS_SOURCES} - opencl/fft_execute.cc # Needs OpenCL - opencl/fft_setup.cc # Needs OpenCL - opencl/fft_kernelstring.cc # Needs OpenCL - ) + set(GNSS_SPLIBS_SOURCES ${GNSS_SPLIBS_SOURCES} + opencl/fft_execute.cc # Needs OpenCL + opencl/fft_setup.cc # Needs OpenCL + opencl/fft_kernelstring.cc # Needs OpenCL + ) endif(OPENCL_FOUND) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${GNURADIO_BLOCKS_INCLUDE_DIRS} - ${VOLK_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${Boost_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${GNURADIO_BLOCKS_INCLUDE_DIRS} + ${VOLK_INCLUDE_DIRS} + ${VOLK_GNSSSDR_INCLUDE_DIRS} ) if(OPENCL_FOUND) - include_directories( ${OPENCL_INCLUDE_DIRS} ) - if(OS_IS_MACOSX) - set(OPT_LIBRARIES ${OPT_LIBRARIES} "-framework OpenCL") - else(OS_IS_MACOSX) - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${OPENCL_LIBRARIES}) - endif(OS_IS_MACOSX) + include_directories( ${OPENCL_INCLUDE_DIRS} ) + if(OS_IS_MACOSX) + set(OPT_LIBRARIES ${OPT_LIBRARIES} "-framework OpenCL") + else(OS_IS_MACOSX) + set(OPT_LIBRARIES ${OPT_LIBRARIES} ${OPENCL_LIBRARIES}) + endif(OS_IS_MACOSX) endif(OPENCL_FOUND) add_definitions(-DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}") @@ -105,22 +105,22 @@ add_library(gnss_sp_libs ${GNSS_SPLIBS_SOURCES} ${GNSS_SPLIBS_HEADERS}) source_group(Headers FILES ${GNSS_SPLIBS_HEADERS}) target_link_libraries(gnss_sp_libs ${GNURADIO_RUNTIME_LIBRARIES} - ${VOLK_LIBRARIES} ${ORC_LIBRARIES} - ${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES} - ${GFlags_LIBS} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FFT_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - ${OPT_LIBRARIES} - gnss_rx + ${VOLK_LIBRARIES} ${ORC_LIBRARIES} + ${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES} + ${GFlags_LIBS} + ${GNURADIO_BLOCKS_LIBRARIES} + ${GNURADIO_FFT_LIBRARIES} + ${GNURADIO_FILTER_LIBRARIES} + ${OPT_LIBRARIES} + gnss_rx ) if(NOT VOLK_GNSSSDR_FOUND) - add_dependencies(gnss_sp_libs volk_gnsssdr_module) + add_dependencies(gnss_sp_libs volk_gnsssdr_module) endif(NOT VOLK_GNSSSDR_FOUND) if(${GFLAGS_GREATER_20}) - add_definitions(-DGFLAGS_GREATER_2_0=1) + add_definitions(-DGFLAGS_GREATER_2_0=1) endif(${GFLAGS_GREATER_20}) add_library(gnss_sdr_flags gnss_sdr_flags.cc gnss_sdr_flags.h) From 0494d9b5a8945a3a45533f4b45b7f4d341da7f19 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 30 Apr 2018 20:58:53 +0200 Subject: [PATCH 66/82] Avoid claah between volk and volk_gnsssdr defines --- .../gps_l1_ca_pcps_acquisition_fpga.cc | 1 - .../gps_l1_ca_pcps_acquisition_fpga.h | 1 + .../gnuradio_blocks/pcps_acquisition_fpga.h | 4 +- .../acquisition/libs/fpga_acquisition.cc | 107 ++++++++++-------- .../acquisition/libs/fpga_acquisition.h | 45 ++++---- 5 files changed, 83 insertions(+), 75 deletions(-) diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc index da4cd4483..d9ef75ae3 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc @@ -40,7 +40,6 @@ #include "gps_sdr_signal_processing.h" #include "GPS_L1_CA.h" #include -#include #include #include diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h index 53ab4af1d..f070e8818 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h @@ -40,6 +40,7 @@ #include "acquisition_interface.h" #include "gnss_synchro.h" #include "pcps_acquisition_fpga.h" +#include #include class ConfigurationInterface; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h index 3014a278a..e758904e3 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h @@ -57,9 +57,9 @@ #define GNSS_SDR_PCPS_ACQUISITION_FPGA_H_ -#include #include "fpga_acquisition.h" #include "gnss_synchro.h" +#include typedef struct { @@ -72,7 +72,7 @@ typedef struct int samples_per_code; unsigned int select_queue_Fpga; std::string device_name; - lv_16sc_t *all_fft_codes; // memory that contains all the code ffts + lv_16sc_t* all_fft_codes; // memory that contains all the code ffts } pcpsconf_fpga_t; diff --git a/src/algorithms/acquisition/libs/fpga_acquisition.cc b/src/algorithms/acquisition/libs/fpga_acquisition.cc index 82f22e050..81995faab 100644 --- a/src/algorithms/acquisition/libs/fpga_acquisition.cc +++ b/src/algorithms/acquisition/libs/fpga_acquisition.cc @@ -33,32 +33,27 @@ * ------------------------------------------------------------------------- */ -// libraries used by the GIPO -#include -#include - -// logging -#include - -// GPS L1 -#include "GPS_L1_CA.h" - #include "fpga_acquisition.h" +#include "GPS_L1_CA.h" #include "gps_sdr_signal_processing.h" +#include +#include // libraries used by the GIPO +#include // libraries used by the GIPO -#define PAGE_SIZE 0x10000 // default page size for the multicorrelator memory map -#define MAX_PHASE_STEP_RAD 0.999999999534339 // 1 - pow(2,-31); -#define RESET_ACQUISITION 2 // command to reset the multicorrelator -#define LAUNCH_ACQUISITION 1 // command to launch the multicorrelator -#define TEST_REG_SANITY_CHECK 0x55AA // value to check the presence of the test register (to detect the hw) -#define LOCAL_CODE_CLEAR_MEM 0x10000000 // command to clear the internal memory of the multicorrelator -#define MEM_LOCAL_CODE_WR_ENABLE 0x0C000000 // command to enable the ENA and WR pins of the internal memory of the multicorrelator -#define POW_2_2 4 // 2^2 (used for the conversion of floating point numbers to integers) -#define POW_2_29 536870912 // 2^29 (used for the conversion of floating point numbers to integers) -#define SELECT_LSB 0x00FF // value to select the least significant byte -#define SELECT_MSB 0XFF00 // value to select the most significant byte -#define SELECT_16_BITS 0xFFFF // value to select 16 bits -#define SHL_8_BITS 256 // value used to shift a value 8 bits to the left + +#define PAGE_SIZE 0x10000 // default page size for the multicorrelator memory map +#define MAX_PHASE_STEP_RAD 0.999999999534339 // 1 - pow(2,-31); +#define RESET_ACQUISITION 2 // command to reset the multicorrelator +#define LAUNCH_ACQUISITION 1 // command to launch the multicorrelator +#define TEST_REG_SANITY_CHECK 0x55AA // value to check the presence of the test register (to detect the hw) +#define LOCAL_CODE_CLEAR_MEM 0x10000000 // command to clear the internal memory of the multicorrelator +#define MEM_LOCAL_CODE_WR_ENABLE 0x0C000000 // command to enable the ENA and WR pins of the internal memory of the multicorrelator +#define POW_2_2 4 // 2^2 (used for the conversion of floating point numbers to integers) +#define POW_2_29 536870912 // 2^29 (used for the conversion of floating point numbers to integers) +#define SELECT_LSB 0x00FF // value to select the least significant byte +#define SELECT_MSB 0XFF00 // value to select the most significant byte +#define SELECT_16_BITS 0xFFFF // value to select 16 bits +#define SHL_8_BITS 256 // value used to shift a value 8 bits to the left bool fpga_acquisition::init() @@ -68,34 +63,36 @@ bool fpga_acquisition::init() return true; } + bool fpga_acquisition::set_local_code(unsigned int PRN) { // select the code with the chosen PRN fpga_acquisition::fpga_configure_acquisition_local_code( - &d_all_fft_codes[d_nsamples_total * (PRN - 1)]); + &d_all_fft_codes[d_nsamples_total * (PRN - 1)]); return true; } + fpga_acquisition::fpga_acquisition(std::string device_name, - unsigned int nsamples, - unsigned int doppler_max, - unsigned int nsamples_total, long fs_in, long freq, - unsigned int sampled_ms, unsigned select_queue, - lv_16sc_t *all_fft_codes) + unsigned int nsamples, + unsigned int doppler_max, + unsigned int nsamples_total, long fs_in, long freq, + unsigned int sampled_ms, unsigned select_queue, + lv_16sc_t *all_fft_codes) { - unsigned int vector_length = nsamples_total*sampled_ms; + unsigned int vector_length = nsamples_total * sampled_ms; // initial values d_device_name = device_name; d_freq = freq; d_fs_in = fs_in; d_vector_length = vector_length; - d_nsamples = nsamples; // number of samples not including padding + d_nsamples = nsamples; // number of samples not including padding d_select_queue = select_queue; d_nsamples_total = nsamples_total; d_doppler_max = doppler_max; d_doppler_step = 0; - d_fd = 0; // driver descriptor - d_map_base = nullptr; // driver memory map + d_fd = 0; // driver descriptor + d_map_base = nullptr; // driver memory map d_all_fft_codes = all_fft_codes; // open communication with HW accelerator @@ -104,9 +101,9 @@ fpga_acquisition::fpga_acquisition(std::string device_name, LOG(WARNING) << "Cannot open deviceio" << d_device_name; } d_map_base = reinterpret_cast(mmap(NULL, PAGE_SIZE, - PROT_READ | PROT_WRITE, MAP_SHARED, d_fd, 0)); + PROT_READ | PROT_WRITE, MAP_SHARED, d_fd, 0)); - if (d_map_base == reinterpret_cast(-1)) + if (d_map_base == reinterpret_cast(-1)) { LOG(WARNING) << "Cannot map the FPGA acquisition module into user memory"; } @@ -121,23 +118,25 @@ fpga_acquisition::fpga_acquisition(std::string device_name, } else { - LOG(INFO) << "Acquisition test register sanity check success !"; + LOG(INFO) << "Acquisition test register sanity check success!"; } fpga_acquisition::reset_acquisition(); DLOG(INFO) << "Acquisition FPGA class created"; - } + fpga_acquisition::~fpga_acquisition() { close_device(); } + bool fpga_acquisition::free() { return true; } + unsigned fpga_acquisition::fpga_acquisition_test_register(unsigned writeval) { unsigned readval; @@ -149,6 +148,7 @@ unsigned fpga_acquisition::fpga_acquisition_test_register(unsigned writeval) return readval; } + void fpga_acquisition::fpga_configure_acquisition_local_code(lv_16sc_t fft_local_code[]) { unsigned short local_code; @@ -161,19 +161,20 @@ void fpga_acquisition::fpga_configure_acquisition_local_code(lv_16sc_t fft_local { tmp = fft_local_code[k].real(); tmp2 = fft_local_code[k].imag(); - local_code = (tmp & SELECT_LSB) | ((tmp2 * SHL_8_BITS) & SELECT_MSB); // put together the real part and the imaginary part + local_code = (tmp & SELECT_LSB) | ((tmp2 * SHL_8_BITS) & SELECT_MSB); // put together the real part and the imaginary part fft_data = MEM_LOCAL_CODE_WR_ENABLE | (local_code & SELECT_16_BITS); d_map_base[4] = fft_data; } } + void fpga_acquisition::run_acquisition(void) { // enable interrupts int reenable = 1; - write(d_fd, reinterpret_cast(&reenable), sizeof(int)); + write(d_fd, reinterpret_cast(&reenable), sizeof(int)); // launch the acquisition process - d_map_base[6] = LAUNCH_ACQUISITION; // writing anything to reg 6 launches the acquisition process + d_map_base[6] = LAUNCH_ACQUISITION; // writing anything to reg 6 launches the acquisition process int irq_count; ssize_t nb; @@ -186,14 +187,16 @@ void fpga_acquisition::run_acquisition(void) } } + void fpga_acquisition::configure_acquisition() { d_map_base[0] = d_select_queue; d_map_base[1] = d_vector_length; d_map_base[2] = d_nsamples; - d_map_base[5] = (int) log2((float) d_vector_length); // log2 FFTlength + d_map_base[5] = (int)log2((float)d_vector_length); // log2 FFTlength } + void fpga_acquisition::set_phase_step(unsigned int doppler_index) { float phase_step_rad_real; @@ -212,13 +215,14 @@ void fpga_acquisition::set_phase_step(unsigned int doppler_index) { phase_step_rad_real = MAX_PHASE_STEP_RAD; } - phase_step_rad_int_temp = phase_step_rad_real * POW_2_2; // * 2^2 - phase_step_rad_int = (int32_t) (phase_step_rad_int_temp * (POW_2_29)); // * 2^29 (in total it makes x2^31 in two steps to avoid the warnings + phase_step_rad_int_temp = phase_step_rad_real * POW_2_2; // * 2^2 + phase_step_rad_int = (int32_t)(phase_step_rad_int_temp * (POW_2_29)); // * 2^29 (in total it makes x2^31 in two steps to avoid the warnings d_map_base[3] = phase_step_rad_int; } -void fpga_acquisition::read_acquisition_results(uint32_t* max_index, - float* max_magnitude, unsigned *initial_sample, float *power_sum) + +void fpga_acquisition::read_acquisition_results(uint32_t *max_index, + float *max_magnitude, unsigned *initial_sample, float *power_sum) { unsigned readval = 0; readval = d_map_base[1]; @@ -231,28 +235,31 @@ void fpga_acquisition::read_acquisition_results(uint32_t* max_index, *max_index = readval; } + void fpga_acquisition::block_samples() { - d_map_base[14] = 1; // block the samples + d_map_base[14] = 1; // block the samples } void fpga_acquisition::unblock_samples() { - d_map_base[14] = 0; // unblock the samples + d_map_base[14] = 0; // unblock the samples } + void fpga_acquisition::close_device() { - unsigned * aux = const_cast(d_map_base); - if (munmap(static_cast(aux), PAGE_SIZE) == -1) + unsigned *aux = const_cast(d_map_base); + if (munmap(static_cast(aux), PAGE_SIZE) == -1) { printf("Failed to unmap memory uio\n"); } close(d_fd); } + void fpga_acquisition::reset_acquisition(void) { - d_map_base[6] = RESET_ACQUISITION; // writing a 2 to d_map_base[6] resets the multicorrelator + d_map_base[6] = RESET_ACQUISITION; // writing a 2 to d_map_base[6] resets the multicorrelator } diff --git a/src/algorithms/acquisition/libs/fpga_acquisition.h b/src/algorithms/acquisition/libs/fpga_acquisition.h index 45cae5475..00641e1cd 100644 --- a/src/algorithms/acquisition/libs/fpga_acquisition.h +++ b/src/algorithms/acquisition/libs/fpga_acquisition.h @@ -36,8 +36,8 @@ #ifndef GNSS_SDR_FPGA_ACQUISITION_H_ #define GNSS_SDR_FPGA_ACQUISITION_H_ -#include #include +#include /*! * \brief Class that implements carrier wipe-off and correlators. @@ -46,18 +46,20 @@ class fpga_acquisition { public: fpga_acquisition(std::string device_name, - unsigned int nsamples, - unsigned int doppler_max, - unsigned int nsamples_total, long fs_in, long freq, - unsigned int sampled_ms, unsigned select_queue, - lv_16sc_t *all_fft_codes); - ~fpga_acquisition();bool init();bool set_local_code( - unsigned int PRN); + unsigned int nsamples, + unsigned int doppler_max, + unsigned int nsamples_total, long fs_in, long freq, + unsigned int sampled_ms, unsigned select_queue, + lv_16sc_t *all_fft_codes); + ~fpga_acquisition(); + bool init(); + bool set_local_code( + unsigned int PRN); bool free(); void run_acquisition(void); void set_phase_step(unsigned int doppler_index); - void read_acquisition_results(uint32_t* max_index, float* max_magnitude, - unsigned *initial_sample, float *power_sum); + void read_acquisition_results(uint32_t *max_index, float *max_magnitude, + unsigned *initial_sample, float *power_sum); void block_samples(); void unblock_samples(); @@ -80,21 +82,20 @@ public: } private: - long d_freq; long d_fs_in; - gr::fft::fft_complex* d_fft_if; // function used to run the fft of the local codes + gr::fft::fft_complex *d_fft_if; // function used to run the fft of the local codes // data related to the hardware module and the driver - int d_fd; // driver descriptor - volatile unsigned *d_map_base; // driver memory map - lv_16sc_t *d_all_fft_codes; // memory that contains all the code ffts - unsigned int d_vector_length; // number of samples incluing padding and number of ms - unsigned int d_nsamples_total; // number of samples including padding - unsigned int d_nsamples; // number of samples not including padding - unsigned int d_select_queue; // queue selection - std::string d_device_name; // HW device name - unsigned int d_doppler_max; // max doppler - unsigned int d_doppler_step; // doppler step + int d_fd; // driver descriptor + volatile unsigned *d_map_base; // driver memory map + lv_16sc_t *d_all_fft_codes; // memory that contains all the code ffts + unsigned int d_vector_length; // number of samples incluing padding and number of ms + unsigned int d_nsamples_total; // number of samples including padding + unsigned int d_nsamples; // number of samples not including padding + unsigned int d_select_queue; // queue selection + std::string d_device_name; // HW device name + unsigned int d_doppler_max; // max doppler + unsigned int d_doppler_step; // doppler step // FPGA private functions unsigned fpga_acquisition_test_register(unsigned writeval); void fpga_configure_acquisition_local_code(lv_16sc_t fft_local_code[]); From c90ec201f20bfe7436dc5edc0efc0a810ed526f1 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 1 May 2018 08:33:41 +0200 Subject: [PATCH 67/82] Fix building in PYBOMBS --- .../signal_source/libs/CMakeLists.txt | 88 ++++++++++--------- 1 file changed, 46 insertions(+), 42 deletions(-) diff --git a/src/algorithms/signal_source/libs/CMakeLists.txt b/src/algorithms/signal_source/libs/CMakeLists.txt index c8f676b49..ccd1390c1 100644 --- a/src/algorithms/signal_source/libs/CMakeLists.txt +++ b/src/algorithms/signal_source/libs/CMakeLists.txt @@ -17,64 +17,68 @@ # if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) - find_package(iio REQUIRED) - if(NOT IIO_FOUND) - message(STATUS "gnuradio-iio not found, its installation is required.") - message(STATUS "Please build and install the following projects:") - message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio") - message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") - message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") - message(FATAL_ERROR "gnuradio-iio required for building gnss-sdr with this option enabled") - endif(NOT IIO_FOUND) - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES}) - set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) - + find_package(iio REQUIRED) + if(NOT IIO_FOUND) + message(STATUS "gnuradio-iio not found, its installation is required.") + message(STATUS "Please build and install the following projects:") + message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio") + message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") + message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") + message(FATAL_ERROR "gnuradio-iio is required for building gnss-sdr with this option enabled") + endif(NOT IIO_FOUND) + set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES}) + set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) endif(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) if(ENABLE_FMCOMMS2 OR ENABLE_AD9361) - find_package(libiio REQUIRED) - if(NOT LIBIIO_FOUND) - message(STATUS "gnuradio-iio not found, its installation is required.") - message(STATUS "Please build and install the following projects:") - message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio") - message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") - message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") - message(FATAL_ERROR "gnuradio-iio required for building gnss-sdr with this option enabled") - endif(NOT LIBIIO_FOUND) - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${LIBIIO_LIBRARIES}) - set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${LIBIIO_INCLUDE_DIRS}) - - ############################################### - # FMCOMMS2 based SDR Hardware - ############################################### - if(IIO_FOUND) - set(OPT_SIGNAL_SOURCE_LIB_SOURCES ad9361_manager.cc) - endif(IIO_FOUND) + find_package(libiio REQUIRED) + if(NOT LIBIIO_FOUND) + message(STATUS "libiio not found, its installation is required.") + message(STATUS "Please build and install the following projects:") + message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio") + message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") + message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") + message(FATAL_ERROR "libiio is required for building gnss-sdr with this option enabled") + endif(NOT LIBIIO_FOUND) + set(OPT_LIBRARIES ${OPT_LIBRARIES} ${LIBIIO_LIBRARIES}) + set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${LIBIIO_INCLUDE_DIRS}) + ############################################### + # FMCOMMS2 based SDR Hardware + ############################################### + if(IIO_FOUND) + set(OPT_SIGNAL_SOURCE_LIB_SOURCES ad9361_manager.cc) + set(OPT_SIGNAL_SOURCE_LIB_HEADERS ad9361_manager.h) + endif(IIO_FOUND) endif(ENABLE_FMCOMMS2 OR ENABLE_AD9361) -if(ENABLE_AD9361) - set(OPT_SIGNAL_SOURCE_LIB_SOURCES ad9361_manager.cc) -endif(ENABLE_AD9361) - if(ENABLE_FPGA) - SET(OPT_SIGNAL_SOURCE_LIB_SOURCES ${OPT_SIGNAL_SOURCE_LIB_SOURCES} fpga_switch.cc) + set(OPT_SIGNAL_SOURCE_LIB_SOURCES ${OPT_SIGNAL_SOURCE_LIB_SOURCES} fpga_switch.cc) + set(OPT_SIGNAL_SOURCE_LIB_HEADERS ${OPT_SIGNAL_SOURCE_LIB_HEADERS} fpga_switch.h) endif(ENABLE_FPGA) include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${Boost_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} ${OPT_DRIVER_INCLUDE_DIRS} -) + ) -set (SIGNAL_SOURCE_LIB_SOURCES - rtl_tcp_commands.cc - rtl_tcp_dongle_info.cc - ${OPT_SIGNAL_SOURCE_LIB_SOURCES}) +set(SIGNAL_SOURCE_LIB_SOURCES + rtl_tcp_commands.cc + rtl_tcp_dongle_info.cc + ${OPT_SIGNAL_SOURCE_LIB_SOURCES} + ) + +set(SIGNAL_SOURCE_LIB_HEADERS + rtl_tcp_commands.h + rtl_tcp_dongle_info.h + ${OPT_SIGNAL_SOURCE_LIB_HEADERS} + ) -file(GLOB SIGNAL_SOURCE_LIB_HEADERS "*.h") list(SORT SIGNAL_SOURCE_LIB_HEADERS) add_library(signal_source_lib ${SIGNAL_SOURCE_LIB_SOURCES} ${SIGNAL_SOURCE_LIB_HEADERS}) source_group(Headers FILES ${SIGNAL_SOURCE_LIB_HEADERS}) - target_link_libraries(signal_source_lib ${OPT_LIBRARIES}) +add_dependencies(signal_source_lib glog-${glog_RELEASE}) From 966dd699ac3deb091f65d66b2ea2c8dff550cc5f Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 1 May 2018 08:40:08 +0200 Subject: [PATCH 68/82] Fix building with libiio but without gnuradio-iio --- src/algorithms/signal_source/libs/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/algorithms/signal_source/libs/CMakeLists.txt b/src/algorithms/signal_source/libs/CMakeLists.txt index ccd1390c1..9cb569618 100644 --- a/src/algorithms/signal_source/libs/CMakeLists.txt +++ b/src/algorithms/signal_source/libs/CMakeLists.txt @@ -46,10 +46,10 @@ if(ENABLE_FMCOMMS2 OR ENABLE_AD9361) ############################################### # FMCOMMS2 based SDR Hardware ############################################### - if(IIO_FOUND) + if(LIBIIO_FOUND) set(OPT_SIGNAL_SOURCE_LIB_SOURCES ad9361_manager.cc) set(OPT_SIGNAL_SOURCE_LIB_HEADERS ad9361_manager.h) - endif(IIO_FOUND) + endif(LIBIIO_FOUND) endif(ENABLE_FMCOMMS2 OR ENABLE_AD9361) if(ENABLE_FPGA) From 43103068fdaa7a2dea5fc92d8c367b02ce31b931 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 1 May 2018 10:16:30 +0200 Subject: [PATCH 69/82] Remove unused includes --- .../signal_source/libs/fpga_switch.cc | 43 ++++++------------- .../signal_source/libs/fpga_switch.h | 2 +- 2 files changed, 13 insertions(+), 32 deletions(-) diff --git a/src/algorithms/signal_source/libs/fpga_switch.cc b/src/algorithms/signal_source/libs/fpga_switch.cc index aae7da979..675c1c071 100644 --- a/src/algorithms/signal_source/libs/fpga_switch.cc +++ b/src/algorithms/signal_source/libs/fpga_switch.cc @@ -35,52 +35,33 @@ */ #include "fpga_switch.h" -#include - -// FPGA stuff -#include - -// libraries used by DMA test code and GIPO test code -#include -#include -#include -#include - -// libraries used by DMA test code -#include -#include -#include -#include - -// libraries used by GPIO test code -#include -#include -#include - -// logging #include +#include // for open, O_RDWR, O_SYNC +#include // for cout, endl +#include // for mmap -// string manipulation -#include // constants -#define PAGE_SIZE 0x10000 -#define TEST_REGISTER_TRACK_WRITEVAL 0x55AA +const size_t PAGE_SIZE = 0x10000; +const unsigned int TEST_REGISTER_TRACK_WRITEVAL = 0x55AA; fpga_switch::fpga_switch(std::string device_name) { if ((d_device_descriptor = open(device_name.c_str(), O_RDWR | O_SYNC)) == -1) { LOG(WARNING) << "Cannot open deviceio" << device_name; - printf("switch memory successfully mapped\n"); } - d_map_base = reinterpret_cast(mmap(NULL, PAGE_SIZE, + d_map_base = reinterpret_cast(mmap(nullptr, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, d_device_descriptor, 0)); if (d_map_base == reinterpret_cast(-1)) { LOG(WARNING) << "Cannot map the FPGA switch module into tracking memory"; - printf("could not map switch memory\n"); + std::cout << "Could not map switch memory." << std::endl; + } + else + { + std::cout << "Switch memory successfully mapped." << std::endl; } // sanity check : check test register @@ -130,7 +111,7 @@ void fpga_switch::close_device() unsigned *aux = const_cast(d_map_base); if (munmap(static_cast(aux), PAGE_SIZE) == -1) { - printf("Failed to unmap memory uio\n"); + std::cout << "Failed to unmap memory uio" << std::endl; } close(d_device_descriptor); diff --git a/src/algorithms/signal_source/libs/fpga_switch.h b/src/algorithms/signal_source/libs/fpga_switch.h index 395aff425..bf60a17fe 100644 --- a/src/algorithms/signal_source/libs/fpga_switch.h +++ b/src/algorithms/signal_source/libs/fpga_switch.h @@ -37,7 +37,7 @@ #ifndef GNSS_SDR_FPGA_SWITCH_H_ #define GNSS_SDR_FPGA_SWITCH_H_ -#include +#include #define MAX_LENGTH_DEVICEIO_NAME 50 From f259ef28dd1789696134f579849816db400a4862 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 1 May 2018 10:56:18 +0200 Subject: [PATCH 70/82] Replace boost::lexical_cast() by std::to_string() This fixes uncaught exceptions detected by Coverity Scan --- src/core/receiver/gnss_flowgraph.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index 7085f9394..17cb2205a 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -341,7 +341,7 @@ void GNSSFlowgraph::connect() { if (FPGA_enabled == false) { - selected_signal_conditioner_ID = configuration_->property("Channel" + boost::lexical_cast(i) + ".RF_channel_ID", 0); + selected_signal_conditioner_ID = configuration_->property("Channel" + std::to_string(i) + ".RF_channel_ID", 0); try { top_block_->connect(sig_conditioner_.at(selected_signal_conditioner_ID)->get_right_block(), 0, @@ -376,7 +376,7 @@ void GNSSFlowgraph::connect() std::vector vector_of_channels; for (unsigned int i = 0; i < channels_count_; i++) { - unsigned int sat = configuration_->property("Channel" + boost::lexical_cast(i) + ".satellite", 0); + unsigned int sat = configuration_->property("Channel" + std::to_string(i) + ".satellite", 0); if (sat == 0) { vector_of_channels.push_back(i); @@ -392,7 +392,7 @@ void GNSSFlowgraph::connect() for (unsigned int& i : vector_of_channels) { std::string gnss_signal = channels_.at(i)->get_signal().get_signal_str(); // use channel's implicit signal - unsigned int sat = configuration_->property("Channel" + boost::lexical_cast(i) + ".satellite", 0); + unsigned int sat = configuration_->property("Channel" + std::to_string(i) + ".satellite", 0); if (sat == 0) { channels_.at(i)->set_signal(search_next_signal(gnss_signal, true)); @@ -528,7 +528,7 @@ void GNSSFlowgraph::disconnect() int selected_signal_conditioner_ID; for (unsigned int i = 0; i < channels_count_; i++) { - selected_signal_conditioner_ID = configuration_->property("Channel" + boost::lexical_cast(i) + ".RF_channel_ID", 0); + selected_signal_conditioner_ID = configuration_->property("Channel" + std::to_string(i) + ".RF_channel_ID", 0); try { top_block_->disconnect(sig_conditioner_.at(selected_signal_conditioner_ID)->get_right_block(), 0, @@ -679,7 +679,7 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) acq_channels_count_--; for (unsigned int i = 0; i < channels_count_; i++) { - unsigned int sat_ = configuration_->property("Channel" + boost::lexical_cast(i) + ".satellite", 0); + unsigned int sat_ = configuration_->property("Channel" + std::to_string(i) + ".satellite", 0); if (!available_GNSS_signals_.empty() && (acq_channels_count_ < max_acq_channels_) && (channels_state_[i] == 0)) { channels_state_[i] = 1; From 8d8ebfc6dfa7f2166ac60cfa3574e2196d4fe8f4 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 1 May 2018 12:02:50 +0200 Subject: [PATCH 71/82] Remove unused includes, minor fixes --- .../signal_source/adapters/CMakeLists.txt | 6 +- .../adapters/ad9361_fpga_signal_source.cc | 64 +++++++++---------- .../adapters/ad9361_fpga_signal_source.h | 17 +++-- 3 files changed, 41 insertions(+), 46 deletions(-) diff --git a/src/algorithms/signal_source/adapters/CMakeLists.txt b/src/algorithms/signal_source/adapters/CMakeLists.txt index ededc5dc7..a502b6e30 100644 --- a/src/algorithms/signal_source/adapters/CMakeLists.txt +++ b/src/algorithms/signal_source/adapters/CMakeLists.txt @@ -29,7 +29,7 @@ if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio") message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") - message(FATAL_ERROR "gnuradio-iio required for building gnss-sdr with this option enabled") + message(FATAL_ERROR "gnuradio-iio is required for building gnss-sdr with this option enabled.") endif(NOT IIO_FOUND) set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES}) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) @@ -38,12 +38,12 @@ endif(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) if(ENABLE_AD9361) find_package(libiio REQUIRED) if(NOT LIBIIO_FOUND) - message(STATUS "gnuradio-iio not found, its installation is required.") + message(STATUS "libiio not found, its installation is required.") message(STATUS "Please build and install the following projects:") message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio") message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") - message(FATAL_ERROR "gnuradio-iio required for building gnss-sdr with this option enabled") + message(FATAL_ERROR "libiio is required for building gnss-sdr with this option enabled.") endif(NOT LIBIIO_FOUND) set(OPT_LIBRARIES ${OPT_LIBRARIES} ${LIBIIO_LIBRARIES}) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${LIBIIO_INCLUDE_DIRS}) diff --git a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc index cba4e5439..02be88152 100644 --- a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc +++ b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc @@ -35,10 +35,8 @@ #include "ad9361_manager.h" #include "GPS_L1_CA.h" #include "GPS_L2C.h" -#include -#include #include -#include +#include // for cout, endl #ifdef __APPLE__ #include @@ -47,10 +45,8 @@ #endif Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, unsigned int out_stream, - boost::shared_ptr queue) : - role_(role), in_stream_(in_stream), out_stream_(out_stream), - queue_(queue) + std::string role, unsigned int in_stream, unsigned int out_stream, + boost::shared_ptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue) { std::string default_item_type = "gr_complex"; std::string default_dump_file = "./data/signal_source.dat"; @@ -75,12 +71,12 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(ConfigurationInterface* configura dump_ = configuration->property(role + ".dump", false); dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file); - enable_dds_lo_=configuration->property(role + ".enable_dds_lo", false); - freq_rf_tx_hz_=configuration->property(role + ".freq_rf_tx_hz", GPS_L1_FREQ_HZ-GPS_L2_FREQ_HZ-1000); - freq_dds_tx_hz_=configuration->property(role + ".freq_dds_tx_hz", 1000); - scale_dds_dbfs_=configuration->property(role + ".scale_dds_dbfs", -3.0); - phase_dds_deg_=configuration->property(role + ".phase_dds_deg", 0.0); - tx_attenuation_db_=configuration->property(role + ".tx_attenuation_db", 0.0); + enable_dds_lo_ = configuration->property(role + ".enable_dds_lo", false); + freq_rf_tx_hz_ = configuration->property(role + ".freq_rf_tx_hz", GPS_L1_FREQ_HZ - GPS_L2_FREQ_HZ - 1000); + freq_dds_tx_hz_ = configuration->property(role + ".freq_dds_tx_hz", 1000); + scale_dds_dbfs_ = configuration->property(role + ".scale_dds_dbfs", -3.0); + phase_dds_deg_ = configuration->property(role + ".phase_dds_deg", 0.0); + tx_attenuation_db_ = configuration->property(role + ".tx_attenuation_db", 0.0); item_size_ = sizeof(gr_complex); @@ -89,30 +85,30 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(ConfigurationInterface* configura std::cout << "sample rate: " << sample_rate_ << " Hz" << std::endl; config_ad9361_rx_local(bandwidth_, - sample_rate_, - freq_, - rf_port_select_, - gain_mode_rx1_, - gain_mode_rx2_, - rf_gain_rx1_, - rf_gain_rx2_); + sample_rate_, + freq_, + rf_port_select_, + gain_mode_rx1_, + gain_mode_rx2_, + rf_gain_rx1_, + rf_gain_rx2_); //LOCAL OSCILLATOR DDS GENERATOR FOR DUAL FREQUENCY OPERATION - if (enable_dds_lo_==true) - { - config_ad9361_lo_local(bandwidth_, - sample_rate_, - freq_rf_tx_hz_, - tx_attenuation_db_, - freq_dds_tx_hz_, - scale_dds_dbfs_); - } + if (enable_dds_lo_ == true) + { + config_ad9361_lo_local(bandwidth_, + sample_rate_, + freq_rf_tx_hz_, + tx_attenuation_db_, + freq_dds_tx_hz_, + scale_dds_dbfs_); + } // turn switch to A/D position std::string default_device_name = "/dev/uio13"; std::string device_name = configuration->property(role + ".devicename", default_device_name); int switch_position = configuration->property(role + ".switch_position", 0); - switch_fpga = std::make_shared (device_name); + switch_fpga = std::make_shared(device_name); switch_fpga->set_switch_position(switch_position); } @@ -125,11 +121,11 @@ Ad9361FpgaSignalSource::~Ad9361FpgaSignalSource() //if (rx0_q) { iio_channel_disable(rx0_q); } if (enable_dds_lo_) - { - ad9361_disable_lo_local(); - } + { + ad9361_disable_lo_local(); + } - // std::cout<<"* AD9361 Destroying context\n"; + // std::cout<<"* AD9361 Destroying context\n"; //if (ctx) { iio_context_destroy(ctx); } } diff --git a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h index 6110a63c3..2a98e3017 100644 --- a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h +++ b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h @@ -34,21 +34,20 @@ #include "gnss_block_interface.h" #include "fpga_switch.h" - #include #include #include class ConfigurationInterface; -class Ad9361FpgaSignalSource: public GNSSBlockInterface +class Ad9361FpgaSignalSource : public GNSSBlockInterface { public: Ad9361FpgaSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, - unsigned int out_stream, boost::shared_ptr queue); + std::string role, unsigned int in_stream, + unsigned int out_stream, boost::shared_ptr queue); - virtual ~Ad9361FpgaSignalSource(); + ~Ad9361FpgaSignalSource(); inline std::string role() override { @@ -77,11 +76,11 @@ private: std::string role_; // Front-end settings - std::string uri_;//device direction - unsigned long freq_; //frequency of local oscilator + std::string uri_; // device direction + unsigned long freq_; // frequency of local oscillator unsigned long sample_rate_; unsigned long bandwidth_; - unsigned long buffer_size_; //reception buffer + unsigned long buffer_size_; // reception buffer bool rx1_en_; bool rx2_en_; bool quadrature_; @@ -95,7 +94,7 @@ private: std::string filter_file_; bool filter_auto_; - //DDS configuration for LO generation for external mixer + // DDS configuration for LO generation for external mixer bool enable_dds_lo_; unsigned long freq_rf_tx_hz_; unsigned long freq_dds_tx_hz_; From 8b390d0924892189c2620e1f2f63280efee77396 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 1 May 2018 23:32:52 +0200 Subject: [PATCH 72/82] Replace boost::lexical_cast with std::to_string Fixes in optional buildings --- .../signal_source/libs/CMakeLists.txt | 4 +- src/core/receiver/control_thread.cc | 17 +- src/core/receiver/gnss_block_factory.cc | 531 +++++++++--------- src/core/receiver/gnss_flowgraph.cc | 133 ++++- 4 files changed, 408 insertions(+), 277 deletions(-) diff --git a/src/algorithms/signal_source/libs/CMakeLists.txt b/src/algorithms/signal_source/libs/CMakeLists.txt index 9cb569618..073cc343f 100644 --- a/src/algorithms/signal_source/libs/CMakeLists.txt +++ b/src/algorithms/signal_source/libs/CMakeLists.txt @@ -52,10 +52,10 @@ if(ENABLE_FMCOMMS2 OR ENABLE_AD9361) endif(LIBIIO_FOUND) endif(ENABLE_FMCOMMS2 OR ENABLE_AD9361) -if(ENABLE_FPGA) +if(ENABLE_FPGA OR ENABLE_AD9361) set(OPT_SIGNAL_SOURCE_LIB_SOURCES ${OPT_SIGNAL_SOURCE_LIB_SOURCES} fpga_switch.cc) set(OPT_SIGNAL_SOURCE_LIB_HEADERS ${OPT_SIGNAL_SOURCE_LIB_HEADERS} fpga_switch.h) -endif(ENABLE_FPGA) +endif(ENABLE_FPGA OR ENABLE_AD9361) include_directories( ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 9121d7fa7..aba3c0272 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -110,7 +110,15 @@ ControlThread::~ControlThread() void ControlThread::run() { // Connect the flowgraph - flowgraph_->connect(); + try + { + flowgraph_->connect(); + } + catch (const std::exception e) + { + LOG(ERROR) << e.what(); + return; + } if (flowgraph_->connected()) { LOG(INFO) << "Flowgraph connected"; @@ -141,9 +149,9 @@ void ControlThread::run() bool enable_FPGA = configuration_->property("Channel.enable_FPGA", false); if (enable_FPGA == true) - { - flowgraph_->start_acquisition_helper(); - } + { + flowgraph_->start_acquisition_helper(); + } // Main loop to read and process the control messages while (flowgraph_->running() && !stop_) @@ -271,6 +279,7 @@ bool ControlThread::read_assistance_from_XML() return ret; } + void ControlThread::assist_GNSS() { //######### GNSS Assistance ################################# diff --git a/src/core/receiver/gnss_block_factory.cc b/src/core/receiver/gnss_block_factory.cc index 09d396b36..329f2e168 100644 --- a/src/core/receiver/gnss_block_factory.cc +++ b/src/core/receiver/gnss_block_factory.cc @@ -148,7 +148,6 @@ #include "gps_l1_ca_dll_pll_tracking_gpu.h" #endif -#include #include #include #include @@ -169,9 +168,16 @@ std::unique_ptr GNSSBlockFactory::GetSignalSource( { std::string default_implementation = "File_Signal_Source"; std::string role = "SignalSource"; //backwards compatibility for old conf files - if (ID != -1) + try { - role = "SignalSource" + boost::lexical_cast(ID); + if (ID != -1) + { + role = "SignalSource" + std::to_string(ID); + } + } + catch (const std::exception &e) + { + LOG(WARNING) << e.what(); } std::string implementation = configuration->property(role + ".implementation", default_implementation); LOG(INFO) << "Getting SignalSource with implementation " << implementation; @@ -188,15 +194,20 @@ std::unique_ptr GNSSBlockFactory::GetSignalConditioner( std::string role_datatypeadapter = "DataTypeAdapter"; std::string role_inputfilter = "InputFilter"; std::string role_resampler = "Resampler"; - - if (ID != -1) + try { - role_conditioner = "SignalConditioner" + boost::lexical_cast(ID); - role_datatypeadapter = "DataTypeAdapter" + boost::lexical_cast(ID); - role_inputfilter = "InputFilter" + boost::lexical_cast(ID); - role_resampler = "Resampler" + boost::lexical_cast(ID); + if (ID != -1) + { + role_conditioner = "SignalConditioner" + std::to_string(ID); + role_datatypeadapter = "DataTypeAdapter" + std::to_string(ID); + role_inputfilter = "InputFilter" + std::to_string(ID); + role_resampler = "Resampler" + std::to_string(ID); + } + } + catch (const std::exception &e) + { + LOG(WARNING) << e.what(); } - std::string signal_conditioner = configuration->property(role_conditioner + ".implementation", default_implementation); std::string data_type_adapter; @@ -293,31 +304,31 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1C( LOG(INFO) << "Instantiating Channel " << channel << " with Acquisition Implementation: " << acq << ", Tracking Implementation: " << trk << ", Telemetry Decoder implementation: " << tlm; - std::string aux = configuration->property("Acquisition_1C" + boost::lexical_cast(channel) + ".implementation", std::string("W")); + std::string aux = configuration->property("Acquisition_1C" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix1; if (aux.compare("W") != 0) { - appendix1 = boost::lexical_cast(channel); + appendix1 = std::to_string(channel); } else { appendix1 = ""; } - aux = configuration->property("Tracking_1C" + boost::lexical_cast(channel) + ".implementation", std::string("W")); + aux = configuration->property("Tracking_1C" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix2; if (aux.compare("W") != 0) { - appendix2 = boost::lexical_cast(channel); + appendix2 = std::to_string(channel); } else { appendix2 = ""; } - aux = configuration->property("TelemetryDecoder_1C" + boost::lexical_cast(channel) + ".implementation", std::string("W")); + aux = configuration->property("TelemetryDecoder_1C" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix3; if (aux.compare("W") != 0) { - appendix3 = boost::lexical_cast(channel); + appendix3 = std::to_string(channel); } else { @@ -358,31 +369,31 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2S( { LOG(INFO) << "Instantiating Channel " << channel << " with Acquisition Implementation: " << acq << ", Tracking Implementation: " << trk << ", Telemetry Decoder implementation: " << tlm; - std::string aux = configuration->property("Acquisition_2S" + boost::lexical_cast(channel) + ".implementation", std::string("W")); + std::string aux = configuration->property("Acquisition_2S" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix1; if (aux.compare("W") != 0) { - appendix1 = boost::lexical_cast(channel); + appendix1 = std::to_string(channel); } else { appendix1 = ""; } - aux = configuration->property("Tracking_2S" + boost::lexical_cast(channel) + ".implementation", std::string("W")); + aux = configuration->property("Tracking_2S" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix2; if (aux.compare("W") != 0) { - appendix2 = boost::lexical_cast(channel); + appendix2 = std::to_string(channel); } else { appendix2 = ""; } - aux = configuration->property("TelemetryDecoder_2S" + boost::lexical_cast(channel) + ".implementation", std::string("W")); + aux = configuration->property("TelemetryDecoder_2S" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix3; if (aux.compare("W") != 0) { - appendix3 = boost::lexical_cast(channel); + appendix3 = std::to_string(channel); } else { @@ -426,31 +437,31 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1B( std::string id = stream.str(); LOG(INFO) << "Instantiating Channel " << id << " with Acquisition Implementation: " << acq << ", Tracking Implementation: " << trk << ", Telemetry Decoder implementation: " << tlm; - std::string aux = configuration->property("Acquisition_1B" + boost::lexical_cast(channel) + ".implementation", std::string("W")); + std::string aux = configuration->property("Acquisition_1B" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix1; if (aux.compare("W") != 0) { - appendix1 = boost::lexical_cast(channel); + appendix1 = std::to_string(channel); } else { appendix1 = ""; } - aux = configuration->property("Tracking_1B" + boost::lexical_cast(channel) + ".implementation", std::string("W")); + aux = configuration->property("Tracking_1B" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix2; if (aux.compare("W") != 0) { - appendix2 = boost::lexical_cast(channel); + appendix2 = std::to_string(channel); } else { appendix2 = ""; } - aux = configuration->property("TelemetryDecoder_1B" + boost::lexical_cast(channel) + ".implementation", std::string("W")); + aux = configuration->property("TelemetryDecoder_1B" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix3; if (aux.compare("W") != 0) { - appendix3 = boost::lexical_cast(channel); + appendix3 = std::to_string(channel); } else { @@ -494,31 +505,31 @@ std::unique_ptr GNSSBlockFactory::GetChannel_5X( std::string id = stream.str(); LOG(INFO) << "Instantiating Channel " << id << " with Acquisition Implementation: " << acq << ", Tracking Implementation: " << trk << ", Telemetry Decoder implementation: " << tlm; - std::string aux = configuration->property("Acquisition_5X" + boost::lexical_cast(channel) + ".implementation", std::string("W")); + std::string aux = configuration->property("Acquisition_5X" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix1; if (aux.compare("W") != 0) { - appendix1 = boost::lexical_cast(channel); + appendix1 = std::to_string(channel); } else { appendix1 = ""; } - aux = configuration->property("Tracking_5X" + boost::lexical_cast(channel) + ".implementation", std::string("W")); + aux = configuration->property("Tracking_5X" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix2; if (aux.compare("W") != 0) { - appendix2 = boost::lexical_cast(channel); + appendix2 = std::to_string(channel); } else { appendix2 = ""; } - aux = configuration->property("TelemetryDecoder_5X" + boost::lexical_cast(channel) + ".implementation", std::string("W")); + aux = configuration->property("TelemetryDecoder_5X" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix3; if (aux.compare("W") != 0) { - appendix3 = boost::lexical_cast(channel); + appendix3 = std::to_string(channel); } else { @@ -563,31 +574,31 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1G( LOG(INFO) << "Instantiating Channel " << channel << " with Acquisition Implementation: " << acq << ", Tracking Implementation: " << trk << ", Telemetry Decoder Implementation: " << tlm; - std::string aux = configuration->property("Acquisition_1G" + boost::lexical_cast(channel) + ".implementation", std::string("W")); + std::string aux = configuration->property("Acquisition_1G" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix1; if (aux.compare("W") != 0) { - appendix1 = boost::lexical_cast(channel); + appendix1 = std::to_string(channel); } else { appendix1 = ""; } - aux = configuration->property("Tracking_1G" + boost::lexical_cast(channel) + ".implementation", std::string("W")); + aux = configuration->property("Tracking_1G" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix2; if (aux.compare("W") != 0) { - appendix2 = boost::lexical_cast(channel); + appendix2 = std::to_string(channel); } else { appendix2 = ""; } - aux = configuration->property("TelemetryDecoder_1G" + boost::lexical_cast(channel) + ".implementation", std::string("W")); + aux = configuration->property("TelemetryDecoder_1G" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix3; if (aux.compare("W") != 0) { - appendix3 = boost::lexical_cast(channel); + appendix3 = std::to_string(channel); } else { @@ -632,31 +643,31 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2G( LOG(INFO) << "Instantiating Channel " << channel << " with Acquisition Implementation: " << acq << ", Tracking Implementation: " << trk << ", Telemetry Decoder Implementation: " << tlm; - std::string aux = configuration->property("Acquisition_2G" + boost::lexical_cast(channel) + ".implementation", std::string("W")); + std::string aux = configuration->property("Acquisition_2G" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix1; if (aux.compare("W") != 0) { - appendix1 = boost::lexical_cast(channel); + appendix1 = std::to_string(channel); } else { appendix1 = ""; } - aux = configuration->property("Tracking_2G" + boost::lexical_cast(channel) + ".implementation", std::string("W")); + aux = configuration->property("Tracking_2G" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix2; if (aux.compare("W") != 0) { - appendix2 = boost::lexical_cast(channel); + appendix2 = std::to_string(channel); } else { appendix2 = ""; } - aux = configuration->property("TelemetryDecoder_2G" + boost::lexical_cast(channel) + ".implementation", std::string("W")); + aux = configuration->property("TelemetryDecoder_2G" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix3; if (aux.compare("W") != 0) { - appendix3 = boost::lexical_cast(channel); + appendix3 = std::to_string(channel); } else { @@ -700,31 +711,31 @@ std::unique_ptr GNSSBlockFactory::GetChannel_L5( std::string id = stream.str(); LOG(INFO) << "Instantiating Channel " << id << " with Acquisition Implementation: " << acq << ", Tracking Implementation: " << trk << ", Telemetry Decoder implementation: " << tlm; - std::string aux = configuration->property("Acquisition_L5" + boost::lexical_cast(channel) + ".implementation", std::string("W")); + std::string aux = configuration->property("Acquisition_L5" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix1; if (aux.compare("W") != 0) { - appendix1 = boost::lexical_cast(channel); + appendix1 = std::to_string(channel); } else { appendix1 = ""; } - aux = configuration->property("Tracking_L5" + boost::lexical_cast(channel) + ".implementation", std::string("W")); + aux = configuration->property("Tracking_L5" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix2; if (aux.compare("W") != 0) { - appendix2 = boost::lexical_cast(channel); + appendix2 = std::to_string(channel); } else { appendix2 = ""; } - aux = configuration->property("TelemetryDecoder_L5" + boost::lexical_cast(channel) + ".implementation", std::string("W")); + aux = configuration->property("TelemetryDecoder_L5" + std::to_string(channel) + ".implementation", std::string("W")); std::string appendix3; if (aux.compare("W") != 0) { - appendix3 = boost::lexical_cast(channel); + appendix3 = std::to_string(channel); } else { @@ -768,227 +779,233 @@ std::unique_ptr>> GNSSBlockFacto unsigned int channel_absolute_id = 0; unsigned int Channels_1C_count = configuration->property("Channels_1C.count", 0); - unsigned int Channels_2S_count = configuration->property("Channels_2S.count", 0); unsigned int Channels_1B_count = configuration->property("Channels_1B.count", 0); - unsigned int Channels_5X_count = configuration->property("Channels_5X.count", 0); unsigned int Channels_1G_count = configuration->property("Channels_1G.count", 0); unsigned int Channels_2G_count = configuration->property("Channels_2G.count", 0); + unsigned int Channels_2S_count = configuration->property("Channels_2S.count", 0); + unsigned int Channels_5X_count = configuration->property("Channels_5X.count", 0); unsigned int Channels_L5_count = configuration->property("Channels_L5.count", 0); unsigned int total_channels = Channels_1C_count + - Channels_2S_count + Channels_1B_count + - Channels_5X_count + Channels_1G_count + + Channels_2S_count + Channels_2G_count + + Channels_5X_count + Channels_L5_count; std::unique_ptr>> channels(new std::vector>(total_channels)); - - //**************** GPS L1 C/A CHANNELS ********************** - LOG(INFO) << "Getting " << Channels_1C_count << " GPS L1 C/A channels"; - acquisition_implementation = configuration->property("Acquisition_1C.implementation", default_implementation); - tracking_implementation = configuration->property("Tracking_1C.implementation", default_implementation); - telemetry_decoder_implementation = configuration->property("TelemetryDecoder_1C.implementation", default_implementation); - - for (unsigned int i = 0; i < Channels_1C_count; i++) + try { - //(i.e. Acquisition_1C0.implementation=xxxx) - std::string acquisition_implementation_specific = configuration->property( - "Acquisition_1C" + boost::lexical_cast(channel_absolute_id) + ".implementation", - acquisition_implementation); - //(i.e. Tracking_1C0.implementation=xxxx) - std::string tracking_implementation_specific = configuration->property( - "Tracking_1C" + boost::lexical_cast(channel_absolute_id) + ".implementation", - tracking_implementation); - std::string telemetry_decoder_implementation_specific = configuration->property( - "TelemetryDecoder_1C" + boost::lexical_cast(channel_absolute_id) + ".implementation", - telemetry_decoder_implementation); + //**************** GPS L1 C/A CHANNELS ********************** + LOG(INFO) << "Getting " << Channels_1C_count << " GPS L1 C/A channels"; + acquisition_implementation = configuration->property("Acquisition_1C.implementation", default_implementation); + tracking_implementation = configuration->property("Tracking_1C.implementation", default_implementation); + telemetry_decoder_implementation = configuration->property("TelemetryDecoder_1C.implementation", default_implementation); - // Push back the channel to the vector of channels - channels->at(channel_absolute_id) = std::move(GetChannel_1C(configuration, - acquisition_implementation_specific, - tracking_implementation_specific, - telemetry_decoder_implementation_specific, - channel_absolute_id, - queue)); - channel_absolute_id++; + for (unsigned int i = 0; i < Channels_1C_count; i++) + { + //(i.e. Acquisition_1C0.implementation=xxxx) + std::string acquisition_implementation_specific = configuration->property( + "Acquisition_1C" + std::to_string(channel_absolute_id) + ".implementation", + acquisition_implementation); + //(i.e. Tracking_1C0.implementation=xxxx) + std::string tracking_implementation_specific = configuration->property( + "Tracking_1C" + std::to_string(channel_absolute_id) + ".implementation", + tracking_implementation); + std::string telemetry_decoder_implementation_specific = configuration->property( + "TelemetryDecoder_1C" + std::to_string(channel_absolute_id) + ".implementation", + telemetry_decoder_implementation); + + // Push back the channel to the vector of channels + channels->at(channel_absolute_id) = std::move(GetChannel_1C(configuration, + acquisition_implementation_specific, + tracking_implementation_specific, + telemetry_decoder_implementation_specific, + channel_absolute_id, + queue)); + channel_absolute_id++; + } + + //**************** GPS L2C (M) CHANNELS ********************** + LOG(INFO) << "Getting " << Channels_2S_count << " GPS L2C (M) channels"; + tracking_implementation = configuration->property("Tracking_2S.implementation", default_implementation); + telemetry_decoder_implementation = configuration->property("TelemetryDecoder_2S.implementation", default_implementation); + acquisition_implementation = configuration->property("Acquisition_2S.implementation", default_implementation); + for (unsigned int i = 0; i < Channels_2S_count; i++) + { + //(i.e. Acquisition_1C0.implementation=xxxx) + std::string acquisition_implementation_specific = configuration->property( + "Acquisition_2S" + std::to_string(channel_absolute_id) + ".implementation", + acquisition_implementation); + //(i.e. Tracking_1C0.implementation=xxxx) + std::string tracking_implementation_specific = configuration->property( + "Tracking_2S" + std::to_string(channel_absolute_id) + ".implementation", + tracking_implementation); + std::string telemetry_decoder_implementation_specific = configuration->property( + "TelemetryDecoder_2S" + std::to_string(channel_absolute_id) + ".implementation", + telemetry_decoder_implementation); + + // Push back the channel to the vector of channels + channels->at(channel_absolute_id) = std::move(GetChannel_2S(configuration, + acquisition_implementation_specific, + tracking_implementation_specific, + telemetry_decoder_implementation_specific, + channel_absolute_id, + queue)); + channel_absolute_id++; + } + + //**************** GPS L5 CHANNELS ********************** + LOG(INFO) << "Getting " << Channels_L5_count << " GPS L5 channels"; + tracking_implementation = configuration->property("Tracking_L5.implementation", default_implementation); + telemetry_decoder_implementation = configuration->property("TelemetryDecoder_L5.implementation", default_implementation); + acquisition_implementation = configuration->property("Acquisition_L5.implementation", default_implementation); + for (unsigned int i = 0; i < Channels_L5_count; i++) + { + //(i.e. Acquisition_1C0.implementation=xxxx) + std::string acquisition_implementation_specific = configuration->property( + "Acquisition_L5" + std::to_string(channel_absolute_id) + ".implementation", + acquisition_implementation); + //(i.e. Tracking_1C0.implementation=xxxx) + std::string tracking_implementation_specific = configuration->property( + "Tracking_L5" + std::to_string(channel_absolute_id) + ".implementation", + tracking_implementation); + std::string telemetry_decoder_implementation_specific = configuration->property( + "TelemetryDecoder_L5" + std::to_string(channel_absolute_id) + ".implementation", + telemetry_decoder_implementation); + + // Push back the channel to the vector of channels + channels->at(channel_absolute_id) = std::move(GetChannel_L5(configuration, + acquisition_implementation_specific, + tracking_implementation_specific, + telemetry_decoder_implementation_specific, + channel_absolute_id, + queue)); + channel_absolute_id++; + } + + //**************** GALILEO E1 B (I/NAV OS) CHANNELS ********************** + LOG(INFO) << "Getting " << Channels_1B_count << " GALILEO E1 B (I/NAV OS) channels"; + tracking_implementation = configuration->property("Tracking_1B.implementation", default_implementation); + telemetry_decoder_implementation = configuration->property("TelemetryDecoder_1B.implementation", default_implementation); + acquisition_implementation = configuration->property("Acquisition_1B.implementation", default_implementation); + for (unsigned int i = 0; i < Channels_1B_count; i++) + { + //(i.e. Acquisition_1C0.implementation=xxxx) + std::string acquisition_implementation_specific = configuration->property( + "Acquisition_1B" + std::to_string(channel_absolute_id) + ".implementation", + acquisition_implementation); + //(i.e. Tracking_1C0.implementation=xxxx) + std::string tracking_implementation_specific = configuration->property( + "Tracking_1B" + std::to_string(channel_absolute_id) + ".implementation", + tracking_implementation); + std::string telemetry_decoder_implementation_specific = configuration->property( + "TelemetryDecoder_1B" + std::to_string(channel_absolute_id) + ".implementation", + telemetry_decoder_implementation); + + // Push back the channel to the vector of channels + channels->at(channel_absolute_id) = std::move(GetChannel_1B(configuration, + acquisition_implementation_specific, + tracking_implementation_specific, + telemetry_decoder_implementation_specific, + channel_absolute_id, + queue)); + channel_absolute_id++; + } + + //**************** GALILEO E5a I (F/NAV OS) CHANNELS ********************** + LOG(INFO) << "Getting " << Channels_5X_count << " GALILEO E5a I (F/NAV OS) channels"; + tracking_implementation = configuration->property("Tracking_5X.implementation", default_implementation); + telemetry_decoder_implementation = configuration->property("TelemetryDecoder_5X.implementation", default_implementation); + acquisition_implementation = configuration->property("Acquisition_5X.implementation", default_implementation); + for (unsigned int i = 0; i < Channels_5X_count; i++) + { + //(i.e. Acquisition_1C0.implementation=xxxx) + std::string acquisition_implementation_specific = configuration->property( + "Acquisition_5X" + std::to_string(channel_absolute_id) + ".implementation", + acquisition_implementation); + //(i.e. Tracking_1C0.implementation=xxxx) + std::string tracking_implementation_specific = configuration->property( + "Tracking_5X" + std::to_string(channel_absolute_id) + ".implementation", + tracking_implementation); + std::string telemetry_decoder_implementation_specific = configuration->property( + "TelemetryDecoder_5X" + std::to_string(channel_absolute_id) + ".implementation", + telemetry_decoder_implementation); + + // Push back the channel to the vector of channels + channels->at(channel_absolute_id) = std::move(GetChannel_5X(configuration, + acquisition_implementation_specific, + tracking_implementation_specific, + telemetry_decoder_implementation_specific, + channel_absolute_id, + queue)); + channel_absolute_id++; + } + + //**************** GLONASS L1 C/A CHANNELS ********************** + LOG(INFO) << "Getting " << Channels_1G_count << " GLONASS L1 C/A channels"; + acquisition_implementation = configuration->property("Acquisition_1G.implementation", default_implementation); + tracking_implementation = configuration->property("Tracking_1G.implementation", default_implementation); + telemetry_decoder_implementation = configuration->property("TelemetryDecoder_1G.implementation", default_implementation); + + for (unsigned int i = 0; i < Channels_1G_count; i++) + { + //(i.e. Acquisition_1G0.implementation=xxxx) + std::string acquisition_implementation_specific = configuration->property( + "Acquisition_1G" + std::to_string(channel_absolute_id) + ".implementation", + acquisition_implementation); + //(i.e. Tracking_1G0.implementation=xxxx) + std::string tracking_implementation_specific = configuration->property( + "Tracking_1G" + std::to_string(channel_absolute_id) + ".implementation", + tracking_implementation); + std::string telemetry_decoder_implementation_specific = configuration->property( + "TelemetryDecoder_1G" + std::to_string(channel_absolute_id) + ".implementation", + telemetry_decoder_implementation); + + // Push back the channel to the vector of channels + channels->at(channel_absolute_id) = std::move(GetChannel_1G(configuration, + acquisition_implementation_specific, + tracking_implementation_specific, + telemetry_decoder_implementation_specific, + channel_absolute_id, + queue)); + channel_absolute_id++; + } + + //**************** GLONASS L2 C/A CHANNELS ********************** + LOG(INFO) << "Getting " << Channels_2G_count << " GLONASS L2 C/A channels"; + acquisition_implementation = configuration->property("Acquisition_2G.implementation", default_implementation); + tracking_implementation = configuration->property("Tracking_2G.implementation", default_implementation); + telemetry_decoder_implementation = configuration->property("TelemetryDecoder_2G.implementation", default_implementation); + + for (unsigned int i = 0; i < Channels_2G_count; i++) + { + //(i.e. Acquisition_2G0.implementation=xxxx) + std::string acquisition_implementation_specific = configuration->property( + "Acquisition_2G" + std::to_string(channel_absolute_id) + ".implementation", + acquisition_implementation); + //(i.e. Tracking_2G0.implementation=xxxx) + std::string tracking_implementation_specific = configuration->property( + "Tracking_2G" + std::to_string(channel_absolute_id) + ".implementation", + tracking_implementation); + std::string telemetry_decoder_implementation_specific = configuration->property( + "TelemetryDecoder_2G" + std::to_string(channel_absolute_id) + ".implementation", + telemetry_decoder_implementation); + + // Push back the channel to the vector of channels + channels->at(channel_absolute_id) = std::move(GetChannel_2G(configuration, + acquisition_implementation_specific, + tracking_implementation_specific, + telemetry_decoder_implementation_specific, + channel_absolute_id, + queue)); + channel_absolute_id++; + } } - - //**************** GPS L2C (M) CHANNELS ********************** - LOG(INFO) << "Getting " << Channels_2S_count << " GPS L2C (M) channels"; - tracking_implementation = configuration->property("Tracking_2S.implementation", default_implementation); - telemetry_decoder_implementation = configuration->property("TelemetryDecoder_2S.implementation", default_implementation); - acquisition_implementation = configuration->property("Acquisition_2S.implementation", default_implementation); - for (unsigned int i = 0; i < Channels_2S_count; i++) + catch (const std::exception &e) { - //(i.e. Acquisition_1C0.implementation=xxxx) - std::string acquisition_implementation_specific = configuration->property( - "Acquisition_2S" + boost::lexical_cast(channel_absolute_id) + ".implementation", - acquisition_implementation); - //(i.e. Tracking_1C0.implementation=xxxx) - std::string tracking_implementation_specific = configuration->property( - "Tracking_2S" + boost::lexical_cast(channel_absolute_id) + ".implementation", - tracking_implementation); - std::string telemetry_decoder_implementation_specific = configuration->property( - "TelemetryDecoder_2S" + boost::lexical_cast(channel_absolute_id) + ".implementation", - telemetry_decoder_implementation); - - // Push back the channel to the vector of channels - channels->at(channel_absolute_id) = std::move(GetChannel_2S(configuration, - acquisition_implementation_specific, - tracking_implementation_specific, - telemetry_decoder_implementation_specific, - channel_absolute_id, - queue)); - channel_absolute_id++; - } - - //**************** GPS L5 CHANNELS ********************** - LOG(INFO) << "Getting " << Channels_L5_count << " GPS L5 channels"; - tracking_implementation = configuration->property("Tracking_L5.implementation", default_implementation); - telemetry_decoder_implementation = configuration->property("TelemetryDecoder_L5.implementation", default_implementation); - acquisition_implementation = configuration->property("Acquisition_L5.implementation", default_implementation); - for (unsigned int i = 0; i < Channels_L5_count; i++) - { - //(i.e. Acquisition_1C0.implementation=xxxx) - std::string acquisition_implementation_specific = configuration->property( - "Acquisition_L5" + boost::lexical_cast(channel_absolute_id) + ".implementation", - acquisition_implementation); - //(i.e. Tracking_1C0.implementation=xxxx) - std::string tracking_implementation_specific = configuration->property( - "Tracking_L5" + boost::lexical_cast(channel_absolute_id) + ".implementation", - tracking_implementation); - std::string telemetry_decoder_implementation_specific = configuration->property( - "TelemetryDecoder_L5" + boost::lexical_cast(channel_absolute_id) + ".implementation", - telemetry_decoder_implementation); - - // Push back the channel to the vector of channels - channels->at(channel_absolute_id) = std::move(GetChannel_L5(configuration, - acquisition_implementation_specific, - tracking_implementation_specific, - telemetry_decoder_implementation_specific, - channel_absolute_id, - queue)); - channel_absolute_id++; - } - - //**************** GALILEO E1 B (I/NAV OS) CHANNELS ********************** - LOG(INFO) << "Getting " << Channels_1B_count << " GALILEO E1 B (I/NAV OS) channels"; - tracking_implementation = configuration->property("Tracking_1B.implementation", default_implementation); - telemetry_decoder_implementation = configuration->property("TelemetryDecoder_1B.implementation", default_implementation); - acquisition_implementation = configuration->property("Acquisition_1B.implementation", default_implementation); - for (unsigned int i = 0; i < Channels_1B_count; i++) - { - //(i.e. Acquisition_1C0.implementation=xxxx) - std::string acquisition_implementation_specific = configuration->property( - "Acquisition_1B" + boost::lexical_cast(channel_absolute_id) + ".implementation", - acquisition_implementation); - //(i.e. Tracking_1C0.implementation=xxxx) - std::string tracking_implementation_specific = configuration->property( - "Tracking_1B" + boost::lexical_cast(channel_absolute_id) + ".implementation", - tracking_implementation); - std::string telemetry_decoder_implementation_specific = configuration->property( - "TelemetryDecoder_1B" + boost::lexical_cast(channel_absolute_id) + ".implementation", - telemetry_decoder_implementation); - - // Push back the channel to the vector of channels - channels->at(channel_absolute_id) = std::move(GetChannel_1B(configuration, - acquisition_implementation_specific, - tracking_implementation_specific, - telemetry_decoder_implementation_specific, - channel_absolute_id, - queue)); - channel_absolute_id++; - } - - //**************** GALILEO E5a I (F/NAV OS) CHANNELS ********************** - LOG(INFO) << "Getting " << Channels_5X_count << " GALILEO E5a I (F/NAV OS) channels"; - tracking_implementation = configuration->property("Tracking_5X.implementation", default_implementation); - telemetry_decoder_implementation = configuration->property("TelemetryDecoder_5X.implementation", default_implementation); - acquisition_implementation = configuration->property("Acquisition_5X.implementation", default_implementation); - for (unsigned int i = 0; i < Channels_5X_count; i++) - { - //(i.e. Acquisition_1C0.implementation=xxxx) - std::string acquisition_implementation_specific = configuration->property( - "Acquisition_5X" + boost::lexical_cast(channel_absolute_id) + ".implementation", - acquisition_implementation); - //(i.e. Tracking_1C0.implementation=xxxx) - std::string tracking_implementation_specific = configuration->property( - "Tracking_5X" + boost::lexical_cast(channel_absolute_id) + ".implementation", - tracking_implementation); - std::string telemetry_decoder_implementation_specific = configuration->property( - "TelemetryDecoder_5X" + boost::lexical_cast(channel_absolute_id) + ".implementation", - telemetry_decoder_implementation); - - // Push back the channel to the vector of channels - channels->at(channel_absolute_id) = std::move(GetChannel_5X(configuration, - acquisition_implementation_specific, - tracking_implementation_specific, - telemetry_decoder_implementation_specific, - channel_absolute_id, - queue)); - channel_absolute_id++; - } - - //**************** GLONASS L1 C/A CHANNELS ********************** - LOG(INFO) << "Getting " << Channels_1G_count << " GLONASS L1 C/A channels"; - acquisition_implementation = configuration->property("Acquisition_1G.implementation", default_implementation); - tracking_implementation = configuration->property("Tracking_1G.implementation", default_implementation); - telemetry_decoder_implementation = configuration->property("TelemetryDecoder_1G.implementation", default_implementation); - - for (unsigned int i = 0; i < Channels_1G_count; i++) - { - //(i.e. Acquisition_1G0.implementation=xxxx) - std::string acquisition_implementation_specific = configuration->property( - "Acquisition_1G" + boost::lexical_cast(channel_absolute_id) + ".implementation", - acquisition_implementation); - //(i.e. Tracking_1G0.implementation=xxxx) - std::string tracking_implementation_specific = configuration->property( - "Tracking_1G" + boost::lexical_cast(channel_absolute_id) + ".implementation", - tracking_implementation); - std::string telemetry_decoder_implementation_specific = configuration->property( - "TelemetryDecoder_1G" + boost::lexical_cast(channel_absolute_id) + ".implementation", - telemetry_decoder_implementation); - - // Push back the channel to the vector of channels - channels->at(channel_absolute_id) = std::move(GetChannel_1G(configuration, - acquisition_implementation_specific, - tracking_implementation_specific, - telemetry_decoder_implementation_specific, - channel_absolute_id, - queue)); - channel_absolute_id++; - } - - //**************** GLONASS L2 C/A CHANNELS ********************** - LOG(INFO) << "Getting " << Channels_2G_count << " GLONASS L2 C/A channels"; - acquisition_implementation = configuration->property("Acquisition_2G.implementation", default_implementation); - tracking_implementation = configuration->property("Tracking_2G.implementation", default_implementation); - telemetry_decoder_implementation = configuration->property("TelemetryDecoder_2G.implementation", default_implementation); - - for (unsigned int i = 0; i < Channels_2G_count; i++) - { - //(i.e. Acquisition_2G0.implementation=xxxx) - std::string acquisition_implementation_specific = configuration->property( - "Acquisition_2G" + boost::lexical_cast(channel_absolute_id) + ".implementation", - acquisition_implementation); - //(i.e. Tracking_2G0.implementation=xxxx) - std::string tracking_implementation_specific = configuration->property( - "Tracking_2G" + boost::lexical_cast(channel_absolute_id) + ".implementation", - tracking_implementation); - std::string telemetry_decoder_implementation_specific = configuration->property( - "TelemetryDecoder_2G" + boost::lexical_cast(channel_absolute_id) + ".implementation", - telemetry_decoder_implementation); - - // Push back the channel to the vector of channels - channels->at(channel_absolute_id) = std::move(GetChannel_2G(configuration, - acquisition_implementation_specific, - tracking_implementation_specific, - telemetry_decoder_implementation_specific, - channel_absolute_id, - queue)); - channel_absolute_id++; + LOG(WARNING) << e.what(); } return channels; diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index 17cb2205a..c12c126ae 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -310,7 +310,6 @@ void GNSSFlowgraph::connect() return; } } - #else // connect the signal source to sample counter // connect the sample counter to Observables @@ -341,7 +340,14 @@ void GNSSFlowgraph::connect() { if (FPGA_enabled == false) { - selected_signal_conditioner_ID = configuration_->property("Channel" + std::to_string(i) + ".RF_channel_ID", 0); + try + { + selected_signal_conditioner_ID = configuration_->property("Channel" + std::to_string(i) + ".RF_channel_ID", 0); + } + catch (const std::exception& e) + { + LOG(WARNING) << e.what(); + } try { top_block_->connect(sig_conditioner_.at(selected_signal_conditioner_ID)->get_right_block(), 0, @@ -376,7 +382,15 @@ void GNSSFlowgraph::connect() std::vector vector_of_channels; for (unsigned int i = 0; i < channels_count_; i++) { - unsigned int sat = configuration_->property("Channel" + std::to_string(i) + ".satellite", 0); + unsigned int sat = 0; + try + { + sat = configuration_->property("Channel" + std::to_string(i) + ".satellite", 0); + } + catch (const std::exception& e) + { + LOG(WARNING) << e.what(); + } if (sat == 0) { vector_of_channels.push_back(i); @@ -392,7 +406,15 @@ void GNSSFlowgraph::connect() for (unsigned int& i : vector_of_channels) { std::string gnss_signal = channels_.at(i)->get_signal().get_signal_str(); // use channel's implicit signal - unsigned int sat = configuration_->property("Channel" + std::to_string(i) + ".satellite", 0); + unsigned int sat = 0; + try + { + sat = configuration_->property("Channel" + std::to_string(i) + ".satellite", 0); + } + catch (const std::exception& e) + { + LOG(WARNING) << e.what(); + } if (sat == 0) { channels_.at(i)->set_signal(search_next_signal(gnss_signal, true)); @@ -459,7 +481,7 @@ void GNSSFlowgraph::disconnect() LOG(INFO) << "flowgraph was not connected"; return; } - + connected_ = false; // Signal Source (i) > Signal conditioner (i) > int RF_Channels = 0; int signal_conditioner_ID = 0; @@ -511,24 +533,77 @@ void GNSSFlowgraph::disconnect() catch (const std::exception& e) { LOG(INFO) << "Can't disconnect signal source " << i << " to signal conditioner " << i << ": " << e.what(); + top_block_->disconnect_all(); + return; } } + bool FPGA_enabled = configuration_->property(sig_source_.at(0)->role() + ".enable_FPGA", false); + +#if ENABLE_FPGA + if (FPGA_enabled == false) + { + // disconnect the signal source to sample counter + // disconnect the sample counter to Observables + try + { + top_block_->disconnect(sig_conditioner_.at(0)->get_right_block(), 0, ch_out_sample_counter, 0); + top_block_->disconnect(ch_out_sample_counter, 0, observables_->get_left_block(), channels_count_); // extra port for the sample counter pulse + } + catch (const std::exception& e) + { + LOG(WARNING) << "Can't disconnect sample counter"; + LOG(ERROR) << e.what(); + top_block_->disconnect_all(); + return; + } + } + else + { + try + { + top_block_->disconnect(null_source_, 0, throttle_, 0); + top_block_->disconnect(throttle_, 0, time_counter_, 0); + top_block_->disconnect(time_counter_, 0, observables_->get_left_block(), channels_count_); + } + catch (const std::exception& e) + { + LOG(WARNING) << "Can't connect sample counter"; + LOG(ERROR) << e.what(); + top_block_->disconnect_all(); + return; + } + } +#else + // disconnect the signal source to sample counter + // disconnect the sample counter to Observables try { top_block_->disconnect(sig_conditioner_.at(0)->get_right_block(), 0, ch_out_sample_counter, 0); - top_block_->disconnect(ch_out_sample_counter, 0, observables_->get_left_block(), channels_count_); //extra port for the sample counter pulse + top_block_->disconnect(ch_out_sample_counter, 0, observables_->get_left_block(), channels_count_); // extra port for the sample counter pulse } catch (const std::exception& e) { - LOG(INFO) << "Can't disconnect sample counter: " << e.what(); + LOG(WARNING) << "Can't connect sample counter"; + LOG(ERROR) << e.what(); + top_block_->disconnect_all(); + return; } - +#endif // Signal conditioner (selected_signal_source) >> channels (i) (dependent of their associated SignalSource_ID) int selected_signal_conditioner_ID; for (unsigned int i = 0; i < channels_count_; i++) { - selected_signal_conditioner_ID = configuration_->property("Channel" + std::to_string(i) + ".RF_channel_ID", 0); + try + { + selected_signal_conditioner_ID = configuration_->property("Channel" + std::to_string(i) + ".RF_channel_ID", 0); + } + catch (const std::exception& e) + { + LOG(WARNING) << e.what(); + top_block_->disconnect_all(); + return; + } try { top_block_->disconnect(sig_conditioner_.at(selected_signal_conditioner_ID)->get_right_block(), 0, @@ -537,6 +612,8 @@ void GNSSFlowgraph::disconnect() catch (const std::exception& e) { LOG(INFO) << "Can't disconnect signal conditioner " << selected_signal_conditioner_ID << " to channel " << i << ": " << e.what(); + top_block_->disconnect_all(); + return; } // Signal Source > Signal conditioner >> Channels >> Observables @@ -548,6 +625,8 @@ void GNSSFlowgraph::disconnect() catch (const std::exception& e) { LOG(INFO) << "Can't disconnect channel " << i << " to observables: " << e.what(); + top_block_->disconnect_all(); + return; } } @@ -562,6 +641,8 @@ void GNSSFlowgraph::disconnect() catch (const std::exception& e) { LOG(INFO) << "Can't disconnect observables to PVT: " << e.what(); + top_block_->disconnect_all(); + return; } for (int i = 0; i < sources_count_; i++) @@ -573,6 +654,8 @@ void GNSSFlowgraph::disconnect() catch (const std::exception& e) { LOG(INFO) << "Can't disconnect signal source block " << i << " internally: " << e.what(); + top_block_->disconnect_all(); + return; } } @@ -586,6 +669,8 @@ void GNSSFlowgraph::disconnect() catch (const std::exception& e) { LOG(INFO) << "Can't disconnect signal conditioner block " << i << " internally: " << e.what(); + top_block_->disconnect_all(); + return; } } @@ -598,6 +683,8 @@ void GNSSFlowgraph::disconnect() catch (const std::exception& e) { LOG(INFO) << "Can't disconnect channel " << i << " internally: " << e.what(); + top_block_->disconnect_all(); + return; } } @@ -608,6 +695,8 @@ void GNSSFlowgraph::disconnect() catch (const std::exception& e) { LOG(INFO) << "Can't disconnect observables block internally: " << e.what(); + top_block_->disconnect_all(); + return; } // Signal Source > Signal conditioner >> Channels >> Observables > PVT @@ -618,11 +707,11 @@ void GNSSFlowgraph::disconnect() catch (const std::exception& e) { LOG(INFO) << "Can't disconnect PVT block internally: " << e.what(); + top_block_->disconnect_all(); + return; } DLOG(INFO) << "blocks disconnected internally"; - - connected_ = false; LOG(INFO) << "Flowgraph disconnected"; } @@ -658,7 +747,15 @@ bool GNSSFlowgraph::send_telemetry_msg(pmt::pmt_t msg) void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) { DLOG(INFO) << "Received " << what << " from " << who << ". Number of applied actions = " << applied_actions_; - unsigned int sat = configuration_->property("Channel" + boost::lexical_cast(who) + ".satellite", 0); + unsigned int sat = 0; + try + { + sat = configuration_->property("Channel" + std::to_string(who) + ".satellite", 0); + } + catch (const std::exception& e) + { + LOG(WARNING) << e.what(); + } switch (what) { case 0: @@ -679,7 +776,15 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) acq_channels_count_--; for (unsigned int i = 0; i < channels_count_; i++) { - unsigned int sat_ = configuration_->property("Channel" + std::to_string(i) + ".satellite", 0); + unsigned int sat_ = 0; + try + { + sat_ = configuration_->property("Channel" + std::to_string(i) + ".satellite", 0); + } + catch (const std::exception& e) + { + LOG(WARNING) << e.what(); + } if (!available_GNSS_signals_.empty() && (acq_channels_count_ < max_acq_channels_) && (channels_state_[i] == 0)) { channels_state_[i] = 1; @@ -828,7 +933,7 @@ void GNSSFlowgraph::init() std::cout << "Please update your configuration file." << std::endl; } - std::shared_ptr > > channels = block_factory_->GetChannels(configuration_, queue_); + std::shared_ptr>> channels = block_factory_->GetChannels(configuration_, queue_); channels_count_ = channels->size(); for (unsigned int i = 0; i < channels_count_; i++) From 813b2a9d04073803eeca28a0586e5d5203641194 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 4 May 2018 13:39:45 +0200 Subject: [PATCH 73/82] Fix bug in GPS L5 and Galileo E5a decoding --- .../galileo_e5a_telemetry_decoder_cc.cc | 53 +++++++++---------- .../gnuradio_blocks/dll_pll_veml_tracking.cc | 9 ++-- 2 files changed, 29 insertions(+), 33 deletions(-) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.cc index 647647698..41bf44833 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.cc @@ -81,7 +81,6 @@ void galileo_e5a_telemetry_decoder_cc::decode_word(double *page_symbols, int fra { double page_symbols_deint[frame_length]; // 1. De-interleave - deinterleaver(GALILEO_FNAV_INTERLEAVER_ROWS, GALILEO_FNAV_INTERLEAVER_COLS, page_symbols, page_symbols_deint); // 2. Viterbi decoder @@ -116,7 +115,6 @@ void galileo_e5a_telemetry_decoder_cc::decode_word(double *page_symbols, int fra if (d_nav.flag_CRC_test == true) { LOG(INFO) << "Galileo E5a CRC correct in channel " << d_channel << " from satellite " << d_satellite; - //std::cout << "Galileo E5a CRC correct on channel " << d_channel << " from satellite " << d_satellite << std::endl; } else { @@ -191,19 +189,19 @@ galileo_e5a_telemetry_decoder_cc::galileo_e5a_telemetry_decoder_cc( delta_t = 0.0; d_symbol_counter = 0; d_prompt_acum = 0.0; - flag_bit_start = false; + flag_bit_start = true; new_symbol = false; required_symbols = GALILEO_FNAV_SYMBOLS_PER_PAGE + GALILEO_FNAV_PREAMBLE_LENGTH_BITS; // vars for Viterbi decoder - int max_states = 1 << mm; /* 2^mm */ - g_encoder[0] = 121; // Polynomial G1 - g_encoder[1] = 91; // Polynomial G2 + int max_states = 1 << mm; // 2^mm + g_encoder[0] = 121; // Polynomial G1 + g_encoder[1] = 91; // Polynomial G2 out0 = static_cast(volk_gnsssdr_malloc(max_states * sizeof(int), volk_gnsssdr_get_alignment())); out1 = static_cast(volk_gnsssdr_malloc(max_states * sizeof(int), volk_gnsssdr_get_alignment())); state0 = static_cast(volk_gnsssdr_malloc(max_states * sizeof(int), volk_gnsssdr_get_alignment())); state1 = static_cast(volk_gnsssdr_malloc(max_states * sizeof(int), volk_gnsssdr_get_alignment())); - /* create appropriate transition matrices */ + // create appropriate transition matrices nsc_transit(out0, state0, 0, g_encoder, KK, nn); nsc_transit(out1, state1, 1, g_encoder, KK, nn); } @@ -241,7 +239,7 @@ void galileo_e5a_telemetry_decoder_cc::set_channel(int channel) { d_channel = channel; LOG(INFO) << "Navigation channel set to " << channel; - // ############# ENABLE DATA FILE LOG ################# + // Enable data file logging if (d_dump == true) { if (d_dump_file.is_open() == false) @@ -272,7 +270,7 @@ int galileo_e5a_telemetry_decoder_cc::general_work(int noutput_items __attribute Gnss_Synchro *out = reinterpret_cast(output_items[0]); // Get the output buffer pointer const Gnss_Synchro *in = reinterpret_cast(input_items[0]); // Get the input buffer pointer - //1. Copy the current tracking output + // 1. Copy the current tracking output Gnss_Synchro current_sample = in[0]; d_symbol_counter++; if (flag_bit_start) @@ -281,7 +279,7 @@ int galileo_e5a_telemetry_decoder_cc::general_work(int noutput_items __attribute if (d_symbol_counter == GALILEO_FNAV_CODES_PER_SYMBOL) { current_sample.Prompt_I = d_prompt_acum / static_cast(GALILEO_FNAV_CODES_PER_SYMBOL); - d_symbol_history.push_back(current_sample); //add new symbol to the symbol queue + d_symbol_history.push_back(current_sample); // add new symbol to the symbol queue d_prompt_acum = 0.0; d_symbol_counter = 0; new_symbol = true; @@ -323,14 +321,14 @@ int galileo_e5a_telemetry_decoder_cc::general_work(int noutput_items __attribute } } } - d_sample_counter++; //count for the processed samples + d_sample_counter++; // count for the processed samples consume_each(1); d_flag_preamble = false; if ((d_symbol_history.size() > required_symbols) && new_symbol) { - //******* preamble correlation ******** + // ****************** Preamble orrelation ****************** corr_value = 0; for (int i = 0; i < GALILEO_FNAV_PREAMBLE_LENGTH_BITS; i++) { @@ -344,13 +342,12 @@ int galileo_e5a_telemetry_decoder_cc::general_work(int noutput_items __attribute } } } - - //******* frame sync ****************** - if ((d_stat == 0) && new_symbol) //no preamble information + // ****************** Frame sync ****************** + if ((d_stat == 0) && new_symbol) // no preamble information { if (abs(corr_value) >= GALILEO_FNAV_PREAMBLE_LENGTH_BITS) { - d_preamble_index = d_sample_counter; //record the preamble sample stamp + d_preamble_index = d_sample_counter; // record the preamble sample stamp LOG(INFO) << "Preamble detection for Galileo E5a satellite " << d_satellite; d_stat = 1; // enter into frame pre-detection status } @@ -359,13 +356,13 @@ int galileo_e5a_telemetry_decoder_cc::general_work(int noutput_items __attribute { if (abs(corr_value) >= GALILEO_FNAV_PREAMBLE_LENGTH_BITS) { - //check preamble separation + // check preamble separation preamble_diff = d_sample_counter - d_preamble_index; if (preamble_diff == GALILEO_FNAV_CODES_PER_PAGE) { - //try to decode frame + // try to decode frame LOG(INFO) << "Starting page decoder for Galileo E5a satellite " << d_satellite; - d_preamble_index = d_sample_counter; //record the preamble sample stamp + d_preamble_index = d_sample_counter; // record the preamble sample stamp d_stat = 2; } else if (preamble_diff > GALILEO_FNAV_CODES_PER_PAGE) @@ -397,13 +394,13 @@ int galileo_e5a_telemetry_decoder_cc::general_work(int noutput_items __attribute page_symbols[i] = corr_sign * d_symbol_history.at(i + GALILEO_FNAV_PREAMBLE_LENGTH_BITS).Prompt_I; // because last symbol of the preamble is just received now! } - //call the decoder + // call the decoder decode_word(page_symbols, frame_length); if (d_nav.flag_CRC_test == true) { d_CRC_error_counter = 0; - d_flag_preamble = true; //valid preamble indicator (initialized to false every work()) - d_preamble_index = d_sample_counter; //record the preamble sample stamp (t_P) + d_flag_preamble = true; // valid preamble indicator (initialized to false every work()) + d_preamble_index = d_sample_counter; // record the preamble sample stamp (t_P) if (!d_flag_frame_sync) { d_flag_frame_sync = true; @@ -414,7 +411,7 @@ int galileo_e5a_telemetry_decoder_cc::general_work(int noutput_items __attribute else { d_CRC_error_counter++; - d_preamble_index = d_sample_counter; //record the preamble sample stamp + d_preamble_index = d_sample_counter; // record the preamble sample stamp if (d_CRC_error_counter > GALILEO_E5A_CRC_ERROR_LIMIT) { LOG(INFO) << "Lost of frame sync SAT " << this->d_satellite; @@ -428,10 +425,10 @@ int galileo_e5a_telemetry_decoder_cc::general_work(int noutput_items __attribute new_symbol = false; // UPDATE GNSS SYNCHRO DATA - //Add the telemetry decoder information + // Add the telemetry decoder information if (d_flag_preamble and d_nav.flag_TOW_set) - //update TOW at the preamble instant - //We expect a preamble each 10 seconds (FNAV page period) + // update TOW at the preamble instant + // We expect a preamble each 10 seconds (FNAV page period) { if (d_nav.flag_TOW_1 == true) { @@ -458,7 +455,7 @@ int galileo_e5a_telemetry_decoder_cc::general_work(int noutput_items __attribute d_TOW_at_current_symbol += GALILEO_E5a_CODE_PERIOD; } } - else //if there is not a new preamble, we define the TOW of the current symbol + else // if there is not a new preamble, we define the TOW of the current symbol { d_TOW_at_current_symbol += GALILEO_E5a_CODE_PERIOD; } @@ -499,7 +496,7 @@ int galileo_e5a_telemetry_decoder_cc::general_work(int noutput_items __attribute { d_symbol_history.pop_front(); } - //3. Make the output + // 3. Make the output if (current_sample.Flag_valid_word) { out[0] = current_sample; diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index 515e21ada..372aec4ff 100755 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -144,21 +144,20 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(dllpllconf_t conf_) : gr::block("dl d_correlation_length_ms = 1; d_code_samples_per_chip = 1; d_code_length_chips = static_cast(GPS_L5i_CODE_LENGTH_CHIPS); - // GPS L5 does not have pilot secondary code d_secondary = true; - interchange_iq = false; if (trk_parameters.track_pilot) { d_secondary_code_length = static_cast(GPS_L5q_NH_CODE_LENGTH); d_secondary_code_string = const_cast(&GPS_L5q_NH_CODE_STR); signal_pretty_name = signal_pretty_name + "Q"; - //interchange_iq = true; + interchange_iq = true; } else { d_secondary_code_length = static_cast(GPS_L5i_NH_CODE_LENGTH); d_secondary_code_string = const_cast(&GPS_L5i_NH_CODE_STR); signal_pretty_name = signal_pretty_name + "I"; + interchange_iq = false; } } else @@ -212,18 +211,18 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(dllpllconf_t conf_) : gr::block("dl d_code_samples_per_chip = 1; d_code_length_chips = static_cast(Galileo_E5a_CODE_LENGTH_CHIPS); d_secondary = true; - interchange_iq = false; if (trk_parameters.track_pilot) { d_secondary_code_length = static_cast(Galileo_E5a_Q_SECONDARY_CODE_LENGTH); signal_pretty_name = signal_pretty_name + "Q"; - // interchange_iq = true; + interchange_iq = true; } else { d_secondary_code_length = static_cast(Galileo_E5a_I_SECONDARY_CODE_LENGTH); d_secondary_code_string = const_cast(&Galileo_E5a_I_SECONDARY_CODE); signal_pretty_name = signal_pretty_name + "I"; + interchange_iq = false; } } else From 62198abdf4fe923983d49b52ec3eb000c686935b Mon Sep 17 00:00:00 2001 From: zosoworld Date: Fri, 4 May 2018 19:04:09 +0200 Subject: [PATCH 74/82] Fixed rtl_tcp signal source deadlock --- .../rtl_tcp_signal_source_c.cc | 2 + .../galileo_e5a_telemetry_decoder_cc.cc | 53 +++++++++---------- .../gnuradio_blocks/dll_pll_veml_tracking.cc | 9 ++-- 3 files changed, 31 insertions(+), 33 deletions(-) diff --git a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc index 4ec4420ce..2207e6d88 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc @@ -154,7 +154,9 @@ rtl_tcp_signal_source_c::rtl_tcp_signal_source_c(const std::string &address, rtl_tcp_signal_source_c::~rtl_tcp_signal_source_c() { + boost::mutex::scoped_lock lock(mutex_); io_service_.stop(); + not_empty_.notify_one(); } diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.cc index 647647698..41bf44833 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.cc @@ -81,7 +81,6 @@ void galileo_e5a_telemetry_decoder_cc::decode_word(double *page_symbols, int fra { double page_symbols_deint[frame_length]; // 1. De-interleave - deinterleaver(GALILEO_FNAV_INTERLEAVER_ROWS, GALILEO_FNAV_INTERLEAVER_COLS, page_symbols, page_symbols_deint); // 2. Viterbi decoder @@ -116,7 +115,6 @@ void galileo_e5a_telemetry_decoder_cc::decode_word(double *page_symbols, int fra if (d_nav.flag_CRC_test == true) { LOG(INFO) << "Galileo E5a CRC correct in channel " << d_channel << " from satellite " << d_satellite; - //std::cout << "Galileo E5a CRC correct on channel " << d_channel << " from satellite " << d_satellite << std::endl; } else { @@ -191,19 +189,19 @@ galileo_e5a_telemetry_decoder_cc::galileo_e5a_telemetry_decoder_cc( delta_t = 0.0; d_symbol_counter = 0; d_prompt_acum = 0.0; - flag_bit_start = false; + flag_bit_start = true; new_symbol = false; required_symbols = GALILEO_FNAV_SYMBOLS_PER_PAGE + GALILEO_FNAV_PREAMBLE_LENGTH_BITS; // vars for Viterbi decoder - int max_states = 1 << mm; /* 2^mm */ - g_encoder[0] = 121; // Polynomial G1 - g_encoder[1] = 91; // Polynomial G2 + int max_states = 1 << mm; // 2^mm + g_encoder[0] = 121; // Polynomial G1 + g_encoder[1] = 91; // Polynomial G2 out0 = static_cast(volk_gnsssdr_malloc(max_states * sizeof(int), volk_gnsssdr_get_alignment())); out1 = static_cast(volk_gnsssdr_malloc(max_states * sizeof(int), volk_gnsssdr_get_alignment())); state0 = static_cast(volk_gnsssdr_malloc(max_states * sizeof(int), volk_gnsssdr_get_alignment())); state1 = static_cast(volk_gnsssdr_malloc(max_states * sizeof(int), volk_gnsssdr_get_alignment())); - /* create appropriate transition matrices */ + // create appropriate transition matrices nsc_transit(out0, state0, 0, g_encoder, KK, nn); nsc_transit(out1, state1, 1, g_encoder, KK, nn); } @@ -241,7 +239,7 @@ void galileo_e5a_telemetry_decoder_cc::set_channel(int channel) { d_channel = channel; LOG(INFO) << "Navigation channel set to " << channel; - // ############# ENABLE DATA FILE LOG ################# + // Enable data file logging if (d_dump == true) { if (d_dump_file.is_open() == false) @@ -272,7 +270,7 @@ int galileo_e5a_telemetry_decoder_cc::general_work(int noutput_items __attribute Gnss_Synchro *out = reinterpret_cast(output_items[0]); // Get the output buffer pointer const Gnss_Synchro *in = reinterpret_cast(input_items[0]); // Get the input buffer pointer - //1. Copy the current tracking output + // 1. Copy the current tracking output Gnss_Synchro current_sample = in[0]; d_symbol_counter++; if (flag_bit_start) @@ -281,7 +279,7 @@ int galileo_e5a_telemetry_decoder_cc::general_work(int noutput_items __attribute if (d_symbol_counter == GALILEO_FNAV_CODES_PER_SYMBOL) { current_sample.Prompt_I = d_prompt_acum / static_cast(GALILEO_FNAV_CODES_PER_SYMBOL); - d_symbol_history.push_back(current_sample); //add new symbol to the symbol queue + d_symbol_history.push_back(current_sample); // add new symbol to the symbol queue d_prompt_acum = 0.0; d_symbol_counter = 0; new_symbol = true; @@ -323,14 +321,14 @@ int galileo_e5a_telemetry_decoder_cc::general_work(int noutput_items __attribute } } } - d_sample_counter++; //count for the processed samples + d_sample_counter++; // count for the processed samples consume_each(1); d_flag_preamble = false; if ((d_symbol_history.size() > required_symbols) && new_symbol) { - //******* preamble correlation ******** + // ****************** Preamble orrelation ****************** corr_value = 0; for (int i = 0; i < GALILEO_FNAV_PREAMBLE_LENGTH_BITS; i++) { @@ -344,13 +342,12 @@ int galileo_e5a_telemetry_decoder_cc::general_work(int noutput_items __attribute } } } - - //******* frame sync ****************** - if ((d_stat == 0) && new_symbol) //no preamble information + // ****************** Frame sync ****************** + if ((d_stat == 0) && new_symbol) // no preamble information { if (abs(corr_value) >= GALILEO_FNAV_PREAMBLE_LENGTH_BITS) { - d_preamble_index = d_sample_counter; //record the preamble sample stamp + d_preamble_index = d_sample_counter; // record the preamble sample stamp LOG(INFO) << "Preamble detection for Galileo E5a satellite " << d_satellite; d_stat = 1; // enter into frame pre-detection status } @@ -359,13 +356,13 @@ int galileo_e5a_telemetry_decoder_cc::general_work(int noutput_items __attribute { if (abs(corr_value) >= GALILEO_FNAV_PREAMBLE_LENGTH_BITS) { - //check preamble separation + // check preamble separation preamble_diff = d_sample_counter - d_preamble_index; if (preamble_diff == GALILEO_FNAV_CODES_PER_PAGE) { - //try to decode frame + // try to decode frame LOG(INFO) << "Starting page decoder for Galileo E5a satellite " << d_satellite; - d_preamble_index = d_sample_counter; //record the preamble sample stamp + d_preamble_index = d_sample_counter; // record the preamble sample stamp d_stat = 2; } else if (preamble_diff > GALILEO_FNAV_CODES_PER_PAGE) @@ -397,13 +394,13 @@ int galileo_e5a_telemetry_decoder_cc::general_work(int noutput_items __attribute page_symbols[i] = corr_sign * d_symbol_history.at(i + GALILEO_FNAV_PREAMBLE_LENGTH_BITS).Prompt_I; // because last symbol of the preamble is just received now! } - //call the decoder + // call the decoder decode_word(page_symbols, frame_length); if (d_nav.flag_CRC_test == true) { d_CRC_error_counter = 0; - d_flag_preamble = true; //valid preamble indicator (initialized to false every work()) - d_preamble_index = d_sample_counter; //record the preamble sample stamp (t_P) + d_flag_preamble = true; // valid preamble indicator (initialized to false every work()) + d_preamble_index = d_sample_counter; // record the preamble sample stamp (t_P) if (!d_flag_frame_sync) { d_flag_frame_sync = true; @@ -414,7 +411,7 @@ int galileo_e5a_telemetry_decoder_cc::general_work(int noutput_items __attribute else { d_CRC_error_counter++; - d_preamble_index = d_sample_counter; //record the preamble sample stamp + d_preamble_index = d_sample_counter; // record the preamble sample stamp if (d_CRC_error_counter > GALILEO_E5A_CRC_ERROR_LIMIT) { LOG(INFO) << "Lost of frame sync SAT " << this->d_satellite; @@ -428,10 +425,10 @@ int galileo_e5a_telemetry_decoder_cc::general_work(int noutput_items __attribute new_symbol = false; // UPDATE GNSS SYNCHRO DATA - //Add the telemetry decoder information + // Add the telemetry decoder information if (d_flag_preamble and d_nav.flag_TOW_set) - //update TOW at the preamble instant - //We expect a preamble each 10 seconds (FNAV page period) + // update TOW at the preamble instant + // We expect a preamble each 10 seconds (FNAV page period) { if (d_nav.flag_TOW_1 == true) { @@ -458,7 +455,7 @@ int galileo_e5a_telemetry_decoder_cc::general_work(int noutput_items __attribute d_TOW_at_current_symbol += GALILEO_E5a_CODE_PERIOD; } } - else //if there is not a new preamble, we define the TOW of the current symbol + else // if there is not a new preamble, we define the TOW of the current symbol { d_TOW_at_current_symbol += GALILEO_E5a_CODE_PERIOD; } @@ -499,7 +496,7 @@ int galileo_e5a_telemetry_decoder_cc::general_work(int noutput_items __attribute { d_symbol_history.pop_front(); } - //3. Make the output + // 3. Make the output if (current_sample.Flag_valid_word) { out[0] = current_sample; diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index 515e21ada..372aec4ff 100755 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -144,21 +144,20 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(dllpllconf_t conf_) : gr::block("dl d_correlation_length_ms = 1; d_code_samples_per_chip = 1; d_code_length_chips = static_cast(GPS_L5i_CODE_LENGTH_CHIPS); - // GPS L5 does not have pilot secondary code d_secondary = true; - interchange_iq = false; if (trk_parameters.track_pilot) { d_secondary_code_length = static_cast(GPS_L5q_NH_CODE_LENGTH); d_secondary_code_string = const_cast(&GPS_L5q_NH_CODE_STR); signal_pretty_name = signal_pretty_name + "Q"; - //interchange_iq = true; + interchange_iq = true; } else { d_secondary_code_length = static_cast(GPS_L5i_NH_CODE_LENGTH); d_secondary_code_string = const_cast(&GPS_L5i_NH_CODE_STR); signal_pretty_name = signal_pretty_name + "I"; + interchange_iq = false; } } else @@ -212,18 +211,18 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(dllpllconf_t conf_) : gr::block("dl d_code_samples_per_chip = 1; d_code_length_chips = static_cast(Galileo_E5a_CODE_LENGTH_CHIPS); d_secondary = true; - interchange_iq = false; if (trk_parameters.track_pilot) { d_secondary_code_length = static_cast(Galileo_E5a_Q_SECONDARY_CODE_LENGTH); signal_pretty_name = signal_pretty_name + "Q"; - // interchange_iq = true; + interchange_iq = true; } else { d_secondary_code_length = static_cast(Galileo_E5a_I_SECONDARY_CODE_LENGTH); d_secondary_code_string = const_cast(&Galileo_E5a_I_SECONDARY_CODE); signal_pretty_name = signal_pretty_name + "I"; + interchange_iq = false; } } else From 79170327ab96467e260694636da3f12a2c7d9515 Mon Sep 17 00:00:00 2001 From: zosoworld Date: Fri, 4 May 2018 19:54:45 +0200 Subject: [PATCH 75/82] Fixed rtl_tcp signal source --- .../signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc index 2207e6d88..cad8c570f 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc @@ -157,6 +157,7 @@ rtl_tcp_signal_source_c::~rtl_tcp_signal_source_c() boost::mutex::scoped_lock lock(mutex_); io_service_.stop(); not_empty_.notify_one(); + not_full_.notify_one(); } From 1ff445937bb240af85557f22a501f10e0e202803 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 4 May 2018 23:44:00 +0200 Subject: [PATCH 76/82] Clean configuration files Add header and pointer to the block documentation page Remove most of the comments so files are easier to read Remove old/unused parameters --- conf/front-end-cal.conf | 3 + conf/gnss-sdr.conf | 131 +-------- ...nss-sdr_GLONASS_L1_CA_GPS_L1_CA_ibyte.conf | 7 +- .../gnss-sdr_GLONASS_L1_CA_GPS_L2C_ibyte.conf | 7 +- conf/gnss-sdr_GLONASS_L1_CA_ibyte.conf | 5 +- .../gnss-sdr_GLONASS_L1_CA_ibyte_coh_trk.conf | 5 +- ...nss-sdr_GLONASS_L2_CA_GPS_L1_CA_ibyte.conf | 8 +- .../gnss-sdr_GLONASS_L2_CA_GPS_L2C_ibyte.conf | 8 +- conf/gnss-sdr_GLONASS_L2_CA_ibyte.conf | 5 +- .../gnss-sdr_GLONASS_L2_CA_ibyte_coh_trk.conf | 5 +- ...gnss-sdr_GPS_L1_2ch_fmcomms2_realtime.conf | 3 + conf/gnss-sdr_GPS_L1_CA_ibyte.conf | 3 + conf/gnss-sdr_GPS_L1_FPGA.conf | 10 +- conf/gnss-sdr_GPS_L1_GN3S_realtime.conf | 7 +- conf/gnss-sdr_GPS_L1_LimeSDR.conf | 3 + conf/gnss-sdr_GPS_L1_SPIR.conf | 127 +------- conf/gnss-sdr_GPS_L1_USRP_X300_realtime.conf | 143 +-------- conf/gnss-sdr_GPS_L1_USRP_realtime.conf | 173 +---------- conf/gnss-sdr_GPS_L1_acq_QuickSync.conf | 152 +--------- conf/gnss-sdr_GPS_L1_bladeRF.conf | 12 +- conf/gnss-sdr_GPS_L1_fmcomms2_realtime.conf | 16 +- conf/gnss-sdr_GPS_L1_gr_complex.conf | 32 +- conf/gnss-sdr_GPS_L1_gr_complex_gpu.conf | 7 +- conf/gnss-sdr_GPS_L1_ishort.conf | 27 +- conf/gnss-sdr_GPS_L1_nsr.conf | 14 +- conf/gnss-sdr_GPS_L1_nsr_twobit_packed.conf | 4 +- conf/gnss-sdr_GPS_L1_plutosdr_realtime.conf | 3 + ...-sdr_GPS_L1_pulse_blanking_gr_complex.conf | 47 +-- conf/gnss-sdr_GPS_L1_rtl_tcp_realtime.conf | 116 +------- conf/gnss-sdr_GPS_L1_rtlsdr_realtime.conf | 12 +- conf/gnss-sdr_GPS_L1_two_bits_cpx.conf | 7 +- conf/gnss-sdr_GPS_L2C_USRP1_realtime.conf | 64 +--- conf/gnss-sdr_GPS_L2C_USRP_X300_realtime.conf | 7 +- ...nss-sdr_Galileo_E1_USRP_X300_realtime.conf | 4 +- conf/gnss-sdr_Galileo_E1_acq_QuickSync.conf | 178 +---------- conf/gnss-sdr_Galileo_E1_ishort.conf | 158 +--------- conf/gnss-sdr_Galileo_E1_nsr.conf | 12 +- conf/gnss-sdr_Galileo_E5a.conf | 172 +---------- conf/gnss-sdr_Galileo_E5a_IFEN_CTTC.conf | 8 +- conf/gnss-sdr_Hybrid_byte.conf | 145 +-------- conf/gnss-sdr_Hybrid_byte_sim.conf | 149 +--------- conf/gnss-sdr_Hybrid_gr_complex.conf | 173 +---------- conf/gnss-sdr_Hybrid_ishort.conf | 154 +--------- conf/gnss-sdr_Hybrid_nsr.conf | 136 +-------- ...r_galileo_E1_extended_correlator_byte.conf | 91 +----- ...galileo_E1_extended_correlator_labsat.conf | 127 +------- ...nnel_GPS_L1_Flexiband_bin_file_III_1a.conf | 126 +------- ...nnel_GPS_L1_Flexiband_realtime_III_1a.conf | 136 +-------- ...nnel_GPS_L1_Flexiband_realtime_III_1b.conf | 126 +------- ...annel_GPS_L1_Flexiband_realtime_II_3b.conf | 121 +------- ...hannel_GPS_L1_Flexiband_realtime_I_1b.conf | 127 +------- ...l_GPS_L1_L2_Flexiband_realtime_III_1b.conf | 168 +---------- ...Galileo_E1B_Flexiband_bin_file_III_1b.conf | 193 +----------- ...ultichannel_GPS_L1_USRP_X300_realtime.conf | 222 +------------- ...el_GPS_L2_M_Flexiband_bin_file_III_1b.conf | 195 +----------- ...S_L2_M_Flexiband_bin_file_III_1b_real.conf | 146 +-------- ..._all_in_one_Flexiband_bin_file_III_1b.conf | 277 ++++-------------- conf/gnss-sdr_multisource_Hybrid_ishort.conf | 246 +--------------- conf/gnss-sdr_multisource_Hybrid_nsr.conf | 210 +------------ 59 files changed, 310 insertions(+), 4663 deletions(-) diff --git a/conf/front-end-cal.conf b/conf/front-end-cal.conf index 72c9be845..6ef6ec846 100644 --- a/conf/front-end-cal.conf +++ b/conf/front-end-cal.conf @@ -1,3 +1,6 @@ +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; Default configuration file ; You can define your own front-end calibration tool configuration and invoke it by doing ; ./front-end-cal --config_file=my_GNSS_SDR_configuration.conf diff --git a/conf/gnss-sdr.conf b/conf/gnss-sdr.conf index 0c456f075..e9a05e798 100644 --- a/conf/gnss-sdr.conf +++ b/conf/gnss-sdr.conf @@ -1,3 +1,6 @@ +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; Default configuration file ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf @@ -25,149 +28,63 @@ GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 ;######### SIGNAL_SOURCE CONFIG ############ -;#implementation SignalSource.implementation=File_Signal_Source -;#filename: path to file with the captured GNSS signal samples to be processed SignalSource.filename=/datalogger/signals/CTTC/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat ; <- PUT YOUR FILE HERE -;#item_type: Type and resolution for each of the signal samples. SignalSource.item_type=ishort -;#sampling_frequency: Original Signal sampling frequency in samples per second SignalSource.sampling_frequency=4000000 -;#samples: Number of samples to be processed. Notice that 0 indicates the entire file. SignalSource.samples=0 -;#repeat: Repeat the processing file. SignalSource.repeat=false -;#enable_throttle_control: Enabling this option tells the signal source to keep the delay between samples in post processing. -; it helps to not overload the CPU, but the processing time will be longer. SignalSource.enable_throttle_control=false ;######### SIGNAL_CONDITIONER CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. - -;#implementation: Use [Pass_Through] or [Signal_Conditioner] -;#[Pass_Through] disables this block and the [DataTypeAdapter], [InputFilter] and [Resampler] blocks -;#[Signal_Conditioner] enables this block. Then you have to configure [DataTypeAdapter], [InputFilter] and [Resampler] blocks SignalConditioner.implementation=Signal_Conditioner -;SignalConditioner.implementation=Pass_Through ;######### DATA_TYPE_ADAPTER CONFIG ############ -;## Changes the type of input data. -;#implementation: [Pass_Through] disables this block DataTypeAdapter.implementation=Ishort_To_Complex -;DataTypeAdapter.implementation=Pass_Through ;######### INPUT_FILTER CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals -;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter] -;#[Pass_Through] disables this block -;#[Fir_Filter] enables a FIR Filter -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation that shifts IF down to zero Hz. +InputFilter.implementation=Pass_Through ; or Fir_Filter -;InputFilter.implementation=Fir_Filter -;InputFilter.implementation=Freq_Xlating_Fir_Filter -InputFilter.implementation=Pass_Through - -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of GNU Radio's function: gr_remez. -;#This function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, -;#the desired response on those bands, and the weight given to the error in those bands. - -;#input_item_type: Type and resolution for input signal samples. InputFilter.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter.output_item_type=gr_complex - -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. InputFilter.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time InputFilter.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. InputFilter.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - InputFilter.band1_begin=0.0 InputFilter.band1_end=0.44 InputFilter.band2_begin=0.55 InputFilter.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - InputFilter.ampl1_begin=1.0 InputFilter.ampl1_end=1.0 InputFilter.ampl2_begin=0.0 InputFilter.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands InputFilter.band1_error=1.0 InputFilter.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" InputFilter.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. InputFilter.grid_density=16 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. -;#InputFilter.IF is the intermediate frequency (in Hz) shifted down to zero Hz - InputFilter.sampling_frequency=4000000 InputFilter.IF=0 - -;#dump: Dump the filtered data to a file. InputFilter.dump=false - -;#dump_filename: Log path and filename. InputFilter.dump_filename=../data/input_filter.dat ;######### RESAMPLER CONFIG ############ -;## Resamples the input data. -;#implementation: Use [Pass_Through] or [Direct_Resampler] -;#[Pass_Through] disables this block -;#[Direct_Resampler] enables a resampler that implements a nearest neighborhood interpolation -;Resampler.implementation=Direct_Resampler Resampler.implementation=Pass_Through -;#item_type: Type and resolution for each of the signal samples. -Resampler.item_type=gr_complex -;#sample_freq_in: the sample frequency of the input signal -Resampler.sample_freq_in=4000000 -;#sample_freq_out: the desired sample frequency of the output signal -Resampler.sample_freq_out=2000000 -;#dump: Dump the resampled data to a file. Resampler.dump=false -;#dump_filename: Log path and filename. Resampler.dump_filename=../data/resampler.dat ;######### CHANNELS GLOBAL CONFIG ############ -;#count: Number of available GPS L1 C/A satellite channels. Channels_1C.count=6 -;#count: Number of available Galileo E1B satellite channels. Channels_1B.count=0 -;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver Channels.in_acquisition=1 -;#if the option is disabled by default is assigned "1C" GPS L1 C/A -Channel.signal=1C - - ;######### SPECIFIC CHANNELS CONFIG ###### -;#The following options are specific to each channel and overwrite the generic options ;######### CHANNEL 0 CONFIG ############ ;Channel0.signal=1C -;#satellite: Satellite PRN ID for this channel. Disable this option for random search ;Channel0.satellite=11 ;######### CHANNEL 1 CONFIG ############ @@ -176,90 +93,52 @@ Channel.signal=1C ;######### ACQUISITION GLOBAL CONFIG ############ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition_Fine_Doppler -;#item_type: Type and resolution for each of the signal samples. Acquisition_1C.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1C.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] -Acquisition_1C.sampled_ms=1 -;#threshold: Acquisition threshold +Acquisition_1C.coherent_integration_time_ms=1 Acquisition_1C.threshold=0.005 -;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition] ;Acquisition_1C.pfa=0.0001 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1C.doppler_max=10000 -;#doppler_max: Maximum expected Doppler shift [Hz] -Acquisition_1C.doppler_min=-10000 -;#doppler_step Doppler step in the grid search [Hz] Acquisition_1C.doppler_step=500 -;#maximum dwells Acquisition_1C.max_dwells=5 -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] Acquisition_1C.dump=false -;#filename: Log path and filename Acquisition_1C.dump_filename=./acq_dump.dat ;######### TRACKING GLOBAL CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_1C.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] -Tracking_1C.if=0 -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1C.pll_bw_hz=45.0; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] Tracking_1C.dll_bw_hz=3.0; -;#order: PLL/DLL loop filter order [2] or [3] Tracking_1C.order=3; -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] Tracking_1C.dump=false -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. Tracking_1C.dump_filename=../data/epl_tracking_ch_ ;######### TELEMETRY DECODER GPS CONFIG ############ -;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L1 C/A TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder TelemetryDecoder_1C.dump=false ;######### OBSERVABLES CONFIG ############ -;#implementation: Observables.implementation=Hybrid_Observables -;#dump: Enable or disable the Observables internal binary data file logging [true] or [false] Observables.dump=false -;#dump_filename: Log path and filename. Observables.dump_filename=./observables.dat ;######### PVT CONFIG ############ -;#implementation: Position Velocity and Time (PVT) implementation: PVT.implementation=RTKLIB_PVT PVT.positioning_mode=PPP_Static ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad PVT.AR_GPS=PPP-AR ; options: OFF, Continuous, Instantaneous, Fix-and-Hold, PPP-AR -;#output_rate_ms: Period between two PVT outputs. Notice that the minimum period is equal to the tracking integration time (for GPS CA L1 is 1ms) [ms] PVT.output_rate_ms=10 -;#display_rate_ms: Position console print (std::out) interval [ms]. Notice that output_rate_ms <= display_rate_ms. PVT.display_rate_ms=500 -PVT.positioning_mode=PPP_Static -;# KML, GeoJSON, NMEA and RTCM output configuration -;#nmea_dump_filename: NMEA log path and filename PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea -;#flag_nmea_tty_port: Enables or disables the NMEA log to a serial TTY port (Can be used with real hardware or virtual one) PVT.flag_nmea_tty_port=true -;#nmea_dump_devname: serial device descriptor for NMEA logging PVT.nmea_dump_devname=/dev/pts/4 -;#flag_rtcm_server: Enables or disables a TCP/IP server transmitting RTCM 3.2 messages (accepts multiple clients, port 2101 by default) PVT.flag_rtcm_server=true -;#flag_rtcm_tty_port: Enables or disables the RTCM log to a serial TTY port (Can be used with real hardware or virtual one) PVT.flag_rtcm_tty_port=false -;#rtcm_dump_devname: serial device descriptor for RTCM logging PVT.rtcm_dump_devname=/dev/pts/1 -;#dump: Enable or disable the PVT internal binary data file logging [true] or [false] PVT.dump=false -;#dump_filename: Log path and filename without extension. Notice that PVT will add ".dat" to the binary dump, ".kml" and ".geojson" to GIS-friendly formats. PVT.dump_filename=./PVT diff --git a/conf/gnss-sdr_GLONASS_L1_CA_GPS_L1_CA_ibyte.conf b/conf/gnss-sdr_GLONASS_L1_CA_GPS_L1_CA_ibyte.conf index 53d903ba3..f042def9c 100644 --- a/conf/gnss-sdr_GLONASS_L1_CA_GPS_L1_CA_ibyte.conf +++ b/conf/gnss-sdr_GLONASS_L1_CA_GPS_L1_CA_ibyte.conf @@ -1,3 +1,6 @@ +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + [GNSS-SDR] ;######### GLOBAL OPTIONS ################## @@ -79,7 +82,6 @@ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition Acquisition_1C.item_type=gr_complex Acquisition_1C.threshold=0.0 Acquisition_1C.pfa=0.00001 -Acquisition_1C.if=0 Acquisition_1C.doppler_max=10000 Acquisition_1C.doppler_step=250 Acquisition_1C.dump=false; @@ -90,7 +92,6 @@ Acquisition_1G.implementation=GLONASS_L1_CA_PCPS_Acquisition Acquisition_1G.item_type=gr_complex Acquisition_1G.threshold=0.0 Acquisition_1G.pfa=0.00001 -Acquisition_1G.if=0 Acquisition_1G.doppler_max=10000 Acquisition_1G.doppler_step=250 Acquisition_1G.dump=false; @@ -100,7 +101,6 @@ Acquisition_1G.dump_filename=/archive/glo_acquisition.dat ;######### TRACKING GLOBAL CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking Tracking_1C.item_type=gr_complex -Tracking_1C.if=0 Tracking_1C.early_late_space_chips=0.5 Tracking_1C.pll_bw_hz=20.0; Tracking_1C.dll_bw_hz=2.0; @@ -109,7 +109,6 @@ Tracking_1C.dump_filename=/archive/gps_tracking_ch_ Tracking_1G.implementation=GLONASS_L1_CA_DLL_PLL_Tracking Tracking_1G.item_type=gr_complex -Tracking_1G.if=0 Tracking_1G.early_late_space_chips=0.5 Tracking_1G.pll_bw_hz=25.0; Tracking_1G.dll_bw_hz=3.0; diff --git a/conf/gnss-sdr_GLONASS_L1_CA_GPS_L2C_ibyte.conf b/conf/gnss-sdr_GLONASS_L1_CA_GPS_L2C_ibyte.conf index cc9ba010f..09bddfb46 100644 --- a/conf/gnss-sdr_GLONASS_L1_CA_GPS_L2C_ibyte.conf +++ b/conf/gnss-sdr_GLONASS_L1_CA_GPS_L2C_ibyte.conf @@ -1,3 +1,6 @@ +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + [GNSS-SDR] ;######### GLOBAL OPTIONS ################## @@ -82,7 +85,6 @@ Acquisition_2S.implementation=GPS_L2_M_PCPS_Acquisition Acquisition_2S.item_type=gr_complex Acquisition_2S.threshold=0.0 Acquisition_2S.pfa=0.00001 -Acquisition_2S.if=0 Acquisition_2S.doppler_max=10000 Acquisition_2S.doppler_step=60 Acquisition_2S.max_dwells=1 @@ -91,7 +93,6 @@ Acquisition_1G.implementation=GLONASS_L1_CA_PCPS_Acquisition Acquisition_1G.item_type=gr_complex Acquisition_1G.threshold=0.0 Acquisition_1G.pfa=0.00001 -Acquisition_1G.if=0 Acquisition_1G.doppler_max=10000 Acquisition_1G.doppler_step=250 Acquisition_1G.dump=false; @@ -100,7 +101,6 @@ Acquisition_1G.dump_filename=/archive/glo_acquisition.dat ;######### TRACKING GLOBAL CONFIG ############ Tracking_2S.implementation=GPS_L2_M_DLL_PLL_Tracking Tracking_2S.item_type=gr_complex -Tracking_2S.if=0 Tracking_2S.early_late_space_chips=0.5 Tracking_2S.pll_bw_hz=2.0; Tracking_2S.dll_bw_hz=0.250; @@ -110,7 +110,6 @@ Tracking_2S.dump_filename=/archive/gps_tracking_ch_ Tracking_1G.implementation=GLONASS_L1_CA_DLL_PLL_Tracking Tracking_1G.item_type=gr_complex -Tracking_1G.if=0 Tracking_1G.early_late_space_chips=0.5 Tracking_1G.pll_bw_hz=25.0; Tracking_1G.dll_bw_hz=3.0; diff --git a/conf/gnss-sdr_GLONASS_L1_CA_ibyte.conf b/conf/gnss-sdr_GLONASS_L1_CA_ibyte.conf index b95b93551..077d3dd1e 100644 --- a/conf/gnss-sdr_GLONASS_L1_CA_ibyte.conf +++ b/conf/gnss-sdr_GLONASS_L1_CA_ibyte.conf @@ -1,3 +1,6 @@ +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + [GNSS-SDR] ;######### GLOBAL OPTIONS ################## @@ -36,7 +39,6 @@ Acquisition_1G.implementation=GLONASS_L1_CA_PCPS_Acquisition Acquisition_1G.item_type=gr_complex Acquisition_1G.threshold=0.0 Acquisition_1G.pfa=0.0001 -Acquisition_1G.if=0 Acquisition_1G.doppler_max=10000 Acquisition_1G.doppler_step=250 Acquisition_1G.dump=true; @@ -47,7 +49,6 @@ Acquisition_1G.dump_filename=/archive/glo_acquisition.dat ;######### TRACKING GLOBAL CONFIG ############ Tracking_1G.implementation=GLONASS_L1_CA_DLL_PLL_Tracking Tracking_1G.item_type=gr_complex -Tracking_1G.if=0 Tracking_1G.early_late_space_chips=0.5 Tracking_1G.pll_bw_hz=25.0; Tracking_1G.dll_bw_hz=3.0; diff --git a/conf/gnss-sdr_GLONASS_L1_CA_ibyte_coh_trk.conf b/conf/gnss-sdr_GLONASS_L1_CA_ibyte_coh_trk.conf index 0bdbe7739..ca1197a6d 100644 --- a/conf/gnss-sdr_GLONASS_L1_CA_ibyte_coh_trk.conf +++ b/conf/gnss-sdr_GLONASS_L1_CA_ibyte_coh_trk.conf @@ -1,3 +1,6 @@ +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + [GNSS-SDR] ;######### GLOBAL OPTIONS ################## @@ -36,7 +39,6 @@ Acquisition_1G.implementation=GLONASS_L1_CA_PCPS_Acquisition Acquisition_1G.item_type=gr_complex Acquisition_1G.threshold=0.0 Acquisition_1G.pfa=0.0001 -Acquisition_1G.if=0 Acquisition_1G.doppler_max=10000 Acquisition_1G.doppler_step=250 Acquisition_1G.dump=false; @@ -47,7 +49,6 @@ Acquisition_1G.dump_filename=/archive/glo_acquisition.dat ;######### TRACKING GLOBAL CONFIG ############ Tracking_1G.implementation=GLONASS_L1_CA_DLL_PLL_C_Aid_Tracking Tracking_1G.item_type=gr_complex -Tracking_1G.if=0 Tracking_1G.early_late_space_chips=0.5 Tracking_1G.pll_bw_hz=40.0; Tracking_1G.dll_bw_hz=3.0; diff --git a/conf/gnss-sdr_GLONASS_L2_CA_GPS_L1_CA_ibyte.conf b/conf/gnss-sdr_GLONASS_L2_CA_GPS_L1_CA_ibyte.conf index 04b8dd746..7e4e9e03f 100644 --- a/conf/gnss-sdr_GLONASS_L2_CA_GPS_L1_CA_ibyte.conf +++ b/conf/gnss-sdr_GLONASS_L2_CA_GPS_L1_CA_ibyte.conf @@ -1,3 +1,6 @@ +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + [GNSS-SDR] ;######### GLOBAL OPTIONS ################## @@ -79,7 +82,6 @@ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition Acquisition_1C.item_type=gr_complex Acquisition_1C.threshold=0.0 Acquisition_1C.pfa=0.00001 -Acquisition_1C.if=0 Acquisition_1C.doppler_max=10000 Acquisition_1C.doppler_step=250 Acquisition_1C.dump=false; @@ -90,7 +92,6 @@ Acquisition_2G.implementation=GLONASS_L2_CA_PCPS_Acquisition Acquisition_2G.item_type=gr_complex Acquisition_2G.threshold=0.0 Acquisition_2G.pfa=0.00001 -Acquisition_2G.if=0 Acquisition_2G.doppler_max=10000 Acquisition_2G.doppler_step=250 Acquisition_2G.dump=false; @@ -100,7 +101,6 @@ Acquisition_2G.dump_filename=/archive/glo_acquisition.dat ;######### TRACKING GLOBAL CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking Tracking_1C.item_type=gr_complex -Tracking_1C.if=0 Tracking_1C.early_late_space_chips=0.5 Tracking_1C.pll_bw_hz=20.0; Tracking_1C.dll_bw_hz=2.0; @@ -109,7 +109,6 @@ Tracking_1C.dump_filename=/archive/gps_tracking_ch_ Tracking_2G.implementation=GLONASS_L2_CA_DLL_PLL_Tracking Tracking_2G.item_type=gr_complex -Tracking_2G.if=0 Tracking_2G.early_late_space_chips=0.5 Tracking_2G.pll_bw_hz=25.0; Tracking_2G.dll_bw_hz=2.0; @@ -127,6 +126,7 @@ Observables.dump_filename=/archive/gnss_observables.dat ;######### PVT CONFIG ############ PVT.implementation=RTKLIB_PVT +PVT.positioning_mode=Single PVT.output_rate_ms=100 PVT.display_rate_ms=500 PVT.trop_model=Saastamoinen diff --git a/conf/gnss-sdr_GLONASS_L2_CA_GPS_L2C_ibyte.conf b/conf/gnss-sdr_GLONASS_L2_CA_GPS_L2C_ibyte.conf index 32faba32a..c3ab7cb9c 100644 --- a/conf/gnss-sdr_GLONASS_L2_CA_GPS_L2C_ibyte.conf +++ b/conf/gnss-sdr_GLONASS_L2_CA_GPS_L2C_ibyte.conf @@ -1,3 +1,6 @@ +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + [GNSS-SDR] ;######### GLOBAL OPTIONS ################## @@ -82,7 +85,6 @@ Acquisition_2S.implementation=GPS_L2_M_PCPS_Acquisition Acquisition_2S.item_type=gr_complex Acquisition_2S.threshold=0.0 Acquisition_2S.pfa=0.00001 -Acquisition_2S.if=0 Acquisition_2S.doppler_max=10000 Acquisition_2S.doppler_step=60 Acquisition_2S.max_dwells=1 @@ -91,7 +93,6 @@ Acquisition_2G.implementation=GLONASS_L2_CA_PCPS_Acquisition Acquisition_2G.item_type=gr_complex Acquisition_2G.threshold=0.0 Acquisition_2G.pfa=0.00001 -Acquisition_2G.if=0 Acquisition_2G.doppler_max=10000 Acquisition_2G.doppler_step=250 Acquisition_2G.dump=false; @@ -100,7 +101,6 @@ Acquisition_2G.dump_filename=/archive/glo_acquisition.dat ;######### TRACKING GLOBAL CONFIG ############ Tracking_2S.implementation=GPS_L2_M_DLL_PLL_Tracking Tracking_2S.item_type=gr_complex -Tracking_2S.if=0 Tracking_2S.early_late_space_chips=0.5 Tracking_2S.pll_bw_hz=2.0; Tracking_2S.dll_bw_hz=0.250; @@ -110,7 +110,6 @@ Tracking_2S.dump_filename=/archive/gps_tracking_ch_ Tracking_2G.implementation=GLONASS_L2_CA_DLL_PLL_Tracking Tracking_2G.item_type=gr_complex -Tracking_2G.if=0 Tracking_2G.early_late_space_chips=0.5 Tracking_2G.pll_bw_hz=25.0; Tracking_2G.dll_bw_hz=3.0; @@ -128,6 +127,7 @@ Observables.dump_filename=/archive/gnss_observables.dat ;######### PVT CONFIG ############ PVT.implementation=RTKLIB_PVT +PVT.positioning_mode=Single PVT.output_rate_ms=100 PVT.display_rate_ms=500 PVT.trop_model=Saastamoinen diff --git a/conf/gnss-sdr_GLONASS_L2_CA_ibyte.conf b/conf/gnss-sdr_GLONASS_L2_CA_ibyte.conf index e8d1342a8..7cc44a0a4 100644 --- a/conf/gnss-sdr_GLONASS_L2_CA_ibyte.conf +++ b/conf/gnss-sdr_GLONASS_L2_CA_ibyte.conf @@ -1,3 +1,6 @@ +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + [GNSS-SDR] ;######### GLOBAL OPTIONS ################## @@ -30,7 +33,6 @@ Acquisition_2G.implementation=GLONASS_L2_CA_PCPS_Acquisition Acquisition_2G.item_type=gr_complex Acquisition_2G.threshold=0.0 Acquisition_2G.pfa=0.0001 -Acquisition_2G.if=0 Acquisition_2G.doppler_max=10000 Acquisition_2G.doppler_step=250 Acquisition_2G.dump=true; @@ -41,7 +43,6 @@ Acquisition_2G.dump_filename=/archive/glo_acquisition.dat ;######### TRACKING GLOBAL CONFIG ############ Tracking_2G.implementation=GLONASS_L2_CA_DLL_PLL_Tracking Tracking_2G.item_type=gr_complex -Tracking_2G.if=0 Tracking_2G.early_late_space_chips=0.5 Tracking_2G.pll_bw_hz=20.0; Tracking_2G.dll_bw_hz=2.0; diff --git a/conf/gnss-sdr_GLONASS_L2_CA_ibyte_coh_trk.conf b/conf/gnss-sdr_GLONASS_L2_CA_ibyte_coh_trk.conf index 0bdbe7739..ca1197a6d 100644 --- a/conf/gnss-sdr_GLONASS_L2_CA_ibyte_coh_trk.conf +++ b/conf/gnss-sdr_GLONASS_L2_CA_ibyte_coh_trk.conf @@ -1,3 +1,6 @@ +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + [GNSS-SDR] ;######### GLOBAL OPTIONS ################## @@ -36,7 +39,6 @@ Acquisition_1G.implementation=GLONASS_L1_CA_PCPS_Acquisition Acquisition_1G.item_type=gr_complex Acquisition_1G.threshold=0.0 Acquisition_1G.pfa=0.0001 -Acquisition_1G.if=0 Acquisition_1G.doppler_max=10000 Acquisition_1G.doppler_step=250 Acquisition_1G.dump=false; @@ -47,7 +49,6 @@ Acquisition_1G.dump_filename=/archive/glo_acquisition.dat ;######### TRACKING GLOBAL CONFIG ############ Tracking_1G.implementation=GLONASS_L1_CA_DLL_PLL_C_Aid_Tracking Tracking_1G.item_type=gr_complex -Tracking_1G.if=0 Tracking_1G.early_late_space_chips=0.5 Tracking_1G.pll_bw_hz=40.0; Tracking_1G.dll_bw_hz=3.0; diff --git a/conf/gnss-sdr_GPS_L1_2ch_fmcomms2_realtime.conf b/conf/gnss-sdr_GPS_L1_2ch_fmcomms2_realtime.conf index 79a57f712..f53fe2ea6 100644 --- a/conf/gnss-sdr_GPS_L1_2ch_fmcomms2_realtime.conf +++ b/conf/gnss-sdr_GPS_L1_2ch_fmcomms2_realtime.conf @@ -1,3 +1,6 @@ +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; diff --git a/conf/gnss-sdr_GPS_L1_CA_ibyte.conf b/conf/gnss-sdr_GPS_L1_CA_ibyte.conf index 8bef7d1c0..959181078 100644 --- a/conf/gnss-sdr_GPS_L1_CA_ibyte.conf +++ b/conf/gnss-sdr_GPS_L1_CA_ibyte.conf @@ -1,3 +1,6 @@ +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + [GNSS-SDR] ;######### GLOBAL OPTIONS ################## diff --git a/conf/gnss-sdr_GPS_L1_FPGA.conf b/conf/gnss-sdr_GPS_L1_FPGA.conf index 5def11d31..c6bb2edfc 100644 --- a/conf/gnss-sdr_GPS_L1_FPGA.conf +++ b/conf/gnss-sdr_GPS_L1_FPGA.conf @@ -1,3 +1,6 @@ +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; @@ -35,12 +38,11 @@ Channel.enable_FPGA=true ;######### ACQUISITION GLOBAL CONFIG ############ +Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition_Fpga Acquisition_1C.dump=false Acquisition_1C.dump_filename=./acq_dump.dat Acquisition_1C.item_type=cshort -Acquisition_1C.if=0 -Acquisition_1C.sampled_ms=1 -Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition_Fpga +Acquisition_1C.coherent_integration_time_ms=1 Acquisition_1C.select_queue_Fpga=0; Acquisition_1C.threshold=0.005 ;Acquisition_1C.pfa=0.01 @@ -50,7 +52,6 @@ Acquisition_1C.doppler_step=500 ;######### TRACKING GLOBAL CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_C_Aid_Tracking_Fpga Tracking_1C.item_type=cshort -Tracking_1C.if=0 Tracking_1C.dump=false Tracking_1C.dump_filename=../data/epl_tracking_ch_ Tracking_1C.pll_bw_hz=45.0; @@ -60,7 +61,6 @@ Tracking_1C.order=3; ;######### TELEMETRY DECODER GPS CONFIG ############ TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder TelemetryDecoder_1C.dump=false -TelemetryDecoder_1C.decimation_factor=1; ;######### OBSERVABLES CONFIG ############ Observables.implementation=GPS_L1_CA_Observables diff --git a/conf/gnss-sdr_GPS_L1_GN3S_realtime.conf b/conf/gnss-sdr_GPS_L1_GN3S_realtime.conf index 082a1b3f4..bc99d4a28 100644 --- a/conf/gnss-sdr_GPS_L1_GN3S_realtime.conf +++ b/conf/gnss-sdr_GPS_L1_GN3S_realtime.conf @@ -1,3 +1,6 @@ +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; @@ -68,8 +71,7 @@ Channel.signal=1C ;######### ACQUISITION GLOBAL CONFIG ############ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition Acquisition_1C.item_type=gr_complex -Acquisition_1C.if=0 -Acquisition_1C.sampled_ms=1 +Acquisition_1C.coherent_integration_time_ms=1 Acquisition_1C.threshold=0.008 Acquisition_1C.doppler_max=10000 Acquisition_1C.doppler_step=500 @@ -79,7 +81,6 @@ Acquisition_1C.dump_filename=./acq_dump.dat ;######### TRACKING GLOBAL CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking Tracking_1C.item_type=gr_complex -Tracking_1C.if=0 Tracking_1C.pll_bw_hz=45.0; Tracking_1C.dll_bw_hz=2.0; Tracking_1C.order=3; diff --git a/conf/gnss-sdr_GPS_L1_LimeSDR.conf b/conf/gnss-sdr_GPS_L1_LimeSDR.conf index 6ad918af0..ab1242bc7 100644 --- a/conf/gnss-sdr_GPS_L1_LimeSDR.conf +++ b/conf/gnss-sdr_GPS_L1_LimeSDR.conf @@ -1,3 +1,6 @@ +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + [GNSS-SDR] ;######### GLOBAL OPTIONS ################## diff --git a/conf/gnss-sdr_GPS_L1_SPIR.conf b/conf/gnss-sdr_GPS_L1_SPIR.conf index 4df77678f..6f3affed4 100644 --- a/conf/gnss-sdr_GPS_L1_SPIR.conf +++ b/conf/gnss-sdr_GPS_L1_SPIR.conf @@ -1,4 +1,6 @@ -; Default configuration file +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; @@ -11,107 +13,43 @@ GNSS-SDR.internal_fs_sps=4000000 ;######### SIGNAL_SOURCE CONFIG ############ -;#implementation SignalSource.implementation=Spir_File_Signal_Source -;#filename: path to file with the captured GNSS signal samples to be processed SignalSource.filename=/dtalogger/signals/spir/data/20Secs/20Secs_L1.dat ; <- PUT YOUR FILE HERE -;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version. SignalSource.item_type=int -;#sampling_frequency: Original Signal sampling frequency in samples per second SignalSource.sampling_frequency=80000000 -;#samples: Number of samples to be processed. Notice that 0 indicates the entire file. SignalSource.samples=0 -;#repeat: Repeat the processing file. SignalSource.repeat=false -;#enable_throttle_control: Enabling this option tells the signal source to keep the delay between samples in post processing. -; it helps to not overload the CPU, but the processing time will be longer. SignalSource.enable_throttle_control=false ;######### SIGNAL_CONDITIONER CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. - -;#implementation: Use [Pass_Through] or [Signal_Conditioner] -;#[Pass_Through] disables this block and the [DataTypeAdapter], [InputFilter] and [Resampler] blocks -;#[Signal_Conditioner] enables this block. Then you have to configure [DataTypeAdapter], [InputFilter] and [Resampler] blocks SignalConditioner.implementation=Signal_Conditioner ;######### DATA_TYPE_ADAPTER CONFIG ############ -;## Changes the type of input data. -;#implementation: [Pass_Through] disables this block DataTypeAdapter.implementation=Pass_Through DataTypeAdapter.item_type=float ;######### INPUT_FILTER CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter] -;#[Pass_Through] disables this block -;#[Fir_Filter] enables a FIR Filter -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation that shifts IF down to zero Hz. - -;InputFilter.implementation=Fir_Filter InputFilter.implementation=Freq_Xlating_Fir_Filter -;InputFilter.implementation=Pass_Through - -;#dump: Dump the filtered data to a file. InputFilter.dump=false - -;#dump_filename: Log path and filename. InputFilter.dump_filename=../data/input_filter.dat - -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of gnuradio's function: gr_remez. -;#This function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, -;#the desired response on those bands, and the weight given to the error in those bands. - -;#input_item_type: Type and resolution for input signal samples. InputFilter.input_item_type=float - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter.output_item_type=gr_complex - -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. InputFilter.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time InputFilter.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. InputFilter.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - InputFilter.band1_begin=0.0 InputFilter.band1_end=0.45 InputFilter.band2_begin=0.55 InputFilter.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - InputFilter.ampl1_begin=1.0 InputFilter.ampl1_end=1.0 InputFilter.ampl2_begin=0.0 InputFilter.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands InputFilter.band1_error=1.0 InputFilter.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" InputFilter.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. InputFilter.grid_density=16 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. -;#InputFilter.IF is the intermediate frequency (in Hz) shifted down to zero Hz - InputFilter.sampling_frequency=80000000 InputFilter.IF=10164 InputFilter.decimation_factor=20 @@ -119,105 +57,58 @@ InputFilter.decimation_factor=20 ;######### RESAMPLER CONFIG ############ -;## Resamples the input data. -;#implementation: Use [Pass_Through] or [Direct_Resampler] -;#[Pass_Through] disables this block -;#[Direct_Resampler] enables a resampler that implements a nearest neigbourhood interpolation -;Resampler.implementation=Direct_Resampler Resampler.implementation=Pass_Through -;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version. Resampler.item_type=gr_complex -;#sample_freq_in: the sample frequency of the input signal Resampler.sample_freq_in=80000000 -;#sample_freq_out: the desired sample frequency of the output signal Resampler.sample_freq_out=4000000 -;#dump: Dump the resamplered data to a file. Resampler.dump=false -;#dump_filename: Log path and filename. Resampler.dump_filename=../data/resampler.dat ;######### CHANNELS GLOBAL CONFIG ############ -;#count: Number of available GPS satellite channels. Channels_1C.count=10 -;#count: Number of available Galileo satellite channels. Channels_1B.count=0 -;#in_acquisition: Number of channels simultaneously acquiring Channels.in_acquisition=1 -;#signal: -;# "1C" GPS L1 C/A -;# "1B" Galileo E1B Channel.signal=1C -;Galileo FM3 -> PRN 19 -;Galileo FM4 -> PRN 20 ;######### CHANNEL 0 CONFIG ############ - -;Channel0.signal=1B -;#satellite: Satellite PRN ID for this channel. Disable this option to random search ;Channel0.satellite=20 ;######### CHANNEL 1 CONFIG ############ -;Channel1.signal=1B ;Channel1.satellite=12 ;######### CHANNEL 2 CONFIG ############ -;Channel2.signal=1B -;#satellite: Satellite PRN ID for this channel. Disable this option to random search ;Channel2.satellite=11 ;######### CHANNEL 3 CONFIG ############ -;Channel3.signal=1B ;Channel3.satellite=19 ;######### ACQUISITION GLOBAL CONFIG ############ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition_Fine_Doppler -;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version. Acquisition_1C.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1C.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] -Acquisition_1C.sampled_ms=1 -;#threshold: Acquisition threshold +Acquisition_1C.coherent_integration_time_ms=1 Acquisition_1C.threshold=0.005 -;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition] ;Acquisition_1C.pfa=0.0001 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1C.doppler_max=10000 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1C.doppler_min=-10000 -;#doppler_step Doppler step in the grid search [Hz] Acquisition_1C.doppler_step=500 -;#maximum dwells Acquisition_1C.max_dwells=5 -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] Acquisition_1C.dump=false -;#filename: Log path and filename Acquisition_1C.dump_filename=./acq_dump.dat ;######### TRACKING GLOBAL CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_1C.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] -Tracking_1C.if=0 -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1C.pll_bw_hz=20.0; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] -Tracking_1 -;#order: PLL/DLL loop filter order [2] or [3] Tracking_1C.order=3; -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] Tracking_1C.dump=false -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. Tracking_1C.dump_filename=../data/epl_tracking_ch_ ;######### TELEMETRY DECODER GPS CONFIG ############ -;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L1 C/A TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder TelemetryDecoder_1C.dump=false @@ -225,9 +116,7 @@ TelemetryDecoder_1C.dump=false ;######### OBSERVABLES CONFIG ############ ;#implementation: Observables.implementation=Hybrid_Observables -;#dump: Enable or disable the Observables internal binary data file logging [true] or [false] Observables.dump=false -;#dump_filename: Log path and filename. Observables.dump_filename=./observables.dat @@ -237,20 +126,12 @@ PVT.implementation=RTKLIB_PVT PVT.positioning_mode=PPP_Static ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad -;#output_rate_ms: Period between two PVT outputs. Notice that the minimum period is equal to the tracking integration time (for GPS CA L1 is 1 ms) [ms] PVT.output_rate_ms=500 -;#display_rate_ms: Position console print (std::out) interval [ms]. Notice that output_rate_ms<=display_rate_ms. PVT.display_rate_ms=500 -;# RINEX, KML, and NMEA output configuration -;#nmea_dump_filename: NMEA log path and filename PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea; -;#flag_nmea_tty_port: Enable or disable the NMEA log to a serial TTY port (Can be used with real hardware or virtual one) PVT.flag_nmea_tty_port=true; -;#nmea_dump_devname: serial device descriptor for NMEA logging PVT.nmea_dump_devname=/dev/pts/4 -;#dump: Enable or disable the PVT internal binary data file logging [true] or [false] PVT.dump=false -;#dump_filename: Log path and filename without extension. Notice that PVT will add ".dat" to the binary dump and ".kml" to GoogleEarth dump. PVT.dump_filename=./PVT diff --git a/conf/gnss-sdr_GPS_L1_USRP_X300_realtime.conf b/conf/gnss-sdr_GPS_L1_USRP_X300_realtime.conf index aaef910d3..89f84fd77 100644 --- a/conf/gnss-sdr_GPS_L1_USRP_X300_realtime.conf +++ b/conf/gnss-sdr_GPS_L1_USRP_X300_realtime.conf @@ -1,3 +1,6 @@ +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; Configuration file for using USRP X300 as a RF front-end for GPS L1 signals. ; Set SignalSource.device_address to the IP address of your device ; and run: @@ -26,154 +29,66 @@ GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 ;######### SIGNAL_SOURCE CONFIG ############ -; # implementation: SignalSource.implementation=UHD_Signal_Source -; # When left empty, the device discovery routines will search all vailable transports on the system (ethernet, usb...) SignalSource.device_address=192.168.40.2 ; <- PUT THE IP ADDRESS OF YOUR USRP HERE -; # item_type: Type and resolution for each of the signal samples. -;SignalSource.item_type=gr_complex SignalSource.item_type=cshort -; # sampling_frequency: Original Signal sampling frequency in samples per second SignalSource.sampling_frequency=4000000 -; # freq: RF front-end center frequency in [Hz] SignalSource.freq=1575420000 -; # gain: Front-end Gain in [dB] SignalSource.gain=40 -; # subdevice: UHD subdevice specification (for USRP1 use A:0 or B:0) SignalSource.subdevice=A:0 -; # samples: Number of samples to be processed. Notice that 0 indicates the entire file. SignalSource.samples=0 -; # repeat: Repeat the processing file. SignalSource.repeat=false -; # dump: Dump the Signal source data to a file. SignalSource.dump=false SignalSource.dump_filename=../data/signal_source.dat -;#enable_throttle_control: Enabling this option tells the signal source to keep the delay between samples in post processing. -; it helps to not overload the CPU, but the processing time will be longer. SignalSource.enable_throttle_control=false ;######### SIGNAL_CONDITIONER CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. - -;#implementation: Use [Pass_Through] or [Signal_Conditioner] -;#[Pass_Through] disables this block and the [DataTypeAdapter], [InputFilter] and [Resampler] blocks -;#[Signal_Conditioner] enables this block. Then you have to configure [DataTypeAdapter], [InputFilter] and [Resampler] blocks SignalConditioner.implementation=Signal_Conditioner -;SignalConditioner.implementation=Pass_Through ;######### DATA_TYPE_ADAPTER CONFIG ############ -;## Changes the type of input data. -;#implementation: [Pass_Through] disables this block DataTypeAdapter.implementation=Pass_Through DataTypeAdapter.item_type=cshort -;DataTypeAdapter.item_type=cbyte ;######### INPUT_FILTER CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter] -;#[Pass_Through] disables this block -;#[Fir_Filter] enables a FIR Filter -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation that shifts IF down to zero Hz. - InputFilter.implementation=Fir_Filter -;InputFilter.implementation=Freq_Xlating_Fir_Filter -;InputFilter.implementation=Pass_Through - -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of gnuradio's function: gr_remez. -;#This function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, -;#the desired response on those bands, and the weight given to the error in those bands. - -;#input_item_type: Type and resolution for input signal samples. InputFilter.input_item_type=cshort - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter.output_item_type=gr_complex - -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. InputFilter.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time InputFilter.number_of_taps=11 - -;#number_of _bands: Number of frequency bands in the filter. InputFilter.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - InputFilter.band1_begin=0.0 InputFilter.band1_end=0.48 InputFilter.band2_begin=0.52 InputFilter.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - InputFilter.ampl1_begin=1.0 InputFilter.ampl1_end=1.0 InputFilter.ampl2_begin=0.0 InputFilter.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands InputFilter.band1_error=1.0 InputFilter.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" InputFilter.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. InputFilter.grid_density=16 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. -;#InputFilter.IF is the intermediate frequency (in Hz) shifted down to zero Hz - InputFilter.sampling_frequency=4000000 InputFilter.IF=0 - -;#dump: Dump the filtered data to a file. InputFilter.dump=false - -;#dump_filename: Log path and filename. InputFilter.dump_filename=../data/input_filter.dat ;######### RESAMPLER CONFIG ############ -;## Resamples the input data. -;#implementation: Use [Pass_Through] or [Direct_Resampler] -;#[Pass_Through] disables this block -;#[Direct_Resampler] enables a resampler that implements a nearest neigbourhood interpolation -;Resampler.implementation=Direct_Resampler Resampler.implementation=Pass_Through -;#item_type: Type and resolution for each of the signal samples. Resampler.item_type=gr_complex -;#sample_freq_in: the sample frequency of the input signal Resampler.sample_freq_in=4000000 -;#sample_freq_out: the desired sample frequency of the output signal Resampler.sample_freq_out=4000000 -;#dump: Dump the resampled data to a file. Resampler.dump=false -;#dump_filename: Log path and filename. Resampler.dump_filename=../data/resampler.dat ;######### CHANNELS GLOBAL CONFIG ############ -;#count: Number of available GPS satellite channels. Channels_1C.count=8 -;#count: Number of available Galileo satellite channels. Channels_1B.count=0 -;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver Channels.in_acquisition=1 -;#system: GPS, GLONASS, GALILEO, SBAS or COMPASS -;#if the option is disabled by default is assigned GPS -;Channel.system=GPS Channel.signal=1C -;#if the option is disabled by default is assigned "1C" GPS L1 C/A ;Channel0.signal=1C ;Channel1.signal=1C @@ -188,68 +103,28 @@ Channel.signal=1C ;Channel10.signal=1C ;Channel11.signal=1C -;######### SPECIFIC CHANNELS CONFIG ###### -;#The following options are specific to each channel and overwrite the generic options - -;######### CHANNEL 0 CONFIG ############ - -;Channel0.system=GPS -;Channel0.signal=1C - -;#satellite: Satellite PRN ID for this channel. Disable this option to random search -;Channel0.satellite=11 - -;######### CHANNEL 1 CONFIG ############ - -;Channel1.system=GPS -;Channel1.signal=1C -;Channel1.satellite=18 - - ;######### ACQUISITION GLOBAL CONFIG ############ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition -;#item_type: Type and resolution for each of the signal samples. Acquisition_1C.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1C.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] Acquisition_1C.coherent_integration_time_ms=1 -;#threshold: Acquisition threshold. It will be ignored if pfa is defined. Acquisition_1C.threshold=0.01 -;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition] ;Acquisition_1C.pfa=0.00001 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1C.doppler_max=8000 -;#doppler_max: Doppler step in the grid search [Hz] Acquisition_1C.doppler_step=500 -;#bit_transition_flag: Enable or disable a strategy to deal with bit transitions in GPS signals: process two dwells and take -maximum test statistics. Only use with implementation: [GPS_L1_CA_PCPS_Acquisition] (should not be used for Galileo_E1_PCPS_Ambiguous_Acquisition]) Acquisition_1C.bit_transition_flag=false -;#max_dwells: Maximum number of consecutive dwells to be processed. It will be ignored if bit_transition_flag=true Acquisition_1C.max_dwells=1 -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] Acquisition_1C.dump=false -;#filename: Log path and filename Acquisition_1C.dump_filename=./acq_dump.dat ;######### TRACKING GLOBAL CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_1C.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] -Tracking_1C.if=0 -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1C.pll_bw_hz=30.0; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] Tracking_1C.dll_bw_hz=4.0; -;#order: PLL/DLL loop filter order [2] or [3] Tracking_1C.order=3; -;#early_late_space_chips: correlator early-late space [chips]. Use [0.5] Tracking_1C.early_late_space_chips=0.5; -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] Tracking_1C.dump=false -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. Tracking_1C.dump_filename=./tracking_ch_ @@ -259,35 +134,23 @@ TelemetryDecoder_1C.dump=false ;######### OBSERVABLES CONFIG ############ -;#implementation: Observables.implementation=Hybrid_Observables -;#dump: Enable or disable the Observables internal binary data file logging [true] or [false] Observables.dump=false -;#dump_filename: Log path and filename. Observables.dump_filename=./observables.dat ;######### PVT CONFIG ############ -;#implementation: Position Velocity and Time (PVT) implementation: PVT.implementation=RTKLIB_PVT PVT.positioning_mode=PPP_Static ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad -;#output_rate_ms: Period between two PVT outputs. Notice that the minimum period is equal to the tracking integration time (for GPS CA L1 is 1ms) [ms] PVT.output_rate_ms=100 -;#display_rate_ms: Position console print (std::out) interval [ms]. Notice that output_rate_ms<=display_rate_ms. PVT.display_rate_ms=500 -;# KML, GeoJSON, NMEA and RTCM output configuration -;#nmea_dump_filename: NMEA log path and filename PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea; -;#flag_nmea_tty_port: Enable or disable the NMEA log to a serial TTY port (Can be used with real hardware or virtual one) PVT.flag_nmea_tty_port=false; -;#nmea_dump_devname: serial device descriptor for NMEA logging PVT.nmea_dump_devname=/dev/pts/4 PVT.flag_rtcm_server=true PVT.flag_rtcm_tty_port=false PVT.rtcm_dump_devname=/dev/pts/1 -;#dump: Enable or disable the PVT internal binary data file logging [true] or [false] PVT.dump=false -;#dump_filename: Log path and filename without extension. Notice that PVT will add ".dat" to the binary dump and ".kml" to GoogleEarth dump. PVT.dump_filename=./PVT diff --git a/conf/gnss-sdr_GPS_L1_USRP_realtime.conf b/conf/gnss-sdr_GPS_L1_USRP_realtime.conf index 72fa42adf..1cb41801f 100644 --- a/conf/gnss-sdr_GPS_L1_USRP_realtime.conf +++ b/conf/gnss-sdr_GPS_L1_USRP_realtime.conf @@ -1,3 +1,6 @@ +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; Configuration file for using USRP 1 as a RF front-end for GPS L1 signals. ; Run: ; gnss-sdr --config_file=/path/to/gnss-sdr_GPS_L1_USRP_realtime.conf @@ -25,145 +28,27 @@ GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 ;######### SIGNAL_SOURCE CONFIG ############ -;#implementation SignalSource.implementation=UHD_Signal_Source -;#When left empty, the device discovery routines will search all available transports on the system (ethernet, usb...) ;SignalSource.device_address=192.168.40.2 ; <- PUT THE IP ADDRESS OF YOUR USRP HERE -;#item_type: Type and resolution for each of the signal samples. SignalSource.item_type=gr_complex -;#sampling_frequency: Original Signal sampling frequency in samples per second SignalSource.sampling_frequency=2000000 -;#freq: RF front-end center frequency in [Hz] SignalSource.freq=1575420000 -;#gain: Front-end Gain in [dB] SignalSource.gain=60 -;#subdevice: UHD subdevice specification (for USRP1 use A:0 or B:0) SignalSource.subdevice=A:0 -;#samples: Number of samples to be processed. Notice that 0 indicates the entire file. SignalSource.samples=0 -;#repeat: Repeat the processing file. SignalSource.repeat=false -;#dump: Dump the Signal source data to a file. SignalSource.dump=false SignalSource.dump_filename=../data/signal_source.dat -;#enable_throttle_control: Enabling this option tells the signal source to keep the delay between samples in post processing. -; it helps to not overload the CPU, but the processing time will be longer. SignalSource.enable_throttle_control=false ;######### SIGNAL_CONDITIONER CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. - -;#implementation: Use [Pass_Through] or [Signal_Conditioner] -;#[Pass_Through] disables this block and the [DataTypeAdapter], [InputFilter] and [Resampler] blocks -;#[Signal_Conditioner] enables this block. Then you have to configure [DataTypeAdapter], [InputFilter] and [Resampler] blocks -;SignalConditioner.implementation=Signal_Conditioner SignalConditioner.implementation=Pass_Through -;######### DATA_TYPE_ADAPTER CONFIG ############ -;## Changes the type of input data. Please disable it in this version. -;#implementation: [Pass_Through] disables this block -DataTypeAdapter.implementation=Pass_Through - -;######### INPUT_FILTER CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter] -;#[Pass_Through] disables this block -;#[Fir_Filter] enables a FIR Filter -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation that shifts IF down to zero Hz. - -;InputFilter.implementation=Fir_Filter -;InputFilter.implementation=Freq_Xlating_Fir_Filter -InputFilter.implementation=Pass_Through - -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of gnuradio's function: gr_remez. -;#This function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, -;#the desired response on those bands, and the weight given to the error in those bands. - -;#input_item_type: Type and resolution for input signal samples. -InputFilter.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. -InputFilter.output_item_type=gr_complex - -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. -InputFilter.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time -InputFilter.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. -InputFilter.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - -InputFilter.band1_begin=0.0 -InputFilter.band1_end=0.45 -InputFilter.band2_begin=0.55 -InputFilter.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - -InputFilter.ampl1_begin=1.0 -InputFilter.ampl1_end=1.0 -InputFilter.ampl2_begin=0.0 -InputFilter.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands -InputFilter.band1_error=1.0 -InputFilter.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" -InputFilter.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. -InputFilter.grid_density=16 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. -;#InputFilter.IF is the intermediate frequency (in Hz) shifted down to zero Hz - -InputFilter.sampling_frequency=2000000 -InputFilter.IF=0 - -;#dump: Dump the filtered data to a file. -InputFilter.dump=false - -;#dump_filename: Log path and filename. -InputFilter.dump_filename=../data/input_filter.dat - - -;######### RESAMPLER CONFIG ############ -;## Resamples the input data. -;#implementation: Use [Pass_Through] or [Direct_Resampler] -;#[Pass_Through] disables this block -;#[Direct_Resampler] enables a resampler that implements a nearest neigbourhood interpolation -;Resampler.implementation=Direct_Resampler -Resampler.implementation=Pass_Through -;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version. -Resampler.item_type=gr_complex -;#sample_freq_in: the sample frequency of the input signal -Resampler.sample_freq_in=8000000 -;#sample_freq_out: the desired sample frequency of the output signal -Resampler.sample_freq_out=2000000 -;#dump: Dump the resamplered data to a file. -Resampler.dump=false -;#dump_filename: Log path and filename. -Resampler.dump_filename=../data/resampler.dat - ;######### CHANNELS GLOBAL CONFIG ############ -;#count: Number of available GPS satellite channels. Channels_1C.count=6 -;#count: Number of available Galileo satellite channels. Channels_1B.count=0 -;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver Channels.in_acquisition=1 @@ -175,86 +60,42 @@ Channels.in_acquisition=1 ;# "5X" GALILEO E5a I+Q ;# "L5" GPS L5 -;#if the option is disabled by default is assigned "1C" GPS L1 C/A Channel.signal=1C -;######### SPECIFIC CHANNELS CONFIG ###### -;#The following options are specific to each channel and overwrite the generic options - -;######### CHANNEL 0 CONFIG ############ - -;Channel0.system=GPS -;Channel0.signal=1C - -;#satellite: Satellite PRN ID for this channel. Disable this option to random search -;Channel0.satellite=11 - -;######### CHANNEL 1 CONFIG ############ - -;Channel1.system=GPS -;Channel1.signal=1C -;Channel1.satellite=18 - ;######### ACQUISITION GLOBAL CONFIG ############ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition -;#item_type: Type and resolution for each of the signal samples. Acquisition_1C.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1C.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] Acquisition_1C.coherent_integration_time_ms=1 -;#threshold: Acquisition threshold. It will be ignored if pfa is defined. Acquisition_1C.threshold=0.01 -;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition] ;Acquisition_1C.pfa=0.0001 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1C.doppler_max=10000 -;#doppler_max: Doppler step in the grid search [Hz] Acquisition_1C.doppler_step=500 -;#bit_transition_flag: Enable or disable a strategy to deal with bit transitions in GPS signals: process two dwells and take -maximum test statistics. Only use with implementation: [GPS_L1_CA_PCPS_Acquisition] (should not be used for Galileo_E1_PCPS_Ambiguous_Acquisition]) Acquisition_1C.bit_transition_flag=false -;#max_dwells: Maximum number of consecutive dwells to be processed. It will be ignored if bit_transition_flag=true Acquisition_1C.max_dwells=1 -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] Acquisition_1C.dump=false -;#filename: Log path and filename Acquisition_1C.dump_filename=./acq_dump.dat ;######### TRACKING GLOBAL CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_1C.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] -Tracking_1C.if=0 -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1C.pll_bw_hz=30.0; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] Tracking_1C.dll_bw_hz=4.0; -;#order: PLL/DLL loop filter order [2] or [3] Tracking_1C.order=3; -;#early_late_space_chips: correlator early-late space [chips] Tracking_1C.early_late_space_chips=0.5; -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] Tracking_1C.dump=false -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. Tracking_1C.dump_filename=./tracking_ch_ ;######### TELEMETRY DECODER GPS CONFIG ############ -;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L1 C/A TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder TelemetryDecoder_1C.dump=false ;######### OBSERVABLES CONFIG ############ -;#implementation: Observables.implementation=Hybrid_Observables -;#dump: Enable or disable the Observables internal binary data file logging [true] or [false] Observables.dump=false -;#dump_filename: Log path and filename. Observables.dump_filename=./observables.dat @@ -264,21 +105,13 @@ PVT.implementation=RTKLIB_PVT PVT.positioning_mode=PPP_Static ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad -;#output_rate_ms: Period between two PVT outputs. Notice that the minimum period is equal to the tracking integration time (for GPS CA L1 is 1ms) [ms] PVT.output_rate_ms=100 -;#display_rate_ms: Position console print (std::out) interval [ms]. Notice that output_rate_ms<=display_rate_ms. PVT.display_rate_ms=500 -;# KML, GeoJSON, NMEA and RTCM output configuration -;#nmea_dump_filename: NMEA log path and filename PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea; -;#flag_nmea_tty_port: Enable or disable the NMEA log to a serial TTY port (Can be used with real hardware or virtual one) PVT.flag_nmea_tty_port=false; -;#nmea_dump_devname: serial device descriptor for NMEA logging PVT.nmea_dump_devname=/dev/pts/4 PVT.flag_rtcm_server=true PVT.flag_rtcm_tty_port=false PVT.rtcm_dump_devname=/dev/pts/1 -;#dump: Enable or disable the PVT internal binary data file logging [true] or [false] PVT.dump=false -;#dump_filename: Log path and filename without extension. Notice that PVT will add ".dat" to the binary dump and ".kml" to GoogleEarth dump. PVT.dump_filename=./PVT diff --git a/conf/gnss-sdr_GPS_L1_acq_QuickSync.conf b/conf/gnss-sdr_GPS_L1_acq_QuickSync.conf index 1cd08b216..1f74645fb 100644 --- a/conf/gnss-sdr_GPS_L1_acq_QuickSync.conf +++ b/conf/gnss-sdr_GPS_L1_acq_QuickSync.conf @@ -1,4 +1,6 @@ -; Default configuration file +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; @@ -12,233 +14,87 @@ GNSS-SDR.internal_fs_sps=4000000 ;######### SIGNAL_SOURCE CONFIG ############ SignalSource.implementation=File_Signal_Source -;#filename: path to file with the captured GNSS signal samples to be processed SignalSource.filename=/datalogger/signals/CTTC/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat ; <- PUT YOUR FILE HERE SignalSource.item_type=ishort -;#sampling_frequency: Original Signal sampling frequency in samples per second SignalSource.sampling_frequency=4000000 -;#samples: Number of samples to be processed. Notice that 0 indicates the entire file. SignalSource.samples=0 -;#repeat: Repeat the processing file. SignalSource.repeat=false -;#enable_throttle_control: Enabling this option tells the signal source to keep the delay between samples in post processing. -; it helps to not overload the CPU, but the processing time will be longer. SignalSource.enable_throttle_control=false ;######### SIGNAL_CONDITIONER CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. - -;#implementation: Use [Pass_Through] or [Signal_Conditioner] -;#[Pass_Through] disables this block and the [DataTypeAdapter], [InputFilter] and [Resampler] blocks -;#[Signal_Conditioner] enables this block. Then you have to configure [DataTypeAdapter], [InputFilter] and [Resampler] blocks SignalConditioner.implementation=Signal_Conditioner ;######### DATA_TYPE_ADAPTER CONFIG ############ -;## Changes the type of input data. -;#implementation: Use [Ishort_To_Complex] or [Pass_Through] DataTypeAdapter.implementation=Ishort_To_Complex -;#dump: Dump the filtered data to a file. DataTypeAdapter.dump=false -;#dump_filename: Log path and filename. DataTypeAdapter.dump_filename=../data/data_type_adapter.dat ;######### INPUT_FILTER CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter] -;#[Pass_Through] disables this block -;#[Fir_Filter] enables a FIR Filter -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation that shifts IF down to zero Hz. - -;InputFilter.implementation=Fir_Filter -;InputFilter.implementation=Freq_Xlating_Fir_Filter InputFilter.implementation=Pass_Through - -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of gnuradio's function: gr_remez. -;#This function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, -;#the desired response on those bands, and the weight given to the error in those bands. - -;#input_item_type: Type and resolution for input signal samples InputFilter.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter.output_item_type=gr_complex - -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. -InputFilter.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time -InputFilter.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. -InputFilter.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - -InputFilter.band1_begin=0.0 -;InputFilter.band1_end=0.8 -InputFilter.band1_end=0.85 -InputFilter.band2_begin=0.90 -InputFilter.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - -InputFilter.ampl1_begin=1.0 -InputFilter.ampl1_end=1.0 -InputFilter.ampl2_begin=0.0 -InputFilter.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands -InputFilter.band1_error=1.0 -InputFilter.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" -InputFilter.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. -InputFilter.grid_density=16 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. -;#InputFilter.IF is the intermediate frequency (in Hz) shifted down to zero Hz - -InputFilter.sampling_frequency=4000000 -InputFilter.IF=0 - -;#dump: Dump the filtered data to a file. InputFilter.dump=false - -;#dump_filename: Log path and filename. InputFilter.dump_filename=../data/input_filter.dat ;######### RESAMPLER CONFIG ############ -;## Resamples the input data. - -;#implementation: Use [Pass_Through] or [Direct_Resampler] -;#[Pass_Through] disables this block -;#[Direct_Resampler] enables a resampler that implements a nearest neigbourhood interpolation -;Resampler.implementation=Direct_Resampler Resampler.implementation=Pass_Through -;#item_type: Type and resolution for each of the signal samples. Resampler.item_type=gr_complex -;#sample_freq_in: the sample frequency of the input signal Resampler.sample_freq_in=4000000 -;#sample_freq_out: the desired sample frequency of the output signal Resampler.sample_freq_out=4000000 -;#dump: Dump the resamplered data to a file. Resampler.dump=false -;#dump_filename: Log path and filename. Resampler.dump_filename=../data/resampler.dat ;######### CHANNELS GLOBAL CONFIG ############ -;#count: Number of available satellite channels. Channels_1C.count=5 -;#in_acquisition: Number of channels simultaneously acquiring Channels.in_acquisition=1 -;######### CHANNEL 0 CONFIG ############ -Channel0.signal=1C -Channel0.satellite=1 -Channel0.repeat_satellite=false - -;######### CHANNEL 1 CONFIG ############ -Channel1.signal=1C -Channel1.satellite=11 -Channel1.repeat_satellite=false - -;######### CHANNEL 2 CONFIG ############ -Channel2.signal=1C -Channel2.satellite=17 -Channel2.repeat_satellite=false - -;######### CHANNEL 3 CONFIG ############ -Channel3.signal=1C -Channel3.satellite=20 -Channel3.repeat_satellite=false - -;######### CHANNEL 4 CONFIG ############ -Channel4.signal=1C -Channel4.satellite=32 -Channel4.repeat_satellite=false - ;######### ACQUISITION GLOBAL CONFIG ############_1C Acquisition_1C.implementation=GPS_L1_CA_PCPS_QuickSync_Acquisition -;#item_type: Type and resolution for each of the signal samples. Acquisition_1C.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1C.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] Acquisition_1C.coherent-integration_time_ms=4 -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] Acquisition_1C.dump=true -;#filename: Log path and filename ;Acquisition_1C.dump_filename=./acq_dump.dat ;######### ACQUISITION CHANNELS CONFIG ###### Acquisition_1C.implementation=GPS_L1_CA_PCPS_QuickSync_Acquisition -;#threshold: Acquisition threshold Acquisition_1C.threshold=0.4 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1C.doppler_max=10000 -;#doppler_max: Doppler step in the grid search [Hz] Acquisition_1C.doppler_step=250 -;#repeat_satellite: Use only jointly with the satellte PRN ID option. ;######### TRACKING GLOBAL CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_1C.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] -Tracking_1C.if=0 -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1C.pll_bw_hz=50.0; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] Tracking_1C.dll_bw_hz=4.0; -;#order: PLL/DLL loop filter order [2] or [3] Tracking_1C.order=3; -;#early_late_space_chips: correlator early-late space [chips]. Use [0.5] Tracking_1C.early_late_space_chips=0.5 -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] Tracking_1C.dump=false -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. Tracking_1C.dump_filename=./tracking_ch_ ;######### TELEMETRY DECODER CONFIG ############ -;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L1 C/A. TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder TelemetryDecoder_1C.dump=false ;######### OBSERVABLES CONFIG ############ -;#implementation: Observables.implementation=Hybrid_Observables -;#dump: Enable or disable the Observables internal binary data file logging [true] or [false] Observables.dump=false -;#dump_filename: Log path and filename. Observables.dump_filename=./observables.dat ;######### PVT CONFIG ############ -;#implementation: Position Velocity and Time (PVT) implementation: PVT.implementation=RTKLIB_PVT PVT.positioning_mode=PPP_Static ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad -;#output_rate_ms: Period between two PVT outputs. Notice that the minimum period is equal to the tracking integration time (for GPS CA L1 is 1 ms) [ms] PVT.output_rate_ms=100; -;#display_rate_ms: Position console print (std::out) interval [ms]. Notice that output_rate_ms<=display_rate_ms. PVT.display_rate_ms=500; PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea PVT.flag_nmea_tty_port=true @@ -246,7 +102,5 @@ PVT.nmea_dump_devname=/dev/pts/4 PVT.flag_rtcm_server=false PVT.flag_rtcm_tty_port=false PVT.rtcm_dump_devname=/dev/pts/1 -;#dump: Enable or disable the PVT internal binary data file logging [true] or [false] PVT.dump=false -;#dump_filename: Log path and filename without extension. Notice that PVT will add ".dat" to the binary dump and ".kml" to GoogleEarth dump. PVT.dump_filename=./PVT diff --git a/conf/gnss-sdr_GPS_L1_bladeRF.conf b/conf/gnss-sdr_GPS_L1_bladeRF.conf index 84fe13d8b..48017a8ec 100644 --- a/conf/gnss-sdr_GPS_L1_bladeRF.conf +++ b/conf/gnss-sdr_GPS_L1_bladeRF.conf @@ -1,3 +1,6 @@ +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + [GNSS-SDR] ;######### GLOBAL OPTIONS ################## @@ -17,8 +20,7 @@ SignalSource.if_gain=48 SignalSource.AGC_enabled=false SignalSource.samples=0 SignalSource.repeat=false -;# Next line enables the bladeRF -SignalSource.osmosdr_args=bladerf=0 +SignalSource.osmosdr_args=bladerf=0 ; This line enables the bladeRF SignalSource.enable_throttle_control=false SignalSource.dump=false SignalSource.dump_filename=./signal_source.dat @@ -63,11 +65,9 @@ Channel.signal=1C ;######### ACQUISITION GLOBAL CONFIG ############ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition_Fine_Doppler Acquisition_1C.item_type=gr_complex -Acquisition_1C.if=0 -Acquisition_1C.sampled_ms=1 +Acquisition_1C.coherent_integration_time_ms=1 Acquisition_1C.threshold=0.015 Acquisition_1C.doppler_max=10000 -Acquisition_1C.doppler_min=-10000 Acquisition_1C.doppler_step=500 Acquisition_1C.max_dwells=15 Acquisition_1C.dump=false @@ -76,7 +76,6 @@ Acquisition_1C.dump_filename=./acq_dump.dat ;######### TRACKING GLOBAL CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking Tracking_1C.item_type=gr_complex -Tracking_1C.if=0 Tracking_1C.pll_bw_hz=40.0; Tracking_1C.dll_bw_hz=2.0; Tracking_1C.order=3; @@ -89,7 +88,6 @@ TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder TelemetryDecoder_1C.dump=false ;######### OBSERVABLES CONFIG ############ -#Observables.implementation=GPS_L1_CA_Observables Observables.implementation=Hybrid_Observables Observables.dump=false Observables.dump_filename=./observables.dat diff --git a/conf/gnss-sdr_GPS_L1_fmcomms2_realtime.conf b/conf/gnss-sdr_GPS_L1_fmcomms2_realtime.conf index 67fe037f8..17880d8a2 100644 --- a/conf/gnss-sdr_GPS_L1_fmcomms2_realtime.conf +++ b/conf/gnss-sdr_GPS_L1_fmcomms2_realtime.conf @@ -1,3 +1,6 @@ +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; @@ -5,9 +8,6 @@ [GNSS-SDR] ;######### GLOBAL OPTIONS ################## -;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [Sps]. -;FOR USE GNSS-SDR WITH RTLSDR DONGLES USER MUST SET THE CALIBRATED SAMPLE RATE HERE -; i.e. using front-end-cal as reported here:http://www.cttc.es/publication/turning-a-television-into-a-gnss-receiver/ GNSS-SDR.internal_fs_sps=2000000 @@ -73,10 +73,6 @@ InputFilter.sampling_frequency=2000000 InputFilter.IF=0; IF deviation due to front-end LO inaccuracies [Hz] ;######### RESAMPLER CONFIG ############ -;## Resamples the input data. -;# DISABLED IN THE RTL-SDR REALTIME -;#implementation: Use [Pass_Through] or [Direct_Resampler] -;#[Pass_Through] disables this block Resampler.implementation=Pass_Through ;######### CHANNELS GLOBAL CONFIG ############ @@ -88,12 +84,10 @@ Channel.signal=1C ;######### ACQUISITION GLOBAL CONFIG ############ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition_Fine_Doppler Acquisition_1C.item_type=gr_complex -Acquisition_1C.if=0 -Acquisition_1C.sampled_ms=1 +Acquisition_1C.coherent_integration_time_ms=1 Acquisition_1C.threshold=0.015 ;Acquisition_1C.pfa=0.0001 Acquisition_1C.doppler_max=10000 -Acquisition_1C.doppler_min=-10000 Acquisition_1C.doppler_step=500 Acquisition_1C.max_dwells=15 Acquisition_1C.dump=false @@ -103,7 +97,6 @@ Acquisition_1C.dump_filename=./acq_dump.dat ;######### TRACKING GLOBAL CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking Tracking_1C.item_type=gr_complex -Tracking_1C.if=0 Tracking_1C.dump=false Tracking_1C.dump_filename=./tracking_ch_ Tracking_1C.pll_bw_hz=40.0; @@ -115,7 +108,6 @@ Tracking_1C.early_late_space_chips=0.5; ;######### TELEMETRY DECODER GPS CONFIG ############ TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder TelemetryDecoder_1C.dump=false -TelemetryDecoder_1C.decimation_factor=1; ;######### OBSERVABLES CONFIG ############ diff --git a/conf/gnss-sdr_GPS_L1_gr_complex.conf b/conf/gnss-sdr_GPS_L1_gr_complex.conf index 99118a0c4..0cf4d146c 100644 --- a/conf/gnss-sdr_GPS_L1_gr_complex.conf +++ b/conf/gnss-sdr_GPS_L1_gr_complex.conf @@ -1,19 +1,23 @@ +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf -; + [GNSS-SDR] ;######### GLOBAL OPTIONS ################## ;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second]. -GNSS-SDR.internal_fs_sps=2600000 +GNSS-SDR.internal_fs_sps=4000000 ;######### SIGNAL_SOURCE CONFIG ############ SignalSource.implementation=File_Signal_Source -SignalSource.filename=/home/javier/gnss/gnss-simulator/build/signal_out.bin ; <- PUT YOUR FILE HERE -SignalSource.item_type=byte -SignalSource.sampling_frequency=2600000 +SignalSource.filename=/datalogger/signals/CTTC/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat ; <- PUT YOUR FILE HERE +SignalSource.item_type=ishort +SignalSource.sampling_frequency=4000000 +SignalSource.freq=1575420000 SignalSource.samples=0 SignalSource.repeat=false SignalSource.enable_throttle_control=false @@ -22,12 +26,8 @@ SignalSource.enable_throttle_control=false ;######### SIGNAL_CONDITIONER CONFIG ############ SignalConditioner.implementation=Signal_Conditioner -;######### DATA_TYPE_ADAPTER CONFIG ############ -;## Changes the type of input data. -;#implementation: [Pass_Through] disables this block -DataTypeAdapter.implementation=Ibyte_To_Complex +DataTypeAdapter.implementation=Ishort_To_Complex DataTypeAdapter.dump=false -;#dump_filename: Log path and filename. DataTypeAdapter.dump_filename=../data/DataTypeAdapter.dat InputFilter.implementation=Pass_Through @@ -47,9 +47,8 @@ Channel.signal=1C ;######### ACQUISITION GLOBAL CONFIG ############ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition Acquisition_1C.item_type=gr_complex -Acquisition_1C.if=0 -Acquisition_1C.sampled_ms=1 -Acquisition_1C.threshold=0.05 +Acquisition_1C.coherent_integration_time_ms=1 +Acquisition_1C.threshold=0.008 ;Acquisition_1C.pfa=0.01 Acquisition_1C.doppler_max=10000 Acquisition_1C.doppler_step=250 @@ -60,9 +59,10 @@ Acquisition_1C.dump_filename=./acq_dump.dat ;######### TRACKING GLOBAL CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_C_Aid_Tracking Tracking_1C.item_type=gr_complex -Tracking_1C.if=0 -Tracking_1C.pll_bw_hz=25.0; -Tracking_1C.dll_bw_hz=1.0; +Tracking_1C.dump=true +Tracking_1C.dump_filename=epl_tracking_ch_ +Tracking_1C.pll_bw_hz=40.0; +Tracking_1C.dll_bw_hz=4.0; Tracking_1C.order=3; Tracking_1C.dump=false Tracking_1C.dump_filename=../data/epl_tracking_c diff --git a/conf/gnss-sdr_GPS_L1_gr_complex_gpu.conf b/conf/gnss-sdr_GPS_L1_gr_complex_gpu.conf index 0111fc5e9..7ecb75715 100644 --- a/conf/gnss-sdr_GPS_L1_gr_complex_gpu.conf +++ b/conf/gnss-sdr_GPS_L1_gr_complex_gpu.conf @@ -1,3 +1,6 @@ +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; @@ -33,8 +36,7 @@ Channel.signal=1C ;######### ACQUISITION GLOBAL CONFIG ############ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition Acquisition_1C.item_type=gr_complex -Acquisition_1C.if=0 -Acquisition_1C.sampled_ms=1 +Acquisition_1C.coherent_integration_time_ms=1 Acquisition_1C.threshold=0.005 ;Acquisition_1C.pfa=0.01 Acquisition_1C.doppler_max=10000 @@ -46,7 +48,6 @@ Acquisition_1C.dump_filename=./acq_dump.dat ;######### TRACKING GLOBAL CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking_GPU Tracking_1C.item_type=gr_complex -Tracking_1C.if=0 Tracking_1C.dump=false Tracking_1C.dump_filename=../data/epl_tracking_ch_ Tracking_1C.pll_bw_hz=45.0; diff --git a/conf/gnss-sdr_GPS_L1_ishort.conf b/conf/gnss-sdr_GPS_L1_ishort.conf index e3395c982..a9528d183 100644 --- a/conf/gnss-sdr_GPS_L1_ishort.conf +++ b/conf/gnss-sdr_GPS_L1_ishort.conf @@ -1,3 +1,6 @@ +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; @@ -13,7 +16,7 @@ ControlThread.wait_for_flowgraph=false ;######### SIGNAL_SOURCE CONFIG ############ SignalSource.implementation=File_Signal_Source -SignalSource.filename=/archive/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat ;/datalogger/signals/CTTC/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat ; <- PUT YOUR FILE HERE +SignalSource.filename=/archive/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat ; <- PUT YOUR FILE HERE SignalSource.item_type=ishort SignalSource.sampling_frequency=4000000 SignalSource.samples=0 @@ -26,18 +29,12 @@ SignalSource.enable_throttle_control=false ;######### SIGNAL_CONDITIONER CONFIG ############ SignalConditioner.implementation=Signal_Conditioner -;DataTypeAdapter.implementation=Ishort_To_Complex DataTypeAdapter.implementation=Ishort_To_Cshort InputFilter.implementation=Pass_Through -;InputFilter.input_item_type=gr_complex -;InputFilter.output_item_type=gr_complex InputFilter.item_type=cshort -;Resampler.implementation=Pass_Through -;Resampler.item_type=gr_complex Resampler.implementation=Direct_Resampler Resampler.sample_freq_in=4000000 Resampler.sample_freq_out=2000000 -;Resampler.item_type=gr_complex Resampler.item_type=cshort ;######### CHANNELS GLOBAL CONFIG ############ @@ -49,39 +46,33 @@ Channel.signal=1C ;######### ACQUISITION GLOBAL CONFIG ############ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition Acquisition_1C.item_type=cshort -Acquisition_1C.if=0 -Acquisition_1C.sampled_ms=1 +Acquisition_1C.coherent_integration_time_ms=1 Acquisition_1C.threshold=0.008 ;Acquisition_1C.pfa=0.000001 Acquisition_1C.doppler_max=10000 Acquisition_1C.doppler_step=250 -Acquisition_1C.tong_init_val=2 -Acquisition_1C.tong_max_val=10 -Acquisition_1C.tong_max_dwells=20 Acquisition_1C.dump=false Acquisition_1C.dump_filename=./acq_dump.dat - +Acquisition_1C.blocking=false; ;######### TRACKING GLOBAL CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_C_Aid_Tracking Tracking_1C.item_type=cshort -Tracking_1C.if=0 -Tracking_1C.dump=false -Tracking_1C.dump_filename=../data/epl_tracking_ch_ Tracking_1C.pll_bw_hz=40.0; Tracking_1C.dll_bw_hz=4.0; Tracking_1C.order=3; +Tracking_1C.dump=false; +Tracking_1C.dump_filename=./epl_tracking_ch_ ;######### TELEMETRY DECODER GPS CONFIG ############ TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder TelemetryDecoder_1C.dump=false -TelemetryDecoder_1C.decimation_factor=1; ;######### OBSERVABLES CONFIG ############ Observables.implementation=Hybrid_Observables -Observables.dump=false +Observables.dump=true Observables.dump_filename=./observables.dat diff --git a/conf/gnss-sdr_GPS_L1_nsr.conf b/conf/gnss-sdr_GPS_L1_nsr.conf index ec085add3..5e2bee6ba 100644 --- a/conf/gnss-sdr_GPS_L1_nsr.conf +++ b/conf/gnss-sdr_GPS_L1_nsr.conf @@ -1,3 +1,6 @@ +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; Sample configuration file for IFEN SX-NSR software receiver front-end ; http://www.ifen.com/products/sx-scientific-gnss-solutions/nsr-software-receiver.html ; This sample configuration is able to process directly .sream binary files @@ -80,18 +83,15 @@ Resampler.item_type=gr_complex ;######### CHANNELS GLOBAL CONFIG ############ -;#count: Number of available GPS satellite channels. Channels_1C.count=0 Channels_2S.count=8 Channels.in_acquisition=1 -#Channel.signal=1C ;######### GPS ACQUISITION CONFIG ############ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition Acquisition_1C.item_type=gr_complex -Acquisition_1C.if=0 -Acquisition_1C.sampled_ms=1 +Acquisition_1C.scoherent_integration_time_ms=1 Acquisition_1C.threshold=0.0075 ;Acquisition_1C.pfa=0.01 Acquisition_1C.doppler_max=10000 @@ -101,7 +101,6 @@ Acquisition_1C.dump_filename=./acq_dump.dat Acquisition_2S.implementation=GPS_L2_M_PCPS_Acquisition Acquisition_2S.item_type=gr_complex -Acquisition_2S.if=0 Acquisition_2S.coherent_integration_time_ms=20 Acquisition_2S.threshold=0.00045 Acquisition_2S.doppler_max=5000 @@ -115,7 +114,6 @@ Acquisition_2S.dump_filename=./acq_dump.dat ;######### TRACKING GPS CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking Tracking_1C.item_type=gr_complex -Tracking_1C.if=0 Tracking_1C.pll_bw_hz=45.0; Tracking_1C.dll_bw_hz=2.0; Tracking_1C.order=3; @@ -125,7 +123,6 @@ Tracking_1C.dump_filename=../data/epl_tracking_ch_ ;######### GPS L2C GENERIC TRACKING CONFIG ############ Tracking_2S.implementation=GPS_L2_M_DLL_PLL_Tracking Tracking_2S.item_type=gr_complex -Tracking_2S.if=0 Tracking_2S.pll_bw_hz=1.5; Tracking_2S.dll_bw_hz=0.4; Tracking_2S.order=2; @@ -143,11 +140,8 @@ TelemetryDecoder_2S.dump=false ;######### OBSERVABLES CONFIG ############ -;#implementation: Observables.implementation=Hybrid_Observables -;#dump: Enable or disable the Observables internal binary data file logging [true] or [false] Observables.dump=false -;#dump_filename: Log path and filename. Observables.dump_filename=./observables.dat diff --git a/conf/gnss-sdr_GPS_L1_nsr_twobit_packed.conf b/conf/gnss-sdr_GPS_L1_nsr_twobit_packed.conf index db5e6d23a..dffa01314 100644 --- a/conf/gnss-sdr_GPS_L1_nsr_twobit_packed.conf +++ b/conf/gnss-sdr_GPS_L1_nsr_twobit_packed.conf @@ -1,3 +1,6 @@ +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; Sample configuration file for IFEN SX-NSR software receiver front-end ; http://www.ifen.com/products/sx-scientific-gnss-solutions/nsr-software-receiver.html ; This sample configuration is able to process directly .sream binary files @@ -94,7 +97,6 @@ Resampler.item_type=gr_complex ;######### CHANNELS GLOBAL CONFIG ############ -;#count: Number of available GPS satellite channels. Channels_1C.count=8 Channels.in_acquisition=1 Channel.signal=1C diff --git a/conf/gnss-sdr_GPS_L1_plutosdr_realtime.conf b/conf/gnss-sdr_GPS_L1_plutosdr_realtime.conf index 83f808645..d3be2c6b6 100644 --- a/conf/gnss-sdr_GPS_L1_plutosdr_realtime.conf +++ b/conf/gnss-sdr_GPS_L1_plutosdr_realtime.conf @@ -1,3 +1,6 @@ +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; diff --git a/conf/gnss-sdr_GPS_L1_pulse_blanking_gr_complex.conf b/conf/gnss-sdr_GPS_L1_pulse_blanking_gr_complex.conf index 8cd02bd32..4f68bdb08 100644 --- a/conf/gnss-sdr_GPS_L1_pulse_blanking_gr_complex.conf +++ b/conf/gnss-sdr_GPS_L1_pulse_blanking_gr_complex.conf @@ -1,4 +1,6 @@ -; Default configuration file +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; @@ -25,51 +27,26 @@ GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 ;######### SIGNAL_SOURCE CONFIG ############ -;#implementation SignalSource.implementation=File_Signal_Source -;#filename: path to file with the captured GNSS signal samples to be processed SignalSource.filename=/home/javier/signals/signal_source_int.dat -;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version. SignalSource.item_type=gr_complex -;#sampling_frequency: Original Signal sampling frequency in samples per second SignalSource.sampling_frequency=2000000 -;#samples: Number of samples to be processed. Notice that 0 indicates the entire file. SignalSource.samples=0 -;#repeat: Repeat the processing file. Disable this option in this version SignalSource.repeat=false -;#dump: Dump the Signal source data to a file. Disable this option in this version SignalSource.dump=false SignalSource.dump_filename=dump.dat -;#enable_throttle_control: Enabling this option tells the signal source to keep the delay between samples in post processing. -; it helps to not overload the CPU, but the processing time will be longer. SignalSource.enable_throttle_control=false ;######### SIGNAL_CONDITIONER CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. - -;#implementation: Use [Pass_Through] or [Signal_Conditioner] -;#[Pass_Through] disables this block and the [DataTypeAdapter], [InputFilter] and [Resampler] blocks -;#[Signal_Conditioner] enables this block. Then you have to configure [DataTypeAdapter], [InputFilter] and [Resampler] blocks SignalConditioner.implementation=Signal_Conditioner ;######### INPUT_FILTER CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -;#[Pass_Through] disables this block InputFilter.implementation=Pulse_Blanking_Filter - InputFilter.Pfa=0.001 -;#input_item_type: Type and resolution for input signal samples. Use only gr_complex in this version. InputFilter.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. Use only gr_complex in this version. InputFilter.output_item_type=gr_complex - -;#dump: Dump the filtered data to a file. InputFilter.dump=false - -;#dump_filename: Log path and filename. InputFilter.dump_filename=../data/input_filter.dat ;######### CHANNELS GLOBAL CONFIG ############ @@ -81,12 +58,8 @@ Channel.signal=1C ;######### ACQUISITION GLOBAL CONFIG ############ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition Acquisition_1C.item_type=gr_complex -Acquisition_1C.if=0 -Acquisition_1C.sampled_ms=1 -;#use_CFAR_algorithm: If enabled, acquisition estimates the input signal power to implement CFAR detection algorithms -;#notice that this affects the Acquisition threshold range! +Acquisition_1C.coherent_integration_time_ms=1 Acquisition_1C.use_CFAR_algorithm=false; -;#threshold: Acquisition threshold Acquisition_1C.threshold=20 ;Acquisition_1C.pfa=0.01 Acquisition_1C.doppler_max=5000 @@ -97,27 +70,15 @@ Acquisition_1C.dump_filename=./acq_dump.dat ;######### TRACKING GPS CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_C_Aid_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_1C.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] -Tracking_1C.if=0 -;# Extended correlation after telemetry bit synchronization -;# Valid values are: [1,2,4,5,10,20] (integer divisors of the GPS L1 CA bit period (20 ms) ) -;# Longer integration period require more stable front-end LO Tracking_1C.extend_correlation_ms=10 -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1C.pll_bw_hz=35; Tracking_1C.pll_bw_narrow_hz=30; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] Tracking_1C.dll_bw_hz=2.0; Tracking_1C.dll_bw_narrow_hz=1.5; -;#fll_bw_hz: FLL loop filter bandwidth [Hz] Tracking_1C.fll_bw_hz=2.0; -;#order: PLL/DLL loop filter order [2] or [3] Tracking_1C.order=3; -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] Tracking_1C.dump=true -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. Tracking_1C.dump_filename=../data/epl_tracking_ch_ diff --git a/conf/gnss-sdr_GPS_L1_rtl_tcp_realtime.conf b/conf/gnss-sdr_GPS_L1_rtl_tcp_realtime.conf index 944a1ba36..01b30c02a 100644 --- a/conf/gnss-sdr_GPS_L1_rtl_tcp_realtime.conf +++ b/conf/gnss-sdr_GPS_L1_rtl_tcp_realtime.conf @@ -1,4 +1,6 @@ -; Default configuration file +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; @@ -29,119 +31,48 @@ GNSS-SDR.SUPL_CI=0x31b0 ;######### SIGNAL_SOURCE CONFIG ############ ;#implementation SignalSource.implementation=RtlTcp_Signal_Source -;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version. -SignalSource.item_type=gr_complex -;#sampling_frequency: Original Signal sampling frequency in samples per second -;FOR USE GNSS-SDR WITH RTLSDR DONGLES USER MUST SET THE CALIBRATED SAMPLE RATE HERE -; i.e. using front-end-cal as reported here:http://www.cttc.es/publication/turning-a-television-into-a-gnss-receiver/ SignalSource.sampling_frequency=1200000 -;#freq: RF front-end center frequency in [Hz] SignalSource.freq=1575420000 -;#gain: Front-end overall gain Gain in [dB] SignalSource.gain=40 -;#rf_gain: Front-end RF stage gain in [dB] SignalSource.rf_gain=40 -;#rf_gain: Front-end IF stage gain in [dB] SignalSource.if_gain=30 -;#AGC_enabled: Front-end AGC enabled or disabled SignalSource.AGC_enabled = false -;#samples: Number of samples to be processed. Notice that 0 indicates the entire file. SignalSource.samples=0 -;#repeat: Repeat the processing file. Disable this option in this version SignalSource.repeat=false -;#dump: Dump the Signal source data to a file. Disable this option in this version SignalSource.dump=false SignalSource.dump_filename=../data/signal_source.dat -;#enable_throttle_control: Enabling this option tells the signal source to keep the delay between samples in post processing. -; it helps to not overload the CPU, but the processing time will be longer. SignalSource.enable_throttle_control=false - -;#Address of the rtl_tcp server (IPv6 allowed) SignalSource.address=127.0.0.1 - -;#Port of the rtl_tcp server SignalSource.port=1234 - -;# Set to true if I/Q samples come swapped SignalSource.swap_iq=false ;######### SIGNAL_CONDITIONER CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. - -;#implementation: Use [Pass_Through] or [Signal_Conditioner] -;#[Pass_Through] disables this block and the [DataTypeAdapter], [InputFilter] and [Resampler] blocks -;#[Signal_Conditioner] enables this block. Then you have to configure [DataTypeAdapter], [InputFilter] and [Resampler] blocks SignalConditioner.implementation=Signal_Conditioner ;######### DATA_TYPE_ADAPTER CONFIG ############ -;## Changes the type of input data. -;#implementation: [Pass_Through] disables this block DataTypeAdapter.implementation=Pass_Through ;######### INPUT_FILTER CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter] -;#[Pass_Through] disables this block -;#[Fir_Filter] enables a FIR Filter -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation that shifts IF down to zero Hz. - InputFilter.implementation=Freq_Xlating_Fir_Filter - -;#dump: Dump the filtered data to a file. InputFilter.dump=false - -;#dump_filename: Log path and filename. InputFilter.dump_filename=../data/input_filter.dat - -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of gnuradio's function: gr_remez. -;#This function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, -;#the desired response on those bands, and the weight given to the error in those bands. - -;#input_item_type: Type and resolution for input signal samples. InputFilter.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter.output_item_type=gr_complex - -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. InputFilter.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time InputFilter.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. InputFilter.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - InputFilter.band1_begin=0.0 InputFilter.band1_end=0.45 InputFilter.band2_begin=0.55 InputFilter.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - InputFilter.ampl1_begin=1.0 InputFilter.ampl1_end=1.0 InputFilter.ampl2_begin=0.0 InputFilter.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands InputFilter.band1_error=1.0 InputFilter.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" InputFilter.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. InputFilter.grid_density=16 ;#The following options are used only in Freq_Xlating_Fir_Filter implementation. @@ -149,22 +80,15 @@ InputFilter.grid_density=16 ;FOR USE GNSS-SDR WITH RTLSDR DONGLES USER MUST SET THE CALIBRATED SAMPLE RATE HERE ; i.e. using front-end-cal as reported here:http://www.cttc.es/publication/turning-a-television-into-a-gnss-receiver/ InputFilter.sampling_frequency=1200000 -;# IF deviation due to front-end LO inaccuracies [HZ] InputFilter.IF=80558 ;######### RESAMPLER CONFIG ############ -;## Resamples the input data. -;# DISABLED IN THE RTL-SDR REALTIME -;#implementation: Use [Pass_Through] or [Direct_Resampler] -;#[Pass_Through] disables this block Resampler.implementation=Pass_Through ;######### CHANNELS GLOBAL CONFIG ############ -;#count: Number of available GPS satellite channels. Channels_1C.count=4 -;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver Channels.in_acquisition=1 Channel.signal=1C @@ -172,52 +96,30 @@ Channel.signal=1C ;######### ACQUISITION GLOBAL CONFIG ############ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition_Fine_Doppler -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] -;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version. Acquisition_1C.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1C.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] -Acquisition_1C.sampled_ms=1 -;#threshold: Acquisition threshold +Acquisition_1C.coherent_integration_time_ms =1 Acquisition_1C.threshold=0.015 -;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition] ;Acquisition_1C.pfa=0.0001 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1C.doppler_max=10000 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1C.doppler_min=-10000 -;#doppler_step Doppler step in the grid search [Hz] Acquisition_1C.doppler_step=500 -;#maximum dwells Acquisition_1C.max_dwells=15 Acquisition_1C.dump=false -;#filename: Log path and filename Acquisition_1C.dump_filename=./acq_dump.dat ;######### TRACKING GLOBAL CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_1C.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] -Tracking_1C.if=0 -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1C.pll_bw_hz=40.0; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] Tracking_1C.dll_bw_hz=2.0; -;#order: PLL/DLL loop filter order [2] or [3] Tracking_1C.order=3; -;#early_late_space_chips: correlator early-late space [chips]. Use [0.5] Tracking_1C.early_late_space_chips=0.5; -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] Tracking_1C.dump=false -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. Tracking_1C.dump_filename=./tracking_ch_ ;######### TELEMETRY DECODER GPS CONFIG ############ -;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L1 C/A TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder TelemetryDecoder_1C.dump=false @@ -225,9 +127,7 @@ TelemetryDecoder_1C.dump=false ;######### OBSERVABLES CONFIG ############ ;#implementation: Observables.implementation=Hybrid_Observables -;#dump: Enable or disable the Observables internal binary data file logging [true] or [false] Observables.dump=false -;#dump_filename: Log path and filename. Observables.dump_filename=./observables.dat @@ -237,21 +137,13 @@ PVT.implementation=RTKLIB_PVT PVT.positioning_mode=PPP_Static ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad -;#output_rate_ms: Period between two PVT outputs. Notice that the minimum period is equal to the tracking integration time (for GPS CA L1 is 1ms) [ms] PVT.output_rate_ms=100 -;#display_rate_ms: Position console print (std::out) interval [ms]. Notice that output_rate_ms<=display_rate_ms. PVT.display_rate_ms=500 -;# KML, GeoJSON, NMEA and RTCM output configuration -;#nmea_dump_filename: NMEA log path and filename PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea; -;#flag_nmea_tty_port: Enable or disable the NMEA log to a serial TTY port (Can be used with real hardware or virtual one) PVT.flag_nmea_tty_port=false; -;#nmea_dump_devname: serial device descriptor for NMEA logging PVT.nmea_dump_devname=/dev/pts/4 PVT.flag_rtcm_server=false PVT.flag_rtcm_tty_port=false PVT.rtcm_dump_devname=/dev/pts/1 -;#dump: Enable or disable the PVT internal binary data file logging [true] or [false] PVT.dump=true -;#dump_filename: Log path and filename without extension. Notice that PVT will add ".dat" to the binary dump and ".kml" to GoogleEarth dump. PVT.dump_filename=./PVT diff --git a/conf/gnss-sdr_GPS_L1_rtlsdr_realtime.conf b/conf/gnss-sdr_GPS_L1_rtlsdr_realtime.conf index b4e025f6f..18d783741 100644 --- a/conf/gnss-sdr_GPS_L1_rtlsdr_realtime.conf +++ b/conf/gnss-sdr_GPS_L1_rtlsdr_realtime.conf @@ -1,3 +1,6 @@ +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; @@ -88,10 +91,6 @@ InputFilter.sampling_frequency=1999898 InputFilter.IF=80558 ; IF deviation due to front-end LO inaccuracies [Hz] ;######### RESAMPLER CONFIG ############ -;## Resamples the input data. -;# DISABLED IN THE RTL-SDR REALTIME -;#implementation: Use [Pass_Through] or [Direct_Resampler] -;#[Pass_Through] disables this block Resampler.implementation=Pass_Through ;######### CHANNELS GLOBAL CONFIG ############ @@ -103,8 +102,7 @@ Channel.signal=1C ;######### ACQUISITION GLOBAL CONFIG ############ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition_Fine_Doppler Acquisition_1C.item_type=gr_complex -Acquisition_1C.if=0 -Acquisition_1C.sampled_ms=1 +Acquisition_1C.coherent_integration_time_ms=1 Acquisition_1C.threshold=0.015 ;Acquisition_1C.pfa=0.0001 Acquisition_1C.doppler_max=10000 @@ -118,7 +116,6 @@ Acquisition_1C.dump_filename=./acq_dump.dat ;######### TRACKING GLOBAL CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking Tracking_1C.item_type=gr_complex -Tracking_1C.if=0 Tracking_1C.dump=false Tracking_1C.dump_filename=./tracking_ch_ Tracking_1C.pll_bw_hz=40.0; @@ -139,7 +136,6 @@ Observables.dump_filename=./observables.dat ;######### PVT CONFIG ############ -;#implementation: Position Velocity and Time (PVT) implementation: PVT.implementation=RTKLIB_PVT PVT.positioning_mode=PPP_Static ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX diff --git a/conf/gnss-sdr_GPS_L1_two_bits_cpx.conf b/conf/gnss-sdr_GPS_L1_two_bits_cpx.conf index f6e2ec730..1cf1ac378 100644 --- a/conf/gnss-sdr_GPS_L1_two_bits_cpx.conf +++ b/conf/gnss-sdr_GPS_L1_two_bits_cpx.conf @@ -1,3 +1,6 @@ +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; @@ -84,8 +87,7 @@ Channel.signal=1C ;######### GPS ACQUISITION CONFIG ############ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition_Fine_Doppler Acquisition_1C.item_type=gr_complex -Acquisition_1C.if=0 -Acquisition_1C.sampled_ms=1 +Acquisition_1C.coherent_integration_time_ms=1 Acquisition_1C.threshold=0.007 ;Acquisition_1C.pfa=0.0001 Acquisition_1C.doppler_max=10000 @@ -99,7 +101,6 @@ Acquisition_1C.dump_filename=./acq_dump.dat ;######### TRACKING GPS CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking Tracking_1C.item_type=gr_complex -Tracking_1C.if=0_ Tracking_1C.pll_bw_hz=40.0; Tracking_1C.dll_bw_hz=1.5; Tracking_1C.order=3; diff --git a/conf/gnss-sdr_GPS_L2C_USRP1_realtime.conf b/conf/gnss-sdr_GPS_L2C_USRP1_realtime.conf index 97710c4f0..362e747a3 100644 --- a/conf/gnss-sdr_GPS_L2C_USRP1_realtime.conf +++ b/conf/gnss-sdr_GPS_L2C_USRP1_realtime.conf @@ -1,7 +1,11 @@ +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; Configuration file for using USRP1 as a RF front-end for GPS L2C signals ; Run: ; gnss-sdr --config_file=/path/to/gnss-sdr_GPS_L2C_USRP1_realtime.conf ; + [GNSS-SDR] ;######### GLOBAL OPTIONS ################## @@ -46,81 +50,29 @@ DataTypeAdapter.item_type=gr_complex ;######### INPUT_FILTER 0 CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter] -;#[Pass_Through] disables this block -;#[Fir_Filter] enables a FIR Filter -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation that shifts IF down to zero Hz. - InputFilter.implementation=Freq_Xlating_Fir_Filter - -InputFilter.dump_filename=../data/input_filter.dat - -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of gnuradio's function: gr_remez. -;#This function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, -;#the desired response on those bands, and the weight given to the error in those bands. - - -;#input_item_type: Type and resolution for input signal samples. InputFilter.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter.output_item_type=gr_complex - -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. InputFilter.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time InputFilter.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. InputFilter.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - InputFilter.band1_begin=0.0 InputFilter.band1_end=0.45 InputFilter.band2_begin=0.55 InputFilter.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - InputFilter.ampl1_begin=1.0 InputFilter.ampl1_end=1.0 InputFilter.ampl2_begin=0.0 InputFilter.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands InputFilter.band1_error=1.0 InputFilter.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" InputFilter.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. InputFilter.grid_density=16 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. -;#InputFilter.IF is the intermediate frequency (in Hz) shifted down to zero Hz - InputFilter.sampling_frequency=20000000 - InputFilter.IF=-1600000 - -;# Decimation factor after the frequency tranaslating block InputFilter.decimation_factor=1 - -;#dump: Dump the filtered data to a file. InputFilter.dump=false - -;#dump_filename: Log path and filename. +InputFilter.dump_filename=../data/input_filter.dat ;######### RESAMPLER CONFIG ############ @@ -133,9 +85,7 @@ Resampler.sample_freq_out=2000000 ;######### CHANNELS GLOBAL CONFIG ############ -;#count: Number of available GPS satellite channels. Channels_2S.count=1 -;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver Channels.in_acquisition=1 Channel.signal=2S @@ -155,14 +105,11 @@ Channel7.signal=2S ;######### ACQUISITION GLOBAL CONFIG ############ -;# GPS L2C M Acquisition_2S.implementation=GPS_L2_M_PCPS_Acquisition Acquisition_2S.item_type=gr_complex -Acquisition_2S.if=0 Acquisition_2S.threshold=0.0013 ;Acquisition_2S.pfa=0.001 Acquisition_2S.doppler_max=10000 -Acquisition_2S.doppler_min=-10000 Acquisition_2S.doppler_step=100 Acquisition_2S.max_dwells=1 Acquisition_2S.dump=false @@ -172,7 +119,6 @@ Acquisition_2S.dump_filename=./acq_dump.dat ;######### TRACKING GLOBAL CONFIG ############ Tracking_2S.implementation=GPS_L2_M_DLL_PLL_Tracking Tracking_2S.item_type=gr_complex -Tracking_2S.if=0 Tracking_2S.pll_bw_hz=1.5; Tracking_2S.dll_bw_hz=0.3; Tracking_2S.order=3; diff --git a/conf/gnss-sdr_GPS_L2C_USRP_X300_realtime.conf b/conf/gnss-sdr_GPS_L2C_USRP_X300_realtime.conf index caaf4536c..1572b45cd 100644 --- a/conf/gnss-sdr_GPS_L2C_USRP_X300_realtime.conf +++ b/conf/gnss-sdr_GPS_L2C_USRP_X300_realtime.conf @@ -1,3 +1,6 @@ +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; Configuration file for using USRP X300 as a RF front-end for GPS L2C signals ; Set SignalSource.device_address to the IP address of your device ; and run: @@ -87,9 +90,7 @@ Resampler.sample_freq_out=4000000 ;######### CHANNELS GLOBAL CONFIG ############ -;#count: Number of available GPS satellite channels. Channels_2S.count=1 -;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver Channels.in_acquisition=1 Channel.signal=2S @@ -112,7 +113,6 @@ Channel7.signal=2S ;# GPS L2C M Acquisition_2S.implementation=GPS_L2_M_PCPS_Acquisition Acquisition_2S.item_type=gr_complex -Acquisition_2S.if=0 Acquisition_2S.threshold=0.0015 ;Acquisition_2S.pfa=0.001 Acquisition_2S.doppler_max=5000 @@ -125,7 +125,6 @@ Acquisition_2S.dump_filename=./acq_dump.dat Tracking_2S.implementation=GPS_L2_M_DLL_PLL_Tracking Tracking_2S.item_type=gr_complex -Tracking_2S.if=0 Tracking_2S.pll_bw_hz=2.0; Tracking_2S.dll_bw_hz=0.25; Tracking_2S.order=2; diff --git a/conf/gnss-sdr_Galileo_E1_USRP_X300_realtime.conf b/conf/gnss-sdr_Galileo_E1_USRP_X300_realtime.conf index 54e092708..aad3dd417 100644 --- a/conf/gnss-sdr_Galileo_E1_USRP_X300_realtime.conf +++ b/conf/gnss-sdr_Galileo_E1_USRP_X300_realtime.conf @@ -38,8 +38,7 @@ Channel.signal=1B ;######### ACQUISITION GLOBAL CONFIG ############ Acquisition_1B.implementation=Galileo_E1_PCPS_Ambiguous_Acquisition Acquisition_1B.item_type=gr_complex -Acquisition_1B.if=0 -Acquisition_1B.sampled_ms=4 +Acquisition_1B.coherent_integration_time_ms=4 ;Acquisition_1B.threshold=1 Acquisition_1B.pfa=0.000008 Acquisition_1B.doppler_max=6000 @@ -52,7 +51,6 @@ Acquisition_1B.dump_filename=./acq_dump.dat ;######### TRACKING GLOBAL CONFIG ############ Tracking_1B.implementation=Galileo_E1_DLL_PLL_VEML_Tracking Tracking_1B.item_type=gr_complex -Tracking_1B.if=0 Tracking_1B.pll_bw_hz=20.0; Tracking_1B.dll_bw_hz=2.0; Tracking_1B.order=3; diff --git a/conf/gnss-sdr_Galileo_E1_acq_QuickSync.conf b/conf/gnss-sdr_Galileo_E1_acq_QuickSync.conf index ab6802559..2653a1402 100644 --- a/conf/gnss-sdr_Galileo_E1_acq_QuickSync.conf +++ b/conf/gnss-sdr_Galileo_E1_acq_QuickSync.conf @@ -1,3 +1,6 @@ +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; @@ -10,259 +13,86 @@ GNSS-SDR.internal_fs_sps=4000000 ;######### SIGNAL_SOURCE CONFIG ############ -;#implementation: SignalSource.implementation=File_Signal_Source - -;#filename: path to file with the captured GNSS signal samples to be processed SignalSource.filename=/datalogger/signals/CTTC/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat ; <- PUT YOUR FILE HERE - -;#item_type: Type and resolution for each of the signal samples. -;#Use gr_complex for 32 bits float I/Q or ishort for I/Q interleaved short integer. -;#If ishort is selected you should have to instantiate the Ishort_To_Complex data_type_adapter. SignalSource.item_type=ishort - -;#sampling_frequency: Original Signal sampling frequency in samples per second SignalSource.sampling_frequency=4000000 - -;#samples: Number of samples to be processed. Notice that 0 indicates the entire file. SignalSource.samples=0 - -;#repeat: Repeat the processing file. SignalSource.repeat=false - -;#enable_throttle_control: Enabling this option tells the signal source to keep the delay between samples in post processing. -; it helps to not overload the CPU, but the processing time will be longer. SignalSource.enable_throttle_control=false ;######### SIGNAL_CONDITIONER CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. - -;#implementation: Use [Pass_Through] or [Signal_Conditioner] -;#[Pass_Through] disables this block and the [DataTypeAdapter], [InputFilter] and [Resampler] blocks -;#[Signal_Conditioner] enables this block. Then you have to configure [DataTypeAdapter], [InputFilter] and [Resampler] blocks SignalConditioner.implementation=Signal_Conditioner ;######### DATA_TYPE_ADAPTER CONFIG ############ -;## Changes the type of input data. -;#implementation: Use [Ishort_To_Complex] or [Pass_Through] DataTypeAdapter.implementation=Ishort_To_Complex -;#dump: Dump the filtered data to a file. DataTypeAdapter.dump=false -;#dump_filename: Log path and filename. DataTypeAdapter.dump_filename=../data/data_type_adapter.dat ;######### INPUT_FILTER CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter] -;#[Pass_Through] disables this block -;#[Fir_Filter] enables a FIR Filter -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation that shifts IF down to zero Hz. - -;InputFilter.implementation=Fir_Filter -;InputFilter.implementation=Freq_Xlating_Fir_Filter InputFilter.implementation=Pass_Through -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of gnuradio's function: gr_remez. -;#This function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, -;#the desired response on those bands, and the weight given to the error in those bands. - -;#input_item_type: Type and resolution for input signal samples. -InputFilter.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. -InputFilter.output_item_type=gr_complex - -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. -InputFilter.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time -InputFilter.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. -InputFilter.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - -#used for gps -InputFilter.band1_begin=0.0 -;InputFilter.band1_end=0.8 -InputFilter.band1_end=0.85 -InputFilter.band2_begin=0.90 -InputFilter.band2_end=1.0 - -#used for galileo -InputFilter.band1_begin=0.0 -;InputFilter.band1_end=0.8 -InputFilter.band1_end=0.45 -InputFilter.band2_begin=0.55 -InputFilter.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands -InputFilter.ampl1_begin=1.0 -InputFilter.ampl1_end=1.0 -InputFilter.ampl2_begin=0.0 -InputFilter.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands -InputFilter.band1_error=1.0 -InputFilter.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" -InputFilter.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. -InputFilter.grid_density=16 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. -;#InputFilter.IF is the intermediate frequency (in Hz) shifted down to zero Hz -InputFilter.sampling_frequency=4000000 -InputFilter.IF=0 - -;#dump: Dump the filtered data to a file. -InputFilter.dump=false - -;#dump_filename: Log path and filename. -InputFilter.dump_filename=../data/input_filter.dat - ;######### RESAMPLER CONFIG ############ -;## Resamples the input data. - -;#implementation: Use [Pass_Through] or [Direct_Resampler] -;#[Pass_Through] disables this block -;#[Direct_Resampler] enables a resampler that implements a nearest neigbourhood interpolation -;Resampler.implementation=Direct_Resampler Resampler.implementation=Pass_Through - -;#dump: Dump the resamplered data to a file. Resampler.dump=false -;#dump_filename: Log path and filename. Resampler.dump_filename=../data/resampler.dat - -;#item_type: Type and resolution for each of the signal samples. Resampler.item_type=gr_complex -;#sample_freq_in: the sample frequency of the input signal -Resampler.sample_freq_in=4000000 - -;#sample_freq_out: the desired sample frequency of the output signal -Resampler.sample_freq_out=4000000 - ;######### CHANNELS GLOBAL CONFIG ############ -;#count: Number of available satellite channels. Channels_1B.count=4 -;#in_acquisition: Number of channels simultaneously acquiring Channels.in_acquisition=1 Channel.signal=1B ;######### ACQUISITION GLOBAL CONFIG ############ Acquisition_1B.implementation=Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition -;#item_type: Type and resolution for each of the signal samples. Acquisition_1B.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1B.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] Acquisition_1B.coherent_integration_time_ms=4 -;#threshold: Acquisition threshold Acquisition_1B.threshold=0.05 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1B.doppler_max=15000 -;#doppler_max: Doppler step in the grid search [Hz] Acquisition_1B.doppler_step=125 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms]; Acquisition_1B.coherent_integration_time_ms=8 Acquisition_1B.cboc=false -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] Acquisition_1B.dump=false -;#filename: Log path and filename Acquisition_1B.dump_filename=./acq_dump.dat ;######### TRACKING GLOBAL CONFIG ############ -;#implementation: Tracking_1B.implementation=Galileo_E1_DLL_PLL_VEML_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_1B.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] -Tracking_1B.if=0 -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1B.pll_bw_hz=20.0; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] Tracking_1B.dll_bw_hz=2.0; -;#order: PLL/DLL loop filter order [2] or [3] Tracking_1B.order=3; -;#early_late_space_chips: correlator early-late space [chips]. Use [0.5] for GPS and [0.15] for Galileo Tracking_1B.early_late_space_chips=0.15; -;#very_early_late_space_chips: only for [Galileo_E1_DLL_PLL_VEML_Tracking], correlator very early-late space [chips]. Use [0.6] Tracking_1B.very_early_late_space_chips=0.6; -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] -Tracking_1B.dump=true -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. +Tracking_1B.dump=false Tracking_1B.dump_filename=../data/veml_tracking_ch_ ;######### TELEMETRY DECODER CONFIG ############ -;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L1 C/A or [Galileo_E1B_Telemetry_Decoder] for Galileo E1B TelemetryDecoder_1B.implementation=Galileo_E1B_Telemetry_Decoder TelemetryDecoder_1B.dump=false ;######### OBSERVABLES CONFIG ############ -;#implementation: Observables.implementation=Hybrid_Observables - -;#dump: Enable or disable the Observables internal binary data file logging [true] or [false] Observables.dump=false - -;#dump_filename: Log path and filename. Observables.dump_filename=./observables.dat ;######### PVT CONFIG ############ -;#implementation: Position Velocity and Time (PVT) implementation algorithm: PVT.implementation=RTKLIB_PVT PVT.positioning_mode=PPP_Static ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad - -;#output_rate_ms: Period between two PVT outputs. Notice that the minimum period is equal to the tracking integration time (for GPS CA L1 is 1ms) [ms] PVT.output_rate_ms=100; - -;#display_rate_ms: Position console print (std::out) interval [ms]. Notice that output_rate_ms<=display_rate_ms. PVT.display_rate_ms=500; - -;#dump: Enable or disable the PVT internal binary data file logging [true] or [false] PVT.dump=false - -;#dump_filename: Log path and filename without extension. Notice that PVT will add ".dat" to the binary dump and ".kml" to GoogleEarth dump. PVT.dump_filename=./PVT - -;# KML, GeoJSON, NMEA and RTCM output configuration - -;#dump_filename: Log path and filename without extension. Notice that PVT will add ".dat" to the binary dump, ".kml" and ".geojson" to GIS-friendly formats. PVT.dump_filename=./PVT - -;#nmea_dump_filename: NMEA log path and filename PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea; - -;#flag_nmea_tty_port: Enables or disables the NMEA log to a serial TTY port (Can be used with real hardware or virtual one) PVT.flag_nmea_tty_port=true; - -;#nmea_dump_devname: serial device descriptor for NMEA logging PVT.nmea_dump_devname=/dev/pts/4 - -;#flag_rtcm_server: Enables or disables a TCP/IP server transmitting RTCM 3.2 messages (accepts multiple clients, port 2101 by default) PVT.flag_rtcm_server=false; - -;#flag_rtcm_tty_port: Enables or disables the RTCM log to a serial TTY port (Can be used with real hardware or virtual one) PVT.flag_rtcm_tty_port=false; - -;#rtcm_dump_devname: serial device descriptor for RTCM logging PVT.rtcm_dump_devname=/dev/pts/1 diff --git a/conf/gnss-sdr_Galileo_E1_ishort.conf b/conf/gnss-sdr_Galileo_E1_ishort.conf index 2f051700a..22a64245d 100644 --- a/conf/gnss-sdr_Galileo_E1_ishort.conf +++ b/conf/gnss-sdr_Galileo_E1_ishort.conf @@ -1,3 +1,6 @@ +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; @@ -11,190 +14,65 @@ GNSS-SDR.internal_fs_sps=4000000 ;######### SIGNAL_SOURCE CONFIG ############ SignalSource.implementation=File_Signal_Source -;#filename: path to file with the captured GNSS signal samples to be processed SignalSource.filename=/datalogger/signals/CTTC/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat ; <- PUT YOUR FILE HERE -;#item_type: Type and resolution for each of the signal samples. SignalSource.item_type=ishort -;#sampling_frequency: Original Signal sampling frequency in samples per second SignalSource.sampling_frequency=4000000 -;#samples: Number of samples to be processed. Notice that 0 indicates the entire file. SignalSource.samples=0 -;#repeat: Repeat the processing file. SignalSource.repeat=false -;#enable_throttle_control: Enabling this option tells the signal source to keep the delay between samples in post processing. -; it helps to not overload the CPU, but the processing time will be longer. -SignalSource.enable_throttle_control=false +SignalSource.enable_throttle_control=true ;######### SIGNAL_CONDITIONER CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. - -;#implementation: Use [Pass_Through] or [Signal_Conditioner] -;#[Pass_Through] disables this block and the [DataTypeAdapter], [InputFilter] and [Resampler] blocks -;#[Signal_Conditioner] enables this block. Then you have to configure [DataTypeAdapter], [InputFilter] and [Resampler] blocks SignalConditioner.implementation=Signal_Conditioner ;######### DATA_TYPE_ADAPTER CONFIG ############ -;## Changes the type of input data. -;#implementation: [Pass_Through] disables this block DataTypeAdapter.implementation=Ishort_To_Complex ;######### INPUT_FILTER CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -;#implementation: -;#[Pass_Through] disables this block -;#[Fir_Filter] enables a FIR Filter -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation that shifts IF down to zero Hz. -;InputFilter.implementation=Fir_Filter -;InputFilter.implementation=Freq_Xlating_Fir_Filter InputFilter.implementation=Pass_Through - -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of GNU Radio's function: gr_remez. -;#This function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, -;#the desired response on those bands, and the weight given to the error in those bands. - -;#input_item_type: Type and resolution for input signal samples. InputFilter.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter.output_item_type=gr_complex -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. -InputFilter.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time -InputFilter.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. -InputFilter.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - -InputFilter.band1_begin=0.0 -InputFilter.band1_end=0.45 -InputFilter.band2_begin=0.55 -InputFilter.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - -InputFilter.ampl1_begin=1.0 -InputFilter.ampl1_end=1.0 -InputFilter.ampl2_begin=0.0 -InputFilter.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands -InputFilter.band1_error=1.0 -InputFilter.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" -InputFilter.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. -InputFilter.grid_density=16 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. -;#InputFilter.IF is the intermediate frequency (in Hz) shifted down to zero Hz - -InputFilter.sampling_frequency=4000000 -InputFilter.IF=0 -;#dump: Dump the filtered data to a file. -InputFilter.dump=false -;#dump_filename: Log path and filename. -InputFilter.dump_filename=../data/input_filter.dat - - ;######### RESAMPLER CONFIG ############ -;## Resamples the input data. - -;#implementation: Use [Pass_Through] or [Direct_Resampler] -;#[Pass_Through] disables this block -;#[Direct_Resampler] enables a resampler that implements a nearest neighborhood interpolation -;Resampler.implementation=Direct_Resampler Resampler.implementation=Pass_Through -;#item_type: Type and resolution for each of the signal samples. Resampler.item_type=gr_complex -;#sample_freq_in: the sample frequency of the input signal Resampler.sample_freq_in=4000000 -;#sample_freq_out: the desired sample frequency of the output signal Resampler.sample_freq_out=4000000 -;#dump: Dump the resampled data to a file. Resampler.dump=false -;#dump_filename: Log path and filename. Resampler.dump_filename=../data/resampler.dat ;######### CHANNELS GLOBAL CONFIG ############ -;#count: Number of available Galileo satellite channels. Channels_1B.count=8 -;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver Channels.in_acquisition=1 Channel.signal=1B ;######### ACQUISITION GLOBAL CONFIG ############ Acquisition_1B.implementation=Galileo_E1_PCPS_Ambiguous_Acquisition -;#item_type: Type and resolution for each of the signal samples. Acquisition_1B.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1B.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] -Acquisition_1B.sampled_ms=4 -;#threshold: Acquisition threshold +Acquisition_1B.coherent_integration_time_ms=4 ;Acquisition_1B.threshold=0 -;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition] -Acquisition_1B.pfa=0.000002 -;#doppler_max: Maximum expected Doppler shift [Hz] +Acquisition_1B.pfa=0.00001 Acquisition_1B.doppler_max=15000 -;#doppler_max: Doppler step in the grid search [Hz] Acquisition_1B.doppler_step=125 -;#cboc: Only for [Galileo_E1_PCPS_Ambiguous_Acquisition]. This option allows you to choose between acquiring with CBOC signal [true] or sinboc(1,1) signal [false]. -;#Use only if GNSS-SDR.internal_fs_sps is greater than or equal to 6138000 Acquisition_1B.cboc=false -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] Acquisition_1B.dump=false -;#filename: Log path and filename Acquisition_1B.dump_filename=./acq_dump.dat - - -;######### ACQUISITION CHANNELS CONFIG ###### - -;######### ACQUISITION CH 0 CONFIG ############ -;#repeat_satellite: Use only jointly with the satellite PRN ID option. The default value is false -;Acquisition_1B0.repeat_satellite = true -;Acquisition_1B1.repeat_satellite = true -;Acquisition_1B2.repeat_satellite = true -;Acquisition_1B3.repeat_satellite = true +Acquisition_1B.blocking=false ;######### TRACKING GLOBAL CONFIG ############ Tracking_1B.implementation=Galileo_E1_DLL_PLL_VEML_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_1B.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] -Tracking_1B.if=0 -;#pll_bw_hz: PLL loop filter bandwidth [Hz] -Tracking_1B.pll_bw_hz=15.0; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] -Tracking_1B.dll_bw_hz=2.0; -;#fll_bw_hz: FLL loop filter bandwidth [Hz] -Tracking_1B.fll_bw_hz=10.0; -;#order: PLL/DLL loop filter order [2] or [3] -Tracking_1B.order=3; -;#early_late_space_chips: correlator early-late space [chips]. Use [0.5] for GPS and [0.15] for Galileo +Tracking_1B.dump=true +Tracking_1B.dump_filename=./veml_tracking_ch_ +Tracking_1B.pll_bw_hz=20.0; +Tracking_1B.dll_bw_hz=3.0; Tracking_1B.early_late_space_chips=0.15; -;#very_early_late_space_chips: only for [Galileo_E1_DLL_PLL_VEML_Tracking], correlator very early-late space [chips]. Use [0.6] Tracking_1B.very_early_late_space_chips=0.6; Tracking_1B.track_pilot=true -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] Tracking_1B.dump=false -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. Tracking_1B.dump_filename=../data/veml_tracking_ch_ @@ -205,39 +83,25 @@ TelemetryDecoder_1B.dump=false ;######### OBSERVABLES CONFIG ############ Observables.implementation=Hybrid_Observables -;#dump: Enable or disable the Observables internal binary data file logging [true] or [false] Observables.dump=false -;#dump_filename: Log path and filename. Observables.dump_filename=./observables.dat ;######### PVT CONFIG ############ -;#implementation: Position Velocity and Time (PVT) implementation: PVT.implementation=RTKLIB_PVT PVT.positioning_mode=PPP_Static ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad -;#output_rate_ms: Period between two PVT outputs. Notice that the minimum period is equal to the tracking integration time (for GPS CA L1 is 1ms) [ms] PVT.output_rate_ms=100; -;#display_rate_ms: Position console print (std::out) interval [ms]. Notice that output_rate_ms<=display_rate_ms. PVT.display_rate_ms=500; -;# KML, GeoJSON, NMEA and RTCM output configuration -;#nmea_dump_filename: NMEA log path and filename PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea; -;#flag_nmea_tty_port: Enables or disables the NMEA log to a serial TTY port (Can be used with real hardware or virtual one) PVT.flag_nmea_tty_port=true -;#nmea_dump_devname: serial device descriptor for NMEA logging PVT.nmea_dump_devname=/dev/pts/4 -;#flag_rtcm_server: Enables or disables a TCP/IP server transmitting RTCM 3.2 messages (accepts multiple clients, port 2101 by default) PVT.flag_rtcm_server=true; PVT.rtcm_tcp_port=2101 PVT.rtcm_MT1045_rate_ms=5000 PVT.rtcm_MSM_rate_ms=1000 -;#flag_rtcm_tty_port: Enables or disables the RTCM log to a serial TTY port (Can be used with real hardware or virtual one) PVT.flag_rtcm_tty_port=false; -;#rtcm_dump_devname: serial device descriptor for RTCM logging PVT.rtcm_dump_devname=/dev/pts/1 -;#dump: Enable or disable the PVT internal binary data file logging [true] or [false] PVT.dump=false -;#dump_filename: Log path and filename without extension. Notice that PVT will add ".dat" to the binary dump, ".kml" and ".geojson" to GIS-friendly formats. PVT.dump_filename=./PVT \ No newline at end of file diff --git a/conf/gnss-sdr_Galileo_E1_nsr.conf b/conf/gnss-sdr_Galileo_E1_nsr.conf index f7ca01480..7350f5314 100644 --- a/conf/gnss-sdr_Galileo_E1_nsr.conf +++ b/conf/gnss-sdr_Galileo_E1_nsr.conf @@ -1,3 +1,6 @@ +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; @@ -21,15 +24,10 @@ SignalSource.samples=0 ; 0 means the entire file SignalSource.repeat=false SignalSource.dump=false SignalSource.dump_filename=../data/signal_source.dat - - -;#enable_throttle_control: Enabling this option tells the signal source to keep the delay between samples in post processing. -; it helps to not overload the CPU, but the processing time will be longer. SignalSource.enable_throttle_control=false ;######### SIGNAL_CONDITIONER CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. SignalConditioner.implementation=Signal_Conditioner ;######### DATA_TYPE_ADAPTER CONFIG ############ @@ -78,8 +76,7 @@ Channel.signal=1B ;######### ACQUISITION GLOBAL CONFIG ############ Acquisition_1B.implementation=Galileo_E1_PCPS_Ambiguous_Acquisition Acquisition_1B.item_type=gr_complex -Acquisition_1B.if=0 -Acquisition_1B.sampled_ms=4 +Acquisition_1B.coherent_integration_time_ms=4 Acquisition_1B.pfa=0.0000008 Acquisition_1B.doppler_max=15000 Acquisition_1B.doppler_step=125 @@ -91,7 +88,6 @@ Acquisition_1B.dump_filename=./acq_dump.dat ;######### TRACKING GLOBAL CONFIG ############ Tracking_1B.implementation=Galileo_E1_DLL_PLL_VEML_Tracking Tracking_1B.item_type=gr_complex -Tracking_1B.if=0 Tracking_1B.pll_bw_hz=20.0; Tracking_1B.dll_bw_hz=2.0; Tracking_1B.order=3; diff --git a/conf/gnss-sdr_Galileo_E5a.conf b/conf/gnss-sdr_Galileo_E5a.conf index 702942f55..5ab3096c3 100644 --- a/conf/gnss-sdr_Galileo_E5a.conf +++ b/conf/gnss-sdr_Galileo_E5a.conf @@ -1,4 +1,3 @@ -; Default configuration file ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; @@ -25,159 +24,33 @@ GNSS-SDR.internal_fs_sps=32000000 ;GNSS-SDR.SUPL_CI=0x31b0 ;######### SIGNAL_SOURCE CONFIG ############ -;#implementation SignalSource.implementation=File_Signal_Source -;#filename: path to file with the captured GNSS signal samples to be processed SignalSource.filename=/datalogger/signals/ifen/32MS_complex.dat ; <- PUT YOUR FILE HERE -;#item_type: Type and resolution for each of the signal samples. SignalSource.item_type=gr_complex -;#sampling_frequency: Original Signal sampling frequency in samples per second SignalSource.sampling_frequency=32000000 -;#samples: Number of samples to be processed. Notice that 0 indicates the entire file. SignalSource.samples=0 -;#repeat: Repeat the processing file. SignalSource.repeat=false -;#enable_throttle_control: Enabling this option tells the signal source to keep the delay between samples in post processing. -; it helps to not overload the CPU, but the processing time will be longer. SignalSource.enable_throttle_control=false ;######### SIGNAL_CONDITIONER CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. - -;#implementation: Use [Pass_Through] or [Signal_Conditioner] -;#[Pass_Through] disables this block and the [DataTypeAdapter], [InputFilter] and [Resampler] blocks -;#[Signal_Conditioner] enables this block. Then you have to configure [DataTypeAdapter], [InputFilter] and [Resampler] blocks -;SignalConditioner.implementation=Signal_Conditioner SignalConditioner.implementation=Pass_Through -;######### DATA_TYPE_ADAPTER CONFIG ############ -;## Changes the type of input data. -;#implementation: [Pass_Through] disables this block -DataTypeAdapter.implementation=Pass_Through - -;######### INPUT_FILTER CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -;#implementation: -;#[Pass_Through] disables this block -;#[Fir_Filter] enables a FIR Filter -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation that shifts IF down to zero Hz. - -;InputFilter.implementation=Fir_Filter -;InputFilter.implementation=Freq_Xlating_Fir_Filter -InputFilter.implementation=Pass_Through - -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of gnuradio's function: gr_remez. -;#This function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, -;#the desired response on those bands, and the weight given to the error in those bands. - -;#input_item_type: Type and resolution for input signal samples. -InputFilter.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. -InputFilter.output_item_type=gr_complex - -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. -InputFilter.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time -InputFilter.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. -InputFilter.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - -InputFilter.band1_begin=0.0 -InputFilter.band1_end=0.45 -InputFilter.band2_begin=0.55 -InputFilter.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - -InputFilter.ampl1_begin=1.0 -InputFilter.ampl1_end=1.0 -InputFilter.ampl2_begin=0.0 -InputFilter.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands -InputFilter.band1_error=1.0 -InputFilter.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" -InputFilter.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. -InputFilter.grid_density=16 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. -;#InputFilter.IF is the intermediate frequency (in Hz) shifted down to zero Hz - -InputFilter.sampling_frequency=32000000 -InputFilter.IF=0 - -;#dump: Dump the filtered data to a file. -InputFilter.dump=false - -;#dump_filename: Log path and filename. -InputFilter.dump_filename=../data/input_filter.dat - - -;######### RESAMPLER CONFIG ############ -;## Resamples the input data. - -;#implementation: Use [Pass_Through] or [Direct_Resampler] -;#[Pass_Through] disables this block -;#[Direct_Resampler] enables a resampler that implements a nearest neigbourhood interpolation -;Resampler.implementation=Direct_Resampler -Resampler.implementation=Pass_Through -;#item_type: Type and resolution for each of the signal samples. -Resampler.item_type=gr_complex -;#sample_freq_in: the sample frequency of the input signal -Resampler.sample_freq_in=8000000 -;#sample_freq_out: the desired sample frequency of the output signal -Resampler.sample_freq_out=4000000 -;#dump: Dump the resamplered data to a file. -Resampler.dump=false -;#dump_filename: Log path and filename. -Resampler.dump_filename=../data/resampler.dat - ;######### CHANNELS GLOBAL CONFIG ############ -;#count: Number of available satellite channels. Channels_5X.count=1 -;#in_acquisition: Number of channels simultaneously acquiring Channels.in_acquisition=1 -;#system: GPS, GLONASS, Galileo, SBAS or Compass -;#if the option is disabled by default is assigned GPS -Channel.signal=5X ;######### SPECIFIC CHANNELS CONFIG ###### ;#The following options are specific to each channel and overwrite the generic options ;######### CHANNEL 0 CONFIG ############ -;Channel0.signal=5X -;#satellite: Satellite PRN ID for this channel. Disable this option to random search ;Channel0.satellite=19 -;Channel0.repeat_satellite=true ;######### CHANNEL 1 CONFIG ############ - -;Channel1.system=Galileo -;Channel1.signal=5Q ;Channel1.satellite=12 ;######### CHANNEL 2 CONFIG ############ - -;Channel2.system=Galileo -;Channel2.signal=5Q ;Channel2.satellite=11 ;######### CHANNEL 3 CONFIG ############ @@ -188,97 +61,56 @@ Channel.signal=5X ;######### ACQUISITION GLOBAL CONFIG ############ Acquisition_5X.implementation=Galileo_E5a_Noncoherent_IQ_Acquisition_CAF -;#item_type: Type and resolution for each of the signal samples. Acquisition_5X.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_5X.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] Acquisition_5X.coherent_integration_time_ms=1 -;#threshold: Acquisition threshold. It will be ignored if pfa is defined. Acquisition_5X.threshold=0.001 -;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition] Acquisition_5X.pfa=0.0003 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_5X.doppler_max=10000 -;#doppler_max: Doppler step in the grid search [Hz] Acquisition_5X.doppler_step=250 -;#bit_transition_flag: Enable or disable a strategy to deal with bit transitions in GPS signals: process two dwells and take -;maximum test statistics. Only use with implementation: [GPS_L1_CA_PCPS_Acquisition] (should not be used for Galileo_E1_PCPS_Ambiguous_Acquisition]) Acquisition_5X.bit_transition_flag=false -;#max_dwells: Maximum number of consecutive dwells to be processed. It will be ignored if bit_transition_flag=true Acquisition_5X.max_dwells=1 -;#CAF filter: **Only for E5a** Resolves doppler ambiguity averaging the specified BW in the winner code delay. If set to 0 CAF filter is desactivated. Recommended value 3000 Hz Acquisition_5X.CAF_window_hz=0 -;#Zero_padding: **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. Acquisition_5X.Zero_padding=0 -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] -Acquisition_5X.dump=true -;#filename: Log path and filename +Acquisition_5X.dump=false Acquisition_5X.dump_filename=./acq_dump.dat ;######### TRACKING GLOBAL CONFIG ############ Tracking_5X.implementation=Galileo_E5a_DLL_PLL_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_5X.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] -Tracking_5X.if=0 -;#dll_ti_ms: **Only for E5a** loop filter integration time after initialization (secondary code delay search)[ms] -;Tracking_5X.ti_ms=3; -Tracking_5X.ti_ms=1; -;#pll_bw_hz: PLL loop filter bandwidth during initialization [Hz] Tracking_5X.pll_bw_hz=20.0; -;#dll_bw_hz: DLL loop filter bandwidth during initialization [Hz] Tracking_5X.dll_bw_hz=20.0; Tracking_5X.pll_bw_narrow_hz=2.0; Tracking_5X.dll_bw_narrow_hz=5.0; -;#order: PLL/DLL loop filter order [2] or [3] Tracking_5X.order=2; -;#early_late_space_chips: correlator early-late space [chips]. Use [0.5] Tracking_5X.early_late_space_chips=0.5; -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] -Tracking_5X.dump=true -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. +Tracking_5X.dump=false Tracking_5X.dump_filename=./tracking_ch_ ;######### TELEMETRY DECODER CONFIG ############ -;#implementation: TelemetryDecoder_5X.implementation=Galileo_E5a_Telemetry_Decoder TelemetryDecoder_5X.dump=false ;######### OBSERVABLES CONFIG ############ -;#implementation: Observables.implementation=Hybrid_Observables -;#dump: Enable or disable the Observables internal binary data file logging [true] or [false] Observables.dump=false -;#dump_filename: Log path and filename. Observables.dump_filename=./observables.dat ;######### PVT CONFIG ############ -;#implementation: Position Velocity and Time (PVT) implementation algorithm: PVT.implementation=RTKLIB_PVT PVT.positioning_mode=Single ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad -;#output_rate_ms: Period between two PVT outputs. Notice that the minimum period is equal to the tracking integration time [ms] PVT.output_rate_ms=100 -;#display_rate_ms: Position console print (std::out) interval [ms]. Notice that output_rate_ms<=display_rate_ms. PVT.display_rate_ms=500 -;# KML, GeoJSON, NMEA and RTCM output configuration -;#nmea_dump_filename: NMEA log path and filename PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea; -;#flag_nmea_tty_port: Enable or disable the NMEA log to a serial TTY port (Can be used with real hardware or virtual one) PVT.flag_nmea_tty_port=true; -;#nmea_dump_devname: serial device descriptor for NMEA logging PVT.nmea_dump_devname=/dev/pts/4 PVT.flag_rtcm_server=false PVT.flag_rtcm_tty_port=false PVT.rtcm_dump_devname=/dev/pts/1 -;#dump: Enable or disable the PVT internal binary data file logging [true] or [false] PVT.dump=false -;#dump_filename: Log path and filename without extension. Notice that PVT will add ".dat" to the binary dump and ".kml" to GoogleEarth dump. PVT.dump_filename=./PVT diff --git a/conf/gnss-sdr_Galileo_E5a_IFEN_CTTC.conf b/conf/gnss-sdr_Galileo_E5a_IFEN_CTTC.conf index 661920ca0..e884778d2 100644 --- a/conf/gnss-sdr_Galileo_E5a_IFEN_CTTC.conf +++ b/conf/gnss-sdr_Galileo_E5a_IFEN_CTTC.conf @@ -1,4 +1,3 @@ -; Default configuration file ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; @@ -74,7 +73,7 @@ Resampler.dump_filename=../data/resampler.dat ;######### CHANNELS GLOBAL CONFIG ############ -Channels_5X.count=1 +Channels_5X.count=8 Channels.in_acquisition=1 Channel.signal=5X @@ -83,7 +82,7 @@ Channel.signal=5X ;######### CHANNEL 0 CONFIG ############ Channel0.signal=5X -Channel0.satellite=19 +;Channel0.satellite=19 ;Channel0.repeat_satellite=true ;######### CHANNEL 1 CONFIG ############ @@ -101,7 +100,6 @@ Channel3.signal=5X ;######### ACQUISITION GLOBAL CONFIG ############ Acquisition_5X.implementation=Galileo_E5a_Noncoherent_IQ_Acquisition_CAF Acquisition_5X.item_type=gr_complex -Acquisition_5X.if=0 Acquisition_5X.coherent_integration_time_ms=1 Acquisition_5X.threshold=0.002 Acquisition_5X.doppler_max=10000 @@ -117,10 +115,8 @@ Acquisition_5X.dump_filename=./acq_dump.dat ;######### TRACKING GLOBAL CONFIG ############ Tracking_5X.implementation=Galileo_E5a_DLL_PLL_Tracking Tracking_5X.item_type=gr_complex -Tracking_5X.if=0 Tracking_5X.pll_bw_hz=20.0; Tracking_5X.dll_bw_hz=20.0; -Tracking_5X.ti_ms=1; **Only for E5a** loop filter integration time after initialization (secondary code delay search)[ms] Tracking_5X.pll_bw_narrow_hz=20.0; Tracking_5X.dll_bw_narrow_hz=20.0; Tracking_5X.order=2; diff --git a/conf/gnss-sdr_Hybrid_byte.conf b/conf/gnss-sdr_Hybrid_byte.conf index aa7caae99..bf50bcb30 100644 --- a/conf/gnss-sdr_Hybrid_byte.conf +++ b/conf/gnss-sdr_Hybrid_byte.conf @@ -1,4 +1,6 @@ -; Default configuration file +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; @@ -12,129 +14,40 @@ GNSS-SDR.internal_fs_sps=20000000 ;######### SIGNAL_SOURCE CONFIG ############ SignalSource.implementation=File_Signal_Source -;#filename: path to file with the captured GNSS signal samples to be processed SignalSource.filename=/datalogger/signals/Fraunhofer/L125_III1b_210s_L1.bin ; <- PUT YOUR FILE HERE -;#item_type: Type and resolution for each of the signal samples.. SignalSource.item_type=byte -;#sampling_frequency: Original Signal sampling frequency in samples per second SignalSource.sampling_frequency=20000000 -;#samples: Number of samples to be processed. Notice that 0 indicates the entire file. SignalSource.samples=0 -;#repeat: Repeat the processing file. SignalSource.repeat=false -;#enable_throttle_control: Enabling this option tells the signal source to keep the delay between samples in post processing. -; it helps to not overload the CPU, but the processing time will be longer. SignalSource.enable_throttle_control=false ;######### SIGNAL_CONDITIONER CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. - -;#implementation: Use [Pass_Through] or [Signal_Conditioner] -;#[Pass_Through] disables this block and the [DataTypeAdapter], [InputFilter] and [Resampler] blocks -;#[Signal_Conditioner] enables this block. Then you have to configure [DataTypeAdapter], [InputFilter] and [Resampler] blocks SignalConditioner.implementation=Signal_Conditioner ;######### DATA_TYPE_ADAPTER CONFIG ############ -;## Changes the type of input data. -;#implementation: [Pass_Through] disables this block DataTypeAdapter.implementation=Ibyte_To_Complex ;######### INPUT_FILTER CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals -;#[Pass_Through] disables this block -;#[Fir_Filter] enables a FIR Filter -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation that shifts IF down to zero Hz. - -;InputFilter.implementation=Fir_Filter -;InputFilter.implementation=Freq_Xlating_Fir_Filter InputFilter.implementation=Pass_Through - -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of gnuradio's function: gr_remez. -;#This function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, -;#the desired response on those bands, and the weight given to the error in those bands. - -;#input_item_type: Type and resolution for input signal samples. InputFilter.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples.. InputFilter.output_item_type=gr_complex - -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. -InputFilter.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time -InputFilter.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. -InputFilter.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - -InputFilter.band1_begin=0.0 -InputFilter.band1_end=0.45 -InputFilter.band2_begin=0.55 -InputFilter.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - -InputFilter.ampl1_begin=1.0 -InputFilter.ampl1_end=1.0 -InputFilter.ampl2_begin=0.0 -InputFilter.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands -InputFilter.band1_error=1.0 -InputFilter.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" -InputFilter.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. -InputFilter.grid_density=16 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. -;#InputFilter.IF is the intermediate frequency (in Hz) shifted down to zero Hz - -InputFilter.sampling_frequency=20000000 -InputFilter.IF=0 -;#dump: Dump the filtered data to a file. InputFilter.dump=false -;#dump_filename: Log path and filename. InputFilter.dump_filename=../data/input_filter.dat ;######### RESAMPLER CONFIG ############ -;## Resamples the input data. -;#implementation: Use [Pass_Through] or [Direct_Resampler] -;#[Pass_Through] disables this block -;#[Direct_Resampler] enables a resampler that implements a nearest neigbourhood interpolation -;Resampler.implementation=Direct_Resampler Resampler.implementation=Pass_Through -;#item_type: Type and resolution for each of the signal samples. Resampler.item_type=gr_complex -;#sample_freq_in: the sample frequency of the input signal Resampler.sample_freq_in=20000000 -;#sample_freq_out: the desired sample frequency of the output signal Resampler.sample_freq_out=20000000 -;#dump: Dump the resamplered data to a file. Resampler.dump=false -;#dump_filename: Log path and filename. Resampler.dump_filename=../data/resampler.dat ;######### CHANNELS GLOBAL CONFIG ############ -;#count: Number of available GPS satellite channels. Channels_1C.count=8 -;#count: Number of available Galileo satellite channels. Channels_1B.count=8 -;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver Channels.in_acquisition=1 ;#signal: @@ -158,123 +71,75 @@ Channel15.signal=1B ;######### GPS ACQUISITION CONFIG ############ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition -;#item_type: Type and resolution for each of the signal samples. Acquisition_1C.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1C.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] -Acquisition_1C.sampled_ms=1 -;#threshold: Acquisition threshold +Acquisition_1C.coherent_integration_time_ms=1 Acquisition_1C.threshold=0.0060 -;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition] ;Acquisition_1C.pfa=0.01 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1C.doppler_max=10000 -;#doppler_max: Doppler step in the grid search [Hz] Acquisition_1C.doppler_step=500 -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] Acquisition_1C.dump=false -;#filename: Log path and filename Acquisition_1C.dump_filename=./acq_dump.dat ;######### GALILEO ACQUISITION CONFIG ############ Acquisition_1B.implementation=Galileo_E1_PCPS_Ambiguous_Acquisition -;#item_type: Type and resolution for each of the signal samples. Acquisition_1B.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1B.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] -Acquisition_1B.sampled_ms=4 -;#threshold: Acquisition threshold +Acquisition_1B.coherent_integration_time_ms=4 ;Acquisition_1B.threshold=0 -;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition] Acquisition_1B.pfa=0.0000008 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1B.doppler_max=15000 -;#doppler_max: Doppler step in the grid search [Hz] Acquisition_1B.doppler_step=125 -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] Acquisition_1B.dump=false -;#filename: Log path and filename Acquisition_1B.dump_filename=./acq_dump.dat ;######### TRACKING GPS CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_1C.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] -Tracking_1C.if=0 -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1C.pll_bw_hz=45.0; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] Tracking_1C.dll_bw_hz=4.0; -;#order: PLL/DLL loop filter order [2] or [3] Tracking_1C.order=3; -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] Tracking_1C.dump=false -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. Tracking_1C.dump_filename=../data/epl_tracking_ch_ ;######### TRACKING GALILEO CONFIG ############ Tracking_1B.implementation=Galileo_E1_DLL_PLL_VEML_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_1B.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] -Tracking_1B.if=0 -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1B.pll_bw_hz=15.0; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] Tracking_1B.dll_bw_hz=2.0; -;#order: PLL/DLL loop filter order [2] or [3] Tracking_1B.order=3; -;#early_late_space_chips: correlator early-late space [chips]. Use [0.5] for GPS and [0.15] for Galileo Tracking_1B.early_late_space_chips=0.15; -;#very_early_late_space_chips: only for [Galileo_E1_DLL_PLL_VEML_Tracking], correlator very early-late space [chips]. Use [0.6] Tracking_1B.very_early_late_space_chips=0.6; -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] Tracking_1B.dump=false -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. Tracking_1B.dump_filename=../data/veml_tracking_ch_ ;######### TELEMETRY DECODER GPS CONFIG ############ -;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L1 C/A TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder TelemetryDecoder_1C.dump=false ;######### TELEMETRY DECODER GALILEO CONFIG ############ -;#implementation: Use [Galileo_E1B_Telemetry_Decoder] for Galileo E1B TelemetryDecoder_1B.implementation=Galileo_E1B_Telemetry_Decoder TelemetryDecoder_1B.dump=false ;######### OBSERVABLES CONFIG ############ -;#implementation: Observables.implementation=Hybrid_Observables -;#dump: Enable or disable the Observables internal binary data file logging [true] or [false] Observables.dump=false -;#dump_filename: Log path and filename. Observables.dump_filename=./observables.dat ;######### PVT CONFIG ############ -;#implementation: Position Velocity and Time (PVT) implementation: PVT.implementation=RTKLIB_PVT PVT.positioning_mode=PPP_Static ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad -;#output_rate_ms: Period between two PVT outputs. Notice that the minimum period is equal to the tracking integration time (for GPS CA L1 is 1ms) [ms] PVT.output_rate_ms=100; -;#display_rate_ms: Position console print (std::out) interval [ms]. Notice that output_rate_ms<=display_rate_ms. PVT.display_rate_ms=500; -;#dump: Enable or disable the PVT internal binary data file logging [true] or [false] PVT.dump=false PVT.flag_rtcm_server=false PVT.flag_rtcm_tty_port=false PVT.rtcm_dump_devname=/dev/pts/1 -;#dump_filename: Log path and filename without extension. Notice that PVT will add ".dat" to the binary dump and ".kml" to GoogleEarth dump. PVT.dump_filename=./PVT diff --git a/conf/gnss-sdr_Hybrid_byte_sim.conf b/conf/gnss-sdr_Hybrid_byte_sim.conf index 7df406547..60cca8e00 100644 --- a/conf/gnss-sdr_Hybrid_byte_sim.conf +++ b/conf/gnss-sdr_Hybrid_byte_sim.conf @@ -1,4 +1,6 @@ -; Default configuration file +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; @@ -7,139 +9,48 @@ ;######### GLOBAL OPTIONS ################## ;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second]. -;GNSS-SDR.internal_fs_sps=2048000 GNSS-SDR.internal_fs_sps=2600000 ;######### SIGNAL_SOURCE CONFIG ############ -;#implementation SignalSource.implementation=File_Signal_Source -;#filename: path to file with the captured GNSS signal samples to be processed -;#SignalSource.filename=/home/javier/Descargas/rtlsdr_tcxo_l1/rtlsdr_tcxo_l1.bin ; <- PUT YOUR FILE HERE SignalSource.filename=/Users/carlesfernandez/git/cttc/build/signal_out.bin ; <- PUT YOUR FILE HERE -;#item_type: Type and resolution for each of the signal samples. SignalSource.item_type=byte -;#sampling_frequency: Original Signal sampling frequency in samples per second SignalSource.sampling_frequency=4000000 -;#samples: Number of samples to be processed. Notice that 0 indicates the entire file. SignalSource.samples=0 -;#repeat: Repeat the processing file. SignalSource.repeat=false -;#dump: Dump the Signal source data to a file. SignalSource.dump=false SignalSource.dump_filename=../data/signal_source.dat -;#enable_throttle_control: Enabling this option tells the signal source to keep the delay between samples in post processing. -; it helps to not overload the CPU, but the processing time will be longer. SignalSource.enable_throttle_control=false ;######### SIGNAL_CONDITIONER CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. - -;#implementation: Use [Pass_Through] or [Signal_Conditioner] -;#[Pass_Through] disables this block and the [DataTypeAdapter], [InputFilter] and [Resampler] blocks -;#[Signal_Conditioner] enables this block. Then you have to configure [DataTypeAdapter], [InputFilter] and [Resampler] blocks SignalConditioner.implementation=Signal_Conditioner ;######### DATA_TYPE_ADAPTER CONFIG ############ -;## Changes the type of input data. Please disable it in this version. -;#implementation: [Pass_Through] disables this block DataTypeAdapter.implementation=Ibyte_To_Complex DataTypeAdapter.dump=false -;#dump_filename: Log path and filename. DataTypeAdapter.dump_filename=../data/DataTypeAdapter.dat ;######### INPUT_FILTER CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter] -;#[Pass_Through] disables this block -;#[Fir_Filter] enables a FIR Filter -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation that shifts IF down to zero Hz. - -;InputFilter.implementation=Fir_Filter -;InputFilter.implementation=Freq_Xlating_Fir_Filter InputFilter.implementation=Pass_Through - -;#dump: Dump the filtered data to a file. InputFilter.dump=false - -;#dump_filename: Log path and filename. InputFilter.dump_filename=../data/input_filter.dat - -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of gnuradio's function: gr_remez. -;#This function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, -;#the desired response on those bands, and the weight given to the error in those bands. - -;#input_item_type: Type and resolution for input signal samples. InputFilter.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter.output_item_type=gr_complex -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. -InputFilter.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time -InputFilter.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. -InputFilter.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - -InputFilter.band1_begin=0.0 -InputFilter.band1_end=0.45 -InputFilter.band2_begin=0.55 -InputFilter.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - -InputFilter.ampl1_begin=1.0 -InputFilter.ampl1_end=1.0 -InputFilter.ampl2_begin=0.0 -InputFilter.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands -InputFilter.band1_error=1.0 -InputFilter.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" -InputFilter.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. -InputFilter.grid_density=16 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. -;#InputFilter.IF is the intermediate frequency (in Hz) shifted down to zero Hz - -InputFilter.sampling_frequency=2600000 -InputFilter.IF=0 - - ;######### RESAMPLER CONFIG ############ -;## Resamples the input data. Resampler.implementation=Pass_Through Resampler.item_type = gr_complex; ;######### CHANNELS GLOBAL CONFIG ############ -;#count: Number of available GPS satellite channels. Channels_1C.count=11 -;#count: Number of available Galileo satellite channels. Channels_1B.count=0 -;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver Channels.in_acquisition=1 ;#signal: -;#if the option is disabled by default is assigned "1C" GPS L1 C/A Channel1.signal=1C Channel2.signal=1C Channel3.signal=1C @@ -159,109 +70,63 @@ Channel15.signal=1B ;######### GPS ACQUISITION CONFIG ############ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition -;#item_type: Type and resolution for each of the signal samples. Acquisition_1C.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1C.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] -Acquisition_1C.sampled_ms=1 -;#implementation: Acquisition algorithm selection for this channel: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition] -;#use_CFAR_algorithm: If enabled, acquisition estimates the input signal power to implement CFAR detection algorithms -;#notice that this affects the Acquisition threshold range! +Acquisition_1C.coherent_integration_time_ms=1 Acquisition_1C.use_CFAR_algorithm=false; -;#threshold: Acquisition threshold Acquisition_1C.threshold=15 -;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition] ;Acquisition_1C.pfa=0.01 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1C.doppler_max=6000 -;#doppler_max: Doppler step in the grid search [Hz] Acquisition_1C.doppler_step=100 -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] Acquisition_1C.dump=false -;#filename: Log path and filename Acquisition_1C.dump_filename=./acq_dump.dat ;######### GALILEO ACQUISITION CONFIG ############ Acquisition_1B.implementation=Galileo_E1_PCPS_Ambiguous_Acquisition -;#item_type: Type and resolution for each of the signal samples. Acquisition_1B.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1B.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] -Acquisition_1B.sampled_ms=4 -;#threshold: Acquisition threshold +Acquisition_1B.coherent_integration_time_ms=4 ;Acquisition_1B.threshold=0 -;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition] Acquisition_1B.pfa=0.0000008 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1B.doppler_max=15000 -;#doppler_max: Doppler step in the grid search [Hz] Acquisition_1B.doppler_step=125 -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] Acquisition_1B.dump=false -;#filename: Log path and filename Acquisition_1B.dump_filename=./acq_dump.dat ;######### TRACKING GPS CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_1C.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] -Tracking_1C.if=0 -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1C.pll_bw_hz=20.0; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] Tracking_1C.dll_bw_hz=1.5; -;#order: PLL/DLL loop filter order [2] or [3] Tracking_1C.order=3; ;######### TRACKING GALILEO CONFIG ############ Tracking_1B.implementation=Galileo_E1_DLL_PLL_VEML_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_1B.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] -Tracking_1B.if=0 -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] Tracking_1B.dump=false -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. Tracking_1B.dump_filename=../data/veml_tracking_ch_ -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1B.pll_bw_hz=15.0; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] Tracking_1B.dll_bw_hz=2.0; -;#order: PLL/DLL loop filter order [2] or [3] Tracking_1B.order=3; -;#early_late_space_chips: correlator early-late space [chips]. Use [0.5] for GPS and [0.15] for Galileo Tracking_1B.early_late_space_chips=0.15; -;#very_early_late_space_chips: only for [Galileo_E1_DLL_PLL_VEML_Tracking], correlator very early-late space [chips]. Use [0.6] Tracking_1B.very_early_late_space_chips=0.6; -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] Tracking_1C.dump=false -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. Tracking_1C.dump_filename=../data/epl_tracking_ch_ - ;######### TELEMETRY DECODER GPS CONFIG ############ -;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L1 C/A TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder TelemetryDecoder_1C.dump=false ;######### TELEMETRY DECODER GALILEO CONFIG ############ -;#implementation: Use [Galileo_E1B_Telemetry_Decoder] for Galileo E1B TelemetryDecoder_1B.implementation=Galileo_E1B_Telemetry_Decoder ;######### OBSERVABLES CONFIG ############ Observables.implementation=Hybrid_Observables -;#dump: Enable or disable the Observables internal binary data file logging [true] or [false] Observables.dump=false -;#dump_filename: Log path and filename. Observables.dump_filename=./observables.dat @@ -270,14 +135,10 @@ PVT.implementation=RTKLIB_PVT PVT.positioning_mode=PPP_Static ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad -;#output_rate_ms: Period between two PVT outputs. Notice that the minimum period is equal to the tracking integration time (for GPS CA L1 is 1ms) [ms] PVT.output_rate_ms=100; -;#display_rate_ms: Position console print (std::out) interval [ms]. Notice that output_rate_ms<=display_rate_ms. PVT.display_rate_ms=500; PVT.flag_rtcm_server=false PVT.flag_rtcm_tty_port=false PVT.rtcm_dump_devname=/dev/pts/1 -;#dump: Enable or disable the PVT internal binary data file logging [true] or [false] PVT.dump=false -;#dump_filename: Log path and filename without extension. Notice that PVT will add ".dat" to the binary dump and ".kml" to GoogleEarth dump. PVT.dump_filename=./PVT diff --git a/conf/gnss-sdr_Hybrid_gr_complex.conf b/conf/gnss-sdr_Hybrid_gr_complex.conf index 63f92330e..dbd9d8286 100644 --- a/conf/gnss-sdr_Hybrid_gr_complex.conf +++ b/conf/gnss-sdr_Hybrid_gr_complex.conf @@ -1,4 +1,6 @@ -; Default configuration file +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; @@ -10,135 +12,24 @@ GNSS-SDR.internal_fs_sps=4092000 ;######### SIGNAL_SOURCE CONFIG ############ -;#implementation SignalSource.implementation=File_Signal_Source -;#filename: path to file with the captured GNSS signal samples to be processed SignalSource.filename=/datalogger/signals/sim/GPS_sim1.dat ; <- PUT YOUR FILE HERE -;#item_type: Type and resolution for each of the signal samples. SignalSource.item_type=gr_complex -;#sampling_frequency: Original Signal sampling frequency in samples per second SignalSource.sampling_frequency=4092000 -;#samples: Number of samples to be processed. Notice that 0 indicates the entire file. SignalSource.samples=0 -;#repeat: Repeat the processing file. SignalSource.repeat=false -;#enable_throttle_control: Enabling this option tells the signal source to keep the delay between samples in post processing. -; it helps to not overload the CPU, but the processing time will be longer. SignalSource.enable_throttle_control=false ;######### SIGNAL_CONDITIONER CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. - -;#implementation: Use [Pass_Through] or [Signal_Conditioner] -;#[Pass_Through] disables this block and the [DataTypeAdapter], [InputFilter] and [Resampler] blocks -;#[Signal_Conditioner] enables this block. Then you have to configure [DataTypeAdapter], [InputFilter] and [Resampler] blocks SignalConditioner.implementation=Pass_Through -;######### DATA_TYPE_ADAPTER CONFIG ############ -;## Changes the type of input data. -;#implementation: [Pass_Through] disables this block -DataTypeAdapter.implementation=Pass_Through -DataTypeAdapter.item_type=gr_complex - -;######### INPUT_FILTER CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter] -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation -;# that shifts IF down to zero Hz. - -InputFilter.implementation=Pass_Through - -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of gnuradio's function: gr_remez. -;#This function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, -;#the desired response on those bands, and the weight given to the error in those bands. - -;#input_item_type: Type and resolution for input signal samples. -InputFilter.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. -InputFilter.output_item_type=gr_complex - -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. -InputFilter.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time -InputFilter.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. -InputFilter.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - -InputFilter.band1_begin=0.0 -InputFilter.band1_end=0.45 -InputFilter.band2_begin=0.55 -InputFilter.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - -InputFilter.ampl1_begin=1.0 -InputFilter.ampl1_end=1.0 -InputFilter.ampl2_begin=0.0 -InputFilter.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands -InputFilter.band1_error=1.0 -InputFilter.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" -InputFilter.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. -InputFilter.grid_density=16 - -;# Original sampling frequency stored in the signal file -InputFilter.sampling_frequency=4092000 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. -;#InputFilter.IF is the intermediate frequency (in Hz) shifted down to zero Hz - -InputFilter.IF=5499998.47412109 - -;# Decimation factor after the frequency tranaslating block -InputFilter.decimation_factor=8 - -;#dump: Dump the filtered data to a file. -InputFilter.dump=false - -;#dump_filename: Log path and filename. -InputFilter.dump_filename=../data/input_filter.dat - - -;######### RESAMPLER CONFIG ############ -;## Resamples the input data. -;#implementation: Use [Pass_Through] or [Direct_Resampler] -;#[Pass_Through] disables this block -;#[Direct_Resampler] enables a resampler that implements a nearest neigbourhood interpolation -Resampler.implementation=Pass_Through - ;######### CHANNELS GLOBAL CONFIG ############ -;#count: Number of available GPS satellite channels. Channels_1C.count=1 -;#count: Number of available Galileo satellite channels. Channels_1B.count=0 -;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver Channels.in_acquisition=1 -;#signal: -;# "1C" GPS L1 C/A -;# "2S" GPS L2 L2C (M) -;# "1B" GALILEO E1 B (I/NAV OS/CS/SoL) -;# "5X" GALILEO E5a I+Q - ;#if the option is disabled by default is assigned "1C" GPS L1 C/A Channel0.signal=1C Channel1.signal=1B @@ -160,134 +51,80 @@ Channel15.signal=1B ;######### GPS ACQUISITION CONFIG ############ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition -;#item_type: Type and resolution for each of the signal samples. Acquisition_1C.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1C.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] -Acquisition_1C.sampled_ms=1 +Acquisition_1C.coherent_integration_time_ms=1 Acquisition_1C.use_CFAR_algorithm=false; -;#threshold: Acquisition threshold Acquisition_1C.threshold=30 -;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition] ;Acquisition_1C.pfa=0.01 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1C.doppler_max=5000 -;#doppler_max: Doppler step in the grid search [Hz] Acquisition_1C.doppler_step=100 -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] Acquisition_1C.dump=false -;#filename: Log path and filename Acquisition_1C.dump_filename=./acq_dump.dat ;######### GALILEO ACQUISITION CONFIG ############ Acquisition_1B.implementation=Galileo_E1_PCPS_Ambiguous_Acquisition -;#item_type: Type and resolution for each of the signal samples. Acquisition_1B.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1B.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] -Acquisition_1B.sampled_ms=4 -;#threshold: Acquisition threshold +Acquisition_1B.coherent_integration_time_ms=4 ;Acquisition_1B.threshold=0 -;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition] Acquisition_1B.pfa=0.0000002 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1B.doppler_max=15000 -;#doppler_max: Doppler step in the grid search [Hz] Acquisition_1B.doppler_step=125 -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] Acquisition_1B.dump=false -;#filename: Log path and filename Acquisition_1B.dump_filename=./acq_dump.dat ;######### TRACKING GPS CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_C_Aid_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_1C.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] -Tracking_1C.if=0 -;# Extended correlation after telemetry bit synchronization -;# Valid values are: [1,2,4,5,10,20] (integer divisors of the GPS L1 CA bit period (20 ms) ) -;# Longer integration period require more stable front-end LO Tracking_1C.extend_correlation_ms=10 -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1C.pll_bw_hz=40; Tracking_1C.pll_bw_narrow_hz=25; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] Tracking_1C.dll_bw_hz=2.0; Tracking_1C.dll_bw_narrow_hz=2.0; -;#fll_bw_hz: FLL loop filter bandwidth [Hz] -Tracking_1C.fll_bw_hz=2.0; -;#order: PLL/DLL loop filter order [2] or [3] Tracking_1C.order=3; -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] Tracking_1C.dump=true -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. Tracking_1C.dump_filename=../data/epl_tracking_ch_ ;######### TRACKING GALILEO CONFIG ############ Tracking_1B.implementation=Galileo_E1_DLL_PLL_VEML_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_1B.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] -Tracking_1B.if=0 -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1B.pll_bw_hz=15.0; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] Tracking_1B.dll_bw_hz=2.0; -;#fll_bw_hz: FLL loop filter bandwidth [Hz] Tracking_1B.fll_bw_hz=10.0; -;#order: PLL/DLL loop filter order [2] or [3] Tracking_1B.order=3; -;#early_late_space_chips: correlator early-late space [chips]. Use [0.5] for GPS and [0.15] for Galileo Tracking_1B.early_late_space_chips=0.15; -;#very_early_late_space_chips: only for [Galileo_E1_DLL_PLL_VEML_Tracking], correlator very early-late space [chips]. Use [0.6] Tracking_1B.very_early_late_space_chips=0.6; -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] Tracking_1B.dump=false -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. Tracking_1B.dump_filename=../data/veml_tracking_ch_ ;######### TELEMETRY DECODER GPS CONFIG ############ -;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L1 C/A TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder TelemetryDecoder_1C.dump=false ;######### TELEMETRY DECODER GALILEO CONFIG ############ -;#implementation: Use [Galileo_E1B_Telemetry_Decoder] for Galileo E1B TelemetryDecoder_1B.implementation=Galileo_E1B_Telemetry_Decoder TelemetryDecoder_1B.dump=false ;######### OBSERVABLES CONFIG ############ -;#implementation: Observables.implementation=Hybrid_Observables -;#dump: Enable or disable the Observables internal binary data file logging [true] or [false] Observables.dump=false -;#dump_filename: Log path and filename. Observables.dump_filename=./observables.dat ;######### PVT CONFIG ############ -;#implementation: Position Velocity and Time (PVT) implementation: PVT.implementation=RTKLIB_PVT PVT.positioning_mode=PPP_Static ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad -;#output_rate_ms: Period between two PVT outputs. Notice that the minimum period is equal to the tracking integration time (for GPS CA L1 is 1ms) [ms] PVT.output_rate_ms=10; -;#display_rate_ms: Position console print (std::out) interval [ms]. Notice that output_rate_ms<=display_rate_ms. PVT.display_rate_ms=500; -;#dump: Enable or disable the PVT internal binary data file logging [true] or [false] PVT.dump=false PVT.flag_rtcm_server=false PVT.flag_rtcm_tty_port=false PVT.rtcm_dump_devname=/dev/pts/1 -;#dump_filename: Log path and filename without extension. Notice that PVT will add ".dat" to the binary dump and ".kml" to GoogleEarth dump. PVT.dump_filename=./PVT diff --git a/conf/gnss-sdr_Hybrid_ishort.conf b/conf/gnss-sdr_Hybrid_ishort.conf index 6bfa9e8fa..6fc17c35c 100644 --- a/conf/gnss-sdr_Hybrid_ishort.conf +++ b/conf/gnss-sdr_Hybrid_ishort.conf @@ -1,4 +1,6 @@ -; Default configuration file +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; @@ -28,133 +30,36 @@ GNSS-SDR.SUPL_CI=0x31b0 ;######### SIGNAL_SOURCE CONFIG ############ ;#implementation SignalSource.implementation=File_Signal_Source -;#filename: path to file with the captured GNSS signal samples to be processed SignalSource.filename=/datalogger/signals/CTTC/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat ; <- PUT YOUR FILE HERE -;#item_type: Type and resolution for each of the signal samples. SignalSource.item_type=ishort -;#sampling_frequency: Original Signal sampling frequency in samples per second SignalSource.sampling_frequency=4000000 -;#samples: Number of samples to be processed. Notice that 0 indicates the entire file. SignalSource.samples=0 -;#repeat: Repeat the processing file. SignalSource.repeat=false -;#enable_throttle_control: Enabling this option tells the signal source to keep the delay between samples in post processing. -; it helps to not overload the CPU, but the processing time will be longer. SignalSource.enable_throttle_control=false ;######### SIGNAL_CONDITIONER CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. - -;#implementation: Use [Pass_Through] or [Signal_Conditioner] -;#[Pass_Through] disables this block and the [DataTypeAdapter], [InputFilter] and [Resampler] blocks -;#[Signal_Conditioner] enables this block. Then you have to configure [DataTypeAdapter], [InputFilter] and [Resampler] blocks SignalConditioner.implementation=Signal_Conditioner ;######### DATA_TYPE_ADAPTER CONFIG ############ -;## Changes the type of input data. -;#implementation: [Pass_Through] disables this block DataTypeAdapter.implementation=Ishort_To_Complex ;######### INPUT_FILTER CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter] -;#[Pass_Through] disables this block -;#[Fir_Filter] enables a FIR Filter -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation that shifts IF down to zero Hz. - -;InputFilter.implementation=Fir_Filter -;InputFilter.implementation=Freq_Xlating_Fir_Filter InputFilter.implementation=Pass_Through - -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of gnuradio's function: gr_remez. -;#This function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, -;#the desired response on those bands, and the weight given to the error in those bands. - -;#input_item_type: Type and resolution for input signal samples. InputFilter.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter.output_item_type=gr_complex -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. -InputFilter.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time -InputFilter.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. -InputFilter.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - -InputFilter.band1_begin=0.0 -InputFilter.band1_end=0.45 -InputFilter.band2_begin=0.55 -InputFilter.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - -InputFilter.ampl1_begin=1.0 -InputFilter.ampl1_end=1.0 -InputFilter.ampl2_begin=0.0 -InputFilter.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands -InputFilter.band1_error=1.0 -InputFilter.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" -InputFilter.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. -InputFilter.grid_density=16 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. -;#InputFilter.IF is the intermediate frequency (in Hz) shifted down to zero Hz - -InputFilter.sampling_frequency=4000000 -InputFilter.IF=0 - -;#dump: Dump the filtered data to a file. -InputFilter.dump=false - -;#dump_filename: Log path and filename. -InputFilter.dump_filename=../data/input_filter.dat - ;######### RESAMPLER CONFIG ############ -;## Resamples the input data. -;#implementation: Use [Pass_Through] or [Direct_Resampler] -;#[Pass_Through] disables this block -;#[Direct_Resampler] enables a resampler that implements a nearest neigbourhood interpolation -;Resampler.implementation=Direct_Resampler Resampler.implementation=Pass_Through -;#item_type: Type and resolution for each of the signal samples. Resampler.item_type=gr_complex -;#sample_freq_in: the sample frequency of the input signalq -Resampler.sample_freq_in=4000000 -;#sample_freq_out: the desired sample frequency of the output signal -Resampler.sample_freq_out=4000000 -;#dump: Dump the resamplered data to a file. Resampler.dump=false -;#dump_filename: Log path and filename. Resampler.dump_filename=../data/resampler.dat ;######### CHANNELS GLOBAL CONFIG ############ -;#count: Number of available GPS satellite channels. Channels_1C.count=0 -;#count: Number of available Galileo satellite channels. Channels_1B.count=5 -;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver Channels.in_acquisition=1 ;#signal: @@ -174,120 +79,73 @@ Channel7.signal=1B ;######### GPS ACQUISITION CONFIG ############ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition -;#item_type: Type and resolution for each of the signal samples. Acquisition_1C.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1C.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] -Acquisition_1C.sampled_ms=1 -;#threshold: Acquisition threshold +Acquisition_1C.coherent_integration_time_ms=1 Acquisition_1C.threshold=0.0075 -;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition] ;Acquisition_1C.pfa=0.01 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1C.doppler_max=10000 -;#doppler_max: Doppler step in the grid search [Hz] Acquisition_1C.doppler_step=500 -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] Acquisition_1C.dump=false -;#filename: Log path and filename Acquisition_1C.dump_filename=./acq_dump.dat ;######### GALILEO ACQUISITION CONFIG ############ Acquisition_1B.implementation=Galileo_E1_PCPS_Ambiguous_Acquisition -;#item_type: Type and resolution for each of the signal samples. Acquisition_1B.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1B.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] -Acquisition_1B.sampled_ms=4 -;#implementation: Acquisition algorithm selection for this channel: -;#threshold: Acquisition threshold +Acquisition_1B.coherent_integration_time_ms=4 ;Acquisition_1B.threshold=0 -;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition] Acquisition_1B.pfa=0.0000008; 0.0000008 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1B.doppler_max=15000 -;#doppler_max: Doppler step in the grid search [Hz] Acquisition_1B.doppler_step=125 Acquisition_1B.cboc=false; -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] Acquisition_1B.dump=false -;#filename: Log path and filename Acquisition_1B.dump_filename=./acq_dump.dat ;######### TRACKING GPS CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_C_Aid_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_1C.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] -Tracking_1C.if=0 -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1C.pll_bw_hz=50.0; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] Tracking_1C.dll_bw_hz=5.0; -;#order: PLL/DLL loop filter order [2] or [3] Tracking_1C.order=3; -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] Tracking_1C.dump=false -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. Tracking_1C.dump_filename=../data/epl_tracking_ch_ ;######### TRACKING GALILEO CONFIG ############ Tracking_1B.implementation=Galileo_E1_DLL_PLL_VEML_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_1B.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] -Tracking_1B.if=0 -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1B.pll_bw_hz=20.0; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] Tracking_1B.dll_bw_hz=2.0; -;#order: PLL/DLL loop filter order [2] or [3] Tracking_1B.order=3; -;#early_late_space_chips: correlator early-late space [chips]. Use [0.5] for GPS and [0.15] for Galileo Tracking_1B.early_late_space_chips=0.15; -;#very_early_late_space_chips: only for [Galileo_E1_DLL_PLL_VEML_Tracking], correlator very early-late space [chips]. Use [0.6] Tracking_1B.very_early_late_space_chips=0.6; -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] Tracking_1B.dump=false -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. Tracking_1B.dump_filename=../data/veml_tracking_ch_ ;######### TELEMETRY DECODER GPS CONFIG ############ -;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L1 C/A TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder TelemetryDecoder_1C.dump=false ;######### TELEMETRY DECODER GALILEO CONFIG ############ -;#implementation: Use [Galileo_E1B_Telemetry_Decoder] for Galileo E1B TelemetryDecoder_1B.implementation=Galileo_E1B_Telemetry_Decoder TelemetryDecoder_1B.dump=false ;######### OBSERVABLES CONFIG ############ -;#implementation: Observables.implementation=Hybrid_Observables -;#dump: Enable or disable the Observables internal binary data file logging [true] or [false] Observables.dump=false -;#dump_filename: Log path and filename. Observables.dump_filename=./observables.dat ;######### PVT CONFIG ############ -;#implementation: Position Velocity and Time (PVT) implementation: PVT.implementation=RTKLIB_PVT PVT.positioning_mode=PPP_Static ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad -;#output_rate_ms: Period between two PVT outputs. Notice that the minimum period is equal to the tracking integration time (for GPS CA L1 is 1ms) [ms] PVT.output_rate_ms=100; -;#display_rate_ms: Position console print (std::out) interval [ms]. Notice that output_rate_ms<=display_rate_ms. PVT.display_rate_ms=500; PVT.flag_rtcm_server=true PVT.flag_rtcm_tty_port=false @@ -297,7 +155,5 @@ PVT.rtcm_MT1045_rate_ms=5000 ; Period (in ms) of Galileo ephemeris messages. 0 m PVT.rtcm_MT1045_rate_ms=5000 ; Period (in ms) of GPS ephemeris messages. 0 mutes this message PVT.rtcm_MT1097_rate_ms=1000 ; Period (in ms) of Galileo observables. 0 mutes this message PVT.rtcm_MT1077_rate_ms=1000 ; Period (in ms) of GPS observables. 0 mutes this message -;#dump: Enable or disable the PVT internal binary data file logging [true] or [false] PVT.dump=false -;#dump_filename: Log path and filename without extension. Notice that PVT will add ".dat" to the binary dump and ".kml" to GoogleEarth dump. PVT.dump_filename=./PVT diff --git a/conf/gnss-sdr_Hybrid_nsr.conf b/conf/gnss-sdr_Hybrid_nsr.conf index 2427aa101..682482991 100644 --- a/conf/gnss-sdr_Hybrid_nsr.conf +++ b/conf/gnss-sdr_Hybrid_nsr.conf @@ -1,4 +1,6 @@ -; Default configuration file +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; @@ -7,136 +9,60 @@ ;######### GLOBAL OPTIONS ################## ;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second]. -;GNSS-SDR.internal_fs_sps=6826700 GNSS-SDR.internal_fs_sps=2560000 -;GNSS-SDR.internal_fs_sps=4096000 -;GNSS-SDR.internal_fs_sps=5120000 + ;######### SIGNAL_SOURCE CONFIG ############ -;#implementation SignalSource.implementation=Nsr_File_Signal_Source -;#filename: path to file with the captured GNSS signal samples to be processed SignalSource.filename=/media/javier/SISTEMA/signals/ifen/E1L1_FE0_Band0.stream ; <- PUT YOUR FILE HERE -;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version. SignalSource.item_type=byte -;#sampling_frequency: Original Signal sampling frequency in samples per second SignalSource.sampling_frequency=20480000 -;#samples: Number of samples to be processed. Notice that 0 indicates the entire file. SignalSource.samples=0 -;#repeat: Repeat the processing file. SignalSource.repeat=false -;#dump: Dump the Signal source data to a file. SignalSource.dump=false SignalSource.dump_filename=../data/signal_source.dat -;#enable_throttle_control: Enabling this option tells the signal source to keep the delay between samples in post processing. -; it helps to not overload the CPU, but the processing time will be longer. SignalSource.enable_throttle_control=false ;######### SIGNAL_CONDITIONER CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. - -;#implementation: Use [Pass_Through] or [Signal_Conditioner] -;#[Pass_Through] disables this block and the [DataTypeAdapter], [InputFilter] and [Resampler] blocks -;#[Signal_Conditioner] enables this block. Then you have to configure [DataTypeAdapter], [InputFilter] and [Resampler] blocks SignalConditioner.implementation=Signal_Conditioner ;######### DATA_TYPE_ADAPTER CONFIG ############ -;## Changes the type of input data. -;#implementation: [Pass_Through] disables this block DataTypeAdapter.implementation=Pass_Through DataTypeAdapter.item_type=float ;######### INPUT_FILTER CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter] -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation -;# that shifts IF down to zero Hz. - InputFilter.implementation=Freq_Xlating_Fir_Filter - -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of gnuradio's function: gr_remez. -;#This function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, -;#the desired response on those bands, and the weight given to the error in those bands. - -;#input_item_type: Type and resolution for input signal samples. InputFilter.input_item_type=float - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter.output_item_type=gr_complex - -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. InputFilter.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time InputFilter.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. InputFilter.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - InputFilter.band1_begin=0.0 InputFilter.band1_end=0.45 InputFilter.band2_begin=0.55 InputFilter.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - InputFilter.ampl1_begin=1.0 InputFilter.ampl1_end=1.0 InputFilter.ampl2_begin=0.0 InputFilter.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands InputFilter.band1_error=1.0 InputFilter.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" InputFilter.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. InputFilter.grid_density=16 - -;# Original sampling frequency stored in the signal file InputFilter.sampling_frequency=20480000 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. -;#InputFilter.IF is the intermediate frequency (in Hz) shifted down to zero Hz - InputFilter.IF=5499998.47412109 - -;# Decimation factor after the frequency tranaslating block InputFilter.decimation_factor=8 - -;#dump: Dump the filtered data to a file. InputFilter.dump=false - -;#dump_filename: Log path and filename. InputFilter.dump_filename=../data/input_filter.dat ;######### RESAMPLER CONFIG ############ -;## Resamples the input data. - -;#implementation: Use [Pass_Through] or [Direct_Resampler] -;#[Pass_Through] disables this block -;#[Direct_Resampler] enables a resampler that implements a nearest neigbourhood interpolation Resampler.implementation=Pass_Through ;######### CHANNELS GLOBAL CONFIG ############ -;#count: Number of available GPS satellite channels. Channels_1C.count=8 -;#count: Number of available Galileo satellite channels. Channels_1B.count=0 -;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver Channels.in_acquisition=1 ;#signal: @@ -168,103 +94,59 @@ Channel15.signal=1B ;######### GPS ACQUISITION CONFIG ############ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition -;#item_type: Type and resolution for each of the signal samples. Acquisition_1C.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1C.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] -Acquisition_1C.sampled_ms=1 -;#threshold: Acquisition threshold +Acquisition_1C.coherent_integration_time_ms=1 Acquisition_1C.threshold=0.0075 -;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition] ;Acquisition_1C.pfa=0.01 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1C.doppler_max=5000 -;#doppler_max: Doppler step in the grid search [Hz] Acquisition_1C.doppler_step=250 -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] Acquisition_1C.dump=false -;#filename: Log path and filename Acquisition_1C.dump_filename=./acq_dump.dat ;######### GALILEO ACQUISITION CONFIG ############ Acquisition_1B.implementation=Galileo_E1_PCPS_Ambiguous_Acquisition -;#item_type: Type and resolution for each of the signal samples. Acquisition_1B.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1B.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] -Acquisition_1B.sampled_ms=4 -;#implementation: Acquisition algorithm selection for this channel: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition] -;#threshold: Acquisition threshold +Acquisition_1B.coherent_integration_time_ms=4 ;Acquisition_1B.threshold=0 -;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition] Acquisition_1B.pfa=0.0000002 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1B.doppler_max=15000 -;#doppler_max: Doppler step in the grid search [Hz] Acquisition_1B.doppler_step=125 -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] Acquisition_1B.dump=false -;#filename: Log path and filename Acquisition_1B.dump_filename=./acq_dump.dat ;######### TRACKING GPS CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_C_Aid_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_1C.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] -Tracking_1C.if=0 -;# Extended correlation after telemetry bit synchronization -;# Valid values are: [1,2,4,5,10,20] (integer divisors of the GPS L1 CA bit period (20 ms) ) -;# Longer integration period require more stable front-end LO Tracking_1C.extend_correlation_ms=1 -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1C.pll_bw_hz=40; Tracking_1C.pll_bw_narrow_hz=20; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] Tracking_1C.dll_bw_hz=2.0; Tracking_1C.dll_bw_narrow_hz=1.0; -;#order: PLL/DLL loop filter order [2] or [3] Tracking_1C.order=3; -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] Tracking_1C.dump=true -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. Tracking_1C.dump_filename=../data/epl_tracking_ch_ ;######### TRACKING GALILEO CONFIG ############ Tracking_1B.implementation=Galileo_E1_DLL_PLL_VEML_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_1B.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] -Tracking_1B.if=0 -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1B.pll_bw_hz=15.0; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] Tracking_1B.dll_bw_hz=2.0; -;#order: PLL/DLL loop filter order [2] or [3] Tracking_1B.order=3; -;#early_late_space_chips: correlator early-late space [chips]. Use [0.5] for GPS and [0.15] for Galileo Tracking_1B.early_late_space_chips=0.15; -;#very_early_late_space_chips: only for [Galileo_E1_DLL_PLL_VEML_Tracking], correlator very early-late space [chips]. Use [0.6] Tracking_1B.very_early_late_space_chips=0.6; -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] Tracking_1B.dump=false -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. Tracking_1B.dump_filename=../data/veml_tracking_ch_ ;######### TELEMETRY DECODER GPS CONFIG ############ -;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L1 C/A TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder TelemetryDecoder_1C.dump=false ;######### TELEMETRY DECODER GALILEO CONFIG ############ -;#implementation: Use [Galileo_E1B_Telemetry_Decoder] for Galileo E1B TelemetryDecoder_1B.implementation=Galileo_E1B_Telemetry_Decoder TelemetryDecoder_1B.dump=false @@ -272,9 +154,7 @@ TelemetryDecoder_1B.dump=false ;######### OBSERVABLES CONFIG ############ ;#implementation: Observables.implementation=Hybrid_Observables -;#dump: Enable or disable the Observables internal binary data file logging [true] or [false] Observables.dump=false -;#dump_filename: Log path and filename. Observables.dump_filename=./observables.dat @@ -283,14 +163,10 @@ PVT.implementation=RTKLIB_PVT PVT.positioning_mode=PPP_Static ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad -;#output_rate_ms: Period between two PVT outputs. Notice that the minimum period is equal to the tracking integration time (for GPS CA L1 is 1ms) [ms] PVT.output_rate_ms=10; -;#display_rate_ms: Position console print (std::out) interval [ms]. Notice that output_rate_ms<=display_rate_ms. PVT.display_rate_ms=500; PVT.flag_rtcm_server=false PVT.flag_rtcm_tty_port=false PVT.rtcm_dump_devname=/dev/pts/1 -;#dump: Enable or disable the PVT internal binary data file logging [true] or [false] PVT.dump=false -;#dump_filename: Log path and filename without extension. Notice that PVT will add ".dat" to the binary dump and ".kml" to GoogleEarth dump. PVT.dump_filename=./PVT diff --git a/conf/gnss-sdr_galileo_E1_extended_correlator_byte.conf b/conf/gnss-sdr_galileo_E1_extended_correlator_byte.conf index e9e5eb0f8..18d9f5307 100644 --- a/conf/gnss-sdr_galileo_E1_extended_correlator_byte.conf +++ b/conf/gnss-sdr_galileo_E1_extended_correlator_byte.conf @@ -1,4 +1,6 @@ -; Default configuration file +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; @@ -11,62 +13,34 @@ GNSS-SDR.internal_fs_sps=20000000 ;######### SIGNAL_SOURCE CONFIG ############ -;#implementation SignalSource.implementation=File_Signal_Source -;#filename: path to file with the captured GNSS signal samples to be processed SignalSource.filename=/media/javier/SISTEMA/signals/fraunhofer/L125_III1b_210s_L1.bin ; <- PUT YOUR FILE HERE -;#item_type: Type and resolution for each of the signal samples. SignalSource.item_type=byte -;#sampling_frequency: Original Signal sampling frequency in samples per second SignalSource.sampling_frequency=20000000 -;#samples: Number of samples to be processed. Notice that 0 indicates the entire file. SignalSource.samples=0 -;#repeat: Repeat the processing file. SignalSource.repeat=false -;#enable_throttle_control: Enabling this option tells the signal source to keep the delay between samples in post processing. -; it helps to not overload the CPU, but the processing time will be longer. SignalSource.enable_throttle_control=false ;######### SIGNAL_CONDITIONER CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. - -;#implementation: Use [Pass_Through] or [Signal_Conditioner] -;#[Pass_Through] disables this block and the [DataTypeAdapter], [InputFilter] and [Resampler] blocks -;#[Signal_Conditioner] enables this block. Then you have to configure [DataTypeAdapter], [InputFilter] and [Resampler] blocks SignalConditioner.implementation=Signal_Conditioner ;######### DATA_TYPE_ADAPTER CONFIG ############ -;## Changes the type of input data. -;#implementation: [Pass_Through] disables this block DataTypeAdapter.implementation=Ibyte_To_Complex ;######### INPUT_FILTER CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - InputFilter.implementation=Pass_Through - ;######### RESAMPLER CONFIG ############ -;## Resamples the input data. - -;#implementation: Use [Pass_Through] or [Direct_Resampler] -;#[Pass_Through] disables this block -;#[Direct_Resampler] enables a resampler that implements a nearest neighborhood interpolation -;Resampler.implementation=Direct_Resampler Resampler.implementation=Pass_Through ;######### CHANNELS GLOBAL CONFIG ############ -;#count: Number of available GPS satellite channels. Channels_1C.count=0 -;#count: Number of available Galileo satellite channels. -Channels_1B.count=1 -;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver +Channels_1B.count=8 + Channels.in_acquisition=1 -;#signal: -;#if the option is disabled by default is assigned "1C" GPS L1 C/A Channel1.signal=1B Channel2.signal=1B Channel3.signal=1B @@ -86,132 +60,83 @@ Channel15.signal=1B ;######### GPS ACQUISITION CONFIG ############ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition -;#item_type: Type and resolution for each of the signal samples. Acquisition_1C.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1C.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] -Acquisition_1C.sampled_ms=1 +Acquisition_1C.scoherent_integration_time_ms=1 Acquisition_1C.use_CFAR_algorithm=false; -;#threshold: Acquisition threshold Acquisition_1C.threshold=18 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1C.doppler_max=5000 -;#doppler_max: Doppler step in the grid search [Hz] Acquisition_1C.doppler_step=500 -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] Acquisition_1C.dump=false -;#filename: Log path and filename Acquisition_1C.dump_filename=./acq_dump.dat ;######### GALILEO ACQUISITION CONFIG ############ Acquisition_1B.implementation=Galileo_E1_PCPS_Ambiguous_Acquisition -;#item_type: Type and resolution for each of the signal samples. Acquisition_1B.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1B.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] -Acquisition_1B.sampled_ms=4 +Acquisition_1B.coherent_integration_time_ms=4 Acquisition_1B.acquire_pilot=true Acquisition_1B.use_CFAR_algorithm=false -;#threshold: Acquisition threshold Acquisition_1B.threshold=21 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1B.doppler_max=5000 -;#doppler_max: Doppler step in the grid search [Hz] Acquisition_1B.doppler_step=125 Acquisition_1B.bit_transition_flag=true -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] Acquisition_1B.dump=false -;#filename: Log path and filename Acquisition_1B.dump_filename=../data/acq_dump.dat ;######### TRACKING GPS CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_1C.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] -Tracking_1C.if=0 -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1C.pll_bw_hz=30.0; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] Tracking_1C.dll_bw_hz=2.0; -;#order: PLL/DLL loop filter order [2] or [3] Tracking_1C.order=3; -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] Tracking_1C.dump=false -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. Tracking_1C.dump_filename=../data/epl_tracking_ch_ ;######### TRACKING GALILEO CONFIG ############ Tracking_1B.implementation=Galileo_E1_DLL_PLL_VEML_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_1B.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] Tracking_1B.if=0 Tracking_1B.track_pilot=true -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1B.pll_bw_hz=4.0; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] Tracking_1B.dll_bw_hz=0.5; -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1B.pll_bw_narrow_hz=2.0; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] Tracking_1B.dll_bw_narrow_hz=0.25; Tracking_1B.extend_correlation_symbols=4; -;#order: PLL/DLL loop filter order [2] or [3] Tracking_1B.order=3; -;#early_late_space_chips: correlator early-late space [chips]. Use [0.5] for GPS and [0.15] for Galileo Tracking_1B.early_late_space_chips=0.15; -;#very_early_late_space_chips: only for [Galileo_E1_DLL_PLL_VEML_Tracking], correlator very early-late space [chips]. Use [0.6] Tracking_1B.very_early_late_space_chips=0.6; -;#early_late_space_chips: correlator early-late space [chips]. Use [0.5] for GPS and [0.15] for Galileo Tracking_1B.early_late_space_narrow_chips=0.06; -;#very_early_late_space_chips: only for [Galileo_E1_DLL_PLL_VEML_Tracking], correlator very early-late space [chips]. Use [0.6] Tracking_1B.very_early_late_space_narrow_chips=0.25; -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] -Tracking_1B.dump=true -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. +Tracking_1B.dump=false Tracking_1B.dump_filename=../data/veml_tracking_ch_ ;######### TELEMETRY DECODER GPS CONFIG ############ -;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L1 C/A TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder TelemetryDecoder_1C.dump=false ;######### TELEMETRY DECODER GALILEO CONFIG ############ -;#implementation: Use [Galileo_E1B_Telemetry_Decoder] for Galileo E1B TelemetryDecoder_1B.implementation=Galileo_E1B_Telemetry_Decoder TelemetryDecoder_1B.dump=false ;######### OBSERVABLES CONFIG ############ -;#implementation: Observables.implementation=Hybrid_Observables -;#dump: Enable or disable the Observables internal binary data file logging [true] or [false] Observables.dump=false -;#dump_filename: Log path and filename. Observables.dump_filename=./observables.dat ;######### PVT CONFIG ############ -;#implementation: Position Velocity and Time (PVT) implementation: PVT.implementation=RTKLIB_PVT PVT.positioning_mode=PPP_Static ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad -;#output_rate_ms: Period between two PVT outputs. Notice that the minimum period is equal to the tracking integration time (for GPS CA L1 is 1ms) [ms] PVT.output_rate_ms=100; -;#display_rate_ms: Position console print (std::out) interval [ms]. Notice that output_rate_ms<=display_rate_ms. PVT.display_rate_ms=500; PVT.flag_rtcm_server=false PVT.flag_rtcm_tty_port=false PVT.rtcm_dump_devname=/dev/pts/1 -;#dump: Enable or disable the PVT internal binary data file logging [true] or [false] PVT.dump=false -;#dump_filename: Log path and filename without extension. Notice that PVT will add ".dat" to the binary dump and ".kml" to GoogleEarth dump. PVT.dump_filename=./PVT diff --git a/conf/gnss-sdr_galileo_E1_extended_correlator_labsat.conf b/conf/gnss-sdr_galileo_E1_extended_correlator_labsat.conf index 8b2f05195..cfbd1f73c 100644 --- a/conf/gnss-sdr_galileo_E1_extended_correlator_labsat.conf +++ b/conf/gnss-sdr_galileo_E1_extended_correlator_labsat.conf @@ -1,4 +1,6 @@ -; Default configuration file +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; @@ -6,11 +8,9 @@ [GNSS-SDR] ;######### GLOBAL OPTIONS ################## -;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz]. GNSS-SDR.internal_fs_sps=5456000 ;######### SIGNAL_SOURCE CONFIG ############ -;#implementation SignalSource.implementation=Labsat_Signal_Source SignalSource.selected_channel=1 ;#filename: path to file with the captured GNSS signal samples to be processed @@ -18,121 +18,58 @@ SignalSource.selected_channel=1 ;# the adapter adds "_0000.LS3" to this base path and filename. Next file will be "_0001.LS3" and so on ;# in this example, the first file complete path will be ../signals/GPS_025_0000.LS3 SignalSource.filename=../signals/GPS_025 ; <- PUT YOUR FILE HERE -;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version. SignalSource.item_type=gr_complex -;#sampling_frequency: Original Signal sampling frequency in samples per second SignalSource.sampling_frequency=16368000 -;#samples: Number of samples to be processed. Notice that 0 indicates the entire file. SignalSource.samples=0 -;#repeat: Repeat the processing file. SignalSource.repeat=false -;#dump: Dump the Signal source data to a file. SignalSource.dump=false SignalSource.dump_filename=../data/signal_source.dat -;#enable_throttle_control: Enabling this option tells the signal source to keep the delay between samples in post processing. -; it helps to not overload the CPU, but the processing time will be longer. SignalSource.enable_throttle_control=false ;######### SIGNAL_CONDITIONER CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. - -;#implementation: Use [Pass_Through] or [Signal_Conditioner] -;#[Pass_Through] disables this block and the [DataTypeAdapter], [InputFilter] and [Resampler] blocks -;#[Signal_Conditioner] enables this block. Then you have to configure [DataTypeAdapter], [InputFilter] and [Resampler] blocks SignalConditioner.implementation=Signal_Conditioner ;######### DATA_TYPE_ADAPTER CONFIG ############ -;## Changes the type of input data. -;#implementation: [Pass_Through] disables this block DataTypeAdapter.implementation=Pass_Through DataTypeAdapter.item_type=gr_complex ;######### INPUT_FILTER CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -;#implementation -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation -;# that shifts IF down to zero Hz. InputFilter.implementation=Freq_Xlating_Fir_Filter - -;#dump: Dump the filtered data to a file. InputFilter.dump=false - -;#dump_filename: Log path and filename. InputFilter.dump_filename=../data/input_filter.dat -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of gnuradio's function: gr_remez. -;#This function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, -;#the desired response on those bands, and the weight given to the error in those bands. - -;#input_item_type: Type and resolution for input signal samples. InputFilter.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter.output_item_type=gr_complex - -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. InputFilter.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time InputFilter.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. InputFilter.number_of_bands=2 -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - InputFilter.band1_begin=0.0 InputFilter.band1_end=0.45 InputFilter.band2_begin=0.55 InputFilter.band2_end=1.0 -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - InputFilter.ampl1_begin=1.0 InputFilter.ampl1_end=1.0 InputFilter.ampl2_begin=0.0 InputFilter.ampl2_end=0.0 -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands InputFilter.band1_error=1.0 InputFilter.band2_error=1.0 -;#filter_type: one of "bandpass", "hilbert" or "differentiator" InputFilter.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. InputFilter.grid_density=16 - -;# Original sampling frequency stored in the signal file InputFilter.sampling_frequency=16368000 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. -;#InputFilter.IF is the intermediate frequency (in Hz) shifted down to zero Hz - InputFilter.IF=0 - -;# Decimation factor after the frequency tranaslating block InputFilter.decimation_factor=3 ;######### CHANNELS GLOBAL CONFIG ############ -;#count: Number of available GPS satellite channels. Channels_1C.count=0 -;#count: Number of available Galileo satellite channels. Channels_1B.count=6 -;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver Channels.in_acquisition=1 -;#signal: -;#if the option is disabled by default is assigned "1C" GPS L1 C/A Channel0.signal=1B Channel1.signal=1B Channel2.signal=1B @@ -153,130 +90,80 @@ Channel15.signal=1B ;######### GPS ACQUISITION CONFIG ############ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition -;#item_type: Type and resolution for each of the signal samples. Acquisition_1C.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1C.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] -Acquisition_1C.sampled_ms=1 +Acquisition_1C.coherent_integration_time_ms=1 Acquisition_1C.use_CFAR_algorithm=false; -;#threshold: Acquisition threshold Acquisition_1C.threshold=22 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1C.doppler_max=5000 -;#doppler_max: Doppler step in the grid search [Hz] Acquisition_1C.doppler_step=250 -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] Acquisition_1C.dump=false -;#filename: Log path and filename Acquisition_1C.dump_filename=./acq_dump.dat ;######### GALILEO ACQUISITION CONFIG ############ Acquisition_1B.implementation=Galileo_E1_PCPS_Ambiguous_Acquisition -;#item_type: Type and resolution for each of the signal samples. Acquisition_1B.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1B.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] -Acquisition_1B.sampled_ms=4 +Acquisition_1B.coherent_integration_time_ms=4 Acquisition_1B.acquire_pilot=true Acquisition_1B.use_CFAR_algorithm=false -;#threshold: Acquisition threshold Acquisition_1B.threshold=22 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1B.doppler_max=5000 -;#doppler_max: Doppler step in the grid search [Hz] Acquisition_1B.doppler_step=125 Acquisition_1B.bit_transition_flag=true -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] Acquisition_1B.dump=false -;#filename: Log path and filename Acquisition_1B.dump_filename=../data/acq_dump.dat ;######### TRACKING GPS CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_1C.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] -Tracking_1C.if=0 -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1C.pll_bw_hz=40.0; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] Tracking_1C.dll_bw_hz=2.0; -;#order: PLL/DLL loop filter order [2] or [3] Tracking_1C.order=3; -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] -Tracking_1C.dump=true -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. +Tracking_1C.dump=false Tracking_1C.dump_filename=../data/epl_tracking_ch_ ;######### TRACKING GALILEO CONFIG ############ Tracking_1B.implementation=Galileo_E1_DLL_PLL_VEML_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_1B.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] -Tracking_1B.if=0 Tracking_1B.track_pilot=true -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1B.pll_bw_hz=7.5; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] Tracking_1B.dll_bw_hz=0.5; -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1B.pll_bw_narrow_hz=2.5; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] Tracking_1B.dll_bw_narrow_hz=0.25; Tracking_1B.extend_correlation_symbols=4; -;#order: PLL/DLL loop filter order [2] or [3] Tracking_1B.order=3; -;#early_late_space_chips: correlator early-late space [chips]. Use [0.5] for GPS and [0.15] for Galileo Tracking_1B.early_late_space_chips=0.15; -;#very_early_late_space_chips: only for [Galileo_E1_DLL_PLL_VEML_Tracking], correlator very early-late space [chips]. Use [0.6] Tracking_1B.very_early_late_space_chips=0.6; -;#early_late_space_chips: correlator early-late space [chips]. Use [0.5] for GPS and [0.15] for Galileo Tracking_1B.early_late_space_narrow_chips=0.15; -;#very_early_late_space_chips: only for [Galileo_E1_DLL_PLL_VEML_Tracking], correlator very early-late space [chips]. Use [0.6] Tracking_1B.very_early_late_space_narrow_chips=0.30; -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] -Tracking_1B.dump=true -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. +Tracking_1B.dump=false Tracking_1B.dump_filename=../data/veml_tracking_ch_ ;######### TELEMETRY DECODER GPS CONFIG ############ -;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L1 C/A TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder TelemetryDecoder_1C.dump=false ;######### TELEMETRY DECODER GALILEO CONFIG ############ -;#implementation: Use [Galileo_E1B_Telemetry_Decoder] for Galileo E1B TelemetryDecoder_1B.implementation=Galileo_E1B_Telemetry_Decoder TelemetryDecoder_1B.dump=false ;######### OBSERVABLES CONFIG ############ -;#implementation: Observables.implementation=Hybrid_Observables -;#dump: Enable or disable the Observables internal binary data file logging [true] or [false] Observables.dump=false -;#dump_filename: Log path and filename. Observables.dump_filename=./observables.dat ;######### PVT CONFIG ############ -;#implementation: Position Velocity and Time (PVT) implementation: PVT.implementation=RTKLIB_PVT PVT.positioning_mode=Single ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad -;#output_rate_ms: Period between two PVT outputs. Notice that the minimum period is equal to the tracking integration time (for GPS CA L1 is 1ms) [ms] PVT.output_rate_ms=100; -;#display_rate_ms: Position console print (std::out) interval [ms]. Notice that output_rate_ms<=display_rate_ms. PVT.display_rate_ms=500; PVT.flag_rtcm_server=false PVT.flag_rtcm_tty_port=false PVT.rtcm_dump_devname=/dev/pts/1 -;#dump: Enable or disable the PVT internal binary data file logging [true] or [false] PVT.dump=false -;#dump_filename: Log path and filename without extension. Notice that PVT will add ".dat" to the binary dump and ".kml" to GoogleEarth dump. PVT.dump_filename=./PVT diff --git a/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_bin_file_III_1a.conf b/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_bin_file_III_1a.conf index 746dbdea9..2180d8ccb 100644 --- a/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_bin_file_III_1a.conf +++ b/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_bin_file_III_1a.conf @@ -1,4 +1,6 @@ -; Default configuration file +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; @@ -24,27 +26,20 @@ GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 ;######### SIGNAL_SOURCE CONFIG ############ -;#implementation SignalSource.implementation=Flexiband_Signal_Source SignalSource.flag_read_file=true SignalSource.signal_file=/datalogger/signals/Fraunhofer/L125_III1b_210s.usb ; <- PUT YOUR FILE HERE -;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version. SignalSource.item_type=gr_complex -;# FPGA firmware file SignalSource.firmware_file=flexiband_III-1b.bit -;#RF_channels: Number of RF channels present in the frontend device, must agree the FPGA firmware file SignalSource.RF_channels=1 ;#frontend channels gain. Not usable yet! SignalSource.gain1=0 SignalSource.gain2=0 SignalSource.gain3=0 -;#frontend channels AGC SignalSource.AGC=true -;# USB 3.0 packet buffer size (number of SuperSpeed packets) SignalSource.usb_packet_buffer=128 ;######### SIGNAL_CONDITIONER 0 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. SignalConditioner0.implementation=Signal_Conditioner ;######### DATA_TYPE_ADAPTER 0 CONFIG ############ @@ -52,88 +47,34 @@ DataTypeAdapter0.implementation=Pass_Through DataTypeAdapter0.item_type=gr_complex ;######### INPUT_FILTER 0 CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter] -;#[Pass_Through] disables this block -;#[Fir_Filter] enables a FIR Filter -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation that shifts IF down to zero Hz. - InputFilter0.implementation=Freq_Xlating_Fir_Filter - -;#dump: Dump the filtered data to a file. InputFilter0.dump=false - -;#dump_filename: Log path and filename. InputFilter0.dump_filename=../data/input_filter.dat - -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of gnuradio's function: gr_remez. -;#This function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, -;#the desired response on those bands, and the weight given to the error in those bands. - -;#input_item_type: Type and resolution for input signal samples. InputFilter0.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter0.output_item_type=gr_complex - -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. InputFilter0.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time InputFilter0.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. InputFilter0.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - InputFilter0.band1_begin=0.0 InputFilter0.band1_end=0.45 InputFilter0.band2_begin=0.55 InputFilter0.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - InputFilter0.ampl1_begin=1.0 InputFilter0.ampl1_end=1.0 InputFilter0.ampl2_begin=0.0 InputFilter0.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands InputFilter0.band1_error=1.0 InputFilter0.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" InputFilter0.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. InputFilter0.grid_density=16 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. -;#InputFilter0.IF is the intermediate frequency (in Hz) shifted down to zero Hz -;FOR USE GNSS-SDR WITH RTLSDR DONGLES USER MUST SET THE CALIBRATED SAMPLE RATE HERE -; i.e. using front-end-cal as reported here:http://www.cttc.es/publication/turning-a-television-into-a-gnss-receiver/ InputFilter0.sampling_frequency=20000000 -;# IF deviation due to front-end LO inaccuracies [HZ] InputFilter0.IF=0; -;#-205000 - -;# Decimation factor after the frequency tranaslating block InputFilter0.decimation_factor=8 ;######### RESAMPLER CONFIG 0 ############ -;## Resamples the input data. Resampler0.implementation=Pass_Through ;######### SIGNAL_CONDITIONER 1 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. SignalConditioner1.implementation=Pass_Through ;######### DATA_TYPE_ADAPTER 1 CONFIG ############ @@ -142,25 +83,15 @@ DataTypeAdapter1.item_type=gr_complex ;######### INPUT_FILTER 1 CONFIG ############ InputFilter1.implementation=Pass_Through - -;#dump: Dump the filtered data to a file. InputFilter1.dump=false - -;#dump_filename: Log path and filename. InputFilter1.dump_filename=../data/input_filter.dat - -;#input_item_type: Type and resolution for input signal samples. InputFilter1.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter1.output_item_type=gr_complex ;######### RESAMPLER CONFIG 1 ############ -;## Resamples the input data. Resampler1.implementation=Pass_Through ;######### SIGNAL_CONDITIONER 2 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. SignalConditioner2.implementation=Pass_Through ;######### DATA_TYPE_ADAPTER 2 CONFIG ############ @@ -169,28 +100,17 @@ DataTypeAdapter2.item_type=gr_complex ;######### INPUT_FILTER 2 CONFIG ############ InputFilter2.implementation=Pass_Through - -;#dump: Dump the filtered data to a file. InputFilter2.dump=false - -;#dump_filename: Log path and filename. InputFilter2.dump_filename=../data/input_filter.dat - -;#input_item_type: Type and resolution for input signal samples. InputFilter2.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter2.output_item_type=gr_complex ;######### RESAMPLER CONFIG 2 ############ -;## Resamples the input data. Resampler2.implementation=Pass_Through ;######### CHANNELS GLOBAL CONFIG ############ -;#count: Number of available GPS satellite channels. Channels_1C.count=8 -;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver Channels.in_acquisition=1 ;# CHANNEL CONNECTION @@ -204,77 +124,46 @@ Channel6.RF_channel_ID=0 Channel7.RF_channel_ID=0 ;#signal: -;#if the option is disabled by default is assigned "1C" GPS L1 C/A Channel.signal=1C -;######### SPECIFIC CHANNELS CONFIG ###### -;#The following options are specific to each channel and overwrite the generic options - ;######### ACQUISITION GLOBAL CONFIG ############ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition -;#item_type: Type and resolution for each of the signal samples. Acquisition_1C.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1C.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] Acquisition_1C.coherent_integration_time_ms=1 Acquisition_1C.use_CFAR_algorithm=false; -;#threshold: Acquisition threshold. It will be ignored if pfa is defined. Acquisition_1C.threshold=15 -;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition] ;Acquisition_1C.pfa=0.0001 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1C.doppler_max=10000 -;#doppler_max: Doppler step in the grid search [Hz] Acquisition_1C.doppler_step=250 -;#bit_transition_flag: Enable or disable a strategy to deal with bit transitions in GPS signals: process two dwells and take -;#maximum test statistics. Only use with implementation: [GPS_L1_CA_PCPS_Acquisition] -;#(should not be used for Galileo_E1_PCPS_Ambiguous_Acquisition]) Acquisition_1C.bit_transition_flag=false -;#max_dwells: Maximum number of consecutive dwells to be processed. It will be ignored if bit_transition_flag=true Acquisition_1C.max_dwells=1 -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] Acquisition_1C.dump=false -;#filename: Log path and filename Acquisition_1C.dump_filename=./acq_dump.dat ;######### TRACKING GLOBAL CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_C_Aid_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_1C.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] -Tracking_1C.if=0 Tracking_1C.extend_correlation_ms=10 -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1C.pll_bw_hz=40.0; Tracking_1C.pll_bw_narrow_hz=35; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] Tracking_1C.dll_bw_hz=2.0; Tracking_1C.dll_bw_narrow_hz=2.0; -;#order: PLL/DLL loop filter order [2] or [3] Tracking_1C.order=3; -;#early_late_space_chips: correlator early-late space [chips]. Use [0.5] Tracking_1C.early_late_space_chips=0.5; -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] Tracking_1C.dump=true -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. Tracking_1C.dump_filename=../data/epl_tracking_ch_ ;######### TELEMETRY DECODER GPS CONFIG ############ -;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L1 C/A TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder TelemetryDecoder_1C.dump=false ;######### OBSERVABLES CONFIG ############ -;#implementation: Observables.implementation=Hybrid_Observables -;#dump: Enable or disable the Observables internal binary data file logging [true] or [false] Observables.dump=false -;#dump_filename: Log path and filename. Observables.dump_filename=./observables.dat @@ -283,22 +172,13 @@ PVT.implementation=RTKLIB_PVT PVT.positioning_mode=PPP_Static ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad -;#output_rate_ms: Period between two PVT outputs. Notice that the minimum period is equal to the tracking integration time (for GPS CA L1 is 1ms) [ms] PVT.output_rate_ms=100 -;#display_rate_ms: Position console print (std::out) interval [ms]. Notice that output_rate_ms<=display_rate_ms. PVT.display_rate_ms=500 -;# KML, GeoJSON, NMEA and RTCM output configuration -;#nmea_dump_filename: NMEA log path and filename PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea; -;#flag_nmea_tty_port: Enable or disable the NMEA log to a serial TTY port (Can be used with real hardware or virtual one) PVT.flag_nmea_tty_port=false; -;#nmea_dump_devname: serial device descriptor for NMEA logging PVT.nmea_dump_devname=/dev/pts/4 PVT.flag_rtcm_server=true PVT.flag_rtcm_tty_port=false PVT.rtcm_dump_devname=/dev/pts/1 -;#dump: Enable or disable the PVT internal binary data file logging [true] or [false] PVT.dump=false -;#dump_filename: Log path and filename without extension. Notice that PVT will add ".dat" to the binary dump and ".kml" to GoogleEarth dump. PVT.dump_filename=./PVT - diff --git a/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_III_1a.conf b/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_III_1a.conf index dc80ecfd0..e53db62e7 100644 --- a/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_III_1a.conf +++ b/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_III_1a.conf @@ -1,4 +1,6 @@ -; Default configuration file +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; @@ -25,31 +27,18 @@ GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 ;######### SIGNAL_SOURCE CONFIG ############ -;#implementation SignalSource.implementation=Flexiband_Signal_Source - -;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version. SignalSource.item_type=gr_complex - -;# FPGA firmware file SignalSource.firmware_file=flexiband_III-1a.bit - -;#RF_channels: Number of RF channels present in the frontend device, must agree the FPGA firmware file SignalSource.RF_channels=1 - ;#frontend channels gain. Not usable yet! SignalSource.gain1=0 SignalSource.gain2=0 SignalSource.gain3=0 - -;#frontend channels AGC SignalSource.AGC=true - -;# USB 3.0 packet buffer size (number of SuperSpeed packets) SignalSource.usb_packet_buffer=128 ;######### SIGNAL_CONDITIONER 0 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. SignalConditioner0.implementation=Signal_Conditioner ;######### DATA_TYPE_ADAPTER 0 CONFIG ############ @@ -57,87 +46,34 @@ DataTypeAdapter0.implementation=Pass_Through DataTypeAdapter0.item_type=gr_complex ;######### INPUT_FILTER 0 CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter] -;#[Pass_Through] disables this block -;#[Fir_Filter] enables a FIR Filter -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation that shifts IF down to zero Hz. - InputFilter0.implementation=Freq_Xlating_Fir_Filter - -;#dump: Dump the filtered data to a file. InputFilter0.dump=false - -;#dump_filename: Log path and filename. InputFilter0.dump_filename=../data/input_filter.dat - -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of gnuradio's function: gr_remez. -;#This function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, -;#the desired response on those bands, and the weight given to the error in those bands. - -;#input_item_type: Type and resolution for input signal samples. InputFilter0.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter0.output_item_type=gr_complex - -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. InputFilter0.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time InputFilter0.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. InputFilter0.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - InputFilter0.band1_begin=0.0 InputFilter0.band1_end=0.45 InputFilter0.band2_begin=0.55 InputFilter0.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - InputFilter0.ampl1_begin=1.0 InputFilter0.ampl1_end=1.0 InputFilter0.ampl2_begin=0.0 InputFilter0.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands InputFilter0.band1_error=1.0 InputFilter0.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" InputFilter0.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. InputFilter0.grid_density=16 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. -;#InputFilter0.IF is the intermediate frequency (in Hz) shifted down to zero Hz -;FOR USE GNSS-SDR WITH RTLSDR DONGLES USER MUST SET THE CALIBRATED SAMPLE RATE HERE -; i.e. using front-end-cal as reported here:http://www.cttc.es/publication/turning-a-television-into-a-gnss-receiver/ InputFilter0.sampling_frequency=20000000 -;# IF deviation due to front-end LO inaccuracies [HZ] InputFilter0.IF=-205000 - -;# Decimation factor after the frequency tranaslating block InputFilter0.decimation_factor=8 ;######### RESAMPLER CONFIG 0 ############ -;## Resamples the input data. Resampler0.implementation=Pass_Through ;######### SIGNAL_CONDITIONER 1 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. SignalConditioner1.implementation=Pass_Through ;######### DATA_TYPE_ADAPTER 1 CONFIG ############ @@ -146,25 +82,15 @@ DataTypeAdapter1.item_type=gr_complex ;######### INPUT_FILTER 1 CONFIG ############ InputFilter1.implementation=Pass_Through - -;#dump: Dump the filtered data to a file. InputFilter1.dump=false - -;#dump_filename: Log path and filename. InputFilter1.dump_filename=../data/input_filter.dat - -;#input_item_type: Type and resolution for input signal samples. InputFilter1.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter1.output_item_type=gr_complex ;######### RESAMPLER CONFIG 1 ############ -;## Resamples the input data. Resampler1.implementation=Pass_Through ;######### SIGNAL_CONDITIONER 2 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. SignalConditioner2.implementation=Pass_Through ;######### DATA_TYPE_ADAPTER 2 CONFIG ############ @@ -173,37 +99,19 @@ DataTypeAdapter2.item_type=gr_complex ;######### INPUT_FILTER 2 CONFIG ############ InputFilter2.implementation=Pass_Through - -;#dump: Dump the filtered data to a file. InputFilter2.dump=false - -;#dump_filename: Log path and filename. InputFilter2.dump_filename=../data/input_filter.dat - -;#input_item_type: Type and resolution for input signal samples. InputFilter2.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter2.output_item_type=gr_complex ;######### RESAMPLER CONFIG 2 ############ -;## Resamples the input data. Resampler2.implementation=Pass_Through ;######### CHANNELS GLOBAL CONFIG ############ -;#count: Number of available GPS satellite channels. Channels_1C.count=8 -;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver Channels.in_acquisition=1 -;#signal: -;# "1C" GPS L1 C/A -;# "1B" GALILEO E1 B (I/NAV OS/CS/SoL) -;# "1G" GLONASS L1 C/A -;# "2S" GPS L2 L2C (M) -;# "5X" GALILEO E5a I+Q -;# "L5" GPS L5 ;# CHANNEL CONNECTION Channel0.RF_channel_ID=0 @@ -227,69 +135,39 @@ Channel6.signal=1C Channel7.signal=1C -;######### SPECIFIC CHANNELS CONFIG ###### -;#The following options are specific to each channel and overwrite the generic options - - ;######### ACQUISITION GLOBAL CONFIG ############ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition -;#item_type: Type and resolution for each of the signal samples. Acquisition_1C.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1C.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] Acquisition_1C.coherent_integration_time_ms=1 -;#threshold: Acquisition threshold. It will be ignored if pfa is defined. Acquisition_1C.threshold=0.012 -;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition] ;Acquisition_1C.pfa=0.0001 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1C.doppler_max=10000 -;#doppler_max: Doppler step in the grid search [Hz] Acquisition_1C.doppler_step=250 -;#bit_transition_flag: Enable or disable a strategy to deal with bit transitions in GPS signals: process two dwells and take -;#maximum test statistics. Only use with implementation: [GPS_L1_CA_PCPS_Acquisition] -;#(should not be used for Galileo_E1_PCPS_Ambiguous_Acquisition]) Acquisition_1C.bit_transition_flag=false -;#max_dwells: Maximum number of consecutive dwells to be processed. It will be ignored if bit_transition_flag=true Acquisition_1C.max_dwells=1 -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] Acquisition_1C.dump=false -;#filename: Log path and filename Acquisition_1C.dump_filename=./acq_dump.dat ;######### TRACKING GLOBAL CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_1C.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] -Tracking_1C.if=0 -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1C.pll_bw_hz=40.0; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] Tracking_1C.dll_bw_hz=3.0; -;#order: PLL/DLL loop filter order [2] or [3] Tracking_1C.order=3; -;#early_late_space_chips: correlator early-late space [chips]. Use [0.5] Tracking_1C.early_late_space_chips=0.5; -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] Tracking_1C.dump=false -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. Tracking_1C.dump_filename=./tracking_ch_ ;######### TELEMETRY DECODER GPS CONFIG ############ -;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L1 C/A TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder TelemetryDecoder_1C.dump=false ;######### OBSERVABLES CONFIG ############ Observables.implementation=Hybrid_Observables -;#dump: Enable or disable the Observables internal binary data file logging [true] or [false] Observables.dump=false -;#dump_filename: Log path and filename. Observables.dump_filename=./observables.dat @@ -298,21 +176,13 @@ PVT.implementation=RTKLIB_PVT PVT.positioning_mode=PPP_Static ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad -;#output_rate_ms: Period between two PVT outputs. Notice that the minimum period is equal to the tracking integration time (for GPS CA L1 is 1ms) [ms] PVT.output_rate_ms=100 -;#display_rate_ms: Position console print (std::out) interval [ms]. Notice that output_rate_ms<=display_rate_ms. PVT.display_rate_ms=500 -;# KML, GeoJSON, NMEA and RTCM output configuration -;#nmea_dump_filename: NMEA log path and filename PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea; -;#flag_nmea_tty_port: Enable or disable the NMEA log to a serial TTY port (Can be used with real hardware or virtual one) PVT.flag_nmea_tty_port=false; -;#nmea_dump_devname: serial device descriptor for NMEA logging PVT.nmea_dump_devname=/dev/pts/4 PVT.flag_rtcm_server=true PVT.flag_rtcm_tty_port=false PVT.rtcm_dump_devname=/dev/pts/1 -;#dump: Enable or disable the PVT internal binary data file logging [true] or [false] PVT.dump=false -;#dump_filename: Log path and filename without extension. Notice that PVT will add ".dat" to the binary dump and ".kml" to GoogleEarth dump. PVT.dump_filename=./PVT \ No newline at end of file diff --git a/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_III_1b.conf b/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_III_1b.conf index 9a184f66d..aa0e26be4 100644 --- a/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_III_1b.conf +++ b/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_III_1b.conf @@ -1,4 +1,6 @@ -; Default configuration file +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; @@ -25,13 +27,9 @@ GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 ;######### SIGNAL_SOURCE CONFIG ############ -;#implementation SignalSource.implementation=Flexiband_Signal_Source -;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version. SignalSource.item_type=gr_complex -;# FPGA firmware file SignalSource.firmware_file=flexiband_III-1b.bit -;#RF_channels: Number of RF channels present in the frontend device, must agree the FPGA firmware file SignalSource.RF_channels=1 ;#frontend channels gain. Not usable yet! SignalSource.gain1=0 @@ -39,11 +37,9 @@ SignalSource.gain2=0 SignalSource.gain3=0 ;#frontend channels AGC SignalSource.AGC=true -;# USB 3.0 packet buffer size (number of SuperSpeed packets) SignalSource.usb_packet_buffer=128 ;######### SIGNAL_CONDITIONER 0 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. SignalConditioner0.implementation=Signal_Conditioner ;######### DATA_TYPE_ADAPTER 0 CONFIG ############ @@ -51,87 +47,33 @@ DataTypeAdapter0.implementation=Pass_Through DataTypeAdapter0.item_type=gr_complex ;######### INPUT_FILTER 0 CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter] -;#[Pass_Through] disables this block -;#[Fir_Filter] enables a FIR Filter -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation that shifts IF down to zero Hz. - InputFilter0.implementation=Freq_Xlating_Fir_Filter - -;#dump: Dump the filtered data to a file. InputFilter0.dump=false - -;#dump_filename: Log path and filename. InputFilter0.dump_filename=../data/input_filter.dat - -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of gnuradio's function: gr_remez. -;#This function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, -;#the desired response on those bands, and the weight given to the error in those bands. - -;#input_item_type: Type and resolution for input signal samples. InputFilter0.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter0.output_item_type=gr_complex - -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. InputFilter0.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time InputFilter0.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. InputFilter0.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - InputFilter0.band1_begin=0.0 InputFilter0.band1_end=0.45 InputFilter0.band2_begin=0.55 InputFilter0.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - InputFilter0.ampl1_begin=1.0 InputFilter0.ampl1_end=1.0 InputFilter0.ampl2_begin=0.0 InputFilter0.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands InputFilter0.band1_error=1.0 InputFilter0.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" InputFilter0.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. InputFilter0.grid_density=16 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. -;#InputFilter0.IF is the intermediate frequency (in Hz) shifted down to zero Hz -;FOR USE GNSS-SDR WITH RTLSDR DONGLES USER MUST SET THE CALIBRATED SAMPLE RATE HERE -; i.e. using front-end-cal as reported here:http://www.cttc.es/publication/turning-a-television-into-a-gnss-receiver/ -InputFilter0.sampling_frequency=20000000 -;# IF deviation due to front-end LO inaccuracies [HZ] InputFilter0.IF=-205000 - -;# Decimation factor after the frequency tranaslating block InputFilter0.decimation_factor=8 ;######### RESAMPLER CONFIG 0 ############ -;## Resamples the input data. Resampler0.implementation=Pass_Through ;######### SIGNAL_CONDITIONER 1 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. SignalConditioner1.implementation=Pass_Through ;######### DATA_TYPE_ADAPTER 1 CONFIG ############ @@ -140,25 +82,15 @@ DataTypeAdapter1.item_type=gr_complex ;######### INPUT_FILTER 1 CONFIG ############ InputFilter1.implementation=Pass_Through - -;#dump: Dump the filtered data to a file. InputFilter1.dump=false - -;#dump_filename: Log path and filename. InputFilter1.dump_filename=../data/input_filter.dat - -;#input_item_type: Type and resolution for input signal samples. InputFilter1.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter1.output_item_type=gr_complex ;######### RESAMPLER CONFIG 1 ############ -;## Resamples the input data. Resampler1.implementation=Pass_Through ;######### SIGNAL_CONDITIONER 2 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. SignalConditioner2.implementation=Pass_Through ;######### DATA_TYPE_ADAPTER 2 CONFIG ############ @@ -167,36 +99,18 @@ DataTypeAdapter2.item_type=gr_complex ;######### INPUT_FILTER 2 CONFIG ############ InputFilter2.implementation=Pass_Through - -;#dump: Dump the filtered data to a file. InputFilter2.dump=false - -;#dump_filename: Log path and filename. InputFilter2.dump_filename=../data/input_filter.dat - -;#input_item_type: Type and resolution for input signal samples. InputFilter2.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter2.output_item_type=gr_complex ;######### RESAMPLER CONFIG 2 ############ -;## Resamples the input data. Resampler2.implementation=Pass_Through ;######### CHANNELS GLOBAL CONFIG ############ -;#count: Number of available GPS satellite channels. Channels_1C.count=8 -;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver Channels.in_acquisition=1 -;#signal: -;# "1C" GPS L1 C/A -;# "1B" GALILEO E1 B (I/NAV OS/CS/SoL) -;# "1G" GLONASS L1 C/A -;# "2S" GPS L2 L2C (M) -;# "5X" GALILEO E5a I+Q -;# "L5" GPS L5 ;# CHANNEL CONNECTION Channel0.RF_channel_ID=0 @@ -222,63 +136,37 @@ Channel7.signal=1C ;######### ACQUISITION GLOBAL CONFIG ############ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition -;#item_type: Type and resolution for each of the signal samples. Acquisition_1C.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1C.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] Acquisition_1C.coherent_integration_time_ms=1 -;#threshold: Acquisition threshold. It will be ignored if pfa is defined. Acquisition_1C.threshold=0.012 -;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition] ;Acquisition_1C.pfa=0.0001 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1C.doppler_max=10000 -;#doppler_max: Doppler step in the grid search [Hz] Acquisition_1C.doppler_step=250 -;#bit_transition_flag: Enable or disable a strategy to deal with bit transitions in GPS signals: process two dwells and take -;#maximum test statistics. Only use with implementation: [GPS_L1_CA_PCPS_Acquisition] -;#(should not be used for Galileo_E1_PCPS_Ambiguous_Acquisition]) Acquisition_1C.bit_transition_flag=false -;#max_dwells: Maximum number of consecutive dwells to be processed. It will be ignored if bit_transition_flag=true Acquisition_1C.max_dwells=1 -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] Acquisition_1C.dump=false -;#filename: Log path and filename Acquisition_1C.dump_filename=./acq_dump.dat ;######### TRACKING GLOBAL CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_1C.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] -Tracking_1C.if=0 -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1C.pll_bw_hz=40.0; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] Tracking_1C.dll_bw_hz=3.0; -;#order: PLL/DLL loop filter order [2] or [3] Tracking_1C.order=3; -;#early_late_space_chips: correlator early-late space [chips]. Use [0.5] Tracking_1C.early_late_space_chips=0.5; -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] Tracking_1C.dump=false -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. Tracking_1C.dump_filename=./tracking_ch_ ;######### TELEMETRY DECODER GPS CONFIG ############ -;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L1 C/A TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder TelemetryDecoder_1C.dump=false ;######### OBSERVABLES CONFIG ############ Observables.implementation=Hybrid_Observables -;#dump: Enable or disable the Observables internal binary data file logging [true] or [false] Observables.dump=false -;#dump_filename: Log path and filename. Observables.dump_filename=./observables.dat @@ -287,21 +175,13 @@ PVT.implementation=RTKLIB_PVT PVT.positioning_mode=PPP_Static ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad -;#output_rate_ms: Period between two PVT outputs. Notice that the minimum period is equal to the tracking integration time (for GPS CA L1 is 1ms) [ms] PVT.output_rate_ms=100 -;#display_rate_ms: Position console print (std::out) interval [ms]. Notice that output_rate_ms<=display_rate_ms. PVT.display_rate_ms=500 -;# KML, GeoJSON, NMEA and RTCM output configuration -;#nmea_dump_filename: NMEA log path and filename PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea; -;#flag_nmea_tty_port: Enable or disable the NMEA log to a serial TTY port (Can be used with real hardware or virtual one) PVT.flag_nmea_tty_port=false; -;#nmea_dump_devname: serial device descriptor for NMEA logging PVT.nmea_dump_devname=/dev/pts/4 PVT.flag_rtcm_server=true PVT.flag_rtcm_tty_port=false PVT.rtcm_dump_devname=/dev/pts/1 -;#dump: Enable or disable the PVT internal binary data file logging [true] or [false] PVT.dump=false -;#dump_filename: Log path and filename without extension. Notice that PVT will add ".dat" to the binary dump and ".kml" to GoogleEarth dump. PVT.dump_filename=./PVT \ No newline at end of file diff --git a/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_II_3b.conf b/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_II_3b.conf index 34c4e3142..7a7627cef 100644 --- a/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_II_3b.conf +++ b/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_II_3b.conf @@ -1,4 +1,6 @@ -; Default configuration file +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; @@ -25,25 +27,18 @@ GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 ;######### SIGNAL_SOURCE CONFIG ############ -;#implementation SignalSource.implementation=Flexiband_Signal_Source -;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version. SignalSource.item_type=gr_complex -;# FPGA firmware file SignalSource.firmware_file=flexiband_II-3b.bit -;#RF_channels: Number of RF channels present in the frontend device, must agree the FPGA firmware file SignalSource.RF_channels=1 ;#frontend channels gain. Not usable yet! SignalSource.gain1=0 SignalSource.gain2=0 SignalSource.gain3=0 -;#frontend channels AGC SignalSource.AGC=true -;# USB 3.0 packet buffer size (number of SuperSpeed packets) SignalSource.usb_packet_buffer=128 ;######### SIGNAL_CONDITIONER 0 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. SignalConditioner0.implementation=Signal_Conditioner ;######### DATA_TYPE_ADAPTER 0 CONFIG ############ @@ -51,85 +46,34 @@ DataTypeAdapter0.implementation=Pass_Through DataTypeAdapter0.item_type=gr_complex ;######### INPUT_FILTER 0 CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter] -;#[Pass_Through] disables this block -;#[Fir_Filter] enables a FIR Filter -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation that shifts IF down to zero Hz. - InputFilter0.implementation=Freq_Xlating_Fir_Filter - -;#dump: Dump the filtered data to a file. InputFilter0.dump=false - -;#dump_filename: Log path and filename. InputFilter0.dump_filename=../data/input_filter.dat - -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of gnuradio's function: gr_remez. -;#This function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, -;#the desired response on those bands, and the weight given to the error in those bands. - -;#input_item_type: Type and resolution for input signal samples. InputFilter0.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter0.output_item_type=gr_complex - -;#taps_item_type: Type and resolution for the taps of the filter. InputFilter0.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time InputFilter0.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. InputFilter0.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - InputFilter0.band1_begin=0.0 InputFilter0.band1_end=0.45 InputFilter0.band2_begin=0.55 InputFilter0.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - InputFilter0.ampl1_begin=1.0 InputFilter0.ampl1_end=1.0 InputFilter0.ampl2_begin=0.0 InputFilter0.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands InputFilter0.band1_error=1.0 InputFilter0.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" InputFilter0.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. InputFilter0.grid_density=16 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. -;#InputFilter0.IF is the intermediate frequency (in Hz) shifted down to zero Hz InputFilter0.sampling_frequency=40000000 -;# IF deviation due to front-end LO inaccuracies [HZ] InputFilter0.IF=-205000 - -;# Decimation factor after the frequency tranaslating block InputFilter0.decimation_factor=16 ;######### RESAMPLER CONFIG 0 ############ -;## Resamples the input data. Resampler0.implementation=Pass_Through ;######### SIGNAL_CONDITIONER 1 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. SignalConditioner1.implementation=Pass_Through ;######### DATA_TYPE_ADAPTER 1 CONFIG ############ @@ -138,25 +82,15 @@ DataTypeAdapter1.item_type=gr_complex ;######### INPUT_FILTER 1 CONFIG ############ InputFilter1.implementation=Pass_Through - -;#dump: Dump the filtered data to a file. InputFilter1.dump=false - -;#dump_filename: Log path and filename. InputFilter1.dump_filename=../data/input_filter.dat - -;#input_item_type: Type and resolution for input signal samples. InputFilter1.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter1.output_item_type=gr_complex ;######### RESAMPLER CONFIG 1 ############ -;## Resamples the input data. Resampler1.implementation=Pass_Through ;######### SIGNAL_CONDITIONER 2 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. SignalConditioner2.implementation=Pass_Through ;######### DATA_TYPE_ADAPTER 2 CONFIG ############ @@ -165,28 +99,17 @@ DataTypeAdapter2.item_type=gr_complex ;######### INPUT_FILTER 2 CONFIG ############ InputFilter2.implementation=Pass_Through - -;#dump: Dump the filtered data to a file. InputFilter2.dump=false - -;#dump_filename: Log path and filename. InputFilter2.dump_filename=../data/input_filter.dat - -;#input_item_type: Type and resolution for input signal samples. InputFilter2.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter2.output_item_type=gr_complex ;######### RESAMPLER CONFIG 2 ############ -;## Resamples the input data. Resampler2.implementation=Pass_Through ;######### CHANNELS GLOBAL CONFIG ############ -;#count: Number of available GPS satellite channels. Channels_1C.count=8 -;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver Channels.in_acquisition=1 ;#signal: @@ -208,7 +131,6 @@ Channel6.RF_channel_ID=0 Channel7.RF_channel_ID=0 ;#signal: -;#if the option is disabled by default is assigned "1C" GPS L1 C/A Channel0.signal=1C Channel1.signal=1C Channel2.signal=1C @@ -219,91 +141,54 @@ Channel6.signal=1C Channel7.signal=1C - ;######### ACQUISITION GLOBAL CONFIG ############ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition -;#item_type: Type and resolution for each of the signal samples. Acquisition_1C.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1C.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] Acquisition_1C.coherent_integration_time_ms=1 -;#threshold: Acquisition threshold. It will be ignored if pfa is defined. Acquisition_1C.threshold=0.012 -;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition] ;Acquisition_1C.pfa=0.0001 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1C.doppler_max=10000 -;#doppler_max: Doppler step in the grid search [Hz] Acquisition_1C.doppler_step=250 -;#bit_transition_flag: Enable or disable a strategy to deal with bit transitions in GPS signals: process two dwells and take -;#maximum test statistics. Only use with implementation: [GPS_L1_CA_PCPS_Acquisition] -;#(should not be used for Galileo_E1_PCPS_Ambiguous_Acquisition]) Acquisition_1C.bit_transition_flag=false -;#max_dwells: Maximum number of consecutive dwells to be processed. It will be ignored if bit_transition_flag=true Acquisition_1C.max_dwells=1 -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] Acquisition_1C.dump=false -;#filename: Log path and filename Acquisition_1C.dump_filename=./acq_dump.dat ;######### TRACKING GLOBAL CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_1C.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] -Tracking_1C.if=0 -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1C.pll_bw_hz=40.0; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] Tracking_1C.dll_bw_hz=3.0; -;#order: PLL/DLL loop filter order [2] or [3] Tracking_1C.order=3; -;#early_late_space_chips: correlator early-late space [chips]. Use [0.5] Tracking_1C.early_late_space_chips=0.5; -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] Tracking_1C.dump=false -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. Tracking_1C.dump_filename=./tracking_ch_ ;######### TELEMETRY DECODER GPS CONFIG ############ -;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L1 C/A TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder TelemetryDecoder_1C.dump=false ;######### OBSERVABLES CONFIG ############ -;#implementation: Observables.implementation=Hybrid_Observables -;#dump: Enable or disable the Observables internal binary data file logging [true] or [false] Observables.dump=false -;#dump_filename: Log path and filename. Observables.dump_filename=./observables.dat ;######### PVT CONFIG ############ -;#implementation: Position Velocity and Time (PVT) implementation: PVT.implementation=RTKLIB_PVT PVT.positioning_mode=PPP_Static ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad -;#output_rate_ms: Period between two PVT outputs. Notice that the minimum period is equal to the tracking integration time (for GPS CA L1 is 1ms) [ms] PVT.output_rate_ms=100 -;#display_rate_ms: Position console print (std::out) interval [ms]. Notice that output_rate_ms<=display_rate_ms. PVT.display_rate_ms=500 -;# KML, GeoJSON, NMEA and RTCM output configuration -;#nmea_dump_filename: NMEA log path and filename PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea; -;#flag_nmea_tty_port: Enable or disable the NMEA log to a serial TTY port (Can be used with real hardware or virtual one) PVT.flag_nmea_tty_port=false; -;#nmea_dump_devname: serial device descriptor for NMEA logging PVT.nmea_dump_devname=/dev/pts/4 PVT.flag_rtcm_server=true PVT.flag_rtcm_tty_port=false PVT.rtcm_dump_devname=/dev/pts/1 -;#dump: Enable or disable the PVT internal binary data file logging [true] or [false] PVT.dump=false -;#dump_filename: Log path and filename without extension. Notice that PVT will add ".dat" to the binary dump and ".kml" to GoogleEarth dump. PVT.dump_filename=./PVT \ No newline at end of file diff --git a/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_I_1b.conf b/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_I_1b.conf index 2bba3f755..3dd9d76cd 100644 --- a/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_I_1b.conf +++ b/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_I_1b.conf @@ -1,4 +1,6 @@ -; Default configuration file +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; @@ -25,25 +27,18 @@ GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 ;######### SIGNAL_SOURCE CONFIG ############ -;#implementation SignalSource.implementation=Flexiband_Signal_Source -;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version. SignalSource.item_type=gr_complex -;# FPGA firmware file SignalSource.firmware_file=flexiband_I-1b.bit -;#RF_channels: Number of RF channels present in the frontend device, must agree the FPGA firmware file SignalSource.RF_channels=1 ;#frontend channels gain. Not usable yet! SignalSource.gain1=0 SignalSource.gain2=0 SignalSource.gain3=0 -;#frontend channels AGC SignalSource.AGC=true -;# USB 3.0 packet buffer size (number of SuperSpeed packets) SignalSource.usb_packet_buffer=128 ;######### SIGNAL_CONDITIONER 0 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. SignalConditioner0.implementation=Signal_Conditioner ;######### DATA_TYPE_ADAPTER 0 CONFIG ############ @@ -51,87 +46,34 @@ DataTypeAdapter0.implementation=Pass_Through DataTypeAdapter0.item_type=gr_complex ;######### INPUT_FILTER 0 CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter] -;#[Pass_Through] disables this block -;#[Fir_Filter] enables a FIR Filter -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation that shifts IF down to zero Hz. - InputFilter0.implementation=Freq_Xlating_Fir_Filter - -;#dump: Dump the filtered data to a file. InputFilter0.dump=false - -;#dump_filename: Log path and filename. InputFilter0.dump_filename=../data/input_filter.dat - -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of gnuradio's function: gr_remez. -;#This function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, -;#the desired response on those bands, and the weight given to the error in those bands. - -;#input_item_type: Type and resolution for input signal samples. InputFilter0.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter0.output_item_type=gr_complex - -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. InputFilter0.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time InputFilter0.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. InputFilter0.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - InputFilter0.band1_begin=0.0 InputFilter0.band1_end=0.45 InputFilter0.band2_begin=0.55 InputFilter0.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - InputFilter0.ampl1_begin=1.0 InputFilter0.ampl1_end=1.0 InputFilter0.ampl2_begin=0.0 InputFilter0.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands InputFilter0.band1_error=1.0 InputFilter0.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" InputFilter0.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. InputFilter0.grid_density=16 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. -;#InputFilter0.IF is the intermediate frequency (in Hz) shifted down to zero Hz -;FOR USE GNSS-SDR WITH RTLSDR DONGLES USER MUST SET THE CALIBRATED SAMPLE RATE HERE -; i.e. using front-end-cal as reported here:http://www.cttc.es/publication/turning-a-television-into-a-gnss-receiver/ InputFilter0.sampling_frequency=40000000 -;# IF deviation due to front-end LO inaccuracies [HZ] InputFilter0.IF=-205000 - -;# Decimation factor after the frequency tranaslating block InputFilter0.decimation_factor=8 ;######### RESAMPLER CONFIG 0 ############ -;## Resamples the input data. Resampler0.implementation=Pass_Through ;######### SIGNAL_CONDITIONER 1 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. SignalConditioner1.implementation=Pass_Through ;######### DATA_TYPE_ADAPTER 1 CONFIG ############ @@ -140,25 +82,15 @@ DataTypeAdapter1.item_type=gr_complex ;######### INPUT_FILTER 1 CONFIG ############ InputFilter1.implementation=Pass_Through - -;#dump: Dump the filtered data to a file. InputFilter1.dump=false - -;#dump_filename: Log path and filename. InputFilter1.dump_filename=../data/input_filter.dat - -;#input_item_type: Type and resolution for input signal samples. InputFilter1.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter1.output_item_type=gr_complex ;######### RESAMPLER CONFIG 1 ############ -;## Resamples the input data. Resampler1.implementation=Pass_Through ;######### SIGNAL_CONDITIONER 2 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. SignalConditioner2.implementation=Pass_Through ;######### DATA_TYPE_ADAPTER 2 CONFIG ############ @@ -167,38 +99,19 @@ DataTypeAdapter2.item_type=gr_complex ;######### INPUT_FILTER 2 CONFIG ############ InputFilter2.implementation=Pass_Through - -;#dump: Dump the filtered data to a file. InputFilter2.dump=false - -;#dump_filename: Log path and filename. InputFilter2.dump_filename=../data/input_filter.dat - -;#input_item_type: Type and resolution for input signal samples. InputFilter2.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter2.output_item_type=gr_complex ;######### RESAMPLER CONFIG 2 ############ -;## Resamples the input data. Resampler2.implementation=Pass_Through ;######### CHANNELS GLOBAL CONFIG ############ -;#count: Number of available GPS satellite channels. Channels_1C.count=4 -;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver Channels.in_acquisition=1 -;#signal: -;# "1C" GPS L1 C/A -;# "1B" GALILEO E1 B (I/NAV OS/CS/SoL) -;# "1G" GLONASS L1 C/A -;# "2S" GPS L2 L2C (M) -;# "5X" GALILEO E5a I+Q -;# "L5" GPS L5 - ;# CHANNEL CONNECTION Channel0.RF_channel_ID=0 Channel1.RF_channel_ID=0 @@ -210,7 +123,6 @@ Channel3.RF_channel_ID=0 ;Channel7.RF_channel_ID=0 ;#signal: -;#if the option is disabled by default is assigned "1C" GPS L1 C/A Channel0.signal=1C Channel1.signal=1C Channel2.signal=1C @@ -219,63 +131,37 @@ Channel3.signal=1C ;######### ACQUISITION GLOBAL CONFIG ############ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition -;#item_type: Type and resolution for each of the signal samples. Acquisition_1C.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1C.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] Acquisition_1C.coherent_integration_time_ms=1 -;#threshold: Acquisition threshold. It will be ignored if pfa is defined. Acquisition_1C.threshold=0.011 -;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition] ;Acquisition_1C.pfa=0.0001 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1C.doppler_max=10000 -;#doppler_max: Doppler step in the grid search [Hz] Acquisition_1C.doppler_step=250 -;#bit_transition_flag: Enable or disable a strategy to deal with bit transitions in GPS signals: process two dwells and take -;#maximum test statistics. Only use with implementation: [GPS_L1_CA_PCPS_Acquisition] -;#(should not be used for Galileo_E1_PCPS_Ambiguous_Acquisition]) Acquisition_1C.bit_transition_flag=false -;#max_dwells: Maximum number of consecutive dwells to be processed. It will be ignored if bit_transition_flag=true Acquisition_1C.max_dwells=1 -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] Acquisition_1C.dump=false -;#filename: Log path and filename Acquisition_1C.dump_filename=./acq_dump.dat ;######### TRACKING GLOBAL CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_1C.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] -Tracking_1C.if=0 -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1C.pll_bw_hz=40.0; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] Tracking_1C.dll_bw_hz=3.0; -;#order: PLL/DLL loop filter order [2] or [3] Tracking_1C.order=3; -;#early_late_space_chips: correlator early-late space [chips]. Use [0.5] Tracking_1C.early_late_space_chips=0.5; -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] Tracking_1C.dump=false -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. Tracking_1C.dump_filename=./tracking_ch_ ;######### TELEMETRY DECODER GPS CONFIG ############ -;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L1 C/A TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder TelemetryDecoder_1C.dump=false ;######### OBSERVABLES CONFIG ############ Observables.implementation=Hybrid_Observables -;#dump: Enable or disable the Observables internal binary data file logging [true] or [false] Observables.dump=false -;#dump_filename: Log path and filename. Observables.dump_filename=./observables.dat @@ -284,20 +170,13 @@ PVT.implementation=RTKLIB_PVT PVT.positioning_mode=PPP_Static ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad -;#output_rate_ms: Period between two PVT outputs. Notice that the minimum period is equal to the tracking integration time (for GPS CA L1 is 1ms) [ms] PVT.output_rate_ms=100 -;#display_rate_ms: Position console print (std::out) interval [ms]. Notice that output_rate_ms<=display_rate_ms. PVT.display_rate_ms=500 -;# KML, GeoJSON, NMEA and RTCM output configuration -;#nmea_dump_filename: NMEA log path and filename PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea; -;#flag_nmea_tty_port: Enable or disable the NMEA log to a serial TTY port (Can be used with real hardware or virtual one) PVT.flag_nmea_tty_port=false; -;#nmea_dump_devname: serial device descriptor for NMEA logging PVT.nmea_dump_devname=/dev/pts/4 PVT.flag_rtcm_server=true PVT.flag_rtcm_tty_port=false PVT.rtcm_dump_devname=/dev/pts/1 -;#dump: Enable or disable the PVT internal binary data file logging [true] or [false] PVT.dump=false PVT.dump_filename=./PVT diff --git a/conf/gnss-sdr_multichannel_GPS_L1_L2_Flexiband_realtime_III_1b.conf b/conf/gnss-sdr_multichannel_GPS_L1_L2_Flexiband_realtime_III_1b.conf index 48c73a036..1513e6c8b 100644 --- a/conf/gnss-sdr_multichannel_GPS_L1_L2_Flexiband_realtime_III_1b.conf +++ b/conf/gnss-sdr_multichannel_GPS_L1_L2_Flexiband_realtime_III_1b.conf @@ -1,4 +1,6 @@ -; Default configuration file +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; @@ -25,21 +27,15 @@ GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 ;######### SIGNAL_SOURCE CONFIG ############ -;#implementation SignalSource.implementation=Flexiband_Signal_Source -;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version. SignalSource.item_type=gr_complex -;# FPGA firmware file SignalSource.firmware_file=flexiband_III-1b.bit -;#RF_channels: Number of RF channels present in the frontend device, must agree the FPGA firmware file SignalSource.RF_channels=2 ;#frontend channels gain. Not usable yet! SignalSource.gain1=0 SignalSource.gain2=0 SignalSource.gain3=0 -;#frontend channels AGC SignalSource.AGC=true -;# USB 3.0 packet buffer size (number of SuperSpeed packets) SignalSource.usb_packet_buffer=128 ;###################################################### @@ -47,7 +43,6 @@ SignalSource.usb_packet_buffer=128 ;###################################################### ;######### SIGNAL_CONDITIONER 0 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. SignalConditioner0.implementation=Signal_Conditioner ;######### DATA_TYPE_ADAPTER 0 CONFIG ############ @@ -55,85 +50,31 @@ DataTypeAdapter0.implementation=Pass_Through DataTypeAdapter0.item_type=gr_complex ;######### INPUT_FILTER 0 CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter] -;#[Pass_Through] disables this block -;#[Fir_Filter] enables a FIR Filter -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation that shifts IF down to zero Hz. - InputFilter0.implementation=Freq_Xlating_Fir_Filter - -;#dump: Dump the filtered data to a file. InputFilter0.dump=false - -;#dump_filename: Log path and filename. InputFilter0.dump_filename=../data/input_filter.dat - -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of gnuradio's function: gr_remez. -;#This function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, -;#the desired response on those bands, and the weight given to the error in those bands. - -;#input_item_type: Type and resolution for input signal samples. InputFilter0.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter0.output_item_type=gr_complex - -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. InputFilter0.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time InputFilter0.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. InputFilter0.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - InputFilter0.band1_begin=0.0 InputFilter0.band1_end=0.45 InputFilter0.band2_begin=0.55 InputFilter0.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - InputFilter0.ampl1_begin=1.0 InputFilter0.ampl1_end=1.0 InputFilter0.ampl2_begin=0.0 InputFilter0.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands InputFilter0.band1_error=1.0 InputFilter0.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" InputFilter0.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. InputFilter0.grid_density=16 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. -;#InputFilter0.IF is the intermediate frequency (in Hz) shifted down to zero Hz -;FOR USE GNSS-SDR WITH RTLSDR DONGLES USER MUST SET THE CALIBRATED SAMPLE RATE HERE -; i.e. using front-end-cal as reported here:http://www.cttc.es/publication/turning-a-television-into-a-gnss-receiver/ InputFilter0.sampling_frequency=20000000 -;# IF deviation due to front-end LO inaccuracies [HZ] -;# WARNING: Fraunhofer front-end hardwareconfigurations can difer. Signals available on http://www.iis.fraunhofer.de/de/ff/lok/leist/test/flexiband.html are centered on 0 Hz, ALL BANDS. InputFilter0.IF=-205000 -;#InputFilter0.IF=0 - -;# Decimation factor after the frequency tranaslating block InputFilter0.decimation_factor=8 ;######### RESAMPLER CONFIG 0 ############ -;## Resamples the input data. Resampler0.implementation=Pass_Through ;###################################################### @@ -141,7 +82,6 @@ Resampler0.implementation=Pass_Through ;###################################################### ;######### SIGNAL_CONDITIONER 1 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. SignalConditioner1.implementation=Signal_Conditioner ;######### DATA_TYPE_ADAPTER 1 CONFIG ############ @@ -149,90 +89,35 @@ DataTypeAdapter1.implementation=Pass_Through DataTypeAdapter1.item_type=gr_complex ;######### INPUT_FILTER 0 CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter] -;#[Pass_Through] disables this block -;#[Fir_Filter] enables a FIR Filter -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation that shifts IF down to zero Hz. - InputFilter1.implementation=Freq_Xlating_Fir_Filter - -;#dump: Dump the filtered data to a file. InputFilter1.dump=false - -;#dump_filename: Log path and filename. InputFilter1.dump_filename=../data/input_filter_ch1.dat - -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of gnuradio's function: gr_remez. -;#This function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, -;#the desired response on those bands, and the weight given to the error in those bands. - -;#input_item_type: Type and resolution for input signal samples. InputFilter1.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter1.output_item_type=gr_complex - -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. InputFilter1.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time InputFilter1.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. InputFilter1.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - InputFilter1.band1_begin=0.0 InputFilter1.band1_end=0.45 InputFilter1.band2_begin=0.55 InputFilter1.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - InputFilter1.ampl1_begin=1.0 InputFilter1.ampl1_end=1.0 InputFilter1.ampl2_begin=0.0 InputFilter1.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands InputFilter1.band1_error=1.0 InputFilter1.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" InputFilter1.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. InputFilter1.grid_density=16 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. -;#InputFilter0.IF is the intermediate frequency (in Hz) shifted down to zero Hz -;FOR USE GNSS-SDR WITH RTLSDR DONGLES USER MUST SET THE CALIBRATED SAMPLE RATE HERE -; i.e. using front-end-cal as reported here:http://www.cttc.es/publication/turning-a-television-into-a-gnss-receiver/ InputFilter1.sampling_frequency=20000000 -;# IF deviation due to front-end LO inaccuracies [HZ] -;# WARNING: Fraunhofer front-end hardwareconfigurations can difer. Signals available on http://www.iis.fraunhofer.de/de/ff/lok/leist/test/flexiband.html are centered on 0 Hz, ALL BANDS. InputFilter1.IF=100000 -;#InputFilter1.IF=0 - -;# Decimation factor after the frequency tranaslating block InputFilter1.decimation_factor=8 ;######### RESAMPLER CONFIG 1 ############ -;## Resamples the input data. Resampler1.implementation=Pass_Through ;######### SIGNAL_CONDITIONER 2 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. SignalConditioner2.implementation=Pass_Through ;######### DATA_TYPE_ADAPTER 2 CONFIG ############ @@ -241,30 +126,17 @@ DataTypeAdapter2.item_type=gr_complex ;######### INPUT_FILTER 2 CONFIG ############ InputFilter2.implementation=Pass_Through - -;#dump: Dump the filtered data to a file. InputFilter2.dump=false - -;#dump_filename: Log path and filename. InputFilter2.dump_filename=../data/input_filter.dat - -;#input_item_type: Type and resolution for input signal samples. InputFilter2.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter2.output_item_type=gr_complex ;######### RESAMPLER CONFIG 2 ############ -;## Resamples the input data. Resampler2.implementation=Pass_Through ;######### CHANNELS GLOBAL CONFIG ############ -;#count: Number of available GPS satellite channels. Channels_1C.count=8 Channels_2S.count=8 -;#count: Number of available Galileo satellite channels. -;Channels_Galileo.count=0 -;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver Channels.in_acquisition=1 ;#signal: @@ -351,40 +223,23 @@ Channel15.RF_channel_ID=1 Channel15.signal=2S -;######### SPECIFIC CHANNELS CONFIG ###### -;#The following options are specific to each channel and overwrite the generic options ;######### ACQUISITION GLOBAL CONFIG ############ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition -;#item_type: Type and resolution for each of the signal samples. Acquisition_1C.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1C.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] Acquisition_1C.coherent_integration_time_ms=1 -;#threshold: Acquisition threshold. It will be ignored if pfa is defined. Acquisition_1C.threshold=0.008 -;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition] ;Acquisition_1C.pfa=0.0001 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1C.doppler_max=5000 -;#doppler_max: Doppler step in the grid search [Hz] Acquisition_1C.doppler_step=250 -;#bit_transition_flag: Enable or disable a strategy to deal with bit transitions in GPS signals: process two dwells and take -;#maximum test statistics. Only use with implementation: [GPS_L1_CA_PCPS_Acquisition] -;#(should not be used for Galileo_E1_PCPS_Ambiguous_Acquisition]) Acquisition_1C.bit_transition_flag=false -;#max_dwells: Maximum number of consecutive dwells to be processed. It will be ignored if bit_transition_flag=true Acquisition_1C.max_dwells=1 -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] Acquisition_1C.dump=false -;#filename: Log path and filename Acquisition_1C.dump_filename=./acq_dump.dat ;######### TRACKING GLOBAL CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking Tracking_1C.item_type=gr_complex -Tracking_1C.if=0 Tracking_1C.pll_bw_hz=40.0; Tracking_1C.dll_bw_hz=3.0; Tracking_1C.order=3; @@ -396,7 +251,6 @@ Tracking_1C.dump_filename=./tracking_ch_ ;# GPS L2C M Acquisition_2S.implementation=GPS_L2_M_PCPS_Acquisition Acquisition_2S.item_type=gr_complex -Acquisition_2S.if=0 Acquisition_2S.threshold=0.0005 ;Acquisition_2S.pfa=0.001 Acquisition_2S.doppler_max=5000 @@ -408,7 +262,6 @@ Acquisition_2S.dump_filename=./acq_dump.dat Tracking_2S.implementation=GPS_L2_M_DLL_PLL_Tracking Tracking_2S.item_type=gr_complex -Tracking_2S.if=0 Tracking_2S.pll_bw_hz=1.5; Tracking_2S.dll_bw_hz=0.3; Tracking_2S.order=3; @@ -418,22 +271,18 @@ Tracking_2S.dump_filename=./tracking_ch_ ;######### TELEMETRY DECODER GPS L1 CONFIG ############ -;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L1 C/A TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder TelemetryDecoder_1C.dump=false ;######### TELEMETRY DECODER GPS L2 CONFIG ############ -;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L2 M TelemetryDecoder_2S.implementation=GPS_L2C_Telemetry_Decoder TelemetryDecoder_2S.dump=false ;######### OBSERVABLES CONFIG ############ Observables.implementation=Hybrid_Observables -;#dump: Enable or disable the Observables internal binary data file logging [true] or [false] Observables.dump=false -;#dump_filename: Log path and filename. Observables.dump_filename=./observables.dat @@ -442,25 +291,14 @@ PVT.implementation=RTKLIB_PVT PVT.positioning_mode=PPP_Static ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad -;#averaging_depth: Number of PVT observations in the moving average algorithm -PVT.averaging_depth=10 -;#flag_average: Enables the PVT averaging between output intervals (arithmetic mean) [true] or [false] PVT.flag_averaging=true -;#output_rate_ms: Period between two PVT outputs. Notice that the minimum period is equal to the tracking integration time (for GPS CA L1 is 1ms) [ms] PVT.output_rate_ms=100 -;#display_rate_ms: Position console print (std::out) interval [ms]. Notice that output_rate_ms<=display_rate_ms. PVT.display_rate_ms=500 -;# KML, GeoJSON, NMEA and RTCM output configuration -;#nmea_dump_filename: NMEA log path and filename PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea; -;#flag_nmea_tty_port: Enable or disable the NMEA log to a serial TTY port (Can be used with real hardware or virtual one) PVT.flag_nmea_tty_port=false; -;#nmea_dump_devname: serial device descriptor for NMEA logging PVT.nmea_dump_devname=/dev/pts/4 PVT.flag_rtcm_server=false PVT.flag_rtcm_tty_port=false PVT.rtcm_dump_devname=/dev/pts/1 -;#dump: Enable or disable the PVT internal binary data file logging [true] or [false] PVT.dump=false -;#dump_filename: Log path and filename without extension. Notice that PVT will add ".dat" to the binary dump and ".kml" to GoogleEarth dump. PVT.dump_filename=./PVT diff --git a/conf/gnss-sdr_multichannel_GPS_L1_L2_Galileo_E1B_Flexiband_bin_file_III_1b.conf b/conf/gnss-sdr_multichannel_GPS_L1_L2_Galileo_E1B_Flexiband_bin_file_III_1b.conf index 44be57a15..349b2f2b3 100644 --- a/conf/gnss-sdr_multichannel_GPS_L1_L2_Galileo_E1B_Flexiband_bin_file_III_1b.conf +++ b/conf/gnss-sdr_multichannel_GPS_L1_L2_Galileo_E1B_Flexiband_bin_file_III_1b.conf @@ -1,4 +1,6 @@ -; Default configuration file +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; @@ -25,30 +27,17 @@ GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 ;######### SIGNAL_SOURCE CONFIG ############ -;#implementation SignalSource.implementation=Flexiband_Signal_Source - SignalSource.flag_read_file=true SignalSource.signal_file=/datalogger/signals/Fraunhofer/L125_III1b_210s.usb ; <- PUT YOUR FILE HERE - -;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version. SignalSource.item_type=gr_complex - -;# FPGA firmware file SignalSource.firmware_file=flexiband_III-1b.bit - -;#RF_channels: Number of RF channels present in the frontend device, must agree the FPGA firmware file SignalSource.RF_channels=2 - ;#frontend channels gain. Not usable yet! SignalSource.gain1=0 SignalSource.gain2=0 SignalSource.gain3=0 - -;#frontend channels AGC SignalSource.AGC=true - -;# USB 3.0 packet buffer size (number of SuperSpeed packets) SignalSource.usb_packet_buffer=128 ;###################################################### @@ -56,7 +45,6 @@ SignalSource.usb_packet_buffer=128 ;###################################################### ;######### SIGNAL_CONDITIONER 0 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. SignalConditioner0.implementation=Signal_Conditioner ;######### DATA_TYPE_ADAPTER 0 CONFIG ############ @@ -64,85 +52,31 @@ DataTypeAdapter0.implementation=Pass_Through DataTypeAdapter0.item_type=gr_complex ;######### INPUT_FILTER 0 CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter] -;#[Pass_Through] disables this block -;#[Fir_Filter] enables a FIR Filter -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation that shifts IF down to zero Hz. - InputFilter0.implementation=Freq_Xlating_Fir_Filter - -;#dump: Dump the filtered data to a file. InputFilter0.dump=false - -;#dump_filename: Log path and filename. InputFilter0.dump_filename=../data/input_filter.dat - -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of gnuradio's function: gr_remez. -;#This function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, -;#the desired response on those bands, and the weight given to the error in those bands. - -;#input_item_type: Type and resolution for input signal samples. InputFilter0.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter0.output_item_type=gr_complex - -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. InputFilter0.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time InputFilter0.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. InputFilter0.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - InputFilter0.band1_begin=0.0 InputFilter0.band1_end=0.45 InputFilter0.band2_begin=0.55 InputFilter0.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - InputFilter0.ampl1_begin=1.0 InputFilter0.ampl1_end=1.0 InputFilter0.ampl2_begin=0.0 InputFilter0.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands InputFilter0.band1_error=1.0 InputFilter0.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" InputFilter0.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. InputFilter0.grid_density=16 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. -;#InputFilter0.IF is the intermediate frequency (in Hz) shifted down to zero Hz -;FOR USE GNSS-SDR WITH RTLSDR DONGLES USER MUST SET THE CALIBRATED SAMPLE RATE HERE -; i.e. using front-end-cal as reported here:http://www.cttc.es/publication/turning-a-television-into-a-gnss-receiver/ InputFilter0.sampling_frequency=20000000 -;# IF deviation due to front-end LO inaccuracies [HZ] -;# WARNING: Fraunhofer front-end hardwareconfigurations can difer. Signals available on http://www.iis.fraunhofer.de/de/ff/lok/leist/test/flexiband.html are centered on 0 Hz, ALL BANDS. -;#InputFilter0.IF=-205000 InputFilter0.IF=0 - -;# Decimation factor after the frequency tranaslating block InputFilter0.decimation_factor=8 ;######### RESAMPLER CONFIG 0 ############ -;## Resamples the input data. Resampler0.implementation=Pass_Through ;###################################################### @@ -150,7 +84,6 @@ Resampler0.implementation=Pass_Through ;###################################################### ;######### SIGNAL_CONDITIONER 1 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. SignalConditioner1.implementation=Signal_Conditioner ;######### DATA_TYPE_ADAPTER 1 CONFIG ############ @@ -158,90 +91,35 @@ DataTypeAdapter1.implementation=Pass_Through DataTypeAdapter1.item_type=gr_complex ;######### INPUT_FILTER 0 CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter] -;#[Pass_Through] disables this block -;#[Fir_Filter] enables a FIR Filter -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation that shifts IF down to zero Hz. - InputFilter1.implementation=Freq_Xlating_Fir_Filter - -;#dump: Dump the filtered data to a file. InputFilter1.dump=false - -;#dump_filename: Log path and filename. InputFilter1.dump_filename=../data/input_filter_ch1.dat - -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of gnuradio's function: gr_remez. -;#This function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, -;#the desired response on those bands, and the weight given to the error in those bands. - -;#input_item_type: Type and resolution for input signal samples. InputFilter1.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter1.output_item_type=gr_complex - -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. InputFilter1.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time InputFilter1.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. InputFilter1.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - InputFilter1.band1_begin=0.0 InputFilter1.band1_end=0.45 InputFilter1.band2_begin=0.55 InputFilter1.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - InputFilter1.ampl1_begin=1.0 InputFilter1.ampl1_end=1.0 InputFilter1.ampl2_begin=0.0 InputFilter1.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands InputFilter1.band1_error=1.0 InputFilter1.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" InputFilter1.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. InputFilter1.grid_density=16 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. -;#InputFilter0.IF is the intermediate frequency (in Hz) shifted down to zero Hz -;FOR USE GNSS-SDR WITH RTLSDR DONGLES USER MUST SET THE CALIBRATED SAMPLE RATE HERE -; i.e. using front-end-cal as reported here:http://www.cttc.es/publication/turning-a-television-into-a-gnss-receiver/ InputFilter1.sampling_frequency=20000000 -;# IF deviation due to front-end LO inaccuracies [HZ] -;# WARNING: Fraunhofer front-end hardware configurations can differ. Signals available at http://www.iis.fraunhofer.de/de/ff/lok/leist/test/flexiband.html are centered on 0 Hz, ALL BANDS. -;#InputFilter1.IF=100000 InputFilter1.IF=0 - -;# Decimation factor after the frequency translating block InputFilter1.decimation_factor=8 ;######### RESAMPLER CONFIG 1 ############ -;## Resamples the input data. Resampler1.implementation=Pass_Through ;######### SIGNAL_CONDITIONER 2 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. SignalConditioner2.implementation=Pass_Through ;######### DATA_TYPE_ADAPTER 2 CONFIG ############ @@ -250,30 +128,19 @@ DataTypeAdapter2.item_type=gr_complex ;######### INPUT_FILTER 2 CONFIG ############ InputFilter2.implementation=Pass_Through - -;#dump: Dump the filtered data to a file. InputFilter2.dump=false - -;#dump_filename: Log path and filename. InputFilter2.dump_filename=../data/input_filter.dat - -;#input_item_type: Type and resolution for input signal samples. InputFilter2.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter2.output_item_type=gr_complex ;######### RESAMPLER CONFIG 2 ############ -;## Resamples the input data. Resampler2.implementation=Pass_Through -;######### CHANNELS GLOBAL CONFIG ############ -;#count: Number of available GPS satellite channels. +;######### CHANNELS GLOBAL CONFIG ############. Channels_1C.count=2 Channels_1B.count=4 Channels_2S.count=4 -;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver Channels.in_acquisition=1 ;#signal: @@ -304,33 +171,17 @@ Channel14.RF_channel_ID=1 Channel15.RF_channel_ID=1 -;######### SPECIFIC CHANNELS CONFIG ###### -;#The following options are specific to each channel and overwrite the generic options ;######### ACQUISITION GLOBAL CONFIG ############ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition -;#item_type: Type and resolution for each of the signal samples.. Acquisition_1C.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1C.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] Acquisition_1C.coherent_integration_time_ms=1 -;#threshold: Acquisition threshold. It will be ignored if pfa is defined. Acquisition_1C.threshold=0.008 -;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition] ;Acquisition_1C.pfa=0.0001 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1C.doppler_max=5000 -;#doppler_max: Doppler step in the grid search [Hz] Acquisition_1C.doppler_step=250 -;#bit_transition_flag: Enable or disable a strategy to deal with bit transitions in GPS signals: process two dwells and take -;#maximum test statistics. Only use with implementation: [GPS_L1_CA_PCPS_Acquisition] -;#(should not be used for Galileo_E1_PCPS_Ambiguous_Acquisition]) Acquisition_1C.bit_transition_flag=false -;#max_dwells: Maximum number of consecutive dwells to be processed. It will be ignored if bit_transition_flag=true Acquisition_1C.max_dwells=1 -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] Acquisition_1C.dump=false -;#filename: Log path and filename Acquisition_1C.dump_filename=./acq_dump.dat @@ -371,70 +222,44 @@ Tracking_2S.dump_filename=../data/epl_tracking_ch_ ;# GALILEO E1B Acquisition_1B.implementation=Galileo_E1_PCPS_Ambiguous_Acquisition -;#item_type: Type and resolution for each of the signal samples. Acquisition_1B.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1B.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] -Acquisition_1B.sampled_ms=4 -;#threshold: Acquisition threshold +Acquisition_1B.coherent_integration_time_ms=4 ;Acquisition_1B.threshold=0 -;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition] Acquisition_1B.pfa=0.0000005 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1B.doppler_max=5000 -;#doppler_max: Doppler step in the grid search [Hz] Acquisition_1B.doppler_step=125 -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] Acquisition_1B.dump=false -;#filename: Log path and filename Acquisition_1B.dump_filename=./acq_dump.dat Tracking_1B.implementation=Galileo_E1_DLL_PLL_VEML_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_1B.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] -Tracking_1B.if=0 -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1B.pll_bw_hz=15.0; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] Tracking_1B.dll_bw_hz=2.0; -;#order: PLL/DLL loop filter order [2] or [3] Tracking_1B.order=3; -;#early_late_space_chips: correlator early-late space [chips]. Use [0.5] for GPS and [0.15] for Galileo Tracking_1B.early_late_space_chips=0.15; -;#very_early_late_space_chips: only for [Galileo_E1_DLL_PLL_VEML_Tracking], correlator very early-late space [chips]. Use [0.6] Tracking_1B.very_early_late_space_chips=0.6; -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] Tracking_1B.dump=false -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. Tracking_1B.dump_filename=./veml_tracking_ch_ ;######### TELEMETRY DECODER GPS L1 CONFIG ############ -;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L1 C/A TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder TelemetryDecoder_1C.dump=false ;######### TELEMETRY DECODER GPS L2 CONFIG ############ -;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L2 M TelemetryDecoder_2S.implementation=GPS_L2C_Telemetry_Decoder TelemetryDecoder_2S.dump=false ;######### TELEMETRY DECODER GALILEO E1B CONFIG ############ -;#implementation: Use [Galileo_E1B_Telemetry_Decoder] for Galileo E1B TelemetryDecoder_1B.implementation=Galileo_E1B_Telemetry_Decoder TelemetryDecoder_1B.dump=false ;######### OBSERVABLES CONFIG ############ -;#implementation: Observables.implementation=Hybrid_Observables -;#dump: Enable or disable the Observables internal binary data file logging [true] or [false] Observables.dump=false -;#dump_filename: Log path and filename. Observables.dump_filename=./observables.dat @@ -443,22 +268,14 @@ PVT.implementation=RTKLIB_PVT PVT.positioning_mode=PPP_Static ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad -;#output_rate_ms: Period between two PVT outputs. Notice that the minimum period is equal to the tracking integration time (for GPS CA L1 is 1ms) [ms] PVT.output_rate_ms=100 -;#display_rate_ms: Position console print (std::out) interval [ms]. Notice that output_rate_ms<=display_rate_ms. PVT.display_rate_ms=100 -;# KML, GeoJSON, NMEA and RTCM output configuration -;#nmea_dump_filename: NMEA log path and filename PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea; -;#flag_nmea_tty_port: Enable or disable the NMEA log to a serial TTY port (Can be used with real hardware or virtual one) PVT.flag_nmea_tty_port=false; -;#nmea_dump_devname: serial device descriptor for NMEA logging PVT.nmea_dump_devname=/dev/pts/4 PVT.flag_rtcm_server=false PVT.flag_rtcm_tty_port=false PVT.rtcm_dump_devname=/dev/pts/1 -;#dump: Enable or disable the PVT internal binary data file logging [true] or [false] PVT.dump=false -;#dump_filename: Log path and filename without extension. Notice that PVT will add ".dat" to the binary dump and ".kml" to GoogleEarth dump. PVT.dump_filename=./PVT diff --git a/conf/gnss-sdr_multichannel_GPS_L1_USRP_X300_realtime.conf b/conf/gnss-sdr_multichannel_GPS_L1_USRP_X300_realtime.conf index c5f32b456..c2216e648 100644 --- a/conf/gnss-sdr_multichannel_GPS_L1_USRP_X300_realtime.conf +++ b/conf/gnss-sdr_multichannel_GPS_L1_USRP_X300_realtime.conf @@ -1,4 +1,6 @@ -; Default configuration file +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; @@ -27,235 +29,59 @@ GNSS-SDR.SUPL_CI=0x31b0 ;######### SIGNAL_SOURCE CONFIG ############ ;#implementation SignalSource.implementation=UHD_Signal_Source -;#When left empty, the device discovery routines will search all vailable transports on the system (ethernet, usb...) SignalSource.device_address=192.168.40.2 ; <- PUT THE IP ADDRESS OF YOUR USRP HERE -;#item_type: Type and resolution for each of the signal samples. SignalSource.item_type=gr_complex -;#RF_channels: Number of RF channels present in the frontend device (i.e. USRP with two frontends) SignalSource.RF_channels=2 -;#sampling_frequency: Original Signal sampling frequency in [Hz] SignalSource.sampling_frequency=4000000 -;#subdevice: UHD subdevice specification (for USRP dual frontend use A:0 or B:0 or A:0 B:0) SignalSource.subdevice=A:0 B:0 ;######### RF Channels specific settings ###### - ;## RF CHANNEL 0 ## -;#freq: RF front-end center frequency in [Hz] SignalSource.freq0=1575420000 - -;#gain: Front-end Gain in [dB] SignalSource.gain0=50 - -;#samples: Number of samples to be processed. Notice that 0 indicates no limit SignalSource.samples0=0 - ;## RF CHANNEL 1 ## -;#freq: RF front-end center frequency in [Hz] SignalSource.freq1=1575420000 - -;#gain: Front-end Gain in [dB] SignalSource.gain1=50 - -;#samples: Number of samples to be processed. Notice that 0 indicates no limit SignalSource.samples1=0 ;######### SIGNAL_CONDITIONER 0 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. - -;#implementation: Use [Pass_Through] or [Signal_Conditioner] -;#[Pass_Through] disables this block and the [DataTypeAdapter], [InputFilter] and [Resampler] blocks -;#[Signal_Conditioner] enables this block. Then you have to configure [DataTypeAdapter], [InputFilter] and [Resampler] blocks SignalConditioner0.implementation=Pass_Through ;######### DATA_TYPE_ADAPTER 0 CONFIG ############ -;## Changes the type of input data. -;#implementation: [Pass_Through] disables this block DataTypeAdapter0.implementation=Pass_Through DataTypeAdapter0.item_type=gr_complex ;######### INPUT_FILTER 0 CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter] -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation -;# that shifts IF down to zero Hz. - InputFilter0.implementation=Pass_Through - -;#dump: Dump the filtered data to a file. InputFilter0.dump=false - -;#dump_filename: Log path and filename. InputFilter0.dump_filename=../data/input_filter.dat - -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of gnuradio's function: gr_remez. -;#This function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, -;#the desired response on those bands, and the weight given to the error in those bands. - -;#input_item_type: Type and resolution for input signal samples. InputFilter0.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter0.output_item_type=gr_complex -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. -InputFilter0.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time -InputFilter0.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. -InputFilter0.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - -InputFilter0.band1_begin=0.0 -InputFilter0.band1_end=0.45 -InputFilter0.band2_begin=0.55 -InputFilter0.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - -InputFilter0.ampl1_begin=1.0 -InputFilter0.ampl1_end=1.0 -InputFilter0.ampl2_begin=0.0 -InputFilter0.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands -InputFilter0.band1_error=1.0 -InputFilter0.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" -InputFilter0.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. -InputFilter0.grid_density=16 - -;# Original sampling frequency stored in the signal file -InputFilter0.sampling_frequency=20480000 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. -;#InputFilter0.IF is the intermediate frequency (in Hz) shifted down to zero Hz - -InputFilter0.IF=5499998.47412109 - -;# Decimation factor after the frequency tranaslating block -InputFilter0.decimation_factor=8 - ;######### RESAMPLER CONFIG 0 ############ -;## Resamples the input data. - -;#implementation: Use [Pass_Through] or [Direct_Resampler] -;#[Pass_Through] disables this block -;#[Direct_Resampler] enables a resampler that implements a nearest neigbourhood interpolation Resampler0.implementation=Pass_Through -;######### SIGNAL_CONDITIONER 1 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. -;#implementation: Use [Pass_Through] or [Signal_Conditioner] -;#[Pass_Through] disables this block and the [DataTypeAdapter], [InputFilter] and [Resampler] blocks -;#[Signal_Conditioner] enables this block. Then you have to configure [DataTypeAdapter], [InputFilter] and [Resampler] blocks +;######### SIGNAL_CONDITIONER 1 CONFIG ############ SignalConditioner1.implementation=Pass_Through + ;######### INPUT_FILTER 1 CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter] -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation -;# that shifts IF down to zero Hz. - InputFilter1.implementation=Pass_Through - -;#dump: Dump the filtered data to a file. InputFilter1.dump=false - -;#dump_filename: Log path and filename. InputFilter1.dump_filename=../data/input_filter.dat - -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of gnuradio's function: gr_remez. -;#This function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, -;#the desired response on those bands, and the weight given to the error in those bands. - -;#input_item_type: Type and resolution for input signal samples. InputFilter1.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter1.output_item_type=gr_complex -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. -InputFilter1.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time -InputFilter1.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. -InputFilter1.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - -InputFilter1.band1_begin=0.0 -InputFilter1.band1_end=0.45 -InputFilter1.band2_begin=0.55 -InputFilter1.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - -InputFilter1.ampl1_begin=1.0 -InputFilter1.ampl1_end=1.0 -InputFilter1.ampl2_begin=0.0 -InputFilter1.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands -InputFilter1.band1_error=1.0 -InputFilter1.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" -InputFilter1.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. -InputFilter1.grid_density=16 - -;# Original sampling frequency stored in the signal file -InputFilter1.sampling_frequency=20480000 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. -;#InputFilter1.IF is the intermediate frequency (in Hz) shifted down to zero Hz - -InputFilter1.IF=5499998.47412109 - -;# Decimation factor after the frequency tranaslating block -InputFilter1.decimation_factor=8 - - ;######### RESAMPLER CONFIG 1 ############ -;## Resamples the input data. - -;#implementation: Use [Pass_Through] or [Direct_Resampler] -;#[Pass_Through] disables this block -;#[Direct_Resampler] enables a resampler that implements a nearest neigbourhood interpolation Resampler1.implementation=Pass_Through ;######### CHANNELS GLOBAL CONFIG ############ -;#count: Number of available GPS satellite channels. Channels_1C.count=4 -;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver Channels.in_acquisition=1 ;#signal: @@ -274,75 +100,45 @@ Channel3.RF_channel_ID=1 ;#signal: -;#if the option is disabled by default is assigned "1C" GPS L1 C/A Channel0.signal=1C Channel1.signal=1C Channel2.signal=1C Channel3.signal=1C -;######### SPECIFIC CHANNELS CONFIG ###### -;#The following options are specific to each channel and overwrite the generic options - ;######### ACQUISITION GLOBAL CONFIG ############ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] -;#item_type: Type and resolution for each of the signal samples. Acquisition_1C.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1C.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] Acquisition_1C.coherent_integration_time_ms=1 -;#threshold: Acquisition threshold. It will be ignored if pfa is defined. Acquisition_1C.threshold=0.01 -;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition] ;Acquisition_1C.pfa=0.01 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1C.doppler_max=8000 -;#doppler_max: Doppler step in the grid search [Hz] Acquisition_1C.doppler_step=500 -;#bit_transition_flag: Enable or disable a strategy to deal with bit transitions in GPS signals: process two dwells and take -;#maximum test statistics. Only use with implementation: [GPS_L1_CA_PCPS_Acquisition] -;#(should not be used for Galileo_E1_PCPS_Ambiguous_Acquisition]) Acquisition_1C.bit_transition_flag=false -;#max_dwells: Maximum number of consecutive dwells to be processed. It will be ignored if bit_transition_flag=true Acquisition_1C.max_dwells=1 Acquisition_1C.dump=false -;#filename: Log path and filename Acquisition_1C.dump_filename=./acq_dump.dat ;######### TRACKING GLOBAL CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_1C.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] -Tracking_1C.if=0 -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1C.pll_bw_hz=40.0; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] Tracking_1C.dll_bw_hz=4.0; -;#order: PLL/DLL loop filter order [2] or [3] Tracking_1C.order=3; -;#early_late_space_chips: correlator early-late space [chips]. Use [0.5] Tracking_1C.early_late_space_chips=0.5; -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] Tracking_1C.dump=false -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. Tracking_1C.dump_filename=./tracking_ch_ ;######### TELEMETRY DECODER GPS CONFIG ############ -;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L1 C/A TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder TelemetryDecoder_1C.dump=false ;######### OBSERVABLES CONFIG ############ Observables.implementation=Hybrid_Observables -;#dump: Enable or disable the Observables internal binary data file logging [true] or [false] Observables.dump=false -;#dump_filename: Log path and filename. Observables.dump_filename=./observables.dat @@ -351,21 +147,13 @@ PVT.implementation=RTKLIB_PVT PVT.positioning_mode=PPP_Static ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad -;#output_rate_ms: Period between two PVT outputs. Notice that the minimum period is equal to the tracking integration time (for GPS CA L1 is 1ms) [ms] PVT.output_rate_ms=100 -;#display_rate_ms: Position console print (std::out) interval [ms]. Notice that output_rate_ms<=display_rate_ms. PVT.display_rate_ms=500 -;# KML, GeoJSON, NMEA and RTCM output configuration -;#nmea_dump_filename: NMEA log path and filename PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea; -;#flag_nmea_tty_port: Enable or disable the NMEA log to a serial TTY port (Can be used with real hardware or virtual one) PVT.flag_nmea_tty_port=false; -;#nmea_dump_devname: serial device descriptor for NMEA logging PVT.nmea_dump_devname=/dev/pts/4 PVT.flag_rtcm_server=true PVT.flag_rtcm_tty_port=false PVT.rtcm_dump_devname=/dev/pts/1 -;#dump: Enable or disable the PVT internal binary data file logging [true] or [false] PVT.dump=false -;#dump_filename: Log path and filename without extension. Notice that PVT will add ".dat" to the binary dump and ".kml" to GoogleEarth dump. PVT.dump_filename=./PVT diff --git a/conf/gnss-sdr_multichannel_GPS_L2_M_Flexiband_bin_file_III_1b.conf b/conf/gnss-sdr_multichannel_GPS_L2_M_Flexiband_bin_file_III_1b.conf index 2f601ba41..9c899e6ca 100644 --- a/conf/gnss-sdr_multichannel_GPS_L2_M_Flexiband_bin_file_III_1b.conf +++ b/conf/gnss-sdr_multichannel_GPS_L2_M_Flexiband_bin_file_III_1b.conf @@ -1,4 +1,6 @@ -; Default configuration file +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; @@ -25,23 +27,17 @@ GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 ;######### SIGNAL_SOURCE CONFIG ############ -;#implementation SignalSource.implementation=Flexiband_Signal_Source SignalSource.flag_read_file=true SignalSource.signal_file=/media/javier/SISTEMA/signals/fraunhofer/L125_III1b_210s.usb ; <- PUT YOUR FILE HERE -;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version. SignalSource.item_type=gr_complex -;# FPGA firmware file SignalSource.firmware_file=flexiband_III-1b.bit -;#RF_channels: Number of RF channels present in the frontend device, must agree the FPGA firmware file SignalSource.RF_channels=1 ;#frontend channels gain. Not usable yet! SignalSource.gain1=0 SignalSource.gain2=0 SignalSource.gain3=0 -;#frontend channels AGC SignalSource.AGC=true -;# USB 3.0 packet buffer size (number of SuperSpeed packets) SignalSource.usb_packet_buffer=128 ;###################################################### @@ -49,7 +45,6 @@ SignalSource.usb_packet_buffer=128 ;###################################################### ;######### SIGNAL_CONDITIONER 0 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. SignalConditioner0.implementation=Signal_Conditioner ;######### DATA_TYPE_ADAPTER 0 CONFIG ############ @@ -57,80 +52,31 @@ DataTypeAdapter0.implementation=Pass_Through DataTypeAdapter0.item_type=gr_complex ;######### INPUT_FILTER 0 CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter] -;#[Pass_Through] disables this block -;#[Fir_Filter] enables a FIR Filter -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation that shifts IF down to zero Hz. - InputFilter0.implementation=Freq_Xlating_Fir_Filter - -;#dump: Dump the filtered data to a file. InputFilter0.dump=false - -;#dump_filename: Log path and filename. InputFilter0.dump_filename=../data/input_filter_ch0.dat - -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of gnuradio's function: gr_remez. -;#This function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, -;#the desired response on those bands, and the weight given to the error in those bands. - -;#input_item_type: Type and resolution for input signal samples. InputFilter0.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter0.output_item_type=gr_complex - -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. InputFilter0.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time InputFilter0.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. InputFilter0.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - InputFilter0.band1_begin=0.0 InputFilter0.band1_end=0.45 InputFilter0.band2_begin=0.55 InputFilter0.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - InputFilter0.ampl1_begin=1.0 InputFilter0.ampl1_end=1.0 InputFilter0.ampl2_begin=0.0 InputFilter0.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands InputFilter0.band1_error=1.0 InputFilter0.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" InputFilter0.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. InputFilter0.grid_density=16 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. -;#InputFilter0.IF is the intermediate frequency (in Hz) shifted down to zero Hz InputFilter0.sampling_frequency=20000000 InputFilter0.IF=0 - -;# Decimation factor after the frequency tranaslating block InputFilter0.decimation_factor=4 ;######### RESAMPLER CONFIG 0 ############ -;## Resamples the input data. Resampler0.implementation=Pass_Through ;###################################################### @@ -138,7 +84,6 @@ Resampler0.implementation=Pass_Through ;###################################################### ;######### SIGNAL_CONDITIONER 1 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. SignalConditioner1.implementation=Signal_Conditioner ;######### DATA_TYPE_ADAPTER 1 CONFIG ############ @@ -146,81 +91,32 @@ DataTypeAdapter1.implementation=Pass_Through DataTypeAdapter1.item_type=gr_complex ;######### INPUT_FILTER 0 CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter] -;#[Pass_Through] disables this block -;#[Fir_Filter] enables a FIR Filter -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation that shifts IF down to zero Hz. - InputFilter1.implementation=Freq_Xlating_Fir_Filter - -;#dump: Dump the filtered data to a file. InputFilter1.dump=false - -;#dump_filename: Log path and filename. InputFilter1.dump_filename=../data/input_filter_ch1.dat - -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of gnuradio's function: gr_remez. -;#This function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, -;#the desired response on those bands, and the weight given to the error in those bands. - -;#input_item_type: Type and resolution for input signal samples. InputFilter1.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter1.output_item_type=gr_complex - -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. InputFilter1.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time InputFilter1.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. InputFilter1.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - InputFilter1.band1_begin=0.0 InputFilter1.band1_end=0.45 InputFilter1.band2_begin=0.55 InputFilter1.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - InputFilter1.ampl1_begin=1.0 InputFilter1.ampl1_end=1.0 InputFilter1.ampl2_begin=0.0 InputFilter1.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands InputFilter1.band1_error=1.0 InputFilter1.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" InputFilter1.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. InputFilter1.grid_density=16 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. InputFilter1.sampling_frequency=20000000 -;# IF deviation due to front-end LO inaccuracies [HZ] InputFilter1.IF=0 - -;# Decimation factor after the frequency tranaslating block InputFilter1.decimation_factor=4 ;######### RESAMPLER CONFIG 1 ############ -;## Resamples the input data. Resampler1.implementation=Pass_Through @@ -229,7 +125,6 @@ Resampler1.implementation=Pass_Through ;###################################################### ;######### SIGNAL_CONDITIONER 2 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. SignalConditioner2.implementation=Signal_Conditioner ;######### DATA_TYPE_ADAPTER 2 CONFIG ############ @@ -237,84 +132,41 @@ DataTypeAdapter2.implementation=Pass_Through DataTypeAdapter2.item_type=gr_complex ;######### INPUT_FILTER 2 CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - InputFilter2.implementation=Freq_Xlating_Fir_Filter - -;#dump: Dump the filtered data to a file. InputFilter2.dump=false - -;#dump_filename: Log path and filename. InputFilter2.dump_filename=../data/input_filter_ch2.dat - -;#input_item_type: Type and resolution for input signal samples. InputFilter2.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples.. InputFilter2.output_item_type=gr_complex - -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. InputFilter2.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time InputFilter2.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. InputFilter2.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - InputFilter2.band1_begin=0.0 InputFilter2.band1_end=0.45 InputFilter2.band2_begin=0.55 InputFilter2.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - InputFilter2.ampl1_begin=1.0 InputFilter2.ampl1_end=1.0 InputFilter2.ampl2_begin=0.0 InputFilter2.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands InputFilter2.band1_error=1.0 InputFilter2.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" InputFilter2.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. InputFilter2.grid_density=16 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. InputFilter2.sampling_frequency=40000000 -;# IF deviation due to front-end LO inaccuracies [HZ] InputFilter2.IF=0 - -;# Decimation factor after the frequency tranaslating block InputFilter2.decimation_factor=8 ;######### RESAMPLER CONFIG 1 ############ -;## Resamples the input data. Resampler2.implementation=Pass_Through ;######### CHANNELS GLOBAL CONFIG ############ -;#count: Number of available GPS satellite channels. Channels_1C.count=0 Channels_1B.count=10 Channels_2S.count=0 Channels_5X.count=0 -;#GPS.prns=7,8 - -;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver Channels.in_acquisition=1 ;#signal: @@ -369,13 +221,11 @@ Channel37.RF_channel_ID=2 Channel38.RF_channel_ID=2 Channel39.RF_channel_ID=2 -;######### ACQUISITION GENERIC CONFIG ###### -;#The following options are specific to each channel and overwrite the generic options +;######### ACQUISITION CONFIG ###### ;# GPS L1 CA Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition Acquisition_1C.item_type=gr_complex -Acquisition_1C.if=0 Acquisition_1C.coherent_integration_time_ms=1 Acquisition_1C.threshold=0.005 Acquisition_1C.doppler_max=5000 @@ -387,30 +237,19 @@ Acquisition_1C.dump_filename=./acq_dump.dat ;# Galileo E1 Acquisition_1B.implementation=Galileo_E1_PCPS_Ambiguous_Acquisition -;#item_type: Type and resolution for each of the signal samples. Acquisition_1B.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1B.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] -Acquisition_1B.sampled_ms=4 -;#threshold: Acquisition threshold +Acquisition_1B.coherent_integration_time_ms=4 ;Acquisition_1B.threshold=0 -;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition] Acquisition_1B.pfa=0.0000002 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1B.doppler_max=5000 -;#doppler_max: Doppler step in the grid search [Hz] Acquisition_1B.doppler_step=125 -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] Acquisition_1B.dump=false -;#filename: Log path and filename Acquisition_1B.dump_filename=./acq_dump.dat ;# GPS L2C M Acquisition_2S.implementation=GPS_L2_M_PCPS_Acquisition Acquisition_2S.item_type=gr_complex -Acquisition_2S.if=0 Acquisition_2S.threshold=0.00074 ;Acquisition_2S.pfa=0.001 Acquisition_2S.doppler_max=5000 @@ -424,7 +263,6 @@ Acquisition_2S.dump_filename=./acq_dump.dat ;# GALILEO E5a Acquisition_5X.implementation=Galileo_E5a_Noncoherent_IQ_Acquisition_CAF Acquisition_5X.item_type=gr_complex -Acquisition_5X.if=0 Acquisition_5X.coherent_integration_time_ms=1 Acquisition_5X.threshold=0.009 Acquisition_5X.doppler_max=5000 @@ -441,7 +279,6 @@ Acquisition_5X.dump_filename=./acq_dump.dat ;######### GPS L1 C/A GENERIC TRACKING CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking Tracking_1C.item_type=gr_complex -Tracking_1C.if=0 Tracking_1C.pll_bw_hz=40.0; Tracking_1C.dll_bw_hz=3.0; Tracking_1C.order=3; @@ -452,30 +289,19 @@ Tracking_1C.dump_filename=../data/epl_tracking_ch_ ;######### GALILEO E1 TRK CONFIG ############ Tracking_1B.implementation=Galileo_E1_DLL_PLL_VEML_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_1B.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] -Tracking_1B.if=0 -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1B.pll_bw_hz=15.0; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] Tracking_1B.dll_bw_hz=2.0; -;#order: PLL/DLL loop filter order [2] or [3] Tracking_1B.order=3; -;#early_late_space_chips: correlator early-late space [chips]. Use [0.5] for GPS and [0.15] for Galileo Tracking_1B.early_late_space_chips=0.15; -;#very_early_late_space_chips: only for [Galileo_E1_DLL_PLL_VEML_Tracking], correlator very early-late space [chips]. Use [0.6] Tracking_1B.very_early_late_space_chips=0.6; -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] Tracking_1B.dump=false -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. Tracking_1B.dump_filename=../data/veml_tracking_ch_ ;######### GPS L2C GENERIC TRACKING CONFIG ############ Tracking_2S.implementation=GPS_L2_M_DLL_PLL_Tracking Tracking_2S.item_type=gr_complex -Tracking_2S.if=0 Tracking_2S.pll_bw_hz=2.0; Tracking_2S.dll_bw_hz=0.25; Tracking_2S.order=2; @@ -487,7 +313,6 @@ Tracking_2S.dump_filename=./tracking_ch_ ;######### GALILEO E5 TRK CONFIG ############ Tracking_5X.implementation=Galileo_E5a_DLL_PLL_Tracking Tracking_5X.item_type=gr_complex -Tracking_5X.if=0 Tracking_5X.pll_bw_hz_init=20.0; **Only for E5a** PLL loop filter bandwidth during initialization [Hz] Tracking_5X.dll_bw_hz_init=20.0; **Only for E5a** DLL loop filter bandwidth during initialization [Hz] Tracking_5X.ti_ms=1; **Only for E5a** loop filter integration time after initialization (secondary code delay search)[ms] @@ -515,9 +340,7 @@ TelemetryDecoder_5X.dump=false ;######### OBSERVABLES CONFIG ############ Observables.implementation=Hybrid_Observables -;#dump: Enable or disable the Observables internal binary data file logging [true] or [false] Observables.dump=false -;#dump_filename: Log path and filename. Observables.dump_filename=./observables.dat @@ -526,21 +349,13 @@ PVT.implementation=RTKLIB_PVT PVT.positioning_mode=PPP_Static ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad -;#output_rate_ms: Period between two PVT outputs. Notice that the minimum period is equal to the tracking integration time (for GPS CA L1 is 1ms) [ms] PVT.output_rate_ms=100 -;#display_rate_ms: Position console print (std::out) interval [ms]. Notice that output_rate_ms<=display_rate_ms. PVT.display_rate_ms=100 -;# KML, GeoJSON, NMEA and RTCM output configuration -;#nmea_dump_filename: NMEA log path and filename PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea; -;#flag_nmea_tty_port: Enable or disable the NMEA log to a serial TTY port (Can be used with real hardware or virtual one) PVT.flag_nmea_tty_port=false; -;#nmea_dump_devname: serial device descriptor for NMEA logging PVT.nmea_dump_devname=/dev/pts/4 PVT.flag_rtcm_server=false PVT.flag_rtcm_tty_port=false PVT.rtcm_dump_devname=/dev/pts/1 -;#dump: Enable or disable the PVT internal binary data file logging [true] or [false] PVT.dump=false -;#dump_filename: Log path and filename without extension. Notice that PVT will add ".dat" to the binary dump and ".kml" to GoogleEarth dump. PVT.dump_filename=./PVT diff --git a/conf/gnss-sdr_multichannel_GPS_L2_M_Flexiband_bin_file_III_1b_real.conf b/conf/gnss-sdr_multichannel_GPS_L2_M_Flexiband_bin_file_III_1b_real.conf index 669f734c3..ab8bbaed6 100644 --- a/conf/gnss-sdr_multichannel_GPS_L2_M_Flexiband_bin_file_III_1b_real.conf +++ b/conf/gnss-sdr_multichannel_GPS_L2_M_Flexiband_bin_file_III_1b_real.conf @@ -1,4 +1,6 @@ -; Default configuration file +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; @@ -25,23 +27,17 @@ GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 ;######### SIGNAL_SOURCE CONFIG ############ -;#implementation SignalSource.implementation=Flexiband_Signal_Source SignalSource.flag_read_file=true SignalSource.signal_file=/home/javier/signals/20140923_20-24-17_L125_roof_210s.usb ; <- PUT YOUR FILE HERE -;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version. SignalSource.item_type=gr_complex -;# FPGA firmware file SignalSource.firmware_file=flexiband_III-1b.bit -;#RF_channels: Number of RF channels present in the frontend device, must agree the FPGA firmware file SignalSource.RF_channels=2 ;#frontend channels gain. Not usable yet! SignalSource.gain1=0 SignalSource.gain2=0 SignalSource.gain3=0 -;#frontend channels AGC SignalSource.AGC=true -;# USB 3.0 packet buffer size (number of SuperSpeed packets) SignalSource.usb_packet_buffer=128 ;###################################################### @@ -49,7 +45,6 @@ SignalSource.usb_packet_buffer=128 ;###################################################### ;######### SIGNAL_CONDITIONER 0 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. SignalConditioner0.implementation=Signal_Conditioner ;######### DATA_TYPE_ADAPTER 0 CONFIG ############ @@ -57,83 +52,30 @@ DataTypeAdapter0.implementation=Pass_Through DataTypeAdapter0.item_type=gr_complex ;######### INPUT_FILTER 0 CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter] -;#[Pass_Through] disables this block -;#[Fir_Filter] enables a FIR Filter -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation that shifts IF down to zero Hz. - InputFilter0.implementation=Freq_Xlating_Fir_Filter - -;#dump: Dump the filtered data to a file. InputFilter0.dump=false - -;#dump_filename: Log path and filename. InputFilter0.dump_filename=../data/input_filter_ch0.dat - -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of gnuradio's function: gr_remez. -;#This function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, -;#the desired response on those bands, and the weight given to the error in those bands. - -;#input_item_type: Type and resolution for input signal samples. InputFilter0.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter0.output_item_type=gr_complex - -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. InputFilter0.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time InputFilter0.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. InputFilter0.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - InputFilter0.band1_begin=0.0 InputFilter0.band1_end=0.45 InputFilter0.band2_begin=0.55 InputFilter0.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - InputFilter0.ampl1_begin=1.0 InputFilter0.ampl1_end=1.0 InputFilter0.ampl2_begin=0.0 InputFilter0.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands InputFilter0.band1_error=1.0 InputFilter0.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" InputFilter0.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. InputFilter0.grid_density=16 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. -;#InputFilter0.IF is the intermediate frequency (in Hz) shifted down to zero Hz -;FOR USE GNSS-SDR WITH RTLSDR DONGLES USER MUST SET THE CALIBRATED SAMPLE RATE HERE -; i.e. using front-end-cal as reported here:http://www.cttc.es/publication/turning-a-television-into-a-gnss-receiver/ -InputFilter0.sampling_frequency=20000000 -;# IF deviation due to front-end LO inaccuracies [HZ] InputFilter0.IF=0 - -;# Decimation factor after the frequency tranaslating block InputFilter0.decimation_factor=4 ;######### RESAMPLER CONFIG 0 ############ -;## Resamples the input data. Resampler0.implementation=Pass_Through ;###################################################### @@ -141,7 +83,6 @@ Resampler0.implementation=Pass_Through ;###################################################### ;######### SIGNAL_CONDITIONER 1 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. SignalConditioner1.implementation=Signal_Conditioner ;######### DATA_TYPE_ADAPTER 1 CONFIG ############ @@ -149,88 +90,35 @@ DataTypeAdapter1.implementation=Pass_Through DataTypeAdapter1.item_type=gr_complex ;######### INPUT_FILTER 0 CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter] -;#[Pass_Through] disables this block -;#[Fir_Filter] enables a FIR Filter -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation that shifts IF down to zero Hz. - InputFilter1.implementation=Freq_Xlating_Fir_Filter - -;#dump: Dump the filtered data to a file. InputFilter1.dump=false - -;#dump_filename: Log path and filename. InputFilter1.dump_filename=../data/input_filter_ch1.dat - -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of gnuradio's function: gr_remez. -;#This function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, -;#the desired response on those bands, and the weight given to the error in those bands. - -;#input_item_type: Type and resolution for input signal samples. InputFilter1.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter1.output_item_type=gr_complex - -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. InputFilter1.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time InputFilter1.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. InputFilter1.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - InputFilter1.band1_begin=0.0 InputFilter1.band1_end=0.45 InputFilter1.band2_begin=0.55 InputFilter1.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - InputFilter1.ampl1_begin=1.0 InputFilter1.ampl1_end=1.0 InputFilter1.ampl2_begin=0.0 InputFilter1.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands InputFilter1.band1_error=1.0 InputFilter1.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" InputFilter1.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. InputFilter1.grid_density=16 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. -;#InputFilter0.IF is the intermediate frequency (in Hz) shifted down to zero Hz -;FOR USE GNSS-SDR WITH RTLSDR DONGLES USER MUST SET THE CALIBRATED SAMPLE RATE HERE -; i.e. using front-end-cal as reported here:http://www.cttc.es/publication/turning-a-television-into-a-gnss-receiver/ InputFilter1.sampling_frequency=20000000 -;# IF deviation due to front-end LO inaccuracies [HZ] InputFilter1.IF=0 - -;# Decimation factor after the frequency tranaslating block InputFilter1.decimation_factor=4 ;######### RESAMPLER CONFIG 1 ############ -;## Resamples the input data. Resampler1.implementation=Pass_Through ;######### SIGNAL_CONDITIONER 2 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. SignalConditioner2.implementation=Pass_Through ;######### DATA_TYPE_ADAPTER 2 CONFIG ############ @@ -239,32 +127,21 @@ DataTypeAdapter2.item_type=gr_complex ;######### INPUT_FILTER 2 CONFIG ############ InputFilter2.implementation=Pass_Through - -;#dump: Dump the filtered data to a file. InputFilter2.dump=false - -;#dump_filename: Log path and filename. InputFilter2.dump_filename=../data/input_filter.dat - -;#input_item_type: Type and resolution for input signal samples. InputFilter2.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter2.output_item_type=gr_complex ;######### RESAMPLER CONFIG 2 ############ -;## Resamples the input data. Resampler2.implementation=Pass_Through ;######### CHANNELS GLOBAL CONFIG ############ -;#count: Number of available GPS satellite channels. Channels_1C.count=10 Channels_2S.count=4 ;#GPS.prns=7,8 -;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver Channels.in_acquisition=1 ;#signal: @@ -301,7 +178,6 @@ Channel19.RF_channel_ID=1 Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition Acquisition_1C.item_type=gr_complex -Acquisition_1C.if=0 Acquisition_1C.coherent_integration_time_ms=1 Acquisition_1C.threshold=0.005 Acquisition_1C.doppler_max=5000 @@ -315,7 +191,6 @@ Acquisition_1C.dump_filename=./acq_dump.dat ;# GPS L2C M Acquisition_2S.implementation=GPS_L2_M_PCPS_Acquisition Acquisition_2S.item_type=gr_complex -Acquisition_2S.if=0 Acquisition_2S.threshold=0.00074 ;Acquisition_2S.pfa=0.001 Acquisition_2S.doppler_max=5000 @@ -330,7 +205,6 @@ Acquisition_2S.dump_filename=./acq_dump.dat ;######### GPS L1 C/A GENERIC TRACKING CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking Tracking_1C.item_type=gr_complex -Tracking_1C.if=0 Tracking_1C.pll_bw_hz=40.0; Tracking_1C.dll_bw_hz=3.0; Tracking_1C.order=3; @@ -342,7 +216,6 @@ Tracking_1C.dump_filename=../data/epl_tracking_ch_ ;######### GPS L2C GENERIC TRACKING CONFIG ############ Tracking_2S.implementation=GPS_L2_M_DLL_PLL_Tracking Tracking_2S.item_type=gr_complex -Tracking_2S.if=0 Tracking_2S.pll_bw_hz=2.0; Tracking_2S.dll_bw_hz=0.25; Tracking_2S.order=2; @@ -362,29 +235,22 @@ TelemetryDecoder_2S.dump=false ;######### OBSERVABLES CONFIG ############ Observables.implementation=Hybrid_Observables -;#dump: Enable or disable the Observables internal binary data file logging [true] or [false] Observables.dump=true -;#dump_filename: Log path and filename. Observables.dump_filename=./observables.dat ;######### PVT CONFIG ############ PVT.implementation=RTKLIB_PVT -;#output_rate_ms: Period between two PVT outputs. Notice that the minimum period is equal to the tracking integration time (for GPS CA L1 is 1ms) [ms] +PVT.positioning_mode=PPP_Static ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic +PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX +PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad PVT.output_rate_ms=100 -;#display_rate_ms: Position console print (std::out) interval [ms]. Notice that output_rate_ms<=display_rate_ms. PVT.display_rate_ms=100 -;# KML, GeoJSON, NMEA and RTCM output configuration -;#nmea_dump_filename: NMEA log path and filename PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea; -;#flag_nmea_tty_port: Enable or disable the NMEA log to a serial TTY port (Can be used with real hardware or virtual one) PVT.flag_nmea_tty_port=false; -;#nmea_dump_devname: serial device descriptor for NMEA logging PVT.nmea_dump_devname=/dev/pts/4 PVT.flag_rtcm_server=false PVT.flag_rtcm_tty_port=false PVT.rtcm_dump_devname=/dev/pts/1 -;#dump: Enable or disable the PVT internal binary data file logging [true] or [false] PVT.dump=false -;#dump_filename: Log path and filename without extension. Notice that PVT will add ".dat" to the binary dump and ".kml" to GoogleEarth dump. PVT.dump_filename=./PVT \ No newline at end of file diff --git a/conf/gnss-sdr_multichannel_all_in_one_Flexiband_bin_file_III_1b.conf b/conf/gnss-sdr_multichannel_all_in_one_Flexiband_bin_file_III_1b.conf index dece9c9e4..26fa98a81 100644 --- a/conf/gnss-sdr_multichannel_all_in_one_Flexiband_bin_file_III_1b.conf +++ b/conf/gnss-sdr_multichannel_all_in_one_Flexiband_bin_file_III_1b.conf @@ -1,4 +1,6 @@ -; Default configuration file +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; @@ -25,23 +27,17 @@ GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 ;######### SIGNAL_SOURCE CONFIG ############ -;#implementation SignalSource.implementation=Flexiband_Signal_Source SignalSource.flag_read_file=true -SignalSource.signal_file=/media/javier/SISTEMA/signals/fraunhofer/L125_III1b_210s.usb ; <- PUT YOUR FILE HERE -;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version. +SignalSource.signal_file=/media/javier/SISTEMA/signals/fraunhofer/L125_III1b_210s.usb ; <- PUT YOUR FILE HERE SignalSource.item_type=gr_complex -;# FPGA firmware file SignalSource.firmware_file=flexiband_III-1b.bit -;#RF_channels: Number of RF channels present in the frontend device, must agree the FPGA firmware file SignalSource.RF_channels=3 ;#frontend channels gain. Not usable yet! SignalSource.gain1=0 SignalSource.gain2=0 SignalSource.gain3=0 -;#frontend channels AGC SignalSource.AGC=true -;# USB 3.0 packet buffer size (number of SuperSpeed packets) SignalSource.usb_packet_buffer=128 ;###################################################### @@ -49,7 +45,6 @@ SignalSource.usb_packet_buffer=128 ;###################################################### ;######### SIGNAL_CONDITIONER 0 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. SignalConditioner0.implementation=Signal_Conditioner ;######### DATA_TYPE_ADAPTER 0 CONFIG ############ @@ -57,177 +52,69 @@ DataTypeAdapter0.implementation=Pass_Through DataTypeAdapter0.item_type=gr_complex ;######### INPUT_FILTER 0 CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter] -;#[Pass_Through] disables this block -;#[Fir_Filter] enables a FIR Filter -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation that shifts IF down to zero Hz. - InputFilter0.implementation=Freq_Xlating_Fir_Filter - -;#dump: Dump the filtered data to a file. InputFilter0.dump=false - -;#dump_filename: Log path and filename. InputFilter0.dump_filename=../data/input_filter_ch0.dat - -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of gnuradio's function: gr_remez. -;#These function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse reaponse given a set of band edges, -;#the desired reaponse on those bands, and the weight given to the error in those bands. - -;#input_item_type: Type and resolution for input signal samples. InputFilter0.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter0.output_item_type=gr_complex - -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. InputFilter0.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time InputFilter0.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. InputFilter0.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - InputFilter0.band1_begin=0.0 InputFilter0.band1_end=0.45 InputFilter0.band2_begin=0.55 InputFilter0.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - InputFilter0.ampl1_begin=1.0 InputFilter0.ampl1_end=1.0 InputFilter0.ampl2_begin=0.0 InputFilter0.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands InputFilter0.band1_error=1.0 InputFilter0.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" InputFilter0.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. InputFilter0.grid_density=16 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. -;#InputFilter0.IF is the intermediate frequency (in Hz) shifted down to zero Hz -;FOR USE GNSS-SDR WITH RTLSDR DONGLES USER MUST SET THE CALIBRATED SAMPLE RATE HERE -; i.e. using front-end-cal as reported here:http://www.cttc.es/publication/turning-a-television-into-a-gnss-receiver/ -InputFilter0.sampling_frequency=20000000 -;# IF deviation due to front-end LO inaccuracies [HZ] -;#InputFilter0.IF=-205000 InputFilter0.IF=0 - -;# Decimation factor after the frequency tranaslating block InputFilter0.decimation_factor=4 ;######### RESAMPLER CONFIG 0 ############ -;## Resamples the input data. Resampler0.implementation=Pass_Through + ;###################################################### ;######### RF CHANNEL 1 SIGNAL CONDITIONER ############ ;###################################################### ;######### SIGNAL_CONDITIONER 1 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. SignalConditioner1.implementation=Signal_Conditioner ;######### DATA_TYPE_ADAPTER 1 CONFIG ############ DataTypeAdapter1.implementation=Pass_Through DataTypeAdapter1.item_type=gr_complex -;######### INPUT_FILTER 0 CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter] -;#[Pass_Through] disables this block -;#[Fir_Filter] enables a FIR Filter -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation that shifts IF down to zero Hz. - +;######### INPUT_FILTER 1 CONFIG ############ InputFilter1.implementation=Freq_Xlating_Fir_Filter - -;#dump: Dump the filtered data to a file. InputFilter1.dump=false - -;#dump_filename: Log path and filename. InputFilter1.dump_filename=../data/input_filter_ch1.dat - -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of gnuradio's function: gr_remez. -;#This function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, -;#the desired response on those bands, and the weight given to the error in those bands. - -;#input_item_type: Type and resolution for input signal samples. InputFilter1.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter1.output_item_type=gr_complex - -;#taps_item_type: Type and resolution for the taps of the filter. InputFilter1.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time InputFilter1.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. InputFilter1.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - InputFilter1.band1_begin=0.0 InputFilter1.band1_end=0.45 InputFilter1.band2_begin=0.55 InputFilter1.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - InputFilter1.ampl1_begin=1.0 InputFilter1.ampl1_end=1.0 InputFilter1.ampl2_begin=0.0 InputFilter1.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands InputFilter1.band1_error=1.0 InputFilter1.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" InputFilter1.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. InputFilter1.grid_density=16 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. -;#InputFilter0.IF is the intermediate frequency (in Hz) shifted down to zero Hz -;FOR USE GNSS-SDR WITH RTLSDR DONGLES USER MUST SET THE CALIBRATED SAMPLE RATE HERE -; i.e. using front-end-cal as reported here:http://www.cttc.es/publication/turning-a-television-into-a-gnss-receiver/ -InputFilter1.sampling_frequency=20000000 -;# IF deviation due to front-end LO inaccuracies [HZ] InputFilter1.IF=0 - -;# Decimation factor after the frequency tranaslating block InputFilter1.decimation_factor=4 - ;######### RESAMPLER CONFIG 1 ############ -;## Resamples the input data. Resampler1.implementation=Pass_Through @@ -236,7 +123,6 @@ Resampler1.implementation=Pass_Through ;###################################################### ;######### SIGNAL_CONDITIONER 2 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. SignalConditioner2.implementation=Signal_Conditioner ;######### DATA_TYPE_ADAPTER 2 CONFIG ############ @@ -244,96 +130,43 @@ DataTypeAdapter2.implementation=Pass_Through DataTypeAdapter2.item_type=gr_complex ;######### INPUT_FILTER 2 CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - InputFilter2.implementation=Freq_Xlating_Fir_Filter - -;#dump: Dump the filtered data to a file. InputFilter2.dump=false - -;#dump_filename: Log path and filename. InputFilter2.dump_filename=../data/input_filter_ch2.dat - -;#input_item_type: Type and resolution for input signal samples. InputFilter2.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter2.output_item_type=gr_complex - -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. InputFilter2.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time InputFilter2.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. InputFilter2.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - InputFilter2.band1_begin=0.0 InputFilter2.band1_end=0.45 InputFilter2.band2_begin=0.55 InputFilter2.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - InputFilter2.ampl1_begin=1.0 InputFilter2.ampl1_end=1.0 InputFilter2.ampl2_begin=0.0 InputFilter2.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands InputFilter2.band1_error=1.0 InputFilter2.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" InputFilter2.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. InputFilter2.grid_density=16 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. -;#InputFilter0.IF is the intermediate frequency (in Hz) shifted down to zero Hz -;FOR USE GNSS-SDR WITH RTLSDR DONGLES USER MUST SET THE CALIBRATED SAMPLE RATE HERE -; i.e. using front-end-cal as reported here:http://www.cttc.es/publication/turning-a-television-into-a-gnss-receiver/ -InputFilter2.sampling_frequency=40000000 -;# IF deviation due to front-end LO inaccuracies [HZ] InputFilter2.IF=0 - -;# Decimation factor after the frequency tranaslating block InputFilter2.decimation_factor=8 -;######### RESAMPLER CONFIG 1 ############ -;## Resamples the input data. +;######### RESAMPLER CONFIG 2 ############ Resampler2.implementation=Pass_Through ;######### CHANNELS GLOBAL CONFIG ############ -;#count: Number of available GPS satellite channels. Channels_1C.count=10 Channels_1B.count=10 Channels_2S.count=10 -Channels_5X.count=10 +Channels_5X.count=2 +Channels_L5.count=2 ;#GPS.prns=7,8 - -;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver -Channels.in_acquisition=1 - -;#signal: -;# "1C" GPS L1 C/A -;# "1B" GALILEO E1 B (I/NAV OS/CS/SoL) -;# "1G" GLONASS L1 C/A -;# "2S" GPS L2 L2C (M) -;# "5X" GALILEO E5a I+Q -;# "L5" GPS L5 +;Channels.in_acquisition=2 ;# CHANNEL CONNECTION @@ -377,14 +210,16 @@ Channel36.RF_channel_ID=2 Channel37.RF_channel_ID=2 Channel38.RF_channel_ID=2 Channel39.RF_channel_ID=2 +Channel40.RF_channel_ID=2 +Channel41.RF_channel_ID=2 +Channel42.RF_channel_ID=2 + +;Channel20.satellite=7 -;######### ACQUISITION GENERIC CONFIG ###### -;#The following options are specific to each channel and overwrite the generic options ;# GPS L1 CA Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition Acquisition_1C.item_type=gr_complex -Acquisition_1C.if=0 Acquisition_1C.coherent_integration_time_ms=1 Acquisition_1C.threshold=0.005 Acquisition_1C.doppler_max=5000 @@ -397,30 +232,18 @@ Acquisition_1C.dump_filename=./acq_dump.dat ;# Galileo E1 Acquisition_1B.implementation=Galileo_E1_PCPS_Ambiguous_Acquisition -;#item_type: Type and resolution for each of the signal samples. Acquisition_1B.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1B.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] -Acquisition_1B.sampled_ms=4 -;#threshold: Acquisition threshold +Acquisition_1B.coherent_integration_time_ms=4 ;Acquisition_1B.threshold=0 -;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition] Acquisition_1B.pfa=0.0000002 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1B.doppler_max=5000 -;#doppler_max: Doppler step in the grid search [Hz] Acquisition_1B.doppler_step=125 -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] -Acquisition_1B.dump=false -;#filename: Log path and filename Acquisition_1B.dump_filename=./acq_dump.dat ;# GPS L2C M Acquisition_2S.implementation=GPS_L2_M_PCPS_Acquisition Acquisition_2S.item_type=gr_complex -Acquisition_2S.if=0 Acquisition_2S.threshold=0.00074 ;Acquisition_2S.pfa=0.001 Acquisition_2S.doppler_max=5000 @@ -434,7 +257,6 @@ Acquisition_2S.dump_filename=./acq_dump.dat ;# GALILEO E5a Acquisition_5X.implementation=Galileo_E5a_Noncoherent_IQ_Acquisition_CAF Acquisition_5X.item_type=gr_complex -Acquisition_5X.if=0 Acquisition_5X.coherent_integration_time_ms=1 Acquisition_5X.threshold=0.009 Acquisition_5X.doppler_max=5000 @@ -447,11 +269,23 @@ Acquisition_5X.dump=false Acquisition_5X.dump_filename=./acq_dump.dat +;# GPS L5 +Acquisition_L5.implementation=GPS_L5i_PCPS_Acquisition +Acquisition_L5.item_type=gr_complex +Acquisition_L5.threshold=0.00074 +;Acquisition_L5.pfa=0.001 +Acquisition_L5.doppler_max=5000 +Acquisition_L5.doppler_min=-5000 +Acquisition_L5.doppler_step=125 +Acquisition_L5.max_dwells=1 +Acquisition_L5.dump=false +Acquisition_L5.dump_filename=./acq_dump.dat + + + ;######### TRACKING CONFIG ############ -;######### GPS L1 C/A GENERIC TRACKING CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking Tracking_1C.item_type=gr_complex -Tracking_1C.if=0 Tracking_1C.pll_bw_hz=35.0; Tracking_1C.dll_bw_hz=2.0; Tracking_1C.order=3; @@ -461,30 +295,19 @@ Tracking_1C.dump_filename=../data/epl_tracking_ch_ ;######### GALILEO E1 TRK CONFIG ############ Tracking_1B.implementation=Galileo_E1_DLL_PLL_VEML_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_1B.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] -Tracking_1B.if=0 -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1B.pll_bw_hz=15.0; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] Tracking_1B.dll_bw_hz=2.0; -;#order: PLL/DLL loop filter order [2] or [3] Tracking_1B.order=3; -;#early_late_space_chips: correlator early-late space [chips]. Use [0.5] for GPS and [0.15] for Galileo Tracking_1B.early_late_space_chips=0.15; -;#very_early_late_space_chips: only for [Galileo_E1_DLL_PLL_VEML_Tracking], correlator very early-late space [chips]. Use [0.6] Tracking_1B.very_early_late_space_chips=0.6; -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] Tracking_1B.dump=false -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. Tracking_1B.dump_filename=../data/veml_tracking_ch_ ;######### GPS L2C GENERIC TRACKING CONFIG ############ Tracking_2S.implementation=GPS_L2_M_DLL_PLL_Tracking Tracking_2S.item_type=gr_complex -Tracking_2S.if=0 Tracking_2S.pll_bw_hz=2.0; Tracking_2S.dll_bw_hz=0.25; Tracking_2S.order=2; @@ -492,21 +315,32 @@ Tracking_2S.early_late_space_chips=0.5; Tracking_2S.dump=false Tracking_2S.dump_filename=./tracking_ch_ - ;######### GALILEO E5 TRK CONFIG ############ Tracking_5X.implementation=Galileo_E5a_DLL_PLL_Tracking Tracking_5X.item_type=gr_complex -Tracking_5X.if=0 -Tracking_5X.pll_bw_hz_init=20.0; **Only for E5a** PLL loop filter bandwidth during initialization [Hz] -Tracking_5X.dll_bw_hz_init=20.0; **Only for E5a** DLL loop filter bandwidth during initialization [Hz] -Tracking_5X.ti_ms=1; **Only for E5a** loop filter integration time after initialization (secondary code delay search)[ms] -Tracking_5X.pll_bw_hz=20.0; -Tracking_5X.dll_bw_hz=20.0; +Tracking_5X.track_pilot=true +Tracking_5X.pll_bw_hz=15.0; +Tracking_5X.dll_bw_hz=2.0; +Tracking_5X.pll_bw_narrow_hz=5.0; +Tracking_5X.dll_bw_narrow_hz=1.0; Tracking_5X.order=2; Tracking_5X.early_late_space_chips=0.5; Tracking_5X.dump=false Tracking_5X.dump_filename=./tracking_ch_ +;######### GALILEO E5 TRK CONFIG ############ +Tracking_L5.implementation=GPS_L5_DLL_PLL_Tracking +Tracking_L5.item_type=gr_complex +Tracking_L5.track_pilot=true +Tracking_L5.pll_bw_hz=15.0; +Tracking_L5.dll_bw_hz=2.0; +Tracking_L5.pll_bw_narrow_hz=4.0; +Tracking_L5.dll_bw_narrow_hz=1.0; +Tracking_L5.order=2; +Tracking_L5.early_late_space_chips=0.5; +Tracking_L5.dump=false +Tracking_L5.dump_filename=./tracking_ch_ + ;######### TELEMETRY DECODER CONFIG ############ TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder @@ -521,37 +355,28 @@ TelemetryDecoder_2S.dump=false TelemetryDecoder_5X.implementation=Galileo_E5a_Telemetry_Decoder TelemetryDecoder_5X.dump=false +TelemetryDecoder_L5.implementation=GPS_L5_Telemetry_Decoder +TelemetryDecoder_L5.dump=false + ;######### OBSERVABLES CONFIG ############ -;#implementation: Observables.implementation=Hybrid_Observables -;#dump: Enable or disable the Observables internal binary data file logging [true] or [false] Observables.dump=false -;#dump_filename: Log path and filename. Observables.dump_filename=./observables.dat ;######### PVT CONFIG ############ -;#implementation: Position Velocity and Time (PVT) implementation: PVT.implementation=RTKLIB_PVT PVT.positioning_mode=PPP_Static ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad -;#output_rate_ms: Period between two PVT outputs. Notice that the minimum period is equal to the tracking integration time (for GPS CA L1 is 1ms) [ms] PVT.output_rate_ms=10 -;#display_rate_ms: Position console print (std::out) interval [ms]. Notice that output_rate_ms<=display_rate_ms. PVT.display_rate_ms=100 -;# KML, GeoJSON, NMEA and RTCM output configuration -;#nmea_dump_filename: NMEA log path and filename PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea; -;#flag_nmea_tty_port: Enable or disable the NMEA log to a serial TTY port (Can be used with real hardware or virtual one) PVT.flag_nmea_tty_port=false; -;#nmea_dump_devname: serial device descriptor for NMEA logging PVT.nmea_dump_devname=/dev/pts/4 PVT.flag_rtcm_server=false PVT.flag_rtcm_tty_port=false PVT.rtcm_dump_devname=/dev/pts/1 -;#dump: Enable or disable the PVT internal binary data file logging [true] or [false] PVT.dump=false -;#dump_filename: Log path and filename without extension. Notice that PVT will add ".dat" to the binary dump and ".kml" to GoogleEarth dump. PVT.dump_filename=./PVT diff --git a/conf/gnss-sdr_multisource_Hybrid_ishort.conf b/conf/gnss-sdr_multisource_Hybrid_ishort.conf index 3aa7f840b..60f03431b 100644 --- a/conf/gnss-sdr_multisource_Hybrid_ishort.conf +++ b/conf/gnss-sdr_multisource_Hybrid_ishort.conf @@ -1,4 +1,6 @@ -; Default configuration file +; This is a GNSS-SDR configuration file +; The configuration API is described at http://gnss-sdr.org/docs/sp-blocks/ + ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; @@ -11,260 +13,73 @@ GNSS-SDR.internal_fs_sps=4000000 Receiver.sources_count=2 -;#enable_throttle_control: Enabling this option tells the signal source to keep the delay between samples in post processing. -; it helps to not overload the CPU, but the processing time will be longer. SignalSource.enable_throttle_control=false -;#repeat: Repeat the processing file. SignalSource.repeat=false ;######### SIGNAL_SOURCE 0 CONFIG ############ SignalSource0.implementation=File_Signal_Source -;#filename: path to file with the captured GNSS signal samples to be processed SignalSource0.filename=/datalogger/signals/CTTC/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat ; <- PUT YOUR FILE HERE -;#item_type: Type and resolution for each of the signal samples. SignalSource0.item_type=ishort -;#sampling_frequency: Original Signal sampling frequency in samples per second SignalSource0.sampling_frequency=4000000 -;#samples: Number of samples to be processed. Notice that 0 indicates the entire file. SignalSource0.samples=0 ;######### SIGNAL_SOURCE 1 CONFIG ############ SignalSource1.implementation=File_Signal_Source -;#filename: path to file with the captured GNSS signal samples to be processed SignalSource1.filename=/datalogger/signals/CTTC/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat ; <- PUT YOUR FILE HERE -;#item_type: Type and resolution for each of the signal samples. SignalSource1.item_type=ishort -;#sampling_frequency: Original Signal sampling frequency in [Hz] SignalSource1.sampling_frequency=4000000 -;#freq: RF front-end center frequency in [Hz] SignalSource1.freq=1575420000 -;#samples: Number of samples to be processed. Notice that 0 indicates the entire file. SignalSource1.samples=0 ;######### SIGNAL_CONDITIONER 0 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. - -;#implementation: Use [Pass_Through] or [Signal_Conditioner] -;#[Pass_Through] disables this block and the [DataTypeAdapter], [InputFilter] and [Resampler] blocks -;#[Signal_Conditioner] enables this block. Then you have to configure [DataTypeAdapter], [InputFilter] and [Resampler] blocks SignalConditioner0.implementation=Signal_Conditioner ;######### DATA_TYPE_ADAPTER 0 CONFIG ############ -;## Changes the type of input data. -;#implementation: [Pass_Through] disables this block DataTypeAdapter0.implementation=Ishort_To_Complex ;######### INPUT_FILTER 0 CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter] -;#[Pass_Through] disables this block -;#[Fir_Filter] enables a FIR Filter -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation that shifts IF down to zero Hz. - InputFilter0.implementation=Pass_Through - -;#dump: Dump the filtered data to a file. InputFilter0.dump=false - -;#dump_filename: Log path and filename. InputFilter0.dump_filename=../data/input_filter.dat - -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of GNU Radio's function: gr_remez. -;;#This function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, -;#the desired response on those bands, and the weight given to the error in those bands. - -;#input_item_type: Type and resolution for input signal samples. InputFilter0.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter0.output_item_type=gr_complex -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. -InputFilter0.taps_item_type=float -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time -InputFilter0.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. -InputFilter0.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - -InputFilter0.band1_begin=0.0 -InputFilter0.band1_end=0.45 -InputFilter0.band2_begin=0.55 -InputFilter0.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - -InputFilter0.ampl1_begin=1.0 -InputFilter0.ampl1_end=1.0 -InputFilter0.ampl2_begin=0.0 -InputFilter0.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands -InputFilter0.band1_error=1.0 -InputFilter0.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" -InputFilter0.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. -InputFilter0.grid_density=16 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. -;#InputFilter0.IF is the intermediate frequency (in Hz) shifted down to zero Hz - -InputFilter0.sampling_frequency=4000000 -InputFilter0.IF=0 ;######### RESAMPLER 1 CONFIG ############ -;## Resamples the input data. - -;#implementation: Use [Pass_Through] or [Direct_Resampler] -;#[Pass_Through] disables this block -;#[Direct_Resampler] enables a resampler that implements a nearest neighborhood interpolation - Resampler1.implementation=Pass_Through - -;#dump: Dump the resampled data to a file. Resampler1.dump=false -;#dump_filename: Log path and filename. Resampler1.dump_filename=../data/resampler.dat - -;#item_type: Type and resolution for each of the signal samples. Resampler1.item_type=gr_complex - -;#sample_freq_in: the sample frequency of the input signal Resampler1.sample_freq_in=4000000 - -;#sample_freq_out: the desired sample frequency of the output signal Resampler1.sample_freq_out=4000000 ;######### SIGNAL_CONDITIONER 1 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. - -;#implementation: Use [Pass_Through] or [Signal_Conditioner] -;#[Pass_Through] disables this block and the [DataTypeAdapter], [InputFilter] and [Resampler] blocks -;#[Signal_Conditioner] enables this block. Then you have to configure [DataTypeAdapter], [InputFilter] and [Resampler] blocks SignalConditioner1.implementation=Signal_Conditioner ;######### DATA_TYPE_ADAPTER 1 CONFIG ############ -;## Changes the type of input data. -;#implementation: [Pass_Through] disables this block DataTypeAdapter1.implementation=Ishort_To_Complex ;######### INPUT_FILTER 1 CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter] -;#[Pass_Through] disables this block -;#[Fir_Filter] enables a FIR Filter -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation that shifts IF down to zero Hz. - InputFilter1.implementation=Pass_Through - -;#dump: Dump the filtered data to a file. InputFilter1.dump=false -;#dump_filename: Log path and filename. -InputFilter1.dump_filename=../data/input_filter.dat - -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of GNU Radio's function: gr_remez. -;#This function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, -;#the desired response on those bands, and the weight given to the error in those bands. - -;#input_item_type: Type and resolution for input signal samples. -InputFilter1.input_item_type=gr_complex - -;#outut_item_type: Type and resolution for output filtered signal samples. -InputFilter1.output_item_type=gr_complex - -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. -InputFilter1.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time -InputFilter1.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. -InputFilter1.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - -InputFilter1.band1_begin=0.0 -InputFilter1.band1_end=0.45 -InputFilter1.band2_begin=0.55 -InputFilter1.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - -InputFilter1.ampl1_begin=1.0 -InputFilter1.ampl1_end=1.0 -InputFilter1.ampl2_begin=0.0 -InputFilter1.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands -InputFilter1.band1_error=1.0 -InputFilter1.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" -InputFilter1.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. -InputFilter1.grid_density=16 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. -;#InputFilter1.IF is the intermediate frequency (in Hz) shifted down to zero Hz - -InputFilter1.sampling_frequency=4000000 -InputFilter1.IF=0 ;######### RESAMPLER 1 CONFIG ############ -;## Resamples the input data. - -;#implementation: Use [Pass_Through] or [Direct_Resampler] -;#[Pass_Through] disables this block -;#[Direct_Resampler] enables a resampler that implements a nearest neighborhood interpolation - Resampler1.implementation=Pass_Through - -;#dump: Dump the resampled data to a file. Resampler1.dump=false -;#dump_filename: Log path and filename. -Resampler1.dump_filename=../data/resampler.dat - -;#item_type: Type and resolution for each of the signal samples. +Resampler1.dump_filename=../data/resampler.dat. Resampler1.item_type=gr_complex - -;#sample_freq_in: the sample frequency of the input signal Resampler1.sample_freq_in=4000000 - -;#sample_freq_out: the desired sample frequency of the output signal Resampler1.sample_freq_out=4000000 ;######### CHANNELS GLOBAL CONFIG ############ -;#count: Number of available GPS satellite channels. Channels_1C.count=2 -;#count: Number of available Galileo satellite channels. Channels_1B.count=2 -;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver Channels.in_acquisition=1 @@ -280,120 +95,73 @@ Channel.signal=1B ;######### GPS ACQUISITION CONFIG ############ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition -;#item_type: Type and resolution for each of the signal samples. Acquisition_1C.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1C.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] -Acquisition_1C.sampled_ms=1 -;#threshold: Acquisition threshold +Acquisition_1C.coherent_integration_time_ms=1 Acquisition_1C.threshold=0.0075 -;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition] ;Acquisition_1C.pfa=0.01 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1C.doppler_max=10000 -;#doppler_max: Doppler step in the grid search [Hz] Acquisition_1C.doppler_step=500 -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] Acquisition_1C.dump=false -;#filename: Log path and filename Acquisition_1C.dump_filename=./acq_dump.dat ;######### GALILEO ACQUISITION CONFIG ############ Acquisition_1B.implementation=Galileo_E1_PCPS_Ambiguous_Acquisition -;#item_type: Type and resolution for each of the signal samples. Acquisition_1B.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1B.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] -Acquisition_1B.sampled_ms=4 -;#threshold: Acquisition threshold +Acquisition_1B.coherent_integration_time_ms=4 ;Acquisition_1B.threshold=0 -;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition] Acquisition_1B.pfa=0.0000008 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1B.doppler_max=15000 -;#doppler_max: Doppler step in the grid search [Hz] Acquisition_1B.doppler_step=125 -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] Acquisition_1B.dump=false -;#filename: Log path and filename Acquisition_1B.dump_filename=./acq_dump.dat ;######### TRACKING GPS CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_1C.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] -Tracking_1C.if=0 -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1C.pll_bw_hz=45.0; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] Tracking_1C.dll_bw_hz=4.0; -;#order: PLL/DLL loop filter order [2] or [3] Tracking_1C.order=3; -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] Tracking_1C.dump=false -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. Tracking_1C.dump_filename=../data/epl_tracking_ch_ ;######### TRACKING GALILEO CONFIG ############ Tracking_1B.implementation=Galileo_E1_DLL_PLL_VEML_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_1B.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] -Tracking_1B.if=0 -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1B.pll_bw_hz=15.0; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] Tracking_1B.dll_bw_hz=2.0; -;#order: PLL/DLL loop filter order [2] or [3] Tracking_1B.order=3; -;#early_late_space_chips: correlator early-late space [chips]. Use [0.5] for GPS and [0.15] for Galileo Tracking_1B.early_late_space_chips=0.15; -;#very_early_late_space_chips: only for [Galileo_E1_DLL_PLL_VEML_Tracking], correlator very early-late space [chips]. Use [0.6] Tracking_1B.very_early_late_space_chips=0.6; -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] Tracking_1B.dump=false -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. Tracking_1B.dump_filename=../data/veml_tracking_ch_ ;######### TELEMETRY DECODER GPS CONFIG ############ -;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L1 C/A TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder TelemetryDecoder_1C.dump=false ;######### TELEMETRY DECODER GALILEO CONFIG ############ -;#implementation: Use [Galileo_E1B_Telemetry_Decoder] for Galileo E1B TelemetryDecoder_1B.implementation=Galileo_E1B_Telemetry_Decoder TelemetryDecoder_1B.dump=false ;######### OBSERVABLES CONFIG ############ -;#implementation: Observables.implementation=Hybrid_Observables -;#dump: Enable or disable the Observables internal binary data file logging [true] or [false] Observables.dump=false -;#dump_filename: Log path and filename. Observables.dump_filename=./observables.dat ;######### PVT CONFIG ############ -;#implementation: Position Velocity and Time (PVT) implementation: PVT.implementation=RTKLIB_PVT -;#output_rate_ms: Period between two PVT outputs. Notice that the minimum period is equal to the tracking integration time (for GPS CA L1 is 1ms) [ms] +PVT.positioning_mode=Single ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic PVT.output_rate_ms=100; -;#display_rate_ms: Position console print (std::out) interval [ms]. Notice that output_rate_ms<=display_rate_ms. PVT.display_rate_ms=500; PVT.flag_rtcm_server=false PVT.flag_rtcm_tty_port=false PVT.rtcm_dump_devname=/dev/pts/1 -;#dump_filename: Log path and filename without extension. Notice that PVT will add ".dat" to the binary dump and ".kml" to GoogleEarth dump. PVT.dump_filename=./PVT -;#dump: Enable or disable the PVT internal binary data file logging [true] or [false] PVT.dump=false diff --git a/conf/gnss-sdr_multisource_Hybrid_nsr.conf b/conf/gnss-sdr_multisource_Hybrid_nsr.conf index 5a543018e..8c035713e 100644 --- a/conf/gnss-sdr_multisource_Hybrid_nsr.conf +++ b/conf/gnss-sdr_multisource_Hybrid_nsr.conf @@ -14,250 +14,102 @@ GNSS-SDR.internal_fs_sps=2560000 ;GNSS-SDR.internal_fs_sps=4096000 ;GNSS-SDR.internal_fs_sps=5120000 -;#enable_throttle_control: Enabling this option tells the signal source to keep the delay between samples in post processing. -; it helps to not overload the CPU, but the processing time will be longer. SignalSource.enable_throttle_control=false -;#repeat: Repeat the processing file. SignalSource.repeat=false ;######### SIGNAL_SOURCE 0 CONFIG ############ -;#implementation SignalSource0.implementation=Nsr_File_Signal_Source -;#filename: path to file with the captured GNSS signal samples to be processed SignalSource0.filename=/datalogger/signals/ifen/E1L1_FE0_Band0.stream ; <- PUT YOUR FILE HERE -;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version. SignalSource0.item_type=byte -;#sampling_frequency: Original Signal sampling frequency in samples per second SignalSource0.sampling_frequency=20480000 -;#samples: Number of samples to be processed. Notice that 0 indicates the entire file. SignalSource0.samples=0 ;######### SIGNAL_SOURCE 1 CONFIG ############ -;#implementation: Use [File_Signal_Source] [Nsr_File_Signal_Source] or [UHD_Signal_Source] or [GN3S_Signal_Source] (experimental) SignalSource1.implementation=Nsr_File_Signal_Source -;#filename: path to file with the captured GNSS signal samples to be processed SignalSource1.filename=/datalogger/signals/ifen/E1L1_FE0_Band0.stream -;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version. SignalSource1.item_type=byte -;#sampling_frequency: Original Signal sampling frequency in samples per second SignalSource1.sampling_frequency=20480000 -;#samples: Number of samples to be processed. Notice that 0 indicates the entire file. SignalSource1.samples=0 ;######### SIGNAL_CONDITIONER 0 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. - -;#implementation: Use [Pass_Through] or [Signal_Conditioner] -;#[Pass_Through] disables this block and the [DataTypeAdapter], [InputFilter] and [Resampler] blocks -;#[Signal_Conditioner] enables this block. Then you have to configure [DataTypeAdapter], [InputFilter] and [Resampler] blocks SignalConditioner0.implementation=Signal_Conditioner ;######### DATA_TYPE_ADAPTER 0 CONFIG ############ -;## Changes the type of input data. -;#implementation: [Pass_Through] disables this block DataTypeAdapter0.implementation=Pass_Through DataTypeAdapter0.item_type=float ;######### INPUT_FILTER 0 CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter] -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation -;# that shifts IF down to zero Hz. - InputFilter0.implementation=Freq_Xlating_Fir_Filter - -;#dump: Dump the filtered data to a file. InputFilter0.dump=false - -;#dump_filename: Log path and filename. InputFilter0.dump_filename=../data/input_filter.dat - -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of gnuradio's function: gr_remez. -;#This function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, -;#the desired response on those bands, and the weight given to the error in those bands. - -;#input_item_type: Type and resolution for input signal samples. InputFilter0.input_item_type=float - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter0.output_item_type=gr_complex - -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. InputFilter0.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time InputFilter0.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. InputFilter0.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - InputFilter0.band1_begin=0.0 InputFilter0.band1_end=0.45 InputFilter0.band2_begin=0.55 InputFilter0.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - InputFilter0.ampl1_begin=1.0 InputFilter0.ampl1_end=1.0 InputFilter0.ampl2_begin=0.0 InputFilter0.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands InputFilter0.band1_error=1.0 InputFilter0.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" InputFilter0.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. InputFilter0.grid_density=16 - -;# Original sampling frequency stored in the signal file InputFilter0.sampling_frequency=20480000 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. -;#InputFilter0.IF is the intermediate frequency (in Hz) shifted down to zero Hz - InputFilter0.IF=5499998.47412109 - -;# Decimation factor after the frequency tranaslating block InputFilter0.decimation_factor=8 ;######### RESAMPLER CONFIG 0 ############ -;## Resamples the input data. - -;#implementation: Use [Pass_Through] or [Direct_Resampler] -;#[Pass_Through] disables this block -;#[Direct_Resampler] enables a resampler that implements a nearest neigbourhood interpolation Resampler0.implementation=Pass_Through ;######### SIGNAL_CONDITIONER 1 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. - -;#implementation: Use [Pass_Through] or [Signal_Conditioner] -;#[Pass_Through] disables this block and the [DataTypeAdapter], [InputFilter] and [Resampler] blocks -;#[Signal_Conditioner] enables this block. Then you have to configure [DataTypeAdapter], [InputFilter] and [Resampler] blocks SignalConditioner1.implementation=Signal_Conditioner ;######### DATA_TYPE_ADAPTER 1 CONFIG ############ -;## Changes the type of input data. -;#implementation: [Pass_Through] disables this block DataTypeAdapter1.implementation=Pass_Through DataTypeAdapter1.item_type=float ;######### INPUT_FILTER 1 CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter] -;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation -;# that shifts IF down to zero Hz. - InputFilter1.implementation=Freq_Xlating_Fir_Filter - -;#dump: Dump the filtered data to a file. InputFilter1.dump=false - -;#dump_filename: Log path and filename. InputFilter1.dump_filename=../data/input_filter.dat - -;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. -;#These options are based on parameters of gnuradio's function: gr_remez. -;#This function calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, -;#the desired response on those bands, and the weight given to the error in those bands. - -;#input_item_type: Type and resolution for input signal samples. InputFilter1.input_item_type=float - -;#outut_item_type: Type and resolution for output filtered signal samples. InputFilter1.output_item_type=gr_complex - -;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version. InputFilter1.taps_item_type=float - -;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time InputFilter1.number_of_taps=5 - -;#number_of _bands: Number of frequency bands in the filter. InputFilter1.number_of_bands=2 - -;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]. -;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2) -;#The number of band_begin and band_end elements must match the number of bands - InputFilter1.band1_begin=0.0 InputFilter1.band1_end=0.45 InputFilter1.band2_begin=0.55 InputFilter1.band2_end=1.0 - -;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]. -;#The number of ampl_begin and ampl_end elements must match the number of bands - InputFilter1.ampl1_begin=1.0 InputFilter1.ampl1_end=1.0 InputFilter1.ampl2_begin=0.0 InputFilter1.ampl2_end=0.0 - -;#band_error: weighting applied to each band (usually 1). -;#The number of band_error elements must match the number of bands InputFilter1.band1_error=1.0 InputFilter1.band2_error=1.0 - -;#filter_type: one of "bandpass", "hilbert" or "differentiator" InputFilter1.filter_type=bandpass - -;#grid_density: determines how accurately the filter will be constructed. -;The minimum value is 16; higher values are slower to compute the filter. InputFilter1.grid_density=16 - -;# Original sampling frequency stored in the signal file InputFilter1.sampling_frequency=20480000 - -;#The following options are used only in Freq_Xlating_Fir_Filter implementation. -;#InputFilter1.IF is the intermediate frequency (in Hz) shifted down to zero Hz - InputFilter1.IF=5499998.47412109 - -;# Decimation factor after the frequency tranaslating block InputFilter1.decimation_factor=8 ;######### RESAMPLER CONFIG 1 ############ -;## Resamples the input data. - -;#implementation: Use [Pass_Through] or [Direct_Resampler] -;#[Pass_Through] disables this block -;#[Direct_Resampler] enables a resampler that implements a nearest neigbourhood interpolation Resampler1.implementation=Pass_Through ;######### CHANNELS GLOBAL CONFIG ############ -;#count: Number of available GPS satellite channels. Channels_1C.count=8 -;#count: Number of available Galileo satellite channels. Channels_1B.count=8 -;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver Channels.in_acquisition=1 -;#signal: -;# "1C" GPS L1 C/A -;# "1B" GALILEO E1 B (I/NAV OS/CS/SoL) -;# "1G" GLONASS L1 C/A -;# "2S" GPS L2 L2C (M) -;# "5X" GALILEO E5a I+Q -;# "L5" GPS L5 - ;# SOURCE CONNECTION Channel0.RF_channel_ID=0 Channel1.RF_channel_ID=0 @@ -299,117 +151,77 @@ Channel15.signal=1B ;######### GPS ACQUISITION CONFIG ############ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition -;#item_type: Type and resolution for each of the signal samples. Acquisition_1C.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1C.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] -Acquisition_1C.sampled_ms=1 -;#threshold: Acquisition threshold +Acquisition_1C.scoherent_integration_time_ms=1 Acquisition_1C.threshold=0.0075 -;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition] ;Acquisition_1C.pfa=0.01 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1C.doppler_max=10000 -;#doppler_max: Doppler step in the grid search [Hz] Acquisition_1C.doppler_step=500 -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] Acquisition_1C.dump=false -;#filename: Log path and filename Acquisition_1C.dump_filename=./acq_dump.dat ;######### GALILEO ACQUISITION CONFIG ############ Acquisition_1B.implementation=Galileo_E1_PCPS_Ambiguous_Acquisition -;#item_type: Type and resolution for each of the signal samples. Acquisition_1B.item_type=gr_complex -;#if: Signal intermediate frequency in [Hz] -Acquisition_1B.if=0 -;#sampled_ms: Signal block duration for the acquisition signal detection [ms] -Acquisition_1B.sampled_ms=4 -;#threshold: Acquisition threshold +Acquisition_1B.coherent_integration_time_ms=4 ;Acquisition_1B.threshold=0 -;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition] Acquisition_1B.pfa=0.0000002 -;#doppler_max: Maximum expected Doppler shift [Hz] Acquisition_1B.doppler_max=15000 -;#doppler_max: Doppler step in the grid search [Hz] Acquisition_1B.doppler_step=125 -;#dump: Enable or disable the acquisition internal data file logging [true] or [false] Acquisition_1B.dump=false -;#filename: Log path and filename Acquisition_1B.dump_filename=./acq_dump.dat ;######### TRACKING GPS CONFIG ############ Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_1C.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] -Tracking_1C.if=0 -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1C.pll_bw_hz=45.0; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] Tracking_1C.dll_bw_hz=2.0; -;#order: PLL/DLL loop filter order [2] or [3] Tracking_1C.order=3; -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] Tracking_1C.dump=false -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. Tracking_1C.dump_filename=../data/epl_tracking_ch_ ;######### TRACKING GALILEO CONFIG ############ Tracking_1B.implementation=Galileo_E1_DLL_PLL_VEML_Tracking -;#item_type: Type and resolution for each of the signal samples. Tracking_1B.item_type=gr_complex -;#sampling_frequency: Signal Intermediate Frequency in [Hz] -Tracking_1B.if=0 -;#pll_bw_hz: PLL loop filter bandwidth [Hz] Tracking_1B.pll_bw_hz=15.0; -;#dll_bw_hz: DLL loop filter bandwidth [Hz] Tracking_1B.dll_bw_hz=2.0; -;#order: PLL/DLL loop filter order [2] or [3] Tracking_1B.order=3; -;#early_late_space_chips: correlator early-late space [chips]. Use [0.5] for GPS and [0.15] for Galileo Tracking_1B.early_late_space_chips=0.15; -;#very_early_late_space_chips: only for [Galileo_E1_DLL_PLL_VEML_Tracking], correlator very early-late space [chips]. Use [0.6] Tracking_1B.very_early_late_space_chips=0.6; -;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] Tracking_1B.dump=false -;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. Tracking_1B.dump_filename=../data/veml_tracking_ch_ ;######### TELEMETRY DECODER GPS CONFIG ############ -;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L1 C/A TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder TelemetryDecoder_1C.dump=false ;######### TELEMETRY DECODER GALILEO CONFIG ############ -;#implementation: Use [Galileo_E1B_Telemetry_Decoder] for Galileo E1B TelemetryDecoder_1B.implementation=Galileo_E1B_Telemetry_Decoder ;######### OBSERVABLES CONFIG ############ Observables.implementation=Hybrid_Observables -;#dump: Enable or disable the Observables internal binary data file logging [true] or [false] Observables.dump=false -;#dump_filename: Log path and filename. Observables.dump_filename=./observables.dat ;######### PVT CONFIG ############ PVT.implementation=RTKLIB_PVT -;#output_rate_ms: Period between two PVT outputs. Notice that the minimum period is equal to the tracking integration time (for GPS CA L1 is 1ms) [ms] -PVT.output_rate_ms=10; -;#display_rate_ms: Position console print (std::out) interval [ms]. Notice that output_rate_ms<=display_rate_ms. -PVT.display_rate_ms=500; +PVT.positioning_mode=Single ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic +PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX +PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad +PVT.output_rate_ms=100 +PVT.display_rate_ms=500 +PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea; +PVT.flag_nmea_tty_port=true; +PVT.nmea_dump_devname=/dev/pts/4 PVT.flag_rtcm_server=false PVT.flag_rtcm_tty_port=false PVT.rtcm_dump_devname=/dev/pts/1 -;#dump_filename: Log path and filename without extension. Notice that PVT will add ".dat" to the binary dump and ".kml" to GoogleEarth dump. -PVT.dump_filename=./PVT -;#dump: Enable or disable the PVT internal binary data file logging [true] or [false] PVT.dump=false +PVT.dump_filename=./PVT From 9e35ae223960acc0d3ff4006ca52f455c17cbe96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Cebri=C3=A1n=20Juan?= Date: Sat, 5 May 2018 07:44:20 +0200 Subject: [PATCH 77/82] Add GPS Exchange Format (GPX) output writer class --- src/algorithms/PVT/libs/gpx_printer.cc | 176 +++++++++++++++++++++++++ src/algorithms/PVT/libs/gpx_printer.h | 62 +++++++++ 2 files changed, 238 insertions(+) create mode 100644 src/algorithms/PVT/libs/gpx_printer.cc create mode 100644 src/algorithms/PVT/libs/gpx_printer.h diff --git a/src/algorithms/PVT/libs/gpx_printer.cc b/src/algorithms/PVT/libs/gpx_printer.cc new file mode 100644 index 000000000..2960e6e7c --- /dev/null +++ b/src/algorithms/PVT/libs/gpx_printer.cc @@ -0,0 +1,176 @@ +/*! + * \file gpx_printer.cc + * \brief Interface of a class that prints PVT information to a gpx file + * \author Álvaro Cebrián Juan, 2018. acebrianjuan(at)gmail.com + * + * + * ------------------------------------------------------------------------- + * + * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) + * + * GNSS-SDR is a software defined Global Navigation + * Satellite Systems receiver + * + * This file is part of GNSS-SDR. + * + * GNSS-SDR is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GNSS-SDR is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNSS-SDR. If not, see . + * + * ------------------------------------------------------------------------- + */ + + +#include "gpx_printer.h" +#include +#include +#include + +using google::LogMessage; + +bool Gpx_Printer::set_headers(std::string filename, bool time_tag_name) +{ + boost::posix_time::ptime pt = boost::posix_time::second_clock::local_time(); + tm timeinfo = boost::posix_time::to_tm(pt); + + if (time_tag_name) + { + std::stringstream strm0; + const int year = timeinfo.tm_year - 100; + strm0 << year; + const int month = timeinfo.tm_mon + 1; + if (month < 10) + { + strm0 << "0"; + } + strm0 << month; + const int day = timeinfo.tm_mday; + if (day < 10) + { + strm0 << "0"; + } + strm0 << day << "_"; + const int hour = timeinfo.tm_hour; + if (hour < 10) + { + strm0 << "0"; + } + strm0 << hour; + const int min = timeinfo.tm_min; + if (min < 10) + { + strm0 << "0"; + } + strm0 << min; + const int sec = timeinfo.tm_sec; + if (sec < 10) + { + strm0 << "0"; + } + strm0 << sec; + + gpx_filename = filename + "_" + strm0.str() + ".gpx"; + } + else + { + gpx_filename = filename + ".gpx"; + } + gpx_file.open(gpx_filename.c_str()); + + if (gpx_file.is_open()) + { + DLOG(INFO) << "GPX printer writing on " << filename.c_str(); + // Set iostream numeric format and precision + gpx_file.setf(gpx_file.fixed, gpx_file.floatfield); + gpx_file << std::setprecision(14); + gpx_file << "" << std::endl + << "" << std::endl + << "" << std::endl + << "" << std::endl; + return true; + } + else + { + return false; + } +} + + +bool Gpx_Printer::print_position(const std::shared_ptr& position, bool print_average_values) +{ + double latitude; + double longitude; + double height; + + positions_printed = true; + + std::shared_ptr position_ = position; + + if (print_average_values == false) + { + latitude = position_->get_latitude(); + longitude = position_->get_longitude(); + height = position_->get_height(); + } + else + { + latitude = position_->get_avg_latitude(); + longitude = position_->get_avg_longitude(); + height = position_->get_avg_height(); + } + + if (gpx_file.is_open()) + { + gpx_file << "" << height << "" << std::endl; + return true; + } + else + { + return false; + } +} + + +bool Gpx_Printer::close_file() +{ + if (gpx_file.is_open()) + { + gpx_file << "" << std::endl + << "" << std::endl + << ""; + gpx_file.close(); + return true; + } + else + { + return false; + } +} + + +Gpx_Printer::Gpx_Printer() +{ + positions_printed = false; +} + + +Gpx_Printer::~Gpx_Printer() +{ + close_file(); + if (!positions_printed) + { + if (remove(gpx_filename.c_str()) != 0) LOG(INFO) << "Error deleting temporary GPX file"; + } +} diff --git a/src/algorithms/PVT/libs/gpx_printer.h b/src/algorithms/PVT/libs/gpx_printer.h new file mode 100644 index 000000000..f7415cf71 --- /dev/null +++ b/src/algorithms/PVT/libs/gpx_printer.h @@ -0,0 +1,62 @@ +/*! + * \file gpx_printer.h + * \brief Interface of a class that prints PVT information to a gpx file + * \author Álvaro Cebrián Juan, 2018. acebrianjuan(at)gmail.com + * + * + * ------------------------------------------------------------------------- + * + * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) + * + * GNSS-SDR is a software defined Global Navigation + * Satellite Systems receiver + * + * This file is part of GNSS-SDR. + * + * GNSS-SDR is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GNSS-SDR is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNSS-SDR. If not, see . + * + * ------------------------------------------------------------------------- + */ + + +#ifndef GNSS_SDR_GPX_PRINTER_H_ +#define GNSS_SDR_GPX_PRINTER_H_ + +#include "pvt_solution.h" +#include +#include +#include + + +/*! + * \brief Prints PVT information to GPX format file + * + * See http://www.topografix.com/gpx.asp + */ +class Gpx_Printer +{ +private: + std::ofstream gpx_file; + bool positions_printed; + std::string gpx_filename; + +public: + Gpx_Printer(); + ~Gpx_Printer(); + bool set_headers(std::string filename, bool time_tag_name = true); + bool print_position(const std::shared_ptr& position, bool print_average_values); + bool close_file(); +}; + +#endif From 460dc217040dd3f4375b3138b4a9d19ce0c3fb26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Cebri=C3=A1n=20Juan?= Date: Sat, 5 May 2018 07:46:04 +0200 Subject: [PATCH 78/82] Add gpx_printer.cc to CMakeLists --- src/algorithms/PVT/libs/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/algorithms/PVT/libs/CMakeLists.txt b/src/algorithms/PVT/libs/CMakeLists.txt index 96aace272..ebf9d6041 100644 --- a/src/algorithms/PVT/libs/CMakeLists.txt +++ b/src/algorithms/PVT/libs/CMakeLists.txt @@ -23,6 +23,7 @@ set(PVT_LIB_SOURCES ls_pvt.cc hybrid_ls_pvt.cc kml_printer.cc + gpx_printer.cc rinex_printer.cc nmea_printer.cc rtcm_printer.cc From f1a77dfb1fa4d833c35dc631de491ea5a84a22ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Cebri=C3=A1n=20Juan?= Date: Sat, 5 May 2018 07:47:42 +0200 Subject: [PATCH 79/82] Initialize gpx printer in RTKLIB_PVT block --- src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc | 7 +++++++ src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index 91267e33d..18248ea05 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -261,6 +261,12 @@ rtklib_pvt_cc::rtklib_pvt_cc(unsigned int nchannels, bool dump, std::string dump d_kml_dump = std::make_shared(); d_kml_dump->set_headers(kml_dump_filename); + //initialize gpx_printer + std::string gpx_dump_filename; + gpx_dump_filename = d_dump_filename; + d_gpx_dump = std::make_shared(); + d_gpx_dump->set_headers(gpx_dump_filename); + //initialize geojson_printer std::string geojson_dump_filename; geojson_dump_filename = d_dump_filename; @@ -678,6 +684,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item first_fix = false; } d_kml_dump->print_position(d_ls_pvt, false); + d_gpx_dump->print_position(d_ls_pvt, false); d_geojson_printer->print_position(d_ls_pvt, false); d_nmea_printer->Print_Nmea_Line(d_ls_pvt, false); diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h index f4e4323fd..70333a7eb 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h @@ -34,6 +34,7 @@ #include "nmea_printer.h" #include "kml_printer.h" +#include "gpx_printer.h" #include "geojson_printer.h" #include "rinex_printer.h" #include "rtcm_printer.h" @@ -120,6 +121,7 @@ private: std::shared_ptr rp; std::shared_ptr d_kml_dump; + std::shared_ptr d_gpx_dump; std::shared_ptr d_nmea_printer; std::shared_ptr d_geojson_printer; std::shared_ptr d_rtcm_printer; From 3bc6ce4f758bd24390d0712877e932a43a8e2783 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 5 May 2018 12:50:00 +0200 Subject: [PATCH 80/82] Fix warnings --- src/core/receiver/gnss_flowgraph.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index c12c126ae..28fd703c9 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -335,7 +335,7 @@ void GNSSFlowgraph::connect() } #endif // Signal conditioner (selected_signal_source) >> channels (i) (dependent of their associated SignalSource_ID) - int selected_signal_conditioner_ID; + int selected_signal_conditioner_ID = 0; for (unsigned int i = 0; i < channels_count_; i++) { if (FPGA_enabled == false) @@ -538,9 +538,8 @@ void GNSSFlowgraph::disconnect() } } - bool FPGA_enabled = configuration_->property(sig_source_.at(0)->role() + ".enable_FPGA", false); - #if ENABLE_FPGA + bool FPGA_enabled = configuration_->property(sig_source_.at(0)->role() + ".enable_FPGA", false); if (FPGA_enabled == false) { // disconnect the signal source to sample counter From 632bceb653fa1988deddcd57a976ab0227aceb4c Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 7 May 2018 09:13:45 +0200 Subject: [PATCH 81/82] Fix DOP computation, print it in GPX and NMEA --- src/algorithms/PVT/libs/gpx_printer.cc | 21 +++-- src/algorithms/PVT/libs/gpx_printer.h | 4 +- src/algorithms/PVT/libs/hybrid_ls_pvt.cc | 3 - src/algorithms/PVT/libs/ls_pvt.cc | 2 +- src/algorithms/PVT/libs/nmea_printer.cc | 10 +-- src/algorithms/PVT/libs/nmea_printer.h | 6 +- src/algorithms/PVT/libs/pvt_solution.cc | 85 ------------------- src/algorithms/PVT/libs/pvt_solution.h | 17 ---- src/algorithms/PVT/libs/rtklib_solver.cc | 34 +++++++- src/algorithms/PVT/libs/rtklib_solver.h | 8 +- src/tests/CMakeLists.txt | 1 + .../pvt/nmea_printer_test.cc | 12 ++- 12 files changed, 77 insertions(+), 126 deletions(-) diff --git a/src/algorithms/PVT/libs/gpx_printer.cc b/src/algorithms/PVT/libs/gpx_printer.cc index 2960e6e7c..65dda1636 100644 --- a/src/algorithms/PVT/libs/gpx_printer.cc +++ b/src/algorithms/PVT/libs/gpx_printer.cc @@ -98,7 +98,9 @@ bool Gpx_Printer::set_headers(std::string filename, bool time_tag_name) << "xmlns=\"http://www.topografix.com/GPX/1/1\"" << std::endl << "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">" << std::endl << "" << std::endl - << "" << std::endl; + << indent << "Position fixes computed by GNSS-SDR v" << GNSS_SDR_VERSION << "" << std::endl + << indent << "GNSS-SDR position log generated at " << pt << " (local time)" << std::endl + << indent << "" << std::endl; return true; } else @@ -108,15 +110,21 @@ bool Gpx_Printer::set_headers(std::string filename, bool time_tag_name) } -bool Gpx_Printer::print_position(const std::shared_ptr& position, bool print_average_values) +bool Gpx_Printer::print_position(const std::shared_ptr& position, bool print_average_values) { double latitude; double longitude; double height; positions_printed = true; + std::shared_ptr position_ = position; - std::shared_ptr position_ = position; + double hdop = position_->get_hdop(); + double vdop = position_->get_vdop(); + double pdop = position_->get_pdop(); + std::string utc_time = to_iso_extended_string(position_->get_position_UTC_time()); + utc_time.resize(23); // time up to ms + utc_time.append("Z"); // UTC time zone if (print_average_values == false) { @@ -133,7 +141,9 @@ bool Gpx_Printer::print_position(const std::shared_ptr& position, if (gpx_file.is_open()) { - gpx_file << "" << height << "" << std::endl; + gpx_file << indent << indent << "" << height << "" + << "" + << "" << hdop << "" << vdop << "" << pdop << "" << std::endl; return true; } else @@ -147,7 +157,7 @@ bool Gpx_Printer::close_file() { if (gpx_file.is_open()) { - gpx_file << "" << std::endl + gpx_file << indent << "" << std::endl << "" << std::endl << ""; gpx_file.close(); @@ -163,6 +173,7 @@ bool Gpx_Printer::close_file() Gpx_Printer::Gpx_Printer() { positions_printed = false; + indent = " "; } diff --git a/src/algorithms/PVT/libs/gpx_printer.h b/src/algorithms/PVT/libs/gpx_printer.h index f7415cf71..347d95599 100644 --- a/src/algorithms/PVT/libs/gpx_printer.h +++ b/src/algorithms/PVT/libs/gpx_printer.h @@ -34,6 +34,7 @@ #define GNSS_SDR_GPX_PRINTER_H_ #include "pvt_solution.h" +#include "rtklib_solver.h" #include #include #include @@ -50,12 +51,13 @@ private: std::ofstream gpx_file; bool positions_printed; std::string gpx_filename; + std::string indent; public: Gpx_Printer(); ~Gpx_Printer(); bool set_headers(std::string filename, bool time_tag_name = true); - bool print_position(const std::shared_ptr& position, bool print_average_values); + bool print_position(const std::shared_ptr& position, bool print_average_values); bool close_file(); }; diff --git a/src/algorithms/PVT/libs/hybrid_ls_pvt.cc b/src/algorithms/PVT/libs/hybrid_ls_pvt.cc index 3197c1882..4644352e5 100644 --- a/src/algorithms/PVT/libs/hybrid_ls_pvt.cc +++ b/src/algorithms/PVT/libs/hybrid_ls_pvt.cc @@ -350,9 +350,6 @@ bool hybrid_ls_pvt::get_PVT(std::map gnss_observables_map, do << " [deg], Height= " << this->get_height() << " [m]" << " RX time offset= " << this->get_time_offset_s() << " [s]"; - // ###### Compute DOPs ######## - hybrid_ls_pvt::compute_DOP(); - // ######## LOG FILE ######### if (d_flag_dump_enabled == true) { diff --git a/src/algorithms/PVT/libs/ls_pvt.cc b/src/algorithms/PVT/libs/ls_pvt.cc index 27be29287..af4f1e812 100644 --- a/src/algorithms/PVT/libs/ls_pvt.cc +++ b/src/algorithms/PVT/libs/ls_pvt.cc @@ -281,7 +281,7 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat& satpos, const arma::vec& obs, } //-- compute the Dilution Of Precision values - this->set_Q(arma::inv(arma::htrans(A) * A)); + //this->set_Q(arma::inv(arma::htrans(A) * A)); // check the consistency of the PVT solution if (((fabs(pos(3)) * 1000.0) / GPS_C_m_s) > GPS_STARTOFFSET_ms * 2) diff --git a/src/algorithms/PVT/libs/nmea_printer.cc b/src/algorithms/PVT/libs/nmea_printer.cc index 305a89a07..ebff7b4ac 100644 --- a/src/algorithms/PVT/libs/nmea_printer.cc +++ b/src/algorithms/PVT/libs/nmea_printer.cc @@ -125,7 +125,7 @@ void Nmea_Printer::close_serial() } -bool Nmea_Printer::Print_Nmea_Line(const std::shared_ptr& pvt_data, bool print_average_values) +bool Nmea_Printer::Print_Nmea_Line(const std::shared_ptr& pvt_data, bool print_average_values) { std::string GPRMC; std::string GPGGA; @@ -432,9 +432,9 @@ std::string Nmea_Printer::get_GPGSA() // GSA-GNSS DOP and Active Satellites bool valid_fix = d_PVT_data->is_valid_position(); int n_sats_used = d_PVT_data->get_num_valid_observations(); - double pdop = d_PVT_data->get_PDOP(); - double hdop = d_PVT_data->get_HDOP(); - double vdop = d_PVT_data->get_VDOP(); + double pdop = d_PVT_data->get_pdop(); + double hdop = d_PVT_data->get_hdop(); + double vdop = d_PVT_data->get_vdop(); std::stringstream sentence_str; std::string sentence_header; @@ -603,7 +603,7 @@ std::string Nmea_Printer::get_GPGGA() //boost::posix_time::ptime d_position_UTC_time=boost::posix_time::microsec_clock::universal_time(); bool valid_fix = d_PVT_data->is_valid_position(); int n_channels = d_PVT_data->get_num_valid_observations(); //d_nchannels - double hdop = d_PVT_data->get_HDOP(); + double hdop = d_PVT_data->get_hdop(); double MSL_altitude; if (d_PVT_data->is_averaging() == true) diff --git a/src/algorithms/PVT/libs/nmea_printer.h b/src/algorithms/PVT/libs/nmea_printer.h index c1b671d1a..857301d1c 100644 --- a/src/algorithms/PVT/libs/nmea_printer.h +++ b/src/algorithms/PVT/libs/nmea_printer.h @@ -36,7 +36,7 @@ #ifndef GNSS_SDR_NMEA_PRINTER_H_ #define GNSS_SDR_NMEA_PRINTER_H_ -#include "pvt_solution.h" +#include "rtklib_solver.h" #include #include @@ -58,7 +58,7 @@ public: /*! * \brief Print NMEA PVT and satellite info to the initialized device */ - bool Print_Nmea_Line(const std::shared_ptr& position, bool print_average_values); + bool Print_Nmea_Line(const std::shared_ptr& position, bool print_average_values); /*! * \brief Default destructor. @@ -70,7 +70,7 @@ private: std::ofstream nmea_file_descriptor; // Output file stream for NMEA log file std::string nmea_devname; int nmea_dev_descriptor; // NMEA serial device descriptor (i.e. COM port) - std::shared_ptr d_PVT_data; + std::shared_ptr d_PVT_data; int init_serial(std::string serial_device); //serial port control void close_serial(); std::string get_GPGGA(); // fix data diff --git a/src/algorithms/PVT/libs/pvt_solution.cc b/src/algorithms/PVT/libs/pvt_solution.cc index e38da70f7..dbfd76f1c 100644 --- a/src/algorithms/PVT/libs/pvt_solution.cc +++ b/src/algorithms/PVT/libs/pvt_solution.cc @@ -46,11 +46,6 @@ Pvt_Solution::Pvt_Solution() d_avg_latitude_d = 0.0; d_avg_longitude_d = 0.0; d_avg_height_m = 0.0; - d_GDOP = 0.0; - d_PDOP = 0.0; - d_HDOP = 0.0; - d_VDOP = 0.0; - d_TDOP = 0.0; d_flag_averaging = false; b_valid_position = false; d_averaging_depth = 0; @@ -445,50 +440,6 @@ int Pvt_Solution::topocent(double *Az, double *El, double *D, const arma::vec &x } -int Pvt_Solution::compute_DOP() -{ - // ###### Compute DOPs ######## - - // 1- Rotation matrix from ECEF coordinates to ENU coordinates - // ref: http://www.navipedia.net/index.php/Transformations_between_ECEF_and_ENU_coordinates - arma::mat F = arma::zeros(3, 3); - F(0, 0) = -sin(GPS_TWO_PI * (d_longitude_d / 360.0)); - F(0, 1) = -sin(GPS_TWO_PI * (d_latitude_d / 360.0)) * cos(GPS_TWO_PI * (d_longitude_d / 360.0)); - F(0, 2) = cos(GPS_TWO_PI * (d_latitude_d / 360.0)) * cos(GPS_TWO_PI * (d_longitude_d / 360.0)); - - F(1, 0) = cos((GPS_TWO_PI * d_longitude_d) / 360.0); - F(1, 1) = -sin((GPS_TWO_PI * d_latitude_d) / 360.0) * sin((GPS_TWO_PI * d_longitude_d) / 360.0); - F(1, 2) = cos((GPS_TWO_PI * d_latitude_d / 360.0)) * sin((GPS_TWO_PI * d_longitude_d) / 360.0); - - F(2, 0) = 0; - F(2, 1) = cos((GPS_TWO_PI * d_latitude_d) / 360.0); - F(2, 2) = sin((GPS_TWO_PI * d_latitude_d / 360.0)); - - // 2- Apply the rotation to the latest covariance matrix (available in ECEF from LS) - arma::mat Q_ECEF = d_Q.submat(0, 0, 2, 2); - arma::mat DOP_ENU = arma::zeros(3, 3); - - try - { - DOP_ENU = arma::htrans(F) * Q_ECEF * F; - d_GDOP = sqrt(arma::trace(DOP_ENU)); // Geometric DOP - d_PDOP = sqrt(DOP_ENU(0, 0) + DOP_ENU(1, 1) + DOP_ENU(2, 2)); // PDOP - d_HDOP = sqrt(DOP_ENU(0, 0) + DOP_ENU(1, 1)); // HDOP - d_VDOP = sqrt(DOP_ENU(2, 2)); // VDOP - d_TDOP = sqrt(d_Q(3, 3)); // TDOP - } - catch (const std::exception &ex) - { - d_GDOP = -1; // Geometric DOP - d_PDOP = -1; // PDOP - d_HDOP = -1; // HDOP - d_VDOP = -1; // VDOP - d_TDOP = -1; // TDOP - } - return 0; -} - - void Pvt_Solution::set_averaging_depth(int depth) { d_averaging_depth = depth; @@ -824,39 +775,3 @@ double Pvt_Solution::get_visible_satellites_CN0_dB(size_t index) const return d_visible_satellites_CN0_dB[index]; } } - - -void Pvt_Solution::set_Q(const arma::mat &Q) -{ - d_Q = Q; -} - - -double Pvt_Solution::get_GDOP() const -{ - return d_GDOP; -} - - -double Pvt_Solution::get_PDOP() const -{ - return d_PDOP; -} - - -double Pvt_Solution::get_HDOP() const -{ - return d_HDOP; -} - - -double Pvt_Solution::get_VDOP() const -{ - return d_VDOP; -} - - -double Pvt_Solution::get_TDOP() const -{ - return d_TDOP; -} diff --git a/src/algorithms/PVT/libs/pvt_solution.h b/src/algorithms/PVT/libs/pvt_solution.h index e036b1547..c01e494a9 100644 --- a/src/algorithms/PVT/libs/pvt_solution.h +++ b/src/algorithms/PVT/libs/pvt_solution.h @@ -70,13 +70,6 @@ private: boost::posix_time::ptime d_position_UTC_time; int d_valid_observations; - arma::mat d_Q; - double d_GDOP; - double d_PDOP; - double d_HDOP; - double d_VDOP; - double d_TDOP; - int d_visible_satellites_IDs[PVT_MAX_CHANNELS] = {}; // Array with the IDs of the valid satellites double d_visible_satellites_El[PVT_MAX_CHANNELS] = {}; // Array with the LOS Elevation of the valid satellites double d_visible_satellites_Az[PVT_MAX_CHANNELS] = {}; // Array with the LOS Azimuth of the valid satellites @@ -130,16 +123,6 @@ public: bool is_averaging() const; void set_averaging_flag(bool flag); - // DOP estimations - void set_Q(const arma::mat &Q); - int compute_DOP(); //!< Compute Dilution Of Precision parameters - - double get_GDOP() const; - double get_PDOP() const; - double get_HDOP() const; - double get_VDOP() const; - double get_TDOP() const; - arma::vec rotateSatellite(double traveltime, const arma::vec &X_sat); /*! diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index 4dcee81a0..8dc81a90a 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -70,7 +70,7 @@ rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag count_valid_position = 0; this->set_averaging_flag(false); rtk_ = rtk; - + for (unsigned int i = 0; i > 4; i++) dop_[i] = 0.0; pvt_sol = {{0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, '0', '0', '0', 0, 0, 0}; // ############# ENABLE DATA FILE LOG ################# @@ -109,6 +109,30 @@ rtklib_solver::~rtklib_solver() } +double rtklib_solver::get_gdop() const +{ + return dop_[0]; +} + + +double rtklib_solver::get_pdop() const +{ + return dop_[1]; +} + + +double rtklib_solver::get_hdop() const +{ + return dop_[2]; +} + + +double rtklib_solver::get_vdop() const +{ + return dop_[3]; +} + + bool rtklib_solver::get_PVT(const std::map& gnss_observables_map, double Rx_time, bool flag_averaging) { std::map::const_iterator gnss_observables_iter; @@ -435,6 +459,14 @@ bool rtklib_solver::get_PVT(const std::map& gnss_observables_ { this->set_num_valid_observations(rtk_.sol.ns); //record the number of valid satellites used by the PVT solver pvt_sol = rtk_.sol; + // TODO: Reduce the number of satellites in DOP computation + double azel[MAXSAT * 2] = {0.0}; + for (unsigned int i = 0; i < MAXSAT; i++) + { + azel[2 * i] = rtk_.ssat[i].azel[0]; + azel[2 * i + 1] = rtk_.ssat[i].azel[1]; + } + dops(MAXSAT, azel, 0.0, dop_); this->set_valid_position(true); arma::vec rx_position_and_time(4); rx_position_and_time(0) = pvt_sol.rr[0]; diff --git a/src/algorithms/PVT/libs/rtklib_solver.h b/src/algorithms/PVT/libs/rtklib_solver.h index 3af8d2a76..ac180f617 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.h +++ b/src/algorithms/PVT/libs/rtklib_solver.h @@ -79,12 +79,18 @@ private: sol_t pvt_sol; bool d_flag_dump_enabled; int d_nchannels; // Number of available channels for positioning + double dop_[4]; + public: rtklib_solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, rtk_t& rtk); ~rtklib_solver(); bool get_PVT(const std::map& gnss_observables_map, double Rx_time, bool flag_averaging); - + double get_hdop() const; + double get_vdop() const; + double get_pdop() const; + double get_gdop() const; + std::map galileo_ephemeris_map; //!< Map storing new Galileo_Ephemeris std::map gps_ephemeris_map; //!< Map storing new GPS_Ephemeris std::map gps_cnav_ephemeris_map; //!< Map storing new GPS_CNAV_Ephemeris diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index c43b47a07..ff2d91ee8 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -308,6 +308,7 @@ include_directories( ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib ${CMAKE_SOURCE_DIR}/src/algorithms/data_type_adapter/adapters ${CMAKE_SOURCE_DIR}/src/algorithms/data_type_adapter/gnuradio_blocks ${CMAKE_SOURCE_DIR}/src/algorithms/resampler/adapters diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc index 0e260dd75..f259947e5 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc @@ -38,8 +38,10 @@ TEST(NmeaPrinterTest, PrintLine) { std::string filename("nmea_test.nmea"); - - std::shared_ptr pvt_solution = std::make_shared(); + rtk_t rtk; + prcopt_t rtklib_configuration_options; + rtkinit(&rtk, &rtklib_configuration_options); + std::shared_ptr pvt_solution = std::make_shared(12, "filename", false, rtk); boost::posix_time::ptime pt(boost::gregorian::date(1994, boost::date_time::Nov, 19), boost::posix_time::hours(22) + boost::posix_time::minutes(54) + boost::posix_time::seconds(46)); // example from http://aprs.gids.nl/nmea/#rmc @@ -77,8 +79,10 @@ TEST(NmeaPrinterTest, PrintLine) TEST(NmeaPrinterTest, PrintLineLessthan10min) { std::string filename("nmea_test.nmea"); - - std::shared_ptr pvt_solution = std::make_shared(); + rtk_t rtk; + prcopt_t rtklib_configuration_options; + rtkinit(&rtk, &rtklib_configuration_options); + std::shared_ptr pvt_solution = std::make_shared(12, "filename", false, rtk); boost::posix_time::ptime pt(boost::gregorian::date(1994, boost::date_time::Nov, 19), boost::posix_time::hours(22) + boost::posix_time::minutes(54) + boost::posix_time::seconds(46)); // example from http://aprs.gids.nl/nmea/#rmc From a23e6644ac6cb0837d5dd6a1a85f47a607c02003 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 7 May 2018 14:34:53 +0200 Subject: [PATCH 82/82] Fix DOP computation --- src/algorithms/PVT/libs/rtklib_solver.cc | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index 8dc81a90a..8d74aea20 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -459,14 +459,26 @@ bool rtklib_solver::get_PVT(const std::map& gnss_observables_ { this->set_num_valid_observations(rtk_.sol.ns); //record the number of valid satellites used by the PVT solver pvt_sol = rtk_.sol; - // TODO: Reduce the number of satellites in DOP computation - double azel[MAXSAT * 2] = {0.0}; + // DOP computation + unsigned int used_sats = 0; for (unsigned int i = 0; i < MAXSAT; i++) { - azel[2 * i] = rtk_.ssat[i].azel[0]; - azel[2 * i + 1] = rtk_.ssat[i].azel[1]; + if (int vsat = rtk_.ssat[i].vsat[0] == 1) used_sats++; } - dops(MAXSAT, azel, 0.0, dop_); + + double azel[used_sats * 2]; + unsigned int index_aux = 0; + for (unsigned int i = 0; i < MAXSAT; i++) + { + if (int vsat = rtk_.ssat[i].vsat[0] == 1) + { + azel[2 * index_aux] = rtk_.ssat[i].azel[0]; + azel[2 * index_aux + 1] = rtk_.ssat[i].azel[1]; + index_aux++; + } + } + if (index_aux > 0) dops(index_aux, azel, 0.0, dop_); + this->set_valid_position(true); arma::vec rx_position_and_time(4); rx_position_and_time(0) = pvt_sol.rr[0];