Merge branch 'next' of https://github.com/gnss-sdr/gnss-sdr into fpga

added second acquisition to reduce the time between acquisition and tracking when using the FPGA
moved the process of writing of the tracking local code to the HW accelerator from the start_tracking() function to the set_gnss_synchro() function (this is only applicable for the FPGA case)
there was a bug in the computation of the tracking starting position for the L1/E1 band when using the FPGA, only high sample counter values (>31 bits) were affected, due to a uint64_t*float mult.
This commit is contained in:
Marc Majoral 2019-03-22 19:03:46 +01:00
commit 2bae20d2fd
50 changed files with 797 additions and 361 deletions

View File

@ -408,8 +408,8 @@ set(GNSSSDR_MATIO_MIN_VERSION "1.5.3")
# Versions to download and build (but not installed) if not found
################################################################################
set(GNSSSDR_GFLAGS_LOCAL_VERSION "2.2.2")
set(GNSSSDR_GLOG_LOCAL_VERSION "0.3.5")
set(GNSSSDR_ARMADILLO_LOCAL_VERSION "9.200.x")
set(GNSSSDR_GLOG_LOCAL_VERSION "0.4.0")
set(GNSSSDR_ARMADILLO_LOCAL_VERSION "9.300.x")
set(GNSSSDR_GTEST_LOCAL_VERSION "1.8.1")
set(GNSSSDR_GNSS_SIM_LOCAL_VERSION "master")
set(GNSSSDR_GPSTK_LOCAL_VERSION "2.10.6")
@ -1331,14 +1331,30 @@ endif()
# Check that BLAS (Basic Linear Algebra Subprograms) is found in the system
# See http://www.netlib.org/blas/
################################################################################
find_library(BLAS blas)
if(NOT BLAS)
if(OS_IS_MACOSX)
# Avoid using the implementation that comes with the Accelerate framework
include(AvoidAccelerate)
else()
find_package(BLAS)
set_package_properties(BLAS PROPERTIES
URL "http://www.netlib.org/blas/"
DESCRIPTION "Basic Linear Algebra Subprograms"
PURPOSE "Used for matrix algebra computations."
TYPE REQUIRED
)
endif()
if(NOT BLAS_FOUND)
message(" The BLAS library has not been found.")
message(" You can try to install it by typing:")
if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
message(" sudo yum install blas-devel")
if(OS_IS_MACOSX)
message(" 'sudo port install lapack' if you are using Macports, or")
message(" 'brew install lapack' if you are using Homebrew.")
else()
message(" sudo apt-get install libblas-dev")
if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
message(" sudo yum install blas-devel")
else()
message(" sudo apt-get install libblas-dev")
endif()
endif()
message(FATAL_ERROR "BLAS is required to build gnss-sdr")
endif()
@ -1349,8 +1365,16 @@ endif()
# Check that LAPACK (Linear Algebra PACKage) is found in the system
# See http://www.netlib.org/lapack/
################################################################################
find_library(LAPACK lapack)
if(NOT LAPACK)
if(NOT OS_IS_MACOSX)
find_package(LAPACK)
set_package_properties(LAPACK PROPERTIES
URL "http://www.netlib.org/lapack/"
DESCRIPTION "Linear Algebra PACKage"
PURPOSE "Used for matrix algebra computations."
TYPE REQUIRED
)
endif()
if(NOT LAPACK_FOUND)
message(" The LAPACK library has not been found.")
message(" You can try to install it by typing:")
if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
@ -1457,7 +1481,7 @@ if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO)
if(NOT GFORTRAN)
set(GFORTRAN "")
endif()
set(ARMADILLO_LIBRARIES ${BLAS} ${LAPACK} ${GFORTRAN} ${binary_dir}/${CMAKE_FIND_LIBRARY_PREFIXES}armadillo${CMAKE_STATIC_LIBRARY_SUFFIX})
set(ARMADILLO_LIBRARIES ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} ${GFORTRAN} ${binary_dir}/${CMAKE_FIND_LIBRARY_PREFIXES}armadillo${CMAKE_STATIC_LIBRARY_SUFFIX})
set(LOCAL_ARMADILLO true CACHE STRING "Armadillo downloaded and built automatically" FORCE)
set(ARMADILLO_VERSION_STRING ${armadillo_RELEASE})
file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE}/include)

View File

@ -190,9 +190,9 @@ $ sudo apt-get install libblas-dev liblapack-dev # For Debian/Ubuntu/Linux
$ sudo yum install lapack-devel blas-devel # For Fedora/CentOS/RHEL
$ sudo zypper install lapack-devel blas-devel # For OpenSUSE
$ sudo pacman -S blas lapack # For Arch Linux
$ wget https://sourceforge.net/projects/arma/files/armadillo-9.200.7.tar.xz
$ tar xvfz armadillo-9.200.7.tar.xz
$ cd armadillo-9.200.7
$ wget https://sourceforge.net/projects/arma/files/armadillo-9.300.2.tar.xz
$ tar xvfz armadillo-9.300.2.tar.xz
$ cd armadillo-9.300.2
$ cmake .
$ make
$ sudo make install
@ -219,9 +219,10 @@ $ sudo ldconfig
#### Install [Glog](https://github.com/google/glog "Glog's Homepage"), a library that implements application-level logging:
~~~~~~
$ wget https://github.com/google/glog/archive/v0.3.5.tar.gz
$ tar xvfz v0.3.5.tar.gz
$ cd glog-0.3.5
$ wget https://github.com/google/glog/archive/v0.4.0.tar.gz
$ tar xvfz v0.4.0.tar.gz
$ cd glog-0.4.0
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install
@ -545,6 +546,7 @@ $ sudo port selfupdate
$ sudo port upgrade outdated
$ sudo port install doxygen +docs
$ sudo port install gnuradio
$ sudo port install lapack
$ sudo port install armadillo
$ sudo port install gnutls
$ sudo port install google-glog +gflags
@ -586,7 +588,9 @@ Install the required dependencies:
~~~~~~
$ brew install cmake
$ brew install hdf5 arpack superlu armadillo
$ brew install hdf5
$ brew install lapack
$ brew install arpack superlu armadillo
$ brew install glog gflags
$ brew install gnuradio
$ brew install libmatio

View File

@ -0,0 +1,58 @@
# Copyright (C) 2011-2019 (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 <https://www.gnu.org/licenses/>.
# Avoid using the BLAS and LAPACK implementations that comes with the Accelerate
# framework, which causes a bug when the BeiDou constellation is enabled
find_library(BLAS_LIBRARIES
libblas.dylib
PATHS
/opt/local/lib/lapack
/usr/local/opt/lapack/lib
/usr/local/lib
${BLAS_ROOT}/lib
$ENV{BLAS_ROOT}/lib
NO_DEFAULT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
NO_CMAKE_ENVIRONMENT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
NO_CMAKE_SYSTEM_PATH
)
if(BLAS_LIBRARIES)
set(BLAS_FOUND TRUE)
endif()
find_library(LAPACK_LIBRARIES
liblapack.dylib
PATHS
/opt/local/lib/lapack
/usr/local/opt/lapack/lib
/usr/local/lib
${BLAS_ROOT}/lib
$ENV{BLAS_ROOT}/lib
NO_DEFAULT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
NO_CMAKE_ENVIRONMENT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
NO_CMAKE_SYSTEM_PATH
)
if(LAPACK_LIBRARIES)
set(LAPACK_FOUND TRUE)
endif()

View File

@ -366,10 +366,10 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels,
// Display time in local time zone
d_show_local_time_zone = conf_.show_local_time_zone;
time_t when = std::time(nullptr);
auto const tm = *std::localtime(&when);
std::ostringstream os;
#ifdef HAS_PUT_TIME
time_t when = std::time(nullptr);
auto const tm = *std::localtime(&when);
os << std::put_time(&tm, "%z");
#endif
std::string utc_diff_str = os.str(); // in ISO 8601 format: "+HHMM" or "-HHMM"

View File

@ -93,7 +93,7 @@ public:
/*!
* \brief Set acquisition channel unique ID
*/
inline void set_channel(unsigned int channel)
inline void set_channel(unsigned int channel) override
{
channel_ = channel;
acquisition_->set_channel(channel_);
@ -102,7 +102,7 @@ public:
/*!
* \brief Set channel fsm associated to this acquisition instance
*/
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm)
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm) override
{
channel_fsm_ = channel_fsm;
acquisition_->set_channel_fsm(channel_fsm);

View File

@ -92,7 +92,7 @@ public:
/*!
* \brief Set acquisition channel unique ID
*/
inline void set_channel(unsigned int channel)
inline void set_channel(unsigned int channel) override
{
channel_ = channel;
acquisition_->set_channel(channel_);
@ -101,7 +101,7 @@ public:
/*!
* \brief Set channel fsm associated to this acquisition instance
*/
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm)
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm) override
{
channel_fsm_ = channel_fsm;
acquisition_->set_channel_fsm(channel_fsm);

View File

@ -87,7 +87,7 @@ public:
/*!
* \brief Set acquisition channel unique ID
*/
inline void set_channel(unsigned int channel)
inline void set_channel(unsigned int channel) override
{
channel_ = channel;
acquisition_cc_->set_channel(channel_);
@ -96,7 +96,7 @@ public:
/*!
* \brief Set channel fsm associated to this acquisition instance
*/
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm)
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm) override
{
channel_fsm_ = channel_fsm;
acquisition_cc_->set_channel_fsm(channel_fsm);

View File

@ -91,7 +91,7 @@ public:
/*!
* \brief Set acquisition channel unique ID
*/
inline void set_channel(unsigned int channel)
inline void set_channel(unsigned int channel) override
{
channel_ = channel;
acquisition_->set_channel(channel_);
@ -100,7 +100,7 @@ public:
/*!
* \brief Set channel fsm associated to this acquisition instance
*/
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm)
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm) override
{
channel_fsm_ = channel_fsm;
acquisition_->set_channel_fsm(channel_fsm);

View File

@ -66,7 +66,10 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
int64_t fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
float downsampling_factor = configuration_->property(role + ".downsampling_factor", 4.0);
acq_parameters.repeat_satellite = configuration_->property(role + ".repeat_satellite", false);
DLOG(INFO) << role << " satellite repeat = " << acq_parameters.repeat_satellite;
uint32_t downsampling_factor = configuration_->property(role + ".downsampling_factor", 4);
acq_parameters.downsampling_factor = downsampling_factor;
fs_in = fs_in / downsampling_factor;
@ -169,7 +172,6 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
acq_parameters.total_block_exp = configuration_->property(role + ".total_block_exp", 12);
acquisition_fpga_ = pcps_make_acquisition_fpga(acq_parameters);
DLOG(INFO) << "acquisition(" << acquisition_fpga_->unique_id() << ")";
channel_ = 0;
doppler_step_ = 0;
@ -280,5 +282,5 @@ gr::basic_block_sptr GalileoE1PcpsAmbiguousAcquisitionFpga::get_left_block()
gr::basic_block_sptr GalileoE1PcpsAmbiguousAcquisitionFpga::get_right_block()
{
return acquisition_fpga_;
return nullptr;
}

View File

@ -33,10 +33,7 @@
#define GNSS_SDR_GALILEO_E1_PCPS_AMBIGUOUS_ACQUISITION_FPGA_H_
#include "channel_fsm.h"
#include "complex_byte_to_float_x2.h"
#include "pcps_acquisition_fpga.h"
#include <gnuradio/blocks/float_to_complex.h>
#include <gnuradio/blocks/stream_to_vector.h>
#include <gnuradio/runtime_types.h> // for basic_block_sptr, top_block_sptr
#include <volk/volk_complex.h> // for lv_16sc_t
#include <cstddef> // for size_t
@ -93,7 +90,7 @@ public:
/*!
* \brief Set acquisition channel unique ID
*/
inline void set_channel(unsigned int channel)
inline void set_channel(unsigned int channel) override
{
channel_ = channel;
acquisition_fpga_->set_channel(channel_);
@ -102,9 +99,8 @@ public:
/*!
* \brief Set channel fsm associated to this acquisition instance
*/
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm)
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm) override
{
channel_fsm = nullptr;
channel_fsm_ = channel_fsm;
acquisition_fpga_->set_channel_fsm(channel_fsm);
}
@ -158,9 +154,6 @@ public:
private:
ConfigurationInterface* configuration_;
pcps_acquisition_fpga_sptr acquisition_fpga_;
gr::blocks::stream_to_vector::sptr stream_to_vector_;
gr::blocks::float_to_complex::sptr float_to_complex_;
complex_byte_to_float_x2_sptr cbyte_to_float_x2_;
bool acquire_pilot_;
uint32_t channel_;
std::shared_ptr<ChannelFsm> channel_fsm_;

View File

@ -87,7 +87,7 @@ public:
/*!
* \brief Set acquisition channel unique ID
*/
inline void set_channel(unsigned int channel)
inline void set_channel(unsigned int channel) override
{
channel_ = channel;
acquisition_cc_->set_channel(channel_);
@ -96,7 +96,7 @@ public:
/*!
* \brief Set channel fsm associated to this acquisition instance
*/
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm)
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm) override
{
channel_fsm_ = channel_fsm;
acquisition_cc_->set_channel_fsm(channel_fsm);

View File

@ -88,7 +88,7 @@ public:
/*!
* \brief Set acquisition channel unique ID
*/
inline void set_channel(unsigned int channel)
inline void set_channel(unsigned int channel) override
{
channel_ = channel;
acquisition_cc_->set_channel(channel_);
@ -97,7 +97,7 @@ public:
/*!
* \brief Set channel fsm associated to this acquisition instance
*/
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm)
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm) override
{
channel_fsm_ = channel_fsm;
acquisition_cc_->set_channel_fsm(channel_fsm);

View File

@ -87,7 +87,7 @@ public:
/*!
* \brief Set acquisition channel unique ID
*/
inline void set_channel(unsigned int channel)
inline void set_channel(unsigned int channel) override
{
channel_ = channel;
acquisition_cc_->set_channel(channel_);
@ -96,7 +96,7 @@ public:
/*!
* \brief Set channel fsm associated to this acquisition instance
*/
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm)
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm) override
{
channel_fsm_ = channel_fsm;
acquisition_cc_->set_channel_fsm(channel_fsm);

View File

@ -88,7 +88,7 @@ public:
/*!
* \brief Set acquisition channel unique ID
*/
inline void set_channel(unsigned int channel)
inline void set_channel(unsigned int channel) override
{
channel_ = channel;
acquisition_cc_->set_channel(channel_);
@ -97,7 +97,7 @@ public:
/*!
* \brief Set channel fsm associated to this acquisition instance
*/
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm)
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm) override
{
channel_fsm_ = channel_fsm;
acquisition_cc_->set_channel_fsm(channel_fsm);

View File

@ -79,7 +79,7 @@ public:
/*!
* \brief Set acquisition channel unique ID
*/
inline void set_channel(unsigned int channel)
inline void set_channel(unsigned int channel) override
{
channel_ = channel;
acquisition_->set_channel(channel_);
@ -88,7 +88,7 @@ public:
/*!
* \brief Set channel fsm associated to this acquisition instance
*/
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm)
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm) override
{
channel_fsm_ = channel_fsm;
acquisition_->set_channel_fsm(channel_fsm);

View File

@ -62,7 +62,10 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf
int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 32000000);
int64_t fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
float downsampling_factor = configuration_->property(role + ".downsampling_factor", 1.0);
acq_parameters.repeat_satellite = configuration_->property(role + ".repeat_satellite", false);
DLOG(INFO) << role << " satellite repeat = " << acq_parameters.repeat_satellite;
uint32_t downsampling_factor = configuration_->property(role + ".downsampling_factor", 1);
acq_parameters.downsampling_factor = downsampling_factor;
fs_in = fs_in / downsampling_factor;
@ -169,7 +172,6 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf
acq_parameters.make_2_steps = configuration_->property(role + ".make_two_steps", false);
acquisition_fpga_ = pcps_make_acquisition_fpga(acq_parameters);
DLOG(INFO) << "acquisition(" << acquisition_fpga_->unique_id() << ")";
channel_ = 0;
doppler_step_ = 0;
@ -279,5 +281,5 @@ gr::basic_block_sptr GalileoE5aPcpsAcquisitionFpga::get_left_block()
gr::basic_block_sptr GalileoE5aPcpsAcquisitionFpga::get_right_block()
{
return acquisition_fpga_;
return nullptr;
}

View File

@ -35,7 +35,6 @@
#include "channel_fsm.h"
#include "pcps_acquisition_fpga.h"
#include <gnuradio/blocks/stream_to_vector.h>
#include <gnuradio/runtime_types.h> // for basic_block_sptr, top_block_sptr
#include <volk/volk_complex.h> // for lv_16sc_t
#include <cstddef> // for size_t
@ -92,7 +91,7 @@ public:
/*!
* \brief Set acquisition channel unique ID
*/
inline void set_channel(unsigned int channel)
inline void set_channel(unsigned int channel) override
{
channel_ = channel;
acquisition_fpga_->set_channel(channel_);
@ -101,9 +100,8 @@ public:
/*!
* \brief Set channel fsm associated to this acquisition instance
*/
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm)
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm) override
{
channel_fsm = nullptr;
channel_fsm_ = channel_fsm;
acquisition_fpga_->set_channel_fsm(channel_fsm);
}
@ -167,7 +165,6 @@ public:
private:
ConfigurationInterface* configuration_;
pcps_acquisition_fpga_sptr acquisition_fpga_;
gr::blocks::stream_to_vector::sptr stream_to_vector_;
std::string item_type_;
std::string dump_filename_;

View File

@ -89,7 +89,7 @@ public:
/*!
* \brief Set acquisition channel unique ID
*/
inline void set_channel(unsigned int channel)
inline void set_channel(unsigned int channel) override
{
channel_ = channel;
acquisition_->set_channel(channel_);
@ -98,7 +98,7 @@ public:
/*!
* \brief Set channel fsm associated to this acquisition instance
*/
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm)
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm) override
{
channel_fsm_ = channel_fsm;
acquisition_->set_channel_fsm(channel_fsm);

View File

@ -89,7 +89,7 @@ public:
/*!
* \brief Set acquisition channel unique ID
*/
inline void set_channel(unsigned int channel)
inline void set_channel(unsigned int channel) override
{
channel_ = channel;
acquisition_->set_channel(channel_);
@ -98,7 +98,7 @@ public:
/*!
* \brief Set channel fsm associated to this acquisition instance
*/
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm)
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm) override
{
channel_fsm_ = channel_fsm;
acquisition_->set_channel_fsm(channel_fsm);

View File

@ -95,7 +95,7 @@ public:
/*!
* \brief Set acquisition channel unique ID
*/
inline void set_channel(unsigned int channel)
inline void set_channel(unsigned int channel) override
{
channel_ = channel;
acquisition_->set_channel(channel_);
@ -104,7 +104,7 @@ public:
/*!
* \brief Set channel fsm associated to this acquisition instance
*/
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm)
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm) override
{
channel_fsm_ = channel_fsm;
acquisition_->set_channel_fsm(channel_fsm);

View File

@ -88,7 +88,7 @@ public:
/*!
* \brief Set acquisition channel unique ID
*/
inline void set_channel(unsigned int channel)
inline void set_channel(unsigned int channel) override
{
channel_ = channel;
acquisition_cc_->set_channel(channel_);
@ -97,7 +97,7 @@ public:
/*!
* \brief Set channel fsm associated to this acquisition instance
*/
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm)
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm) override
{
channel_fsm_ = channel_fsm;
acquisition_cc_->set_channel_fsm(channel_fsm);

View File

@ -69,9 +69,11 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
int64_t fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
float downsampling_factor = configuration_->property(role + ".downsampling_factor", 4.0);
acq_parameters.downsampling_factor = downsampling_factor;
acq_parameters.repeat_satellite = configuration_->property(role + ".repeat_satellite", false);
DLOG(INFO) << role << " satellite repeat = " << acq_parameters.repeat_satellite;
uint32_t downsampling_factor = configuration_->property(role + ".downsampling_factor", 4);
acq_parameters.downsampling_factor = downsampling_factor;
fs_in = fs_in / downsampling_factor;
acq_parameters.fs_in = fs_in;
@ -144,14 +146,13 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
acq_parameters.all_fft_codes = d_all_fft_codes_;
// reference for the FPGA FFT-IFFT attenuation factor
acq_parameters.total_block_exp = configuration_->property(role + ".total_block_exp", 10);
acq_parameters.total_block_exp = configuration_->property(role + ".total_block_exp", 11);
acq_parameters.num_doppler_bins_step2 = configuration_->property(role + ".second_nbins", 4);
acq_parameters.doppler_step2 = configuration_->property(role + ".second_doppler_step", 125.0);
acq_parameters.make_2_steps = configuration_->property(role + ".make_two_steps", false);
acquisition_fpga_ = pcps_make_acquisition_fpga(acq_parameters);
DLOG(INFO) << "acquisition(" << acquisition_fpga_->unique_id() << ")";
channel_ = 0;
doppler_step_ = 0;
@ -262,5 +263,5 @@ gr::basic_block_sptr GpsL1CaPcpsAcquisitionFpga::get_left_block()
gr::basic_block_sptr GpsL1CaPcpsAcquisitionFpga::get_right_block()
{
return acquisition_fpga_;
return nullptr;
}

View File

@ -93,7 +93,7 @@ public:
/*!
* \brief Set acquisition channel unique ID
*/
inline void set_channel(unsigned int channel)
inline void set_channel(unsigned int channel) override
{
channel_ = channel;
acquisition_fpga_->set_channel(channel_);
@ -102,9 +102,8 @@ public:
/*!
* \brief Set channel fsm associated to this acquisition instance
*/
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm)
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm) override
{
channel_fsm = nullptr;
channel_fsm_ = channel_fsm;
acquisition_fpga_->set_channel_fsm(channel_fsm);
}

View File

@ -88,7 +88,7 @@ public:
/*!
* \brief Set acquisition channel unique ID
*/
inline void set_channel(unsigned int channel)
inline void set_channel(unsigned int channel) override
{
channel_ = channel;
acquisition_cc_->set_channel(channel_);
@ -97,7 +97,7 @@ public:
/*!
* \brief Set channel fsm associated to this acquisition instance
*/
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm)
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm) override
{
channel_fsm_ = channel_fsm;
acquisition_cc_->set_channel_fsm(channel_fsm);

View File

@ -87,7 +87,7 @@ public:
/*!
* \brief Set acquisition channel unique ID
*/
inline void set_channel(unsigned int channel)
inline void set_channel(unsigned int channel) override
{
channel_ = channel;
acquisition_cc_->set_channel(channel_);
@ -96,7 +96,7 @@ public:
/*!
* \brief Set channel fsm associated to this acquisition instance
*/
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm)
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm) override
{
channel_fsm_ = channel_fsm;
acquisition_cc_->set_channel_fsm(channel_fsm);

View File

@ -89,7 +89,7 @@ public:
/*!
* \brief Set acquisition channel unique ID
*/
inline void set_channel(unsigned int channel)
inline void set_channel(unsigned int channel) override
{
channel_ = channel;
acquisition_cc_->set_channel(channel_);
@ -98,7 +98,7 @@ public:
/*!
* \brief Set channel fsm associated to this acquisition instance
*/
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm)
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm) override
{
channel_fsm_ = channel_fsm;
acquisition_cc_->set_channel_fsm(channel_fsm);

View File

@ -88,7 +88,7 @@ public:
/*!
* \brief Set acquisition channel unique ID
*/
inline void set_channel(unsigned int channel)
inline void set_channel(unsigned int channel) override
{
channel_ = channel;
acquisition_cc_->set_channel(channel_);
@ -97,7 +97,7 @@ public:
/*!
* \brief Set channel fsm associated to this acquisition instance
*/
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm)
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm) override
{
channel_fsm_ = channel_fsm;
acquisition_cc_->set_channel_fsm(channel_fsm);

View File

@ -92,7 +92,7 @@ public:
/*!
* \brief Set acquisition channel unique ID
*/
inline void set_channel(unsigned int channel)
inline void set_channel(unsigned int channel) override
{
channel_ = channel;
acquisition_->set_channel(channel_);
@ -101,7 +101,7 @@ public:
/*!
* \brief Set channel fsm associated to this acquisition instance
*/
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm)
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm) override
{
channel_fsm_ = channel_fsm;
acquisition_->set_channel_fsm(channel_fsm);

View File

@ -70,6 +70,9 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga(
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
acq_parameters.fs_in = fs_in_;
acq_parameters.repeat_satellite = configuration_->property(role + ".repeat_satellite", false);
DLOG(INFO) << role << " satellite repeat = " << acq_parameters.repeat_satellite;
doppler_max_ = configuration->property(role + ".doppler_max", 5000);
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max;
acq_parameters.doppler_max = doppler_max_;
@ -139,13 +142,11 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga(
delete[] fft_codes_padded;
acquisition_fpga_ = pcps_make_acquisition_fpga(acq_parameters);
DLOG(INFO) << "acquisition(" << acquisition_fpga_->unique_id() << ")";
channel_ = 0;
doppler_step_ = 0;
gnss_synchro_ = nullptr;
channel_fsm_ = nullptr;
DLOG(INFO) << "acquisition(" << acquisition_fpga_->unique_id() << ")";
threshold_ = 0.0;
}
@ -253,5 +254,5 @@ gr::basic_block_sptr GpsL2MPcpsAcquisitionFpga::get_left_block()
gr::basic_block_sptr GpsL2MPcpsAcquisitionFpga::get_right_block()
{
return acquisition_fpga_;
return nullptr;
}

View File

@ -35,10 +35,7 @@
#define GNSS_SDR_GPS_L2_M_PCPS_ACQUISITION_FPGA_H_
#include "channel_fsm.h"
#include "complex_byte_to_float_x2.h"
#include "pcps_acquisition_fpga.h"
#include <gnuradio/blocks/float_to_complex.h>
#include <gnuradio/blocks/stream_to_vector.h>
#include <gnuradio/runtime_types.h> // for basic_block_sptr, top_block_sptr
#include <volk/volk_complex.h> // for lv_16sc_t
#include <cstddef> // for size_t
@ -94,7 +91,7 @@ public:
/*!
* \brief Set acquisition channel unique ID
*/
inline void set_channel(unsigned int channel)
inline void set_channel(unsigned int channel) override
{
channel_ = channel;
acquisition_fpga_->set_channel(channel_);
@ -103,11 +100,12 @@ public:
/*!
* \brief Set channel fsm associated to this acquisition instance
*/
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm)
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm) override
{
channel_fsm_ = channel_fsm;
acquisition_fpga_->set_channel_fsm(channel_fsm);
}
/*!
* \brief Set statistics threshold of PCPS algorithm
*/
@ -158,9 +156,6 @@ public:
private:
ConfigurationInterface* configuration_;
pcps_acquisition_fpga_sptr acquisition_fpga_;
gr::blocks::stream_to_vector::sptr stream_to_vector_;
gr::blocks::float_to_complex::sptr float_to_complex_;
complex_byte_to_float_x2_sptr cbyte_to_float_x2_;
std::string item_type_;
unsigned int channel_;
std::shared_ptr<ChannelFsm> channel_fsm_;

View File

@ -92,7 +92,7 @@ public:
/*!
* \brief Set acquisition channel unique ID
*/
inline void set_channel(unsigned int channel)
inline void set_channel(unsigned int channel) override
{
channel_ = channel;
acquisition_->set_channel(channel_);
@ -101,7 +101,7 @@ public:
/*!
* \brief Set channel fsm associated to this acquisition instance
*/
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm)
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm) override
{
channel_fsm_ = channel_fsm;
acquisition_->set_channel_fsm(channel_fsm);

View File

@ -68,7 +68,10 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga(
int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
int64_t fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
float downsampling_factor = configuration_->property(role + ".downsampling_factor", 1.0);
acq_parameters.repeat_satellite = configuration_->property(role + ".repeat_satellite", false);
DLOG(INFO) << role << " satellite repeat = " << acq_parameters.repeat_satellite;
uint32_t downsampling_factor = configuration_->property(role + ".downsampling_factor", 1);
acq_parameters.downsampling_factor = downsampling_factor;
fs_in = fs_in / downsampling_factor;
@ -144,14 +147,13 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga(
acq_parameters.all_fft_codes = d_all_fft_codes_;
// reference for the FPGA FFT-IFFT attenuation factor
acq_parameters.total_block_exp = configuration_->property(role + ".total_block_exp", 12);
acq_parameters.total_block_exp = configuration_->property(role + ".total_block_exp", 13);
acq_parameters.num_doppler_bins_step2 = configuration_->property(role + ".second_nbins", 4);
acq_parameters.doppler_step2 = configuration_->property(role + ".second_doppler_step", 125.0);
acq_parameters.make_2_steps = configuration_->property(role + ".make_two_steps", false);
acquisition_fpga_ = pcps_make_acquisition_fpga(acq_parameters);
DLOG(INFO) << "acquisition(" << acquisition_fpga_->unique_id() << ")";
channel_ = 0;
doppler_step_ = 0;
@ -263,5 +265,5 @@ gr::basic_block_sptr GpsL5iPcpsAcquisitionFpga::get_left_block()
gr::basic_block_sptr GpsL5iPcpsAcquisitionFpga::get_right_block()
{
return acquisition_fpga_;
return nullptr;
}

View File

@ -36,10 +36,7 @@
#define GNSS_SDR_GPS_L5I_PCPS_ACQUISITION_FPGA_H_
#include "channel_fsm.h"
#include "complex_byte_to_float_x2.h"
#include "pcps_acquisition_fpga.h"
#include <gnuradio/blocks/float_to_complex.h>
#include <gnuradio/blocks/stream_to_vector.h>
#include <gnuradio/runtime_types.h> // for basic_block_sptr, top_block_sptr
#include <volk/volk_complex.h> // for lv_16sc_t
#include <cstddef> // for size_t
@ -95,7 +92,7 @@ public:
/*!
* \brief Set acquisition channel unique ID
*/
inline void set_channel(unsigned int channel)
inline void set_channel(unsigned int channel) override
{
channel_ = channel;
acquisition_fpga_->set_channel(channel_);
@ -104,9 +101,8 @@ public:
/*!
* \brief Set channel fsm associated to this acquisition instance
*/
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm)
inline void set_channel_fsm(std::shared_ptr<ChannelFsm> channel_fsm) override
{
channel_fsm = nullptr;
channel_fsm_ = channel_fsm;
acquisition_fpga_->set_channel_fsm(channel_fsm);
}
@ -160,9 +156,6 @@ public:
private:
ConfigurationInterface* configuration_;
pcps_acquisition_fpga_sptr acquisition_fpga_;
gr::blocks::stream_to_vector::sptr stream_to_vector_;
gr::blocks::float_to_complex::sptr float_to_complex_;
complex_byte_to_float_x2_sptr cbyte_to_float_x2_;
std::string item_type_;
uint32_t channel_;
std::shared_ptr<ChannelFsm> channel_fsm_;

View File

@ -34,13 +34,11 @@
#include "pcps_acquisition_fpga.h"
#include "gnss_synchro.h"
//#include <boost/chrono.hpp>
#include <glog/logging.h>
#include <gnuradio/io_signature.h>
#include <pmt/pmt.h> // for from_long
#include <pmt/pmt_sugar.h> // for mp
#include <cmath> // for ceil
#include <iostream> // for operator<<
#include <utility> // for move
#include <cmath> // for ceil
#include <iostream> // for operator<<
#include <utility> // for move
#define AQ_DOWNSAMPLING_DELAY 40 // delay due to the downsampling filter in the acquisition
@ -52,12 +50,8 @@ pcps_acquisition_fpga_sptr pcps_make_acquisition_fpga(pcpsconf_fpga_t 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))
pcps_acquisition_fpga::pcps_acquisition_fpga(pcpsconf_fpga_t conf_)
{
this->message_port_register_out(pmt::mp("events"));
acq_parameters = std::move(conf_);
d_sample_counter = 0ULL; // SAMPLE COUNTER
d_active = false;
@ -158,17 +152,8 @@ void pcps_acquisition_fpga::send_positive_acquisition()
<< ", magnitude " << d_mag
<< ", input signal power " << d_input_power;
if (d_channel_fsm)
{
printf("d_channel_fsm is set\n");
//the channel FSM is set, so, notify it directly the positive acquisition to minimize delays
d_channel_fsm->Event_valid_acquisition();
}
else
{
printf("d_channel_fsm is not set\n");
this->message_port_pub(pmt::mp("events"), pmt::from_long(1));
}
//the channel FSM is set, so, notify it directly the positive acquisition to minimize delays
d_channel_fsm->Event_valid_acquisition();
}
@ -185,7 +170,14 @@ void pcps_acquisition_fpga::send_negative_acquisition()
<< ", magnitude " << d_mag
<< ", input signal power " << d_input_power;
this->message_port_pub(pmt::mp("events"), pmt::from_long(2));
if (acq_parameters.repeat_satellite == true)
{
d_channel_fsm->Event_failed_acquisition_repeat();
}
else
{
d_channel_fsm->Event_failed_acquisition_no_repeat();
}
}
void pcps_acquisition_fpga::acquisition_core(uint32_t num_doppler_bins, uint32_t doppler_step, int32_t doppler_min)
@ -196,10 +188,15 @@ void pcps_acquisition_fpga::acquisition_core(uint32_t num_doppler_bins, uint32_t
uint32_t total_block_exp;
uint64_t initial_sample;
int32_t doppler;
acquisition_fpga->set_doppler_sweep(num_doppler_bins, doppler_step, doppler_min);
acquisition_fpga->run_acquisition();
acquisition_fpga->read_acquisition_results(&indext, &firstpeak, &secondpeak, &initial_sample, &d_input_power, &d_doppler_index, &total_block_exp);
acquisition_fpga->read_acquisition_results(&indext,
&firstpeak,
&secondpeak,
&initial_sample,
&d_input_power,
&d_doppler_index,
&total_block_exp);
doppler = static_cast<int32_t>(doppler_min) + doppler_step * (d_doppler_index - 1);
@ -222,12 +219,12 @@ void pcps_acquisition_fpga::acquisition_core(uint32_t num_doppler_bins, uint32_t
}
}
// // debug
if (d_test_statistics > d_threshold)
{
printf("firstpeak = %f, secondpeak = %f, test_statistics = %f reported block exp = %d PRN = %d inext = %d, initial_sample = %ld doppler = %d\n", firstpeak, secondpeak, d_test_statistics, (int)total_block_exp, (int)d_gnss_synchro->PRN, (int)indext, (long int)initial_sample, (int)doppler);
printf("doppler_min = %d doppler_step = %d num_doppler_bins = %d\n", (int)doppler_min, (int)doppler_step, (int)num_doppler_bins);
}
// debug
//if (d_test_statistics > d_threshold)
// {
// printf("firstpeak = %f, secondpeak = %f, test_statistics = %f reported block exp = %d PRN = %d inext = %d, initial_sample = %ld doppler = %d\n", firstpeak, secondpeak, d_test_statistics, (int)total_block_exp, (int)d_gnss_synchro->PRN, (int)indext, (long int)initial_sample, (int)doppler);
// printf("doppler_min = %d doppler_step = %d num_doppler_bins = %d\n", (int)doppler_min, (int)doppler_step, (int)num_doppler_bins);
// }
d_gnss_synchro->Acq_doppler_hz = static_cast<double>(doppler);
d_sample_counter = initial_sample;
@ -237,7 +234,7 @@ void pcps_acquisition_fpga::acquisition_core(uint32_t num_doppler_bins, uint32_t
if (d_downsampling_factor > 1)
{
d_gnss_synchro->Acq_delay_samples = static_cast<double>(d_downsampling_factor * (indext));
d_gnss_synchro->Acq_samplestamp_samples = d_downsampling_factor * d_sample_counter - 44; //33; //41; //+ 81*0.5; // delay due to the downsampling filter in the acquisition
d_gnss_synchro->Acq_samplestamp_samples = d_downsampling_factor * static_cast<uint64_t>(d_sample_counter) - static_cast<uint64_t>(44); //33; //41; //+ 81*0.5; // delay due to the downsampling filter in the acquisition
}
else
{
@ -269,15 +266,11 @@ void pcps_acquisition_fpga::set_active(bool active)
<< ", use_CFAR_algorithm_flag: false";
//acquisition_fpga->configure_acquisition();
//acquisition_fpga->write_local_code();
acquisition_fpga->configure_acquisition();
acquisition_fpga->write_local_code();
acquisition_fpga->set_block_exp(d_total_block_exp);
acquisition_core(d_num_doppler_bins, d_doppler_step, -d_doppler_max);
if (!d_make_2_steps)
{
if (d_test_statistics > d_threshold)
@ -299,6 +292,8 @@ void pcps_acquisition_fpga::set_active(bool active)
{
d_doppler_center_step_two = static_cast<float>(d_gnss_synchro->Acq_doppler_hz);
acquisition_fpga->open_device();
//boost::chrono::high_resolution_clock::time_point start = boost::chrono::high_resolution_clock::now();
acquisition_core(d_num_doppler_bins_step2, d_doppler_step2, d_doppler_center_step_two - static_cast<float>(floor(d_num_doppler_bins_step2 / 2.0)) * d_doppler_step2);
if (d_test_statistics > d_threshold)
@ -313,6 +308,9 @@ void pcps_acquisition_fpga::set_active(bool active)
d_active = false;
send_negative_acquisition();
}
//boost::chrono::nanoseconds ns = boost::chrono::high_resolution_clock::now() - start;
//auto val = ns.count();
//std::cout << "Count ns: " << val << std::endl;
}
else
{
@ -324,16 +322,6 @@ void pcps_acquisition_fpga::set_active(bool active)
}
int pcps_acquisition_fpga::general_work(int noutput_items __attribute__((unused)),
gr_vector_int& ninput_items __attribute__((unused)),
gr_vector_const_void_star& input_items __attribute__((unused)),
gr_vector_void_star& output_items __attribute__((unused)))
{
// the general work is not used with the acquisition that uses the FPGA
return noutput_items;
}
void pcps_acquisition_fpga::reset_acquisition(void)
{
// this function triggers a HW reset of the FPGA PL.
@ -341,7 +329,7 @@ void pcps_acquisition_fpga::reset_acquisition(void)
}
void pcps_acquisition_fpga::read_fpga_total_scale_factor(uint32_t* total_scale_factor, uint32_t* fw_scale_factor)
{
acquisition_fpga->read_fpga_total_scale_factor(total_scale_factor, fw_scale_factor);
}
//void pcps_acquisition_fpga::read_fpga_total_scale_factor(uint32_t* total_scale_factor, uint32_t* fw_scale_factor)
//{
// acquisition_fpga->read_fpga_total_scale_factor(total_scale_factor, fw_scale_factor);
//}

View File

@ -44,8 +44,6 @@
#include "channel_fsm.h"
#include "fpga_acquisition.h"
#include <boost/shared_ptr.hpp>
#include <gnuradio/block.h> // for block
#include <gnuradio/types.h> // for gr_vector_const_void_star
#include <volk/volk_complex.h> // for lv_16sc_t
#include <cstdint> // for uint32_t
#include <memory> // for shared_ptr
@ -65,12 +63,14 @@ typedef struct
uint32_t select_queue_Fpga;
std::string device_name;
lv_16sc_t* all_fft_codes; // memory that contains all the code ffts
float downsampling_factor;
//float downsampling_factor;
uint32_t downsampling_factor;
uint32_t total_block_exp;
uint32_t excludelimit;
bool make_2_steps;
uint32_t num_doppler_bins_step2;
float doppler_step2;
bool repeat_satellite;
} pcpsconf_fpga_t;
class pcps_acquisition_fpga;
@ -86,7 +86,7 @@ pcps_make_acquisition_fpga(pcpsconf_fpga_t conf_);
* 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
class pcps_acquisition_fpga
{
private:
friend pcps_acquisition_fpga_sptr pcps_make_acquisition_fpga(pcpsconf_fpga_t conf_);
@ -119,7 +119,8 @@ private:
Gnss_Synchro* d_gnss_synchro;
std::shared_ptr<Fpga_Acquisition> acquisition_fpga;
float d_downsampling_factor;
//float d_downsampling_factor;
uint32_t d_downsampling_factor;
uint32_t d_select_queue_Fpga;
uint32_t d_total_block_exp;
@ -231,14 +232,7 @@ public:
/*!
* \brief This funciton is only used for the unit tests
*/
void read_fpga_total_scale_factor(uint32_t* total_scale_factor, uint32_t* fw_scale_factor);
/*!
* \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);
//void read_fpga_total_scale_factor(uint32_t* total_scale_factor, uint32_t* fw_scale_factor);
};
#endif /* GNSS_SDR_PCPS_ACQUISITION_FPGA_H_*/

View File

@ -55,7 +55,8 @@ Channel::Channel(ConfigurationInterface* configuration, uint32_t channel, std::s
queue_ = std::move(queue);
channel_fsm_ = std::make_shared<ChannelFsm>();
flag_enable_fpga = configuration->property("Channel.enable_FPGA", false);
flag_enable_fpga = configuration->property("GNSS-SDR.enable_FPGA", false);
acq_->set_channel(channel_);
acq_->set_channel_fsm(channel_fsm_);
trk_->set_channel(channel_);
@ -125,7 +126,10 @@ Channel::~Channel() = default;
void Channel::connect(gr::top_block_sptr top_block)
{
acq_->connect(top_block);
if (!flag_enable_fpga)
{
acq_->connect(top_block);
}
trk_->connect(top_block);
nav_->connect(top_block);
@ -136,7 +140,10 @@ void Channel::connect(gr::top_block_sptr top_block)
DLOG(INFO) << "tracking -> telemetry_decoder";
// Message ports
top_block->msg_connect(acq_->get_right_block(), pmt::mp("events"), channel_msg_rx, pmt::mp("events"));
if (!flag_enable_fpga)
{
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"));
connected_ = true;
@ -152,12 +159,18 @@ void Channel::disconnect(gr::top_block_sptr top_block)
}
top_block->disconnect(trk_->get_right_block(), 0, nav_->get_left_block(), 0);
acq_->disconnect(top_block);
if (!flag_enable_fpga)
{
acq_->disconnect(top_block);
}
trk_->disconnect(top_block);
nav_->disconnect(top_block);
top_block->msg_disconnect(nav_->get_left_block(), pmt::mp("telemetry_to_trk"), trk_->get_right_block(), pmt::mp("telemetry_to_trk"));
top_block->msg_disconnect(acq_->get_right_block(), pmt::mp("events"), channel_msg_rx, pmt::mp("events"));
if (!flag_enable_fpga)
{
top_block->msg_disconnect(acq_->get_right_block(), pmt::mp("events"), channel_msg_rx, pmt::mp("events"));
}
top_block->msg_disconnect(trk_->get_right_block(), pmt::mp("events"), channel_msg_rx, pmt::mp("events"));
connected_ = false;
}
@ -178,6 +191,10 @@ gr::basic_block_sptr Channel::get_left_block_trk()
gr::basic_block_sptr Channel::get_left_block_acq()
{
if (flag_enable_fpga)
{
LOG(ERROR) << "Enabled FPGA and called get_left_block() in channel interface";
}
return acq_->get_left_block();
}
@ -199,6 +216,10 @@ void Channel::set_signal(const Gnss_Signal& gnss_signal)
gnss_synchro_.PRN = gnss_signal_.get_satellite().get_PRN();
gnss_synchro_.System = gnss_signal_.get_satellite().get_system_short().c_str()[0];
acq_->set_local_code();
if (flag_enable_fpga)
{
trk_->set_gnss_synchro(&gnss_synchro_);
}
nav_->set_satellite(gnss_signal_.get_satellite());
}
@ -220,7 +241,15 @@ void Channel::start_acquisition()
{
std::lock_guard<std::mutex> lk(mx);
bool result = false;
result = channel_fsm_->Event_start_acquisition();
if (!flag_enable_fpga)
{
result = channel_fsm_->Event_start_acquisition();
}
else
{
result = channel_fsm_->Event_start_acquisition_fpga();
channel_fsm_->start_acquisition();
}
if (!result)
{
LOG(WARNING) << "Invalid channel event";

View File

@ -1,7 +1,8 @@
/*!
* \file channel_fsm.cc
* \brief Implementation of a State Machine for channel
* \authors Antonio Ramos, 2017. antonio.ramos(at)cttc.es
* \authors Javier Arribas, 2019. javiarribas@gmail.com
* Antonio Ramos, 2017. antonio.ramos(at)cttc.es
* Luis Esteve, 2011. luis(at)epsilon-formacion.com
*
* -------------------------------------------------------------------------
@ -74,6 +75,18 @@ bool ChannelFsm::Event_stop_channel()
}
bool ChannelFsm::Event_start_acquisition_fpga()
{
std::lock_guard<std::mutex> lk(mx);
if ((d_state == 1) || (d_state == 2))
{
return false;
}
d_state = 1;
DLOG(INFO) << "CH = " << channel_ << ". Ev start acquisition FPGA";
return true;
}
bool ChannelFsm::Event_start_acquisition()
{
std::lock_guard<std::mutex> lk(mx);

View File

@ -1,7 +1,8 @@
/*!
* \file channel_fsm.h
* \brief Interface of the State Machine for channel
* \authors Antonio Ramos, 2017. antonio.ramos(at)cttc.es
* \authors Javier Arribas, 2019. javiarribas@gmail.com
* Antonio Ramos, 2017. antonio.ramos(at)cttc.es
* Luis Esteve, 2011. luis(at)epsilon-formacion.com
*
* -------------------------------------------------------------------------
@ -55,9 +56,10 @@ public:
void set_telemetry(std::shared_ptr<TelemetryDecoderInterface> telemetry);
void set_queue(gr::msg_queue::sptr queue);
void set_channel(uint32_t channel);
void start_acquisition();
// FSM EVENTS
bool Event_start_acquisition();
bool Event_start_acquisition_fpga();
bool Event_valid_acquisition();
bool Event_stop_channel();
bool Event_failed_acquisition_repeat();
@ -65,7 +67,6 @@ public:
bool Event_failed_tracking_standby();
private:
void start_acquisition();
void start_tracking();
void stop_acquisition();
void stop_tracking();

View File

@ -70,14 +70,10 @@ target_link_libraries(algorithms_libs_rtklib
core_system_parameters
Gflags::gflags
Glog::glog
${LAPACK_LIBRARIES}
${BLAS_LIBRARIES}
)
if(OS_IS_MACOSX)
target_link_libraries(algorithms_libs_rtklib PRIVATE "-framework Accelerate")
else()
target_link_libraries(algorithms_libs_rtklib PRIVATE ${LAPACK} ${BLAS})
endif()
set_property(TARGET algorithms_libs_rtklib
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>

View File

@ -215,9 +215,7 @@ const int NSATQZS = 0;
const int NSYSQZS = 0;
#endif
#ifndef __APPLE__
#define ENABDS
#endif
#ifdef ENABDS
const int MINPRNBDS = 1; //!< min satellite sat number of BeiDou
const int MAXPRNBDS = 37; //!< max satellite sat number of BeiDou

View File

@ -1,9 +1,10 @@
/*!
* \file volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn.h
* \brief VOLK_GNSSSDR kernel: multiplies N complex (32-bit float per component) vectors
* by a common vector, phase rotated and accumulates the results in N float complex outputs.
* by a common vector, phase rotated with Doppler rate and accumulates the results in N float complex outputs.
* \authors <ul>
* <li> Antonio Ramos 2018. antonio.ramosdet(at)gmail.com
* <li> Carles Fernandez, 2019 cfernandez@cttc.es
* <li> Javier Arribas, 2019 javiarribas@cttc.es
* </ul>
*
* VOLK_GNSSSDR kernel that multiplies N 32 bits complex vectors by a common vector, which is
@ -43,8 +44,8 @@
*
* Rotates and multiplies the reference complex vector with an arbitrary number of other real vectors,
* accumulates the results and stores them in the output vector.
* The rotation is done at a fixed rate per sample, from an initial \p phase offset.
* This function can be used for Doppler wipe-off and multiple correlator.
* The rotation is done at a variable rate per sample, from an initial \p phase offset.
* This function can be used for Doppler wipe-off and multiple correlator in the presence of Doppler rate.
*
* <b>Dispatcher Prototype</b>
* \code
@ -70,24 +71,19 @@
#define INCLUDED_volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn_H
#include <volk_gnsssdr/saturation_arithmetic.h>
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <volk_gnsssdr/volk_gnsssdr_complex.h>
#include <volk_gnsssdr/volk_gnsssdr_malloc.h>
#include <math.h>
#ifdef LV_HAVE_GENERIC
static inline void volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn_generic(lv_32fc_t* result, const lv_32fc_t* in_common, const lv_32fc_t phase_inc, const lv_32fc_t phase_inc_rate, lv_32fc_t* phase, const float** in_a, int num_a_vectors, unsigned int num_points)
{
lv_32fc_t tmp32_1;
#ifdef __cplusplus
lv_32fc_t half_phase_inc_rate = std::sqrt(phase_inc_rate);
#else
lv_32fc_t half_phase_inc_rate = csqrtf(phase_inc_rate);
#endif
lv_32fc_t constant_rotation = phase_inc * half_phase_inc_rate;
lv_32fc_t delta_phase_rate = lv_cmake(1.0f, 0.0f);
lv_32fc_t phase_doppler_rate = lv_cmake(1.0f, 0.0f);
lv_32fc_t phase_doppler = (*phase);
int n_vec;
unsigned int n;
for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
@ -96,27 +92,60 @@ static inline void volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn_g
}
for (n = 0; n < num_points; n++)
{
tmp32_1 = *in_common++ * (*phase);
// Regenerate phase
if (n % 256 == 0)
{
#ifdef __cplusplus
(*phase) /= std::abs((*phase));
delta_phase_rate /= std::abs(delta_phase_rate);
#else
(*phase) /= hypotf(lv_creal(*phase), lv_cimag(*phase));
delta_phase_rate /= hypotf(lv_creal(delta_phase_rate), lv_cimag(delta_phase_rate));
#endif
}
(*phase) *= (constant_rotation * delta_phase_rate);
delta_phase_rate *= phase_inc_rate;
tmp32_1 = *in_common++ * (*phase);
phase_doppler *= phase_inc;
phase_doppler_rate = cpowf(phase_inc_rate, lv_cmake(n * n, 0.0f));
(*phase) = phase_doppler * phase_doppler_rate;
for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
{
result[n_vec] += (tmp32_1 * in_a[n_vec][n]);
}
}
}
#endif
#endif /*LV_HAVE_GENERIC*/
#ifdef LV_HAVE_GENERIC
static inline void volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn_generic_acc(lv_32fc_t* result, const lv_32fc_t* in_common, const lv_32fc_t phase_inc, const lv_32fc_t phase_inc_rate, lv_32fc_t* phase, const float** in_a, int num_a_vectors, unsigned int num_points)
{
lv_32fc_t tmp32_1 = lv_cmake(0.0f, 0.0f);
lv_32fc_t phase_rate_acc = lv_cmake(1.0f, 0.0f);
int n_vec;
unsigned int n;
for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
{
result[n_vec] = lv_cmake(0.0f, 0.0f);
}
for (n = 0; n < num_points; n++)
{
// Regenerate phase
if (n % 256 == 0)
{
#ifdef __cplusplus
(*phase) /= std::abs((*phase));
#else
(*phase) /= hypotf(lv_creal(*phase), lv_cimag(*phase));
#endif
}
phase_rate_acc += phase_inc_rate;
(*phase) *= lv_cmake(cosf(phase_rate_acc), sinf(phase_rate_acc));
for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
{
result[n_vec] += (tmp32_1 * in_a[n_vec][n]);
}
}
}
#endif
#endif /* INCLUDED_volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn_H */

View File

@ -1,6 +1,7 @@
/*!
* \file volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc.h
* \brief Volk puppet for the multiple 16-bit complex dot product kernel.
* \brief VOLK_GNSSSDR kernel: multiplies N complex (32-bit float per component) vectors
* by a common vector, phase rotated with Doppler rate and accumulates the results in N float complex outputs.
* \authors <ul>
* <li> Carles Fernandez Prades 2016 cfernandez at cttc dot cat
* </ul>
@ -61,6 +62,7 @@ static inline void volk_gnsssdr_32fc_32f_high_dynamic_rotator_dotprodxnpuppet_32
in_a[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment());
memcpy((float*)in_a[n], (float*)in, sizeof(float) * num_points);
}
volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn_generic(result, local_code, phase_inc[0], phase_inc_rate[0], phase, (const float**)in_a, num_a_vectors, num_points);
for (n = 0; n < num_a_vectors; n++)
@ -71,93 +73,35 @@ static inline void volk_gnsssdr_32fc_32f_high_dynamic_rotator_dotprodxnpuppet_32
}
#endif // Generic
//
//#ifdef LV_HAVE_GENERIC
//static inline void volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc_generic_reload(lv_32fc_t* result, const lv_32fc_t* local_code, const float* in, unsigned int num_points)
//{
// // phases must be normalized. Phase rotator expects a complex exponential input!
// float rem_carrier_phase_in_rad = 0.25;
// float phase_step_rad = 0.1;
// lv_32fc_t phase[1];
// phase[0] = lv_cmake(cos(rem_carrier_phase_in_rad), sin(rem_carrier_phase_in_rad));
// lv_32fc_t phase_inc[1];
// phase_inc[0] = lv_cmake(cos(phase_step_rad), sin(phase_step_rad));
// int n;
// int num_a_vectors = 3;
// float** in_a = (float**)volk_gnsssdr_malloc(sizeof(float*) * num_a_vectors, volk_gnsssdr_get_alignment());
// for (n = 0; n < num_a_vectors; n++)
// {
// in_a[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment());
// memcpy((float*)in_a[n], (float*)in, sizeof(float) * num_points);
// }
// volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_generic_reload(result, local_code, phase_inc[0], phase, (const float**)in_a, num_a_vectors, num_points);
//
// for (n = 0; n < num_a_vectors; n++)
// {
// volk_gnsssdr_free(in_a[n]);
// }
// volk_gnsssdr_free(in_a);
//}
//
//#endif // Generic
//
//#ifdef LV_HAVE_AVX
//static inline void volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc_u_avx(lv_32fc_t* result, const lv_32fc_t* local_code, const float* in, unsigned int num_points)
//{
// // phases must be normalized. Phase rotator expects a complex exponential input!
// float rem_carrier_phase_in_rad = 0.25;
// float phase_step_rad = 0.1;
// lv_32fc_t phase[1];
// phase[0] = lv_cmake(cos(rem_carrier_phase_in_rad), sin(rem_carrier_phase_in_rad));
// lv_32fc_t phase_inc[1];
// phase_inc[0] = lv_cmake(cos(phase_step_rad), sin(phase_step_rad));
// int n;
// int num_a_vectors = 3;
// float** in_a = (float**)volk_gnsssdr_malloc(sizeof(float*) * num_a_vectors, volk_gnsssdr_get_alignment());
// for (n = 0; n < num_a_vectors; n++)
// {
// in_a[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment());
// memcpy((float*)in_a[n], (float*)in, sizeof(float) * num_points);
// }
// volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_u_avx(result, local_code, phase_inc[0], phase, (const float**)in_a, num_a_vectors, num_points);
//
// for (n = 0; n < num_a_vectors; n++)
// {
// volk_gnsssdr_free(in_a[n]);
// }
// volk_gnsssdr_free(in_a);
//}
//
//#endif // AVX
//
//
//#ifdef LV_HAVE_AVX
//static inline void volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc_a_avx(lv_32fc_t* result, const lv_32fc_t* local_code, const float* in, unsigned int num_points)
//{
// // phases must be normalized. Phase rotator expects a complex exponential input!
// float rem_carrier_phase_in_rad = 0.25;
// float phase_step_rad = 0.1;
// lv_32fc_t phase[1];
// phase[0] = lv_cmake(cos(rem_carrier_phase_in_rad), sin(rem_carrier_phase_in_rad));
// lv_32fc_t phase_inc[1];
// phase_inc[0] = lv_cmake(cos(phase_step_rad), sin(phase_step_rad));
// int n;
// int num_a_vectors = 3;
// float** in_a = (float**)volk_gnsssdr_malloc(sizeof(float*) * num_a_vectors, volk_gnsssdr_get_alignment());
// for (n = 0; n < num_a_vectors; n++)
// {
// in_a[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment());
// memcpy((float*)in_a[n], (float*)in, sizeof(float) * num_points);
// }
// volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_a_avx(result, local_code, phase_inc[0], phase, (const float**)in_a, num_a_vectors, num_points);
//
// for (n = 0; n < num_a_vectors; n++)
// {
// volk_gnsssdr_free(in_a[n]);
// }
// volk_gnsssdr_free(in_a);
//}
//
//#endif // AVX
#ifdef LV_HAVE_GENERIC
static inline void volk_gnsssdr_32fc_32f_high_dynamic_rotator_dotprodxnpuppet_32fc_generic_acc(lv_32fc_t* result, const lv_32fc_t* local_code, const float* in, unsigned int num_points)
{
// phases must be normalized. Phase rotator expects a complex exponential input!
float rem_carrier_phase_in_rad = 0.25;
float phase_step_rad = 0.1;
lv_32fc_t phase[1];
phase[0] = lv_cmake(cos(rem_carrier_phase_in_rad), sin(rem_carrier_phase_in_rad));
lv_32fc_t phase_inc[1];
phase_inc[0] = lv_cmake(cos(phase_step_rad), sin(phase_step_rad));
lv_32fc_t phase_inc_rate[1];
phase_inc_rate[0] = lv_cmake(cos(phase_step_rad * 0.001), sin(phase_step_rad * 0.001));
int n;
int num_a_vectors = 3;
float** in_a = (float**)volk_gnsssdr_malloc(sizeof(float*) * num_a_vectors, volk_gnsssdr_get_alignment());
for (n = 0; n < num_a_vectors; n++)
{
in_a[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment());
memcpy((float*)in_a[n], (float*)in, sizeof(float) * num_points);
}
volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn_generic_acc(result, local_code, phase_inc[0], phase_inc_rate[0], phase, (const float**)in_a, num_a_vectors, num_points);
for (n = 0; n < num_a_vectors; n++)
{
volk_gnsssdr_free(in_a[n]);
}
volk_gnsssdr_free(in_a);
}
#endif // Generic
#endif // INCLUDED_volk_gnsssdr_32fc_32f_high_dynamic_rotator_dotprodxnpuppet_32fc_H

View File

@ -73,6 +73,49 @@ BeidouB1iDllPllTracking::BeidouB1iDllPllTracking(
dll_bw_hz = static_cast<float>(FLAGS_dll_bw_hz);
}
trk_param.dll_bw_hz = dll_bw_hz;
int dll_filter_order = configuration->property(role + ".dll_filter_order", 2);
if (dll_filter_order < 1)
{
LOG(WARNING) << "dll_filter_order parameter must be 1, 2 or 3. Set to 1.";
dll_filter_order = 1;
}
if (dll_filter_order > 3)
{
LOG(WARNING) << "dll_filter_order parameter must be 1, 2 or 3. Set to 3.";
dll_filter_order = 3;
}
trk_param.dll_filter_order = dll_filter_order;
int pll_filter_order = configuration->property(role + ".pll_filter_order", 3);
if (pll_filter_order < 2)
{
LOG(WARNING) << "pll_filter_order parameter must be 2 or 3. Set to 2.";
pll_filter_order = 2;
}
if (pll_filter_order > 3)
{
LOG(WARNING) << "pll_filter_order parameter must be 2 or 3. Set to 3.";
pll_filter_order = 3;
}
trk_param.pll_filter_order = pll_filter_order;
if (pll_filter_order == 2)
{
trk_param.fll_filter_order = 1;
}
if (pll_filter_order == 3)
{
trk_param.fll_filter_order = 2;
}
bool enable_fll_pull_in = configuration->property(role + ".enable_fll_pull_in", false);
trk_param.enable_fll_pull_in = enable_fll_pull_in;
float fll_bw_hz = configuration->property(role + ".fll_bw_hz", 35.0);
trk_param.fll_bw_hz = fll_bw_hz;
float pull_in_time_s = configuration->property(role + ".pull_in_time_s", 2.0);
trk_param.pull_in_time_s = pull_in_time_s;
float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5);
trk_param.early_late_space_chips = early_late_space_chips;
float early_late_space_narrow_chips = configuration->property(role + ".early_late_space_narrow_chips", 0.5);

View File

@ -68,6 +68,49 @@ BeidouB3iDllPllTracking::BeidouB3iDllPllTracking(
float dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0);
if (FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast<float>(FLAGS_dll_bw_hz);
trk_param.dll_bw_hz = dll_bw_hz;
int dll_filter_order = configuration->property(role + ".dll_filter_order", 2);
if (dll_filter_order < 1)
{
LOG(WARNING) << "dll_filter_order parameter must be 1, 2 or 3. Set to 1.";
dll_filter_order = 1;
}
if (dll_filter_order > 3)
{
LOG(WARNING) << "dll_filter_order parameter must be 1, 2 or 3. Set to 3.";
dll_filter_order = 3;
}
trk_param.dll_filter_order = dll_filter_order;
int pll_filter_order = configuration->property(role + ".pll_filter_order", 3);
if (pll_filter_order < 2)
{
LOG(WARNING) << "pll_filter_order parameter must be 2 or 3. Set to 2.";
pll_filter_order = 2;
}
if (pll_filter_order > 3)
{
LOG(WARNING) << "pll_filter_order parameter must be 2 or 3. Set to 3.";
pll_filter_order = 3;
}
trk_param.pll_filter_order = pll_filter_order;
if (pll_filter_order == 2)
{
trk_param.fll_filter_order = 1;
}
if (pll_filter_order == 3)
{
trk_param.fll_filter_order = 2;
}
bool enable_fll_pull_in = configuration->property(role + ".enable_fll_pull_in", false);
trk_param.enable_fll_pull_in = enable_fll_pull_in;
float fll_bw_hz = configuration->property(role + ".fll_bw_hz", 35.0);
trk_param.fll_bw_hz = fll_bw_hz;
float pull_in_time_s = configuration->property(role + ".pull_in_time_s", 2.0);
trk_param.pull_in_time_s = pull_in_time_s;
float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5);
trk_param.early_late_space_chips = early_late_space_chips;
float early_late_space_narrow_chips = configuration->property(role + ".early_late_space_narrow_chips", 0.5);
@ -141,8 +184,7 @@ BeidouB3iDllPllTracking::BeidouB3iDllPllTracking(
}
BeidouB3iDllPllTracking::~BeidouB3iDllPllTracking()
= default;
BeidouB3iDllPllTracking::~BeidouB3iDllPllTracking() = default;
void BeidouB3iDllPllTracking::start_tracking()

View File

@ -88,6 +88,49 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking(
trk_param.pll_bw_narrow_hz = pll_bw_narrow_hz;
float dll_bw_narrow_hz = configuration->property(role + ".dll_bw_narrow_hz", 0.25);
trk_param.dll_bw_narrow_hz = dll_bw_narrow_hz;
int dll_filter_order = configuration->property(role + ".dll_filter_order", 2);
if (dll_filter_order < 1)
{
LOG(WARNING) << "dll_filter_order parameter must be 1, 2 or 3. Set to 1.";
dll_filter_order = 1;
}
if (dll_filter_order > 3)
{
LOG(WARNING) << "dll_filter_order parameter must be 1, 2 or 3. Set to 3.";
dll_filter_order = 3;
}
trk_param.dll_filter_order = dll_filter_order;
int pll_filter_order = configuration->property(role + ".pll_filter_order", 3);
if (pll_filter_order < 2)
{
LOG(WARNING) << "pll_filter_order parameter must be 2 or 3. Set to 2.";
pll_filter_order = 2;
}
if (pll_filter_order > 3)
{
LOG(WARNING) << "pll_filter_order parameter must be 2 or 3. Set to 3.";
pll_filter_order = 3;
}
trk_param.pll_filter_order = pll_filter_order;
if (pll_filter_order == 2)
{
trk_param.fll_filter_order = 1;
}
if (pll_filter_order == 3)
{
trk_param.fll_filter_order = 2;
}
bool enable_fll_pull_in = configuration->property(role + ".enable_fll_pull_in", false);
trk_param.enable_fll_pull_in = enable_fll_pull_in;
float fll_bw_hz = configuration->property(role + ".fll_bw_hz", 35.0);
trk_param.fll_bw_hz = fll_bw_hz;
float pull_in_time_s = configuration->property(role + ".pull_in_time_s", 2.0);
trk_param.pull_in_time_s = pull_in_time_s;
int extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", 1);
float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.15);
trk_param.early_late_space_chips = early_late_space_chips;

View File

@ -83,6 +83,49 @@ GalileoE5aDllPllTracking::GalileoE5aDllPllTracking(
dll_bw_hz = static_cast<float>(FLAGS_dll_bw_hz);
}
trk_param.dll_bw_hz = dll_bw_hz;
int dll_filter_order = configuration->property(role + ".dll_filter_order", 2);
if (dll_filter_order < 1)
{
LOG(WARNING) << "dll_filter_order parameter must be 1, 2 or 3. Set to 1.";
dll_filter_order = 1;
}
if (dll_filter_order > 3)
{
LOG(WARNING) << "dll_filter_order parameter must be 1, 2 or 3. Set to 3.";
dll_filter_order = 3;
}
trk_param.dll_filter_order = dll_filter_order;
int pll_filter_order = configuration->property(role + ".pll_filter_order", 3);
if (pll_filter_order < 2)
{
LOG(WARNING) << "pll_filter_order parameter must be 2 or 3. Set to 2.";
pll_filter_order = 2;
}
if (pll_filter_order > 3)
{
LOG(WARNING) << "pll_filter_order parameter must be 2 or 3. Set to 3.";
pll_filter_order = 3;
}
trk_param.pll_filter_order = pll_filter_order;
if (pll_filter_order == 2)
{
trk_param.fll_filter_order = 1;
}
if (pll_filter_order == 3)
{
trk_param.fll_filter_order = 2;
}
bool enable_fll_pull_in = configuration->property(role + ".enable_fll_pull_in", false);
trk_param.enable_fll_pull_in = enable_fll_pull_in;
float fll_bw_hz = configuration->property(role + ".fll_bw_hz", 35.0);
trk_param.fll_bw_hz = fll_bw_hz;
float pull_in_time_s = configuration->property(role + ".pull_in_time_s", 2.0);
trk_param.pull_in_time_s = pull_in_time_s;
float pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz", 5.0);
trk_param.pll_bw_narrow_hz = pll_bw_narrow_hz;
float dll_bw_narrow_hz = configuration->property(role + ".dll_bw_narrow_hz", 2.0);

View File

@ -89,6 +89,49 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking(
dll_bw_hz = static_cast<float>(FLAGS_dll_bw_hz);
}
trk_param.dll_bw_hz = dll_bw_hz;
int dll_filter_order = configuration->property(role + ".dll_filter_order", 2);
if (dll_filter_order < 1)
{
LOG(WARNING) << "dll_filter_order parameter must be 1, 2 or 3. Set to 1.";
dll_filter_order = 1;
}
if (dll_filter_order > 3)
{
LOG(WARNING) << "dll_filter_order parameter must be 1, 2 or 3. Set to 3.";
dll_filter_order = 3;
}
trk_param.dll_filter_order = dll_filter_order;
int pll_filter_order = configuration->property(role + ".pll_filter_order", 3);
if (pll_filter_order < 2)
{
LOG(WARNING) << "pll_filter_order parameter must be 2 or 3. Set to 2.";
pll_filter_order = 2;
}
if (pll_filter_order > 3)
{
LOG(WARNING) << "pll_filter_order parameter must be 2 or 3. Set to 3.";
pll_filter_order = 3;
}
trk_param.pll_filter_order = pll_filter_order;
if (pll_filter_order == 2)
{
trk_param.fll_filter_order = 1;
}
if (pll_filter_order == 3)
{
trk_param.fll_filter_order = 2;
}
bool enable_fll_pull_in = configuration->property(role + ".enable_fll_pull_in", false);
trk_param.enable_fll_pull_in = enable_fll_pull_in;
float fll_bw_hz = configuration->property(role + ".fll_bw_hz", 35.0);
trk_param.fll_bw_hz = fll_bw_hz;
float pull_in_time_s = configuration->property(role + ".pull_in_time_s", 2.0);
trk_param.pull_in_time_s = pull_in_time_s;
float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5);
trk_param.early_late_space_chips = early_late_space_chips;
float early_late_space_narrow_chips = configuration->property(role + ".early_late_space_narrow_chips", 0.5);

View File

@ -77,6 +77,49 @@ GpsL2MDllPllTracking::GpsL2MDllPllTracking(
float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5);
trk_param.early_late_space_chips = early_late_space_chips;
trk_param.early_late_space_narrow_chips = 0.0;
int dll_filter_order = configuration->property(role + ".dll_filter_order", 2);
if (dll_filter_order < 1)
{
LOG(WARNING) << "dll_filter_order parameter must be 1, 2 or 3. Set to 1.";
dll_filter_order = 1;
}
if (dll_filter_order > 3)
{
LOG(WARNING) << "dll_filter_order parameter must be 1, 2 or 3. Set to 3.";
dll_filter_order = 3;
}
trk_param.dll_filter_order = dll_filter_order;
int pll_filter_order = configuration->property(role + ".pll_filter_order", 3);
if (pll_filter_order < 2)
{
LOG(WARNING) << "pll_filter_order parameter must be 2 or 3. Set to 2.";
pll_filter_order = 2;
}
if (pll_filter_order > 3)
{
LOG(WARNING) << "pll_filter_order parameter must be 2 or 3. Set to 3.";
pll_filter_order = 3;
}
trk_param.pll_filter_order = pll_filter_order;
if (pll_filter_order == 2)
{
trk_param.fll_filter_order = 1;
}
if (pll_filter_order == 3)
{
trk_param.fll_filter_order = 2;
}
bool enable_fll_pull_in = configuration->property(role + ".enable_fll_pull_in", false);
trk_param.enable_fll_pull_in = enable_fll_pull_in;
float fll_bw_hz = configuration->property(role + ".fll_bw_hz", 35.0);
trk_param.fll_bw_hz = fll_bw_hz;
float pull_in_time_s = configuration->property(role + ".pull_in_time_s", 2.0);
trk_param.pull_in_time_s = pull_in_time_s;
int vector_length = std::round(static_cast<double>(fs_in) / (static_cast<double>(GPS_L2_M_CODE_RATE_HZ) / static_cast<double>(GPS_L2_M_CODE_LENGTH_CHIPS)));
trk_param.vector_length = vector_length;
int symbols_extended_correlator = configuration->property(role + ".extend_correlation_symbols", 1);

View File

@ -90,6 +90,49 @@ GpsL5DllPllTracking::GpsL5DllPllTracking(
trk_param.dll_bw_narrow_hz = dll_bw_narrow_hz;
float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5);
trk_param.early_late_space_chips = early_late_space_chips;
int dll_filter_order = configuration->property(role + ".dll_filter_order", 2);
if (dll_filter_order < 1)
{
LOG(WARNING) << "dll_filter_order parameter must be 1, 2 or 3. Set to 1.";
dll_filter_order = 1;
}
if (dll_filter_order > 3)
{
LOG(WARNING) << "dll_filter_order parameter must be 1, 2 or 3. Set to 3.";
dll_filter_order = 3;
}
trk_param.dll_filter_order = dll_filter_order;
int pll_filter_order = configuration->property(role + ".pll_filter_order", 3);
if (pll_filter_order < 2)
{
LOG(WARNING) << "pll_filter_order parameter must be 2 or 3. Set to 2.";
pll_filter_order = 2;
}
if (pll_filter_order > 3)
{
LOG(WARNING) << "pll_filter_order parameter must be 2 or 3. Set to 3.";
pll_filter_order = 3;
}
trk_param.pll_filter_order = pll_filter_order;
if (pll_filter_order == 2)
{
trk_param.fll_filter_order = 1;
}
if (pll_filter_order == 3)
{
trk_param.fll_filter_order = 2;
}
bool enable_fll_pull_in = configuration->property(role + ".enable_fll_pull_in", false);
trk_param.enable_fll_pull_in = enable_fll_pull_in;
float fll_bw_hz = configuration->property(role + ".fll_bw_hz", 35.0);
trk_param.fll_bw_hz = fll_bw_hz;
float pull_in_time_s = configuration->property(role + ".pull_in_time_s", 2.0);
trk_param.pull_in_time_s = pull_in_time_s;
int vector_length = std::round(static_cast<double>(fs_in) / (static_cast<double>(GPS_L5I_CODE_RATE_HZ) / static_cast<double>(GPS_L5I_CODE_LENGTH_CHIPS)));
trk_param.vector_length = vector_length;
int extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", 1);

View File

@ -436,74 +436,74 @@ void dll_pll_veml_tracking_fpga::start_tracking()
d_carrier_doppler_hz = d_acq_carrier_doppler_hz;
d_carrier_phase_step_rad = PI_2 * d_carrier_doppler_hz / trk_parameters.fs_in;
d_carrier_phase_rate_step_rad = 0.0;
d_carr_ph_history.clear();
d_code_ph_history.clear();
// DLL/PLL filter initialization
d_carrier_loop_filter.initialize(); // initialize the carrier filter
d_code_loop_filter.initialize(); // initialize the code filter
// d_carr_ph_history.clear();
// d_code_ph_history.clear();
// // DLL/PLL filter initialization
// d_carrier_loop_filter.initialize(); // initialize the carrier filter
// d_code_loop_filter.initialize(); // initialize the code filter
//
// if (systemName == "GPS" and signal_type == "L5")
// {
// if (trk_parameters.track_pilot)
// {
// d_Prompt_Data[0] = gr_complex(0.0, 0.0);
// }
// }
// else if (systemName == "Galileo" and signal_type == "1B")
// {
// if (trk_parameters.track_pilot)
// {
// d_Prompt_Data[0] = gr_complex(0.0, 0.0);
// }
// }
// else if (systemName == "Galileo" and signal_type == "5X")
// {
// if (trk_parameters.track_pilot)
// {
// d_secondary_code_string = const_cast<std::string *>(&GALILEO_E5A_Q_SECONDARY_CODE[d_acquisition_gnss_synchro->PRN - 1]);
// d_Prompt_Data[0] = gr_complex(0.0, 0.0);
// }
// }
//
// std::fill_n(d_correlator_outs, d_n_correlator_taps, gr_complex(0.0, 0.0));
//
// d_carrier_lock_fail_counter = 0;
// d_rem_code_phase_samples = 0.0;
// d_rem_carr_phase_rad = 0.0;
// d_rem_code_phase_chips = 0.0;
// d_acc_carrier_phase_rad = 0.0;
// d_cn0_estimation_counter = 0;
// d_carrier_lock_test = 1.0;
// d_CN0_SNV_dB_Hz = 0.0;
if (systemName == "GPS" and signal_type == "L5")
{
if (trk_parameters.track_pilot)
{
d_Prompt_Data[0] = gr_complex(0.0, 0.0);
}
}
else if (systemName == "Galileo" and signal_type == "1B")
{
if (trk_parameters.track_pilot)
{
d_Prompt_Data[0] = gr_complex(0.0, 0.0);
}
}
else if (systemName == "Galileo" and signal_type == "5X")
{
if (trk_parameters.track_pilot)
{
d_secondary_code_string = const_cast<std::string *>(&GALILEO_E5A_Q_SECONDARY_CODE[d_acquisition_gnss_synchro->PRN - 1]);
d_Prompt_Data[0] = gr_complex(0.0, 0.0);
}
}
std::fill_n(d_correlator_outs, d_n_correlator_taps, gr_complex(0.0, 0.0));
d_carrier_lock_fail_counter = 0;
d_rem_code_phase_samples = 0.0;
d_rem_carr_phase_rad = 0.0;
d_rem_code_phase_chips = 0.0;
d_acc_carrier_phase_rad = 0.0;
d_cn0_estimation_counter = 0;
d_carrier_lock_test = 1.0;
d_CN0_SNV_dB_Hz = 0.0;
if (d_veml)
{
d_local_code_shift_chips[0] = -trk_parameters.very_early_late_space_chips * static_cast<float>(d_code_samples_per_chip);
d_local_code_shift_chips[1] = -trk_parameters.early_late_space_chips * static_cast<float>(d_code_samples_per_chip);
d_local_code_shift_chips[3] = trk_parameters.early_late_space_chips * static_cast<float>(d_code_samples_per_chip);
d_local_code_shift_chips[4] = trk_parameters.very_early_late_space_chips * static_cast<float>(d_code_samples_per_chip);
}
else
{
d_local_code_shift_chips[0] = -trk_parameters.early_late_space_chips * static_cast<float>(d_code_samples_per_chip);
d_local_code_shift_chips[2] = trk_parameters.early_late_space_chips * static_cast<float>(d_code_samples_per_chip);
}
d_code_loop_filter.set_DLL_BW(trk_parameters.dll_bw_hz);
d_carrier_loop_filter.set_PLL_BW(trk_parameters.pll_bw_hz);
d_carrier_loop_filter.set_pdi(static_cast<float>(d_code_period));
d_code_loop_filter.set_pdi(static_cast<float>(d_code_period));
// if (d_veml)
// {
// d_local_code_shift_chips[0] = -trk_parameters.very_early_late_space_chips * static_cast<float>(d_code_samples_per_chip);
// d_local_code_shift_chips[1] = -trk_parameters.early_late_space_chips * static_cast<float>(d_code_samples_per_chip);
// d_local_code_shift_chips[3] = trk_parameters.early_late_space_chips * static_cast<float>(d_code_samples_per_chip);
// d_local_code_shift_chips[4] = trk_parameters.very_early_late_space_chips * static_cast<float>(d_code_samples_per_chip);
// }
// else
// {
// d_local_code_shift_chips[0] = -trk_parameters.early_late_space_chips * static_cast<float>(d_code_samples_per_chip);
// d_local_code_shift_chips[2] = trk_parameters.early_late_space_chips * static_cast<float>(d_code_samples_per_chip);
// }
// d_code_loop_filter.set_DLL_BW(trk_parameters.dll_bw_hz);
// d_carrier_loop_filter.set_PLL_BW(trk_parameters.pll_bw_hz);
// d_carrier_loop_filter.set_pdi(static_cast<float>(d_code_period));
// d_code_loop_filter.set_pdi(static_cast<float>(d_code_period));
//
// DEBUG OUTPUT
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;
DLOG(INFO) << "Starting tracking of satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel;
multicorrelator_fpga->set_local_code_and_taps(d_local_code_shift_chips, d_prompt_data_shift, d_acquisition_gnss_synchro->PRN);
//
// multicorrelator_fpga->set_local_code_and_taps(d_local_code_shift_chips, d_prompt_data_shift, d_acquisition_gnss_synchro->PRN);
// enable tracking pull-in
d_state = 1;
d_cloop = true;
d_Prompt_buffer_deque.clear();
d_last_prompt = gr_complex(0.0, 0.0);
// d_Prompt_buffer_deque.clear();
// d_last_prompt = gr_complex(0.0, 0.0);
}
@ -1237,6 +1237,77 @@ void dll_pll_veml_tracking_fpga::set_channel(uint32_t channel)
void dll_pll_veml_tracking_fpga::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro)
{
d_acquisition_gnss_synchro = p_gnss_synchro;
if (p_gnss_synchro->PRN > 0)
{
//std::cout << "Acquisition is about to start " << std::endl;
d_carr_ph_history.clear();
d_code_ph_history.clear();
// DLL/PLL filter initialization
d_carrier_loop_filter.initialize(); // initialize the carrier filter
d_code_loop_filter.initialize(); // initialize the code filter
if (systemName == "GPS" and signal_type == "L5")
{
if (trk_parameters.track_pilot)
{
d_Prompt_Data[0] = gr_complex(0.0, 0.0);
}
}
else if (systemName == "Galileo" and signal_type == "1B")
{
if (trk_parameters.track_pilot)
{
d_Prompt_Data[0] = gr_complex(0.0, 0.0);
}
}
else if (systemName == "Galileo" and signal_type == "5X")
{
if (trk_parameters.track_pilot)
{
d_secondary_code_string = const_cast<std::string *>(&GALILEO_E5A_Q_SECONDARY_CODE[d_acquisition_gnss_synchro->PRN - 1]);
d_Prompt_Data[0] = gr_complex(0.0, 0.0);
}
}
std::fill_n(d_correlator_outs, d_n_correlator_taps, gr_complex(0.0, 0.0));
d_carrier_lock_fail_counter = 0;
d_rem_code_phase_samples = 0.0;
d_rem_carr_phase_rad = 0.0;
d_rem_code_phase_chips = 0.0;
d_acc_carrier_phase_rad = 0.0;
d_cn0_estimation_counter = 0;
d_carrier_lock_test = 1.0;
d_CN0_SNV_dB_Hz = 0.0;
if (d_veml)
{
d_local_code_shift_chips[0] = -trk_parameters.very_early_late_space_chips * static_cast<float>(d_code_samples_per_chip);
d_local_code_shift_chips[1] = -trk_parameters.early_late_space_chips * static_cast<float>(d_code_samples_per_chip);
d_local_code_shift_chips[3] = trk_parameters.early_late_space_chips * static_cast<float>(d_code_samples_per_chip);
d_local_code_shift_chips[4] = trk_parameters.very_early_late_space_chips * static_cast<float>(d_code_samples_per_chip);
}
else
{
d_local_code_shift_chips[0] = -trk_parameters.early_late_space_chips * static_cast<float>(d_code_samples_per_chip);
d_local_code_shift_chips[2] = trk_parameters.early_late_space_chips * static_cast<float>(d_code_samples_per_chip);
}
d_code_loop_filter.set_DLL_BW(trk_parameters.dll_bw_hz);
d_carrier_loop_filter.set_PLL_BW(trk_parameters.pll_bw_hz);
d_carrier_loop_filter.set_pdi(static_cast<float>(d_code_period));
d_code_loop_filter.set_pdi(static_cast<float>(d_code_period));
// // DEBUG OUTPUT
// 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;
// DLOG(INFO) << "Starting tracking of satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel;
multicorrelator_fpga->set_local_code_and_taps(d_local_code_shift_chips, d_prompt_data_shift, d_acquisition_gnss_synchro->PRN);
d_Prompt_buffer_deque.clear();
d_last_prompt = gr_complex(0.0, 0.0);
}
}
@ -1266,7 +1337,9 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
{
case 0: // Standby - Consume samples at full throttle, do nothing
{
return 0;
*out[0] = *d_acquisition_gnss_synchro;
usleep(1000);
return 1;
break;
}
case 1: // Pull-in