diff --git a/CMakeLists.txt b/CMakeLists.txt
index 12918282e..265e79ec5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,6 +22,7 @@
 if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
     message(WARNING "In-tree build is bad practice. Try 'cd build && cmake ../' ")
 endif(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
+
 cmake_minimum_required(VERSION 2.8)
 project(gnss-sdr CXX C)
 list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
@@ -83,6 +84,7 @@ if(ENABLE_FPGA)
 endif(ENABLE_FPGA)
 
 
+
 ###############################
 # GNSS-SDR version information
 ###############################
@@ -279,32 +281,87 @@ if(UNIX)
                    )
 endif(UNIX)
 
-
-
-################################################################################
-# Checkout cmake version
-################################################################################
-if(CMAKE_VERSION VERSION_LESS 2.8.8)
-      message(STATUS "Your CMake version is too old and does not support some features required by GNSS-SDR. CMake version must be at least 2.8.8. For more information check https://github.com/joakimkarlsson/bandit/issues/40")
-      message(FATAL_ERROR "Fatal error: CMake >= 2.8.8 required.")
-endif(CMAKE_VERSION VERSION_LESS 2.8.8)
+# Determine if we are using make or ninja
+if(CMAKE_MAKE_PROGRAM MATCHES "make")
+   set(CMAKE_MAKE_PROGRAM_PRETTY_NAME "make")
+endif(CMAKE_MAKE_PROGRAM MATCHES "make")
+if(CMAKE_MAKE_PROGRAM MATCHES "ninja")
+   set(CMAKE_MAKE_PROGRAM_PRETTY_NAME "ninja")
+endif(CMAKE_MAKE_PROGRAM MATCHES "ninja")
+if(NOT CMAKE_MAKE_PROGRAM_PRETTY_NAME)
+   set(CMAKE_MAKE_PROGRAM_PRETTY_NAME "${CMAKE_MAKE_PROGRAM}")
+endif(NOT CMAKE_MAKE_PROGRAM_PRETTY_NAME)
 
 
 
 ################################################################################
-# Checkout compiler version
+# Minimum required versions
 ################################################################################
-if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
-      if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
-          message(STATUS "Your GCC version is too old and does not support some C++11 features required by GNSS-SDR. GCC version must be at least 4.7")
+set(GNSSSDR_CMAKE_MIN_VERSION "2.8.8")
+set(GNSSSDR_GCC_MIN_VERSION "4.7.2")
+set(GNSSSDR_CLANG_MIN_VERSION "3.4.0")
+set(GNSSSDR_APPLECLANG_MIN_VERSION "500")
+set(GNSSSDR_GNURADIO_MIN_VERSION "3.7.3")
+set(GNSSSDR_BOOST_MIN_VERSION "1.45")
+set(GNSSSDR_PYTHON_MIN_VERSION "2.7")
+set(GNSSSDR_MAKO_MIN_VERSION "0.4.2")
+set(GNSSSDR_ARMADILLO_MIN_VERSION "4.200.0")
+
+
+
+################################################################################
+# Check cmake version
+################################################################################
+if(CMAKE_VERSION VERSION_LESS ${GNSSSDR_CMAKE_MIN_VERSION})
+      message(STATUS "Your CMake version is too old and does not support some features required by GNSS-SDR. CMake version must be at least ${GNSSSDR_CMAKE_MIN_VERSION}. For more information check https://github.com/joakimkarlsson/bandit/issues/40")
+      message(FATAL_ERROR "Fatal error: CMake >= ${GNSSSDR_CMAKE_MIN_VERSION} required.")
+endif(CMAKE_VERSION VERSION_LESS ${GNSSSDR_CMAKE_MIN_VERSION})
+
+
+
+################################################################################
+# Check compiler version
+################################################################################
+if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+      if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${GNSSSDR_GCC_MIN_VERSION})
+          message(STATUS "Your GCC version is too old and does not support some C++ features required by GNSS-SDR. GCC version must be at least ${GNSSSDR_GCC_MIN_VERSION}")
           if(${LINUX_DISTRIBUTION} MATCHES "Ubuntu")
               if(${LINUX_VER} MATCHES "12.04")
                   message(STATUS "For instructions on how to upgrade GCC, check http://askubuntu.com/a/271561")
               endif(${LINUX_VER} MATCHES "12.04")
           endif(${LINUX_DISTRIBUTION} MATCHES "Ubuntu")
-          message(FATAL_ERROR "Fatal error: GCC >= 4.7 required.")
-      endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
-endif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+          message(FATAL_ERROR "Fatal error: GCC >= ${GNSSSDR_GCC_MIN_VERSION} required.")
+      endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${GNSSSDR_GCC_MIN_VERSION})
+endif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+
+if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+    execute_process(COMMAND
+        ${CMAKE_CXX_COMPILER} -v
+        RESULT_VARIABLE _res ERROR_VARIABLE _err
+        ERROR_STRIP_TRAILING_WHITESPACE)
+    if(${_res} STREQUAL "0")
+        # output is in error stream
+        string(REGEX MATCH "^Apple.*" IS_APPLE ${_err})
+        if("${IS_APPLE}" STREQUAL "")
+            set(MIN_VERSION ${GNSSSDR_CLANG_MIN_VERSION})
+            set(APPLE_STR "")
+            # retrieve the compiler's version from it
+            string(REGEX MATCH "clang version [0-9.]+" CLANG_OTHER_VERSION ${_err})
+            string(REGEX MATCH "[0-9.]+" CLANG_VERSION ${CLANG_OTHER_VERSION})
+        else("${IS_APPLE}" STREQUAL "")
+            set(MIN_VERSION ${GNSSSDR_APPLECLANG_MIN_VERSION})
+            set(APPLE_STR "Apple ")
+            # retrieve the compiler's version from it
+            string(REGEX MATCH "(clang-[0-9.]+)" CLANG_APPLE_VERSION ${_err})
+            string(REGEX MATCH "[0-9.]+" CLANG_VERSION ${CLANG_APPLE_VERSION})
+        endif("${IS_APPLE}" STREQUAL "")
+        if(${CLANG_VERSION} VERSION_LESS "${MIN_VERSION}")
+            message(WARNING "\nThe compiler selected to build GNSS-SDR (${APPLE_STR}Clang version ${CLANG_VERSION} : ${CMAKE_CXX_COMPILER}) is older than that officially supported (${MIN_VERSION} minimum). This build may or not work. We highly recommend using Apple Clang version ${APPLECLANG_MIN_VERSION} or more recent, or Clang version ${CLANG_MIN_VERSION} or more recent.")
+        endif(${CLANG_VERSION} VERSION_LESS "${MIN_VERSION}")
+    else(${_res} STREQUAL "0")
+        message(WARNING "\nCannot determine the version of the compiler selected to build GNSS-SDR (${APPLE_STR}Clang : ${CMAKE_CXX_COMPILER}). This build may or not work. We highly recommend using Apple Clang version ${APPLECLANG_MIN_VERSION} or more recent, or Clang version ${CLANG_MIN_VERSION} or more recent.")
+    endif(${_res} STREQUAL "0")
+endif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
 
 
 
@@ -339,6 +396,7 @@ if(OS_IS_LINUX)
 endif(OS_IS_LINUX)
 
 
+
 ################################################################################
 # Googletest - https://github.com/google/googletest
 ################################################################################
@@ -364,7 +422,7 @@ if(ENABLE_UNIT_TESTING OR ENABLE_SYSTEM_TESTING)
         else(LIBGTEST_DEV_DIR)
             message (STATUS " Googletest has not been found.")
             message (STATUS " Googletest will be downloaded and built automatically ")
-            message (STATUS " when doing 'make'. ")
+            message (STATUS " when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'. ")
         endif(LIBGTEST_DEV_DIR)
     endif(GTEST_DIR)
 endif(ENABLE_UNIT_TESTING OR ENABLE_SYSTEM_TESTING)
@@ -384,12 +442,13 @@ set(Boost_ADDITIONAL_VERSIONS
     "1.60.0" "1.60" "1.61.0" "1.61" "1.62.0" "1.62" "1.63.0" "1.63" "1.64.0" "1.64"
     "1.65.0" "1.65" "1.66.0" "1.66" "1.67.0" "1.67" "1.68.0" "1.68" "1.69.0" "1.69"
     "1.70.0" "1.70" "1.71.0" "1.71" "1.72.0" "1.72" "1.73.0" "1.73" "1.74.0" "1.74"
+    "1.75.0" "1.75" "1.76.0" "1.76" "1.77.0" "1.77" "1.78.0" "1.78" "1.79.0" "1.79"
 )
 set(Boost_USE_MULTITHREAD ON)
 set(Boost_USE_STATIC_LIBS OFF)
 find_package(Boost COMPONENTS date_time system filesystem thread serialization chrono unit_test_framework program_options REQUIRED)
 if(NOT Boost_FOUND)
-     message(FATAL_ERROR "Fatal error: Boost (version >=1.45.0) required.")
+     message(FATAL_ERROR "Fatal error: Boost (version >=${GNSSSDR_BOOST_MIN_VERSION}) required.")
 endif(NOT Boost_FOUND)
 
 
@@ -400,17 +459,17 @@ endif(NOT Boost_FOUND)
 set(GR_REQUIRED_COMPONENTS RUNTIME ANALOG BLOCKS FFT FILTER PMT)
 find_package(Gnuradio)
 if(PC_GNURADIO_RUNTIME_VERSION)
-   if(PC_GNURADIO_RUNTIME_VERSION VERSION_LESS 3.7.3)
+   if(PC_GNURADIO_RUNTIME_VERSION VERSION_LESS ${GNSSSDR_GNURADIO_MIN_VERSION})
        set(GNURADIO_RUNTIME_FOUND)
        message(STATUS "The GNU Radio version installed in your system is too old.")
-   endif(PC_GNURADIO_RUNTIME_VERSION VERSION_LESS 3.7.3)
+   endif(PC_GNURADIO_RUNTIME_VERSION VERSION_LESS ${GNSSSDR_GNURADIO_MIN_VERSION})
 endif(PC_GNURADIO_RUNTIME_VERSION)
 if(NOT GNURADIO_RUNTIME_FOUND)
-   message(STATUS "CMake cannot find GNU Radio >= 3.7.3")
+   message(STATUS "CMake cannot find GNU Radio >= ${GNSSSDR_GNURADIO_MIN_VERSION}")
    if(OS_IS_LINUX)
        message("Go to https://github.com/gnuradio/pybombs")
        message("and follow the instructions to install GNU Radio in your system.")
-       message(FATAL_ERROR "GNU Radio 3.7.3 or later is required to build gnss-sdr")
+       message(FATAL_ERROR "GNU Radio ${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr")
    endif(OS_IS_LINUX)
    if(OS_IS_MACOSX)
        message("You can install it easily via Macports:")
@@ -418,24 +477,24 @@ if(NOT GNURADIO_RUNTIME_FOUND)
        message("Alternatively, you can use homebrew:")
        message("  brew tap odrisci/gnuradio")
        message("  brew install gnuradio" )
-       message(FATAL_ERROR "GNU Radio 3.7.3 or later is required to build gnss-sdr")
+       message(FATAL_ERROR "GNU Radio ${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr")
    endif(OS_IS_MACOSX)
 endif(NOT GNURADIO_RUNTIME_FOUND)
 
 if(NOT GNURADIO_ANALOG_FOUND)
-    message(FATAL_ERROR "*** The gnuradio-analog library v3.7.3 or later is required to build gnss-sdr")
+    message(FATAL_ERROR "*** The gnuradio-analog library v${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr")
 endif()
 if(NOT GNURADIO_BLOCKS_FOUND)
-    message(FATAL_ERROR "*** The gnuradio-blocks library v3.7.3 or later is required to build gnss-sdr")
+    message(FATAL_ERROR "*** The gnuradio-blocks library v${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr")
 endif()
 if(NOT GNURADIO_FILTER_FOUND)
-    message(FATAL_ERROR "*** The gnuradio-filter library v3.7.3 or later is required to build gnss-sdr")
+    message(FATAL_ERROR "*** The gnuradio-filter library v${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr")
 endif()
 if(NOT GNURADIO_FFT_FOUND)
-    message(FATAL_ERROR "*** The gnuradio-fft library v3.7.3 or later is required to build gnss-sdr")
+    message(FATAL_ERROR "*** The gnuradio-fft library v${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr")
 endif()
 if(NOT GNURADIO_PMT_FOUND)
-    message(FATAL_ERROR "*** The gnuradio-pmt library v3.7.3 or later is required to build gnss-sdr")
+    message(FATAL_ERROR "*** The gnuradio-pmt library v${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr")
 endif()
 
 
@@ -466,17 +525,17 @@ endif()
 find_package(VolkGnssSdr)
 
 if(NOT VOLK_GNSSSDR_FOUND)
-    message(STATUS " volk_gnsssdr will be built along with gnss-sdr when doing 'make'")
+    message(STATUS " volk_gnsssdr will be built along with gnss-sdr when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'")
     ###############################
     # Find Python required modules
     ###############################
     include(SetupPython) #sets PYTHON_EXECUTABLE and PYTHON_DASH_B
-    GNSSSDR_PYTHON_CHECK_MODULE("python >= 2.7" sys "sys.version.split()[0] >= '2.7'" PYTHON_MIN_VER_FOUND)
-    GNSSSDR_PYTHON_CHECK_MODULE("mako >= 0.4.2" mako "mako.__version__ >= '0.4.2'" MAKO_FOUND)
+    GNSSSDR_PYTHON_CHECK_MODULE("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND)
+    GNSSSDR_PYTHON_CHECK_MODULE("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND)
     GNSSSDR_PYTHON_CHECK_MODULE("six - python 2 and 3 compatibility library" six "True" SIX_FOUND)
 
     if(NOT PYTHON_MIN_VER_FOUND)
-        message(FATAL_ERROR "Python 2.7 or greater required to build VOLK_GNSSSDR")
+        message(FATAL_ERROR "Python ${GNSSSDR_PYTHON_MIN_VERSION} or greater required to build VOLK_GNSSSDR")
     endif()
 
     #  Mako
@@ -509,11 +568,11 @@ if(NOT VOLK_GNSSSDR_FOUND)
 
     if(ENABLE_PACKAGING)
         if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
-            set(STRIP_VOLK_GNSSSDR_PROFILE "-DENABLE_STRIP=ON")
+            set(STRIP_VOLK_GNSSSDR_PROFILE "-DENABLE_STRIP=ON -DCMAKE_VERBOSE_MAKEFILE=ON")
         endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
     endif(ENABLE_PACKAGING)
 
-    set(VOLK_GNSSSDR_BUILD_COMMAND "make")
+    set(VOLK_GNSSSDR_BUILD_COMMAND "${CMAKE_MAKE_PROGRAM}")
     if(PYTHON_EXECUTABLE)
         set(USE_THIS_PYTHON "-DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}")
     endif(PYTHON_EXECUTABLE)
@@ -523,8 +582,6 @@ if(NOT VOLK_GNSSSDR_FOUND)
         endif(CMAKE_GENERATOR STREQUAL Xcode)
     endif(OS_IS_MACOSX)
 
-    set(CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
-    set(C_FLAGS "${CMAKE_C_FLAGS} -std=c11")
     if(CMAKE_CROSSCOMPILING)
         set(VOLK_GNSSSDR_COMPILER "")
     else(CMAKE_CROSSCOMPILING)
@@ -534,8 +591,6 @@ if(NOT VOLK_GNSSSDR_FOUND)
                                 -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install
                                 -DENABLE_STATIC_LIBS=ON
                                 -DENABLE_PROFILING=${ENABLE_PROFILING}
-                                -DCMAKE_CXX_FLAGS=${CXX_FLAGS}
-                                -DCMAKE_C_FLAGS=${C_FLAGS}
                                 -DCMAKE_INCLUDE_PATH=${Boost_INCLUDE_DIR}
                                 -DENABLE_ORC=OFF
                                 ${STRIP_VOLK_GNSSSDR_PROFILE}
@@ -545,7 +600,8 @@ if(NOT VOLK_GNSSSDR_FOUND)
                                     -DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/cmake/Toolchains/oe-sdk_cross.cmake
                                     -DCROSSCOMPILE_MULTILIB=TRUE )
     endif(EXISTS $ENV{OECORE_TARGET_SYSROOT})
-    ExternalProject_Add(volk_gnsssdr_module
+    if(CMAKE_VERSION VERSION_LESS 3.2)
+       ExternalProject_Add(volk_gnsssdr_module
          PREFIX ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module
          SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr
          BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/build
@@ -556,6 +612,21 @@ if(NOT VOLK_GNSSSDR_FOUND)
          BUILD_COMMAND ${VOLK_GNSSSDR_BUILD_COMMAND} volk_gnsssdr_profile
          INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install
          )
+    else(CMAKE_VERSION VERSION_LESS 3.2)
+       ExternalProject_Add(volk_gnsssdr_module
+         PREFIX ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module
+         SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr
+         BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/build
+         CMAKE_ARGS ${VOLK_GNSSSDR_CMAKE_ARGS}
+         DOWNLOAD_COMMAND ""
+         UPDATE_COMMAND ""
+         PATCH_COMMAND ""
+         BUILD_COMMAND ${VOLK_GNSSSDR_BUILD_COMMAND} volk_gnsssdr_profile
+         BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}volk_gnsssdr${CMAKE_STATIC_LIBRARY_SUFFIX}
+                          ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile
+         INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install
+         )
+    endif(CMAKE_VERSION VERSION_LESS 3.2)
     find_package(ORC)
     if(NOT ORC_FOUND)
          set(ORC_LIBRARIES "")
@@ -563,13 +634,20 @@ if(NOT VOLK_GNSSSDR_FOUND)
     endif(NOT ORC_FOUND)
 
     add_library(volk_gnsssdr UNKNOWN IMPORTED)
-    set_property(TARGET volk_gnsssdr PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/lib/libvolk_gnsssdr.a)
+    set_property(TARGET volk_gnsssdr PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/lib/libvolk_gnsssdr${CMAKE_STATIC_LIBRARY_SUFFIX})
     set(VOLK_GNSSSDR_INCLUDE_DIRS "${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/build/include/;${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include;${ORC_INCLUDE_DIRS}")
     set(VOLK_GNSSSDR_LIBRARIES volk_gnsssdr ${ORC_LIBRARIES})
 
-    add_custom_command(TARGET volk_gnsssdr_module POST_BUILD
+    if(CMAKE_VERSION VERSION_LESS 3.2)
+      add_custom_command(TARGET volk_gnsssdr_module POST_BUILD
         COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile
-        ${CMAKE_SOURCE_DIR}/install/volk_gnsssdr_profile)
+                ${CMAKE_SOURCE_DIR}/install/volk_gnsssdr_profile)
+    else(CMAKE_VERSION VERSION_LESS 3.2)
+      add_custom_command(TARGET volk_gnsssdr_module POST_BUILD
+        COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile
+                ${CMAKE_SOURCE_DIR}/install/volk_gnsssdr_profile
+        BYPRODUCTS ${CMAKE_SOURCE_DIR}/install/volk_gnsssdr_profile)
+    endif(CMAKE_VERSION VERSION_LESS 3.2)
 
     add_custom_command(TARGET volk_gnsssdr_module POST_BUILD
         COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr-config-info
@@ -582,13 +660,28 @@ endif(NOT VOLK_GNSSSDR_FOUND)
 # gflags - https://github.com/gflags/gflags
 ################################################################################
 set(LOCAL_GFLAGS false)
-set(gflags_RELEASE 2.2.0)
+set(gflags_RELEASE 2.2.1)
 find_package(GFlags)
 if (NOT GFlags_FOUND)
      message (STATUS " gflags library has not been found.")
      message (STATUS " gflags will be downloaded and built automatically ")
      message (STATUS " when doing 'make'. ")
 
+     if(CMAKE_VERSION VERSION_LESS 3.2)
+          ExternalProject_Add(
+          gflags-${gflags_RELEASE}
+          PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}
+          GIT_REPOSITORY git://github.com/gflags/gflags.git
+          GIT_TAG v${gflags_RELEASE}
+          SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags/gflags-${gflags_RELEASE}
+          BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}
+          CMAKE_ARGS -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DBUILD_gflags_nothreads_LIB=OFF -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
+          BUILD_COMMAND ${CMAKE_MAKE_PROGRAM}
+          UPDATE_COMMAND ""
+          PATCH_COMMAND ""
+          INSTALL_COMMAND ""
+     )
+     else(CMAKE_VERSION VERSION_LESS 3.2)
      ExternalProject_Add(
           gflags-${gflags_RELEASE}
           PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}
@@ -597,18 +690,20 @@ if (NOT GFlags_FOUND)
           SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags/gflags-${gflags_RELEASE}
           BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}
           CMAKE_ARGS -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DBUILD_gflags_nothreads_LIB=OFF -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-          BUILD_COMMAND make
+          BUILD_COMMAND ${CMAKE_MAKE_PROGRAM}
+          BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX}
           UPDATE_COMMAND ""
           PATCH_COMMAND ""
           INSTALL_COMMAND ""
      )
+     endif(CMAKE_VERSION VERSION_LESS 3.2)
 
      set(GFlags_INCLUDE_DIRS
           ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/include CACHE PATH "Local Gflags headers"
      )
 
      add_library(gflags UNKNOWN IMPORTED)
-     set_property(TARGET gflags PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags.a)
+     set_property(TARGET gflags PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX})
      add_dependencies(gflags gflags-${gflags_RELEASE})
      set(GFlags_LIBS gflags)
      file(GLOB GFlags_SHARED_LIBS "${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_SHARED_LIBRARY_SUFFIX}*")
@@ -721,7 +816,8 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}/configure")
          endif(EXISTS "/usr/bin/libtoolize")
      endif(OS_IS_LINUX)
 
-     ExternalProject_Add(
+     if(CMAKE_VERSION VERSION_LESS 3.2)
+      ExternalProject_Add(
          glog-${glog_RELEASE}
          DEPENDS ${TARGET_GFLAGS}
          PREFIX ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}
@@ -730,11 +826,28 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}/configure")
          SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}
          BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}
          CONFIGURE_COMMAND ${GLOG_CONFIGURE} --prefix=<INSTALL_DIR>
-         BUILD_COMMAND make
+         BUILD_COMMAND "${CMAKE_MAKE_PROGRAM}"
          UPDATE_COMMAND ""
          PATCH_COMMAND ""
          INSTALL_COMMAND ""
-     )
+      )
+     else(CMAKE_VERSION VERSION_LESS 3.2)
+      ExternalProject_Add(
+         glog-${glog_RELEASE}
+         DEPENDS ${TARGET_GFLAGS}
+         PREFIX ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}
+         GIT_REPOSITORY https://github.com/google/glog/
+         GIT_TAG v${glog_RELEASE}
+         SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}
+         BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}
+         CONFIGURE_COMMAND ${GLOG_CONFIGURE} --prefix=<INSTALL_DIR>
+         BUILD_COMMAND "${CMAKE_MAKE_PROGRAM}"
+         BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX}
+         UPDATE_COMMAND ""
+         PATCH_COMMAND ""
+         INSTALL_COMMAND ""
+      )
+     endif(CMAKE_VERSION VERSION_LESS 3.2)
 
      # Set up variables
      set(GLOG_INCLUDE_DIRS
@@ -742,7 +855,7 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}/configure")
           ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}/src
      )
      set(GLOG_LIBRARIES
-          ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog.a
+          ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX}
      )
      set(LOCAL_GLOG true CACHE STRING "Glog downloaded and built automatically" FORCE)
 else(NOT GLOG_FOUND OR ${LOCAL_GFLAGS})
@@ -882,6 +995,28 @@ if(OS_IS_LINUX)
                        /usr/lib/gcc/sparc64-linux-gnu/6
                        /usr/lib/gcc/x86_64-linux-gnux32/6
                        /usr/lib/gcc/sh4-linux-gnu/6
+                       /usr/lib/gcc/x86_64-linux-gnu/7      # Debian 9 Buster
+                       /usr/lib/gcc/alpha-linux-gnu/7
+                       /usr/lib/gcc/aarch64-linux-gnu/7
+                       /usr/lib/gcc/arm-linux-gnueabi/7
+                       /usr/lib/gcc/arm-linux-gnueabihf/7
+                       /usr/lib/gcc/hppa-linux-gnu/7
+                       /usr/lib/gcc/i686-gnu/7
+                       /usr/lib/gcc/i686-linux-gnu/7
+                       /usr/lib/gcc/x86_64-kfreebsd-gnu/7
+                       /usr/lib/gcc/i686-kfreebsd-gnu/7
+                       /usr/lib/gcc/m68k-linux-gnu/7
+                       /usr/lib/gcc/mips-linux-gnu/7
+                       /usr/lib/gcc/mips64el-linux-gnuabi64/7
+                       /usr/lib/gcc/mipsel-linux-gnu/7
+                       /usr/lib/gcc/powerpc-linux-gnu/7
+                       /usr/lib/gcc/powerpc-linux-gnuspe/7
+                       /usr/lib/gcc/powerpc64-linux-gnu/7
+                       /usr/lib/gcc/powerpc64le-linux-gnu/7
+                       /usr/lib/gcc/s390x-linux-gnu/7
+                       /usr/lib/gcc/sparc64-linux-gnu/7
+                       /usr/lib/gcc/x86_64-linux-gnux32/7
+                       /usr/lib/gcc/sh4-linux-gnu/7
                 )
     if(NOT GFORTRAN)
         message(STATUS "The gfortran library has not been found.")
@@ -897,14 +1032,22 @@ if(OS_IS_LINUX)
 endif(OS_IS_LINUX)
 
 find_package(Armadillo)
+if(ARMADILLO_FOUND)
+    if(${ARMADILLO_VERSION_STRING} VERSION_LESS ${GNSSSDR_ARMADILLO_MIN_VERSION})
+        set(ARMADILLO_FOUND false)
+        set(ENABLE_OWN_ARMADILLO true)
+    endif(${ARMADILLO_VERSION_STRING} VERSION_LESS ${GNSSSDR_ARMADILLO_MIN_VERSION})
+endif(ARMADILLO_FOUND)
+
 if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO)
      message(STATUS " Armadillo has not been found.")
      message(STATUS " Armadillo will be downloaded and built automatically")
-     message(STATUS " when doing 'make'. ")
-     set(armadillo_BRANCH 7.900.x)
+     message(STATUS " when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'. ")
+     set(armadillo_BRANCH unstable)
      set(armadillo_RELEASE ${armadillo_BRANCH})
 
-     ExternalProject_Add(
+     if(CMAKE_VERSION VERSION_LESS 3.2)
+      ExternalProject_Add(
          armadillo-${armadillo_RELEASE}
          PREFIX ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE}
          GIT_REPOSITORY https://github.com/conradsnicta/armadillo-code.git
@@ -912,10 +1055,25 @@ if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO)
          SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE}
          BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE}
          CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_FLAGS=-std=c++11
-         BUILD_COMMAND make
+         BUILD_COMMAND ${CMAKE_MAKE_PROGRAM}
          UPDATE_COMMAND ""
          INSTALL_COMMAND ""
-     )
+      )
+     else(CMAKE_VERSION VERSION_LESS 3.2)
+      ExternalProject_Add(
+         armadillo-${armadillo_RELEASE}
+         PREFIX ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE}
+         GIT_REPOSITORY https://github.com/conradsnicta/armadillo-code.git
+         GIT_TAG ${armadillo_BRANCH}
+         SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE}
+         BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE}
+         CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_FLAGS=-std=c++11
+         BUILD_COMMAND ${CMAKE_MAKE_PROGRAM}
+         BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE}/${CMAKE_FIND_LIBRARY_PREFIXES}armadillo${CMAKE_STATIC_LIBRARY_SUFFIX}
+         UPDATE_COMMAND ""
+         INSTALL_COMMAND ""
+      )
+     endif(CMAKE_VERSION VERSION_LESS 3.2)
 
      # Set up variables
      ExternalProject_Get_Property(armadillo-${armadillo_RELEASE} binary_dir)
@@ -931,7 +1089,7 @@ if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO)
      if(NOT GFORTRAN)
          set(GFORTRAN "")
      endif(NOT GFORTRAN)
-     set(ARMADILLO_LIBRARIES ${BLAS} ${LAPACK} ${GFORTRAN} ${binary_dir}/${CMAKE_FIND_LIBRARY_PREFIXES}armadillo.a)
+     set(ARMADILLO_LIBRARIES ${BLAS} ${LAPACK} ${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})
 else(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO)
@@ -1026,7 +1184,7 @@ endif(NOT UHD_FOUND)
 find_package(Doxygen)
 if(DOXYGEN_FOUND)
      message(STATUS "Doxygen found.")
-     message(STATUS "You can build the documentation with 'make doc'." )
+     message(STATUS "You can build the documentation with '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} doc'." )
      message(STATUS "When done, point your browser to ${CMAKE_BINARY_DIR}/html/index.html")
      set(HAVE_DOT ${DOXYGEN_DOT_FOUND})
      file(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR} top_srcdir)
@@ -1049,7 +1207,7 @@ if(DOXYGEN_FOUND)
           COMMENT "Generating API documentation with Doxygen." VERBATIM
      )
      if(LATEX_COMPILER)
-          message(STATUS "'make pdfmanual' will generate a manual at ${CMAKE_BINARY_DIR}/docs/GNSS-SDR_manual.pdf")
+          message(STATUS "'${CMAKE_MAKE_PROGRAM_PRETTY_NAME} pdfmanual' will generate a manual at ${CMAKE_BINARY_DIR}/docs/GNSS-SDR_manual.pdf")
           add_custom_target(pdfmanual
                COMMAND ${CMAKE_MAKE_PROGRAM}
                COMMAND ${CMAKE_COMMAND} -E copy refman.pdf ${CMAKE_BINARY_DIR}/docs/GNSS-SDR_manual.pdf
@@ -1059,7 +1217,7 @@ if(DOXYGEN_FOUND)
                COMMENT "Generating PDF manual with Doxygen." VERBATIM
           )
      endif(LATEX_COMPILER)
-     message(STATUS "'make doc-clean' will clean the documentation.")
+     message(STATUS "'${CMAKE_MAKE_PROGRAM_PRETTY_NAME} doc-clean' will clean the documentation.")
      add_custom_target(doc-clean
           COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/docs/html
           COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/docs/latex
@@ -1130,6 +1288,8 @@ else(ENABLE_CUDA)
     message(STATUS "Enable it with 'cmake -DENABLE_CUDA=ON ../' to add support for GPU-based acceleration using CUDA." )
 endif(ENABLE_CUDA)
 
+
+
 ###############################################################################
 # FPGA (OPTIONAL)
 ###############################################################################
@@ -1141,6 +1301,8 @@ else(ENABLE_FPGA)
     message(STATUS "Enable it with 'cmake -DENABLE_FPGA=ON ../' to add support for GPU-based acceleration using the FPGA." )
 endif(ENABLE_FPGA)
 
+
+
 ################################################################################
 # Setup of optional drivers
 ################################################################################
@@ -1210,7 +1372,7 @@ if(FLEXIBAND_DRIVER)
 endif(FLEXIBAND_DRIVER)
 
 if(ENABLE_FLEXIBAND)
-    message(STATUS "CTTC's Antenna Array front-end driver will be compiled." )
+    message(STATUS "The Teleorbit Flexiband front-end source will be compiled." )
     message(STATUS "You can disable it with 'cmake -DENABLE_FLEXIBAND=OFF ../'" )
 else(ENABLE_FLEXIBAND)
     message(STATUS "The (optional) Teleorbit Flexiband front-end driver adapter is not enabled." )
@@ -1264,17 +1426,50 @@ endif(ENABLE_GPROF)
 ########################################################################
 # Set compiler flags
 ########################################################################
-# Enable C++11 support in GCC
+# Enable C++14 support in GCC / Fallback to C++11 when using GCC < 6.1.1
 if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
-    set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11 -Wall -Wextra")  #Add warning flags: For "-Wall" see http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
+    if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1")
+        set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11")
+    else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1")
+        set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14")
+    endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1")
+    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++14 support in Clang from 3.5 / Fallback to C++11 if older version and use lib++ if working in macOS
 if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-    set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11 -stdlib=libc++")
+    if(OS_IS_LINUX)
+        if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0")
+            set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11")
+        else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0")
+            set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14")
+        endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0")
+    endif(OS_IS_LINUX)
+    if(OS_IS_MACOSX)
+        # See https://trac.macports.org/wiki/XcodeVersionInfo for Apple Clang version equivalences
+        if(CLANG_VERSION VERSION_LESS "600")
+            set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11")
+        else(CLANG_VERSION VERSION_LESS "600")
+            set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14")
+        endif(CLANG_VERSION VERSION_LESS "600")
+        set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -Wno-deprecated-declarations")
+    endif(OS_IS_MACOSX)
+
     if(CMAKE_BUILD_TYPE MATCHES "Release")
         set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -Wno-unused-private-field")
     endif(CMAKE_BUILD_TYPE MATCHES "Release")
+    if(OS_IS_MACOSX)
+       set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -stdlib=libc++")
+    endif(OS_IS_MACOSX)
 endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
 
+if(NOT (CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
+    if(NOT (CMAKE_VERSION VERSION_LESS "3.1"))
+        set(CMAKE_C_STANDARD 11)
+        set(CMAKE_CXX_STANDARD 14)
+    endif(NOT (CMAKE_VERSION VERSION_LESS "3.1"))
+endif(NOT (CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
+
 # Processor-architecture related flags
 # See http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html#i386-and-x86_002d64-Options
 if (NOT ARCH_COMPILER_FLAGS)
diff --git a/README.md b/README.md
index 4b24a1dc9..9a14d8343 100644
--- a/README.md
+++ b/README.md
@@ -584,11 +584,10 @@ We use a [DBSRX2](https://www.ettus.com/product/details/DBSRX2) to do the task,
     1. The default configuration file resides at [/usr/local/share/gnss-sdr/conf/default.conf](./conf/gnss-sdr.conf).
     2. You need to review/modify at least the following settings:
         * ```SignalSource.filename=``` (absolute or relative route to your GNSS signal captured file)
-        * ```GNSS-SDR.internal_fs_hz=``` (captured file sampling rate in Hz)
-        * ```SignalSource.sampling_frequency=``` (captured file sampling rate in Hz)
-        * ```SignalConditioner.sample_freq_in=``` (captured file sampling rate in Hz)
-        * ```SignalConditioner.sample_freq_out=``` (captured file sampling rate in Hz)
-        * ```TelemetryDecoder.fs_in=``` (captured file sampling rate in Hz)
+        * ```GNSS-SDR.internal_fs_sps=``` (captured file sampling rate in samples per second)
+        * ```SignalSource.sampling_frequency=``` (captured file sampling rate in samples per second)
+        * ```SignalConditioner.sample_freq_in=``` (captured file sampling rate in samples per second)
+        * ```SignalConditioner.sample_freq_out=``` (captured file sampling rate in samples per second)
     3. The configuration file has in-line documentation, you can try to tune the number of channels and several receiver parameters. Store your .conf file in some working directory of your choice.
 4. Run the receiver invoking the configuration by
 ```$ gnss-sdr --config_file=/path/to/my_receiver.conf```
@@ -1138,12 +1137,10 @@ In case you are configuring a multi-system receiver, you will need to decimate t
 ;######### TELEMETRY DECODER GPS L1 CONFIG ############
 TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder
 TelemetryDecoder_1C.dump=false
-TelemetryDecoder_1C.decimation_factor=4;
 
 ;######### TELEMETRY DECODER GALILEO E1B CONFIG ############
 TelemetryDecoder_1B.implementation=Galileo_E1B_Telemetry_Decoder
 TelemetryDecoder_1B.dump=false
-TelemetryDecoder_1B.decimation_factor=1;
 ~~~~~~
 
 More documentation at the [Telemetry Decoder Blocks page](http://gnss-sdr.org/docs/sp-blocks/telemetry-decoder/).
@@ -1155,25 +1152,7 @@ GNSS systems provide different kinds of observations. The most commonly used are
 
 The common interface is [ObservablesInterface](./src/core/interfaces/observables_interface.h).
 
-Configuration example for GPS L1 C/A signals:
-
-~~~~~~
-;######### OBSERVABLES CONFIG ############
-Observables.implementation=GPS_L1_CA_Observables
-Observables.dump=false
-Observables.dump_filename=./observables.dat
-~~~~~~
-
-For Galileo E1B receivers:
-
-~~~~~~
-;######### OBSERVABLES CONFIG ############
-Observables.implementation=Galileo_E1B_Observables
-Observables.dump=false
-Observables.dump_filename=./observables.dat
-~~~~~~
-
-For hybrid GPS L1 / Galileo E1B receivers:
+Configuration example:
 
 ~~~~~~
 ;######### OBSERVABLES CONFIG ############
@@ -1190,57 +1169,30 @@ Although data processing for obtaining high-accuracy PVT solutions is out of the
 
 The common interface is [PvtInterface](./src/core/interfaces/pvt_interface.h).
 
-Configuration example for GPS L1 C/A signals:
+Configuration example:
 
 ~~~~~~
 ;######### PVT CONFIG ############
-PVT.implementation=GPS_L1_CA_PVT
-PVT.averaging_depth=10 ; Number of PVT observations in the moving average algorithm
-PVT.flag_averaging=true ; Enables the PVT averaging between output intervals (arithmetic mean) [true] or [false]
-PVT.output_rate_ms=100 ; Period in [ms] between two PVT outputs
-PVT.display_rate_ms=500 ; Position console print (std::out) interval [ms].
-PVT.dump=false ; Enables the PVT internal binary data file logging [true] or [false]
-PVT.dump_filename=./PVT ; Log path and filename without extension of GeoJSON and KML files
+PVT.implementation=RTKLIB_PVT
+PVT.positioning_mode=Single      ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic
+PVT.iono_model=Broadcast         ; options: OFF, Broadcast
+PVT.trop_model=Saastamoinen      ; options: OFF, Saastamoinen
+PVT.rinex_version=2              ; options: 2 or 3
+PVT.output_rate_ms=100           ; Period in [ms] between two PVT outputs
+PVT.display_rate_ms=500          ; Position console print (std::out) interval [ms].
 PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea ; NMEA log path and filename
-PVT.flag_nmea_tty_port=true ; Enables the NMEA log to a serial TTY port
+PVT.flag_nmea_tty_port=false     ; Enables the NMEA log to a serial TTY port
 PVT.nmea_dump_devname=/dev/pts/4 ; serial device descriptor for NMEA logging
-PVT.flag_rtcm_server=false ; Enables or disables a TCP/IP server dispatching RTCM messages
-PVT.flag_rtcm_tty_port=true ; Enables the RTCM log to a serial TTY port
+PVT.flag_rtcm_server=true        ; Enables or disables a TCP/IP server dispatching RTCM messages
+PVT.flag_rtcm_tty_port=false     ; Enables the RTCM log to a serial TTY port
 PVT.rtcm_dump_devname=/dev/pts/1 ; serial device descriptor for RTCM logging
+PVT.rtcm_tcp_port=2101
+PVT.rtcm_MT1019_rate_ms=5000
+PVT.rtcm_MT1045_rate_ms=5000
+PVT.rtcm_MT1097_rate_ms=1000
+PVT.rtcm_MT1077_rate_ms=1000
 ~~~~~~
 
-For Galileo E1B receivers:
-
-~~~~~~
-;######### PVT CONFIG ############
-PVT.implementation=GALILEO_E1_PVT
-PVT.averaging_depth=100
-PVT.flag_averaging=false
-PVT.output_rate_ms=100;
-PVT.display_rate_ms=500;
-PVT.dump=false
-PVT.dump_filename=./PVT
-PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea ; NMEA log path and filename
-PVT.flag_nmea_tty_port=true ; Enables the NMEA log to a serial TTY port
-PVT.nmea_dump_devname=/dev/pts/4 ; serial device descriptor for NMEA logging
-PVT.flag_rtcm_server=false ; Enables or disables a TCP/IP server dispatching RTCM messages
-PVT.flag_rtcm_tty_port=true ; Enables the RTCM log to a serial TTY port
-PVT.rtcm_dump_devname=/dev/pts/1 ; serial device descriptor for RTCM logging
-~~~~~~
-
-
-For hybrid GPS L1 / Galileo E1B receivers:
-
-~~~~~~
-;######### PVT CONFIG ############
-PVT.implementation=Hybrid_PVT
-PVT.averaging_depth=10
-PVT.flag_averaging=false
-PVT.output_rate_ms=100;
-PVT.display_rate_ms=500;
-PVT.dump=false
-PVT.dump_filename=./PVT
-~~~~~~
 
 **Notes on the output formats:**
 
@@ -1250,9 +1202,9 @@ PVT.dump_filename=./PVT
 
  * **NMEA 0183** is a combined electrical and data specification for communication between marine electronics such as echo sounder, sonars, anemometer, gyrocompass, autopilot, GPS receivers and many other types of instruments. It has been defined by, and is controlled by, the U.S. [National Marine Electronics Association](http://www.nmea.org/). The NMEA 0183 standard uses a simple ASCII, serial communications protocol that defines how data are transmitted in a *sentence* from one *talker* to multiple *listeners* at a time. Through the use of intermediate expanders, a talker can have a unidirectional conversation with a nearly unlimited number of listeners, and using multiplexers, multiple sensors can talk to a single computer port. At the application layer, the standard also defines the contents of each sentence (message) type, so that all listeners can parse messages accurately. Those messages can be sent through the serial port (that could be for instance a Bluetooth link) and be used/displayed by a number of software applications such as [gpsd](http://www.catb.org/gpsd/ "The UNIX GPS daemon"), [JOSM](https://josm.openstreetmap.de/ "The Java OpenStreetMap Editor"), [OpenCPN](http://opencpn.org/ocpn/ "Open Chart Plotter Navigator"), and many others (and maybe running on other devices).
 
- * **RINEX** (Receiver Independent Exchange Format) is an interchange format for raw satellite navigation system data, covering observables and the information contained in the navigation message broadcast by GNSS satellites. This allows the user to post-process the received data to produce a more accurate result (usually with other data unknown to the original receiver, such as better models of the atmospheric conditions at time of measurement). RINEX files can be used by software packages such as [GPSTk](http://www.gpstk.org), [RTKLIB](http://www.rtklib.com/) and [gLAB](http://gage14.upc.es/gLAB/). GNSS-SDR by default generates RINEX version [3.02](https://igscb.jpl.nasa.gov/igscb/data/format/rinex302.pdf). If [2.11](https://igscb.jpl.nasa.gov/igscb/data/format/rinex211.txt) is needed, it can be requested through a commandline flag when invoking the software receiver:
+ * **RINEX** (Receiver Independent Exchange Format) is an interchange format for raw satellite navigation system data, covering observables and the information contained in the navigation message broadcast by GNSS satellites. This allows the user to post-process the received data to produce a more accurate result (usually with other data unknown to the original receiver, such as better models of the atmospheric conditions at time of measurement). RINEX files can be used by software packages such as [GPSTk](http://www.gpstk.org), [RTKLIB](http://www.rtklib.com/) and [gLAB](http://gage14.upc.es/gLAB/). GNSS-SDR by default generates RINEX version [3.02](https://igscb.jpl.nasa.gov/igscb/data/format/rinex302.pdf). If [2.11](https://igscb.jpl.nasa.gov/igscb/data/format/rinex211.txt) is needed, it can be requested through the `rinex_version` parameter in the configuration file:
 ~~~~~~
-$ gnss-sdr --RINEX_version=2
+PVT.rinex_version=2
 ~~~~~~
 
 * **RTCM SC-104** provides standards that define the data structure for differential GNSS correction information for a variety of differential correction applications. Developed by the Radio Technical Commission for Maritime Services ([RTCM](http://www.rtcm.org/overview.php#Standards "Radio Technical Commission for Maritime Services")), they have become an industry standard for communication of correction information. GNSS-SDR implements RTCM version 3.2, defined in the document *RTCM 10403.2, Differential GNSS (Global Navigation Satellite Systems) Services - Version 3* (February 1, 2013), which can be [purchased online](https://ssl29.pair.com/dmarkle/puborder.php?show=3 "RTCM Online Publication Order Form"). By default, the generated RTCM binary messages are dumped into a text file in hexadecimal format. However, GNSS-SDR is equipped with a TCP/IP server, acting as an NTRIP source that can feed an NTRIP server. NTRIP (Networked Transport of RTCM via Internet Protocol) is an open standard protocol that can be freely download from [BKG](http://igs.bkg.bund.de/root_ftp/NTRIP/documentation/NtripDocumentation.pdf "Networked Transport of RTCM via Internet Protocol (Ntrip) Version 1.0"), and it is designed for disseminating differential correction data (*e.g.* in the RTCM-104 format) or other kinds of GNSS streaming data to stationary or mobile users over the Internet. The TCP/IP server can be enabled by setting ```PVT.flag_rtcm_server=true``` in the configuration file, and will be active during the execution of the software receiver. By default, the server will operate on port 2101 (which is the recommended port for RTCM services according to the Internet Assigned Numbers Authority, [IANA](http://www.iana.org/assignments/service-names-port-numbers "Service Name and Transport Protocol Port Number Registry")), and will identify the Reference Station with ID=1234. This behaviour can be changed in the configuration file:
diff --git a/conf/front-end-cal.conf b/conf/front-end-cal.conf
index 6f9d898d4..af9221936 100644
--- a/conf/front-end-cal.conf
+++ b/conf/front-end-cal.conf
@@ -23,8 +23,8 @@ GNSS-SDR.init_altitude_m=10
 
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=2000000
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=2000000
 
 ;######### SUPL RRLP GPS assistance configuration #####
 ; Check http://www.mcc-mnc.com/
diff --git a/conf/gnss-sdr.conf b/conf/gnss-sdr.conf
index f56a720a6..6ffffd631 100644
--- a/conf/gnss-sdr.conf
+++ b/conf/gnss-sdr.conf
@@ -6,8 +6,8 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=4000000
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=4000000
 
 
 ;######### SUPL RRLP GPS assistance configuration #####
diff --git a/conf/gnss-sdr_GPS_L1_FPGA.conf b/conf/gnss-sdr_GPS_L1_FPGA.conf
index 7e7e49aa7..5def11d31 100644
--- a/conf/gnss-sdr_GPS_L1_FPGA.conf
+++ b/conf/gnss-sdr_GPS_L1_FPGA.conf
@@ -5,8 +5,8 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=4000000
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=4000000
 
 
 ;######### SIGNAL_SOURCE CONFIG ############
diff --git a/conf/gnss-sdr_GPS_L1_GN3S_realtime.conf b/conf/gnss-sdr_GPS_L1_GN3S_realtime.conf
index 8f3aed872..e2c156cec 100644
--- a/conf/gnss-sdr_GPS_L1_GN3S_realtime.conf
+++ b/conf/gnss-sdr_GPS_L1_GN3S_realtime.conf
@@ -5,8 +5,8 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=2727933.33  ;  8183800/3
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=2727933.33  ;  8183800/3
 
 
 ;######### SIGNAL_SOURCE CONFIG ############
@@ -14,7 +14,7 @@ GNSS-SDR.internal_fs_hz=2727933.33  ;  8183800/3
 ;#Notes for GN3S source:
 ; - The front-end sampling frequency is fixed to 8.1838 MSPS (8183800 Hz).
 ; - The baseband signal is shifted to an IF of 38400 Hz. It should be corrected with the signal conditioner block
-GNSS-SDR.internal_fs_hz=2727933.33  ; 8183800/3
+GNSS-SDR.internal_fs_sps=2727933.33  ; 8183800/3
 
 ;######### SIGNAL_SOURCE CONFIG ############
 SignalSource.implementation=GN3S_Signal_Source
diff --git a/conf/gnss-sdr_GPS_L1_SPIR.conf b/conf/gnss-sdr_GPS_L1_SPIR.conf
index 5e4335b00..0799f82c5 100644
--- a/conf/gnss-sdr_GPS_L1_SPIR.conf
+++ b/conf/gnss-sdr_GPS_L1_SPIR.conf
@@ -6,8 +6,8 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=4000000
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=4000000
 
 
 ;######### SIGNAL_SOURCE CONFIG ############
@@ -226,7 +226,7 @@ Acquisition_1C.max_dwells=5
 ;Acquisition3.repeat_satellite = true
 
 ;#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_hz is greater than or equal to 6138000
+;#Use only if GNSS-SDR.internal_fs_sps is greater than or equal to 6138000
 Acquisition0.cboc=false
 
 
diff --git a/conf/gnss-sdr_GPS_L1_USRP_X300_realtime.conf b/conf/gnss-sdr_GPS_L1_USRP_X300_realtime.conf
index b71126374..094d1f1d8 100644
--- a/conf/gnss-sdr_GPS_L1_USRP_X300_realtime.conf
+++ b/conf/gnss-sdr_GPS_L1_USRP_X300_realtime.conf
@@ -7,8 +7,8 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=4000000
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=4000000
 
 
 ;######### SUPL RRLP GPS assistance configuration #####
diff --git a/conf/gnss-sdr_GPS_L1_USRP_realtime.conf b/conf/gnss-sdr_GPS_L1_USRP_realtime.conf
index 22584d4e4..64db841fa 100644
--- a/conf/gnss-sdr_GPS_L1_USRP_realtime.conf
+++ b/conf/gnss-sdr_GPS_L1_USRP_realtime.conf
@@ -6,8 +6,8 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=2000000
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=2000000
 
 
 ;######### SUPL RRLP GPS assistance configuration #####
@@ -177,71 +177,19 @@ Resampler.sample_freq_out=2000000
 
 ;######### CHANNELS GLOBAL CONFIG ############
 ;#count: Number of available GPS satellite channels.
-Channels_GPS.count=6
+Channels_1C.count=6
 ;#count: Number of available Galileo satellite channels.
-Channels_Galileo.count=0
+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
+
 
 ;#signal:
 ;# "1C" GPS L1 C/A
-;# "1P" GPS L1 P
-;# "1W" GPS L1 Z-tracking and similar (AS on)
-;# "1Y" GPS L1 Y
-;# "1M" GPS L1 M
-;# "1N" GPS L1 codeless
-;# "2C" GPS L2 C/A
-;# "2D" GPS L2 L1(C/A)+(P2-P1) semi-codeless
 ;# "2S" GPS L2 L2C (M)
-;# "2L" GPS L2 L2C (L)
-;# "2X" GPS L2 L2C (M+L)
-;# "2P" GPS L2 P
-;# "2W" GPS L2 Z-tracking and similar (AS on)
-;# "2Y" GPS L2 Y
-;# "2M" GPS GPS L2 M
-;# "2N" GPS L2 codeless
-;# "5I" GPS L5 I
-;# "5Q" GPS L5 Q
-;# "5X" GPS L5 I+Q
-;# "1C" GLONASS G1 C/A
-;# "1P" GLONASS G1 P
-;# "2C" GLONASS G2 C/A  (Glonass M)
-;# "2P" GLONASS G2 P
-;# "1A" GALILEO E1 A (PRS)
 ;# "1B" GALILEO E1 B (I/NAV OS/CS/SoL)
-;# "1C" GALILEO E1 C (no data)
-;# "1X" GALILEO E1 B+C
-;# "1Z" GALILEO E1 A+B+C
-;# "5I" GALILEO E5a I (F/NAV OS)
-;# "5Q" GALILEO E5a Q  (no data)
 ;# "5X" GALILEO E5a I+Q
-;# "7I" GALILEO E5b I
-;# "7Q" GALILEO E5b Q
-;# "7X" GALILEO E5b I+Q
-;# "8I" GALILEO E5 I
-;# "8Q" GALILEO E5 Q
-;# "8X" GALILEO E5 I+Q
-;# "6A" GALILEO E6 A
-;# "6B" GALILEO E6 B
-;# "6C" GALILEO E6 C
-;# "6X" GALILEO E6 B+C
-;# "6Z" GALILEO E6 A+B+C
-;# "1C" SBAS L1 C/A
-;# "5I" SBAS L5 I
-;# "5Q" SBAS L5 Q
-;# "5X" SBAS L5 I+Q
-;# "2I" COMPASS E2 I
-;# "2Q" COMPASS E2 Q
-;# "2X" COMPASS E2 IQ
-;# "7I" COMPASS E5b I
-;# "7Q" COMPASS E5b Q
-;# "7X" COMPASS E5b IQ
-;# "6I" COMPASS E6 I
-;# "6Q" COMPASS E6 Q
-;# "6X" COMPASS E6 IQ
+
 ;#if the option is disabled by default is assigned "1C" GPS L1 C/A
 Channel.signal=1C
 
@@ -250,46 +198,45 @@ Channel.signal=1C
 
 ;######### CHANNEL 0 CONFIG ############
 
-Channel0.system=GPS
-Channel0.signal=1C
+;Channel0.system=GPS
+;Channel0.signal=1C
 
 ;#satellite: Satellite PRN ID for this channel. Disable this option to random search
-Channel0.satellite=11
+;Channel0.satellite=11
 
 ;######### CHANNEL 1 CONFIG ############
 
-Channel1.system=GPS
-Channel1.signal=1C
-Channel1.satellite=18
+;Channel1.system=GPS
+;Channel1.signal=1C
+;Channel1.satellite=18
 
 
 ;######### ACQUISITION GLOBAL CONFIG ############
 
 ;#dump: Enable or disable the acquisition internal data file logging [true] or [false]
-Acquisition_GPS.dump=false
+Acquisition_1C.dump=false
 ;#filename: Log path and filename
-Acquisition_GPS.dump_filename=./acq_dump.dat
-;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version.
-Acquisition_GPS.item_type=gr_complex
+Acquisition_1C.dump_filename=./acq_dump.dat
+;#item_type: Type and resolution for each of the signal samples.
+Acquisition_1C.item_type=gr_complex
 ;#if: Signal intermediate frequency in [Hz]
-Acquisition_GPS.if=0
+Acquisition_1C.if=0
 ;#sampled_ms: Signal block duration for the acquisition signal detection [ms]
-Acquisition_GPS.coherent_integration_time_ms=1
-;#implementation: Acquisition algorithm selection for this channel: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
-Acquisition_GPS.implementation=GPS_L1_CA_PCPS_Acquisition
+Acquisition_1C.coherent_integration_time_ms=1
+Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition
 ;#threshold: Acquisition threshold. It will be ignored if pfa is defined.
-Acquisition_GPS.threshold=0.01
+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_GPS.pfa=0.0001
+;Acquisition_1C.pfa=0.0001
 ;#doppler_max: Maximum expected Doppler shift [Hz]
-Acquisition_GPS.doppler_max=10000
+Acquisition_1C.doppler_max=10000
 ;#doppler_max: Doppler step in the grid search [Hz]
-Acquisition_GPS.doppler_step=500
+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_GPS.bit_transition_flag=false
+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_GPS.max_dwells=1
+Acquisition_1C.max_dwells=1
 
 
 ;######### ACQUISITION CHANNELS CONFIG ######
@@ -299,37 +246,37 @@ Acquisition_GPS.max_dwells=1
 ;######### TRACKING GLOBAL CONFIG ############
 
 ;#implementation: Selected tracking algorithm: [GPS_L1_CA_DLL_PLL_Tracking] or [GPS_L1_CA_DLL_PLL_C_Aid_Tracking]
-Tracking_GPS.implementation=GPS_L1_CA_DLL_PLL_Tracking
+Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking
 ;#item_type: Type and resolution for each of the signal samples.
-Tracking_GPS.item_type=gr_complex
+Tracking_1C.item_type=gr_complex
 
 ;#sampling_frequency: Signal Intermediate Frequency in [Hz]
-Tracking_GPS.if=0
+Tracking_1C.if=0
 
 ;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false]
-Tracking_GPS.dump=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_GPS.dump_filename=./tracking_ch_
+Tracking_1C.dump_filename=./tracking_ch_
 
 ;#pll_bw_hz: PLL loop filter bandwidth [Hz]
-Tracking_GPS.pll_bw_hz=50.0;
+Tracking_1C.pll_bw_hz=30.0;
 
 ;#dll_bw_hz: DLL loop filter bandwidth [Hz]
-Tracking_GPS.dll_bw_hz=2.0;
+Tracking_1C.dll_bw_hz=4.0;
 
 ;#order: PLL/DLL loop filter order [2] or [3]
-Tracking_GPS.order=3;
+Tracking_1C.order=3;
 
-;#early_late_space_chips: correlator early-late space [chips]. Use [0.5]
-Tracking_GPS.early_late_space_chips=0.5;
+;#early_late_space_chips: correlator early-late space [chips]
+Tracking_1C.early_late_space_chips=0.5;
 
 ;######### TELEMETRY DECODER GPS CONFIG ############
 ;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L1 C/A
-TelemetryDecoder_GPS.implementation=GPS_L1_CA_Telemetry_Decoder
-TelemetryDecoder_GPS.dump=false
+TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder
+TelemetryDecoder_1C.dump=false
 ;#decimation factor
-TelemetryDecoder_GPS.decimation_factor=1;
+TelemetryDecoder_1C.decimation_factor=1;
 
 ;######### OBSERVABLES CONFIG ############
 ;#implementation:
diff --git a/conf/gnss-sdr_GPS_L1_acq_QuickSync.conf b/conf/gnss-sdr_GPS_L1_acq_QuickSync.conf
index 2c67377bf..02fa2ff35 100644
--- a/conf/gnss-sdr_GPS_L1_acq_QuickSync.conf
+++ b/conf/gnss-sdr_GPS_L1_acq_QuickSync.conf
@@ -6,8 +6,8 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=4000000
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=4000000
 
 
 ;######### SIGNAL_SOURCE CONFIG ############
diff --git a/conf/gnss-sdr_GPS_L1_gr_complex.conf b/conf/gnss-sdr_GPS_L1_gr_complex.conf
index ca5af458c..662d42b12 100644
--- a/conf/gnss-sdr_GPS_L1_gr_complex.conf
+++ b/conf/gnss-sdr_GPS_L1_gr_complex.conf
@@ -5,8 +5,8 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=2600000
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=2600000
 
 
 ;######### SIGNAL_SOURCE CONFIG ############
diff --git a/conf/gnss-sdr_GPS_L1_gr_complex_gpu.conf b/conf/gnss-sdr_GPS_L1_gr_complex_gpu.conf
index 41e4b61bb..e7e8f4e62 100644
--- a/conf/gnss-sdr_GPS_L1_gr_complex_gpu.conf
+++ b/conf/gnss-sdr_GPS_L1_gr_complex_gpu.conf
@@ -5,8 +5,8 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=4000000
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=4000000
 
 
 ;######### SIGNAL_SOURCE CONFIG ############
diff --git a/conf/gnss-sdr_GPS_L1_ishort.conf b/conf/gnss-sdr_GPS_L1_ishort.conf
index b7376135f..a5cce5189 100644
--- a/conf/gnss-sdr_GPS_L1_ishort.conf
+++ b/conf/gnss-sdr_GPS_L1_ishort.conf
@@ -5,8 +5,8 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=2000000
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=2000000
 
 ;######### CONTROL_THREAD CONFIG ############
 ControlThread.wait_for_flowgraph=false
diff --git a/conf/gnss-sdr_GPS_L1_nsr.conf b/conf/gnss-sdr_GPS_L1_nsr.conf
index 076f46260..078f8e690 100644
--- a/conf/gnss-sdr_GPS_L1_nsr.conf
+++ b/conf/gnss-sdr_GPS_L1_nsr.conf
@@ -8,8 +8,8 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=2560000
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=2560000
 
 
 ;######### SUPL RRLP GPS assistance configuration #####
diff --git a/conf/gnss-sdr_GPS_L1_nsr_twobit_packed.conf b/conf/gnss-sdr_GPS_L1_nsr_twobit_packed.conf
index 809f2bcbb..f3bac7589 100644
--- a/conf/gnss-sdr_GPS_L1_nsr_twobit_packed.conf
+++ b/conf/gnss-sdr_GPS_L1_nsr_twobit_packed.conf
@@ -8,8 +8,8 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=2560000
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=2560000
 
 
 ;######### SUPL RRLP GPS assistance configuration #####
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 d6222161e..2ce06d573 100644
--- a/conf/gnss-sdr_GPS_L1_pulse_blanking_gr_complex.conf
+++ b/conf/gnss-sdr_GPS_L1_pulse_blanking_gr_complex.conf
@@ -6,8 +6,8 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=2000000
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=2000000
 
 ;######### CONTROL_THREAD CONFIG ############
 ControlThread.wait_for_flowgraph=false
diff --git a/conf/gnss-sdr_GPS_L1_rtl_tcp_realtime.conf b/conf/gnss-sdr_GPS_L1_rtl_tcp_realtime.conf
index 5b1ffe1d6..468c44de7 100644
--- a/conf/gnss-sdr_GPS_L1_rtl_tcp_realtime.conf
+++ b/conf/gnss-sdr_GPS_L1_rtl_tcp_realtime.conf
@@ -6,10 +6,10 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [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/
-GNSS-SDR.internal_fs_hz=1200000
+GNSS-SDR.internal_fs_sps=1200000
 
 
 ;######### SUPL RRLP GPS assistance configuration #####
diff --git a/conf/gnss-sdr_GPS_L1_rtlsdr_realtime.conf b/conf/gnss-sdr_GPS_L1_rtlsdr_realtime.conf
index f7c934703..8c5f9022a 100644
--- a/conf/gnss-sdr_GPS_L1_rtlsdr_realtime.conf
+++ b/conf/gnss-sdr_GPS_L1_rtlsdr_realtime.conf
@@ -5,10 +5,10 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [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/
-GNSS-SDR.internal_fs_hz=1999898
+GNSS-SDR.internal_fs_sps=1999898
 
 
 ;######### SUPL RRLP GPS assistance configuration #####
diff --git a/conf/gnss-sdr_GPS_L1_two_bits_cpx.conf b/conf/gnss-sdr_GPS_L1_two_bits_cpx.conf
index b21abf2c7..a720b859b 100644
--- a/conf/gnss-sdr_GPS_L1_two_bits_cpx.conf
+++ b/conf/gnss-sdr_GPS_L1_two_bits_cpx.conf
@@ -5,8 +5,8 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=3200000
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=3200000
 
 
 ;######### SUPL RRLP GPS assistance configuration #####
diff --git a/conf/gnss-sdr_GPS_L2C_USRP1_realtime.conf b/conf/gnss-sdr_GPS_L2C_USRP1_realtime.conf
index e96fa0e94..5c800efad 100644
--- a/conf/gnss-sdr_GPS_L2C_USRP1_realtime.conf
+++ b/conf/gnss-sdr_GPS_L2C_USRP1_realtime.conf
@@ -5,8 +5,8 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=2000000
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=2000000
 
 
 ;######### SUPL RRLP GPS assistance configuration #####
diff --git a/conf/gnss-sdr_GPS_L2C_USRP_X300_realtime.conf b/conf/gnss-sdr_GPS_L2C_USRP_X300_realtime.conf
index 4bebf9fcb..263f7cce2 100644
--- a/conf/gnss-sdr_GPS_L2C_USRP_X300_realtime.conf
+++ b/conf/gnss-sdr_GPS_L2C_USRP_X300_realtime.conf
@@ -7,8 +7,8 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=4000000
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=4000000
 
 ;######### SUPL RRLP GPS assistance configuration #####
 ; Check http://www.mcc-mnc.com/
diff --git a/conf/gnss-sdr_Galileo_E1_USRP_X300_realtime.conf b/conf/gnss-sdr_Galileo_E1_USRP_X300_realtime.conf
index a305cd277..6d82ad1e9 100644
--- a/conf/gnss-sdr_Galileo_E1_USRP_X300_realtime.conf
+++ b/conf/gnss-sdr_Galileo_E1_USRP_X300_realtime.conf
@@ -7,8 +7,8 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=4000000
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=4000000
 
 
 ;######### SIGNAL_SOURCE CONFIG ############
diff --git a/conf/gnss-sdr_Galileo_E1_acq_QuickSync.conf b/conf/gnss-sdr_Galileo_E1_acq_QuickSync.conf
index 9be99d94d..52df58dc9 100644
--- a/conf/gnss-sdr_Galileo_E1_acq_QuickSync.conf
+++ b/conf/gnss-sdr_Galileo_E1_acq_QuickSync.conf
@@ -5,8 +5,8 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=4000000
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=4000000
 
 
 ;######### SIGNAL_SOURCE CONFIG ############
diff --git a/conf/gnss-sdr_Galileo_E1_ishort.conf b/conf/gnss-sdr_Galileo_E1_ishort.conf
index cada1263c..208571be0 100644
--- a/conf/gnss-sdr_Galileo_E1_ishort.conf
+++ b/conf/gnss-sdr_Galileo_E1_ishort.conf
@@ -5,8 +5,8 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=4000000
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=4000000
 
 
 ;######### SIGNAL_SOURCE CONFIG ############
@@ -193,7 +193,7 @@ Acquisition_1B.doppler_step=125
 ;Acquisition_1B3.repeat_satellite = true
 
 ;#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_hz is greater than or equal to 6138000
+;#Use only if GNSS-SDR.internal_fs_sps is greater than or equal to 6138000
 Acquisition_1B.cboc=false
 
 
diff --git a/conf/gnss-sdr_Galileo_E1_nsr.conf b/conf/gnss-sdr_Galileo_E1_nsr.conf
index c357bd013..4cf3f213c 100644
--- a/conf/gnss-sdr_Galileo_E1_nsr.conf
+++ b/conf/gnss-sdr_Galileo_E1_nsr.conf
@@ -5,11 +5,11 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-;GNSS-SDR.internal_fs_hz=6826700
-GNSS-SDR.internal_fs_hz=2560000
-;GNSS-SDR.internal_fs_hz=4096000
-;GNSS-SDR.internal_fs_hz=5120000
+;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 ############
@@ -87,7 +87,7 @@ Acquisition_1B.implementation=Galileo_E1_PCPS_Ambiguous_Acquisition
 Acquisition_1B.pfa=0.0000008
 Acquisition_1B.doppler_max=15000
 Acquisition_1B.doppler_step=125
-Acquisition_1B.cboc=false ; 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_hz is greater than or equal to 6138000
+Acquisition_1B.cboc=false ; 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
 
 ;######### TRACKING GLOBAL CONFIG ############
 Tracking_1B.implementation=Galileo_E1_DLL_PLL_VEML_Tracking
diff --git a/conf/gnss-sdr_Galileo_E5a.conf b/conf/gnss-sdr_Galileo_E5a.conf
index 1528a5d2b..0845e1dff 100644
--- a/conf/gnss-sdr_Galileo_E5a.conf
+++ b/conf/gnss-sdr_Galileo_E5a.conf
@@ -6,8 +6,8 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=32000000
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=32000000
 
 
 ;######### SUPL RRLP GPS assistance configuration #####
diff --git a/conf/gnss-sdr_Galileo_E5a_IFEN_CTTC.conf b/conf/gnss-sdr_Galileo_E5a_IFEN_CTTC.conf
index 6b733b4dd..8d4e1bc0b 100644
--- a/conf/gnss-sdr_Galileo_E5a_IFEN_CTTC.conf
+++ b/conf/gnss-sdr_Galileo_E5a_IFEN_CTTC.conf
@@ -6,8 +6,8 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=50000000
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=50000000
 
 ;######### SUPL RRLP GPS assistance configuration #####
 ; Check http://www.mcc-mnc.com/
diff --git a/conf/gnss-sdr_Hybrid_byte.conf b/conf/gnss-sdr_Hybrid_byte.conf
index 047c2bc6f..44aa298f6 100644
--- a/conf/gnss-sdr_Hybrid_byte.conf
+++ b/conf/gnss-sdr_Hybrid_byte.conf
@@ -6,8 +6,8 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=20000000
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=20000000
 
 
 ;######### SIGNAL_SOURCE CONFIG ############
diff --git a/conf/gnss-sdr_Hybrid_byte_sim.conf b/conf/gnss-sdr_Hybrid_byte_sim.conf
index 32bea4e58..5de0b699f 100644
--- a/conf/gnss-sdr_Hybrid_byte_sim.conf
+++ b/conf/gnss-sdr_Hybrid_byte_sim.conf
@@ -6,9 +6,9 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-;#GNSS-SDR.internal_fs_hz=2048000
-GNSS-SDR.internal_fs_hz=2600000
+;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 ############
diff --git a/conf/gnss-sdr_Hybrid_gr_complex.conf b/conf/gnss-sdr_Hybrid_gr_complex.conf
index e444a9326..684c24af7 100644
--- a/conf/gnss-sdr_Hybrid_gr_complex.conf
+++ b/conf/gnss-sdr_Hybrid_gr_complex.conf
@@ -6,8 +6,8 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=4092000
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=4092000
 
 ;######### SIGNAL_SOURCE CONFIG ############
 ;#implementation: Use [File_Signal_Source] [Nsr_File_Signal_Source] or [UHD_Signal_Source] or [GN3S_Signal_Source] (experimental)
diff --git a/conf/gnss-sdr_Hybrid_ishort.conf b/conf/gnss-sdr_Hybrid_ishort.conf
index b6cbe8591..8e4989aeb 100644
--- a/conf/gnss-sdr_Hybrid_ishort.conf
+++ b/conf/gnss-sdr_Hybrid_ishort.conf
@@ -6,8 +6,8 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=4000000
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=4000000
 
 
 ;######### SUPL RRLP GPS assistance configuration #####
diff --git a/conf/gnss-sdr_Hybrid_nsr.conf b/conf/gnss-sdr_Hybrid_nsr.conf
index 51ca610e5..a65244110 100644
--- a/conf/gnss-sdr_Hybrid_nsr.conf
+++ b/conf/gnss-sdr_Hybrid_nsr.conf
@@ -6,11 +6,11 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-;GNSS-SDR.internal_fs_hz=6826700
-GNSS-SDR.internal_fs_hz=2560000
-;GNSS-SDR.internal_fs_hz=4096000
-;GNSS-SDR.internal_fs_hz=5120000
+;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: Use [File_Signal_Source] [Nsr_File_Signal_Source] or [UHD_Signal_Source] or [GN3S_Signal_Source] (experimental)
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 924d72f9e..7cf44f53b 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
@@ -6,8 +6,8 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=2500000
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=2500000
 
 ;######### SUPL RRLP GPS assistance configuration #####
 ; Check http://www.mcc-mnc.com/
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 b6de1c3cd..ef35f1207 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
@@ -6,8 +6,8 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=2500000
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=2500000
 
 
 ;######### SUPL RRLP GPS assistance configuration #####
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 2e33999f6..859c41ba2 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
@@ -6,8 +6,8 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=2500000
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=2500000
 
 
 ;######### SUPL RRLP GPS assistance configuration #####
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 b49d1c795..f95cdba22 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
@@ -6,8 +6,8 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=2500000
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=2500000
 
 
 ;######### SUPL RRLP GPS assistance configuration #####
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 8cf620713..4860367dc 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
@@ -6,8 +6,8 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=5000000
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=5000000
 
 
 ;######### SUPL RRLP GPS assistance configuration #####
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 2f2ba159d..37a7f89be 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
@@ -6,8 +6,8 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=2500000
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=2500000
 
 
 ;######### SUPL RRLP GPS assistance configuration #####
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 436b1070f..e3c724fad 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
@@ -6,8 +6,8 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=2500000
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=2500000
 
 
 ;######### SUPL RRLP GPS assistance configuration #####
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 62938acd4..541ef7b8b 100644
--- a/conf/gnss-sdr_multichannel_GPS_L1_USRP_X300_realtime.conf
+++ b/conf/gnss-sdr_multichannel_GPS_L1_USRP_X300_realtime.conf
@@ -6,8 +6,8 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=4000000
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=4000000
 
 
 ;######### SUPL RRLP GPS assistance configuration #####
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 e278865e9..50cd9d1cb 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
@@ -6,8 +6,8 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=5000000
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=5000000
 
 
 ;######### SUPL RRLP GPS assistance configuration #####
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 26128cf81..ce8f87a9f 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
@@ -6,8 +6,8 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=5000000
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=5000000
 
 
 ;######### SUPL RRLP GPS assistance configuration #####
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 7a108fba6..e03a01dbe 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
@@ -6,8 +6,8 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=5000000
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=5000000
 
 
 ;######### SUPL RRLP GPS assistance configuration #####
diff --git a/conf/gnss-sdr_multisource_Hybrid_ishort.conf b/conf/gnss-sdr_multisource_Hybrid_ishort.conf
index 31f777693..71571955e 100644
--- a/conf/gnss-sdr_multisource_Hybrid_ishort.conf
+++ b/conf/gnss-sdr_multisource_Hybrid_ishort.conf
@@ -6,9 +6,11 @@
 [GNSS-SDR]
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-GNSS-SDR.internal_fs_hz=4000000
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+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
@@ -283,14 +285,12 @@ Resampler1.sample_freq_out=4000000
 
 ;######### CHANNELS GLOBAL CONFIG ############
 ;#count: Number of available GPS satellite channels.
-Channels_GPS.count=2
+Channels_1C.count=2
 ;#count: Number of available Galileo satellite channels.
-Channels_Galileo.count=2
+Channels_1B.count=2
 ;#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, Galileo
+
 
 ;# CHANNEL CONNECTION
 Channel0.RF_channel_ID=0
@@ -305,118 +305,118 @@ Channel.signal=1B
 ;######### GPS ACQUISITION CONFIG ############
 
 ;#dump: Enable or disable the acquisition internal data file logging [true] or [false]
-Acquisition_GPS.dump=false
+Acquisition_1C.dump=false
 ;#filename: Log path and filename
-Acquisition_GPS.dump_filename=./acq_dump.dat
+Acquisition_1C.dump_filename=./acq_dump.dat
 ;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version.
-Acquisition_GPS.item_type=gr_complex
+Acquisition_1C.item_type=gr_complex
 ;#if: Signal intermediate frequency in [Hz]
-Acquisition_GPS.if=0
+Acquisition_1C.if=0
 ;#sampled_ms: Signal block duration for the acquisition signal detection [ms]
-Acquisition_GPS.sampled_ms=1
+Acquisition_1C.sampled_ms=1
 ;#implementation: Acquisition algorithm selection for this channel: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
-Acquisition_GPS.implementation=GPS_L1_CA_PCPS_Acquisition
+Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition
 ;#threshold: Acquisition threshold
-Acquisition_GPS.threshold=0.0075
+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_GPS.pfa=0.01
+;Acquisition_1C.pfa=0.01
 ;#doppler_max: Maximum expected Doppler shift [Hz]
-Acquisition_GPS.doppler_max=10000
+Acquisition_1C.doppler_max=10000
 ;#doppler_max: Doppler step in the grid search [Hz]
-Acquisition_GPS.doppler_step=500
+Acquisition_1C.doppler_step=500
 
 
 ;######### GALILEO ACQUISITION CONFIG ############
 
 ;#dump: Enable or disable the acquisition internal data file logging [true] or [false]
-Acquisition_Galileo.dump=false
+Acquisition_1B.dump=false
 ;#filename: Log path and filename
-Acquisition_Galileo.dump_filename=./acq_dump.dat
+Acquisition_1B.dump_filename=./acq_dump.dat
 ;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version.
-Acquisition_Galileo.item_type=gr_complex
+Acquisition_1B.item_type=gr_complex
 ;#if: Signal intermediate frequency in [Hz]
-Acquisition_Galileo.if=0
+Acquisition_1B.if=0
 ;#sampled_ms: Signal block duration for the acquisition signal detection [ms]
-Acquisition_Galileo.sampled_ms=4
+Acquisition_1B.sampled_ms=4
 ;#implementation: Acquisition algorithm selection for this channel: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
-Acquisition_Galileo.implementation=Galileo_E1_PCPS_Ambiguous_Acquisition
+Acquisition_1B.implementation=Galileo_E1_PCPS_Ambiguous_Acquisition
 ;#threshold: Acquisition threshold
-;Acquisition_Galileo.threshold=0
+;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_Galileo.pfa=0.0000008
+Acquisition_1B.pfa=0.0000008
 ;#doppler_max: Maximum expected Doppler shift [Hz]
-Acquisition_Galileo.doppler_max=15000
+Acquisition_1B.doppler_max=15000
 ;#doppler_max: Doppler step in the grid search [Hz]
-Acquisition_Galileo.doppler_step=125
+Acquisition_1B.doppler_step=125
 
 ;######### TRACKING GPS CONFIG ############
 
 ;#implementation: Selected tracking algorithm: [GPS_L1_CA_DLL_PLL_Tracking] or [GPS_L1_CA_DLL_PLL_C_Aid_Tracking] or [GPS_L1_CA_TCP_CONNECTOR_Tracking] or [Galileo_E1_DLL_PLL_VEML_Tracking]
-Tracking_GPS.implementation=GPS_L1_CA_DLL_PLL_Tracking
+Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking
 ;#item_type: Type and resolution for each of the signal samples. Use only [gr_complex] in this version.
-Tracking_GPS.item_type=gr_complex
+Tracking_1C.item_type=gr_complex
 
 ;#sampling_frequency: Signal Intermediate Frequency in [Hz]
-Tracking_GPS.if=0
+Tracking_1C.if=0
 
 ;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false]
-Tracking_GPS.dump=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_GPS.dump_filename=../data/epl_tracking_ch_
+Tracking_1C.dump_filename=../data/epl_tracking_ch_
 
 ;#pll_bw_hz: PLL loop filter bandwidth [Hz]
-Tracking_GPS.pll_bw_hz=45.0;
+Tracking_1C.pll_bw_hz=45.0;
 
 ;#dll_bw_hz: DLL loop filter bandwidth [Hz]
-Tracking_GPS.dll_bw_hz=4.0;
+Tracking_1C.dll_bw_hz=4.0;
 
 ;#order: PLL/DLL loop filter order [2] or [3]
-Tracking_GPS.order=3;
+Tracking_1C.order=3;
 
 ;######### TRACKING GALILEO CONFIG ############
 
 ;#implementation: Selected tracking algorithm: [Galileo_E1_DLL_PLL_VEML_Tracking]
-Tracking_Galileo.implementation=Galileo_E1_DLL_PLL_VEML_Tracking
+Tracking_1B.implementation=Galileo_E1_DLL_PLL_VEML_Tracking
 ;#item_type: Type and resolution for each of the signal samples. Use only [gr_complex] in this version.
-Tracking_Galileo.item_type=gr_complex
+Tracking_1B.item_type=gr_complex
 
 ;#sampling_frequency: Signal Intermediate Frequency in [Hz]
-Tracking_Galileo.if=0
+Tracking_1B.if=0
 
 ;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false]
-Tracking_Galileo.dump=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_Galileo.dump_filename=../data/veml_tracking_ch_
+Tracking_1B.dump_filename=../data/veml_tracking_ch_
 
 ;#pll_bw_hz: PLL loop filter bandwidth [Hz]
-Tracking_Galileo.pll_bw_hz=15.0;
+Tracking_1B.pll_bw_hz=15.0;
 
 ;#dll_bw_hz: DLL loop filter bandwidth [Hz]
-Tracking_Galileo.dll_bw_hz=2.0;
+Tracking_1B.dll_bw_hz=2.0;
 
 ;#order: PLL/DLL loop filter order [2] or [3]
-Tracking_Galileo.order=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_Galileo.early_late_space_chips=0.15;
+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_Galileo.very_early_late_space_chips=0.6;
+Tracking_1B.very_early_late_space_chips=0.6;
 
 
 ;######### TELEMETRY DECODER GPS CONFIG ############
 ;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L1 C/A
-TelemetryDecoder_GPS.implementation=GPS_L1_CA_Telemetry_Decoder
-TelemetryDecoder_GPS.dump=false
+TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder
+TelemetryDecoder_1C.dump=false
 ;#decimation factor
-TelemetryDecoder_GPS.decimation_factor=4;
+TelemetryDecoder_1C.decimation_factor=4;
 
 ;######### TELEMETRY DECODER GALILEO CONFIG ############
 ;#implementation: Use [Galileo_E1B_Telemetry_Decoder] for Galileo E1B
-TelemetryDecoder_Galileo.implementation=Galileo_E1B_Telemetry_Decoder
-TelemetryDecoder_Galileo.dump=false
+TelemetryDecoder_1B.implementation=Galileo_E1B_Telemetry_Decoder
+TelemetryDecoder_1B.dump=false
 
 
 ;######### OBSERVABLES CONFIG ############
diff --git a/conf/gnss-sdr_multisource_Hybrid_nsr.conf b/conf/gnss-sdr_multisource_Hybrid_nsr.conf
index f0a644f18..deee952af 100644
--- a/conf/gnss-sdr_multisource_Hybrid_nsr.conf
+++ b/conf/gnss-sdr_multisource_Hybrid_nsr.conf
@@ -8,11 +8,11 @@
 Receiver.sources_count=2
 
 ;######### GLOBAL OPTIONS ##################
-;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
-;GNSS-SDR.internal_fs_hz=6826700
-GNSS-SDR.internal_fs_hz=2560000
-;GNSS-SDR.internal_fs_hz=4096000
-;GNSS-SDR.internal_fs_hz=5120000
+;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
 
 ;#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.
diff --git a/src/algorithms/PVT/adapters/CMakeLists.txt b/src/algorithms/PVT/adapters/CMakeLists.txt
index a051c7953..baf58e507 100644
--- a/src/algorithms/PVT/adapters/CMakeLists.txt
+++ b/src/algorithms/PVT/adapters/CMakeLists.txt
@@ -21,7 +21,7 @@ set(PVT_ADAPTER_SOURCES
 )
 
 include_directories(
-     $(CMAKE_CURRENT_SOURCE_DIR)
+     ${CMAKE_CURRENT_SOURCE_DIR}
      ${CMAKE_SOURCE_DIR}/src/core/system_parameters
      ${CMAKE_SOURCE_DIR}/src/core/interfaces
      ${CMAKE_SOURCE_DIR}/src/core/receiver
diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.cc b/src/algorithms/PVT/adapters/rtklib_pvt.cc
index 0de546abb..8e1e9fbe0 100644
--- a/src/algorithms/PVT/adapters/rtklib_pvt.cc
+++ b/src/algorithms/PVT/adapters/rtklib_pvt.cc
@@ -194,7 +194,8 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
     int num_bands = 0;
     if ((gps_1C_count > 0) || (gal_1B_count > 0)) num_bands = 1;
     if (((gps_1C_count > 0) || (gal_1B_count > 0)) && (gps_2S_count > 0) ) num_bands = 2;
-    if (((gps_1C_count > 0) || (gal_1B_count > 0)) && (gps_2S_count > 0) && ((gal_E5a_count > 0) || (gal_E5a_count > 0))) num_bands = 3;
+    if (((gps_1C_count > 0) || (gal_1B_count > 0)) && ((gal_E5a_count > 0) || (gal_E5b_count > 0)) ) num_bands = 2;
+    if (((gps_1C_count > 0) || (gal_1B_count > 0)) && (gps_2S_count > 0) && ((gal_E5a_count > 0) || (gal_E5b_count > 0))) num_bands = 3;
     int number_of_frequencies = configuration->property(role + ".num_bands", num_bands); /* (1:L1, 2:L1+L2, 3:L1+L2+L5) */
     if( (number_of_frequencies < 1) || (number_of_frequencies > 3) )
         {
@@ -382,7 +383,7 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
             iono_model,      /* ionosphere option (IONOOPT_XXX) */
             trop_model,      /* troposphere option (TROPOPT_XXX) */
             dynamics_model,  /* dynamics model (0:none, 1:velocity, 2:accel) */
-            earth_tide,   /* earth tide correction (0:off,1:solid,2:solid+otl+pole) */
+            earth_tide,      /* earth tide correction (0:off,1:solid,2:solid+otl+pole) */
             number_filter_iter,   /* number of filter iteration */
             0,   /* code smoothing window size (0:none) */
             0,   /* interpolate reference obs (for post mission) */
@@ -446,7 +447,7 @@ bool RtklibPvt::save_assistance_to_XML()
                     ofs.close();
                     LOG(INFO) << "Saved GPS L1 Ephemeris map data";
                 }
-            catch (std::exception& e)
+            catch (const std::exception & e)
                 {
                     LOG(WARNING) << e.what();
                     return false;
diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.h b/src/algorithms/PVT/adapters/rtklib_pvt.h
index 33d04ecf0..f37515323 100644
--- a/src/algorithms/PVT/adapters/rtklib_pvt.h
+++ b/src/algorithms/PVT/adapters/rtklib_pvt.h
@@ -53,44 +53,41 @@ public:
 
     virtual ~RtklibPvt();
 
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
 
     //!  Returns "RTKLIB_Pvt"
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "RTKLIB_PVT";
     }
 
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+    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;
 
-    void reset()
+    inline void reset() override
     {
         return;
     }
 
     //! All blocks must have an item_size() function implementation. Returns sizeof(gr_complex)
-    size_t item_size()
+    inline size_t item_size() override
     {
         return sizeof(gr_complex);
     }
 
 private:
     rtklib_pvt_cc_sptr pvt_;
-
     rtk_t rtk;
-
     bool dump_;
     std::string dump_filename_;
     std::string role_;
     unsigned int in_streams_;
     unsigned int out_streams_;
-
     std::string eph_xml_filename_;
     bool save_assistance_to_XML();
 };
diff --git a/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt b/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt
index a80c236a4..ad8c08e7c 100644
--- a/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt
+++ b/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt
@@ -21,7 +21,7 @@ set(PVT_GR_BLOCKS_SOURCES
 )
 
 include_directories(
-     $(CMAKE_CURRENT_SOURCE_DIR)
+     ${CMAKE_CURRENT_SOURCE_DIR}
      ${CMAKE_SOURCE_DIR}/src/core/system_parameters
      ${CMAKE_SOURCE_DIR}/src/core/interfaces
      ${CMAKE_SOURCE_DIR}/src/core/receiver
diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc
index a349ef753..152fc6f1d 100644
--- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc
+++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc
@@ -280,7 +280,7 @@ rtklib_pvt_cc::rtklib_pvt_cc(unsigned int nchannels, bool dump, std::string dump
     d_dump_filename.append("_raw.dat");
     dump_ls_pvt_filename.append("_ls_pvt.dat");
 
-    d_ls_pvt = std::make_shared<rtklib_solver>((int)nchannels, dump_ls_pvt_filename, d_dump, rtk);
+    d_ls_pvt = std::make_shared<rtklib_solver>(static_cast<int>(nchannels), dump_ls_pvt_filename, d_dump, rtk);
     d_ls_pvt->set_averaging_depth(1);
 
     d_rx_time = 0.0;
@@ -326,8 +326,7 @@ rtklib_pvt_cc::rtklib_pvt_cc(unsigned int nchannels, bool dump, std::string dump
             std::cout << "GNSS-SDR can not create message queues!" << std::endl;
             throw new std::exception();
         }
-    gettimeofday(&tv, NULL);
-    begin = tv.tv_sec * 1000000 + tv.tv_usec;
+    start = std::chrono::system_clock::now();
 }
 
 
@@ -336,7 +335,7 @@ rtklib_pvt_cc::~rtklib_pvt_cc()
     msgctl(sysv_msqid, IPC_RMID, NULL);
 
     //save GPS L2CM ephemeris to XML file
-    std::string file_name="eph_GPS_L2CM.xml";
+    std::string file_name = "eph_GPS_L2CM.xml";
 
     if (d_ls_pvt->gps_cnav_ephemeris_map.size() > 0)
         {
@@ -348,7 +347,7 @@ rtklib_pvt_cc::~rtklib_pvt_cc()
                     ofs.close();
                     LOG(INFO) << "Saved GPS L2CM Ephemeris map data";
             }
-            catch (std::exception& e)
+            catch (const std::exception & e)
             {
                     LOG(WARNING) << e.what();
             }
@@ -371,7 +370,7 @@ rtklib_pvt_cc::~rtklib_pvt_cc()
                     ofs.close();
                     LOG(INFO) << "Saved GPS L1 CA Ephemeris map data";
             }
-            catch (std::exception& e)
+            catch (const std::exception & e)
             {
                     LOG(WARNING) << e.what();
             }
@@ -394,7 +393,7 @@ rtklib_pvt_cc::~rtklib_pvt_cc()
                     ofs.close();
                     LOG(INFO) << "Saved Galileo E1 Ephemeris map data";
             }
-            catch (std::exception& e)
+            catch (const std::exception & e)
             {
                     LOG(WARNING) << e.what();
             }
@@ -404,6 +403,17 @@ rtklib_pvt_cc::~rtklib_pvt_cc()
             LOG(WARNING) << "Failed to save Galileo E1 Ephemeris, map is empty";
         }
 
+    if (d_dump_file.is_open() == true)
+        {
+            try
+            {
+                    d_dump_file.close();
+            }
+            catch(const std::exception & ex)
+            {
+                    LOG(WARNING) << "Exception in destructor closing the dump file " << ex.what();
+            }
+        }
 }
 
 
@@ -447,16 +457,16 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
             unsigned int gal_channel = 0;
 
             gnss_observables_map.clear();
-            Gnss_Synchro **in = (Gnss_Synchro **)  &input_items[0]; //Get the input pointer
+            const Gnss_Synchro **in = reinterpret_cast<const Gnss_Synchro **>(&input_items[0]); // Get the input buffer pointer
 
             // ############ 1. READ PSEUDORANGES ####
             for (unsigned int i = 0; i < d_nchannels; i++)
                 {
                     if (in[i][epoch].Flag_valid_pseudorange == true)
                         {
-                            std::map<int,Gps_Ephemeris>::iterator tmp_eph_iter_gps = d_ls_pvt->gps_ephemeris_map.find(in[i][epoch].PRN);
-                            std::map<int,Galileo_Ephemeris>::iterator tmp_eph_iter_gal = d_ls_pvt->galileo_ephemeris_map.find(in[i][epoch].PRN);
-                            std::map<int,Gps_CNAV_Ephemeris>::iterator tmp_eph_iter_cnav = d_ls_pvt->gps_cnav_ephemeris_map.find(in[i][epoch].PRN);
+                            std::map<int,Gps_Ephemeris>::const_iterator tmp_eph_iter_gps = d_ls_pvt->gps_ephemeris_map.find(in[i][epoch].PRN);
+                            std::map<int,Galileo_Ephemeris>::const_iterator tmp_eph_iter_gal = d_ls_pvt->galileo_ephemeris_map.find(in[i][epoch].PRN);
+                            std::map<int,Gps_CNAV_Ephemeris>::const_iterator tmp_eph_iter_cnav = d_ls_pvt->gps_cnav_ephemeris_map.find(in[i][epoch].PRN);
                             if(((tmp_eph_iter_gps->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("1C") == 0))
                                     || ((tmp_eph_iter_cnav->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("2S") == 0))
                                     || ((tmp_eph_iter_gal->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("1B") == 0))
@@ -559,18 +569,18 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
 
                                     for (std::map<int,Gnss_Synchro>::iterator it = gnss_observables_map.begin(); it != gnss_observables_map.end(); ++it)
                                         {
-                                            it->second.Pseudorange_m = it->second.Pseudorange_m - d_ls_pvt->d_rx_dt_s * GPS_C_m_s;
+                                            it->second.Pseudorange_m = it->second.Pseudorange_m - d_ls_pvt->get_time_offset_s() * GPS_C_m_s;
                                         }
                                     if(first_fix == true)
                                         {
-                                            std::cout << "First position fix at " << boost::posix_time::to_simple_string(d_ls_pvt->d_position_UTC_time)
-                                            << " UTC is Lat = " << d_ls_pvt->d_latitude_d << " [deg], Long = " << d_ls_pvt->d_longitude_d
-                                            << " [deg], Height= " << d_ls_pvt->d_height_m << " [m]" << std::endl;
+                                            std::cout << "First position fix at " << boost::posix_time::to_simple_string(d_ls_pvt->get_position_UTC_time())
+                                                      << " UTC is Lat = " << d_ls_pvt->get_latitude() << " [deg], Long = " << d_ls_pvt->get_longitude()
+                                                      << " [deg], Height= " << d_ls_pvt->get_height() << " [m]" << std::endl;
                                             ttff_msgbuf ttff;
                                             ttff.mtype = 1;
-                                            gettimeofday(&tv, NULL);
-                                            long long int end = tv.tv_sec * 1000000 + tv.tv_usec;
-                                            ttff.ttff = static_cast<double>(end - begin) / 1000000.0;
+                                            end = std::chrono::system_clock::now();
+                                            std::chrono::duration<double> elapsed_seconds = end - start;
+                                            ttff.ttff = elapsed_seconds.count();
                                             send_sys_v_ttff_msg(ttff);
                                             first_fix = false;
                                         }
@@ -607,20 +617,20 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
 
                                     // ####################### RINEX FILES #################
 
-                                    std::map<int, Galileo_Ephemeris>::iterator galileo_ephemeris_iter;
-                                    std::map<int, Gps_Ephemeris>::iterator gps_ephemeris_iter;
-                                    std::map<int, Gps_CNAV_Ephemeris>::iterator gps_cnav_ephemeris_iter;
-                                    std::map<int, Gnss_Synchro>::iterator gnss_observables_iter;
+                                    std::map<int, Galileo_Ephemeris>::const_iterator galileo_ephemeris_iter;
+                                    std::map<int, Gps_Ephemeris>::const_iterator gps_ephemeris_iter;
+                                    std::map<int, Gps_CNAV_Ephemeris>::const_iterator gps_cnav_ephemeris_iter;
+                                    std::map<int, Gnss_Synchro>::const_iterator gnss_observables_iter;
 
                                     if (!b_rinex_header_written) //  & we have utc data in nav message!
                                         {
-                                            galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.begin();
-                                            gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin();
-                                            gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.begin();
+                                            galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin();
+                                            gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin();
+                                            gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin();
 
                                             if(type_of_rx == 1) // GPS L1 C/A only
                                                 {
-                                                    if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())
+                                                    if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())
                                                         {
                                                             rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, d_rx_time);
                                                             rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model);
@@ -630,7 +640,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
                                                 }
                                             if(type_of_rx == 2) // GPS L2C only
                                                 {
-                                                    if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end())
+                                                    if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())
                                                         {
                                                             rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time);
                                                             rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model);
@@ -639,7 +649,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
                                                 }
                                             if(type_of_rx == 4) // Galileo E1B only
                                                 {
-                                                    if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())
+                                                    if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
                                                         {
                                                             rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time);
                                                             rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac);
@@ -649,7 +659,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
                                             if(type_of_rx == 5) // Galileo E5a only
                                                 {
                                                     std::string signal("5X");
-                                                    if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())
+                                                    if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
                                                         {
                                                             rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, signal);
                                                             rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac);
@@ -659,7 +669,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
                                             if(type_of_rx == 6) // Galileo E5b only
                                                 {
                                                     std::string signal("7X");
-                                                    if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())
+                                                    if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
                                                         {
                                                             rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, signal);
                                                             rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac);
@@ -668,7 +678,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
                                                 }
                                             if(type_of_rx == 7) // GPS L1 C/A + GPS L2C
                                                 {
-                                                    if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end()))
+                                                    if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()))
                                                         {
                                                             rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time);
                                                             rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model);
@@ -678,7 +688,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
 
                                             if(type_of_rx == 9) // GPS L1 C/A + Galileo E1B
                                                 {
-                                                    if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) )
+                                                    if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) )
                                                         {
                                                             std::string gal_signal("1B");
                                                             rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal);
@@ -688,7 +698,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
                                                 }
                                             if(type_of_rx == 10) //  GPS L1 C/A + Galileo E5a
                                                 {
-                                                    if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) )
+                                                    if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) )
                                                         {
                                                             std::string gal_signal("5X");
                                                             rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal);
@@ -698,7 +708,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
                                                 }
                                             if(type_of_rx == 11) //  GPS L1 C/A + Galileo E5b
                                                 {
-                                                    if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) )
+                                                    if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) )
                                                         {
                                                             std::string gal_signal("7X");
                                                             rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal);
@@ -708,7 +718,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
                                                 }
                                             if(type_of_rx == 14) //  Galileo E1B + Galileo E5a
                                                 {
-                                                    if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) )
+                                                    if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) )
                                                         {
                                                             std::string gal_signal("1B 5X");
                                                             rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gal_signal);
@@ -718,7 +728,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
                                                 }
                                             if(type_of_rx == 15) //  Galileo E1B + Galileo E5b
                                                 {
-                                                    if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) )
+                                                    if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) )
                                                         {
                                                             std::string gal_signal("1B 7X");
                                                             rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gal_signal);
@@ -756,9 +766,9 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
                                                             rp->log_rinex_nav(rp->navGalFile, d_ls_pvt->galileo_ephemeris_map);
                                                         }
                                                 }
-                                            galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.begin();
-                                            gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin();
-                                            gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.begin();
+                                            galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin();
+                                            gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin();
+                                            gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin();
 
                                             // Log observables into the RINEX file
                                             if(flag_write_RINEX_obs_output)
@@ -890,17 +900,17 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
                                                 {
                                                     if(flag_write_RTCM_1019_output == true)
                                                         {
-                                                            for(std::map<int,Gps_Ephemeris>::iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end(); gps_ephemeris_iter++ )
+                                                            for(std::map<int,Gps_Ephemeris>::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++ )
                                                                 {
                                                                     d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second);
                                                                 }
                                                         }
                                                     if(flag_write_RTCM_MSM_output == true)
                                                         {
-                                                            std::map<int,Gps_Ephemeris>::iterator gps_ephemeris_iter;
-                                                            gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin();
+                                                            std::map<int,Gps_Ephemeris>::const_iterator gps_ephemeris_iter;
+                                                            gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin();
 
-                                                            if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())
+                                                            if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())
                                                                 {
                                                                     d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
                                                                 }
@@ -910,16 +920,16 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
                                                 {
                                                     if(flag_write_RTCM_1045_output == true)
                                                         {
-                                                            for(std::map<int,Galileo_Ephemeris>::iterator gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.begin(); gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end(); gal_ephemeris_iter++ )
+                                                            for(std::map<int,Galileo_Ephemeris>::const_iterator gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_ephemeris_iter++ )
                                                                 {
                                                                     d_rtcm_printer->Print_Rtcm_MT1045(gal_ephemeris_iter->second);
                                                                 }
                                                         }
                                                     if(flag_write_RTCM_MSM_output == true)
                                                         {
-                                                            std::map<int,Galileo_Ephemeris>::iterator gal_ephemeris_iter;
-                                                            gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.begin();
-                                                            if (gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())
+                                                            std::map<int,Galileo_Ephemeris>::const_iterator gal_ephemeris_iter;
+                                                            gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin();
+                                                            if (gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
                                                                 {
                                                                     d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
                                                                 }
@@ -929,18 +939,18 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
                                                 {
                                                     if(flag_write_RTCM_1019_output == true)
                                                         {
-                                                            for(std::map<int,Gps_Ephemeris>::iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end(); gps_ephemeris_iter++ )
+                                                            for(std::map<int,Gps_Ephemeris>::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++ )
                                                                 {
                                                                     d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second);
                                                                 }
                                                         }
                                                     if(flag_write_RTCM_MSM_output == true)
                                                         {
-                                                            std::map<int,Gps_Ephemeris>::iterator gps_ephemeris_iter;
-                                                            gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin();
-                                                            std::map<int,Gps_CNAV_Ephemeris>::iterator gps_cnav_ephemeris_iter;
-                                                            gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.begin();
-                                                            if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end()) )
+                                                            std::map<int,Gps_Ephemeris>::const_iterator gps_ephemeris_iter;
+                                                            gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin();
+                                                            std::map<int,Gps_CNAV_Ephemeris>::const_iterator gps_cnav_ephemeris_iter;
+                                                            gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin();
+                                                            if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) )
                                                                 {
                                                                     d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
                                                                 }
@@ -967,7 +977,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
                                                             //gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.end();
                                                             //galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.end();
                                                             unsigned int i = 0;
-                                                            for (gnss_observables_iter = gnss_observables_map.begin(); gnss_observables_iter != gnss_observables_map.end(); gnss_observables_iter++)
+                                                            for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++)
                                                                 {
                                                                     std::string system(&gnss_observables_iter->second.System, 1);
                                                                     if(gps_channel == 0)
@@ -976,7 +986,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
                                                                                 {
                                                                                     // This is a channel with valid GPS signal
                                                                                     gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN);
-                                                                                    if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())
+                                                                                    if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())
                                                                                         {
                                                                                             gps_channel = i;
                                                                                         }
@@ -987,7 +997,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
                                                                             if(system.compare("E") == 0)
                                                                                 {
                                                                                     galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN);
-                                                                                    if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())
+                                                                                    if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
                                                                                         {
                                                                                             gal_channel = i;
                                                                                         }
@@ -998,14 +1008,14 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
                                                             if(flag_write_RTCM_MSM_output == true)
                                                                 {
 
-                                                                    if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())
+                                                                    if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
                                                                         {
                                                                             d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
                                                                         }
                                                                 }
                                                             if(flag_write_RTCM_MSM_output == true)
                                                                 {
-                                                                    if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())
+                                                                    if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())
                                                                         {
                                                                             d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
                                                                         }
@@ -1018,14 +1028,14 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
                                         {
                                             if(type_of_rx == 1) // GPS L1 C/A
                                                 {
-                                                    for(std::map<int,Gps_Ephemeris>::iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end(); gps_ephemeris_iter++ )
+                                                    for(std::map<int,Gps_Ephemeris>::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++ )
                                                         {
                                                             d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second);
                                                         }
 
-                                                    std::map<int,Gps_Ephemeris>::iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin();
+                                                    std::map<int,Gps_Ephemeris>::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin();
 
-                                                    if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())
+                                                    if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())
                                                         {
                                                             d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
                                                         }
@@ -1034,14 +1044,14 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
 
                                             if((type_of_rx == 4) || (type_of_rx == 5) || (type_of_rx == 6) || (type_of_rx == 14) || (type_of_rx == 15)) // Galileo
                                                 {
-                                                    for(std::map<int,Galileo_Ephemeris>::iterator gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.begin(); gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end(); gal_ephemeris_iter++ )
+                                                    for(std::map<int,Galileo_Ephemeris>::const_iterator gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_ephemeris_iter++ )
                                                         {
                                                             d_rtcm_printer->Print_Rtcm_MT1045(gal_ephemeris_iter->second);
                                                         }
 
-                                                    std::map<int,Galileo_Ephemeris>::iterator gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.begin();
+                                                    std::map<int,Galileo_Ephemeris>::const_iterator gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin();
 
-                                                    if (gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())
+                                                    if (gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
                                                         {
                                                             d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
                                                         }
@@ -1049,15 +1059,15 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
                                                 }
                                             if(type_of_rx == 7) // GPS L1 C/A + GPS L2C
                                                 {
-                                                    for(std::map<int,Gps_Ephemeris>::iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end(); gps_ephemeris_iter++ )
+                                                    for(std::map<int,Gps_Ephemeris>::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++ )
                                                         {
                                                             d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second);
                                                         }
 
-                                                    std::map<int,Gps_Ephemeris>::iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin();
-                                                    std::map<int,Gps_CNAV_Ephemeris>::iterator gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.begin();
+                                                    std::map<int,Gps_Ephemeris>::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin();
+                                                    std::map<int,Gps_CNAV_Ephemeris>::const_iterator gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin();
 
-                                                    if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end()))
+                                                    if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()))
                                                         {
                                                             d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
                                                         }
@@ -1067,7 +1077,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
                                                 {
                                                     if(d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0
                                                         {
-                                                            for(std::map<int,Gps_Ephemeris>::iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end(); gps_ephemeris_iter++ )
+                                                            for(std::map<int,Gps_Ephemeris>::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++ )
                                                                 {
                                                                     d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second);
                                                                 }
@@ -1081,7 +1091,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
                                                         }
 
                                                     unsigned int i = 0;
-                                                    for (gnss_observables_iter = gnss_observables_map.begin(); gnss_observables_iter != gnss_observables_map.end(); gnss_observables_iter++)
+                                                    for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++)
                                                         {
                                                             std::string system(&gnss_observables_iter->second.System, 1);
                                                             if(gps_channel == 0)
@@ -1126,20 +1136,20 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
                         }
 
                     // DEBUG MESSAGE: Display position in console output
-                    if( (d_ls_pvt->b_valid_position == true) && (flag_display_pvt == true) )
+                    if( (d_ls_pvt->is_valid_position() == true) && (flag_display_pvt == true) )
                         {
-                            std::cout << "Position at " << boost::posix_time::to_simple_string(d_ls_pvt->d_position_UTC_time)
-                                      << " UTC using " << d_ls_pvt->d_valid_observations << " observations is Lat = " << d_ls_pvt->d_latitude_d << " [deg], Long = " << d_ls_pvt->d_longitude_d
-                                      << " [deg], Height= " << d_ls_pvt->d_height_m << " [m]" << std::endl;
+                            std::cout << "Position at " << boost::posix_time::to_simple_string(d_ls_pvt->get_position_UTC_time())
+                                      << " UTC using " << d_ls_pvt->get_num_valid_observations() << " observations is Lat = " << d_ls_pvt->get_latitude() << " [deg], Long = " << d_ls_pvt->get_longitude()
+                                      << " [deg], Height= " << d_ls_pvt->get_height() << " [m]" << std::endl;
 
-                            LOG(INFO) << "Position at " << boost::posix_time::to_simple_string(d_ls_pvt->d_position_UTC_time)
-                                      << " UTC using "<< d_ls_pvt->d_valid_observations << " observations is Lat = " << d_ls_pvt->d_latitude_d << " [deg], Long = " << d_ls_pvt->d_longitude_d
-                                      << " [deg], Height= " << d_ls_pvt->d_height_m << " [m]";
+                            LOG(INFO) << "Position at " << boost::posix_time::to_simple_string(d_ls_pvt->get_position_UTC_time())
+                                      << " UTC using "<< d_ls_pvt->get_num_valid_observations() << " observations is Lat = " << d_ls_pvt->get_latitude() << " [deg], Long = " << d_ls_pvt->get_longitude()
+                                      << " [deg], Height= " << d_ls_pvt->get_height() << " [m]";
 
-                            /* std::cout << "Dilution of Precision at " << boost::posix_time::to_simple_string(d_ls_pvt->d_position_UTC_time)
-                                         << " UTC using "<< d_ls_pvt->d_valid_observations<<" observations is HDOP = " << d_ls_pvt->d_HDOP << " VDOP = "
-                                         << d_ls_pvt->d_VDOP <<" TDOP = " << d_ls_pvt->d_TDOP
-                                         << " GDOP = " << d_ls_pvt->d_GDOP << std::endl; */
+                            /* std::cout << "Dilution of Precision at " << boost::posix_time::to_simple_string(d_ls_pvt->get_position_UTC_time())
+                                         << " UTC using "<< d_ls_pvt->get_num_valid_observations()<<" observations is HDOP = " << d_ls_pvt->get_HDOP() << " VDOP = "
+                                         << d_ls_pvt->get_VDOP() <<" TDOP = " << d_ls_pvt->get_TDOP()
+                                         << " GDOP = " << d_ls_pvt->get_GDOP() << std::endl; */
                         }
 
                     // MULTIPLEXED FILE RECORDING - Record results to file
@@ -1151,10 +1161,10 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
                                     for (unsigned int i = 0; i < d_nchannels; i++)
                                         {
                                             tmp_double = in[i][epoch].Pseudorange_m;
-                                            d_dump_file.write((char*)&tmp_double, sizeof(double));
+                                            d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
                                             tmp_double = 0;
-                                            d_dump_file.write((char*)&tmp_double, sizeof(double));
-                                            d_dump_file.write((char*)&d_rx_time, sizeof(double));
+                                            d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
+                                            d_dump_file.write(reinterpret_cast<char*>(&d_rx_time), sizeof(double));
                                         }
                             }
                             catch (const std::ifstream::failure& e)
diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h
index a23cb4b38..a188c5809 100644
--- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h
+++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h
@@ -31,7 +31,7 @@
 #ifndef GNSS_SDR_RTKLIB_PVT_CC_H
 #define GNSS_SDR_RTKLIB_PVT_CC_H
 
-#include <ctime>
+#include <chrono>
 #include <fstream>
 #include <utility>
 #include <string>
@@ -143,8 +143,7 @@ private:
         double ttff;
     } ttff_msgbuf;
     bool send_sys_v_ttff_msg(ttff_msgbuf ttff);
-    struct timeval tv;
-    long long int begin;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
 
 public:
     rtklib_pvt_cc(unsigned int nchannels,
diff --git a/src/algorithms/PVT/libs/CMakeLists.txt b/src/algorithms/PVT/libs/CMakeLists.txt
index d223454d3..5e30040d5 100644
--- a/src/algorithms/PVT/libs/CMakeLists.txt
+++ b/src/algorithms/PVT/libs/CMakeLists.txt
@@ -31,7 +31,7 @@ set(PVT_LIB_SOURCES
 )
 
 include_directories(
-     $(CMAKE_CURRENT_SOURCE_DIR)
+     ${CMAKE_CURRENT_SOURCE_DIR}
      ${CMAKE_SOURCE_DIR}/src/core/system_parameters
      ${CMAKE_SOURCE_DIR}/src/core/interfaces
      ${CMAKE_SOURCE_DIR}/src/core/receiver
diff --git a/src/algorithms/PVT/libs/geojson_printer.cc b/src/algorithms/PVT/libs/geojson_printer.cc
index 997992934..b1062f65f 100644
--- a/src/algorithms/PVT/libs/geojson_printer.cc
+++ b/src/algorithms/PVT/libs/geojson_printer.cc
@@ -31,9 +31,9 @@
 
 
 #include "geojson_printer.h"
-#include <ctime>
 #include <iomanip>
 #include <sstream>
+#include <boost/date_time/posix_time/posix_time.hpp>
 #include <glog/logging.h>
 
 GeoJSON_Printer::GeoJSON_Printer()
@@ -42,7 +42,6 @@ GeoJSON_Printer::GeoJSON_Printer()
 }
 
 
-
 GeoJSON_Printer::~GeoJSON_Printer ()
 {
     GeoJSON_Printer::close_file();
@@ -51,41 +50,39 @@ GeoJSON_Printer::~GeoJSON_Printer ()
 
 bool GeoJSON_Printer::set_headers(std::string filename, bool time_tag_name)
 {
-    time_t rawtime;
-    struct tm * timeinfo;
-    time ( &rawtime );
-    timeinfo = localtime ( &rawtime );
+    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;
+            const int year = timeinfo.tm_year - 100;
             strm0 << year;
-            const int month = timeinfo->tm_mon + 1;
+            const int month = timeinfo.tm_mon + 1;
             if(month < 10)
                 {
                     strm0 << "0";
                 }
             strm0 << month;
-            const int day = timeinfo->tm_mday;
+            const int day = timeinfo.tm_mday;
             if(day < 10)
                 {
                     strm0 << "0";
                 }
             strm0 << day << "_";
-            const int hour = timeinfo->tm_hour;
+            const int hour = timeinfo.tm_hour;
             if(hour < 10)
                 {
                     strm0 << "0";
                 }
             strm0 << hour;
-            const int min = timeinfo->tm_min;
+            const int min = timeinfo.tm_min;
             if(min < 10)
                 {
                     strm0 << "0";
                 }
             strm0 << min;
-            const int sec = timeinfo->tm_sec;
+            const int sec = timeinfo.tm_sec;
             if(sec < 10)
                 {
                     strm0 << "0";
@@ -131,7 +128,6 @@ bool GeoJSON_Printer::set_headers(std::string filename, bool time_tag_name)
 }
 
 
-
 bool GeoJSON_Printer::print_position(const std::shared_ptr<Pvt_Solution>& position, bool print_average_values)
 {
     double latitude;
@@ -142,15 +138,15 @@ bool GeoJSON_Printer::print_position(const std::shared_ptr<Pvt_Solution>& positi
 
     if (print_average_values == false)
         {
-            latitude = position_->d_latitude_d;
-            longitude = position_->d_longitude_d;
-            height = position_->d_height_m;
+            latitude = position_->get_latitude();
+            longitude = position_->get_longitude();
+            height = position_->get_height();
         }
     else
         {
-            latitude = position_->d_avg_latitude_d;
-            longitude = position_->d_avg_longitude_d;
-            height = position_->d_avg_height_m;
+            latitude = position_->get_avg_latitude();
+            longitude = position_->get_avg_longitude();
+            height = position_->get_avg_height();
         }
 
     if (geojson_file.is_open())
@@ -174,7 +170,6 @@ bool GeoJSON_Printer::print_position(const std::shared_ptr<Pvt_Solution>& positi
 }
 
 
-
 bool GeoJSON_Printer::close_file()
 {
     if (geojson_file.is_open())
diff --git a/src/algorithms/PVT/libs/hybrid_ls_pvt.cc b/src/algorithms/PVT/libs/hybrid_ls_pvt.cc
index 20add847b..2deb7c05b 100644
--- a/src/algorithms/PVT/libs/hybrid_ls_pvt.cc
+++ b/src/algorithms/PVT/libs/hybrid_ls_pvt.cc
@@ -46,7 +46,7 @@ hybrid_ls_pvt::hybrid_ls_pvt(int nchannels, std::string dump_filename, bool flag
     d_flag_dump_enabled = flag_dump_to_file;
     d_galileo_current_time = 0;
     count_valid_position = 0;
-    d_flag_averaging = false;
+    this->set_averaging_flag(false);
     // ############# ENABLE DATA FILE LOG #################
     if (d_flag_dump_enabled == true)
     {
@@ -69,7 +69,17 @@ hybrid_ls_pvt::hybrid_ls_pvt(int nchannels, std::string dump_filename, bool flag
 
 hybrid_ls_pvt::~hybrid_ls_pvt()
 {
-    d_dump_file.close();
+    if (d_dump_file.is_open() == true)
+        {
+            try
+            {
+                    d_dump_file.close();
+            }
+            catch(const std::exception & ex)
+            {
+                    LOG(WARNING) << "Exception in destructor closing the dump file " << ex.what();
+            }
+        }
 }
 
 
@@ -94,7 +104,7 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_observables_map, dou
     double TX_time_corrected_s = 0.0;
     double SV_clock_bias_s = 0.0;
 
-    d_flag_averaging = flag_averaging;
+    this->set_averaging_flag(flag_averaging);
 
     // ********************************************************************************
     // ****** PREPARE THE LEAST SQUARES DATA (SV POSITIONS MATRIX AND OBS VECTORS) ****
@@ -138,9 +148,9 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_observables_map, dou
 
                             // 4- fill the observations vector with the corrected observables
                             obs.resize(valid_obs + 1, 1);
-                            obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + SV_clock_bias_s * GALILEO_C_m_s - d_rx_dt_s * GALILEO_C_m_s;
-                            d_visible_satellites_IDs[valid_obs] = galileo_ephemeris_iter->second.i_satellite_PRN;
-                            d_visible_satellites_CN0_dB[valid_obs] = gnss_observables_iter->second.CN0_dB_hz;
+                            obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + SV_clock_bias_s * GALILEO_C_m_s - this->get_time_offset_s() * GALILEO_C_m_s;
+                            this->set_visible_satellites_ID(valid_obs, galileo_ephemeris_iter->second.i_satellite_PRN);
+                            this->set_visible_satellites_CN0_dB(valid_obs, gnss_observables_iter->second.CN0_dB_hz);
 
                             Galileo_week_number = galileo_ephemeris_iter->second.WN_5; //for GST
                             GST = galileo_ephemeris_iter->second.Galileo_System_Time(Galileo_week_number, hybrid_current_time);
@@ -201,9 +211,9 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_observables_map, dou
                                     double P1_P2=(1.0-Gamma)*(gps_ephemeris_iter->second.d_TGD* GPS_C_m_s);
                                     double Code_bias_m= P1_P2/(1.0-Gamma);
                                     obs.resize(valid_obs + 1, 1);
-                                    obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + dtr * GPS_C_m_s-Code_bias_m-d_rx_dt_s * GPS_C_m_s;
-                                    d_visible_satellites_IDs[valid_obs] = gps_ephemeris_iter->second.i_satellite_PRN;
-                                    d_visible_satellites_CN0_dB[valid_obs] = gnss_observables_iter->second.CN0_dB_hz;
+                                    obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + dtr * GPS_C_m_s-Code_bias_m-this->get_time_offset_s() * GPS_C_m_s;
+                                    this->set_visible_satellites_ID(valid_obs, gps_ephemeris_iter->second.i_satellite_PRN);
+                                    this->set_visible_satellites_CN0_dB(valid_obs, gnss_observables_iter->second.CN0_dB_hz);
 
                                     // SV ECEF DEBUG OUTPUT
                                     LOG(INFO) << "(new)ECEF GPS L1 CA satellite SV ID=" << gps_ephemeris_iter->second.i_satellite_PRN
@@ -254,8 +264,8 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_observables_map, dou
                                     // 4- fill the observations vector with the corrected observables
                                     obs.resize(valid_obs + 1, 1);
                                     obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + dtr*GPS_C_m_s + SV_clock_bias_s * GPS_C_m_s;
-                                    d_visible_satellites_IDs[valid_obs] = gps_cnav_ephemeris_iter->second.i_satellite_PRN;
-                                    d_visible_satellites_CN0_dB[valid_obs] = gnss_observables_iter->second.CN0_dB_hz;
+                                    this->set_visible_satellites_ID(valid_obs, gps_cnav_ephemeris_iter->second.i_satellite_PRN);
+                                    this->set_visible_satellites_CN0_dB(valid_obs, gnss_observables_iter->second.CN0_dB_hz);
 
                                     GPS_week = gps_cnav_ephemeris_iter->second.i_GPS_week;
                                     GPS_week=GPS_week%1024; //Necessary due to the increase of WN bits in CNAV message (10 in GPS NAV and 13 in CNAV)
@@ -286,7 +296,7 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_observables_map, dou
     // ********************************************************************************
     // ****** SOLVE LEAST SQUARES******************************************************
     // ********************************************************************************
-    d_valid_observations = valid_obs;
+    this->set_num_valid_observations(valid_obs);
 
     LOG(INFO) << "HYBRID PVT: valid observations=" << valid_obs;
 
@@ -299,23 +309,23 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_observables_map, dou
             try
             {
                     // check if this is the initial position computation
-                    if (d_rx_dt_s == 0)
+                    if (this->get_time_offset_s() == 0)
                         {
                             // execute Bancroft's algorithm to estimate initial receiver position and time
                             DLOG(INFO) << " Executing Bancroft algorithm...";
                             rx_position_and_time = bancroftPos(satpos.t(), obs);
-                            d_rx_pos = rx_position_and_time.rows(0, 2); // save ECEF position for the next iteration
-                            d_rx_dt_s = rx_position_and_time(3) / GPS_C_m_s; // save time for the next iteration [meters]->[seconds]
+                            this->set_rx_pos(rx_position_and_time.rows(0, 2)); // save ECEF position for the next iteration
+                            this->set_time_offset_s(rx_position_and_time(3) / GPS_C_m_s); // save time for the next iteration [meters]->[seconds]
                         }
 
                     // Execute WLS using previous position as the initialization point
                     rx_position_and_time = leastSquarePos(satpos, obs, W);
 
-                    d_rx_pos = rx_position_and_time.rows(0, 2); // save ECEF position for the next iteration
-                    d_rx_dt_s += rx_position_and_time(3) / GPS_C_m_s; // accumulate the rx time error for the next iteration [meters]->[seconds]
+                    this->set_rx_pos(rx_position_and_time.rows(0, 2)); // save ECEF position for the next iteration
+                    this->set_time_offset_s(this->get_time_offset_s() + rx_position_and_time(3) / GPS_C_m_s); // accumulate the rx time error for the next iteration [meters]->[seconds]
 
                     DLOG(INFO) << "Hybrid Position at TOW=" << hybrid_current_time << " in ECEF (X,Y,Z,t[meters]) = " << rx_position_and_time;
-                    DLOG(INFO) << "Accumulated rx clock error=" << d_rx_dt_s << " clock error for this iteration=" << rx_position_and_time(3) / GPS_C_m_s << " [s]";
+                    DLOG(INFO) << "Accumulated rx clock error=" << this->get_time_offset_s() << " clock error for this iteration=" << rx_position_and_time(3) / GPS_C_m_s << " [s]";
 
                     // Compute GST and Gregorian time
                     if( GST != 0.0)
@@ -331,13 +341,13 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_observables_map, dou
                     boost::posix_time::time_duration t = boost::posix_time::seconds(utc);
                     // 22 August 1999 00:00 last Galileo start GST epoch (ICD sec 5.1.2)
                     boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t);
-                    d_position_UTC_time = p_time;
+                    this->set_position_UTC_time(p_time);
 
                     cart2geo(static_cast<double>(rx_position_and_time(0)), static_cast<double>(rx_position_and_time(1)), static_cast<double>(rx_position_and_time(2)), 4);
 
                     DLOG(INFO) << "Hybrid Position at " << boost::posix_time::to_simple_string(p_time)
-                               << " is Lat = " << d_latitude_d << " [deg], Long = " << d_longitude_d
-                               << " [deg], Height= " << d_height_m << " [m]" << " RX time offset= " << d_rx_dt_s << " [s]";
+                               << " is Lat = " << this->get_latitude() << " [deg], Long = " << this->get_longitude()
+                               << " [deg], Height= " << this->get_height() << " [m]" << " RX time offset= " << this->get_time_offset_s() << " [s]";
 
                     // ###### Compute DOPs ########
                     hybrid_ls_pvt::compute_DOP();
@@ -351,28 +361,28 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_observables_map, dou
                                     double tmp_double;
                                     //  PVT GPS time
                                     tmp_double = hybrid_current_time;
-                                    d_dump_file.write((char*)&tmp_double, sizeof(double));
+                                    d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
                                     // ECEF User Position East [m]
                                     tmp_double = rx_position_and_time(0);
-                                    d_dump_file.write((char*)&tmp_double, sizeof(double));
+                                    d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
                                     // ECEF User Position North [m]
                                     tmp_double = rx_position_and_time(1);
-                                    d_dump_file.write((char*)&tmp_double, sizeof(double));
+                                    d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
                                     // ECEF User Position Up [m]
                                     tmp_double = rx_position_and_time(2);
-                                    d_dump_file.write((char*)&tmp_double, sizeof(double));
+                                    d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
                                     // User clock offset [s]
                                     tmp_double = rx_position_and_time(3);
-                                    d_dump_file.write((char*)&tmp_double, sizeof(double));
+                                    d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
                                     // GEO user position Latitude [deg]
-                                    tmp_double = d_latitude_d;
-                                    d_dump_file.write((char*)&tmp_double, sizeof(double));
+                                    tmp_double = this->get_latitude();
+                                    d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
                                     // GEO user position Longitude [deg]
-                                    tmp_double = d_longitude_d;
-                                    d_dump_file.write((char*)&tmp_double, sizeof(double));
+                                    tmp_double = this->get_longitude();
+                                    d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
                                     // GEO user position Height [m]
-                                    tmp_double = d_height_m;
-                                    d_dump_file.write((char*)&tmp_double, sizeof(double));
+                                    tmp_double = this->get_height();
+                                    d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
                             }
                             catch (const std::ifstream::failure& e)
                             {
@@ -381,18 +391,18 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_observables_map, dou
                         }
 
                     // MOVING AVERAGE PVT
-                    pos_averaging(flag_averaging);
+                    this->perform_pos_averaging();
             }
             catch(const std::exception & e)
             {
-                    d_rx_dt_s = 0; //reset rx time estimation
+                    this->set_time_offset_s(0.0); //reset rx time estimation
                     LOG(WARNING) << "Problem with the solver, invalid solution!" << e.what();
-                    b_valid_position = false;
+                    this->set_valid_position(false);
             }
         }
     else
         {
-            b_valid_position = false;
+            this->set_valid_position(false);
         }
-    return b_valid_position;
+    return this->is_valid_position();
 }
diff --git a/src/algorithms/PVT/libs/hybrid_ls_pvt.h b/src/algorithms/PVT/libs/hybrid_ls_pvt.h
index e1084d6e7..1a658793b 100644
--- a/src/algorithms/PVT/libs/hybrid_ls_pvt.h
+++ b/src/algorithms/PVT/libs/hybrid_ls_pvt.h
@@ -49,13 +49,17 @@
 class hybrid_ls_pvt : public Ls_Pvt
 {
 private:
-
+    int count_valid_position;
+    bool d_flag_dump_enabled;
+    std::string d_dump_filename;
+    std::ofstream d_dump_file;
+    int d_nchannels; // Number of available channels for positioning
+    double d_galileo_current_time;
 public:
     hybrid_ls_pvt(int nchannels,std::string dump_filename, bool flag_dump_to_file);
     ~hybrid_ls_pvt();
 
     bool get_PVT(std::map<int,Gnss_Synchro> gnss_observables_map, double Rx_time, bool flag_averaging);
-    int d_nchannels;                                        //!< Number of available channels for positioning
 
     std::map<int,Galileo_Ephemeris> galileo_ephemeris_map; //!< Map storing new Galileo_Ephemeris
     std::map<int,Gps_Ephemeris> gps_ephemeris_map; //!< Map storing new GPS_Ephemeris
@@ -70,16 +74,6 @@ public:
 
     Gps_CNAV_Iono gps_cnav_iono;
     Gps_CNAV_Utc_Model gps_cnav_utc_model;
-
-    double d_galileo_current_time;
-
-    int count_valid_position;
-
-    bool d_flag_dump_enabled;
-    bool d_flag_averaging;
-
-    std::string d_dump_filename;
-    std::ofstream d_dump_file;
 };
 
 #endif
diff --git a/src/algorithms/PVT/libs/kml_printer.cc b/src/algorithms/PVT/libs/kml_printer.cc
index dd457db45..1db4f6f61 100644
--- a/src/algorithms/PVT/libs/kml_printer.cc
+++ b/src/algorithms/PVT/libs/kml_printer.cc
@@ -30,51 +30,47 @@
  */
 
 #include "kml_printer.h"
-#include <ctime>
 #include <sstream>
+#include <boost/date_time/posix_time/posix_time.hpp>
 #include <glog/logging.h>
 
 using google::LogMessage;
 
 bool Kml_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);
 
-    time_t rawtime;
-    struct tm * timeinfo;
-    time ( &rawtime );
-    timeinfo = localtime ( &rawtime );
     if (time_tag_name)
         {
-
-
             std::stringstream strm0;
-            const int year = timeinfo->tm_year - 100;
+            const int year = timeinfo.tm_year - 100;
             strm0 << year;
-            const int month = timeinfo->tm_mon + 1;
+            const int month = timeinfo.tm_mon + 1;
             if(month < 10)
                 {
                     strm0 << "0";
                 }
             strm0 << month;
-            const int day = timeinfo->tm_mday;
+            const int day = timeinfo.tm_mday;
             if(day < 10)
                 {
                     strm0 << "0";
                 }
             strm0 << day << "_";
-            const int hour = timeinfo->tm_hour;
+            const int hour = timeinfo.tm_hour;
             if(hour < 10)
                 {
                     strm0 << "0";
                 }
             strm0 << hour;
-            const int min = timeinfo->tm_min;
+            const int min = timeinfo.tm_min;
             if(min < 10)
                 {
                     strm0 << "0";
                 }
             strm0 << min;
-            const int sec = timeinfo->tm_sec;
+            const int sec = timeinfo.tm_sec;
             if(sec < 10)
                 {
                     strm0 << "0";
@@ -88,6 +84,7 @@ bool Kml_Printer::set_headers(std::string filename,  bool time_tag_name)
             kml_filename = filename + ".kml";
         }
     kml_file.open(kml_filename.c_str());
+
     if (kml_file.is_open())
         {
             DLOG(INFO) << "KML printer writing on " << filename.c_str();
@@ -98,7 +95,7 @@ bool Kml_Printer::set_headers(std::string filename,  bool time_tag_name)
                     << "<kml xmlns=\"http://www.opengis.net/kml/2.2\">" << std::endl
                     << "    <Document>" << std::endl
                     << "    <name>GNSS Track</name>" << std::endl
-                    << "    <description>GNSS-SDR Receiver position log file created at " << asctime (timeinfo)
+                    << "    <description>GNSS-SDR Receiver position log file created at " << pt
                     << "    </description>" << std::endl
                     << "<Style id=\"yellowLineGreenPoly\">" << std::endl
                     << " <LineStyle>" << std::endl
@@ -140,15 +137,15 @@ bool Kml_Printer::print_position(const std::shared_ptr<Pvt_Solution>& position,
 
     if (print_average_values == false)
         {
-            latitude = position_->d_latitude_d;
-            longitude = position_->d_longitude_d;
-            height = position_->d_height_m;
+            latitude = position_->get_latitude();
+            longitude = position_->get_longitude();
+            height = position_->get_height();
         }
     else
         {
-            latitude = position_->d_avg_latitude_d;
-            longitude = position_->d_avg_longitude_d;
-            height = position_->d_avg_height_m;
+            latitude = position_->get_avg_latitude();
+            longitude = position_->get_avg_longitude();
+            height = position_->get_avg_height();
         }
 
     if (kml_file.is_open())
diff --git a/src/algorithms/PVT/libs/ls_pvt.cc b/src/algorithms/PVT/libs/ls_pvt.cc
index f8055241d..b8ec551e8 100644
--- a/src/algorithms/PVT/libs/ls_pvt.cc
+++ b/src/algorithms/PVT/libs/ls_pvt.cc
@@ -188,19 +188,16 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat & satpos, const arma::vec & obs
     //=== Initialization =======================================================
     int nmbOfIterations = 10; // TODO: include in config
     int nmbOfSatellites;
-    nmbOfSatellites = satpos.n_cols;    //Armadillo
+    nmbOfSatellites = satpos.n_cols;    // Armadillo
     arma::mat w = arma::zeros(nmbOfSatellites, nmbOfSatellites);
     w.diag() = w_vec; //diagonal weight matrix
 
-    arma::vec pos = {d_rx_pos(0), d_rx_pos(0), d_rx_pos(0), 0}; // time error in METERS (time x speed)
+    arma::vec rx_pos = this->get_rx_pos();
+    arma::vec pos = {rx_pos(0), rx_pos(1), rx_pos(2), 0}; // time error in METERS (time x speed)
     arma::mat A;
     arma::mat omc;
-    arma::mat az;
-    arma::mat el;
     A = arma::zeros(nmbOfSatellites, 4);
     omc = arma::zeros(nmbOfSatellites, 1);
-    az = arma::zeros(1, nmbOfSatellites);
-    el = arma::zeros(1, nmbOfSatellites);
     arma::mat X = satpos;
     arma::vec Rot_X;
     double rho2;
@@ -209,7 +206,6 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat & satpos, const arma::vec & obs
     double dlambda;
     double dphi;
     double h;
-    arma::mat mat_tmp;
     arma::vec x;
 
     //=== Iteratively find receiver position ===================================
@@ -236,11 +232,14 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat & satpos, const arma::vec & obs
                             Rot_X = Ls_Pvt::rotateSatellite(traveltime, X.col(i)); //armadillo
 
                             //--- Find DOA and range of satellites
-                            Ls_Pvt::topocent(&d_visible_satellites_Az[i],
-                                    &d_visible_satellites_El[i],
-                                    &d_visible_satellites_Distance[i],
-                                    pos.subvec(0,2),
-                                    Rot_X - pos.subvec(0, 2));
+                            double * azim = 0;
+                            double * elev = 0;
+                            double * dist = 0;
+                            Ls_Pvt::topocent(azim, elev, dist, pos.subvec(0,2), Rot_X - pos.subvec(0, 2));
+                            this->set_visible_satellites_Az(i, *azim);
+                            this->set_visible_satellites_El(i, *elev);
+                            this->set_visible_satellites_Distance(i, *dist);
+
                             if(traveltime < 0.1 && nmbOfSatellites > 3)
                                 {
                                     //--- Find receiver's height
@@ -254,7 +253,7 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat & satpos, const arma::vec & obs
                                     else
                                         {
                                             //--- Find delay due to troposphere (in meters)
-                                            Ls_Pvt::tropo(&trop, sin(d_visible_satellites_El[i] * GPS_PI / 180.0), h / 1000.0, 1013.0, 293.0, 50.0, 0.0, 0.0, 0.0);
+                                            Ls_Pvt::tropo(&trop, sin(this->get_visible_satellites_El(i) * GPS_PI / 180.0), h / 1000.0, 1013.0, 293.0, 50.0, 0.0, 0.0, 0.0);
                                             if(trop > 5.0 ) trop = 0.0; //check for erratic values
                                         }
                                 }
@@ -282,7 +281,7 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat & satpos, const arma::vec & obs
         }
 
     //-- compute the Dilution Of Precision values
-    d_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 e502dab75..97ab793a7 100644
--- a/src/algorithms/PVT/libs/nmea_printer.cc
+++ b/src/algorithms/PVT/libs/nmea_printer.cc
@@ -167,7 +167,7 @@ bool Nmea_Printer::Print_Nmea_Line(const std::shared_ptr<Pvt_Solution>& pvt_data
             //GPGSV
             nmea_file_descriptor << GPGSV;
     }
-    catch(std::exception ex)
+    catch(const std::exception & ex)
     {
             DLOG(INFO) << "NMEA printer can not write on output file" << nmea_filename.c_str();;
     }
@@ -236,9 +236,10 @@ std::string Nmea_Printer::latitude_to_hm(double lat)
     out_string.fill('0');
     out_string.width(2);
     out_string << deg;
-    out_string.width(6);
-    out_string.precision(4);
-    out_string << mins;
+    out_string.width(2);
+    out_string << static_cast<int>(mins) << ".";
+    out_string.width(4);
+    out_string << static_cast<int>((mins - static_cast<double>(static_cast<int>(mins))) * 1e4);
 
     if (north == true)
         {
@@ -273,9 +274,10 @@ std::string Nmea_Printer::longitude_to_hm(double longitude)
     out_string.width(3);
     out_string.fill('0');
     out_string << deg;
-    out_string.width(6);
-    out_string.precision(4);
-    out_string << mins;
+    out_string.width(2);
+    out_string << static_cast<int>(mins) << ".";
+    out_string.width(4);
+    out_string << static_cast<int>((mins - static_cast<double>(static_cast<int>(mins))) * 1e4);
 
     if (east == true)
         {
@@ -338,7 +340,7 @@ std::string Nmea_Printer::get_UTC_NMEA_time(boost::posix_time::ptime d_position_
 std::string Nmea_Printer::get_GPRMC()
 {
     // Sample -> $GPRMC,161229.487,A,3723.2475,N,12158.3416,W,0.13,309.62,120598,*10
-    bool valid_fix = d_PVT_data->b_valid_position;
+    bool valid_fix = d_PVT_data->is_valid_position();
 
     // ToDo: Compute speed and course over ground
     double speed_over_ground_knots = 0;
@@ -354,7 +356,7 @@ std::string Nmea_Printer::get_GPRMC()
     sentence_str << sentence_header;
 
     //UTC Time: hhmmss.sss
-    sentence_str << get_UTC_NMEA_time(d_PVT_data->d_position_UTC_time);
+    sentence_str << get_UTC_NMEA_time(d_PVT_data->get_position_UTC_time());
 
     //Status: A: data valid, V: data NOT valid
 
@@ -370,16 +372,16 @@ std::string Nmea_Printer::get_GPRMC()
     if (print_avg_pos == true)
         {
             // Latitude ddmm.mmmm,(N or S)
-            sentence_str << "," << latitude_to_hm(d_PVT_data->d_avg_latitude_d);
+            sentence_str << "," << latitude_to_hm(d_PVT_data->get_avg_latitude());
             // longitude dddmm.mmmm,(E or W)
-            sentence_str << "," << longitude_to_hm(d_PVT_data->d_avg_longitude_d);
+            sentence_str << "," << longitude_to_hm(d_PVT_data->get_avg_longitude());
         }
     else
         {
             // Latitude ddmm.mmmm,(N or S)
-            sentence_str << "," << latitude_to_hm(d_PVT_data->d_latitude_d);
+            sentence_str << "," << latitude_to_hm(d_PVT_data->get_latitude());
             // longitude dddmm.mmmm,(E or W)
-            sentence_str << "," << longitude_to_hm(d_PVT_data->d_longitude_d);
+            sentence_str << "," << longitude_to_hm(d_PVT_data->get_longitude());
         }
 
     //Speed over ground (knots)
@@ -395,7 +397,7 @@ std::string Nmea_Printer::get_GPRMC()
     sentence_str << course_over_ground_deg;
 
     // Date ddmmyy
-    boost::gregorian::date sentence_date = d_PVT_data->d_position_UTC_time.date();
+    boost::gregorian::date sentence_date = d_PVT_data->get_position_UTC_time().date();
     unsigned int year = sentence_date.year();
     unsigned int day = sentence_date.day();
     unsigned int month = sentence_date.month();
@@ -441,11 +443,11 @@ std::string Nmea_Printer::get_GPGSA()
 {
     //$GPGSA,A,3,07,02,26,27,09,04,15, , , , , ,1.8,1.0,1.5*33
     // GSA-GNSS DOP and Active Satellites
-    bool valid_fix = d_PVT_data->b_valid_position;
-    int n_sats_used = d_PVT_data->d_valid_observations;
-    double pdop = d_PVT_data->d_PDOP;
-    double hdop = d_PVT_data->d_HDOP;
-    double vdop = d_PVT_data->d_VDOP;
+    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();
 
     std::stringstream sentence_str;
     std::string sentence_header;
@@ -479,7 +481,7 @@ std::string Nmea_Printer::get_GPGSA()
                 {
                     sentence_str.width(2);
                     sentence_str.fill('0');
-                    sentence_str << d_PVT_data->d_visible_satellites_IDs[i];
+                    sentence_str << d_PVT_data->get_visible_satellites_ID(i);
                 }
         }
 
@@ -527,7 +529,7 @@ std::string Nmea_Printer::get_GPGSV()
 {
     // GSV-GNSS Satellites in View
     // Notice that NMEA 2.1 only supports 12 channels
-    int n_sats_used = d_PVT_data->d_valid_observations;
+    int n_sats_used = d_PVT_data->get_num_valid_observations();
     std::stringstream sentence_str;
     std::stringstream frame_str;
     std::string sentence_header;
@@ -567,22 +569,22 @@ std::string Nmea_Printer::get_GPGSV()
                     frame_str << ",";
                     frame_str.width(2);
                     frame_str.fill('0');
-                    frame_str << std::dec << d_PVT_data->d_visible_satellites_IDs[current_satellite];
+                    frame_str << std::dec << d_PVT_data->get_visible_satellites_ID(current_satellite);
 
                     frame_str << ",";
                     frame_str.width(2);
                     frame_str.fill('0');
-                    frame_str << std::dec << static_cast<int>(d_PVT_data->d_visible_satellites_El[current_satellite]);
+                    frame_str << std::dec << static_cast<int>(d_PVT_data->get_visible_satellites_El(current_satellite));
 
                     frame_str << ",";
                     frame_str.width(3);
                     frame_str.fill('0');
-                    frame_str << std::dec << static_cast<int>(d_PVT_data->d_visible_satellites_Az[current_satellite]);
+                    frame_str << std::dec << static_cast<int>(d_PVT_data->get_visible_satellites_Az(current_satellite));
 
                     frame_str << ",";
                     frame_str.width(2);
                     frame_str.fill('0');
-                    frame_str << std::dec << static_cast<int>(d_PVT_data->d_visible_satellites_CN0_dB[current_satellite]);
+                    frame_str << std::dec << static_cast<int>(d_PVT_data->get_visible_satellites_CN0_dB(current_satellite));
 
                     current_satellite++;
 
@@ -617,18 +619,18 @@ std::string Nmea_Printer::get_GPGSV()
 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->b_valid_position;
-    int n_channels = d_PVT_data->d_valid_observations;//d_nchannels
-    double hdop = d_PVT_data->d_HDOP;
+    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 MSL_altitude;
 
-    if (d_PVT_data->d_flag_averaging == true)
+    if (d_PVT_data->is_averaging() == true)
         {
-            MSL_altitude = d_PVT_data->d_avg_height_m;
+            MSL_altitude = d_PVT_data->get_avg_height();
         }
     else
         {
-            MSL_altitude = d_PVT_data->d_height_m;
+            MSL_altitude = d_PVT_data->get_height();
         }
 
     std::stringstream sentence_str;
@@ -639,21 +641,21 @@ std::string Nmea_Printer::get_GPGGA()
     sentence_str << sentence_header;
 
     //UTC Time: hhmmss.sss
-    sentence_str << get_UTC_NMEA_time(d_PVT_data->d_position_UTC_time);
+    sentence_str << get_UTC_NMEA_time(d_PVT_data->get_position_UTC_time());
 
-    if (d_PVT_data->d_flag_averaging == true)
+    if (d_PVT_data->is_averaging() == true)
         {
             // Latitude ddmm.mmmm,(N or S)
-            sentence_str << "," << latitude_to_hm(d_PVT_data->d_avg_latitude_d);
+            sentence_str << "," << latitude_to_hm(d_PVT_data->get_avg_latitude());
             // longitude dddmm.mmmm,(E or W)
-            sentence_str << "," << longitude_to_hm(d_PVT_data->d_avg_longitude_d);
+            sentence_str << "," << longitude_to_hm(d_PVT_data->get_avg_longitude());
         }
     else
         {
             // Latitude ddmm.mmmm,(N or S)
-            sentence_str << "," << latitude_to_hm(d_PVT_data->d_latitude_d);
+            sentence_str << "," << latitude_to_hm(d_PVT_data->get_latitude());
             // longitude dddmm.mmmm,(E or W)
-            sentence_str << "," << longitude_to_hm(d_PVT_data->d_longitude_d);
+            sentence_str << "," << longitude_to_hm(d_PVT_data->get_longitude());
         }
 
     // Position fix indicator
diff --git a/src/algorithms/PVT/libs/pvt_solution.cc b/src/algorithms/PVT/libs/pvt_solution.cc
index 9901ab878..8b9842411 100644
--- a/src/algorithms/PVT/libs/pvt_solution.cc
+++ b/src/algorithms/PVT/libs/pvt_solution.cc
@@ -364,6 +364,7 @@ int Pvt_Solution::tropo(double *ddr_m, double sinel, double hsta_km, double p_mb
     return 0;
 }
 
+
 int Pvt_Solution::topocent(double *Az, double *El, double *D, const arma::vec & x, const arma::vec & dx)
 {
     /*  Transformation of vector dx into topocentric coordinate
@@ -474,7 +475,7 @@ int Pvt_Solution::compute_DOP()
             d_VDOP = sqrt(DOP_ENU(2, 2));                                // VDOP
             d_TDOP = sqrt(d_Q(3, 3));                                    // TDOP
     }
-    catch(std::exception& ex)
+    catch(const std::exception & ex)
     {
             d_GDOP = -1; // Geometric DOP
             d_PDOP = -1; // PDOP
@@ -483,26 +484,28 @@ int Pvt_Solution::compute_DOP()
             d_TDOP = -1; // TDOP
     }
     return 0;
-
 }
 
 
-
-
-int Pvt_Solution::set_averaging_depth(int depth)
+void Pvt_Solution::set_averaging_depth(int depth)
 {
     d_averaging_depth = depth;
-    return 0;
 }
 
 
-int Pvt_Solution::pos_averaging(bool flag_averaring)
+void Pvt_Solution::set_averaging_flag(bool flag)
+{
+    d_flag_averaging = flag;
+}
+
+
+void Pvt_Solution::perform_pos_averaging()
 {
     // MOVING AVERAGE PVT
-    bool avg = flag_averaring;
+    bool avg = d_flag_averaging;
     if (avg == true)
         {
-            if (d_hist_longitude_d.size() == (unsigned int)d_averaging_depth)
+            if (d_hist_longitude_d.size() == static_cast<unsigned int>(d_averaging_depth))
                 {
                     // Pop oldest value
                     d_hist_longitude_d.pop_back();
@@ -545,6 +548,313 @@ int Pvt_Solution::pos_averaging(bool flag_averaring)
         {
             b_valid_position = true;
         }
-    return 0;
 }
 
+
+double Pvt_Solution::get_time_offset_s() const
+{
+    return d_rx_dt_s;
+}
+
+
+void Pvt_Solution::set_time_offset_s(double offset)
+{
+    d_rx_dt_s = offset;
+}
+
+
+double Pvt_Solution::get_latitude() const
+{
+    return d_latitude_d;
+}
+
+
+double Pvt_Solution::get_longitude() const
+{
+    return d_longitude_d;
+}
+
+
+double Pvt_Solution::get_height() const
+{
+    return d_height_m;
+}
+
+
+double Pvt_Solution::get_avg_latitude() const
+{
+    return d_avg_latitude_d;
+}
+
+
+double Pvt_Solution::get_avg_longitude() const
+{
+    return d_avg_longitude_d;
+}
+
+
+double Pvt_Solution::get_avg_height() const
+{
+    return d_avg_height_m;
+}
+
+
+bool Pvt_Solution::is_averaging() const
+{
+    return d_flag_averaging;
+}
+
+bool Pvt_Solution::is_valid_position() const
+{
+    return b_valid_position;
+}
+
+
+void Pvt_Solution::set_valid_position(bool is_valid)
+{
+    b_valid_position = is_valid;
+}
+
+
+void Pvt_Solution::set_rx_pos(const arma::vec & pos)
+{
+    d_rx_pos = pos;
+    d_latitude_d = d_rx_pos(0);
+    d_longitude_d = d_rx_pos(1);
+    d_height_m = d_rx_pos(2);
+}
+
+
+arma::vec Pvt_Solution::get_rx_pos() const
+{
+    return d_rx_pos;
+}
+
+
+boost::posix_time::ptime Pvt_Solution::get_position_UTC_time() const
+{
+    return d_position_UTC_time;
+}
+
+
+void Pvt_Solution::set_position_UTC_time(const boost::posix_time::ptime & pt)
+{
+    d_position_UTC_time = pt;
+}
+
+
+int Pvt_Solution::get_num_valid_observations() const
+{
+    return d_valid_observations;
+}
+
+
+void Pvt_Solution::set_num_valid_observations(int num)
+{
+    d_valid_observations = num;
+}
+
+
+bool Pvt_Solution::set_visible_satellites_ID(size_t index, unsigned int prn)
+{
+    if(index >= PVT_MAX_CHANNELS)
+        {
+            LOG(WARNING) << "Setting sat ID to channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")";
+            return false;
+        }
+    else
+        {
+            if(prn >= PVT_MAX_PRN)
+                {
+                    LOG(WARNING) << "Setting to channel " << index << " a PRN of " << prn << " (the maximum is " << PVT_MAX_PRN << ")";
+                    return false;
+                }
+            else
+                {
+                    d_visible_satellites_IDs[index] = prn;
+                    return true;
+                }
+        }
+}
+
+
+unsigned int Pvt_Solution::get_visible_satellites_ID(size_t index) const
+{
+    if(index >= PVT_MAX_CHANNELS)
+        {
+            LOG(WARNING) << "Getting sat ID for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")";
+            return 0;
+        }
+    else
+        {
+            return d_visible_satellites_IDs[index];
+        }
+}
+
+
+bool Pvt_Solution::set_visible_satellites_El(size_t index, double el)
+{
+    if(index >= PVT_MAX_CHANNELS)
+        {
+            LOG(WARNING) << "Setting sat elevation for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")";
+            return false;
+        }
+    else
+        {
+            if(el > 90.0)
+                {
+                    LOG(WARNING) << "Setting a sat elevation > 90 [degrees]. Saturating to 90";
+                    d_visible_satellites_El[index] = 90.0;
+                }
+            else
+                {
+                    if(el < -90.0)
+                        {
+                            LOG(WARNING) << "Setting a sat elevation < -90 [degrees]. Saturating to -90";
+                            d_visible_satellites_El[index] = -90.0;
+                        }
+                    else
+                        {
+                            d_visible_satellites_El[index] = el;
+                        }
+                }
+            return true;
+        }
+}
+
+
+double Pvt_Solution::get_visible_satellites_El(size_t index) const
+{
+    if(index >= PVT_MAX_CHANNELS)
+        {
+            LOG(WARNING) << "Getting sat elevation for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")";
+            return 0.0;
+        }
+    else
+        {
+            return d_visible_satellites_El[index];
+        }
+}
+
+
+bool Pvt_Solution::set_visible_satellites_Az(size_t index, double az)
+{
+    if(index >= PVT_MAX_CHANNELS)
+        {
+            LOG(WARNING) << "Getting sat azimuth for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")";
+            return false;
+        }
+    else
+        {
+            d_visible_satellites_Az[index] = az;
+            return true;
+        }
+}
+
+
+double Pvt_Solution::get_visible_satellites_Az(size_t index) const
+{
+    if(index >= PVT_MAX_CHANNELS)
+        {
+            LOG(WARNING) << "Getting sat azimuth for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")";
+            return 0.0;
+        }
+    else
+        {
+            return d_visible_satellites_Az[index];
+        }
+}
+
+
+bool Pvt_Solution::set_visible_satellites_Distance(size_t index, double dist)
+{
+    if(index >= PVT_MAX_CHANNELS)
+        {
+            LOG(WARNING) << "Setting sat distance for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")";
+            return false;
+        }
+    else
+        {
+            d_visible_satellites_Distance[index] = dist;
+            return true;
+        }
+}
+
+
+double Pvt_Solution::get_visible_satellites_Distance(size_t index) const
+{
+    if(index >= PVT_MAX_CHANNELS)
+        {
+            LOG(WARNING) << "Getting sat distance for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")";
+            return 0.0;
+        }
+    else
+        {
+            return d_visible_satellites_Distance[index];
+        }
+}
+
+
+bool Pvt_Solution::set_visible_satellites_CN0_dB(size_t index, double cn0)
+{
+    if(index >= PVT_MAX_CHANNELS)
+        {
+            LOG(WARNING) << "Setting sat Cn0 for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")";
+            return false;
+        }
+    else
+        {
+            d_visible_satellites_CN0_dB[index] = cn0;
+            return true;
+        }
+}
+
+
+double Pvt_Solution::get_visible_satellites_CN0_dB(size_t index) const
+{
+    if(index >= PVT_MAX_CHANNELS)
+        {
+            LOG(WARNING) << "Getting received CN0 for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")";
+            return 0.0;
+        }
+    else
+        {
+            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 3b0681391..0a7cc451d 100644
--- a/src/algorithms/PVT/libs/pvt_solution.h
+++ b/src/algorithms/PVT/libs/pvt_solution.h
@@ -37,7 +37,8 @@
 #include <armadillo>
 #include <boost/date_time/posix_time/posix_time.hpp>
 
-#define PVT_MAX_CHANNELS 24
+const unsigned int PVT_MAX_CHANNELS = 90;
+const unsigned int PVT_MAX_PRN = 127;  // 126 is SBAS
 
 /*!
  * \brief Base class for a PVT solution
@@ -45,50 +46,99 @@
  */
 class Pvt_Solution
 {
-public:
-    Pvt_Solution();
+private:
+    double d_rx_dt_s;         // RX time offset [s]
 
-    double d_latitude_d; //!< RX position Latitude WGS84 [deg]
-    double d_longitude_d; //!< RX position Longitude WGS84 [deg]
-    double d_height_m; //!< RX position height WGS84 [m]
+    double d_latitude_d;      // RX position Latitude WGS84 [deg]
+    double d_longitude_d;     // RX position Longitude WGS84 [deg]
+    double d_height_m;        // RX position height WGS84 [m]
 
-    arma::vec d_rx_pos;
-    double d_rx_dt_s; //!< RX time offset [s]
-
-    boost::posix_time::ptime d_position_UTC_time;
+    double d_avg_latitude_d;  // Averaged latitude in degrees
+    double d_avg_longitude_d; // Averaged longitude in degrees
+    double d_avg_height_m;    // Averaged height [m]
 
     bool b_valid_position;
 
-    int d_valid_observations;                               //!< Number of valid pseudorange observations (valid satellites)
-    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
-    double d_visible_satellites_Distance[PVT_MAX_CHANNELS] = {}; //!< Array with the LOS Distance of the valid satellites
-    double d_visible_satellites_CN0_dB[PVT_MAX_CHANNELS] = {};   //!< Array with the IDs of the valid satellites
-
-    //averaging
-    int d_averaging_depth;    //!< Length of averaging window
     std::deque<double> d_hist_latitude_d;
     std::deque<double> d_hist_longitude_d;
     std::deque<double> d_hist_height_m;
 
-    double d_avg_latitude_d;  //!< Averaged latitude in degrees
-    double d_avg_longitude_d; //!< Averaged longitude in degrees
-    double d_avg_height_m;    //!< Averaged height [m]
-    int pos_averaging(bool flag_averaging);
+    bool d_flag_averaging;
+    int d_averaging_depth;    // Length of averaging window
+
+    arma::vec d_rx_pos;
+    boost::posix_time::ptime d_position_UTC_time;
+    int d_valid_observations;
 
-    // DOP estimations
     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
+    double d_visible_satellites_Distance[PVT_MAX_CHANNELS] = {}; // Array with the LOS Distance of the valid satellites
+    double d_visible_satellites_CN0_dB[PVT_MAX_CHANNELS] = {};   // Array with the IDs of the valid satellites
+
+public:
+    Pvt_Solution();
+
+    double get_time_offset_s() const;       //!< Get RX time offset [s]
+    void set_time_offset_s(double offset);  //!< Set RX time offset [s]
+
+    double get_latitude() const;            //!< Get RX position Latitude WGS84 [deg]
+    double get_longitude() const;           //!< Get RX position Longitude WGS84 [deg]
+    double get_height() const;              //!< Get RX position height WGS84 [m]
+
+    double get_avg_latitude() const;        //!< Get RX position averaged Latitude WGS84 [deg]
+    double get_avg_longitude() const;       //!< Get RX position averaged Longitude WGS84 [deg]
+    double get_avg_height() const;          //!< Get RX position averaged height WGS84 [m]
+
+    void set_rx_pos(const arma::vec & pos); //!< Set position: Latitude [deg], longitude [deg], height [m]
+    arma::vec get_rx_pos() const;
+
+    bool is_valid_position() const;
+    void set_valid_position(bool is_valid);
+
+    boost::posix_time::ptime get_position_UTC_time() const;
+    void set_position_UTC_time(const boost::posix_time::ptime & pt);
+
+    int get_num_valid_observations() const;    //!< Get the number of valid pseudorange observations (valid satellites)
+    void set_num_valid_observations(int num);  //!< Set the number of valid pseudorange observations (valid satellites)
+
+    bool set_visible_satellites_ID(size_t index, unsigned int prn);  //!< Set the ID of the visible satellite index channel
+    unsigned int get_visible_satellites_ID(size_t index) const;      //!< Get the ID of the visible satellite index channel
+
+    bool set_visible_satellites_El(size_t index, double el);         //!< Set the LOS Elevation, in degrees, of the visible satellite index channel
+    double get_visible_satellites_El(size_t index) const;            //!< Get the LOS Elevation, in degrees, of the visible satellite index channel
+
+    bool set_visible_satellites_Az(size_t index, double az);         //!< Set the LOS Azimuth, in degrees, of the visible satellite index channel
+    double get_visible_satellites_Az(size_t index) const;            //!< Get the LOS Azimuth, in degrees, of the visible satellite index channel
+
+    bool set_visible_satellites_Distance(size_t index, double dist); //!< Set the LOS Distance of the visible satellite index channel
+    double get_visible_satellites_Distance(size_t index) const;      //!< Get the LOS Distance of the visible satellite index channel
+
+    bool set_visible_satellites_CN0_dB(size_t index, double cn0);    //!< Set the CN0 in dB of the visible satellite index channel
+    double get_visible_satellites_CN0_dB(size_t index) const;        //!< Get the CN0 in dB of the visible satellite index channel
+
+    //averaging
+    void perform_pos_averaging();
+    void set_averaging_depth(int depth); //!< Set length of averaging window
+    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
 
-    bool d_flag_averaging;
-
-    int set_averaging_depth(int depth);
+    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/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc
index 0b6fb5030..4631270d2 100644
--- a/src/algorithms/PVT/libs/rinex_printer.cc
+++ b/src/algorithms/PVT/libs/rinex_printer.cc
@@ -1133,7 +1133,7 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& gal
     out.close();
     out.open(navGalfilename, std::ios::out | std::ios::trunc);
     out.seekp(0);
-    for (int i = 0; i < (int) data.size() - 1; i++)
+    for (int i = 0; i < static_cast<int>(data.size()) - 1; i++)
         {
             out << data[i] << std::endl;
         }
@@ -1284,7 +1284,7 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Utc_Model& ut
     out.close();
     out.open(navfilename, std::ios::out | std::ios::trunc);
     out.seekp(0);
-    for (int i = 0; i < (int) data.size() - 1; i++)
+    for (int i = 0; i < static_cast<int>(data.size()) - 1; i++)
         {
             out << data[i] << std::endl;
         }
@@ -1379,7 +1379,7 @@ void Rinex_Printer::update_nav_header(std::fstream & out, const Gps_CNAV_Utc_Mod
     out.close();
     out.open(navfilename, std::ios::out | std::ios::trunc);
     out.seekp(0);
-    for (int i = 0; i < (int) data.size() - 1; i++)
+    for (int i = 0; i < static_cast<int>(data.size()) - 1; i++)
         {
             out << data[i] << std::endl;
         }
@@ -1510,7 +1510,7 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_ion
     out.close();
     out.open(navMixfilename, std::ios::out | std::ios::trunc);
     out.seekp(0);
-    for (int i = 0; i < (int) data.size() - 1; i++)
+    for (int i = 0; i < static_cast<int>(data.size()) - 1; i++)
         {
             out << data[i] << std::endl;
         }
@@ -1526,8 +1526,8 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int,Gps_Ephe
     std::string line;
     std::map<int,Gps_Ephemeris>::const_iterator gps_ephemeris_iter;
 
-    for(gps_ephemeris_iter = eph_map.begin();
-            gps_ephemeris_iter != eph_map.end();
+    for(gps_ephemeris_iter = eph_map.cbegin();
+            gps_ephemeris_iter != eph_map.cend();
             gps_ephemeris_iter++)
     {
             // -------- SV / EPOCH / SV CLK
@@ -1857,8 +1857,8 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int,Gps_CNAV
     std::string line;
     std::map<int,Gps_CNAV_Ephemeris>::const_iterator gps_ephemeris_iter;
 
-    for(gps_ephemeris_iter = eph_map.begin();
-            gps_ephemeris_iter != eph_map.end();
+    for(gps_ephemeris_iter = eph_map.cbegin();
+            gps_ephemeris_iter != eph_map.cend();
             gps_ephemeris_iter++)
         {
             // -------- SV / EPOCH / SV CLK
@@ -2020,8 +2020,8 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int, Galileo
     std::string line;
     std::map<int,Galileo_Ephemeris>::const_iterator galileo_ephemeris_iter;
     line.clear();
-    for(galileo_ephemeris_iter = eph_map.begin();
-            galileo_ephemeris_iter != eph_map.end();
+    for(galileo_ephemeris_iter = eph_map.cbegin();
+            galileo_ephemeris_iter != eph_map.cend();
             galileo_ephemeris_iter++)
         {
             // -------- SV / EPOCH / SV CLK
@@ -3522,7 +3522,7 @@ void Rinex_Printer::update_obs_header(std::fstream& out, const Gps_Utc_Model& ut
     out.close();
     out.open(obsfilename, std::ios::out | std::ios::trunc);
     out.seekp(0);
-    for (int i = 0; i < (int) data.size() - 1; i++)
+    for (int i = 0; i < static_cast<int>( data.size()) - 1; i++)
         {
             out << data[i] << std::endl;
         }
@@ -3581,7 +3581,7 @@ void Rinex_Printer::update_obs_header(std::fstream& out, const Gps_CNAV_Utc_Mode
     out.close();
     out.open(obsfilename, std::ios::out | std::ios::trunc);
     out.seekp(0);
-    for (int i = 0; i < (int) data.size() - 1; i++)
+    for (int i = 0; i < static_cast<int>(data.size()) - 1; i++)
         {
             out << data[i] << std::endl;
         }
@@ -3641,7 +3641,7 @@ void Rinex_Printer::update_obs_header(std::fstream& out, const Galileo_Utc_Model
     out.close();
     out.open(obsfilename, std::ios::out | std::ios::trunc);
     out.seekp(0);
-    for (int i = 0; i < (int) data.size() - 1; i++)
+    for (int i = 0; i < static_cast<int>(data.size()) - 1; i++)
         {
             out << data[i] << std::endl;
         }
@@ -3710,15 +3710,15 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c
             //Number of satellites observed in current epoch
             int numSatellitesObserved = 0;
             std::map<int, Gnss_Synchro>::const_iterator observables_iter;
-            for(observables_iter = observables.begin();
-                    observables_iter != observables.end();
+            for(observables_iter = observables.cbegin();
+                    observables_iter != observables.cend();
                     observables_iter++)
                 {
                     numSatellitesObserved++;
                 }
             line += Rinex_Printer::rightJustify(boost::lexical_cast<std::string>(numSatellitesObserved), 3);
-            for(observables_iter = observables.begin();
-                    observables_iter != observables.end();
+            for(observables_iter = observables.cbegin();
+                    observables_iter != observables.cend();
                     observables_iter++)
                 {
                     line += satelliteSystem["GPS"];
@@ -3732,8 +3732,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c
             out << line << std::endl;
 
 
-            for(observables_iter = observables.begin();
-                    observables_iter != observables.end();
+            for(observables_iter = observables.cbegin();
+                    observables_iter != observables.cend();
                     observables_iter++)
                 {
                     std::string lineObs;
@@ -3816,8 +3816,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c
             //Number of satellites observed in current epoch
             int numSatellitesObserved = 0;
             std::map<int, Gnss_Synchro>::const_iterator observables_iter;
-            for(observables_iter = observables.begin();
-                    observables_iter != observables.end();
+            for(observables_iter = observables.cbegin();
+                    observables_iter != observables.cend();
                     observables_iter++)
                 {
                     numSatellitesObserved++;
@@ -3832,8 +3832,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c
             Rinex_Printer::lengthCheck(line);
             out << line << std::endl;
 
-            for(observables_iter = observables.begin();
-                    observables_iter != observables.end();
+            for(observables_iter = observables.cbegin();
+                    observables_iter != observables.cend();
                     observables_iter++)
                 {
                     std::string lineObs;
@@ -3938,8 +3938,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_CNAV_Ephemeris &
     //Number of satellites observed in current epoch
     int numSatellitesObserved = 0;
     std::map<int, Gnss_Synchro>::const_iterator observables_iter;
-    for(observables_iter = observables.begin();
-            observables_iter != observables.end();
+    for(observables_iter = observables.cbegin();
+            observables_iter != observables.cend();
             observables_iter++)
         {
             numSatellitesObserved++;
@@ -3953,8 +3953,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_CNAV_Ephemeris &
     Rinex_Printer::lengthCheck(line);
     out << line << std::endl;
 
-    for(observables_iter = observables.begin();
-            observables_iter != observables.end();
+    for(observables_iter = observables.cbegin();
+            observables_iter != observables.cend();
             observables_iter++)
         {
             std::string lineObs;
@@ -4063,12 +4063,11 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_Ephemeris & eph,
     std::map<int, Gnss_Synchro> observablesL1;
     std::map<int, Gnss_Synchro> observablesL2;
     std::map<int, Gnss_Synchro>::const_iterator observables_iter;
-    std::map<int, Gnss_Synchro>::const_iterator observables_iter2;
 
     std::multimap<unsigned int, Gnss_Synchro> total_mmap;
     std::multimap<unsigned int, Gnss_Synchro>::iterator mmap_iter;
-    for(observables_iter = observables.begin();
-            observables_iter != observables.end();
+    for(observables_iter = observables.cbegin();
+            observables_iter != observables.cend();
             observables_iter++)
         {
             std::string system_(&observables_iter->second.System, 1);
@@ -4104,7 +4103,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_Ephemeris & eph,
                     std::string sys = "G";
                     gs.System = *sys.c_str();
                     std::string sig = "2S";
-                    std::memcpy((void*)gs.Signal, sig.c_str(), 3);
+                    std::memcpy(static_cast<void*>(gs.Signal), sig.c_str(), 3);
                     gs.PRN = mmap_iter->second.PRN;
                     total_mmap.insert(std::pair<unsigned int, Gnss_Synchro>(mmap_iter->second.PRN, gs));
                 }
@@ -4112,8 +4111,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_Ephemeris & eph,
 
     std::set<unsigned int> available_prns;
     std::set<unsigned int>::iterator it;
-    for(observables_iter = observablesL1.begin();
-            observables_iter != observablesL1.end();
+    for(observables_iter = observablesL1.cbegin();
+            observables_iter != observablesL1.cend();
             observables_iter++)
         {
             unsigned int prn_ = observables_iter->second.PRN;
@@ -4124,8 +4123,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_Ephemeris & eph,
                 }
         }
 
-    for(observables_iter = observablesL2.begin();
-            observables_iter != observablesL2.end();
+    for(observables_iter = observablesL2.cbegin();
+            observables_iter != observablesL2.cend();
             observables_iter++)
         {
             unsigned int prn_ = observables_iter->second.PRN;
@@ -4258,8 +4257,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep
     std::map<int, Gnss_Synchro> observablesE5B;
     std::map<int, Gnss_Synchro>::const_iterator observables_iter;
 
-    for(observables_iter = observables.begin();
-            observables_iter != observables.end();
+    for(observables_iter = observables.cbegin();
+            observables_iter != observables.cend();
             observables_iter++)
         {
             std::string system_(&observables_iter->second.System, 1);
@@ -4301,8 +4300,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep
     }
     if(found_E5a != std::string::npos)
     {
-        for(observables_iter = observablesE5A.begin();
-                observables_iter != observablesE5A.end();
+        for(observables_iter = observablesE5A.cbegin();
+                observables_iter != observablesE5A.cend();
                 observables_iter++)
             {
                 unsigned int prn_ = observables_iter->second.PRN;
@@ -4316,7 +4315,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep
                             std::string sys = "E";
                             gs.System = *sys.c_str();
                             std::string sig = "1B";
-                            std::memcpy((void*)gs.Signal, sig.c_str(), 3);
+                            std::memcpy(static_cast<void*>(gs.Signal), sig.c_str(), 3);
                             gs.PRN = prn_;
                             total_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, gs));
                         }
@@ -4326,8 +4325,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep
     }
     if(found_E5b != std::string::npos)
     {
-        for(observables_iter = observablesE5B.begin();
-                observables_iter != observablesE5B.end();
+        for(observables_iter = observablesE5B.cbegin();
+                observables_iter != observablesE5B.cend();
                 observables_iter++)
             {
                 unsigned int prn_ = observables_iter->second.PRN;
@@ -4336,25 +4335,25 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep
                     {
                         available_prns.insert(prn_);
                         if(found_1B != std::string::npos)
-                        {
-                            Gnss_Synchro gs = Gnss_Synchro();
-                            std::string sys = "E";
-                            gs.System = *sys.c_str();
-                            std::string sig = "1B";
-                            std::memcpy((void*)gs.Signal, sig.c_str(), 3);
-                            gs.PRN = prn_;
-                            total_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, gs));
-                        }
+                            {
+                                Gnss_Synchro gs = Gnss_Synchro();
+                                std::string sys = "E";
+                                gs.System = *sys.c_str();
+                                std::string sig = "1B";
+                                std::memcpy(static_cast<void*>(gs.Signal), sig.c_str(), 3);
+                                gs.PRN = prn_;
+                                total_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, gs));
+                            }
                         if(found_E5a != std::string::npos)
-                        {
-                            Gnss_Synchro gs = Gnss_Synchro();
-                            std::string sys = "E";
-                            gs.System = *sys.c_str();
-                            std::string sig = "5X";
-                            std::memcpy((void*)gs.Signal, sig.c_str(), 3);
-                            gs.PRN = prn_;
-                            total_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, gs));
-                        }
+                            {
+                                Gnss_Synchro gs = Gnss_Synchro();
+                                std::string sys = "E";
+                                gs.System = *sys.c_str();
+                                std::string sig = "5X";
+                                std::memcpy(static_cast<void*>(gs.Signal), sig.c_str(), 3);
+                                gs.PRN = prn_;
+                                total_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, gs));
+                            }
                     }
                 else
                     {
@@ -4362,15 +4361,15 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep
                         if(found_E5a != std::string::npos)
                             {
                                 if( (total_map.count(prn_)) == 1)
-                                {
-                                    Gnss_Synchro gs = Gnss_Synchro();
-                                    std::string sys = "E";
-                                    gs.System = *sys.c_str();
-                                    std::string sig = "5X";
-                                    std::memcpy((void*)gs.Signal, sig.c_str(), 3);
-                                    gs.PRN = prn_;
-                                    total_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, gs));
-                                }
+                                    {
+                                        Gnss_Synchro gs = Gnss_Synchro();
+                                        std::string sys = "E";
+                                        gs.System = *sys.c_str();
+                                        std::string sig = "5X";
+                                        std::memcpy(static_cast<void*>(gs.Signal), sig.c_str(), 3);
+                                        gs.PRN = prn_;
+                                        total_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, gs));
+                                    }
                             }
                     }
                 total_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, observables_iter->second));
@@ -4498,8 +4497,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep
     std::map<int, Gnss_Synchro> observablesE5B;
     std::map<int, Gnss_Synchro>::const_iterator observables_iter;
 
-    for(observables_iter = observables.begin();
-            observables_iter != observables.end();
+    for(observables_iter = observables.cbegin();
+            observables_iter != observables.cend();
             observables_iter++)
         {
             std::string system_(&observables_iter->second.System, 1);
@@ -4525,8 +4524,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep
     std::multimap<unsigned int, Gnss_Synchro> total_gal_map;
     std::set<unsigned int> available_gal_prns;
     std::set<unsigned int>::iterator it;
-    for(observables_iter = observablesE1B.begin();
-            observables_iter != observablesE1B.end();
+    for(observables_iter = observablesE1B.cbegin();
+            observables_iter != observablesE1B.cend();
             observables_iter++)
         {
             unsigned int prn_ = observables_iter->second.PRN;
@@ -4538,8 +4537,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep
                 }
         }
 
-    for(observables_iter = observablesE5A.begin();
-            observables_iter != observablesE5A.end();
+    for(observables_iter = observablesE5A.cbegin();
+            observables_iter != observablesE5A.cend();
             observables_iter++)
         {
             unsigned int prn_ = observables_iter->second.PRN;
@@ -4551,8 +4550,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep
                 }
         }
 
-    for(observables_iter = observablesE5B.begin();
-            observables_iter != observablesE5B.end();
+    for(observables_iter = observablesE5B.cbegin();
+            observables_iter != observablesE5B.cend();
             observables_iter++)
         {
             unsigned int prn_ = observables_iter->second.PRN;
@@ -4578,8 +4577,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep
 
     std::string s;
     std::string lineObs;
-    for(observables_iter = observablesG1C.begin();
-            observables_iter != observablesG1C.end();
+    for(observables_iter = observablesG1C.cbegin();
+            observables_iter != observablesG1C.cend();
             observables_iter++)
         {
             lineObs.clear();
diff --git a/src/algorithms/PVT/libs/rinex_printer.h b/src/algorithms/PVT/libs/rinex_printer.h
index af168ab9b..d9aee967e 100644
--- a/src/algorithms/PVT/libs/rinex_printer.h
+++ b/src/algorithms/PVT/libs/rinex_printer.h
@@ -483,7 +483,7 @@ inline std::string & Rinex_Printer::rightJustify(std::string & s,
         }
     else
         {
-            s.insert((std::string::size_type)0, length-s.length(), pad);
+            s.insert(static_cast<std::string::size_type>(0), length - s.length(), pad);
         }
     return s;
 }
@@ -614,13 +614,13 @@ inline std::string & Rinex_Printer::sci2for(std::string & aStr,
     // (if it's negative, there's a leading '-'
     if (aStr[0] == '.')
         {
-            aStr.insert((std::string::size_type)0, 1, ' ');
+            aStr.insert(static_cast<std::string::size_type>(0), 1, ' ');
         }
 
     //If checkSwitch is false, add on one leading zero to the string
     if (!checkSwitch)
         {
-            aStr.insert((std::string::size_type)1, 1, '0');
+            aStr.insert(static_cast<std::string::size_type>(1), 1, '0');
         }
 
     return aStr;
diff --git a/src/algorithms/PVT/libs/rtcm_printer.cc b/src/algorithms/PVT/libs/rtcm_printer.cc
index be889e406..aa80318ed 100644
--- a/src/algorithms/PVT/libs/rtcm_printer.cc
+++ b/src/algorithms/PVT/libs/rtcm_printer.cc
@@ -32,11 +32,11 @@
  */
 
 #include "rtcm_printer.h"
-#include <ctime>
 #include <iostream>
 #include <iomanip>
 #include <fcntl.h>    // for O_RDWR
 #include <termios.h>  // for tcgetattr
+#include <boost/date_time/posix_time/posix_time.hpp>
 #include <gflags/gflags.h>
 #include <glog/logging.h>
 
@@ -45,41 +45,39 @@ using google::LogMessage;
 
 Rtcm_Printer::Rtcm_Printer(std::string filename, bool flag_rtcm_server, bool flag_rtcm_tty_port, unsigned short rtcm_tcp_port, unsigned short rtcm_station_id, std::string rtcm_dump_devname, bool time_tag_name)
 {
-    time_t rawtime;
-    struct tm * timeinfo;
-    time ( &rawtime );
-    timeinfo = localtime ( &rawtime );
+    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;
+            const int year = timeinfo.tm_year - 100;
             strm0 << year;
-            const int month = timeinfo->tm_mon + 1;
+            const int month = timeinfo.tm_mon + 1;
             if(month < 10)
                 {
                     strm0 << "0";
                 }
             strm0 << month;
-            const int day = timeinfo->tm_mday;
+            const int day = timeinfo.tm_mday;
             if(day < 10)
                 {
                     strm0 << "0";
                 }
             strm0 << day << "_";
-            const int hour = timeinfo->tm_hour;
+            const int hour = timeinfo.tm_hour;
             if(hour < 10)
                 {
                     strm0 << "0";
                 }
             strm0 << hour;
-            const int min = timeinfo->tm_min;
+            const int min = timeinfo.tm_min;
             if(min < 10)
                 {
                     strm0 << "0";
                 }
             strm0 << min;
-            const int sec = timeinfo->tm_sec;
+            const int sec = timeinfo.tm_sec;
             if(sec < 10)
                 {
                     strm0 << "0";
@@ -133,11 +131,11 @@ Rtcm_Printer::~Rtcm_Printer()
             {
                     rtcm->stop_server();
             }
-            catch( boost::exception & e )
+            catch(const boost::exception & e)
             {
                     LOG(WARNING) << "Boost exception: " << boost::diagnostic_information(e);
             }
-            catch(std::exception const&  ex)
+            catch(const std::exception & ex)
             {
                     LOG(WARNING) << "STD exception: " << ex.what();
             }
@@ -307,9 +305,9 @@ bool Rtcm_Printer::Print_Message(const std::string & message)
     {
             rtcm_file_descriptor << message << std::endl;
     }
-    catch(std::exception ex)
+    catch(const std::exception & ex)
     {
-            DLOG(INFO) << "RTCM printer can not write on output file" << rtcm_filename.c_str();
+            DLOG(INFO) << "RTCM printer cannot write on the output file " << rtcm_filename.c_str();
             return false;
     }
 
@@ -318,8 +316,8 @@ bool Rtcm_Printer::Print_Message(const std::string & message)
         {
             if(write(rtcm_dev_descriptor, message.c_str(), message.length()) == -1)
                 {
-                    DLOG(INFO) << "RTCM printer cannot write on serial device" << rtcm_devname.c_str();
-                    std::cout << "RTCM printer cannot write on serial device" << rtcm_devname.c_str() << std::endl;
+                    DLOG(INFO) << "RTCM printer cannot write on serial device " << rtcm_devname.c_str();
+                    std::cout << "RTCM printer cannot write on serial device " << rtcm_devname.c_str() << std::endl;
                     return false;
                 }
         }
diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc
index 053b8a926..344888f67 100644
--- a/src/algorithms/PVT/libs/rtklib_solver.cc
+++ b/src/algorithms/PVT/libs/rtklib_solver.cc
@@ -67,45 +67,55 @@ rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag
     d_dump_filename = dump_filename;
     d_flag_dump_enabled = flag_dump_to_file;
     count_valid_position = 0;
-    d_flag_averaging = false;
+    this->set_averaging_flag(false);
     rtk_ = rtk;
 
     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 #################
     if (d_flag_dump_enabled == true)
-    {
-        if (d_dump_file.is_open() == false)
         {
-            try
-            {
-                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) << "PVT lib dump enabled Log file: " << d_dump_filename.c_str();
-            }
-            catch (const std::ifstream::failure &e)
-            {
-                LOG(WARNING) << "Exception opening PVT lib dump file " << e.what();
-            }
+            if (d_dump_file.is_open() == false)
+                {
+                    try
+                    {
+                            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) << "PVT lib dump enabled Log file: " << d_dump_filename.c_str();
+                    }
+                    catch (const std::ifstream::failure &e)
+                    {
+                            LOG(WARNING) << "Exception opening PVT lib dump file " << e.what();
+                    }
+                }
         }
-    }
 }
 
 
 rtklib_solver::~rtklib_solver()
 {
-    d_dump_file.close();
+    if (d_dump_file.is_open() == true)
+        {
+            try
+            {
+                    d_dump_file.close();
+            }
+            catch(const std::exception & ex)
+            {
+                    LOG(WARNING) << "Exception in destructor closing the dump file " << ex.what();
+            }
+        }
 }
 
 
-bool rtklib_solver::get_PVT(std::map<int,Gnss_Synchro> gnss_observables_map, double Rx_time, bool flag_averaging)
+bool rtklib_solver::get_PVT(const std::map<int,Gnss_Synchro> & gnss_observables_map, double Rx_time, bool flag_averaging)
 {
-    std::map<int,Gnss_Synchro>::iterator gnss_observables_iter;
-    std::map<int,Galileo_Ephemeris>::iterator galileo_ephemeris_iter;
-    std::map<int,Gps_Ephemeris>::iterator gps_ephemeris_iter;
-    std::map<int,Gps_CNAV_Ephemeris>::iterator gps_cnav_ephemeris_iter;
+    std::map<int,Gnss_Synchro>::const_iterator gnss_observables_iter;
+    std::map<int,Galileo_Ephemeris>::const_iterator galileo_ephemeris_iter;
+    std::map<int,Gps_Ephemeris>::const_iterator gps_ephemeris_iter;
+    std::map<int,Gps_CNAV_Ephemeris>::const_iterator gps_cnav_ephemeris_iter;
 
-    d_flag_averaging = flag_averaging;
+    this->set_averaging_flag(flag_averaging);
 
     // ********************************************************************************
     // ****** PREPARE THE DATA (SV EPHEMERIS AND OBSERVATIONS) ************************
@@ -115,246 +125,246 @@ bool rtklib_solver::get_PVT(std::map<int,Gnss_Synchro> gnss_observables_map, dou
     obsd_t obs_data[MAXOBS];
     eph_t eph_data[MAXOBS];
 
-    for(gnss_observables_iter = gnss_observables_map.begin();
-            gnss_observables_iter != gnss_observables_map.end();
+    for(gnss_observables_iter = gnss_observables_map.cbegin();
+            gnss_observables_iter != gnss_observables_map.cend();
             gnss_observables_iter++)
-    {
-        switch(gnss_observables_iter->second.System)
         {
-        case 'E':
-        {
-            std::string sig_(gnss_observables_iter->second.Signal);
-            // Galileo E1
-            if(sig_.compare("1B") == 0)
+            switch(gnss_observables_iter->second.System)
             {
-                // 1 Gal - find the ephemeris for the current GALILEO SV observation. The SV PRN ID is the map key
-                galileo_ephemeris_iter = galileo_ephemeris_map.find(gnss_observables_iter->second.PRN);
-                if (galileo_ephemeris_iter != galileo_ephemeris_map.end())
+            case 'E':
                 {
-                    //convert ephemeris from GNSS-SDR class to RTKLIB structure
-                    eph_data[valid_obs] = eph_to_rtklib(galileo_ephemeris_iter->second);
-                    //convert observation from GNSS-SDR class to RTKLIB structure
-                    obsd_t newobs = {{0,0}, '0', '0', {}, {}, {}, {}, {}, {}};
-                    obs_data[valid_obs] = insert_obs_to_rtklib(newobs,
-                            gnss_observables_iter->second,
-                            galileo_ephemeris_iter->second.WN_5,
-                            0);
-                    valid_obs++;
-                }
-                else // the ephemeris are not available for this SV
-                {
-                    DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN;
-                }
-
-            }
-            // Galileo E5
-            if(sig_.compare("5X") == 0)
-            {
-
-                // 1 Gal - find the ephemeris for the current GALILEO SV observation. The SV PRN ID is the map key
-                galileo_ephemeris_iter = galileo_ephemeris_map.find(gnss_observables_iter->second.PRN);
-                if (galileo_ephemeris_iter != galileo_ephemeris_map.end())
-                {
-                    bool found_E1_obs=false;
-                    for (int i = 0; i < valid_obs; i++)
-                    {
-                        if (eph_data[i].sat == (static_cast<int>(gnss_observables_iter->second.PRN+NSATGPS+NSATGLO)))
+                    std::string sig_(gnss_observables_iter->second.Signal);
+                    // Galileo E1
+                    if(sig_.compare("1B") == 0)
                         {
-                            obs_data[i] = insert_obs_to_rtklib(obs_data[i],
-                                    gnss_observables_iter->second,
-                                    galileo_ephemeris_iter->second.WN_5,
-                                    2);//Band 3 (L5/E5)
-                            found_E1_obs=true;
-                            break;
-                        }
-                    }
-                    if (!found_E1_obs)
-                    {
-                        //insert Galileo E5 obs as new obs and also insert its ephemeris
-                        //convert ephemeris from GNSS-SDR class to RTKLIB structure
-                        eph_data[valid_obs] = eph_to_rtklib(galileo_ephemeris_iter->second);
-                        //convert observation from GNSS-SDR class to RTKLIB structure
-                        obsd_t newobs = {{0,0}, '0', '0', {}, {}, {}, {}, {}, {}};
-                        obs_data[valid_obs] = insert_obs_to_rtklib(newobs,
-                                gnss_observables_iter->second,
-                                galileo_ephemeris_iter->second.WN_5,
-                                2); //Band 3 (L5/E5)
-                        valid_obs++;
-                    }
-                }
-                else // the ephemeris are not available for this SV
-                {
-                    DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN;
-                }
+                            // 1 Gal - find the ephemeris for the current GALILEO SV observation. The SV PRN ID is the map key
+                            galileo_ephemeris_iter = galileo_ephemeris_map.find(gnss_observables_iter->second.PRN);
+                            if (galileo_ephemeris_iter != galileo_ephemeris_map.cend())
+                                {
+                                    //convert ephemeris from GNSS-SDR class to RTKLIB structure
+                                    eph_data[valid_obs] = eph_to_rtklib(galileo_ephemeris_iter->second);
+                                    //convert observation from GNSS-SDR class to RTKLIB structure
+                                    obsd_t newobs = {{0,0}, '0', '0', {}, {}, {}, {}, {}, {}};
+                                    obs_data[valid_obs] = insert_obs_to_rtklib(newobs,
+                                            gnss_observables_iter->second,
+                                            galileo_ephemeris_iter->second.WN_5,
+                                            0);
+                                    valid_obs++;
+                                }
+                            else // the ephemeris are not available for this SV
+                                {
+                                    DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN;
+                                }
 
-            }
-            break;
-        }
-        case 'G':
-        {
-            // GPS L1
-            // 1 GPS - find the ephemeris for the current GPS SV observation. The SV PRN ID is the map key
-            std::string sig_(gnss_observables_iter->second.Signal);
-            if(sig_.compare("1C") == 0)
-            {
-                gps_ephemeris_iter = gps_ephemeris_map.find(gnss_observables_iter->second.PRN);
-                if (gps_ephemeris_iter != gps_ephemeris_map.end())
-                {
-                    //convert ephemeris from GNSS-SDR class to RTKLIB structure
-                    eph_data[valid_obs] = eph_to_rtklib(gps_ephemeris_iter->second);
-                    //convert observation from GNSS-SDR class to RTKLIB structure
-                    obsd_t newobs = {{0,0}, '0', '0', {}, {}, {}, {}, {}, {}};
-                    obs_data[valid_obs] = insert_obs_to_rtklib(newobs,
-                            gnss_observables_iter->second,
-                            gps_ephemeris_iter->second.i_GPS_week,
-                            0);
-                    valid_obs++;
-                }
-                else // the ephemeris are not available for this SV
-                {
-                    DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->first;
-                }
-            }
-            //GPS L2
-            if(sig_.compare("2S") == 0)
-            {
-                gps_cnav_ephemeris_iter = gps_cnav_ephemeris_map.find(gnss_observables_iter->second.PRN);
-                if (gps_cnav_ephemeris_iter != gps_cnav_ephemeris_map.end())
-                {
-                    // 1. Find the same satellite in GPS L1 band
-                    gps_ephemeris_iter = gps_ephemeris_map.find(gnss_observables_iter->second.PRN);
-                    if (gps_ephemeris_iter != gps_ephemeris_map.end())
-                    {
-                        // 2. If found, replace the existing GPS L1 ephemeris with the GPS L2 ephemeris
-                        // (more precise!), and attach the L2 observation to the L1 observation in RTKLIB structure
-                        for (int i = 0; i < valid_obs; i++)
+                        }
+                    // Galileo E5
+                    if(sig_.compare("5X") == 0)
                         {
-                            if (eph_data[i].sat == static_cast<int>(gnss_observables_iter->second.PRN))
-                            {
-                                eph_data[i] = eph_to_rtklib(gps_cnav_ephemeris_iter->second);
-                                obs_data[i] = insert_obs_to_rtklib(obs_data[i],
-                                        gnss_observables_iter->second,
-                                        gps_cnav_ephemeris_iter->second.i_GPS_week,
-                                        1);//Band 2 (L2)
-                                break;
-                            }
+
+                            // 1 Gal - find the ephemeris for the current GALILEO SV observation. The SV PRN ID is the map key
+                            galileo_ephemeris_iter = galileo_ephemeris_map.find(gnss_observables_iter->second.PRN);
+                            if (galileo_ephemeris_iter != galileo_ephemeris_map.cend())
+                                {
+                                    bool found_E1_obs=false;
+                                    for (int i = 0; i < valid_obs; i++)
+                                        {
+                                            if (eph_data[i].sat == (static_cast<int>(gnss_observables_iter->second.PRN + NSATGPS + NSATGLO)))
+                                                {
+                                                    obs_data[i] = insert_obs_to_rtklib(obs_data[i],
+                                                            gnss_observables_iter->second,
+                                                            galileo_ephemeris_iter->second.WN_5,
+                                                            2);//Band 3 (L5/E5)
+                                                    found_E1_obs=true;
+                                                    break;
+                                                }
+                                        }
+                                    if (!found_E1_obs)
+                                        {
+                                            //insert Galileo E5 obs as new obs and also insert its ephemeris
+                                            //convert ephemeris from GNSS-SDR class to RTKLIB structure
+                                            eph_data[valid_obs] = eph_to_rtklib(galileo_ephemeris_iter->second);
+                                            //convert observation from GNSS-SDR class to RTKLIB structure
+                                            obsd_t newobs = {{0,0}, '0', '0', {}, {}, {}, {}, {}, {}};
+                                            obs_data[valid_obs] = insert_obs_to_rtklib(newobs,
+                                                    gnss_observables_iter->second,
+                                                    galileo_ephemeris_iter->second.WN_5,
+                                                    2); //Band 3 (L5/E5)
+                                            valid_obs++;
+                                        }
+                                }
+                            else // the ephemeris are not available for this SV
+                                {
+                                    DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN;
+                                }
                         }
-                    }
-                    else
-                    {
-                        // 3. If not found, insert the GPS L2 ephemeris and the observation
-                        //convert ephemeris from GNSS-SDR class to RTKLIB structure
-                        eph_data[valid_obs] = eph_to_rtklib(gps_cnav_ephemeris_iter->second);
-                        //convert observation from GNSS-SDR class to RTKLIB structure
-                        obsd_t newobs = {{0,0}, '0', '0', {}, {}, {}, {}, {}, {}};
-                        obs_data[valid_obs] = insert_obs_to_rtklib(newobs,
-                                gnss_observables_iter->second,
-                                gps_cnav_ephemeris_iter->second.i_GPS_week,
-                                1);//Band 2 (L2)
-                        valid_obs++;
-                    }
+                    break;
                 }
-                else // the ephemeris are not available for this SV
+            case 'G':
                 {
-                    DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN;
+                    // GPS L1
+                    // 1 GPS - find the ephemeris for the current GPS SV observation. The SV PRN ID is the map key
+                    std::string sig_(gnss_observables_iter->second.Signal);
+                    if(sig_.compare("1C") == 0)
+                        {
+                            gps_ephemeris_iter = gps_ephemeris_map.find(gnss_observables_iter->second.PRN);
+                            if (gps_ephemeris_iter != gps_ephemeris_map.cend())
+                                {
+                                    //convert ephemeris from GNSS-SDR class to RTKLIB structure
+                                    eph_data[valid_obs] = eph_to_rtklib(gps_ephemeris_iter->second);
+                                    //convert observation from GNSS-SDR class to RTKLIB structure
+                                    obsd_t newobs = {{0,0}, '0', '0', {}, {}, {}, {}, {}, {}};
+                                    obs_data[valid_obs] = insert_obs_to_rtklib(newobs,
+                                            gnss_observables_iter->second,
+                                            gps_ephemeris_iter->second.i_GPS_week,
+                                            0);
+                                    valid_obs++;
+                                }
+                            else // the ephemeris are not available for this SV
+                                {
+                                    DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->first;
+                                }
+                        }
+                    //GPS L2
+                    if(sig_.compare("2S") == 0)
+                        {
+                            gps_cnav_ephemeris_iter = gps_cnav_ephemeris_map.find(gnss_observables_iter->second.PRN);
+                            if (gps_cnav_ephemeris_iter != gps_cnav_ephemeris_map.cend())
+                                {
+                                    // 1. Find the same satellite in GPS L1 band
+                                    gps_ephemeris_iter = gps_ephemeris_map.find(gnss_observables_iter->second.PRN);
+                                    if (gps_ephemeris_iter != gps_ephemeris_map.cend())
+                                        {
+                                            // 2. If found, replace the existing GPS L1 ephemeris with the GPS L2 ephemeris
+                                            // (more precise!), and attach the L2 observation to the L1 observation in RTKLIB structure
+                                            for (int i = 0; i < valid_obs; i++)
+                                                {
+                                                    if (eph_data[i].sat == static_cast<int>(gnss_observables_iter->second.PRN))
+                                                        {
+                                                            eph_data[i] = eph_to_rtklib(gps_cnav_ephemeris_iter->second);
+                                                            obs_data[i] = insert_obs_to_rtklib(obs_data[i],
+                                                                    gnss_observables_iter->second,
+                                                                    gps_cnav_ephemeris_iter->second.i_GPS_week,
+                                                                    1);//Band 2 (L2)
+                                                            break;
+                                                        }
+                                                }
+                                        }
+                                    else
+                                        {
+                                            // 3. If not found, insert the GPS L2 ephemeris and the observation
+                                            //convert ephemeris from GNSS-SDR class to RTKLIB structure
+                                            eph_data[valid_obs] = eph_to_rtklib(gps_cnav_ephemeris_iter->second);
+                                            //convert observation from GNSS-SDR class to RTKLIB structure
+                                            obsd_t newobs = {{0,0}, '0', '0', {}, {}, {}, {}, {}, {}};
+                                            obs_data[valid_obs] = insert_obs_to_rtklib(newobs,
+                                                    gnss_observables_iter->second,
+                                                    gps_cnav_ephemeris_iter->second.i_GPS_week,
+                                                    1);//Band 2 (L2)
+                                            valid_obs++;
+                                        }
+                                }
+                            else // the ephemeris are not available for this SV
+                                {
+                                    DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN;
+                                }
+                        }
+                    break;
                 }
+            default :
+                DLOG(INFO) << "Hybrid observables: Unknown GNSS";
+                break;
             }
-            break;
-        }
-        default :
-            DLOG(INFO) << "Hybrid observables: Unknown GNSS";
-            break;
-        }
         }
 
-        // **********************************************************************
-        // ****** SOLVE PVT******************************************************
-        // **********************************************************************
+    // **********************************************************************
+    // ****** SOLVE PVT******************************************************
+    // **********************************************************************
 
-        b_valid_position = false;
-        if (valid_obs > 0)
+    this->set_valid_position(false);
+    if (valid_obs > 0)
         {
             int result = 0;
             nav_t nav_data;
             nav_data.eph = eph_data;
             nav_data.n = valid_obs;
             for (int i = 0; i < MAXSAT; i++)
-            {
-                nav_data.lam[i][0] = SPEED_OF_LIGHT / FREQ1; /* L1/E1 */
-                nav_data.lam[i][1] = SPEED_OF_LIGHT / FREQ2; /* L2 */
-                nav_data.lam[i][2] = SPEED_OF_LIGHT / FREQ5; /* L5/E5 */
-            }
+                {
+                    nav_data.lam[i][0] = SPEED_OF_LIGHT / FREQ1; /* L1/E1 */
+                    nav_data.lam[i][1] = SPEED_OF_LIGHT / FREQ2; /* L2 */
+                    nav_data.lam[i][2] = SPEED_OF_LIGHT / FREQ5; /* L5/E5 */
+                }
 
             result = rtkpos(&rtk_, obs_data, valid_obs, &nav_data);
             if(result == 0)
-            {
-                LOG(INFO) << "RTKLIB rtkpos error message: " << rtk_.errbuf;
-                d_rx_dt_s = 0; //reset rx time estimation
-                d_valid_observations = 0;
-            }
-            else
-            {
-                d_valid_observations = rtk_.sol.ns; //record the number of valid satellites used by the PVT solver
-                pvt_sol = rtk_.sol;
-                b_valid_position = true;
-                arma::vec rx_position_and_time(4);
-                rx_position_and_time(0) = pvt_sol.rr[0];
-                rx_position_and_time(1) = pvt_sol.rr[1];
-                rx_position_and_time(2) = pvt_sol.rr[2];
-                rx_position_and_time(3) = pvt_sol.dtr[0];
-                d_rx_pos = rx_position_and_time.rows(0, 2); // save ECEF position for the next iteration
-                d_rx_dt_s += rx_position_and_time(3) / GPS_C_m_s; // accumulate the rx time error for the next iteration [meters]->[seconds]
-                DLOG(INFO) << "RTKLIB Position at TOW=" << Rx_time << " in ECEF (X,Y,Z,t[meters]) = " << rx_position_and_time;
-
-                boost::posix_time::ptime p_time;
-                gtime_t rtklib_utc_time = gpst2utc(pvt_sol.time);
-                p_time = boost::posix_time::from_time_t(rtklib_utc_time.time);
-                p_time+=boost::posix_time::microseconds(round(rtklib_utc_time.sec * 1e6));
-                d_position_UTC_time = p_time;
-                cart2geo(static_cast<double>(rx_position_and_time(0)), static_cast<double>(rx_position_and_time(1)), static_cast<double>(rx_position_and_time(2)), 4);
-
-                DLOG(INFO) << "RTKLIB Position at " << boost::posix_time::to_simple_string(p_time)
-                << " is Lat = " << d_latitude_d << " [deg], Long = " << d_longitude_d
-                << " [deg], Height= " << d_height_m << " [m]" << " RX time offset= " << d_rx_dt_s << " [s]";
-
-                // ######## LOG FILE #########
-                if(d_flag_dump_enabled == true)
                 {
-                    // MULTIPLEXED FILE RECORDING - Record results to file
-                    try
-                    {
-                        double tmp_double;
-                        //  PVT GPS time
-                        tmp_double = Rx_time;
-                        d_dump_file.write((char*)&tmp_double, sizeof(double));
-                        // ECEF User Position East [m]
-                        tmp_double = rx_position_and_time(0);
-                        d_dump_file.write((char*)&tmp_double, sizeof(double));
-                        // ECEF User Position North [m]
-                        tmp_double = rx_position_and_time(1);
-                        d_dump_file.write((char*)&tmp_double, sizeof(double));
-                        // ECEF User Position Up [m]
-                        tmp_double = rx_position_and_time(2);
-                        d_dump_file.write((char*)&tmp_double, sizeof(double));
-                        // User clock offset [s]
-                        tmp_double = rx_position_and_time(3);
-                        d_dump_file.write((char*)&tmp_double, sizeof(double));
-                        // GEO user position Latitude [deg]
-                        tmp_double = d_latitude_d;
-                        d_dump_file.write((char*)&tmp_double, sizeof(double));
-                        // GEO user position Longitude [deg]
-                        tmp_double = d_longitude_d;
-                        d_dump_file.write((char*)&tmp_double, sizeof(double));
-                        // GEO user position Height [m]
-                        tmp_double = d_height_m;
-                        d_dump_file.write((char*)&tmp_double, sizeof(double));
-                    }
-                    catch (const std::ifstream::failure& e)
-                    {
-                        LOG(WARNING) << "Exception writing PVT LS dump file " << e.what();
-                    }
+                    LOG(INFO) << "RTKLIB rtkpos error message: " << rtk_.errbuf;
+                    this->set_time_offset_s(0.0); //reset rx time estimation
+                    this->set_num_valid_observations(0);
+                }
+            else
+                {
+                    this->set_num_valid_observations(rtk_.sol.ns); //record the number of valid satellites used by the PVT solver
+                    pvt_sol = rtk_.sol;
+                    this->set_valid_position(true);
+                    arma::vec rx_position_and_time(4);
+                    rx_position_and_time(0) = pvt_sol.rr[0];
+                    rx_position_and_time(1) = pvt_sol.rr[1];
+                    rx_position_and_time(2) = pvt_sol.rr[2];
+                    rx_position_and_time(3) = pvt_sol.dtr[0];
+                    this->set_rx_pos(rx_position_and_time.rows(0, 2)); // save ECEF position for the next iteration
+                    double offset_s = this->get_time_offset_s();
+                    this->set_time_offset_s(offset_s + (rx_position_and_time(3) / GPS_C_m_s)); // accumulate the rx time error for the next iteration [meters]->[seconds]
+                    DLOG(INFO) << "RTKLIB Position at TOW=" << Rx_time << " in ECEF (X,Y,Z,t[meters]) = " << rx_position_and_time;
+
+                    boost::posix_time::ptime p_time;
+                    gtime_t rtklib_utc_time = gpst2utc(pvt_sol.time);
+                    p_time = boost::posix_time::from_time_t(rtklib_utc_time.time);
+                    p_time += boost::posix_time::microseconds(round(rtklib_utc_time.sec * 1e6));
+                    this->set_position_UTC_time(p_time);
+                    cart2geo(static_cast<double>(rx_position_and_time(0)), static_cast<double>(rx_position_and_time(1)), static_cast<double>(rx_position_and_time(2)), 4);
+
+                    DLOG(INFO) << "RTKLIB Position at " << boost::posix_time::to_simple_string(p_time)
+                               << " is Lat = " << this->get_latitude() << " [deg], Long = " << this->get_longitude()
+                               << " [deg], Height= " << this->get_height() << " [m]" << " RX time offset= " << this->get_time_offset_s() << " [s]";
+
+                    // ######## LOG FILE #########
+                    if(d_flag_dump_enabled == true)
+                        {
+                            // MULTIPLEXED FILE RECORDING - Record results to file
+                            try
+                            {
+                                    double tmp_double;
+                                    //  PVT GPS time
+                                    tmp_double = Rx_time;
+                                    d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
+                                    // ECEF User Position East [m]
+                                    tmp_double = rx_position_and_time(0);
+                                    d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
+                                    // ECEF User Position North [m]
+                                    tmp_double = rx_position_and_time(1);
+                                    d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
+                                    // ECEF User Position Up [m]
+                                    tmp_double = rx_position_and_time(2);
+                                    d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
+                                    // User clock offset [s]
+                                    tmp_double = rx_position_and_time(3);
+                                    d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
+                                    // GEO user position Latitude [deg]
+                                    tmp_double = this->get_latitude();
+                                    d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
+                                    // GEO user position Longitude [deg]
+                                    tmp_double = this->get_longitude();
+                                    d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
+                                    // GEO user position Height [m]
+                                    tmp_double = this->get_height();
+                                    d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
+                            }
+                            catch (const std::ifstream::failure& e)
+                            {
+                                    LOG(WARNING) << "Exception writing PVT LS dump file " << e.what();
+                            }
+                        }
                 }
-            }
         }
-        return b_valid_position;
-    }
+    return this->is_valid_position();
+}
diff --git a/src/algorithms/PVT/libs/rtklib_solver.h b/src/algorithms/PVT/libs/rtklib_solver.h
index 5ab5ee5bb..6f441f4a6 100644
--- a/src/algorithms/PVT/libs/rtklib_solver.h
+++ b/src/algorithms/PVT/libs/rtklib_solver.h
@@ -71,17 +71,21 @@
 class rtklib_solver : public Pvt_Solution
 {
 private:
-
+    rtk_t rtk_;
+    std::string d_dump_filename;
+    std::ofstream d_dump_file;
+    sol_t pvt_sol;
+    bool d_flag_dump_enabled;
+    int d_nchannels;  // Number of available channels for positioning
 public:
-    rtklib_solver(int nchannels,std::string dump_filename, bool flag_dump_to_file, rtk_t & rtk);
+    rtklib_solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, rtk_t & rtk);
     ~rtklib_solver();
 
-    bool get_PVT(std::map<int,Gnss_Synchro> gnss_observables_map, double Rx_time, bool flag_averaging);
-    int d_nchannels;                                        //!< Number of available channels for positioning
+    bool get_PVT(const std::map<int,Gnss_Synchro> & gnss_observables_map, double Rx_time, bool flag_averaging);
 
-    std::map<int,Galileo_Ephemeris> galileo_ephemeris_map; //!< Map storing new Galileo_Ephemeris
-    std::map<int,Gps_Ephemeris> gps_ephemeris_map; //!< Map storing new GPS_Ephemeris
-    std::map<int,Gps_CNAV_Ephemeris> gps_cnav_ephemeris_map;
+    std::map<int,Galileo_Ephemeris> galileo_ephemeris_map;   //!< Map storing new Galileo_Ephemeris
+    std::map<int,Gps_Ephemeris> gps_ephemeris_map;           //!< Map storing new GPS_Ephemeris
+    std::map<int,Gps_CNAV_Ephemeris> gps_cnav_ephemeris_map; //!< Map storing new GPS_CNAV_Ephemeris
 
     Galileo_Utc_Model galileo_utc_model;
     Galileo_Iono galileo_iono;
@@ -94,14 +98,6 @@ public:
     Gps_CNAV_Utc_Model gps_cnav_utc_model;
 
     int count_valid_position;
-
-    bool d_flag_dump_enabled;
-
-    sol_t pvt_sol;
-    rtk_t rtk_;
-
-    std::string d_dump_filename;
-    std::ofstream d_dump_file;
 };
 
 #endif
diff --git a/src/algorithms/acquisition/CMakeLists.txt b/src/algorithms/acquisition/CMakeLists.txt
index d91502f0f..579bf4ba0 100644
--- a/src/algorithms/acquisition/CMakeLists.txt
+++ b/src/algorithms/acquisition/CMakeLists.txt
@@ -18,5 +18,7 @@
 
 add_subdirectory(adapters)
 add_subdirectory(gnuradio_blocks)
-#add_subdirectory(libs)
+if(ENABLE_FPGA)
+	add_subdirectory(libs)
+endif(ENABLE_FPGA)
 
diff --git a/src/algorithms/acquisition/adapters/CMakeLists.txt b/src/algorithms/acquisition/adapters/CMakeLists.txt
index d7b00edc1..57d2bd298 100644
--- a/src/algorithms/acquisition/adapters/CMakeLists.txt
+++ b/src/algorithms/acquisition/adapters/CMakeLists.txt
@@ -19,7 +19,6 @@
 
 set(ACQ_ADAPTER_SOURCES
     gps_l1_ca_pcps_acquisition.cc
-    gps_l1_ca_pcps_multithread_acquisition.cc
     gps_l1_ca_pcps_assisted_acquisition.cc
     gps_l1_ca_pcps_acquisition_fine_doppler.cc
     gps_l1_ca_pcps_tong_acquisition.cc
@@ -42,7 +41,7 @@ if(OPENCL_FOUND)
 endif(OPENCL_FOUND)
 
 include_directories(
-     $(CMAKE_CURRENT_SOURCE_DIR)
+     ${CMAKE_CURRENT_SOURCE_DIR}
      ${CMAKE_SOURCE_DIR}/src/core/system_parameters
      ${CMAKE_SOURCE_DIR}/src/core/interfaces
      ${CMAKE_SOURCE_DIR}/src/core/receiver
diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc
index d6859919c..ab2fa05e9 100644
--- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc
+++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc
@@ -53,7 +53,8 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition(
     item_type_ = configuration_->property(role + ".item_type",
             default_item_type);
 
-    fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
+    long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
+    fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
     if_ = configuration_->property(role + ".if", 0);
     dump_ = configuration_->property(role + ".dump", false);
     doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
@@ -61,10 +62,10 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition(
 
     if (sampled_ms_ % 4 != 0)
         {
-            sampled_ms_ = (int)(sampled_ms_/4) * 4;
+            sampled_ms_ = static_cast<int>(sampled_ms_ / 4) * 4;
             LOG(WARNING) << "coherent_integration_time should be multiple of "
-                                     << "Galileo code length (4 ms). coherent_integration_time = "
-                                     << sampled_ms_ << " ms will be used.";
+                         << "Galileo code length (4 ms). coherent_integration_time = "
+                         << sampled_ms_ << " ms will be used.";
         }
 
     max_dwells_ = configuration_->property(role + ".max_dwells", 1);
@@ -73,13 +74,12 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition(
             default_dump_filename);
 
     //--- Find number of samples per spreading code (4 ms)  -----------------
-
     code_length_ = round(
             fs_in_
             / (Galileo_E1_CODE_CHIP_RATE_HZ
                     / Galileo_E1_B_CODE_LENGTH_CHIPS));
 
-    vector_length_ = code_length_ * (int)(sampled_ms_/4);
+    vector_length_ = code_length_ * static_cast<int>(sampled_ms_ / 4);
 
     int samples_per_ms = code_length_ / 4;
 
@@ -198,7 +198,7 @@ signed int GalileoE1Pcps8msAmbiguousAcquisition::mag()
 void GalileoE1Pcps8msAmbiguousAcquisition::init()
 {
     acquisition_cc_->init();
-    set_local_code();
+    //set_local_code();
 }
 
 
@@ -239,7 +239,7 @@ void GalileoE1Pcps8msAmbiguousAcquisition::reset()
 float GalileoE1Pcps8msAmbiguousAcquisition::calculate_threshold(float pfa)
 {
     unsigned int frequency_bins = 0;
-    for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_)
+    for (int doppler = static_cast<int>(-doppler_max_); doppler <= static_cast<int>(doppler_max_); doppler += doppler_step_)
         {
             frequency_bins++;
         }
@@ -251,7 +251,7 @@ float GalileoE1Pcps8msAmbiguousAcquisition::calculate_threshold(float pfa)
     double val = pow(1.0 - pfa,exponent);
     double lambda = double(vector_length_);
     boost::math::exponential_distribution<double> mydist (lambda);
-    float threshold = (float)quantile(mydist,val);
+    float threshold = static_cast<float>(quantile(mydist,val));
 
     return threshold;
 }
diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.h
index 75c25b0a7..90e9d3488 100644
--- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.h
+++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.h
@@ -54,7 +54,7 @@ public:
 
     virtual ~GalileoE1Pcps8msAmbiguousAcquisition();
 
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
@@ -62,66 +62,67 @@ public:
     /*!
      * \brief Returns "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition"
      */
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return item_size_;
     }
 
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+    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;
 
     /*!
      * \brief Set acquisition/tracking common Gnss_Synchro object pointer
      * to efficiently exchange synchronization data between acquisition and
      *  tracking blocks
      */
-    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
+    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
 
     /*!
      * \brief Set acquisition channel unique ID
      */
-    void set_channel(unsigned int channel);
+    void set_channel(unsigned int channel) override;
 
     /*!
      * \brief Set statistics threshold of PCPS algorithm
      */
-    void set_threshold(float threshold);
+    void set_threshold(float threshold) override;
 
     /*!
      * \brief Set maximum Doppler off grid search
      */
-    void set_doppler_max(unsigned int doppler_max);
+    void set_doppler_max(unsigned int doppler_max) override;
 
     /*!
      * \brief Set Doppler steps for the grid search
      */
-    void set_doppler_step(unsigned int doppler_step);
+    void set_doppler_step(unsigned int doppler_step) override;
 
     /*!
      * \brief Initializes acquisition algorithm.
      */
-    void init();
+    void init() override;
 
     /*!
      * \brief Sets local code for Galileo E1 PCPS acquisition algorithm.
      */
-    void set_local_code();
+    void set_local_code() override;
 
     /*!
      * \brief Returns the maximum peak of grid search
      */
-    signed int mag();
+    signed int mag() override;
 
     /*!
      * \brief Restart acquisition algorithm
      */
-    void reset();
+    void reset() override;
 
 private:
     ConfigurationInterface* configuration_;
diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc
index 6f184c25e..f2060aebb 100644
--- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc
+++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc
@@ -52,15 +52,17 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
 
     item_type_ = configuration_->property(role + ".item_type", default_item_type);
 
-    fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
+    long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
+    fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
     if_ = configuration_->property(role + ".if", 0);
     dump_ = configuration_->property(role + ".dump", false);
+    blocking_ = configuration_->property(role + ".blocking", true);
     doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
     sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4);
 
     if (sampled_ms_ % 4 != 0)
         {
-            sampled_ms_ = (int)(sampled_ms_ / 4) * 4;
+            sampled_ms_ = static_cast<int>(sampled_ms_ / 4) * 4;
             LOG(WARNING) << "coherent_integration_time should be multiple of "
                          << "Galileo code length (4 ms). coherent_integration_time = "
                          << sampled_ms_ << " ms will be used.";
@@ -90,15 +92,19 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
             item_size_ = sizeof(lv_16sc_t);
             acquisition_sc_ = pcps_make_acquisition_sc(sampled_ms_, max_dwells_,
                     doppler_max_, if_, fs_in_, samples_per_ms, code_length_,
-                    bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, dump_filename_);
+                    bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_,
+                    dump_filename_);
             DLOG(INFO) << "acquisition(" << acquisition_sc_->unique_id() << ")";
 
-        }else{
-                item_size_ = sizeof(gr_complex);
-                acquisition_cc_ = pcps_make_acquisition_cc(sampled_ms_, max_dwells_,
-                        doppler_max_, if_, fs_in_, samples_per_ms, code_length_,
-                        bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, dump_filename_);
-                DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
+        }
+    else
+        {
+            item_size_ = sizeof(gr_complex);
+            acquisition_cc_ = pcps_make_acquisition_cc(sampled_ms_, max_dwells_,
+                    doppler_max_, if_, fs_in_, samples_per_ms, code_length_,
+                    bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_,
+                    dump_filename_);
+            DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
         }
 
     stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_);
@@ -234,7 +240,7 @@ void GalileoE1PcpsAmbiguousAcquisition::init()
             acquisition_cc_->init();
         }
 
-    set_local_code();
+    //set_local_code();
 }
 
 
@@ -296,7 +302,7 @@ void GalileoE1PcpsAmbiguousAcquisition::set_state(int state)
 float GalileoE1PcpsAmbiguousAcquisition::calculate_threshold(float pfa)
 {
     unsigned int frequency_bins = 0;
-    for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_)
+    for (int doppler = static_cast<int>(-doppler_max_); doppler <= static_cast<int>(doppler_max_); doppler += doppler_step_)
         {
             frequency_bins++;
         }
@@ -308,7 +314,7 @@ float GalileoE1PcpsAmbiguousAcquisition::calculate_threshold(float pfa)
     double val = pow(1.0 - pfa,exponent);
     double lambda = double(vector_length_);
     boost::math::exponential_distribution<double> mydist (lambda);
-    float threshold = (float)quantile(mydist,val);
+    float threshold = static_cast<float>(quantile(mydist,val));
 
     return threshold;
 }
diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.h
index b98bcbcb6..da8d2e742 100644
--- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.h
+++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.h
@@ -58,7 +58,7 @@ public:
 
     virtual ~GalileoE1PcpsAmbiguousAcquisition();
 
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
@@ -66,66 +66,67 @@ public:
     /*!
      * \brief Returns "Galileo_E1_PCPS_Ambiguous_Acquisition"
      */
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "Galileo_E1_PCPS_Ambiguous_Acquisition";
     }
-    size_t item_size()
+
+    size_t item_size() override
     {
         return item_size_;
     }
 
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+    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;
 
     /*!
      * \brief Set acquisition/tracking common Gnss_Synchro object pointer
      * to efficiently exchange synchronization data between acquisition and
      *  tracking blocks
      */
-    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
+    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
 
     /*!
      * \brief Set acquisition channel unique ID
      */
-    void set_channel(unsigned int channel);
+    void set_channel(unsigned int channel) override;
 
     /*!
      * \brief Set statistics threshold of PCPS algorithm
      */
-    void set_threshold(float threshold);
+    void set_threshold(float threshold) override;
 
     /*!
      * \brief Set maximum Doppler off grid search
      */
-    void set_doppler_max(unsigned int doppler_max);
+    void set_doppler_max(unsigned int doppler_max) override;
 
     /*!
      * \brief Set Doppler steps for the grid search
      */
-    void set_doppler_step(unsigned int doppler_step);
+    void set_doppler_step(unsigned int doppler_step) override;
 
     /*!
      * \brief Initializes acquisition algorithm.
      */
-    void init();
+    void init() override;
 
     /*!
      * \brief Sets local code for Galileo E1 PCPS acquisition algorithm.
      */
-    void set_local_code();
+    void set_local_code() override;
 
     /*!
      * \brief Returns the maximum peak of grid search
      */
-    signed int mag();
+    signed int mag() override;
 
     /*!
      * \brief Restart acquisition algorithm
      */
-    void reset();
+    void reset() override;
 
     /*!
      * \brief If state = 1, it forces the block to start acquiring from the first sample
@@ -154,6 +155,7 @@ private:
     long fs_in_;
     long if_;
     bool dump_;
+    bool blocking_;
     std::string dump_filename_;
     std::complex<float> * code_;
     Gnss_Synchro * gnss_synchro_;
diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc
index 690e3879d..dd1d5537e 100644
--- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc
+++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc
@@ -52,7 +52,8 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition
 
     item_type_ = configuration_->property(role + ".item_type", default_item_type);
 
-    fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
+    long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
+    fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
     if_ = configuration_->property(role + ".if", 0);
     dump_ = configuration_->property(role + ".dump", false);
     doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
@@ -200,7 +201,7 @@ signed int GalileoE1PcpsCccwsrAmbiguousAcquisition::mag()
 void GalileoE1PcpsCccwsrAmbiguousAcquisition::init()
 {
     acquisition_cc_->init();
-    set_local_code();
+    //set_local_code();
 }
 
 
diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.h
index 228b4a527..1ae47ea54 100644
--- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.h
+++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.h
@@ -54,7 +54,7 @@ public:
 
     virtual ~GalileoE1PcpsCccwsrAmbiguousAcquisition();
 
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
@@ -62,63 +62,64 @@ public:
     /*!
      * \brief Returns "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition"
      */
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return item_size_;
     }
 
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+    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;
 
     /*!
      * \brief Set acquisition/tracking common Gnss_Synchro object pointer
      * to efficiently exchange synchronization data between acquisition and
      * tracking blocks
      */
-    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
+    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
 
     /*!
      * \brief Set acquisition channel unique ID
      */
-    void set_channel(unsigned int channel);
+    void set_channel(unsigned int channel) override;
 
     /*!
      * \brief Set statistics threshold of CCCWSR algorithm
      */
-    void set_threshold(float threshold);
+    void set_threshold(float threshold) override;
 
     /*!
      * \brief Set maximum Doppler off grid search
      */
-    void set_doppler_max(unsigned int doppler_max);
+    void set_doppler_max(unsigned int doppler_max) override;
 
     /*!
      * \brief Set Doppler steps for the grid search
      */
-    void set_doppler_step(unsigned int doppler_step);
+    void set_doppler_step(unsigned int doppler_step) override;
 
     /*!
      * \brief Initializes acquisition algorithm.
      */
-    void init();
+    void init() override;
 
-    void set_local_code();
+    void set_local_code() override;
 
     /*!
      * \brief Returns the maximum peak of grid search
      */
-    signed int mag();
+    signed int mag() override;
 
     /*!
      * \brief Restart acquisition algorithm
      */
-    void reset();
+    void reset() override;
 
     /*!
      * \brief If state = 1, it forces the block to start acquiring from the first sample
diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc
index e6be855d2..53da3ac60 100644
--- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc
+++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc
@@ -53,7 +53,8 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui
     item_type_ = configuration_->property(role + ".item_type",
             default_item_type);
 
-    fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
+    long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
+    fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
     if_ = configuration_->property(role + ".if", 0);
     dump_ = configuration_->property(role + ".dump", false);
     doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
@@ -67,14 +68,13 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui
 
     int samples_per_ms = round(code_length_ / 4.0);
 
-
     /*Calculate the folding factor value based on the formula described in the paper.
     This may be a bug, but acquisition also work by variying the folding factor at va-
     lues different that the expressed in the paper. In adition, it is important to point
     out that by making the folding factor smaller we were able to get QuickSync work with 
     Galileo. Future work should be directed to test this asumption statistically.*/
 
-    //folding_factor_ = (unsigned int)ceil(sqrt(log2(code_length_)));
+    //folding_factor_ = static_cast<unsigned int>(ceil(sqrt(log2(code_length_))));
     folding_factor_ = configuration_->property(role + ".folding_factor", 2);
 
     if (sampled_ms_ % (folding_factor_*4) != 0)
@@ -85,11 +85,11 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui
 
             if(sampled_ms_ < (folding_factor_*4))
                 {
-                    sampled_ms_ = (int) (folding_factor_*4);
+                    sampled_ms_ = static_cast<int>(folding_factor_ * 4);
                 }
             else
                 {
-                    sampled_ms_ = (int)(sampled_ms_/(folding_factor_*4)) * (folding_factor_*4);
+                    sampled_ms_ = static_cast<int>(sampled_ms_/(folding_factor_*4)) * (folding_factor_*4);
                 }
             LOG(WARNING) << "coherent_integration_time should be multiple of "
                     << "Galileo code length (4 ms). coherent_integration_time = "
@@ -240,7 +240,7 @@ void
 GalileoE1PcpsQuickSyncAmbiguousAcquisition::init()
 {
     acquisition_cc_->init();
-    set_local_code();
+    //set_local_code();
 }
 
 
@@ -296,7 +296,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_state(int state)
 float GalileoE1PcpsQuickSyncAmbiguousAcquisition::calculate_threshold(float pfa)
 {
     unsigned int frequency_bins = 0;
-    for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_)
+    for (int doppler = static_cast<int>(-doppler_max_); doppler <= static_cast<int>(doppler_max_); doppler += doppler_step_)
         {
             frequency_bins++;
         }
diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.h
index 847419692..0e64dbf96 100644
--- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.h
+++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.h
@@ -54,7 +54,7 @@ public:
 
     virtual ~GalileoE1PcpsQuickSyncAmbiguousAcquisition();
 
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
@@ -62,66 +62,67 @@ public:
     /*!
      * \brief Returns "Galileo_E1_PCPS_Ambiguous_Acquisition"
      */
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return item_size_;
     }
 
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+    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;
 
     /*!
      * \brief Set acquisition/tracking common Gnss_Synchro object pointer
      * to efficiently exchange synchronization data between acquisition and
      *  tracking blocks
      */
-    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
+    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
 
     /*!
      * \brief Set acquisition channel unique ID
      */
-    void set_channel(unsigned int channel);
+    void set_channel(unsigned int channel) override;
 
     /*!
      * \brief Set statistics threshold of PCPS algorithm
      */
-    void set_threshold(float threshold);
+    void set_threshold(float threshold) override;
 
     /*!
      * \brief Set maximum Doppler off grid search
      */
-    void set_doppler_max(unsigned int doppler_max);
+    void set_doppler_max(unsigned int doppler_max) override;
 
     /*!
      * \brief Set Doppler steps for the grid search
      */
-    void set_doppler_step(unsigned int doppler_step);
+    void set_doppler_step(unsigned int doppler_step) override;
 
     /*!
      * \brief Initializes acquisition algorithm.
      */
-    void init();
+    void init() override;
 
     /*!
      * \brief Sets local code for Galileo E1 PCPS acquisition algorithm.
      */
-    void set_local_code();
+    void set_local_code() override;
 
     /*!
      * \brief Returns the maximum peak of grid search
      */
-    signed int mag();
+    signed int mag() override;
 
     /*!
      * \brief Restart acquisition algorithm
      */
-    void reset();
+    void reset() override;
 
     /*!
      * \brief If state = 1, it forces the block to start acquiring from the first sample
diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc
index dae111573..1b91b4058 100644
--- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc
+++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc
@@ -53,7 +53,8 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition(
     item_type_ = configuration_->property(role + ".item_type",
             default_item_type);
 
-    fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
+    long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
+    fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
     if_ = configuration_->property(role + ".if", 0);
     dump_ = configuration_->property(role + ".dump", false);
     doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
@@ -61,11 +62,10 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition(
 
     if (sampled_ms_ % 4 != 0)
         {
-            sampled_ms_ = (int)(sampled_ms_/4) * 4;
+            sampled_ms_ = static_cast<int>(sampled_ms_ / 4) * 4;
             LOG(WARNING) << "coherent_integration_time should be multiple of "
-                                     << "Galileo code length (4 ms). coherent_integration_time = "
-                                     << sampled_ms_ << " ms will be used.";
-
+                    << "Galileo code length (4 ms). coherent_integration_time = "
+                    << sampled_ms_ << " ms will be used.";
         }
 
     tong_init_val_ = configuration->property(role + ".tong_init_val", 1);
@@ -82,7 +82,7 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition(
             / (Galileo_E1_CODE_CHIP_RATE_HZ
                     / Galileo_E1_B_CODE_LENGTH_CHIPS));
 
-    vector_length_ = code_length_ * (int)(sampled_ms_/4);
+    vector_length_ = code_length_ * static_cast<int>(sampled_ms_ / 4);
 
     int samples_per_ms = code_length_ / 4;
 
@@ -204,7 +204,7 @@ signed int GalileoE1PcpsTongAmbiguousAcquisition::mag()
 void GalileoE1PcpsTongAmbiguousAcquisition::init()
 {
     acquisition_cc_->init();
-    set_local_code();
+    //set_local_code();
 }
 
 
@@ -251,7 +251,7 @@ void GalileoE1PcpsTongAmbiguousAcquisition::set_state(int state)
 float GalileoE1PcpsTongAmbiguousAcquisition::calculate_threshold(float pfa)
 {
     unsigned int frequency_bins = 0;
-    for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_)
+    for (int doppler = static_cast<int>(-doppler_max_); doppler <= static_cast<int>(doppler_max_); doppler += doppler_step_)
         {
             frequency_bins++;
         }
@@ -263,7 +263,7 @@ float GalileoE1PcpsTongAmbiguousAcquisition::calculate_threshold(float pfa)
     double val = pow(1.0-pfa,exponent);
     double lambda = double(vector_length_);
     boost::math::exponential_distribution<double> mydist (lambda);
-    float threshold = (float)quantile(mydist,val);
+    float threshold = static_cast<float>(quantile(mydist,val));
 
     return threshold;
 }
diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.h
index dd7b7db34..78f033572 100644
--- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.h
+++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.h
@@ -54,7 +54,7 @@ public:
 
     virtual ~GalileoE1PcpsTongAmbiguousAcquisition();
 
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
@@ -62,66 +62,67 @@ public:
     /*!
      * \brief Returns "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition"
      */
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return item_size_;
     }
 
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+    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;
 
     /*!
      * \brief Set acquisition/tracking common Gnss_Synchro object pointer
      * to efficiently exchange synchronization data between acquisition and
      *  tracking blocks
      */
-    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
+    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
 
     /*!
      * \brief Set acquisition channel unique ID
      */
-    void set_channel(unsigned int channel);
+    void set_channel(unsigned int channel) override;
 
     /*!
      * \brief Set statistics threshold of TONG algorithm
      */
-    void set_threshold(float threshold);
+    void set_threshold(float threshold) override;
 
     /*!
      * \brief Set maximum Doppler off grid search
      */
-    void set_doppler_max(unsigned int doppler_max);
+    void set_doppler_max(unsigned int doppler_max) override;
 
     /*!
      * \brief Set Doppler steps for the grid search
      */
-    void set_doppler_step(unsigned int doppler_step);
+    void set_doppler_step(unsigned int doppler_step) override;
 
     /*!
      * \brief Initializes acquisition algorithm.
      */
-    void init();
+    void init() override;
 
     /*!
      * \brief Sets local code for Galileo E1 TONG acquisition algorithm.
      */
-    void set_local_code();
+    void set_local_code() override;
 
     /*!
      * \brief Returns the maximum peak of grid search
      */
-    signed int mag();
+    signed int mag() override;
 
     /*!
      * \brief Restart acquisition algorithm
      */
-    void reset();
+    void reset() override;
 
     /*!
      * \brief If state = 1, it forces the block to start acquiring from the first sample
diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc
index e7701a513..ec9501b12 100644
--- a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc
+++ b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc
@@ -58,7 +58,8 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf(
 
     item_type_ = configuration_->property(role + ".item_type", default_item_type);
 
-    fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 32000000);
+    long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 32000000);
+    fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
     if_ = configuration_->property(role + ".if", 0);
     dump_ = configuration_->property(role + ".dump", false);
     doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
@@ -206,7 +207,7 @@ signed int GalileoE5aNoncoherentIQAcquisitionCaf::mag()
 void GalileoE5aNoncoherentIQAcquisitionCaf::init()
 {
     acquisition_cc_->init();
-    set_local_code();
+    //set_local_code();
 }
 
 
@@ -282,7 +283,7 @@ float GalileoE5aNoncoherentIQAcquisitionCaf::calculate_threshold(float pfa)
 {
     //Calculate the threshold
     unsigned int frequency_bins = 0;
-    for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_)
+    for (int doppler = static_cast<int>(-doppler_max_); doppler <= static_cast<int>(doppler_max_); doppler += doppler_step_)
         {
             frequency_bins++;
         }
@@ -292,7 +293,7 @@ float GalileoE5aNoncoherentIQAcquisitionCaf::calculate_threshold(float pfa)
     double val = pow(1.0 - pfa, exponent);
     double lambda = double(vector_length_);
     boost::math::exponential_distribution<double> mydist (lambda);
-    float threshold = (float)quantile(mydist,val);
+    float threshold = static_cast<float>(quantile(mydist,val));
 
     return threshold;
 }
diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h
index e2a867c63..ce23d5441 100644
--- a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h
+++ b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h
@@ -55,7 +55,7 @@ public:
 
     virtual ~GalileoE5aNoncoherentIQAcquisitionCaf();
 
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
@@ -63,67 +63,67 @@ public:
     /*!
      * \brief Returns "Galileo_E5a_Noncoherent_IQ_Acquisition_CAF"
      */
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "Galileo_E5a_Noncoherent_IQ_Acquisition_CAF";
     }
 
-    size_t item_size()
+    inline size_t item_size() override
     {
         return item_size_;
     }
 
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+    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;
 
     /*!
      * \brief Set acquisition/tracking common Gnss_Synchro object pointer
      * to efficiently exchange synchronization data between acquisition and
      *  tracking blocks
      */
-    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
+    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
 
     /*!
      * \brief Set acquisition channel unique ID
      */
-    void set_channel(unsigned int channel);
+    void set_channel(unsigned int channel) override;
 
     /*!
      * \brief Set statistics threshold of PCPS algorithm
      */
-    void set_threshold(float threshold);
+    void set_threshold(float threshold) override;
 
     /*!
      * \brief Set maximum Doppler off grid search
      */
-    void set_doppler_max(unsigned int doppler_max);
+    void set_doppler_max(unsigned int doppler_max) override;
 
     /*!
      * \brief Set Doppler steps for the grid search
      */
-    void set_doppler_step(unsigned int doppler_step);
+    void set_doppler_step(unsigned int doppler_step) override;
 
     /*!
      * \brief Initializes acquisition algorithm.
      */
-    void init();
+    void init() override;
 
     /*!
      * \brief Sets local Galileo E5a code for PCPS acquisition algorithm.
      */
-    void set_local_code();
+    void set_local_code() override;
 
     /*!
      * \brief Returns the maximum peak of grid search
      */
-    signed int mag();
+    signed int mag() override;
 
     /*!
      * \brief Restart acquisition algorithm
      */
-    void reset();
+    void reset() override;
 
     /*!
      * \brief If set to 1, ensures that acquisition starts at the
diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc
index 8ae477856..2cacaae60 100644
--- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc
+++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc
@@ -55,10 +55,11 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition(
     DLOG(INFO) << "role " << role;
 
     item_type_ = configuration_->property(role + ".item_type", default_item_type);
-
-    fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
+    long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
+    fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
     if_ = configuration_->property(role + ".if", 0);
     dump_ = configuration_->property(role + ".dump", false);
+    blocking_ = configuration_->property(role + ".blocking", true);
     doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
     sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1);
 
@@ -86,15 +87,16 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition(
             item_size_ = sizeof(lv_16sc_t);
             acquisition_sc_ = pcps_make_acquisition_sc(sampled_ms_, max_dwells_,
                     doppler_max_, if_, fs_in_, code_length_, code_length_,
-                    bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, dump_filename_);
+                    bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_, dump_filename_);
             DLOG(INFO) << "acquisition(" << acquisition_sc_->unique_id() << ")";
-
-        }else{
-                item_size_ = sizeof(gr_complex);
-                acquisition_cc_ = pcps_make_acquisition_cc(sampled_ms_, max_dwells_,
-                        doppler_max_, if_, fs_in_, code_length_, code_length_,
-                        bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, dump_filename_);
-                DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
+        }
+    else
+        {
+            item_size_ = sizeof(gr_complex);
+            acquisition_cc_ = pcps_make_acquisition_cc(sampled_ms_, max_dwells_,
+                    doppler_max_, if_, fs_in_, code_length_, code_length_,
+                    bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_, dump_filename_);
+            DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
         }
 
     stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_);
@@ -130,7 +132,6 @@ void GpsL1CaPcpsAcquisition::set_channel(unsigned int channel)
         {
             acquisition_cc_->set_channel(channel_);
         }
-
 }
 
 
@@ -188,9 +189,9 @@ void GpsL1CaPcpsAcquisition::set_doppler_step(unsigned int doppler_step)
         {
             acquisition_cc_->set_doppler_step(doppler_step_);
         }
-
 }
 
+
 void GpsL1CaPcpsAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro)
 {
     gnss_synchro_ = gnss_synchro;
@@ -230,13 +231,12 @@ void GpsL1CaPcpsAcquisition::init()
             acquisition_cc_->init();
         }
 
-    set_local_code();
+    //set_local_code();
 }
 
 
 void GpsL1CaPcpsAcquisition::set_local_code()
 {
-
     std::complex<float>* code = new std::complex<float>[code_length_];
 
     gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0);
@@ -291,7 +291,7 @@ float GpsL1CaPcpsAcquisition::calculate_threshold(float pfa)
 {
     //Calculate the threshold
     unsigned int frequency_bins = 0;
-    for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_)
+    for (int doppler = static_cast<int>(-doppler_max_); doppler <= static_cast<int>(doppler_max_); doppler += doppler_step_)
         {
             frequency_bins++;
         }
@@ -301,7 +301,7 @@ float GpsL1CaPcpsAcquisition::calculate_threshold(float pfa)
     double val = pow(1.0 - pfa, exponent);
     double lambda = double(vector_length_);
     boost::math::exponential_distribution<double> mydist (lambda);
-    float threshold = (float)quantile(mydist,val);
+    float threshold = static_cast<float>(quantile(mydist,val));
 
     return threshold;
 }
diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h
index a32cc81a4..183a9212c 100644
--- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h
+++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h
@@ -63,7 +63,7 @@ public:
 
     virtual ~GpsL1CaPcpsAcquisition();
 
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
@@ -71,66 +71,67 @@ public:
     /*!
      * \brief Returns "GPS_L1_CA_PCPS_Acquisition"
      */
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "GPS_L1_CA_PCPS_Acquisition";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return item_size_;
     }
 
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+    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;
 
     /*!
      * \brief Set acquisition/tracking common Gnss_Synchro object pointer
      * to efficiently exchange synchronization data between acquisition and
      *  tracking blocks
      */
-    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
+    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
 
     /*!
      * \brief Set acquisition channel unique ID
      */
-    void set_channel(unsigned int channel);
+    void set_channel(unsigned int channel) override;
 
     /*!
      * \brief Set statistics threshold of PCPS algorithm
      */
-    void set_threshold(float threshold);
+    void set_threshold(float threshold) override;
 
     /*!
      * \brief Set maximum Doppler off grid search
      */
-    void set_doppler_max(unsigned int doppler_max);
+    void set_doppler_max(unsigned int doppler_max) override;
 
     /*!
      * \brief Set Doppler steps for the grid search
      */
-    void set_doppler_step(unsigned int doppler_step);
+    void set_doppler_step(unsigned int doppler_step) override;
 
     /*!
      * \brief Initializes acquisition algorithm.
      */
-    void init();
+    void init() override;
 
     /*!
      * \brief Sets local code for GPS L1/CA PCPS acquisition algorithm.
      */
-    void set_local_code();
+    void set_local_code() override;
 
     /*!
      * \brief Returns the maximum peak of grid search
      */
-    signed int mag();
+    signed int mag() override;
 
     /*!
      * \brief Restart acquisition algorithm
      */
-    void reset();
+    void reset() override;
 
     /*!
      * \brief If state = 1, it forces the block to start acquiring from the first sample
@@ -159,6 +160,7 @@ private:
     long fs_in_;
     long if_;
     bool dump_;
+    bool blocking_;
     std::string dump_filename_;
     std::complex<float> * code_;
     Gnss_Synchro * gnss_synchro_;
diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc
index 254e71369..5328cb343 100644
--- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc
+++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc
@@ -51,7 +51,8 @@ GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler(
     DLOG(INFO) << "role " << role;
 
     item_type_ = configuration->property(role + ".item_type", default_item_type);
-    fs_in_ = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
+    long fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
+    fs_in_ = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
     if_ = configuration->property(role + ".if", 0);
     dump_ = configuration->property(role + ".dump", false);
     dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
@@ -136,7 +137,7 @@ signed int GpsL1CaPcpsAcquisitionFineDoppler::mag()
 void GpsL1CaPcpsAcquisitionFineDoppler::init()
 {
     acquisition_cc_->init();
-    set_local_code();
+    //set_local_code();
 }
 
 
diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h
index 0b6796a8b..4d1474a10 100644
--- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h
+++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h
@@ -56,7 +56,7 @@ public:
 
     virtual ~GpsL1CaPcpsAcquisitionFineDoppler();
 
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
@@ -64,63 +64,64 @@ public:
     /*!
      * \brief Returns "GPS_L1_CA_PCPS_Acquisition_Fine_Doppler"
      */
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "GPS_L1_CA_PCPS_Acquisition_Fine_Doppler";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return item_size_;
     }
 
-    void connect(boost::shared_ptr<gr::top_block> top_block);
-    void disconnect(boost::shared_ptr<gr::top_block> top_block);
-    boost::shared_ptr<gr::basic_block> get_left_block();
-    boost::shared_ptr<gr::basic_block> get_right_block();
+    void connect(boost::shared_ptr<gr::top_block> top_block) override;
+    void disconnect(boost::shared_ptr<gr::top_block> top_block) override;
+    boost::shared_ptr<gr::basic_block> get_left_block() override;
+    boost::shared_ptr<gr::basic_block> get_right_block() override;
 
     /*!
      * \brief Set acquisition/tracking common Gnss_Synchro object pointer
      * to efficiently exchange synchronization data between acquisition and
      *  tracking blocks
      */
-    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
+    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
 
     /*!
      * \brief Set acquisition channel unique ID
      */
-    void set_channel(unsigned int channel);
+    void set_channel(unsigned int channel) override;
 
     /*!
      * \brief Set statistics threshold of PCPS algorithm
      */
-    void set_threshold(float threshold);
+    void set_threshold(float threshold) override;
 
     /*!
      * \brief Set maximum Doppler off grid search
      */
-    void set_doppler_max(unsigned int doppler_max);
+    void set_doppler_max(unsigned int doppler_max) override;
 
     /*!
      * \brief Set Doppler steps for the grid search
      */
-    void set_doppler_step(unsigned int doppler_step);
+    void set_doppler_step(unsigned int doppler_step) override;
 
     /*!
      * \brief Initializes acquisition algorithm.
      */
-    void init();
+    void init() override;
 
-    void set_local_code();
+    void set_local_code() override;
 
     /*!
      * \brief Returns the maximum peak of grid search
      */
-    signed int mag();
+    signed int mag() override;
 
     /*!
      * \brief Restart acquisition algorithm
      */
-    void reset();
+    void reset() override;
 
 private:
     pcps_acquisition_fine_doppler_cc_sptr acquisition_cc_;
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 48dd946cb..e1bb219c7 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,20 +32,31 @@
  */
 
 #include "gps_l1_ca_pcps_acquisition_fpga.h"
+#include <stdexcept>
 #include <boost/math/distributions/exponential.hpp>
 #include <glog/logging.h>
-#include "gps_sdr_signal_processing.h"
 #include "GPS_L1_CA.h"
 #include "configuration_interface.h"
 
-
 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)
+        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;
+
     configuration_ = configuration;
 
     std::string default_item_type = "cshort";
@@ -55,57 +66,62 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
 
     item_type_ = configuration_->property(role + ".item_type", default_item_type);
 
-    fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
-    if_ = 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);
+    ifreq = configuration_->property(role + ".if", 0);
+    dump = configuration_->property(role + ".dump", false);
     doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
-    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 = 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);
+    float nbits;
+    nbits = ceilf(log2f(code_length));
+    nsamples_total = pow(2, nbits);
 
     //vector_length_ = code_length_ * sampled_ms_;
-    vector_length_ = nsamples_total_ * sampled_ms_;
+    vector_length_ = nsamples_total * sampled_ms;
 
+    //    if( bit_transition_flag_ )
+    //        {
+    //            vector_length_ *= 2;
+    //        }
 
-    if( bit_transition_flag_ )
-        {
-            vector_length_ *= 2;
-        }
+    select_queue_Fpga = configuration_->property(role + ".select_queue_Fpga", 0);
 
-    code_ = new gr_complex[vector_length_];
+    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);
-
-    if (item_type_.compare("cshort") == 0 )
+    if (item_type_.compare("cshort") == 0)
         {
             item_size_ = sizeof(lv_16sc_t);
-            gps_acquisition_fpga_sc_ = gps_pcps_make_acquisition_fpga_sc(sampled_ms_, max_dwells_,
-                    doppler_max_, if_, fs_in_, code_length_, code_length_, vector_length_,
-                    bit_transition_flag_, use_CFAR_algorithm_flag_, select_queue_Fpga_, dump_, dump_filename_);
-            DLOG(INFO) << "acquisition(" << gps_acquisition_fpga_sc_->unique_id() << ")";
-
+            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(WARNING) << "item_type configured to " << item_type_ << "but FPGA implementation only accepts cshort";
+            throw std::invalid_argument( "Wrong input_type configuration. Should be cshort" );
         }
-    else{
-    		LOG(FATAL) << item_type_ << " FPGA only accepts chsort";
-    	}
-
 
     channel_ = 0;
     threshold_ = 0.0;
@@ -116,16 +132,13 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
 
 GpsL1CaPcpsAcquisitionFpga::~GpsL1CaPcpsAcquisitionFpga()
 {
-    delete[] code_;
 }
 
 
 void GpsL1CaPcpsAcquisitionFpga::set_channel(unsigned int channel)
 {
     channel_ = channel;
-
     gps_acquisition_fpga_sc_->set_channel(channel_);
-
 }
 
 
@@ -133,7 +146,7 @@ void GpsL1CaPcpsAcquisitionFpga::set_threshold(float threshold)
 {
     float pfa = configuration_->property(role_ + ".pfa", 0.0);
 
-    if(pfa == 0.0)
+    if (pfa == 0.0)
         {
             threshold_ = threshold;
         }
@@ -143,101 +156,68 @@ void GpsL1CaPcpsAcquisitionFpga::set_threshold(float threshold)
         }
 
     DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_;
-
-
     gps_acquisition_fpga_sc_->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_);
-
 }
 
 
 void GpsL1CaPcpsAcquisitionFpga::set_doppler_step(unsigned int doppler_step)
 {
     doppler_step_ = doppler_step;
-
     gps_acquisition_fpga_sc_->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_);
 }
 
 
 signed int GpsL1CaPcpsAcquisitionFpga::mag()
 {
-
-	return gps_acquisition_fpga_sc_->mag();
+    return gps_acquisition_fpga_sc_->mag();
 }
 
 
 void GpsL1CaPcpsAcquisitionFpga::init()
 {
-
-	gps_acquisition_fpga_sc_->init();
-
+    gps_acquisition_fpga_sc_->init();
     set_local_code();
 }
 
 
 void GpsL1CaPcpsAcquisitionFpga::set_local_code()
 {
-
-    std::complex<float>* code = new std::complex<float>[vector_length_];
-
-
-    //init to zeros for the zero padding of the fft
-    for (uint s=0;s<vector_length_;s++)
-    {
-    	code[s] = std::complex<float>(0, 0);
-    }
-
-    gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_ , 0);
-
-    for (unsigned int i = 0; i < sampled_ms_; i++)
-	{
-		memcpy(&(code_[i*vector_length_]), code, sizeof(gr_complex)*vector_length_);
-
-	}
-
-    gps_acquisition_fpga_sc_->set_local_code(code_);
-
-    delete[] code;
+    gps_acquisition_fpga_sc_->set_local_code();
 }
 
 
 void GpsL1CaPcpsAcquisitionFpga::reset()
 {
-
-	gps_acquisition_fpga_sc_->set_active(true);
-
+    gps_acquisition_fpga_sc_->set_active(true);
 }
 
 
 void GpsL1CaPcpsAcquisitionFpga::set_state(int state)
 {
-
-	gps_acquisition_fpga_sc_->set_state(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 = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_)
+    for (int doppler = static_cast<int>(-doppler_max_); doppler <= static_cast<int>(doppler_max_);
+            doppler += doppler_step_)
         {
             frequency_bins++;
         }
@@ -246,39 +226,31 @@ float GpsL1CaPcpsAcquisitionFpga::calculate_threshold(float pfa)
     double exponent = 1 / static_cast<double>(ncells);
     double val = pow(1.0 - pfa, exponent);
     double lambda = double(vector_length_);
-    boost::math::exponential_distribution<double> mydist (lambda);
-    float threshold = (float)quantile(mydist,val);
+    boost::math::exponential_distribution<double> mydist(lambda);
+    float threshold = static_cast<float>(quantile(mydist, val));
 
     return threshold;
 }
 
-
 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 gps_acquisition_fpga_sc_;
 }
 
 
 gr::basic_block_sptr GpsL1CaPcpsAcquisitionFpga::get_right_block()
 {
-
-	return gps_acquisition_fpga_sc_;
-
+    return gps_acquisition_fpga_sc_;
 }
-
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 95d7cc8dd..3a6115e6e 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
@@ -43,15 +43,13 @@
 #include "complex_byte_to_float_x2.h"
 #include <volk_gnsssdr/volk_gnsssdr.h>
 
-
-
 class ConfigurationInterface;
 
 /*!
  * \brief This class adapts a PCPS acquisition block to an AcquisitionInterface
  *  for GPS L1 C/A signals
  */
-class GpsL1CaPcpsAcquisitionFpga: public AcquisitionInterface
+class GpsL1CaPcpsAcquisitionFpga : public AcquisitionInterface
 {
 public:
     GpsL1CaPcpsAcquisitionFpga(ConfigurationInterface* configuration,
@@ -60,7 +58,7 @@ public:
 
     virtual ~GpsL1CaPcpsAcquisitionFpga();
 
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
@@ -68,66 +66,67 @@ public:
     /*!
      * \brief Returns "GPS_L1_CA_PCPS_Acquisition"
      */
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "GPS_L1_CA_PCPS_Acquisition_Fpga";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return item_size_;
     }
 
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+    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;
 
     /*!
      * \brief Set acquisition/tracking common Gnss_Synchro object pointer
      * to efficiently exchange synchronization data between acquisition and
      *  tracking blocks
      */
-    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
+    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
 
     /*!
      * \brief Set acquisition channel unique ID
      */
-    void set_channel(unsigned int channel);
+    void set_channel(unsigned int channel) override;
 
     /*!
      * \brief Set statistics threshold of PCPS algorithm
      */
-    void set_threshold(float threshold);
+    void set_threshold(float threshold) override;
 
     /*!
      * \brief Set maximum Doppler off grid search
      */
-    void set_doppler_max(unsigned int doppler_max);
+    void set_doppler_max(unsigned int doppler_max) override;
 
     /*!
      * \brief Set Doppler steps for the grid search
      */
-    void set_doppler_step(unsigned int doppler_step);
+    void set_doppler_step(unsigned int doppler_step) override;
 
     /*!
      * \brief Initializes acquisition algorithm.
      */
-    void init();
+    void init() override;
 
     /*!
      * \brief Sets local code for GPS L1/CA PCPS acquisition algorithm.
      */
-    void set_local_code();
+    void set_local_code() override;
 
     /*!
      * \brief Returns the maximum peak of grid search
      */
-    signed int mag();
+    signed int mag() override;
 
     /*!
      * \brief Restart acquisition algorithm
      */
-    void reset();
+    void reset() override;
 
     /*!
      * \brief If state = 1, it forces the block to start acquiring from the first sample
@@ -137,35 +136,19 @@ public:
 private:
     ConfigurationInterface* configuration_;
     gps_pcps_acquisition_fpga_sc_sptr gps_acquisition_fpga_sc_;
-    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_;
     size_t item_size_;
     std::string item_type_;
     unsigned int vector_length_;
-    unsigned int code_length_;
-    bool bit_transition_flag_;
-    bool use_CFAR_algorithm_flag_;
     unsigned int channel_;
     float threshold_;
     unsigned int doppler_max_;
     unsigned int doppler_step_;
-    unsigned int sampled_ms_;
     unsigned int max_dwells_;
-    long fs_in_;
-    long if_;
-    bool dump_;
-    std::string dump_filename_;
-    std::complex<float> * code_;
     Gnss_Synchro * gnss_synchro_;
     std::string role_;
     unsigned int in_streams_;
     unsigned int out_streams_;
 
-    unsigned int nsamples_total_;
-
-    unsigned int select_queue_Fpga_;
-
     float calculate_threshold(float pfa);
 };
 
diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.cc
index beb45c323..f4a0e8190 100644
--- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.cc
+++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.cc
@@ -51,7 +51,8 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition(
     DLOG(INFO) << "role " << role;
 
     item_type_ = configuration->property(role + ".item_type", default_item_type);
-    fs_in_ = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
+    long fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
+    fs_in_ = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
     if_ = configuration->property(role + ".if", 0);
     dump_ = configuration->property(role + ".dump", false);
     doppler_max_ = configuration->property(role + ".doppler_max", 5000);
@@ -72,7 +73,6 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition(
             acquisition_cc_ = pcps_make_assisted_acquisition_cc(max_dwells_, sampled_ms_,
                     doppler_max_, doppler_min_, if_, fs_in_, vector_length_,
                     dump_, dump_filename_);
-
         }
     else
         {
@@ -137,7 +137,7 @@ signed int GpsL1CaPcpsAssistedAcquisition::mag()
 void GpsL1CaPcpsAssistedAcquisition::init()
 {
     acquisition_cc_->init();
-    set_local_code();
+    //set_local_code();
 }
 
 void GpsL1CaPcpsAssistedAcquisition::set_local_code()
diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.h
index d2faf3f51..ee7ac9b66 100644
--- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.h
+++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.h
@@ -56,7 +56,7 @@ public:
 
     virtual ~GpsL1CaPcpsAssistedAcquisition();
 
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
@@ -64,63 +64,64 @@ public:
     /*!
      * \brief Returns "GPS_L1_CA_PCPS_Assisted_Acquisition"
      */
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "GPS_L1_CA_PCPS_Assisted_Acquisition";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return item_size_;
     }
 
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+    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;
 
     /*!
      * \brief Set acquisition/tracking common Gnss_Synchro object pointer
      * to efficiently exchange synchronization data between acquisition and
      *  tracking blocks
      */
-    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
+    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
 
     /*!
      * \brief Set acquisition channel unique ID
      */
-    void set_channel(unsigned int channel);
+    void set_channel(unsigned int channel) override;
 
     /*!
      * \brief Set statistics threshold of PCPS algorithm
      */
-    void set_threshold(float threshold);
+    void set_threshold(float threshold) override;
 
     /*!
      * \brief Set maximum Doppler off grid search
      */
-    void set_doppler_max(unsigned int doppler_max);
+    void set_doppler_max(unsigned int doppler_max) override;
 
     /*!
      * \brief Set Doppler steps for the grid search
      */
-    void set_doppler_step(unsigned int doppler_step);
+    void set_doppler_step(unsigned int doppler_step) override;
 
     /*!
      * \brief Initializes acquisition algorithm.
      */
-    void init();
+    void init() override;
 
-    void set_local_code();
+    void set_local_code() override;
 
     /*!
      * \brief Returns the maximum peak of grid search
      */
-    signed int mag();
+    signed int mag() override;
 
     /*!
      * \brief Restart acquisition algorithm
      */
-    void reset();
+    void reset() override;
 
 private:
     pcps_assisted_acquisition_cc_sptr acquisition_cc_;
diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_multithread_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_multithread_acquisition.cc
deleted file mode 100644
index 9bd8f8b3e..000000000
--- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_multithread_acquisition.cc
+++ /dev/null
@@ -1,286 +0,0 @@
-/*!
- * \file gps_l1_ca_pcps_multithread_acquisition.cc
- * \brief Adapts a multithread PCPS acquisition block to an
- *  AcquisitionInterface for GPS L1 C/A signals
- * \author Marc Molina, 2013. marc.molina.pena(at)gmail.com
- *
- * -------------------------------------------------------------------------
- *
- * 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 <http://www.gnu.org/licenses/>.
- *
- * -------------------------------------------------------------------------
- */
-
-#include "gps_l1_ca_pcps_multithread_acquisition.h"
-#include <boost/math/distributions/exponential.hpp>
-#include <glog/logging.h>
-#include "gps_sdr_signal_processing.h"
-#include "GPS_L1_CA.h"
-#include "configuration_interface.h"
-
-
-using google::LogMessage;
-
-GpsL1CaPcpsMultithreadAcquisition::GpsL1CaPcpsMultithreadAcquisition(
-        ConfigurationInterface* configuration, std::string role,
-        unsigned int in_streams, unsigned int out_streams) :
-    role_(role), in_streams_(in_streams), out_streams_(out_streams)
-{
-    configuration_ = configuration;
-    std::string default_item_type = "gr_complex";
-    std::string default_dump_filename = "./data/acquisition.dat";
-
-    DLOG(INFO) << "role " << role;
-
-    item_type_ = configuration_->property(role + ".item_type",
-            default_item_type);
-
-    fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
-    if_ = configuration_->property(role + ".if", 0);
-    dump_ = configuration_->property(role + ".dump", false);
-    doppler_max_ = configuration->property(role + ".doppler_max", 5000);
-    sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1);
-
-    bit_transition_flag_ = configuration_->property("Acquisition.bit_transition_flag", false);
-
-    if (!bit_transition_flag_)
-        {
-            max_dwells_ = configuration_->property(role + ".max_dwells", 1);
-        }
-    else
-        {
-            max_dwells_ = 2;
-        }
-
-    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));
-
-    vector_length_ = code_length_ * sampled_ms_;
-
-    code_ = new gr_complex[vector_length_];
-
-    if (item_type_.compare("gr_complex") == 0)
-        {
-            item_size_ = sizeof(gr_complex);
-            acquisition_cc_ = pcps_make_multithread_acquisition_cc(sampled_ms_, max_dwells_,
-                    doppler_max_, if_, fs_in_, code_length_, code_length_,
-                    bit_transition_flag_, dump_, dump_filename_);
-
-            stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_);
-
-            DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id()
-                        << ")";
-            DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id()
-                        << ")";
-        }
-    else
-        {
-            item_size_ = sizeof(gr_complex);
-            LOG(WARNING) << item_type_ << " unknown acquisition item type";
-        }
-
-    channel_ = 0;
-    threshold_ = 0.0;
-    doppler_step_ = 0;
-    gnss_synchro_ = 0;
-}
-
-
-GpsL1CaPcpsMultithreadAcquisition::~GpsL1CaPcpsMultithreadAcquisition()
-{
-    delete[] code_;
-}
-
-
-void GpsL1CaPcpsMultithreadAcquisition::set_channel(unsigned int channel)
-{
-    channel_ = channel;
-    if (item_type_.compare("gr_complex") == 0)
-        {
-            acquisition_cc_->set_channel(channel_);
-        }
-}
-
-
-void GpsL1CaPcpsMultithreadAcquisition::set_threshold(float threshold)
-{
-    float pfa = configuration_->property(role_ + boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0);
-
-    if(pfa == 0.0)
-        {
-            pfa = configuration_->property(role_+".pfa", 0.0);
-        }
-    if(pfa == 0.0)
-        {
-            threshold_ = threshold;
-        }
-    else
-        {
-            threshold_ = calculate_threshold(pfa);
-        }
-
-    DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_;
-
-    if (item_type_.compare("gr_complex") == 0)
-        {
-            acquisition_cc_->set_threshold(threshold_);
-        }
-}
-
-
-void GpsL1CaPcpsMultithreadAcquisition::set_doppler_max(unsigned int doppler_max)
-{
-    doppler_max_ = doppler_max;
-    if (item_type_.compare("gr_complex") == 0)
-        {
-            acquisition_cc_->set_doppler_max(doppler_max_);
-        }
-}
-
-
-void GpsL1CaPcpsMultithreadAcquisition::set_doppler_step(unsigned int doppler_step)
-{
-    doppler_step_ = doppler_step;
-    if (item_type_.compare("gr_complex") == 0)
-        {
-            acquisition_cc_->set_doppler_step(doppler_step_);
-        }
-
-}
-
-
-void GpsL1CaPcpsMultithreadAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro)
-{
-    gnss_synchro_ = gnss_synchro;
-    if (item_type_.compare("gr_complex") == 0)
-        {
-            acquisition_cc_->set_gnss_synchro(gnss_synchro_);
-        }
-}
-
-
-signed int GpsL1CaPcpsMultithreadAcquisition::mag()
-{
-    if (item_type_.compare("gr_complex") == 0)
-        {
-            return acquisition_cc_->mag();
-        }
-    else
-        {
-            return 0;
-        }
-}
-
-
-void GpsL1CaPcpsMultithreadAcquisition::init()
-{
-    acquisition_cc_->init();
-    set_local_code();
-}
-
-
-void GpsL1CaPcpsMultithreadAcquisition::set_local_code()
-{
-    if (item_type_.compare("gr_complex") == 0)
-        {
-            std::complex<float>* code = new std::complex<float>[code_length_];
-
-            gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0);
-
-            for (unsigned int i = 0; i < sampled_ms_; i++)
-                {
-                    memcpy(&(code_[i*code_length_]), code,
-                            sizeof(gr_complex)*code_length_);
-                }
-
-            acquisition_cc_->set_local_code(code_);
-
-            delete[] code;
-        }
-}
-
-
-void GpsL1CaPcpsMultithreadAcquisition::reset()
-{
-    if (item_type_.compare("gr_complex") == 0)
-        {
-            acquisition_cc_->set_active(true);
-        }
-}
-
-
-float GpsL1CaPcpsMultithreadAcquisition::calculate_threshold(float pfa)
-{
-    //Calculate the threshold
-
-    unsigned int frequency_bins = 0;
-    for (int doppler = (int)(-doppler_max_); doppler <= (int)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<double>(ncells);
-    double val = pow(1.0 - pfa, exponent);
-    double lambda = double(vector_length_);
-    boost::math::exponential_distribution<double> mydist (lambda);
-    float threshold = (float)quantile(mydist,val);
-
-    return threshold;
-}
-
-
-void GpsL1CaPcpsMultithreadAcquisition::connect(gr::top_block_sptr top_block)
-{
-    if (item_type_.compare("gr_complex") == 0)
-        {
-            top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0);
-        }
-
-}
-
-
-void GpsL1CaPcpsMultithreadAcquisition::disconnect(gr::top_block_sptr top_block)
-{
-    if (item_type_.compare("gr_complex") == 0)
-        {
-            top_block->disconnect(stream_to_vector_, 0, acquisition_cc_, 0);
-        }
-}
-
-
-gr::basic_block_sptr GpsL1CaPcpsMultithreadAcquisition::get_left_block()
-{
-    return stream_to_vector_;
-}
-
-
-gr::basic_block_sptr GpsL1CaPcpsMultithreadAcquisition::get_right_block()
-{
-    return acquisition_cc_;
-}
-
diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_multithread_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_multithread_acquisition.h
deleted file mode 100644
index 8b1f1af0a..000000000
--- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_multithread_acquisition.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/*!
- * \file gps_l1_ca_pcps_multithread_acquisition.h
- * \brief Adapts a multithread PCPS acquisition block to an
- *  AcquisitionInterface for GPS L1 C/A signals
- * \author Marc Molina, 2013. marc.molina.pena(at)gmail.com
- *
- * -------------------------------------------------------------------------
- *
- * 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 <http://www.gnu.org/licenses/>.
- *
- * -------------------------------------------------------------------------
- */
-
-#ifndef GNSS_SDR_GPS_L1_CA_PCPS_MULTITHREAD_ACQUISITION_H_
-#define GNSS_SDR_GPS_L1_CA_PCPS_MULTITHREAD_ACQUISITION_H_
-
-#include <string>
-#include <gnuradio/blocks/stream_to_vector.h>
-#include "gnss_synchro.h"
-#include "acquisition_interface.h"
-#include "pcps_multithread_acquisition_cc.h"
-
-
-
-class ConfigurationInterface;
-
-/*!
- * \brief This class adapts a multithread PCPS acquisition block to an
- *  AcquisitionInterface for GPS L1 C/A signals
- */
-class GpsL1CaPcpsMultithreadAcquisition: public AcquisitionInterface
-{
-public:
-    GpsL1CaPcpsMultithreadAcquisition(ConfigurationInterface* configuration,
-            std::string role, unsigned int in_streams,
-            unsigned int out_streams);
-
-    virtual ~GpsL1CaPcpsMultithreadAcquisition();
-
-    std::string role()
-    {
-        return role_;
-    }
-
-    /*!
-     * \brief Returns "GPS_L1_CA_PCPS_Multithread_Acquisition"
-     */
-    std::string implementation()
-    {
-        return "GPS_L1_CA_PCPS_Multithread_Acquisition";
-    }
-    size_t item_size()
-    {
-        return item_size_;
-    }
-
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
-
-    /*!
-     * \brief Set acquisition/tracking common Gnss_Synchro object pointer
-     * to efficiently exchange synchronization data between acquisition and
-     *  tracking blocks
-     */
-    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
-
-    /*!
-     * \brief Set acquisition channel unique ID
-     */
-    void set_channel(unsigned int channel);
-
-    /*!
-     * \brief Set statistics threshold of PCPS algorithm
-     */
-    void set_threshold(float threshold);
-
-    /*!
-     * \brief Set maximum Doppler off grid search
-     */
-    void set_doppler_max(unsigned int doppler_max);
-
-    /*!
-     * \brief Set Doppler steps for the grid search
-     */
-    void set_doppler_step(unsigned int doppler_step);
-
-    /*!
-     * \brief Initializes acquisition algorithm.
-     */
-    void init();
-
-    /*!
-     * \brief Sets local code for GPS L1/CA PCPS acquisition algorithm.
-     */
-    void set_local_code();
-
-    /*!
-     * \brief Returns the maximum peak of grid search
-     */
-    signed int mag();
-
-    /*!
-     * \brief Restart acquisition algorithm
-     */
-    void reset();
-
-private:
-    ConfigurationInterface* configuration_;
-    pcps_multithread_acquisition_cc_sptr acquisition_cc_;
-    gr::blocks::stream_to_vector::sptr stream_to_vector_;
-    size_t item_size_;
-    std::string item_type_;
-    unsigned int vector_length_;
-    unsigned int code_length_;
-    bool bit_transition_flag_;
-    unsigned int channel_;
-    float threshold_;
-    unsigned int doppler_max_;
-    unsigned int doppler_step_;
-    unsigned int sampled_ms_;
-    unsigned int max_dwells_;
-    long fs_in_;
-    long if_;
-    bool dump_;
-    std::string dump_filename_;
-    std::complex<float> * code_;
-    Gnss_Synchro * gnss_synchro_;
-    std::string role_;
-    unsigned int in_streams_;
-    unsigned int out_streams_;
-
-    float calculate_threshold(float pfa);
-};
-
-#endif /* GNSS_SDR_GPS_L1_CA_PCPS_MULTITHREAD_ACQUISITION_H_ */
diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.cc
index ba2c6b68c..e9add0e8b 100644
--- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.cc
+++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.cc
@@ -52,7 +52,8 @@ GpsL1CaPcpsOpenClAcquisition::GpsL1CaPcpsOpenClAcquisition(
     item_type_ = configuration_->property(role + ".item_type",
             default_item_type);
 
-    fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
+    long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
+    fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
     if_ = configuration_->property(role + ".if", 0);
     dump_ = configuration_->property(role + ".dump", false);
     doppler_max_ = configuration->property(role + ".doppler_max", 5000);
@@ -194,7 +195,7 @@ signed int GpsL1CaPcpsOpenClAcquisition::mag()
 void GpsL1CaPcpsOpenClAcquisition::init()
 {
     acquisition_cc_->init();
-    set_local_code();
+    //set_local_code();
 }
 
 
@@ -233,7 +234,7 @@ float GpsL1CaPcpsOpenClAcquisition::calculate_threshold(float pfa)
     //Calculate the threshold
 
     unsigned int frequency_bins = 0;
-    for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_)
+    for (int doppler = static_cast<int>(-doppler_max_); doppler <= static_cast<int>(doppler_max_); doppler += doppler_step_)
         {
             frequency_bins++;
         }
@@ -245,7 +246,7 @@ float GpsL1CaPcpsOpenClAcquisition::calculate_threshold(float pfa)
     double val = pow(1.0 - pfa, exponent);
     double lambda = double(vector_length_);
     boost::math::exponential_distribution<double> mydist (lambda);
-    float threshold = (float)quantile(mydist,val);
+    float threshold = static_cast<float>(quantile(mydist,val));
 
     return threshold;
 }
diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.h
index 9eea40659..606926155 100644
--- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.h
+++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.h
@@ -55,7 +55,7 @@ public:
 
     virtual ~GpsL1CaPcpsOpenClAcquisition();
 
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
@@ -63,66 +63,67 @@ public:
     /*!
      * \brief Returns "GPS_L1_CA_PCPS_OpenCl_Acquisition"
      */
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "GPS_L1_CA_PCPS_OpenCl_Acquisition";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return item_size_;
     }
 
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+    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;
 
     /*!
      * \brief Set acquisition/tracking common Gnss_Synchro object pointer
      * to efficiently exchange synchronization data between acquisition and
      *  tracking blocks
      */
-    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
+    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
 
     /*!
      * \brief Set acquisition channel unique ID
      */
-    void set_channel(unsigned int channel);
+    void set_channel(unsigned int channel) override;
 
     /*!
      * \brief Set statistics threshold of PCPS algorithm
      */
-    void set_threshold(float threshold);
+    void set_threshold(float threshold) override;
 
     /*!
      * \brief Set maximum Doppler off grid search
      */
-    void set_doppler_max(unsigned int doppler_max);
+    void set_doppler_max(unsigned int doppler_max) override;
 
     /*!
      * \brief Set Doppler steps for the grid search
      */
-    void set_doppler_step(unsigned int doppler_step);
+    void set_doppler_step(unsigned int doppler_step) override;
 
     /*!
      * \brief Initializes acquisition algorithm.
      */
-    void init();
+    void init() override;
 
     /*!
      * \brief Sets local code for GPS L1/CA PCPS acquisition algorithm.
      */
-    void set_local_code();
+    void set_local_code() override;
 
     /*!
      * \brief Returns the maximum peak of grid search
      */
-    signed int mag();
+    signed int mag() override;
 
     /*!
      * \brief Restart acquisition algorithm
      */
-    void reset();
+    void reset() override;
 
 private:
     ConfigurationInterface* configuration_;
diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc
index f732b5aba..47e1ce498 100644
--- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc
+++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc
@@ -53,40 +53,39 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition(
     DLOG(INFO) << "role " << role;
 
     item_type_ = configuration_->property(role + ".item_type", default_item_type);
-    fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
+    long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
+    fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
     if_ = configuration_->property(role + ".if", 0);
     dump_ = configuration_->property(role + ".dump", false);
     doppler_max_ = configuration->property(role + ".doppler_max", 5000);
     sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4);
 
-
     //--- Find number of samples per spreading code -------------------------
     code_length_ = round(fs_in_
             / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS));
 
-
     /*Calculate the folding factor value based on the calculations*/
-    unsigned int temp = (unsigned int)ceil(sqrt(log2(code_length_)));
+    unsigned int temp = static_cast<unsigned int>(ceil(sqrt(log2(code_length_))));
     folding_factor_ = configuration_->property(role + ".folding_factor", temp);
 
     if ( sampled_ms_ % folding_factor_ != 0)
         {
             LOG(WARNING) << "QuickSync Algorithm requires a coherent_integration_time"
-                    << " multiple of " << folding_factor_ << "ms, Value entered "
-                    << sampled_ms_ << " ms";
+                         << " multiple of " << folding_factor_ << "ms, Value entered "
+                         << sampled_ms_ << " ms";
             if(sampled_ms_ < folding_factor_)
                 {
-                    sampled_ms_ = (int) folding_factor_;
+                    sampled_ms_ = static_cast<int>(folding_factor_);
                 }
             else
                 {
-                    sampled_ms_ = (int)(sampled_ms_/folding_factor_) * folding_factor_;
+                    sampled_ms_ = static_cast<int>(sampled_ms_ / folding_factor_) * folding_factor_;
                 }
 
-            LOG(WARNING) <<" Coherent_integration_time of "
-                    << sampled_ms_ << " ms will be used instead.";
-
+            LOG(WARNING) << " Coherent_integration_time of "
+                         << sampled_ms_ << " ms will be used instead.";
         }
+
     vector_length_ = code_length_ * sampled_ms_;
     bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
 
@@ -227,8 +226,7 @@ signed int GpsL1CaPcpsQuickSyncAcquisition::mag()
 void GpsL1CaPcpsQuickSyncAcquisition::init()
 {
     acquisition_cc_->init();
-    set_local_code();
-
+    //set_local_code();
 }
 
 
@@ -263,6 +261,7 @@ void GpsL1CaPcpsQuickSyncAcquisition::reset()
         }
 }
 
+
 void GpsL1CaPcpsQuickSyncAcquisition::set_state(int state)
 {
     if (item_type_.compare("gr_complex") == 0)
@@ -276,7 +275,7 @@ float GpsL1CaPcpsQuickSyncAcquisition::calculate_threshold(float pfa)
 {
     //Calculate the threshold
     unsigned int frequency_bins = 0;
-    for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_)
+    for (int doppler = static_cast<int>(-doppler_max_); doppler <= static_cast<int>(doppler_max_); doppler += doppler_step_)
         {
             frequency_bins++;
         }
@@ -298,7 +297,6 @@ void GpsL1CaPcpsQuickSyncAcquisition::connect(gr::top_block_sptr top_block)
         {
             top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0);
         }
-
 }
 
 
diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.h
index 2e32df150..a43597ee8 100644
--- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.h
+++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.h
@@ -57,7 +57,7 @@ public:
 
     virtual ~GpsL1CaPcpsQuickSyncAcquisition();
 
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
@@ -65,66 +65,67 @@ public:
     /*!
      * \brief Returns "GPS_L1_CA_PCPS_QuickSync_Acquisition"
      */
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "GPS_L1_CA_PCPS_QuickSync_Acquisition";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return item_size_;
     }
 
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+    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;
 
     /*!
      * \brief Set acquisition/tracking common Gnss_Synchro object pointer
      * to efficiently exchange synchronization data between acquisition and
      *  tracking blocks
      */
-    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
+    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
 
     /*!
      * \brief Set acquisition channel unique ID
      */
-    void set_channel(unsigned int channel);
+    void set_channel(unsigned int channel) override;
 
     /*!
      * \brief Set statistics threshold of PCPS algorithm
      */
-    void set_threshold(float threshold);
+    void set_threshold(float threshold) override;
 
     /*!
      * \brief Set maximum Doppler off grid search
      */
-    void set_doppler_max(unsigned int doppler_max);
+    void set_doppler_max(unsigned int doppler_max) override;
 
     /*!
      * \brief Set Doppler steps for the grid search
      */
-    void set_doppler_step(unsigned int doppler_step);
+    void set_doppler_step(unsigned int doppler_step) override;
 
     /*!
      * \brief Initializes acquisition algorithm.
      */
-    void init();
+    void init() override;
 
     /*!
      * \brief Sets local code for GPS L1/CA PCPS acquisition algorithm.
      */
-    void set_local_code();
+    void set_local_code() override;
 
     /*!
      * \brief Returns the maximum peak of grid search
      */
-    signed int mag();
+    signed int mag() override;
 
     /*!
      * \brief Restart acquisition algorithm
      */
-    void reset();
+    void reset() override;
 
     /*!
      * \brief If state = 1, it forces the block to start acquiring from the first sample
diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc
index e7a4bdb65..b71041c6a 100644
--- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc
+++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc
@@ -52,7 +52,8 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition(
 
     item_type_ = configuration_->property(role + ".item_type", default_item_type);
 
-    fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
+    long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
+    fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
     if_ = configuration_->property(role + ".if", 0);
     dump_ = configuration_->property(role + ".dump", false);
     doppler_max_ = configuration->property(role + ".doppler_max", 5000);
@@ -186,7 +187,7 @@ signed int GpsL1CaPcpsTongAcquisition::mag()
 void GpsL1CaPcpsTongAcquisition::init()
 {
     acquisition_cc_->init();
-    set_local_code();
+    //set_local_code();
 }
 
 void GpsL1CaPcpsTongAcquisition::set_local_code()
@@ -232,7 +233,7 @@ float GpsL1CaPcpsTongAcquisition::calculate_threshold(float pfa)
 {
     //Calculate the threshold
     unsigned int frequency_bins = 0;
-    for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_)
+    for (int doppler = static_cast<int>(-doppler_max_); doppler <= static_cast<int>(doppler_max_); doppler += doppler_step_)
         {
             frequency_bins++;
         }
@@ -244,7 +245,7 @@ float GpsL1CaPcpsTongAcquisition::calculate_threshold(float pfa)
     double val = pow(1.0 - pfa,exponent);
     double lambda = double(vector_length_);
     boost::math::exponential_distribution<double> mydist (lambda);
-    float threshold = (float)quantile(mydist, val);
+    float threshold = static_cast<float>(quantile(mydist, val));
 
     return threshold;
 }
diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.h
index a43dd3e99..957688bad 100644
--- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.h
+++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.h
@@ -54,7 +54,7 @@ public:
 
     virtual ~GpsL1CaPcpsTongAcquisition();
 
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
@@ -62,66 +62,67 @@ public:
     /*!
      * \brief Returns "GPS_L1_CA_PCPS_Tong_Acquisition"
      */
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "GPS_L1_CA_PCPS_Tong_Acquisition";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return item_size_;
     }
 
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+    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;
 
     /*!
      * \brief Set acquisition/tracking common Gnss_Synchro object pointer
      * to efficiently exchange synchronization data between acquisition and
      *  tracking blocks
      */
-    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
+    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
 
     /*!
      * \brief Set acquisition channel unique ID
      */
-    void set_channel(unsigned int channel);
+    void set_channel(unsigned int channel) override;
 
     /*!
      * \brief Set statistics threshold of TONG algorithm
      */
-    void set_threshold(float threshold);
+    void set_threshold(float threshold) override;
 
     /*!
      * \brief Set maximum Doppler off grid search
      */
-    void set_doppler_max(unsigned int doppler_max);
+    void set_doppler_max(unsigned int doppler_max) override;
 
     /*!
      * \brief Set Doppler steps for the grid search
      */
-    void set_doppler_step(unsigned int doppler_step);
+    void set_doppler_step(unsigned int doppler_step) override;
 
     /*!
      * \brief Initializes acquisition algorithm.
      */
-    void init();
+    void init() override;
 
     /*!
      * \brief Sets local code for GPS L1/CA TONG acquisition algorithm.
      */
-    void set_local_code();
+    void set_local_code() override;
 
     /*!
      * \brief Returns the maximum peak of grid search
      */
-    signed int mag();
+    signed int mag() override;
 
     /*!
      * \brief Restart acquisition algorithm
      */
-    void reset();
+    void reset() override;
 
     /*!
      * \brief If state = 1, it forces the block to start acquiring from the first sample
diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc
index baf00ff1f..b9443a4e8 100644
--- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc
+++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc
@@ -55,9 +55,11 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition(
     item_type_ = configuration_->property(role + ".item_type", default_item_type);
     //float pfa =  configuration_->property(role + ".pfa", 0.0);
 
-    fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
+    long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
+    fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
     if_ = configuration_->property(role + ".if", 0);
     dump_ = configuration_->property(role + ".dump", false);
+    blocking_ = configuration_->property(role + ".blocking", true);
     doppler_max_ = configuration->property(role + ".doppler_max", 5000);
 
     bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
@@ -85,15 +87,18 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition(
             item_size_ = sizeof(lv_16sc_t);
             acquisition_sc_ = pcps_make_acquisition_sc(1, max_dwells_,
                     doppler_max_, if_, fs_in_, code_length_, code_length_,
-                    bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, dump_filename_);
+                    bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_, dump_filename_);
             DLOG(INFO) << "acquisition(" << acquisition_sc_->unique_id() << ")";
 
-        }else{
-                item_size_ = sizeof(gr_complex);
-                acquisition_cc_ = pcps_make_acquisition_cc(1, max_dwells_,
-                        doppler_max_, if_, fs_in_, code_length_, code_length_,
-                        bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, dump_filename_);
-                DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
+        }
+    else
+        {
+            item_size_ = sizeof(gr_complex);
+            acquisition_cc_ = pcps_make_acquisition_cc(1, max_dwells_,
+                    doppler_max_, if_, fs_in_, code_length_, code_length_,
+                    bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_,
+                    dump_filename_);
+            DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
         }
 
     stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_);
@@ -233,7 +238,7 @@ void GpsL2MPcpsAcquisition::init()
             acquisition_cc_->init();
         }
 
-    set_local_code();
+    //set_local_code();
 }
 
 
@@ -251,17 +256,15 @@ void GpsL2MPcpsAcquisition::set_local_code()
             acquisition_cc_->set_local_code(code_);
         }
         
-//    //debug
-//    std::ofstream d_dump_file;
-//    std::stringstream filename;
-//    std::streamsize n = 2 * sizeof(float) * (code_length_); // complex file write
-//    filename.str("");
-//    filename << "../data/local_prn_sampled.dat";
-//    d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary);
-//    d_dump_file.write((char*)code_, n);
-//    d_dump_file.close();
-
-    //  }
+    //    //debug
+    //    std::ofstream d_dump_file;
+    //    std::stringstream filename;
+    //    std::streamsize n = 2 * sizeof(float) * (code_length_); // complex file write
+    //    filename.str("");
+    //    filename << "../data/local_prn_sampled.dat";
+    //    d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary);
+    //    d_dump_file.write(reinterpret_cast<char*>(code_), n);
+    //    d_dump_file.close();
 }
 
 
@@ -305,7 +308,7 @@ float GpsL2MPcpsAcquisition::calculate_threshold(float pfa)
     double val = pow(1.0 - pfa, exponent);
     double lambda = double(vector_length_);
     boost::math::exponential_distribution<double> mydist (lambda);
-    float threshold = (float)quantile(mydist,val);
+    float threshold = static_cast<float>(quantile(mydist,val));
 
     return threshold;
 }
diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h
index 308a1a590..544737e79 100644
--- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h
+++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h
@@ -61,7 +61,7 @@ public:
 
     virtual ~GpsL2MPcpsAcquisition();
 
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
@@ -69,66 +69,67 @@ public:
     /*!
      * \brief Returns "GPS_L2_M_PCPS_Acquisition"
      */
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "GPS_L2_M_PCPS_Acquisition";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return item_size_;
     }
 
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+    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;
 
     /*!
      * \brief Set acquisition/tracking common Gnss_Synchro object pointer
      * to efficiently exchange synchronization data between acquisition and
      *  tracking blocks
      */
-    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
+    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
 
     /*!
      * \brief Set acquisition channel unique ID
      */
-    void set_channel(unsigned int channel);
+    void set_channel(unsigned int channel) override;
 
     /*!
      * \brief Set statistics threshold of PCPS algorithm
      */
-    void set_threshold(float threshold);
+    void set_threshold(float threshold) override;
 
     /*!
      * \brief Set maximum Doppler off grid search
      */
-    void set_doppler_max(unsigned int doppler_max);
+    void set_doppler_max(unsigned int doppler_max) override;
 
     /*!
      * \brief Set Doppler steps for the grid search
      */
-    void set_doppler_step(unsigned int doppler_step);
+    void set_doppler_step(unsigned int doppler_step) override;
 
     /*!
      * \brief Initializes acquisition algorithm.
      */
-    void init();
+    void init() override;
 
     /*!
      * \brief Sets local code for GPS L2/M PCPS acquisition algorithm.
      */
-    void set_local_code();
+    void set_local_code() override;
 
     /*!
      * \brief Returns the maximum peak of grid search
      */
-    signed int mag();
+    signed int mag() override;
 
     /*!
      * \brief Restart acquisition algorithm
      */
-    void reset();
+    void reset() override;
 
     /*!
      * \brief If state = 1, it forces the block to start acquiring from the first sample
@@ -156,6 +157,7 @@ private:
     long fs_in_;
     long if_;
     bool dump_;
+    bool blocking_;
     std::string dump_filename_;
     std::complex<float> * code_;
     Gnss_Synchro * gnss_synchro_;
diff --git a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt
index 134db4b19..8a22651c4 100644
--- a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt
+++ b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt
@@ -20,7 +20,6 @@
 set(ACQ_GR_BLOCKS_SOURCES
     pcps_acquisition_cc.cc
     pcps_acquisition_sc.cc
-    pcps_multithread_acquisition_cc.cc
     pcps_assisted_acquisition_cc.cc
     pcps_acquisition_fine_doppler_cc.cc
     pcps_tong_acquisition_cc.cc
@@ -39,7 +38,7 @@ if(OPENCL_FOUND)
 endif(OPENCL_FOUND)
 
 include_directories(
-     $(CMAKE_CURRENT_SOURCE_DIR)
+     ${CMAKE_CURRENT_SOURCE_DIR}
      ${CMAKE_SOURCE_DIR}/src/core/system_parameters
      ${CMAKE_SOURCE_DIR}/src/core/interfaces
      ${CMAKE_SOURCE_DIR}/src/core/receiver
@@ -67,7 +66,11 @@ add_library(acq_gr_blocks ${ACQ_GR_BLOCKS_SOURCES} ${ACQ_GR_BLOCKS_HEADERS})
 source_group(Headers FILES ${ACQ_GR_BLOCKS_HEADERS}) 
 #target_link_libraries(acq_gr_blocks gnss_sp_libs gnss_system_parameters ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_FFT_LIBRARIES}
 #target_link_libraries(acq_gr_blocks acquisition_lib gnss_sp_libs gnss_system_parameters ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_FFT_LIBRARIES} ${VOLK_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${OPT_LIBRARIES} ${OPT_ACQUISITION_LIBRARIES})
-target_link_libraries(acq_gr_blocks gnss_sp_libs gnss_system_parameters ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_FFT_LIBRARIES} ${VOLK_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${OPT_LIBRARIES} ${OPT_ACQUISITION_LIBRARIES})
+if(ENABLE_FPGA)
+	target_link_libraries(acq_gr_blocks acquisition_lib gnss_sp_libs gnss_system_parameters ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_FFT_LIBRARIES} ${VOLK_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${OPT_LIBRARIES} ${OPT_ACQUISITION_LIBRARIES})
+else(ENABLE_FPGA)
+	target_link_libraries(acq_gr_blocks gnss_sp_libs gnss_system_parameters ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_FFT_LIBRARIES} ${VOLK_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${OPT_LIBRARIES} ${OPT_ACQUISITION_LIBRARIES})
+endif(ENABLE_FPGA)
 if(NOT VOLK_GNSSSDR_FOUND)
     add_dependencies(acq_gr_blocks volk_gnsssdr_module)
 endif(NOT VOLK_GNSSSDR_FOUND)
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 106c959ac..f20d39ff0 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
@@ -390,7 +390,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
         }
     case 1:
         {
-            const gr_complex *in = (const gr_complex *)input_items[0]; //Get the input samples pointer
+            const gr_complex *in = reinterpret_cast<const gr_complex *>(input_items[0]); //Get the input samples pointer
             unsigned int buff_increment;
             if (ninput_items[0] + d_buffer_count <= d_fft_size)
                 {
@@ -414,7 +414,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
     case 2:
         {
             // Fill last part of the buffer and reset counter
-            const gr_complex *in = (const gr_complex *)input_items[0]; //Get the input samples pointer
+            const gr_complex *in = reinterpret_cast<const gr_complex *>(input_items[0]); //Get the input samples pointer
             if (d_buffer_count < d_fft_size)
                 {
                     memcpy(&d_inbuffer[d_buffer_count], in, sizeof(gr_complex)*(d_fft_size-d_buffer_count));
@@ -628,16 +628,16 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
                                 {
                                     if (magt_IA >= magt_IB)
                                         {
-                                            d_dump_file.write((char*)d_magnitudeIA, n);
+                                            d_dump_file.write(reinterpret_cast<char*>(d_magnitudeIA), n);
                                         }
                                     else
                                         {
-                                            d_dump_file.write((char*)d_magnitudeIB, n);
+                                            d_dump_file.write(reinterpret_cast<char*>(d_magnitudeIB), n);
                                         }
                                 }
                             else
                                 {
-                                    d_dump_file.write((char*)d_magnitudeIA, n);
+                                    d_dump_file.write(reinterpret_cast<char*>(d_magnitudeIA), n);
                                 }
                             d_dump_file.close();
                         }
@@ -738,7 +738,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
                             filename.str("");
                             filename << "../data/test_statistics_E5a_sat_" << d_gnss_synchro->PRN << "_CAF.dat";
                             d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary);
-                            d_dump_file.write((char*)d_CAF_vector, n);
+                            d_dump_file.write(reinterpret_cast<char*>(d_CAF_vector), n);
                             d_dump_file.close();
                         }
                     volk_gnsssdr_free(accum);
diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.h b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.h
index d4d3b31d4..ab44e54c7 100644
--- a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.h
+++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.h
@@ -162,7 +162,7 @@ public:
       * to exchange synchronization data between acquisition and tracking blocks.
       * \param p_gnss_synchro Satellite information shared by the processing blocks.
       */
-     void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
+     inline void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
      {
          d_gnss_synchro = p_gnss_synchro;
      }
@@ -170,7 +170,7 @@ public:
      /*!
       * \brief Returns the maximum peak of grid search.
       */
-     unsigned int mag()
+     inline unsigned int mag() const
      {
          return d_mag;
      }
@@ -191,7 +191,7 @@ public:
       * active mode
       * \param active - bool that activates/deactivates the block.
       */
-     void set_active(bool active)
+     inline void set_active(bool active)
      {
          d_active = active;
      }
@@ -207,7 +207,7 @@ public:
       * \brief Set acquisition channel unique ID
       * \param channel - receiver channel.
       */
-     void set_channel(unsigned int channel)
+     inline void set_channel(unsigned int channel)
      {
          d_channel = channel;
      }
@@ -217,7 +217,7 @@ public:
       * \param threshold - Threshold for signal detection (check \ref Navitec2012,
       * Algorithm 1, for a definition of this threshold).
       */
-     void set_threshold(float threshold)
+     inline void set_threshold(float threshold)
      {
          d_threshold = threshold;
      }
@@ -226,7 +226,7 @@ public:
       * \brief Set maximum Doppler grid search
       * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz].
       */
-     void set_doppler_max(unsigned int doppler_max)
+     inline void set_doppler_max(unsigned int doppler_max)
      {
          d_doppler_max = doppler_max;
      }
@@ -235,12 +235,11 @@ public:
       * \brief Set Doppler steps for the grid search
       * \param doppler_step - Frequency bin of the search grid [Hz].
       */
-     void set_doppler_step(unsigned int doppler_step)
+     inline void set_doppler_step(unsigned int doppler_step)
      {
          d_doppler_step = doppler_step;
      }
 
-
      /*!
       * \brief Parallel Code Phase Search Acquisition signal processing.
       */
diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc
index ab2d501b9..1ccaa8fb4 100644
--- a/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc
+++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc
@@ -163,11 +163,11 @@ void galileo_pcps_8ms_acquisition_cc::init()
     // Count the number of bins
     d_num_doppler_bins = 0;
     for (int doppler = static_cast<int>(-d_doppler_max);
-         doppler <= static_cast<int>(d_doppler_max);
-         doppler += d_doppler_step)
-    {
-        d_num_doppler_bins++;
-    }
+            doppler <= static_cast<int>(d_doppler_max);
+            doppler += d_doppler_step)
+        {
+            d_num_doppler_bins++;
+        }
 
     // Create the carrier Doppler wipeoff signals
     d_grid_doppler_wipeoffs = new gr_complex*[d_num_doppler_bins];
@@ -210,7 +210,6 @@ int galileo_pcps_8ms_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)))
 {
-
     int acquisition_message = -1; //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL
 
     switch (d_state)
@@ -247,7 +246,7 @@ int galileo_pcps_8ms_acquisition_cc::general_work(int noutput_items,
             float magt = 0.0;
             float magt_A = 0.0;
             float magt_B = 0.0;
-            const gr_complex *in = (const gr_complex *)input_items[0]; //Get the input samples pointer
+            const gr_complex *in = reinterpret_cast<const gr_complex *>(input_items[0]); //Get the input samples pointer
             float fft_normalization_factor = static_cast<float>(d_fft_size) * static_cast<float>(d_fft_size);
             d_input_power = 0.0;
             d_mag = 0.0;
@@ -271,7 +270,6 @@ int galileo_pcps_8ms_acquisition_cc::general_work(int noutput_items,
             for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++)
                 {
                     // doppler search steps
-
                     doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
 
                     volk_32fc_x2_multiply_32fc(d_fft_if->get_inbuf(), in,
@@ -315,15 +313,15 @@ int galileo_pcps_8ms_acquisition_cc::general_work(int noutput_items,
 
                     // Take the greater magnitude
                     if (magt_A >= magt_B)
-                    {
-                        magt = magt_A;
-                        indext = indext_A;
-                    }
+                        {
+                            magt = magt_A;
+                            indext = indext_A;
+                        }
                     else
-                    {
-                        magt = magt_B;
-                        indext = indext_B;
-                    }
+                        {
+                            magt = magt_B;
+                            indext = indext_B;
+                        }
 
                     // 4- record the maximum peak and the associated synchronization parameters
                     if (d_mag < magt)
@@ -344,7 +342,7 @@ int galileo_pcps_8ms_acquisition_cc::general_work(int noutput_items,
                                      <<"_" << d_gnss_synchro->Signal << "_sat_"
                                      << d_gnss_synchro->PRN << "_doppler_" <<  doppler << ".dat";
                             d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary);
-                            d_dump_file.write((char*)d_ifft->get_outbuf(), n); //write directly |abs(x)|^2 in this Doppler bin?
+                            d_dump_file.write(reinterpret_cast<char*>(d_ifft->get_outbuf()), n); //write directly |abs(x)|^2 in this Doppler bin?
                             d_dump_file.close();
                         }
                 }
diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.h
index 332b91083..267a5f6cf 100644
--- a/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.h
+++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.h
@@ -116,7 +116,7 @@ public:
      * to exchange synchronization data between acquisition and tracking blocks.
      * \param p_gnss_synchro Satellite information shared by the processing blocks.
      */
-    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
+    inline void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
     {
         d_gnss_synchro = p_gnss_synchro;
     }
@@ -124,7 +124,7 @@ public:
     /*!
      * \brief Returns the maximum peak of grid search.
      */
-    unsigned int mag()
+    inline unsigned int mag() const
     {
         return d_mag;
     }
@@ -145,7 +145,7 @@ public:
      * active mode
      * \param active - bool that activates/deactivates the block.
      */
-    void set_active(bool active)
+    inline void set_active(bool active)
     {
         d_active = active;
     }
@@ -161,7 +161,7 @@ public:
      * \brief Set acquisition channel unique ID
      * \param channel - receiver channel.
      */
-    void set_channel(unsigned int channel)
+    inline void set_channel(unsigned int channel)
     {
         d_channel = channel;
     }
@@ -171,7 +171,7 @@ public:
      * \param threshold - Threshold for signal detection (check \ref Navitec2012,
      * Algorithm 1, for a definition of this threshold).
      */
-    void set_threshold(float threshold)
+    inline void set_threshold(float threshold)
     {
         d_threshold = threshold;
     }
@@ -180,7 +180,7 @@ public:
      * \brief Set maximum Doppler grid search
      * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz].
      */
-    void set_doppler_max(unsigned int doppler_max)
+    inline void set_doppler_max(unsigned int doppler_max)
     {
         d_doppler_max = doppler_max;
     }
@@ -189,7 +189,7 @@ public:
      * \brief Set Doppler steps for the grid search
      * \param doppler_step - Frequency bin of the search grid [Hz].
      */
-    void set_doppler_step(unsigned int doppler_step)
+    inline void set_doppler_step(unsigned int doppler_step)
     {
         d_doppler_step = doppler_step;
     }
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 7cb177ded..cc491f3c0 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
@@ -40,172 +40,87 @@
 #include <volk_gnsssdr/volk_gnsssdr.h>
 #include "control_message_factory.h"
 #include "GPS_L1_CA.h" //GPS_TWO_PI
-
 using google::LogMessage;
 
 void wait3(int seconds)
 {
-    boost::this_thread::sleep_for(boost::chrono::seconds{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,
-                                 bool bit_transition_flag, bool use_CFAR_algorithm_flag,
-                                 unsigned int select_queue_Fpga,
-                                 bool dump,
-                                 std::string dump_filename)
+        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, bit_transition_flag, use_CFAR_algorithm_flag, select_queue_Fpga, dump, dump_filename));
+            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,
-                         bool bit_transition_flag, bool use_CFAR_algorithm_flag,
-                         unsigned int select_queue_Fpga,
-                         bool dump,
-                         std::string dump_filename) :
 
-    gr::block("pcps_acquisition_fpga_sc",gr::io_signature::make(0, 0, sizeof(lv_16sc_t)),gr::io_signature::make(0, 0, 0))
+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::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_freq = freq;
-    d_fs_in = fs_in;
-    d_samples_per_ms = samples_per_ms;
     d_samples_per_code = samples_per_code;
-    d_sampled_ms = sampled_ms;
-    d_max_dwells = max_dwells;								// Note : d_max_dwells is not used in the FPGA implementation
+    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 = d_sampled_ms * d_samples_per_ms;
+    d_fft_size = sampled_ms * samples_per_ms;
     d_mag = 0;
-    d_input_power = 0.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_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_code_phase = 0;
-    d_test_statistics = 0.0;
     d_channel = 0;
-    d_doppler_freq = 0.0;
-
-    d_nsamples_total = vector_length;
-
-    //if( d_bit_transition_flag )
-    //    {
-    //        d_fft_size *= 2;
-    //        d_max_dwells = 1;
-    //    }
-
-    d_fft_codes = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
-    d_magnitude = static_cast<float*>(volk_gnsssdr_malloc(d_nsamples_total * sizeof(float), volk_gnsssdr_get_alignment()));
-    //temporary storage for the input conversion from 16sc to float 32fc
-    d_in_32fc = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
-
-	d_fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
-
-
-    // Direct FFT
-    d_fft_if = new gr::fft::fft_complex(d_nsamples_total, true);
-
-    // Inverse FFT
-    d_ifft = new gr::fft::fft_complex(d_nsamples_total, false);
-
-    // FPGA queue selection
-    d_select_queue_Fpga = select_queue_Fpga;
 
     // For dumping samples into a file
     d_dump = dump;
     d_dump_filename = dump_filename;
 
     d_gnss_synchro = 0;
-    d_grid_doppler_wipeoffs = 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);
 }
 
 
 gps_pcps_acquisition_fpga_sc::~gps_pcps_acquisition_fpga_sc()
 {
-    if (d_num_doppler_bins > 0)
-        {
-            for (unsigned int i = 0; i < d_num_doppler_bins; i++)
-                {
-                    volk_gnsssdr_free(d_grid_doppler_wipeoffs[i]);
-                }
-            delete[] d_grid_doppler_wipeoffs;
-        }
-
-    volk_gnsssdr_free(d_fft_codes);
-    volk_gnsssdr_free(d_magnitude);
-    volk_gnsssdr_free(d_in_32fc);
-
-    delete d_ifft;
-    delete d_fft_if;
-
     if (d_dump)
         {
             d_dump_file.close();
         }
 
-
-
-    acquisition_fpga_8sc.free();
+    acquisition_fpga_8sc->free();
 }
 
 
-void gps_pcps_acquisition_fpga_sc::set_local_code(std::complex<float> * code)
+void gps_pcps_acquisition_fpga_sc::set_local_code()
 {
-    // COD
-    // Here we want to create a buffer that looks like this:
-    // [ 0 0 0 ... 0 c_0 c_1 ... c_L]
-    // where c_i is the local code and there are L zeros and L chips
-
-
-
-
-    int offset = 0;
-//    if( d_bit_transition_flag )
-//        {
-//            std::fill_n( d_fft_if->get_inbuf(), d_nsamples_total, gr_complex( 0.0, 0.0 ) );
-//            offset = d_nsamples_total;
-//        }
-
-
-
-    memcpy(d_fft_if->get_inbuf() + offset, code, sizeof(gr_complex) * d_nsamples_total);
-    d_fft_if->execute(); // We need the FFT of local code
-    volk_32fc_conjugate_32fc(d_fft_codes_padded, d_fft_if->get_outbuf(), d_nsamples_total);
-
-    acquisition_fpga_8sc.set_local_code(d_fft_codes_padded);
-
-}
-
-
-void gps_pcps_acquisition_fpga_sc::update_local_carrier(gr_complex* carrier_vector, int correlator_length_samples, float freq)
-{
-
-    float phase_step_rad = GPS_TWO_PI * freq / static_cast<float>(d_fs_in);
-
-    float _phase[1];
-    _phase[0] = 0;
-    volk_gnsssdr_s32f_sincos_32fc(carrier_vector, - phase_step_rad, _phase, correlator_length_samples);
-
+    acquisition_fpga_8sc->set_local_code(d_gnss_synchro->PRN);
 }
 
 
@@ -215,34 +130,22 @@ void gps_pcps_acquisition_fpga_sc::init()
     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->Flag_preamble = 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 = ceil( static_cast<double>(static_cast<int>(d_doppler_max) - static_cast<int>(-d_doppler_max)) / static_cast<double>(d_doppler_step));
-
-    // Create the carrier Doppler wipeoff signals
-    d_grid_doppler_wipeoffs = new gr_complex*[d_num_doppler_bins];
-    for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++)
-        {
-            d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
-            int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
-            update_local_carrier(d_grid_doppler_wipeoffs[doppler_index], d_fft_size, d_freq + doppler);
-        }
-    acquisition_fpga_8sc.init(d_fft_size, d_nsamples_total, d_freq, d_doppler_max, d_doppler_step, d_num_doppler_bins, d_fs_in, d_select_queue_Fpga);
-
-
 
+    d_num_doppler_bins = ceil(
+            static_cast<double>(static_cast<int>(d_doppler_max)
+                    - static_cast<int>(-d_doppler_max))
+                    / static_cast<double>(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;
@@ -253,172 +156,161 @@ void gps_pcps_acquisition_fpga_sc::set_state(int state)
             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;
         }
     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;
-	acquisition_fpga_8sc.block_samples(); // block the samples to run the acquisition this is only necessary for the tests
-
+    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
 
     d_active = active;
 
+    int acquisition_message = -1; //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL
 
-//    while (d_well_count < d_max_dwells)
-//    {
-		int acquisition_message = -1; //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL
+    d_state = 1;
 
-		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<float>(d_fft_size) * static_cast<float>(d_fft_size);
 
-		// 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<float>(d_fft_size) * static_cast<float>(d_fft_size);
+    d_mag = 0.0;
 
-		d_mag = 0.0;
+    unsigned int initial_sample;
 
-		unsigned int initial_sample;
+    d_well_count++;
 
-		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;
 
-		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 frequency search loop
-		for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++)
-			{
+            doppler = -static_cast<int>(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
 
-				doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
+            acquisition_fpga_8sc->read_acquisition_results(&indext, &magt,
+                    &initial_sample, &input_power);
 
-				acquisition_fpga_8sc.set_phase_step(doppler_index);
-				acquisition_fpga_8sc.run_acquisition(); // runs acquisition and waits until it is finished
+            d_sample_counter = initial_sample;
 
-	    		acquisition_fpga_8sc.read_acquisition_results(&indext, &magt, &initial_sample, &d_input_power);
+            temp_peak_to_noise_level = static_cast<float>(magt) / static_cast<float>(input_power);
+            if (peak_to_noise_level < temp_peak_to_noise_level)
+                {
+                    peak_to_noise_level = temp_peak_to_noise_level;
+                    d_mag = magt;
 
-	    		d_sample_counter = initial_sample;
+                    input_power = (input_power - d_mag)
+                            / (effective_fft_size - 1);
 
-		        temp_peak_to_noise_level = (float) (magt / d_input_power);
-		        if (peak_to_noise_level < temp_peak_to_noise_level) 
-					{
-		        	peak_to_noise_level = temp_peak_to_noise_level;
-						d_mag = magt;
+                    d_gnss_synchro->Acq_delay_samples =
+                            static_cast<double>(indext % d_samples_per_code);
+                    d_gnss_synchro->Acq_doppler_hz =
+                            static_cast<double>(doppler);
+                    d_gnss_synchro->Acq_samplestamp_samples = d_sample_counter;
+                    test_statistics = d_mag / input_power;
+                }
 
-                        d_input_power = (d_input_power - d_mag) / (effective_fft_size - 1);
+            // 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("");
 
-						//if (d_test_statistics < (d_mag / d_input_power) || !d_bit_transition_flag)
-						//	{
-								d_gnss_synchro->Acq_delay_samples = static_cast<double>(indext % d_samples_per_code);
-								d_gnss_synchro->Acq_doppler_hz = static_cast<double>(doppler);
-								d_gnss_synchro->Acq_samplestamp_samples = d_sample_counter;
-	                            d_test_statistics = d_mag / d_input_power;
-						//	}
-					}
+                    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();
 
-				// 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("");
+                    DLOG(INFO) << "Writing ACQ out to " << 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();
+                    d_dump_file.open(filename.str().c_str(),
+                            std::ios::out | std::ios::binary);
+                    d_dump_file.close();
+                }
+        }
 
-						DLOG(INFO) << "Writing ACQ out to " << filename.str();
+    if (test_statistics > d_threshold)
+        {
+            d_state = 2; // Positive acquisition
 
-						d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary);
-						d_dump_file.write((char*)d_ifft->get_outbuf(), n); //write directly |abs(x)|^2 in this Doppler bin?
-						d_dump_file.close();
-					}
-			}
+            // 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;
 
-			if (d_test_statistics > d_threshold)
-				{
-					d_state = 2; // Positive acquisition
+            acquisition_message = 1;
+            this->message_port_pub(pmt::mp("events"),
+                    pmt::from_long(acquisition_message));
+        }
+    else
+        {
+            d_state = 3; // Negative 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 " << d_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 " << d_input_power;
+            // 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;
+            d_active = false;
+            d_state = 0;
 
-					acquisition_message = 1;
-					this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message));
+            acquisition_message = 2;
+            this->message_port_pub(pmt::mp("events"),
+                    pmt::from_long(acquisition_message));
+        }
 
-//					break;
+    acquisition_fpga_8sc->unblock_samples();
 
-				}
-			else //if (d_well_count == d_max_dwells)
-				{
-					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 " << d_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 " << d_input_power;
-
-					d_active = false;
-					d_state = 0;
-
-					acquisition_message = 2;
-					this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message));
-
-//					break;
-				}
-
-//    }
-
-    acquisition_fpga_8sc.unblock_samples();
+    acquisition_fpga_8sc->close_device();
 
     DLOG(INFO) << "Done. Consumed 1 item.";
-
 }
 
 
@@ -426,6 +318,6 @@ 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_void_star &output_items __attribute__((unused)))
 {
-	// general work not used with the acquisition
+    // 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
index a3b4c1b64..561609109 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
@@ -15,7 +15,7 @@
  *
  * 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", Birkha user, 2007. pp 81-84
+ * Approach", Birkhauser, 2007. pp 81-84
  *
  * \authors <ul>
  *          <li> Marc Majoral, 2017. mmajoral(at)cttc.cat
@@ -62,13 +62,13 @@ class gps_pcps_acquisition_fpga_sc;
 typedef boost::shared_ptr<gps_pcps_acquisition_fpga_sc> 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_,
-                         bool bit_transition_flag, bool use_CFAR_algorithm_flag,
-                         unsigned int select_queue_Fpga,
-                         bool dump,
-                         std::string dump_filename);
+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.
@@ -76,163 +76,139 @@ gps_pcps_make_acquisition_fpga_sc(unsigned int sampled_ms, unsigned int max_dwel
  * 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
+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,
+    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,
-            bool dump,
+            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,
+    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,
-            bool dump,
+            unsigned int select_queue_Fpga, std::string device_name, bool dump,
             std::string dump_filename);
 
-    void update_local_carrier(gr_complex* carrier_vector,
-            int correlator_length_samples,
-            float freq);
-
-    long d_fs_in;
-    long d_freq;
-    int d_samples_per_ms;
     int d_samples_per_code;
     float d_threshold;
-    std::string d_satellite_str;
     unsigned int d_doppler_max;
     unsigned int d_doppler_step;
-    unsigned int d_sampled_ms;
     unsigned int d_max_dwells;
     unsigned int d_well_count;
     unsigned int d_fft_size;
-    unsigned int d_nsamples_total;			// the closest power of two approximation to d_fft_size
     unsigned long int d_sample_counter;
-    gr_complex** d_grid_doppler_wipeoffs;
     unsigned int d_num_doppler_bins;
-    gr_complex* d_fft_codes;
-    gr_complex* d_fft_codes_padded;
-    gr_complex* d_in_32fc;
-    gr::fft::fft_complex* d_fft_if;
-    gr::fft::fft_complex* d_ifft;
+
     Gnss_Synchro *d_gnss_synchro;
-    unsigned int d_code_phase;
-    float d_doppler_freq;
-    float d_mag;
-    float* d_magnitude;
-    float d_input_power;
-    float d_test_statistics;
-    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;
+    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;
-    unsigned int d_select_queue_Fpga;
     std::string d_dump_filename;
 
-    gps_fpga_acquisition_8sc acquisition_fpga_8sc;
+    std::shared_ptr<gps_fpga_acquisition_8sc> acquisition_fpga_8sc;
 
 public:
     /*!
      * \brief Default destructor.
      */
-     ~gps_pcps_acquisition_fpga_sc();
+    ~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.
-      */
-     void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
-     {
-         d_gnss_synchro = p_gnss_synchro;
-     }
+    /*!
+     * \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.
-      */
-     unsigned int mag()
-     {
-         return d_mag;
-     }
+    /*!
+     * \brief Returns the maximum peak of grid search.
+     */
+    inline unsigned int mag() const
+    {
+        return d_mag;
+    }
 
-     /*!
-      * \brief Initializes acquisition algorithm.
-      */
-     void init();
+    /*!
+     * \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(std::complex<float> * code);
+    /*!
+     * \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 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 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.
-      */
-     void set_channel(unsigned int channel)
-     {
-         d_channel = channel;
-     }
+    /*!
+     * \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).
-      */
-     void set_threshold(float threshold)
-     {
-         d_threshold = threshold;
-     }
+    /*!
+     * \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].
-      */
-     void set_doppler_max(unsigned int doppler_max)
-     {
-         d_doppler_max = doppler_max;
-     }
+    /*!
+     * \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].
-      */
-     void set_doppler_step(unsigned int doppler_step)
-     {
-         d_doppler_step = doppler_step;
-     }
+    /*!
+     * \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);
+    /*!
+     * \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);
 
 };
 
diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.cc
index 449433328..a0461f9c5 100644
--- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.cc
+++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.cc
@@ -5,11 +5,12 @@
  *          <li> Javier Arribas, 2011. jarribas(at)cttc.es
  *          <li> Luis Esteve, 2012. luis(at)epsilon-formacion.com
  *          <li> Marc Molina, 2013. marc.molina.pena@gmail.com
+ *          <li> Cillian O'Driscoll, 2017. cillian(at)ieee.org
  *          </ul>
  *
  * -------------------------------------------------------------------------
  *
- * Copyright (C) 2010-2015  (see AUTHORS file for a list of contributors)
+ * Copyright (C) 2010-2017  (see AUTHORS file for a list of contributors)
  *
  * GNSS-SDR is a software defined Global Navigation
  *          Satellite Systems receiver
@@ -50,12 +51,12 @@ pcps_acquisition_cc_sptr pcps_make_acquisition_cc(
                                  unsigned int doppler_max, long freq, long fs_in,
                                  int samples_per_ms, int samples_per_code,
                                  bool bit_transition_flag, bool use_CFAR_algorithm_flag,
-                                 bool dump,
+                                 bool dump, bool blocking,
                                  std::string dump_filename)
 {
     return pcps_acquisition_cc_sptr(
             new pcps_acquisition_cc(sampled_ms, max_dwells, doppler_max, freq, fs_in, samples_per_ms,
-                    samples_per_code, bit_transition_flag, use_CFAR_algorithm_flag, dump, dump_filename));
+                    samples_per_code, bit_transition_flag, use_CFAR_algorithm_flag, dump, blocking, dump_filename));
 }
 
 
@@ -64,7 +65,7 @@ pcps_acquisition_cc::pcps_acquisition_cc(
                          unsigned int doppler_max, long freq, long fs_in,
                          int samples_per_ms, int samples_per_code,
                          bool bit_transition_flag, bool use_CFAR_algorithm_flag,
-                         bool dump,
+                         bool dump, bool blocking,
                          std::string dump_filename) :
     gr::block("pcps_acquisition_cc",
     gr::io_signature::make(1, 1, sizeof(gr_complex) * sampled_ms * samples_per_ms * ( bit_transition_flag ? 2 : 1 )),
@@ -129,6 +130,12 @@ pcps_acquisition_cc::pcps_acquisition_cc(
 
     d_gnss_synchro = 0;
     d_grid_doppler_wipeoffs = 0;
+
+    d_done = false;
+    d_blocking = blocking;
+    d_new_data_available = false;
+    d_worker_active = false;
+    d_data_buffer = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
 }
 
 
@@ -153,6 +160,20 @@ pcps_acquisition_cc::~pcps_acquisition_cc()
         {
             d_dump_file.close();
         }
+
+    // Let the worker thread know that we are done and then wait to join
+    if( d_worker_thread.joinable() )
+        {
+            {
+                std::lock_guard<std::mutex> lk( d_mutex );
+                d_done = true;
+                d_cond.notify_one();
+            }
+
+            d_worker_thread.join();
+        }
+
+    volk_gnsssdr_free( d_data_buffer );
 }
 
 
@@ -165,7 +186,7 @@ void pcps_acquisition_cc::set_local_code(std::complex<float> * code)
     gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler
     if( d_bit_transition_flag )
         {
-            int offset = d_fft_size/2;
+            int offset = d_fft_size / 2;
             std::fill_n( d_fft_if->get_inbuf(), offset, gr_complex( 0.0, 0.0 ) );
             memcpy(d_fft_if->get_inbuf() + offset, code, sizeof(gr_complex) * offset);
         } 
@@ -173,7 +194,7 @@ void pcps_acquisition_cc::set_local_code(std::complex<float> * code)
         {
             memcpy(d_fft_if->get_inbuf(), code, sizeof(gr_complex) * d_fft_size);
         }
-    
+
     d_fft_if->execute(); // We need the FFT of local code
     volk_32fc_conjugate_32fc(d_fft_codes, d_fft_if->get_outbuf(), d_fft_size);
 }
@@ -212,6 +233,10 @@ void pcps_acquisition_cc::init()
             int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
             update_local_carrier(d_grid_doppler_wipeoffs[doppler_index], d_fft_size, d_freq + doppler);
         }
+
+    d_new_data_available = false;
+    d_done = false;
+    d_worker_active = false;
 }
 
 
@@ -243,37 +268,37 @@ void pcps_acquisition_cc::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;
+               << ", 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_cc::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;
+               << ", 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));
-
 }
 
+
 int pcps_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)))
@@ -314,11 +339,72 @@ int pcps_acquisition_cc::general_work(int noutput_items,
 
     case 1:
         {
+            std::unique_lock<std::mutex> lk( d_mutex );
+
+            int num_items_consumed = 1;
+
+            if( d_worker_active )
+                {
+                    if( d_blocking )
+                        {
+                            // Should never get here:
+                            std::string msg = "pcps_acquisition_cc: Entered general work with worker active in blocking mode, should never happen";
+                            LOG(WARNING) << msg;
+                            std::cout << msg << std::endl;
+                            d_cond.wait( lk, [&]{ return !this->d_worker_active; } );
+                        }
+                    else
+                        {
+                            num_items_consumed = ninput_items[0];
+                            d_sample_counter += d_fft_size * num_items_consumed;
+                        }
+                }
+            else
+                {
+                    // Copy the data to the core and let it know that new data is available
+                    memcpy( d_data_buffer, input_items[0], d_fft_size * sizeof( gr_complex ) );
+                    d_new_data_available = true;
+                    d_cond.notify_one();
+
+                    if( d_blocking )
+                        {
+                            d_cond.wait( lk, [&]{ return !this->d_new_data_available; } );
+
+                        }
+                }
+
+            consume_each(num_items_consumed);
+
+            break;
+        } // case 1, switch d_state
+
+    } // switch d_state
+
+    return noutput_items;
+}
+
+
+void pcps_acquisition_cc::acquisition_core( void )
+{
+    d_worker_active = false;
+    while( 1 )
+        {
+            std::unique_lock<std::mutex> lk( d_mutex );
+            d_cond.wait( lk, [&]{ return this->d_new_data_available or this->d_done; } );
+            d_worker_active = !d_done;
+            unsigned long int sample_counter = d_sample_counter; // sample counter
+            lk.unlock();
+
+            if( d_done )
+                {
+                    break;
+                }
+
             // initialize acquisition algorithm
             int doppler;
             uint32_t indext = 0;
             float magt = 0.0;
-            const gr_complex *in = (const gr_complex *)input_items[0]; //Get the input samples pointer
+            const gr_complex *in = d_data_buffer; //Get the input samples pointer
 
             int effective_fft_size = ( d_bit_transition_flag ? d_fft_size/2 : d_fft_size );
 
@@ -326,14 +412,14 @@ int pcps_acquisition_cc::general_work(int noutput_items,
 
             d_input_power = 0.0;
             d_mag = 0.0;
-            d_sample_counter += d_fft_size; // sample counter
             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: " << d_doppler_max
-                    << ", doppler_step: " << d_doppler_step<<std::endl;
+            DLOG(INFO) << "Channel: " << d_channel
+                       << " , doing acquisition of satellite: " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN
+                       << " ,sample stamp: " << sample_counter << ", threshold: "
+                       << d_threshold << ", doppler_max: " << d_doppler_max
+                       << ", doppler_step: " << d_doppler_step
+                       << ", use_CFAR_algorithm_flag: " << ( d_use_CFAR_algorithm_flag ? "true" : "false" );
 
             if (d_use_CFAR_algorithm_flag == true)
                 {
@@ -398,7 +484,7 @@ int pcps_acquisition_cc::general_work(int noutput_items,
                                 {
                                     d_gnss_synchro->Acq_delay_samples = static_cast<double>(indext % d_samples_per_code);
                                     d_gnss_synchro->Acq_doppler_hz = static_cast<double>(doppler);
-                                    d_gnss_synchro->Acq_samplestamp_samples = d_sample_counter;
+                                    d_gnss_synchro->Acq_samplestamp_samples = sample_counter;
 
                                     // 5- Compute the test statistics and compare to the threshold
                                     //d_test_statistics = 2 * d_fft_size * d_mag / d_input_power;
@@ -415,18 +501,18 @@ int pcps_acquisition_cc::general_work(int noutput_items,
 
                             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();
+                            << 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.write((char*)d_ifft->get_outbuf(), n); //write directly |abs(x)|^2 in this Doppler bin?
+                            d_dump_file.write(reinterpret_cast<char*>(d_ifft->get_outbuf()), n); //write directly |abs(x)|^2 in this Doppler bin?
                             d_dump_file.close();
                         }
                 }
@@ -465,26 +551,40 @@ int pcps_acquisition_cc::general_work(int noutput_items,
                         }
                 }
 
-            consume_each(1);
-            break;
+            lk.lock();
+            d_worker_active = false;
+            d_new_data_available = false;
+            lk.unlock();
+            d_cond.notify_one();
         }
-
-    }
-
-    return noutput_items;
 }
 
 
-//void pcps_acquisition_cc::forecast (int noutput_items, gr_vector_int &ninput_items_required)
-//{
-    //// COD:
-    //// For zero-padded case we need one extra code period
-    //if( d_bit_transition_flag )
-    //{
-        //ninput_items_required[0] = noutput_items*(d_samples_per_code * d_max_dwells + d_samples_per_code);
-    //}
-    //else
-    //{
-        //ninput_items_required[0] = noutput_items*d_fft_size*d_max_dwells;
-    //}
-//}
+bool pcps_acquisition_cc::start( void )
+{
+    d_worker_active = false;
+    d_done = false;
+
+    // Start the worker thread and wait for it to acknowledge:
+    d_worker_thread = std::move( std::thread( &pcps_acquisition_cc::acquisition_core, this ) );
+
+    return gr::block::start();
+}
+
+
+bool pcps_acquisition_cc::stop( void )
+{
+    // Let the worker thread know that we are done and then wait to join
+    if( d_worker_thread.joinable() )
+        {
+            {
+                std::lock_guard<std::mutex> lk( d_mutex );
+                d_done = true;
+                d_cond.notify_one();
+            }
+
+            d_worker_thread.join();
+        }
+    return gr::block::stop();
+}
+
diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.h
index 00a602fc4..486468379 100644
--- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.h
+++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.h
@@ -14,17 +14,18 @@
  *
  * 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", Birkha user, 2007. pp 81-84
+ * Approach", Birkhauser, 2007. pp 81-84
  *
  * \authors <ul>
  *          <li> Javier Arribas, 2011. jarribas(at)cttc.es
  *          <li> Luis Esteve, 2012. luis(at)epsilon-formacion.com
  *          <li> Marc Molina, 2013. marc.molina.pena@gmail.com
+ *          <li> Cillian O'Driscoll, 2017. cillian(at)ieee.org
  *          </ul>
  *
  * -------------------------------------------------------------------------
  *
- * Copyright (C) 2010-2015  (see AUTHORS file for a list of contributors)
+ * Copyright (C) 2010-2017  (see AUTHORS file for a list of contributors)
  *
  * GNSS-SDR is a software defined Global Navigation
  *          Satellite Systems receiver
@@ -52,6 +53,9 @@
 
 #include <fstream>
 #include <string>
+#include <mutex>
+#include <thread>
+#include <condition_variable>
 #include <gnuradio/block.h>
 #include <gnuradio/gr_complex.h>
 #include <gnuradio/fft/fft.h>
@@ -66,7 +70,7 @@ pcps_make_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,
                          bool bit_transition_flag, bool use_CFAR_algorithm_flag,
-                         bool dump,
+                         bool dump, bool blocking,
                          std::string dump_filename);
 
 /*!
@@ -83,18 +87,20 @@ private:
             unsigned int doppler_max, long freq, long fs_in,
             int samples_per_ms, int samples_per_code,
             bool bit_transition_flag, bool use_CFAR_algorithm_flag,
-            bool dump,
+            bool dump, bool blocking,
             std::string dump_filename);
 
     pcps_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,
             bool bit_transition_flag, bool use_CFAR_algorithm_flag,
-            bool dump,
+            bool dump, bool blocking, 
             std::string dump_filename);
 
     void update_local_carrier(gr_complex* carrier_vector, int correlator_length_samples, float freq);
 
+    void acquisition_core( void );
+
     void send_negative_acquisition();
     void send_positive_acquisition();
     long d_fs_in;
@@ -132,6 +138,17 @@ private:
     unsigned int d_channel;
     std::string d_dump_filename;
 
+    std::thread d_worker_thread;
+    std::mutex  d_mutex;
+
+    std::condition_variable d_cond;
+    bool d_done;
+    bool d_new_data_available;
+    bool d_worker_active;
+    bool d_blocking;
+
+    gr_complex *d_data_buffer;
+
 public:
     /*!
      * \brief Default destructor.
@@ -143,7 +160,7 @@ public:
       * to exchange synchronization data between acquisition and tracking blocks.
       * \param p_gnss_synchro Satellite information shared by the processing blocks.
       */
-     void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
+     inline void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
      {
          gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler
          d_gnss_synchro = p_gnss_synchro;
@@ -152,7 +169,7 @@ public:
      /*!
       * \brief Returns the maximum peak of grid search.
       */
-     unsigned int mag()
+     inline unsigned int mag() const
      {
          return d_mag;
      }
@@ -173,7 +190,7 @@ public:
       * active mode
       * \param active - bool that activates/deactivates the block.
       */
-     void set_active(bool active)
+     inline void set_active(bool active)
      {
          gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler
          d_active = active;
@@ -190,7 +207,7 @@ public:
       * \brief Set acquisition channel unique ID
       * \param channel - receiver channel.
       */
-     void set_channel(unsigned int channel)
+     inline void set_channel(unsigned int channel)
      {
          gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler
          d_channel = channel;
@@ -201,7 +218,7 @@ public:
       * \param threshold - Threshold for signal detection (check \ref Navitec2012,
       * Algorithm 1, for a definition of this threshold).
       */
-     void set_threshold(float threshold)
+     inline void set_threshold(float threshold)
      {
          gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler
          d_threshold = threshold;
@@ -211,7 +228,7 @@ public:
       * \brief Set maximum Doppler grid search
       * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz].
       */
-     void set_doppler_max(unsigned int doppler_max)
+     inline void set_doppler_max(unsigned int doppler_max)
      {
          gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler
          d_doppler_max = doppler_max;
@@ -221,7 +238,7 @@ public:
       * \brief Set Doppler steps for the grid search
       * \param doppler_step - Frequency bin of the search grid [Hz].
       */
-     void set_doppler_step(unsigned int doppler_step)
+     inline void set_doppler_step(unsigned int doppler_step)
      {
          gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler
          d_doppler_step = doppler_step;
@@ -233,6 +250,16 @@ public:
      int general_work(int noutput_items, gr_vector_int &ninput_items,
              gr_vector_const_void_star &input_items,
              gr_vector_void_star &output_items);
+
+     /*!
+      * Called by the flowgraph when processing is about to start.
+      */
+     bool start( void );
+
+     /*!
+      * Called by the flowgraph when processing is done.
+      */
+     bool stop( void );
 };
 
 #endif /* GNSS_SDR_PCPS_ACQUISITION_CC_H_*/
diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc
index d61d89f66..0aa8f1410 100644
--- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc
+++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc
@@ -56,7 +56,6 @@ pcps_acquisition_fine_doppler_cc_sptr pcps_make_acquisition_fine_doppler_cc(
 }
 
 
-
 pcps_acquisition_fine_doppler_cc::pcps_acquisition_fine_doppler_cc(
         int max_dwells, unsigned int sampled_ms, int doppler_max, int doppler_min, long freq,
         long fs_in, int samples_per_ms, bool dump,
@@ -108,6 +107,7 @@ pcps_acquisition_fine_doppler_cc::pcps_acquisition_fine_doppler_cc(
     d_channel = 0;
 }
 
+
 void pcps_acquisition_fine_doppler_cc::set_doppler_step(unsigned int doppler_step)
 {
     d_doppler_step = doppler_step;
@@ -123,6 +123,7 @@ void pcps_acquisition_fine_doppler_cc::set_doppler_step(unsigned int doppler_ste
     update_carrier_wipeoff();
 }
 
+
 void pcps_acquisition_fine_doppler_cc::free_grid_memory()
 {
     for (int i = 0; i < d_num_doppler_points; i++)
@@ -134,6 +135,7 @@ void pcps_acquisition_fine_doppler_cc::free_grid_memory()
     delete d_grid_doppler_wipeoffs;
 }
 
+
 pcps_acquisition_fine_doppler_cc::~pcps_acquisition_fine_doppler_cc()
 {
     volk_gnsssdr_free(d_carrier);
@@ -149,16 +151,15 @@ pcps_acquisition_fine_doppler_cc::~pcps_acquisition_fine_doppler_cc()
 }
 
 
-
 void pcps_acquisition_fine_doppler_cc::set_local_code(std::complex<float> * code)
 {
-
     memcpy(d_fft_if->get_inbuf(), code, sizeof(gr_complex) * d_fft_size);
     d_fft_if->execute(); // We need the FFT of local code
     //Conjugate the local code
     volk_32fc_conjugate_32fc(d_fft_codes, d_fft_if->get_outbuf(), d_fft_size);
 }
 
+
 void pcps_acquisition_fine_doppler_cc::init()
 {
     d_gnss_synchro->Flag_valid_acquisition = false;
@@ -171,9 +172,9 @@ void pcps_acquisition_fine_doppler_cc::init()
     d_gnss_synchro->Acq_samplestamp_samples = 0;
     d_input_power = 0.0;
     d_state = 0;
-
 }
 
+
 void pcps_acquisition_fine_doppler_cc::forecast (int noutput_items,
         gr_vector_int &ninput_items_required)
 {
@@ -216,6 +217,7 @@ void pcps_acquisition_fine_doppler_cc::update_carrier_wipeoff()
         }
 }
 
+
 double pcps_acquisition_fine_doppler_cc::search_maximum()
 {
     float magt = 0.0;
@@ -259,16 +261,17 @@ double pcps_acquisition_fine_doppler_cc::search_maximum()
                     << d_gnss_synchro->PRN << "_doppler_" <<  d_gnss_synchro->Acq_doppler_hz << ".dat";
             d_dump_file.open(filename.str().c_str(), std::ios::out
                     | std::ios::binary);
-            d_dump_file.write((char*)d_grid_data[index_doppler], n); //write directly |abs(x)|^2 in this Doppler bin?
+            d_dump_file.write(reinterpret_cast<char*>(d_grid_data[index_doppler]), n); //write directly |abs(x)|^2 in this Doppler bin?
             d_dump_file.close();
         }
 
     return d_test_statistics;
 }
 
+
 float pcps_acquisition_fine_doppler_cc::estimate_input_power(gr_vector_const_void_star &input_items)
 {
-    const gr_complex *in = (const gr_complex *)input_items[0]; //Get the input samples pointer
+    const gr_complex *in = reinterpret_cast<const gr_complex *>(input_items[0]); //Get the input samples pointer
     // Compute the input signal power estimation
     float power = 0;
     volk_32fc_magnitude_squared_32f(d_magnitude, in, d_fft_size);
@@ -277,10 +280,11 @@ float pcps_acquisition_fine_doppler_cc::estimate_input_power(gr_vector_const_voi
     return power;
 }
 
+
 int pcps_acquisition_fine_doppler_cc::compute_and_accumulate_grid(gr_vector_const_void_star &input_items)
 {
     // initialize acquisition algorithm
-    const gr_complex *in = (const gr_complex *)input_items[0]; //Get the input samples pointer
+    const gr_complex *in = reinterpret_cast<const gr_complex *>(input_items[0]); //Get the input samples pointer
 
     DLOG(INFO) << "Channel: " << d_channel
             << " , doing acquisition of satellite: " << d_gnss_synchro->System << " "<< d_gnss_synchro->PRN
@@ -288,8 +292,6 @@ int pcps_acquisition_fine_doppler_cc::compute_and_accumulate_grid(gr_vector_cons
             << d_threshold << ", doppler_max: " << d_config_doppler_max
             << ", doppler_step: " << d_doppler_step;
 
-
-
     // 2- Doppler frequency search loop
     float* p_tmp_vector = static_cast<float*>(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment()));
 
@@ -314,16 +316,15 @@ int pcps_acquisition_fine_doppler_cc::compute_and_accumulate_grid(gr_vector_cons
             volk_32fc_magnitude_squared_32f(p_tmp_vector, d_ifft->get_outbuf(), d_fft_size);
             const float*  old_vector = d_grid_data[doppler_index];
             volk_32f_x2_add_32f(d_grid_data[doppler_index], old_vector, p_tmp_vector, d_fft_size);
-
         }
 
     volk_gnsssdr_free(p_tmp_vector);
     return d_fft_size;
 }
 
+
 int pcps_acquisition_fine_doppler_cc::estimate_Doppler(gr_vector_const_void_star &input_items)
 {
-
     // Direct FFT
     int zero_padding_factor = 2;
     int fft_size_extended = d_fft_size * zero_padding_factor;
@@ -346,7 +347,7 @@ int pcps_acquisition_fine_doppler_cc::estimate_Doppler(gr_vector_const_void_star
         }
 
     //2. Perform code wipe-off
-    const gr_complex *in = (const gr_complex *)input_items[0]; //Get the input samples pointer
+    const gr_complex *in = reinterpret_cast<const gr_complex *>(input_items[0]); //Get the input samples pointer
 
     volk_32fc_x2_multiply_32fc(fft_operator->get_inbuf(), in, code_replica, d_fft_size);
 
@@ -367,7 +368,7 @@ int pcps_acquisition_fine_doppler_cc::estimate_Doppler(gr_vector_const_void_star
     float fftFreqBins[fft_size_extended];
     memset(fftFreqBins, 0, fft_size_extended * sizeof(float));
 
-    for (int k=0; k < (fft_size_extended / 2); k++)
+    for (int k = 0; k < (fft_size_extended / 2); k++)
         {
             fftFreqBins[counter] = ((static_cast<float>(d_fs_in) / 2.0) * static_cast<float>(k)) / (static_cast<float>(fft_size_extended) / 2.0);
             counter++;
@@ -399,14 +400,14 @@ int pcps_acquisition_fine_doppler_cc::estimate_Doppler(gr_vector_const_void_star
             //        filename << "../data/code_prn_" << d_gnss_synchro->PRN << ".dat";
             //        d_dump_file.open(filename.str().c_str(), std::ios::out
             //                | std::ios::binary);
-            //        d_dump_file.write((char*)code_replica, n); //write directly |abs(x)|^2 in this Doppler bin?
+            //        d_dump_file.write(reinterpret_cast<char*>(code_replica), n); //write directly |abs(x)|^2 in this Doppler bin?
             //        d_dump_file.close();
             //
             //        filename.str("");
             //        filename << "../data/signal_prn_" << d_gnss_synchro->PRN << ".dat";
             //        d_dump_file.open(filename.str().c_str(), std::ios::out
             //                | std::ios::binary);
-            //        d_dump_file.write((char*)in, n); //write directly |abs(x)|^2 in this Doppler bin?
+            //        d_dump_file.write(reinterpret_cast<char*>(in), n); //write directly |abs(x)|^2 in this Doppler bin?
             //        d_dump_file.close();
             //
             //
@@ -415,11 +416,10 @@ int pcps_acquisition_fine_doppler_cc::estimate_Doppler(gr_vector_const_void_star
             //        filename << "../data/fft_prn_" << d_gnss_synchro->PRN << ".dat";
             //        d_dump_file.open(filename.str().c_str(), std::ios::out
             //                | std::ios::binary);
-            //        d_dump_file.write((char*)p_tmp_vector, n); //write directly |abs(x)|^2 in this Doppler bin?
+            //        d_dump_file.write(reinterpret_cast<char*>(p_tmp_vector), n); //write directly |abs(x)|^2 in this Doppler bin?
             //        d_dump_file.close();
         }
 
-
     // free memory!!
     delete fft_operator;
     volk_gnsssdr_free(code_replica);
@@ -432,7 +432,6 @@ int pcps_acquisition_fine_doppler_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 __attribute__((unused)))
 {
-
     /*!
      * TODO:     High sensitivity acquisition algorithm:
      *             State Mechine:
@@ -479,9 +478,6 @@ int pcps_acquisition_fine_doppler_cc::general_work(int noutput_items,
                 d_state = 5; //negative acquisition
             }
         break;
-
-
-
     case 3: // Fine doppler estimation
         //DLOG(INFO) <<"S3"<<std::endl;
         DLOG(INFO) << "Performing fine Doppler estimation";
diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h
index f5dbe6061..cd3d75e5f 100644
--- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h
+++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h
@@ -14,7 +14,7 @@
  *
  * 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", Birkha user, 2007. pp 81-84
+ * Approach", Birkhauser, 2007. pp 81-84
  *
  * \authors <ul>
  *          <li> Javier Arribas, 2013. jarribas(at)cttc.es
@@ -147,7 +147,7 @@ public:
      * to exchange synchronization data between acquisition and tracking blocks.
      * \param p_gnss_synchro Satellite information shared by the processing blocks.
      */
-    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
+    inline void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
     {
         d_gnss_synchro = p_gnss_synchro;
     }
@@ -155,7 +155,7 @@ public:
     /*!
      * \brief Returns the maximum peak of grid search.
      */
-    unsigned int mag()
+    inline unsigned int mag() const
     {
         return d_test_statistics;
     }
@@ -176,7 +176,7 @@ public:
      * active mode
      * \param active - bool that activates/deactivates the block.
      */
-    void set_active(bool active)
+    inline void set_active(bool active)
     {
         d_active = active;
     }
@@ -185,7 +185,7 @@ public:
      * \brief Set acquisition channel unique ID
      * \param channel - receiver channel.
      */
-    void set_channel(unsigned int channel)
+    inline void set_channel(unsigned int channel)
     {
         d_channel = channel;
     }
@@ -195,7 +195,7 @@ public:
      * \param threshold - Threshold for signal detection (check \ref Navitec2012,
      * Algorithm 1, for a definition of this threshold).
      */
-    void set_threshold(float threshold)
+    inline void set_threshold(float threshold)
     {
         d_threshold = threshold;
     }
@@ -204,7 +204,7 @@ public:
      * \brief Set maximum Doppler grid search
      * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz].
      */
-    void set_doppler_max(unsigned int doppler_max)
+    inline void set_doppler_max(unsigned int doppler_max)
     {
         d_config_doppler_max = doppler_max;
     }
@@ -215,7 +215,6 @@ public:
      */
     void set_doppler_step(unsigned int doppler_step);
 
-
     /*!
      * \brief Parallel Code Phase Search Acquisition signal processing.
      */
@@ -224,7 +223,6 @@ public:
             gr_vector_void_star &output_items);
 
     void forecast (int noutput_items, gr_vector_int &ninput_items_required);
-
 };
 
 #endif /* pcps_acquisition_fine_doppler_cc*/
diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_sc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_sc.cc
index 92466e159..3946493ff 100644
--- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_sc.cc
+++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_sc.cc
@@ -5,11 +5,12 @@
  *          <li> Javier Arribas, 2011. jarribas(at)cttc.es
  *          <li> Luis Esteve, 2012. luis(at)epsilon-formacion.com
  *          <li> Marc Molina, 2013. marc.molina.pena@gmail.com
+ *          <li> Cillian O'Driscoll, 2017. cillian(at)ieee.org
  *          </ul>
  *
  * -------------------------------------------------------------------------
  *
- * Copyright (C) 2010-2015  (see AUTHORS file for a list of contributors)
+ * Copyright (C) 2010-2017  (see AUTHORS file for a list of contributors)
  *
  * GNSS-SDR is a software defined Global Navigation
  *          Satellite Systems receiver
@@ -32,16 +33,17 @@
  * -------------------------------------------------------------------------
  */
 
+
 #include "pcps_acquisition_sc.h"
 #include <sstream>
 #include <boost/filesystem.hpp>
 #include <gnuradio/io_signature.h>
 #include <glog/logging.h>
 #include <volk/volk.h>
-#include <volk_gnsssdr/volk_gnsssdr.h>
 #include "control_message_factory.h"
 #include "GPS_L1_CA.h" //GPS_TWO_PI
 
+
 using google::LogMessage;
 
 pcps_acquisition_sc_sptr pcps_make_acquisition_sc(
@@ -49,27 +51,28 @@ pcps_acquisition_sc_sptr pcps_make_acquisition_sc(
                                  unsigned int doppler_max, long freq, long fs_in,
                                  int samples_per_ms, int samples_per_code,
                                  bool bit_transition_flag, bool use_CFAR_algorithm_flag,
-                                 bool dump,
+                                 bool dump, bool blocking,
                                  std::string dump_filename)
 {
-
     return pcps_acquisition_sc_sptr(
             new pcps_acquisition_sc(sampled_ms, max_dwells, doppler_max, freq, fs_in, samples_per_ms,
-                                     samples_per_code, bit_transition_flag, use_CFAR_algorithm_flag, dump, dump_filename));
+                    samples_per_code, bit_transition_flag, use_CFAR_algorithm_flag, dump, blocking, dump_filename));
 }
 
+
 pcps_acquisition_sc::pcps_acquisition_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,
                          bool bit_transition_flag, bool use_CFAR_algorithm_flag,
-                         bool dump,
+                         bool dump, bool blocking,
                          std::string dump_filename) :
     gr::block("pcps_acquisition_sc",
     gr::io_signature::make(1, 1, sizeof(lv_16sc_t) * sampled_ms * samples_per_ms * ( bit_transition_flag ? 2 : 1 )),
-    gr::io_signature::make(0, 0, 0))
+    gr::io_signature::make(0, 0, sizeof(lv_16sc_t) * sampled_ms * samples_per_ms * ( bit_transition_flag ? 2 : 1 )) )
 {
     this->message_port_register_out(pmt::mp("events"));
+
     d_sample_counter = 0;    // SAMPLE COUNTER
     d_active = false;
     d_state = 0;
@@ -88,7 +91,7 @@ pcps_acquisition_sc::pcps_acquisition_sc(
     d_bit_transition_flag = bit_transition_flag;
     d_use_CFAR_algorithm_flag = use_CFAR_algorithm_flag;
     d_threshold = 0.0;
-    d_doppler_step = 250;
+    d_doppler_step = 0;
     d_code_phase = 0;
     d_test_statistics = 0.0;
     d_channel = 0;
@@ -109,11 +112,12 @@ pcps_acquisition_sc::pcps_acquisition_sc(
     if( d_bit_transition_flag )
         {
             d_fft_size *= 2;
-            d_max_dwells = 1;
+            d_max_dwells = 1; //Activation of d_bit_transition_flag invalidates the value of d_max_dwells
         }
 
     d_fft_codes = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
     d_magnitude = static_cast<float*>(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment()));
+
     //temporary storage for the input conversion from 16sc to float 32fc
     d_in_32fc = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
 
@@ -129,6 +133,12 @@ pcps_acquisition_sc::pcps_acquisition_sc(
 
     d_gnss_synchro = 0;
     d_grid_doppler_wipeoffs = 0;
+
+    d_done = false;
+    d_blocking = blocking;
+    d_new_data_available = false;
+    d_worker_active = false;
+    d_data_buffer = static_cast<lv_16sc_t*>(volk_gnsssdr_malloc(d_fft_size * sizeof(lv_16sc_t), volk_gnsssdr_get_alignment()));
 }
 
 
@@ -154,6 +164,20 @@ pcps_acquisition_sc::~pcps_acquisition_sc()
         {
             d_dump_file.close();
         }
+
+    // Let the worker thread know that we are done and then wait to join
+    if( d_worker_thread.joinable() )
+        {
+            {
+                std::lock_guard<std::mutex> lk( d_mutex );
+                d_done = true;
+                d_cond.notify_one();
+            }
+
+            d_worker_thread.join();
+        }
+
+    volk_gnsssdr_free( d_data_buffer );
 }
 
 
@@ -163,13 +187,18 @@ void pcps_acquisition_sc::set_local_code(std::complex<float> * code)
     // Here we want to create a buffer that looks like this:
     // [ 0 0 0 ... 0 c_0 c_1 ... c_L]
     // where c_i is the local code and there are L zeros and L chips
-    int offset = 0;
+    gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler
     if( d_bit_transition_flag )
         {
-            std::fill_n( d_fft_if->get_inbuf(), d_samples_per_code, gr_complex( 0.0, 0.0 ) );
-            offset = d_samples_per_code;
+            int offset = d_fft_size / 2;
+            std::fill_n( d_fft_if->get_inbuf(), offset, gr_complex( 0.0, 0.0 ) );
+            memcpy(d_fft_if->get_inbuf() + offset, code, sizeof(gr_complex) * offset);
         }
-    memcpy(d_fft_if->get_inbuf() + offset, code, sizeof(gr_complex) * d_samples_per_code);
+    else
+        {
+            memcpy(d_fft_if->get_inbuf(), code, sizeof(gr_complex) * d_fft_size);
+        }
+
     d_fft_if->execute(); // We need the FFT of local code
     volk_32fc_conjugate_32fc(d_fft_codes, d_fft_if->get_outbuf(), d_fft_size);
 }
@@ -208,12 +237,16 @@ void pcps_acquisition_sc::init()
             int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
             update_local_carrier(d_grid_doppler_wipeoffs[doppler_index], d_fft_size, d_freq + doppler);
         }
-}
 
+    d_new_data_available = false;
+    d_done = false;
+    d_worker_active = false;
+}
 
 
 void pcps_acquisition_sc::set_state(int state)
 {
+    gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler
     d_state = state;
     if (d_state == 1)
         {
@@ -233,6 +266,43 @@ void pcps_acquisition_sc::set_state(int state)
         }
 }
 
+
+void pcps_acquisition_sc::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_sc::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));
+}
+
+
 int pcps_acquisition_sc::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)))
@@ -248,8 +318,6 @@ int pcps_acquisition_sc::general_work(int noutput_items,
      * 6. Declare positive or negative acquisition using a message port
      */
 
-    int acquisition_message = -1; //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL
-
     switch (d_state)
     {
     case 0:
@@ -264,42 +332,101 @@ int pcps_acquisition_sc::general_work(int noutput_items,
                     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]);
 
-            //DLOG(INFO) << "Consumed " << ninput_items[0] << " items";
-
             break;
         }
 
     case 1:
         {
+            std::unique_lock<std::mutex> lk( d_mutex );
+
+            int num_items_consumed = 1;
+
+            if( d_worker_active )
+                {
+                    if( d_blocking )
+                        {
+                            // Should never get here:
+                            std::string msg = "pcps_acquisition_sc: Entered general work with worker active in blocking mode, should never happen";
+                            LOG(WARNING) << msg;
+                            std::cout << msg << std::endl;
+                            d_cond.wait( lk, [&]{ return !this->d_worker_active; } );
+                        }
+                    else
+                        {
+                            num_items_consumed = ninput_items[0];
+                            d_sample_counter += d_fft_size * num_items_consumed;
+                        }
+                }
+            else
+                {
+                    // Copy the data to the core and let it know that new data is available
+                    memcpy( d_data_buffer, input_items[0], d_fft_size * sizeof( lv_16sc_t ) );
+                    d_new_data_available = true;
+                    d_cond.notify_one();
+
+                    if( d_blocking )
+                        {
+                            d_cond.wait( lk, [&]{ return !this->d_new_data_available; } );
+
+                        }
+                }
+
+            consume_each(num_items_consumed);
+
+            break;
+        } // case 1, switch d_state
+
+    } // switch d_state
+
+    return noutput_items;
+}
+
+
+void pcps_acquisition_sc::acquisition_core( void )
+{
+    d_worker_active = false;
+    while( 1 )
+        {
+            std::unique_lock<std::mutex> lk( d_mutex );
+            d_cond.wait( lk, [&]{ return this->d_new_data_available or this->d_done; } );
+            d_worker_active = !d_done;
+            unsigned long int sample_counter = d_sample_counter; // sample counter
+            lk.unlock();
+
+            if( d_done )
+                {
+                    break;
+                }
+
             // initialize acquisition algorithm
             int doppler;
             uint32_t indext = 0;
             float magt = 0.0;
-            const lv_16sc_t *in = (const lv_16sc_t *)input_items[0]; //Get the input samples pointer
+            const lv_16sc_t *in = d_data_buffer; //Get the input samples pointer
+
             int effective_fft_size = ( d_bit_transition_flag ? d_fft_size/2 : d_fft_size );
 
             //TODO: optimize the signal processing chain to not use gr_complex. This is a temporary solution
-            volk_gnsssdr_16ic_convert_32fc(d_in_32fc,in,effective_fft_size);
+            volk_gnsssdr_16ic_convert_32fc(d_in_32fc, in, effective_fft_size);
 
             float fft_normalization_factor = static_cast<float>(d_fft_size) * static_cast<float>(d_fft_size);
 
+            d_input_power = 0.0;
             d_mag = 0.0;
-
-            d_sample_counter += d_fft_size; // sample counter
             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: "
+                       << " , doing acquisition of satellite: " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN
+                       << " ,sample stamp: " << sample_counter << ", threshold: "
                        << d_threshold << ", doppler_max: " << d_doppler_max
-                       << ", doppler_step: " << d_doppler_step;
+                       << ", doppler_step: " << d_doppler_step
+                       << ", use_CFAR_algorithm_flag: " << ( d_use_CFAR_algorithm_flag ? "true" : "false" );
 
             if (d_use_CFAR_algorithm_flag == true)
                 {
@@ -312,7 +439,6 @@ int pcps_acquisition_sc::general_work(int noutput_items,
             for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++)
                 {
                     // doppler search steps
-
                     doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
 
                     volk_32fc_x2_multiply_32fc(d_fft_if->get_inbuf(), d_in_32fc,
@@ -341,7 +467,6 @@ int pcps_acquisition_sc::general_work(int noutput_items,
                             // Normalize the maximum value to correct the scale factor introduced by FFTW
                             magt = d_magnitude[indext] / (fft_normalization_factor * fft_normalization_factor);
                         }
-
                     // 4- record the maximum peak and the associated synchronization parameters
                     if (d_mag < magt)
                         {
@@ -366,12 +491,11 @@ int pcps_acquisition_sc::general_work(int noutput_items,
                                 {
                                     d_gnss_synchro->Acq_delay_samples = static_cast<double>(indext % d_samples_per_code);
                                     d_gnss_synchro->Acq_doppler_hz = static_cast<double>(doppler);
-                                    d_gnss_synchro->Acq_samplestamp_samples = d_sample_counter;
+                                    d_gnss_synchro->Acq_samplestamp_samples = sample_counter;
 
                                     // 5- Compute the test statistics and compare to the threshold
+                                    //d_test_statistics = 2 * d_fft_size * d_mag / d_input_power;
                                     d_test_statistics = d_mag / d_input_power;
-                                    //std::cout<<"d_input_power="<<d_input_power<<" d_test_statistics="<<d_test_statistics<<" d_gnss_synchro->Acq_doppler_hz ="<<d_gnss_synchro->Acq_doppler_hz <<std::endl;
-
                                 }
                         }
 
@@ -384,18 +508,18 @@ int pcps_acquisition_sc::general_work(int noutput_items,
 
                             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();
+                            << 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.write((char*)d_ifft->get_outbuf(), n); //write directly |abs(x)|^2 in this Doppler bin?
+                            d_dump_file.write(reinterpret_cast<char*>(d_ifft->get_outbuf()), n); //write directly |abs(x)|^2 in this Doppler bin?
                             d_dump_file.close();
                         }
                 }
@@ -404,11 +528,15 @@ int pcps_acquisition_sc::general_work(int noutput_items,
                 {
                     if (d_test_statistics > d_threshold)
                         {
-                            d_state = 2; // Positive acquisition
+                            d_state = 0; // Positive acquisition
+                            d_active = false;
+                            send_positive_acquisition();
                         }
                     else if (d_well_count == d_max_dwells)
                         {
-                            d_state = 3; // Negative acquisition
+                            d_state = 0;
+                            d_active = false;
+                            send_negative_acquisition();
                         }
                 }
             else
@@ -417,71 +545,53 @@ int pcps_acquisition_sc::general_work(int noutput_items,
                         {
                             if (d_test_statistics > d_threshold)
                                 {
-                                    d_state = 2; // Positive acquisition
+                                    d_state = 0; // Positive acquisition
+                                    d_active = false;
+                                    send_positive_acquisition();
                                 }
                             else
                                 {
-                                    d_state = 3; // Negative acquisition
+                                    d_state = 0; // Negative acquisition
+                                    d_active = false;
+                                    send_negative_acquisition();
                                 }
                         }
                 }
 
-            consume_each(1);
-
-            DLOG(INFO) << "Done. Consumed 1 item.";
-
-            break;
+            lk.lock();
+            d_worker_active = false;
+            d_new_data_available = false;
+            lk.unlock();
+            d_cond.notify_one();
         }
-
-    case 2:
-        {
-            // 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 " << d_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 " << d_input_power;
-
-            d_active = false;
-            d_state = 0;
-
-            d_sample_counter += d_fft_size * ninput_items[0]; // sample counter
-            consume_each(ninput_items[0]);
-
-            acquisition_message = 1;
-            this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message));
-
-            break;
-        }
-
-    case 3:
-        {
-            // 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 " << d_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 " << d_input_power;
-
-            d_active = false;
-            d_state = 0;
-
-            d_sample_counter += d_fft_size * ninput_items[0]; // sample counter
-            consume_each(ninput_items[0]);
-            acquisition_message = 2;
-            this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message));
-
-            break;
-        }
-    }
-
-    return noutput_items;
 }
+
+
+bool pcps_acquisition_sc::start( void )
+{
+    d_worker_active = false;
+    d_done = false;
+
+    // Start the worker thread and wait for it to acknowledge:
+    d_worker_thread = std::move( std::thread( &pcps_acquisition_sc::acquisition_core, this ) );
+
+    return gr::block::start();
+}
+
+
+bool pcps_acquisition_sc::stop( void )
+{
+    // Let the worker thread know that we are done and then wait to join
+    if( d_worker_thread.joinable() )
+        {
+            {
+                std::lock_guard<std::mutex> lk( d_mutex );
+                d_done = true;
+                d_cond.notify_one();
+            }
+
+            d_worker_thread.join();
+        }
+    return gr::block::stop();
+}
+
diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_sc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_sc.h
index bc13941f3..7474b910b 100644
--- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_sc.h
+++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_sc.h
@@ -14,17 +14,18 @@
  *
  * 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", Birkha user, 2007. pp 81-84
+ * Approach", Birkhauser, 2007. pp 81-84
  *
  * \authors <ul>
  *          <li> Javier Arribas, 2011. jarribas(at)cttc.es
  *          <li> Luis Esteve, 2012. luis(at)epsilon-formacion.com
  *          <li> Marc Molina, 2013. marc.molina.pena@gmail.com
+ *          <li> Cillian O'Driscoll, 2017. cillian(at)ieee.org
  *          </ul>
  *
  * -------------------------------------------------------------------------
  *
- * Copyright (C) 2010-2015  (see AUTHORS file for a list of contributors)
+ * Copyright (C) 2010-2017  (see AUTHORS file for a list of contributors)
  *
  * GNSS-SDR is a software defined Global Navigation
  *          Satellite Systems receiver
@@ -52,11 +53,16 @@
 
 #include <fstream>
 #include <string>
+#include <mutex>
+#include <thread>
+#include <condition_variable>
 #include <gnuradio/block.h>
 #include <gnuradio/gr_complex.h>
 #include <gnuradio/fft/fft.h>
+#include <volk_gnsssdr/volk_gnsssdr.h>
 #include "gnss_synchro.h"
 
+
 class pcps_acquisition_sc;
 
 typedef boost::shared_ptr<pcps_acquisition_sc> pcps_acquisition_sc_sptr;
@@ -66,7 +72,7 @@ pcps_make_acquisition_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,
                          bool bit_transition_flag, bool use_CFAR_algorithm_flag,
-                         bool dump,
+                         bool dump, bool blocking,
                          std::string dump_filename);
 
 /*!
@@ -83,20 +89,22 @@ private:
             unsigned int doppler_max, long freq, long fs_in,
             int samples_per_ms, int samples_per_code,
             bool bit_transition_flag, bool use_CFAR_algorithm_flag,
-            bool dump,
+            bool dump, bool blocking,
             std::string dump_filename);
 
     pcps_acquisition_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,
             bool bit_transition_flag, bool use_CFAR_algorithm_flag,
-            bool dump,
+            bool dump, bool blocking,
             std::string dump_filename);
 
-    void update_local_carrier(gr_complex* carrier_vector,
-            int correlator_length_samples,
-            float freq);
+    void update_local_carrier(gr_complex* carrier_vector, int correlator_length_samples, float freq);
 
+    void acquisition_core( void );
+
+    void send_negative_acquisition();
+    void send_positive_acquisition();
     long d_fs_in;
     long d_freq;
     int d_samples_per_ms;
@@ -133,6 +141,17 @@ private:
     unsigned int d_channel;
     std::string d_dump_filename;
 
+    std::thread d_worker_thread;
+    std::mutex  d_mutex;
+
+    std::condition_variable d_cond;
+    bool d_done;
+    bool d_new_data_available;
+    bool d_worker_active;
+    bool d_blocking;
+
+    lv_16sc_t *d_data_buffer;
+
 public:
     /*!
      * \brief Default destructor.
@@ -144,15 +163,16 @@ public:
       * to exchange synchronization data between acquisition and tracking blocks.
       * \param p_gnss_synchro Satellite information shared by the processing blocks.
       */
-     void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
+     inline void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
      {
+         gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler
          d_gnss_synchro = p_gnss_synchro;
      }
 
      /*!
       * \brief Returns the maximum peak of grid search.
       */
-     unsigned int mag()
+     inline unsigned int mag() const
      {
          return d_mag;
      }
@@ -173,8 +193,9 @@ public:
       * active mode
       * \param active - bool that activates/deactivates the block.
       */
-     void set_active(bool active)
+     inline void set_active(bool active)
      {
+         gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler
          d_active = active;
      }
 
@@ -189,8 +210,9 @@ public:
       * \brief Set acquisition channel unique ID
       * \param channel - receiver channel.
       */
-     void set_channel(unsigned int channel)
+     inline void set_channel(unsigned int channel)
      {
+         gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler
          d_channel = channel;
      }
 
@@ -199,8 +221,9 @@ public:
       * \param threshold - Threshold for signal detection (check \ref Navitec2012,
       * Algorithm 1, for a definition of this threshold).
       */
-     void set_threshold(float threshold)
+     inline void set_threshold(float threshold)
      {
+         gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler
          d_threshold = threshold;
      }
 
@@ -208,8 +231,9 @@ public:
       * \brief Set maximum Doppler grid search
       * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz].
       */
-     void set_doppler_max(unsigned int doppler_max)
+     inline void set_doppler_max(unsigned int doppler_max)
      {
+         gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler
          d_doppler_max = doppler_max;
      }
 
@@ -217,18 +241,28 @@ public:
       * \brief Set Doppler steps for the grid search
       * \param doppler_step - Frequency bin of the search grid [Hz].
       */
-     void set_doppler_step(unsigned int doppler_step)
+     inline void set_doppler_step(unsigned int doppler_step)
      {
+         gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler
          d_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);
+
+     /*!
+      * Called by the flowgraph when processing is about to start.
+      */
+     bool start( void );
+
+     /*!
+      * Called by the flowgraph when processing is done.
+      */
+     bool stop( void );
 };
 
 #endif /* GNSS_SDR_PCPS_ACQUISITION_SC_H_*/
diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc
index cb671a2dd..f730a3d30 100644
--- a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc
+++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc
@@ -303,7 +303,7 @@ double pcps_assisted_acquisition_cc::search_maximum()
                      << "_" << d_gnss_synchro->Signal << "_sat_"
                      << d_gnss_synchro->PRN << "_doppler_" <<  d_gnss_synchro->Acq_doppler_hz << ".dat";
             d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary);
-            d_dump_file.write((char*)d_grid_data[index_doppler], n); //write directly |abs(x)|^2 in this Doppler bin?
+            d_dump_file.write(reinterpret_cast<char*>(d_grid_data[index_doppler]), n); //write directly |abs(x)|^2 in this Doppler bin?
             d_dump_file.close();
         }
 
@@ -314,7 +314,7 @@ double pcps_assisted_acquisition_cc::search_maximum()
 
 float pcps_assisted_acquisition_cc::estimate_input_power(gr_vector_const_void_star &input_items)
 {
-    const gr_complex *in = (const gr_complex *)input_items[0]; //Get the input samples pointer
+    const gr_complex *in = reinterpret_cast<const gr_complex *>(input_items[0]); //Get the input samples pointer
     // 1- Compute the input signal power estimation
     float* p_tmp_vector = static_cast<float*>(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment()));
 
@@ -332,7 +332,7 @@ float pcps_assisted_acquisition_cc::estimate_input_power(gr_vector_const_void_st
 int pcps_assisted_acquisition_cc::compute_and_accumulate_grid(gr_vector_const_void_star &input_items)
 {
     // initialize acquisition algorithm
-    const gr_complex *in = (const gr_complex *)input_items[0]; //Get the input samples pointer
+    const gr_complex *in = reinterpret_cast<const gr_complex *>(input_items[0]); //Get the input samples pointer
 
     DLOG(INFO) << "Channel: " << d_channel
                << " , doing acquisition of satellite: " << d_gnss_synchro->System << " "
diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.h
index d090c04e6..58409b753 100644
--- a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.h
+++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.h
@@ -14,7 +14,7 @@
  *
  * 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", Birkha user, 2007. pp 81-84
+ * Approach", Birkhauser, 2007. pp 81-84
  *
  * \authors <ul>
  *          <li> Javier Arribas, 2013. jarribas(at)cttc.es
@@ -148,7 +148,7 @@ public:
      * to exchange synchronization data between acquisition and tracking blocks.
      * \param p_gnss_synchro Satellite information shared by the processing blocks.
      */
-    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
+    inline void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
     {
         d_gnss_synchro = p_gnss_synchro;
     }
@@ -156,7 +156,7 @@ public:
     /*!
      * \brief Returns the maximum peak of grid search.
      */
-    unsigned int mag()
+    inline unsigned int mag() const
     {
         return d_test_statistics;
     }
@@ -177,7 +177,7 @@ public:
      * active mode
      * \param active - bool that activates/deactivates the block.
      */
-    void set_active(bool active)
+    inline void set_active(bool active)
     {
         d_active = active;
     }
@@ -186,7 +186,7 @@ public:
      * \brief Set acquisition channel unique ID
      * \param channel - receiver channel.
      */
-    void set_channel(unsigned int channel)
+    inline void set_channel(unsigned int channel)
     {
         d_channel = channel;
     }
@@ -196,7 +196,7 @@ public:
      * \param threshold - Threshold for signal detection (check \ref Navitec2012,
      * Algorithm 1, for a definition of this threshold).
      */
-    void set_threshold(float threshold)
+    inline void set_threshold(float threshold)
     {
         d_threshold = threshold;
     }
@@ -205,7 +205,7 @@ public:
      * \brief Set maximum Doppler grid search
      * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz].
      */
-    void set_doppler_max(unsigned int doppler_max)
+    inline void set_doppler_max(unsigned int doppler_max)
     {
         d_doppler_max = doppler_max;
     }
@@ -216,7 +216,6 @@ public:
      */
     void set_doppler_step(unsigned int doppler_step);
 
-
     /*!
      * \brief Parallel Code Phase Search Acquisition signal processing.
      */
diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc
index 4b9a775ee..08327a647 100644
--- a/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc
+++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc
@@ -260,7 +260,7 @@ int pcps_cccwsr_acquisition_cc::general_work(int noutput_items,
             float magt = 0.0;
             float magt_plus = 0.0;
             float magt_minus = 0.0;
-            const gr_complex *in = (const gr_complex *)input_items[0]; //Get the input samples pointer
+            const gr_complex *in = reinterpret_cast<const gr_complex *>(input_items[0]); //Get the input samples pointer
             float fft_normalization_factor = static_cast<float>(d_fft_size) * static_cast<float>(d_fft_size);
 
             d_sample_counter += d_fft_size; // sample counter
@@ -367,7 +367,7 @@ int pcps_cccwsr_acquisition_cc::general_work(int noutput_items,
                                      <<"_" << d_gnss_synchro->Signal << "_sat_"
                                      << d_gnss_synchro->PRN << "_doppler_" <<  doppler << ".dat";
                             d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary);
-                            d_dump_file.write((char*)d_ifft->get_outbuf(), n); //write directly |abs(x)|^2 in this Doppler bin?
+                            d_dump_file.write(reinterpret_cast<char*>(d_ifft->get_outbuf()), n); //write directly |abs(x)|^2 in this Doppler bin?
                             d_dump_file.close();
                         }
                 }
diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.h
index cc34f1abd..dad25665b 100644
--- a/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.h
+++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.h
@@ -125,7 +125,7 @@ public:
      * to exchange synchronization data between acquisition and tracking blocks.
      * \param p_gnss_synchro Satellite information shared by the processing blocks.
      */
-     void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
+     inline void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
      {
          d_gnss_synchro = p_gnss_synchro;
      }
@@ -133,7 +133,7 @@ public:
      /*!
       * \brief Returns the maximum peak of grid search.
       */
-     unsigned int mag()
+     inline unsigned int mag() const
      {
          return d_mag;
      }
@@ -155,7 +155,7 @@ public:
       * active mode
       * \param active - bool that activates/deactivates the block.
       */
-     void set_active(bool active)
+     inline void set_active(bool active)
      {
          d_active = active;
      }
@@ -171,7 +171,7 @@ public:
       * \brief Set acquisition channel unique ID
       * \param channel - receiver channel.
       */
-     void set_channel(unsigned int channel)
+     inline void set_channel(unsigned int channel)
      {
          d_channel = channel;
      }
@@ -181,7 +181,7 @@ public:
       * \param threshold - Threshold for signal detection (check \ref Navitec2012,
       * Algorithm 1, for a definition of this threshold).
       */
-     void set_threshold(float threshold)
+     inline void set_threshold(float threshold)
      {
          d_threshold = threshold;
      }
@@ -190,7 +190,7 @@ public:
       * \brief Set maximum Doppler grid search
       * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz].
       */
-     void set_doppler_max(unsigned int doppler_max)
+     inline void set_doppler_max(unsigned int doppler_max)
      {
          d_doppler_max = doppler_max;
      }
@@ -199,7 +199,7 @@ public:
       * \brief Set Doppler steps for the grid search
       * \param doppler_step - Frequency bin of the search grid [Hz].
       */
-     void set_doppler_step(unsigned int doppler_step)
+     inline void set_doppler_step(unsigned int doppler_step)
      {
          d_doppler_step = doppler_step;
      }
diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_multithread_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_multithread_acquisition_cc.cc
deleted file mode 100644
index a4f03815b..000000000
--- a/src/algorithms/acquisition/gnuradio_blocks/pcps_multithread_acquisition_cc.cc
+++ /dev/null
@@ -1,478 +0,0 @@
-/*!
- * \file pcps_multithread_acquisition_cc.cc
- * \brief This class implements a Parallel Code Phase Search Acquisition
- * \authors <ul>
- *          <li> Javier Arribas, 2011. jarribas(at)cttc.es
- *          <li> Luis Esteve, 2012. luis(at)epsilon-formacion.com
- *          <li> Marc Molina, 2013. marc.molina.pena@gmail.com
- *          </ul>
- *
- * -------------------------------------------------------------------------
- *
- * 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 <http://www.gnu.org/licenses/>.
- *
- * -------------------------------------------------------------------------
- */
-
-#include "pcps_multithread_acquisition_cc.h"
-#include <sstream>
-#include <boost/thread/mutex.hpp>
-#include <boost/thread/thread.hpp>
-#include <glog/logging.h>
-#include <gnuradio/io_signature.h>
-#include <volk/volk.h>
-#include <volk_gnsssdr/volk_gnsssdr.h>
-#include "control_message_factory.h"
-#include "GPS_L1_CA.h" //GPS_TWO_PI
-
-using google::LogMessage;
-
-pcps_multithread_acquisition_cc_sptr pcps_make_multithread_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,
-                                 bool bit_transition_flag,
-                                 bool dump,
-                                 std::string dump_filename)
-{
-
-    return pcps_multithread_acquisition_cc_sptr(
-            new pcps_multithread_acquisition_cc(sampled_ms, max_dwells, doppler_max, freq, fs_in, samples_per_ms,
-                                     samples_per_code, bit_transition_flag, dump, dump_filename));
-}
-
-pcps_multithread_acquisition_cc::pcps_multithread_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,
-                         bool bit_transition_flag,
-                         bool dump,
-                         std::string dump_filename) :
-    gr::block("pcps_multithread_acquisition_cc",
-    gr::io_signature::make(1, 1, sizeof(gr_complex) * sampled_ms * samples_per_ms),
-    gr::io_signature::make(0, 0, sizeof(gr_complex) * sampled_ms * samples_per_ms))
-{
-    this->message_port_register_out(pmt::mp("events"));
-    d_sample_counter = 0;    // SAMPLE COUNTER
-    d_active = false;
-    d_state = 0;
-    d_core_working = false;
-    d_freq = freq;
-    d_fs_in = fs_in;
-    d_samples_per_ms = samples_per_ms;
-    d_samples_per_code = samples_per_code;
-    d_sampled_ms = sampled_ms;
-    d_max_dwells = max_dwells;
-    d_well_count = 0;
-    d_doppler_max = doppler_max;
-    d_fft_size = d_sampled_ms * d_samples_per_ms;
-    d_mag = 0;
-    d_input_power = 0.0;
-    d_num_doppler_bins = 0;
-    d_bit_transition_flag = bit_transition_flag;
-    d_in_dwell_count = 0;
-
-    d_in_buffer = new gr_complex*[d_max_dwells];
-
-    //todo: do something if posix_memalign fails
-    for (unsigned int i = 0; i < d_max_dwells; i++)
-        {
-            d_in_buffer[i] = static_cast<gr_complex*>(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()));
-        }
-    d_fft_codes = static_cast<gr_complex*>(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()));
-    d_magnitude = static_cast<float*>(volk_malloc(d_fft_size * sizeof(float), volk_get_alignment()));
-
-    // Direct FFT
-    d_fft_if = new gr::fft::fft_complex(d_fft_size, true);
-
-    // Inverse FFT
-    d_ifft = new gr::fft::fft_complex(d_fft_size, false);
-
-    // For dumping samples into a file
-    d_dump = dump;
-    d_dump_filename = dump_filename;
-
-    d_doppler_resolution = 0;
-    d_threshold = 0;
-    d_doppler_step = 0;
-    d_grid_doppler_wipeoffs = 0;
-    d_gnss_synchro = 0;
-    d_code_phase = 0;
-    d_doppler_freq = 0;
-    d_test_statistics = 0;
-    d_channel = 0;
-}
-
-pcps_multithread_acquisition_cc::~pcps_multithread_acquisition_cc()
-{
-    if (d_num_doppler_bins > 0)
-        {
-            for (unsigned int i = 0; i < d_num_doppler_bins; i++)
-                {
-                    volk_free(d_grid_doppler_wipeoffs[i]);
-                }
-            delete[] d_grid_doppler_wipeoffs;
-        }
-
-    for (unsigned int i = 0; i < d_max_dwells; i++)
-        {
-            volk_free(d_in_buffer[i]);
-        }
-    delete[] d_in_buffer;
-
-    volk_free(d_fft_codes);
-    volk_free(d_magnitude);
-
-    delete d_ifft;
-    delete d_fft_if;
-
-    if (d_dump)
-        {
-            d_dump_file.close();
-        }
-}
-
-void pcps_multithread_acquisition_cc::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;
-
-    // Count the number of bins
-    d_num_doppler_bins = 0;
-    for (int doppler = (int)(-d_doppler_max);
-         doppler <= (int)d_doppler_max;
-         doppler += d_doppler_step)
-    {
-        d_num_doppler_bins++;
-    }
-
-    // Create the carrier Doppler wipeoff signals
-    d_grid_doppler_wipeoffs = new gr_complex*[d_num_doppler_bins];
-    for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++)
-        {
-            d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex*>(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()));
-            int doppler = -(int)d_doppler_max + d_doppler_step * doppler_index;
-            float phase_step_rad = static_cast<float>(GPS_TWO_PI) * (d_freq + doppler) / static_cast<float>(d_fs_in);
-            float _phase[1];
-            _phase[0] = 0;
-            volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], - phase_step_rad, _phase, d_fft_size);
-        }
-}
-
-void pcps_multithread_acquisition_cc::set_local_code(std::complex<float> * code)
-{
-    memcpy(d_fft_if->get_inbuf(), code, sizeof(gr_complex)*d_fft_size);
-
-    d_fft_if->execute(); // We need the FFT of local code
-
-    //Conjugate the local code
-    volk_32fc_conjugate_32fc(d_fft_codes, d_fft_if->get_outbuf(), d_fft_size);
-}
-
-void pcps_multithread_acquisition_cc::acquisition_core()
-{
-    // initialize acquisition algorithm
-    int doppler;
-    uint32_t indext = 0;
-    float magt = 0.0;
-    float fft_normalization_factor = (float)d_fft_size * (float)d_fft_size;
-    gr_complex* in = d_in_buffer[d_well_count];
-    unsigned long int samplestamp = d_sample_counter_buffer[d_well_count];
-
-    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: " << d_doppler_max
-            << ", doppler_step: " << d_doppler_step;
-
-    // 1- Compute the input signal power estimation
-    volk_32fc_magnitude_squared_32f(d_magnitude, in, d_fft_size);
-    volk_32f_accumulator_s32f(&d_input_power, d_magnitude, d_fft_size);
-    d_input_power /= (float)d_fft_size;
-
-    // 2- Doppler frequency search loop
-    for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++)
-        {
-            // doppler search steps
-
-            doppler = -(int)d_doppler_max + d_doppler_step*doppler_index;
-
-            volk_32fc_x2_multiply_32fc(d_fft_if->get_inbuf(), in,
-                        d_grid_doppler_wipeoffs[doppler_index], d_fft_size);
-
-            // 3- Perform the FFT-based convolution  (parallel time search)
-            // Compute the FFT of the carrier wiped--off incoming signal
-            d_fft_if->execute();
-
-            // Multiply carrier wiped--off, Fourier transformed incoming signal
-            // with the local FFT'd code reference using SIMD operations with VOLK library
-            volk_32fc_x2_multiply_32fc(d_ifft->get_inbuf(),
-                        d_fft_if->get_outbuf(), d_fft_codes, d_fft_size);
-
-            // compute the inverse FFT
-            d_ifft->execute();
-
-            // Search maximum
-            volk_32fc_magnitude_squared_32f(d_magnitude, d_ifft->get_outbuf(), d_fft_size);
-            volk_gnsssdr_32f_index_max_32u(&indext, d_magnitude, d_fft_size);
-
-            // Normalize the maximum value to correct the scale factor introduced by FFTW
-            magt = d_magnitude[indext] / (fft_normalization_factor * fft_normalization_factor);
-
-            // 4- record the maximum peak and the associated synchronization parameters
-            if (d_mag < magt)
-                {
-                    d_mag = magt;
-
-                    // In case that d_bit_transition_flag = true, we compare the potentially
-                    // new maximum test statistics (d_mag/d_input_power) with the value in
-                    // d_test_statistics. When the second dwell is being processed, the value
-                    // of d_mag/d_input_power could be lower than d_test_statistics (i.e,
-                    // the maximum test statistics in the previous dwell is greater than
-                    // current d_mag/d_input_power). Note that d_test_statistics is not
-                    // restarted between consecutive dwells in multidwell operation.
-                    if (d_test_statistics < (d_mag / d_input_power) || !d_bit_transition_flag)
-                    {
-                        d_gnss_synchro->Acq_delay_samples = (double)(indext % d_samples_per_code);
-                        d_gnss_synchro->Acq_doppler_hz = (double)doppler;
-                        d_gnss_synchro->Acq_samplestamp_samples = samplestamp;
-
-                        // 5- Compute the test statistics and compare to the threshold
-                        //d_test_statistics = 2 * d_fft_size * d_mag / d_input_power;
-                        d_test_statistics = d_mag / d_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("");
-                    filename << "../data/test_statistics_" << d_gnss_synchro->System
-                             <<"_" << d_gnss_synchro->Signal << "_sat_"
-                             << d_gnss_synchro->PRN << "_doppler_" <<  doppler << ".dat";
-                    d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary);
-                    d_dump_file.write((char*)d_ifft->get_outbuf(), n); //write directly |abs(x)|^2 in this Doppler bin?
-                    d_dump_file.close();
-                }
-        }
-
-    if (!d_bit_transition_flag)
-        {
-            if (d_test_statistics > d_threshold)
-                {
-                    d_state = 2; // Positive acquisition
-                }
-            else if (d_well_count == d_max_dwells)
-                {
-                    d_state = 3; // Negative acquisition
-                }
-        }
-    else
-        {
-            if (d_well_count == d_max_dwells) // d_max_dwells = 2
-                {
-                    if (d_test_statistics > d_threshold)
-                        {
-                            d_state = 2; // Positive acquisition
-                        }
-                    else
-                        {
-                            d_state = 3; // Negative acquisition
-                        }
-                }
-        }
-
-    d_core_working = false;
-}
-
-
-
-void pcps_multithread_acquisition_cc::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_in_dwell_count = 0;
-            d_sample_counter_buffer.clear();
-        }
-    else if (d_state == 0)
-        {}
-    else
-        {
-            LOG(ERROR) << "State can only be set to 0 or 1";
-        }
-}
-
-
-
-int pcps_multithread_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)))
-{
-
-    int acquisition_message = -1; //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL
-
-    switch (d_state)
-    {
-    case 0:
-        {
-            if (d_active)
-                {
-                    //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_in_dwell_count = 0;
-                    d_sample_counter_buffer.clear();
-
-                    d_state = 1;
-                }
-
-            d_sample_counter += d_fft_size * ninput_items[0]; // sample counter
-
-            break;
-        }
-
-    case 1:
-        {
-            if (d_in_dwell_count < d_max_dwells)
-                {
-                    // Fill internal buffer with d_max_dwells signal blocks. This step ensures that
-                    // consecutive signal blocks will be processed in multi-dwell operation. This is
-                    // essential when d_bit_transition_flag = true.
-                    unsigned int num_dwells = std::min((int)(d_max_dwells-d_in_dwell_count),ninput_items[0]);
-                    for (unsigned int i = 0; i < num_dwells; i++)
-                        {
-                            memcpy(d_in_buffer[d_in_dwell_count++], (gr_complex*)input_items[i],
-                                    sizeof(gr_complex)*d_fft_size);
-                            d_sample_counter += d_fft_size;
-                            d_sample_counter_buffer.push_back(d_sample_counter);
-                        }
-
-                    if (ninput_items[0] > (int)num_dwells)
-                        {
-                            d_sample_counter += d_fft_size * (ninput_items[0]-num_dwells);
-                        }
-                }
-            else
-                {
-                    // We already have d_max_dwells consecutive blocks in the internal buffer,
-                    // just skip input blocks.
-                    d_sample_counter += d_fft_size * ninput_items[0];
-                }
-
-            // We create a new thread to process next block if the following
-            // conditions are fulfilled:
-            //   1. There are new blocks in d_in_buffer that have not been processed yet
-            //      (d_well_count < d_in_dwell_count).
-            //   2. No other acquisition_core thead is working (!d_core_working).
-            //   3. d_state==1. We need to check again d_state because it can be modified at any
-            //      moment by the external thread (may have changed since checked in the switch()).
-            //      If the external thread has already declared positive (d_state=2) or negative
-            //      (d_state=3) acquisition, we don't have to process next block!!
-            if ((d_well_count < d_in_dwell_count) && !d_core_working && d_state==1)
-                {
-                    d_core_working = true;
-                    boost::thread(&pcps_multithread_acquisition_cc::acquisition_core, this);
-                }
-
-            break;
-        }
-
-    case 2:
-        {
-            // 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 " << d_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 " << d_input_power;
-
-            d_active = false;
-            d_state = 0;
-
-            d_sample_counter += d_fft_size * ninput_items[0]; // sample counter
-
-            acquisition_message = 1;
-            this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message));
-
-            break;
-        }
-
-    case 3:
-        {
-            // 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 " << d_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 " << d_input_power;
-
-            d_active = false;
-            d_state = 0;
-
-            d_sample_counter += d_fft_size * ninput_items[0]; // sample counter
-
-            acquisition_message = 2;
-            this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message));
-
-            break;
-        }
-    }
-
-    consume_each(ninput_items[0]);
-
-    return noutput_items;
-}
diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_multithread_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_multithread_acquisition_cc.h
deleted file mode 100644
index 30c10d190..000000000
--- a/src/algorithms/acquisition/gnuradio_blocks/pcps_multithread_acquisition_cc.h
+++ /dev/null
@@ -1,241 +0,0 @@
-/*!
- * \file pcps_multithread_acquisition_cc.h
- * \brief This class implements a Parallel Code Phase Search Acquisition
- *
- *  Acquisition strategy (Kay Borre book + CFAR threshold).
- *  <ol>
- *  <li> Compute the input signal power estimation
- *  <li> Doppler serial search loop
- *  <li> Perform the FFT-based circular convolution (parallel time search)
- *  <li> Record the maximum peak and the associated synchronization parameters
- *  <li> Compute the test statistics and compare to the threshold
- *  <li> Declare positive or negative acquisition using a message port
- *  </ol>
- *
- * 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", Birkha user, 2007. pp 81-84
- *
- * \authors <ul>
- *          <li> Javier Arribas, 2011. jarribas(at)cttc.es
- *          <li> Luis Esteve, 2012. luis(at)epsilon-formacion.com
- *          <li> Marc Molina, 2013. marc.molina.pena@gmail.com
- *          </ul>
- *
- * -------------------------------------------------------------------------
- *
- * 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 <http://www.gnu.org/licenses/>.
- *
- * -------------------------------------------------------------------------
- */
-
-#ifndef GNSS_SDR_PCPS_MULTITHREAD_ACQUISITION_CC_H_
-#define GNSS_SDR_PCPS_MULTITHREAD_ACQUISITION_CC_H_
-
-#include <algorithm>
-#include <fstream>
-#include <string>
-#include <vector>
-#include <gnuradio/block.h>
-#include <gnuradio/gr_complex.h>
-#include <gnuradio/fft/fft.h>
-#include "gnss_synchro.h"
-
-class pcps_multithread_acquisition_cc;
-
-typedef boost::shared_ptr<pcps_multithread_acquisition_cc> pcps_multithread_acquisition_cc_sptr;
-
-pcps_multithread_acquisition_cc_sptr
-pcps_make_multithread_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,
-                         bool bit_transition_flag,
-                         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 pcps_multithread_acquisition_cc: public gr::block
-{
-private:
-    friend pcps_multithread_acquisition_cc_sptr
-    pcps_make_multithread_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,
-                             bool bit_transition_flag,
-                             bool dump,
-                             std::string dump_filename);
-
-
-    pcps_multithread_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,
-                        bool bit_transition_flag,
-                        bool dump,
-                        std::string dump_filename);
-
-    void calculate_magnitudes(gr_complex* fft_begin, int doppler_shift,
-            int doppler_offset);
-
-
-    long d_fs_in;
-    long d_freq;
-    int d_samples_per_ms;
-    int d_samples_per_code;
-    unsigned int d_doppler_resolution;
-    float d_threshold;
-    std::string d_satellite_str;
-    unsigned int d_doppler_max;
-    unsigned int d_doppler_step;
-    unsigned int d_sampled_ms;
-    unsigned int d_max_dwells;
-    unsigned int d_well_count;
-    unsigned int d_fft_size;
-    unsigned long int d_sample_counter;
-    gr_complex** d_grid_doppler_wipeoffs;
-    unsigned int d_num_doppler_bins;
-    gr_complex* d_fft_codes;
-    gr::fft::fft_complex* d_fft_if;
-    gr::fft::fft_complex* d_ifft;
-    Gnss_Synchro *d_gnss_synchro;
-    unsigned int d_code_phase;
-    float d_doppler_freq;
-    float d_mag;
-    float* d_magnitude;
-    float d_input_power;
-    float d_test_statistics;
-    bool d_bit_transition_flag;
-    std::ofstream d_dump_file;
-    bool d_active;
-    int d_state;
-    bool d_core_working;
-    bool d_dump;
-    unsigned int d_channel;
-    std::string d_dump_filename;
-    gr_complex** d_in_buffer;
-    std::vector<unsigned long int> d_sample_counter_buffer;
-    unsigned int d_in_dwell_count;
-
-public:
-    /*!
-     * \brief Default destructor.
-     */
-    ~pcps_multithread_acquisition_cc();
-
-    /*!
-     * \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.
-     */
-    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
-    {
-        d_gnss_synchro = p_gnss_synchro;
-    }
-
-    /*!
-     * \brief Returns the maximum peak of grid search.
-     */
-    unsigned int mag()
-    {
-        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(std::complex<float> * 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)
-    {
-        d_active = 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.
-     */
-    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).
-     */
-    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].
-     */
-    void set_doppler_max(unsigned int doppler_max)
-    {
-        d_doppler_max = doppler_max;
-    }
-
-    /*!
-     * \brief Set Doppler steps for the grid search
-     * \param doppler_step - Frequency bin of the search grid [Hz].
-     */
-    void set_doppler_step(unsigned int doppler_step)
-    {
-        d_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);
-
-    void acquisition_core();
-};
-
-#endif /* GNSS_SDR_PCPS_MULTITHREAD_ACQUISITION_CC_H_*/
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 de7584ac5..28823347e 100644
--- a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc
+++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc
@@ -469,7 +469,7 @@ void pcps_opencl_acquisition_cc::acquisition_core_volk()
                              <<"_" << d_gnss_synchro->Signal << "_sat_"
                              << d_gnss_synchro->PRN << "_doppler_" <<  doppler << ".dat";
                     d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary);
-                    d_dump_file.write((char*)d_ifft->get_outbuf(), n); //write directly |abs(x)|^2 in this Doppler bin?
+                    d_dump_file.write(reinterpret_cast<char*>(d_ifft->get_outbuf()), n); //write directly |abs(x)|^2 in this Doppler bin?
                     d_dump_file.close();
                 }
         }
@@ -631,7 +631,7 @@ void pcps_opencl_acquisition_cc::acquisition_core_opencl()
                              << "_" << d_gnss_synchro->Signal << "_sat_"
                              << d_gnss_synchro->PRN << "_doppler_" <<  doppler << ".dat";
                     d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary);
-                    d_dump_file.write((char*)d_ifft->get_outbuf(), n); //write directly |abs(x)|^2 in this Doppler bin?
+                    d_dump_file.write(reinterpret_cast<char*>(d_ifft->get_outbuf()), n); //write directly |abs(x)|^2 in this Doppler bin?
                     d_dump_file.close();
                 }
         }
@@ -730,10 +730,10 @@ int pcps_opencl_acquisition_cc::general_work(int noutput_items,
                     // Fill internal buffer with d_max_dwells signal blocks. This step ensures that
                     // consecutive signal blocks will be processed in multi-dwell operation. This is
                     // essential when d_bit_transition_flag = true.
-                    unsigned int num_dwells = std::min(static_cast<int>(d_max_dwells-d_in_dwell_count), ninput_items[0]);
+                    unsigned int num_dwells = std::min(static_cast<int>(d_max_dwells - d_in_dwell_count), ninput_items[0]);
                     for (unsigned int i = 0; i < num_dwells; i++)
                         {
-                            memcpy(d_in_buffer[d_in_dwell_count++], (gr_complex*)input_items[i],
+                            memcpy(d_in_buffer[d_in_dwell_count++], static_cast<const gr_complex*>(input_items[i]),
                                     sizeof(gr_complex)*d_fft_size);
                             d_sample_counter += d_fft_size;
                             d_sample_counter_buffer.push_back(d_sample_counter);
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 33559cb3b..8d5a1fef0 100644
--- a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.h
+++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.h
@@ -175,7 +175,7 @@ public:
       * to exchange synchronization data between acquisition and tracking blocks.
       * \param p_gnss_synchro Satellite information shared by the processing blocks.
       */
-     void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
+     inline void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
      {
          d_gnss_synchro = p_gnss_synchro;
      }
@@ -183,7 +183,7 @@ public:
      /*!
       * \brief Returns the maximum peak of grid search.
       */
-     unsigned int mag()
+     inline unsigned int mag() const
      {
          return d_mag;
      }
@@ -204,7 +204,7 @@ public:
       * active mode
       * \param active - bool that activates/deactivates the block.
       */
-     void set_active(bool active)
+     inline void set_active(bool active)
      {
          d_active = active;
      }
@@ -220,7 +220,7 @@ public:
       * \brief Set acquisition channel unique ID
       * \param channel - receiver channel.
       */
-     void set_channel(unsigned int channel)
+     inline void set_channel(unsigned int channel)
      {
          d_channel = channel;
      }
@@ -230,7 +230,7 @@ public:
       * \param threshold - Threshold for signal detection (check \ref Navitec2012,
       * Algorithm 1, for a definition of this threshold).
       */
-     void set_threshold(float threshold)
+     inline void set_threshold(float threshold)
      {
          d_threshold = threshold;
      }
@@ -239,7 +239,7 @@ public:
       * \brief Set maximum Doppler grid search
       * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz].
       */
-     void set_doppler_max(unsigned int doppler_max)
+     inline void set_doppler_max(unsigned int doppler_max)
      {
          d_doppler_max = doppler_max;
      }
@@ -248,7 +248,7 @@ public:
       * \brief Set Doppler steps for the grid search
       * \param doppler_step - Frequency bin of the search grid [Hz].
       */
-     void set_doppler_step(unsigned int doppler_step)
+     inline void set_doppler_step(unsigned int doppler_step)
      {
          d_doppler_step = doppler_step;
      }
diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc
index 8c9d053df..cbc541c33 100644
--- a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc
+++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc
@@ -302,7 +302,7 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items,
             int doppler;
             uint32_t indext = 0;
             float magt = 0.0;
-            const gr_complex *in = (const gr_complex *)input_items[0]; //Get the input samples pointer
+            const gr_complex *in = reinterpret_cast<const gr_complex *>(input_items[0]); //Get the input samples pointer
 
             gr_complex* in_temp = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_samples_per_code * d_folding_factor * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
             gr_complex* in_temp_folded = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
@@ -479,7 +479,7 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items,
                                     << "_" << d_gnss_synchro->Signal << "_sat_"
                                     << d_gnss_synchro->PRN << "_doppler_" <<  doppler << ".dat";
                             d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary);
-                            d_dump_file.write((char*)d_magnitude_folded, n); //write directly |abs(x)|^2 in this Doppler bin?
+                            d_dump_file.write(reinterpret_cast<char*>(d_magnitude_folded), n); //write directly |abs(x)|^2 in this Doppler bin?
                             d_dump_file.close();
                         }
                 }
@@ -489,12 +489,10 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items,
                     if (d_test_statistics > d_threshold)
                         {
                             d_state = 2; // Positive acquisition
-
                         }
                     else if (d_well_count == d_max_dwells)
                         {
                             d_state = 3; // Negative acquisition
-
                         }
                 }
             else
diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.h
index 9538dffa4..1196e6821 100644
--- a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.h
+++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.h
@@ -161,7 +161,7 @@ public:
      * to exchange synchronization data between acquisition and tracking blocks.
      * \param p_gnss_synchro Satellite information shared by the processing blocks.
      */
-    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
+    inline void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
     {
         d_gnss_synchro = p_gnss_synchro;
     }
@@ -169,7 +169,7 @@ public:
     /*!
      * \brief Returns the maximum peak of grid search.
      */
-    unsigned int mag()
+    inline unsigned int mag() const
     {
         return d_mag;
     }
@@ -190,7 +190,7 @@ public:
      * active mode
      * \param active - bool that activates/deactivates the block.
      */
-    void set_active(bool active)
+    inline void set_active(bool active)
     {
         d_active = active;
     }
@@ -206,7 +206,7 @@ public:
      * \brief Set acquisition channel unique ID
      * \param channel - receiver channel.
      */
-    void set_channel(unsigned int channel)
+    inline void set_channel(unsigned int channel)
     {
         d_channel = channel;
     }
@@ -216,7 +216,7 @@ public:
      * \param threshold - Threshold for signal detection (check \ref Navitec2012,
      * Algorithm 1, for a definition of this threshold).
      */
-    void set_threshold(float threshold)
+    inline void set_threshold(float threshold)
     {
         d_threshold = threshold;
     }
@@ -225,7 +225,7 @@ public:
      * \brief Set maximum Doppler grid search
      * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz].
      */
-    void set_doppler_max(unsigned int doppler_max)
+    inline void set_doppler_max(unsigned int doppler_max)
     {
         d_doppler_max = doppler_max;
     }
@@ -234,12 +234,11 @@ public:
      * \brief Set Doppler steps for the grid search
      * \param doppler_step - Frequency bin of the search grid [Hz].
      */
-    void set_doppler_step(unsigned int doppler_step)
+    inline void set_doppler_step(unsigned int doppler_step)
     {
         d_doppler_step = doppler_step;
     }
 
-
     /*!
      * \brief Parallel Code Phase Search Acquisition signal processing.
      */
diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc
index 1e3a0118c..676705a23 100644
--- a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc
+++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc
@@ -280,7 +280,7 @@ int pcps_tong_acquisition_cc::general_work(int noutput_items,
             int doppler;
             uint32_t indext = 0;
             float magt = 0.0;
-            const gr_complex *in = (const gr_complex *)input_items[0]; //Get the input samples pointer
+            const gr_complex *in = reinterpret_cast<const gr_complex *>(input_items[0]); //Get the input samples pointer
             float fft_normalization_factor = static_cast<float>(d_fft_size) * static_cast<float>(d_fft_size);
             d_input_power = 0.0;
             d_mag = 0.0;
@@ -357,7 +357,7 @@ int pcps_tong_acquisition_cc::general_work(int noutput_items,
                                      <<"_" << d_gnss_synchro->Signal << "_sat_"
                                      << d_gnss_synchro->PRN << "_doppler_" <<  doppler << ".dat";
                             d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary);
-                            d_dump_file.write((char*)d_ifft->get_outbuf(), n); //write directly |abs(x)|^2 in this Doppler bin?
+                            d_dump_file.write(reinterpret_cast<char*>(d_ifft->get_outbuf()), n); //write directly |abs(x)|^2 in this Doppler bin?
                             d_dump_file.close();
                         }
                 }
diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.h
index 03b20b372..7174f2a88 100644
--- a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.h
+++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.h
@@ -140,7 +140,7 @@ public:
       * to exchange synchronization data between acquisition and tracking blocks.
       * \param p_gnss_synchro Satellite information shared by the processing blocks.
       */
-     void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
+     inline void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
      {
          d_gnss_synchro = p_gnss_synchro;
      }
@@ -148,7 +148,7 @@ public:
      /*!
       * \brief Returns the maximum peak of grid search.
       */
-     unsigned int mag()
+     inline unsigned int mag() const
      {
          return d_mag;
      }
@@ -169,7 +169,7 @@ public:
       * active mode
       * \param active - bool that activates/deactivates the block.
       */
-     void set_active(bool active)
+     inline void set_active(bool active)
      {
          d_active = active;
      }
@@ -185,7 +185,7 @@ public:
       * \brief Set acquisition channel unique ID
       * \param channel - receiver channel.
       */
-     void set_channel(unsigned int channel)
+     inline void set_channel(unsigned int channel)
      {
          d_channel = channel;
      }
@@ -195,7 +195,7 @@ public:
       * \param threshold - Threshold for signal detection (check \ref Navitec2012,
       * Algorithm 1, for a definition of this threshold).
       */
-     void set_threshold(float threshold)
+     inline void set_threshold(float threshold)
      {
          d_threshold = threshold;
      }
@@ -204,7 +204,7 @@ public:
       * \brief Set maximum Doppler grid search
       * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz].
       */
-     void set_doppler_max(unsigned int doppler_max)
+     inline void set_doppler_max(unsigned int doppler_max)
      {
          d_doppler_max = doppler_max;
      }
@@ -213,12 +213,11 @@ public:
       * \brief Set Doppler steps for the grid search
       * \param doppler_step - Frequency bin of the search grid [Hz].
       */
-     void set_doppler_step(unsigned int doppler_step)
+     inline void set_doppler_step(unsigned int doppler_step)
      {
          d_doppler_step = doppler_step;
      }
 
-
      /*!
       * \brief Parallel Code Phase Search Acquisition signal processing.
       */
diff --git a/src/algorithms/acquisition/libs/CMakeLists.txt b/src/algorithms/acquisition/libs/CMakeLists.txt
index 01ab3de68..702ee57b8 100644
--- a/src/algorithms/acquisition/libs/CMakeLists.txt
+++ b/src/algorithms/acquisition/libs/CMakeLists.txt
@@ -51,10 +51,11 @@ set(ACQUISITION_LIB_SOURCES
 #endif(ENABLE_FPGA)
 
 include_directories(
-     $(CMAKE_CURRENT_SOURCE_DIR)
+     ${CMAKE_CURRENT_SOURCE_DIR}
      ${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/acquisition/libs/gps_fpga_acquisition_8sc.cc b/src/algorithms/acquisition/libs/gps_fpga_acquisition_8sc.cc
index df5713dfe..ca80ee6ff 100644
--- a/src/algorithms/acquisition/libs/gps_fpga_acquisition_8sc.cc
+++ b/src/algorithms/acquisition/libs/gps_fpga_acquisition_8sc.cc
@@ -34,6 +34,7 @@
  */
 
 #include "gps_fpga_acquisition_8sc.h"
+#include "gps_sdr_signal_processing.h"
 #include <cmath>
 
 // allocate memory dynamically
@@ -59,139 +60,120 @@
 // logging
 #include <glog/logging.h>
 
+#include <volk/volk.h>
+
 #include "GPS_L1_CA.h"
 
 #define PAGE_SIZE 0x10000
-#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 PHASE_CARR_NBITS 32
-#define PHASE_CARR_NBITS_INT 1
-#define PHASE_CARR_NBITS_FRAC PHASE_CARR_NBITS - PHASE_CARR_NBITS_INT
-
 #define MAX_PHASE_STEP_RAD 0.999999999534339 // 1 - pow(2,-31);
+#define NUM_PRNs 32
+#define TEST_REGISTER_ACQ_WRITEVAL 0x55AA
 
-
-bool gps_fpga_acquisition_8sc::init(unsigned int fft_size, unsigned int nsamples_total, long freq, unsigned int doppler_max, unsigned int doppler_step, int num_doppler_bins, long fs_in, unsigned select_queue)
+bool gps_fpga_acquisition_8sc::init()
 {
-    float phase_step_rad_fpga;
+    // configure the acquisition with the main initialization values
+    gps_fpga_acquisition_8sc::configure_acquisition();
+    return true;
+}
 
-    d_phase_step_rad_vector = new float[num_doppler_bins];
+bool gps_fpga_acquisition_8sc::set_local_code(unsigned int PRN)
+{
 
-    for (int doppler_index = 0; doppler_index < num_doppler_bins; doppler_index++)
-        {
-            int doppler = -static_cast<int>(doppler_max) + doppler_step * doppler_index;
-            float phase_step_rad = GPS_TWO_PI * (freq + doppler) / static_cast<float>(fs_in);
-            // The doppler step can never be outside the range -pi to +pi, otherwise there would be aliasing
-            // The FPGA expects phase_step_rad between -1 (-pi) to +1 (+pi)
-            // The FPGA also expects the phase to be negative since it produces cos(x) -j*sin(x)
-            // while the gnss-sdr software (volk_gnsssdr_s32f_sincos_32fc) generates cos(x) + j*sin(x)
-            phase_step_rad_fpga = 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_fpga == 1.0)
-                {
-                    phase_step_rad_fpga = MAX_PHASE_STEP_RAD;
-                }
-            d_phase_step_rad_vector[doppler_index] = phase_step_rad_fpga;
-        }
+    // select the code with the chosen PRN
+    gps_fpga_acquisition_8sc::fpga_configure_acquisition_local_code(
+            &d_all_fft_codes[d_vector_length * PRN]);
+    return true;
+}
 
-    // sanity check : check test register
-    unsigned writeval = 0x55AA;
-    unsigned readval;
-    readval = gps_fpga_acquisition_8sc::fpga_acquisition_test_register(writeval);
-    if (writeval != readval)
-        {
-            printf("test register fail\n");
-            LOG(WARNING) << "Acquisition test register sanity check failed";
-        }
-    else
-        {
-            printf("test register success\n");
-            LOG(INFO) << "Acquisition test register sanity check success !";
-        }
-
-    d_nsamples = fft_size;
-    d_nsamples_total = nsamples_total;
+gps_fpga_acquisition_8sc::gps_fpga_acquisition_8sc(std::string device_name,
+        unsigned int vector_length, unsigned int nsamples,
+        unsigned int nsamples_total, long fs_in, long freq,
+        unsigned int sampled_ms, unsigned select_queue)
+{
+    // 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_select_queue = select_queue;
 
-    gps_fpga_acquisition_8sc::configure_acquisition();
+    d_doppler_max = 0;
+    d_doppler_step = 0;
+    d_fd = 0; // driver descriptor
+    d_map_base = nullptr; // driver memory map
 
-    return true;
-}
+    // 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<float>* code = new std::complex<float>[nsamples_total]; // buffer for the local code
+    std::complex<float> * code_total = new gr_complex[vector_length]; // buffer for the local code repeate every number of ms
 
-bool gps_fpga_acquisition_8sc::set_local_code(gr_complex* fft_codes)
-{
-    unsigned int i;
-    float max = 0;
-    d_fft_codes = new lv_16sc_t[d_nsamples_total];
+    gr_complex* d_fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(vector_length * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
 
-    for (i=0;i<d_nsamples_total;i++)
+    d_all_fft_codes = new lv_16sc_t[vector_length * 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++)
         {
-            if(std::abs(fft_codes[i].real()) > max)
+            gps_l1_ca_code_gen_complex_sampled(code, PRN, fs_in, 0); // generate PRN code
+
+            for (unsigned int i = 0; i < sampled_ms; i++)
                 {
-                    max = std::abs(fft_codes[i].real());
+                    memcpy(&(code_total[i * nsamples_total]), code, sizeof(gr_complex) * nsamples_total); // repeat for each ms
                 }
-            if(std::abs(fft_codes[i].imag()) > max)
+
+            int offset = 0;
+
+            memcpy(d_fft_if->get_inbuf() + offset, code_total, sizeof(gr_complex) * vector_length); // 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
+
+            max = 0; // initialize maximum value
+
+            for (unsigned int i = 0; i < vector_length; i++) // search for maxima
                 {
-                    max = std::abs(fft_codes[i].imag());
+                    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 < vector_length; 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<int>(d_fft_codes_padded[i].real() * (pow(2, 7) - 1) / max),
+                            static_cast<int>(d_fft_codes_padded[i].imag() * (pow(2, 7) - 1) / max));
+                }
+
         }
 
-    for (i=0;i<d_nsamples_total;i++)
-        {
-            d_fft_codes[i] = lv_16sc_t((int) (fft_codes[i].real()*(pow(2,7) - 1)/max), (int) (fft_codes[i].imag()*(pow(2,7) - 1)/max));
-        }
-
-    gps_fpga_acquisition_8sc::fpga_configure_acquisition_local_code(d_fft_codes);
-
-    return true;
-}
-
-
-
-gps_fpga_acquisition_8sc::gps_fpga_acquisition_8sc()
-{
-    if ((d_fd = open(d_device_io_name, O_RDWR | O_SYNC )) == -1)
-        {
-            LOG(WARNING) << "Cannot open deviceio" << d_device_io_name;
-        }
-    d_map_base = (volatile unsigned *)mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, d_fd,0);
-
-    if (d_map_base == (void *) -1)
-        {
-            LOG(WARNING) << "Cannot map the FPGA acquisition module into user memory";
-        }
+    // 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()
 {
-    if (munmap((void*)d_map_base, PAGE_SIZE) == -1)
-        {
-            printf("Failed to unmap memory uio\n");
-        }
-
-    close(d_fd);
+    delete[] d_all_fft_codes;
 }
 
 
 bool gps_fpga_acquisition_8sc::free()
 {
-    if (d_fft_codes != nullptr)
-        {
-            delete [] d_fft_codes;
-            d_fft_codes = nullptr;
-        }
-    if (d_phase_step_rad_vector != nullptr)
-        {
-            delete [] d_phase_step_rad_vector;
-            d_phase_step_rad_vector = nullptr;
-        }
-
     return true;
 }
 
@@ -215,11 +197,11 @@ void gps_fpga_acquisition_8sc::fpga_configure_acquisition_local_code(lv_16sc_t f
 
     // clear memory address counter
     d_map_base[4] = 0x10000000;
-    for (k = 0; k < d_nsamples_total; k++)
+    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
+            local_code = (tmp & 0xFF) | ((tmp2 * 256) & 0xFF00); // put together the real part and the imaginary part
             d_map_base[4] = 0x0C000000 | (local_code & 0xFFFF);
         }
 }
@@ -229,14 +211,14 @@ void gps_fpga_acquisition_8sc::run_acquisition(void)
 {
     // enable interrupts
     int reenable = 1;
-    write(d_fd, (void *)&reenable, sizeof(int));
+    write(d_fd, reinterpret_cast<void*>(&reenable), sizeof(int));
 
-    d_map_base[5] = 0;	// writing anything to reg 4 launches the acquisition process
+    d_map_base[5] = 0; // writing anything to reg 4 launches the acquisition process
 
     int irq_count;
     ssize_t nb;
     // wait for interrupt
-    nb=read(d_fd, &irq_count, sizeof(irq_count));
+    nb = read(d_fd, &irq_count, sizeof(irq_count));
     if (nb != sizeof(irq_count))
         {
             printf("Tracking_module Read failed to retrieve 4 bytes!\n");
@@ -248,7 +230,7 @@ void gps_fpga_acquisition_8sc::run_acquisition(void)
 void gps_fpga_acquisition_8sc::configure_acquisition()
 {
     d_map_base[0] = d_select_queue;
-    d_map_base[1] = d_nsamples_total;
+    d_map_base[1] = d_vector_length;
     d_map_base[2] = d_nsamples;
 }
 
@@ -259,25 +241,37 @@ void gps_fpga_acquisition_8sc::set_phase_step(unsigned int doppler_index)
     float phase_step_rad_int_temp;
     int32_t phase_step_rad_int;
 
-    phase_step_rad_real = d_phase_step_rad_vector[doppler_index];
-
-    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
+    int doppler = static_cast<int>(-d_doppler_max) + d_doppler_step * doppler_index;
+    float phase_step_rad = GPS_TWO_PI * (d_freq + doppler) / static_cast<float>(d_fs_in);
+    // The doppler step can never be outside the range -pi to +pi, otherwise there would be aliasing
+    // The FPGA expects phase_step_rad between -1 (-pi) to +1 (+pi)
+    // The FPGA also expects the phase to be negative since it produces cos(x) -j*sin(x)
+    // while the gnss-sdr software (volk_gnsssdr_s32f_sincos_32fc) generates cos(x) + j*sin(x)
+    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)
+        {
+            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)
+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];
-    *max_magnitude = (float) readval;
+    *max_magnitude = static_cast<float>(readval);
     readval = d_map_base[4];
-    *power_sum = (float) readval;
+    *power_sum = static_cast<float>(readval);
     readval = d_map_base[3];
     *max_index = readval;
 }
@@ -295,3 +289,50 @@ void gps_fpga_acquisition_8sc::unblock_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<volatile unsigned *>(mmap(NULL, PAGE_SIZE,
+            PROT_READ | PROT_WRITE, MAP_SHARED, d_fd, 0));
+
+    if (d_map_base == reinterpret_cast<void*>(-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<unsigned*>(d_map_base);
+    if (munmap(static_cast<void*>(aux), PAGE_SIZE) == -1)
+        {
+            printf("Failed to unmap memory uio\n");
+        }
+    close(d_fd);
+}
+
diff --git a/src/algorithms/acquisition/libs/gps_fpga_acquisition_8sc.h b/src/algorithms/acquisition/libs/gps_fpga_acquisition_8sc.h
index b34566308..4f48af3bc 100644
--- a/src/algorithms/acquisition/libs/gps_fpga_acquisition_8sc.h
+++ b/src/algorithms/acquisition/libs/gps_fpga_acquisition_8sc.h
@@ -39,7 +39,7 @@
 #include <volk_gnsssdr/volk_gnsssdr.h>
 
 #include <gnuradio/block.h>
-
+#include <gnuradio/fft/fft.h>
 
 /*!
  * \brief Class that implements carrier wipe-off and correlators.
@@ -47,35 +47,56 @@
 class gps_fpga_acquisition_8sc
 {
 public:
-    gps_fpga_acquisition_8sc();
-    ~gps_fpga_acquisition_8sc();
-    bool init(unsigned int fft_size, unsigned int nsamples_total, long d_freq, unsigned int doppler_max, unsigned int doppler_step, int num_doppler_bins, long fs_in, unsigned select_queue);
-    bool set_local_code(gr_complex* fft_codes); //int code_length_chips, const lv_16sc_t* local_code_in, float *shifts_chips);
+    gps_fpga_acquisition_8sc(std::string device_name,
+            unsigned int vector_length, unsigned int nsamples,
+            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);
     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();
+    void open_device();
+    void close_device();
+
+    /*!
+     * \brief Set maximum Doppler grid search
+     * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz].
+     */
+    void set_doppler_max(unsigned int doppler_max)
+    {
+        d_doppler_max = doppler_max;
+    }
+
+    /*!
+     * \brief Set Doppler steps for the grid search
+     * \param doppler_step - Frequency bin of the search grid [Hz].
+     */
+    void set_doppler_step(unsigned int doppler_step)
+    {
+        d_doppler_step = doppler_step;
+    }
+
 private:
-    const lv_16sc_t *d_local_code_in;
-    lv_16sc_t *d_corr_out;
-    float *d_shifts_chips;
-    int d_code_length_chips;
-    int d_n_correlators;
+
+    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
-    char d_device_io_name[11] = "/dev/uio13";  // driver io name
-    int d_fd;                                         // driver descriptor
-    volatile unsigned *d_map_base;                    // driver memory map
-
-    // configuration data received from the interface
-    lv_16sc_t *d_fft_codes = nullptr;
-    float *d_phase_step_rad_vector = nullptr;
-
-    unsigned int d_nsamples_total; // total number of samples in the fft including padding
+    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; // 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);
@@ -84,5 +105,4 @@ private:
 
 };
 
-
 #endif /* GNSS_SDR_FPGA_MULTICORRELATOR_H_ */
diff --git a/src/algorithms/channel/adapters/CMakeLists.txt b/src/algorithms/channel/adapters/CMakeLists.txt
index b3efdcff7..e7c1c8660 100644
--- a/src/algorithms/channel/adapters/CMakeLists.txt
+++ b/src/algorithms/channel/adapters/CMakeLists.txt
@@ -19,7 +19,7 @@
 set(CHANNEL_ADAPTER_SOURCES channel.cc)
 
 include_directories(
-     $(CMAKE_CURRENT_SOURCE_DIR)
+     ${CMAKE_CURRENT_SOURCE_DIR}
      ${CMAKE_SOURCE_DIR}/src/core/system_parameters
      ${CMAKE_SOURCE_DIR}/src/core/interfaces
      ${CMAKE_SOURCE_DIR}/src/core/receiver
diff --git a/src/algorithms/channel/adapters/channel.cc b/src/algorithms/channel/adapters/channel.cc
index eb59941e9..425dbb968 100644
--- a/src/algorithms/channel/adapters/channel.cc
+++ b/src/algorithms/channel/adapters/channel.cc
@@ -28,16 +28,11 @@
  *
  * -------------------------------------------------------------------------
  */
+
 #include "channel.h"
-//#include <memory>
 #include <boost/lexical_cast.hpp>
 #include <glog/logging.h>
-//#include "channel_interface.h"
-//#include "acquisition_interface.h"
-//#include "tracking_interface.h"
-//#include "telemetry_decoder_interface.h"
 #include "configuration_interface.h"
-//#include "channel_msg_receiver_cc.h"
 
 using google::LogMessage;
 
@@ -56,7 +51,7 @@ Channel::Channel(ConfigurationInterface *configuration, unsigned int channel,
     channel_ = channel;
     queue_ = queue;
 
-    flag_enable_fpga=configuration->property("Channel.enable_FPGA", false);
+    flag_enable_fpga = configuration->property("Channel.enable_FPGA", false);
     acq_->set_channel(channel_);
     trk_->set_channel(channel_);
     nav_->set_channel(channel_);
@@ -65,6 +60,17 @@ Channel::Channel(ConfigurationInterface *configuration, unsigned int channel,
     acq_->set_gnss_synchro(&gnss_synchro_);
     trk_->set_gnss_synchro(&gnss_synchro_);
 
+    // Provide a warning to the user about the change of parameter name
+    if(channel_ == 0)
+        {
+            long int deprecation_warning = configuration->property("GNSS-SDR.internal_fs_hz", 0);
+            if(deprecation_warning != 0)
+                {
+                    std::cout << "WARNING: The global parameter name GNSS-SDR.internal_fs_hz has been DEPRECATED." << std::endl;
+                    std::cout << "WARNING: Please replace it by GNSS-SDR.internal_fs_sps in your configuration file." << std::endl;
+                }
+        }
+
     // IMPORTANT: Do not change the order between set_doppler_step and set_threshold
 
     unsigned int doppler_step = configuration->property("Acquisition_" + implementation_ + boost::lexical_cast<std::string>(channel_) + ".doppler_step" ,0);
@@ -93,15 +99,16 @@ Channel::Channel(ConfigurationInterface *configuration, unsigned int channel,
     gnss_signal_ = Gnss_Signal(implementation_);
 
     channel_msg_rx = channel_msg_receiver_make_cc(&channel_fsm_, repeat_);
-
 }
 
+
 // Destructor
 Channel::~Channel()
 {
     channel_fsm_.terminate();
 }
 
+
 void Channel::connect(gr::top_block_sptr top_block)
 {
     if (connected_)
@@ -109,22 +116,22 @@ void Channel::connect(gr::top_block_sptr top_block)
             LOG(WARNING) << "channel already connected internally";
             return;
         }
-    if (flag_enable_fpga==false)
-    {
-    	pass_through_->connect(top_block);
-    }
+    if (flag_enable_fpga == false)
+        {
+            pass_through_->connect(top_block);
+        }
     acq_->connect(top_block);
     trk_->connect(top_block);
     nav_->connect(top_block);
 
     //Synchronous ports
-    if (flag_enable_fpga==false)
-    {
-		top_block->connect(pass_through_->get_right_block(), 0, acq_->get_left_block(), 0);
-		DLOG(INFO) << "pass_through_ -> acquisition";
-		top_block->connect(pass_through_->get_right_block(), 0, trk_->get_left_block(), 0);
-		DLOG(INFO) << "pass_through_ -> tracking";
-    }
+    if (flag_enable_fpga == false)
+        {
+            top_block->connect(pass_through_->get_right_block(), 0, acq_->get_left_block(), 0);
+            DLOG(INFO) << "pass_through_ -> acquisition";
+            top_block->connect(pass_through_->get_right_block(), 0, trk_->get_left_block(), 0);
+            DLOG(INFO) << "pass_through_ -> tracking";
+        }
     top_block->connect(trk_->get_right_block(), 0, nav_->get_left_block(), 0);
     DLOG(INFO) << "tracking -> telemetry_decoder";
 
@@ -148,17 +155,17 @@ void Channel::disconnect(gr::top_block_sptr top_block)
             return;
         }
 
-    if (flag_enable_fpga==false)
-    {
-		top_block->disconnect(pass_through_->get_right_block(), 0, acq_->get_left_block(), 0);
-		top_block->disconnect(pass_through_->get_right_block(), 0, trk_->get_left_block(), 0);
-    }
+    if (flag_enable_fpga == false)
+        {
+            top_block->disconnect(pass_through_->get_right_block(), 0, acq_->get_left_block(), 0);
+            top_block->disconnect(pass_through_->get_right_block(), 0, trk_->get_left_block(), 0);
+        }
     top_block->disconnect(trk_->get_right_block(), 0, nav_->get_left_block(), 0);
 
-    if (flag_enable_fpga==false)
-    {
-    	pass_through_->disconnect(top_block);
-    }
+    if (flag_enable_fpga == false)
+        {
+            pass_through_->disconnect(top_block);
+        }
     acq_->disconnect(top_block);
     trk_->disconnect(top_block);
     nav_->disconnect(top_block);
@@ -183,7 +190,7 @@ void Channel::set_signal(const Gnss_Signal& gnss_signal)
     gnss_signal_ = gnss_signal;
     std::string str_aux = gnss_signal_.get_signal_str();
     const char * str = str_aux.c_str(); // get a C style null terminated string
-    std::memcpy((void*)gnss_synchro_.Signal, str, 3); // copy string into synchro char array: 2 char + null
+    std::memcpy(static_cast<void*>(gnss_synchro_.Signal), str, 3); // copy string into synchro char array: 2 char + null
     gnss_synchro_.Signal[2] = 0; // make sure that string length is only two characters
     gnss_synchro_.PRN = gnss_signal_.get_satellite().get_PRN();
     gnss_synchro_.System = gnss_signal_.get_satellite().get_system_short().c_str()[0];
diff --git a/src/algorithms/channel/adapters/channel.h b/src/algorithms/channel/adapters/channel.h
index 0060111de..a05697eed 100644
--- a/src/algorithms/channel/adapters/channel.h
+++ b/src/algorithms/channel/adapters/channel.h
@@ -67,25 +67,29 @@ public:
             boost::shared_ptr<gr::msg_queue> queue);
     //! Virtual destructor
     virtual ~Channel();
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
-    std::string role(){ return role_; }
+
+    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;
+
+    inline std::string role() override { return role_; }
 
     //! Returns "Channel"
-    std::string implementation(){ return implementation_; }
-    size_t item_size(){ return 0; }
-    Gnss_Signal get_signal() const { return gnss_signal_; }
-    std::shared_ptr<AcquisitionInterface> acquisition(){ return acq_; }
-    std::shared_ptr<TrackingInterface> tracking(){ return trk_; }
-    std::shared_ptr<TelemetryDecoderInterface> telemetry(){ return nav_; }
-    void start_acquisition();                   //!< Start the State Machine
-    void set_signal(const Gnss_Signal& gnss_signal_);  //!< Sets the channel GNSS signal
+    inline std::string implementation() override { return implementation_; }
+
+    inline size_t item_size() override { return 0; }
+    inline Gnss_Signal get_signal() const override { return gnss_signal_; }
+
+    void start_acquisition() override;   //!< Start the State Machine
+    void set_signal(const Gnss_Signal& gnss_signal_) override;  //!< Sets the channel GNSS signal
+
+    inline std::shared_ptr<AcquisitionInterface> acquisition(){ return acq_; }
+    inline std::shared_ptr<TrackingInterface> tracking(){ return trk_; }
+    inline std::shared_ptr<TelemetryDecoderInterface> telemetry(){ return nav_; }
 
     void msg_handler_events(pmt::pmt_t msg);
 
-
 private:
     channel_msg_receiver_cc_sptr channel_msg_rx;
     std::shared_ptr<GNSSBlockInterface> pass_through_;
diff --git a/src/algorithms/channel/libs/CMakeLists.txt b/src/algorithms/channel/libs/CMakeLists.txt
index 40dfdbe26..7dddaa5e3 100644
--- a/src/algorithms/channel/libs/CMakeLists.txt
+++ b/src/algorithms/channel/libs/CMakeLists.txt
@@ -22,7 +22,7 @@ set(CHANNEL_FSM_SOURCES
     )
 
 include_directories(
-     $(CMAKE_CURRENT_SOURCE_DIR)
+     ${CMAKE_CURRENT_SOURCE_DIR}
      ${CMAKE_SOURCE_DIR}/src/core/system_parameters
      ${CMAKE_SOURCE_DIR}/src/core/interfaces
      ${CMAKE_SOURCE_DIR}/src/core/receiver
diff --git a/src/algorithms/channel/libs/channel_msg_receiver_cc.cc b/src/algorithms/channel/libs/channel_msg_receiver_cc.cc
index 61b409c5c..573c1aa84 100644
--- a/src/algorithms/channel/libs/channel_msg_receiver_cc.cc
+++ b/src/algorithms/channel/libs/channel_msg_receiver_cc.cc
@@ -94,4 +94,3 @@ channel_msg_receiver_cc::channel_msg_receiver_cc(ChannelFsm* channel_fsm, bool r
 
 channel_msg_receiver_cc::~channel_msg_receiver_cc()
 {}
-
diff --git a/src/algorithms/conditioner/adapters/CMakeLists.txt b/src/algorithms/conditioner/adapters/CMakeLists.txt
index 371a78dc8..f23f3b4f2 100644
--- a/src/algorithms/conditioner/adapters/CMakeLists.txt
+++ b/src/algorithms/conditioner/adapters/CMakeLists.txt
@@ -23,7 +23,7 @@ set(COND_ADAPTER_SOURCES
 )
 
 include_directories(
-     $(CMAKE_CURRENT_SOURCE_DIR)
+     ${CMAKE_CURRENT_SOURCE_DIR}
      ${CMAKE_SOURCE_DIR}/src/core/system_parameters
      ${CMAKE_SOURCE_DIR}/src/core/interfaces
      ${CMAKE_SOURCE_DIR}/src/core/receiver
diff --git a/src/algorithms/conditioner/adapters/array_signal_conditioner.h b/src/algorithms/conditioner/adapters/array_signal_conditioner.h
index d0f100402..b639f1a14 100644
--- a/src/algorithms/conditioner/adapters/array_signal_conditioner.h
+++ b/src/algorithms/conditioner/adapters/array_signal_conditioner.h
@@ -58,19 +58,19 @@ public:
     //! Virtual destructor
     virtual ~ArraySignalConditioner();
 
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+    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;
 
-    std::string role(){ return role_; }
-    //! Returns "Signal_Conditioner"
-    std::string implementation(){ return "Array_Signal_Conditioner"; }
-    size_t item_size(){ return 0; }
+    inline std::string role() override { return role_; }
+    //! Returns "Array_Signal_Conditioner"
+    inline std::string implementation() override { return "Array_Signal_Conditioner"; }
+    inline size_t item_size() override { return 0; }
 
-    std::shared_ptr<GNSSBlockInterface> data_type_adapter(){ return data_type_adapt_; }
-    std::shared_ptr<GNSSBlockInterface> input_filter(){ return in_filt_; }
-    std::shared_ptr<GNSSBlockInterface> resampler(){ return res_; }
+    inline std::shared_ptr<GNSSBlockInterface> data_type_adapter(){ return data_type_adapt_; }
+    inline std::shared_ptr<GNSSBlockInterface> input_filter(){ return in_filt_; }
+    inline std::shared_ptr<GNSSBlockInterface> resampler(){ return res_; }
 
 private:
     std::shared_ptr<GNSSBlockInterface> data_type_adapt_;
@@ -79,7 +79,6 @@ private:
     std::string role_;
     std::string implementation_;
     bool connected_;
-    //bool stop_;
 };
 
 #endif /*GNSS_SDR_SIGNAL_CONDITIONER_H_*/
diff --git a/src/algorithms/conditioner/adapters/signal_conditioner.h b/src/algorithms/conditioner/adapters/signal_conditioner.h
index de830368d..815bf7cec 100644
--- a/src/algorithms/conditioner/adapters/signal_conditioner.h
+++ b/src/algorithms/conditioner/adapters/signal_conditioner.h
@@ -56,19 +56,20 @@ public:
     //! Virtual destructor
     virtual ~SignalConditioner();
 
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+    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;
 
-    std::string role(){ return role_; }
-    //! Returns "Signal_Conditioner"
-    std::string implementation(){ return "Signal_Conditioner"; }
-    size_t item_size(){ return 0; }
+    inline std::string role() override { return role_; }
 
-    std::shared_ptr<GNSSBlockInterface> data_type_adapter(){ return data_type_adapt_; }
-    std::shared_ptr<GNSSBlockInterface> input_filter(){ return in_filt_; }
-    std::shared_ptr<GNSSBlockInterface> resampler(){ return res_; }
+    inline std::string implementation() override { return "Signal_Conditioner"; }  //!< Returns "Signal_Conditioner"
+
+    inline size_t item_size() override { return 0; }
+
+    inline std::shared_ptr<GNSSBlockInterface> data_type_adapter(){ return data_type_adapt_; }
+    inline std::shared_ptr<GNSSBlockInterface> input_filter(){ return in_filt_; }
+    inline std::shared_ptr<GNSSBlockInterface> resampler(){ return res_; }
 
 private:
     std::shared_ptr<GNSSBlockInterface> data_type_adapt_;
@@ -77,7 +78,6 @@ private:
     std::string role_;
     std::string implementation_;
     bool connected_;
-    //bool stop_;
 };
 
 #endif /*GNSS_SDR_SIGNAL_CONDITIONER_H_*/
diff --git a/src/algorithms/data_type_adapter/adapters/CMakeLists.txt b/src/algorithms/data_type_adapter/adapters/CMakeLists.txt
index 659ebf728..a88ffd3e9 100644
--- a/src/algorithms/data_type_adapter/adapters/CMakeLists.txt
+++ b/src/algorithms/data_type_adapter/adapters/CMakeLists.txt
@@ -27,7 +27,7 @@ set(DATATYPE_ADAPTER_SOURCES
 	 )
 
 include_directories(
-     $(CMAKE_CURRENT_SOURCE_DIR)
+     ${CMAKE_CURRENT_SOURCE_DIR}
      ${CMAKE_SOURCE_DIR}/src/core/system_parameters
      ${CMAKE_SOURCE_DIR}/src/core/interfaces
      ${CMAKE_SOURCE_DIR}/src/algorithms/data_type_adapter/gnuradio_blocks
diff --git a/src/algorithms/data_type_adapter/adapters/byte_to_short.h b/src/algorithms/data_type_adapter/adapters/byte_to_short.h
index ff241d5ce..85870ba43 100644
--- a/src/algorithms/data_type_adapter/adapters/byte_to_short.h
+++ b/src/algorithms/data_type_adapter/adapters/byte_to_short.h
@@ -52,24 +52,26 @@ public:
 
     virtual ~ByteToShort();
 
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
+
     //! Returns "Byte_To_Short"
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "Byte_To_Short";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return 0;
     }
 
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+    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:
     gr::blocks::char_to_short::sptr gr_char_to_short_;
@@ -85,4 +87,3 @@ private:
 };
 
 #endif
-
diff --git a/src/algorithms/data_type_adapter/adapters/ibyte_to_cbyte.h b/src/algorithms/data_type_adapter/adapters/ibyte_to_cbyte.h
index 5eafe5587..2aa0d1197 100644
--- a/src/algorithms/data_type_adapter/adapters/ibyte_to_cbyte.h
+++ b/src/algorithms/data_type_adapter/adapters/ibyte_to_cbyte.h
@@ -53,24 +53,26 @@ public:
 
     virtual ~IbyteToCbyte();
 
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
+
     //! Returns "Ibyte_To_Cbyte"
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "Ibyte_To_Cbyte";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return 0;
     }
 
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+    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:
     interleaved_byte_to_complex_byte_sptr ibyte_to_cbyte_;
diff --git a/src/algorithms/data_type_adapter/adapters/ibyte_to_complex.h b/src/algorithms/data_type_adapter/adapters/ibyte_to_complex.h
index 228e15435..50b38f37e 100644
--- a/src/algorithms/data_type_adapter/adapters/ibyte_to_complex.h
+++ b/src/algorithms/data_type_adapter/adapters/ibyte_to_complex.h
@@ -53,24 +53,26 @@ public:
 
     virtual ~IbyteToComplex();
 
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
+
     //! Returns "Ibyte_To_Complex"
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "Ibyte_To_Complex";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return 0;
     }
 
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+    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:
     gr::blocks::interleaved_char_to_complex::sptr gr_interleaved_char_to_complex_;
@@ -86,5 +88,3 @@ private:
 };
 
 #endif
-
-
diff --git a/src/algorithms/data_type_adapter/adapters/ibyte_to_cshort.h b/src/algorithms/data_type_adapter/adapters/ibyte_to_cshort.h
index a5a716aff..71829d6a3 100644
--- a/src/algorithms/data_type_adapter/adapters/ibyte_to_cshort.h
+++ b/src/algorithms/data_type_adapter/adapters/ibyte_to_cshort.h
@@ -53,24 +53,26 @@ public:
 
     virtual ~IbyteToCshort();
 
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
+
     //! Returns "Ibyte_To_Cshort"
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "Ibyte_To_Cshort";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return 0;
     }
 
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+    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:
     interleaved_byte_to_complex_short_sptr interleaved_byte_to_complex_short_;
@@ -86,4 +88,3 @@ private:
 };
 
 #endif
-
diff --git a/src/algorithms/data_type_adapter/adapters/ishort_to_complex.h b/src/algorithms/data_type_adapter/adapters/ishort_to_complex.h
index e12b23bdc..79a2d7162 100644
--- a/src/algorithms/data_type_adapter/adapters/ishort_to_complex.h
+++ b/src/algorithms/data_type_adapter/adapters/ishort_to_complex.h
@@ -52,24 +52,26 @@ public:
 
     virtual ~IshortToComplex();
 
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
+
     //! Returns "Ishort_To_Complex"
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "Ishort_To_Complex";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return 0;
     }
 
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+    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:
     gr::blocks::interleaved_short_to_complex::sptr gr_interleaved_short_to_complex_;
@@ -85,4 +87,3 @@ private:
 };
 
 #endif
-
diff --git a/src/algorithms/data_type_adapter/adapters/ishort_to_cshort.h b/src/algorithms/data_type_adapter/adapters/ishort_to_cshort.h
index 9cc5ae959..cb8080e40 100644
--- a/src/algorithms/data_type_adapter/adapters/ishort_to_cshort.h
+++ b/src/algorithms/data_type_adapter/adapters/ishort_to_cshort.h
@@ -53,24 +53,26 @@ public:
 
     virtual ~IshortToCshort();
 
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
+
     //! Returns "Ishort_To_Cshort"
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "Ishort_To_Cshort";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return 0;
     }
 
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+    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:
     interleaved_short_to_complex_short_sptr interleaved_short_to_complex_short_;
@@ -86,4 +88,3 @@ private:
 };
 
 #endif
-
diff --git a/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt b/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt
index 111c87cf4..afb7a12d7 100644
--- a/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt
+++ b/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt
@@ -24,7 +24,7 @@ set(DATA_TYPE_GR_BLOCKS_SOURCES
 )
 
 include_directories(
-     $(CMAKE_CURRENT_SOURCE_DIR)
+     ${CMAKE_CURRENT_SOURCE_DIR}
      ${GNURADIO_RUNTIME_INCLUDE_DIRS}
      ${VOLK_INCLUDE_DIRS}
 )
diff --git a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_byte.cc b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_byte.cc
index 38a7380e6..9cc6e21f4 100644
--- a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_byte.cc
+++ b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_byte.cc
@@ -55,8 +55,8 @@ int interleaved_byte_to_complex_byte::work(int noutput_items,
         gr_vector_const_void_star &input_items,
         gr_vector_void_star &output_items)
 {
-    const int8_t *in = (const int8_t *) input_items[0];
-    lv_8sc_t *out = (lv_8sc_t *) output_items[0];
+    const int8_t *in = reinterpret_cast<const int8_t *>(input_items[0]);
+    lv_8sc_t *out = reinterpret_cast<lv_8sc_t *>(output_items[0]);
     // This could be put into a Volk kernel
     int8_t real_part;
     int8_t imag_part;
diff --git a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_short.cc b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_short.cc
index 273c51205..c4927d825 100644
--- a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_short.cc
+++ b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_short.cc
@@ -55,8 +55,8 @@ int interleaved_byte_to_complex_short::work(int noutput_items,
         gr_vector_const_void_star &input_items,
         gr_vector_void_star &output_items)
 {
-    const int8_t *in = (const int8_t *) input_items[0];
-    lv_16sc_t *out = (lv_16sc_t *) output_items[0];
+    const int8_t *in = reinterpret_cast<const int8_t *>(input_items[0]);
+    lv_16sc_t *out = reinterpret_cast<lv_16sc_t *>(output_items[0]);
     // This could be put into a Volk kernel
     int8_t real_part;
     int8_t imag_part;
@@ -65,7 +65,7 @@ int interleaved_byte_to_complex_short::work(int noutput_items,
             // lv_cmake(r, i) defined at volk/volk_complex.h
             real_part = *in++;
             imag_part = *in++;
-            *out++ = lv_cmake((int16_t)real_part, (int16_t)imag_part);
+            *out++ = lv_cmake(static_cast<int16_t>(real_part), static_cast<int16_t>(imag_part));
         }
     return noutput_items;
 }
diff --git a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_short_to_complex_short.cc b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_short_to_complex_short.cc
index a6dc2798d..7d13e3c0c 100644
--- a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_short_to_complex_short.cc
+++ b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_short_to_complex_short.cc
@@ -55,8 +55,8 @@ int interleaved_short_to_complex_short::work(int noutput_items,
         gr_vector_const_void_star &input_items,
         gr_vector_void_star &output_items)
 {
-    const int16_t *in = (const int16_t *) input_items[0];
-    lv_16sc_t *out = (lv_16sc_t *) output_items[0];
+    const int16_t *in = reinterpret_cast<const int16_t *>(input_items[0]);
+    lv_16sc_t *out =  reinterpret_cast<lv_16sc_t *>(output_items[0]);
     // This could be put into a Volk kernel
     int16_t real_part;
     int16_t imag_part;
diff --git a/src/algorithms/input_filter/adapters/CMakeLists.txt b/src/algorithms/input_filter/adapters/CMakeLists.txt
index 2cee74880..267ad9062 100644
--- a/src/algorithms/input_filter/adapters/CMakeLists.txt
+++ b/src/algorithms/input_filter/adapters/CMakeLists.txt
@@ -26,7 +26,7 @@ set(INPUT_FILTER_ADAPTER_SOURCES
 )
 
 include_directories(
-     $(CMAKE_CURRENT_SOURCE_DIR)
+     ${CMAKE_CURRENT_SOURCE_DIR}
      ${CMAKE_SOURCE_DIR}/src/core/system_parameters
      ${CMAKE_SOURCE_DIR}/src/core/interfaces
      ${CMAKE_SOURCE_DIR}/src/algorithms/input_filter/gnuradio_blocks
diff --git a/src/algorithms/input_filter/adapters/beamformer_filter.h b/src/algorithms/input_filter/adapters/beamformer_filter.h
index b23d293cd..fce549ebf 100644
--- a/src/algorithms/input_filter/adapters/beamformer_filter.h
+++ b/src/algorithms/input_filter/adapters/beamformer_filter.h
@@ -50,23 +50,27 @@ public:
             unsigned int out_stream);
 
     virtual ~BeamformerFilter();
-    std::string role()
+
+    inline std::string role() override
     {
         return role_;
     }
+
     //! returns "Direct_Resampler"
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "Beamformer_Filter";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return item_size_;
     }
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+
+    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_;
diff --git a/src/algorithms/input_filter/adapters/fir_filter.h b/src/algorithms/input_filter/adapters/fir_filter.h
index 958266cbe..9a5fdc8a1 100644
--- a/src/algorithms/input_filter/adapters/fir_filter.h
+++ b/src/algorithms/input_filter/adapters/fir_filter.h
@@ -70,24 +70,27 @@ public:
 
     //! Destructor
     virtual ~FirFilter();
-    std::string role()
+
+    inline std::string role() override
     {
         return role_;
     }
 
     //! Returns "Fir_Filter"
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "Fir_Filter";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return 0;
     }
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+
+    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:
     gr::filter::fir_filter_ccf::sptr fir_filter_ccf_;
@@ -114,7 +117,6 @@ private:
     gr::blocks::float_to_short::sptr float_to_short_1_;
     gr::blocks::float_to_short::sptr float_to_short_2_;
     short_x2_to_cshort_sptr short_x2_to_cshort_;
-
 };
 
 #endif
diff --git a/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.h b/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.h
index caac52ddc..baaf47c10 100644
--- a/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.h
+++ b/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.h
@@ -68,24 +68,27 @@ public:
             unsigned int out_streams);
 
     virtual ~FreqXlatingFirFilter();
-    std::string role()
+
+    inline std::string role() override
     {
         return role_;
     }
 
     //! Returns "Freq_Xlating_Fir_Filter"
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "Freq_Xlating_Fir_Filter";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return 0;
     }
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+
+    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:
     gr::filter::freq_xlating_fir_filter_ccf::sptr freq_xlating_fir_filter_ccf_;
diff --git a/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc b/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc
index 0786f3f3e..72a98d576 100644
--- a/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc
+++ b/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc
@@ -148,4 +148,3 @@ gr::basic_block_sptr PulseBlankingFilter::get_right_block()
             LOG(ERROR) << " Unknown input filter input/output item type conversion";
         }
 }
-
diff --git a/src/algorithms/input_filter/adapters/pulse_blanking_filter.h b/src/algorithms/input_filter/adapters/pulse_blanking_filter.h
index c57c68d10..18b040bcc 100644
--- a/src/algorithms/input_filter/adapters/pulse_blanking_filter.h
+++ b/src/algorithms/input_filter/adapters/pulse_blanking_filter.h
@@ -48,24 +48,27 @@ public:
             unsigned int out_streams);
 
     virtual ~PulseBlankingFilter();
-    std::string role()
+
+    inline std::string role() override
     {
         return role_;
     }
 
     //! Returns "Pulse_Blanking_Filter"
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "Pulse_Blanking_Filter";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return 0;
     }
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+
+    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:
     ConfigurationInterface* config_;
diff --git a/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt b/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt
index b0ce4a55e..0d169b019 100644
--- a/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt
+++ b/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt
@@ -25,7 +25,7 @@ set(INPUT_FILTER_GR_BLOCKS_SOURCES
 )
 
 include_directories(
-     $(CMAKE_CURRENT_SOURCE_DIR)
+     ${CMAKE_CURRENT_SOURCE_DIR}
      ${GNURADIO_RUNTIME_INCLUDE_DIRS}
      ${GNURADIO_BLOCKS_INCLUDE_DIRS}
      ${VOLK_GNSSSDR_INCLUDE_DIRS}
diff --git a/src/algorithms/input_filter/gnuradio_blocks/beamformer.cc b/src/algorithms/input_filter/gnuradio_blocks/beamformer.cc
index 47a61a877..697d33362 100644
--- a/src/algorithms/input_filter/gnuradio_blocks/beamformer.cc
+++ b/src/algorithms/input_filter/gnuradio_blocks/beamformer.cc
@@ -67,7 +67,7 @@ beamformer::~beamformer()
 int beamformer::work(int noutput_items,gr_vector_const_void_star &input_items,
         gr_vector_void_star &output_items)
 {
-    gr_complex *out = (gr_complex *) output_items[0];
+    gr_complex *out = reinterpret_cast<gr_complex *>(output_items[0]);
     // channel output buffers
     //  gr_complex *ch1 = (gr_complex *) input_items[0];
     //  gr_complex *ch2 = (gr_complex *) input_items[1];
@@ -86,7 +86,7 @@ int beamformer::work(int noutput_items,gr_vector_const_void_star &input_items,
             sum = gr_complex(0,0);
             for (int i = 0; i < GNSS_SDR_BEAMFORMER_CHANNELS; i++)
                 {
-                    sum = sum + ((gr_complex*)input_items[i])[n] * weight_vector[i];
+                    sum = sum + (reinterpret_cast<const gr_complex *>(input_items[i]))[n] * weight_vector[i];
                 }
             out[n] = sum;
         }
diff --git a/src/algorithms/libs/CMakeLists.txt b/src/algorithms/libs/CMakeLists.txt
index f15c9ddb8..e7d8b60bd 100644
--- a/src/algorithms/libs/CMakeLists.txt
+++ b/src/algorithms/libs/CMakeLists.txt
@@ -44,7 +44,7 @@ if(OPENCL_FOUND)
 endif(OPENCL_FOUND)
 
 include_directories(
-     $(CMAKE_CURRENT_SOURCE_DIR)
+     ${CMAKE_CURRENT_SOURCE_DIR}
      ${CMAKE_SOURCE_DIR}/src/core/system_parameters
      ${CMAKE_SOURCE_DIR}/src/core/receiver
      ${CMAKE_SOURCE_DIR}/src/core/interfaces
diff --git a/src/algorithms/libs/byte_x2_to_complex_byte.cc b/src/algorithms/libs/byte_x2_to_complex_byte.cc
index c0da81b6c..2b289cac5 100644
--- a/src/algorithms/libs/byte_x2_to_complex_byte.cc
+++ b/src/algorithms/libs/byte_x2_to_complex_byte.cc
@@ -54,9 +54,9 @@ int byte_x2_to_complex_byte::work(int noutput_items,
         gr_vector_const_void_star &input_items,
         gr_vector_void_star &output_items)
 {
-    const int8_t *in0 = (const int8_t *) input_items[0];
-    const int8_t *in1 = (const int8_t *) input_items[1];
-    lv_8sc_t *out = (lv_8sc_t *) output_items[0];
+    const int8_t *in0 = reinterpret_cast<const int8_t *>(input_items[0]);
+    const int8_t *in1 = reinterpret_cast<const int8_t *>(input_items[1]);
+    lv_8sc_t *out = reinterpret_cast<lv_8sc_t *>(output_items[0]);
     // This could be put into a volk kernel
     int8_t real_part;
     int8_t imag_part;
diff --git a/src/algorithms/libs/complex_byte_to_float_x2.cc b/src/algorithms/libs/complex_byte_to_float_x2.cc
index 0bcdcc909..014b330f3 100644
--- a/src/algorithms/libs/complex_byte_to_float_x2.cc
+++ b/src/algorithms/libs/complex_byte_to_float_x2.cc
@@ -54,9 +54,9 @@ int complex_byte_to_float_x2::work(int noutput_items,
         gr_vector_const_void_star &input_items,
         gr_vector_void_star &output_items)
 {
-    const lv_8sc_t *in = (const lv_8sc_t *) input_items[0];
-    float *out0 = (float*) output_items[0];
-    float *out1 = (float*) output_items[1];
+    const lv_8sc_t *in = reinterpret_cast<const lv_8sc_t *>(input_items[0]);
+    float *out0 = reinterpret_cast<float *>(output_items[0]);
+    float *out1 = reinterpret_cast<float *>(output_items[1]);
     const float scalar = 1;
     volk_8ic_s32f_deinterleave_32f_x2(out0, out1, in, scalar, noutput_items);
     return noutput_items;
diff --git a/src/algorithms/libs/complex_float_to_complex_byte.cc b/src/algorithms/libs/complex_float_to_complex_byte.cc
index 9b659e506..a6934d5b9 100644
--- a/src/algorithms/libs/complex_float_to_complex_byte.cc
+++ b/src/algorithms/libs/complex_float_to_complex_byte.cc
@@ -56,8 +56,8 @@ int complex_float_to_complex_byte::work(int noutput_items,
         gr_vector_const_void_star &input_items,
         gr_vector_void_star &output_items)
 {
-    const gr_complex *in = (const gr_complex *) input_items[0];
-    lv_8sc_t *out = (lv_8sc_t*) output_items[0];
+    const gr_complex *in = reinterpret_cast<const gr_complex *>(input_items[0]);
+    lv_8sc_t *out = reinterpret_cast<lv_8sc_t*>(output_items[0]);
     volk_gnsssdr_32fc_convert_8ic(out, in, noutput_items);
     return noutput_items;
 }
diff --git a/src/algorithms/libs/cshort_to_float_x2.cc b/src/algorithms/libs/cshort_to_float_x2.cc
index 861f1c010..50b2f3d4b 100644
--- a/src/algorithms/libs/cshort_to_float_x2.cc
+++ b/src/algorithms/libs/cshort_to_float_x2.cc
@@ -54,9 +54,9 @@ int cshort_to_float_x2::work(int noutput_items,
         gr_vector_const_void_star &input_items,
         gr_vector_void_star &output_items)
 {
-    const lv_16sc_t *in = (const lv_16sc_t *) input_items[0];
-    float *out0 = (float*) output_items[0];
-    float *out1 = (float*) output_items[1];
+    const lv_16sc_t *in = reinterpret_cast<const lv_16sc_t *>(input_items[0]);
+    float *out0 = reinterpret_cast<float *>(output_items[0]);
+    float *out1 = reinterpret_cast<float *>(output_items[1]);
     const float scalar = 1;
     volk_16ic_s32f_deinterleave_32f_x2(out0, out1, in, scalar, noutput_items);
     return noutput_items;
diff --git a/src/algorithms/libs/galileo_e1_signal_processing.cc b/src/algorithms/libs/galileo_e1_signal_processing.cc
index 93fef2f50..2ea720ec8 100644
--- a/src/algorithms/libs/galileo_e1_signal_processing.cc
+++ b/src/algorithms/libs/galileo_e1_signal_processing.cc
@@ -55,7 +55,6 @@ void galileo_e1_code_gen_int(int* _dest, char _Signal[3], signed int _prn)
                     hex_to_binary_converter(&_dest[index], Galileo_E1_B_PRIMARY_CODE[prn].at(i));
                     index = index + 4;
                 }
-
         }
     else if (_galileo_signal.rfind("1C") != std::string::npos && _galileo_signal.length() >= 2)
         {
@@ -72,8 +71,7 @@ void galileo_e1_code_gen_int(int* _dest, char _Signal[3], signed int _prn)
 }
 
 
-
-void galileo_e1_sinboc_11_gen(std::complex<float>* _dest, int* _prn, unsigned int _length_out)
+void galileo_e1_sinboc_11_gen_int(int* _dest, int* _prn, unsigned int _length_out)
 {
     const unsigned int _length_in = Galileo_E1_B_CODE_LENGTH_CHIPS;
     unsigned int _period = static_cast<unsigned int>( _length_out / _length_in );
@@ -81,18 +79,17 @@ void galileo_e1_sinboc_11_gen(std::complex<float>* _dest, int* _prn, unsigned in
         {
             for (unsigned int j = 0; j < (_period / 2); j++)
                 {
-                    _dest[i * _period + j] = std::complex<float>(static_cast<float>(_prn[i]), 0.0);
+                    _dest[i * _period + j] = _prn[i];
                 }
             for (unsigned int j = (_period / 2); j < _period; j++)
                 {
-                    _dest[i * _period + j] = std::complex<float>(static_cast<float>(- _prn[i]), 0.0);
+                    _dest[i * _period + j] = - _prn[i];
                 }
         }
 }
 
 
-
-void galileo_e1_sinboc_61_gen(std::complex<float>* _dest, int* _prn, unsigned int _length_out)
+void galileo_e1_sinboc_61_gen_int(int* _dest, int* _prn, unsigned int _length_out)
 {
     const unsigned int _length_in = Galileo_E1_B_CODE_LENGTH_CHIPS;
     unsigned int _period = static_cast<unsigned int>(_length_out / _length_in);
@@ -101,42 +98,43 @@ void galileo_e1_sinboc_61_gen(std::complex<float>* _dest, int* _prn, unsigned in
         {
             for (unsigned int j = 0; j < _period; j += 2)
                 {
-                    _dest[i * _period + j] = std::complex<float>(static_cast<float>(_prn[i]), 0.0);
+                    _dest[i * _period + j] = _prn[i];
                 }
             for (unsigned int j = 1; j < _period; j += 2)
                 {
-                    _dest[i * _period + j] = std::complex<float>(static_cast<float>(- _prn[i]), 0.0);
+                    _dest[i * _period + j] = - _prn[i];
                 }
         }
 }
 
 
-
-void galileo_e1_gen(std::complex<float>* _dest, int* _prn, char _Signal[3])
+void galileo_e1_gen_float(float* _dest, int* _prn, char _Signal[3])
 {
     std::string _galileo_signal = _Signal;
     const unsigned int _codeLength = 12 * Galileo_E1_B_CODE_LENGTH_CHIPS;
     const float alpha = sqrt(10.0 / 11.0);
     const float beta = sqrt(1.0 / 11.0);
 
-    std::complex<float> sinboc_11[12 * 4092]; //  _codeLength not accepted by Clang
-    std::complex<float> sinboc_61[12 * 4092];
+    int sinboc_11[12 * 4092]; //  _codeLength not accepted by Clang
+    int sinboc_61[12 * 4092];
 
-    galileo_e1_sinboc_11_gen(sinboc_11, _prn, _codeLength); //generate sinboc(1,1) 12 samples per chip
-    galileo_e1_sinboc_61_gen(sinboc_61, _prn, _codeLength); //generate sinboc(6,1) 12 samples per chip
+    galileo_e1_sinboc_11_gen_int(sinboc_11, _prn, _codeLength); //generate sinboc(1,1) 12 samples per chip
+    galileo_e1_sinboc_61_gen_int(sinboc_61, _prn, _codeLength); //generate sinboc(6,1) 12 samples per chip
 
     if (_galileo_signal.rfind("1B") != std::string::npos && _galileo_signal.length() >= 2)
         {
             for (unsigned int i = 0; i < _codeLength; i++)
                 {
-                    _dest[i] = alpha * sinboc_11[i] + beta * sinboc_61[i];
+                    _dest[i] = alpha * static_cast<float>(sinboc_11[i]) + 
+                        beta * static_cast<float>(sinboc_61[i]);
                 }
         }
     else if (_galileo_signal.rfind("1C") != std::string::npos && _galileo_signal.length() >= 2)
         {
             for (unsigned int i = 0; i < _codeLength; i++)
                 {
-                    _dest[i] = alpha * sinboc_11[i] - beta * sinboc_61[i];
+                    _dest[i] = alpha * static_cast<float>(sinboc_11[i]) - 
+                        beta * static_cast<float>(sinboc_61[i]);
                 }
         }
     else
@@ -144,8 +142,7 @@ void galileo_e1_gen(std::complex<float>* _dest, int* _prn, char _Signal[3])
 }
 
 
-
-void galileo_e1_code_gen_complex_sampled(std::complex<float>* _dest, char _Signal[3],
+void galileo_e1_code_gen_float_sampled(float* _dest, char _Signal[3],
         bool _cboc, unsigned int _prn, signed int _fs, unsigned int _chip_shift,
         bool _secondary_flag)
 {
@@ -159,28 +156,34 @@ void galileo_e1_code_gen_complex_sampled(std::complex<float>* _dest, char _Signa
     const int _samplesPerChip = (_cboc == true) ? 12 : 2;
 
     const unsigned int delay = ((static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS) - _chip_shift)
-                                % static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS))
-                                * _samplesPerCode / Galileo_E1_B_CODE_LENGTH_CHIPS;
+            % static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS))
+            * _samplesPerCode / Galileo_E1_B_CODE_LENGTH_CHIPS;
 
     galileo_e1_code_gen_int(primary_code_E1_chips, _Signal, _prn); //generate Galileo E1 code, 1 sample per chip
 
-    std::complex<float>* _signal_E1;
+    float* _signal_E1;
 
     _codeLength = _samplesPerChip * Galileo_E1_B_CODE_LENGTH_CHIPS;
-    _signal_E1 = new std::complex<float>[_codeLength];
+    _signal_E1 = new float[_codeLength];
 
     if (_cboc == true)
         {
-            galileo_e1_gen(_signal_E1, primary_code_E1_chips, _Signal); //generate cboc 12 samples per chip
+            galileo_e1_gen_float(_signal_E1, primary_code_E1_chips, _Signal); //generate cboc 12 samples per chip
         }
     else
         {
-            galileo_e1_sinboc_11_gen(_signal_E1, primary_code_E1_chips, _codeLength); //generate sinboc(1,1) 2 samples per chip
+            int _signal_E1_int[_codeLength];
+            galileo_e1_sinboc_11_gen_int(_signal_E1_int, primary_code_E1_chips, _codeLength); //generate sinboc(1,1) 2 samples per chip
+
+            for( unsigned int ii = 0; ii < _codeLength; ++ii )
+                {
+                    _signal_E1[ii] = static_cast< float >( _signal_E1_int[ii] );
+                }
         }
 
     if (_fs != _samplesPerChip * _codeFreqBasis)
         {
-            std::complex<float>* _resampled_signal = new std::complex<float>[_samplesPerCode];
+            float* _resampled_signal = new float[_samplesPerCode];
             resampler(_signal_E1, _resampled_signal, _samplesPerChip * _codeFreqBasis, _fs,
                     _codeLength, _samplesPerCode); //resamples code to fs
 
@@ -188,29 +191,24 @@ void galileo_e1_code_gen_complex_sampled(std::complex<float>* _dest, char _Signa
             _signal_E1 = _resampled_signal;
         }
 
-
     if (_galileo_signal.rfind("1C") != std::string::npos && _galileo_signal.length() >= 2 && _secondary_flag)
-    {
+        {
+            float* _signal_E1C_secondary = new float[static_cast<int>(Galileo_E1_C_SECONDARY_CODE_LENGTH) * _samplesPerCode];
 
-        std::complex<float>* _signal_E1C_secondary = new std::complex<float>
-                                                    [static_cast<int>(Galileo_E1_C_SECONDARY_CODE_LENGTH)
-                                                    * _samplesPerCode];
+            for (unsigned int i = 0; i < static_cast<unsigned int>(Galileo_E1_C_SECONDARY_CODE_LENGTH); i++)
+                {
+                    for (unsigned k = 0; k < _samplesPerCode; k++)
+                        {
+                            _signal_E1C_secondary[i*_samplesPerCode + k] = _signal_E1[k]
+                                 * (Galileo_E1_C_SECONDARY_CODE.at(i) == '0' ? 1.0f : -1.0f);
+                        }
+                }
 
-        for (unsigned int i = 0; i < static_cast<unsigned int>(Galileo_E1_C_SECONDARY_CODE_LENGTH); i++)
-            {
-                for (unsigned k = 0; k < _samplesPerCode; k++)
-                    {
-                        _signal_E1C_secondary[i*_samplesPerCode + k] = _signal_E1[k]
-                                * (Galileo_E1_C_SECONDARY_CODE.at(i) == '0'
-                                   ? std::complex<float>(1,0) : std::complex<float>(-1,0));
-                    }
-            }
+            _samplesPerCode *= static_cast<int>(Galileo_E1_C_SECONDARY_CODE_LENGTH);
 
-        _samplesPerCode *= static_cast<int>(Galileo_E1_C_SECONDARY_CODE_LENGTH);
-
-        delete[] _signal_E1;
-        _signal_E1 = _signal_E1C_secondary;
-    }
+            delete[] _signal_E1;
+            _signal_E1 = _signal_E1C_secondary;
+        }
 
     for (unsigned int i = 0; i < _samplesPerCode; i++)
         {
@@ -221,6 +219,38 @@ void galileo_e1_code_gen_complex_sampled(std::complex<float>* _dest, char _Signa
 }
 
 
+void galileo_e1_code_gen_complex_sampled(std::complex<float>* _dest, char _Signal[3],
+        bool _cboc, unsigned int _prn, signed int _fs, unsigned int _chip_shift,
+        bool _secondary_flag)
+{
+    std::string _galileo_signal = _Signal;
+    const int _codeFreqBasis = Galileo_E1_CODE_CHIP_RATE_HZ; //Hz
+    unsigned int _samplesPerCode = static_cast<unsigned int>( static_cast<double>(_fs) /
+            (static_cast<double>(_codeFreqBasis )  / static_cast<double>(Galileo_E1_B_CODE_LENGTH_CHIPS)));
+
+    if (_galileo_signal.rfind("1C") != std::string::npos && _galileo_signal.length() >= 2 && _secondary_flag)
+        {
+            _samplesPerCode *= static_cast<int>(Galileo_E1_C_SECONDARY_CODE_LENGTH);
+        }
+
+    float real_code[_samplesPerCode];
+
+    galileo_e1_code_gen_float_sampled( real_code, _Signal, _cboc, _prn, _fs, _chip_shift, _secondary_flag );
+
+    for( unsigned int ii = 0; ii < _samplesPerCode; ++ii )
+        {
+            _dest[ii] = std::complex< float >( real_code[ii], 0.0f );
+        }
+}
+
+
+void galileo_e1_code_gen_float_sampled(float* _dest, char _Signal[3],
+        bool _cboc, unsigned int _prn, signed int _fs, unsigned int _chip_shift)
+{
+    galileo_e1_code_gen_float_sampled(_dest, _Signal, _cboc, _prn, _fs, _chip_shift, false);
+}
+
+
 void galileo_e1_code_gen_complex_sampled(std::complex<float>* _dest, char _Signal[3],
         bool _cboc, unsigned int _prn, signed int _fs, unsigned int _chip_shift)
 {
diff --git a/src/algorithms/libs/galileo_e1_signal_processing.h b/src/algorithms/libs/galileo_e1_signal_processing.h
index d7518ab04..f7c670129 100644
--- a/src/algorithms/libs/galileo_e1_signal_processing.h
+++ b/src/algorithms/libs/galileo_e1_signal_processing.h
@@ -36,30 +36,22 @@
 
 
 /*!
- * \brief This function generates Galileo E1 code (one sample per chip).
+ * \brief This function generates Galileo E1 code (can select E1B or E1C, cboc or sinboc
+ * and the sample frequency _fs).
  *
  */
-void galileo_e1_code_gen_int(int* _dest, char _Signal[3], signed int _prn);
+void galileo_e1_code_gen_float_sampled(float* _dest, char _Signal[3],
+        bool _cboc, unsigned int _prn, signed int _fs, unsigned int _chip_shift,
+        bool _secondary_flag);
 
 /*!
- * \brief This function generates Galileo E1 sinboc(1,1) code (minimum 2 samples per chip),
- * the _codeLength variable must be a multiple of 2*4092.
+ * \brief This function generates Galileo E1 code (can select E1B or E1C, cboc or sinboc
+ * and the sample frequency _fs).
  *
  */
-void galileo_e1_sinboc_11_gen(std::complex<float>* _dest, int* _prn,
-        unsigned int _codeLength);
-/*!
- * \brief This function generates Galileo E1 sinboc(6,1) code (minimum 12 samples per chip),
- * the _codeLength variable must be a multiple of 12*4092.
- *
- */
-void galileo_e1_sinboc_61_gen(std::complex<float>* _dest, int* _prn,
-        unsigned int _codeLength);
-/*!
- * \brief This function generates Galileo E1 cboc code (12 samples per chip).
- *
- */
-void galileo_e1_cboc_gen(std::complex<float>* _dest, int* _prn, char _Signal[3]);
+void galileo_e1_code_gen_float_sampled(float* _dest, char _Signal[3],
+        bool _cboc, unsigned int _prn, signed int _fs, unsigned int _chip_shift);
+
 /*!
  * \brief This function generates Galileo E1 code (can select E1B or E1C, cboc or sinboc
  * and the sample frequency _fs).
diff --git a/src/algorithms/libs/gnss_sdr_sample_counter.cc b/src/algorithms/libs/gnss_sdr_sample_counter.cc
index ec93ce09c..026e08548 100644
--- a/src/algorithms/libs/gnss_sdr_sample_counter.cc
+++ b/src/algorithms/libs/gnss_sdr_sample_counter.cc
@@ -38,9 +38,9 @@ gnss_sdr_sample_counter::gnss_sdr_sample_counter () : gr::sync_block("sample_cou
                 gr::io_signature::make(0,0,0))
 {
     this->message_port_register_out(pmt::mp("sample_counter"));
-    last_T_rx_s=0;
-    report_interval_s=1;//default reporting 1 second
-    flag_enable_send_msg=false; //enable it for reporting time with asynchronous message
+    last_T_rx_s = 0;
+    report_interval_s = 1;//default reporting 1 second
+    flag_enable_send_msg = false; //enable it for reporting time with asynchronous message
 }
 
 
@@ -53,19 +53,19 @@ gnss_sdr_sample_counter_sptr gnss_sdr_make_sample_counter ()
 
 int gnss_sdr_sample_counter::work (int noutput_items,
         gr_vector_const_void_star &input_items,
-        gr_vector_void_star &output_items)
+        gr_vector_void_star &output_items __attribute__((unused)))
 {
-    const Gnss_Synchro *in = (const Gnss_Synchro *)  input_items[0]; // input
+    const Gnss_Synchro *in = reinterpret_cast<const Gnss_Synchro *>(input_items[0]); // input
 
-    double current_T_rx_s=in[noutput_items-1].Tracking_sample_counter/(double)in[noutput_items-1].fs;
-    if ((current_T_rx_s-last_T_rx_s)>report_interval_s)
-    {
-        std::cout<<"Current receiver time: "<<floor(current_T_rx_s)<<" [s]"<<std::endl;
-        if(flag_enable_send_msg==true)
+    double current_T_rx_s = in[noutput_items - 1].Tracking_sample_counter / static_cast<double>(in[noutput_items - 1].fs);
+    if ((current_T_rx_s - last_T_rx_s) > report_interval_s)
         {
-            this->message_port_pub(pmt::mp("receiver_time"), pmt::from_double(current_T_rx_s));
+            std::cout << "Current receiver time: " << floor(current_T_rx_s) << " [s]" << std::endl;
+            if(flag_enable_send_msg == true)
+                {
+                    this->message_port_pub(pmt::mp("receiver_time"), pmt::from_double(current_T_rx_s));
+                }
+            last_T_rx_s = current_T_rx_s;
         }
-        last_T_rx_s=current_T_rx_s;
-    }
     return noutput_items;
 }
diff --git a/src/algorithms/libs/gnss_sdr_valve.cc b/src/algorithms/libs/gnss_sdr_valve.cc
index 981e8072c..152bdbe84 100644
--- a/src/algorithms/libs/gnss_sdr_valve.cc
+++ b/src/algorithms/libs/gnss_sdr_valve.cc
@@ -32,6 +32,7 @@
 
 #include "gnss_sdr_valve.h"
 #include <algorithm> // for min
+#include <cstring>  // for memcpy
 #include <gnuradio/io_signature.h>
 #include "control_message_factory.h"
 
@@ -63,9 +64,13 @@ int gnss_sdr_valve::work (int noutput_items,
             delete cmf;
             return -1;    // Done!
         }
-    unsigned long long n = std::min(d_nitems - d_ncopied_items, (long long unsigned int)noutput_items);
+    unsigned long long n = std::min(d_nitems - d_ncopied_items, static_cast<long long unsigned int>(noutput_items));
     if (n == 0) return 0;
     memcpy (output_items[0], input_items[0], n * input_signature()->sizeof_stream_item(0));
+    //for(long long i = 0; i++; i<n)
+    //    {
+    //        output_items[i] = input_items[i];
+    //    }
     d_ncopied_items += n;
     return n;
 }
diff --git a/src/algorithms/libs/gnss_sdr_valve.h b/src/algorithms/libs/gnss_sdr_valve.h
index 7ea1d7961..54aa374d7 100644
--- a/src/algorithms/libs/gnss_sdr_valve.h
+++ b/src/algorithms/libs/gnss_sdr_valve.h
@@ -33,7 +33,6 @@
 #ifndef GNSS_SDR_GNSS_SDR_VALVE_H_
 #define GNSS_SDR_GNSS_SDR_VALVE_H_
 
-#include <cstring>
 #include <gnuradio/sync_block.h>
 #include <gnuradio/msg_queue.h>
 #include <boost/shared_ptr.hpp>
@@ -54,8 +53,8 @@ class gnss_sdr_valve : public gr::sync_block
     gnss_sdr_valve (size_t sizeof_stream_item,
             unsigned long long nitems,
             gr::msg_queue::sptr queue);
-    unsigned long long    d_nitems;
-    unsigned long long    d_ncopied_items;
+    unsigned long long d_nitems;
+    unsigned long long d_ncopied_items;
     gr::msg_queue::sptr d_queue;
 
 public:
diff --git a/src/algorithms/libs/gnss_signal_processing.cc b/src/algorithms/libs/gnss_signal_processing.cc
index 86738f062..9666b1d0d 100644
--- a/src/algorithms/libs/gnss_signal_processing.cc
+++ b/src/algorithms/libs/gnss_signal_processing.cc
@@ -156,6 +156,28 @@ void hex_to_binary_converter(int * _dest, char _from)
     }
 }
 
+void resampler(float* _from, float* _dest, float _fs_in,
+        float _fs_out, unsigned int _length_in, unsigned int _length_out)
+{
+    unsigned int _codeValueIndex;
+    float aux;
+    //--- Find time constants --------------------------------------------------
+    const float _t_in = 1 / _fs_in;  // Incoming sampling  period in sec
+    const float _t_out = 1 / _fs_out;   // Out sampling period in sec
+    for (unsigned int i = 0; i < _length_out - 1; i++)
+        {
+            //=== Digitizing =======================================================
+            //--- compute index array to read sampled values -------------------------
+            //_codeValueIndex = ceil((_t_out * ((float)i + 1)) / _t_in) - 1;
+            aux = (_t_out * (i + 1)) / _t_in;
+            _codeValueIndex = auxCeil2(aux) - 1;
+
+            //if repeat the chip -> upsample by nearest neighborhood interpolation
+            _dest[i] = _from[_codeValueIndex];
+        }
+    //--- Correct the last index (due to number rounding issues) -----------
+    _dest[_length_out - 1] = _from[_length_in - 1];
+}
 
 void resampler(std::complex<float>* _from, std::complex<float>* _dest, float _fs_in,
         float _fs_out, unsigned int _length_in, unsigned int _length_out)
diff --git a/src/algorithms/libs/gnss_signal_processing.h b/src/algorithms/libs/gnss_signal_processing.h
index 2449dfaea..b75cb71c5 100644
--- a/src/algorithms/libs/gnss_signal_processing.h
+++ b/src/algorithms/libs/gnss_signal_processing.h
@@ -60,6 +60,13 @@ void complex_exp_gen_conj(std::complex<float>* _dest, double _f, double _fs,
  */
 void hex_to_binary_converter(int * _dest, char _from);
 
+/*!
+ * \brief This function resamples a sequence of float values.
+ *
+ */
+void resampler(float* _from, float* _dest,
+        float _fs_in, float _fs_out, unsigned int _length_in,
+        unsigned int _length_out);
 /*!
  * \brief This function resamples a sequence of complex values.
  *
diff --git a/src/algorithms/libs/gps_l2c_signal.cc b/src/algorithms/libs/gps_l2c_signal.cc
index d4e9cd22e..4bd44a994 100644
--- a/src/algorithms/libs/gps_l2c_signal.cc
+++ b/src/algorithms/libs/gps_l2c_signal.cc
@@ -48,7 +48,7 @@ void gps_l2c_m_code(int32_t * _dest, unsigned int _prn)
     x = GPS_L2C_M_INIT_REG[ _prn - 1];
     for (int n = 0; n < GPS_L2_M_CODE_LENGTH_CHIPS; n++)
         {
-            _dest[n] = (int8_t)(x&1);
+            _dest[n] = static_cast<int8_t>(x&1);
             x = gps_l2c_m_shift(x);
         }
 }
@@ -102,7 +102,7 @@ void gps_l2c_m_code_gen_complex_sampled(std::complex<float>* _dest, unsigned int
 
             //--- Make index array to read L2C code values -------------------------
             //TODO: Check this formula! Seems to start with an extra sample
-            _codeValueIndex = ceil((_ts * ((float)i + 1)) / _tc) - 1;
+            _codeValueIndex = ceil((_ts * (static_cast<float>(i) + 1)) / _tc) - 1;
             //aux = (_ts * (i + 1)) / _tc;
             //_codeValueIndex = static_cast<int>(static_cast<long>(aux)) - 1;
 
diff --git a/src/algorithms/libs/gps_sdr_signal_processing.cc b/src/algorithms/libs/gps_sdr_signal_processing.cc
index a88ea5119..1ddb8976a 100644
--- a/src/algorithms/libs/gps_sdr_signal_processing.cc
+++ b/src/algorithms/libs/gps_sdr_signal_processing.cc
@@ -34,7 +34,7 @@
 
 auto auxCeil = [](float x){ return static_cast<int>(static_cast<long>((x)+1)); };
 
-void gps_l1_ca_code_gen_complex(std::complex<float>* _dest, signed int _prn, unsigned int _chip_shift)
+void gps_l1_ca_code_gen_int(int* _dest, signed int _prn, unsigned int _chip_shift)
 {
     const unsigned int _code_length = 1023;
     bool G1[_code_length];
@@ -102,11 +102,11 @@ void gps_l1_ca_code_gen_complex(std::complex<float>* _dest, signed int _prn, uns
             aux = G1[(lcv + _chip_shift) % _code_length]^G2[delay];
             if(aux == true)
                 {
-                    _dest[lcv] = std::complex<float>(1, 0);
+                    _dest[lcv] = 1;
                 }
             else
                 {
-                    _dest[lcv] = std::complex<float>(-1, 0);
+                    _dest[lcv] = -1;
                 }
             delay++;
             delay %= _code_length;
@@ -114,6 +114,33 @@ void gps_l1_ca_code_gen_complex(std::complex<float>* _dest, signed int _prn, uns
 }
 
 
+void gps_l1_ca_code_gen_float(float* _dest, signed int _prn, unsigned int _chip_shift)
+{
+    unsigned int _code_length = 1023;
+    int ca_code_int[ _code_length ];
+
+    gps_l1_ca_code_gen_int( ca_code_int, _prn, _chip_shift );
+
+    for( unsigned int ii = 0; ii < _code_length; ++ii )
+        {
+            _dest[ii] = static_cast<float>( ca_code_int[ii] );
+        }
+}
+
+
+void gps_l1_ca_code_gen_complex(std::complex<float>* _dest, signed int _prn, unsigned int _chip_shift)
+{
+    unsigned int _code_length = 1023;
+    int ca_code_int[ _code_length ];
+
+    gps_l1_ca_code_gen_int( ca_code_int, _prn, _chip_shift );
+
+    for( unsigned int ii = 0; ii < _code_length; ++ii )
+        {
+            _dest[ii] = std::complex<float>( static_cast<float>(ca_code_int[ii]), 0.0f );
+        }
+}
+
 
 /*
  *  Generates complex GPS L1 C/A code for the desired SV ID and sampled to specific sampling frequency
diff --git a/src/algorithms/libs/gps_sdr_signal_processing.h b/src/algorithms/libs/gps_sdr_signal_processing.h
index 2f01b5647..bd41ca8a3 100644
--- a/src/algorithms/libs/gps_sdr_signal_processing.h
+++ b/src/algorithms/libs/gps_sdr_signal_processing.h
@@ -35,6 +35,12 @@
 
 #include <complex>
 
+//!Generates int GPS L1 C/A code for the desired SV ID and code shift 
+void gps_l1_ca_code_gen_int(int* _dest, signed int _prn, unsigned int _chip_shift);
+
+//!Generates float GPS L1 C/A code for the desired SV ID and code shift 
+void gps_l1_ca_code_gen_float(float* _dest, signed int _prn, unsigned int _chip_shift);
+
 //!Generates complex GPS L1 C/A code for the desired SV ID and code shift, and sampled to specific sampling frequency
 void gps_l1_ca_code_gen_complex(std::complex<float>* _dest, signed int _prn, unsigned int _chip_shift);
 
diff --git a/src/algorithms/libs/pass_through.h b/src/algorithms/libs/pass_through.h
index b8f394ee2..02cc1647f 100644
--- a/src/algorithms/libs/pass_through.h
+++ b/src/algorithms/libs/pass_through.h
@@ -52,31 +52,37 @@ public:
             unsigned int out_stream);
 
     virtual ~Pass_Through();
-    std::string role()
+
+    inline std::string role() override
     {
         return role_;
     }
+
     //! returns "Pass_Through"
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "Pass_Through";
     }
-    std::string item_type()
+
+    inline std::string item_type() const
     {
         return item_type_;
     }
-    size_t vector_size()
+
+    inline size_t vector_size() const
     {
         return vector_size_;
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return item_size_;
     }
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+    
+    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 item_type_;
diff --git a/src/algorithms/libs/rtklib/CMakeLists.txt b/src/algorithms/libs/rtklib/CMakeLists.txt
index 3640f45e4..d2fbe78c9 100644
--- a/src/algorithms/libs/rtklib/CMakeLists.txt
+++ b/src/algorithms/libs/rtklib/CMakeLists.txt
@@ -39,7 +39,7 @@ set(RTKLIB_LIB_SOURCES
 )
 
 include_directories(
-     $(CMAKE_CURRENT_SOURCE_DIR)
+     ${CMAKE_CURRENT_SOURCE_DIR}
      ${CMAKE_SOURCE_DIR}/src/core/system_parameters
      ${CMAKE_SOURCE_DIR}/src/core/interfaces
      ${CMAKE_SOURCE_DIR}/src/core/receiver
diff --git a/src/algorithms/libs/rtklib/rtklib.h b/src/algorithms/libs/rtklib/rtklib.h
index 1d0b6df1d..ec0274b71 100644
--- a/src/algorithms/libs/rtklib/rtklib.h
+++ b/src/algorithms/libs/rtklib/rtklib.h
@@ -53,15 +53,13 @@
 #ifndef GNSS_SDR_RTKLIB_H_
 #define GNSS_SDR_RTKLIB_H_
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <cstring>
-#include <cmath>
-#include <time.h>
-#include <ctype.h>
 #include <pthread.h>
 #include <netinet/in.h>
+#include <cctype>
+#include <cmath>
+#include <cstdarg>
+#include <cstdio>
+#include <cstdlib>
 #include "MATH_CONSTANTS.h"
 #include "gnss_frequencies.h"
 #include "gnss_obs_codes.h"
diff --git a/src/algorithms/libs/rtklib/rtklib_ephemeris.cc b/src/algorithms/libs/rtklib/rtklib_ephemeris.cc
index 07954f822..7fb213366 100644
--- a/src/algorithms/libs/rtklib/rtklib_ephemeris.cc
+++ b/src/algorithms/libs/rtklib/rtklib_ephemeris.cc
@@ -92,7 +92,7 @@ double var_uraeph(int ura)
             2.4, 3.4, 4.85, 6.85, 9.65, 13.65, 24.0, 48.0, 96.0, 192.0, 384.0, 768.0, 1536.0,
             3072.0, 6144.0
     };
-    return ura < 0 || 15 < ura ? std::pow(6144.0, 2.0) : std::pow(ura_value[ura], 2.0);
+    return ura < 0 || 14 < ura ? std::pow(6144.0, 2.0) : std::pow(ura_value[ura], 2.0);
 }
 
 
diff --git a/src/algorithms/libs/rtklib/rtklib_ionex.cc b/src/algorithms/libs/rtklib/rtklib_ionex.cc
index 404cd34f9..c70a43fa6 100644
--- a/src/algorithms/libs/rtklib/rtklib_ionex.cc
+++ b/src/algorithms/libs/rtklib/rtklib_ionex.cc
@@ -394,15 +394,18 @@ void readtec(const char *file, nav_t *nav, int opt)
                     trace(2, "ionex file open error %s\n", efiles[i]);
                     continue;
                 }
-            /* read ionex header */
-            if (readionexh(fp, lats, lons, hgts, &rb, &nexp, dcb, rms) <= 0.0)
+            else
                 {
-                    trace(2, "ionex file format error %s\n", efiles[i]);
-                    continue;
+                    /* read ionex header */
+                    if (readionexh(fp, lats, lons, hgts, &rb, &nexp, dcb, rms) <= 0.0)
+                        {
+                            trace(2, "ionex file format error %s\n", efiles[i]);
+                            fclose(fp);
+                            continue;
+                        }
+                    /* read ionex body */
+                    readionexb(fp, lats, lons, hgts, rb, nexp, nav);
                 }
-            /* read ionex body */
-            readionexb(fp, lats, lons, hgts, rb, nexp, nav);
-
             fclose(fp);
         }
     for (i = 0; i < MAXEXFILE; i++) free(efiles[i]);
diff --git a/src/algorithms/libs/rtklib/rtklib_pntpos.cc b/src/algorithms/libs/rtklib/rtklib_pntpos.cc
index 1f95ba32f..6bf14c19e 100644
--- a/src/algorithms/libs/rtklib/rtklib_pntpos.cc
+++ b/src/algorithms/libs/rtklib/rtklib_pntpos.cc
@@ -364,7 +364,8 @@ int valsol(const double *azel, const int *vsat, int n,
         const prcopt_t *opt, const double *v, int nv, int nx,
         char *msg)
 {
-    double azels[MAXOBS*2], dop[4], vv;
+    double azels[MAXOBS*2] = {0};
+    double dop[4], vv;
     int i, ns;
 
     trace(3, "valsol  : n=%d nv=%d\n", n, nv);
diff --git a/src/algorithms/libs/rtklib/rtklib_ppp.cc b/src/algorithms/libs/rtklib/rtklib_ppp.cc
index 5fe24ed68..96ccb7237 100644
--- a/src/algorithms/libs/rtklib/rtklib_ppp.cc
+++ b/src/algorithms/libs/rtklib/rtklib_ppp.cc
@@ -461,7 +461,11 @@ int fix_amb_ILS(rtk_t *rtk, int *sat1, int *sat2, int *NW, int n)
             sat2[m] = sat2[i];
             NW[m++] = NW[i];
         }
-    if (m<3) return 0;
+    if (m<3)
+        {
+            free(B1); free(N1); free(D); free(E); free(Q); free(NC);
+            return 0;
+        }
 
     /* covariance of narrow-lane ambiguities */
     matmul("TN", m, rtk->nx, rtk->nx, 1.0, D, rtk->P, 0.0, E);
@@ -471,9 +475,14 @@ int fix_amb_ILS(rtk_t *rtk, int *sat1, int *sat2, int *NW, int n)
     if ((info = lambda(m, 2, B1, Q, N1, s)))
         {
             trace(2, "lambda error: info=%d\n", info);
+            free(B1); free(N1); free(D); free(E); free(Q); free(NC);
+            return 0;
+        }
+    if (s[0] <= 0.0)
+        {
+            free(B1); free(N1); free(D); free(E); free(Q); free(NC);
             return 0;
         }
-    if (s[0] <= 0.0) return 0;
 
     rtk->sol.ratio = (float)(MIN_PPP(s[1]/s[0], 999.9));
 
@@ -481,6 +490,7 @@ int fix_amb_ILS(rtk_t *rtk, int *sat1, int *sat2, int *NW, int n)
     if (rtk->opt.thresar[0]>0.0 && rtk->sol.ratio<rtk->opt.thresar[0])
         {
             trace(2, "varidation error: n=%2d ratio=%8.3f\n", m, rtk->sol.ratio);
+            free(B1); free(N1); free(D); free(E); free(Q); free(NC);
             return 0;
         }
     trace(2, "varidation ok: %s n=%2d ratio=%8.3f\n", time_str(rtk->sol.time, 0), m,
@@ -889,7 +899,7 @@ void testeclipse(const obsd_t *obs, int n, const nav_t *nav, double *rs)
 
     /* unit vector of sun direction (ecef) */
     sunmoonpos(gpst2utc(obs[0].time), erpv, rsun, NULL, NULL);
-    normv3(rsun, esun);
+    if(normv3(rsun, esun) == 0) trace(1, "Error computing the norm");
 
     for (i = 0;i<n;i++)
         {
diff --git a/src/algorithms/libs/rtklib/rtklib_preceph.cc b/src/algorithms/libs/rtklib/rtklib_preceph.cc
index 1b42081e1..2e4d73911 100644
--- a/src/algorithms/libs/rtklib/rtklib_preceph.cc
+++ b/src/algorithms/libs/rtklib/rtklib_preceph.cc
@@ -355,8 +355,7 @@ void readsp3(const char *file, nav_t *nav, int opt)
  *-----------------------------------------------------------------------------*/
 int readsap(const char *file, gtime_t time, nav_t *nav)
 {
-    pcv_t aux = { 0, {}, {}, {0,0}, {0,0}, {{},{}}, {{},{}} };
-    pcvs_t pcvs = {0, 0, &aux };
+    pcvs_t pcvs = {0, 0, (pcv_t*){ 0 } };
     pcv_t pcv0 = { 0, {}, {}, {0,0}, {0,0}, {{},{}}, {{},{}} }, *pcv;
     int i;
 
@@ -369,7 +368,7 @@ int readsap(const char *file, gtime_t time, nav_t *nav)
             pcv = searchpcv(i + 1, "", time, &pcvs);
             nav->pcvs[i] = pcv ? *pcv : pcv0;
         }
-    free(pcvs.pcv);
+    free(pcv);
     return 1;
 }
 
@@ -530,7 +529,11 @@ int readfcbf(const char *file, nav_t *nav)
             if (!(sat = satid2no(str))) continue;
             ts = epoch2time(ep1);
             te = epoch2time(ep2);
-            if (!addfcb(nav, ts, te, sat, bias, std)) return 0;
+            if (!addfcb(nav, ts, te, sat, bias, std))
+                {
+                    fclose(fp);
+                    return 0;
+                }
         }
     fclose(fp);
     return 1;
diff --git a/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc b/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc
index 252880b5b..1d569997e 100644
--- a/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc
+++ b/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc
@@ -51,12 +51,9 @@
  *----------------------------------------------------------------------------*/
 
 #include "rtklib_rtkcmn.h"
-//#include <stdarg.h>
-//#include <ctype.h>
-#include <cstdio>
+//#include <cstdio>
 #include <dirent.h>
 #include <iostream>
-//#include <time.h>
 #include <sys/time.h>
 #include <sys/stat.h>
 #include <sys/types.h>
@@ -567,13 +564,20 @@ void setcodepri(int sys, int freq, const char *pri)
     trace(3, "setcodepri : sys=%d freq=%d pri=%s\n", sys, freq, pri);
 
     if (freq <= 0 || MAXFREQ<freq) return;
-    if (sys&SYS_GPS) strcpy(codepris[0][freq-1], pri);
-    if (sys&SYS_GLO) strcpy(codepris[1][freq-1], pri);
-    if (sys&SYS_GAL) strcpy(codepris[2][freq-1], pri);
-    if (sys&SYS_QZS) strcpy(codepris[3][freq-1], pri);
-    if (sys&SYS_SBS) strcpy(codepris[4][freq-1], pri);
-    if (sys&SYS_BDS) strcpy(codepris[5][freq-1], pri);
-    if (sys&SYS_IRN) strcpy(codepris[6][freq-1], pri);
+    if(strlen(pri) < 17)
+        {
+            if (sys&SYS_GPS) strcpy(codepris[0][freq-1], pri);
+            if (sys&SYS_GLO) strcpy(codepris[1][freq-1], pri);
+            if (sys&SYS_GAL) strcpy(codepris[2][freq-1], pri);
+            if (sys&SYS_QZS) strcpy(codepris[3][freq-1], pri);
+            if (sys&SYS_SBS) strcpy(codepris[4][freq-1], pri);
+            if (sys&SYS_BDS) strcpy(codepris[5][freq-1], pri);
+            if (sys&SYS_IRN) strcpy(codepris[6][freq-1], pri);
+        }
+    else
+        {
+                trace(1, "pri array is too long");
+        }
 }
 
 
@@ -1163,7 +1167,11 @@ double str2num(const char *s, int i, int n)
     char str[256], *p = str;
 
     if (i<0 || (int)strlen(s)<i || (int)sizeof(str)-1<n) return 0.0;
-    for (s += i; *s && --n >= 0; s++) *p++=*s == 'd' || *s == 'D' ? 'E' : *s; *p = '\0';
+    for (s += i; *s && --n >= 0; s++)
+        {
+            *p++=*s == 'd' || *s == 'D' ? 'E' : *s;
+        }
+    *p = '\0';
     return sscanf(str, "%lf", &value) == 1 ? value : 0.0;
 }
 
@@ -1181,7 +1189,11 @@ int str2time(const char *s, int i, int n, gtime_t *t)
     char str[256], *p = str;
 
     if (i<0 || (int)strlen(s)<i || (int)sizeof(str)-1<i) return -1;
-    for (s += i; *s && --n >= 0;) *p++=*s++; *p = '\0';
+    for (s += i; *s && --n >= 0;)
+        {
+            *p++=*s++;
+        }
+    *p = '\0';
     if (sscanf(str, "%lf %lf %lf %lf %lf %lf", ep, ep+1, ep+2, ep+3, ep+4, ep+5)<6)
         return -1;
     if (ep[0]<100.0) ep[0] += ep[0]<80.0 ? 2000.0 : 1900.0;
@@ -2133,7 +2145,7 @@ int readngspcv(const char *file, pcvs_t *pcvs)
 {
     FILE *fp;
     static const pcv_t pcv0 = {0, {}, {}, {0,0}, {0,0}, {{},{}}, {{},{}} };
-    pcv_t pcv;
+    pcv_t pcv = {0, {}, {}, {0,0}, {0,0}, {{},{}}, {{},{}} };
     double neu[3];
     int n = 0;
     char buff[256];
@@ -2187,7 +2199,7 @@ int readantex(const char *file, pcvs_t *pcvs)
 {
     FILE *fp;
     static const pcv_t pcv0 = {0, {}, {}, {0,0}, {0,0}, {{},{}}, {{},{}} };
-    pcv_t pcv;
+    pcv_t pcv = {0, {}, {}, {0,0}, {0,0}, {{},{}}, {{},{}} };
     double neu[3];
     int i, f, freq = 0, state = 0, freqs[] = {1, 2, 5, 6, 7, 8, 0};
     char buff[256];
@@ -2317,12 +2329,13 @@ pcv_t *searchpcv(int sat, const char *type, gtime_t time,
         const pcvs_t *pcvs)
 {
     pcv_t *pcv;
-    char buff[MAXANT], *types[2], *p;
+    char buff[MAXANT] = "", *types[2], *p;
     int i, j, n = 0;
 
     trace(3, "searchpcv: sat=%2d type=%s\n", sat, type);
 
-    if (sat) { /* search satellite antenna */
+    if (sat)
+        { /* search satellite antenna */
             for (i = 0; i<pcvs->n; i++)
                 {
                     pcv = pcvs->pcv+i;
@@ -2331,10 +2344,14 @@ pcv_t *searchpcv(int sat, const char *type, gtime_t time,
                     if (pcv->te.time != 0 && timediff(pcv->te, time)<0.0) continue;
                     return pcv;
                 }
-    }
+        }
     else
         {
-            strcpy(buff, type);
+            if(strlen(type) < MAXANT +1 ) strcpy(buff, type);
+            else
+                {
+                    trace(1, "type array is too long");
+                }
             for (p = strtok(buff, " "); p && n<2; p = strtok(NULL, " ")) types[n++] = p;
             if (n <= 0) return NULL;
 
@@ -3013,7 +3030,8 @@ void traceopen(const char *file)
 
     reppath(file, path, time, "", "");
     if (!*path || !(fp_trace = fopen(path, "w"))) fp_trace = stderr;
-    strcpy(file_trace, file);
+    if (strlen(file) < 1025) strcpy(file_trace, file);
+    else trace(1, "file array is too long");
     tick_trace = tickget();
     time_trace = time;
     initlock(&lock_trace);
@@ -3224,11 +3242,12 @@ void createdir(const char *path)
     char buff[1024], *p;
     //tracet(3, "createdir: path=%s\n", path);
 
-    strcpy(buff, path);
+    if(strlen(path) < 1025) strcpy(buff, path);
+    else trace(1, "path is too long");
     if (!(p = strrchr(buff, FILEPATHSEP))) return;
     *p = '\0';
 
-    mkdir(buff, 0777);
+    if(mkdir(buff, 0777) != 0) trace(1, "Error creating folder");
 }
 
 
@@ -3246,7 +3265,9 @@ int repstr(char *str, const char *pat, const char *rep)
             r += sprintf(r, "%s", rep);
         }
     if (p <= str) return 0;
-    strcpy(r, p);
+
+    if(strlen(p) < 1025 ) strcpy(r, p);
+    else trace(1, "pat array is too long");
     strcpy(str, buff);
     return 1;
 }
@@ -3934,7 +3955,8 @@ int rtk_uncompress(const char *file, char *uncfile)
 
     trace(3, "rtk_uncompress: file=%s\n", file);
 
-    strcpy(tmpfile, file);
+    if(strlen(file) < 1025) strcpy(tmpfile, file);
+    else trace(1, "file array is too long");
     if (!(p = strrchr(tmpfile, '.'))) return 0;
 
     /* uncompress by gzip */
@@ -3947,10 +3969,10 @@ int rtk_uncompress(const char *file, char *uncfile)
 
             if (execcmd(cmd))
                 {
-                    remove(uncfile);
+                    if(remove(uncfile) != 0) trace(1, "Error removing file");
                     return -1;
                 }
-            strcpy(tmpfile, uncfile);
+            if(strlen(uncfile) < 1025) strcpy(tmpfile, uncfile);
             stat = 1;
         }
     /* extract tar file */
@@ -3966,10 +3988,10 @@ int rtk_uncompress(const char *file, char *uncfile)
             sprintf(cmd, "tar -C \"%s\" -xf \"%s\"", dir, tmpfile);
             if (execcmd(cmd))
                 {
-                    if (stat) remove(tmpfile);
+                    if (stat) if(remove(tmpfile) != 0) trace(1, "Error removing file");
                     return -1;
                 }
-            if (stat) remove(tmpfile);
+            if (stat) if(remove(tmpfile) != 0) trace(1, "Error removing file");
             stat = 1;
         }
     /* extract hatanaka-compressed file by cnx2rnx */
@@ -3982,11 +4004,11 @@ int rtk_uncompress(const char *file, char *uncfile)
 
             if (execcmd(cmd))
                 {
-                    remove(uncfile);
-                    if (stat) remove(tmpfile);
+                    if(remove(uncfile) != 0) trace(1, "Error removing file");
+                    if (stat) if(remove(tmpfile) != 0) trace(1, "Error removing file");
                     return -1;
                 }
-            if (stat) remove(tmpfile);
+            if (stat) if(remove(tmpfile) != 0) trace(1, "Error removing file");
             stat = 1;
         }
     trace(3, "rtk_uncompress: stat=%d\n", stat);
@@ -4005,7 +4027,7 @@ int rtk_uncompress(const char *file, char *uncfile)
 int expath(const char *path, char *paths[], int nmax)
 {
     int i, j, n = 0;
-    char tmp[1024];
+    char tmp[1024] = "";
     struct dirent *d;
     DIR *dp;
     const char *file = path;
@@ -4040,7 +4062,11 @@ int expath(const char *path, char *paths[], int nmax)
                 {
                     if (strcmp(paths[i], paths[j])>0)
                         {
-                            strcpy(tmp, paths[i]);
+                            if(strlen(paths[i]) < 1025) strcpy(tmp, paths[i]);
+                            else
+                                {
+                                    trace(1, "Path is too long");
+                                }
                             strcpy(paths[i], paths[j]);
                             strcpy(paths[j], tmp);
                         }
diff --git a/src/algorithms/libs/rtklib/rtklib_rtkpos.cc b/src/algorithms/libs/rtklib/rtklib_rtkpos.cc
index 437b75e1f..6af5e200d 100644
--- a/src/algorithms/libs/rtklib/rtklib_rtkpos.cc
+++ b/src/algorithms/libs/rtklib/rtklib_rtkpos.cc
@@ -156,7 +156,8 @@ int rtkopenstat(const char *file, int level)
             trace(1, "rtkopenstat: file open error path=%s\n", path);
             return 0;
         }
-    strcpy(file_stat, file);
+    if(strlen(file) < 1025) strcpy(file_stat, file);
+    else trace(1, "File name is too long");
     time_stat = time;
     statlevel = level;
     return 1;
@@ -584,7 +585,11 @@ void udpos(rtk_t *rtk, double tt)
             return;
         }
     /* check variance of estimated postion */
-    for (i = 0;i<3;i++) var += rtk->P[i+i*rtk->nx]; var/=3.0;
+    for (i = 0;i<3;i++)
+        {
+            var += rtk->P[i+i*rtk->nx];
+        }
+    var /= 3.0;
 
     if (var>VAR_POS)
         {
@@ -1177,8 +1182,11 @@ int constbl(rtk_t *rtk, const double *x, const double *P, double *v,
     /* approximate variance of solution */
     if (P)
         {
-            for (i = 0;i<3;i++) var+=P[i+i*rtk->nx];
-            var/=3.0;
+            for (i = 0;i<3;i++)
+                {
+                    var += P[i+i*rtk->nx];
+                }
+            var /= 3.0;
         }
     /* check nonlinearity */
     if (var>thres*thres*bb*bb)
@@ -1536,49 +1544,46 @@ int ddmat(rtk_t *rtk, double *D)
 
             for (f = 0, k = na;f<nf;f++, k+=MAXSAT)
                 {
-                    for (i = k;i<k+MAXSAT;i++)
+                    if(i < k + MAXSAT)
                         {
-#if 0
-                            if (rtk->x[i] == 0.0||!test_sys(rtk->ssat[i-k].sys,m)||
-                                    !rtk->ssat[i-k].vsat[f])
+                            for (i = k;i<k+MAXSAT;i++)
                                 {
-#else
-                            if (rtk->x[i] == 0.0 || !test_sys(rtk->ssat[i-k].sys, m) ||
+                                    if (rtk->x[i] == 0.0 || !test_sys(rtk->ssat[i-k].sys, m) ||
                                             !rtk->ssat[i-k].vsat[f] || !rtk->ssat[i-k].half[f])
-                                {
-#endif
-                                    continue;
+                                        {
+                                            continue;
+                                        }
+                                    if (rtk->ssat[i-k].lock[f]>0 && !(rtk->ssat[i-k].slip[f]&2) &&
+                                            rtk->ssat[i-k].azel[1] >= rtk->opt.elmaskar && !nofix)
+                                        {
+                                            rtk->ssat[i-k].fix[f] = 2; /* fix */
+                                            break;
+                                        }
+                                    else rtk->ssat[i-k].fix[f] = 1;
                                 }
-                            if (rtk->ssat[i-k].lock[f]>0 && !(rtk->ssat[i-k].slip[f]&2) &&
-                                    rtk->ssat[i-k].azel[1] >= rtk->opt.elmaskar && !nofix)
+                            for (j = k;j<k+MAXSAT;j++)
                                 {
-                                    rtk->ssat[i-k].fix[f] = 2; /* fix */
-                                    break;
+                                    if (i == j || rtk->x[j] == 0.0 || !test_sys(rtk->ssat[j-k].sys, m) ||
+                                            !rtk->ssat[j-k].vsat[f])
+                                        {
+                                            continue;
+                                        }
+                                    if (rtk->ssat[j-k].lock[f]>0 && !(rtk->ssat[j-k].slip[f]&2) &&
+                                            rtk->ssat[i-k].vsat[f] &&
+                                            rtk->ssat[j-k].azel[1] >= rtk->opt.elmaskar && !nofix)
+                                        {
+                                            D[i+(na+nb)*nx] =  1.0;
+                                            D[j+(na+nb)*nx] = -1.0;
+                                            nb++;
+                                            rtk->ssat[j-k].fix[f] = 2; /* fix */
+                                        }
+                                    else rtk->ssat[j-k].fix[f] = 1;
                                 }
-                            else rtk->ssat[i-k].fix[f] = 1;
-                       }
-                   for (j = k;j<k+MAXSAT;j++)
-                        {
-                            if (i == j || rtk->x[j] == 0.0 || !test_sys(rtk->ssat[j-k].sys, m) ||
-                                    !rtk->ssat[j-k].vsat[f])
-                                {
-                                    continue;
-                                }
-                            if (rtk->ssat[j-k].lock[f]>0 && !(rtk->ssat[j-k].slip[f]&2) &&
-                                        rtk->ssat[i-k].vsat[f] &&
-                                        rtk->ssat[j-k].azel[1] >= rtk->opt.elmaskar && !nofix)
-                                {
-                                    D[i+(na+nb)*nx] =  1.0;
-                                    D[j+(na+nb)*nx] = -1.0;
-                                    nb++;
-                                    rtk->ssat[j-k].fix[f] = 2; /* fix */
-                                }
-                                else rtk->ssat[j-k].fix[f] = 1;
                         }
                 }
         }
-     trace(5, "D=\n"); tracemat(5, D, nx, na+nb, 2, 0);
-     return nb;
+    trace(5, "D=\n"); tracemat(5, D, nx, na+nb, 2, 0);
+    return nb;
 }
 
 
diff --git a/src/algorithms/libs/rtklib/rtklib_rtksvr.cc b/src/algorithms/libs/rtklib/rtklib_rtksvr.cc
index c8ba20466..0c2aabedf 100644
--- a/src/algorithms/libs/rtklib/rtklib_rtksvr.cc
+++ b/src/algorithms/libs/rtklib/rtklib_rtksvr.cc
@@ -752,8 +752,8 @@ int rtksvrstart(rtksvr_t *svr, int cycle, int buffsize, int *strs,
             init_rtcm(svr->rtcm+i);
 
             /* set receiver and rtcm option */
-            strcpy(svr->raw [i].opt, rcvopts[i]);
-            strcpy(svr->rtcm[i].opt, rcvopts[i]);
+            if(strlen(rcvopts[i]) < 256 ) strcpy(svr->raw [i].opt, rcvopts[i]);
+            if(strlen(rcvopts[i]) < 256 ) strcpy(svr->rtcm[i].opt, rcvopts[i]);
 
             /* connect dgps corrections */
             svr->rtcm[i].dgps = svr->nav.dgps;
diff --git a/src/algorithms/libs/rtklib/rtklib_sbas.cc b/src/algorithms/libs/rtklib/rtklib_sbas.cc
index ad081128f..577199268 100644
--- a/src/algorithms/libs/rtklib/rtklib_sbas.cc
+++ b/src/algorithms/libs/rtklib/rtklib_sbas.cc
@@ -185,9 +185,9 @@ int decode_sbstype6(const sbsmsg_t *msg, sbssat_t *sbssat)
         {
             iodf[i] = getbitu(msg->msg, 14+i*2, 2);
         }
-    for (i = 0;i<sbssat->nsat && i<MAXSAT;i++)
+    for (i = 0; i < sbssat->nsat && i < MAXSAT; i++)
         {
-            if (sbssat->sat[i].fcorr.iodf != iodf[i/13]) continue;
+            if (sbssat->sat[i].fcorr.iodf != iodf[i/22]) continue;
             udre = getbitu(msg->msg, 22+i*4, 4);
             sbssat->sat[i].fcorr.udre = udre+1;
         }
@@ -536,7 +536,7 @@ void readmsgs(const char *file, int sel, gtime_t ts, gtime_t te,
                     if (!(sbs_msgs = (sbsmsg_t *)realloc(sbs->msgs, sbs->nmax * sizeof(sbsmsg_t))))
                         {
                             trace(1, "readsbsmsg malloc error: nmax=%d\n", sbs->nmax);
-                            free(sbs->msgs); sbs->msgs = NULL; sbs->n = sbs->nmax = 0;
+                            free(sbs->msgs); sbs->msgs = NULL; sbs->n = sbs->nmax = 0; fclose(fp);
                             return;
                         }
                     sbs->msgs = sbs_msgs;
diff --git a/src/algorithms/libs/rtklib/rtklib_solution.cc b/src/algorithms/libs/rtklib/rtklib_solution.cc
index 82f804305..78daf0817 100644
--- a/src/algorithms/libs/rtklib/rtklib_solution.cc
+++ b/src/algorithms/libs/rtklib/rtklib_solution.cc
@@ -271,7 +271,7 @@ int decode_nmeagga(char **val, int n, sol_t *sol)
 /* decode nmea ---------------------------------------------------------------*/
 int decode_nmea(char *buff, sol_t *sol)
 {
-    char *p,*q,*val[MAXFIELD];
+    char *p, *q, *val[MAXFIELD] = {0};
     int n = 0;
 
     trace(4,"decode_nmea: buff=%s\n",buff);
@@ -1119,7 +1119,7 @@ int outecef(unsigned char *buff, const char *s, const sol_t *sol,
 
     trace(3,"outecef:\n");
 
-    p += sprintf(p,"%s%s%14.4f%s%14.4f%s%14.4f%s%3d%s%3d%s%8.4f%s%8.4f%s%8.4f%s%8.4f%s%8.4f%s%8.4f%s%6.2f%s%6.1f\n",
+    p += snprintf(p,255,"%s%s%14.4f%s%14.4f%s%14.4f%s%3d%s%3d%s%8.4f%s%8.4f%s%8.4f%s%8.4f%s%8.4f%s%8.4f%s%6.2f%s%6.1f\n",
             s,sep,sol->rr[0],sep,sol->rr[1],sep,sol->rr[2],sep,sol->stat,sep,
             sol->ns,sep,SQRT_SOL(sol->qr[0]),sep,SQRT_SOL(sol->qr[1]),sep,SQRT_SOL(sol->qr[2]),
             sep,sqvar(sol->qr[3]),sep,sqvar(sol->qr[4]),sep,sqvar(sol->qr[5]),
@@ -1627,46 +1627,46 @@ int outsols(unsigned char *buff, const sol_t *sol, const double *rb,
     double gpst;
     int week,timeu;
     const char *sep = opt2sep(opt);
-    char s[64];
+    char s[255];
     unsigned char *p = buff;
 
     trace(3,"outsols :\n");
 
     if (opt->posf == SOLF_NMEA)
         {
-            if (opt->nmeaintv[0]<0.0) return 0;
-            if (!screent(sol->time,ts,ts,opt->nmeaintv[0])) return 0;
+            if (opt->nmeaintv[0] < 0.0) return 0;
+            if (!screent(sol->time, ts, ts, opt->nmeaintv[0])) return 0;
         }
     if (sol->stat <= SOLQ_NONE || (opt->posf == SOLF_ENU && norm_rtk(rb,3) <= 0.0))
         {
             return 0;
         }
-    timeu = opt->timeu<0?0:(opt->timeu>20?20:opt->timeu);
+    timeu = opt->timeu < 0 ? 0 : (opt->timeu > 20 ? 20 : opt->timeu);
 
     time = sol->time;
     if (opt->times >= TIMES_UTC) time = gpst2utc(time);
-    if (opt->times == TIMES_JST) time = timeadd(time,9*3600.0);
+    if (opt->times == TIMES_JST) time = timeadd(time, 9*3600.0);
 
-    if (opt->timef) time2str(time,s,timeu);
+    if (opt->timef) time2str(time, s, timeu);
     else
         {
-            gpst = time2gpst(time,&week);
-            if (86400*7-gpst<0.5/pow(10.0,timeu))
+            gpst = time2gpst(time, &week);
+            if (86400 * 7 - gpst < 0.5 / pow(10.0, timeu))
                 {
                     week++;
                     gpst = 0.0;
                 }
-            sprintf(s,"%4d%s%*.*f",week,sep,6+(timeu <= 0?0:timeu+1),timeu,gpst);
+            snprintf(s, 255, "%4d%s%*.*f", week, sep, 6 + (timeu <= 0 ? 0 : timeu+1), timeu, gpst);
         }
     switch (opt->posf)
     {
-    case SOLF_LLH:  p += outpos (p,s,sol,opt);   break;
-    case SOLF_XYZ:  p += outecef(p,s,sol,opt);   break;
-    case SOLF_ENU:  p += outenu(p,s,sol,rb,opt); break;
-    case SOLF_NMEA: p += outnmea_rmc(p,sol);
-    p += outnmea_gga(p,sol); break;
+    case SOLF_LLH:  p += outpos(p, s, sol, opt); break;
+    case SOLF_XYZ:  p += outecef(p, s, sol, opt); break;
+    case SOLF_ENU:  p += outenu(p, s, sol, rb, opt); break;
+    case SOLF_NMEA: p += outnmea_rmc(p, sol);
+    p += outnmea_gga(p, sol); break;
     }
-    return p-buff;
+    return p - buff;
 }
 
 
diff --git a/src/algorithms/libs/rtklib/rtklib_stream.cc b/src/algorithms/libs/rtklib/rtklib_stream.cc
index 5decd4bcb..8844f9e1c 100644
--- a/src/algorithms/libs/rtklib/rtklib_stream.cc
+++ b/src/algorithms/libs/rtklib/rtklib_stream.cc
@@ -104,10 +104,10 @@ serial_t *openserial(const char *path, int mode, char *msg)
             strncpy(port, path, p-path); port[p-path] = '\0';
             sscanf(p, ":%d:%d:%c:%d:%s", &brate, &bsize, &parity, &stopb, fctr);
         }
-    else strcpy(port, path);
+    else if(strlen(path) < 128) strcpy(port, path);
 
-    for (i = 0;i < 11;i++) if (br[i] == brate) break;
-    if (i >= 12)
+    for (i = 0;i < 10; i++) if (br[i] == brate) break;
+    if (i >= 11)
         {
             sprintf(msg, "bitrate error (%d)", brate);
             tracet(1, "openserial: %s path=%s\n", msg, path);
@@ -150,8 +150,8 @@ serial_t *openserial(const char *path, int mode, char *msg)
 /* close serial --------------------------------------------------------------*/
 void closeserial(serial_t *serial)
 {
-    tracet(3, "closeserial: dev=%d\n", serial->dev);
     if (!serial) return;
+    tracet(3, "closeserial: dev=%d\n", serial->dev);
     close(serial->dev);
     free(serial);
 }
@@ -161,8 +161,8 @@ void closeserial(serial_t *serial)
 int readserial(serial_t *serial, unsigned char *buff, int n, char *msg __attribute__((unused)))
 {
     int nr;
-    tracet(4, "readserial: dev=%d n=%d\n", serial->dev, n);
     if (!serial) return 0;
+    tracet(4, "readserial: dev=%d n=%d\n", serial->dev, n);
     if ((nr = read(serial->dev, buff, n)) < 0) return 0;
     tracet(5, "readserial: exit dev=%d nr=%d\n", serial->dev, nr);
     return nr;
@@ -173,8 +173,8 @@ int readserial(serial_t *serial, unsigned char *buff, int n, char *msg __attribu
 int writeserial(serial_t *serial, unsigned char *buff, int n, char *msg __attribute__((unused)))
 {
     int ns;
-    tracet(3, "writeserial: dev=%d n=%d\n", serial->dev, n);
     if (!serial) return 0;
+    tracet(3, "writeserial: dev=%d n=%d\n", serial->dev, n);
     if ((ns = write(serial->dev, buff, n)) < 0) return 0;
     tracet(5, "writeserial: exit dev=%d ns=%d\n", serial->dev, ns);
     return ns;
@@ -269,7 +269,7 @@ int openfile_(file_t *file, gtime_t time, char *msg)
             if ((fp = fopen(tagpath, "rb")))
                 {
                     fclose(fp);
-                    remove(tagpath);
+                    if (remove(tagpath) != 0) trace(1, "Error removing file");
                 }
         }
     return 1;
@@ -315,7 +315,7 @@ file_t *openfile(const char *path, int mode, char *msg)
     if (!(file = (file_t *)malloc(sizeof(file_t)))) return NULL;
 
     file->fp = file->fp_tag = file->fp_tmp = file->fp_tag_tmp = NULL;
-    strcpy(file->path, path);
+    if(strlen(path) <  MAXSTRPATH) strcpy(file->path, path);
     if ((p = strstr(file->path, "::"))) *p = '\0';
     file->openpath[0] = '\0';
     file->mode = mode;
@@ -344,8 +344,8 @@ file_t *openfile(const char *path, int mode, char *msg)
 /* close file ----------------------------------------------------------------*/
 void closefile(file_t *file)
 {
-    tracet(3, "closefile: fp=%d\n", file->fp);
     if (!file) return;
+    tracet(3, "closefile: fp=%d\n", file->fp);
     closefile_(file);
     free(file);
 }
@@ -404,9 +404,8 @@ int readfile(file_t *file, unsigned char *buff, int nmax, char *msg)
     int nr = 0;
     size_t fpos;
 
-    tracet(4, "readfile: fp=%d nmax=%d\n", file->fp, nmax);
-
     if (!file) return 0;
+    tracet(4, "readfile: fp=%d nmax=%d\n", file->fp, nmax);
 
     if (file->fp == stdin)
         {
@@ -431,7 +430,7 @@ int readfile(file_t *file, unsigned char *buff, int nmax, char *msg)
                     if (fread(&tick, sizeof(tick), 1, file->fp_tag) < 1 ||
                             fread(&fpos, sizeof(fpos), 1, file->fp_tag) < 1)
                         {
-                            fseek(file->fp, 0, SEEK_END);
+                            if(fseek(file->fp, 0, SEEK_END) != 0) trace(1, "fseek error");
                             sprintf(msg, "end");
                             break;
                         }
@@ -445,7 +444,7 @@ int readfile(file_t *file, unsigned char *buff, int nmax, char *msg)
 
                     if ((int)(fpos-file->fpos) >= nmax)
                         {
-                            fseek(file->fp, fpos, SEEK_SET);
+                            if(fseek(file->fp, fpos, SEEK_SET) != 0) trace(1, "Error fseek");
                             file->fpos = fpos;
                             return 0;
                         }
@@ -453,7 +452,7 @@ int readfile(file_t *file, unsigned char *buff, int nmax, char *msg)
 
                     if (file->repmode || file->speed>0.0)
                         {
-                            fseek(file->fp_tag, -(long)(sizeof(tick)+sizeof(fpos)), SEEK_CUR);
+                            if(fseek(file->fp_tag, -(long)(sizeof(tick)+sizeof(fpos)), SEEK_CUR) !=0) trace(1, "Error fseek");
                         }
                     break;
                 }
@@ -478,9 +477,8 @@ int writefile(file_t *file, unsigned char *buff, int n, char *msg)
     double tow1, tow2, intv;
     size_t fpos, fpos_tmp;
 
-    tracet(3, "writefile: fp=%d n=%d\n", file->fp, n);
-
     if (!file) return 0;
+    tracet(3, "writefile: fp=%d n=%d\n", file->fp, n);
 
     wtime = utc2gpst(timeget()); /* write time in gpst */
 
@@ -560,7 +558,7 @@ void decodetcppath(const char *path, char *addr, char *port, char *user,
     if (mntpnt) *mntpnt = '\0';
     if (str) *str = '\0';
 
-    strcpy(buff, path);
+    if(strlen(path) < MAXSTRPATH) strcpy(buff, path);
 
     if (!(p = strrchr(buff, '@'))) p = buff;
 
@@ -645,7 +643,7 @@ int connect_nb(socket_t sock, struct sockaddr *addr, socklen_t len)
     int err, flag;
 
     flag = fcntl(sock, F_GETFL, 0);
-    fcntl(sock, F_SETFL, flag|O_NONBLOCK);
+    if(fcntl(sock, F_SETFL, flag|O_NONBLOCK) == -1) trace(1, "fcntl error");
     if (connect(sock, addr, len) == -1)
         {
             err = errsock();
@@ -761,7 +759,7 @@ tcpsvr_t *opentcpsvr(const char *path, char *msg)
 {
     tcpsvr_t *tcpsvr, tcpsvr0; // = {{0}};
     char port[256] = "";
-
+    tcpsvr0 = { {0, {0}, 0, {0,0,0,{0}},0,0,0,0}, { 0, {0}, 0,{0,0,0,{0}},0,0,0,0} };
     tracet(3, "opentcpsvr: path=%s\n", path);
 
     if (!(tcpsvr = (tcpsvr_t *)malloc(sizeof(tcpsvr_t)))) return NULL;
@@ -863,7 +861,7 @@ int accsock(tcpsvr_t *tcpsvr, char *msg)
     tcpsvr->cli[i].sock = sock;
     if (!setsock(tcpsvr->cli[i].sock, msg)) return 0;
     memcpy(&tcpsvr->cli[i].addr, &addr, sizeof(addr));
-    strcpy(tcpsvr->cli[i].saddr, inet_ntoa(addr.sin_addr));
+    if(strlen(inet_ntoa(addr.sin_addr)) < 256) strcpy(tcpsvr->cli[i].saddr, inet_ntoa(addr.sin_addr));
     sprintf(msg, "%s", tcpsvr->cli[i].saddr);
     tracet(2, "accsock: connected sock=%d addr=%s\n", tcpsvr->cli[i].sock, tcpsvr->cli[i].saddr);
     tcpsvr->cli[i].state = 2;
@@ -985,6 +983,7 @@ tcpcli_t *opentcpcli(const char *path, char *msg)
 {
     tcpcli_t *tcpcli, tcpcli0; // = {{0}};
     char port[256] = "";
+    tcpcli0 = {{0, {0}, 0, {0,0,0,{0}},0,0,0,0}, 0, 0};
 
     tracet(3, "opentcpcli: path=%s\n", path);
 
@@ -1128,7 +1127,7 @@ int reqntrip_s(ntrip_t *ntrip, char *msg)
 
     tracet(3, "reqntrip_s: state=%d\n", ntrip->state);
 
-    p += sprintf(p, "SOURCE %s %s\r\n", ntrip->passwd, ntrip->mntpnt);
+    p += snprintf(p, 256 + NTRIP_MAXSTR, "SOURCE %s %s\r\n", ntrip->passwd, ntrip->mntpnt);
     p += sprintf(p, "Source-Agent: NTRIP %s\r\n", NTRIP_AGENT);
     p += sprintf(p, "STR: %s\r\n", ntrip->str);
     p += sprintf(p, "\r\n");
@@ -1425,7 +1424,7 @@ void decodeftppath(const char *path, char *addr, char *file, char *user,
             topts[2] = 0;    /* download time offset (s) */
             topts[3] = 0;    /* retry interval (s) (0: no retry) */
         }
-    strcpy(buff, path);
+    if(strlen(path) < MAXSTRPATH) strcpy(buff, path);
 
     if ((p = strchr(buff, '/')))
         {
@@ -1550,13 +1549,13 @@ void *ftpthread(void *arg)
     /* execute download command */
     if ((ret = execcmd(cmd)))
         {
-            remove(local);
+            if(remove(local) != 0) trace(1, "Error removing file");
             tracet(1, "execcmd error: cmd=%s ret=%d\n", cmd, ret);
             ftp->error = ret;
             ftp->state = 3;
             return 0;
         }
-    remove(errfile);
+    if(remove(errfile) != 0) trace(1, "Error removing file");
 
     /* uncompress downloaded file */
     if ((p = strrchr(local, '.')) &&
@@ -1565,8 +1564,8 @@ void *ftpthread(void *arg)
         {
             if (rtk_uncompress(local, tmpfile))
                 {
-                    remove(local);
-                    strcpy(local, tmpfile);
+                    if(remove(local) != 0) trace(1, "Error removing file");
+                    if(strlen(tmpfile) < 1024) strcpy(local, tmpfile);
                 }
             else
                 {
@@ -1576,7 +1575,7 @@ void *ftpthread(void *arg)
                     return 0;
                 }
         }
-    strcpy(ftp->local, local);
+    if(strlen(local) < 1024 ) strcpy(ftp->local, local);
     ftp->state = 2; /* ftp completed */
 
     tracet(3, "ftpthread: complete cmd=%s\n", cmd);
@@ -1754,7 +1753,7 @@ int stropen(stream_t *stream, int type, int mode, const char *path)
 
     stream->type = type;
     stream->mode = mode;
-    strcpy(stream->path, path);
+    if(strlen(path) < MAXSTRPATH ) strcpy(stream->path, path);
     stream->inb = stream->inr = stream->outb = stream->outr = 0;
     stream->tick = tickget();
     stream->inbt = stream->outbt = 0;
@@ -2060,7 +2059,7 @@ void strsettimeout(stream_t *stream, int toinact, int tirecon)
 void strsetdir(const char *dir)
 {
     tracet(3, "strsetdir: dir=%s\n", dir);
-    strcpy(localdir, dir);
+    if (strlen(dir) < 1024) strcpy(localdir, dir);
 }
 
 
@@ -2072,7 +2071,7 @@ void strsetdir(const char *dir)
 void strsetproxy(const char *addr)
 {
     tracet(3, "strsetproxy: addr=%s\n", addr);
-    strcpy(proxyaddr, addr);
+    if(strlen(addr) < 256) strcpy(proxyaddr, addr);
 }
 
 
diff --git a/src/algorithms/libs/short_x2_to_cshort.cc b/src/algorithms/libs/short_x2_to_cshort.cc
index e55b1ac27..d722a6cdd 100644
--- a/src/algorithms/libs/short_x2_to_cshort.cc
+++ b/src/algorithms/libs/short_x2_to_cshort.cc
@@ -54,9 +54,9 @@ int short_x2_to_cshort::work(int noutput_items,
         gr_vector_const_void_star &input_items,
         gr_vector_void_star &output_items)
 {
-    const short *in0 = (const short *) input_items[0];
-    const short *in1 = (const short *) input_items[1];
-    lv_16sc_t *out = (lv_16sc_t *) output_items[0];
+    const short *in0 = reinterpret_cast<const short *>(input_items[0]);
+    const short *in1 = reinterpret_cast<const short *>(input_items[1]);
+    lv_16sc_t *out = reinterpret_cast<lv_16sc_t *>(output_items[0]);
     // This could be put into a volk kernel
     short real_part;
     short imag_part;
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 d6e69819b..8178609a2 100644
--- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt
+++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt
@@ -27,7 +27,7 @@ enable_language(CXX)
 enable_language(C)
 enable_testing()
 
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")
 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
 add_definitions(-D_GLIBCXX_USE_CXX11_ABI=1)
 
diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/CMakeLists.txt b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/CMakeLists.txt
index 40d38a9a1..4ba808db5 100644
--- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/CMakeLists.txt
+++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/CMakeLists.txt
@@ -34,11 +34,14 @@ include_directories(
     ${Boost_INCLUDE_DIRS}
 )
 
-if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
-   set(Clang_required_link "c++")
-elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
-   set(Clang_required_link "")
-endif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+
+set(Clang_required_link "")
+if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+   if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+      set(Clang_required_link "c++")
+   endif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+
 
 if(ORC_FOUND)
     set(orc_lib ${ORC_LIBRARIES})
diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc
index c1b764210..d55999d16 100644
--- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc
+++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc
@@ -23,202 +23,208 @@
 #include <volk_gnsssdr/volk_gnsssdr.h>
 #include <volk_gnsssdr/volk_gnsssdr_prefs.h>
 
-#include <ciso646>
 #include <vector>
+#include <boost/exception/diagnostic_information.hpp>
 #include <boost/filesystem.hpp>
 #include <boost/program_options.hpp>
 #include <boost/xpressive/xpressive.hpp>
 #include <iostream>
 #include <fstream>
-#include <sys/stat.h>
-#include <sys/types.h>
 
 namespace fs = boost::filesystem;
 
 int main(int argc, char *argv[]) {
     // Adding program options
-    boost::program_options::options_description desc("Options");
-    desc.add_options()
-      ("help,h", "Print help messages")
-      ("benchmark,b",
-            boost::program_options::value<bool>()->default_value( false )
-                                                ->implicit_value( true ),
-            "Run all kernels (benchmark mode)")
-      ("tol,t",
-            boost::program_options::value<float>()->default_value( 1e-6 ),
-            "Set the default error tolerance for tests")
-      ("vlen,v",
-            boost::program_options::value<int>()->default_value( 8111 ), //it is also prime
-            "Set the default vector length for tests") // default is a mersenne prime
-      ("iter,i",
-            boost::program_options::value<int>()->default_value( 1987 ),
-            "Set the default number of test iterations per kernel")
-      ("tests-regex,R",
-            boost::program_options::value<std::string>(),
-            "Run tests matching regular expression.")
-      ("update,u",
-            boost::program_options::value<bool>()->default_value( false )
-                                                     ->implicit_value( true ),
-            "Run only kernels missing from config; use -R to further restrict the candidates")
-      ("dry-run,n",
-            boost::program_options::value<bool>()->default_value( false )
-                                                     ->implicit_value( true ),
-            "Dry run. Respect other options, but don't write to file")
-      ("json,j",
-            boost::program_options::value<std::string>(),
-            "JSON output file")
-      ("path,p",
-            boost::program_options::value<std::string>(),
-            "Specify volk_config path.")
-      ;
+    try
+    {
+            boost::program_options::options_description desc("Options");
+            desc.add_options()
+              ("help,h", "Print help messages")
+              ("benchmark,b",
+                 boost::program_options::value<bool>()->default_value( false )
+                                                      ->implicit_value( true ),
+                 "Run all kernels (benchmark mode)")
+              ("tol,t",
+                 boost::program_options::value<float>()->default_value( 1e-6 ),
+                 "Set the default error tolerance for tests")
+              ("vlen,v",
+                 boost::program_options::value<int>()->default_value( 8111 ), //it is also prime
+                 "Set the default vector length for tests") // default is a mersenne prime
+              ("iter,i",
+                 boost::program_options::value<int>()->default_value( 1987 ),
+                 "Set the default number of test iterations per kernel")
+              ("tests-regex,R",
+                  boost::program_options::value<std::string>(),
+                  "Run tests matching regular expression.")
+              ("update,u",
+                  boost::program_options::value<bool>()->default_value( false )
+                                                       ->implicit_value( true ),
+                  "Run only kernels missing from config; use -R to further restrict the candidates")
+              ("dry-run,n",
+                  boost::program_options::value<bool>()->default_value( false )
+                                                        ->implicit_value( true ),
+                  "Dry run. Respect other options, but don't write to file")
+              ("json,j",
+                  boost::program_options::value<std::string>(),
+                  "JSON output file")
+              ("path,p",
+                  boost::program_options::value<std::string>(),
+                  "Specify volk_config path.")
+              ;
 
-    // Handle the options that were given
-    boost::program_options::variables_map vm;
-    bool benchmark_mode;
-    std::string kernel_regex;
-    std::ofstream json_file;
-    float def_tol;
-    lv_32fc_t def_scalar;
-    int def_iter;
-    int def_vlen;
-    bool def_benchmark_mode;
-    std::string def_kernel_regex;
-    bool update_mode = false;
-    bool dry_run = false;
-    std::string config_file;
+            // Handle the options that were given
+            boost::program_options::variables_map vm;
+            bool benchmark_mode;
+            std::string kernel_regex;
+            std::ofstream json_file;
+            float def_tol;
+            lv_32fc_t def_scalar;
+            int def_iter;
+            int def_vlen;
+            bool def_benchmark_mode;
+            std::string def_kernel_regex;
+            bool update_mode = false;
+            bool dry_run = false;
+            std::string config_file;
 
-    // Handle the provided options
-    try {
-        boost::program_options::store(boost::program_options::parse_command_line(argc, argv, desc), vm);
-        boost::program_options::notify(vm);
-        benchmark_mode = vm.count("benchmark")?vm["benchmark"].as<bool>():false;
-        if ( vm.count("tests-regex" ) ) {
-            kernel_regex = vm["tests-regex"].as<std::string>();
-        }
-        else {
-            kernel_regex = ".*";
-        }
+            // Handle the provided options
+            try {
+                    boost::program_options::store(boost::program_options::parse_command_line(argc, argv, desc), vm);
+                    boost::program_options::notify(vm);
+                    benchmark_mode = vm.count("benchmark")?vm["benchmark"].as<bool>():false;
+                    if ( vm.count("tests-regex" ) ) {
+                            kernel_regex = vm["tests-regex"].as<std::string>();
+                    }
+                    else {
+                            kernel_regex = ".*";
+                    }
 
-        def_tol = vm["tol"].as<float>();
-        def_scalar = 327.0;
-        def_vlen = vm["vlen"].as<int>();
-        def_iter = vm["iter"].as<int>();
-        def_benchmark_mode = benchmark_mode;
-        def_kernel_regex = kernel_regex;
-        update_mode = vm["update"].as<bool>();
-        dry_run = vm["dry-run"].as<bool>();
+                    def_tol = vm["tol"].as<float>();
+                    def_scalar = 327.0;
+                    def_vlen = vm["vlen"].as<int>();
+                    def_iter = vm["iter"].as<int>();
+                    def_benchmark_mode = benchmark_mode;
+                    def_kernel_regex = kernel_regex;
+                    update_mode = vm["update"].as<bool>();
+                    dry_run = vm["dry-run"].as<bool>();
+            }
+            catch (const boost::program_options::error & error) {
+                    std::cerr << "Error: " << error.what() << std::endl << std::endl;
+                    std::cerr << desc << std::endl;
+                    return 1;
+            }
+
+            /** --help option */
+            if ( vm.count("help") ) {
+                    std::cout << "The VOLK_GNSSSDR profiler." << std::endl
+                            << desc << std::endl;
+                    return 0;
+            }
+
+            if ( vm.count("json") ) {
+                    std::string filename;
+                    try {
+                            filename = vm["json"].as<std::string>();
+                    }
+                    catch (const boost::bad_any_cast& error) {
+                            std::cerr << error.what() << std::endl;
+                            return 1;
+                    }
+                    json_file.open( filename.c_str() );
+            }
+
+            if ( vm.count("path") ) {
+                    try {
+                            config_file = vm["path"].as<std::string>() + "/volk_config";
+                    }
+                    catch (const boost::bad_any_cast& error) {
+                            std::cerr << error.what() << std::endl;
+                            return 1;
+                    }
+            }
+
+            volk_gnsssdr_test_params_t test_params(def_tol, def_scalar, def_vlen, def_iter,
+                    def_benchmark_mode, def_kernel_regex);
+
+            // Run tests
+            std::vector<volk_gnsssdr_test_results_t> results;
+            if(update_mode) {
+                    read_results(&results);
+                    if( vm.count("path") ) read_results(&results, config_file);
+                    else read_results(&results);
+            }
+
+
+            // Initialize the list of tests
+            // the default test parameters come from options
+            std::vector<volk_gnsssdr_test_case_t> test_cases = init_test_list(test_params);
+            boost::xpressive::sregex kernel_expression;
+            try {
+                    kernel_expression = boost::xpressive::sregex::compile(kernel_regex);
+            }
+            catch (const boost::xpressive::regex_error& error) {
+                    std::cerr << "Error occurred while compiling regex" << std::endl << std::endl;
+                    return 1;
+            }
+
+            // Iteratate through list of tests running each one
+            for(unsigned int ii = 0; ii < test_cases.size(); ++ii) {
+                    bool regex_match = true;
+
+                    volk_gnsssdr_test_case_t test_case = test_cases[ii];
+                    // if the kernel name matches regex then do the test
+                    if(boost::xpressive::regex_search(test_case.name(), kernel_expression)) {
+                            regex_match = true;
+                    }
+                    else {
+                            regex_match = false;
+                    }
+
+                    // if we are in update mode check if we've already got results
+                    // if we have any, then no need to test that kernel
+                    bool update = true;
+                    if(update_mode) {
+                            for(unsigned int jj=0; jj < results.size(); ++jj) {
+                                    if(results[jj].name == test_case.name() ||
+                                            results[jj].name == test_case.puppet_master_name()) {
+                                            update = false;
+                                            break;
+                                    }
+                            }
+                    }
+
+                    if( regex_match && update ) {
+                            try {
+                                    run_volk_gnsssdr_tests(test_case.desc(), test_case.kernel_ptr(), test_case.name(),
+                                            test_case.test_parameters(), &results, test_case.puppet_master_name());
+                            }
+                            catch (const std::string & error) {
+                                    std::cerr << "Caught Exception in 'run_volk_gnsssdr_tests': " << error << std::endl;
+                            }
+
+                    }
+            }
+
+
+            // Output results according to provided options
+            if(vm.count("json")) {
+                    write_json(json_file, results);
+                    json_file.close();
+            }
+
+            if(!dry_run) {
+                    write_results(&results, false);
+                    if(vm.count("path")) write_results(&results, false, config_file);
+                    else write_results(&results, false);
+            }
+            else {
+                    std::cout << "Warning: this was a dry-run. Config not generated" << std::endl;
+            }
     }
-    catch (boost::program_options::error& error) {
-        std::cerr << "Error: " << error.what() << std::endl << std::endl;
-        std::cerr << desc << std::endl;
-        return 1;
-    }
-
-    /** --help option */
-    if ( vm.count("help") ) {
-      std::cout << "The VOLK_GNSSSDR profiler." << std::endl
-                << desc << std::endl;
-      return 0;
-    }
-
-    if ( vm.count("json") ) {
-        std::string filename;
-        try {
-             filename = vm["json"].as<std::string>();
-        }
-        catch (boost::bad_any_cast& error) {
-            std::cerr << error.what() << std::endl;
+    catch(const boost::exception & e)
+    {
+            std::cerr << boost::diagnostic_information(e) << std::endl;
             return 1;
-        }
-        json_file.open( filename.c_str() );
-    }
-
-    if ( vm.count("path") ) {
-            try {
-                    config_file = vm["path"].as<std::string>() + "/volk_config";
-                }
-            catch (boost::bad_any_cast& error) {
-                std::cerr << error.what() << std::endl;
-                return 1;
-          }
-     }
-
-    volk_gnsssdr_test_params_t test_params(def_tol, def_scalar, def_vlen, def_iter,
-        def_benchmark_mode, def_kernel_regex);
-
-    // Run tests
-    std::vector<volk_gnsssdr_test_results_t> results;
-    if(update_mode) {
-        read_results(&results);
-        if( vm.count("path") ) read_results(&results, config_file);
-        else read_results(&results);
-    }
-
-
-    // Initialize the list of tests
-    // the default test parameters come from options
-    std::vector<volk_gnsssdr_test_case_t> test_cases = init_test_list(test_params);
-    boost::xpressive::sregex kernel_expression;
-    try {
-        kernel_expression = boost::xpressive::sregex::compile(kernel_regex);
-    }
-    catch (boost::xpressive::regex_error& error) {
-        std::cerr << "Error occurred while compiling regex" << std::endl << std::endl;
-        return 1;
-    }
-
-    // Iteratate through list of tests running each one
-    for(unsigned int ii = 0; ii < test_cases.size(); ++ii) {
-        bool regex_match = true;
-
-        volk_gnsssdr_test_case_t test_case = test_cases[ii];
-        // if the kernel name matches regex then do the test
-        if(boost::xpressive::regex_search(test_case.name(), kernel_expression)) {
-            regex_match = true;
-        }
-        else {
-            regex_match = false;
-        }
-
-        // if we are in update mode check if we've already got results
-        // if we have any, then no need to test that kernel
-        bool update = true;
-        if(update_mode) {
-            for(unsigned int jj=0; jj < results.size(); ++jj) {
-                if(results[jj].name == test_case.name() ||
-                    results[jj].name == test_case.puppet_master_name()) {
-                    update = false;
-                    break;
-                }
-            }
-        }
-
-        if( regex_match && update ) {
-            try {
-            run_volk_gnsssdr_tests(test_case.desc(), test_case.kernel_ptr(), test_case.name(),
-                test_case.test_parameters(), &results, test_case.puppet_master_name());
-            }
-            catch (std::string error) {
-                std::cerr << "Caught Exception in 'run_volk_gnsssdr_tests': " << error << std::endl;
-            }
-
-        }
-    }
-
-
-    // Output results according to provided options
-    if(vm.count("json")) {
-        write_json(json_file, results);
-        json_file.close();
-    }
-
-    if(!dry_run) {
-        write_results(&results, false);
-        if(vm.count("path")) write_results(&results, false, config_file);
-        else write_results(&results, false);
-    }
-    else {
-        std::cout << "Warning: this was a dry-run. Config not generated" << std::endl;
     }
 }
 
diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/volk_gnsssdr_kernel_defs.py b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/volk_gnsssdr_kernel_defs.py
index 90ba0693c..3eb77d26f 100644
--- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/volk_gnsssdr_kernel_defs.py
+++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/volk_gnsssdr_kernel_defs.py
@@ -204,7 +204,7 @@ class kernel_class:
 ########################################################################
 __file__ = os.path.abspath(__file__)
 srcdir = os.path.dirname(os.path.dirname(__file__))
-kernel_files = glob.glob(os.path.join(srcdir, "kernels", "volk_gnsssdr", "*.h"))
+kernel_files = sorted(glob.glob(os.path.join(srcdir, "kernels", "volk_gnsssdr", "*.h")))
 kernels = list(map(kernel_class, kernel_files))
 
 if __name__ == '__main__':
diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_avx_intrinsics.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_avx_intrinsics.h
index b737ea164..809aa98f9 100644
--- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_avx_intrinsics.h
+++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_avx_intrinsics.h
@@ -61,6 +61,14 @@ _mm256_magnitudesquared_ps(__m256 cplxValue1, __m256 cplxValue2){
   return _mm256_hadd_ps(complex1, complex2); // Add the I2 and Q2 values
 }
 
+static inline __m256 _mm256_complexnormalise_ps( __m256 z ){
+    __m256 tmp1 = _mm256_mul_ps(z, z);
+    __m256 tmp2 = _mm256_hadd_ps(tmp1, tmp1);
+    tmp1 = _mm256_shuffle_ps(tmp2, tmp2, 0xD8);
+    tmp2 = _mm256_sqrt_ps(tmp1);
+    return _mm256_div_ps(z, tmp2);
+}
+
 static inline __m256
 _mm256_magnitude_ps(__m256 cplxValue1, __m256 cplxValue2){
   return _mm256_sqrt_ps(_mm256_magnitudesquared_ps(cplxValue1, cplxValue2));
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
new file mode 100644
index 000000000..3c1c0f817
--- /dev/null
+++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16i_resamplerxnpuppet_16i.h
@@ -0,0 +1,282 @@
+/*!
+ * \file volk_gnsssdr_16i_resamplerxnpuppet_16i.h
+ * \brief VOLK_GNSSSDR puppet for the multiple 16-bit vector resampler kernel.
+ * \authors <ul>
+ *          <li> Cillian O'Driscoll 2017 cillian.odriscoll at gmail dot com
+ *          </ul>
+ *
+ * VOLK_GNSSSDR puppet for integrating the multiple resampler into the test system
+ *
+ * -------------------------------------------------------------------------
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ *
+ * -------------------------------------------------------------------------
+ */
+
+#ifndef INCLUDED_volk_gnsssdr_16i_resamplerxnpuppet_16i_H
+#define INCLUDED_volk_gnsssdr_16i_resamplerxnpuppet_16i_H
+
+#include "volk_gnsssdr/volk_gnsssdr_16i_xn_resampler_16i_xn.h"
+#include <volk_gnsssdr/volk_gnsssdr_malloc.h>
+#include <volk_gnsssdr/volk_gnsssdr_complex.h>
+#include <volk_gnsssdr/volk_gnsssdr.h>
+#include <string.h>
+
+#ifdef LV_HAVE_GENERIC
+static inline void volk_gnsssdr_16i_resamplerxnpuppet_16i_generic(int16_t* result, const int16_t* local_code, unsigned int num_points)
+{
+    int code_length_chips = 2046;
+    float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points );
+    int num_out_vectors = 3;
+    unsigned int n;
+    float rem_code_phase_chips = -0.234;
+    float shifts_chips[3] = { -0.1, 0.0, 0.1  };
+    int16_t** result_aux =  (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_out_vectors, volk_gnsssdr_get_alignment());
+
+    for(n = 0; n < num_out_vectors; n++)
+    {
+       result_aux[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment());
+    }
+
+    volk_gnsssdr_16i_xn_resampler_16i_xn_generic(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points);
+
+    memcpy((int16_t*)result, (int16_t*)result_aux[0], sizeof(int16_t) * num_points);
+
+    for(n = 0; n < num_out_vectors; n++)
+    {
+        volk_gnsssdr_free(result_aux[n]);
+    }
+    volk_gnsssdr_free(result_aux);
+}
+
+#endif /* LV_HAVE_GENERIC */
+ 
+#ifdef LV_HAVE_SSE3
+static inline void volk_gnsssdr_16i_resamplerxnpuppet_16i_a_sse3(int16_t* result, const int16_t* local_code, unsigned int num_points)
+{
+    int code_length_chips = 2046;
+    float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points );
+    int num_out_vectors = 3;
+    float rem_code_phase_chips = -0.234;
+    unsigned int n;
+    float shifts_chips[3] = { -0.1, 0.0, 0.1 };
+    int16_t** result_aux =  (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_out_vectors, volk_gnsssdr_get_alignment());
+
+    for(n = 0; n < num_out_vectors; n++)
+    {
+       result_aux[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment());
+    }
+
+    volk_gnsssdr_16i_xn_resampler_16i_xn_a_sse3(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points);
+
+    memcpy((int16_t*)result, (int16_t*)result_aux[0], sizeof(int16_t) * num_points);
+
+    for(n = 0; n < num_out_vectors; n++)
+    {
+        volk_gnsssdr_free(result_aux[n]);
+    }
+    volk_gnsssdr_free(result_aux);
+}
+
+#endif
+
+#ifdef LV_HAVE_SSE3
+static inline void volk_gnsssdr_16i_resamplerxnpuppet_16i_u_sse3(int16_t* result, const int16_t* local_code, unsigned int num_points)
+{
+    int code_length_chips = 2046;
+    float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points );
+    int num_out_vectors = 3;
+    float rem_code_phase_chips = -0.234;
+    unsigned int n;
+    float shifts_chips[3] = { -0.1, 0.0, 0.1 };
+    int16_t** result_aux =  (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_out_vectors, volk_gnsssdr_get_alignment());
+
+    for(n = 0; n < num_out_vectors; n++)
+    {
+       result_aux[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment());
+    }
+
+    volk_gnsssdr_16i_xn_resampler_16i_xn_u_sse3(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points);
+
+    memcpy((int16_t*)result, (int16_t*)result_aux[0], sizeof(int16_t) * num_points);
+
+    for(n = 0; n < num_out_vectors; n++)
+    {
+        volk_gnsssdr_free(result_aux[n]);
+    }
+    volk_gnsssdr_free(result_aux);
+}
+
+#endif
+
+
+#ifdef LV_HAVE_SSE4_1
+static inline void volk_gnsssdr_16i_resamplerxnpuppet_16i_u_sse4_1(int16_t* result, const int16_t* local_code, unsigned int num_points)
+{
+    int code_length_chips = 2046;
+    float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points );
+    int num_out_vectors = 3;
+    float rem_code_phase_chips = -0.234;
+    unsigned int n;
+    float shifts_chips[3] = { -0.1, 0.0, 0.1 };
+    int16_t** result_aux =  (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_out_vectors, volk_gnsssdr_get_alignment());
+
+    for(n = 0; n < num_out_vectors; n++)
+    {
+       result_aux[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment());
+    }
+
+    volk_gnsssdr_16i_xn_resampler_16i_xn_u_sse4_1(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points);
+
+    memcpy((int16_t*)result, (int16_t*)result_aux[0], sizeof(int16_t) * num_points);
+
+    for(n = 0; n < num_out_vectors; n++)
+    {
+        volk_gnsssdr_free(result_aux[n]);
+    }
+    volk_gnsssdr_free(result_aux);
+}
+
+#endif
+
+
+#ifdef LV_HAVE_SSE4_1
+static inline void volk_gnsssdr_16i_resamplerxnpuppet_16i_a_sse4_1(int16_t* result, const int16_t* local_code, unsigned int num_points)
+{
+    int code_length_chips = 2046;
+    float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points );
+    int num_out_vectors = 3;
+    float rem_code_phase_chips = -0.234;
+    unsigned int n;
+    float shifts_chips[3] = { -0.1, 0.0, 0.1 };
+    int16_t** result_aux =  (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_out_vectors, volk_gnsssdr_get_alignment());
+
+    for(n = 0; n < num_out_vectors; n++)
+    {
+       result_aux[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment());
+    }
+
+    volk_gnsssdr_16i_xn_resampler_16i_xn_a_sse4_1(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points);
+
+    memcpy((int16_t*)result, (int16_t*)result_aux[0], sizeof(int16_t) * num_points);
+
+    for(n = 0; n < num_out_vectors; n++)
+    {
+        volk_gnsssdr_free(result_aux[n]);
+    }
+    volk_gnsssdr_free(result_aux);
+}
+
+#endif
+
+
+#ifdef LV_HAVE_AVX
+static inline void volk_gnsssdr_16i_resamplerxnpuppet_16i_u_avx(int16_t* result, const int16_t* local_code, unsigned int num_points)
+{
+    int code_length_chips = 2046;
+    float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points );
+    int num_out_vectors = 3;
+    float rem_code_phase_chips = -0.234;
+    unsigned int n;
+    float shifts_chips[3] = { -0.1, 0.0, 0.1 };
+    int16_t** result_aux =  (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_out_vectors, volk_gnsssdr_get_alignment());
+
+    for(n = 0; n < num_out_vectors; n++)
+    {
+       result_aux[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment());
+    }
+
+    volk_gnsssdr_16i_xn_resampler_16i_xn_u_avx(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points);
+
+    memcpy((int16_t*)result, (int16_t*)result_aux[0], sizeof(int16_t) * num_points);
+
+    for(n = 0; n < num_out_vectors; n++)
+    {
+        volk_gnsssdr_free(result_aux[n]);
+    }
+    volk_gnsssdr_free(result_aux);
+}
+
+#endif
+
+
+#ifdef LV_HAVE_AVX
+static inline void volk_gnsssdr_16i_resamplerxnpuppet_16i_a_avx(int16_t* result, const int16_t* local_code, unsigned int num_points)
+{
+    int code_length_chips = 2046;
+    float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points );
+    int num_out_vectors = 3;
+    float rem_code_phase_chips = -0.234;
+    unsigned int n;
+    float shifts_chips[3] = { -0.1, 0.0, 0.1 };
+    int16_t** result_aux =  (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_out_vectors, volk_gnsssdr_get_alignment());
+
+    for(n = 0; n < num_out_vectors; n++)
+    {
+       result_aux[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment());
+    }
+
+    volk_gnsssdr_16i_xn_resampler_16i_xn_a_avx(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points);
+
+    memcpy((int16_t*)result, (int16_t*)result_aux[0], sizeof(int16_t) * num_points);
+
+    for(n = 0; n < num_out_vectors; n++)
+    {
+        volk_gnsssdr_free(result_aux[n]);
+    }
+    volk_gnsssdr_free(result_aux);
+}
+
+#endif
+
+
+#ifdef LV_HAVE_NEON
+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;
+    float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points );
+    int num_out_vectors = 3;
+    float rem_code_phase_chips = -0.234;
+    unsigned int n;
+    float shifts_chips[3] = { -0.1, 0.0, 0.1 };
+    int16_t** result_aux =  (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_out_vectors, volk_gnsssdr_get_alignment());
+
+    for(n = 0; n < num_out_vectors; n++)
+    {
+       result_aux[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment());
+    }
+
+    volk_gnsssdr_16i_xn_resampler_16i_xn_neon(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points);
+
+    memcpy((int16_t*)result, (int16_t*)result_aux[0], sizeof(int16_t) * num_points);
+
+    for(n = 0; n < num_out_vectors; n++)
+    {
+        volk_gnsssdr_free(result_aux[n]);
+    }
+    volk_gnsssdr_free(result_aux);
+}
+
+#endif
+
+#endif // INCLUDED_volk_gnsssdr_16i_resamplerpuppet_16i_H
+
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
new file mode 100644
index 000000000..0d09df273
--- /dev/null
+++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16i_xn_resampler_16i_xn.h
@@ -0,0 +1,608 @@
+/*!
+ * \file volk_gnsssdr_16i_xn_resampler_16i_xn.h
+ * \brief VOLK_GNSSSDR kernel: Resamples N 16 bits integer short vectors using zero hold resample algorithm.
+ * \authors <ul>
+ *          <li> Cillian O'Driscoll, 2017. cillian.odriscoll(at)gmail.com
+ *          </ul>
+ *
+ * VOLK_GNSSSDR kernel that resamples N 16 bits integer short complex vectors using zero hold resample algorithm.
+ * It resamples a single GNSS local code signal replica into N vectors fractional-resampled and fractional-delayed
+ * (i.e. it creates the Early, Prompt, and Late code replicas)
+ *
+ * -------------------------------------------------------------------------
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ *
+ * -------------------------------------------------------------------------
+ */
+
+/*!
+ * \page volk_gnsssdr_16i_xn_resampler_16i_xn
+ *
+ * \b Overview
+ *
+ * Resamples a complex vector (16-bit integer each component), providing \p num_out_vectors outputs.
+ *
+ * <b>Dispatcher Prototype</b>
+ * \code
+ * void volk_gnsssdr_16i_xn_resampler_16i_xn(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)
+ * \endcode
+ *
+ * \b Inputs
+ * \li local_code:            Vector to be resampled.
+ * \li rem_code_phase_chips:  Remnant code phase [chips].
+ * \li code_phase_step_chips: Phase increment per sample [chips/sample].
+ * \li shifts_chips:          Vector of floats that defines the spacing (in chips) between the replicas of \p local_code
+ * \li code_length_chips:     Code length in chips.
+ * \li num_out_vectors:       Number of output vectors.
+ * \li num_points:            The number of data values to be in the resampled vector.
+ *
+ * \b Outputs
+ * \li result:                Pointer to a vector of pointers where the results will be stored.
+ *
+ */
+
+#ifndef INCLUDED_volk_gnsssdr_16i_xn_resampler_16i_xn_H
+#define INCLUDED_volk_gnsssdr_16i_xn_resampler_16i_xn_H
+
+#include <assert.h>
+#include <math.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <volk_gnsssdr/volk_gnsssdr_common.h>
+#include <volk_gnsssdr/volk_gnsssdr_complex.h>
+
+
+#ifdef LV_HAVE_GENERIC
+
+static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_generic(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)
+{
+    int local_code_chip_index;
+    int current_correlator_tap;
+    int n;
+    for (current_correlator_tap = 0; current_correlator_tap < num_out_vectors; current_correlator_tap++)
+        {
+            for (n = 0; n < num_points; n++)
+                {
+                    // resample code for current tap
+                    local_code_chip_index = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips);
+                    //Take into account that in multitap correlators, the shifts can be negative!
+                    if (local_code_chip_index < 0) local_code_chip_index += (int)code_length_chips * (abs(local_code_chip_index) / code_length_chips + 1);
+                    local_code_chip_index = local_code_chip_index % code_length_chips;
+                    result[current_correlator_tap][n] = local_code[local_code_chip_index];
+                }
+        }
+}
+
+#endif /*LV_HAVE_GENERIC*/
+
+#ifdef LV_HAVE_SSE4_1
+#include <smmintrin.h>
+static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_a_sse4_1(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)
+{
+    int16_t** _result = result;
+    const unsigned int quarterPoints = num_points / 4;
+    int current_correlator_tap;
+    unsigned int n;
+    unsigned int k;
+    const __m128 fours = _mm_set1_ps(4.0f);
+    const __m128 rem_code_phase_chips_reg = _mm_set_ps1(rem_code_phase_chips);
+    const __m128 code_phase_step_chips_reg = _mm_set_ps1(code_phase_step_chips);
+
+    __VOLK_ATTR_ALIGNED(16) int local_code_chip_index[4];
+    int local_code_chip_index_;
+
+    const __m128i zeros = _mm_setzero_si128();
+    const __m128 code_length_chips_reg_f = _mm_set_ps1((float)code_length_chips);
+    const __m128i code_length_chips_reg_i = _mm_set1_epi32((int)code_length_chips);
+    __m128i local_code_chip_index_reg, aux_i, negatives, i;
+    __m128 aux, aux2, shifts_chips_reg, c, cTrunc, base;
+
+    for (current_correlator_tap = 0; current_correlator_tap < num_out_vectors; current_correlator_tap++)
+        {
+            shifts_chips_reg = _mm_set_ps1((float)shifts_chips[current_correlator_tap]);
+            aux2 = _mm_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg);
+            __m128 indexn = _mm_set_ps(3.0f, 2.0f, 1.0f, 0.0f);
+            for(n = 0; n < quarterPoints; n++)
+                {
+                    aux = _mm_mul_ps(code_phase_step_chips_reg, indexn);
+                    aux = _mm_add_ps(aux, aux2);
+                    // floor
+                    aux = _mm_floor_ps(aux);
+
+                    // fmod
+                    c = _mm_div_ps(aux, code_length_chips_reg_f);
+                    i = _mm_cvttps_epi32(c);
+                    cTrunc = _mm_cvtepi32_ps(i);
+                    base = _mm_mul_ps(cTrunc, code_length_chips_reg_f);
+                    local_code_chip_index_reg = _mm_cvtps_epi32(_mm_sub_ps(aux, base));
+
+                    negatives = _mm_cmplt_epi32(local_code_chip_index_reg, zeros);
+                    aux_i = _mm_and_si128(code_length_chips_reg_i, negatives);
+                    local_code_chip_index_reg = _mm_add_epi32(local_code_chip_index_reg, aux_i);
+                    _mm_store_si128((__m128i*)local_code_chip_index, local_code_chip_index_reg);
+                    for(k = 0; k < 4; ++k)
+                        {
+                            _result[current_correlator_tap][n * 4 + k] = local_code[local_code_chip_index[k]];
+                        }
+                    indexn = _mm_add_ps(indexn, fours);
+                }
+            for(n = quarterPoints * 4; n < num_points; n++)
+                {
+                    // resample code for current tap
+                    local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips);
+                    //Take into account that in multitap correlators, the shifts can be negative!
+                    if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1);
+                    local_code_chip_index_ = local_code_chip_index_ % code_length_chips;
+                    _result[current_correlator_tap][n] = local_code[local_code_chip_index_];
+                }
+        }
+}
+
+#endif 
+
+
+#ifdef LV_HAVE_SSE4_1
+#include <smmintrin.h>
+static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_u_sse4_1(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)
+{
+    int16_t** _result = result;
+    const unsigned int quarterPoints = num_points / 4;
+    int current_correlator_tap;
+    unsigned int n;
+    unsigned int k;
+    const __m128 fours = _mm_set1_ps(4.0f);
+    const __m128 rem_code_phase_chips_reg = _mm_set_ps1(rem_code_phase_chips);
+    const __m128 code_phase_step_chips_reg = _mm_set_ps1(code_phase_step_chips);
+
+    __VOLK_ATTR_ALIGNED(16) int local_code_chip_index[4];
+    int local_code_chip_index_;
+
+    const __m128i zeros = _mm_setzero_si128();
+    const __m128 code_length_chips_reg_f = _mm_set_ps1((float)code_length_chips);
+    const __m128i code_length_chips_reg_i = _mm_set1_epi32((int)code_length_chips);
+    __m128i local_code_chip_index_reg, aux_i, negatives, i;
+    __m128 aux, aux2, shifts_chips_reg, c, cTrunc, base;
+
+    for (current_correlator_tap = 0; current_correlator_tap < num_out_vectors; current_correlator_tap++)
+        {
+            shifts_chips_reg = _mm_set_ps1((float)shifts_chips[current_correlator_tap]);
+            aux2 = _mm_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg);
+            __m128 indexn = _mm_set_ps(3.0f, 2.0f, 1.0f, 0.0f);
+            for(n = 0; n < quarterPoints; n++)
+                {
+                    aux = _mm_mul_ps(code_phase_step_chips_reg, indexn);
+                    aux = _mm_add_ps(aux, aux2);
+                    // floor
+                    aux = _mm_floor_ps(aux);
+
+                    // fmod
+                    c = _mm_div_ps(aux, code_length_chips_reg_f);
+                    i = _mm_cvttps_epi32(c);
+                    cTrunc = _mm_cvtepi32_ps(i);
+                    base = _mm_mul_ps(cTrunc, code_length_chips_reg_f);
+                    local_code_chip_index_reg = _mm_cvtps_epi32(_mm_sub_ps(aux, base));
+
+                    negatives = _mm_cmplt_epi32(local_code_chip_index_reg, zeros);
+                    aux_i = _mm_and_si128(code_length_chips_reg_i, negatives);
+                    local_code_chip_index_reg = _mm_add_epi32(local_code_chip_index_reg, aux_i);
+                    _mm_store_si128((__m128i*)local_code_chip_index, local_code_chip_index_reg);
+                    for(k = 0; k < 4; ++k)
+                        {
+                            _result[current_correlator_tap][n * 4 + k] = local_code[local_code_chip_index[k]];
+                        }
+                    indexn = _mm_add_ps(indexn, fours);
+                }
+            for(n = quarterPoints * 4; n < num_points; n++)
+                {
+                    // resample code for current tap
+                    local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips);
+                    //Take into account that in multitap correlators, the shifts can be negative!
+                    if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1);
+                    local_code_chip_index_ = local_code_chip_index_ % code_length_chips;
+                    _result[current_correlator_tap][n] = local_code[local_code_chip_index_];
+                }
+        }
+}
+
+#endif
+
+
+#ifdef LV_HAVE_SSE3
+#include <pmmintrin.h>
+static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_a_sse3(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)
+{
+    int16_t** _result = result;
+    const unsigned int quarterPoints = num_points / 4;
+    int current_correlator_tap;
+    unsigned int n;
+    unsigned int k;
+    const __m128 ones = _mm_set1_ps(1.0f);
+    const __m128 fours = _mm_set1_ps(4.0f);
+    const __m128 rem_code_phase_chips_reg = _mm_set_ps1(rem_code_phase_chips);
+    const __m128 code_phase_step_chips_reg = _mm_set_ps1(code_phase_step_chips);
+
+    __VOLK_ATTR_ALIGNED(16) int local_code_chip_index[4];
+    int local_code_chip_index_;
+
+    const __m128i zeros = _mm_setzero_si128();
+    const __m128 code_length_chips_reg_f = _mm_set_ps1((float)code_length_chips);
+    const __m128i code_length_chips_reg_i = _mm_set1_epi32((int)code_length_chips);
+    __m128i local_code_chip_index_reg, aux_i, negatives, i;
+    __m128 aux, aux2, shifts_chips_reg, fi, igx, j, c, cTrunc, base;
+
+    for (current_correlator_tap = 0; current_correlator_tap < num_out_vectors; current_correlator_tap++)
+        {
+            shifts_chips_reg = _mm_set_ps1((float)shifts_chips[current_correlator_tap]);
+            aux2 = _mm_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg);
+            __m128 indexn = _mm_set_ps(3.0f, 2.0f, 1.0f, 0.0f);
+            for(n = 0; n < quarterPoints; n++)
+                {
+                    aux = _mm_mul_ps(code_phase_step_chips_reg, indexn);
+                    aux = _mm_add_ps(aux, aux2);
+                    // floor
+                    i = _mm_cvttps_epi32(aux);
+                    fi = _mm_cvtepi32_ps(i);
+                    igx = _mm_cmpgt_ps(fi, aux);
+                    j = _mm_and_ps(igx, ones);
+                    aux = _mm_sub_ps(fi, j);
+                    // fmod
+                    c = _mm_div_ps(aux, code_length_chips_reg_f);
+                    i = _mm_cvttps_epi32(c);
+                    cTrunc = _mm_cvtepi32_ps(i);
+                    base = _mm_mul_ps(cTrunc, code_length_chips_reg_f);
+                    local_code_chip_index_reg = _mm_cvtps_epi32(_mm_sub_ps(aux, base));
+
+                    negatives = _mm_cmplt_epi32(local_code_chip_index_reg, zeros);
+                    aux_i = _mm_and_si128(code_length_chips_reg_i, negatives);
+                    local_code_chip_index_reg = _mm_add_epi32(local_code_chip_index_reg, aux_i);
+                    _mm_store_si128((__m128i*)local_code_chip_index, local_code_chip_index_reg);
+                    for(k = 0; k < 4; ++k)
+                        {
+                            _result[current_correlator_tap][n * 4 + k] = local_code[local_code_chip_index[k]];
+                        }
+                    indexn = _mm_add_ps(indexn, fours);
+                }
+            for(n = quarterPoints * 4; n < num_points; n++)
+                {
+                    // resample code for current tap
+                    local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips);
+                    //Take into account that in multitap correlators, the shifts can be negative!
+                    if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1);
+                    local_code_chip_index_ = local_code_chip_index_ % code_length_chips;
+                    _result[current_correlator_tap][n] = local_code[local_code_chip_index_];
+                }
+        }
+}
+
+#endif
+
+
+#ifdef LV_HAVE_SSE3
+#include <pmmintrin.h>
+static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_u_sse3(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)
+{
+    int16_t** _result = result;
+    const unsigned int quarterPoints = num_points / 4;
+    int current_correlator_tap;
+    unsigned int n;
+    unsigned int k;
+    const __m128 ones = _mm_set1_ps(1.0f);
+    const __m128 fours = _mm_set1_ps(4.0f);
+    const __m128 rem_code_phase_chips_reg = _mm_set_ps1(rem_code_phase_chips);
+    const __m128 code_phase_step_chips_reg = _mm_set_ps1(code_phase_step_chips);
+
+    __VOLK_ATTR_ALIGNED(16) int local_code_chip_index[4];
+    int local_code_chip_index_;
+
+    const __m128i zeros = _mm_setzero_si128();
+    const __m128 code_length_chips_reg_f = _mm_set_ps1((float)code_length_chips);
+    const __m128i code_length_chips_reg_i = _mm_set1_epi32((int)code_length_chips);
+    __m128i local_code_chip_index_reg, aux_i, negatives, i;
+    __m128 aux, aux2, shifts_chips_reg, fi, igx, j, c, cTrunc, base;
+
+    for (current_correlator_tap = 0; current_correlator_tap < num_out_vectors; current_correlator_tap++)
+        {
+            shifts_chips_reg = _mm_set_ps1((float)shifts_chips[current_correlator_tap]);
+            aux2 = _mm_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg);
+            __m128 indexn = _mm_set_ps(3.0f, 2.0f, 1.0f, 0.0f);
+            for(n = 0; n < quarterPoints; n++)
+                {
+                    aux = _mm_mul_ps(code_phase_step_chips_reg, indexn);
+                    aux = _mm_add_ps(aux, aux2);
+                    // floor
+                    i = _mm_cvttps_epi32(aux);
+                    fi = _mm_cvtepi32_ps(i);
+                    igx = _mm_cmpgt_ps(fi, aux);
+                    j = _mm_and_ps(igx, ones);
+                    aux = _mm_sub_ps(fi, j);
+                    // fmod
+                    c = _mm_div_ps(aux, code_length_chips_reg_f);
+                    i = _mm_cvttps_epi32(c);
+                    cTrunc = _mm_cvtepi32_ps(i);
+                    base = _mm_mul_ps(cTrunc, code_length_chips_reg_f);
+                    local_code_chip_index_reg = _mm_cvtps_epi32(_mm_sub_ps(aux, base));
+
+                    negatives = _mm_cmplt_epi32(local_code_chip_index_reg, zeros);
+                    aux_i = _mm_and_si128(code_length_chips_reg_i, negatives);
+                    local_code_chip_index_reg = _mm_add_epi32(local_code_chip_index_reg, aux_i);
+                    _mm_store_si128((__m128i*)local_code_chip_index, local_code_chip_index_reg);
+                    for(k = 0; k < 4; ++k)
+                        {
+                            _result[current_correlator_tap][n * 4 + k] = local_code[local_code_chip_index[k]];
+                        }
+                    indexn = _mm_add_ps(indexn, fours);
+                }
+            for(n = quarterPoints * 4; n < num_points; n++)
+                {
+                    // resample code for current tap
+                    local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips);
+                    //Take into account that in multitap correlators, the shifts can be negative!
+                    if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1);
+                    local_code_chip_index_ = local_code_chip_index_ % code_length_chips;
+                    _result[current_correlator_tap][n] = local_code[local_code_chip_index_];
+                }
+        }
+}
+
+#endif
+
+
+#ifdef LV_HAVE_AVX
+#include <immintrin.h>
+static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_a_avx(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)
+{
+    int16_t** _result = result;
+    const unsigned int avx_iters = num_points / 8;
+    int current_correlator_tap;
+    unsigned int n;
+    unsigned int k;
+    const __m256 eights = _mm256_set1_ps(8.0f);
+    const __m256 rem_code_phase_chips_reg = _mm256_set1_ps(rem_code_phase_chips);
+    const __m256 code_phase_step_chips_reg = _mm256_set1_ps(code_phase_step_chips);
+
+    __VOLK_ATTR_ALIGNED(32) int local_code_chip_index[8];
+    int local_code_chip_index_;
+
+    const __m256 zeros = _mm256_setzero_ps();
+    const __m256 code_length_chips_reg_f = _mm256_set1_ps((float)code_length_chips);
+    const __m256 n0 = _mm256_set_ps(7.0f, 6.0f, 5.0f, 4.0f, 3.0f, 2.0f, 1.0f, 0.0f);
+
+    __m256i local_code_chip_index_reg, i;
+    __m256 aux, aux2, aux3, shifts_chips_reg, c, cTrunc, base, negatives, indexn;
+
+    for (current_correlator_tap = 0; current_correlator_tap < num_out_vectors; current_correlator_tap++)
+        {
+            shifts_chips_reg = _mm256_set1_ps((float)shifts_chips[current_correlator_tap]);
+            aux2 = _mm256_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg);
+            indexn = n0;
+            for(n = 0; n < avx_iters; n++)
+                {
+                    __VOLK_GNSSSDR_PREFETCH_LOCALITY(&_result[current_correlator_tap][8 * n + 7], 1, 0);
+                    __VOLK_GNSSSDR_PREFETCH_LOCALITY(&local_code_chip_index[8], 1, 3);
+                    aux = _mm256_mul_ps(code_phase_step_chips_reg, indexn);
+                    aux = _mm256_add_ps(aux, aux2);
+                    // floor
+                    aux = _mm256_floor_ps(aux);
+
+                    // fmod
+                    c = _mm256_div_ps(aux, code_length_chips_reg_f);
+                    i = _mm256_cvttps_epi32(c);
+                    cTrunc = _mm256_cvtepi32_ps(i);
+                    base = _mm256_mul_ps(cTrunc, code_length_chips_reg_f);
+                    local_code_chip_index_reg = _mm256_cvttps_epi32(_mm256_sub_ps(aux, base));
+
+                    // no negatives
+                    c = _mm256_cvtepi32_ps(local_code_chip_index_reg);
+                    negatives = _mm256_cmp_ps(c, zeros, 0x01 );
+                    aux3 = _mm256_and_ps(code_length_chips_reg_f, negatives);
+                    aux = _mm256_add_ps(c, aux3);
+                    local_code_chip_index_reg = _mm256_cvttps_epi32(aux);
+
+                    _mm256_store_si256((__m256i*)local_code_chip_index, local_code_chip_index_reg);
+                    for(k = 0; k < 8; ++k)
+                        {
+                            _result[current_correlator_tap][n * 8 + k] = local_code[local_code_chip_index[k]];
+                        }
+                    indexn = _mm256_add_ps(indexn, eights);
+                }
+        }
+    _mm256_zeroupper();
+    for (current_correlator_tap = 0; current_correlator_tap < num_out_vectors; current_correlator_tap++)
+        {
+            for(n = avx_iters * 8; n < num_points; n++)
+                {
+                    // resample code for current tap
+                    local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips);
+                    //Take into account that in multitap correlators, the shifts can be negative!
+                    if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1);
+                    local_code_chip_index_ = local_code_chip_index_ % code_length_chips;
+                    _result[current_correlator_tap][n] = local_code[local_code_chip_index_];
+                }
+        }
+}
+
+#endif
+
+
+#ifdef LV_HAVE_AVX
+#include <immintrin.h>
+static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_u_avx(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)
+{
+    int16_t** _result = result;
+    const unsigned int avx_iters = num_points / 8;
+    int current_correlator_tap;
+    unsigned int n;
+    unsigned int k;
+    const __m256 eights = _mm256_set1_ps(8.0f);
+    const __m256 rem_code_phase_chips_reg = _mm256_set1_ps(rem_code_phase_chips);
+    const __m256 code_phase_step_chips_reg = _mm256_set1_ps(code_phase_step_chips);
+
+    __VOLK_ATTR_ALIGNED(32) int local_code_chip_index[8];
+    int local_code_chip_index_;
+
+    const __m256 zeros = _mm256_setzero_ps();
+    const __m256 code_length_chips_reg_f = _mm256_set1_ps((float)code_length_chips);
+    const __m256 n0 = _mm256_set_ps(7.0f, 6.0f, 5.0f, 4.0f, 3.0f, 2.0f, 1.0f, 0.0f);
+
+    __m256i local_code_chip_index_reg, i;
+    __m256 aux, aux2, aux3, shifts_chips_reg, c, cTrunc, base, negatives, indexn;
+
+    for (current_correlator_tap = 0; current_correlator_tap < num_out_vectors; current_correlator_tap++)
+        {
+            shifts_chips_reg = _mm256_set1_ps((float)shifts_chips[current_correlator_tap]);
+            aux2 = _mm256_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg);
+            indexn = n0;
+            for(n = 0; n < avx_iters; n++)
+                {
+                    __VOLK_GNSSSDR_PREFETCH_LOCALITY(&_result[current_correlator_tap][8 * n + 7], 1, 0);
+                    __VOLK_GNSSSDR_PREFETCH_LOCALITY(&local_code_chip_index[8], 1, 3);
+                    aux = _mm256_mul_ps(code_phase_step_chips_reg, indexn);
+                    aux = _mm256_add_ps(aux, aux2);
+                    // floor
+                    aux = _mm256_floor_ps(aux);
+
+                    // fmod
+                    c = _mm256_div_ps(aux, code_length_chips_reg_f);
+                    i = _mm256_cvttps_epi32(c);
+                    cTrunc = _mm256_cvtepi32_ps(i);
+                    base = _mm256_mul_ps(cTrunc, code_length_chips_reg_f);
+                    local_code_chip_index_reg = _mm256_cvttps_epi32(_mm256_sub_ps(aux, base));
+
+                    // no negatives
+                    c = _mm256_cvtepi32_ps(local_code_chip_index_reg);
+                    negatives = _mm256_cmp_ps(c, zeros, 0x01 );
+                    aux3 = _mm256_and_ps(code_length_chips_reg_f, negatives);
+                    aux = _mm256_add_ps(c, aux3);
+                    local_code_chip_index_reg = _mm256_cvttps_epi32(aux);
+
+                    _mm256_store_si256((__m256i*)local_code_chip_index, local_code_chip_index_reg);
+                    for(k = 0; k < 8; ++k)
+                        {
+                            _result[current_correlator_tap][n * 8 + k] = local_code[local_code_chip_index[k]];
+                        }
+                    indexn = _mm256_add_ps(indexn, eights);
+                }
+        }
+    _mm256_zeroupper();
+    for (current_correlator_tap = 0; current_correlator_tap < num_out_vectors; current_correlator_tap++)
+        {
+            for(n = avx_iters * 8; n < num_points; n++)
+                {
+                    // resample code for current tap
+                    local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips);
+                    //Take into account that in multitap correlators, the shifts can be negative!
+                    if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1);
+                    local_code_chip_index_ = local_code_chip_index_ % code_length_chips;
+                    _result[current_correlator_tap][n] = local_code[local_code_chip_index_];
+                }
+        }
+}
+
+#endif
+
+
+#ifdef LV_HAVE_NEON
+#include <arm_neon.h>
+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)
+{
+    int16_t** _result = result;
+    const unsigned int neon_iters = num_points / 4;
+    const int32x4_t ones = vdupq_n_s32(1);
+    const float32x4_t fours = vdupq_n_f32(4.0f);
+    const float32x4_t rem_code_phase_chips_reg = vdupq_n_f32(rem_code_phase_chips);
+    const float32x4_t code_phase_step_chips_reg = vdupq_n_f32(code_phase_step_chips);
+
+    __VOLK_ATTR_ALIGNED(16) int32_t local_code_chip_index[4];
+    int32_t local_code_chip_index_;
+
+    const int32x4_t zeros = vdupq_n_s32(0);
+    const float32x4_t code_length_chips_reg_f = vdupq_n_f32((float)code_length_chips);
+    const int32x4_t code_length_chips_reg_i = vdupq_n_s32((int32_t)code_length_chips);
+    int32x4_t local_code_chip_index_reg, aux_i, negatives, i;
+    float32x4_t aux, aux2, shifts_chips_reg, fi, c, j, cTrunc, base, indexn, reciprocal;
+    __VOLK_ATTR_ALIGNED(16) const float vec[4] = { 0.0f, 1.0f, 2.0f, 3.0f };
+    uint32x4_t igx;
+    reciprocal = vrecpeq_f32(code_length_chips_reg_f);
+    reciprocal = vmulq_f32(vrecpsq_f32(code_length_chips_reg_f, reciprocal), reciprocal);
+    reciprocal = vmulq_f32(vrecpsq_f32(code_length_chips_reg_f, reciprocal), reciprocal); // this refinement is required!
+    float32x4_t n0 = vld1q_f32((float*)vec);
+    int current_correlator_tap;
+    unsigned int n;
+    unsigned int k;
+    for (current_correlator_tap = 0; current_correlator_tap < num_out_vectors; current_correlator_tap++)
+        {
+            shifts_chips_reg = vdupq_n_f32((float)shifts_chips[current_correlator_tap]);
+            aux2 = vsubq_f32(shifts_chips_reg, rem_code_phase_chips_reg);
+            indexn = n0;
+            for(n = 0; n < neon_iters; n++)
+                {
+                    __VOLK_GNSSSDR_PREFETCH_LOCALITY(&_result[current_correlator_tap][4 * n + 3], 1, 0);
+                    __VOLK_GNSSSDR_PREFETCH(&local_code_chip_index[4]);
+                    aux = vmulq_f32(code_phase_step_chips_reg, indexn);
+                    aux = vaddq_f32(aux, aux2);
+
+                    //floor
+                    i = vcvtq_s32_f32(aux);
+                    fi = vcvtq_f32_s32(i);
+                    igx = vcgtq_f32(fi, aux);
+                    j = vcvtq_f32_s32(vandq_s32(vreinterpretq_s32_u32(igx), ones));
+                    aux = vsubq_f32(fi, j);
+
+                    // fmod
+                    c = vmulq_f32(aux, reciprocal);
+                    i =  vcvtq_s32_f32(c);
+                    cTrunc = vcvtq_f32_s32(i);
+                    base = vmulq_f32(cTrunc, code_length_chips_reg_f);
+                    aux = vsubq_f32(aux, base);
+                    local_code_chip_index_reg = vcvtq_s32_f32(aux);
+
+                    negatives = vreinterpretq_s32_u32(vcltq_s32(local_code_chip_index_reg, zeros));
+                    aux_i = vandq_s32(code_length_chips_reg_i, negatives);
+                    local_code_chip_index_reg = vaddq_s32(local_code_chip_index_reg, aux_i);
+
+                    vst1q_s32((int32_t*)local_code_chip_index, local_code_chip_index_reg);
+
+                    for(k = 0; k < 4; ++k)
+                        {
+                            _result[current_correlator_tap][n * 4 + k] = local_code[local_code_chip_index[k]];
+                        }
+                    indexn = vaddq_f32(indexn, fours);
+                }
+            for(n = neon_iters * 4; n < num_points; n++)
+                {
+                    __VOLK_GNSSSDR_PREFETCH_LOCALITY(&_result[current_correlator_tap][n], 1, 0);
+                    // resample code for current tap
+                    local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips);
+                    //Take into account that in multitap correlators, the shifts can be negative!
+                    if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1);
+                    local_code_chip_index_ = local_code_chip_index_ % code_length_chips;
+                    _result[current_correlator_tap][n] = local_code[local_code_chip_index_];
+                }
+        }
+}
+
+
+#endif
+
+
+#endif /*INCLUDED_volk_gnsssdr_16i_xn_resampler_16i_xn_H*/
+
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
new file mode 100644
index 000000000..230401ccb
--- /dev/null
+++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn.h
@@ -0,0 +1,1600 @@
+/*!
+ * \file volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn.h
+ * \brief VOLK_GNSSSDR kernel: multiplies N 16 bits vectors by a common vector
+ * phase rotated and accumulates the results in N 16 bits short complex outputs.
+ * \authors <ul>
+ *          <li> Javier Arribas, 2015. jarribas(at)cttc.es
+ *          </ul>
+ *
+ * VOLK_GNSSSDR kernel that multiplies N 16 bits vectors by a common vector, which is
+ * phase-rotated by phase offset and phase increment, and accumulates the results
+ * in N 16 bits short complex outputs.
+ * It is optimized to perform the N tap correlation process in GNSS receivers.
+ *
+ * -------------------------------------------------------------------------
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ *
+ * -------------------------------------------------------------------------
+ */
+
+/*!
+ * \page volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn
+ *
+ * \b Overview
+ *
+ * Rotates and multiplies the reference complex vector with an arbitrary number of other complex 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.
+ *
+ * <b>Dispatcher Prototype</b>
+ * \code
+ * void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn((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);
+ * \endcode
+ *
+ * \b Inputs
+ * \li in_common:     Pointer to one of the vectors to be rotated, multiplied and accumulated (reference vector).
+ * \li phase_inc:     Phase increment = lv_cmake(cos(phase_step_rad), sin(phase_step_rad))
+ * \li phase:         Initial phase = lv_cmake(cos(initial_phase_rad), sin(initial_phase_rad))
+ * \li in_a:          Pointer to an array of pointers to multiple vectors to be multiplied and accumulated.
+ * \li num_a_vectors: Number of vectors to be multiplied by the reference vector and accumulated.
+ * \li num_points:    Number of complex values to be multiplied together, accumulated and stored into \p result.
+ *
+ * \b Outputs
+ * \li phase:         Final phase.
+ * \li result:        Vector of \p num_a_vectors components with the multiple vectors of \p in_a rotated, multiplied by \p in_common and accumulated.
+ *
+ */
+
+#ifndef INCLUDED_volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_H
+#define INCLUDED_volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_H
+
+
+#include <volk_gnsssdr/volk_gnsssdr.h>
+#include <volk_gnsssdr/volk_gnsssdr_malloc.h>
+#include <volk_gnsssdr/volk_gnsssdr_complex.h>
+#include <volk_gnsssdr/saturation_arithmetic.h>
+#include <math.h>
+//#include <stdio.h>
+
+#ifdef LV_HAVE_GENERIC
+
+static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_generic(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)
+{
+    lv_16sc_t tmp16;
+    lv_32fc_t tmp32;
+    int n_vec;
+    unsigned int n;
+    for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+        {
+            result[n_vec] = lv_cmake(0,0);
+        }
+    for (n = 0; n < num_points; n++)
+        {
+            tmp16 = *in_common++; //if(n<10 || n >= 8108) printf("generic phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase));
+            tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase);
+            tmp16 = lv_cmake((int16_t)rintf(lv_creal(tmp32)), (int16_t)rintf(lv_cimag(tmp32)));
+
+            // Regenerate phase
+            if (n % 256 == 0)
+                {
+                    //printf("Phase before regeneration %i: %f,%f  Modulus: %f\n", n,lv_creal(*phase),lv_cimag(*phase), cabsf(*phase));
+#ifdef __cplusplus
+                    (*phase) /= std::abs((*phase));
+#else
+                    (*phase) /= hypotf(lv_creal(*phase), lv_cimag(*phase));
+#endif
+                    //printf("Phase after regeneration %i: %f,%f  Modulus: %f\n", n,lv_creal(*phase),lv_cimag(*phase), cabsf(*phase));
+                }
+
+            (*phase) *= phase_inc;
+            for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+                {
+                    lv_16sc_t tmp = tmp16 * in_a[n_vec][n];
+                    //lv_16sc_t tmp = lv_cmake(sat_adds16i(sat_muls16i(lv_creal(tmp16), lv_creal(in_a[n_vec][n])), - sat_muls16i(lv_cimag(tmp16), lv_cimag(in_a[n_vec][n]))) , sat_adds16i(sat_muls16i(lv_creal(tmp16), lv_cimag(in_a[n_vec][n])), sat_muls16i(lv_cimag(tmp16), lv_creal(in_a[n_vec][n]))));
+                    result[n_vec] = lv_cmake(sat_adds16i(lv_creal(result[n_vec]), lv_creal(tmp)), sat_adds16i(lv_cimag(result[n_vec]), lv_cimag(tmp)));
+                }
+        }
+}
+
+#endif /*LV_HAVE_GENERIC*/
+
+
+#ifdef LV_HAVE_GENERIC
+
+static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_generic_reload(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)
+{
+    lv_16sc_t tmp16;
+    lv_32fc_t tmp32;
+    int n_vec;
+    unsigned int n;
+    unsigned int j;
+    const unsigned int ROTATOR_RELOAD = 256;
+    for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+        {
+            result[n_vec] = lv_cmake(0,0);
+        }
+
+    for (n = 0; n < num_points / ROTATOR_RELOAD; n++)
+        {
+            for (j = 0; j < ROTATOR_RELOAD; j++)
+                {
+                    tmp16 = *in_common++; //if(n<10 || n >= 8108) printf("generic phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase));
+                    tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase);
+                    tmp16 = lv_cmake((int16_t)rintf(lv_creal(tmp32)), (int16_t)rintf(lv_cimag(tmp32)));
+                    (*phase) *= phase_inc;
+                    for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+                        {
+                            lv_16sc_t tmp = tmp16 * in_a[n_vec][n * ROTATOR_RELOAD + j];
+                            //lv_16sc_t tmp = lv_cmake(sat_adds16i(sat_muls16i(lv_creal(tmp16), lv_creal(in_a[n_vec][n])), - sat_muls16i(lv_cimag(tmp16), lv_cimag(in_a[n_vec][n]))) , sat_adds16i(sat_muls16i(lv_creal(tmp16), lv_cimag(in_a[n_vec][n])), sat_muls16i(lv_cimag(tmp16), lv_creal(in_a[n_vec][n]))));
+                            result[n_vec] = lv_cmake(sat_adds16i(lv_creal(result[n_vec]), lv_creal(tmp)), sat_adds16i(lv_cimag(result[n_vec]), lv_cimag(tmp)));
+                        }
+                }
+            /* Regenerate phase */
+#ifdef __cplusplus
+            (*phase) /= std::abs((*phase));
+#else
+            //(*phase) /= cabsf((*phase));
+            (*phase) /= hypotf(lv_creal(*phase), lv_cimag(*phase));
+#endif
+        }
+
+    for (j = 0; j < num_points % ROTATOR_RELOAD; j++)
+        {
+            tmp16 = *in_common++; //if(n<10 || n >= 8108) printf("generic phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase));
+            tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase);
+            tmp16 = lv_cmake((int16_t)rintf(lv_creal(tmp32)), (int16_t)rintf(lv_cimag(tmp32)));
+            (*phase) *= phase_inc;
+            for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+                {
+                    lv_16sc_t tmp = tmp16 * in_a[n_vec][ (num_points / ROTATOR_RELOAD) * ROTATOR_RELOAD + j ];
+                    //lv_16sc_t tmp = lv_cmake(sat_adds16i(sat_muls16i(lv_creal(tmp16), lv_creal(in_a[n_vec][n])), - sat_muls16i(lv_cimag(tmp16), lv_cimag(in_a[n_vec][n]))) , sat_adds16i(sat_muls16i(lv_creal(tmp16), lv_cimag(in_a[n_vec][n])), sat_muls16i(lv_cimag(tmp16), lv_creal(in_a[n_vec][n]))));
+                    result[n_vec] = lv_cmake(sat_adds16i(lv_creal(result[n_vec]), lv_creal(tmp)), sat_adds16i(lv_cimag(result[n_vec]), lv_cimag(tmp)));
+                }
+        }
+}
+
+#endif /*LV_HAVE_GENERIC*/
+
+
+#ifdef LV_HAVE_SSE3
+#include <pmmintrin.h>
+
+static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_sse3(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)
+{
+    lv_16sc_t dotProduct = lv_cmake(0,0);
+
+    const unsigned int sse_iters = num_points / 4;
+    int n_vec;
+    int i;
+    unsigned int number;
+    unsigned int n;
+    const int16_t** _in_a = in_a;
+    const lv_16sc_t* _in_common = in_common;
+    lv_16sc_t* _out = result;
+
+    __VOLK_ATTR_ALIGNED(16) lv_16sc_t dotProductVector[4];
+
+    __m128i* cacc = (__m128i*)volk_gnsssdr_malloc(num_a_vectors * sizeof(__m128i), volk_gnsssdr_get_alignment());
+
+    for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+        {
+            cacc[n_vec] = _mm_setzero_si128();
+        }
+
+    __m128i a, b, c;
+
+    // phase rotation registers
+    __m128 pa, pb, two_phase_acc_reg, two_phase_inc_reg;
+    __m128i pc1, pc2;
+    __VOLK_ATTR_ALIGNED(16) lv_32fc_t two_phase_inc[2];
+    two_phase_inc[0] = phase_inc * phase_inc;
+    two_phase_inc[1] = phase_inc * phase_inc;
+    two_phase_inc_reg = _mm_load_ps((float*) two_phase_inc);
+    __VOLK_ATTR_ALIGNED(16) lv_32fc_t two_phase_acc[2];
+    two_phase_acc[0] = (*phase);
+    two_phase_acc[1] = (*phase) * phase_inc;
+    two_phase_acc_reg = _mm_load_ps((float*)two_phase_acc);
+    __m128 yl, yh, tmp1, tmp2, tmp3;
+    lv_16sc_t tmp16;
+    lv_32fc_t tmp32;
+
+    for(number = 0; number < sse_iters; number++)
+        {
+            // Phase rotation on operand in_common starts here:
+            //printf("generic phase %i: %f,%f\n", n*4,lv_creal(*phase),lv_cimag(*phase));
+            pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg
+            //complex 32fc multiplication b=a*two_phase_acc_reg
+            yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr
+            yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di
+            tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr
+            pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br
+            tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di
+            pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di
+            pc1 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic
+
+            //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg
+            yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr
+            yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di
+            tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr
+            tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br
+            tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di
+            two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di
+
+            //next two samples
+            _in_common += 2;
+            pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg
+            __VOLK_GNSSSDR_PREFETCH(_in_common + 8);
+            //complex 32fc multiplication b=a*two_phase_acc_reg
+            yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr
+            yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di
+            tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr
+            pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br
+            tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di
+            pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di
+            pc2 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic
+
+            //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg
+            yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr
+            yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di
+            tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr
+            tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br
+            tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di
+            two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di
+
+            // store four rotated in_common samples in the register b
+            b = _mm_packs_epi32(pc1, pc2);// convert from 32ic to 16ic
+
+            //next two samples
+            _in_common += 2;
+
+            for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+                {
+                    a = _mm_loadl_epi64((__m128i*)&(_in_a[n_vec][number*4])); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg
+
+                    a = _mm_unpacklo_epi16( a, a );
+
+                    c = _mm_mullo_epi16(a, b); // a3.i*b3.i, a3.r*b3.r, ....
+
+                    cacc[n_vec] = _mm_adds_epi16(cacc[n_vec], c);
+                }
+            // Regenerate phase
+            if ((number % 128) == 0)
+                {
+                    tmp1 = _mm_mul_ps(two_phase_acc_reg, two_phase_acc_reg);
+                    tmp2 = _mm_hadd_ps(tmp1, tmp1);
+                    tmp1 = _mm_shuffle_ps(tmp2, tmp2, 0xD8);
+                    tmp2 = _mm_sqrt_ps(tmp1);
+                    two_phase_acc_reg = _mm_div_ps(two_phase_acc_reg, tmp2);
+                }
+        }
+
+    for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+        {
+
+            a = cacc[n_vec];
+            _mm_store_si128((__m128i*)dotProductVector, a); // Store the results back into the dot product vector
+            dotProduct = lv_cmake(0,0);
+            for (i = 0; i < 4; ++i)
+                {
+                    dotProduct = lv_cmake(sat_adds16i(lv_creal(dotProduct), lv_creal(dotProductVector[i])),
+                            sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[i])));
+                }
+            _out[n_vec] = dotProduct;
+        }
+    volk_gnsssdr_free(cacc);
+
+    tmp1 = _mm_mul_ps(two_phase_acc_reg, two_phase_acc_reg);
+    tmp2 = _mm_hadd_ps(tmp1, tmp1);
+    tmp1 = _mm_shuffle_ps(tmp2, tmp2, 0xD8);
+    tmp2 = _mm_sqrt_ps(tmp1);
+    two_phase_acc_reg = _mm_div_ps(two_phase_acc_reg, tmp2);
+
+    _mm_store_ps((float*)two_phase_acc, two_phase_acc_reg);
+    //(*phase) = lv_cmake((float*)two_phase_acc[0], (float*)two_phase_acc[1]);
+    (*phase) = two_phase_acc[0];
+
+    for(n = sse_iters * 4; n < num_points; n++)
+        {
+            tmp16 = in_common[n];  //printf("a_sse phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase));
+            tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase);
+            tmp16 = lv_cmake((int16_t)rintf(lv_creal(tmp32)), (int16_t)rintf(lv_cimag(tmp32)));
+            (*phase) *= phase_inc;
+
+            for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+                {
+                    lv_16sc_t tmp = tmp16 * in_a[n_vec][n];
+                    //lv_16sc_t tmp = lv_cmake(sat_adds16i(sat_muls16i(lv_creal(tmp16), lv_creal(in_a[n_vec][n])), - sat_muls16i(lv_cimag(tmp16), lv_cimag(in_a[n_vec][n]))) , sat_adds16i(sat_muls16i(lv_creal(tmp16), lv_cimag(in_a[n_vec][n])), sat_muls16i(lv_cimag(tmp16), lv_creal(in_a[n_vec][n]))));
+                    _out[n_vec] = lv_cmake(sat_adds16i(lv_creal(_out[n_vec]), lv_creal(tmp)),
+                            sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp)));
+                }
+        }
+}
+#endif /* LV_HAVE_SSE3 */
+
+
+//#ifdef LV_HAVE_SSE3
+//#include <pmmintrin.h>
+
+//static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_sse3_reload(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)
+//{
+    //lv_16sc_t dotProduct = lv_cmake(0,0);
+
+    //const unsigned int sse_iters = num_points / 4;
+    //const unsigned int ROTATOR_RELOAD = 128;
+    //int n_vec;
+    //int i;
+    //unsigned int number;
+    //unsigned int j;
+    //unsigned int n;
+
+    //const int16_t** _in_a = in_a;
+    //const lv_16sc_t* _in_common = in_common;
+    //lv_16sc_t* _out = result;
+
+    //__VOLK_ATTR_ALIGNED(16) lv_16sc_t dotProductVector[4];
+
+    //__m128i* realcacc = (__m128i*)volk_gnsssdr_malloc(num_a_vectors * sizeof(__m128i), volk_gnsssdr_get_alignment());
+    //__m128i* imagcacc = (__m128i*)volk_gnsssdr_malloc(num_a_vectors * sizeof(__m128i), volk_gnsssdr_get_alignment());
+
+    //for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+        //{
+            //realcacc[n_vec] = _mm_setzero_si128();
+            //imagcacc[n_vec] = _mm_setzero_si128();
+        //}
+
+    //__m128i a, b, c, c_sr, mask_imag, mask_real, real, imag, imag1, imag2, b_sl, a_sl;
+
+    //mask_imag = _mm_set_epi8(255, 255, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0);
+    //mask_real = _mm_set_epi8(0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255);
+
+    //// phase rotation registers
+    //__m128 pa, pb, two_phase_acc_reg, two_phase_inc_reg;
+    //__m128i pc1, pc2;
+    //__VOLK_ATTR_ALIGNED(16) lv_32fc_t two_phase_inc[2];
+    //two_phase_inc[0] = phase_inc * phase_inc;
+    //two_phase_inc[1] = phase_inc * phase_inc;
+    //two_phase_inc_reg = _mm_load_ps((float*) two_phase_inc);
+    //__VOLK_ATTR_ALIGNED(16) lv_32fc_t two_phase_acc[2];
+    //two_phase_acc[0] = (*phase);
+    //two_phase_acc[1] = (*phase) * phase_inc;
+    //two_phase_acc_reg = _mm_load_ps((float*)two_phase_acc);
+    //__m128 yl, yh, tmp1, tmp2, tmp3;
+    //lv_16sc_t tmp16;
+    //lv_32fc_t tmp32;
+
+    //for (number = 0; number <  sse_iters / ROTATOR_RELOAD; ++number)
+        //{
+            //for (j = 0; j < ROTATOR_RELOAD; j++)
+                //{
+                    //// Phase rotation on operand in_common starts here:
+                    ////printf("generic phase %i: %f,%f\n", n*4,lv_creal(*phase),lv_cimag(*phase));
+                    //pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg
+                    ////complex 32fc multiplication b=a*two_phase_acc_reg
+                    //yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr
+                    //yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di
+                    //tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr
+                    //pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br
+                    //tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di
+                    //pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di
+                    //pc1 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic
+
+                    ////complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg
+                    //yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr
+                    //yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di
+                    //tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr
+                    //tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br
+                    //tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di
+                    //two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di
+
+                    ////next two samples
+                    //_in_common += 2;
+                    //pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg
+                    //__VOLK_GNSSSDR_PREFETCH(_in_common + 8);
+                    ////complex 32fc multiplication b=a*two_phase_acc_reg
+                    //yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr
+                    //yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di
+                    //tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr
+                    //pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br
+                    //tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di
+                    //pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di
+                    //pc2 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic
+
+                    ////complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg
+                    //yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr
+                    //yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di
+                    //tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr
+                    //tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br
+                    //tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di
+                    //two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di
+
+                    //// store four rotated in_common samples in the register b
+                    //b = _mm_packs_epi32(pc1, pc2);// convert from 32ic to 16ic
+
+                    ////next two samples
+                    //_in_common += 2;
+
+                    //for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+                        //{
+                            //a = _mm_load_si128((__m128i*)&(_in_a[n_vec][(number * ROTATOR_RELOAD + j) * 4])); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg
+
+                            //c = _mm_mullo_epi16(a, b); // a3.i*b3.i, a3.r*b3.r, ....
+
+                            //c_sr = _mm_srli_si128(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst.
+                            //real = _mm_subs_epi16(c, c_sr);
+
+                            //b_sl = _mm_slli_si128(b, 2); // b3.r, b2.i ....
+                            //a_sl = _mm_slli_si128(a, 2); // a3.r, a2.i ....
+
+                            //imag1 = _mm_mullo_epi16(a, b_sl); // a3.i*b3.r, ....
+                            //imag2 = _mm_mullo_epi16(b, a_sl); // b3.i*a3.r, ....
+
+                            //imag = _mm_adds_epi16(imag1, imag2);
+
+                            //realcacc[n_vec] = _mm_adds_epi16(realcacc[n_vec], real);
+                            //imagcacc[n_vec] = _mm_adds_epi16(imagcacc[n_vec], imag);
+                        //}
+                //}
+            //// regenerate phase
+            //tmp1 = _mm_mul_ps(two_phase_acc_reg, two_phase_acc_reg);
+            //tmp2 = _mm_hadd_ps(tmp1, tmp1);
+            //tmp1 = _mm_shuffle_ps(tmp2, tmp2, 0xD8);
+            //tmp2 = _mm_sqrt_ps(tmp1);
+            //two_phase_acc_reg = _mm_div_ps(two_phase_acc_reg, tmp2);
+        //}
+
+    //for (j = 0; j < sse_iters % ROTATOR_RELOAD; j++)
+        //{
+            //pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg
+            ////complex 32fc multiplication b=a*two_phase_acc_reg
+            //yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr
+            //yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di
+            //tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr
+            //pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br
+            //tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di
+            //pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di
+            //pc1 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic
+
+            ////complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg
+            //yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr
+            //yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di
+            //tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr
+            //tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br
+            //tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di
+            //two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di
+
+            ////next two samples
+            //_in_common += 2;
+            //pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg
+            //__VOLK_GNSSSDR_PREFETCH(_in_common + 8);
+            ////complex 32fc multiplication b=a*two_phase_acc_reg
+            //yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr
+            //yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di
+            //tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr
+            //pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br
+            //tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di
+            //pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di
+            //pc2 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic
+
+            ////complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg
+            //yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr
+            //yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di
+            //tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr
+            //tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br
+            //tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di
+            //two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di
+
+            //// store four rotated in_common samples in the register b
+            //b = _mm_packs_epi32(pc1, pc2);// convert from 32ic to 16ic
+
+            ////next two samples
+            //_in_common += 2;
+
+            //for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+                //{
+                    //a = _mm_load_si128((__m128i*)&(_in_a[n_vec][((sse_iters / ROTATOR_RELOAD)  * ROTATOR_RELOAD + j) * 4])); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg
+
+                    //c = _mm_mullo_epi16(a, b); // a3.i*b3.i, a3.r*b3.r, ....
+
+                    //c_sr = _mm_srli_si128(c, 2); // Shift a right by imm8 bytes while shifting in zeros, and store the results in dst.
+                    //real = _mm_subs_epi16(c, c_sr);
+
+                    //b_sl = _mm_slli_si128(b, 2); // b3.r, b2.i ....
+                    //a_sl = _mm_slli_si128(a, 2); // a3.r, a2.i ....
+
+                    //imag1 = _mm_mullo_epi16(a, b_sl); // a3.i*b3.r, ....
+                    //imag2 = _mm_mullo_epi16(b, a_sl); // b3.i*a3.r, ....
+
+                    //imag = _mm_adds_epi16(imag1, imag2);
+
+                    //realcacc[n_vec] = _mm_adds_epi16(realcacc[n_vec], real);
+                    //imagcacc[n_vec] = _mm_adds_epi16(imagcacc[n_vec], imag);
+                //}
+        //}
+
+    //for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+        //{
+            //realcacc[n_vec] = _mm_and_si128(realcacc[n_vec], mask_real);
+            //imagcacc[n_vec] = _mm_and_si128(imagcacc[n_vec], mask_imag);
+
+            //a = _mm_or_si128(realcacc[n_vec], imagcacc[n_vec]);
+
+            //_mm_store_si128((__m128i*)dotProductVector, a); // Store the results back into the dot product vector
+            //dotProduct = lv_cmake(0,0);
+            //for (i = 0; i < 4; ++i)
+                //{
+                    //dotProduct = lv_cmake(sat_adds16i(lv_creal(dotProduct), lv_creal(dotProductVector[i])),
+                            //sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[i])));
+                //}
+            //_out[n_vec] = dotProduct;
+        //}
+
+    //volk_gnsssdr_free(realcacc);
+    //volk_gnsssdr_free(imagcacc);
+
+    //tmp1 = _mm_mul_ps(two_phase_acc_reg, two_phase_acc_reg);
+    //tmp2 = _mm_hadd_ps(tmp1, tmp1);
+    //tmp1 = _mm_shuffle_ps(tmp2, tmp2, 0xD8);
+    //tmp2 = _mm_sqrt_ps(tmp1);
+    //two_phase_acc_reg = _mm_div_ps(two_phase_acc_reg, tmp2);
+
+    //_mm_store_ps((float*)two_phase_acc, two_phase_acc_reg);
+    ////(*phase) = lv_cmake((float*)two_phase_acc[0], (float*)two_phase_acc[1]);
+    //(*phase) = two_phase_acc[0];
+
+    //for(n = sse_iters * 4; n < num_points; n++)
+        //{
+            //tmp16 = in_common[n];  //printf("a_sse phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase));
+            //tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase);
+            //tmp16 = lv_cmake((int16_t)rintf(lv_creal(tmp32)), (int16_t)rintf(lv_cimag(tmp32)));
+            //(*phase) *= phase_inc;
+
+            //for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+                //{
+                    //lv_16sc_t tmp = tmp16 * in_a[n_vec][n];
+                    ////lv_16sc_t tmp = lv_cmake(sat_adds16i(sat_muls16i(lv_creal(tmp16), lv_creal(in_a[n_vec][n])), - sat_muls16i(lv_cimag(tmp16), lv_cimag(in_a[n_vec][n]))) , sat_adds16i(sat_muls16i(lv_creal(tmp16), lv_cimag(in_a[n_vec][n])), sat_muls16i(lv_cimag(tmp16), lv_creal(in_a[n_vec][n]))));
+                    //_out[n_vec] = lv_cmake(sat_adds16i(lv_creal(_out[n_vec]), lv_creal(tmp)),
+                            //sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp)));
+                //}
+        //}
+
+//}
+//#endif [> LV_HAVE_SSE3 <]
+
+
+#ifdef LV_HAVE_SSE3
+#include <pmmintrin.h>
+
+static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_sse3(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)
+{
+    lv_16sc_t dotProduct = lv_cmake(0,0);
+
+    const unsigned int sse_iters = num_points / 4;
+    int n_vec;
+    int i;
+    unsigned int number;
+    unsigned int n;
+    const int16_t** _in_a = in_a;
+    const lv_16sc_t* _in_common = in_common;
+    lv_16sc_t* _out = result;
+
+    __VOLK_ATTR_ALIGNED(16) lv_16sc_t dotProductVector[4];
+
+    __m128i* cacc = (__m128i*)volk_gnsssdr_malloc(num_a_vectors * sizeof(__m128i), volk_gnsssdr_get_alignment());
+
+    for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+        {
+            cacc[n_vec] = _mm_setzero_si128();
+        }
+
+    __m128i a, b, c;
+
+    // phase rotation registers
+    __m128 pa, pb, two_phase_acc_reg, two_phase_inc_reg;
+    __m128i pc1, pc2;
+    __VOLK_ATTR_ALIGNED(16) lv_32fc_t two_phase_inc[2];
+    two_phase_inc[0] = phase_inc * phase_inc;
+    two_phase_inc[1] = phase_inc * phase_inc;
+    two_phase_inc_reg = _mm_load_ps((float*) two_phase_inc);
+    __VOLK_ATTR_ALIGNED(16) lv_32fc_t two_phase_acc[2];
+    two_phase_acc[0] = (*phase);
+    two_phase_acc[1] = (*phase) * phase_inc;
+    two_phase_acc_reg = _mm_load_ps((float*)two_phase_acc);
+    __m128 yl, yh, tmp1, tmp2, tmp3;
+    lv_16sc_t tmp16;
+    lv_32fc_t tmp32;
+
+    for(number = 0; number < sse_iters; number++)
+        {
+            // Phase rotation on operand in_common starts here:
+            //printf("generic phase %i: %f,%f\n", n*4,lv_creal(*phase),lv_cimag(*phase));
+            pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg
+            //complex 32fc multiplication b=a*two_phase_acc_reg
+            yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr
+            yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di
+            tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr
+            pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br
+            tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di
+            pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di
+            pc1 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic
+
+            //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg
+            yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr
+            yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di
+            tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr
+            tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br
+            tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di
+            two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di
+
+            //next two samples
+            _in_common += 2;
+            pa = _mm_set_ps((float)(lv_cimag(_in_common[1])), (float)(lv_creal(_in_common[1])), (float)(lv_cimag(_in_common[0])), (float)(lv_creal(_in_common[0]))); // //load (2 byte imag, 2 byte real) x 2 into 128 bits reg
+            __VOLK_GNSSSDR_PREFETCH(_in_common + 8);
+            //complex 32fc multiplication b=a*two_phase_acc_reg
+            yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr
+            yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di
+            tmp1 = _mm_mul_ps(pa, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr
+            pa = _mm_shuffle_ps(pa, pa, 0xB1); // Re-arrange x to be ai,ar,bi,br
+            tmp2 = _mm_mul_ps(pa, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di
+            pb = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di
+            pc2 = _mm_cvtps_epi32(pb); // convert from 32fc to 32ic
+
+            //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg
+            yl = _mm_moveldup_ps(two_phase_acc_reg); // Load yl with cr,cr,dr,dr
+            yh = _mm_movehdup_ps(two_phase_acc_reg); // Load yh with ci,ci,di,di
+            tmp1 = _mm_mul_ps(two_phase_inc_reg, yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr
+            tmp3 = _mm_shuffle_ps(two_phase_inc_reg, two_phase_inc_reg, 0xB1); // Re-arrange x to be ai,ar,bi,br
+            tmp2 = _mm_mul_ps(tmp3, yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di
+            two_phase_acc_reg = _mm_addsub_ps(tmp1, tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di
+
+            // store four rotated in_common samples in the register b
+            b = _mm_packs_epi32(pc1, pc2);// convert from 32ic to 16ic
+
+            //next two samples
+            _in_common += 2;
+
+            for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+                {
+                    a = _mm_loadl_epi64((__m128i*)&(_in_a[n_vec][number*4])); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg
+
+                    a = _mm_unpacklo_epi16( a, a );
+
+                    c = _mm_mullo_epi16(a, b); // a3.i*b3.i, a3.r*b3.r, ....
+
+                    cacc[n_vec] = _mm_adds_epi16(cacc[n_vec], c);
+                }
+            // Regenerate phase
+            if ((number % 128) == 0)
+                {
+                    tmp1 = _mm_mul_ps(two_phase_acc_reg, two_phase_acc_reg);
+                    tmp2 = _mm_hadd_ps(tmp1, tmp1);
+                    tmp1 = _mm_shuffle_ps(tmp2, tmp2, 0xD8);
+                    tmp2 = _mm_sqrt_ps(tmp1);
+                    two_phase_acc_reg = _mm_div_ps(two_phase_acc_reg, tmp2);
+                }
+        }
+
+    for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+        {
+
+            a = cacc[n_vec];
+            _mm_store_si128((__m128i*)dotProductVector, a); // Store the results back into the dot product vector
+            dotProduct = lv_cmake(0,0);
+            for (i = 0; i < 4; ++i)
+                {
+                    dotProduct = lv_cmake(sat_adds16i(lv_creal(dotProduct), lv_creal(dotProductVector[i])),
+                            sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[i])));
+                }
+            _out[n_vec] = dotProduct;
+        }
+    volk_gnsssdr_free(cacc);
+
+    tmp1 = _mm_mul_ps(two_phase_acc_reg, two_phase_acc_reg);
+    tmp2 = _mm_hadd_ps(tmp1, tmp1);
+    tmp1 = _mm_shuffle_ps(tmp2, tmp2, 0xD8);
+    tmp2 = _mm_sqrt_ps(tmp1);
+    two_phase_acc_reg = _mm_div_ps(two_phase_acc_reg, tmp2);
+
+    _mm_store_ps((float*)two_phase_acc, two_phase_acc_reg);
+    //(*phase) = lv_cmake((float*)two_phase_acc[0], (float*)two_phase_acc[1]);
+    (*phase) = two_phase_acc[0];
+
+    for(n = sse_iters * 4; n < num_points; n++)
+        {
+            tmp16 = in_common[n];  //printf("a_sse phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase));
+            tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase);
+            tmp16 = lv_cmake((int16_t)rintf(lv_creal(tmp32)), (int16_t)rintf(lv_cimag(tmp32)));
+            (*phase) *= phase_inc;
+
+            for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+                {
+                    lv_16sc_t tmp = tmp16 * in_a[n_vec][n];
+                    //lv_16sc_t tmp = lv_cmake(sat_adds16i(sat_muls16i(lv_creal(tmp16), lv_creal(in_a[n_vec][n])), - sat_muls16i(lv_cimag(tmp16), lv_cimag(in_a[n_vec][n]))) , sat_adds16i(sat_muls16i(lv_creal(tmp16), lv_cimag(in_a[n_vec][n])), sat_muls16i(lv_cimag(tmp16), lv_creal(in_a[n_vec][n]))));
+                    _out[n_vec] = lv_cmake(sat_adds16i(lv_creal(_out[n_vec]), lv_creal(tmp)),
+                            sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp)));
+                }
+        }
+}
+#endif /* LV_HAVE_SSE3 */
+
+
+#ifdef LV_HAVE_AVX2
+#include <immintrin.h>
+#include <volk_gnsssdr/volk_gnsssdr_sse3_intrinsics.h>
+#include <volk_gnsssdr/volk_gnsssdr_avx_intrinsics.h>
+
+static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_avx2(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)
+{
+    const unsigned int avx2_iters = num_points / 8;
+    const int16_t** _in_a = in_a;
+    const lv_16sc_t* _in_common = in_common;
+    lv_16sc_t* _out = result;
+    int n_vec;
+    unsigned int number;
+    unsigned int n;
+
+    lv_16sc_t tmp16;
+    lv_32fc_t tmp32;
+
+    __VOLK_ATTR_ALIGNED(32) lv_16sc_t dotProductVector[8];
+    lv_16sc_t dotProduct = lv_cmake(0,0);
+
+    __m256i* cacc = (__m256i*)volk_gnsssdr_malloc(num_a_vectors * sizeof(__m256i), volk_gnsssdr_get_alignment());
+
+    for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+        {
+            cacc[n_vec] = _mm256_setzero_si256();
+        }
+
+    __m128i a128, ain_128, ain_128_lo, ain_128_hi;
+    __m256i ai;
+    __m256 a, b;
+
+    __m256 four_phase_acc_reg, four_phase_inc_reg;
+
+    lv_32fc_t _phase_inc = phase_inc*phase_inc*phase_inc*phase_inc;
+
+    // Normalise the 4*phase increment
+#ifdef __cplusplus
+    _phase_inc /= std::abs(_phase_inc);
+#else
+    _phase_inc /= hypotf(lv_creal(_phase_inc), lv_cimag(_phase_inc));
+#endif
+
+    __VOLK_ATTR_ALIGNED(32) lv_32fc_t four_phase_inc[4];
+    __VOLK_ATTR_ALIGNED(32) lv_32fc_t four_phase_acc[4];
+    for( n = 0; n < 4; ++n )
+    {
+        four_phase_inc[n] = _phase_inc;
+        four_phase_acc[n] = *phase;
+        *phase *= phase_inc;
+    }
+    four_phase_acc_reg = _mm256_load_ps((float*) four_phase_acc);
+    four_phase_inc_reg = _mm256_load_ps((float*) four_phase_inc);
+
+    __m256i a2, b2, c, c1, c2, perm_idx;
+
+    perm_idx = _mm256_set_epi32( 7, 6, 3, 2, 5, 4, 1, 0);
+    //perm_idx = _mm256_set_epi32( 0, 1, 4, 5, 2, 3, 6, 7);
+
+    for(number = 0; number < avx2_iters; number++)
+        {
+            a128 = _mm_load_si128( (__m128i *)_in_common );
+            ai = _mm256_cvtepi16_epi32( a128 );
+            a = _mm256_cvtepi32_ps( ai );
+
+            //complex 32fc multiplication b=a*two_phase_acc_reg
+            b = _mm256_complexmul_ps( a, four_phase_acc_reg );
+            c1 = _mm256_cvtps_epi32(b); // convert from 32fc to 32ic
+
+            //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg
+            four_phase_acc_reg = _mm256_complexmul_ps( four_phase_inc_reg, four_phase_acc_reg );
+
+            //next four samples
+            _in_common += 4;
+            a128 = _mm_load_si128( (__m128i *)_in_common );
+            ai = _mm256_cvtepi16_epi32( a128 );
+            a = _mm256_cvtepi32_ps( ai );
+
+            //complex 32fc multiplication b=a*two_phase_acc_reg
+            b = _mm256_complexmul_ps( a, four_phase_acc_reg );
+            c2 = _mm256_cvtps_epi32(b); // convert from 32fc to 32ic
+
+            //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg
+            four_phase_acc_reg = _mm256_complexmul_ps( four_phase_inc_reg, four_phase_acc_reg );
+
+            __VOLK_GNSSSDR_PREFETCH(_in_common + 16);
+
+
+            // Store and convert 32ic to 16ic:
+            b2 = _mm256_packs_epi32( c1, c2 );
+
+            b2 = _mm256_permutevar8x32_epi32( b2, perm_idx );
+
+
+            _in_common += 4;
+            for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+                {
+                    ain_128 = _mm_load_si128((__m128i*)&(_in_a[n_vec][number * 8]));
+
+                    ain_128_lo = _mm_unpacklo_epi16( ain_128, ain_128 );
+                    ain_128_hi = _mm_unpackhi_epi16( ain_128, ain_128 );
+
+                    a2 = _mm256_insertf128_si256( _mm256_castsi128_si256(ain_128_lo), ain_128_hi, 1);
+
+                    c = _mm256_mullo_epi16(a2, b2);
+
+                    cacc[n_vec] = _mm256_adds_epi16(cacc[n_vec], c);
+                }
+            // Regenerate phase
+            if ((number % 128) == 0)
+                {
+                    four_phase_acc_reg = _mm256_complexnormalise_ps(four_phase_acc_reg);
+                }
+        }
+
+    for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+        {
+            a2 = cacc[n_vec];
+
+            _mm256_store_si256((__m256i*)dotProductVector, a2); // Store the results back into the dot product vector
+            dotProduct = lv_cmake(0,0);
+            for (number = 0; number < 8; ++number)
+                {
+                    dotProduct = lv_cmake(sat_adds16i(lv_creal(dotProduct), lv_creal(dotProductVector[number])),
+                            sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[number])));
+                }
+            _out[n_vec] = dotProduct;
+        }
+
+    volk_gnsssdr_free(cacc);
+    _mm256_zeroupper();
+
+    _mm256_store_ps((float*)four_phase_acc, four_phase_acc_reg);
+    (*phase) = four_phase_acc[0];
+
+    for(n = avx2_iters * 8; n < num_points; n++)
+        {
+            tmp16 = in_common[n];
+            tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase);
+            tmp16 = lv_cmake((int16_t)rintf(lv_creal(tmp32)), (int16_t)rintf(lv_cimag(tmp32)));
+            (*phase) *= phase_inc;
+            for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+                {
+                    lv_16sc_t tmp = tmp16 * in_a[n_vec][n];
+                    _out[n_vec] = lv_cmake(sat_adds16i(lv_creal(_out[n_vec]), lv_creal(tmp)),
+                            sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp)));
+                }
+        }
+
+}
+#endif /* LV_HAVE_AVX2 */
+
+#ifdef LV_HAVE_AVX2
+#include <immintrin.h>
+#include <volk_gnsssdr/volk_gnsssdr_sse3_intrinsics.h>
+#include <volk_gnsssdr/volk_gnsssdr_avx_intrinsics.h>
+
+static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_avx2(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)
+{
+    const unsigned int avx2_iters = num_points / 8;
+    const int16_t** _in_a = in_a;
+    const lv_16sc_t* _in_common = in_common;
+    lv_16sc_t* _out = result;
+    int n_vec;
+    unsigned int number;
+    unsigned int n;
+
+    lv_16sc_t tmp16;
+    lv_32fc_t tmp32;
+
+    __VOLK_ATTR_ALIGNED(32) lv_16sc_t dotProductVector[8];
+    lv_16sc_t dotProduct = lv_cmake(0,0);
+
+    __m256i* cacc = (__m256i*)volk_gnsssdr_malloc(num_a_vectors * sizeof(__m256i), volk_gnsssdr_get_alignment());
+
+    for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+        {
+            cacc[n_vec] = _mm256_setzero_si256();
+        }
+
+    __m128i a128, ain_128, ain_128_lo, ain_128_hi;
+    __m256i ai;
+    __m256 a, b;
+
+    __m256 four_phase_acc_reg, four_phase_inc_reg;
+
+    lv_32fc_t _phase_inc = phase_inc*phase_inc*phase_inc*phase_inc;
+
+    // Normalise the 4*phase increment
+#ifdef __cplusplus
+    _phase_inc /= std::abs(_phase_inc);
+#else
+    _phase_inc /= hypotf(lv_creal(_phase_inc), lv_cimag(_phase_inc));
+#endif
+
+    __VOLK_ATTR_ALIGNED(32) lv_32fc_t four_phase_inc[4];
+    __VOLK_ATTR_ALIGNED(32) lv_32fc_t four_phase_acc[4];
+    for( n = 0; n < 4; ++n )
+    {
+        four_phase_inc[n] = _phase_inc;
+        four_phase_acc[n] = *phase;
+        *phase *= phase_inc;
+    }
+    four_phase_acc_reg = _mm256_load_ps((float*) four_phase_acc);
+    four_phase_inc_reg = _mm256_load_ps((float*) four_phase_inc);
+
+    __m256i a2, b2, c, c1, c2, perm_idx;
+
+    perm_idx = _mm256_set_epi32( 7, 6, 3, 2, 5, 4, 1, 0);
+    //perm_idx = _mm256_set_epi32( 0, 1, 4, 5, 2, 3, 6, 7);
+
+    for(number = 0; number < avx2_iters; number++)
+        {
+            a128 = _mm_loadu_si128( (__m128i *)_in_common );
+            ai = _mm256_cvtepi16_epi32( a128 );
+            a = _mm256_cvtepi32_ps( ai );
+
+            //complex 32fc multiplication b=a*two_phase_acc_reg
+            b = _mm256_complexmul_ps( a, four_phase_acc_reg );
+            c1 = _mm256_cvtps_epi32(b); // convert from 32fc to 32ic
+
+            //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg
+            four_phase_acc_reg = _mm256_complexmul_ps( four_phase_inc_reg, four_phase_acc_reg );
+
+            //next four samples
+            _in_common += 4;
+            a128 = _mm_loadu_si128( (__m128i *)_in_common );
+            ai = _mm256_cvtepi16_epi32( a128 );
+            a = _mm256_cvtepi32_ps( ai );
+
+            //complex 32fc multiplication b=a*two_phase_acc_reg
+            b = _mm256_complexmul_ps( a, four_phase_acc_reg );
+            c2 = _mm256_cvtps_epi32(b); // convert from 32fc to 32ic
+
+            //complex 32fc multiplication two_phase_acc_reg=two_phase_acc_reg*two_phase_inc_reg
+            four_phase_acc_reg = _mm256_complexmul_ps( four_phase_inc_reg, four_phase_acc_reg );
+
+            __VOLK_GNSSSDR_PREFETCH(_in_common + 16);
+
+
+            // Store and convert 32ic to 16ic:
+            b2 = _mm256_packs_epi32( c1, c2 );
+
+            b2 = _mm256_permutevar8x32_epi32( b2, perm_idx );
+
+
+            _in_common += 4;
+            for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+                {
+                    ain_128 = _mm_loadu_si128((__m128i*)&(_in_a[n_vec][number * 8]));
+
+                    ain_128_lo = _mm_unpacklo_epi16( ain_128, ain_128 );
+                    ain_128_hi = _mm_unpackhi_epi16( ain_128, ain_128 );
+
+                    a2 = _mm256_insertf128_si256( _mm256_castsi128_si256(ain_128_lo), ain_128_hi, 1);
+
+                    c = _mm256_mullo_epi16(a2, b2);
+
+                    cacc[n_vec] = _mm256_adds_epi16(cacc[n_vec], c);
+                }
+            // Regenerate phase
+            if ((number % 128) == 0)
+                {
+                    four_phase_acc_reg = _mm256_complexnormalise_ps(four_phase_acc_reg);
+                }
+        }
+
+    for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+        {
+            a2 = cacc[n_vec];
+
+            _mm256_store_si256((__m256i*)dotProductVector, a2); // Store the results back into the dot product vector
+            dotProduct = lv_cmake(0,0);
+            for (number = 0; number < 8; ++number)
+                {
+                    dotProduct = lv_cmake(sat_adds16i(lv_creal(dotProduct), lv_creal(dotProductVector[number])),
+                            sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[number])));
+                }
+            _out[n_vec] = dotProduct;
+        }
+
+    volk_gnsssdr_free(cacc);
+    _mm256_zeroupper();
+
+    _mm256_store_ps((float*)four_phase_acc, four_phase_acc_reg);
+    (*phase) = four_phase_acc[0];
+
+    for(n = avx2_iters * 8; n < num_points; n++)
+        {
+            tmp16 = in_common[n];
+            tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase);
+            tmp16 = lv_cmake((int16_t)rintf(lv_creal(tmp32)), (int16_t)rintf(lv_cimag(tmp32)));
+            (*phase) *= phase_inc;
+            for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+                {
+                    lv_16sc_t tmp = tmp16 * in_a[n_vec][n];
+                    _out[n_vec] = lv_cmake(sat_adds16i(lv_creal(_out[n_vec]), lv_creal(tmp)),
+                            sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp)));
+                }
+        }
+
+}
+#endif /* LV_HAVE_AVX2 */
+
+//#ifdef LV_HAVE_NEON
+//#include <arm_neon.h>
+
+//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)
+//{
+    //const unsigned int neon_iters = num_points / 4;
+
+    //const int16_t** _in_a = in_a;
+    //const lv_16sc_t* _in_common = in_common;
+    //lv_16sc_t* _out = result;
+    //int n_vec;
+    //int i;
+    //unsigned int number;
+    //unsigned int n;
+    //lv_16sc_t tmp16_, tmp;
+    //lv_32fc_t tmp32_;
+
+    //if (neon_iters > 0)
+        //{
+            //lv_16sc_t dotProduct = lv_cmake(0,0);
+            //float arg_phase0 = cargf(*phase);
+            //float arg_phase_inc = cargf(phase_inc);
+            //float phase_est;
+
+            //lv_32fc_t ___phase4 = phase_inc * phase_inc * phase_inc * phase_inc;
+            //__VOLK_ATTR_ALIGNED(16) float32_t __phase4_real[4] = { lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4) };
+            //__VOLK_ATTR_ALIGNED(16) float32_t __phase4_imag[4] = { lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4) };
+
+            //float32x4_t _phase4_real = vld1q_f32(__phase4_real);
+            //float32x4_t _phase4_imag = vld1q_f32(__phase4_imag);
+
+            //lv_32fc_t phase2 = (lv_32fc_t)(*phase) * phase_inc;
+            //lv_32fc_t phase3 = phase2 * phase_inc;
+            //lv_32fc_t phase4 = phase3 * phase_inc;
+
+            //__VOLK_ATTR_ALIGNED(16) float32_t __phase_real[4] = { lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4) };
+            //__VOLK_ATTR_ALIGNED(16) float32_t __phase_imag[4] = { lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4) };
+
+            //float32x4_t _phase_real = vld1q_f32(__phase_real);
+            //float32x4_t _phase_imag = vld1q_f32(__phase_imag);
+
+            //int16x4x2_t a_val, b_val, c_val;
+            //__VOLK_ATTR_ALIGNED(16) lv_16sc_t dotProductVector[4];
+            //float32x4_t half = vdupq_n_f32(0.5f);
+            //int16x4x2_t tmp16;
+            //int32x4x2_t tmp32i;
+
+            //float32x4x2_t tmp32f, tmp32_real, tmp32_imag;
+            //float32x4_t sign, PlusHalf, Round;
+
+            //int16x4x2_t* accumulator = (int16x4x2_t*)volk_gnsssdr_malloc(num_a_vectors * sizeof(int16x4x2_t), volk_gnsssdr_get_alignment());
+
+            //for(n_vec = 0; n_vec < num_a_vectors; n_vec++)
+                //{
+                    //accumulator[n_vec].val[0] = vdup_n_s16(0);
+                    //accumulator[n_vec].val[1] = vdup_n_s16(0);
+                //}
+
+            //for(number = 0; number < neon_iters; number++)
+                //{
+                    //[> load 4 complex numbers (int 16 bits each component) <]
+                    //tmp16 = vld2_s16((int16_t*)_in_common);
+                    //__VOLK_GNSSSDR_PREFETCH(_in_common + 8);
+                    //_in_common += 4;
+
+                    //[> promote them to int 32 bits <]
+                    //tmp32i.val[0] = vmovl_s16(tmp16.val[0]);
+                    //tmp32i.val[1] = vmovl_s16(tmp16.val[1]);
+
+                    //[> promote them to float 32 bits <]
+                    //tmp32f.val[0] = vcvtq_f32_s32(tmp32i.val[0]);
+                    //tmp32f.val[1] = vcvtq_f32_s32(tmp32i.val[1]);
+
+                    //[> complex multiplication of four complex samples (float 32 bits each component) <]
+                    //tmp32_real.val[0] = vmulq_f32(tmp32f.val[0], _phase_real);
+                    //tmp32_real.val[1] = vmulq_f32(tmp32f.val[1], _phase_imag);
+                    //tmp32_imag.val[0] = vmulq_f32(tmp32f.val[0], _phase_imag);
+                    //tmp32_imag.val[1] = vmulq_f32(tmp32f.val[1], _phase_real);
+
+                    //tmp32f.val[0] = vsubq_f32(tmp32_real.val[0], tmp32_real.val[1]);
+                    //tmp32f.val[1] = vaddq_f32(tmp32_imag.val[0], tmp32_imag.val[1]);
+
+                    //[> downcast results to int32 <]
+                    //[> in __aarch64__ we can do that with vcvtaq_s32_f32(ret1); vcvtaq_s32_f32(ret2); <]
+                    //sign = vcvtq_f32_u32((vshrq_n_u32(vreinterpretq_u32_f32(tmp32f.val[0]), 31)));
+                    //PlusHalf = vaddq_f32(tmp32f.val[0], half);
+                    //Round = vsubq_f32(PlusHalf, sign);
+                    //tmp32i.val[0] = vcvtq_s32_f32(Round);
+
+                    //sign = vcvtq_f32_u32((vshrq_n_u32(vreinterpretq_u32_f32(tmp32f.val[1]), 31)));
+                    //PlusHalf = vaddq_f32(tmp32f.val[1], half);
+                    //Round = vsubq_f32(PlusHalf, sign);
+                    //tmp32i.val[1] = vcvtq_s32_f32(Round);
+
+                    //[> downcast results to int16 <]
+                    //tmp16.val[0] = vqmovn_s32(tmp32i.val[0]);
+                    //tmp16.val[1] = vqmovn_s32(tmp32i.val[1]);
+
+                    //[> compute next four phases <]
+                    //tmp32_real.val[0] = vmulq_f32(_phase_real, _phase4_real);
+                    //tmp32_real.val[1] = vmulq_f32(_phase_imag, _phase4_imag);
+                    //tmp32_imag.val[0] = vmulq_f32(_phase_real, _phase4_imag);
+                    //tmp32_imag.val[1] = vmulq_f32(_phase_imag, _phase4_real);
+
+                    //_phase_real = vsubq_f32(tmp32_real.val[0], tmp32_real.val[1]);
+                    //_phase_imag = vaddq_f32(tmp32_imag.val[0], tmp32_imag.val[1]);
+
+                    //for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+                        //{
+                            //a_val = vld2_s16((int16_t*)&(_in_a[n_vec][number*4])); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg
+                            ////__VOLK_GNSSSDR_PREFETCH(&_in_a[n_vec][number*4] + 8);
+
+                            //// multiply the real*real and imag*imag to get real result
+                            //// a0r*b0r|a1r*b1r|a2r*b2r|a3r*b3r
+                            //b_val.val[0] = vmul_s16(a_val.val[0], tmp16.val[0]);
+                            //// a0i*b0i|a1i*b1i|a2i*b2i|a3i*b3i
+                            //b_val.val[1] = vmul_s16(a_val.val[1], tmp16.val[1]);
+                            //c_val.val[0] = vqsub_s16(b_val.val[0], b_val.val[1]);
+
+                            //// Multiply cross terms to get the imaginary result
+                            //// a0r*b0i|a1r*b1i|a2r*b2i|a3r*b3i
+                            //b_val.val[0] = vmul_s16(a_val.val[0], tmp16.val[1]);
+                            //// a0i*b0r|a1i*b1r|a2i*b2r|a3i*b3r
+                            //b_val.val[1] = vmul_s16(a_val.val[1], tmp16.val[0]);
+                            //c_val.val[1] = vqadd_s16(b_val.val[0], b_val.val[1]);
+
+                            //accumulator[n_vec].val[0] = vqadd_s16(accumulator[n_vec].val[0], c_val.val[0]);
+                            //accumulator[n_vec].val[1] = vqadd_s16(accumulator[n_vec].val[1], c_val.val[1]);
+                        //}
+                    //// Regenerate phase
+                    //if ((number % 256) == 0)
+                        //{
+                            //phase_est = arg_phase0 + (number + 1) * 4 * arg_phase_inc;
+
+                            //*phase = lv_cmake(cos(phase_est), sin(phase_est));
+                            //phase2 = (lv_32fc_t)(*phase) * phase_inc;
+                            //phase3 = phase2 * phase_inc;
+                            //phase4 = phase3 * phase_inc;
+
+                            //__VOLK_ATTR_ALIGNED(16) float32_t ____phase_real[4] = { lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4) };
+                            //__VOLK_ATTR_ALIGNED(16) float32_t ____phase_imag[4] = { lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4) };
+
+                            //_phase_real = vld1q_f32(____phase_real);
+                            //_phase_imag = vld1q_f32(____phase_imag);
+                        //}
+                //}
+
+            //for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+                //{
+                    //vst2_s16((int16_t*)dotProductVector, accumulator[n_vec]); // Store the results back into the dot product vector
+                    //dotProduct = lv_cmake(0,0);
+                    //for (i = 0; i < 4; ++i)
+                        //{
+                            //dotProduct = lv_cmake(sat_adds16i(lv_creal(dotProduct), lv_creal(dotProductVector[i])),
+                                    //sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[i])));
+                        //}
+                    //_out[n_vec] = dotProduct;
+                //}
+            //volk_gnsssdr_free(accumulator);
+            //vst1q_f32((float32_t*)__phase_real, _phase_real);
+            //vst1q_f32((float32_t*)__phase_imag, _phase_imag);
+
+            //(*phase) = lv_cmake((float32_t)__phase_real[0], (float32_t)__phase_imag[0]);
+        //}
+
+    //for (n = neon_iters * 4; n < num_points; n++)
+        //{
+            //tmp16_ = in_common[n];  //printf("neon phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase));
+            //tmp32_ = lv_cmake((float32_t)lv_creal(tmp16_), (float32_t)lv_cimag(tmp16_)) * (*phase);
+            //tmp16_ = lv_cmake((int16_t)rintf(lv_creal(tmp32_)), (int16_t)rintf(lv_cimag(tmp32_)));
+            //(*phase) *= phase_inc;
+            //for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+                //{
+                    //tmp = tmp16_ * in_a[n_vec][n];
+                    //_out[n_vec] = lv_cmake(sat_adds16i(lv_creal(_out[n_vec]), lv_creal(tmp)), sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp)));
+                //}
+        //}
+//}
+
+//#endif [> LV_HAVE_NEON <]
+
+
+//#ifdef LV_HAVE_NEON
+//#include <arm_neon.h>
+//#include <volk_gnsssdr/volk_gnsssdr_neon_intrinsics.h>
+
+//static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_neon_vma(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)
+//{
+    //const unsigned int neon_iters = num_points / 4;
+
+    //const int16_t** _in_a = in_a;
+    //const lv_16sc_t* _in_common = in_common;
+    //lv_16sc_t* _out = result;
+    //int n_vec;
+    //int i;
+    //unsigned int number;
+    //unsigned int n;
+    //lv_16sc_t tmp16_, tmp;
+    //lv_32fc_t tmp32_;
+
+    //if (neon_iters > 0)
+        //{
+            //lv_16sc_t dotProduct = lv_cmake(0,0);
+            //float arg_phase0 = cargf(*phase);
+            //float arg_phase_inc = cargf(phase_inc);
+            //float phase_est;
+            ////printf("arg phase0: %f", arg_phase0);
+            //lv_32fc_t ___phase4 = phase_inc * phase_inc * phase_inc * phase_inc;
+            //__VOLK_ATTR_ALIGNED(16) float32_t __phase4_real[4] = { lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4) };
+            //__VOLK_ATTR_ALIGNED(16) float32_t __phase4_imag[4] = { lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4) };
+
+            //float32x4_t _phase4_real = vld1q_f32(__phase4_real);
+            //float32x4_t _phase4_imag = vld1q_f32(__phase4_imag);
+
+            //lv_32fc_t phase2 = (lv_32fc_t)(*phase) * phase_inc;
+            //lv_32fc_t phase3 = phase2 * phase_inc;
+            //lv_32fc_t phase4 = phase3 * phase_inc;
+
+            //__VOLK_ATTR_ALIGNED(16) float32_t __phase_real[4] = { lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4) };
+            //__VOLK_ATTR_ALIGNED(16) float32_t __phase_imag[4] = { lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4) };
+
+            //float32x4_t _phase_real = vld1q_f32(__phase_real);
+            //float32x4_t _phase_imag = vld1q_f32(__phase_imag);
+
+            //int16x4x2_t a_val, b_val;
+            //__VOLK_ATTR_ALIGNED(16) lv_16sc_t dotProductVector[4];
+            //float32x4_t half = vdupq_n_f32(0.5f);
+            //int16x4x2_t tmp16;
+            //int32x4x2_t tmp32i;
+
+            //float32x4x2_t tmp32f, tmp32_real, tmp32_imag;
+            //float32x4_t sign, PlusHalf, Round;
+
+            //int16x4x2_t* accumulator = (int16x4x2_t*)volk_gnsssdr_malloc(num_a_vectors * sizeof(int16x4x2_t), volk_gnsssdr_get_alignment());
+
+            //for(n_vec = 0; n_vec < num_a_vectors; n_vec++)
+                //{
+                    //accumulator[n_vec].val[0] = vdup_n_s16(0);
+                    //accumulator[n_vec].val[1] = vdup_n_s16(0);
+                //}
+
+            //for(number = 0; number < neon_iters; number++)
+                //{
+                    //[> load 4 complex numbers (int 16 bits each component) <]
+                    //tmp16 = vld2_s16((int16_t*)_in_common);
+                    //__VOLK_GNSSSDR_PREFETCH(_in_common + 8);
+                    //_in_common += 4;
+
+                    //[> promote them to int 32 bits <]
+                    //tmp32i.val[0] = vmovl_s16(tmp16.val[0]);
+                    //tmp32i.val[1] = vmovl_s16(tmp16.val[1]);
+
+                    //[> promote them to float 32 bits <]
+                    //tmp32f.val[0] = vcvtq_f32_s32(tmp32i.val[0]);
+                    //tmp32f.val[1] = vcvtq_f32_s32(tmp32i.val[1]);
+
+                    //[> complex multiplication of four complex samples (float 32 bits each component) <]
+                    //tmp32_real.val[0] = vmulq_f32(tmp32f.val[0], _phase_real);
+                    //tmp32_real.val[1] = vmulq_f32(tmp32f.val[1], _phase_imag);
+                    //tmp32_imag.val[0] = vmulq_f32(tmp32f.val[0], _phase_imag);
+                    //tmp32_imag.val[1] = vmulq_f32(tmp32f.val[1], _phase_real);
+
+                    //tmp32f.val[0] = vsubq_f32(tmp32_real.val[0], tmp32_real.val[1]);
+                    //tmp32f.val[1] = vaddq_f32(tmp32_imag.val[0], tmp32_imag.val[1]);
+
+                    //[> downcast results to int32 <]
+                    //[> in __aarch64__ we can do that with vcvtaq_s32_f32(ret1); vcvtaq_s32_f32(ret2); <]
+                    //sign = vcvtq_f32_u32((vshrq_n_u32(vreinterpretq_u32_f32(tmp32f.val[0]), 31)));
+                    //PlusHalf = vaddq_f32(tmp32f.val[0], half);
+                    //Round = vsubq_f32(PlusHalf, sign);
+                    //tmp32i.val[0] = vcvtq_s32_f32(Round);
+
+                    //sign = vcvtq_f32_u32((vshrq_n_u32(vreinterpretq_u32_f32(tmp32f.val[1]), 31)));
+                    //PlusHalf = vaddq_f32(tmp32f.val[1], half);
+                    //Round = vsubq_f32(PlusHalf, sign);
+                    //tmp32i.val[1] = vcvtq_s32_f32(Round);
+
+                    //[> downcast results to int16 <]
+                    //tmp16.val[0] = vqmovn_s32(tmp32i.val[0]);
+                    //tmp16.val[1] = vqmovn_s32(tmp32i.val[1]);
+
+                    //[> compute next four phases <]
+                    //tmp32_real.val[0] = vmulq_f32(_phase_real, _phase4_real);
+                    //tmp32_real.val[1] = vmulq_f32(_phase_imag, _phase4_imag);
+                    //tmp32_imag.val[0] = vmulq_f32(_phase_real, _phase4_imag);
+                    //tmp32_imag.val[1] = vmulq_f32(_phase_imag, _phase4_real);
+
+                    //_phase_real = vsubq_f32(tmp32_real.val[0], tmp32_real.val[1]);
+                    //_phase_imag = vaddq_f32(tmp32_imag.val[0], tmp32_imag.val[1]);
+
+                    //// Regenerate phase
+                    //if ((number % 256) == 0)
+                        //{
+                            ////printf("computed phase: %f\n", cos(cargf(lv_cmake(_phase_real[0],_phase_imag[0]))));
+                            //phase_est = arg_phase0 + (number + 1) * 4 * arg_phase_inc;
+                            ////printf("Estimated phase: %f\n\n", cos(phase_est));
+
+                            //*phase = lv_cmake(cos(phase_est), sin(phase_est));
+                            //phase2 = (lv_32fc_t)(*phase) * phase_inc;
+                            //phase3 = phase2 * phase_inc;
+                            //phase4 = phase3 * phase_inc;
+
+                            //__VOLK_ATTR_ALIGNED(16) float32_t ____phase_real[4] = { lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4) };
+                            //__VOLK_ATTR_ALIGNED(16) float32_t ____phase_imag[4] = { lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4) };
+
+                            //_phase_real = vld1q_f32(____phase_real);
+                            //_phase_imag = vld1q_f32(____phase_imag);
+
+                            //// Round = vmulq_f32(_phase_real, _phase_real);
+                            //// Round = vmlaq_f32(Round, _phase_imag, _phase_imag);
+                            ////               Round = vsqrtq_f32(Round);//printf("sqrt: %f \n", Round[0]);
+                            ////Round = vrsqrteq_f32(Round);printf("1/sqtr: %f  \n",Round[0]);  
+                            ////Round = vrecpeq_f32((Round);
+                            ////              _phase_real = vdivq_f32(_phase_real, Round);
+                            ////              _phase_imag = vdivq_f32(_phase_imag, Round);
+                            ////_phase_real = vmulq_f32(_phase_real, Round);
+                            ////_phase_imag = vmulq_f32(_phase_imag, Round);
+                            ////printf("After  %i: %f,%f, %f\n\n", number, _phase_real[0], _phase_imag[0], sqrt(_phase_real[0]*_phase_real[0]+_phase_imag[0]*_phase_imag[0]));
+
+                        //}
+
+                    //for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+                        //{
+                            //a_val = vld2_s16((int16_t*)&(_in_a[n_vec][number*4]));
+
+                            //b_val.val[0] = vmul_s16(a_val.val[0], tmp16.val[0]);
+                            //b_val.val[1] = vmul_s16(a_val.val[1], tmp16.val[0]);
+
+                            //// use multiply accumulate/subtract to get result
+                            //b_val.val[0] = vmls_s16(b_val.val[0], a_val.val[1], tmp16.val[1]);
+                            //b_val.val[1] = vmla_s16(b_val.val[1], a_val.val[0], tmp16.val[1]);
+
+                            //accumulator[n_vec].val[0] = vqadd_s16(accumulator[n_vec].val[0], b_val.val[0]);
+                            //accumulator[n_vec].val[1] = vqadd_s16(accumulator[n_vec].val[1], b_val.val[1]);
+                        //}
+                //}
+
+            //for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+                //{
+                    //vst2_s16((int16_t*)dotProductVector, accumulator[n_vec]); // Store the results back into the dot product vector
+                    //dotProduct = lv_cmake(0,0);
+                    //for (i = 0; i < 4; ++i)
+                        //{
+                            //dotProduct = lv_cmake(sat_adds16i(lv_creal(dotProduct), lv_creal(dotProductVector[i])),
+                                    //sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[i])));
+                        //}
+                    //_out[n_vec] = dotProduct;
+                //}
+            //volk_gnsssdr_free(accumulator);
+
+            //vst1q_f32((float32_t*)__phase_real, _phase_real);
+            //vst1q_f32((float32_t*)__phase_imag, _phase_imag);
+
+            //(*phase) = lv_cmake((float32_t)__phase_real[0], (float32_t)__phase_imag[0]);
+        //}
+
+    //for (n = neon_iters * 4; n < num_points; n++)
+        //{
+            //tmp16_ = in_common[n];  //printf("neon phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase));
+            //tmp32_ = lv_cmake((float32_t)lv_creal(tmp16_), (float32_t)lv_cimag(tmp16_)) * (*phase);
+            //tmp16_ = lv_cmake((int16_t)rintf(lv_creal(tmp32_)), (int16_t)rintf(lv_cimag(tmp32_)));
+            //(*phase) *= phase_inc;
+            //for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+                //{
+                    //tmp = tmp16_ * in_a[n_vec][n];
+                    //_out[n_vec] = lv_cmake(sat_adds16i(lv_creal(_out[n_vec]), lv_creal(tmp)), sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp)));
+                //}
+        //}
+//}
+
+//#endif [> LV_HAVE_NEON <]
+
+
+//#ifdef LV_HAVE_NEON
+//#include <arm_neon.h>
+//#include <volk_gnsssdr/volk_gnsssdr_neon_intrinsics.h>
+
+//static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_neon_optvma(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)
+//{
+    //const unsigned int neon_iters = num_points / 4;
+
+    //const int16_t** _in_a = in_a;
+    //const lv_16sc_t* _in_common = in_common;
+    //lv_16sc_t* _out = result;
+    //int n_vec;
+    //int i;
+    //unsigned int number;
+    //unsigned int n;
+    //lv_16sc_t tmp16_, tmp;
+    //lv_32fc_t tmp32_;
+
+    //if (neon_iters > 0)
+        //{
+            //lv_16sc_t dotProduct = lv_cmake(0,0);
+            //float arg_phase0 = cargf(*phase);
+            //float arg_phase_inc = cargf(phase_inc);
+            //float phase_est;
+
+            //lv_32fc_t ___phase4 = phase_inc * phase_inc * phase_inc * phase_inc;
+            //__VOLK_ATTR_ALIGNED(16) float32_t __phase4_real[4] = { lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4) };
+            //__VOLK_ATTR_ALIGNED(16) float32_t __phase4_imag[4] = { lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4) };
+
+            //float32x4_t _phase4_real = vld1q_f32(__phase4_real);
+            //float32x4_t _phase4_imag = vld1q_f32(__phase4_imag);
+
+            //lv_32fc_t phase2 = (lv_32fc_t)(*phase) * phase_inc;
+            //lv_32fc_t phase3 = phase2 * phase_inc;
+            //lv_32fc_t phase4 = phase3 * phase_inc;
+
+            //__VOLK_ATTR_ALIGNED(16) float32_t __phase_real[4] = { lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4) };
+            //__VOLK_ATTR_ALIGNED(16) float32_t __phase_imag[4] = { lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4) };
+
+            //float32x4_t _phase_real = vld1q_f32(__phase_real);
+            //float32x4_t _phase_imag = vld1q_f32(__phase_imag);
+
+            //int16x4x2_t a_val, b_val;
+            //__VOLK_ATTR_ALIGNED(16) lv_16sc_t dotProductVector[4];
+            //float32x4_t half = vdupq_n_f32(0.5f);
+            //int32x4x2_t tmp32i;
+
+            //float32x4x2_t tmp32f, tmp32_real, tmp32_imag;
+            //float32x4_t sign, PlusHalf, Round;
+
+            //int16x4x2_t* accumulator1 = (int16x4x2_t*)volk_gnsssdr_malloc(num_a_vectors * sizeof(int16x4x2_t), volk_gnsssdr_get_alignment());
+            //int16x4x2_t* accumulator2 = (int16x4x2_t*)volk_gnsssdr_malloc(num_a_vectors * sizeof(int16x4x2_t), volk_gnsssdr_get_alignment());
+
+            //for(n_vec = 0; n_vec < num_a_vectors; n_vec++)
+                //{
+                    //accumulator1[n_vec].val[0] = vdup_n_s16(0);
+                    //accumulator1[n_vec].val[1] = vdup_n_s16(0);
+                    //accumulator2[n_vec].val[0] = vdup_n_s16(0);
+                    //accumulator2[n_vec].val[1] = vdup_n_s16(0);
+                //}
+
+            //for(number = 0; number < neon_iters; number++)
+                //{
+                    //[> load 4 complex numbers (int 16 bits each component) <]
+                    //b_val = vld2_s16((int16_t*)_in_common);
+                    //__VOLK_GNSSSDR_PREFETCH(_in_common + 8);
+                    //_in_common += 4;
+
+                    //[> promote them to int 32 bits <]
+                    //tmp32i.val[0] = vmovl_s16(b_val.val[0]);
+                    //tmp32i.val[1] = vmovl_s16(b_val.val[1]);
+
+                    //[> promote them to float 32 bits <]
+                    //tmp32f.val[0] = vcvtq_f32_s32(tmp32i.val[0]);
+                    //tmp32f.val[1] = vcvtq_f32_s32(tmp32i.val[1]);
+
+                    //[> complex multiplication of four complex samples (float 32 bits each component) <]
+                    //tmp32_real.val[0] = vmulq_f32(tmp32f.val[0], _phase_real);
+                    //tmp32_real.val[1] = vmulq_f32(tmp32f.val[1], _phase_imag);
+                    //tmp32_imag.val[0] = vmulq_f32(tmp32f.val[0], _phase_imag);
+                    //tmp32_imag.val[1] = vmulq_f32(tmp32f.val[1], _phase_real);
+
+                    //tmp32f.val[0] = vsubq_f32(tmp32_real.val[0], tmp32_real.val[1]);
+                    //tmp32f.val[1] = vaddq_f32(tmp32_imag.val[0], tmp32_imag.val[1]);
+
+                    //[> downcast results to int32 <]
+                    //[> in __aarch64__ we can do that with vcvtaq_s32_f32(ret1); vcvtaq_s32_f32(ret2); <]
+                    //sign = vcvtq_f32_u32((vshrq_n_u32(vreinterpretq_u32_f32(tmp32f.val[0]), 31)));
+                    //PlusHalf = vaddq_f32(tmp32f.val[0], half);
+                    //Round = vsubq_f32(PlusHalf, sign);
+                    //tmp32i.val[0] = vcvtq_s32_f32(Round);
+
+                    //sign = vcvtq_f32_u32((vshrq_n_u32(vreinterpretq_u32_f32(tmp32f.val[1]), 31)));
+                    //PlusHalf = vaddq_f32(tmp32f.val[1], half);
+                    //Round = vsubq_f32(PlusHalf, sign);
+                    //tmp32i.val[1] = vcvtq_s32_f32(Round);
+
+                    //[> downcast results to int16 <]
+                    //b_val.val[0] = vqmovn_s32(tmp32i.val[0]);
+                    //b_val.val[1] = vqmovn_s32(tmp32i.val[1]);
+
+                    //[> compute next four phases <]
+                    //tmp32_real.val[0] = vmulq_f32(_phase_real, _phase4_real);
+                    //tmp32_real.val[1] = vmulq_f32(_phase_imag, _phase4_imag);
+                    //tmp32_imag.val[0] = vmulq_f32(_phase_real, _phase4_imag);
+                    //tmp32_imag.val[1] = vmulq_f32(_phase_imag, _phase4_real);
+
+                    //_phase_real = vsubq_f32(tmp32_real.val[0], tmp32_real.val[1]);
+                    //_phase_imag = vaddq_f32(tmp32_imag.val[0], tmp32_imag.val[1]);
+
+                    //// Regenerate phase
+                    //if ((number % 256) == 0)
+                        //{
+                            ////printf("computed phase: %f\n", cos(cargf(lv_cmake(_phase_real[0],_phase_imag[0]))));
+                            //phase_est = arg_phase0 + (number + 1) * 4 * arg_phase_inc;
+                            ////printf("Estimated phase: %f\n\n", cos(phase_est));
+
+                            //*phase = lv_cmake(cos(phase_est), sin(phase_est));
+                            //phase2 = (lv_32fc_t)(*phase) * phase_inc;
+                            //phase3 = phase2 * phase_inc;
+                            //phase4 = phase3 * phase_inc;
+
+                            //__VOLK_ATTR_ALIGNED(16) float32_t ____phase_real[4] = { lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4) };
+                            //__VOLK_ATTR_ALIGNED(16) float32_t ____phase_imag[4] = { lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4) };
+
+                            //_phase_real = vld1q_f32(____phase_real);
+                            //_phase_imag = vld1q_f32(____phase_imag);
+                        //}
+
+                    //for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+                        //{
+                            //a_val = vld2_s16((int16_t*)&(_in_a[n_vec][number*4]));
+
+                            //// use 2 accumulators to remove inter-instruction data dependencies
+                            //accumulator1[n_vec].val[0] = vmla_s16(accumulator1[n_vec].val[0], a_val.val[0], b_val.val[0]);
+                            //accumulator1[n_vec].val[1] = vmla_s16(accumulator1[n_vec].val[1], a_val.val[0], b_val.val[1]);
+                            //accumulator2[n_vec].val[0] = vmls_s16(accumulator2[n_vec].val[0], a_val.val[1], b_val.val[1]);
+                            //accumulator2[n_vec].val[1] = vmla_s16(accumulator2[n_vec].val[1], a_val.val[1], b_val.val[0]);
+                        //}
+                //}
+            //for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+                //{
+                    //accumulator1[n_vec].val[0] = vqadd_s16(accumulator1[n_vec].val[0], accumulator2[n_vec].val[0]);
+                    //accumulator1[n_vec].val[1] = vqadd_s16(accumulator1[n_vec].val[1], accumulator2[n_vec].val[1]);
+                //}
+            //for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+                //{
+                    //vst2_s16((int16_t*)dotProductVector, accumulator1[n_vec]); // Store the results back into the dot product vector
+                    //dotProduct = lv_cmake(0,0);
+                    //for (i = 0; i < 4; ++i)
+                        //{
+                            //dotProduct = lv_cmake(sat_adds16i(lv_creal(dotProduct), lv_creal(dotProductVector[i])),
+                                    //sat_adds16i(lv_cimag(dotProduct), lv_cimag(dotProductVector[i])));
+                        //}
+                    //_out[n_vec] = dotProduct;
+                //}
+            //volk_gnsssdr_free(accumulator1);
+            //volk_gnsssdr_free(accumulator2);
+
+            //vst1q_f32((float32_t*)__phase_real, _phase_real);
+            //vst1q_f32((float32_t*)__phase_imag, _phase_imag);
+
+            //(*phase) = lv_cmake((float32_t)__phase_real[0], (float32_t)__phase_imag[0]);
+        //}
+
+    //for (n = neon_iters * 4; n < num_points; n++)
+        //{
+            //tmp16_ = in_common[n];  //printf("neon phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase));
+            //tmp32_ = lv_cmake((float32_t)lv_creal(tmp16_), (float32_t)lv_cimag(tmp16_)) * (*phase);
+            //tmp16_ = lv_cmake((int16_t)rintf(lv_creal(tmp32_)), (int16_t)rintf(lv_cimag(tmp32_)));
+            //(*phase) *= phase_inc;
+            //for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+                //{
+                    //tmp = tmp16_ * in_a[n_vec][n];
+                    //_out[n_vec] = lv_cmake(sat_adds16i(lv_creal(_out[n_vec]), lv_creal(tmp)), sat_adds16i(lv_cimag(_out[n_vec]), lv_cimag(tmp)));
+                //}
+        //}
+//}
+
+//#endif [> LV_HAVE_NEON <]
+
+#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
new file mode 100644
index 000000000..a666c0270
--- /dev/null
+++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic.h
@@ -0,0 +1,384 @@
+/*!
+ * \file volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic.h
+ * \brief Volk puppet for the multiple 16-bit complex dot product kernel.
+ * \authors <ul>
+ *          <li> Carles Fernandez Prades 2016 cfernandez at cttc dot cat
+ *          </ul>
+ *
+ * Volk puppet for integrating the resampler into volk's test system
+ *
+ * -------------------------------------------------------------------------
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ *
+ * -------------------------------------------------------------------------
+ */
+
+#ifndef INCLUDED_volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_H
+#define INCLUDED_volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_H
+
+#include "volk_gnsssdr/volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn.h"
+#include <volk_gnsssdr/volk_gnsssdr_malloc.h>
+#include <volk_gnsssdr/volk_gnsssdr.h>
+#include <string.h>
+
+#ifdef LV_HAVE_GENERIC
+static inline void volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_generic(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!
+    float rem_carrier_phase_in_rad = 0.345;
+    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));
+    unsigned int n;
+    int num_a_vectors = 3;
+    int16_t** in_a = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_a_vectors, volk_gnsssdr_get_alignment());
+    for(n = 0; n < num_a_vectors; n++)
+        {
+            in_a[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment());
+            memcpy((int16_t*)in_a[n], (int16_t*)in, sizeof(int16_t) * num_points);
+        }
+    volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_generic(result, local_code, phase_inc[0], phase,(const int16_t**) 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_GENERIC
+static inline void volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_generic_reload(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!
+    float rem_carrier_phase_in_rad = 0.345;
+    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));
+    unsigned int n;
+    int num_a_vectors = 3;
+    int16_t** in_a = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_a_vectors, volk_gnsssdr_get_alignment());
+    for(n = 0; n < num_a_vectors; n++)
+        {
+            in_a[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment());
+            memcpy((int16_t*)in_a[n], (int16_t*)in, sizeof(int16_t) * num_points);
+        }
+    volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_generic_reload(result, local_code, phase_inc[0], phase,(const int16_t**) 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_SSE3
+static inline void volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_a_sse3(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!
+    float rem_carrier_phase_in_rad = 0.345;
+    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));
+    unsigned int n;
+    int num_a_vectors = 3;
+    int16_t** in_a = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_a_vectors, volk_gnsssdr_get_alignment());
+    for(n = 0; n < num_a_vectors; n++)
+        {
+            in_a[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment());
+            memcpy((int16_t*)in_a[n], (int16_t*)in, sizeof(int16_t) * num_points);
+        }
+
+    volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_sse3(result, local_code, phase_inc[0], phase, (const int16_t**) 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 // SSE3
+
+
+//#ifdef LV_HAVE_SSE3
+//static inline void volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_a_sse3_reload(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!
+    //float rem_carrier_phase_in_rad = 0.345;
+    //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));
+    //unsigned int n;
+    //int num_a_vectors = 3;
+    //int16_t** in_a = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_a_vectors, volk_gnsssdr_get_alignment());
+    //for(n = 0; n < num_a_vectors; n++)
+        //{
+            //in_a[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment());
+            //memcpy((int16_t*)in_a[n], (int16_t*)in, sizeof(int16_t) * num_points);
+        //}
+
+    //volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_sse3_reload(result, local_code, phase_inc[0], phase, (const int16_t**) 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 // SSE3
+
+
+#ifdef LV_HAVE_SSE3
+static inline void volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_u_sse3(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!
+    float rem_carrier_phase_in_rad = 0.345;
+    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));
+    unsigned int n;
+    int num_a_vectors = 3;
+    int16_t** in_a = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_a_vectors, volk_gnsssdr_get_alignment());
+    for(n = 0; n < num_a_vectors; n++)
+        {
+            in_a[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment());
+            memcpy((int16_t*)in_a[n], (int16_t*)in, sizeof(int16_t) * num_points);
+        }
+
+    volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_sse3(result, local_code, phase_inc[0], phase, (const int16_t**) 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 // SSE3
+
+
+#ifdef LV_HAVE_AVX2
+static inline void volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_a_avx2(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!
+    float rem_carrier_phase_in_rad = 0.345;
+    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));
+    unsigned int n;
+    int num_a_vectors = 3;
+    int16_t** in_a = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_a_vectors, volk_gnsssdr_get_alignment());
+    for(n = 0; n < num_a_vectors; n++)
+        {
+            in_a[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment());
+            memcpy((int16_t*)in_a[n], (int16_t*)in, sizeof(int16_t) * num_points);
+        }
+
+    volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_avx2(result, local_code, phase_inc[0], phase, (const int16_t**) 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 // AVX2
+
+
+//#ifdef LV_HAVE_AVX2
+//static inline void volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_a_avx2_reload(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!
+    //float rem_carrier_phase_in_rad = 0.345;
+    //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));
+    //unsigned int n;
+    //int num_a_vectors = 3;
+    //int16_t** in_a = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_a_vectors, volk_gnsssdr_get_alignment());
+    //for(n = 0; n < num_a_vectors; n++)
+        //{
+            //in_a[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment());
+            //memcpy((int16_t*)in_a[n], (int16_t*)in, sizeof(int16_t) * num_points);
+        //}
+
+    //volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_avx2_reload(result, local_code, phase_inc[0], phase, (const int16_t**) 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 // AVX2
+
+
+#ifdef LV_HAVE_AVX2
+static inline void volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_u_avx2(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!
+    float rem_carrier_phase_in_rad = 0.345;
+    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));
+    unsigned int n;
+    int num_a_vectors = 3;
+    int16_t** in_a = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_a_vectors, volk_gnsssdr_get_alignment());
+    for(n = 0; n < num_a_vectors; n++)
+        {
+            in_a[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment());
+            memcpy((int16_t*)in_a[n], (int16_t*)in, sizeof(int16_t) * num_points);
+        }
+
+    volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_avx2(result, local_code, phase_inc[0], phase, (const int16_t**) 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 // AVX2
+
+
+//#ifdef LV_HAVE_AVX2
+//static inline void volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_u_avx2_reload(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!
+    //float rem_carrier_phase_in_rad = 0.345;
+    //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));
+    //unsigned int n;
+    //int num_a_vectors = 3;
+    //int16_t** in_a = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_a_vectors, volk_gnsssdr_get_alignment());
+    //for(n = 0; n < num_a_vectors; n++)
+        //{
+            //in_a[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment());
+            //memcpy((int16_t*)in_a[n], (int16_t*)in, sizeof(int16_t) * num_points);
+        //}
+
+    //volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_avx2_reload(result, local_code, phase_inc[0], phase, (const int16_t**) 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 // AVX2
+
+
+//#ifdef LV_HAVE_NEON
+//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!
+    //float rem_carrier_phase_in_rad = 0.345;
+    //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));
+    //unsigned int n;
+    //int num_a_vectors = 3;
+    //int16_t** in_a = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_a_vectors, volk_gnsssdr_get_alignment());
+    //for(n = 0; n < num_a_vectors; n++)
+        //{
+            //in_a[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment());
+            //memcpy((int16_t*)in_a[n], (int16_t*)in, sizeof(int16_t) * num_points);
+        //}
+
+    //volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_neon(result, local_code, phase_inc[0], phase, (const int16_t**) 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 // NEON
+
+
+//#ifdef LV_HAVE_NEON
+//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!
+    //float rem_carrier_phase_in_rad = 0.345;
+    //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));
+    //unsigned int n;
+    //int num_a_vectors = 3;
+    //int16_t** in_a = (int16_t**)volk_gnsssdr_malloc(sizeof(int16_t*) * num_a_vectors, volk_gnsssdr_get_alignment());
+    //for(n = 0; n < num_a_vectors; n++)
+        //{
+            //in_a[n] = (int16_t*)volk_gnsssdr_malloc(sizeof(int16_t) * num_points, volk_gnsssdr_get_alignment());
+            //memcpy((int16_t*)in_a[n], (int16_t*)in, sizeof(int16_t) * num_points);
+        //}
+
+    //volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_neon_vma(result, local_code, phase_inc[0], phase, (const int16_t**) 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 // NEON
+
+#endif  // INCLUDED_volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_H
+
+
+
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 106ad85b7..85e6fcb08 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
@@ -44,8 +44,8 @@
 #ifdef LV_HAVE_GENERIC
 static inline void volk_gnsssdr_16ic_resamplerxnpuppet_16ic_generic(lv_16sc_t* result, const lv_16sc_t* local_code, unsigned int num_points)
 {
-    float code_phase_step_chips = -0.6;
     int code_length_chips = 2046;
+    float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points );
     int num_out_vectors = 3;
     unsigned int n;
     float rem_code_phase_chips = -0.234;
@@ -74,8 +74,8 @@ static inline void volk_gnsssdr_16ic_resamplerxnpuppet_16ic_generic(lv_16sc_t* r
 #ifdef LV_HAVE_SSE3
 static inline void volk_gnsssdr_16ic_resamplerxnpuppet_16ic_a_sse3(lv_16sc_t* result, const lv_16sc_t* local_code, unsigned int num_points)
 {
-    float code_phase_step_chips = -0.6;
     int code_length_chips = 2046;
+    float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points );
     int num_out_vectors = 3;
     float rem_code_phase_chips = -0.234;
     unsigned int n;
@@ -103,8 +103,8 @@ static inline void volk_gnsssdr_16ic_resamplerxnpuppet_16ic_a_sse3(lv_16sc_t* re
 #ifdef LV_HAVE_SSE3
 static inline void volk_gnsssdr_16ic_resamplerxnpuppet_16ic_u_sse3(lv_16sc_t* result, const lv_16sc_t* local_code, unsigned int num_points)
 {
-    float code_phase_step_chips = -0.6;
     int code_length_chips = 2046;
+    float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points );
     int num_out_vectors = 3;
     float rem_code_phase_chips = -0.234;
     unsigned int n;
@@ -133,8 +133,8 @@ static inline void volk_gnsssdr_16ic_resamplerxnpuppet_16ic_u_sse3(lv_16sc_t* re
 #ifdef LV_HAVE_SSE4_1
 static inline void volk_gnsssdr_16ic_resamplerxnpuppet_16ic_u_sse4_1(lv_16sc_t* result, const lv_16sc_t* local_code, unsigned int num_points)
 {
-    float code_phase_step_chips = -0.6;
     int code_length_chips = 2046;
+    float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points );
     int num_out_vectors = 3;
     float rem_code_phase_chips = -0.234;
     unsigned int n;
@@ -163,8 +163,8 @@ static inline void volk_gnsssdr_16ic_resamplerxnpuppet_16ic_u_sse4_1(lv_16sc_t*
 #ifdef LV_HAVE_SSE4_1
 static inline void volk_gnsssdr_16ic_resamplerxnpuppet_16ic_a_sse4_1(lv_16sc_t* result, const lv_16sc_t* local_code, unsigned int num_points)
 {
-    float code_phase_step_chips = -0.6;
     int code_length_chips = 2046;
+    float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points );
     int num_out_vectors = 3;
     float rem_code_phase_chips = -0.234;
     unsigned int n;
@@ -193,8 +193,8 @@ static inline void volk_gnsssdr_16ic_resamplerxnpuppet_16ic_a_sse4_1(lv_16sc_t*
 #ifdef LV_HAVE_AVX
 static inline void volk_gnsssdr_16ic_resamplerxnpuppet_16ic_u_avx(lv_16sc_t* result, const lv_16sc_t* local_code, unsigned int num_points)
 {
-    float code_phase_step_chips = -0.6;
     int code_length_chips = 2046;
+    float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points );
     int num_out_vectors = 3;
     float rem_code_phase_chips = -0.234;
     unsigned int n;
@@ -223,8 +223,8 @@ static inline void volk_gnsssdr_16ic_resamplerxnpuppet_16ic_u_avx(lv_16sc_t* res
 #ifdef LV_HAVE_AVX
 static inline void volk_gnsssdr_16ic_resamplerxnpuppet_16ic_a_avx(lv_16sc_t* result, const lv_16sc_t* local_code, unsigned int num_points)
 {
-    float code_phase_step_chips = -0.6;
     int code_length_chips = 2046;
+    float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points );
     int num_out_vectors = 3;
     float rem_code_phase_chips = -0.234;
     unsigned int n;
@@ -253,8 +253,8 @@ static inline void volk_gnsssdr_16ic_resamplerxnpuppet_16ic_a_avx(lv_16sc_t* res
 #ifdef LV_HAVE_NEON
 static inline void volk_gnsssdr_16ic_resamplerxnpuppet_16ic_neon(lv_16sc_t* result, const lv_16sc_t* local_code, unsigned int num_points)
 {
-    float code_phase_step_chips = -0.6;
     int code_length_chips = 2046;
+    float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points );
     int num_out_vectors = 3;
     float rem_code_phase_chips = -0.234;
     unsigned int n;
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 d971fa04e..15303ead5 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
@@ -61,7 +61,6 @@
 
 #include <volk_gnsssdr/volk_gnsssdr_complex.h>
 #include <math.h>
-//#include <stdio.h>
 
 
 #ifdef LV_HAVE_GENERIC
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 dc9289af6..0cfc9df61 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
@@ -74,7 +74,6 @@
 #include <volk_gnsssdr/volk_gnsssdr_complex.h>
 #include <volk_gnsssdr/saturation_arithmetic.h>
 #include <math.h>
-//#include <stdio.h>
 
 #ifdef LV_HAVE_GENERIC
 
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 3948a96a6..af5e609cb 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
@@ -57,7 +57,6 @@
 
 #include <volk_gnsssdr/volk_gnsssdr_common.h>
 #include <inttypes.h>
-#include <stdio.h>
 
 #ifdef LV_HAVE_AVX
 #include <immintrin.h>
@@ -212,7 +211,6 @@ static inline void volk_gnsssdr_32f_index_max_32u_a_sse4_1(uint32_t* target, con
 
             for(;number < quarterPoints; number++)
                 {
-
                     currentValues  = _mm_load_ps(inputPtr); inputPtr += 4;
                     currentIndexes = _mm_add_ps(currentIndexes, indexIncrementValues);
                     compareResults = _mm_cmpgt_ps(maxValues, currentValues);
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
new file mode 100644
index 000000000..cf2a80f52
--- /dev/null
+++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_resamplerxnpuppet_32f.h
@@ -0,0 +1,279 @@
+/*!
+ * \file volk_gnsssdr_32f_resamplerxnpuppet_32f.h
+ * \brief VOLK_GNSSSDR puppet for the multiple 32-bit float vector resampler kernel.
+ * \authors <ul>
+ *          <li> Cillian O'Driscoll 2017 cillian.odriscoll at gmail dot com
+ *          </ul>
+ *
+ * VOLK_GNSSSDR puppet for integrating the multiple resampler into the test system
+ *
+ * -------------------------------------------------------------------------
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ *
+ * -------------------------------------------------------------------------
+ */
+
+#ifndef INCLUDED_volk_gnsssdr_32f_resamplerxnpuppet_32f_H
+#define INCLUDED_volk_gnsssdr_32f_resamplerxnpuppet_32f_H
+
+#include "volk_gnsssdr/volk_gnsssdr_32f_xn_resampler_32f_xn.h"
+#include <volk_gnsssdr/volk_gnsssdr_malloc.h>
+#include <volk_gnsssdr/volk_gnsssdr_complex.h>
+#include <volk_gnsssdr/volk_gnsssdr.h>
+#include <string.h>
+
+
+
+#ifdef LV_HAVE_GENERIC
+static inline void volk_gnsssdr_32f_resamplerxnpuppet_32f_generic(float* result, const float* local_code, unsigned int num_points)
+{
+    int code_length_chips = 2046;
+    float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points );
+    int num_out_vectors = 3;
+    float rem_code_phase_chips = -0.234;
+    unsigned int n;
+    float shifts_chips[3] = { -0.1, 0.0, 0.1  };
+
+    float** result_aux =  (float**)volk_gnsssdr_malloc(sizeof(float*) * num_out_vectors, volk_gnsssdr_get_alignment());
+    for(n = 0; n < num_out_vectors; n++)
+    {
+       result_aux[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment());
+    }
+
+    volk_gnsssdr_32f_xn_resampler_32f_xn_generic(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points);
+
+    memcpy((float*)result, (float*)result_aux[0], sizeof(float) * num_points);
+
+    for(n = 0; n < num_out_vectors; n++)
+    {
+        volk_gnsssdr_free(result_aux[n]);
+    }
+    volk_gnsssdr_free(result_aux);
+}
+
+
+#endif /* LV_HAVE_GENERIC */
+
+#ifdef LV_HAVE_SSE3
+static inline void volk_gnsssdr_32f_resamplerxnpuppet_32f_a_sse3(float* result, const float* local_code, unsigned int num_points)
+{
+    int code_length_chips = 2046;
+    float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points );
+    int num_out_vectors = 3;
+    float rem_code_phase_chips = -0.234;
+    unsigned int n;
+    float shifts_chips[3] = { -0.1, 0.0, 0.1 };
+
+    float** result_aux =  (float**)volk_gnsssdr_malloc(sizeof(float*) * num_out_vectors, volk_gnsssdr_get_alignment());
+    for(n = 0; n < num_out_vectors; n++)
+    {
+       result_aux[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment());
+    }
+
+    volk_gnsssdr_32f_xn_resampler_32f_xn_a_sse3(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points);
+
+    memcpy((float*)result, (float*)result_aux[0], sizeof(float) * num_points);
+
+    for(n = 0; n < num_out_vectors; n++)
+    {
+        volk_gnsssdr_free(result_aux[n]);
+    }
+    volk_gnsssdr_free(result_aux);
+}
+
+#endif
+
+#ifdef LV_HAVE_SSE3
+static inline void volk_gnsssdr_32f_resamplerxnpuppet_32f_u_sse3(float* result, const float* local_code, unsigned int num_points)
+{
+    int code_length_chips = 2046;
+    float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points );
+    int num_out_vectors = 3;
+    float rem_code_phase_chips = -0.234;
+    unsigned int n;
+    float shifts_chips[3] = { -0.1, 0.0, 0.1 };
+
+    float** result_aux =  (float**)volk_gnsssdr_malloc(sizeof(float*) * num_out_vectors, volk_gnsssdr_get_alignment());
+    for(n = 0; n < num_out_vectors; n++)
+    {
+       result_aux[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment());
+    }
+
+    volk_gnsssdr_32f_xn_resampler_32f_xn_u_sse3(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points);
+
+    memcpy((float*)result, (float*)result_aux[0], sizeof(float) * num_points);
+
+    for(n = 0; n < num_out_vectors; n++)
+    {
+        volk_gnsssdr_free(result_aux[n]);
+    }
+    volk_gnsssdr_free(result_aux);
+}
+
+#endif
+
+
+#ifdef LV_HAVE_SSE4_1
+static inline void volk_gnsssdr_32f_resamplerxnpuppet_32f_u_sse4_1(float* result, const float* local_code, unsigned int num_points)
+{
+    int code_length_chips = 2046;
+    float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points );
+    int num_out_vectors = 3;
+    float rem_code_phase_chips = -0.234;
+    unsigned int n;
+    float shifts_chips[3] = { -0.1, 0.0, 0.1 };
+
+    float** result_aux =  (float**)volk_gnsssdr_malloc(sizeof(float*) * num_out_vectors, volk_gnsssdr_get_alignment());
+    for(n = 0; n < num_out_vectors; n++)
+    {
+       result_aux[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment());
+    }
+
+    volk_gnsssdr_32f_xn_resampler_32f_xn_u_sse4_1(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points);
+
+    memcpy((float*)result, (float*)result_aux[0], sizeof(float) * num_points);
+
+    for(n = 0; n < num_out_vectors; n++)
+    {
+        volk_gnsssdr_free(result_aux[n]);
+    }
+    volk_gnsssdr_free(result_aux);
+}
+
+#endif
+
+#ifdef LV_HAVE_SSE4_1
+static inline void volk_gnsssdr_32f_resamplerxnpuppet_32f_a_sse4_1(float* result, const float* local_code, unsigned int num_points)
+{
+    int code_length_chips = 2046;
+    float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points );
+    int num_out_vectors = 3;
+    float rem_code_phase_chips = -0.234;
+    unsigned int n;
+    float shifts_chips[3] = { -0.1, 0.0, 0.1 };
+
+    float** result_aux =  (float**)volk_gnsssdr_malloc(sizeof(float*) * num_out_vectors, volk_gnsssdr_get_alignment());
+    for(n = 0; n < num_out_vectors; n++)
+    {
+       result_aux[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment());
+    }
+
+    volk_gnsssdr_32f_xn_resampler_32f_xn_a_sse4_1(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points);
+
+    memcpy((float*)result, (float*)result_aux[0], sizeof(float) * num_points);
+
+    for(n = 0; n < num_out_vectors; n++)
+    {
+        volk_gnsssdr_free(result_aux[n]);
+    }
+    volk_gnsssdr_free(result_aux);
+}
+
+#endif
+
+#ifdef LV_HAVE_AVX
+static inline void volk_gnsssdr_32f_resamplerxnpuppet_32f_a_avx(float* result, const float* local_code, unsigned int num_points)
+{
+    int code_length_chips = 2046;
+    float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points );
+    int num_out_vectors = 3;
+    float rem_code_phase_chips = -0.234;
+    unsigned int n;
+    float shifts_chips[3] = { -0.1, 0.0, 0.1 };
+
+    float** result_aux =  (float**)volk_gnsssdr_malloc(sizeof(float*) * num_out_vectors, volk_gnsssdr_get_alignment());
+    for(n = 0; n < num_out_vectors; n++)
+    {
+       result_aux[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment());
+    }
+
+    volk_gnsssdr_32f_xn_resampler_32f_xn_a_avx(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points);
+
+    memcpy((float*)result, (float*)result_aux[0], sizeof(float) * num_points);
+
+    for(n = 0; n < num_out_vectors; n++)
+    {
+        volk_gnsssdr_free(result_aux[n]);
+    }
+    volk_gnsssdr_free(result_aux);
+}
+#endif
+
+
+#ifdef LV_HAVE_AVX
+static inline void volk_gnsssdr_32f_resamplerxnpuppet_32f_u_avx(float* result, const float* local_code, unsigned int num_points)
+{
+    int code_length_chips = 2046;
+    float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points );
+    int num_out_vectors = 3;
+    float rem_code_phase_chips = -0.234;
+    unsigned int n;
+    float shifts_chips[3] = { -0.1, 0.0, 0.1 };
+
+    float** result_aux =  (float**)volk_gnsssdr_malloc(sizeof(float*) * num_out_vectors, volk_gnsssdr_get_alignment());
+    for(n = 0; n < num_out_vectors; n++)
+    {
+       result_aux[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment());
+    }
+
+    volk_gnsssdr_32f_xn_resampler_32f_xn_u_avx(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points);
+
+    memcpy((float*)result, (float*)result_aux[0], sizeof(float) * num_points);
+
+    for(n = 0; n < num_out_vectors; n++)
+    {
+        volk_gnsssdr_free(result_aux[n]);
+    }
+    volk_gnsssdr_free(result_aux);
+}
+#endif
+
+#ifdef LV_HAVE_NEON
+static inline void volk_gnsssdr_32f_resamplerxnpuppet_32f_neon(float* result, const float* local_code, unsigned int num_points)
+{
+    int code_length_chips = 2046;
+    float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points );
+    int num_out_vectors = 3;
+    float rem_code_phase_chips = -0.234;
+    unsigned int n;
+    float shifts_chips[3] = { -0.1, 0.0, 0.1 };
+
+    float** result_aux =  (float**)volk_gnsssdr_malloc(sizeof(float*) * num_out_vectors, volk_gnsssdr_get_alignment());
+    for(n = 0; n < num_out_vectors; n++)
+    {
+       result_aux[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment());
+    }
+
+    volk_gnsssdr_32f_xn_resampler_32f_xn_neon(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points);
+
+    memcpy((float*)result, (float*)result_aux[0], sizeof(float) * num_points);
+
+    for(n = 0; n < num_out_vectors; n++)
+    {
+        volk_gnsssdr_free(result_aux[n]);
+    }
+    volk_gnsssdr_free(result_aux);
+}
+#endif
+
+#endif // INCLUDED_volk_gnsssdr_32f_resamplerpuppet_32f_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
new file mode 100644
index 000000000..1fa95e0e6
--- /dev/null
+++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_xn_resampler_32f_xn.h
@@ -0,0 +1,610 @@
+/*!
+ * \file volk_gnsssdr_32f_xn_resampler_32f_xn.h
+ * \brief VOLK_GNSSSDR kernel: Resamples N complex 32-bit float vectors using zero hold resample algorithm.
+ * \authors <ul>
+ *          <li> Cillian O'Driscoll, 2017. cillian.odirscoll(at)gmail.com
+ *          </ul>
+ *
+ * VOLK_GNSSSDR kernel that resamples N 32-bit float vectors using zero hold resample algorithm.
+ * It is optimized to resample a single GNSS local code signal replica into N vectors fractional-resampled and fractional-delayed
+ * (i.e. it creates the Early, Prompt, and Late code replicas)
+ *
+ * -------------------------------------------------------------------------
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ *
+ * -------------------------------------------------------------------------
+ */
+
+/*!
+ * \page volk_gnsssdr_32f_xn_resampler_32f_xn
+ *
+ * \b Overview
+ *
+ * Resamples a 32-bit floating point vector , providing \p num_out_vectors outputs.
+ *
+ * <b>Dispatcher Prototype</b>
+ * \code
+ * void volk_gnsssdr_32f_xn_resampler_32f_xn(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)
+ * \endcode
+ *
+ * \b Inputs
+ * \li local_code:            Vector to be resampled.
+ * \li rem_code_phase_chips:  Remnant code phase [chips].
+ * \li code_phase_step_chips: Phase increment per sample [chips/sample].
+ * \li shifts_chips:          Vector of floats that defines the spacing (in chips) between the replicas of \p local_code
+ * \li code_length_chips:     Code length in chips.
+ * \li num_out_vectors        Number of output vectors.
+ * \li num_points:            The number of data values to be in the resampled vector.
+ *
+ * \b Outputs
+ * \li result:                Pointer to a vector of pointers where the results will be stored.
+ *
+ */
+
+#ifndef INCLUDED_volk_gnsssdr_32f_xn_resampler_32f_xn_H
+#define INCLUDED_volk_gnsssdr_32f_xn_resampler_32f_xn_H
+
+#include <assert.h>
+#include <math.h>
+#include <stdlib.h> /* abs */
+#include <stdint.h> /* int64_t */
+#include <stdio.h>
+#include <volk_gnsssdr/volk_gnsssdr_common.h>
+#include <volk_gnsssdr/volk_gnsssdr_complex.h>
+
+
+#ifdef LV_HAVE_GENERIC
+
+static inline void volk_gnsssdr_32f_xn_resampler_32f_xn_generic(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)
+{
+    int local_code_chip_index;
+    int current_correlator_tap;
+    int n;
+    for (current_correlator_tap = 0; current_correlator_tap < num_out_vectors; current_correlator_tap++)
+        {
+            for (n = 0; n < num_points; n++)
+                {
+                    // resample code for current tap
+                    local_code_chip_index = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips);
+                    //Take into account that in multitap correlators, the shifts can be negative!
+                    if (local_code_chip_index < 0) local_code_chip_index += (int)code_length_chips * (abs(local_code_chip_index) / code_length_chips + 1);
+                    local_code_chip_index = local_code_chip_index % code_length_chips;
+                    result[current_correlator_tap][n] = local_code[local_code_chip_index];
+                }
+        }
+}
+
+#endif /*LV_HAVE_GENERIC*/
+
+
+#ifdef LV_HAVE_SSE3
+#include <pmmintrin.h>
+static inline void volk_gnsssdr_32f_xn_resampler_32f_xn_a_sse3(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)
+{
+    float** _result = result;
+    const unsigned int quarterPoints = num_points / 4;
+    int current_correlator_tap;
+    unsigned int n;
+    unsigned int k;
+    const __m128 ones = _mm_set1_ps(1.0f);
+    const __m128 fours = _mm_set1_ps(4.0f);
+    const __m128 rem_code_phase_chips_reg = _mm_set_ps1(rem_code_phase_chips);
+    const __m128 code_phase_step_chips_reg = _mm_set_ps1(code_phase_step_chips);
+
+    __VOLK_ATTR_ALIGNED(16) int local_code_chip_index[4];
+    int local_code_chip_index_;
+
+    const __m128i zeros = _mm_setzero_si128();
+    const __m128 code_length_chips_reg_f = _mm_set_ps1((float)code_length_chips);
+    const __m128i code_length_chips_reg_i = _mm_set1_epi32((int)code_length_chips);
+    __m128i local_code_chip_index_reg, aux_i, negatives, i;
+    __m128 aux, aux2, shifts_chips_reg, fi, igx, j, c, cTrunc, base;
+
+    for (current_correlator_tap = 0; current_correlator_tap < num_out_vectors; current_correlator_tap++)
+        {
+            shifts_chips_reg = _mm_set_ps1((float)shifts_chips[current_correlator_tap]);
+            aux2 = _mm_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg);
+            __m128 indexn = _mm_set_ps(3.0f, 2.0f, 1.0f, 0.0f);
+            for(n = 0; n < quarterPoints; n++)
+                {
+                    aux = _mm_mul_ps(code_phase_step_chips_reg, indexn);
+                    aux = _mm_add_ps(aux, aux2);
+                    // floor
+                    i = _mm_cvttps_epi32(aux);
+                    fi = _mm_cvtepi32_ps(i);
+                    igx = _mm_cmpgt_ps(fi, aux);
+                    j = _mm_and_ps(igx, ones);
+                    aux = _mm_sub_ps(fi, j);
+                    // fmod
+                    c = _mm_div_ps(aux, code_length_chips_reg_f);
+                    i = _mm_cvttps_epi32(c);
+                    cTrunc = _mm_cvtepi32_ps(i);
+                    base = _mm_mul_ps(cTrunc, code_length_chips_reg_f);
+                    local_code_chip_index_reg = _mm_cvtps_epi32(_mm_sub_ps(aux, base));
+
+                    negatives = _mm_cmplt_epi32(local_code_chip_index_reg, zeros);
+                    aux_i = _mm_and_si128(code_length_chips_reg_i, negatives);
+                    local_code_chip_index_reg = _mm_add_epi32(local_code_chip_index_reg, aux_i);
+                    _mm_store_si128((__m128i*)local_code_chip_index, local_code_chip_index_reg);
+                    for(k = 0; k < 4; ++k)
+                        {
+                            _result[current_correlator_tap][n * 4 + k] = local_code[local_code_chip_index[k]];
+                        }
+                    indexn = _mm_add_ps(indexn, fours);
+                }
+            for(n = quarterPoints * 4; n < num_points; n++)
+                {
+                    // resample code for current tap
+                    local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips);
+                    //Take into account that in multitap correlators, the shifts can be negative!
+                    if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1) ;
+                    local_code_chip_index_ = local_code_chip_index_ % code_length_chips;
+                    _result[current_correlator_tap][n] = local_code[local_code_chip_index_];
+                }
+        }
+}
+
+#endif 
+
+
+#ifdef LV_HAVE_SSE3
+#include <pmmintrin.h>
+static inline void volk_gnsssdr_32f_xn_resampler_32f_xn_u_sse3(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)
+{
+    float** _result = result;
+    const unsigned int quarterPoints = num_points / 4;
+    int current_correlator_tap;
+    unsigned int n;
+    unsigned int k;
+    const __m128 ones = _mm_set1_ps(1.0f);
+    const __m128 fours = _mm_set1_ps(4.0f);
+    const __m128 rem_code_phase_chips_reg = _mm_set_ps1(rem_code_phase_chips);
+    const __m128 code_phase_step_chips_reg = _mm_set_ps1(code_phase_step_chips);
+
+    __VOLK_ATTR_ALIGNED(16) int local_code_chip_index[4];
+    int local_code_chip_index_;
+
+    const __m128i zeros = _mm_setzero_si128();
+    const __m128 code_length_chips_reg_f = _mm_set_ps1((float)code_length_chips);
+    const __m128i code_length_chips_reg_i = _mm_set1_epi32((int)code_length_chips);
+    __m128i local_code_chip_index_reg, aux_i, negatives, i;
+    __m128 aux, aux2, shifts_chips_reg, fi, igx, j, c, cTrunc, base;
+
+    for (current_correlator_tap = 0; current_correlator_tap < num_out_vectors; current_correlator_tap++)
+        {
+            shifts_chips_reg = _mm_set_ps1((float)shifts_chips[current_correlator_tap]);
+            aux2 = _mm_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg);
+            __m128 indexn = _mm_set_ps(3.0f, 2.0f, 1.0f, 0.0f);
+            for(n = 0; n < quarterPoints; n++)
+                {
+                    aux = _mm_mul_ps(code_phase_step_chips_reg, indexn);
+                    aux = _mm_add_ps(aux, aux2);
+                    // floor
+                    i = _mm_cvttps_epi32(aux);
+                    fi = _mm_cvtepi32_ps(i);
+                    igx = _mm_cmpgt_ps(fi, aux);
+                    j = _mm_and_ps(igx, ones);
+                    aux = _mm_sub_ps(fi, j);
+                    // fmod
+                    c = _mm_div_ps(aux, code_length_chips_reg_f);
+                    i = _mm_cvttps_epi32(c);
+                    cTrunc = _mm_cvtepi32_ps(i);
+                    base = _mm_mul_ps(cTrunc, code_length_chips_reg_f);
+                    local_code_chip_index_reg = _mm_cvtps_epi32(_mm_sub_ps(aux, base));
+
+                    negatives = _mm_cmplt_epi32(local_code_chip_index_reg, zeros);
+                    aux_i = _mm_and_si128(code_length_chips_reg_i, negatives);
+                    local_code_chip_index_reg = _mm_add_epi32(local_code_chip_index_reg, aux_i);
+                    _mm_store_si128((__m128i*)local_code_chip_index, local_code_chip_index_reg);
+                    for(k = 0; k < 4; ++k)
+                        {
+                            _result[current_correlator_tap][n * 4 + k] = local_code[local_code_chip_index[k]];
+                        }
+                    indexn = _mm_add_ps(indexn, fours);
+                }
+            for(n = quarterPoints * 4; n < num_points; n++)
+                {
+                    // resample code for current tap
+                    local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips);
+                    //Take into account that in multitap correlators, the shifts can be negative!
+                    if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1) ;
+                    local_code_chip_index_ = local_code_chip_index_ % code_length_chips;
+                    _result[current_correlator_tap][n] = local_code[local_code_chip_index_];
+                }
+        }
+}
+#endif
+
+
+#ifdef LV_HAVE_SSE4_1
+#include <smmintrin.h>
+static inline void volk_gnsssdr_32f_xn_resampler_32f_xn_a_sse4_1(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)
+{
+    float** _result = result;
+    const unsigned int quarterPoints = num_points / 4;
+    int current_correlator_tap;
+    unsigned int n;
+    unsigned int k;
+    const __m128 fours = _mm_set1_ps(4.0f);
+    const __m128 rem_code_phase_chips_reg = _mm_set_ps1(rem_code_phase_chips);
+    const __m128 code_phase_step_chips_reg = _mm_set_ps1(code_phase_step_chips);
+
+    __VOLK_ATTR_ALIGNED(16) int local_code_chip_index[4];
+    int local_code_chip_index_;
+
+    const __m128i zeros = _mm_setzero_si128();
+    const __m128 code_length_chips_reg_f = _mm_set_ps1((float)code_length_chips);
+    const __m128i code_length_chips_reg_i = _mm_set1_epi32((int)code_length_chips);
+    __m128i local_code_chip_index_reg, aux_i, negatives, i;
+    __m128 aux, aux2, shifts_chips_reg, c, cTrunc, base;
+
+    for (current_correlator_tap = 0; current_correlator_tap < num_out_vectors; current_correlator_tap++)
+        {
+            shifts_chips_reg = _mm_set_ps1((float)shifts_chips[current_correlator_tap]);
+            aux2 = _mm_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg);
+            __m128 indexn = _mm_set_ps(3.0f, 2.0f, 1.0f, 0.0f);
+            for(n = 0; n < quarterPoints; n++)
+                {
+                    aux = _mm_mul_ps(code_phase_step_chips_reg, indexn);
+                    aux = _mm_add_ps(aux, aux2);
+                    // floor
+                    aux = _mm_floor_ps(aux);
+
+                    // fmod
+                    c = _mm_div_ps(aux, code_length_chips_reg_f);
+                    i = _mm_cvttps_epi32(c);
+                    cTrunc = _mm_cvtepi32_ps(i);
+                    base = _mm_mul_ps(cTrunc, code_length_chips_reg_f);
+                    local_code_chip_index_reg = _mm_cvtps_epi32(_mm_sub_ps(aux, base));
+
+                    negatives = _mm_cmplt_epi32(local_code_chip_index_reg, zeros);
+                    aux_i = _mm_and_si128(code_length_chips_reg_i, negatives);
+                    local_code_chip_index_reg = _mm_add_epi32(local_code_chip_index_reg, aux_i);
+                    _mm_store_si128((__m128i*)local_code_chip_index, local_code_chip_index_reg);
+                    for(k = 0; k < 4; ++k)
+                        {
+                            _result[current_correlator_tap][n * 4 + k] = local_code[local_code_chip_index[k]];
+                        }
+                    indexn = _mm_add_ps(indexn, fours);
+                }
+            for(n = quarterPoints * 4; n < num_points; n++)
+                {
+                    // resample code for current tap
+                    local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips);
+                    //Take into account that in multitap correlators, the shifts can be negative!
+                    if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1) ;
+                    local_code_chip_index_ = local_code_chip_index_ % code_length_chips;
+                    _result[current_correlator_tap][n] = local_code[local_code_chip_index_];
+                }
+        }
+}
+
+#endif 
+
+
+#ifdef LV_HAVE_SSE4_1
+#include <smmintrin.h>
+static inline void volk_gnsssdr_32f_xn_resampler_32f_xn_u_sse4_1(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)
+{
+    float** _result = result;
+    const unsigned int quarterPoints = num_points / 4;
+    int current_correlator_tap;
+    unsigned int n;
+    unsigned int k;
+    const __m128 fours = _mm_set1_ps(4.0f);
+    const __m128 rem_code_phase_chips_reg = _mm_set_ps1(rem_code_phase_chips);
+    const __m128 code_phase_step_chips_reg = _mm_set_ps1(code_phase_step_chips);
+
+    __VOLK_ATTR_ALIGNED(16) int local_code_chip_index[4];
+    int local_code_chip_index_;
+
+    const __m128i zeros = _mm_setzero_si128();
+    const __m128 code_length_chips_reg_f = _mm_set_ps1((float)code_length_chips);
+    const __m128i code_length_chips_reg_i = _mm_set1_epi32((int)code_length_chips);
+    __m128i local_code_chip_index_reg, aux_i, negatives, i;
+    __m128 aux, aux2, shifts_chips_reg, c, cTrunc, base;
+
+    for (current_correlator_tap = 0; current_correlator_tap < num_out_vectors; current_correlator_tap++)
+        {
+            shifts_chips_reg = _mm_set_ps1((float)shifts_chips[current_correlator_tap]);
+            aux2 = _mm_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg);
+            __m128 indexn = _mm_set_ps(3.0f, 2.0f, 1.0f, 0.0f);
+            for(n = 0; n < quarterPoints; n++)
+                {
+                    aux = _mm_mul_ps(code_phase_step_chips_reg, indexn);
+                    aux = _mm_add_ps(aux, aux2);
+                    // floor
+                    aux = _mm_floor_ps(aux);
+
+                    // fmod
+                    c = _mm_div_ps(aux, code_length_chips_reg_f);
+                    i = _mm_cvttps_epi32(c);
+                    cTrunc = _mm_cvtepi32_ps(i);
+                    base = _mm_mul_ps(cTrunc, code_length_chips_reg_f);
+                    local_code_chip_index_reg = _mm_cvtps_epi32(_mm_sub_ps(aux, base));
+
+                    negatives = _mm_cmplt_epi32(local_code_chip_index_reg, zeros);
+                    aux_i = _mm_and_si128(code_length_chips_reg_i, negatives);
+                    local_code_chip_index_reg = _mm_add_epi32(local_code_chip_index_reg, aux_i);
+                    _mm_store_si128((__m128i*)local_code_chip_index, local_code_chip_index_reg);
+                    for(k = 0; k < 4; ++k)
+                        {
+                            _result[current_correlator_tap][n * 4 + k] = local_code[local_code_chip_index[k]];
+                        }
+                    indexn = _mm_add_ps(indexn, fours);
+                }
+            for(n = quarterPoints * 4; n < num_points; n++)
+                {
+                    // resample code for current tap
+                    local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips);
+                    //Take into account that in multitap correlators, the shifts can be negative!
+                    if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1) ;
+                    local_code_chip_index_ = local_code_chip_index_ % code_length_chips;
+                    _result[current_correlator_tap][n] = local_code[local_code_chip_index_];
+                }
+        }
+}
+
+#endif
+
+
+#ifdef LV_HAVE_AVX
+#include <immintrin.h>
+static inline void volk_gnsssdr_32f_xn_resampler_32f_xn_a_avx(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)
+{
+    float** _result = result;
+    const unsigned int avx_iters = num_points / 8;
+    int current_correlator_tap;
+    unsigned int n;
+    unsigned int k;
+    const __m256 eights = _mm256_set1_ps(8.0f);
+    const __m256 rem_code_phase_chips_reg = _mm256_set1_ps(rem_code_phase_chips);
+    const __m256 code_phase_step_chips_reg = _mm256_set1_ps(code_phase_step_chips);
+
+    __VOLK_ATTR_ALIGNED(32) int local_code_chip_index[8];
+    int local_code_chip_index_;
+
+    const __m256 zeros = _mm256_setzero_ps();
+    const __m256 code_length_chips_reg_f = _mm256_set1_ps((float)code_length_chips);
+    const __m256 n0 = _mm256_set_ps(7.0f, 6.0f, 5.0f, 4.0f, 3.0f, 2.0f, 1.0f, 0.0f);
+
+    __m256i local_code_chip_index_reg, i;
+    __m256 aux, aux2, aux3, shifts_chips_reg, c, cTrunc, base, negatives, indexn;
+
+    for (current_correlator_tap = 0; current_correlator_tap < num_out_vectors; current_correlator_tap++)
+        {
+            shifts_chips_reg = _mm256_set1_ps((float)shifts_chips[current_correlator_tap]);
+            aux2 = _mm256_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg);
+            indexn = n0;
+            for(n = 0; n < avx_iters; n++)
+                {
+                    __VOLK_GNSSSDR_PREFETCH_LOCALITY(&_result[current_correlator_tap][8 * n + 7], 1, 0);
+                    __VOLK_GNSSSDR_PREFETCH_LOCALITY(&local_code_chip_index[8], 1, 3);
+                    aux = _mm256_mul_ps(code_phase_step_chips_reg, indexn);
+                    aux = _mm256_add_ps(aux, aux2);
+                    // floor
+                    aux = _mm256_floor_ps(aux);
+
+                    // fmod
+                    c = _mm256_div_ps(aux, code_length_chips_reg_f);
+                    i = _mm256_cvttps_epi32(c);
+                    cTrunc = _mm256_cvtepi32_ps(i);
+                    base = _mm256_mul_ps(cTrunc, code_length_chips_reg_f);
+                    local_code_chip_index_reg = _mm256_cvttps_epi32(_mm256_sub_ps(aux, base));
+
+                    // no negatives
+                    c = _mm256_cvtepi32_ps(local_code_chip_index_reg);
+                    negatives = _mm256_cmp_ps(c, zeros, 0x01 );
+                    aux3 = _mm256_and_ps(code_length_chips_reg_f, negatives);
+                    aux = _mm256_add_ps(c, aux3);
+                    local_code_chip_index_reg = _mm256_cvttps_epi32(aux);
+
+                    _mm256_store_si256((__m256i*)local_code_chip_index, local_code_chip_index_reg);
+                    for(k = 0; k < 8; ++k)
+                        {
+                            _result[current_correlator_tap][n * 8 + k] = local_code[local_code_chip_index[k]];
+                        }
+                    indexn = _mm256_add_ps(indexn, eights);
+                }
+        }
+    _mm256_zeroupper();
+    for (current_correlator_tap = 0; current_correlator_tap < num_out_vectors; current_correlator_tap++)
+        {
+            for(n = avx_iters * 8; n < num_points; n++)
+                {
+                    // resample code for current tap
+                    local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips);
+                    //Take into account that in multitap correlators, the shifts can be negative!
+                    if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1) ;
+                    local_code_chip_index_ = local_code_chip_index_ % code_length_chips;
+                    _result[current_correlator_tap][n] = local_code[local_code_chip_index_];
+                }
+        }
+}
+
+#endif
+
+
+#ifdef LV_HAVE_AVX
+#include <immintrin.h>
+static inline void volk_gnsssdr_32f_xn_resampler_32f_xn_u_avx(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)
+{
+    float** _result = result;
+    const unsigned int avx_iters = num_points / 8;
+    int current_correlator_tap;
+    unsigned int n;
+    unsigned int k;
+    const __m256 eights = _mm256_set1_ps(8.0f);
+    const __m256 rem_code_phase_chips_reg = _mm256_set1_ps(rem_code_phase_chips);
+    const __m256 code_phase_step_chips_reg = _mm256_set1_ps(code_phase_step_chips);
+
+    __VOLK_ATTR_ALIGNED(32) int local_code_chip_index[8];
+    int local_code_chip_index_;
+
+    const __m256 zeros = _mm256_setzero_ps();
+    const __m256 code_length_chips_reg_f = _mm256_set1_ps((float)code_length_chips);
+    const __m256 n0 = _mm256_set_ps(7.0f, 6.0f, 5.0f, 4.0f, 3.0f, 2.0f, 1.0f, 0.0f);
+
+    __m256i local_code_chip_index_reg, i;
+    __m256 aux, aux2, aux3, shifts_chips_reg, c, cTrunc, base, negatives, indexn;
+
+    for (current_correlator_tap = 0; current_correlator_tap < num_out_vectors; current_correlator_tap++)
+        {
+            shifts_chips_reg = _mm256_set1_ps((float)shifts_chips[current_correlator_tap]);
+            aux2 = _mm256_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg);
+            indexn = n0;
+            for(n = 0; n < avx_iters; n++)
+                {
+                    __VOLK_GNSSSDR_PREFETCH_LOCALITY(&_result[current_correlator_tap][8 * n + 7], 1, 0);
+                    __VOLK_GNSSSDR_PREFETCH_LOCALITY(&local_code_chip_index[8], 1, 3);
+                    aux = _mm256_mul_ps(code_phase_step_chips_reg, indexn);
+                    aux = _mm256_add_ps(aux, aux2);
+                    // floor
+                    aux = _mm256_floor_ps(aux);
+
+                    // fmod
+                    c = _mm256_div_ps(aux, code_length_chips_reg_f);
+                    i = _mm256_cvttps_epi32(c);
+                    cTrunc = _mm256_cvtepi32_ps(i);
+                    base = _mm256_mul_ps(cTrunc, code_length_chips_reg_f);
+                    local_code_chip_index_reg = _mm256_cvttps_epi32(_mm256_sub_ps(aux, base));
+
+                    // no negatives
+                    c = _mm256_cvtepi32_ps(local_code_chip_index_reg);
+                    negatives = _mm256_cmp_ps(c, zeros, 0x01 );
+                    aux3 = _mm256_and_ps(code_length_chips_reg_f, negatives);
+                    aux = _mm256_add_ps(c, aux3);
+                    local_code_chip_index_reg = _mm256_cvttps_epi32(aux);
+
+                    _mm256_store_si256((__m256i*)local_code_chip_index, local_code_chip_index_reg);
+                    for(k = 0; k < 8; ++k)
+                        {
+                            _result[current_correlator_tap][n * 8 + k] = local_code[local_code_chip_index[k]];
+                        }
+                    indexn = _mm256_add_ps(indexn, eights);
+                }
+        }
+    _mm256_zeroupper();
+    for (current_correlator_tap = 0; current_correlator_tap < num_out_vectors; current_correlator_tap++)
+        {
+            for(n = avx_iters * 8; n < num_points; n++)
+                {
+                    // resample code for current tap
+                    local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips);
+                    //Take into account that in multitap correlators, the shifts can be negative!
+                    if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1) ;
+                    local_code_chip_index_ = local_code_chip_index_ % code_length_chips;
+                    _result[current_correlator_tap][n] = local_code[local_code_chip_index_];
+                }
+        }
+}
+
+#endif
+
+
+#ifdef LV_HAVE_NEON
+#include <arm_neon.h>
+
+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)
+{
+    float** _result = result;
+    const unsigned int neon_iters = num_points / 4;
+    int current_correlator_tap;
+    unsigned int n;
+    unsigned int k;
+    const int32x4_t ones = vdupq_n_s32(1);
+    const float32x4_t fours = vdupq_n_f32(4.0f);
+    const float32x4_t rem_code_phase_chips_reg = vdupq_n_f32(rem_code_phase_chips);
+    const float32x4_t code_phase_step_chips_reg = vdupq_n_f32(code_phase_step_chips);
+
+    __VOLK_ATTR_ALIGNED(16) int32_t local_code_chip_index[4];
+    int32_t local_code_chip_index_;
+
+    const int32x4_t zeros = vdupq_n_s32(0);
+    const float32x4_t code_length_chips_reg_f = vdupq_n_f32((float)code_length_chips);
+    const int32x4_t code_length_chips_reg_i = vdupq_n_s32((int32_t)code_length_chips);
+    int32x4_t local_code_chip_index_reg, aux_i,  negatives, i;
+    float32x4_t aux, aux2, shifts_chips_reg, fi, c, j, cTrunc, base, indexn, reciprocal;
+    __VOLK_ATTR_ALIGNED(16) const float vec[4] = { 0.0f, 1.0f, 2.0f, 3.0f };
+    uint32x4_t igx;
+    reciprocal = vrecpeq_f32(code_length_chips_reg_f);
+    reciprocal = vmulq_f32(vrecpsq_f32(code_length_chips_reg_f, reciprocal), reciprocal);
+    reciprocal = vmulq_f32(vrecpsq_f32(code_length_chips_reg_f, reciprocal), reciprocal); // this refinement is required!
+    float32x4_t n0 = vld1q_f32((float*)vec);
+
+    for (current_correlator_tap = 0; current_correlator_tap < num_out_vectors; current_correlator_tap++)
+        {
+            shifts_chips_reg = vdupq_n_f32((float)shifts_chips[current_correlator_tap]);
+            aux2 = vsubq_f32(shifts_chips_reg, rem_code_phase_chips_reg);
+            indexn = n0;
+            for(n = 0; n < neon_iters; n++)
+                {
+                    __VOLK_GNSSSDR_PREFETCH_LOCALITY(&_result[current_correlator_tap][4 * n + 3], 1, 0);
+                    __VOLK_GNSSSDR_PREFETCH(&local_code_chip_index[4]);
+                    aux = vmulq_f32(code_phase_step_chips_reg, indexn);
+                    aux = vaddq_f32(aux, aux2);
+
+                    //floor
+                    i = vcvtq_s32_f32(aux);
+                    fi = vcvtq_f32_s32(i);
+                    igx = vcgtq_f32(fi, aux);
+                    j = vcvtq_f32_s32(vandq_s32(vreinterpretq_s32_u32(igx), ones));
+                    aux = vsubq_f32(fi, j);
+
+                    // fmod
+                    c = vmulq_f32(aux, reciprocal);
+                    i =  vcvtq_s32_f32(c);
+                    cTrunc = vcvtq_f32_s32(i);
+                    base = vmulq_f32(cTrunc, code_length_chips_reg_f);
+                    aux = vsubq_f32(aux, base);
+                    local_code_chip_index_reg = vcvtq_s32_f32(aux);
+
+                    negatives = vreinterpretq_s32_u32(vcltq_s32(local_code_chip_index_reg, zeros));
+                    aux_i = vandq_s32(code_length_chips_reg_i, negatives);
+                    local_code_chip_index_reg = vaddq_s32(local_code_chip_index_reg, aux_i);
+
+                    vst1q_s32((int32_t*)local_code_chip_index, local_code_chip_index_reg);
+
+                    for(k = 0; k < 4; ++k)
+                        {
+                            _result[current_correlator_tap][n * 4 + k] = local_code[local_code_chip_index[k]];
+                        }
+                    indexn = vaddq_f32(indexn, fours);
+                }
+            for(n = neon_iters * 4; n < num_points; n++)
+                {
+                    __VOLK_GNSSSDR_PREFETCH_LOCALITY(&_result[current_correlator_tap][n], 1, 0);
+                    // resample code for current tap
+                    local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips);
+                    //Take into account that in multitap correlators, the shifts can be negative!
+                    if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1);
+                    local_code_chip_index_ = local_code_chip_index_ % code_length_chips;
+                    _result[current_correlator_tap][n] = local_code[local_code_chip_index_];
+                }
+        }
+}
+
+#endif
+
+#endif /*INCLUDED_volk_gnsssdr_32f_xn_resampler_32f_xn_H*/
+
+
diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn.h
new file mode 100644
index 000000000..544a83990
--- /dev/null
+++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn.h
@@ -0,0 +1,320 @@
+/*!
+ * \file volk_gnsssdr_32fc_32f_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.
+ * \authors <ul>
+ *          <li> Cillian O'Driscoll 2016. cillian.odriscoll(at)gmail.com
+ *          </ul>
+ *
+ * VOLK_GNSSSDR kernel that multiplies N 32 bits complex vectors by a common vector, which is
+ * phase-rotated by phase offset and phase increment, and accumulates the results
+ * in N 32 bits float complex outputs.
+ * It is optimized to perform the N tap correlation process in GNSS receivers.
+ *
+ * -------------------------------------------------------------------------
+ *
+ * Copyright (C) 2010-2016  (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 <http://www.gnu.org/licenses/>.
+ *
+ * -------------------------------------------------------------------------
+ */
+
+/*!
+ * \page volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn
+ *
+ * \b Overview
+ *
+ * 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.
+ *
+ * <b>Dispatcher Prototype</b>
+ * \code
+ * void volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn(lv_32fc_t* result, const lv_32fc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const float** in_a, int num_a_vectors, unsigned int num_points);
+ * \endcode
+ *
+ * \b Inputs
+ * \li in_common:     Pointer to one of the vectors to be rotated, multiplied and accumulated (reference vector).
+ * \li phase_inc:     Phase increment = lv_cmake(cos(phase_step_rad), sin(phase_step_rad))
+ * \li phase:         Initial phase = lv_cmake(cos(initial_phase_rad), sin(initial_phase_rad))
+ * \li in_a:          Pointer to an array of pointers to multiple vectors to be multiplied and accumulated.
+ * \li num_a_vectors: Number of vectors to be multiplied by the reference vector and accumulated.
+ * \li num_points:    Number of complex values to be multiplied together, accumulated and stored into \p result.
+ *
+ * \b Outputs
+ * \li phase:         Final phase.
+ * \li result:        Vector of \p num_a_vectors components with the multiple vectors of \p in_a rotated, multiplied by \p in_common and accumulated.
+ *
+ */
+
+#ifndef INCLUDED_volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_H
+#define INCLUDED_volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_H
+
+
+#include <volk_gnsssdr/volk_gnsssdr.h>
+#include <volk_gnsssdr/volk_gnsssdr_malloc.h>
+#include <volk_gnsssdr/volk_gnsssdr_complex.h>
+#include <volk_gnsssdr/saturation_arithmetic.h>
+#include <math.h>
+#include <stdio.h>
+
+#ifdef LV_HAVE_GENERIC
+
+static inline void volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_generic(lv_32fc_t* result, const lv_32fc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const float** in_a, int num_a_vectors, unsigned int num_points)
+{
+    lv_32fc_t tmp32_1, tmp32_2;
+    int n_vec;
+    unsigned int n;
+    for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+        {
+            result[n_vec] = lv_cmake(0,0);
+        }
+    for (n = 0; n < num_points; n++)
+        {
+            tmp32_1 = *in_common++ * (*phase);//if(n<10 || n >= 8108) printf("generic phase %i: %f,%f\n", n,lv_creal(*phase),lv_cimag(*phase));
+
+            // Regenerate phase
+            if (n % 256 == 0)
+                {
+                    //printf("Phase before regeneration %i: %f,%f  Modulus: %f\n", n,lv_creal(*phase),lv_cimag(*phase), cabsf(*phase));
+#ifdef __cplusplus
+                    (*phase) /= std::abs((*phase));
+#else
+                    (*phase) /= hypotf(lv_creal(*phase), lv_cimag(*phase));
+#endif
+                    //printf("Phase after regeneration %i: %f,%f  Modulus: %f\n", n,lv_creal(*phase),lv_cimag(*phase), cabsf(*phase));
+                }
+
+            (*phase) *= phase_inc;
+            for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+                {
+                    tmp32_2 = tmp32_1 * in_a[n_vec][n];
+                    result[n_vec] += tmp32_2;
+                }
+        }
+}
+
+#endif /*LV_HAVE_GENERIC*/
+
+
+#ifdef LV_HAVE_GENERIC
+
+static inline void volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_generic_reload(lv_32fc_t* result, const lv_32fc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const float** in_a, int num_a_vectors, unsigned int num_points)
+{
+    lv_32fc_t tmp32_1, tmp32_2;
+    const unsigned int ROTATOR_RELOAD = 256;
+    int n_vec;
+    unsigned int n;
+    unsigned int j;
+    for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+        {
+            result[n_vec] = lv_cmake(0,0);
+        }
+
+    for (n = 0; n < num_points / ROTATOR_RELOAD; n++)
+        {
+            for (j = 0; j < ROTATOR_RELOAD; j++)
+                {
+                    tmp32_1 = *in_common++ * (*phase);
+                    (*phase) *= phase_inc;
+                    for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+                        {
+                            tmp32_2 = tmp32_1 * in_a[n_vec][n * ROTATOR_RELOAD + j];
+                            result[n_vec] += tmp32_2;
+                        }
+                }
+            /* Regenerate phase */
+#ifdef __cplusplus
+            (*phase) /= std::abs((*phase));
+#else
+            //(*phase) /= cabsf((*phase));
+            (*phase) /= hypotf(lv_creal(*phase), lv_cimag(*phase));
+#endif
+        }
+
+    for (j = 0; j < num_points % ROTATOR_RELOAD; j++)
+        {
+            tmp32_1 = *in_common++ * (*phase);
+            (*phase) *= phase_inc;
+            for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+                {
+                    tmp32_2 = tmp32_1 * in_a[n_vec][(num_points / ROTATOR_RELOAD) * ROTATOR_RELOAD + j];
+                    result[n_vec] += tmp32_2;
+                }
+        }
+}
+
+#endif /*LV_HAVE_GENERIC*/
+
+#ifdef LV_HAVE_AVX
+#include <immintrin.h>
+#include <volk_gnsssdr/volk_gnsssdr_avx_intrinsics.h>
+static inline void volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_u_avx(lv_32fc_t* result, const lv_32fc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const float** in_a, int num_a_vectors, unsigned int num_points)
+{
+    unsigned int number = 0;
+    unsigned int vec_ind = 0;
+    unsigned int i = 0;
+    const unsigned int sixteenthPoints = num_points / 16;
+
+    const float* aPtr = (float*)in_common;
+    const float* bPtr[ num_a_vectors];
+    for( vec_ind = 0; vec_ind < num_a_vectors; ++vec_ind ){
+        bPtr[vec_ind] = in_a[vec_ind];
+    }
+
+    lv_32fc_t _phase = (*phase);
+    lv_32fc_t wo;
+
+    __m256 a0Val, a1Val, a2Val, a3Val;
+    __m256 b0Val[num_a_vectors], b1Val[num_a_vectors], b2Val[num_a_vectors], b3Val[num_a_vectors];
+    __m256 x0Val[num_a_vectors], x1Val[num_a_vectors], x0loVal[num_a_vectors], x0hiVal[num_a_vectors], x1loVal[num_a_vectors], x1hiVal[num_a_vectors];
+    __m256 c0Val[num_a_vectors], c1Val[num_a_vectors], c2Val[num_a_vectors], c3Val[num_a_vectors];
+
+    __m256 dotProdVal0[num_a_vectors];
+    __m256 dotProdVal1[num_a_vectors];
+    __m256 dotProdVal2[num_a_vectors];
+    __m256 dotProdVal3[num_a_vectors];
+
+    for( vec_ind = 0; vec_ind < num_a_vectors; vec_ind++ ){
+        dotProdVal0[vec_ind] = _mm256_setzero_ps();
+        dotProdVal1[vec_ind] = _mm256_setzero_ps();
+        dotProdVal2[vec_ind] = _mm256_setzero_ps();
+        dotProdVal3[vec_ind] = _mm256_setzero_ps();
+    }
+
+    // Set up the complex rotator
+    __m256 z0, z1, z2, z3;
+    __attribute__((aligned(32))) lv_32fc_t phase_vec[16];
+    for( vec_ind = 0; vec_ind < 16; ++vec_ind ){
+        phase_vec[vec_ind] = _phase;
+        _phase *= phase_inc;
+    }
+
+    z0 = _mm256_load_ps( (float *)phase_vec );
+    z1 = _mm256_load_ps( (float *)(phase_vec + 4) );
+    z2 = _mm256_load_ps( (float *)(phase_vec + 8) );
+    z3 = _mm256_load_ps( (float *)(phase_vec + 12) );
+
+    lv_32fc_t dz = phase_inc; dz *= dz; dz *= dz; dz *= dz; dz *= dz; // dz = phase_inc^16;
+
+    for( vec_ind = 0; vec_ind < 4; ++vec_ind ){
+        phase_vec[vec_ind] = dz;
+    }
+
+    __m256 dz_reg = _mm256_load_ps( (float *)phase_vec );
+    dz_reg = _mm256_complexnormalise_ps( dz_reg );
+
+    for(;number < sixteenthPoints; number++){
+
+        a0Val = _mm256_loadu_ps(aPtr);
+        a1Val = _mm256_loadu_ps(aPtr+8);
+        a2Val = _mm256_loadu_ps(aPtr+16);
+        a3Val = _mm256_loadu_ps(aPtr+24);
+
+        a0Val = _mm256_complexmul_ps( a0Val, z0 );
+        a1Val = _mm256_complexmul_ps( a1Val, z1 );
+        a2Val = _mm256_complexmul_ps( a2Val, z2 );
+        a3Val = _mm256_complexmul_ps( a3Val, z3 );
+
+        z0 = _mm256_complexmul_ps( z0, dz_reg );
+        z1 = _mm256_complexmul_ps( z1, dz_reg );
+        z2 = _mm256_complexmul_ps( z2, dz_reg );
+        z3 = _mm256_complexmul_ps( z3, dz_reg );
+
+
+        for( vec_ind = 0; vec_ind < num_a_vectors; ++vec_ind ){
+            x0Val[vec_ind] = _mm256_loadu_ps(bPtr[vec_ind]); // t0|t1|t2|t3|t4|t5|t6|t7
+            x1Val[vec_ind] = _mm256_loadu_ps(bPtr[vec_ind]+8);
+            x0loVal[vec_ind] = _mm256_unpacklo_ps(x0Val[vec_ind], x0Val[vec_ind]); // t0|t0|t1|t1|t4|t4|t5|t5
+            x0hiVal[vec_ind] = _mm256_unpackhi_ps(x0Val[vec_ind], x0Val[vec_ind]); // t2|t2|t3|t3|t6|t6|t7|t7
+            x1loVal[vec_ind] = _mm256_unpacklo_ps(x1Val[vec_ind], x1Val[vec_ind]);
+            x1hiVal[vec_ind] = _mm256_unpackhi_ps(x1Val[vec_ind], x1Val[vec_ind]);
+
+            // TODO: it may be possible to rearrange swizzling to better pipeline data
+            b0Val[vec_ind] = _mm256_permute2f128_ps(x0loVal[vec_ind], x0hiVal[vec_ind], 0x20); // t0|t0|t1|t1|t2|t2|t3|t3
+            b1Val[vec_ind] = _mm256_permute2f128_ps(x0loVal[vec_ind], x0hiVal[vec_ind], 0x31); // t4|t4|t5|t5|t6|t6|t7|t7
+            b2Val[vec_ind] = _mm256_permute2f128_ps(x1loVal[vec_ind], x1hiVal[vec_ind], 0x20);
+            b3Val[vec_ind] = _mm256_permute2f128_ps(x1loVal[vec_ind], x1hiVal[vec_ind], 0x31);
+
+            c0Val[vec_ind] = _mm256_mul_ps(a0Val, b0Val[vec_ind]);
+            c1Val[vec_ind] = _mm256_mul_ps(a1Val, b1Val[vec_ind]);
+            c2Val[vec_ind] = _mm256_mul_ps(a2Val, b2Val[vec_ind]);
+            c3Val[vec_ind] = _mm256_mul_ps(a3Val, b3Val[vec_ind]);
+
+            dotProdVal0[vec_ind] = _mm256_add_ps(c0Val[vec_ind], dotProdVal0[vec_ind]);
+            dotProdVal1[vec_ind] = _mm256_add_ps(c1Val[vec_ind], dotProdVal1[vec_ind]);
+            dotProdVal2[vec_ind] = _mm256_add_ps(c2Val[vec_ind], dotProdVal2[vec_ind]);
+            dotProdVal3[vec_ind] = _mm256_add_ps(c3Val[vec_ind], dotProdVal3[vec_ind]);
+
+            bPtr[vec_ind] += 16;
+        }
+
+        // Force the rotators back onto the unit circle
+        if ((number % 64) == 0)
+        {
+            z0 = _mm256_complexnormalise_ps( z0 );
+            z1 = _mm256_complexnormalise_ps( z1 );
+            z2 = _mm256_complexnormalise_ps( z2 );
+            z3 = _mm256_complexnormalise_ps( z3 );
+        }
+
+        aPtr += 32;
+    }
+    __VOLK_ATTR_ALIGNED(32) lv_32fc_t dotProductVector[4];
+
+    for( vec_ind = 0; vec_ind < num_a_vectors; ++vec_ind ){
+        dotProdVal0[vec_ind] = _mm256_add_ps(dotProdVal0[vec_ind], dotProdVal1[vec_ind]);
+        dotProdVal0[vec_ind] = _mm256_add_ps(dotProdVal0[vec_ind], dotProdVal2[vec_ind]);
+        dotProdVal0[vec_ind] = _mm256_add_ps(dotProdVal0[vec_ind], dotProdVal3[vec_ind]);
+
+        _mm256_store_ps((float *)dotProductVector,dotProdVal0[vec_ind]); // Store the results back into the dot product vector
+
+        result[ vec_ind ] = lv_cmake( 0, 0 );
+        for( i = 0; i < 4; ++i ){
+            result[vec_ind] += dotProductVector[i];
+        }
+    }
+
+    z0 = _mm256_complexnormalise_ps( z0 );
+    _mm256_store_ps((float*)phase_vec, z0);
+    _phase  = phase_vec[0];
+    _mm256_zeroupper();
+
+
+    number = sixteenthPoints*16;
+    for(;number < num_points; number++){
+        wo = (*aPtr++)*_phase;
+        _phase *= phase_inc;
+
+        for( vec_ind = 0; vec_ind < num_a_vectors; ++vec_ind ){
+            result[vec_ind] += wo * in_a[vec_ind][number];
+        }
+    }
+
+    *phase = _phase;
+
+}
+
+#endif /* LV_HAVE_AVX */
+
+#endif /* INCLUDED_volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_H */
+
+
diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc.h
new file mode 100644
index 000000000..a0284f65d
--- /dev/null
+++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc.h
@@ -0,0 +1,132 @@
+/*!
+ * \file volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc.h
+ * \brief Volk puppet for the multiple 16-bit complex dot product kernel.
+ * \authors <ul>
+ *          <li> Carles Fernandez Prades 2016 cfernandez at cttc dot cat
+ *          </ul>
+ *
+ * Volk puppet for integrating the resampler into volk's test system
+ *
+ * -------------------------------------------------------------------------
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ *
+ * -------------------------------------------------------------------------
+ */
+
+#ifndef INCLUDED_volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc_H
+#define INCLUDED_volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc_H
+
+#include "volk_gnsssdr/volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn.h"
+#include <volk_gnsssdr/volk_gnsssdr_malloc.h>
+#include <volk_gnsssdr/volk_gnsssdr.h>
+#include <string.h>
+
+#ifdef LV_HAVE_GENERIC
+
+static inline void volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc_generic(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));
+    unsigned 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(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_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));
+    unsigned 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));
+    unsigned 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
+
+#endif  // INCLUDED_volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc_H
+
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 c4aeea1a2..b04a93c4b 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
@@ -164,6 +164,58 @@ static inline void volk_gnsssdr_32fc_convert_16ic_u_sse(lv_16sc_t* outputVector,
 }
 #endif /* LV_HAVE_SSE */
 
+#ifdef LV_HAVE_AVX2
+#include <immintrin.h>
+
+static inline void volk_gnsssdr_32fc_convert_16ic_u_avx2(lv_16sc_t* outputVector, const lv_32fc_t* inputVector, unsigned int num_points)
+{
+    const unsigned int avx2_iters = num_points / 8;
+
+    float* inputVectorPtr = (float*)inputVector;
+    int16_t* outputVectorPtr = (int16_t*)outputVector;
+    float aux;
+    unsigned int i;
+    const float min_val = (float)SHRT_MIN; ///todo Something off here, compiler does not perform right cast
+    const float max_val = (float)SHRT_MAX;
+
+    __m256 inputVal1, inputVal2;
+    __m256i intInputVal1, intInputVal2;
+    __m256 ret1, ret2;
+    const __m256 vmin_val = _mm256_set1_ps(min_val);
+    const __m256 vmax_val = _mm256_set1_ps(max_val);
+
+    for(i = 0; i < avx2_iters; i++)
+        {
+            inputVal1 = _mm256_loadu_ps((float*)inputVectorPtr); inputVectorPtr += 8;
+            inputVal2 = _mm256_loadu_ps((float*)inputVectorPtr); inputVectorPtr += 8;
+            __VOLK_GNSSSDR_PREFETCH(inputVectorPtr + 16);
+
+            // Clip
+            ret1 = _mm256_max_ps(_mm256_min_ps(inputVal1, vmax_val), vmin_val);
+            ret2 = _mm256_max_ps(_mm256_min_ps(inputVal2, vmax_val), vmin_val);
+
+            intInputVal1 = _mm256_cvtps_epi32(ret1);
+            intInputVal2 = _mm256_cvtps_epi32(ret2);
+
+            intInputVal1 = _mm256_packs_epi32(intInputVal1, intInputVal2);
+            intInputVal1 = _mm256_permute4x64_epi64(intInputVal1, 0b11011000);
+
+            _mm256_storeu_si256((__m256i*)outputVectorPtr, intInputVal1);
+            outputVectorPtr += 16;
+        }
+
+    for(i = avx2_iters * 16; i < num_points * 2; i++)
+        {
+            aux = *inputVectorPtr++;
+            if(aux > max_val)
+                aux = max_val;
+            else if(aux < min_val)
+                aux = min_val;
+            *outputVectorPtr++ = (int16_t)rintf(aux);
+        }
+}
+#endif /* LV_HAVE_AVX2 */
+
 
 #ifdef LV_HAVE_SSE2
 #include <emmintrin.h>
@@ -269,6 +321,59 @@ static inline void volk_gnsssdr_32fc_convert_16ic_a_sse(lv_16sc_t* outputVector,
 #endif /* LV_HAVE_SSE */
 
 
+#ifdef LV_HAVE_AVX2
+#include <immintrin.h>
+
+static inline void volk_gnsssdr_32fc_convert_16ic_a_avx2(lv_16sc_t* outputVector, const lv_32fc_t* inputVector, unsigned int num_points)
+{
+    const unsigned int avx2_iters = num_points / 8;
+
+    float* inputVectorPtr = (float*)inputVector;
+    int16_t* outputVectorPtr = (int16_t*)outputVector;
+    float aux;
+    unsigned int i;
+    const float min_val = (float)SHRT_MIN; ///todo Something off here, compiler does not perform right cast
+    const float max_val = (float)SHRT_MAX;
+
+    __m256 inputVal1, inputVal2;
+    __m256i intInputVal1, intInputVal2;
+    __m256 ret1, ret2;
+    const __m256 vmin_val = _mm256_set1_ps(min_val);
+    const __m256 vmax_val = _mm256_set1_ps(max_val);
+
+    for(i = 0; i < avx2_iters; i++)
+        {
+            inputVal1 = _mm256_load_ps((float*)inputVectorPtr); inputVectorPtr += 8;
+            inputVal2 = _mm256_load_ps((float*)inputVectorPtr); inputVectorPtr += 8;
+            __VOLK_GNSSSDR_PREFETCH(inputVectorPtr + 16);
+
+            // Clip
+            ret1 = _mm256_max_ps(_mm256_min_ps(inputVal1, vmax_val), vmin_val);
+            ret2 = _mm256_max_ps(_mm256_min_ps(inputVal2, vmax_val), vmin_val);
+
+            intInputVal1 = _mm256_cvtps_epi32(ret1);
+            intInputVal2 = _mm256_cvtps_epi32(ret2);
+
+            intInputVal1 = _mm256_packs_epi32(intInputVal1, intInputVal2);
+            intInputVal1 = _mm256_permute4x64_epi64(intInputVal1, 0b11011000);
+
+            _mm256_store_si256((__m256i*)outputVectorPtr, intInputVal1);
+            outputVectorPtr += 16;
+        }
+
+    for(i = avx2_iters * 16; i < num_points * 2; i++)
+        {
+            aux = *inputVectorPtr++;
+            if(aux > max_val)
+                aux = max_val;
+            else if(aux < min_val)
+                aux = min_val;
+            *outputVectorPtr++ = (int16_t)rintf(aux);
+        }
+}
+#endif /* LV_HAVE_AVX2 */
+
+
 #ifdef LV_HAVE_NEON
 #include <arm_neon.h>
 
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 b04b1072f..ca5f13f22 100755
--- 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
@@ -85,6 +85,146 @@ static inline void volk_gnsssdr_32fc_convert_8ic_generic(lv_8sc_t* outputVector,
 #endif /* LV_HAVE_GENERIC */
 
 
+#ifdef LV_HAVE_AVX2
+#include <immintrin.h>
+
+static inline void volk_gnsssdr_32fc_convert_8ic_u_avx2(lv_8sc_t* outputVector, const lv_32fc_t* inputVector, unsigned int num_points)
+{
+    const unsigned int avx2_iters = num_points / 16;
+
+    float* inputVectorPtr = (float*)inputVector;
+    int8_t* outputVectorPtr = (int8_t*)outputVector;
+
+    const float min_val = (float)SCHAR_MIN;
+    const float max_val = (float)SCHAR_MAX;
+    float aux;
+    unsigned int i;
+
+    __m256 inputVal1, inputVal2, inputVal3, inputVal4;
+    __m256i intInputVal1, intInputVal2, intInputVal3, intInputVal4;
+    __m256i int8InputVal;
+    __m256 ret1, ret2, ret3, ret4;
+    const __m256 vmin_val = _mm256_set1_ps(min_val);
+    const __m256 vmax_val = _mm256_set1_ps(max_val);
+
+    for(i = 0; i < avx2_iters; i++)
+        {
+            inputVal1 = _mm256_loadu_ps((float*)inputVectorPtr); inputVectorPtr += 8;
+            inputVal2 = _mm256_loadu_ps((float*)inputVectorPtr); inputVectorPtr += 8;
+            inputVal3 = _mm256_loadu_ps((float*)inputVectorPtr); inputVectorPtr += 8;
+            inputVal4 = _mm256_loadu_ps((float*)inputVectorPtr); inputVectorPtr += 8;
+            __VOLK_GNSSSDR_PREFETCH(inputVectorPtr + 32);
+
+            inputVal1 = _mm256_mul_ps(inputVal1, vmax_val);
+            inputVal2 = _mm256_mul_ps(inputVal2, vmax_val);
+            inputVal3 = _mm256_mul_ps(inputVal3, vmax_val);
+            inputVal4 = _mm256_mul_ps(inputVal4, vmax_val);
+
+            // Clip
+            ret1 = _mm256_max_ps(_mm256_min_ps(inputVal1, vmax_val), vmin_val);
+            ret2 = _mm256_max_ps(_mm256_min_ps(inputVal2, vmax_val), vmin_val);
+            ret3 = _mm256_max_ps(_mm256_min_ps(inputVal3, vmax_val), vmin_val);
+            ret4 = _mm256_max_ps(_mm256_min_ps(inputVal4, vmax_val), vmin_val);
+
+            intInputVal1 = _mm256_cvtps_epi32(ret1);
+            intInputVal2 = _mm256_cvtps_epi32(ret2);
+            intInputVal3 = _mm256_cvtps_epi32(ret3);
+            intInputVal4 = _mm256_cvtps_epi32(ret4);
+
+            intInputVal1 = _mm256_packs_epi32(intInputVal1, intInputVal2);
+            intInputVal1 = _mm256_permute4x64_epi64(intInputVal1, 0b11011000);
+            intInputVal2 = _mm256_packs_epi32(intInputVal3, intInputVal4);
+            intInputVal2 = _mm256_permute4x64_epi64(intInputVal2, 0b11011000);
+            int8InputVal = _mm256_packs_epi16(intInputVal1, intInputVal2);
+            int8InputVal = _mm256_permute4x64_epi64(int8InputVal, 0b11011000);
+
+            _mm256_storeu_si256((__m256i*)outputVectorPtr, int8InputVal);
+            outputVectorPtr += 32;
+        }
+
+    for(i = avx2_iters * 32; i < num_points * 2; i++)
+        {
+            aux = *inputVectorPtr++ * max_val;
+            if(aux > max_val)
+                aux = max_val;
+            else if(aux < min_val)
+                aux = min_val;
+            *outputVectorPtr++ = (int8_t)rintf(aux);
+        }
+}
+#endif /* LV_HAVE_AVX2 */
+
+
+#ifdef LV_HAVE_AVX2
+#include <immintrin.h>
+
+static inline void volk_gnsssdr_32fc_convert_8ic_a_avx2(lv_8sc_t* outputVector, const lv_32fc_t* inputVector, unsigned int num_points)
+{
+    const unsigned int avx2_iters = num_points / 16;
+
+    float* inputVectorPtr = (float*)inputVector;
+    int8_t* outputVectorPtr = (int8_t*)outputVector;
+
+    const float min_val = (float)SCHAR_MIN;
+    const float max_val = (float)SCHAR_MAX;
+    float aux;
+    unsigned int i;
+
+    __m256 inputVal1, inputVal2, inputVal3, inputVal4;
+    __m256i intInputVal1, intInputVal2, intInputVal3, intInputVal4;
+    __m256i int8InputVal;
+    __m256 ret1, ret2, ret3, ret4;
+    const __m256 vmin_val = _mm256_set1_ps(min_val);
+    const __m256 vmax_val = _mm256_set1_ps(max_val);
+
+    for(i = 0; i < avx2_iters; i++)
+        {
+            inputVal1 = _mm256_load_ps((float*)inputVectorPtr); inputVectorPtr += 8;
+            inputVal2 = _mm256_load_ps((float*)inputVectorPtr); inputVectorPtr += 8;
+            inputVal3 = _mm256_load_ps((float*)inputVectorPtr); inputVectorPtr += 8;
+            inputVal4 = _mm256_load_ps((float*)inputVectorPtr); inputVectorPtr += 8;
+            __VOLK_GNSSSDR_PREFETCH(inputVectorPtr + 32);
+
+            inputVal1 = _mm256_mul_ps(inputVal1, vmax_val);
+            inputVal2 = _mm256_mul_ps(inputVal2, vmax_val);
+            inputVal3 = _mm256_mul_ps(inputVal3, vmax_val);
+            inputVal4 = _mm256_mul_ps(inputVal4, vmax_val);
+
+            // Clip
+            ret1 = _mm256_max_ps(_mm256_min_ps(inputVal1, vmax_val), vmin_val);
+            ret2 = _mm256_max_ps(_mm256_min_ps(inputVal2, vmax_val), vmin_val);
+            ret3 = _mm256_max_ps(_mm256_min_ps(inputVal3, vmax_val), vmin_val);
+            ret4 = _mm256_max_ps(_mm256_min_ps(inputVal4, vmax_val), vmin_val);
+
+            intInputVal1 = _mm256_cvtps_epi32(ret1);
+            intInputVal2 = _mm256_cvtps_epi32(ret2);
+            intInputVal3 = _mm256_cvtps_epi32(ret3);
+            intInputVal4 = _mm256_cvtps_epi32(ret4);
+
+            intInputVal1 = _mm256_packs_epi32(intInputVal1, intInputVal2);
+            intInputVal1 = _mm256_permute4x64_epi64(intInputVal1, 0b11011000);
+            intInputVal2 = _mm256_packs_epi32(intInputVal3, intInputVal4);
+            intInputVal2 = _mm256_permute4x64_epi64(intInputVal2, 0b11011000);
+            int8InputVal = _mm256_packs_epi16(intInputVal1, intInputVal2);
+            int8InputVal = _mm256_permute4x64_epi64(int8InputVal, 0b11011000);
+
+            _mm256_store_si256((__m256i*)outputVectorPtr, int8InputVal);
+            outputVectorPtr += 32;
+        }
+
+    for(i = avx2_iters * 32; i < num_points * 2; i++)
+        {
+            aux = *inputVectorPtr++ * max_val;
+            if(aux > max_val)
+                aux = max_val;
+            else if(aux < min_val)
+                aux = min_val;
+            *outputVectorPtr++ = (int8_t)rintf(aux);
+        }
+}
+#endif /* LV_HAVE_AVX2 */
+
+
 #ifdef LV_HAVE_SSE2
 #include <emmintrin.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 c109a1be3..9348c09fc 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
@@ -46,8 +46,8 @@
 #ifdef LV_HAVE_GENERIC
 static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_generic(lv_32fc_t* result, const lv_32fc_t* local_code, unsigned int num_points)
 {
-    float code_phase_step_chips = -0.6;
-    int code_length_chips = 1023;
+    int code_length_chips = 2046;
+    float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points );
     int num_out_vectors = 3;
     float rem_code_phase_chips = -0.234;
     unsigned int n;
@@ -70,14 +70,15 @@ static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_generic(lv_32fc_t* r
     volk_gnsssdr_free(result_aux);
 }
 
+
 #endif /* LV_HAVE_GENERIC */
- 
+
 
 #ifdef LV_HAVE_SSE3
 static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_a_sse3(lv_32fc_t* result, const lv_32fc_t* local_code, unsigned int num_points)
 {
-    float code_phase_step_chips = -0.6;
-    int code_length_chips = 1023;
+    int code_length_chips = 2046;
+    float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points );
     int num_out_vectors = 3;
     float rem_code_phase_chips = -0.234;
     unsigned int n;
@@ -105,8 +106,8 @@ static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_a_sse3(lv_32fc_t* re
 #ifdef LV_HAVE_SSE3
 static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_u_sse3(lv_32fc_t* result, const lv_32fc_t* local_code, unsigned int num_points)
 {
-    float code_phase_step_chips = -0.6;
-    int code_length_chips = 1023;
+    int code_length_chips = 2046;
+    float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points );
     int num_out_vectors = 3;
     float rem_code_phase_chips = -0.234;
     unsigned int n;
@@ -135,8 +136,8 @@ static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_u_sse3(lv_32fc_t* re
 #ifdef LV_HAVE_SSE4_1
 static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_u_sse4_1(lv_32fc_t* result, const lv_32fc_t* local_code, unsigned int num_points)
 {
-    float code_phase_step_chips = -0.6;
-    int code_length_chips = 1023;
+    int code_length_chips = 2046;
+    float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points );
     int num_out_vectors = 3;
     float rem_code_phase_chips = -0.234;
     unsigned int n;
@@ -164,8 +165,8 @@ static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_u_sse4_1(lv_32fc_t*
 #ifdef LV_HAVE_SSE4_1
 static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_a_sse4_1(lv_32fc_t* result, const lv_32fc_t* local_code, unsigned int num_points)
 {
-    float code_phase_step_chips = -0.6;
-    int code_length_chips = 1023;
+    int code_length_chips = 2046;
+    float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points );
     int num_out_vectors = 3;
     float rem_code_phase_chips = -0.234;
     unsigned int n;
@@ -193,8 +194,8 @@ static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_a_sse4_1(lv_32fc_t*
 #ifdef LV_HAVE_AVX
 static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_a_avx(lv_32fc_t* result, const lv_32fc_t* local_code, unsigned int num_points)
 {
-    float code_phase_step_chips = -0.6;
-    int code_length_chips = 1023;
+    int code_length_chips = 2046;
+    float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points );
     int num_out_vectors = 3;
     float rem_code_phase_chips = -0.234;
     unsigned int n;
@@ -222,8 +223,8 @@ static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_a_avx(lv_32fc_t* res
 #ifdef LV_HAVE_AVX
 static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_u_avx(lv_32fc_t* result, const lv_32fc_t* local_code, unsigned int num_points)
 {
-    float code_phase_step_chips = -0.6;
-    int code_length_chips = 1023;
+    int code_length_chips = 2046;
+    float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points );
     int num_out_vectors = 3;
     float rem_code_phase_chips = -0.234;
     unsigned int n;
@@ -248,11 +249,69 @@ static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_u_avx(lv_32fc_t* res
 #endif
 
 
+#ifdef LV_HAVE_AVX2
+static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_a_avx2(lv_32fc_t* result, const lv_32fc_t* local_code, unsigned int num_points)
+{
+    int code_length_chips = 2046;
+    float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points );
+    int num_out_vectors = 3;
+    float rem_code_phase_chips = -0.234;
+    unsigned int n;
+    float shifts_chips[3] = { -0.1, 0.0, 0.1 };
+
+    lv_32fc_t** result_aux =  (lv_32fc_t**)volk_gnsssdr_malloc(sizeof(lv_32fc_t*) * num_out_vectors, volk_gnsssdr_get_alignment());
+    for(n = 0; n < num_out_vectors; n++)
+    {
+       result_aux[n] = (lv_32fc_t*)volk_gnsssdr_malloc(sizeof(lv_32fc_t) * num_points, volk_gnsssdr_get_alignment());
+    }
+
+    volk_gnsssdr_32fc_xn_resampler_32fc_xn_a_avx2(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points);
+
+    memcpy((lv_32fc_t*)result, (lv_32fc_t*)result_aux[0], sizeof(lv_32fc_t) * num_points);
+
+    for(n = 0; n < num_out_vectors; n++)
+    {
+        volk_gnsssdr_free(result_aux[n]);
+    }
+    volk_gnsssdr_free(result_aux);
+}
+#endif
+
+
+#ifdef LV_HAVE_AVX2
+static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_u_avx2(lv_32fc_t* result, const lv_32fc_t* local_code, unsigned int num_points)
+{
+    int code_length_chips = 2046;
+    float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points );
+    int num_out_vectors = 3;
+    float rem_code_phase_chips = -0.234;
+    unsigned int n;
+    float shifts_chips[3] = { -0.1, 0.0, 0.1 };
+
+    lv_32fc_t** result_aux =  (lv_32fc_t**)volk_gnsssdr_malloc(sizeof(lv_32fc_t*) * num_out_vectors, volk_gnsssdr_get_alignment());
+    for(n = 0; n < num_out_vectors; n++)
+    {
+       result_aux[n] = (lv_32fc_t*)volk_gnsssdr_malloc(sizeof(lv_32fc_t) * num_points, volk_gnsssdr_get_alignment());
+    }
+
+    volk_gnsssdr_32fc_xn_resampler_32fc_xn_u_avx2(result_aux, local_code, rem_code_phase_chips, code_phase_step_chips, shifts_chips, code_length_chips, num_out_vectors, num_points);
+
+    memcpy((lv_32fc_t*)result, (lv_32fc_t*)result_aux[0], sizeof(lv_32fc_t) * num_points);
+
+    for(n = 0; n < num_out_vectors; n++)
+    {
+        volk_gnsssdr_free(result_aux[n]);
+    }
+    volk_gnsssdr_free(result_aux);
+}
+#endif
+
+
 #ifdef LV_HAVE_NEON
 static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_neon(lv_32fc_t* result, const lv_32fc_t* local_code, unsigned int num_points)
 {
-    float code_phase_step_chips = -0.6;
-    int code_length_chips = 1023;
+    int code_length_chips = 2046;
+    float code_phase_step_chips = ((float)(code_length_chips) + 0.1 )/( (float) num_points );
     int num_out_vectors = 3;
     float rem_code_phase_chips = -0.234;
     unsigned int n;
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 13c9d1986..a25715749 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
@@ -74,7 +74,7 @@
 #include <volk_gnsssdr/volk_gnsssdr_complex.h>
 #include <volk_gnsssdr/saturation_arithmetic.h>
 #include <math.h>
-#include <stdio.h>
+
 
 #ifdef LV_HAVE_GENERIC
 
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 9149a0bb9..f8db65944 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
@@ -160,7 +160,7 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_a_sse3(lv_32fc_t** res
         }
 }
 
-#endif 
+#endif
 
 
 #ifdef LV_HAVE_SSE3
@@ -295,7 +295,7 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_a_sse4_1(lv_32fc_t** r
         }
 }
 
-#endif 
+#endif
 
 
 #ifdef LV_HAVE_SSE4_1
@@ -518,6 +518,162 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_u_avx(lv_32fc_t** resu
 #endif
 
 
+#ifdef LV_HAVE_AVX2
+#include <immintrin.h>
+static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_u_avx2(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)
+{
+    lv_32fc_t** _result = result;
+    const unsigned int avx_iters = num_points / 8;
+    int current_correlator_tap;
+    unsigned int n;
+    unsigned int k;
+    const __m256 eights = _mm256_set1_ps(8.0f);
+    const __m256 rem_code_phase_chips_reg = _mm256_set1_ps(rem_code_phase_chips);
+    const __m256 code_phase_step_chips_reg = _mm256_set1_ps(code_phase_step_chips);
+
+    __VOLK_ATTR_ALIGNED(32) int local_code_chip_index[8];
+    int local_code_chip_index_;
+
+    const __m256 zeros = _mm256_setzero_ps();
+    const __m256 code_length_chips_reg_f = _mm256_set1_ps((float)code_length_chips);
+    const __m256 n0 = _mm256_set_ps(7.0f, 6.0f, 5.0f, 4.0f, 3.0f, 2.0f, 1.0f, 0.0f);
+
+    __m256i local_code_chip_index_reg, i;
+    __m256 aux, aux2, aux3, shifts_chips_reg, c, cTrunc, base, negatives, indexn;
+
+    for (current_correlator_tap = 0; current_correlator_tap < num_out_vectors; current_correlator_tap++)
+        {
+            shifts_chips_reg = _mm256_set1_ps((float)shifts_chips[current_correlator_tap]);
+            aux2 = _mm256_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg);
+            indexn = n0;
+            for(n = 0; n < avx_iters; n++)
+                {
+                    __VOLK_GNSSSDR_PREFETCH_LOCALITY(&_result[current_correlator_tap][8 * n + 7], 1, 0);
+                    __VOLK_GNSSSDR_PREFETCH_LOCALITY(&local_code_chip_index[8], 1, 3);
+                    aux = _mm256_fmadd_ps(code_phase_step_chips_reg, indexn, aux2);
+                    //aux = _mm256_add_ps(aux, aux2);
+                    // floor
+                    aux = _mm256_floor_ps(aux);
+
+                    // fmod
+                    c = _mm256_div_ps(aux, code_length_chips_reg_f);
+                    //_mm_fmsub_ps(c, code_length_chips_reg_f, aux)
+                    i = _mm256_cvttps_epi32(c);
+                    cTrunc = _mm256_cvtepi32_ps(i);
+                    base = _mm256_fnmadd_ps(cTrunc, code_length_chips_reg_f, aux);
+                    local_code_chip_index_reg = _mm256_cvttps_epi32(base);
+
+                    // no negatives
+                    c = _mm256_cvtepi32_ps(local_code_chip_index_reg);
+                    negatives = _mm256_cmp_ps(c, zeros, 0x01 );
+                    aux3 = _mm256_and_ps(code_length_chips_reg_f, negatives);
+                    aux = _mm256_add_ps(c, aux3);
+                    local_code_chip_index_reg = _mm256_cvttps_epi32(aux);
+
+                    _mm256_store_si256((__m256i*)local_code_chip_index, local_code_chip_index_reg);
+                    for(k = 0; k < 8; ++k)
+                        {
+                            _result[current_correlator_tap][n * 8 + k] = local_code[local_code_chip_index[k]];
+                        }
+                    indexn = _mm256_add_ps(indexn, eights);
+                }
+        }
+    _mm256_zeroupper();
+    for (current_correlator_tap = 0; current_correlator_tap < num_out_vectors; current_correlator_tap++)
+        {
+            for(n = avx_iters * 8; n < num_points; n++)
+                {
+                    // resample code for current tap
+                    local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips);
+                    //Take into account that in multitap correlators, the shifts can be negative!
+                    if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1) ;
+                    local_code_chip_index_ = local_code_chip_index_ % code_length_chips;
+                    _result[current_correlator_tap][n] = local_code[local_code_chip_index_];
+                }
+        }
+}
+
+#endif
+
+
+#ifdef LV_HAVE_AVX2
+#include <immintrin.h>
+static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_a_avx2(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)
+{
+    lv_32fc_t** _result = result;
+    const unsigned int avx_iters = num_points / 8;
+    int current_correlator_tap;
+    unsigned int n;
+    unsigned int k;
+    const __m256 eights = _mm256_set1_ps(8.0f);
+    const __m256 rem_code_phase_chips_reg = _mm256_set1_ps(rem_code_phase_chips);
+    const __m256 code_phase_step_chips_reg = _mm256_set1_ps(code_phase_step_chips);
+
+    __VOLK_ATTR_ALIGNED(32) int local_code_chip_index[8];
+    int local_code_chip_index_;
+
+    const __m256 zeros = _mm256_setzero_ps();
+    const __m256 code_length_chips_reg_f = _mm256_set1_ps((float)code_length_chips);
+    const __m256 n0 = _mm256_set_ps(7.0f, 6.0f, 5.0f, 4.0f, 3.0f, 2.0f, 1.0f, 0.0f);
+
+    __m256i local_code_chip_index_reg, i;
+    __m256 aux, aux2, aux3, shifts_chips_reg, c, cTrunc, base, negatives, indexn;
+
+    for (current_correlator_tap = 0; current_correlator_tap < num_out_vectors; current_correlator_tap++)
+        {
+            shifts_chips_reg = _mm256_set1_ps((float)shifts_chips[current_correlator_tap]);
+            aux2 = _mm256_sub_ps(shifts_chips_reg, rem_code_phase_chips_reg);
+            indexn = n0;
+            for(n = 0; n < avx_iters; n++)
+                {
+                    __VOLK_GNSSSDR_PREFETCH_LOCALITY(&_result[current_correlator_tap][8 * n + 7], 1, 0);
+                    __VOLK_GNSSSDR_PREFETCH_LOCALITY(&local_code_chip_index[8], 1, 3);
+                    aux = _mm256_fmadd_ps(code_phase_step_chips_reg, indexn, aux2);
+                    //aux = _mm256_mul_ps(code_phase_step_chips_reg, indexn);
+                    //aux = _mm256_add_ps(aux, aux2);
+                    // floor
+                    aux = _mm256_floor_ps(aux);
+
+                    // fmod
+                    c = _mm256_div_ps(aux, code_length_chips_reg_f);
+                    i = _mm256_cvttps_epi32(c);
+                    cTrunc = _mm256_cvtepi32_ps(i);
+                    base = _mm256_fnmadd_ps(cTrunc, code_length_chips_reg_f, aux);
+                    local_code_chip_index_reg = _mm256_cvttps_epi32(base);
+
+                    // no negatives
+                    c = _mm256_cvtepi32_ps(local_code_chip_index_reg);
+                    negatives = _mm256_cmp_ps(c, zeros, 0x01 );
+                    aux3 = _mm256_and_ps(code_length_chips_reg_f, negatives);
+                    aux = _mm256_add_ps(c, aux3);
+                    local_code_chip_index_reg = _mm256_cvttps_epi32(aux);
+
+                    _mm256_store_si256((__m256i*)local_code_chip_index, local_code_chip_index_reg);
+                    for(k = 0; k < 8; ++k)
+                        {
+                            _result[current_correlator_tap][n * 8 + k] = local_code[local_code_chip_index[k]];
+                        }
+                    indexn = _mm256_add_ps(indexn, eights);
+                }
+        }
+    _mm256_zeroupper();
+    for (current_correlator_tap = 0; current_correlator_tap < num_out_vectors; current_correlator_tap++)
+        {
+            for(n = avx_iters * 8; n < num_points; n++)
+                {
+                    // resample code for current tap
+                    local_code_chip_index_ = (int)floor(code_phase_step_chips * (float)n + shifts_chips[current_correlator_tap] - rem_code_phase_chips);
+                    //Take into account that in multitap correlators, the shifts can be negative!
+                    if (local_code_chip_index_ < 0) local_code_chip_index_ += (int)code_length_chips * (abs(local_code_chip_index_) / code_length_chips + 1) ;
+                    local_code_chip_index_ = local_code_chip_index_ % code_length_chips;
+                    _result[current_correlator_tap][n] = local_code[local_code_chip_index_];
+                }
+        }
+}
+
+#endif
+
+
 #ifdef LV_HAVE_NEON
 #include <arm_neon.h>
 
@@ -604,4 +760,3 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_neon(lv_32fc_t** resul
 
 
 #endif /*INCLUDED_volk_gnsssdr_32fc_xn_resampler_32fc_xn_H*/
-
diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8i_accumulator_s8i.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8i_accumulator_s8i.h
index 99588fca5..8c2830cdc 100644
--- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8i_accumulator_s8i.h
+++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8i_accumulator_s8i.h
@@ -152,6 +152,83 @@ static inline void volk_gnsssdr_8i_accumulator_s8i_a_sse3(char* result, const ch
 #endif /* LV_HAVE_SSE3 */
 
 
+#ifdef LV_HAVE_AVX2
+#include <immintrin.h>
+
+static inline void volk_gnsssdr_8i_accumulator_s8i_a_avx2(char* result, const char* inputBuffer, unsigned int num_points)
+{
+    char returnValue = 0;
+    const unsigned int sse_iters = num_points / 32;
+    unsigned int number;
+    unsigned int i;
+
+    const char* aPtr = inputBuffer;
+
+    __VOLK_ATTR_ALIGNED(32) char tempBuffer[32];
+    __m256i accumulator = _mm256_setzero_si256();
+    __m256i aVal = _mm256_setzero_si256();
+
+    for(number = 0; number < sse_iters; number++)
+        {
+            aVal = _mm256_load_si256((__m256i*)aPtr);
+            accumulator = _mm256_add_epi8(accumulator, aVal);
+            aPtr += 32;
+        }
+    _mm256_store_si256((__m256i*)tempBuffer,accumulator);
+
+    for(i = 0; i < 32; ++i)
+        {
+            returnValue += tempBuffer[i];
+        }
+
+    for(i = 0; i < (num_points % 32); ++i)
+        {
+            returnValue += (*aPtr++);
+        }
+
+    *result = returnValue;
+}
+#endif /* LV_HAVE_SSE3 */
+
+
+#ifdef LV_HAVE_AVX2
+#include <pmmintrin.h>
+
+static inline void volk_gnsssdr_8i_accumulator_s8i_u_avx2(char* result, const char* inputBuffer, unsigned int num_points)
+{
+    char returnValue = 0;
+    const unsigned int sse_iters = num_points / 32;
+    unsigned int number;
+    unsigned int i;
+    const char* aPtr = inputBuffer;
+
+    __VOLK_ATTR_ALIGNED(32) char tempBuffer[32];
+    __m256i accumulator = _mm256_setzero_si256();
+    __m256i aVal = _mm256_setzero_si256();
+
+    for(number = 0; number < sse_iters; number++)
+        {
+            aVal = _mm256_lddqu_si256((__m256i*)aPtr);
+            accumulator = _mm256_add_epi8(accumulator, aVal);
+            aPtr += 32;
+        }
+    _mm256_storeu_si256((__m256i*)tempBuffer, accumulator);
+
+    for(i = 0; i < 32; ++i)
+        {
+            returnValue += tempBuffer[i];
+        }
+
+    for(i = 0; i < (num_points % 32); ++i)
+        {
+            returnValue += (*aPtr++);
+        }
+
+    *result = returnValue;
+}
+#endif /* LV_HAVE_SSE3 */
+
+
 #ifdef LV_HAVE_ORC
 
 extern void volk_gnsssdr_8i_accumulator_s8i_a_orc_impl(short* result, const char* inputBuffer, unsigned int num_points);
@@ -169,4 +246,3 @@ static inline void volk_gnsssdr_8i_accumulator_s8i_u_orc(char* result, const cha
 #endif /* LV_HAVE_ORC */
 
 #endif /* INCLUDED_volk_gnsssdr_8i_accumulator_s8i_H */
-
diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8i_index_max_16u.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8i_index_max_16u.h
index 75ad588d2..1f053f239 100644
--- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8i_index_max_16u.h
+++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8i_index_max_16u.h
@@ -58,6 +58,71 @@
 
 #include <volk_gnsssdr/volk_gnsssdr_common.h>
 
+
+#ifdef LV_HAVE_AVX2
+#include<immintrin.h>
+
+static inline void volk_gnsssdr_8i_index_max_16u_u_avx2(unsigned int* target, const char* src0, unsigned int num_points)
+{
+    if(num_points > 0)
+        {
+            const unsigned int avx2_iters = num_points / 32;
+            unsigned int number;
+            unsigned int i;
+            char* basePtr = (char*)src0;
+            char* inputPtr = (char*)src0;
+            char max = src0[0];
+            unsigned int index = 0;
+            unsigned int mask;
+            __VOLK_ATTR_ALIGNED(32) char currentValuesBuffer[32];
+            __m256i maxValues, compareResults, currentValues;
+
+            maxValues = _mm256_set1_epi8(max);
+
+            for(number = 0; number < avx2_iters; number++)
+                {
+                    currentValues  = _mm256_loadu_si256((__m256i*)inputPtr);
+                    compareResults = _mm256_cmpgt_epi8(maxValues, currentValues);
+                    mask = _mm256_movemask_epi8(compareResults);
+
+                    if (mask != 0xFFFFFFFF)
+                        {
+                            _mm256_storeu_si256((__m256i*)&currentValuesBuffer, currentValues);
+                            mask = ~mask;
+                            i = 0;
+                            while (mask > 0)
+                                {
+                                    if ((mask & 1) == 1)
+                                        {
+                                            if(currentValuesBuffer[i] > max)
+                                                {
+                                                    index = inputPtr - basePtr + i;
+                                                    max = currentValuesBuffer[i];
+                                                }
+                                        }
+                                    i++;
+                                    mask >>= 1;
+                                }
+                            maxValues = _mm256_set1_epi8(max);
+                        }
+                    inputPtr += 32;
+                }
+
+            for(i = 0; i<(num_points % 32); ++i)
+                {
+                    if(src0[i] > max)
+                        {
+                            index = i;
+                            max = src0[i];
+                        }
+                }
+            target[0] = index;
+        }
+}
+
+#endif /*LV_HAVE_AVX2*/
+
+
 #ifdef LV_HAVE_AVX
 #include <immintrin.h>
 
@@ -271,6 +336,70 @@ static inline void volk_gnsssdr_8i_index_max_16u_generic(unsigned int* target, c
 #endif /*LV_HAVE_GENERIC*/
 
 
+#ifdef LV_HAVE_AVX2
+#include<immintrin.h>
+
+static inline void volk_gnsssdr_8i_index_max_16u_a_avx2(unsigned int* target, const char* src0, unsigned int num_points)
+{
+    if(num_points > 0)
+        {
+            const unsigned int avx2_iters = num_points / 32;
+            unsigned int number;
+            unsigned int i;
+            char* basePtr = (char*)src0;
+            char* inputPtr = (char*)src0;
+            char max = src0[0];
+            unsigned int index = 0;
+            unsigned int mask;
+            __VOLK_ATTR_ALIGNED(32) char currentValuesBuffer[32];
+            __m256i maxValues, compareResults, currentValues;
+
+            maxValues = _mm256_set1_epi8(max);
+
+            for(number = 0; number < avx2_iters; number++)
+                {
+                    currentValues  = _mm256_load_si256((__m256i*)inputPtr);
+                    compareResults = _mm256_cmpgt_epi8(maxValues, currentValues);
+                    mask = _mm256_movemask_epi8(compareResults);
+
+                    if (mask != 0xFFFFFFFF)
+                        {
+                            _mm256_store_si256((__m256i*)&currentValuesBuffer, currentValues);
+                            mask = ~mask;
+                            i = 0;
+                            while (mask > 0)
+                                {
+                                    if ((mask & 1) == 1)
+                                        {
+                                            if(currentValuesBuffer[i] > max)
+                                                {
+                                                    index = inputPtr - basePtr + i;
+                                                    max = currentValuesBuffer[i];
+                                                }
+                                        }
+                                    i++;
+                                    mask >>= 1;
+                                }
+                            maxValues = _mm256_set1_epi8(max);
+                        }
+                    inputPtr += 32;
+                }
+
+            for(i = 0; i<(num_points % 32); ++i)
+                {
+                    if(src0[i] > max)
+                        {
+                            index = i;
+                            max = src0[i];
+                        }
+                }
+            target[0] = index;
+        }
+}
+
+#endif /*LV_HAVE_AVX2*/
+
+
 #ifdef LV_HAVE_AVX
 #include <immintrin.h>
 
diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8i_max_s8i.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8i_max_s8i.h
index 2e3bad400..109c4f779 100644
--- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8i_max_s8i.h
+++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8i_max_s8i.h
@@ -58,6 +58,55 @@
 
 #include <volk_gnsssdr/volk_gnsssdr_common.h>
 
+#ifdef LV_HAVE_AVX2
+#include <immintrin.h>
+
+static inline void volk_gnsssdr_8i_max_s8i_u_avx2(char* target, const char* src0, unsigned int num_points)
+{
+    if(num_points > 0)
+        {
+            const unsigned int avx_iters = num_points / 32;
+            unsigned int number;
+            unsigned int i;
+            char* inputPtr = (char*)src0;
+            char max = src0[0];
+            __VOLK_ATTR_ALIGNED(32) char maxValuesBuffer[32];
+            __m256i maxValues, compareResults, currentValues;
+
+            maxValues = _mm256_set1_epi8(max);
+
+            for(number = 0; number < avx_iters; number++)
+                {
+                    currentValues  = _mm256_loadu_si256((__m256i*)inputPtr);
+                    compareResults = _mm256_max_epi8(maxValues, currentValues);
+                    maxValues = compareResults;
+                    inputPtr += 32;
+                }
+
+            _mm256_storeu_si256((__m256i*)maxValuesBuffer, maxValues);
+
+            for(i = 0; i < 32; ++i)
+                {
+                    if(maxValuesBuffer[i] > max)
+                        {
+                            max = maxValuesBuffer[i];
+                        }
+                }
+
+            for(i = avx_iters * 32; i < num_points; ++i)
+                {
+                    if(src0[i] > max)
+                        {
+                            max = src0[i];
+                        }
+                }
+            target[0] = max;
+        }
+}
+
+#endif /*LV_HAVE_SSE4_1*/
+
+
 #ifdef LV_HAVE_SSE4_1
 #include <smmintrin.h>
 
@@ -238,6 +287,55 @@ static inline void volk_gnsssdr_8i_max_s8i_a_sse4_1(char* target, const char* sr
 #endif /*LV_HAVE_SSE4_1*/
 
 
+#ifdef LV_HAVE_AVX2
+#include <immintrin.h>
+
+static inline void volk_gnsssdr_8i_max_s8i_a_avx2(char* target, const char* src0, unsigned int num_points)
+{
+    if(num_points > 0)
+        {
+            const unsigned int avx_iters = num_points / 32;
+            unsigned int number;
+            unsigned int i;
+            char* inputPtr = (char*)src0;
+            char max = src0[0];
+            __VOLK_ATTR_ALIGNED(32) char maxValuesBuffer[32];
+            __m256i maxValues, compareResults, currentValues;
+
+            maxValues = _mm256_set1_epi8(max);
+
+            for(number = 0; number < avx_iters; number++)
+                {
+                    currentValues  = _mm256_load_si256((__m256i*)inputPtr);
+                    compareResults = _mm256_max_epi8(maxValues, currentValues);
+                    maxValues = compareResults; //_mm256_blendv_epi8(currentValues, maxValues, compareResults);
+                    inputPtr += 32;
+                }
+
+            _mm256_store_si256((__m256i*)maxValuesBuffer, maxValues);
+
+            for(i = 0; i < 32; ++i)
+                {
+                    if(maxValuesBuffer[i] > max)
+                        {
+                            max = maxValuesBuffer[i];
+                        }
+                }
+
+            for(i = avx_iters * 32; i < num_points; ++i)
+                {
+                    if(src0[i] > max)
+                        {
+                            max = src0[i];
+                        }
+                }
+            target[0] = max;
+        }
+}
+
+#endif /*LV_HAVE_SSE4_1*/
+
+
 #ifdef LV_HAVE_SSE2
 #include <emmintrin.h>
 
diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8i_x2_add_8i.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8i_x2_add_8i.h
index 54460a3a2..3854319fd 100644
--- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8i_x2_add_8i.h
+++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8i_x2_add_8i.h
@@ -94,6 +94,42 @@ static inline void volk_gnsssdr_8i_x2_add_8i_u_sse2(char* cVector, const char* a
 #endif /* LV_HAVE_SSE2 */
 
 
+#ifdef LV_HAVE_AVX2
+#include <immintrin.h>
+
+static inline void volk_gnsssdr_8i_x2_add_8i_u_avx2(char* cVector, const char* aVector, const char* bVector, unsigned int num_points)
+{
+    const unsigned int avx_iters = num_points / 32;
+    unsigned int number;
+    unsigned int i;
+    char* cPtr = cVector;
+    const char* aPtr = aVector;
+    const char* bPtr = bVector;
+
+    __m256i aVal, bVal, cVal;
+
+    for(number = 0; number < avx_iters; number++)
+        {
+            aVal = _mm256_loadu_si256((__m256i*)aPtr);
+            bVal = _mm256_loadu_si256((__m256i*)bPtr);
+
+            cVal = _mm256_add_epi8(aVal, bVal);
+
+            _mm256_storeu_si256((__m256i*)cPtr, cVal); // Store the results back into the C container
+
+            aPtr += 32;
+            bPtr += 32;
+            cPtr += 32;
+        }
+
+    for(i = avx_iters * 32; i < num_points; ++i)
+        {
+            *cPtr++ = (*aPtr++) + (*bPtr++);
+        }
+}
+#endif /* LV_HAVE_SSE2 */
+
+
 #ifdef LV_HAVE_GENERIC
 
 static inline void volk_gnsssdr_8i_x2_add_8i_generic(char* cVector, const char* aVector, const char* bVector, unsigned int num_points)
@@ -147,6 +183,42 @@ static inline void volk_gnsssdr_8i_x2_add_8i_a_sse2(char* cVector, const char* a
 #endif /* LV_HAVE_SSE2 */
 
 
+#ifdef LV_HAVE_AVX2
+#include <immintrin.h>
+
+static inline void volk_gnsssdr_8i_x2_add_8i_a_avx2(char* cVector, const char* aVector, const char* bVector, unsigned int num_points)
+{
+    const unsigned int avx_iters = num_points / 32;
+    unsigned int number;
+    unsigned int i;
+    char* cPtr = cVector;
+    const char* aPtr = aVector;
+    const char* bPtr = bVector;
+
+    __m256i aVal, bVal, cVal;
+
+    for(number = 0; number < avx_iters; number++)
+        {
+            aVal = _mm256_load_si256((__m256i*)aPtr);
+            bVal = _mm256_load_si256((__m256i*)bPtr);
+
+            cVal = _mm256_add_epi8(aVal, bVal);
+
+            _mm256_store_si256((__m256i*)cPtr, cVal); // Store the results back into the C container
+
+            aPtr += 32;
+            bPtr += 32;
+            cPtr += 32;
+        }
+
+    for(i = avx_iters * 32; i < num_points; ++i)
+        {
+            *cPtr++ = (*aPtr++) + (*bPtr++);
+        }
+}
+#endif /* LV_HAVE_SSE2 */
+
+
 #ifdef LV_HAVE_ORC
 
 extern void volk_gnsssdr_8i_x2_add_8i_a_orc_impl(char* cVector, const char* aVector, const char* bVector, 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 7e89fe5d1..830128a83 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
@@ -59,6 +59,37 @@
 
 #include <volk_gnsssdr/volk_gnsssdr_complex.h>
 
+#ifdef LV_HAVE_AVX2
+#include <immintrin.h>
+
+static inline void volk_gnsssdr_8ic_conjugate_8ic_u_avx2(lv_8sc_t* cVector, const lv_8sc_t* aVector, unsigned int num_points)
+{
+    const unsigned int avx2_iters = num_points / 16;
+    unsigned int i;
+    lv_8sc_t* c = cVector;
+    const lv_8sc_t* a = aVector;
+
+    __m256i tmp;
+    __m256i conjugator = _mm256_setr_epi8(1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1);
+
+    for (i = 0; i < avx2_iters; ++i)
+        {
+            tmp = _mm256_loadu_si256((__m256i*)a);
+            tmp = _mm256_sign_epi8(tmp, conjugator);
+            _mm256_storeu_si256((__m256i*)c, tmp);
+
+            a += 16;
+            c += 16;
+        }
+
+    for (i = avx2_iters * 16; i < num_points; ++i)
+        {
+            *c++ = lv_conj(*a++);
+        }
+}
+#endif /* LV_HAVE_AVX2 */
+
+
 #ifdef LV_HAVE_AVX
 #include <immintrin.h>
 
@@ -217,6 +248,37 @@ static inline void volk_gnsssdr_8ic_conjugate_8ic_a_avx(lv_8sc_t* cVector, const
 #endif /* LV_HAVE_AVX */
 
 
+#ifdef LV_HAVE_AVX2
+#include <immintrin.h>
+
+static inline void volk_gnsssdr_8ic_conjugate_8ic_a_avx2(lv_8sc_t* cVector, const lv_8sc_t* aVector, unsigned int num_points)
+{
+    const unsigned int avx2_iters = num_points / 16;
+    unsigned int i;
+    lv_8sc_t* c = cVector;
+    const lv_8sc_t* a = aVector;
+
+    __m256i tmp;
+    __m256i conjugator = _mm256_setr_epi8(1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1);
+
+    for (i = 0; i < avx2_iters; ++i)
+        {
+            tmp = _mm256_load_si256((__m256i*)a);
+            tmp = _mm256_sign_epi8(tmp, conjugator);
+            _mm256_store_si256((__m256i*)c, tmp);
+
+            a += 16;
+            c += 16;
+        }
+
+    for (i = avx2_iters * 16; i < num_points; ++i)
+        {
+            *c++ = lv_conj(*a++);
+        }
+}
+#endif /* LV_HAVE_AVX2 */
+
+
 #ifdef LV_HAVE_SSSE3
 #include <tmmintrin.h>
 
diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8u_x2_multiply_8u.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8u_x2_multiply_8u.h
index df7a0cd7d..8457b7f14 100644
--- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8u_x2_multiply_8u.h
+++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8u_x2_multiply_8u.h
@@ -58,6 +58,56 @@
 #ifndef INCLUDED_volk_gnsssdr_8u_x2_multiply_8u_H
 #define INCLUDED_volk_gnsssdr_8u_x2_multiply_8u_H
 
+#ifdef LV_HAVE_AVX2
+#include <immintrin.h>
+
+static inline void volk_gnsssdr_8u_x2_multiply_8u_u_avx2(unsigned char* cChar, const unsigned char* aChar, const unsigned char* bChar, unsigned int num_points)
+{
+    const unsigned int avx2_iters = num_points / 32;
+    unsigned int number;
+    unsigned int i;
+
+    __m256i x, y, x1, x2, y1, y2, mult1, x1_mult_y1, x2_mult_y2, tmp, tmp1, tmp2, totalc;
+    unsigned char* c = cChar;
+    const unsigned char* a = aChar;
+    const unsigned char* b = bChar;
+
+    for(number = 0; number < avx2_iters; number++)
+        {
+            x = _mm256_loadu_si256((__m256i*)a);
+            y = _mm256_loadu_si256((__m256i*)b);
+
+            mult1 = _mm256_set_epi8(0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF);
+            x1 = _mm256_srli_si256(x, 1);
+            x1 = _mm256_and_si256(x1, mult1);
+            x2 = _mm256_and_si256(x, mult1);
+
+            y1 = _mm256_srli_si256(y, 1);
+            y1 = _mm256_and_si256(y1, mult1);
+            y2 = _mm256_and_si256(y, mult1);
+
+            x1_mult_y1 = _mm256_mullo_epi16(x1, y1);
+            x2_mult_y2 = _mm256_mullo_epi16(x2, y2);
+
+            tmp = _mm256_and_si256(x1_mult_y1, mult1);
+            tmp1 = _mm256_slli_si256(tmp, 1);
+            tmp2 = _mm256_and_si256(x2_mult_y2, mult1);
+            totalc = _mm256_or_si256(tmp1, tmp2);
+
+            _mm256_storeu_si256((__m256i*)c, totalc);
+
+            a += 32;
+            b += 32;
+            c += 32;
+        }
+
+    for (i = avx2_iters * 32; i < num_points ; ++i)
+        {
+            *c++ = (*a++) * (*b++);
+        }
+}
+#endif /* LV_HAVE_SSE3 */
+
 
 #ifdef LV_HAVE_SSE3
 #include <pmmintrin.h>
@@ -176,6 +226,57 @@ static inline void volk_gnsssdr_8u_x2_multiply_8u_a_sse3(unsigned char* cChar, c
 #endif /* LV_HAVE_SSE */
 
 
+#ifdef LV_HAVE_AVX2
+#include <immintrin.h>
+
+static inline void volk_gnsssdr_8u_x2_multiply_8u_a_avx2(unsigned char* cChar, const unsigned char* aChar, const unsigned char* bChar, unsigned int num_points)
+{
+    const unsigned int avx2_iters = num_points / 32;
+    unsigned int number;
+    unsigned int i;
+
+    __m256i x, y, x1, x2, y1, y2, mult1, x1_mult_y1, x2_mult_y2, tmp, tmp1, tmp2, totalc;
+    unsigned char* c = cChar;
+    const unsigned char* a = aChar;
+    const unsigned char* b = bChar;
+
+    for(number = 0; number < avx2_iters; number++)
+        {
+            x = _mm256_load_si256((__m256i*)a);
+            y = _mm256_load_si256((__m256i*)b);
+
+            mult1 = _mm256_set_epi8(0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF);
+            x1 = _mm256_srli_si256(x, 1);
+            x1 = _mm256_and_si256(x1, mult1);
+            x2 = _mm256_and_si256(x, mult1);
+
+            y1 = _mm256_srli_si256(y, 1);
+            y1 = _mm256_and_si256(y1, mult1);
+            y2 = _mm256_and_si256(y, mult1);
+
+            x1_mult_y1 = _mm256_mullo_epi16(x1, y1);
+            x2_mult_y2 = _mm256_mullo_epi16(x2, y2);
+
+            tmp = _mm256_and_si256(x1_mult_y1, mult1);
+            tmp1 = _mm256_slli_si256(tmp, 1);
+            tmp2 = _mm256_and_si256(x2_mult_y2, mult1);
+            totalc = _mm256_or_si256(tmp1, tmp2);
+
+            _mm256_store_si256((__m256i*)c, totalc);
+
+            a += 32;
+            b += 32;
+            c += 32;
+        }
+
+    for (i = avx2_iters * 32; i < num_points ; ++i)
+        {
+            *c++ = (*a++) * (*b++);
+        }
+}
+#endif /* LV_HAVE_SSE3 */
+
+
 #ifdef LV_HAVE_ORC
 
 extern void volk_gnsssdr_8u_x2_multiply_8u_a_orc_impl(unsigned char* cVector, const unsigned char* aVector, const unsigned char* bVector, unsigned int num_points);
diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/kernel_tests.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/kernel_tests.h
index de3284a06..da0b2f0f8 100644
--- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/kernel_tests.h
+++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/kernel_tests.h
@@ -89,10 +89,14 @@ std::vector<volk_gnsssdr_test_case_t> init_test_list(volk_gnsssdr_test_params_t
         (VOLK_INIT_PUPP(volk_gnsssdr_16ic_resamplerfastpuppet_16ic, volk_gnsssdr_16ic_resampler_fast_16ic, test_params))
         (VOLK_INIT_PUPP(volk_gnsssdr_16ic_resamplerfastxnpuppet_16ic, volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn, test_params))
         (VOLK_INIT_PUPP(volk_gnsssdr_16ic_resamplerxnpuppet_16ic, volk_gnsssdr_16ic_xn_resampler_16ic_xn, test_params))
+        (VOLK_INIT_PUPP(volk_gnsssdr_16i_resamplerxnpuppet_16i, volk_gnsssdr_16i_xn_resampler_16i_xn, test_params))
         (VOLK_INIT_PUPP(volk_gnsssdr_32fc_resamplerxnpuppet_32fc, volk_gnsssdr_32fc_xn_resampler_32fc_xn, test_params))
+        (VOLK_INIT_PUPP(volk_gnsssdr_32f_resamplerxnpuppet_32f, volk_gnsssdr_32f_xn_resampler_32f_xn, test_params))
         (VOLK_INIT_PUPP(volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic, volk_gnsssdr_16ic_x2_dot_prod_16ic_xn, test_params))
         (VOLK_INIT_PUPP(volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic, volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn, test_params_int16))
+        (VOLK_INIT_PUPP(volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic, volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn, test_params_int16))
         (VOLK_INIT_PUPP(volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc, volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn, test_params_int1))
+        (VOLK_INIT_PUPP(volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc, volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn, test_params_int1))
         ;
 
     return test_cases;
diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc
index c5b3f5262..8019b3a8a 100644
--- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc
+++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc
@@ -17,29 +17,19 @@
  */
 
 #include "qa_utils.h"
+#include <chrono>
+#include <random>
 #include <boost/foreach.hpp>
 #include <boost/tokenizer.hpp>
 #include <boost/lexical_cast.hpp>
-#include <boost/typeof/typeof.hpp>
-#include <boost/type_traits.hpp>
-
-#include <iostream>
-#include <cstring>
-#include <fstream>
-#include <vector>
-#include <map>
-#include <list>
-#include <ctime>
-#include <cmath>
-#include <limits>
-
-#include <volk_gnsssdr/volk_gnsssdr.h>
 #include <volk_gnsssdr/volk_gnsssdr_cpu.h>
-#include <volk_gnsssdr/volk_gnsssdr_common.h>
 #include <volk_gnsssdr/volk_gnsssdr_malloc.h>
 
 float uniform() {
-    return 2.0f * ((float) rand() / RAND_MAX - 0.5f);     // uniformly (-1, 1)
+    std::random_device r;
+    std::default_random_engine e1(r());
+    std::uniform_real_distribution<float> uniform_dist(-1, 1);
+    return uniform_dist(e1);    // uniformly (-1, 1)
 }
 
 template <class t>
@@ -51,7 +41,11 @@ void random_floats (t *buf, unsigned n)
 
 void load_random_data(void *data, volk_gnsssdr_type_t type, unsigned int n)
 {
+    std::random_device r;
+    std::default_random_engine e2(r());
+
     if(type.is_complex) n *= 2;
+
     if(type.is_float)
         {
             if(type.size == 8) random_floats<double>((double *)data, n);
@@ -61,10 +55,11 @@ void load_random_data(void *data, volk_gnsssdr_type_t type, unsigned int n)
         {
             float int_max = float(uint64_t(2) << (type.size*8));
             if(type.is_signed) int_max /= 2.0;
+            std::uniform_real_distribution<float> uniform_dist(-int_max, int_max);
             for(unsigned int i = 0; i < n; i++)
                 {
-                    float scaled_rand = (((float) (rand() - (RAND_MAX/2))) / static_cast<float>((RAND_MAX/2))) * int_max;
-                    //man i really don't know how to do this in a more clever way, you have to cast down at some point
+                    float scaled_rand = uniform_dist(e2);
+
                     switch(type.size)
                     {
                     case 8:
@@ -490,10 +485,10 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc,
 
     //now run the test
     vlen = vlen - vlen_twiddle;
-    clock_t start, end;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
     std::vector<double> profile_times;
     for(size_t i = 0; i < arch_list.size(); i++) {
-        start = clock();
+        start = std::chrono::system_clock::now();
 
         switch(both_sigs.size())
         {
@@ -618,9 +613,10 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc,
                 break;
         }
 
-        end = clock();
-        double arch_time = 1000.0 * (double)(end-start)/(double)CLOCKS_PER_SEC;
-        std::cout << arch_list[i] << " completed in " << arch_time << "ms" << std::endl;
+        end = std::chrono::system_clock::now();
+        std::chrono::duration<double> elapsed_seconds = end - start;
+        double arch_time = 1000.0 * elapsed_seconds.count();
+        std::cout << arch_list[i] << " completed in " << arch_time << " ms" << std::endl;
         volk_gnsssdr_test_time_t result;
         result.name = arch_list[i];
         result.time = arch_time;
@@ -721,7 +717,7 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc,
                                             {
                                                 if(both_sigs[j].is_signed)
                                                     {
-                                                        fail = icompare((int8_t *) test_data[generic_offset][j], (int8_t *) test_data[i][j], vlen*(both_sigs[j].is_complex ? 2 : 1), tol_i);
+                                                        fail = icompare((int16_t *) test_data[generic_offset][j], (int16_t *) test_data[i][j], vlen*(both_sigs[j].is_complex ? 2 : 1), tol_i);
                                                     }
                                                 else
                                                     {
diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.h
index a50fe8fc8..aa3192524 100644
--- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.h
+++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.h
@@ -19,7 +19,6 @@
 #ifndef GNSS_SDR_VOLK_QA_UTILS_H
 #define GNSS_SDR_VOLK_QA_UTILS_H
 
-#include <cstdlib>
 #include <string>
 #include <iostream>
 #include <fstream>
diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/python/volk_gnsssdr_modtool/volk_gnsssdr_modtool_generate.py b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/python/volk_gnsssdr_modtool/volk_gnsssdr_modtool_generate.py
index ee32d5192..340933018 100644
--- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/python/volk_gnsssdr_modtool/volk_gnsssdr_modtool_generate.py
+++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/python/volk_gnsssdr_modtool/volk_gnsssdr_modtool_generate.py
@@ -58,10 +58,10 @@ class volk_gnsssdr_modtool:
         else:
             name = self.get_basename(base);
         if name == '':
-            hdr_files = glob.glob(os.path.join(base, "kernels/volk_gnsssdr/*.h"));
+            hdr_files = sorted(glob.glob(os.path.join(base, "kernels/volk_gnsssdr/*.h")));
             begins = re.compile("(?<=volk_gnsssdr_).*")
         else:
-            hdr_files = glob.glob(os.path.join(base, "kernels/volk_gnsssdr_" + name + "/*.h"));
+            hdr_files = sorted(glob.glob(os.path.join(base, "kernels/volk_gnsssdr_" + name + "/*.h")));
             begins = re.compile("(?<=volk_gnsssdr_" + name + "_).*")
 
         datatypes = [];
@@ -166,7 +166,7 @@ class volk_gnsssdr_modtool:
         open(dest, 'w+').write(outstring);
 
         # copy orc proto-kernels if they exist
-        for orcfile in glob.glob(inpath + '/orc/' + top + name + '*.orc'):
+        for orcfile in sorted(glob.glob(inpath + '/kernels/volk_gnsssdr/asm/orc/' + top + name + '*.orc')):
             if os.path.isfile(orcfile):
                 instring = open(orcfile, 'r').read();
                 outstring = re.sub(oldvolk_gnsssdr, 'volk_gnsssdr_' + self.my_dict['name'], instring);
@@ -333,8 +333,3 @@ class volk_gnsssdr_modtool:
                     write_okay = False
             if write_okay:
                 open(dest, 'a').write(otherline);
-
-
-
-
-
diff --git a/src/algorithms/observables/adapters/CMakeLists.txt b/src/algorithms/observables/adapters/CMakeLists.txt
index 087302d8c..5129e4157 100644
--- a/src/algorithms/observables/adapters/CMakeLists.txt
+++ b/src/algorithms/observables/adapters/CMakeLists.txt
@@ -21,7 +21,7 @@ set(OBS_ADAPTER_SOURCES
 )
 
 include_directories(
-     $(CMAKE_CURRENT_SOURCE_DIR)
+     ${CMAKE_CURRENT_SOURCE_DIR}
      ${CMAKE_SOURCE_DIR}/src/core/system_parameters
      ${CMAKE_SOURCE_DIR}/src/core/interfaces
      ${CMAKE_SOURCE_DIR}/src/core/receiver
diff --git a/src/algorithms/observables/adapters/hybrid_observables.cc b/src/algorithms/observables/adapters/hybrid_observables.cc
index e076925b9..a3a33d38a 100644
--- a/src/algorithms/observables/adapters/hybrid_observables.cc
+++ b/src/algorithms/observables/adapters/hybrid_observables.cc
@@ -57,7 +57,7 @@ HybridObservables::HybridObservables(ConfigurationInterface* configuration,
         }
     else
         {
-            default_depth = 100;
+            default_depth = 500;
         }
     unsigned int history_deep = configuration->property(role + ".history_depth", default_depth);
     observables_ = hybrid_make_observables_cc(in_streams_, dump_, dump_filename_, history_deep);
diff --git a/src/algorithms/observables/adapters/hybrid_observables.h b/src/algorithms/observables/adapters/hybrid_observables.h
index 98bc9216f..d986ebb14 100644
--- a/src/algorithms/observables/adapters/hybrid_observables.h
+++ b/src/algorithms/observables/adapters/hybrid_observables.h
@@ -51,28 +51,32 @@ public:
             std::string role,
             unsigned int in_streams,
             unsigned int out_streams);
+
     virtual ~HybridObservables();
-    std::string role()
+
+    inline std::string role() override
     {
         return role_;
     }
 
     //!  Returns "Hybrid_Observables"
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "Hybrid_Observables";
     }
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
-    void reset()
+
+    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;
+
+    inline void reset() override
     {
         return;
     }
 
     //! All blocks must have an item_size() function implementation
-    size_t item_size()
+    inline size_t item_size() override
     {
         return sizeof(gr_complex);
     }
diff --git a/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt b/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt
index ec5247aab..d195adf03 100644
--- a/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt
+++ b/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt
@@ -21,7 +21,7 @@ set(OBS_GR_BLOCKS_SOURCES
 )
 
 include_directories(
-     $(CMAKE_CURRENT_SOURCE_DIR)
+     ${CMAKE_CURRENT_SOURCE_DIR}
      ${CMAKE_SOURCE_DIR}/src/core/system_parameters
      ${CMAKE_SOURCE_DIR}/src/core/interfaces
      ${CMAKE_SOURCE_DIR}/src/core/receiver
diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc
index 1422077ab..9ee672c7b 100644
--- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc
+++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc
@@ -46,331 +46,345 @@ using google::LogMessage;
 
 hybrid_observables_cc_sptr hybrid_make_observables_cc(unsigned int nchannels, bool dump, std::string dump_filename, unsigned int deep_history)
 {
-    return hybrid_observables_cc_sptr(new hybrid_observables_cc(nchannels, dump, dump_filename, deep_history));
+  return hybrid_observables_cc_sptr(new hybrid_observables_cc(nchannels, dump, dump_filename, deep_history));
 }
 
 
 hybrid_observables_cc::hybrid_observables_cc(unsigned int nchannels, bool dump, std::string dump_filename, unsigned int deep_history) :
-                  gr::block("hybrid_observables_cc", gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)),
-                          gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)))
+                	      gr::block("hybrid_observables_cc", gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)),
+                	                gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)))
 {
-    // initialize internal vars
-    d_dump = dump;
-    d_nchannels = nchannels;
-    d_dump_filename = dump_filename;
-    history_deep = deep_history;
-    T_rx_s = 0.0;
-    T_rx_step_s = 1e-3;// todo: move to gnss-sdr config
-    for (unsigned int i = 0; i < d_nchannels; i++)
-        {
-            d_gnss_synchro_history_queue.push_back(std::deque<Gnss_Synchro>());
-        }
-    //todo: this is a gnuradio scheduler hack.
-    // Migrate the queues to gnuradio set_history to see if the scheduler can handle
-    // the multiple output flow
-    d_max_noutputs = 100;
-    this->set_min_noutput_items(100);
+  // initialize internal vars
+  d_dump = dump;
+  d_nchannels = nchannels;
+  d_dump_filename = dump_filename;
+  history_deep = deep_history;
+  T_rx_s = 0.0;
+  T_rx_step_s = 1e-3;// todo: move to gnss-sdr config
+  for (unsigned int i = 0; i < d_nchannels; i++)
+    {
+      d_gnss_synchro_history_queue.push_back(std::deque<Gnss_Synchro>());
+    }
+  //todo: this is a gnuradio scheduler hack.
+  // Migrate the queues to gnuradio set_history to see if the scheduler can handle
+  // the multiple output flow
+  d_max_noutputs = 100;
+  this->set_min_noutput_items(100);
 
-    // ############# ENABLE DATA FILE LOG #################
-    if (d_dump == true)
+  // ############# ENABLE DATA FILE LOG #################
+  if (d_dump == true)
+    {
+      if (d_dump_file.is_open() == false)
         {
-            if (d_dump_file.is_open() == false)
-                {
-                    try
-                    {
-                            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) << "Observables dump enabled Log file: " << d_dump_filename.c_str();
-                    }
-                    catch (const std::ifstream::failure & e)
-                    {
-                            LOG(WARNING) << "Exception opening observables dump file " << e.what();
-                    }
-                }
+          try
+          {
+              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) << "Observables dump enabled Log file: " << d_dump_filename.c_str();
+          }
+          catch (const std::ifstream::failure & e)
+          {
+              LOG(WARNING) << "Exception opening observables dump file " << e.what();
+          }
         }
+    }
 }
 
 
 hybrid_observables_cc::~hybrid_observables_cc()
 {
-    d_dump_file.close();
+  if (d_dump_file.is_open() == true)
+    {
+      try
+      {
+          d_dump_file.close();
+      }
+      catch(const std::exception & ex)
+      {
+          LOG(WARNING) << "Exception in destructor closing the dump file " << ex.what();
+      }
+    }
 }
 
 
 bool Hybrid_pairCompare_gnss_synchro_sample_counter(const std::pair<int,Gnss_Synchro>& a, const std::pair<int,Gnss_Synchro>& b)
 {
-    return (a.second.Tracking_sample_counter) < (b.second.Tracking_sample_counter);
+  return (a.second.Tracking_sample_counter) < (b.second.Tracking_sample_counter);
 }
 
 
 bool Hybrid_valueCompare_gnss_synchro_sample_counter(const Gnss_Synchro& a, unsigned long int b)
 {
-    return (a.Tracking_sample_counter) < (b);
+  return (a.Tracking_sample_counter) < (b);
 }
 
 
 bool Hybrid_valueCompare_gnss_synchro_receiver_time(const Gnss_Synchro& a, double b)
 {
-    return (((double)a.Tracking_sample_counter+a.Code_phase_samples)/(double)a.fs) < (b);
+  return (((double)a.Tracking_sample_counter+a.Code_phase_samples)/(double)a.fs) < (b);
 }
 
 
 bool Hybrid_pairCompare_gnss_synchro_d_TOW(const std::pair<int,Gnss_Synchro>& a, const std::pair<int,Gnss_Synchro>& b)
 {
-    return (a.second.TOW_at_current_symbol_s) < (b.second.TOW_at_current_symbol_s);
+  return (a.second.TOW_at_current_symbol_s) < (b.second.TOW_at_current_symbol_s);
 }
 
 
 bool Hybrid_valueCompare_gnss_synchro_d_TOW(const Gnss_Synchro& a, double b)
 {
-    return (a.TOW_at_current_symbol_s) < (b);
+  return (a.TOW_at_current_symbol_s) < (b);
 }
 
 
 int hybrid_observables_cc::general_work (int noutput_items,
-        gr_vector_int &ninput_items,
-        gr_vector_const_void_star &input_items,
-        gr_vector_void_star &output_items)
+                                         gr_vector_int &ninput_items,
+                                         gr_vector_const_void_star &input_items,
+                                         gr_vector_void_star &output_items)
 {
-    Gnss_Synchro **in = (Gnss_Synchro **)  &input_items[0];   // Get the input pointer
-    Gnss_Synchro **out = (Gnss_Synchro **)  &output_items[0]; // Get the output pointer
-    int n_outputs = 0;
-    int n_consume[d_nchannels];
-    double past_history_s = 100e-3;
+  Gnss_Synchro **in = (Gnss_Synchro **)  &input_items[0];   // Get the input pointer
+  Gnss_Synchro **out = (Gnss_Synchro **)  &output_items[0]; // Get the output pointer
+  int n_outputs = 0;
+  int n_consume[d_nchannels];
+  double past_history_s = 100e-3;
 
-    Gnss_Synchro current_gnss_synchro[d_nchannels];
+  Gnss_Synchro current_gnss_synchro[d_nchannels];
 
-    /*
-     * 1. Read the GNSS SYNCHRO objects from available channels.
-     *  Multi-rate GNURADIO Block. Read how many input items are avaliable in each channel
-     *  Record all synchronization data into queues
-     */
-    for (unsigned int i = 0; i < d_nchannels; i++)
+  /*
+   * 1. Read the GNSS SYNCHRO objects from available channels.
+   *  Multi-rate GNURADIO Block. Read how many input items are avaliable in each channel
+   *  Record all synchronization data into queues
+   */
+  for (unsigned int i = 0; i < d_nchannels; i++)
+    {
+      n_consume[i] = ninput_items[i];// full throttle
+      for (int j = 0; j < n_consume[i]; j++)
         {
-            n_consume[i] = ninput_items[i];// full throttle
-            for (int j = 0; j < n_consume[i]; j++)
-                {
-                    d_gnss_synchro_history_queue[i].push_back(in[i][j]);
-                }
-            //std::cout<<"push["<<i<<"] items "<<n_consume[i]
-            ///         <<" latest T_rx: "<<(double)in[i][ninput_items[i]-1].Tracking_sample_counter/(double)in[i][ninput_items[i]-1].fs
-            //         <<" [s] q size: "
-            //         <<d_gnss_synchro_history_queue[i].size()
-            //         <<std::endl;
+          d_gnss_synchro_history_queue[i].push_back(in[i][j]);
         }
+      //std::cout<<"push["<<i<<"] items "<<n_consume[i]
+      ///         <<" latest T_rx: "<<(double)in[i][ninput_items[i]-1].Tracking_sample_counter/(double)in[i][ninput_items[i]-1].fs
+      //         <<" [s] q size: "
+      //         <<d_gnss_synchro_history_queue[i].size()
+      //         <<std::endl;
+    }
 
-    bool channel_history_ok;
-    do
+  bool channel_history_ok;
+  do
+    {
+      channel_history_ok = true;
+      for (unsigned int i = 0; i < d_nchannels; i++)
         {
-            channel_history_ok = true;
-            for (unsigned int i = 0; i < d_nchannels; i++)
-                {
-                    if (d_gnss_synchro_history_queue[i].size() < history_deep)
-                        {
-                            channel_history_ok = false;
-                        }
+          if (d_gnss_synchro_history_queue[i].size() < history_deep)
+            {
+              channel_history_ok = false;
+            }
 
+        }
+      if (channel_history_ok == true)
+        {
+          std::map<int,Gnss_Synchro>::iterator gnss_synchro_map_iter;
+          std::deque<Gnss_Synchro>::iterator gnss_synchro_deque_iter;
+
+          //1. If the RX time is not set, set the Rx time
+          if (T_rx_s == 0)
+            {
+              //0. Read a gnss_synchro snapshot from the queue and store it in a map
+              std::map<int,Gnss_Synchro> gnss_synchro_map;
+              for (unsigned int i = 0; i < d_nchannels; i++)
+                {
+                  gnss_synchro_map.insert(std::pair<int, Gnss_Synchro>(
+                      d_gnss_synchro_history_queue[i].front().Channel_ID,
+                      d_gnss_synchro_history_queue[i].front()));
                 }
-            if (channel_history_ok == true)
+              gnss_synchro_map_iter = min_element(gnss_synchro_map.begin(),
+                                                  gnss_synchro_map.end(),
+                                                  Hybrid_pairCompare_gnss_synchro_sample_counter);
+              T_rx_s = (double)gnss_synchro_map_iter->second.Tracking_sample_counter / (double)gnss_synchro_map_iter->second.fs;
+              T_rx_s = floor(T_rx_s * 1000.0) / 1000.0; // truncate to ms
+              T_rx_s += past_history_s; // increase T_rx to have a minimum past history to interpolate
+            }
+
+          //2. Realign RX time in all valid channels
+          std::map<int,Gnss_Synchro> realigned_gnss_synchro_map; //container for the aligned set of observables for the selected T_rx
+          std::map<int,Gnss_Synchro> adjacent_gnss_synchro_map;  //container for the previous observable values to interpolate
+          //shift channels history to match the reference TOW
+          for (unsigned int i = 0; i < d_nchannels; i++)
+            {
+              gnss_synchro_deque_iter = std::lower_bound(d_gnss_synchro_history_queue[i].begin(),
+                                                         d_gnss_synchro_history_queue[i].end(),
+                                                         T_rx_s,
+                                                         Hybrid_valueCompare_gnss_synchro_receiver_time);
+              if (gnss_synchro_deque_iter != d_gnss_synchro_history_queue[i].end())
                 {
-                    std::map<int,Gnss_Synchro>::iterator gnss_synchro_map_iter;
-                    std::deque<Gnss_Synchro>::iterator gnss_synchro_deque_iter;
+                  if (gnss_synchro_deque_iter->Flag_valid_word == true)
+                    {
+                      double T_rx_channel = (double)gnss_synchro_deque_iter->Tracking_sample_counter / (double)gnss_synchro_deque_iter->fs;
+                      double delta_T_rx_s = T_rx_channel - T_rx_s;
 
-                    //1. If the RX time is not set, set the Rx time
-                    if (T_rx_s == 0)
+                      //check that T_rx difference is less than a threshold (the correlation interval)
+                      if (delta_T_rx_s * 1000.0 < (double)gnss_synchro_deque_iter->correlation_length_ms)
                         {
-                            //0. Read a gnss_synchro snapshot from the queue and store it in a map
-                            std::map<int,Gnss_Synchro> gnss_synchro_map;
-                            for (unsigned int i = 0; i < d_nchannels; i++)
+                          //record the word structure in a map for pseudorange computation
+                          //save the previous observable
+                          int distance = std::distance(d_gnss_synchro_history_queue[i].begin(), gnss_synchro_deque_iter);
+                          if (distance > 0)
+                            {
+                              if (d_gnss_synchro_history_queue[i].at(distance-1).Flag_valid_word)
                                 {
-                                    gnss_synchro_map.insert(std::pair<int, Gnss_Synchro>(
-                                            d_gnss_synchro_history_queue[i].front().Channel_ID,
-                                            d_gnss_synchro_history_queue[i].front()));
-                                }
-                            gnss_synchro_map_iter = min_element(gnss_synchro_map.begin(),
-                                    gnss_synchro_map.end(),
-                                    Hybrid_pairCompare_gnss_synchro_sample_counter);
-                            T_rx_s = (double)gnss_synchro_map_iter->second.Tracking_sample_counter / (double)gnss_synchro_map_iter->second.fs;
-                            T_rx_s = floor(T_rx_s * 1000.0) / 1000.0; // truncate to ms
-                            T_rx_s += past_history_s; // increase T_rx to have a minimum past history to interpolate
-                        }
-
-                    //2. Realign RX time in all valid channels
-                    std::map<int,Gnss_Synchro> realigned_gnss_synchro_map; //container for the aligned set of observables for the selected T_rx
-                    std::map<int,Gnss_Synchro> adjacent_gnss_synchro_map;  //container for the previous observable values to interpolate
-                    //shift channels history to match the reference TOW
-                    for (unsigned int i = 0; i < d_nchannels; i++)
-                        {
-                            gnss_synchro_deque_iter = std::lower_bound(d_gnss_synchro_history_queue[i].begin(),
-                                    d_gnss_synchro_history_queue[i].end(),
-                                    T_rx_s,
-                                    Hybrid_valueCompare_gnss_synchro_receiver_time);
-                            if (gnss_synchro_deque_iter != d_gnss_synchro_history_queue[i].end())
-                                {
-                                    if (gnss_synchro_deque_iter->Flag_valid_word == true)
-                                        {
-                                            double T_rx_channel = (double)gnss_synchro_deque_iter->Tracking_sample_counter / (double)gnss_synchro_deque_iter->fs;
-                                            double delta_T_rx_s = T_rx_channel - T_rx_s;
-
-                                            //check that T_rx difference is less than a threshold (the correlation interval)
-                                            if (delta_T_rx_s * 1000.0 < (double)gnss_synchro_deque_iter->correlation_length_ms)
-                                                {
-                                                    //record the word structure in a map for pseudorange computation
-                                                    //save the previous observable
-                                                    int distance = std::distance(d_gnss_synchro_history_queue[i].begin(), gnss_synchro_deque_iter);
-                                                    if (distance > 0)
-                                                        {
-                                                            double T_rx_channel_prev = (double)d_gnss_synchro_history_queue[i].at(distance - 1).Tracking_sample_counter / (double)gnss_synchro_deque_iter->fs;
-                                                            double delta_T_rx_s_prev = T_rx_channel_prev - T_rx_s;
-                                                            if (fabs(delta_T_rx_s_prev) < fabs(delta_T_rx_s))
-                                                                {
-                                                                    realigned_gnss_synchro_map.insert(std::pair<int, Gnss_Synchro>(
-                                                                            d_gnss_synchro_history_queue[i].at(distance-1).Channel_ID,
-                                                                            d_gnss_synchro_history_queue[i].at(distance-1)));
-                                                                    adjacent_gnss_synchro_map.insert(std::pair<int, Gnss_Synchro>(gnss_synchro_deque_iter->Channel_ID, *gnss_synchro_deque_iter));
-                                                                }
-                                                            else
-                                                                {
-                                                                    realigned_gnss_synchro_map.insert(std::pair<int, Gnss_Synchro>(gnss_synchro_deque_iter->Channel_ID, *gnss_synchro_deque_iter));
-                                                                    adjacent_gnss_synchro_map.insert(std::pair<int, Gnss_Synchro>(
-                                                                            d_gnss_synchro_history_queue[i].at(distance-1).Channel_ID,
-                                                                            d_gnss_synchro_history_queue[i].at(distance-1)));
-                                                                }
-                                                        }
-                                                    else
-                                                        {
-                                                            realigned_gnss_synchro_map.insert(std::pair<int, Gnss_Synchro>(gnss_synchro_deque_iter->Channel_ID, *gnss_synchro_deque_iter));
-                                                        }
-
-                                                }
-                                            else
-                                                {
-                                                    //std::cout<<"ch["<<i<<"] delta_T_rx:"<<delta_T_rx_s*1000.0<<std::endl;
-                                                }
-                                        }
-                                }
-                        }
-
-                    if(!realigned_gnss_synchro_map.empty())
-                        {
-                            /*
-                             *  2.1 Use CURRENT set of measurements and find the nearest satellite
-                             *  common RX time algorithm
-                             */
-                            // what is the most recent symbol TOW in the current set? -> this will be the reference symbol
-                            gnss_synchro_map_iter = max_element(realigned_gnss_synchro_map.begin(),
-                                    realigned_gnss_synchro_map.end(),
-                                    Hybrid_pairCompare_gnss_synchro_d_TOW);
-                            double ref_fs_hz = (double)gnss_synchro_map_iter->second.fs;
-
-                            // compute interpolated TOW value at T_rx_s
-                            int ref_channel_key = gnss_synchro_map_iter->second.Channel_ID;
-                            Gnss_Synchro adj_obs = adjacent_gnss_synchro_map.at(ref_channel_key);
-                            double ref_adj_T_rx_s = (double)adj_obs.Tracking_sample_counter / ref_fs_hz + adj_obs.Code_phase_samples / ref_fs_hz;
-
-                            double d_TOW_reference = gnss_synchro_map_iter->second.TOW_at_current_symbol_s;
-                            double d_ref_T_rx_s = (double)gnss_synchro_map_iter->second.Tracking_sample_counter / ref_fs_hz + gnss_synchro_map_iter->second.Code_phase_samples / ref_fs_hz;
-
-                            double selected_T_rx_s = T_rx_s;
-                            // two points linear interpolation using adjacent (adj) values: y=y1+(x-x1)*(y2-y1)/(x2-x1)
-                            double ref_TOW_at_T_rx_s = adj_obs.TOW_at_current_symbol_s + (selected_T_rx_s - ref_adj_T_rx_s)
-                                * (d_TOW_reference - adj_obs.TOW_at_current_symbol_s) / (d_ref_T_rx_s - ref_adj_T_rx_s);
-
-                            // Now compute RX time differences due to the PRN alignment in the correlators
-                            double traveltime_ms;
-                            double pseudorange_m;
-                            double channel_T_rx_s;
-                            double channel_fs_hz;
-                            double channel_TOW_s;
-                            double delta_T_rx_s;
-                            for(gnss_synchro_map_iter = realigned_gnss_synchro_map.begin(); gnss_synchro_map_iter != realigned_gnss_synchro_map.end(); gnss_synchro_map_iter++)
-                                {
-                                    channel_fs_hz = (double)gnss_synchro_map_iter->second.fs;
-                                    channel_TOW_s = gnss_synchro_map_iter->second.TOW_at_current_symbol_s;
-                                    channel_T_rx_s = (double)gnss_synchro_map_iter->second.Tracking_sample_counter / channel_fs_hz + gnss_synchro_map_iter->second.Code_phase_samples / channel_fs_hz;
-                                    // compute interpolated observation values
-                                    // two points linear interpolation using adjacent (adj) values: y=y1+(x-x1)*(y2-y1)/(x2-x1)
-                                    // TOW at the selected receiver time T_rx_s
-                                    int element_key = gnss_synchro_map_iter->second.Channel_ID;
-                                    adj_obs = adjacent_gnss_synchro_map.at(element_key);
-
-                                    double adj_T_rx_s = (double)adj_obs.Tracking_sample_counter / channel_fs_hz + adj_obs.Code_phase_samples / channel_fs_hz;
-
-                                    double channel_TOW_at_T_rx_s = adj_obs.TOW_at_current_symbol_s + (selected_T_rx_s - adj_T_rx_s) * (channel_TOW_s - adj_obs.TOW_at_current_symbol_s) / (channel_T_rx_s - adj_T_rx_s);
-
-                                    //Doppler and Accumulated carrier phase
-                                    double Carrier_phase_lin_rads = adj_obs.Carrier_phase_rads + (selected_T_rx_s - adj_T_rx_s) * (gnss_synchro_map_iter->second.Carrier_phase_rads - adj_obs.Carrier_phase_rads) / (channel_T_rx_s - adj_T_rx_s);
-                                    double Carrier_Doppler_lin_hz = adj_obs.Carrier_Doppler_hz + (selected_T_rx_s - adj_T_rx_s) * (gnss_synchro_map_iter->second.Carrier_Doppler_hz - adj_obs.Carrier_Doppler_hz) / (channel_T_rx_s - adj_T_rx_s);
-
-                                    //compute the pseudorange (no rx time offset correction)
-                                    traveltime_ms = (ref_TOW_at_T_rx_s - channel_TOW_at_T_rx_s) * 1000.0 + GPS_STARTOFFSET_ms;
-                                    //convert to meters
-                                    pseudorange_m = traveltime_ms * GPS_C_m_ms; // [m]
-                                    // update the pseudorange object
-                                    current_gnss_synchro[gnss_synchro_map_iter->second.Channel_ID] = gnss_synchro_map_iter->second;
-                                    current_gnss_synchro[gnss_synchro_map_iter->second.Channel_ID].Pseudorange_m = pseudorange_m;
-                                    current_gnss_synchro[gnss_synchro_map_iter->second.Channel_ID].Flag_valid_pseudorange = true;
-                                    // Save the estimated RX time (no RX clock offset correction yet!)
-                                    current_gnss_synchro[gnss_synchro_map_iter->second.Channel_ID].RX_time = ref_TOW_at_T_rx_s + GPS_STARTOFFSET_ms / 1000.0;
-
-                                    current_gnss_synchro[gnss_synchro_map_iter->second.Channel_ID].Carrier_phase_rads = Carrier_phase_lin_rads;
-                                    current_gnss_synchro[gnss_synchro_map_iter->second.Channel_ID].Carrier_Doppler_hz = Carrier_Doppler_lin_hz;
-                                }
-
-                            if(d_dump == true)
-                                {
-                                    // MULTIPLEXED FILE RECORDING - Record results to file
-                                    try
+                                  double T_rx_channel_prev = (double)d_gnss_synchro_history_queue[i].at(distance - 1).Tracking_sample_counter / (double)gnss_synchro_deque_iter->fs;
+                                  double delta_T_rx_s_prev = T_rx_channel_prev - T_rx_s;
+                                  if (fabs(delta_T_rx_s_prev) < fabs(delta_T_rx_s))
                                     {
-                                            double tmp_double;
-                                            for (unsigned int i = 0; i < d_nchannels; i++)
-                                                {
-                                                    tmp_double = current_gnss_synchro[i].RX_time;
-                                                    d_dump_file.write((char*)&tmp_double, sizeof(double));
-                                                    tmp_double = current_gnss_synchro[i].TOW_at_current_symbol_s;
-                                                    d_dump_file.write((char*)&tmp_double, sizeof(double));
-                                                    tmp_double = current_gnss_synchro[i].Carrier_Doppler_hz;
-                                                    d_dump_file.write((char*)&tmp_double, sizeof(double));
-                                                    tmp_double = current_gnss_synchro[i].Carrier_phase_rads/GPS_TWO_PI;
-                                                    d_dump_file.write((char*)&tmp_double, sizeof(double));
-                                                    tmp_double = current_gnss_synchro[i].Pseudorange_m;
-                                                    d_dump_file.write((char*)&tmp_double, sizeof(double));
-                                                    tmp_double = current_gnss_synchro[i].PRN;
-                                                    d_dump_file.write((char*)&tmp_double, sizeof(double));
-                                                }
+                                      realigned_gnss_synchro_map.insert(std::pair<int, Gnss_Synchro>(
+                                          d_gnss_synchro_history_queue[i].at(distance-1).Channel_ID,
+                                          d_gnss_synchro_history_queue[i].at(distance-1)));
+                                      adjacent_gnss_synchro_map.insert(std::pair<int, Gnss_Synchro>(gnss_synchro_deque_iter->Channel_ID, *gnss_synchro_deque_iter));
                                     }
-                                    catch (const std::ifstream::failure& e)
+                                  else
                                     {
-                                            LOG(WARNING) << "Exception writing observables dump file " << e.what();
+                                      realigned_gnss_synchro_map.insert(std::pair<int, Gnss_Synchro>(gnss_synchro_deque_iter->Channel_ID, *gnss_synchro_deque_iter));
+                                      adjacent_gnss_synchro_map.insert(std::pair<int, Gnss_Synchro>(
+                                          d_gnss_synchro_history_queue[i].at(distance-1).Channel_ID,
+                                          d_gnss_synchro_history_queue[i].at(distance-1)));
                                     }
                                 }
+                            }
+                          else
+                            {
+                              realigned_gnss_synchro_map.insert(std::pair<int, Gnss_Synchro>(gnss_synchro_deque_iter->Channel_ID, *gnss_synchro_deque_iter));
+                            }
 
-                            for (unsigned int i = 0; i < d_nchannels; i++)
-                                {
-                                    out[i][n_outputs] = current_gnss_synchro[i];
-                                }
-
-                            n_outputs++;
                         }
-
-                    //Move RX time
-                    T_rx_s = T_rx_s + T_rx_step_s;
-                    //pop old elements from queue
-                    for (unsigned int i = 0; i < d_nchannels; i++)
+                      else
                         {
-                            while (d_gnss_synchro_history_queue[i].front().Tracking_sample_counter / (double)d_gnss_synchro_history_queue[i].front().fs < (T_rx_s - past_history_s))
-                                {
-                                    d_gnss_synchro_history_queue[i].pop_front();
-                                }
+                          //std::cout<<"ch["<<i<<"] delta_T_rx:"<<delta_T_rx_s*1000.0<<std::endl;
                         }
+                    }
                 }
-        }while(channel_history_ok == true && d_max_noutputs>n_outputs);
+            }
 
-    //Multi-rate consume!
-    for (unsigned int i = 0; i < d_nchannels; i++)
-        {
-            consume(i, n_consume[i]); //which input, how many items
+          if(!realigned_gnss_synchro_map.empty())
+            {
+              /*
+               *  2.1 Use CURRENT set of measurements and find the nearest satellite
+               *  common RX time algorithm
+               */
+              // what is the most recent symbol TOW in the current set? -> this will be the reference symbol
+              gnss_synchro_map_iter = max_element(realigned_gnss_synchro_map.begin(),
+                                                  realigned_gnss_synchro_map.end(),
+                                                  Hybrid_pairCompare_gnss_synchro_d_TOW);
+              double ref_fs_hz = (double)gnss_synchro_map_iter->second.fs;
+
+              // compute interpolated TOW value at T_rx_s
+              int ref_channel_key = gnss_synchro_map_iter->second.Channel_ID;
+              Gnss_Synchro adj_obs = adjacent_gnss_synchro_map.at(ref_channel_key);
+              double ref_adj_T_rx_s = (double)adj_obs.Tracking_sample_counter / ref_fs_hz + adj_obs.Code_phase_samples / ref_fs_hz;
+
+              double d_TOW_reference = gnss_synchro_map_iter->second.TOW_at_current_symbol_s;
+              double d_ref_T_rx_s = (double)gnss_synchro_map_iter->second.Tracking_sample_counter / ref_fs_hz + gnss_synchro_map_iter->second.Code_phase_samples / ref_fs_hz;
+
+              double selected_T_rx_s = T_rx_s;
+              // two points linear interpolation using adjacent (adj) values: y=y1+(x-x1)*(y2-y1)/(x2-x1)
+              double ref_TOW_at_T_rx_s = adj_obs.TOW_at_current_symbol_s + (selected_T_rx_s - ref_adj_T_rx_s)
+                                	    * (d_TOW_reference - adj_obs.TOW_at_current_symbol_s) / (d_ref_T_rx_s - ref_adj_T_rx_s);
+
+              // Now compute RX time differences due to the PRN alignment in the correlators
+              double traveltime_ms;
+              double pseudorange_m;
+              double channel_T_rx_s;
+              double channel_fs_hz;
+              double channel_TOW_s;
+              for(gnss_synchro_map_iter = realigned_gnss_synchro_map.begin(); gnss_synchro_map_iter != realigned_gnss_synchro_map.end(); gnss_synchro_map_iter++)
+                {
+                  channel_fs_hz = (double)gnss_synchro_map_iter->second.fs;
+                  channel_TOW_s = gnss_synchro_map_iter->second.TOW_at_current_symbol_s;
+                  channel_T_rx_s = (double)gnss_synchro_map_iter->second.Tracking_sample_counter / channel_fs_hz + gnss_synchro_map_iter->second.Code_phase_samples / channel_fs_hz;
+                  // compute interpolated observation values
+                  // two points linear interpolation using adjacent (adj) values: y=y1+(x-x1)*(y2-y1)/(x2-x1)
+                  // TOW at the selected receiver time T_rx_s
+                  int element_key = gnss_synchro_map_iter->second.Channel_ID;
+                  adj_obs = adjacent_gnss_synchro_map.at(element_key);
+
+                  double adj_T_rx_s = (double)adj_obs.Tracking_sample_counter / channel_fs_hz + adj_obs.Code_phase_samples / channel_fs_hz;
+
+                  double channel_TOW_at_T_rx_s = adj_obs.TOW_at_current_symbol_s + (selected_T_rx_s - adj_T_rx_s) * (channel_TOW_s - adj_obs.TOW_at_current_symbol_s) / (channel_T_rx_s - adj_T_rx_s);
+
+                  //Doppler and Accumulated carrier phase
+                  double Carrier_phase_lin_rads = adj_obs.Carrier_phase_rads + (selected_T_rx_s - adj_T_rx_s) * (gnss_synchro_map_iter->second.Carrier_phase_rads - adj_obs.Carrier_phase_rads) / (channel_T_rx_s - adj_T_rx_s);
+                  double Carrier_Doppler_lin_hz = adj_obs.Carrier_Doppler_hz + (selected_T_rx_s - adj_T_rx_s) * (gnss_synchro_map_iter->second.Carrier_Doppler_hz - adj_obs.Carrier_Doppler_hz) / (channel_T_rx_s - adj_T_rx_s);
+
+                  //compute the pseudorange (no rx time offset correction)
+                  traveltime_ms = (ref_TOW_at_T_rx_s - channel_TOW_at_T_rx_s) * 1000.0 + GPS_STARTOFFSET_ms;
+                  //convert to meters
+                  pseudorange_m = traveltime_ms * GPS_C_m_ms; // [m]
+                  // update the pseudorange object
+                  current_gnss_synchro[gnss_synchro_map_iter->second.Channel_ID] = gnss_synchro_map_iter->second;
+                  current_gnss_synchro[gnss_synchro_map_iter->second.Channel_ID].Pseudorange_m = pseudorange_m;
+                  current_gnss_synchro[gnss_synchro_map_iter->second.Channel_ID].Flag_valid_pseudorange = true;
+                  // Save the estimated RX time (no RX clock offset correction yet!)
+                  current_gnss_synchro[gnss_synchro_map_iter->second.Channel_ID].RX_time = ref_TOW_at_T_rx_s + GPS_STARTOFFSET_ms / 1000.0;
+
+                  current_gnss_synchro[gnss_synchro_map_iter->second.Channel_ID].Carrier_phase_rads = Carrier_phase_lin_rads;
+                  current_gnss_synchro[gnss_synchro_map_iter->second.Channel_ID].Carrier_Doppler_hz = Carrier_Doppler_lin_hz;
+                }
+
+              if(d_dump == true)
+                {
+                  // MULTIPLEXED FILE RECORDING - Record results to file
+                  try
+                  {
+                      double tmp_double;
+                      for (unsigned int i = 0; i < d_nchannels; i++)
+                        {
+                          tmp_double = current_gnss_synchro[i].RX_time;
+                          d_dump_file.write((char*)&tmp_double, sizeof(double));
+                          tmp_double = current_gnss_synchro[i].TOW_at_current_symbol_s;
+                          d_dump_file.write((char*)&tmp_double, sizeof(double));
+                          tmp_double = current_gnss_synchro[i].Carrier_Doppler_hz;
+                          d_dump_file.write((char*)&tmp_double, sizeof(double));
+                          tmp_double = current_gnss_synchro[i].Carrier_phase_rads/GPS_TWO_PI;
+                          d_dump_file.write((char*)&tmp_double, sizeof(double));
+                          tmp_double = current_gnss_synchro[i].Pseudorange_m;
+                          d_dump_file.write((char*)&tmp_double, sizeof(double));
+                          tmp_double = current_gnss_synchro[i].PRN;
+                          d_dump_file.write((char*)&tmp_double, sizeof(double));
+                          tmp_double = current_gnss_synchro[i].Flag_valid_pseudorange;
+                          d_dump_file.write((char*)&tmp_double, sizeof(double));
+                        }
+                  }
+                  catch (const std::ifstream::failure& e)
+                  {
+                      LOG(WARNING) << "Exception writing observables dump file " << e.what();
+                  }
+                }
+
+              for (unsigned int i = 0; i < d_nchannels; i++)
+                {
+                  out[i][n_outputs] = current_gnss_synchro[i];
+                }
+
+              n_outputs++;
+            }
+
+          //Move RX time
+          T_rx_s = T_rx_s + T_rx_step_s;
+          //pop old elements from queue
+          for (unsigned int i = 0; i < d_nchannels; i++)
+            {
+              while (d_gnss_synchro_history_queue[i].front().Tracking_sample_counter / (double)d_gnss_synchro_history_queue[i].front().fs < (T_rx_s - past_history_s))
+                {
+                  d_gnss_synchro_history_queue[i].pop_front();
+                }
+            }
         }
+    }while(channel_history_ok == true && d_max_noutputs>n_outputs);
 
-    return n_outputs;
+  //Multi-rate consume!
+  for (unsigned int i = 0; i < d_nchannels; i++)
+    {
+      consume(i, n_consume[i]); //which input, how many items
+    }
+
+  return n_outputs;
 }
diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.h b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.h
index 202a8582e..a647b24de 100644
--- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.h
+++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.h
@@ -52,26 +52,26 @@ hybrid_make_observables_cc(unsigned int n_channels, bool dump, std::string dump_
 class hybrid_observables_cc : public gr::block
 {
 public:
-    ~hybrid_observables_cc ();
-    int general_work (int noutput_items, gr_vector_int &ninput_items,
-            gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
+  ~hybrid_observables_cc ();
+  int general_work (int noutput_items, gr_vector_int &ninput_items,
+					gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
 
 private:
-    friend hybrid_observables_cc_sptr
-    hybrid_make_observables_cc(unsigned int nchannels, bool dump, std::string dump_filename, unsigned int deep_history);
-    hybrid_observables_cc(unsigned int nchannels, bool dump, std::string dump_filename, unsigned int deep_history);
+  friend hybrid_observables_cc_sptr
+  hybrid_make_observables_cc(unsigned int nchannels, bool dump, std::string dump_filename, unsigned int deep_history);
+  hybrid_observables_cc(unsigned int nchannels, bool dump, std::string dump_filename, unsigned int deep_history);
 
-    //Tracking observable history
-    std::vector<std::deque<Gnss_Synchro>> d_gnss_synchro_history_queue;
+  //Tracking observable history
+  std::vector<std::deque<Gnss_Synchro>> d_gnss_synchro_history_queue;
 
-    double T_rx_s;
-    double T_rx_step_s;
-    int d_max_noutputs;
-    bool d_dump;
-    unsigned int d_nchannels;
-    unsigned int history_deep;
-    std::string d_dump_filename;
-    std::ofstream d_dump_file;
+  double T_rx_s;
+  double T_rx_step_s;
+  int d_max_noutputs;
+  bool d_dump;
+  unsigned int d_nchannels;
+  unsigned int history_deep;
+  std::string d_dump_filename;
+  std::ofstream d_dump_file;
 };
 
 #endif
diff --git a/src/algorithms/resampler/adapters/CMakeLists.txt b/src/algorithms/resampler/adapters/CMakeLists.txt
index de168eec5..f78d51464 100644
--- a/src/algorithms/resampler/adapters/CMakeLists.txt
+++ b/src/algorithms/resampler/adapters/CMakeLists.txt
@@ -19,7 +19,7 @@
 set(RESAMPLER_ADAPTER_SOURCES direct_resampler_conditioner.cc )
 
 include_directories(
-     $(CMAKE_CURRENT_SOURCE_DIR)
+     ${CMAKE_CURRENT_SOURCE_DIR}
      ${CMAKE_SOURCE_DIR}/src/core/interfaces
      ${CMAKE_SOURCE_DIR}/src/algorithms/resampler/gnuradio_blocks
      ${GLOG_INCLUDE_DIRS}
diff --git a/src/algorithms/resampler/adapters/direct_resampler_conditioner.cc b/src/algorithms/resampler/adapters/direct_resampler_conditioner.cc
index 1e08d02e4..c69eeb43b 100644
--- a/src/algorithms/resampler/adapters/direct_resampler_conditioner.cc
+++ b/src/algorithms/resampler/adapters/direct_resampler_conditioner.cc
@@ -49,13 +49,14 @@ DirectResamplerConditioner::DirectResamplerConditioner(
 {
     std::string default_item_type = "short";
     std::string default_dump_file = "./data/signal_conditioner.dat";
-    double fs_in;
-    fs_in = configuration->property("GNSS-SDR.internal_fs_hz", 2048000.0);
-    sample_freq_in_ = configuration->property(role_ + ".sample_freq_in", (double)4000000.0);
+    double fs_in_deprecated, fs_in;
+    fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000.0);
+    fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
+    sample_freq_in_ = configuration->property(role_ + ".sample_freq_in", 4000000.0);
     sample_freq_out_ = configuration->property(role_ + ".sample_freq_out", fs_in);
     if(std::fabs(fs_in - sample_freq_out_) > std::numeric_limits<double>::epsilon())
         {
-            std::string aux_warn = "CONFIGURATION WARNING: Parameters GNSS-SDR.internal_fs_hz and "
+            std::string aux_warn = "CONFIGURATION WARNING: Parameters GNSS-SDR.internal_fs_sps and "
                     + role_ + ".sample_freq_out are not set to the same value!" ;
             LOG(WARNING) << aux_warn;
             std::cout << aux_warn << std::endl;
diff --git a/src/algorithms/resampler/adapters/direct_resampler_conditioner.h b/src/algorithms/resampler/adapters/direct_resampler_conditioner.h
index 246ec58b8..8a188d506 100644
--- a/src/algorithms/resampler/adapters/direct_resampler_conditioner.h
+++ b/src/algorithms/resampler/adapters/direct_resampler_conditioner.h
@@ -51,23 +51,27 @@ public:
             unsigned int out_stream);
 
     virtual ~DirectResamplerConditioner();
-    std::string role()
+
+    inline std::string role() override
     {
         return role_;
     }
-    //! returns "Direct_Resampler"
-    std::string implementation()
+
+    //! Returns "Direct_Resampler"
+    inline std::string implementation() override
     {
         return "Direct_Resampler";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return item_size_;
     }
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+
+    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_;
diff --git a/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt b/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt
index 13d8427fe..f7d08172e 100644
--- a/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt
+++ b/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt
@@ -24,7 +24,7 @@ set(RESAMPLER_GR_BLOCKS_SOURCES
 )
 
 include_directories(
-     $(CMAKE_CURRENT_SOURCE_DIR)
+     ${CMAKE_CURRENT_SOURCE_DIR}
      ${GLOG_INCLUDE_DIRS}
      ${GFlags_INCLUDE_DIRS}
      ${GNURADIO_RUNTIME_INCLUDE_DIRS}
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 a3e3687c6..bfda13b4e 100644
--- a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.cc
+++ b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.cc
@@ -50,6 +50,7 @@ direct_resampler_conditioner_cb_sptr direct_resampler_make_conditioner_cb(
                     sample_freq_out));
 }
 
+
 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,
@@ -60,79 +61,80 @@ direct_resampler_conditioner_cb::direct_resampler_conditioner_cb(
     const double two_32 = 4294967296.0;
     // Computes the phase step multiplying the resampling ratio by 2^32 = 4294967296
     if (d_sample_freq_in >= d_sample_freq_out)
-    {
-        d_phase_step = static_cast<uint32_t>(floor(two_32 * sample_freq_out / sample_freq_in));
-    }
+        {
+            d_phase_step = static_cast<uint32_t>(floor(two_32 * sample_freq_out / sample_freq_in));
+        }
     else
-    {
-        d_phase_step = static_cast<uint32_t>(floor(two_32 * sample_freq_in / sample_freq_out));
-    }
+        {
+            d_phase_step = static_cast<uint32_t>(floor(two_32 * sample_freq_in / sample_freq_out));
+        }
 
     set_relative_rate(1.0 * sample_freq_out / sample_freq_in);
     set_output_multiple(1);
 }
 
+
 direct_resampler_conditioner_cb::~direct_resampler_conditioner_cb()
 {
 
 }
 
+
 void direct_resampler_conditioner_cb::forecast(int noutput_items,
         gr_vector_int &ninput_items_required)
 {
-
     int nreqd = std::max(static_cast<unsigned>(1), static_cast<int>(static_cast<double>(noutput_items + 1)
             * sample_freq_in() / sample_freq_out()) + history() - 1);
     unsigned ninputs = ninput_items_required.size();
 
     for (unsigned i = 0; i < ninputs; i++)
-    {
-        ninput_items_required[i] = nreqd;
-    }
+        {
+            ninput_items_required[i] = nreqd;
+        }
 }
 
+
 int direct_resampler_conditioner_cb::general_work(int noutput_items,
         gr_vector_int &ninput_items, gr_vector_const_void_star &input_items,
         gr_vector_void_star &output_items)
 {
-
-    const lv_8sc_t *in = (const lv_8sc_t *)input_items[0];
-    lv_8sc_t *out = (lv_8sc_t *)output_items[0];
+    const lv_8sc_t *in = reinterpret_cast<const lv_8sc_t *>(input_items[0]);
+    lv_8sc_t *out = reinterpret_cast<lv_8sc_t *>(output_items[0]);
 
     int lcv = 0;
     int count = 0;
 
     if (d_sample_freq_in >= d_sample_freq_out)
-    {
-        while ((lcv < noutput_items))
         {
-            if (d_phase <= d_lphase)
-            {
-                out[lcv] = *in;
-                lcv++;
-            }
+            while ((lcv < noutput_items))
+                {
+                    if (d_phase <= d_lphase)
+                        {
+                            out[lcv] = *in;
+                            lcv++;
+                        }
 
-            d_lphase = d_phase;
-            d_phase += d_phase_step;
-            in++;
-            count++;
+                    d_lphase = d_phase;
+                    d_phase += d_phase_step;
+                    in++;
+                    count++;
+                }
         }
-    }
     else
-    {
-        while ((lcv < noutput_items))
         {
-            d_lphase = d_phase;
-            d_phase += d_phase_step;
-            if (d_phase <= d_lphase)
-            {
-                in++;
-                count++;
-            }
-            out[lcv] = *in;
-            lcv++;
+            while ((lcv < noutput_items))
+                {
+                    d_lphase = d_phase;
+                    d_phase += d_phase_step;
+                    if (d_phase <= d_lphase)
+                        {
+                            in++;
+                            count++;
+                        }
+                    out[lcv] = *in;
+                    lcv++;
+                }
         }
-    }
 
     consume_each(std::min(count, ninput_items[0]));
     return lcv;
diff --git a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.h b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.h
index 8565d9473..8420c3973 100644
--- a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.h
+++ b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.h
@@ -49,9 +49,7 @@ direct_resampler_make_conditioner_cb(double sample_freq_in,
  */
 class direct_resampler_conditioner_cb: public gr::block
 {
-
 private:
-
     friend direct_resampler_conditioner_cb_sptr
     direct_resampler_make_conditioner_cb(double sample_freq_in,
             double sample_freq_out);
@@ -67,18 +65,20 @@ private:
             double sample_freq_out);
 
 public:
-
     ~direct_resampler_conditioner_cb();
 
-    unsigned int sample_freq_in() const
+    inline unsigned int sample_freq_in() const
     {
         return d_sample_freq_in;
     }
-    unsigned int sample_freq_out() const
+
+    inline unsigned int sample_freq_out() const
     {
         return d_sample_freq_out;
     }
+
     void forecast(int noutput_items, gr_vector_int &ninput_items_required);
+
     int general_work(int noutput_items, gr_vector_int &ninput_items,
             gr_vector_const_void_star &input_items,
             gr_vector_void_star &output_items);
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 828a11a58..569f3fc14 100644
--- a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.cc
+++ b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.cc
@@ -43,7 +43,6 @@ using google::LogMessage;
 direct_resampler_conditioner_cc_sptr direct_resampler_make_conditioner_cc(
         double sample_freq_in, double sample_freq_out)
 {
-
     return direct_resampler_conditioner_cc_sptr(
             new direct_resampler_conditioner_cc(sample_freq_in,
              sample_freq_out));
@@ -90,9 +89,9 @@ void direct_resampler_conditioner_cc::forecast(int noutput_items,
             * sample_freq_in() / sample_freq_out()) + history() - 1);
     unsigned ninputs = ninput_items_required.size();
     for (unsigned i = 0; i < ninputs; i++)
-    {
-        ninput_items_required[i] = nreqd;
-    }
+        {
+            ninput_items_required[i] = nreqd;
+        }
 }
 
 
@@ -101,8 +100,8 @@ int direct_resampler_conditioner_cc::general_work(int noutput_items,
         gr_vector_int &ninput_items, gr_vector_const_void_star &input_items,
         gr_vector_void_star &output_items)
 {
-    const gr_complex *in = (const gr_complex *)input_items[0];
-    gr_complex *out = (gr_complex *)output_items[0];
+    const gr_complex *in = reinterpret_cast<const gr_complex *>(input_items[0]);
+    gr_complex *out = reinterpret_cast<gr_complex *>(output_items[0]);
 
     int lcv = 0;
     int count = 0;
diff --git a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.h b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.h
index c53b0cf9d..626abcdeb 100644
--- a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.h
+++ b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.h
@@ -70,15 +70,18 @@ private:
 
 public:
     ~direct_resampler_conditioner_cc();
-    unsigned int sample_freq_in() const
+    inline unsigned int sample_freq_in() const
     {
         return d_sample_freq_in;
     }
-    unsigned int sample_freq_out() const
+
+    inline unsigned int sample_freq_out() const
     {
         return d_sample_freq_out;
     }
+
     void forecast(int noutput_items, gr_vector_int &ninput_items_required);
+    
     int general_work(int noutput_items, gr_vector_int &ninput_items,
             gr_vector_const_void_star &input_items,
             gr_vector_void_star &output_items);
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 1ed0872ba..e0e808e0c 100644
--- a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.cc
+++ b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.cc
@@ -43,12 +43,12 @@ using google::LogMessage;
 direct_resampler_conditioner_cs_sptr direct_resampler_make_conditioner_cs(
         double sample_freq_in, double sample_freq_out)
 {
-
     return direct_resampler_conditioner_cs_sptr(
             new direct_resampler_conditioner_cs(sample_freq_in,
                     sample_freq_out));
 }
 
+
 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,
@@ -59,79 +59,80 @@ direct_resampler_conditioner_cs::direct_resampler_conditioner_cs(
     const double two_32 = 4294967296.0;
     // Computes the phase step multiplying the resampling ratio by 2^32 = 4294967296
     if (d_sample_freq_in >= d_sample_freq_out)
-    {
-        d_phase_step = static_cast<uint32_t>(floor(two_32 * sample_freq_out / sample_freq_in));
-    }
+        {
+            d_phase_step = static_cast<uint32_t>(floor(two_32 * sample_freq_out / sample_freq_in));
+        }
     else
-    {
-        d_phase_step = static_cast<uint32_t>(floor(two_32 * sample_freq_in / sample_freq_out));
-    }
+        {
+            d_phase_step = static_cast<uint32_t>(floor(two_32 * sample_freq_in / sample_freq_out));
+        }
 
     set_relative_rate(1.0 * sample_freq_out / sample_freq_in);
     set_output_multiple(1);
 }
 
+
 direct_resampler_conditioner_cs::~direct_resampler_conditioner_cs()
 {
 
 }
 
+
 void direct_resampler_conditioner_cs::forecast(int noutput_items,
         gr_vector_int &ninput_items_required)
 {
-
     int nreqd = std::max(static_cast<unsigned>(1), static_cast<int>(static_cast<double>(noutput_items + 1)
             * sample_freq_in() / sample_freq_out()) + history() - 1);
     unsigned ninputs = ninput_items_required.size();
 
     for (unsigned i = 0; i < ninputs; i++)
-    {
-        ninput_items_required[i] = nreqd;
-    }
+        {
+            ninput_items_required[i] = nreqd;
+        }
 }
 
+
 int direct_resampler_conditioner_cs::general_work(int noutput_items,
         gr_vector_int &ninput_items, gr_vector_const_void_star &input_items,
         gr_vector_void_star &output_items)
 {
-
-    const lv_16sc_t *in = (const lv_16sc_t *)input_items[0];
-    lv_16sc_t *out = (lv_16sc_t *)output_items[0];
+    const lv_16sc_t *in = reinterpret_cast<const lv_16sc_t *>(input_items[0]);
+    lv_16sc_t *out = reinterpret_cast<lv_16sc_t *>(output_items[0]);
 
     int lcv = 0;
     int count = 0;
 
     if (d_sample_freq_in >= d_sample_freq_out)
-    {
-        while ((lcv < noutput_items))
         {
-            if (d_phase <= d_lphase)
-            {
-                out[lcv] = *in;
-                lcv++;
-            }
+            while ((lcv < noutput_items))
+                {
+                    if (d_phase <= d_lphase)
+                        {
+                            out[lcv] = *in;
+                            lcv++;
+                        }
 
-            d_lphase = d_phase;
-            d_phase += d_phase_step;
-            in++;
-            count++;
+                    d_lphase = d_phase;
+                    d_phase += d_phase_step;
+                    in++;
+                    count++;
+                }
         }
-    }
     else
-    {
-        while ((lcv < noutput_items))
         {
-            d_lphase = d_phase;
-            d_phase += d_phase_step;
-            if (d_phase <= d_lphase)
-            {
-                in++;
-                count++;
-            }
-            out[lcv] = *in;
-            lcv++;
+            while ((lcv < noutput_items))
+                {
+                    d_lphase = d_phase;
+                    d_phase += d_phase_step;
+                    if (d_phase <= d_lphase)
+                        {
+                            in++;
+                            count++;
+                        }
+                    out[lcv] = *in;
+                    lcv++;
+                }
         }
-    }
 
     consume_each(std::min(count, ninput_items[0]));
     return lcv;
diff --git a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.h b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.h
index 3e648b427..63969553a 100644
--- a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.h
+++ b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.h
@@ -49,9 +49,7 @@ direct_resampler_make_conditioner_cs(double sample_freq_in,
  */
 class direct_resampler_conditioner_cs: public gr::block
 {
-
 private:
-
     friend direct_resampler_conditioner_cs_sptr
     direct_resampler_make_conditioner_cs(double sample_freq_in,
             double sample_freq_out);
@@ -67,18 +65,20 @@ private:
             double sample_freq_out);
 
 public:
-
     ~direct_resampler_conditioner_cs();
 
-    unsigned int sample_freq_in() const
+    inline unsigned int sample_freq_in() const
     {
         return d_sample_freq_in;
     }
-    unsigned int sample_freq_out() const
+
+    inline unsigned int sample_freq_out() const
     {
         return d_sample_freq_out;
     }
+
     void forecast(int noutput_items, gr_vector_int &ninput_items_required);
+    
     int general_work(int noutput_items, gr_vector_int &ninput_items,
             gr_vector_const_void_star &input_items,
             gr_vector_void_star &output_items);
diff --git a/src/algorithms/signal_generator/adapters/CMakeLists.txt b/src/algorithms/signal_generator/adapters/CMakeLists.txt
index c55031d1a..e81249232 100644
--- a/src/algorithms/signal_generator/adapters/CMakeLists.txt
+++ b/src/algorithms/signal_generator/adapters/CMakeLists.txt
@@ -19,7 +19,7 @@
 set(SIGNAL_GENERATOR_ADAPTER_SOURCES signal_generator.cc)
 
 include_directories(
-     $(CMAKE_CURRENT_SOURCE_DIR)
+     ${CMAKE_CURRENT_SOURCE_DIR}
      ${CMAKE_SOURCE_DIR}/src/core/system_parameters
      ${CMAKE_SOURCE_DIR}/src/core/interfaces
      ${CMAKE_SOURCE_DIR}/src/core/receiver
diff --git a/src/algorithms/signal_generator/adapters/signal_generator.cc b/src/algorithms/signal_generator/adapters/signal_generator.cc
index affa75705..35ecfdddc 100644
--- a/src/algorithms/signal_generator/adapters/signal_generator.cc
+++ b/src/algorithms/signal_generator/adapters/signal_generator.cc
@@ -87,19 +87,19 @@ SignalGenerator::SignalGenerator(ConfigurationInterface* configuration,
         {
             if (signal1[0].at(0)=='5')
                 {
-                    vector_length = round((float) fs_in / (Galileo_E5a_CODE_CHIP_RATE_HZ
+                    vector_length = round(static_cast<float>(fs_in) / (Galileo_E5a_CODE_CHIP_RATE_HZ
                             / Galileo_E5a_CODE_LENGTH_CHIPS));
                 }
             else
                 {
-                    vector_length = round((float)fs_in / (Galileo_E1_CODE_CHIP_RATE_HZ
+                    vector_length = round(static_cast<float>(fs_in) / (Galileo_E1_CODE_CHIP_RATE_HZ
                             / Galileo_E1_B_CODE_LENGTH_CHIPS))
                                               * Galileo_E1_C_SECONDARY_CODE_LENGTH;
                 }
         }
     else if (std::find(system.begin(), system.end(), "G") != system.end())
         {
-            vector_length = round((float)fs_in
+            vector_length = round(static_cast<float>(fs_in)
                     / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS));
         }
 
diff --git a/src/algorithms/signal_generator/adapters/signal_generator.h b/src/algorithms/signal_generator/adapters/signal_generator.h
index 623a28180..97815b393 100644
--- a/src/algorithms/signal_generator/adapters/signal_generator.h
+++ b/src/algorithms/signal_generator/adapters/signal_generator.h
@@ -57,27 +57,29 @@ public:
             unsigned int out_stream, boost::shared_ptr<gr::msg_queue> queue);
 
     virtual ~SignalGenerator();
-    std::string role()
+
+    inline std::string role() override
     {
         return role_;
     }
 
     /*!
-* \brief Returns "GNSSSignalGenerator".
-*/
-    std::string implementation()
+     * \brief Returns "GNSSSignalGenerator".
+     */
+    inline std::string implementation() override
     {
         return "GNSSSignalGenerator";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return item_size_;
     }
 
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+    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_;
diff --git a/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt b/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt
index 8086e3672..f0417f7b4 100644
--- a/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt
+++ b/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt
@@ -19,7 +19,7 @@
 set(SIGNAL_GENERATOR_BLOCK_SOURCES signal_generator_c.cc)
 
 include_directories(
-     $(CMAKE_CURRENT_SOURCE_DIR)
+     ${CMAKE_CURRENT_SOURCE_DIR}
      ${CMAKE_SOURCE_DIR}/src/core/system_parameters
      ${CMAKE_SOURCE_DIR}/src/core/interfaces
      ${CMAKE_SOURCE_DIR}/src/core/receiver
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 74a1cf9f2..86f488588 100644
--- a/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc
+++ b/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc
@@ -15,7 +15,7 @@
 * 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.
+* (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
@@ -29,11 +29,9 @@
 */
 
 #include "signal_generator_c.h"
-#include <cstdlib>
 #include <iostream>
 #include <fstream>
 #include <gnuradio/io_signature.h>
-//#include <volk/volk.h>
 #include <volk_gnsssdr/volk_gnsssdr.h>
 #include "gps_sdr_signal_processing.h"
 #include "galileo_e1_signal_processing.h"
@@ -131,6 +129,8 @@ void signal_generator_c::init()
                 }
         }
     random_ = new gr::random();
+    std::default_random_engine e1(r());
+    std::uniform_int_distribution<int> uniform_dist(0, RAND_MAX);
 }
 
 
@@ -254,7 +254,7 @@ int signal_generator_c::general_work (int noutput_items __attribute__((unused)),
         gr_vector_const_void_star &input_items __attribute__((unused)),
         gr_vector_void_star &output_items)
 {
-    gr_complex *out = (gr_complex *) output_items[0];
+    gr_complex *out = reinterpret_cast<gr_complex *>(output_items[0]);
 
     work_counter_++;
 
@@ -295,7 +295,7 @@ int signal_generator_c::general_work (int noutput_items __attribute__((unused)),
                             if (ms_counter_[sat] == 0 && data_flag_)
                                 {
                                     // New random data bit
-                                    current_data_bits_[sat] = gr_complex((rand() % 2) == 0 ? 1 : -1, 0);
+                                    current_data_bits_[sat] = gr_complex((uniform_dist(e1) % 2) == 0 ? 1 : -1, 0);
                                 }
 
                             for (k = delay_samples; k < samples_per_code_[sat]; k++)
@@ -330,7 +330,7 @@ int signal_generator_c::general_work (int noutput_items __attribute__((unused)),
                             if (ms_counter_[sat]%data_bit_duration_ms_[sat] == 0 && data_flag_)
                                 {
                                     // New random data bit
-                                    current_data_bit_int_[sat] = (rand()%2) == 0 ? 1 : -1;
+                                    current_data_bit_int_[sat] = (uniform_dist(e1)%2) == 0 ? 1 : -1;
                                 }
                             data_modulation_[sat] = current_data_bit_int_[sat] * (Galileo_E5a_I_SECONDARY_CODE.at((ms_counter_[sat]+delay_sec_[sat]) % 20) == '0' ? 1 : -1);
                             pilot_modulation_[sat] = (Galileo_E5a_Q_SECONDARY_CODE[PRN_[sat] - 1].at((ms_counter_[sat] + delay_sec_[sat]) % 100) == '0' ? 1 : -1);
@@ -362,7 +362,7 @@ int signal_generator_c::general_work (int noutput_items __attribute__((unused)),
                                     if (ms_counter_[sat] == 0 && data_flag_)
                                         {
                                             // New random data bit
-                                            current_data_bits_[sat] = gr_complex((rand() % 2) == 0 ? 1 : -1, 0);
+                                            current_data_bits_[sat] = gr_complex((uniform_dist(e1) % 2) == 0 ? 1 : -1, 0);
                                         }
 
                                     for (k = delay_samples; k < samples_per_code_[sat]; k++)
diff --git a/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.h b/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.h
index e35dd0229..01357e08c 100644
--- a/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.h
+++ b/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.h
@@ -33,6 +33,7 @@
 
 #include <string>
 #include <vector>
+#include <random>
 #include <boost/scoped_array.hpp>
 #include <gnuradio/random.h>
 #include <gnuradio/block.h>
@@ -122,6 +123,9 @@ private:
     gr_complex* complex_phase_;
 
     unsigned int work_counter_;
+    std::random_device r;
+    std::default_random_engine e1;
+    std::uniform_int_distribution<int> uniform_dist;
 
 public:
     ~signal_generator_c();    // public destructor
@@ -135,4 +139,3 @@ public:
 };
 
 #endif /* GNSS_SDR_SIGNAL_GENERATOR_C_H */
-
diff --git a/src/algorithms/signal_source/adapters/file_signal_source.cc b/src/algorithms/signal_source/adapters/file_signal_source.cc
index e4d16190a..42591ec79 100644
--- a/src/algorithms/signal_source/adapters/file_signal_source.cc
+++ b/src/algorithms/signal_source/adapters/file_signal_source.cc
@@ -31,7 +31,6 @@
  */
 
 #include "file_signal_source.h"
-#include <cstdlib>
 #include <iostream>
 #include <fstream>
 #include <iomanip>
diff --git a/src/algorithms/signal_source/adapters/file_signal_source.h b/src/algorithms/signal_source/adapters/file_signal_source.h
index 434db7f92..85c9104db 100644
--- a/src/algorithms/signal_source/adapters/file_signal_source.h
+++ b/src/algorithms/signal_source/adapters/file_signal_source.h
@@ -58,7 +58,8 @@ public:
             boost::shared_ptr<gr::msg_queue> queue);
 
     virtual ~FileSignalSource();
-    std::string role()
+
+    inline std::string role() override
     {
         return role_;
     }
@@ -66,35 +67,42 @@ public:
     /*!
      * \brief Returns "File_Signal_Source".
      */
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "File_Signal_Source";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return item_size_;
     }
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
-    std::string filename()
+
+    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;
+
+    inline std::string filename() const
     {
         return filename_;
     }
-    std::string item_type()
+
+    inline std::string item_type() const
     {
         return item_type_;
     }
-    bool repeat()
+
+    inline bool repeat() const
     {
         return repeat_;
     }
-    long sampling_frequency()
+
+    inline long sampling_frequency() const
     {
         return sampling_frequency_;
     }
-    long samples()
+
+    inline long samples() const
     {
         return samples_;
     }
diff --git a/src/algorithms/signal_source/adapters/flexiband_signal_source.h b/src/algorithms/signal_source/adapters/flexiband_signal_source.h
index a621d8ea3..5949f8cb0 100644
--- a/src/algorithms/signal_source/adapters/flexiband_signal_source.h
+++ b/src/algorithms/signal_source/adapters/flexiband_signal_source.h
@@ -57,7 +57,8 @@ public:
             unsigned int out_stream, gr::msg_queue::sptr queue);
 
     virtual ~FlexibandSignalSource();
-    std::string role()
+
+    inline std::string role() override
     {
         return role_;
     }
@@ -65,19 +66,21 @@ public:
     /*!
      * \brief Returns "Flexiband_Signal_Source".
      */
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "Flexiband_Signal_Source";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return item_size_;
     }
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
-    gr::basic_block_sptr get_right_block(int RF_channel);
+
+    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;
+    gr::basic_block_sptr get_right_block(int RF_channel) override;
 
 private:
     std::string role_;
diff --git a/src/algorithms/signal_source/adapters/gen_signal_source.h b/src/algorithms/signal_source/adapters/gen_signal_source.h
index b607f0320..034155bf0 100644
--- a/src/algorithms/signal_source/adapters/gen_signal_source.h
+++ b/src/algorithms/signal_source/adapters/gen_signal_source.h
@@ -52,18 +52,18 @@ public:
     //! Virtual destructor
     virtual ~GenSignalSource();
 
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+    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;
 
-    std::string role(){ return role_; }
+    inline std::string role() override { return role_; }
 
     //! Returns "Signal Source"
-    std::string implementation(){ return "Signal Source"; }
-    size_t item_size(){ return 0; }
+    inline std::string implementation() override { return "Signal Source"; }
+    inline size_t item_size() override { return 0; }
 
-    GNSSBlockInterface *signal_generator(){ return signal_generator_; }
+    inline GNSSBlockInterface *signal_generator() const { return signal_generator_; }
 
 private:
     GNSSBlockInterface *signal_generator_;
diff --git a/src/algorithms/signal_source/adapters/gn3s_signal_source.h b/src/algorithms/signal_source/adapters/gn3s_signal_source.h
index c8a566e7b..af6ab2714 100644
--- a/src/algorithms/signal_source/adapters/gn3s_signal_source.h
+++ b/src/algorithms/signal_source/adapters/gn3s_signal_source.h
@@ -52,7 +52,8 @@ public:
             unsigned int out_stream, gr::msg_queue::sptr queue);
 
     virtual ~Gn3sSignalSource();
-    std::string role()
+
+    inline std::string role() override
     {
         return role_;
     }
@@ -60,18 +61,20 @@ public:
     /*!
      * \brief Returns "Gn3sSignalSource".
      */
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "Gn3sSignalSource";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return item_size_;
     }
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+
+    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_;
diff --git a/src/algorithms/signal_source/adapters/nsr_file_signal_source.cc b/src/algorithms/signal_source/adapters/nsr_file_signal_source.cc
index 86b81b65a..d721d4c4a 100644
--- a/src/algorithms/signal_source/adapters/nsr_file_signal_source.cc
+++ b/src/algorithms/signal_source/adapters/nsr_file_signal_source.cc
@@ -31,7 +31,6 @@
  */
 
 #include "nsr_file_signal_source.h"
-#include <cstdlib>
 #include <exception>
 #include <fstream>
 #include <iomanip>
@@ -123,7 +122,7 @@ NsrFileSignalSource::NsrFileSignalSource(ConfigurationInterface* configuration,
             if (file.is_open())
                 {
                     size = file.tellg();
-                    LOG(INFO) << "Total samples in the file= " << floor((double)size / (double)item_size());
+                    LOG(INFO) << "Total samples in the file= " << floor(static_cast<double>(size) / static_cast<double>(item_size()));
                 }
             else
                 {
@@ -132,20 +131,20 @@ NsrFileSignalSource::NsrFileSignalSource(ConfigurationInterface* configuration,
                 }
             std::streamsize ss = std::cout.precision();
             std::cout << std::setprecision(16);
-            std::cout << "Processing file " << filename_ << ", which contains " << (double)size << " [bytes]" << std::endl;
+            std::cout << "Processing file " << filename_ << ", which contains " << size << " [bytes]" << std::endl;
             std::cout.precision (ss);
 
             if (size > 0)
                 {
                     int sample_packet_factor = 4; // 1 byte -> 4 samples
-                    samples_ = floor((double)size / (double)item_size())*sample_packet_factor;
-                    samples_ = samples_- ceil(0.002 * (double)sampling_frequency_); //process all the samples available in the file excluding the last 2 ms
+                    samples_ = floor(static_cast<double>(size) / static_cast<double>(item_size())) * sample_packet_factor;
+                    samples_ = samples_- ceil(0.002 * static_cast<double>(sampling_frequency_)); //process all the samples available in the file excluding the last 2 ms
                 }
         }
 
     CHECK(samples_ > 0) << "File does not contain enough samples to process.";
     double signal_duration_s;
-    signal_duration_s = (double)samples_ * ( 1 /(double)sampling_frequency_);
+    signal_duration_s = static_cast<double>(samples_) * ( 1 /static_cast<double>(sampling_frequency_));
     LOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]";
     std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]" << std::endl;
 
diff --git a/src/algorithms/signal_source/adapters/nsr_file_signal_source.h b/src/algorithms/signal_source/adapters/nsr_file_signal_source.h
index fabaa10f4..8ca419c91 100644
--- a/src/algorithms/signal_source/adapters/nsr_file_signal_source.h
+++ b/src/algorithms/signal_source/adapters/nsr_file_signal_source.h
@@ -59,7 +59,7 @@ public:
             boost::shared_ptr<gr::msg_queue> queue);
 
     virtual ~NsrFileSignalSource();
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
@@ -67,35 +67,42 @@ public:
     /*!
      * \brief Returns "Nsr_File_Signal_Source".
      */
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "Nsr_File_Signal_Source";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return item_size_;
     }
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
-    std::string filename()
+
+    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;
+
+    inline std::string filename() const
     {
         return filename_;
     }
-    std::string item_type()
+
+    inline std::string item_type() const
     {
         return item_type_;
     }
-    bool repeat()
+
+    inline bool repeat() const
     {
         return repeat_;
     }
-    long sampling_frequency()
+
+    inline long sampling_frequency() const
     {
         return sampling_frequency_;
     }
-    long samples()
+
+    inline long samples() const
     {
         return samples_;
     }
diff --git a/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc b/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc
index 4365b1bbc..ea8adef3d 100644
--- a/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc
+++ b/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc
@@ -60,10 +60,10 @@ OsmosdrSignalSource::OsmosdrSignalSource(ConfigurationInterface* configuration,
     // OSMOSDR Driver parameters
     AGC_enabled_ = configuration->property(role + ".AGC_enabled", true);
     freq_ = configuration->property(role + ".freq", GPS_L1_FREQ_HZ);
-    gain_ = configuration->property(role + ".gain", (double)40.0);
-    rf_gain_ = configuration->property(role + ".rf_gain", (double)40.0);
-    if_gain_ = configuration->property(role + ".if_gain", (double)40.0);
-    sample_rate_ = configuration->property(role + ".sampling_frequency", (double)2.0e6);
+    gain_ = configuration->property(role + ".gain", 40.0);
+    rf_gain_ = configuration->property(role + ".rf_gain", 40.0);
+    if_gain_ = configuration->property(role + ".if_gain", 40.0);
+    sample_rate_ = configuration->property(role + ".sampling_frequency", 2.0e6);
     item_type_ = configuration->property(role + ".item_type", default_item_type);
     osmosdr_args_ = configuration->property(role + ".osmosdr_args", std::string( ));
 
@@ -75,19 +75,7 @@ OsmosdrSignalSource::OsmosdrSignalSource(ConfigurationInterface* configuration,
         {
             item_size_ = sizeof(gr_complex);
             // 1. Make the driver instance
-            try
-            {
-                    if (!osmosdr_args_.empty())
-                        {
-                        std::cout << "OsmoSdr arguments: " << osmosdr_args_ << std::endl;
-                        LOG(INFO) << "OsmoSdr arguments: " << osmosdr_args_;
-                        }
-                    osmosdr_source_ = osmosdr::source::make(osmosdr_args_);
-            }
-            catch( boost::exception & e )
-            {
-                    DLOG(FATAL) << "Boost exception: " << boost::diagnostic_information(e);
-            }
+            OsmosdrSignalSource::driver_instance();
 
             // 2 set sampling rate
             osmosdr_source_->set_sample_rate(sample_rate_);
@@ -147,6 +135,24 @@ OsmosdrSignalSource::~OsmosdrSignalSource()
 {}
 
 
+void OsmosdrSignalSource::driver_instance()
+{
+    try
+    {
+            if (!osmosdr_args_.empty())
+                {
+                    std::cout << "OsmoSdr arguments: " << osmosdr_args_ << std::endl;
+                    LOG(INFO) << "OsmoSdr arguments: " << osmosdr_args_;
+                }
+            osmosdr_source_ = osmosdr::source::make(osmosdr_args_);
+    }
+    catch( const boost::exception & e )
+    {
+            LOG(WARNING) << "Boost exception: " << boost::diagnostic_information(e);
+            throw std::invalid_argument( "Wrong OsmoSdr arguments" );
+    }
+}
+
 
 void OsmosdrSignalSource::connect(gr::top_block_sptr top_block)
 {
diff --git a/src/algorithms/signal_source/adapters/osmosdr_signal_source.h b/src/algorithms/signal_source/adapters/osmosdr_signal_source.h
index 886d713d7..e60834d01 100644
--- a/src/algorithms/signal_source/adapters/osmosdr_signal_source.h
+++ b/src/algorithms/signal_source/adapters/osmosdr_signal_source.h
@@ -33,6 +33,7 @@
 #ifndef GNSS_SDR_OSMOSDR_SIGNAL_SOURCE_H_
 #define GNSS_SDR_OSMOSDR_SIGNAL_SOURCE_H_
 
+#include <stdexcept>
 #include <string>
 #include <boost/shared_ptr.hpp>
 #include <gnuradio/msg_queue.h>
@@ -56,7 +57,7 @@ public:
 
     virtual ~OsmosdrSignalSource();
 
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
@@ -64,21 +65,23 @@ public:
     /*!
      * \brief Returns "Osmosdr_Signal_Source"
      */
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "Osmosdr_Signal_Source";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return item_size_;
     }
 
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+    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:
+    void driver_instance();
     std::string role_;
 
     // Front-end settings
diff --git a/src/algorithms/signal_source/adapters/raw_array_signal_source.h b/src/algorithms/signal_source/adapters/raw_array_signal_source.h
index 93501273f..fe813aa8f 100644
--- a/src/algorithms/signal_source/adapters/raw_array_signal_source.h
+++ b/src/algorithms/signal_source/adapters/raw_array_signal_source.h
@@ -52,7 +52,8 @@ public:
             unsigned int out_stream, gr::msg_queue::sptr queue);
 
     virtual ~RawArraySignalSource();
-    std::string role()
+
+    inline std::string role() override
     {
         return role_;
     }
@@ -60,18 +61,20 @@ public:
     /*!
      * \brief Returns "RawArraySignalSource".
      */
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "Raw_Array_Signal_Source";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return item_size_;
     }
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+
+    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_;
diff --git a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc
index bfa5da504..38da90196 100644
--- a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc
+++ b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc
@@ -61,10 +61,10 @@ RtlTcpSignalSource::RtlTcpSignalSource(ConfigurationInterface* configuration,
     short default_port = 1234;
     AGC_enabled_ = configuration->property(role + ".AGC_enabled", true);
     freq_ = configuration->property(role + ".freq", GPS_L1_FREQ_HZ);
-    gain_ = configuration->property(role + ".gain", (double)40.0);
-    rf_gain_ = configuration->property(role + ".rf_gain", (double)40.0);
-    if_gain_ = configuration->property(role + ".if_gain", (double)40.0);
-    sample_rate_ = configuration->property(role + ".sampling_frequency", (double)2.0e6);
+    gain_ = configuration->property(role + ".gain", 40.0);
+    rf_gain_ = configuration->property(role + ".rf_gain", 40.0);
+    if_gain_ = configuration->property(role + ".if_gain", 40.0);
+    sample_rate_ = configuration->property(role + ".sampling_frequency", 2.0e6);
     item_type_ = configuration->property(role + ".item_type", default_item_type);
     address_ = configuration->property(role + ".address", default_address);
     port_ = configuration->property(role + ".port", default_port);
@@ -78,16 +78,7 @@ RtlTcpSignalSource::RtlTcpSignalSource(ConfigurationInterface* configuration,
         {
             item_size_ = sizeof(gr_complex);
             // 1. Make the gr block
-            try
-            {
-                    std::cout << "Connecting to " << address_ << ":" << port_ << std::endl;
-                    LOG (INFO) << "Connecting to " << address_ << ":" << port_;
-                    signal_source_ = rtl_tcp_make_signal_source_c (address_, port_, flip_iq_);
-            }
-            catch( boost::exception & e )
-            {
-                    DLOG(FATAL) << "Boost exception: " << boost::diagnostic_information(e);
-            }
+            MakeBlock();
 
             // 2 set sampling rate
             signal_source_->set_sample_rate(sample_rate_);
@@ -145,6 +136,22 @@ RtlTcpSignalSource::~RtlTcpSignalSource()
 {}
 
 
+void RtlTcpSignalSource::MakeBlock()
+{
+    try
+    {
+            std::cout << "Connecting to " << address_ << ":" << port_ << std::endl;
+            LOG (INFO) << "Connecting to " << address_ << ":" << port_;
+            signal_source_ = rtl_tcp_make_signal_source_c (address_, port_, flip_iq_);
+    }
+    catch( const boost::exception & e )
+    {
+            LOG(WARNING) << "Boost exception: " << boost::diagnostic_information(e);
+            throw std::runtime_error( "Failure connecting to the device" );
+    }
+}
+
+
 void RtlTcpSignalSource::connect(gr::top_block_sptr top_block)
 {
     if ( samples_ )
diff --git a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.h b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.h
index 8635d0b0b..283f84ae9 100644
--- a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.h
+++ b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.h
@@ -32,6 +32,7 @@
 #ifndef GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_H
 #define GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_H
 
+#include <stdexcept>
 #include <string>
 #include <boost/shared_ptr.hpp>
 #include <gnuradio/msg_queue.h>
@@ -57,7 +58,7 @@ public:
 
     virtual ~RtlTcpSignalSource();
 
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
@@ -65,21 +66,23 @@ public:
     /*!
      * \brief Returns "RtlTcp_Signal_Source"
      */
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "RtlTcp_Signal_Source";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return item_size_;
     }
 
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+    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:
+    void MakeBlock();
     std::string role_;
 
     // rtl_tcp settings
diff --git a/src/algorithms/signal_source/adapters/spir_file_signal_source.cc b/src/algorithms/signal_source/adapters/spir_file_signal_source.cc
index c8bb32ff8..e2e461376 100644
--- a/src/algorithms/signal_source/adapters/spir_file_signal_source.cc
+++ b/src/algorithms/signal_source/adapters/spir_file_signal_source.cc
@@ -30,7 +30,6 @@
  */
 
 #include "spir_file_signal_source.h"
-#include <cstdlib>
 #include <exception>
 #include <fstream>
 #include <iomanip>
@@ -122,7 +121,7 @@ SpirFileSignalSource::SpirFileSignalSource(ConfigurationInterface* configuration
             if (file.is_open())
                 {
                     size = file.tellg();
-                    LOG(INFO) << "Total samples in the file= " << floor((double)size / (double)item_size());
+                    LOG(INFO) << "Total samples in the file= " << floor(static_cast<double>(size) / static_cast<double>(item_size()));
                 }
             else
                 {
@@ -131,20 +130,20 @@ SpirFileSignalSource::SpirFileSignalSource(ConfigurationInterface* configuration
                 }
             std::streamsize ss = std::cout.precision();
             std::cout << std::setprecision(16);
-            std::cout << "Processing file " << filename_ << ", which contains " << (double)size << " [bytes]" << std::endl;
+            std::cout << "Processing file " << filename_ << ", which contains " << size << " [bytes]" << std::endl;
             std::cout.precision (ss);
 
             if (size > 0)
                 {
                     int sample_packet_factor = 1; // 1 int -> 1 complex sample (I&Q from 1 channel)
-                    samples_ = floor((double)size / (double)item_size())*sample_packet_factor;
-                    samples_ = samples_- ceil(0.002 * (double)sampling_frequency_); //process all the samples available in the file excluding the last 2 ms
+                    samples_ = floor(static_cast<double>(size) / static_cast<double>(item_size())) * sample_packet_factor;
+                    samples_ = samples_- ceil(0.002 * static_cast<double>(sampling_frequency_)); //process all the samples available in the file excluding the last 2 ms
                 }
         }
 
     CHECK(samples_ > 0) << "File does not contain enough samples to process.";
     double signal_duration_s;
-    signal_duration_s = (double)samples_ * ( 1 /(double)sampling_frequency_);
+    signal_duration_s = static_cast<double>(samples_) * ( 1 /static_cast<double>(sampling_frequency_));
     LOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]";
     std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]" << std::endl;
 
diff --git a/src/algorithms/signal_source/adapters/spir_file_signal_source.h b/src/algorithms/signal_source/adapters/spir_file_signal_source.h
index 5cc88d24b..f620a40c9 100644
--- a/src/algorithms/signal_source/adapters/spir_file_signal_source.h
+++ b/src/algorithms/signal_source/adapters/spir_file_signal_source.h
@@ -56,7 +56,7 @@ public:
             boost::shared_ptr<gr::msg_queue> queue);
 
     virtual ~SpirFileSignalSource();
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
@@ -64,35 +64,42 @@ public:
     /*!
      * \brief Returns "Spir_File_Signal_Source".
      */
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "Spir_File_Signal_Source";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return item_size_;
     }
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
-    std::string filename()
+
+    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;
+
+    inline std::string filename() const
     {
         return filename_;
     }
-    std::string item_type()
+
+    inline std::string item_type() const
     {
         return item_type_;
     }
-    bool repeat()
+
+    inline bool repeat() const
     {
         return repeat_;
     }
-    long sampling_frequency()
+
+    inline long sampling_frequency() const
     {
         return sampling_frequency_;
     }
-    long samples()
+
+    inline long samples() const
     {
         return samples_;
     }
diff --git a/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.cc b/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.cc
index 97e320e9b..a797edfa4 100644
--- a/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.cc
+++ b/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.cc
@@ -30,7 +30,6 @@
  */
 
 #include "two_bit_cpx_file_signal_source.h"
-#include <cstdlib>
 #include <exception>
 #include <fstream>
 #include <iomanip>
@@ -43,9 +42,6 @@
 
 using google::LogMessage;
 
-//DEFINE_string(two_bit_cpx_signal_source, "-",
-//        "If defined, path to the file containing the NSR (byte to 2-bit packed) signal samples (overrides the configuration file)");
-
 
 TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(ConfigurationInterface* configuration,
         std::string role, unsigned int in_streams, unsigned int out_streams,
@@ -123,7 +119,7 @@ TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(ConfigurationInterface* con
             if (file.is_open())
                 {
                     size = file.tellg();
-                    LOG(INFO) << "Total samples in the file= " << floor((double)size / (double)item_size());
+                    LOG(INFO) << "Total samples in the file= " << floor(static_cast<double>(size) / static_cast<double>(item_size()));
                 }
             else
                 {
@@ -132,20 +128,20 @@ TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(ConfigurationInterface* con
                 }
             std::streamsize ss = std::cout.precision();
             std::cout << std::setprecision(16);
-            std::cout << "Processing file " << filename_ << ", which contains " << (double)size << " [bytes]" << std::endl;
+            std::cout << "Processing file " << filename_ << ", which contains " << size << " [bytes]" << std::endl;
             std::cout.precision (ss);
 
             if (size > 0)
                 {
                     int sample_packet_factor = 2; // 1 byte -> 2 samples
-                    samples_ = floor((double)size / (double)item_size())*sample_packet_factor;
-                    samples_ = samples_- ceil(0.002 * (double)sampling_frequency_); //process all the samples available in the file excluding the last 2 ms
+                    samples_ = floor(static_cast<double>(size) / static_cast<double>(item_size())) * sample_packet_factor;
+                    samples_ = samples_- ceil(0.002 * static_cast<double>(sampling_frequency_)); //process all the samples available in the file excluding the last 2 ms
                 }
         }
 
     CHECK(samples_ > 0) << "File does not contain enough samples to process.";
     double signal_duration_s;
-    signal_duration_s = (double)samples_ * ( 1 /(double)sampling_frequency_);
+    signal_duration_s = static_cast<double>(samples_) * ( 1 /static_cast<double>(sampling_frequency_));
     LOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]";
     std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]" << std::endl;
 
@@ -237,10 +233,6 @@ void TwoBitCpxFileSignalSource::connect(gr::top_block_sptr top_block)
 }
 
 
-
-
-
-
 void TwoBitCpxFileSignalSource::disconnect(gr::top_block_sptr top_block)
 {
     if (samples_ > 0)
diff --git a/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.h b/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.h
index a7f8d1adc..674bb24de 100644
--- a/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.h
+++ b/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.h
@@ -60,7 +60,7 @@ public:
             boost::shared_ptr<gr::msg_queue> queue);
 
     virtual ~TwoBitCpxFileSignalSource();
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
@@ -68,35 +68,42 @@ public:
     /*!
      * \brief Returns "Two_Bit_Cpx_File_Signal_Source".
      */
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "Two_Bit_Cpx_File_Signal_Source";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return item_size_;
     }
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
-    std::string filename()
+
+    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;
+
+    inline std::string filename() const
     {
         return filename_;
     }
-    std::string item_type()
+
+    inline std::string item_type() const
     {
         return item_type_;
     }
-    bool repeat()
+
+    inline bool repeat() const
     {
         return repeat_;
     }
-    long sampling_frequency()
+
+    inline long sampling_frequency() const
     {
         return sampling_frequency_;
     }
-    long samples()
+
+    inline long samples() const
     {
         return samples_;
     }
diff --git a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc
index 9fa6361f9..d4550d4fe 100644
--- a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc
+++ b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc
@@ -31,7 +31,6 @@
  */
 
 #include "two_bit_packed_file_signal_source.h"
-#include <cstdlib>
 #include <exception>
 #include <fstream>
 #include <iomanip>
@@ -45,9 +44,6 @@
 
 using google::LogMessage;
 
-//DEFINE_string(two_bit_packed_signal_source, "-",
-//        "If defined, path to the file containing the NSR (byte to 2-bit packed) signal samples (overrides the configuration file)");
-
 
 TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterface* configuration,
         std::string role, unsigned int in_streams, unsigned int out_streams,
@@ -70,7 +66,7 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac
     item_type_ = configuration->property(role + ".item_type", default_item_type);
     big_endian_items_ = configuration->property(role + ".big_endian_items", true);
     big_endian_bytes_ = configuration->property(role + ".big_endian_bytes", false);
-    sample_type_  = configuration->property(role + ".sample_type", default_sample_type ); // options: "real", "iq", "qi"
+    sample_type_ = configuration->property(role + ".sample_type", default_sample_type ); // options: "real", "iq", "qi"
     repeat_ = configuration->property(role + ".repeat", false);
     dump_ = configuration->property(role + ".dump", false);
     dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
@@ -87,13 +83,13 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac
             // If we have shorts stored in little endian format, might as
             // well read them in as bytes.
             if( big_endian_items_ )
-            {
-                item_size_ = sizeof(short);
-            }
+                {
+                    item_size_ = sizeof(short);
+                }
             else
-            {
-                item_size_ = sizeof(char);
-            }
+                {
+                    item_size_ = sizeof(char);
+                }
         }
     else
         {
@@ -102,51 +98,51 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac
         }
 
     if( sample_type_.compare("real") == 0 )
-    {
-        is_complex_ = false;
-    }
+        {
+            is_complex_ = false;
+        }
     else if( sample_type_.compare("iq" ) == 0 )
-    {
-        is_complex_ = true;
-        reverse_interleaving_ = false;
-    }
+        {
+            is_complex_ = true;
+            reverse_interleaving_ = false;
+        }
     else if( sample_type_.compare("qi") == 0 )
-    {
-        is_complex_ = true;
-        reverse_interleaving_ = true;
-    }
+        {
+            is_complex_ = true;
+            reverse_interleaving_ = true;
+        }
     else
-    {
-        LOG(WARNING) << sample_type_ << " unrecognized sample type. Assuming: "
-            << ( is_complex_ ? ( reverse_interleaving_ ? "qi" : "iq" ) : "real" );
-    }
+        {
+            LOG(WARNING) << sample_type_ << " unrecognized sample type. Assuming: "
+                    << ( is_complex_ ? ( reverse_interleaving_ ? "qi" : "iq" ) : "real" );
+        }
     try
     {
             file_source_ = gr::blocks::file_source::make(item_size_, filename_.c_str(), repeat_);
 
             if( seconds_to_skip > 0 )
-            {
-                bytes_to_skip = static_cast< long >(
-                        seconds_to_skip * sampling_frequency_ / 4 );
-                if( is_complex_ )
                 {
-                    bytes_to_skip <<= 1;
+                    bytes_to_skip = static_cast< long >(
+                            seconds_to_skip * sampling_frequency_ / 4 );
+                    if( is_complex_ )
+                        {
+                            bytes_to_skip <<= 1;
+                        }
+                    file_source_->seek( bytes_to_skip, SEEK_SET );
                 }
-                file_source_->seek( bytes_to_skip, SEEK_SET );
-            }
 
             unpack_samples_ = make_unpack_2bit_samples( big_endian_bytes_,
                     item_size_, big_endian_items_, reverse_interleaving_);
             if( is_complex_ )
-            {
-                char_to_float_ =
-                    gr::blocks::interleaved_char_to_complex::make(false);
-            }
+                {
+                    char_to_float_ =
+                            gr::blocks::interleaved_char_to_complex::make(false);
+                }
             else
-            {
-                char_to_float_ =
-                    gr::blocks::char_to_float::make();
-            }
+                {
+                    char_to_float_ =
+                            gr::blocks::char_to_float::make();
+                }
 
     }
     catch (const std::exception &e)
@@ -168,12 +164,14 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac
             << std::endl;
 
             LOG(WARNING) << "file_signal_source: Unable to open the samples file "
-                         << filename_.c_str() << ", exiting the program.";
+                    << filename_.c_str() << ", exiting the program.";
             throw(e);
     }
 
     DLOG(INFO) << "file_source(" << file_source_->unique_id() << ")";
 
+    size_t output_item_size = ( is_complex_ ? sizeof( gr_complex ) : sizeof( float ) );
+
     if (samples_ == 0) // read all file
         {
             /*!
@@ -187,7 +185,7 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac
             if (file.is_open())
                 {
                     size = file.tellg();
-                    samples_ = floor((double)size * ( is_complex_ ? 2.0 : 4.0 ) );
+                    samples_ = floor(static_cast<double>(size) * ( is_complex_ ? 2.0 : 4.0 ) );
                     LOG(INFO) << "Total samples in the file= " << samples_; // 4 samples per byte
                     samples_ -= bytes_to_skip;
 
@@ -201,29 +199,29 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac
                 }
             std::streamsize ss = std::cout.precision();
             std::cout << std::setprecision(16);
-            std::cout << "Processing file " << filename_ << ", which contains " << (double)size << " [bytes]" << std::endl;
+            std::cout << "Processing file " << filename_ << ", which contains " << size << " [bytes]" << std::endl;
             std::cout.precision (ss);
         }
 
     CHECK(samples_ > 0) << "File does not contain enough samples to process.";
     double signal_duration_s;
-    signal_duration_s = (double)samples_ * ( 1 /(double)sampling_frequency_);
+    signal_duration_s = static_cast<double>(samples_) * ( 1 /static_cast<double>(sampling_frequency_));
     LOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]";
     std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]" << std::endl;
 
-    valve_ = gnss_sdr_make_valve(sizeof(gr_complex), samples_, queue_);
+    valve_ = gnss_sdr_make_valve(output_item_size, samples_, queue_);
     DLOG(INFO) << "valve(" << valve_->unique_id() << ")";
 
     if (dump_)
         {
             //sink_ = gr_make_file_sink(item_size_, dump_filename_.c_str());
-            sink_ = gr::blocks::file_sink::make(sizeof(gr_complex), dump_filename_.c_str());
+            sink_ = gr::blocks::file_sink::make(output_item_size, dump_filename_.c_str());
             DLOG(INFO) << "file_sink(" << sink_->unique_id() << ")";
         }
 
     if (enable_throttle_control_)
         {
-            throttle_ = gr::blocks::throttle::make(sizeof(gr_complex), sampling_frequency_);
+            throttle_ = gr::blocks::throttle::make(output_item_size, sampling_frequency_);
         }
     DLOG(INFO) << "File source filename " << filename_;
     DLOG(INFO) << "Samples " << samples_;
@@ -255,20 +253,20 @@ void TwoBitPackedFileSignalSource::connect(gr::top_block_sptr top_block)
     DLOG(INFO) << "connected unpack samples to char to float";
 
     if( enable_throttle_control_ )
-    {
-        right_block = throttle_;
-        top_block->connect( left_block, 0, right_block, 0 );
-        left_block = right_block;
-        DLOG(INFO) << " connected to throttle";
-    }
+        {
+            right_block = throttle_;
+            top_block->connect( left_block, 0, right_block, 0 );
+            left_block = right_block;
+            DLOG(INFO) << " connected to throttle";
+        }
 
     top_block->connect(left_block, 0, valve_, 0);
     DLOG(INFO) << "connected to valve";
     if (dump_)
-    {
-        top_block->connect(valve_, 0, sink_, 0);
-        DLOG(INFO) << "connected valve to file sink";
-    }
+        {
+            top_block->connect(valve_, 0, sink_, 0);
+            DLOG(INFO) << "connected valve to file sink";
+        }
 }
 
 
@@ -288,20 +286,20 @@ void TwoBitPackedFileSignalSource::disconnect(gr::top_block_sptr top_block)
     DLOG(INFO) << "disconnected unpack samples to char to float";
 
     if( enable_throttle_control_ )
-    {
-        right_block = throttle_;
-        top_block->disconnect( left_block, 0, right_block, 0 );
-        left_block = right_block;
-        DLOG(INFO) << " disconnected to throttle";
-    }
+        {
+            right_block = throttle_;
+            top_block->disconnect( left_block, 0, right_block, 0 );
+            left_block = right_block;
+            DLOG(INFO) << " disconnected to throttle";
+        }
 
     top_block->disconnect(left_block, 0, valve_, 0);
     DLOG(INFO) << "disconnected to valve";
     if (dump_)
-    {
-        top_block->disconnect(valve_, 0, sink_, 0);
-        DLOG(INFO) << "disconnected valve to file sink";
-    }
+        {
+            top_block->disconnect(valve_, 0, sink_, 0);
+            DLOG(INFO) << "disconnected valve to file sink";
+        }
 }
 
 
diff --git a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h
index 48a365c61..397010311 100644
--- a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h
+++ b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h
@@ -61,7 +61,7 @@ public:
             boost::shared_ptr<gr::msg_queue> queue);
 
     virtual ~TwoBitPackedFileSignalSource();
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
@@ -69,51 +69,62 @@ public:
     /*!
      * \brief Returns "Two_Bit_Packed_File_Signal_Source".
      */
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "Two_Bit_Packed_File_Signal_Source";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return item_size_;
     }
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
-    std::string filename()
+
+    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;
+
+    inline std::string filename() const
     {
         return filename_;
     }
-    std::string item_type()
+
+    inline std::string item_type() const
     {
         return item_type_;
     }
-    bool repeat()
+
+    inline bool repeat() const
     {
         return repeat_;
     }
-    long sampling_frequency()
+
+    inline long sampling_frequency() const
     {
         return sampling_frequency_;
     }
-    long samples()
+
+    inline long samples() const
     {
         return samples_;
     }
-    bool big_endian_items()
+
+    inline bool big_endian_items() const
     {
         return big_endian_items_;
     }
-    bool big_endian_bytes()
+
+    inline bool big_endian_bytes() const
     {
         return big_endian_bytes_;
     }
-    bool is_complex()
+
+    inline bool is_complex() const
     {
         return is_complex_;
     }
-    bool reverse_interleaving()
+
+    inline bool reverse_interleaving() const
     {
         return reverse_interleaving_;
     }
@@ -147,4 +158,3 @@ private:
 };
 
 #endif /*GNSS_SDR_TWO_BIT_CPX_FILE_SIGNAL_SOURCE_H_*/
-
diff --git a/src/algorithms/signal_source/adapters/uhd_signal_source.cc b/src/algorithms/signal_source/adapters/uhd_signal_source.cc
index 4728543d3..8a3658281 100644
--- a/src/algorithms/signal_source/adapters/uhd_signal_source.cc
+++ b/src/algorithms/signal_source/adapters/uhd_signal_source.cc
@@ -62,11 +62,16 @@ UhdSignalSource::UhdSignalSource(ConfigurationInterface* configuration,
         {
             dev_addr["addr"] = device_address_;
         }
-
+    //filter the device by serial number if required (useful for USB devices)
+    std::string device_serial = configuration->property(role + ".device_serial", empty);
+    if (empty.compare(device_serial) != 0) // if not empty
+        {
+            dev_addr["serial"] = device_serial;
+        }
     subdevice_ = configuration->property(role + ".subdevice", empty);
     clock_source_ = configuration->property(role + ".clock_source", std::string("internal"));
     RF_channels_ = configuration->property(role + ".RF_channels", 1);
-    sample_rate_ = configuration->property(role + ".sampling_frequency", (double)4.0e6);
+    sample_rate_ = configuration->property(role + ".sampling_frequency", 4.0e6);
     item_type_ = configuration->property(role + ".item_type", default_item_type);
 
     if (RF_channels_ == 1)
@@ -77,7 +82,7 @@ UhdSignalSource::UhdSignalSource(ConfigurationInterface* configuration,
             dump_filename_.push_back(configuration->property(role + ".dump_filename", default_dump_file));
 
             freq_.push_back(configuration->property(role + ".freq", GPS_L1_FREQ_HZ));
-            gain_.push_back(configuration->property(role + ".gain", (double)50.0));
+            gain_.push_back(configuration->property(role + ".gain", 50.0));
 
             IF_bandwidth_hz_.push_back(configuration->property(role + ".IF_bandwidth_hz", sample_rate_/2));
 
@@ -93,7 +98,7 @@ UhdSignalSource::UhdSignalSource(ConfigurationInterface* configuration,
                     dump_filename_.push_back(configuration->property(role + ".dump_filename" + boost::lexical_cast<std::string>(i), default_dump_file));
 
                     freq_.push_back(configuration->property(role + ".freq" + boost::lexical_cast<std::string>(i), GPS_L1_FREQ_HZ));
-                    gain_.push_back(configuration->property(role + ".gain" + boost::lexical_cast<std::string>(i), (double)50.0));
+                    gain_.push_back(configuration->property(role + ".gain" + boost::lexical_cast<std::string>(i), 50.0));
 
                     IF_bandwidth_hz_.push_back(configuration->property(role + ".IF_bandwidth_hz" + boost::lexical_cast<std::string>(i), sample_rate_/2));
                 }
diff --git a/src/algorithms/signal_source/adapters/uhd_signal_source.h b/src/algorithms/signal_source/adapters/uhd_signal_source.h
index cda8c0270..94a622218 100644
--- a/src/algorithms/signal_source/adapters/uhd_signal_source.h
+++ b/src/algorithms/signal_source/adapters/uhd_signal_source.h
@@ -55,7 +55,7 @@ public:
 
     virtual ~UhdSignalSource();
 
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
@@ -63,23 +63,23 @@ public:
     /*!
      * \brief Returns "UHD_Signal_Source"
      */
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "UHD_Signal_Source";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return item_size_;
     }
 
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
-    gr::basic_block_sptr get_right_block(int RF_channel);
+    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;
+    gr::basic_block_sptr get_right_block(int RF_channel) override;
 
 private:
-
     std::string role_;
     unsigned int in_stream_;
     unsigned int out_stream_;
diff --git a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt
index 417f08d17..4159321f3 100644
--- a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt
+++ b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt
@@ -26,7 +26,7 @@ set(SIGNAL_SOURCE_GR_BLOCKS_SOURCES
 )
 
 include_directories(
-     $(CMAKE_CURRENT_SOURCE_DIR)
+     ${CMAKE_CURRENT_SOURCE_DIR}
      ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/libs
      ${GLOG_INCLUDE_DIRS}
      ${GFlags_INCLUDE_DIRS}
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 52e565a28..ba4cce424 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
@@ -76,7 +76,7 @@ rtl_tcp_signal_source_c::rtl_tcp_signal_source_c(const std::string &address,
     // 1. Setup lookup table
     for (unsigned i = 0; i < 0xff; i++)
         {
-            lookup_[i] = ((float)(i & 0xff) - 127.4f) * (1.0f / 128.0f);
+            lookup_[i] = (static_cast<float>(i & 0xff) - 127.4f) * (1.0f / 128.0f);
         }
 
     // 2. Set socket options
diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.cc b/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.cc
index df79dc8a3..b41996bcf 100644
--- a/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.cc
+++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.cc
@@ -40,12 +40,14 @@ struct byte_2bit_struct
   signed sample_3:2;  // <- 2 bits wide only
 };
 
+
 union byte_and_samples
 {
     int8_t byte;
     byte_2bit_struct samples;
 };
 
+
 bool systemIsBigEndian()
 {
     union
@@ -57,6 +59,7 @@ bool systemIsBigEndian()
     return test_int.c[0] == 1; 
 }
 
+
 bool systemBytesAreBigEndian()
 {
     byte_and_samples b;
@@ -65,6 +68,7 @@ bool systemBytesAreBigEndian()
     else return true;
 }
 
+
 void swapEndianness( int8_t const *in, std::vector< int8_t > &out, size_t item_size, unsigned int ninput_items )
 {
     unsigned int i;
@@ -74,16 +78,17 @@ void swapEndianness( int8_t const *in, std::vector< int8_t > &out, size_t item_s
     size_t skip = item_size - 1;
 
     for( i = 0; i < ninput_items; ++i )
-    {
-        k = j + skip;
-        l = j;
-        while( k >= l )
         {
-            out[j++] = in[k--];
+            k = j + skip;
+            l = j;
+            while( k >= l )
+                {
+                    out[j++] = in[k--];
+                }
         }
-    }
 }
 
+
 unpack_2bit_samples_sptr make_unpack_2bit_samples( bool big_endian_bytes,
                                                    size_t item_size,
                                                    bool big_endian_items,
@@ -97,6 +102,7 @@ unpack_2bit_samples_sptr make_unpack_2bit_samples( bool big_endian_bytes,
             );
 }
 
+
 unpack_2bit_samples::unpack_2bit_samples( bool big_endian_bytes,
                                           size_t item_size,
                                           bool big_endian_items,
@@ -111,7 +117,6 @@ unpack_2bit_samples::unpack_2bit_samples( bool big_endian_bytes,
       swap_endian_items_(false),
       reverse_interleaving_(reverse_interleaving)
 {
-
     bool big_endian_system = systemIsBigEndian();
 
     // Only swap the item bytes if the item size > 1 byte and the system 
@@ -122,30 +127,31 @@ unpack_2bit_samples::unpack_2bit_samples( bool big_endian_bytes,
     bool big_endian_bytes_system = systemBytesAreBigEndian();
 
     swap_endian_bytes_ = ( big_endian_bytes_system != big_endian_bytes_ );
-
 }
 
+
 unpack_2bit_samples::~unpack_2bit_samples()
 {}
 
+
 int unpack_2bit_samples::work(int noutput_items,
                                    gr_vector_const_void_star &input_items,
                                    gr_vector_void_star &output_items)
 {
-    signed char const *in = (signed char const *)input_items[0];
-    int8_t *out = (int8_t*)output_items[0];
+    signed char const *in = reinterpret_cast<signed char const *>(input_items[0]);
+    int8_t *out = reinterpret_cast<int8_t*>(output_items[0]);
 
     size_t ninput_bytes = noutput_items/4;
     size_t ninput_items = ninput_bytes/item_size_;
-    
+
     // Handle endian swap if needed
     if( swap_endian_items_ )
-    {
-        work_buffer_.reserve( ninput_bytes );
-        swapEndianness( in, work_buffer_, item_size_, ninput_items );
+        {
+            work_buffer_.reserve( ninput_bytes );
+            swapEndianness( in, work_buffer_, item_size_, ninput_items );
 
-        in = const_cast< signed char const *> ( &work_buffer_[0] );
-    }
+            in = const_cast< signed char const *> ( &work_buffer_[0] );
+        }
 
     // Here the in pointer can be interpreted as a stream of bytes to be
     // converted. But we now have two possibilities:
@@ -156,68 +162,63 @@ int unpack_2bit_samples::work(int noutput_items,
     int n = 0;
 
     if( !reverse_interleaving_ )
-    {
-        if( swap_endian_bytes_ )
         {
-            for(unsigned int i = 0; i < ninput_bytes; ++i)
-            {
-                // Read packed input sample (1 byte = 4 samples)
-                raw_byte.byte = in[i];
+            if( swap_endian_bytes_ )
+                {
+                    for(unsigned int i = 0; i < ninput_bytes; ++i)
+                        {
+                            // Read packed input sample (1 byte = 4 samples)
+                            raw_byte.byte = in[i];
 
-                out[n++] = (int8_t)( 2*raw_byte.samples.sample_3 + 1 );
-                out[n++] = (int8_t)( 2*raw_byte.samples.sample_2 + 1 );
-                out[n++] = (int8_t)( 2*raw_byte.samples.sample_1 + 1 );
-                out[n++] = (int8_t)( 2*raw_byte.samples.sample_0 + 1 );
+                            out[n++] = static_cast<int8_t>( 2*raw_byte.samples.sample_3 + 1 );
+                            out[n++] = static_cast<int8_t>( 2*raw_byte.samples.sample_2 + 1 );
+                            out[n++] = static_cast<int8_t>( 2*raw_byte.samples.sample_1 + 1 );
+                            out[n++] = static_cast<int8_t>( 2*raw_byte.samples.sample_0 + 1 );
+                        }
+                }
+            else
+                {
+                    for(unsigned int i = 0; i < ninput_bytes; ++i )
+                        {
+                            // Read packed input sample (1 byte = 4 samples)
+                            raw_byte.byte = in[i];
 
-            }
+                            out[n++] = static_cast<int8_t>( 2*raw_byte.samples.sample_0 + 1 );
+                            out[n++] = static_cast<int8_t>( 2*raw_byte.samples.sample_1 + 1 );
+                            out[n++] = static_cast<int8_t>( 2*raw_byte.samples.sample_2 + 1 );
+                            out[n++] = static_cast<int8_t>( 2*raw_byte.samples.sample_3 + 1 );
+                        }
+                }
         }
-        else
-        {
-            for(unsigned int i = 0; i < ninput_bytes; ++i )
-            {
-
-                // Read packed input sample (1 byte = 4 samples)
-                raw_byte.byte = in[i];
-
-                out[n++] = (int8_t)( 2*raw_byte.samples.sample_0 + 1 );
-                out[n++] = (int8_t)( 2*raw_byte.samples.sample_1 + 1 );
-                out[n++] = (int8_t)( 2*raw_byte.samples.sample_2 + 1 );
-                out[n++] = (int8_t)( 2*raw_byte.samples.sample_3 + 1 );
-            }
-        }
-    }
     else
-    {
-
-        if( swap_endian_bytes_ )
         {
-            for(unsigned int i = 0; i < ninput_bytes; ++i)
-            {
-                // Read packed input sample (1 byte = 4 samples)
-                raw_byte.byte = in[i];
+            if( swap_endian_bytes_ )
+                {
+                    for(unsigned int i = 0; i < ninput_bytes; ++i)
+                        {
+                            // Read packed input sample (1 byte = 4 samples)
+                            raw_byte.byte = in[i];
 
-                out[n++] = (int8_t)( 2*raw_byte.samples.sample_2 + 1 );
-                out[n++] = (int8_t)( 2*raw_byte.samples.sample_3 + 1 );
-                out[n++] = (int8_t)( 2*raw_byte.samples.sample_0 + 1 );
-                out[n++] = (int8_t)( 2*raw_byte.samples.sample_1 + 1 );
+                            out[n++] = static_cast<int8_t>( 2*raw_byte.samples.sample_2 + 1 );
+                            out[n++] = static_cast<int8_t>( 2*raw_byte.samples.sample_3 + 1 );
+                            out[n++] = static_cast<int8_t>( 2*raw_byte.samples.sample_0 + 1 );
+                            out[n++] = static_cast<int8_t>( 2*raw_byte.samples.sample_1 + 1 );
+                        }
+                }
+            else
+                {
+                    for(unsigned int i = 0; i < ninput_bytes; ++i )
+                        {
+                            // Read packed input sample (1 byte = 4 samples)
+                            raw_byte.byte = in[i];
 
-            }
+                            out[n++] = static_cast<int8_t>( 2*raw_byte.samples.sample_1 + 1 );
+                            out[n++] = static_cast<int8_t>( 2*raw_byte.samples.sample_0 + 1 );
+                            out[n++] = static_cast<int8_t>( 2*raw_byte.samples.sample_3 + 1 );
+                            out[n++] = static_cast<int8_t>( 2*raw_byte.samples.sample_2 + 1 );
+                        }
+                }
         }
-        else
-        {
-            for(unsigned int i = 0; i < ninput_bytes; ++i )
-            {
-
-                // Read packed input sample (1 byte = 4 samples)
-                raw_byte.byte = in[i];
-
-                out[n++] = (int8_t)( 2*raw_byte.samples.sample_1 + 1 );
-                out[n++] = (int8_t)( 2*raw_byte.samples.sample_0 + 1 );
-                out[n++] = (int8_t)( 2*raw_byte.samples.sample_3 + 1 );
-                out[n++] = (int8_t)( 2*raw_byte.samples.sample_2 + 1 );
-            }
-        }
-    }
 
     return noutput_items;
 }
diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_cpx_samples.cc b/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_cpx_samples.cc
index 64a21da35..d654817eb 100644
--- a/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_cpx_samples.cc
+++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_cpx_samples.cc
@@ -47,21 +47,24 @@ unpack_byte_2bit_cpx_samples_sptr make_unpack_byte_2bit_cpx_samples()
     return unpack_byte_2bit_cpx_samples_sptr(new unpack_byte_2bit_cpx_samples());
 }
 
+
 unpack_byte_2bit_cpx_samples::unpack_byte_2bit_cpx_samples() : sync_interpolator("unpack_byte_2bit_cpx_samples",
         gr::io_signature::make(1, 1, sizeof(signed char)),
         gr::io_signature::make(1, 1, sizeof(short)),
         4)
 {}
 
+
 unpack_byte_2bit_cpx_samples::~unpack_byte_2bit_cpx_samples()
 {}
 
+
 int unpack_byte_2bit_cpx_samples::work(int noutput_items,
         gr_vector_const_void_star &input_items,
         gr_vector_void_star &output_items)
 {
-    const signed char *in = (const signed char *)input_items[0];
-    short *out = (short*)output_items[0];
+    const signed char *in = reinterpret_cast<const signed char *>(input_items[0]);
+    short *out = reinterpret_cast<short *>(output_items[0]);
 
     byte_2bit_struct sample;
     int n = 0;
@@ -91,16 +94,16 @@ int unpack_byte_2bit_cpx_samples::work(int noutput_items,
             signed char c = in[i];
             //I[n]
             sample.two_bit_sample = (c >> 4) & 3;
-            out[n++] = (2*(short)sample.two_bit_sample + 1);
+            out[n++] = (2 * static_cast<short>(sample.two_bit_sample) + 1);
             //Q[n]
             sample.two_bit_sample = (c >> 6) & 3;
-            out[n++] = (2*(short)sample.two_bit_sample + 1);
+            out[n++] = (2 * static_cast<short>(sample.two_bit_sample) + 1);
             //I[n+1]
             sample.two_bit_sample = c & 3;
-            out[n++] = (2*(short)sample.two_bit_sample + 1);
+            out[n++] = (2 * static_cast<short>(sample.two_bit_sample) + 1);
             //Q[n+1]
             sample.two_bit_sample = (c >> 2) & 3;
-            out[n++] = (2*(short)sample.two_bit_sample + 1);
+            out[n++] = (2 * static_cast<short>(sample.two_bit_sample) + 1);
         }
     return noutput_items;
 }
diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_samples.cc b/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_samples.cc
index 8a2d5344c..95f1af202 100644
--- a/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_samples.cc
+++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_samples.cc
@@ -59,8 +59,8 @@ int unpack_byte_2bit_samples::work(int noutput_items,
         gr_vector_const_void_star &input_items,
         gr_vector_void_star &output_items)
 {
-    const signed char *in = (const signed char *)input_items[0];
-    float *out = (float*)output_items[0];
+    const signed char *in = reinterpret_cast<const signed char *>(input_items[0]);
+    float *out = reinterpret_cast<float *>(output_items[0]);
 
     byte_2bit_struct sample;
     int n = 0;
@@ -69,16 +69,16 @@ int unpack_byte_2bit_samples::work(int noutput_items,
             // Read packed input sample (1 byte = 4 samples)
             signed char c = in[i];
             sample.two_bit_sample = c & 3;
-            out[n++] = (float)sample.two_bit_sample;
+            out[n++] = static_cast<float>(sample.two_bit_sample);
 
             sample.two_bit_sample = (c>>2) & 3;
-            out[n++] = (float)sample.two_bit_sample;
+            out[n++] = static_cast<float>(sample.two_bit_sample);
 
             sample.two_bit_sample = (c>>4) & 3;
-            out[n++] = (float)sample.two_bit_sample;
+            out[n++] = static_cast<float>(sample.two_bit_sample);
 
             sample.two_bit_sample = (c>>6) & 3;
-            out[n++] = (float)sample.two_bit_sample;
+            out[n++] = static_cast<float>(sample.two_bit_sample);
         }
     return noutput_items;
 }
diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_intspir_1bit_samples.cc b/src/algorithms/signal_source/gnuradio_blocks/unpack_intspir_1bit_samples.cc
index 20afb3c41..9bbd4e8b1 100644
--- a/src/algorithms/signal_source/gnuradio_blocks/unpack_intspir_1bit_samples.cc
+++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_intspir_1bit_samples.cc
@@ -55,8 +55,8 @@ int unpack_intspir_1bit_samples::work(int noutput_items,
         gr_vector_const_void_star &input_items,
         gr_vector_void_star &output_items)
 {
-    const signed int *in = (const signed int *)input_items[0];
-    float *out = (float*)output_items[0];
+    const signed int *in = reinterpret_cast<const signed int *>(input_items[0]);
+    float *out = reinterpret_cast<float*>(output_items[0]);
 
     int n = 0;
     int channel = 1;
diff --git a/src/algorithms/signal_source/libs/CMakeLists.txt b/src/algorithms/signal_source/libs/CMakeLists.txt
index 7d6c9b4ef..1ecb1edfd 100644
--- a/src/algorithms/signal_source/libs/CMakeLists.txt
+++ b/src/algorithms/signal_source/libs/CMakeLists.txt
@@ -21,7 +21,7 @@ set (SIGNAL_SOURCE_LIB_SOURCES
   rtl_tcp_dongle_info.cc)
 
 include_directories(
-     $(CMAKE_CURRENT_SOURCE_DIR)
+     ${CMAKE_CURRENT_SOURCE_DIR}
      ${Boost_INCLUDE_DIRS}
 )
 
diff --git a/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt b/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt
index 24c7374f1..974adfb53 100644
--- a/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt
+++ b/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt
@@ -25,7 +25,7 @@ set(TELEMETRY_DECODER_ADAPTER_SOURCES
 )
 
 include_directories(
-     $(CMAKE_CURRENT_SOURCE_DIR)
+     ${CMAKE_CURRENT_SOURCE_DIR}
      ${CMAKE_SOURCE_DIR}/src/core/system_parameters
      ${CMAKE_SOURCE_DIR}/src/core/interfaces
      ${CMAKE_SOURCE_DIR}/src/core/receiver
diff --git a/src/algorithms/telemetry_decoder/adapters/galileo_e1b_telemetry_decoder.cc b/src/algorithms/telemetry_decoder/adapters/galileo_e1b_telemetry_decoder.cc
index 053bce863..5de974a85 100644
--- a/src/algorithms/telemetry_decoder/adapters/galileo_e1b_telemetry_decoder.cc
+++ b/src/algorithms/telemetry_decoder/adapters/galileo_e1b_telemetry_decoder.cc
@@ -67,7 +67,7 @@ GalileoE1BTelemetryDecoder::~GalileoE1BTelemetryDecoder()
 {}
 
 
-void GalileoE1BTelemetryDecoder::set_satellite(Gnss_Satellite satellite)
+void GalileoE1BTelemetryDecoder::set_satellite(const Gnss_Satellite & satellite)
 {
     satellite_ = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
     telemetry_decoder_->set_satellite(satellite_);
diff --git a/src/algorithms/telemetry_decoder/adapters/galileo_e1b_telemetry_decoder.h b/src/algorithms/telemetry_decoder/adapters/galileo_e1b_telemetry_decoder.h
index deb2035d5..571fd09b8 100644
--- a/src/algorithms/telemetry_decoder/adapters/galileo_e1b_telemetry_decoder.h
+++ b/src/algorithms/telemetry_decoder/adapters/galileo_e1b_telemetry_decoder.h
@@ -55,7 +55,8 @@ public:
             unsigned int out_streams);
 
     virtual ~GalileoE1BTelemetryDecoder();
-    std::string role()
+
+    inline std::string role() override
     {
         return role_;
     }
@@ -63,21 +64,25 @@ public:
     /*!
      * \brief Returns "Galileo_E1B_Telemetry_Decoder"
      */
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "Galileo_E1B_Telemetry_Decoder";
     }
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
-    void set_satellite(Gnss_Satellite satellite);
-    void set_channel(int channel){telemetry_decoder_->set_channel(channel);}
-    void reset()
+
+    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;
+
+    void set_satellite(const Gnss_Satellite & satellite) override;
+    inline void set_channel(int channel) override { telemetry_decoder_->set_channel(channel); }
+
+    inline void reset() override
     {
         return;
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return 0;
     }
diff --git a/src/algorithms/telemetry_decoder/adapters/galileo_e5a_telemetry_decoder.cc b/src/algorithms/telemetry_decoder/adapters/galileo_e5a_telemetry_decoder.cc
index 9049079d4..24f72a4ac 100644
--- a/src/algorithms/telemetry_decoder/adapters/galileo_e5a_telemetry_decoder.cc
+++ b/src/algorithms/telemetry_decoder/adapters/galileo_e5a_telemetry_decoder.cc
@@ -71,7 +71,7 @@ GalileoE5aTelemetryDecoder::~GalileoE5aTelemetryDecoder()
 {}
 
 
-void GalileoE5aTelemetryDecoder::set_satellite(Gnss_Satellite satellite)
+void GalileoE5aTelemetryDecoder::set_satellite(const Gnss_Satellite & satellite)
 {
     satellite_ = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
     telemetry_decoder_->set_satellite(satellite_);
diff --git a/src/algorithms/telemetry_decoder/adapters/galileo_e5a_telemetry_decoder.h b/src/algorithms/telemetry_decoder/adapters/galileo_e5a_telemetry_decoder.h
index 9ea653e7b..9b7bb7713 100644
--- a/src/algorithms/telemetry_decoder/adapters/galileo_e5a_telemetry_decoder.h
+++ b/src/algorithms/telemetry_decoder/adapters/galileo_e5a_telemetry_decoder.h
@@ -56,7 +56,8 @@ public:
             unsigned int out_streams);
 
     virtual ~GalileoE5aTelemetryDecoder();
-    std::string role()
+
+    inline std::string role() override
     {
         return role_;
     }
@@ -64,21 +65,25 @@ public:
     /*!
      * \brief Returns "Galileo_E5a_Telemetry_Decoder"
      */
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "Galileo_E5A_Telemetry_Decoder";
     }
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
-    void set_satellite(Gnss_Satellite satellite);
-    void set_channel(int channel){telemetry_decoder_->set_channel(channel);}
-    void reset()
+
+    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;
+
+    void set_satellite(const Gnss_Satellite & satellite) override;
+    inline void set_channel(int channel) override { telemetry_decoder_->set_channel(channel); }
+
+    inline void reset() override
     {
         return;
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return 0;
     }
diff --git a/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.cc b/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.cc
index bc9792a7b..72deeafd6 100644
--- a/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.cc
+++ b/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.cc
@@ -67,7 +67,7 @@ GpsL1CaTelemetryDecoder::~GpsL1CaTelemetryDecoder()
 {}
 
 
-void GpsL1CaTelemetryDecoder::set_satellite(Gnss_Satellite satellite)
+void GpsL1CaTelemetryDecoder::set_satellite(const Gnss_Satellite & satellite)
 {
     satellite_ = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
     telemetry_decoder_->set_satellite(satellite_);
diff --git a/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.h b/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.h
index fd5f8dc1b..fdefb78d5 100644
--- a/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.h
+++ b/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.h
@@ -52,27 +52,32 @@ public:
             unsigned int out_streams);
 
     virtual ~GpsL1CaTelemetryDecoder();
-    std::string role()
+
+    inline std::string role() override
     {
         return role_;
     }
 
     //! Returns "GPS_L1_CA_Telemetry_Decoder"
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "GPS_L1_CA_Telemetry_Decoder";
     }
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
-    void set_satellite(Gnss_Satellite satellite);
-    void set_channel(int channel){telemetry_decoder_->set_channel(channel);}
-    void reset()
+
+    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;
+
+    void set_satellite(const Gnss_Satellite & satellite) override;
+    inline void set_channel(int channel) override { telemetry_decoder_->set_channel(channel); }
+
+    inline void reset() override
     {
         return;
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return 0;
     }
diff --git a/src/algorithms/telemetry_decoder/adapters/gps_l2c_telemetry_decoder.cc b/src/algorithms/telemetry_decoder/adapters/gps_l2c_telemetry_decoder.cc
index 935998578..205b34395 100644
--- a/src/algorithms/telemetry_decoder/adapters/gps_l2c_telemetry_decoder.cc
+++ b/src/algorithms/telemetry_decoder/adapters/gps_l2c_telemetry_decoder.cc
@@ -68,7 +68,7 @@ GpsL2CTelemetryDecoder::~GpsL2CTelemetryDecoder()
 {}
 
 
-void GpsL2CTelemetryDecoder::set_satellite(Gnss_Satellite satellite)
+void GpsL2CTelemetryDecoder::set_satellite(const Gnss_Satellite & satellite)
 {
     satellite_ = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
     telemetry_decoder_->set_satellite(satellite_);
diff --git a/src/algorithms/telemetry_decoder/adapters/gps_l2c_telemetry_decoder.h b/src/algorithms/telemetry_decoder/adapters/gps_l2c_telemetry_decoder.h
index 08ccc12f0..c98d724cf 100644
--- a/src/algorithms/telemetry_decoder/adapters/gps_l2c_telemetry_decoder.h
+++ b/src/algorithms/telemetry_decoder/adapters/gps_l2c_telemetry_decoder.h
@@ -52,27 +52,31 @@ public:
             unsigned int out_streams);
 
     virtual ~GpsL2CTelemetryDecoder();
-    std::string role()
+
+    inline std::string role() override
     {
         return role_;
     }
 
     //! Returns "GPS_L2C_Telemetry_Decoder"
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "GPS_L2C_Telemetry_Decoder";
     }
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
-    void set_satellite(Gnss_Satellite satellite);
-    void set_channel(int channel){telemetry_decoder_->set_channel(channel);}
-    void reset()
+
+    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;
+
+    void set_satellite(const Gnss_Satellite & satellite) override;
+    inline void set_channel(int channel) override { telemetry_decoder_->set_channel(channel); }
+
+    inline void reset() override
     {
         return;
     }
-    size_t item_size()
+    inline size_t item_size() override
     {
         return 0;
     }
diff --git a/src/algorithms/telemetry_decoder/adapters/sbas_l1_telemetry_decoder.cc b/src/algorithms/telemetry_decoder/adapters/sbas_l1_telemetry_decoder.cc
index 41d2dcf38..bf9e45e74 100644
--- a/src/algorithms/telemetry_decoder/adapters/sbas_l1_telemetry_decoder.cc
+++ b/src/algorithms/telemetry_decoder/adapters/sbas_l1_telemetry_decoder.cc
@@ -63,7 +63,7 @@ SbasL1TelemetryDecoder::~SbasL1TelemetryDecoder()
 {}
 
 
-void SbasL1TelemetryDecoder::set_satellite(Gnss_Satellite satellite)
+void SbasL1TelemetryDecoder::set_satellite(const Gnss_Satellite & satellite)
 {
     satellite_ = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
     telemetry_decoder_->set_satellite(satellite_);
diff --git a/src/algorithms/telemetry_decoder/adapters/sbas_l1_telemetry_decoder.h b/src/algorithms/telemetry_decoder/adapters/sbas_l1_telemetry_decoder.h
index 58c59861e..47325cad7 100644
--- a/src/algorithms/telemetry_decoder/adapters/sbas_l1_telemetry_decoder.h
+++ b/src/algorithms/telemetry_decoder/adapters/sbas_l1_telemetry_decoder.h
@@ -53,7 +53,8 @@ public:
             unsigned int out_streams);
 
     virtual ~SbasL1TelemetryDecoder();
-    std::string role()
+
+    inline std::string role() override
     {
         return role_;
     }
@@ -61,21 +62,25 @@ public:
     /*!
      * \brief Returns "SBAS_L1_Telemetry_Decoder"
      */
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "SBAS_L1_Telemetry_Decoder";
     }
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
-    void set_satellite(Gnss_Satellite satellite);
-    void set_channel(int channel){ telemetry_decoder_->set_channel(channel); }
-    void reset()
+
+    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;
+
+    void set_satellite(const Gnss_Satellite & satellite) override;
+    inline void set_channel(int channel) override { telemetry_decoder_->set_channel(channel); }
+
+    inline void reset() override
     {
         return;
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return 0;
     }
diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt b/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt
index e7c8aee05..7de1a365b 100644
--- a/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt
+++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt
@@ -25,7 +25,7 @@ set(TELEMETRY_DECODER_GR_BLOCKS_SOURCES
 )
       
 include_directories(
-     $(CMAKE_CURRENT_SOURCE_DIR)
+     ${CMAKE_CURRENT_SOURCE_DIR}
      ${CMAKE_SOURCE_DIR}/src/core/system_parameters
      ${CMAKE_SOURCE_DIR}/src/core/receiver
      ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs
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 bb37bd57f..97c4a9927 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
@@ -31,8 +31,6 @@
 
 
 #include "galileo_e1b_telemetry_decoder_cc.h"
-#include <cstdio>
-#include <cstdlib>
 #include <iostream>
 #include <boost/lexical_cast.hpp>
 #include <gnuradio/io_signature.h>
@@ -48,7 +46,7 @@ using google::LogMessage;
 
 
 galileo_e1b_telemetry_decoder_cc_sptr
-galileo_e1b_make_telemetry_decoder_cc(Gnss_Satellite satellite, bool dump)
+galileo_e1b_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump)
 {
     return galileo_e1b_telemetry_decoder_cc_sptr(new galileo_e1b_telemetry_decoder_cc(satellite, dump));
 }
@@ -72,10 +70,10 @@ void galileo_e1b_telemetry_decoder_cc::viterbi_decoder(double *page_part_symbols
 
     /* create appropriate transition matrices */
     int *out0, *out1, *state0, *state1;
-    out0 = (int*)calloc( max_states, sizeof(int) );
-    out1 = (int*)calloc( max_states, sizeof(int) );
-    state0 = (int*)calloc( max_states, sizeof(int) );
-    state1 = (int*)calloc( max_states, sizeof(int) );
+    out0 = static_cast<int*>(calloc( max_states, sizeof(int) ));
+    out1 = static_cast<int*>(calloc( max_states, sizeof(int) ));
+    state0 = static_cast<int*>(calloc( max_states, sizeof(int) ));
+    state1 = static_cast<int*>(calloc( max_states, sizeof(int) ));
 
     nsc_transit( out0, state0, 0, g_encoder, KK, nn );
     nsc_transit( out1, state1, 1, g_encoder, KK, nn );
@@ -104,7 +102,7 @@ void galileo_e1b_telemetry_decoder_cc::deinterleaver(int rows, int cols, double
 
 
 galileo_e1b_telemetry_decoder_cc::galileo_e1b_telemetry_decoder_cc(
-        Gnss_Satellite satellite,
+        const Gnss_Satellite & satellite,
         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)))
@@ -124,10 +122,10 @@ galileo_e1b_telemetry_decoder_cc::galileo_e1b_telemetry_decoder_cc(
 
     d_symbols_per_preamble = GALILEO_INAV_PREAMBLE_LENGTH_BITS * d_samples_per_symbol;
 
-    memcpy((unsigned short int*)this->d_preambles_bits, (unsigned short int*)preambles_bits, GALILEO_INAV_PREAMBLE_LENGTH_BITS*sizeof(unsigned short int));
+    memcpy(static_cast<unsigned short int*>(this->d_preambles_bits), static_cast<unsigned short int*>(preambles_bits), GALILEO_INAV_PREAMBLE_LENGTH_BITS * sizeof(unsigned short int));
 
     // preamble bits to sampled symbols
-    d_preambles_symbols = (signed int*)malloc(sizeof(signed int) * d_symbols_per_preamble);
+    d_preambles_symbols = static_cast<signed int*>(malloc(sizeof(signed int) * d_symbols_per_preamble));
     int n = 0;
     for (int i = 0; i < GALILEO_INAV_PREAMBLE_LENGTH_BITS; i++)
         {
@@ -164,7 +162,17 @@ galileo_e1b_telemetry_decoder_cc::galileo_e1b_telemetry_decoder_cc(
 galileo_e1b_telemetry_decoder_cc::~galileo_e1b_telemetry_decoder_cc()
 {
     delete d_preambles_symbols;
-    d_dump_file.close();
+    if(d_dump_file.is_open() == true)
+        {
+            try
+            {
+                    d_dump_file.close();
+            }
+            catch(const std::exception & ex)
+            {
+                    LOG(WARNING) << "Exception in destructor closing the dump file " << ex.what();
+            }
+        }
 }
 
 
@@ -208,13 +216,13 @@ void galileo_e1b_telemetry_decoder_cc::decode_word(double *page_part_symbols,int
             d_nav.split_page(page_String, flag_even_word_arrived);
             if(d_nav.flag_CRC_test == true)
                 {
-                    LOG(INFO) << "Galileo CRC correct on channel " << d_channel << " from satellite " << d_satellite;
-                    std::cout << "Galileo CRC correct on channel " << d_channel << " from satellite " << d_satellite << std::endl;
+                    LOG(INFO) << "Galileo E1 CRC correct on 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 CRC error on channel " << d_channel <<  " from satellite " << d_satellite << std::endl;
-                    LOG(INFO) << "Galileo CRC error on channel " << d_channel <<  " from satellite " << d_satellite;
+                    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;
                 }
             flag_even_word_arrived = 0;
         }
@@ -230,7 +238,7 @@ void galileo_e1b_telemetry_decoder_cc::decode_word(double *page_part_symbols,int
         {
             // get object for this SV (mandatory)
             std::shared_ptr<Galileo_Ephemeris> tmp_obj = std::make_shared<Galileo_Ephemeris>(d_nav.get_ephemeris());
-
+            std::cout << "New Galileo E1 I/NAV message received: ephemeris from satellite " << d_satellite << std::endl;
             this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj));
 
         }
@@ -238,12 +246,14 @@ void galileo_e1b_telemetry_decoder_cc::decode_word(double *page_part_symbols,int
         {
             // get object for this SV (mandatory)
             std::shared_ptr<Galileo_Iono> tmp_obj = std::make_shared<Galileo_Iono>(d_nav.get_iono());
+            std::cout << "New Galileo E1 I/NAV message received: 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<Galileo_Utc_Model> tmp_obj = std::make_shared<Galileo_Utc_Model>(d_nav.get_utc_model());
+            std::cout << "New Galileo E1 I/NAV message received: 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)
@@ -251,7 +261,7 @@ void galileo_e1b_telemetry_decoder_cc::decode_word(double *page_part_symbols,int
             std::shared_ptr<Galileo_Almanac> tmp_obj= std::make_shared<Galileo_Almanac>(d_nav.get_almanac());
             this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj));
             //debug
-            std::cout << "Galileo almanac received!" << std::endl;
+            std::cout << "Galileo E1 I/NAV almanac received!" << 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;
@@ -274,8 +284,8 @@ int galileo_e1b_telemetry_decoder_cc::general_work (int noutput_items __attribut
     int corr_value = 0;
     int preamble_diff = 0;
 
-    Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0];
-    const Gnss_Synchro **in = (const Gnss_Synchro **)  &input_items[0]; //Get the input samples pointer
+    Gnss_Synchro **out = reinterpret_cast<Gnss_Synchro **>(&output_items[0]);           // Get the output buffer pointer
+    const Gnss_Synchro **in = reinterpret_cast<const Gnss_Synchro **>(&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
@@ -285,9 +295,9 @@ int galileo_e1b_telemetry_decoder_cc::general_work (int noutput_items __attribut
     consume_each(1);
 
     d_flag_preamble = false;
-    unsigned int required_symbols=GALILEO_INAV_PAGE_SYMBOLS+d_symbols_per_preamble;
+    unsigned int required_symbols = GALILEO_INAV_PAGE_SYMBOLS + d_symbols_per_preamble;
 
-    if (d_symbol_history.size()>required_symbols)
+    if (d_symbol_history.size() > required_symbols)
     {
         // TODO Optimize me!
         //******* preamble correlation ********
@@ -310,7 +320,7 @@ int galileo_e1b_telemetry_decoder_cc::general_work (int noutput_items __attribut
             if (abs(corr_value) >= d_symbols_per_preamble)
                 {
                     d_preamble_index = d_sample_counter;//record the preamble sample stamp
-                    LOG(INFO) << "Preamble detection for Galileo SAT " << this->d_satellite;
+                    LOG(INFO) << "Preamble detection for Galileo satellite " << this->d_satellite;
                     d_stat = 1; // enter into frame pre-detection status
                 }
         }
@@ -323,7 +333,7 @@ int galileo_e1b_telemetry_decoder_cc::general_work (int noutput_items __attribut
                     if (abs(preamble_diff - GALILEO_INAV_PREAMBLE_PERIOD_SYMBOLS) == 0)
                         {
                             //try to decode frame
-                            LOG(INFO) << "Starting page decoder for Galileo SAT " << this->d_satellite;
+                            LOG(INFO) << "Starting page decoder for Galileo satellite " << this->d_satellite;
                             d_preamble_index = d_sample_counter; //record the preamble sample stamp
                             d_stat = 2;
                         }
@@ -394,14 +404,14 @@ int galileo_e1b_telemetry_decoder_cc::general_work (int noutput_items __attribut
             if(d_nav.flag_TOW_5 == true) //page 5 arrived and decoded, so we are in the odd page (since Tow refers to the even page, we have to add 1 sec)
                 {
                 //TOW_5 refers to the even preamble, but when we decode it we are in the odd part, so 1 second later plus the decoding delay
-                    d_TOW_at_current_symbol = d_nav.TOW_5  + GALILEO_INAV_PAGE_PART_SECONDS+((double)required_symbols)*GALILEO_E1_CODE_PERIOD; //-GALILEO_E1_CODE_PERIOD;//+ (double)GALILEO_INAV_PREAMBLE_LENGTH_BITS/(double)GALILEO_TELEMETRY_RATE_BITS_SECOND;
+                    d_TOW_at_current_symbol = d_nav.TOW_5 + GALILEO_INAV_PAGE_PART_SECONDS + (static_cast<double>(required_symbols)) * GALILEO_E1_CODE_PERIOD; //-GALILEO_E1_CODE_PERIOD;//+ (double)GALILEO_INAV_PREAMBLE_LENGTH_BITS/(double)GALILEO_TELEMETRY_RATE_BITS_SECOND;
                     d_nav.flag_TOW_5 = false;
                 }
 
             else if(d_nav.flag_TOW_6 == true) //page 6 arrived and decoded, so we are in the odd page (since Tow refers to the even page, we have to add 1 sec)
                 {
                     //TOW_6 refers to the even preamble, but when we decode it we are in the odd part, so 1 second later plus the decoding delay
-                    d_TOW_at_current_symbol = d_nav.TOW_6 + GALILEO_INAV_PAGE_PART_SECONDS+((double)required_symbols)*GALILEO_E1_CODE_PERIOD;//-GALILEO_E1_CODE_PERIOD;//+ (double)GALILEO_INAV_PREAMBLE_LENGTH_BITS/(double)GALILEO_TELEMETRY_RATE_BITS_SECOND;
+                    d_TOW_at_current_symbol = d_nav.TOW_6 + GALILEO_INAV_PAGE_PART_SECONDS + (static_cast<double>(required_symbols)) * GALILEO_E1_CODE_PERIOD;//-GALILEO_E1_CODE_PERIOD;//+ (double)GALILEO_INAV_PREAMBLE_LENGTH_BITS/(double)GALILEO_TELEMETRY_RATE_BITS_SECOND;
                     d_nav.flag_TOW_6 = false;
                 }
             else
@@ -422,7 +432,7 @@ int galileo_e1b_telemetry_decoder_cc::general_work (int noutput_items __attribut
             delta_t = d_nav.A_0G_10 + d_nav.A_1G_10 * (d_TOW_at_current_symbol - d_nav.t_0G_10 + 604800.0 * (fmod((d_nav.WN_0 - d_nav.WN_0G_10), 64)));
         }
 
-    if (d_flag_frame_sync == true and d_nav.flag_TOW_set == true)
+    if(d_flag_frame_sync == true and d_nav.flag_TOW_set == true)
         {
             current_symbol.Flag_valid_word = true;
         }
@@ -432,7 +442,7 @@ int galileo_e1b_telemetry_decoder_cc::general_work (int noutput_items __attribut
         }
 
     current_symbol.TOW_at_current_symbol_s = floor(d_TOW_at_current_symbol*1000.0)/1000.0;
-    current_symbol.TOW_at_current_symbol_s -=delta_t; //Galileo to GPS TOW
+    current_symbol.TOW_at_current_symbol_s -= delta_t; //Galileo to GPS TOW
 
     if(d_dump == true)
         {
@@ -442,11 +452,11 @@ int galileo_e1b_telemetry_decoder_cc::general_work (int noutput_items __attribut
                 double tmp_double;
                 unsigned long int tmp_ulong_int;
                 tmp_double = d_TOW_at_current_symbol;
-                d_dump_file.write((char*)&tmp_double, sizeof(double));
+                d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
                 tmp_ulong_int = current_symbol.Tracking_sample_counter;
-                d_dump_file.write((char*)&tmp_ulong_int, sizeof(unsigned long int));
+                d_dump_file.write(reinterpret_cast<char*>(&tmp_ulong_int), sizeof(unsigned long int));
                 tmp_double = 0;
-                d_dump_file.write((char*)&tmp_double, sizeof(double));
+                d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
             }
             catch (const std::ifstream::failure & e)
             {
@@ -455,10 +465,10 @@ int galileo_e1b_telemetry_decoder_cc::general_work (int noutput_items __attribut
         }
 
     // remove used symbols from history
-    if (d_symbol_history.size()>required_symbols)
-    {
-        d_symbol_history.pop_front();
-    }
+    if (d_symbol_history.size() > required_symbols)
+        {
+            d_symbol_history.pop_front();
+        }
     //3. Make the output (copy the object contents to the GNURadio reserved memory)
     *out[0] = current_symbol;
     //std::cout<<"GPS L1 TLM output on CH="<<this->d_channel << " SAMPLE STAMP="<<d_sample_counter/d_decimation_output_factor<<std::endl;
@@ -466,7 +476,7 @@ int galileo_e1b_telemetry_decoder_cc::general_work (int noutput_items __attribut
 }
 
 
-void galileo_e1b_telemetry_decoder_cc::set_satellite(Gnss_Satellite satellite)
+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;
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 a3f430232..95a618c7a 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
@@ -51,7 +51,7 @@ class galileo_e1b_telemetry_decoder_cc;
 
 typedef boost::shared_ptr<galileo_e1b_telemetry_decoder_cc> galileo_e1b_telemetry_decoder_cc_sptr;
 
-galileo_e1b_telemetry_decoder_cc_sptr galileo_e1b_make_telemetry_decoder_cc(Gnss_Satellite satellite, bool dump);
+galileo_e1b_telemetry_decoder_cc_sptr galileo_e1b_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump);
 
 /*!
  * \brief This class implements a block that decodes the INAV data defined in Galileo ICD
@@ -61,7 +61,7 @@ class galileo_e1b_telemetry_decoder_cc : public gr::block
 {
 public:
     ~galileo_e1b_telemetry_decoder_cc();
-    void set_satellite(Gnss_Satellite satellite);  //!< Set satellite PRN
+    void set_satellite(const Gnss_Satellite & satellite);  //!< Set satellite PRN
     void set_channel(int channel);                 //!< Set receiver's channel
     int flag_even_word_arrived;
 
@@ -73,8 +73,8 @@ public:
 
 private:
     friend galileo_e1b_telemetry_decoder_cc_sptr
-    galileo_e1b_make_telemetry_decoder_cc(Gnss_Satellite satellite, bool dump);
-    galileo_e1b_telemetry_decoder_cc(Gnss_Satellite satellite, bool dump);
+    galileo_e1b_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump);
+    galileo_e1b_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump);
 
     void viterbi_decoder(double *page_part_symbols, int *page_part_bits);
 
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 14973e191..2077ba4ab 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
@@ -35,8 +35,6 @@
  */
 
 #include "galileo_e5a_telemetry_decoder_cc.h"
-#include <cstdio>
-#include <cstdlib>
 #include <iostream>
 #include <boost/lexical_cast.hpp>
 #include <gnuradio/io_signature.h>
@@ -52,7 +50,7 @@ using google::LogMessage;
 
 
 galileo_e5a_telemetry_decoder_cc_sptr
-galileo_e5a_make_telemetry_decoder_cc(Gnss_Satellite satellite, bool dump)
+galileo_e5a_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump)
 {
     return galileo_e5a_telemetry_decoder_cc_sptr(new galileo_e5a_telemetry_decoder_cc(satellite, dump));
 }
@@ -80,10 +78,10 @@ void galileo_e5a_telemetry_decoder_cc::viterbi_decoder(double *page_part_symbols
     //create appropriate transition matrices
 
     int *out0, *out1, *state0, *state1;
-    out0 = (int*)calloc( max_states, sizeof(int) );
-    out1 = (int*)calloc( max_states, sizeof(int) );
-    state0 = (int*)calloc( max_states, sizeof(int) );
-    state1 = (int*)calloc( max_states, sizeof(int) );
+    out0 = static_cast<int*>(calloc( max_states, sizeof(int) ));
+    out1 = static_cast<int*>(calloc( max_states, sizeof(int) ));
+    state0 = static_cast<int*>(calloc( max_states, sizeof(int) ));
+    state1 = static_cast<int*>(calloc( max_states, sizeof(int) ));
 
     nsc_transit( out0, state0, 0, g_encoder, KK, nn );
     nsc_transit( out1, state1, 1, g_encoder, KK, nn );
@@ -111,7 +109,7 @@ void galileo_e5a_telemetry_decoder_cc::deinterleaver(int rows, int cols, double
 }
 
 
-void galileo_e5a_telemetry_decoder_cc::decode_word(double *page_symbols,int frame_length)
+void galileo_e5a_telemetry_decoder_cc::decode_word(double *page_symbols, int frame_length)
 {
     double page_symbols_deint[frame_length];
     // 1. De-interleave
@@ -149,36 +147,39 @@ void galileo_e5a_telemetry_decoder_cc::decode_word(double *page_symbols,int fram
     d_nav.split_page(page_String);
     if(d_nav.flag_CRC_test == true)
         {
-            LOG(INFO) << "Galileo CRC correct on channel " << d_channel << " from satellite " << d_satellite;
-            std::cout << "Galileo CRC correct on channel " << d_channel << " from satellite " << d_satellite << std::endl;
+            LOG(INFO) << "Galileo E5a CRC correct on 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 CRC error on channel " << d_channel << " from satellite " << d_satellite << std::endl;
-            LOG(INFO)<< "Galileo CRC error on channel " << d_channel << " from satellite " << d_satellite;
+            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;
         }
 
     // 4. Push the new navigation data to the queues
     if (d_nav.have_new_ephemeris() == true)
         {
-            std::shared_ptr<Galileo_Ephemeris> tmp_obj= std::make_shared<Galileo_Ephemeris>(d_nav.get_ephemeris());
+            std::shared_ptr<Galileo_Ephemeris> tmp_obj = std::make_shared<Galileo_Ephemeris>(d_nav.get_ephemeris());
+            std::cout << "New Galileo E5a F/NAV message received: 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)
         {
-            std::shared_ptr<Galileo_Iono> tmp_obj= std::make_shared<Galileo_Iono>(d_nav.get_iono());
+            std::shared_ptr<Galileo_Iono> tmp_obj = std::make_shared<Galileo_Iono>(d_nav.get_iono());
+            std::cout << "New Galileo E5a F/NAV message received: 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)
         {
-            std::shared_ptr<Galileo_Utc_Model> tmp_obj= std::make_shared<Galileo_Utc_Model>(d_nav.get_utc_model());
+            std::shared_ptr<Galileo_Utc_Model> tmp_obj = std::make_shared<Galileo_Utc_Model>(d_nav.get_utc_model());
+            std::cout << "New Galileo E5a F/NAV message received: UTC model parameters from satellite " << d_satellite << std::endl;
             this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj));
         }
-
 }
 
+
 galileo_e5a_telemetry_decoder_cc::galileo_e5a_telemetry_decoder_cc(
-        Gnss_Satellite satellite, bool dump) : gr::block("galileo_e5a_telemetry_decoder_cc",
+        const Gnss_Satellite & satellite, bool dump) : gr::block("galileo_e5a_telemetry_decoder_cc",
                 gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)),
                 gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)))
 {
@@ -227,15 +228,26 @@ galileo_e5a_telemetry_decoder_cc::galileo_e5a_telemetry_decoder_cc(
 
 galileo_e5a_telemetry_decoder_cc::~galileo_e5a_telemetry_decoder_cc()
 {
-    d_dump_file.close();
+    if(d_dump_file.is_open() == true)
+        {
+            try
+            {
+                    d_dump_file.close();
+            }
+            catch(const std::exception & ex)
+            {
+                    LOG(WARNING) << "Exception in destructor closing the dump file " << ex.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)
+        gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
 {
-    const Gnss_Synchro *in = (const Gnss_Synchro *)  input_items[0]; // input
-    Gnss_Synchro *out = (Gnss_Synchro *) output_items[0];            // output
+    Gnss_Synchro *out = reinterpret_cast<Gnss_Synchro *>(output_items[0]);           // Get the output buffer pointer
+    const Gnss_Synchro *in = reinterpret_cast<const Gnss_Synchro *>(input_items[0]); // Get the input buffer pointer
+
     /* Terminology:     Prompt: output from tracking Prompt correlator (Prompt samples)
      *             Symbol: encoded navigation bits. 1 symbol = 20 samples in E5a
      *             Bit: decoded navigation bits forming words as described in Galileo ICD
@@ -293,16 +305,16 @@ int galileo_e5a_telemetry_decoder_cc::general_work (int noutput_items __attribut
                     d_symbol_counter++;
                     d_prompt_counter = 0;
                     // **** Attempt Preamble correlation ****
-                    bool corr_flag=true;
+                    bool corr_flag = true;
                     int corr_sign = 0; // sequence can be found inverted
                     // check if the preamble starts positive correlated or negative correlated
                     if (d_page_symbols[d_symbol_counter - GALILEO_FNAV_PREAMBLE_LENGTH_BITS] < 0)    // symbols clipping
                         {
-                            corr_sign=-d_preamble_bits[0];
+                            corr_sign = -d_preamble_bits[0];
                         }
                     else
                         {
-                            corr_sign=d_preamble_bits[0];
+                            corr_sign = d_preamble_bits[0];
                         }
                     // the preamble is fully correlated only if maintains corr_sign along the whole sequence
                     for (int i = 1; i < GALILEO_FNAV_PREAMBLE_LENGTH_BITS; i++)
@@ -310,21 +322,21 @@ int galileo_e5a_telemetry_decoder_cc::general_work (int noutput_items __attribut
                             if (d_page_symbols[d_symbol_counter - GALILEO_FNAV_PREAMBLE_LENGTH_BITS + i] < 0 && d_preamble_bits[i]+corr_sign != 0)
                                 {
                                     //exit for
-                                    corr_flag=false;
+                                    corr_flag = false;
                                     break;
                                 }
                             if (d_page_symbols[d_symbol_counter - GALILEO_FNAV_PREAMBLE_LENGTH_BITS + i] > 0 && d_preamble_bits[i]+corr_sign == 0)
                                 {
                                     //exit for
-                                    corr_flag=false;
+                                    corr_flag = false;
                                     break;
                                 }
                         }
                     //
-                    if (corr_flag==true) // preamble fully correlates
+                    if (corr_flag == true) // preamble fully correlates
                         {
                             d_preamble_index = d_sample_counter - GALILEO_FNAV_CODES_PER_PREAMBLE;//record the preamble sample stamp. Remember correlation appears at the end of the preamble in this design
-                            LOG(INFO) << "Preamble detection for Galileo SAT " << this->d_satellite << std::endl;
+                            LOG(INFO) << "Preamble detection in E5a for Galileo satellite " << this->d_satellite << std::endl;
                             d_symbol_counter = 0; // d_page_symbols start right after preamble and finish at the end of next preamble.
                             d_state = 2; // preamble lock
                         }
@@ -365,11 +377,11 @@ int galileo_e5a_telemetry_decoder_cc::general_work (int noutput_items __attribut
                             // check if the preamble starts positive correlated or negative correlated
                             if (d_page_symbols[d_symbol_counter - GALILEO_FNAV_PREAMBLE_LENGTH_BITS] < 0)    // symbols clipping
                                 {
-                                    corr_sign=-d_preamble_bits[0];
+                                    corr_sign = -d_preamble_bits[0];
                                 }
                             else
                                 {
-                                    corr_sign=d_preamble_bits[0];
+                                    corr_sign = d_preamble_bits[0];
                                 }
                             // the preamble is fully correlated only if maintains corr_sign along the whole sequence
                             for (int i = 1; i < GALILEO_FNAV_PREAMBLE_LENGTH_BITS; i++)
@@ -377,18 +389,18 @@ int galileo_e5a_telemetry_decoder_cc::general_work (int noutput_items __attribut
                                     if (d_page_symbols[d_symbol_counter - GALILEO_FNAV_PREAMBLE_LENGTH_BITS + i] < 0 && d_preamble_bits[i]+corr_sign != 0)
                                         {
                                             //exit for
-                                            corr_flag=false;
+                                            corr_flag = false;
                                             break;
                                         }
                                     if (d_page_symbols[d_symbol_counter - GALILEO_FNAV_PREAMBLE_LENGTH_BITS + i] > 0 && d_preamble_bits[i]+corr_sign == 0)
                                         {
                                             //exit for
-                                            corr_flag=false;
+                                            corr_flag = false;
                                             break;
                                         }
                                 }
 
-                            if (corr_flag==true) // NEW PREAMBLE RECEIVED. DECODE PAGE
+                            if (corr_flag == true) // NEW PREAMBLE RECEIVED. DECODE PAGE
                                 {
                                     d_preamble_index = d_sample_counter - GALILEO_FNAV_CODES_PER_PREAMBLE;//record the preamble sample stamp
                                     // DECODE WORD
@@ -402,7 +414,8 @@ int galileo_e5a_telemetry_decoder_cc::general_work (int noutput_items __attribut
                                                 {
                                                     d_flag_frame_sync = true;
                                                     DLOG(INFO) << " Frame sync SAT " << this->d_satellite << " with preamble start at "
-                                                            << in[0].Tracking_sample_counter << " [samples]";                                                }
+                                                               << in[0].Tracking_sample_counter << " [samples]";
+                                                }
                                             d_symbol_counter = 0; // d_page_symbols start right after preamble and finish at the end of next preamble.
                                         }
                                     else
@@ -495,14 +508,14 @@ int galileo_e5a_telemetry_decoder_cc::general_work (int noutput_items __attribut
             // MULTIPLEXED FILE RECORDING - Record results to file
             try
             {
-                double tmp_double;
-                unsigned long int tmp_ulong_int;
-                tmp_double = d_TOW_at_current_symbol;
-                d_dump_file.write((char*)&tmp_double, sizeof(double));
-                tmp_ulong_int = current_synchro_data.Tracking_sample_counter;
-                d_dump_file.write((char*)&tmp_ulong_int, sizeof(unsigned long int));
-                tmp_double = d_TOW_at_Preamble;
-                d_dump_file.write((char*)&tmp_double, sizeof(double));
+                    double tmp_double;
+                    unsigned long int tmp_ulong_int;
+                    tmp_double = d_TOW_at_current_symbol;
+                    d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
+                    tmp_ulong_int = current_synchro_data.Tracking_sample_counter;
+                    d_dump_file.write(reinterpret_cast<char*>(&tmp_ulong_int), sizeof(unsigned long int));
+                    tmp_double = d_TOW_at_Preamble;
+                    d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
             }
             catch (const std::ifstream::failure & e)
             {
@@ -517,7 +530,7 @@ int galileo_e5a_telemetry_decoder_cc::general_work (int noutput_items __attribut
 }
 
 
-void galileo_e5a_telemetry_decoder_cc::set_satellite(Gnss_Satellite satellite)
+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;
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 81a609274..46620a86e 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
@@ -55,7 +55,7 @@ class galileo_e5a_telemetry_decoder_cc;
 
 typedef boost::shared_ptr<galileo_e5a_telemetry_decoder_cc> galileo_e5a_telemetry_decoder_cc_sptr;
 
-galileo_e5a_telemetry_decoder_cc_sptr galileo_e5a_make_telemetry_decoder_cc(Gnss_Satellite satellite, bool dump);
+galileo_e5a_telemetry_decoder_cc_sptr galileo_e5a_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump);
 
 
 /*!
@@ -66,8 +66,8 @@ class galileo_e5a_telemetry_decoder_cc : public gr::block
 {
 public:
     ~galileo_e5a_telemetry_decoder_cc();
-    void set_satellite(Gnss_Satellite satellite);  //!< Set satellite PRN
-    void set_channel(int channel);                 //!< Set receiver's channel
+    void set_satellite(const Gnss_Satellite & satellite);  //!< Set satellite PRN
+    void set_channel(int channel);                         //!< Set receiver's channel
     /*!
      * \brief This is where all signal processing takes place
      */
@@ -76,20 +76,18 @@ public:
 
 private:
     friend galileo_e5a_telemetry_decoder_cc_sptr
-    galileo_e5a_make_telemetry_decoder_cc(Gnss_Satellite satellite, bool dump);
-    galileo_e5a_telemetry_decoder_cc(Gnss_Satellite satellite, bool dump);
+    galileo_e5a_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump);
+    galileo_e5a_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump);
 
     void viterbi_decoder(double *page_part_symbols, int *page_part_bits);
 
     void deinterleaver(int rows, int cols, double *in, double *out);
 
-    void decode_word(double *page_symbols,int frame_length);
+    void decode_word(double *page_symbols, int frame_length);
 
     int d_preamble_bits[GALILEO_FNAV_PREAMBLE_LENGTH_BITS];
-    // signed int d_page_symbols[GALILEO_FNAV_SYMBOLS_PER_PAGE + GALILEO_FNAV_PREAMBLE_LENGTH_BITS];
     double d_page_symbols[GALILEO_FNAV_SYMBOLS_PER_PAGE + GALILEO_FNAV_PREAMBLE_LENGTH_BITS];
 
-    // signed int *d_preamble_symbols;
     double d_current_symbol;
     long unsigned int d_symbol_counter;
     int d_prompt_counter;
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 ddb39d229..e9189e213 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
@@ -43,13 +43,14 @@
 using google::LogMessage;
 
 gps_l1_ca_telemetry_decoder_cc_sptr
-gps_l1_ca_make_telemetry_decoder_cc(Gnss_Satellite satellite, bool dump)
+gps_l1_ca_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump)
 {
     return gps_l1_ca_telemetry_decoder_cc_sptr(new gps_l1_ca_telemetry_decoder_cc(satellite, dump));
 }
 
+
 gps_l1_ca_telemetry_decoder_cc::gps_l1_ca_telemetry_decoder_cc(
-        Gnss_Satellite satellite,
+        const Gnss_Satellite & satellite,
         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)))
@@ -68,7 +69,7 @@ gps_l1_ca_telemetry_decoder_cc::gps_l1_ca_telemetry_decoder_cc(
     //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 = (signed int*)malloc(sizeof(signed int) * GPS_CA_PREAMBLE_LENGTH_SYMBOLS);
+    d_preambles_symbols = static_cast<signed int*>(malloc(sizeof(signed int) * GPS_CA_PREAMBLE_LENGTH_SYMBOLS));
     int n = 0;
     for (int i = 0; i < GPS_CA_PREAMBLE_LENGTH_BITS; i++)
         {
@@ -98,21 +99,32 @@ gps_l1_ca_telemetry_decoder_cc::gps_l1_ca_telemetry_decoder_cc(
     flag_TOW_set = false;
     d_average_count = 0;
     d_flag_preamble = false;
-    d_flag_new_tow_available=false;
+    d_flag_new_tow_available = false;
     d_word_number = 0;
     d_decimation_output_factor = 1;
     d_channel = 0;
     flag_PLL_180_deg_phase_locked = false;
-
+    d_preamble_time_samples = 0;
 }
 
 
 gps_l1_ca_telemetry_decoder_cc::~gps_l1_ca_telemetry_decoder_cc()
 {
     delete d_preambles_symbols;
-    d_dump_file.close();
+    if(d_dump_file.is_open() == true)
+        {
+            try
+            {
+                    d_dump_file.close();
+            }
+            catch(const std::exception & ex)
+            {
+                    LOG(WARNING) << "Exception in destructor closing the dump file " << ex.what();
+            }
+        }
 }
 
+
 bool gps_l1_ca_telemetry_decoder_cc::gps_word_parityCheck(unsigned int gpsword)
 {
     unsigned int d1, d2, d3, d4, d5, d6, d7, t, parity;
@@ -139,14 +151,11 @@ bool gps_l1_ca_telemetry_decoder_cc::gps_word_parityCheck(unsigned int gpsword)
 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)
 {
-
     int corr_value = 0;
     int preamble_diff_ms = 0;
 
-    Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0];
-
-    // ########### Output the tracking data to navigation and PVT ##########
-    const Gnss_Synchro **in = (const Gnss_Synchro **)  &input_items[0]; //Get the input samples pointer
+    Gnss_Synchro **out = reinterpret_cast<Gnss_Synchro **>(&output_items[0]);           // Get the output buffer pointer
+    const Gnss_Synchro **in = reinterpret_cast<const Gnss_Synchro **>(&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
@@ -154,7 +163,7 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attribute_
     d_symbol_history.push_back(current_symbol); //add new symbol to the symbol queue
     consume_each(1);
 
-    unsigned int required_symbols=GPS_CA_PREAMBLE_LENGTH_SYMBOLS;
+    unsigned int required_symbols = GPS_CA_PREAMBLE_LENGTH_SYMBOLS;
     d_flag_preamble = false;
 
     if (d_symbol_history.size()>required_symbols)
@@ -175,8 +184,8 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attribute_
                     }
                 if (corr_value >= GPS_CA_PREAMBLE_LENGTH_SYMBOLS) break;
             }
-
     }
+
     //******* frame sync ******************
     if (abs(corr_value) == GPS_CA_PREAMBLE_LENGTH_SYMBOLS)
         {
@@ -195,7 +204,7 @@ 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((((double)d_symbol_history.at(0).Tracking_sample_counter - d_preamble_time_samples)/(double)d_symbol_history.at(0).fs) * 1000.0);
+                    preamble_diff_ms = round(((static_cast<double>(d_symbol_history.at(0).Tracking_sample_counter) - d_preamble_time_samples) / static_cast<double>(d_symbol_history.at(0).fs)) * 1000.0);
                     if (abs(preamble_diff_ms - GPS_SUBFRAME_MS) < 1)
                         {
                             DLOG(INFO) << "Preamble confirmation for SAT " << this->d_satellite;
@@ -205,7 +214,7 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attribute_
                             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((double)d_preamble_time_samples/(double)d_symbol_history.at(0).fs - 0.001);
+                                    pmt::pmt_t value = pmt::from_double(static_cast<double>(d_preamble_time_samples) / static_cast<double>(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)
@@ -217,7 +226,8 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attribute_
                                         {
                                             flag_PLL_180_deg_phase_locked = false;
                                         }
-                                    DLOG(INFO)  << " Frame sync SAT " << this->d_satellite << " with preamble start at " << (double)d_preamble_time_samples/(double)d_symbol_history.at(0).fs << " [s]";
+                                    DLOG(INFO)  << " Frame sync SAT " << this->d_satellite << " with preamble start at "
+                                                << static_cast<double>(d_preamble_time_samples) / static_cast<double>(d_symbol_history.at(0).fs) << " [s]";
                                 }
                         }
                 }
@@ -226,7 +236,7 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attribute_
         {
             if (d_stat == 1)
                 {
-                    preamble_diff_ms =  round((((double)d_symbol_history.at(0).Tracking_sample_counter - (double)d_preamble_time_samples)/(double)d_symbol_history.at(0).fs) * 1000.0);
+                    preamble_diff_ms =  round(((static_cast<double>(d_symbol_history.at(0).Tracking_sample_counter) - static_cast<double>(d_preamble_time_samples)) / static_cast<double>(d_symbol_history.at(0).fs)) * 1000.0);
                     if (preamble_diff_ms > GPS_SUBFRAME_MS+1)
                         {
                             DLOG(INFO) << "Lost of frame sync SAT " << this->d_satellite << " preamble_diff= " << preamble_diff_ms;
@@ -339,7 +349,7 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attribute_
             //double decoder_latency_ms=(double)(current_symbol.Tracking_sample_counter-d_symbol_history.at(0).Tracking_sample_counter)
             //        /(double)current_symbol.fs;
             // update TOW at the preamble instant (account with decoder latency)
-            d_TOW_at_Preamble = d_GPS_FSM.d_nav.d_TOW + GPS_L1_CA_CODE_PERIOD + GPS_CA_PREAMBLE_DURATION_S;
+            d_TOW_at_Preamble = d_GPS_FSM.d_nav.d_TOW + 2*GPS_L1_CA_CODE_PERIOD + GPS_CA_PREAMBLE_DURATION_S;
 
             d_TOW_at_current_symbol = floor(d_TOW_at_Preamble*1000.0)/1000.0;
             flag_TOW_set = true;
@@ -353,11 +363,10 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attribute_
      current_symbol.TOW_at_current_symbol_s = d_TOW_at_current_symbol;
      current_symbol.Flag_valid_word = flag_TOW_set;
 
-
      if (flag_PLL_180_deg_phase_locked == true)
          {
              //correct the accumulated phase for the Costas loop phase shift, if required
-         current_symbol.Carrier_phase_rads += GPS_PI;
+             current_symbol.Carrier_phase_rads += GPS_PI;
          }
 
      if(d_dump == true)
@@ -368,11 +377,11 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attribute_
                      double tmp_double;
                      unsigned long int tmp_ulong_int;
                      tmp_double = d_TOW_at_current_symbol;
-                     d_dump_file.write((char*)&tmp_double, sizeof(double));
+                     d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
                      tmp_ulong_int = current_symbol.Tracking_sample_counter;
-                     d_dump_file.write((char*)&tmp_ulong_int, sizeof(unsigned long int));
+                     d_dump_file.write(reinterpret_cast<char*>(&tmp_ulong_int), sizeof(unsigned long int));
                      tmp_double = d_TOW_at_Preamble;
-                     d_dump_file.write((char*)&tmp_double, sizeof(double));
+                     d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
              }
              catch (const std::ifstream::failure & e)
              {
@@ -381,17 +390,18 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attribute_
          }
 
      // remove used symbols from history
-     if (d_symbol_history.size()>required_symbols)
-     {
-         d_symbol_history.pop_front();
-     }
+     if (d_symbol_history.size() > required_symbols)
+         {
+             d_symbol_history.pop_front();
+         }
      //3. Make the output (copy the object contents to the GNURadio reserved memory)
      *out[0] = current_symbol;
 
      return 1;
  }
 
- void gps_l1_ca_telemetry_decoder_cc::set_satellite(Gnss_Satellite satellite)
+
+ void gps_l1_ca_telemetry_decoder_cc::set_satellite(const Gnss_Satellite & satellite)
  {
      d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
      LOG(INFO) << "Setting decoder Finite State Machine to satellite "  << d_satellite;
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 8ccc0cb8d..49ae8e1d0 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
@@ -47,7 +47,7 @@ class gps_l1_ca_telemetry_decoder_cc;
 typedef boost::shared_ptr<gps_l1_ca_telemetry_decoder_cc> gps_l1_ca_telemetry_decoder_cc_sptr;
 
 gps_l1_ca_telemetry_decoder_cc_sptr
-gps_l1_ca_make_telemetry_decoder_cc(Gnss_Satellite satellite, bool dump);
+gps_l1_ca_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump);
 
 /*!
  * \brief This class implements a block that decodes the NAV data defined in IS-GPS-200E
@@ -57,8 +57,8 @@ class gps_l1_ca_telemetry_decoder_cc : public gr::block
 {
 public:
     ~gps_l1_ca_telemetry_decoder_cc();
-    void set_satellite(Gnss_Satellite satellite);  //!< Set satellite PRN
-    void set_channel(int channel);                 //!< Set receiver's channel
+    void set_satellite(const Gnss_Satellite & satellite);  //!< Set satellite PRN
+    void set_channel(int channel);                         //!< Set receiver's channel
 
     /*!
      * \brief This is where all signal processing takes place
@@ -68,9 +68,9 @@ public:
 
 private:
     friend gps_l1_ca_telemetry_decoder_cc_sptr
-    gps_l1_ca_make_telemetry_decoder_cc(Gnss_Satellite satellite, bool dump);
+    gps_l1_ca_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump);
 
-    gps_l1_ca_telemetry_decoder_cc(Gnss_Satellite satellite, bool dump);
+    gps_l1_ca_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump);
 
     bool gps_word_parityCheck(unsigned int gpsword);
 
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 5b8a6cfb4..693990124 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
@@ -41,14 +41,14 @@
 using google::LogMessage;
 
 gps_l2c_telemetry_decoder_cc_sptr
-gps_l2c_make_telemetry_decoder_cc(Gnss_Satellite satellite, bool dump)
+gps_l2c_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump)
 {
     return gps_l2c_telemetry_decoder_cc_sptr(new gps_l2c_telemetry_decoder_cc(satellite, dump));
 }
 
 
 gps_l2c_telemetry_decoder_cc::gps_l2c_telemetry_decoder_cc(
-        Gnss_Satellite satellite, bool dump) : gr::block("gps_l2c_telemetry_decoder_cc",
+        const Gnss_Satellite & satellite, bool dump) : gr::block("gps_l2c_telemetry_decoder_cc",
                 gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)),
                 gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)))
 {
@@ -65,8 +65,8 @@ gps_l2c_telemetry_decoder_cc::gps_l2c_telemetry_decoder_cc(
     d_flag_valid_word = false;
     d_TOW_at_current_symbol = 0;
     d_TOW_at_Preamble = 0;
-    d_state=0; //initial state
-    d_crc_error_count=0;
+    d_state = 0; //initial state
+    d_crc_error_count = 0;
 
     //initialize the CNAV frame decoder (libswiftcnav)
     cnav_msg_decoder_init(&d_cnav_decoder);
@@ -75,7 +75,17 @@ gps_l2c_telemetry_decoder_cc::gps_l2c_telemetry_decoder_cc(
 
 gps_l2c_telemetry_decoder_cc::~gps_l2c_telemetry_decoder_cc()
 {
-    d_dump_file.close();
+    if(d_dump_file.is_open() == true)
+        {
+            try
+            {
+                    d_dump_file.close();
+            }
+            catch(const std::exception & ex)
+            {
+                    LOG(WARNING) << "Exception in destructor closing the dump file " << ex.what();
+            }
+        }
 }
 
 
@@ -83,15 +93,15 @@ int gps_l2c_telemetry_decoder_cc::general_work (int noutput_items __attribute__(
         gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
 {
     // get pointers on in- and output gnss-synchro objects
-    const Gnss_Synchro *in = (const Gnss_Synchro *)  input_items[0]; // input
-    Gnss_Synchro *out = (Gnss_Synchro *) output_items[0];            // output
+    Gnss_Synchro *out = reinterpret_cast<Gnss_Synchro *>(output_items[0]);           // Get the output buffer pointer
+    const Gnss_Synchro *in = reinterpret_cast<const Gnss_Synchro *>(input_items[0]); // Get the input buffer pointer
 
     bool flag_new_cnav_frame = false;
     cnav_msg_t msg;
     u32 delay = 0;
 
     //add the symbol to the decoder
-    u8 symbol_clip=(u8)(in[0].Prompt_I>0) * 255;
+    u8 symbol_clip = static_cast<u8>(in[0].Prompt_I > 0) * 255;
     flag_new_cnav_frame = cnav_msg_decoder_add_symbol(&d_cnav_decoder, symbol_clip, &msg, &delay);
 
     consume_each(1); //one by one
@@ -105,79 +115,80 @@ int gps_l2c_telemetry_decoder_cc::general_work (int noutput_items __attribute__(
     //2. Add the telemetry decoder information
     //check if new CNAV frame is available
     if (flag_new_cnav_frame == true)
-    {
-        std::bitset<GPS_L2_CNAV_DATA_PAGE_BITS> raw_bits;
-        //Expand packet bits to bitsets. Notice the reverse order of the bits sequence, required by the CNAV message decoder
-        for (u32 i = 0; i < GPS_L2_CNAV_DATA_PAGE_BITS ; i++) {
-            raw_bits[GPS_L2_CNAV_DATA_PAGE_BITS-1-i]=((msg.raw_msg[i/8] >> (7 - i%8)) & 1u);
-        }
-
-        d_CNAV_Message.decode_page(raw_bits);
-
-        //Push the new navigation data to the queues
-        if (d_CNAV_Message.have_new_ephemeris() == true)
-            {
-                // get ephemeris object for this SV
-                  std::shared_ptr<Gps_CNAV_Ephemeris> tmp_obj= std::make_shared<Gps_CNAV_Ephemeris>(d_CNAV_Message.get_ephemeris());
-                std::cout << "New GPS CNAV Ephemeris received for SV " << tmp_obj->i_satellite_PRN << 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<Gps_CNAV_Iono> tmp_obj= std::make_shared<Gps_CNAV_Iono>(d_CNAV_Message.get_iono());
-                std::cout << "New GPS CNAV IONO model received for SV " << d_satellite.get_PRN() << 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<Gps_CNAV_Utc_Model> tmp_obj= std::make_shared<Gps_CNAV_Utc_Model>(d_CNAV_Message.get_utc_model());
-                std::cout << "New GPS CNAV UTC model received for SV " << d_satellite.get_PRN() << std::endl;
-                this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj));
-            }
-
-        //update TOW at the preamble instant
-        d_TOW_at_Preamble=(int)msg.tow;
-        //std::cout<<"["<<(int)msg.prn<<"] deco delay: "<<delay<<"[symbols]"<<std::endl;
-        //* The time of the last input symbol can be computed from the message ToW and
-        //* delay by the formulae:
-        //* \code
-        //* symbolTime_ms = msg->tow * 6000 + *pdelay * 20
-        d_TOW_at_current_symbol=((double)msg.tow) * 6.0 + ((double)delay) * GPS_L2_M_PERIOD +12*GPS_L2_M_PERIOD;
-        d_TOW_at_current_symbol=floor(d_TOW_at_current_symbol*1000.0)/1000.0;
-        d_flag_valid_word=true;
-    }
-    else
-    {
-        d_TOW_at_current_symbol +=GPS_L2_M_PERIOD;
-        if (current_synchro_data.Flag_valid_symbol_output==false)
         {
-            d_flag_valid_word=false;
-        }
-    }
-    current_synchro_data.TOW_at_current_symbol_s = d_TOW_at_current_symbol;
-    current_synchro_data.Flag_valid_word=d_flag_valid_word;
+            std::bitset<GPS_L2_CNAV_DATA_PAGE_BITS> raw_bits;
+            //Expand packet bits to bitsets. Notice the reverse order of the bits sequence, required by the CNAV message decoder
+            for (u32 i = 0; i < GPS_L2_CNAV_DATA_PAGE_BITS ; i++)
+                {
+                    raw_bits[GPS_L2_CNAV_DATA_PAGE_BITS - 1 - i] = ((msg.raw_msg[i/8] >> (7 - i%8)) & 1u);
+                }
 
-//    if (flag_PLL_180_deg_phase_locked == true)
-//        {
-//            //correct the accumulated phase for the Costas loop phase shift, if required
-//            current_synchro_data.Carrier_phase_rads += GPS_PI;
-//        }
+            d_CNAV_Message.decode_page(raw_bits);
+
+            //Push the new navigation data to the queues
+            if (d_CNAV_Message.have_new_ephemeris() == true)
+                {
+                    // get ephemeris object for this SV
+                    std::shared_ptr<Gps_CNAV_Ephemeris> tmp_obj = std::make_shared<Gps_CNAV_Ephemeris>(d_CNAV_Message.get_ephemeris());
+                    std::cout << "New GPS CNAV message received: ephemeris from satellite " << d_satellite << 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<Gps_CNAV_Iono> tmp_obj = std::make_shared<Gps_CNAV_Iono>(d_CNAV_Message.get_iono());
+                    std::cout << "New GPS CNAV message received: iono model parameters from satellite " << d_satellite << 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<Gps_CNAV_Utc_Model> tmp_obj = std::make_shared<Gps_CNAV_Utc_Model>(d_CNAV_Message.get_utc_model());
+                    std::cout << "New GPS CNAV message received: UTC model parameters from satellite " << d_satellite << std::endl;
+                    this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj));
+                }
+
+            //update TOW at the preamble instant
+            d_TOW_at_Preamble = static_cast<int>(msg.tow);
+            //std::cout<<"["<<(int)msg.prn<<"] deco delay: "<<delay<<"[symbols]"<<std::endl;
+            //* The time of the last input symbol can be computed from the message ToW and
+            //* delay by the formulae:
+            //* \code
+            //* symbolTime_ms = msg->tow * 6000 + *pdelay * 20
+            d_TOW_at_current_symbol = static_cast<double>(msg.tow) * 6.0 + static_cast<double>(delay) * GPS_L2_M_PERIOD + 12 * GPS_L2_M_PERIOD;
+            d_TOW_at_current_symbol = floor(d_TOW_at_current_symbol * 1000.0) / 1000.0;
+            d_flag_valid_word = true;
+        }
+    else
+        {
+            d_TOW_at_current_symbol += GPS_L2_M_PERIOD;
+            if (current_synchro_data.Flag_valid_symbol_output == false)
+                {
+                    d_flag_valid_word = false;
+                }
+        }
+    current_synchro_data.TOW_at_current_symbol_s = d_TOW_at_current_symbol;
+    current_synchro_data.Flag_valid_word = d_flag_valid_word;
+
+    //    if (flag_PLL_180_deg_phase_locked == true)
+    //        {
+    //            //correct the accumulated phase for the Costas loop phase shift, if required
+    //            current_synchro_data.Carrier_phase_rads += GPS_PI;
+    //        }
 
     if(d_dump == true)
         {
             // MULTIPLEXED FILE RECORDING - Record results to file
             try
             {
-                double tmp_double;
-                unsigned long int tmp_ulong_int;
-                tmp_double = d_TOW_at_current_symbol;
-                d_dump_file.write((char*)&tmp_double, sizeof(double));
-                tmp_ulong_int = current_synchro_data.Tracking_sample_counter;
-                d_dump_file.write((char*)&tmp_ulong_int, sizeof(unsigned long int));
-                tmp_double = d_TOW_at_Preamble;
-                d_dump_file.write((char*)&tmp_double, sizeof(double));
+                    double tmp_double;
+                    unsigned long int tmp_ulong_int;
+                    tmp_double = d_TOW_at_current_symbol;
+                    d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
+                    tmp_ulong_int = current_synchro_data.Tracking_sample_counter;
+                    d_dump_file.write(reinterpret_cast<char*>(&tmp_ulong_int), sizeof(unsigned long int));
+                    tmp_double = d_TOW_at_Preamble;
+                    d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
             }
             catch (const std::ifstream::failure & e)
             {
@@ -185,22 +196,19 @@ int gps_l2c_telemetry_decoder_cc::general_work (int noutput_items __attribute__(
             }
         }
 
-
     //3. Make the output (copy the object contents to the GNURadio reserved memory)
     out[0] = current_synchro_data;
     return 1;
 }
 
 
-
-void gps_l2c_telemetry_decoder_cc::set_satellite(Gnss_Satellite satellite)
+void gps_l2c_telemetry_decoder_cc::set_satellite(const Gnss_Satellite & satellite)
 {
     d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
     LOG(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;
diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.h
index 5d99e19c1..240eac538 100644
--- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.h
+++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.h
@@ -57,7 +57,7 @@ class gps_l2c_telemetry_decoder_cc;
 typedef boost::shared_ptr<gps_l2c_telemetry_decoder_cc> gps_l2c_telemetry_decoder_cc_sptr;
 
 gps_l2c_telemetry_decoder_cc_sptr
-gps_l2c_make_telemetry_decoder_cc(Gnss_Satellite satellite, bool dump);
+gps_l2c_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump);
 
 /*!
  * \brief This class implements a block that decodes the SBAS integrity and corrections data defined in RTCA MOPS DO-229
@@ -67,8 +67,8 @@ class gps_l2c_telemetry_decoder_cc : public gr::block
 {
 public:
     ~gps_l2c_telemetry_decoder_cc();
-    void set_satellite(Gnss_Satellite satellite);  //!< Set satellite PRN
-    void set_channel(int channel);                 //!< Set receiver's channel
+    void set_satellite(const Gnss_Satellite & satellite);  //!< Set satellite PRN
+    void set_channel(int channel);                         //!< Set receiver's channel
 
     /*!
      * \brief This is where all signal processing takes place
@@ -79,8 +79,8 @@ public:
 
 private:
     friend gps_l2c_telemetry_decoder_cc_sptr
-    gps_l2c_make_telemetry_decoder_cc(Gnss_Satellite satellite, bool dump);
-    gps_l2c_telemetry_decoder_cc(Gnss_Satellite satellite, bool dump);
+    gps_l2c_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump);
+    gps_l2c_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump);
 
     bool d_dump;
     Gnss_Satellite d_satellite;
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 d90135bb6..f06cf16fd 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
@@ -48,7 +48,7 @@ using google::LogMessage;
 
 
 sbas_l1_telemetry_decoder_cc_sptr
-sbas_l1_make_telemetry_decoder_cc(Gnss_Satellite satellite, bool dump)
+sbas_l1_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump)
 {
     return sbas_l1_telemetry_decoder_cc_sptr(new sbas_l1_telemetry_decoder_cc(satellite, dump));
 }
@@ -56,7 +56,7 @@ sbas_l1_make_telemetry_decoder_cc(Gnss_Satellite satellite, bool dump)
 
 
 sbas_l1_telemetry_decoder_cc::sbas_l1_telemetry_decoder_cc(
-        Gnss_Satellite satellite,
+        const Gnss_Satellite & satellite,
         bool dump) :
                 gr::block("sbas_l1_telemetry_decoder_cc",
                 gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)),
@@ -79,7 +79,17 @@ sbas_l1_telemetry_decoder_cc::sbas_l1_telemetry_decoder_cc(
 
 sbas_l1_telemetry_decoder_cc::~sbas_l1_telemetry_decoder_cc()
 {
-    d_dump_file.close();
+    if(d_dump_file.is_open() == true)
+        {
+            try
+            {
+                    d_dump_file.close();
+            }
+            catch(const std::exception & ex)
+            {
+                    LOG(WARNING) << "Exception in destructor closing the dump file " << ex.what();
+            }
+        }
 }
 
 
@@ -88,8 +98,8 @@ int sbas_l1_telemetry_decoder_cc::general_work (int noutput_items __attribute__(
 {
     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
-    const Gnss_Synchro *in = (const Gnss_Synchro *)  input_items[0]; // input
-    Gnss_Synchro *out = (Gnss_Synchro *) output_items[0];     // output
+    Gnss_Synchro *out = reinterpret_cast<Gnss_Synchro *>(output_items[0]);           // Get the output buffer pointer
+    const Gnss_Synchro *in = reinterpret_cast<const Gnss_Synchro *>(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
@@ -98,7 +108,7 @@ int sbas_l1_telemetry_decoder_cc::general_work (int noutput_items __attribute__(
     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 = in[0].Tracking_sample_counter/in[0].fs;
+    double sample_stamp = static_cast<double>(in[0].Tracking_sample_counter) / static_cast<double>(in[0].fs);
 
     // decode only if enough samples in buffer
     if(d_sample_buf.size() >= d_block_size)
@@ -126,14 +136,14 @@ int sbas_l1_telemetry_decoder_cc::general_work (int noutput_items __attribute__(
             // compute message sample stamp
             // and fill messages in SBAS raw message objects
             //std::vector<Sbas_Raw_Msg> sbas_raw_msgs;
-            for(std::vector<msg_candiate_char_t>::const_iterator it = valid_msgs.begin();
-                    it != valid_msgs.end(); ++it)
+            for(std::vector<msg_candiate_char_t>::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 + ((double)message_sample_offset)/1000;
+                    double message_sample_stamp = sample_stamp + static_cast<double>(message_sample_offset) / 1000.0;
                     VLOG(EVENT) << "message_sample_stamp=" << message_sample_stamp
                             << " (sample_stamp=" << sample_stamp
                             << " sample_alignment=" << sample_alignment
@@ -167,7 +177,7 @@ int sbas_l1_telemetry_decoder_cc::general_work (int noutput_items __attribute__(
 
 
 
-void sbas_l1_telemetry_decoder_cc::set_satellite(Gnss_Satellite satellite)
+void sbas_l1_telemetry_decoder_cc::set_satellite(const Gnss_Satellite & satellite)
 {
     d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
     LOG(INFO) << "SBAS telemetry decoder in channel " << this->d_channel << " set to satellite " << d_satellite;
@@ -224,7 +234,7 @@ bool sbas_l1_telemetry_decoder_cc::sample_aligner::get_symbols(const std::vector
             // get the next samples
             for (int i = 0; i < d_n_smpls_in_history; i++)
                 {
-                    smpls[i] = ((int)i_sym)*sbas_l1_telemetry_decoder_cc::d_samples_per_symbol + i - 1 == -1 ? d_past_sample : samples[i_sym*sbas_l1_telemetry_decoder_cc::d_samples_per_symbol + i - 1];
+                    smpls[i] = static_cast<int>(i_sym) * sbas_l1_telemetry_decoder_cc::d_samples_per_symbol + i - 1 == -1 ? d_past_sample : samples[i_sym*sbas_l1_telemetry_decoder_cc::d_samples_per_symbol + i - 1];
                 }
 
             // update the pseudo correlations (IIR method) of the two possible alignments
@@ -304,7 +314,7 @@ bool sbas_l1_telemetry_decoder_cc::symbol_aligner_and_decoder::get_bits(const st
     std::vector<double> symbols_vd1(symbols); // aligned symbol vector -> copy input symbol vector
     std::vector<double> symbols_vd2;  // shifted symbol vector -> add past sample in front of input vector
     symbols_vd2.push_back(d_past_symbol);
-    for (std::vector<double>::const_iterator symbol_it = symbols.begin(); symbol_it != symbols.end() - 1; ++symbol_it)
+    for (std::vector<double>::const_iterator symbol_it = symbols.cbegin(); symbol_it != symbols.cend() - 1; ++symbol_it)
         {
             symbols_vd2.push_back(*symbol_it);
         }
@@ -351,7 +361,7 @@ void sbas_l1_telemetry_decoder_cc::frame_detector::get_frame_candidates(const st
     ss << "copy bits ";
     int count = 0;
     // copy new bits into the working buffer
-    for (std::vector<int>::const_iterator bit_it = bits.begin(); bit_it < bits.end(); ++bit_it)
+    for (std::vector<int>::const_iterator bit_it = bits.cbegin(); bit_it < bits.cend(); ++bit_it)
         {
             d_buffer.push_back(*bit_it);
             ss << *bit_it;
@@ -411,7 +421,7 @@ void sbas_l1_telemetry_decoder_cc::crc_verifier::get_valid_frames(const std::vec
     std::stringstream ss;
     VLOG(FLOW) << "get_valid_frames(): " << "msg_candidates.size()=" << msg_candidates.size();
     // for each candidate
-    for (std::vector<msg_candiate_int_t>::const_iterator candidate_it = msg_candidates.begin(); candidate_it < msg_candidates.end(); ++candidate_it)
+    for (std::vector<msg_candiate_int_t>::const_iterator candidate_it = msg_candidates.cbegin(); candidate_it < msg_candidates.cend(); ++candidate_it)
         {
             // convert to bytes
             std::vector<unsigned char> candidate_bytes;
@@ -436,7 +446,7 @@ void sbas_l1_telemetry_decoder_cc::crc_verifier::get_valid_frames(const std::vec
             ss << " Relbitoffset=" << candidate_it->first << " content=";
             for (std::vector<unsigned char>::iterator byte_it = candidate_bytes.begin(); byte_it < candidate_bytes.end(); ++byte_it)
                 {
-                    ss << std::setw(2) << std::setfill('0') << std::hex << (unsigned int)(*byte_it);
+                    ss << std::setw(2) << std::setfill('0') << std::hex << static_cast<unsigned int>((*byte_it));
                 }
             VLOG(SAMP_SYNC) << ss.str() << std::setfill(' ') << std::resetiosflags(std::ios::hex) << std::endl;
         }
@@ -452,22 +462,22 @@ void sbas_l1_telemetry_decoder_cc::crc_verifier::zerropad_back_and_convert_to_by
     const size_t bits_per_byte = 8;
     unsigned char byte = 0;
     VLOG(LMORE) << "zerropad_back_and_convert_to_bytes():" << byte;
-    for (std::vector<int>::const_iterator candidate_bit_it = msg_candidate.begin(); candidate_bit_it < msg_candidate.end(); ++candidate_bit_it)
+    for (std::vector<int>::const_iterator candidate_bit_it = msg_candidate.cbegin(); candidate_bit_it < msg_candidate.cend(); ++candidate_bit_it)
         {
             int idx_bit = candidate_bit_it - msg_candidate.begin();
             int bit_pos_in_current_byte = (bits_per_byte - 1) - (idx_bit % bits_per_byte);
-            byte |= (unsigned char)(*candidate_bit_it) << bit_pos_in_current_byte;
+            byte |= static_cast<unsigned char>(*candidate_bit_it) << bit_pos_in_current_byte;
             ss << *candidate_bit_it;
             if (idx_bit % bits_per_byte == bits_per_byte - 1)
                 {
                     bytes.push_back(byte);
-                    VLOG(LMORE) << ss.str() << " -> byte=" << std::setw(2) << std::setfill('0') << std::hex << (unsigned int)byte; ss.str("");
+                    VLOG(LMORE) << ss.str() << " -> byte=" << std::setw(2) << std::setfill('0') << std::hex << static_cast<unsigned int>(byte); ss.str("");
                     byte = 0;
                 }
         }
     bytes.push_back(byte); // implies: insert 6 zeros at the end to fit the 250bits into a multiple of bytes
     VLOG(LMORE) << " -> byte=" << std::setw(2)
-                << std::setfill('0') << std::hex << (unsigned int)byte
+                << std::setfill('0') << std::hex << static_cast<unsigned int>(byte)
                 << std::setfill(' ') << std::resetiosflags(std::ios::hex);
 }
 
@@ -480,22 +490,21 @@ void sbas_l1_telemetry_decoder_cc::crc_verifier::zerropad_front_and_convert_to_b
     unsigned char byte = 0;
     int idx_bit = 6; // insert 6 zeros at the front to fit the 250bits into a multiple of bytes
     VLOG(LMORE) << "zerropad_front_and_convert_to_bytes():" << byte;
-    for (std::vector<int>::const_iterator candidate_bit_it = msg_candidate.begin(); candidate_bit_it < msg_candidate.end(); ++candidate_bit_it)
+    for (std::vector<int>::const_iterator candidate_bit_it = msg_candidate.cbegin(); candidate_bit_it < msg_candidate.cend(); ++candidate_bit_it)
         {
             int bit_pos_in_current_byte = (bits_per_byte - 1) - (idx_bit % bits_per_byte);
-            byte |= (unsigned char)(*candidate_bit_it) << bit_pos_in_current_byte;
+            byte |= static_cast<unsigned char>(*candidate_bit_it) << bit_pos_in_current_byte;
             ss << *candidate_bit_it;
             if (idx_bit % bits_per_byte == bits_per_byte - 1)
                 {
                     bytes.push_back(byte);
                     VLOG(LMORE) << ss.str() << " -> byte=" << std::setw(2)
-                                << std::setfill('0') << std::hex << (unsigned int)byte; ss.str("");
+                                << std::setfill('0') << std::hex << static_cast<unsigned int>(byte); ss.str("");
                     byte = 0;
                 }
             idx_bit++;
         }
     VLOG(LMORE) << " -> byte=" << std::setw(2)
-                << std::setfill('0') << std::hex << (unsigned int)byte
+                << std::setfill('0') << std::hex << static_cast<unsigned int>(byte)
                 << std::setfill(' ') << std::resetiosflags(std::ios::hex);
 }
-
diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.h
index 4e9b6af96..ee0b2f732 100644
--- a/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.h
+++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.h
@@ -47,7 +47,7 @@ class sbas_l1_telemetry_decoder_cc;
 typedef boost::shared_ptr<sbas_l1_telemetry_decoder_cc> sbas_l1_telemetry_decoder_cc_sptr;
 
 sbas_l1_telemetry_decoder_cc_sptr
-sbas_l1_make_telemetry_decoder_cc(Gnss_Satellite satellite, bool dump);
+sbas_l1_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump);
 
 /*!
  * \brief This class implements a block that decodes the SBAS integrity and corrections data defined in RTCA MOPS DO-229
@@ -57,8 +57,8 @@ class sbas_l1_telemetry_decoder_cc : public gr::block
 {
 public:
     ~sbas_l1_telemetry_decoder_cc();
-    void set_satellite(Gnss_Satellite satellite);  //!< Set satellite PRN
-    void set_channel(int channel);                 //!< Set receiver's channel
+    void set_satellite(const Gnss_Satellite & satellite);  //!< Set satellite PRN
+    void set_channel(int channel);                         //!< Set receiver's channel
 
     /*!
      * \brief This is where all signal processing takes place
@@ -68,8 +68,8 @@ public:
 
 private:
     friend sbas_l1_telemetry_decoder_cc_sptr
-    sbas_l1_make_telemetry_decoder_cc(Gnss_Satellite satellite, bool dump);
-    sbas_l1_telemetry_decoder_cc(Gnss_Satellite satellite, bool dump);
+    sbas_l1_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump);
+    sbas_l1_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump);
 
     void viterbi_decoder(double *page_part_symbols, int *page_part_bits);
     void align_samples();
diff --git a/src/algorithms/telemetry_decoder/libs/CMakeLists.txt b/src/algorithms/telemetry_decoder/libs/CMakeLists.txt
index 091283038..f5b70e4f7 100644
--- a/src/algorithms/telemetry_decoder/libs/CMakeLists.txt
+++ b/src/algorithms/telemetry_decoder/libs/CMakeLists.txt
@@ -24,7 +24,7 @@ set(TELEMETRY_DECODER_LIB_SOURCES
 )
 
 include_directories(
-     $(CMAKE_CURRENT_SOURCE_DIR)
+     ${CMAKE_CURRENT_SOURCE_DIR}
      ${CMAKE_SOURCE_DIR}/src/core/system_parameters
      ${CMAKE_SOURCE_DIR}/src/core/interfaces
      ${CMAKE_SOURCE_DIR}/src/core/receiver
diff --git a/src/algorithms/telemetry_decoder/libs/convolutional.h b/src/algorithms/telemetry_decoder/libs/convolutional.h
index 5f0f1b379..936c45985 100644
--- a/src/algorithms/telemetry_decoder/libs/convolutional.h
+++ b/src/algorithms/telemetry_decoder/libs/convolutional.h
@@ -57,7 +57,7 @@ const float MAXLOG = 1e7;  /* Define infinity */
  *
  * This function is used by nsc_enc_bit(), rsc_enc_bit(), and rsc_tail()
  */
-static int parity_counter(int symbol, int length)
+inline static int parity_counter(int symbol, int length)
 {
     int counter;
     int temp_parity = 0;
@@ -71,7 +71,6 @@ static int parity_counter(int symbol, int length)
 }
 
 
-
 /*!
  * \brief Convolutionally encodes a single bit using a rate 1/n encoder.
  * Takes in one input bit at a time, and produces a n-bit output.
@@ -86,7 +85,7 @@ static int parity_counter(int symbol, int length)
  *
  * This function is used by nsc_transit()
  */
-static int nsc_enc_bit(int state_out_p[],
+inline static int nsc_enc_bit(int state_out_p[],
                        int input,
                        int state_in,
                        int g[],
@@ -113,11 +112,10 @@ static int nsc_enc_bit(int state_out_p[],
 }
 
 
-
 /*!
  * \brief Function that creates the transit and output vectors
  */
-static void nsc_transit(int output_p[],
+inline static void nsc_transit(int output_p[],
                         int trans_p[],
                         int input,
                         int g[],
@@ -138,7 +136,6 @@ static void nsc_transit(int output_p[],
 }
 
 
-
 /*!
  * \brief  Computes the branch metric used for decoding.
  *  \return (returned float) The metric between the hypothetical symbol and the received vector
@@ -147,7 +144,7 @@ static void nsc_transit(int output_p[],
  *  \param[in] nn            The length of the received vector
  *
  */
-static float Gamma(float  rec_array[],
+inline static float Gamma(float  rec_array[],
                    int symbol,
                    int nn)
 {
@@ -177,7 +174,7 @@ static float Gamma(float  rec_array[],
  * \param[out] output_u_int[]    Hard decisions on the data bits
  *
  */
-static void Viterbi(int output_u_int[],
+inline static void Viterbi(int output_u_int[],
                     int out0[],
                     int state0[],
                     int out1[],
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 45eefc1e2..68d286822 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
@@ -238,8 +238,8 @@ GpsL1CaSubframeFsm::GpsL1CaSubframeFsm()
     d_nav.reset();
     i_channel_ID = 0;
     i_satellite_PRN = 0;
-    d_subframe_ID=0;
-    d_flag_new_subframe=false;
+    d_subframe_ID = 0;
+    d_flag_new_subframe = false;
     initiate(); //start the FSM
 }
 
@@ -253,14 +253,14 @@ void GpsL1CaSubframeFsm::gps_word_to_subframe(int position)
 
 void GpsL1CaSubframeFsm::clear_flag_new_subframe()
 {
-    d_flag_new_subframe=false;
+    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 << "NAV Message: received subframe "
+    std::cout << "New GPS NAV message received: subframe "
               << d_subframe_ID << " from satellite "
               << Gnss_Satellite(std::string("GPS"), i_satellite_PRN) << std::endl;
     d_nav.i_satellite_PRN = i_satellite_PRN;
diff --git a/src/algorithms/telemetry_decoder/libs/libswiftcnav/CMakeLists.txt b/src/algorithms/telemetry_decoder/libs/libswiftcnav/CMakeLists.txt
index 1ef372aa8..836db1304 100644
--- a/src/algorithms/telemetry_decoder/libs/libswiftcnav/CMakeLists.txt
+++ b/src/algorithms/telemetry_decoder/libs/libswiftcnav/CMakeLists.txt
@@ -24,7 +24,7 @@ set(TELEMETRY_DECODER_LIBSWIFTCNAV_SOURCES
 )
 
 include_directories(
-     $(CMAKE_CURRENT_SOURCE_DIR)
+     ${CMAKE_CURRENT_SOURCE_DIR}
 )
 
 file(GLOB TELEMETRY_DECODER_LIBSWIFTCNAV_HEADERS "*.h")
diff --git a/src/algorithms/telemetry_decoder/libs/viterbi_decoder.h b/src/algorithms/telemetry_decoder/libs/viterbi_decoder.h
index f9b3249e5..ca3501fbd 100644
--- a/src/algorithms/telemetry_decoder/libs/viterbi_decoder.h
+++ b/src/algorithms/telemetry_decoder/libs/viterbi_decoder.h
@@ -32,8 +32,8 @@
 #ifndef GNSS_SDR_VITERBI_DECODER_H_
 #define GNSS_SDR_VITERBI_DECODER_H_
 
+#include <cstddef> // for size_t
 #include <deque>
-#include <cstdio>
 
 /*!
  * \brief Class that implements a Viterbi decoder
@@ -112,7 +112,7 @@ private:
     // operations on the trellis (change decoder state)
     void init_trellis_state();
     int do_acs(const double sym[], int nbits);
-    int do_traceback(size_t traceback_length);
+    int do_traceback(std::size_t traceback_length);
     int do_tb_and_decode(int traceback_length, int requested_decoding_length, int state, int bits[], float& indicator_metric);
 
     // branch metric function
diff --git a/src/algorithms/tracking/adapters/CMakeLists.txt b/src/algorithms/tracking/adapters/CMakeLists.txt
index 49ef6b7f4..da2051114 100644
--- a/src/algorithms/tracking/adapters/CMakeLists.txt
+++ b/src/algorithms/tracking/adapters/CMakeLists.txt
@@ -37,7 +37,7 @@ set(TRACKING_ADAPTER_SOURCES
 )
  
 include_directories(
-     $(CMAKE_CURRENT_SOURCE_DIR)
+     ${CMAKE_CURRENT_SOURCE_DIR}
      ${CMAKE_SOURCE_DIR}/src/core/system_parameters
      ${CMAKE_SOURCE_DIR}/src/core/interfaces
      ${CMAKE_SOURCE_DIR}/src/core/receiver
diff --git a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc
index ce9613e24..c3a37b548 100755
--- a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc
+++ b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc
@@ -62,7 +62,8 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking(
     float very_early_late_space_chips;
 
     item_type = configuration->property(role + ".item_type", default_item_type);
-    fs_in = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
+    int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
+    fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
     f_if = configuration->property(role + ".if", 0);
     dump = configuration->property(role + ".dump", false);
     pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0);
diff --git a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.h b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.h
index 874044b7b..4b478f666 100755
--- a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.h
+++ b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.h
@@ -7,7 +7,7 @@
  * 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, Birkha user, 2007
+ * Approach, Birkhauser, 2007
  *
  * -------------------------------------------------------------------------
  *
@@ -59,41 +59,40 @@ public:
 
     virtual ~GalileoE1DllPllVemlTracking();
 
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
 
     //! Returns "Galileo_E1_DLL_PLL_VEML_Tracking"
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "Galileo_E1_DLL_PLL_VEML_Tracking";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return item_size_;
     }
 
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
-
+    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;
 
     /*!
      * \brief Set tracking channel unique ID
      */
-    void set_channel(unsigned int channel);
+    void set_channel(unsigned int channel) override;
 
     /*!
      * \brief Set acquisition/tracking common Gnss_Synchro object pointer
      * to efficiently exchange synchronization data between acquisition and
      *  tracking blocks
      */
-    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
+    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
 
-
-    void start_tracking();
+    void start_tracking() override;
 
 private:
     galileo_e1_dll_pll_veml_tracking_cc_sptr tracking_;
diff --git a/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc b/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc
index 1f8cd2744..7dd56092a 100644
--- a/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc
+++ b/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc
@@ -63,7 +63,8 @@ GalileoE1TcpConnectorTracking::GalileoE1TcpConnectorTracking(
     float very_early_late_space_chips;
     size_t port_ch0;
     item_type = configuration->property(role + ".item_type",default_item_type);
-    fs_in = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
+    int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
+    fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
     f_if = configuration->property(role + ".if", 0);
     dump = configuration->property(role + ".dump", false);
     pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0);
diff --git a/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.h b/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.h
index c4e0c3e6a..bba2940cd 100644
--- a/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.h
+++ b/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.h
@@ -59,41 +59,40 @@ public:
 
     virtual ~GalileoE1TcpConnectorTracking();
 
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
 
     //! Returns "Galileo_E1_TCP_CONNECTOR_Tracking"
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "Galileo_E1_TCP_CONNECTOR_Tracking";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return item_size_;
     }
 
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
-
+    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;
 
     /*!
      * \brief Set tracking channel unique ID
      */
-    void set_channel(unsigned int channel);
+    void set_channel(unsigned int channel) override;
 
     /*!
      * \brief Set acquisition/tracking common Gnss_Synchro object pointer
      * to efficiently exchange synchronization data between acquisition and
      *  tracking blocks
      */
-    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
+    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
 
-
-    void start_tracking();
+    void start_tracking() override;
 
 private:
     galileo_e1_tcp_connector_tracking_cc_sptr tracking_;
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 c90d9814e..63ea93389 100644
--- a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc
+++ b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc
@@ -66,7 +66,8 @@ GalileoE5aDllPllTracking::GalileoE5aDllPllTracking(
     float early_late_space_chips;
     item_type = configuration->property(role + ".item_type", default_item_type);
     //vector_length = configuration->property(role + ".vector_length", 2048);
-    fs_in = configuration->property("GNSS-SDR.internal_fs_hz", 12000000);
+    int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 12000000);
+    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", 5.0);
diff --git a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.h b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.h
index b9b46780a..a49aab785 100644
--- a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.h
+++ b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.h
@@ -59,39 +59,39 @@ public:
 
     virtual ~GalileoE5aDllPllTracking();
 
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
 
     //! Returns "Galileo_E5a_DLL_PLL_Tracking"
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "Galileo_E5a_DLL_PLL_Tracking";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return item_size_;
     }
 
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+    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;
 
     /*!
      * \brief Set tracking channel unique ID
      */
-    void set_channel(unsigned int channel);
+    void set_channel(unsigned int channel) override;
 
     /*!
      * \brief Set acquisition/tracking common Gnss_Synchro object pointer
      * to efficiently exchange synchronization data between acquisition and tracking blocks
      */
-    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
+    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
 
-
-    void start_tracking();
+    void start_tracking() override;
 
 private:
     galileo_e5a_dll_pll_tracking_cc_sptr tracking_;
diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.cc b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.cc
index c294de3fc..74c00539f 100644
--- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.cc
+++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.cc
@@ -64,7 +64,8 @@ GpsL1CaDllPllCAidTracking::GpsL1CaDllPllCAidTracking(
     float early_late_space_chips;
     item_type_ = configuration->property(role + ".item_type", default_item_type);
     //vector_length = configuration->property(role + ".vector_length", 2048);
-    fs_in = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
+    int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
+    fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
     f_if = configuration->property(role + ".if", 0);
     dump = configuration->property(role + ".dump", false);
     pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0);
diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.h b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.h
index f8c395b24..d3b01a87c 100644
--- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.h
+++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.h
@@ -8,7 +8,7 @@
  * 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, Birkha user, 2007
+ * Approach, Birkhauser, 2007
  *
  * -------------------------------------------------------------------------
  *
@@ -52,7 +52,6 @@ class ConfigurationInterface;
 class GpsL1CaDllPllCAidTracking : public TrackingInterface
 {
 public:
-
   GpsL1CaDllPllCAidTracking(ConfigurationInterface* configuration,
             std::string role,
             unsigned int in_streams,
@@ -60,40 +59,39 @@ public:
 
     virtual ~GpsL1CaDllPllCAidTracking();
 
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
 
     //! Returns "GPS_L1_CA_DLL_PLL_C_Aid_Tracking"
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "GPS_L1_CA_DLL_PLL_C_Aid_Tracking";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return item_size_;
     }
 
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
-
+    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;
 
     /*!
      * \brief Set tracking channel unique ID
      */
-    void set_channel(unsigned int channel);
+    void set_channel(unsigned int channel) override;
 
     /*!
      * \brief Set acquisition/tracking common Gnss_Synchro object pointer
      * to efficiently exchange synchronization data between acquisition and tracking blocks
      */
-    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
+    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
 
-
-    void start_tracking();
+    void start_tracking() override;
 
 private:
     gps_l1_ca_dll_pll_c_aid_tracking_cc_sptr tracking_cc;
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
index e21b6bc04..7e0e01a9b 100644
--- 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
@@ -36,19 +36,17 @@
  * -------------------------------------------------------------------------
  */
 
-
 #include "gps_l1_ca_dll_pll_c_aid_tracking_fpga.h"
 #include <glog/logging.h>
 #include "GPS_L1_CA.h"
 #include "configuration_interface.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)
+        role_(role), in_streams_(in_streams), out_streams_(out_streams)
 {
     DLOG(INFO) << "role " << role;
     //################# CONFIGURATION PARAMETERS ########################
@@ -63,8 +61,12 @@ GpsL1CaDllPllCAidTrackingFpga::GpsL1CaDllPllCAidTrackingFpga(
     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);
-    fs_in = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
+    int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
+    fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
     f_if = configuration->property(role + ".if", 0);
     dump = configuration->property(role + ".dump", false);
     pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0);
@@ -76,27 +78,22 @@ GpsL1CaDllPllCAidTrackingFpga::GpsL1CaDllPllCAidTrackingFpga(
 
     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!
+    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)
+    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);
+                    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
@@ -104,8 +101,10 @@ GpsL1CaDllPllCAidTrackingFpga::GpsL1CaDllPllCAidTrackingFpga(
 
             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";
+            LOG(WARNING) << item_type_
+                    << " the tracking item type for the FPGA tracking test has to be cshort";
         }
+
     channel_ = 0;
 }
 
@@ -118,7 +117,6 @@ GpsL1CaDllPllCAidTrackingFpga::~GpsL1CaDllPllCAidTrackingFpga()
 
 void GpsL1CaDllPllCAidTrackingFpga::start_tracking()
 {
-
     if (item_type_.compare("cshort") == 0)
         {
             tracking_fpga_sc->start_tracking();
@@ -126,7 +124,8 @@ void GpsL1CaDllPllCAidTrackingFpga::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";
+            LOG(WARNING) << item_type_
+                    << " the tracking item type for the FPGA tracking test has to be cshort";
         }
 }
 
@@ -145,12 +144,14 @@ void GpsL1CaDllPllCAidTrackingFpga::set_channel(unsigned int 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";
+            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)
+void GpsL1CaDllPllCAidTrackingFpga::set_gnss_synchro(
+        Gnss_Synchro* p_gnss_synchro)
 {
     if (item_type_.compare("cshort") == 0)
         {
@@ -159,21 +160,26 @@ void GpsL1CaDllPllCAidTrackingFpga::set_gnss_synchro(Gnss_Synchro* p_gnss_synchr
     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";
+            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 */};
+    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 */};
+    if (top_block)
+        { /* top_block is not null */
+        };
     //nothing to disconnect, now the tracking uses gr_sync_decimator
 }
 
@@ -188,7 +194,8 @@ gr::basic_block_sptr GpsL1CaDllPllCAidTrackingFpga::get_left_block()
     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";
+            LOG(WARNING) << item_type_
+                    << " the tracking item type for the FPGA tracking test has to be cshort";
             return nullptr;
         }
 }
@@ -203,7 +210,15 @@ gr::basic_block_sptr GpsL1CaDllPllCAidTrackingFpga::get_right_block()
     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";
+            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_c_aid_tracking_fpga.h b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking_fpga.h
index 8533220ff..c828f9c3d 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_c_aid_tracking_fpga.h
@@ -9,7 +9,7 @@
  * 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, Birkha user, 2007
+ * Approach, Birkhauser, 2007
  *
  * -------------------------------------------------------------------------
  *
@@ -43,7 +43,6 @@
 #include "tracking_interface.h"
 #include "gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.h"
 
-
 class ConfigurationInterface;
 
 /*!
@@ -53,47 +52,47 @@ class GpsL1CaDllPllCAidTrackingFpga : public TrackingInterface
 {
 public:
     GpsL1CaDllPllCAidTrackingFpga(ConfigurationInterface* configuration,
-            std::string role,
-            unsigned int in_streams,
+            std::string role, unsigned int in_streams,
             unsigned int out_streams);
 
     virtual ~GpsL1CaDllPllCAidTrackingFpga();
 
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
 
     //! Returns "GPS_L1_CA_DLL_PLL_C_Aid_Tracking_Fpga"
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "GPS_L1_CA_DLL_PLL_C_Aid_Tracking_Fpga";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return item_size_;
     }
 
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
+    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();
-    gr::basic_block_sptr get_right_block();
-
+    gr::basic_block_sptr get_left_block() override;
+    gr::basic_block_sptr get_right_block() override;
 
     /*!
      * \brief Set tracking channel unique ID
      */
-    void set_channel(unsigned int channel);
+    void set_channel(unsigned int channel) override;
 
     /*!
      * \brief Set acquisition/tracking common Gnss_Synchro object pointer
      * to efficiently exchange synchronization data between acquisition and tracking blocks
      */
-    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
+    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
 
+    void start_tracking() override;
 
-    void start_tracking();
+    void reset(void);
 
 private:
     gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc_sptr tracking_fpga_sc;
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 2ab0a35c0..67e086aa1 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
@@ -62,7 +62,8 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking(
     float dll_bw_hz;
     float early_late_space_chips;
     item_type = configuration->property(role + ".item_type", default_item_type);
-    fs_in = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
+    int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
+    fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
     f_if = configuration->property(role + ".if", 0);
     dump = configuration->property(role + ".dump", false);
     pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0);
diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.h b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.h
index 3f6594944..495594a1f 100644
--- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.h
+++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.h
@@ -8,7 +8,7 @@
  * 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, Birkha user, 2007
+ * Approach, Birkhauser, 2007
  *
  * -------------------------------------------------------------------------
  *
@@ -58,39 +58,39 @@ public:
 
     virtual ~GpsL1CaDllPllTracking();
 
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
 
     //! Returns "GPS_L1_CA_DLL_PLL_Tracking"
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "GPS_L1_CA_DLL_PLL_Tracking";
     }
 
-    size_t item_size()
+    inline size_t item_size() override
     {
         return item_size_;
     }
 
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+    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;
 
     /*!
      * \brief Set tracking channel unique ID
      */
-    void set_channel(unsigned int channel);
+    void set_channel(unsigned int channel) override;
 
     /*!
      * \brief Set acquisition/tracking common Gnss_Synchro object pointer
      * to efficiently exchange synchronization data between acquisition and tracking blocks
      */
-    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
+    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
 
-    void start_tracking();
+    void start_tracking() override;
 
 private:
     gps_l1_ca_dll_pll_tracking_cc_sptr tracking_;
diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_gpu.cc b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_gpu.cc
index ac36f52ec..81822a5f5 100644
--- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_gpu.cc
+++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_gpu.cc
@@ -62,7 +62,8 @@ GpsL1CaDllPllTrackingGPU::GpsL1CaDllPllTrackingGPU(
     float early_late_space_chips;
     item_type = configuration->property(role + ".item_type", default_item_type);
     //vector_length = configuration->property(role + ".vector_length", 2048);
-    fs_in = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
+    int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
+    fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
     f_if = configuration->property(role + ".if", 0);
     dump = configuration->property(role + ".dump", false);
     pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0);
diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_gpu.h b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_gpu.h
index 263268946..5ff4dcf5d 100644
--- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_gpu.h
+++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_gpu.h
@@ -7,7 +7,7 @@
  * 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, Birkha user, 2007
+ * Approach, Birkhauser, 2007
  *
  * -------------------------------------------------------------------------
  *
@@ -57,38 +57,39 @@ public:
 
     virtual ~GpsL1CaDllPllTrackingGPU();
 
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
 
     //! Returns "GPS_L1_CA_DLL_PLL_Tracking_GPU"
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "GPS_L1_CA_DLL_PLL_Tracking_GPU";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return item_size_;
     }
 
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
+    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;
 
     /*!
      * \brief Set tracking channel unique ID
      */
-    void set_channel(unsigned int channel);
+    void set_channel(unsigned int channel) override;
 
     /*!
      * \brief Set acquisition/tracking common Gnss_Synchro object pointer
      * to efficiently exchange synchronization data between acquisition and tracking blocks
      */
-    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
+    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
 
-    void start_tracking();
+    void start_tracking() override;
 
 private:
     gps_l1_ca_dll_pll_tracking_gpu_cc_sptr tracking_;
diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.cc b/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.cc
index 38a2a0851..ced0f06fe 100644
--- a/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.cc
+++ b/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.cc
@@ -61,7 +61,8 @@ GpsL1CaTcpConnectorTracking::GpsL1CaTcpConnectorTracking(
     size_t port_ch0;
     item_type = configuration->property(role + ".item_type",default_item_type);
     //vector_length = configuration->property(role + ".vector_length", 2048);
-    fs_in = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
+    int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
+    fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
     f_if = configuration->property(role + ".if", 0);
     dump = configuration->property(role + ".dump", false);
     early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5);
diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.h b/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.h
index 32d91e34f..b2327e04a 100644
--- a/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.h
+++ b/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.h
@@ -8,7 +8,7 @@
  * 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, Birkha user, 2007
+ * Approach, Birkhauser, 2007
  *
  * -------------------------------------------------------------------------
  *
@@ -52,7 +52,6 @@ class GpsL1CaTcpConnectorTracking : public TrackingInterface
 {
 
 public:
-
   GpsL1CaTcpConnectorTracking(ConfigurationInterface* configuration,
             std::string role,
             unsigned int in_streams,
@@ -60,40 +59,39 @@ public:
 
     virtual ~GpsL1CaTcpConnectorTracking();
 
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
 
     //! Returns "GPS_L1_CA_TCP_CONNECTOR_Tracking"
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "GPS_L1_CA_TCP_CONNECTOR_Tracking";
     }
-    size_t item_size()
+
+    inline size_t item_size() override
     {
         return item_size_;
     }
 
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
-
+    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;
 
     /*!
      * \brief Set tracking channel unique ID
      */
-    void set_channel(unsigned int channel);
+    void set_channel(unsigned int channel) override;
 
     /*!
      * \brief Set acquisition/tracking common Gnss_Synchro object pointer
      * to efficiently exchange synchronization data between acquisition and tracking blocks
      */
-    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
+    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
 
-
-    void start_tracking();
+    void start_tracking() override;
 
 private:
 
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 88b537478..83bab16eb 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
@@ -61,7 +61,8 @@ GpsL2MDllPllTracking::GpsL2MDllPllTracking(
     float dll_bw_hz;
     float early_late_space_chips;
     item_type = configuration->property(role + ".item_type", default_item_type);
-    fs_in = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
+    int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
+    fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
     f_if = configuration->property(role + ".if", 0);
     dump = configuration->property(role + ".dump", false);
     pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0);
@@ -70,7 +71,7 @@ GpsL2MDllPllTracking::GpsL2MDllPllTracking(
     std::string default_dump_filename = "./track_ch";
     dump_filename = configuration->property(role + ".dump_filename",
             default_dump_filename); //unused!
-    vector_length = std::round((double)fs_in / ((double)GPS_L2_M_CODE_RATE_HZ / (double)GPS_L2_M_CODE_LENGTH_CHIPS));
+    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)));
 
     //################# MAKE TRACKING GNURadio object ###################
     if (item_type.compare("gr_complex") == 0)
diff --git a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.h b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.h
index cd174b2f7..80b214811 100644
--- a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.h
+++ b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.h
@@ -8,7 +8,7 @@
  * 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, Birkha user, 2007
+ * Approach, Birkhauser, 2007
  *
  * -------------------------------------------------------------------------
  *
@@ -58,40 +58,39 @@ public:
 
     virtual ~GpsL2MDllPllTracking();
 
-    std::string role()
+    inline std::string role() override
     {
         return role_;
     }
 
     //! Returns "GPS_L2_M_DLL_PLL_Tracking"
-    std::string implementation()
+    inline std::string implementation() override
     {
         return "GPS_L2_M_DLL_PLL_Tracking";
     }
 
-    size_t item_size()
+    inline size_t item_size() override
     {
         return item_size_;
     }
 
-    void connect(gr::top_block_sptr top_block);
-    void disconnect(gr::top_block_sptr top_block);
-    gr::basic_block_sptr get_left_block();
-    gr::basic_block_sptr get_right_block();
-
+    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;
 
     /*!
      * \brief Set tracking channel unique ID
      */
-    void set_channel(unsigned int channel);
+    void set_channel(unsigned int channel) override;
 
     /*!
      * \brief Set acquisition/tracking common Gnss_Synchro object pointer
      * to efficiently exchange synchronization data between acquisition and tracking blocks
      */
-    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
+    void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
 
-    void start_tracking();
+    void start_tracking() override;
 
 private:
     gps_l2_m_dll_pll_tracking_cc_sptr tracking_;
diff --git a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt
index 32b0be6eb..d7c8981c6 100644
--- a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt
+++ b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt
@@ -39,7 +39,7 @@ set(TRACKING_GR_BLOCKS_SOURCES
 )
 
 include_directories(
-     $(CMAKE_CURRENT_SOURCE_DIR)
+     ${CMAKE_CURRENT_SOURCE_DIR}
      ${CMAKE_SOURCE_DIR}/src/core/system_parameters
      ${CMAKE_SOURCE_DIR}/src/core/interfaces
      ${CMAKE_SOURCE_DIR}/src/core/receiver
diff --git a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_dll_pll_veml_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_dll_pll_veml_tracking_cc.cc
index daca4bb28..9c23835dc 100755
--- a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_dll_pll_veml_tracking_cc.cc
+++ b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_dll_pll_veml_tracking_cc.cc
@@ -11,7 +11,7 @@
  *
  * -------------------------------------------------------------------------
  *
- * Copyright (C) 2010-2015  (see AUTHORS file for a list of contributors)
+ * Copyright (C) 2010-2017  (see AUTHORS file for a list of contributors)
  *
  * GNSS-SDR is a software defined Global Navigation
  *          Satellite Systems receiver
@@ -129,7 +129,7 @@ galileo_e1_dll_pll_veml_tracking_cc::galileo_e1_dll_pll_veml_tracking_cc(
 
     // Initialization of local code replica
     // Get space for a vector with the sinboc(1,1) replica sampled 2x/chip
-    d_ca_code = static_cast<gr_complex*>(volk_gnsssdr_malloc((2 * Galileo_E1_B_CODE_LENGTH_CHIPS) * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
+    d_ca_code = static_cast<float*>(volk_gnsssdr_malloc((2 * Galileo_E1_B_CODE_LENGTH_CHIPS) * sizeof(float), volk_gnsssdr_get_alignment()));
 
     // correlator outputs (scalar)
     d_n_correlator_taps = 5; // Very-Early, Early, Prompt, Late, Very-Late
@@ -199,6 +199,7 @@ galileo_e1_dll_pll_veml_tracking_cc::galileo_e1_dll_pll_veml_tracking_cc(
     d_acc_code_phase_secs = 0.0;
 }
 
+
 void galileo_e1_dll_pll_veml_tracking_cc::start_tracking()
 {
     d_acq_code_phase_samples = d_acquisition_gnss_synchro->Acq_delay_samples;
@@ -210,7 +211,7 @@ void galileo_e1_dll_pll_veml_tracking_cc::start_tracking()
     d_code_loop_filter.initialize();    // initialize the code filter
 
     // generate local reference ALWAYS starting at chip 1 (2 samples per chip)
-    galileo_e1_code_gen_complex_sampled(d_ca_code,
+    galileo_e1_code_gen_float_sampled(d_ca_code,
                                         d_acquisition_gnss_synchro->Signal,
                                         false,
                                         d_acquisition_gnss_synchro->PRN,
@@ -236,7 +237,7 @@ void galileo_e1_dll_pll_veml_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;
+    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;
 
     // enable tracking
@@ -247,20 +248,35 @@ void galileo_e1_dll_pll_veml_tracking_cc::start_tracking()
               << " PULL-IN Code Phase [samples]=" << d_acq_code_phase_samples;
 }
 
+
 galileo_e1_dll_pll_veml_tracking_cc::~galileo_e1_dll_pll_veml_tracking_cc()
 {
-    d_dump_file.close();
-
-    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();
+    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();
+    }
+    catch(const std::exception & ex)
+    {
+            LOG(WARNING) << "Exception in destructor " << ex.what();
+    }
 }
 
 
-
 int galileo_e1_dll_pll_veml_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)
 {
@@ -270,8 +286,8 @@ int galileo_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items __attri
     double code_error_filt_chips = 0.0;
 
     // Block input data and block output stream pointers
-    const gr_complex* in = (gr_complex*) input_items[0];
-    Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0];
+    const gr_complex* in = reinterpret_cast<const gr_complex *>(input_items[0]);
+    Gnss_Synchro **out = reinterpret_cast<Gnss_Synchro **>(&output_items[0]);
     // GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder
     Gnss_Synchro current_synchro_data = Gnss_Synchro();
 
@@ -291,7 +307,7 @@ int galileo_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items __attri
                     acq_trk_shif_correction_samples = d_current_prn_length_samples - std::fmod(static_cast<double>(acq_to_trk_delay_samples), static_cast<double>(d_current_prn_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;
-                    current_synchro_data.fs=d_fs_in;
+                    current_synchro_data.fs = d_fs_in;
                     *out[0] = current_synchro_data;
                     d_sample_counter = d_sample_counter + samples_offset; //count for the processed samples
                     d_pull_in = false;
@@ -415,9 +431,9 @@ int galileo_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items __attri
     current_synchro_data.System = {'E'};
     std::string str_aux = "1B";
     const char * str = str_aux.c_str(); // get a C style null terminated string
-    std::memcpy((void*)current_synchro_data.Signal, str, 3);
+    std::memcpy(static_cast<void*>(current_synchro_data.Signal), str, 3);
 
-    current_synchro_data.fs=d_fs_in;
+    current_synchro_data.fs = d_fs_in;
     *out[0] = current_synchro_data;
 
     if(d_dump)
@@ -477,10 +493,13 @@ int galileo_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items __attri
                     d_dump_file.write(reinterpret_cast<char*>(&tmp_float), sizeof(float));
                     tmp_double = static_cast<double>(d_sample_counter + d_current_prn_length_samples);
                     d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
+                    // PRN
+                    unsigned int prn_ = d_acquisition_gnss_synchro->PRN;
+                    d_dump_file.write(reinterpret_cast<char*>(&prn_), sizeof(unsigned int));
             }
             catch (const std::ifstream::failure &e)
             {
-                    LOG(WARNING) << "Exception writing trk dump file " << e.what() << std::endl;
+                    LOG(WARNING) << "Exception writing trk dump file " << e.what();
             }
         }
     consume_each(d_current_prn_length_samples); // this is required for gr_block derivates
@@ -510,7 +529,7 @@ void galileo_e1_dll_pll_veml_tracking_cc::set_channel(unsigned int channel)
                     }
                     catch (const std::ifstream::failure &e)
                     {
-                            LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what() << std::endl;
+                            LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what();
                     }
                 }
         }
diff --git a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_dll_pll_veml_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_dll_pll_veml_tracking_cc.h
index 3377234cf..09e6fffe6 100755
--- a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_dll_pll_veml_tracking_cc.h
+++ b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_dll_pll_veml_tracking_cc.h
@@ -6,7 +6,7 @@
  *
  * -------------------------------------------------------------------------
  *
- * Copyright (C) 2010-2015  (see AUTHORS file for a list of contributors)
+ * Copyright (C) 2010-2017  (see AUTHORS file for a list of contributors)
  *
  * GNSS-SDR is a software defined Global Navigation
  *          Satellite Systems receiver
@@ -39,7 +39,7 @@
 #include "gnss_synchro.h"
 #include "tracking_2nd_DLL_filter.h"
 #include "tracking_2nd_PLL_filter.h"
-#include "cpu_multicorrelator.h"
+#include "cpu_multicorrelator_real_codes.h"
 
 class galileo_e1_dll_pll_veml_tracking_cc;
 
@@ -120,10 +120,10 @@ private:
     double d_early_late_spc_chips;
     double d_very_early_late_spc_chips;
 
-    gr_complex* d_ca_code;
+    float* d_ca_code;
     float* d_local_code_shift_chips;
     gr_complex* d_correlator_outs;
-    cpu_multicorrelator multicorrelator_cpu;
+    cpu_multicorrelator_real_codes multicorrelator_cpu;
 
     gr_complex *d_Very_Early;
     gr_complex *d_Early;
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 7df873fb1..6204215a5 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
@@ -87,7 +87,7 @@ void Galileo_E1_Tcp_Connector_Tracking_cc::forecast (int noutput_items,
 {
     if (noutput_items != 0)
         {
-            ninput_items_required[0] = (int)d_vector_length*2; // set the required available samples in each call
+            ninput_items_required[0] = static_cast<int>(d_vector_length) * 2; // set the required available samples in each call
         }
 }
 
@@ -155,7 +155,7 @@ Galileo_E1_Tcp_Connector_Tracking_cc::Galileo_E1_Tcp_Connector_Tracking_cc(
     d_local_code_shift_chips[4] = d_very_early_late_spc_chips;
 
     d_correlation_length_samples = d_vector_length;
- 
+
     multicorrelator_cpu.init(2 * d_correlation_length_samples, d_n_correlator_taps);
 
     //--- Perform initializations ------------------------------
@@ -173,7 +173,7 @@ Galileo_E1_Tcp_Connector_Tracking_cc::Galileo_E1_Tcp_Connector_Tracking_cc(
     d_enable_tracking = false;
     d_pull_in = false;
 
-    d_current_prn_length_samples = (int)d_vector_length;
+    d_current_prn_length_samples = static_cast<int>(d_vector_length);
 
     // CN0 estimation and lock detector buffers
     d_cn0_estimation_counter = 0;
@@ -231,7 +231,7 @@ void Galileo_E1_Tcp_Connector_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;
+    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;
 
     // enable tracking
@@ -244,15 +244,30 @@ void Galileo_E1_Tcp_Connector_Tracking_cc::start_tracking()
 
 Galileo_E1_Tcp_Connector_Tracking_cc::~Galileo_E1_Tcp_Connector_Tracking_cc()
 {
-    d_dump_file.close();
-
-    delete[] d_Prompt_buffer;
-    volk_gnsssdr_free(d_ca_code);
-    volk_gnsssdr_free(d_local_code_shift_chips);
-    volk_gnsssdr_free(d_correlator_outs);
-
-    d_tcp_com.close_tcp_connection(d_port);
-    multicorrelator_cpu.free();
+    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;
+            d_tcp_com.close_tcp_connection(d_port);
+            multicorrelator_cpu.free();
+    }
+    catch(const std::exception & ex)
+    {
+            LOG(WARNING) << "Exception in destructor " << ex.what();
+    }
 }
 
 
@@ -267,8 +282,8 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attr
     // GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder
     Gnss_Synchro current_synchro_data = Gnss_Synchro();
     // Block input data and block output stream pointers
-    const gr_complex* in = (gr_complex*) input_items[0];
-    Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0];
+    const gr_complex* in = reinterpret_cast<const gr_complex *>(input_items[0]);
+    Gnss_Synchro **out = reinterpret_cast<Gnss_Synchro **>(&output_items[0]);
     if (d_enable_tracking == true)
         {
             // Fill the acquisition data
@@ -282,10 +297,10 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attr
                     float 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_current_prn_length_samples - fmod((float)acq_to_trk_delay_samples, (float)d_current_prn_length_samples);
+                    acq_trk_shif_correction_samples = d_current_prn_length_samples - fmod(static_cast<float>(acq_to_trk_delay_samples), static_cast<float>(d_current_prn_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;
-                    current_synchro_data.fs=d_fs_in;
+                    current_synchro_data.fs = d_fs_in;
                     *out[0] = current_synchro_data;
                     d_sample_counter = d_sample_counter + samples_offset; //count for the processed samples
                     d_pull_in = false;
@@ -355,10 +370,10 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attr
             double T_prn_samples;
             double K_blk_samples;
             // Compute the next buffer lenght based in the new period of the PRN sequence and the code phase error estimation
-            T_chip_seconds = 1 / (double)d_code_freq_chips;
+            T_chip_seconds = 1 / static_cast<double>(d_code_freq_chips);
             T_prn_seconds = T_chip_seconds * Galileo_E1_B_CODE_LENGTH_CHIPS;
-            T_prn_samples = T_prn_seconds * (double)d_fs_in;
-            K_blk_samples = T_prn_samples + d_rem_code_phase_samples + code_error_filt_secs * (double)d_fs_in;
+            T_prn_samples = T_prn_seconds * static_cast<double>(d_fs_in);
+            K_blk_samples = T_prn_samples + d_rem_code_phase_samples + code_error_filt_secs * static_cast<double>(d_fs_in);
             d_current_prn_length_samples = round(K_blk_samples); //round to a discrete samples
             //d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; //rounding error < 1 sample
 
@@ -400,15 +415,15 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attr
                 }
 
             // ########### Output the tracking data to navigation and PVT ##########
-            current_synchro_data.Prompt_I = (double)(*d_Prompt).real();
-            current_synchro_data.Prompt_Q = (double)(*d_Prompt).imag();
+            current_synchro_data.Prompt_I = static_cast<double>((*d_Prompt).real());
+            current_synchro_data.Prompt_Q = static_cast<double>((*d_Prompt).imag());
             // Tracking_timestamp_secs is aligned with the PRN start sample
             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;
             d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; //rounding error < 1 sample
-            current_synchro_data.Carrier_phase_rads = (double)d_acc_carrier_phase_rad;
-            current_synchro_data.Carrier_Doppler_hz = (double)d_carrier_doppler_hz;
-            current_synchro_data.CN0_dB_hz = (double)d_CN0_SNV_dB_Hz;
+            current_synchro_data.Carrier_phase_rads = static_cast<double>(d_acc_carrier_phase_rad);
+            current_synchro_data.Carrier_Doppler_hz = static_cast<double>(d_carrier_doppler_hz);
+            current_synchro_data.CN0_dB_hz = static_cast<double>(d_CN0_SNV_dB_Hz);
             current_synchro_data.Flag_valid_symbol_output = true;
             current_synchro_data.correlation_length_ms = 4;
         }
@@ -426,9 +441,9 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attr
     current_synchro_data.System = {'E'};
     std::string str_aux = "1B";
     const char * str = str_aux.c_str(); // get a C style null terminated string
-    std::memcpy((void*)current_synchro_data.Signal, str, 3);
+    std::memcpy(static_cast<void*>(current_synchro_data.Signal), str, 3);
 
-    current_synchro_data.fs=d_fs_in;
+    current_synchro_data.fs = d_fs_in;
     *out[0] = current_synchro_data;
 
     if(d_dump)
@@ -451,40 +466,44 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attr
             try
             {
                     // EPR
-                    d_dump_file.write((char*)&tmp_VE, sizeof(float));
-                    d_dump_file.write((char*)&tmp_E, sizeof(float));
-                    d_dump_file.write((char*)&tmp_P, sizeof(float));
-                    d_dump_file.write((char*)&tmp_L, sizeof(float));
-                    d_dump_file.write((char*)&tmp_VL, sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&tmp_VE), sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&tmp_E), sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&tmp_P), sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&tmp_L), sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&tmp_VL), sizeof(float));
                     // PROMPT I and Q (to analyze navigation symbols)
-                    d_dump_file.write((char*)&prompt_I, sizeof(float));
-                    d_dump_file.write((char*)&prompt_Q, sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&prompt_I), sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&prompt_Q), sizeof(float));
                     // PRN start sample stamp
-                    d_dump_file.write((char*)&d_sample_counter, sizeof(unsigned long int));
+                    d_dump_file.write(reinterpret_cast<char*>(&d_sample_counter), sizeof(unsigned long int));
                     // accumulated carrier phase
-                    d_dump_file.write((char*)&d_acc_carrier_phase_rad, sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&d_acc_carrier_phase_rad), sizeof(float));
 
                     // carrier and code frequency
-                    d_dump_file.write((char*)&d_carrier_doppler_hz, sizeof(float));
-                    d_dump_file.write((char*)&d_code_freq_chips, sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&d_carrier_doppler_hz), sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&d_code_freq_chips), sizeof(float));
 
                     //PLL commands
-                    d_dump_file.write((char*)&tmp_float, sizeof(float));
-                    d_dump_file.write((char*)&carr_error_filt_hz, sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&tmp_float), sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&carr_error_filt_hz), sizeof(float));
 
                     //DLL commands
-                    d_dump_file.write((char*)&tmp_float, sizeof(float));
-                    d_dump_file.write((char*)&code_error_filt_chips, sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&tmp_float), sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&code_error_filt_chips), sizeof(float));
 
                     // CN0 and carrier lock test
-                    d_dump_file.write((char*)&d_CN0_SNV_dB_Hz, sizeof(float));
-                    d_dump_file.write((char*)&d_carrier_lock_test, sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&d_CN0_SNV_dB_Hz), sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&d_carrier_lock_test), sizeof(float));
 
                     // AUX vars (for debug purposes)
                     tmp_float = d_rem_code_phase_samples;
-                    d_dump_file.write((char*)&tmp_float, sizeof(float));
-                    tmp_double = (double)(d_sample_counter+d_current_prn_length_samples);
-                    d_dump_file.write((char*)&tmp_double, sizeof(double));
+                    d_dump_file.write(reinterpret_cast<char*>(&tmp_float), sizeof(float));
+                    tmp_double = static_cast<double>(d_sample_counter + d_current_prn_length_samples);
+                    d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
+
+                    // PRN
+                    unsigned int prn_ = d_acquisition_gnss_synchro->PRN;
+                    d_dump_file.write(reinterpret_cast<char*>(&prn_), sizeof(unsigned int));
             }
             catch (const std::ifstream::failure &e)
             {
diff --git a/src/algorithms/tracking/gnuradio_blocks/galileo_e5a_dll_pll_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/galileo_e5a_dll_pll_tracking_cc.cc
index 040aef9ea..45beca2bf 100644
--- a/src/algorithms/tracking/gnuradio_blocks/galileo_e5a_dll_pll_tracking_cc.cc
+++ b/src/algorithms/tracking/gnuradio_blocks/galileo_e5a_dll_pll_tracking_cc.cc
@@ -211,22 +211,34 @@ Galileo_E5a_Dll_Pll_Tracking_cc::Galileo_E5a_Dll_Pll_Tracking_cc(
 }
 
 
-Galileo_E5a_Dll_Pll_Tracking_cc::~Galileo_E5a_Dll_Pll_Tracking_cc ()
+Galileo_E5a_Dll_Pll_Tracking_cc::~Galileo_E5a_Dll_Pll_Tracking_cc()
 {
-    d_dump_file.close();
-
-    delete[] d_codeI;
-    delete[] d_codeQ;
-    delete[] d_Prompt_buffer;
-
-    d_dump_file.close();
-
-    volk_gnsssdr_free(d_local_code_shift_chips);
-    volk_gnsssdr_free(d_correlator_outs);
-    volk_gnsssdr_free(d_Single_Prompt_data);
-
-    multicorrelator_cpu_Q.free();
-    multicorrelator_cpu_I.free();
+    if (d_dump_file.is_open())
+        {
+            try
+            {
+                    d_dump_file.close();
+            }
+            catch(const std::exception & ex)
+            {
+                    LOG(WARNING)<<"Exception in destructor "<<ex.what();
+            }
+        }
+    try
+    {
+            delete[] d_codeI;
+            delete[] d_codeQ;
+            delete[] d_Prompt_buffer;
+            volk_gnsssdr_free(d_local_code_shift_chips);
+            volk_gnsssdr_free(d_correlator_outs);
+            volk_gnsssdr_free(d_Single_Prompt_data);
+            multicorrelator_cpu_Q.free();
+            multicorrelator_cpu_I.free();
+    }
+    catch(const std::exception & ex)
+    {
+            LOG(WARNING)<<"Exception in destructor "<<ex.what();
+    }
 }
 
 
@@ -301,17 +313,15 @@ void Galileo_E5a_Dll_Pll_Tracking_cc::start_tracking()
     sys = sys_.substr(0,1);
 
     // DEBUG OUTPUT
-    std::cout << "Tracking Galileo E5a start on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl;
+    std::cout << "Tracking of Galileo E5a signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl;
     LOG(INFO) << "Galileo E5a starting tracking of satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel;
 
-
     // enable tracking
     d_state = 1;
 
     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;
-
 }
 
 
@@ -378,7 +388,7 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute
     double code_error_filt_chips;
 
     // GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder
-    Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0]; //block output streams pointer
+    Gnss_Synchro **out = reinterpret_cast<Gnss_Synchro **>(&output_items[0]); //block output streams pointer
 
     // GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder
     Gnss_Synchro current_synchro_data;
@@ -394,7 +404,6 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute
     {
     case 0:
         {
-
             d_Early = gr_complex(0,0);
             d_Prompt = gr_complex(0,0);
             d_Late = gr_complex(0,0);
@@ -420,7 +429,7 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute
             current_synchro_data.Tracking_sample_counter = d_sample_counter;
             current_synchro_data.Carrier_phase_rads = 0.0;
             current_synchro_data.CN0_dB_hz = 0.0;
-            current_synchro_data.fs=d_fs_in;
+            current_synchro_data.fs = d_fs_in;
             consume_each(samples_offset); //shift input to perform alignment with local replica
             return 1;
             break;
@@ -428,14 +437,12 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute
     case 2:
         {
             // Block input data and block output stream pointers
-            const gr_complex* in = (gr_complex*) input_items[0]; //PRN start block alignment
+            const gr_complex* in = reinterpret_cast<const gr_complex *>(input_items[0]); //PRN start block alignment
             gr_complex sec_sign_Q;
             gr_complex sec_sign_I;
             // Secondary code Chip
             if (d_secondary_lock)
                 {
-                    //            sec_sign_Q = gr_complex((Galileo_E5a_Q_SECONDARY_CODE[d_acquisition_gnss_synchro->PRN-1].at(d_secondary_delay)=='0' ? 1 : -1),0);
-                    //            sec_sign_I = gr_complex((Galileo_E5a_I_SECONDARY_CODE.at(d_secondary_delay%Galileo_E5a_I_SECONDARY_CODE_LENGTH)=='0' ? 1 : -1),0);
                     sec_sign_Q = gr_complex((Galileo_E5a_Q_SECONDARY_CODE[d_acquisition_gnss_synchro->PRN-1].at(d_secondary_delay) == '0' ? -1 : 1), 0);
                     sec_sign_I = gr_complex((Galileo_E5a_I_SECONDARY_CODE.at(d_secondary_delay % Galileo_E5a_I_SECONDARY_CODE_LENGTH) == '0' ? -1 : 1), 0);
                 }
@@ -464,7 +471,6 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute
             multicorrelator_cpu_Q.set_local_code_and_taps(Galileo_E5a_CODE_LENGTH_CHIPS, d_codeQ, d_local_code_shift_chips);
             multicorrelator_cpu_I.set_local_code_and_taps(Galileo_E5a_CODE_LENGTH_CHIPS, d_codeI, &d_local_code_shift_chips[1]);
 
-
             // ################# CARRIER WIPEOFF AND CORRELATORS ##############################
             // perform carrier wipe-off and compute Early, Prompt and Late correlation
             multicorrelator_cpu_Q.set_input_output_vectors(d_correlator_outs,in);
@@ -487,7 +493,6 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute
                     code_phase_step_chips,
                     d_current_prn_length_samples);
 
-
             // Accumulate results (coherent integration since there are no bit transitions in pilot signal)
             d_Early += (*d_Single_Early) * sec_sign_Q;
             d_Prompt += (*d_Single_Prompt) * sec_sign_Q;
@@ -516,9 +521,9 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute
                     // New code Doppler frequency estimation
                     d_code_freq_chips = Galileo_E5a_CODE_CHIP_RATE_HZ + ((d_carrier_doppler_hz * Galileo_E5a_CODE_CHIP_RATE_HZ) / Galileo_E5a_FREQ_HZ);
                 }
-            //carrier phase accumulator for (K) doppler estimation
+            // carrier phase accumulator for (K) doppler estimation
             d_acc_carrier_phase_rad -= 2.0 * GALILEO_PI * d_carrier_doppler_hz * GALILEO_E5a_CODE_PERIOD;
-            //remanent carrier phase to prevent overflow in the code NCO
+            // remnant carrier phase to prevent overflow in the code NCO
             d_rem_carr_phase_rad = d_rem_carr_phase_rad + 2.0 * GALILEO_PI * d_carrier_doppler_hz * GALILEO_E5a_CODE_PERIOD;
             d_rem_carr_phase_rad = fmod(d_rem_carr_phase_rad, 2.0 * GALILEO_PI);
 
@@ -628,7 +633,6 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute
                     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;
-
                 }
             else
                 {
@@ -638,15 +642,14 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute
                     current_synchro_data.Tracking_sample_counter = d_sample_counter;
                     current_synchro_data.Carrier_phase_rads = 0.0;
                     current_synchro_data.CN0_dB_hz = 0.0;
-
                 }
 
             break;
         }
     }
 
-    current_synchro_data.fs=d_fs_in;
-    current_synchro_data.correlation_length_ms=GALILEO_E5a_CODE_PERIOD_MS;
+    current_synchro_data.fs = d_fs_in;
+    current_synchro_data.correlation_length_ms = GALILEO_E5a_CODE_PERIOD_MS;
     *out[0] = current_synchro_data;
 
     if(d_dump)
@@ -700,6 +703,10 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute
                     tmp_double = static_cast<double>(d_sample_counter + d_current_prn_length_samples);
                     d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
 
+                    // PRN
+                    unsigned int prn_ = d_acquisition_gnss_synchro->PRN;
+                    d_dump_file.write(reinterpret_cast<char*>(&prn_), sizeof(unsigned int));
+
             }
             catch (const std::ifstream::failure & e)
             {
@@ -729,11 +736,11 @@ void Galileo_E5a_Dll_Pll_Tracking_cc::set_channel(unsigned int 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;
+                            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;
+                            LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what();
                     }
                 }
         }
@@ -744,4 +751,3 @@ void Galileo_E5a_Dll_Pll_Tracking_cc::set_gnss_synchro(Gnss_Synchro* p_gnss_sync
 {
     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 400749eda..8f68d765d 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
@@ -283,7 +283,7 @@ void gps_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;
+    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
@@ -299,14 +299,30 @@ void gps_l1_ca_dll_pll_c_aid_tracking_cc::start_tracking()
 
 gps_l1_ca_dll_pll_c_aid_tracking_cc::~gps_l1_ca_dll_pll_c_aid_tracking_cc()
 {
-    d_dump_file.close();
 
-    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();
+    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();
+    }
+    catch(const std::exception & ex)
+    {
+            LOG(WARNING) << "Exception in destructor " << ex.what();
+    }
 }
 
 
@@ -315,8 +331,8 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __attri
         gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
 {
     // Block input data and block output stream pointers
-    const gr_complex* in = (gr_complex*) input_items[0]; //PRN start block alignment
-    Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0];
+    const gr_complex* in = reinterpret_cast<const gr_complex *>(input_items[0]);
+    Gnss_Synchro **out = reinterpret_cast<Gnss_Synchro **>(&output_items[0]);
 
     // GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder
     Gnss_Synchro current_synchro_data = Gnss_Synchro();
@@ -345,7 +361,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __attri
                     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;
+                    current_synchro_data.fs = d_fs_in;
                     *out[0] = current_synchro_data;
                     consume_each(samples_offset); // shift input to perform alignment with local replica
                     return 1;
@@ -575,7 +591,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __attri
             current_synchro_data.Tracking_sample_counter = d_sample_counter + d_correlation_length_samples;
         }
     //assign the GNURadio block output data
-    current_synchro_data.fs=d_fs_in;
+    current_synchro_data.fs = d_fs_in;
     *out[0] = current_synchro_data;
     if(d_dump)
         {
@@ -625,6 +641,10 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __attri
                     d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
                     tmp_double = static_cast<double>(d_sample_counter + d_correlation_length_samples);
                     d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
+
+                    // PRN
+                    unsigned int prn_ = d_acquisition_gnss_synchro->PRN;
+                    d_dump_file.write(reinterpret_cast<char*>(&prn_), sizeof(unsigned int));
             }
             catch (const std::ifstream::failure* e)
             {
@@ -654,7 +674,7 @@ void gps_l1_ca_dll_pll_c_aid_tracking_cc::set_channel(unsigned int 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;
+                            LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str();
                     }
                     catch (const std::ifstream::failure* e)
                     {
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 19cce7732..22d504786 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
@@ -47,7 +47,6 @@
 #include "GPS_L1_CA.h"
 #include "control_message_factory.h"
 
-
 /*!
  * \todo Include in definition header file
  */
@@ -56,32 +55,29 @@
 #define MAXIMUM_LOCK_FAIL_COUNTER 50
 #define CARRIER_LOCK_THRESHOLD 0.85
 
-
 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)
+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));
+    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)
+void gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::msg_handler_preamble_index(
+        pmt::pmt_t msg)
 {
-    //pmt::print(msg);
-    DLOG(INFO) << "Extended correlation enabled for Tracking CH " << d_channel <<  ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN);
+    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);
@@ -90,26 +86,24 @@ void gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::msg_handler_preamble_index(pmt::p
         }
 }
 
+
 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) :
-        gr::block("gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc", gr::io_signature::make(0, 0, sizeof(lv_16sc_t)),
+        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));
+            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;
@@ -139,19 +133,23 @@ gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::gps_l1_ca_dll_pll_c_aid_tracking_fpga_
     // correlator outputs (scalar)
     d_n_correlator_taps = 3; // Early, Prompt, and Late
 
-    d_correlator_outs_16sc = static_cast<lv_16sc_t*>(volk_gnsssdr_malloc(d_n_correlator_taps*sizeof(lv_16sc_t), volk_gnsssdr_get_alignment()));
+    d_correlator_outs_16sc = static_cast<lv_16sc_t*>(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_correlator_outs_16sc[n] = lv_cmake(0, 0);
         }
 
-    d_local_code_shift_chips = static_cast<float*>(volk_gnsssdr_malloc(d_n_correlator_taps*sizeof(float), volk_gnsssdr_get_alignment()));
+    d_local_code_shift_chips = static_cast<float*>(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[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;
 
-    multicorrelator_fpga_8sc.init(d_n_correlator_taps);
+    // create multicorrelator class
+    multicorrelator_fpga_8sc = std::make_shared <fpga_multicorrelator_8sc>(d_n_correlator_taps, device_name, device_base);
 
     //--- Perform initializations ------------------------------
     // define initial code frequency basis of NCO
@@ -214,7 +212,7 @@ void gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::start_tracking()
 
     long int acq_trk_diff_samples;
     double acq_trk_diff_seconds;
-    acq_trk_diff_samples = static_cast<long int>(d_sample_counter) - static_cast<long int>(d_acq_sample_stamp);//-d_vector_length;
+    acq_trk_diff_samples = static_cast<long int>(d_sample_counter) - static_cast<long int>(d_acq_sample_stamp);
     DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples;
     acq_trk_diff_seconds = static_cast<double>(acq_trk_diff_samples) / static_cast<double>(d_fs_in);
     // Doppler effect
@@ -252,16 +250,16 @@ void gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::start_tracking()
 
     // 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
+    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<int>(GPS_L1_CA_CODE_LENGTH_CHIPS));
 
-    multicorrelator_fpga_8sc.set_local_code_and_taps(static_cast<int>(GPS_L1_CA_CODE_LENGTH_CHIPS), d_ca_code_16sc, d_local_code_shift_chips);
+    multicorrelator_fpga_8sc->set_local_code_and_taps(static_cast<int>(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_correlator_outs_16sc[n] = lv_16sc_t(0, 0);
         }
 
     d_carrier_lock_fail_counter = 0;
@@ -273,11 +271,15 @@ void gps_l1_ca_dll_pll_c_aid_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);
+    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 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;
@@ -285,32 +287,55 @@ void gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::start_tracking()
     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;
+              << " 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()
 {
-    d_dump_file.close();
-
-    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();
+    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_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)
+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 = (Gnss_Synchro **) &output_items[0];
+    Gnss_Synchro **out = reinterpret_cast<Gnss_Synchro **>(&output_items[0]);
 
     Gnss_Synchro current_synchro_data = Gnss_Synchro();
 
@@ -318,7 +343,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::general_work (int noutput_items __
     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
@@ -326,11 +351,10 @@ int gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::general_work (int noutput_items __
             // Receiver signal alignment
             if (d_pull_in == true)
                 {
-                    int samples_offset;
                     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<double>(acq_to_trk_delay_samples), static_cast<double>(d_correlation_length_samples));
+                    acq_trk_shif_correction_samples = d_correlation_length_samples - fmod( static_cast<double>(acq_to_trk_delay_samples), static_cast<double>(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
@@ -338,23 +362,22 @@ int gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::general_work (int noutput_items __
                     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;
+                    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);
+                    //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_input_output_vectors(d_correlator_outs_16sc, in);
-            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);
+            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
@@ -378,9 +401,9 @@ int gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::general_work (int noutput_items __
                             // compute coherent integration and enable tracking loop
                             // perform coherent integration using correlator output history
                             // std::cout<<"##### RESET COHERENT INTEGRATION ####"<<std::endl;
-                            d_correlator_outs_16sc[0] = lv_cmake(0,0);
-                            d_correlator_outs_16sc[1] = lv_cmake(0,0);
-                            d_correlator_outs_16sc[2] = lv_cmake(0,0);
+                            d_correlator_outs_16sc[0] = lv_cmake(0, 0);
+                            d_correlator_outs_16sc[1] = lv_cmake(0, 0);
+                            d_correlator_outs_16sc[2] = lv_cmake(0, 0);
                             for (int n = 0; n < d_extend_correlation_ms; n++)
                                 {
                                     d_correlator_outs_16sc[0] += d_E_history.at(n);
@@ -391,11 +414,21 @@ int gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::general_work (int noutput_items __
                             if (d_preamble_synchronized == false)
                                 {
                                     d_code_loop_filter.set_DLL_BW(d_dll_bw_narrow_hz);
-                                    d_carrier_loop_filter.set_params(10.0, d_pll_bw_narrow_hz,2);
+                                    d_carrier_loop_filter.set_params(10.0, d_pll_bw_narrow_hz, 2);
                                     d_preamble_synchronized = true;
-                                    std::cout << "Enabled " << d_extend_correlation_ms << " [ms] extended correlator for CH "<< d_channel << " : Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->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;
+                                    std::cout << "Enabled "
+                                              << d_extend_correlation_ms
+                                              << " [ms] extended correlator for CH "
+                                              << d_channel << " : Satellite "
+                                              << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->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<double>(d_extend_correlation_ms) * GPS_L1_CA_CODE_PERIOD;
@@ -403,7 +436,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::general_work (int noutput_items __
                         }
                     else
                         {
-                            if(d_preamble_synchronized == true)
+                            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
@@ -450,7 +483,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::general_work (int noutput_items __
                 {
                     // ################## PLL ##########################################################
                     // Update PLL discriminator [rads/Ti -> Secs/Ti]
-                    d_carr_phase_error_secs_Ti = pll_cloop_two_quadrant_atan(std::complex<float>(d_correlator_outs_16sc[1].real(),d_correlator_outs_16sc[1].imag())) / GPS_TWO_PI; //prompt output
+                    d_carr_phase_error_secs_Ti = pll_cloop_two_quadrant_atan(std::complex<float>(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
@@ -463,7 +496,13 @@ int gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::general_work (int noutput_items __
 
                     // ################## DLL ##########################################################
                     // DLL discriminator
-                    d_code_error_chips_Ti = dll_nc_e_minus_l_normalized(std::complex<float>(d_correlator_outs_16sc[0].real(),d_correlator_outs_16sc[0].imag()), std::complex<float>(d_correlator_outs_16sc[2].real(),d_correlator_outs_16sc[2].imag())); // [chips/Ti] //early and late
+                    d_code_error_chips_Ti = dll_nc_e_minus_l_normalized(
+                            std::complex<float>(
+                                    d_correlator_outs_16sc[0].real(),
+                                    d_correlator_outs_16sc[0].imag()),
+                            std::complex<float>(
+                                    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;
@@ -480,10 +519,10 @@ int gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::general_work (int noutput_items __
 
                     d_rem_code_phase_samples = d_rem_code_phase_samples - K_T_prn_error_samples + code_error_filt_secs_Ti * static_cast<double>(d_fs_in); //(code_error_filt_secs_Ti + d_pll_to_dll_assist_secs_Ti) * static_cast<double>(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_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 #################################################
+                    //################### 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<double>(d_fs_in);
                     d_acc_carrier_phase_cycles -= d_carrier_phase_step_rad * d_correlation_length_samples / GPS_TWO_PI;
@@ -502,7 +541,8 @@ int gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::general_work (int noutput_items __
                     if (d_cn0_estimation_counter < CN0_ESTIMATION_SAMPLES)
                         {
                             // fill buffer with prompt correlator output values
-                            d_Prompt_buffer[d_cn0_estimation_counter] = lv_cmake(static_cast<float>(d_correlator_outs_16sc[1].real()), static_cast<float>(d_correlator_outs_16sc[1].imag()) ); // prompt
+                            d_Prompt_buffer[d_cn0_estimation_counter] = lv_cmake(static_cast<float>(d_correlator_outs_16sc[1].real()),
+                                            static_cast<float>(d_correlator_outs_16sc[1].imag())); // prompt
                             d_cn0_estimation_counter++;
                         }
                     else
@@ -519,15 +559,19 @@ int gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::general_work (int noutput_items __
                                 }
                             else
                                 {
-                                    if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--;
+                                    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;
                                     LOG(INFO) << "Loss of lock in channel " << d_channel << "!";
-                                    this->message_port_pub(pmt::mp("events"), pmt::from_long(3));//3 -> loss of lock
+                                    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 ##########
@@ -555,7 +599,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::general_work (int noutput_items __
                     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.Carrier_Doppler_hz = d_carrier_doppler_hz; // todo: project the carrier doppler
                     current_synchro_data.CN0_dB_hz = d_CN0_SNV_dB_Hz;
                 }
         }
@@ -563,15 +607,17 @@ int gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::general_work (int noutput_items __
         {
             for (int n = 0; n < d_n_correlator_taps; n++)
                 {
-                    d_correlator_outs_16sc[n] = lv_cmake(0,0);
+                    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;
+
+    current_synchro_data.fs = d_fs_in;
     *out[0] = current_synchro_data;
-    if(d_dump)
+
+    if (d_dump)
         {
             // MULTIPLEXED FILE RECORDING - Record results to file
             float prompt_I;
@@ -580,11 +626,11 @@ int gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::general_work (int noutput_items __
             double tmp_double;
             prompt_I = d_correlator_outs_16sc[1].real();
             prompt_Q = d_correlator_outs_16sc[1].imag();
-            tmp_E = std::abs<float>(std::complex<float>(d_correlator_outs_16sc[0].real(),d_correlator_outs_16sc[0].imag()));
-            tmp_P = std::abs<float>(std::complex<float>(d_correlator_outs_16sc[1].real(),d_correlator_outs_16sc[1].imag()));
-            tmp_L = std::abs<float>(std::complex<float>(d_correlator_outs_16sc[2].real(),d_correlator_outs_16sc[2].imag()));
+            tmp_E = std::abs<float>(std::complex<float>(d_correlator_outs_16sc[0].real(), d_correlator_outs_16sc[0].imag()));
+            tmp_P = std::abs<float>(std::complex<float>(d_correlator_outs_16sc[1].real(), d_correlator_outs_16sc[1].imag()));
+            tmp_L = std::abs<float>(std::complex<float>(d_correlator_outs_16sc[2].real(), d_correlator_outs_16sc[2].imag()));
             try
-            {
+                {
                     // EPR
                     d_dump_file.write(reinterpret_cast<char*>(&tmp_E), sizeof(float));
                     d_dump_file.write(reinterpret_cast<char*>(&tmp_P), sizeof(float));
@@ -619,14 +665,14 @@ int gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::general_work (int noutput_items __
                     d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
                     tmp_double = static_cast<double>(d_sample_counter + d_correlation_length_samples);
                     d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
-            }
+                }
             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
+    //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
 
     return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
@@ -636,8 +682,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::general_work (int noutput_items __
 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);
-
+    multicorrelator_fpga_8sc->set_channel(d_channel);
     LOG(INFO) << "Tracking Channel set to " << d_channel;
     // ############# ENABLE DATA FILE LOG #################
     if (d_dump == true)
@@ -645,23 +690,34 @@ void gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::set_channel(unsigned int channel)
             if (d_dump_file.is_open() == false)
                 {
                     try
-                    {
+                        {
                             d_dump_filename.append(boost::lexical_cast<std::string>(d_channel));
                             d_dump_filename.append(".dat");
-                            d_dump_file.exceptions (std::ifstream::failbit | std::ifstream::badbit);
+                            d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
                             d_dump_file.open(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();
-                    }
+                            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();
-                    }
+                        {
+                            LOG(WARNING) << "channel " << d_channel
+                                         << " Exception opening trk dump file "
+                                         << e->what();
+                        }
                 }
         }
 }
 
 
-void gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
+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
index f4f85404b..444ffbc72 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
@@ -53,28 +53,19 @@
 
 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>
-        gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc_sptr;
+typedef boost::shared_ptr<gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc> 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);
-
-
+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
+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();
@@ -83,38 +74,30 @@ public:
     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);
+    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);
+    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);
+    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;
+    unsigned int d_vector_length;bool d_dump;
 
     Gnss_Synchro* d_acquisition_gnss_synchro;
     unsigned int d_channel;
@@ -128,9 +111,9 @@ private:
     gr_complex* d_ca_code;
     lv_16sc_t* d_ca_code_16sc;
     float* d_local_code_shift_chips;
-    //gr_complex* d_correlator_outs;
     lv_16sc_t* d_correlator_outs_16sc;
-    fpga_multicorrelator_8sc multicorrelator_fpga_8sc;
+    //fpga_multicorrelator_8sc multicorrelator_fpga_8sc;
+    std::shared_ptr<fpga_multicorrelator_8sc> multicorrelator_fpga_8sc;
 
     // remaining code phase and carrier phase between tracking loops
     double d_rem_code_phase_samples;
@@ -161,9 +144,7 @@ private:
     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;
+    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);
@@ -189,8 +170,7 @@ private:
     int d_carrier_lock_fail_counter;
 
     // control vars
-    bool d_enable_tracking;
-    bool d_pull_in;
+    bool d_enable_tracking;bool d_pull_in;
 
     // file dump
     std::string d_dump_filename;
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 222986554..24e96ff02 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
@@ -285,7 +285,7 @@ void gps_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;
+    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
@@ -302,15 +302,31 @@ void gps_l1_ca_dll_pll_c_aid_tracking_sc::start_tracking()
 
 gps_l1_ca_dll_pll_c_aid_tracking_sc::~gps_l1_ca_dll_pll_c_aid_tracking_sc()
 {
-    d_dump_file.close();
+    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_ca_code);
+            volk_gnsssdr_free(d_ca_code_16sc);
+            volk_gnsssdr_free(d_correlator_outs_16sc);
+            delete[] d_Prompt_buffer;
+            multicorrelator_cpu_16sc.free();
+    }
+    catch(const std::exception & ex)
+    {
+            LOG(WARNING) << "Exception in destructor " << ex.what();
+    }
 
-    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_cpu_16sc.free();
 }
 
 
@@ -319,8 +335,8 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __attri
         gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
 {
     // Block input data and block output stream pointers
-    const lv_16sc_t* in = (lv_16sc_t*) input_items[0]; //PRN start block alignment
-    Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0];
+    const lv_16sc_t* in = reinterpret_cast<const lv_16sc_t*>(input_items[0]); //PRN start block alignment
+    Gnss_Synchro **out = reinterpret_cast<Gnss_Synchro **>(&output_items[0]);
 
     // GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder
     Gnss_Synchro current_synchro_data = Gnss_Synchro();
@@ -349,7 +365,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __attri
                     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;
+                    current_synchro_data.fs = d_fs_in;
                     *out[0] = current_synchro_data;
                     consume_each(samples_offset); // shift input to perform alignment with local replica
                     return 1;
@@ -578,7 +594,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __attri
             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;
+    current_synchro_data.fs = d_fs_in;
     *out[0] = current_synchro_data;
     if(d_dump)
         {
@@ -628,6 +644,10 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __attri
                     d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
                     tmp_double = static_cast<double>(d_sample_counter + d_correlation_length_samples);
                     d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
+
+                    // PRN
+                    unsigned int prn_ = d_acquisition_gnss_synchro->PRN;
+                    d_dump_file.write(reinterpret_cast<char*>(&prn_), sizeof(unsigned int));
             }
             catch (const std::ifstream::failure* e)
             {
@@ -657,11 +677,11 @@ void gps_l1_ca_dll_pll_c_aid_tracking_sc::set_channel(unsigned int 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;
+                            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;
+                            LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e->what();
                     }
                 }
         }
diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_cc.cc
index a0a7b6743..32d96c079 100644
--- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_cc.cc
+++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_cc.cc
@@ -82,9 +82,9 @@ void Gps_L1_Ca_Dll_Pll_Tracking_cc::forecast (int noutput_items,
         gr_vector_int &ninput_items_required)
 {
     if (noutput_items != 0)
-    {
-        ninput_items_required[0] = static_cast<int>(d_vector_length) * 2; //set the required available samples in each call
-    }
+        {
+            ninput_items_required[0] = static_cast<int>(d_vector_length) * 2; //set the required available samples in each call
+        }
 }
 
 
@@ -123,16 +123,16 @@ Gps_L1_Ca_Dll_Pll_Tracking_cc::Gps_L1_Ca_Dll_Pll_Tracking_cc(
 
     // Initialization of local code replica
     // Get space for a vector with the C/A code replica sampled 1x/chip
-    d_ca_code = static_cast<gr_complex*>(volk_gnsssdr_malloc(static_cast<int>(GPS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
+    d_ca_code = static_cast<float*>(volk_gnsssdr_malloc(static_cast<int>(GPS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(float), volk_gnsssdr_get_alignment()));
 
     // correlator outputs (scalar)
     d_n_correlator_taps = 3; // Early, Prompt, and Late
-    d_correlator_outs = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_n_correlator_taps*sizeof(gr_complex), volk_gnsssdr_get_alignment()));
+    d_correlator_outs = static_cast<gr_complex*>(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<float*>(volk_gnsssdr_malloc(d_n_correlator_taps*sizeof(float), volk_gnsssdr_get_alignment()));
+        {
+            d_correlator_outs[n] = gr_complex(0,0);
+        }
+    d_local_code_shift_chips = static_cast<float*>(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;
@@ -194,7 +194,7 @@ void Gps_L1_Ca_Dll_Pll_Tracking_cc::start_tracking()
     long int acq_trk_diff_samples;
     double acq_trk_diff_seconds;
     acq_trk_diff_samples = static_cast<long int>(d_sample_counter) - static_cast<long int>(d_acq_sample_stamp); //-d_vector_length;
-    DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples;
+    DLOG(INFO) << "Number of samples between Acquisition and Tracking = " << acq_trk_diff_samples;
     acq_trk_diff_seconds = static_cast<float>(acq_trk_diff_samples) / static_cast<float>(d_fs_in);
     // Doppler effect
     // Fd=(C/(C+Vr))*F
@@ -218,9 +218,9 @@ void Gps_L1_Ca_Dll_Pll_Tracking_cc::start_tracking()
     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<double>(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;
-    }
+        {
+            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;
@@ -233,13 +233,13 @@ void Gps_L1_Ca_Dll_Pll_Tracking_cc::start_tracking()
     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);
+    gps_l1_ca_code_gen_float(d_ca_code, d_acquisition_gnss_synchro->PRN, 0);
 
     multicorrelator_cpu.set_local_code_and_taps(static_cast<int>(GPS_L1_CA_CODE_LENGTH_CHIPS), d_ca_code, d_local_code_shift_chips);
     for (int n = 0; n < d_n_correlator_taps; n++)
-    {
-        d_correlator_outs[n] = gr_complex(0,0);
-    }
+        {
+            d_correlator_outs[n] = gr_complex(0,0);
+        }
 
     d_carrier_lock_fail_counter = 0;
     d_rem_code_phase_samples = 0;
@@ -253,7 +253,7 @@ void Gps_L1_Ca_Dll_Pll_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;
+    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
@@ -265,16 +265,32 @@ void Gps_L1_Ca_Dll_Pll_Tracking_cc::start_tracking()
             << " PULL-IN Code Phase [samples]=" << d_acq_code_phase_samples;
 }
 
+
 Gps_L1_Ca_Dll_Pll_Tracking_cc::~Gps_L1_Ca_Dll_Pll_Tracking_cc()
 {
-    d_dump_file.close();
-
-    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();
+    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();
+    }
+    catch(const std::exception & ex)
+    {
+            LOG(WARNING) << "Exception in destructor " << ex.what();
+    }
 }
 
 
@@ -289,207 +305,211 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute__
     double code_error_filt_chips = 0.0;
 
     // Block input data and block output stream pointers
-    const gr_complex* in = (gr_complex*) input_items[0]; //PRN start block alignment
-    Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0];
+    const gr_complex* in = reinterpret_cast<const gr_complex *>(input_items[0]);
+    Gnss_Synchro **out = reinterpret_cast<Gnss_Synchro **>(&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)
         {
-            int samples_offset;
-            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_current_prn_length_samples - fmod(static_cast<float>(acq_to_trk_delay_samples), static_cast<float>(d_current_prn_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 = d_sample_counter + samples_offset; // count for the processed samples
-            d_pull_in = false;
-            // take into account the carrier cycles accumulated in the pull in signal alignment
-            d_acc_carrier_phase_rad -= d_carrier_phase_step_rad * samples_offset;
+            // Fill the acquisition data
+            current_synchro_data = *d_acquisition_gnss_synchro;
+            // Receiver signal alignment
+            if (d_pull_in == true)
+                {
+                    int samples_offset;
+                    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_current_prn_length_samples - fmod(static_cast<float>(acq_to_trk_delay_samples), static_cast<float>(d_current_prn_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 = d_sample_counter + samples_offset; // count for the processed samples
+                    d_pull_in = false;
+                    // take into account the carrier cycles accumulated in the pull in signal alignment
+                    d_acc_carrier_phase_rad -= d_carrier_phase_step_rad * samples_offset;
+                    current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_rad;
+                    current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz;
+                    current_synchro_data.fs = d_fs_in;
+                    current_synchro_data.correlation_length_ms = 1;
+                    *out[0] = current_synchro_data;
+                    consume_each(samples_offset); // shift input to perform alignment with local replica
+                    return 1;
+                }
+
+            // ################# CARRIER WIPEOFF AND CORRELATORS ##############################
+            // perform carrier wipe-off and compute Early, Prompt and Late correlation
+            multicorrelator_cpu.set_input_output_vectors(d_correlator_outs, in);
+            multicorrelator_cpu.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);
+
+            // ################## 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<double>(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]
+            //double code_error_filt_secs = (GPS_L1_CA_CODE_PERIOD * code_error_filt_chips) / GPS_L1_CA_CODE_RATE_HZ; // [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_chip_seconds =  1.0 / static_cast<double>(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<double>(d_fs_in);
+            double K_blk_samples = T_prn_samples + d_rem_code_phase_samples + code_error_filt_secs * static_cast<double>(d_fs_in);
+            d_current_prn_length_samples = round(K_blk_samples); // round to a discrete number of 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<double>(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<double>(d_fs_in);
+            // remnant code phase [chips]
+            d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; // rounding error < 1 sample
+            d_rem_code_phase_chips = d_code_freq_chips * (d_rem_code_phase_samples / static_cast<double>(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;
+                            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
+                        }
+                }
+            // ########### Output the tracking data to navigation and PVT ##########
+            current_synchro_data.Prompt_I = static_cast<double>((d_correlator_outs[1]).real());
+            current_synchro_data.Prompt_Q = static_cast<double>((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.fs=d_fs_in;
+            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;
-            *out[0] = current_synchro_data;
-            consume_each(samples_offset); // shift input to perform alignment with local replica
-            return 1;
         }
-
-        // ################# CARRIER WIPEOFF AND CORRELATORS ##############################
-        // perform carrier wipe-off and compute Early, Prompt and Late correlation
-        multicorrelator_cpu.set_input_output_vectors(d_correlator_outs, in);
-        multicorrelator_cpu.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);
-
-        // ################## 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<double>(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]
-        //double code_error_filt_secs = (GPS_L1_CA_CODE_PERIOD * code_error_filt_chips) / GPS_L1_CA_CODE_RATE_HZ; // [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_chip_seconds =  1.0 / static_cast<double>(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<double>(d_fs_in);
-        double K_blk_samples = T_prn_samples + d_rem_code_phase_samples + code_error_filt_secs * static_cast<double>(d_fs_in);
-        d_current_prn_length_samples = round(K_blk_samples); // round to a discrete number of 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<double>(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<double>(d_fs_in);
-        // remnant code phase [chips]
-        d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; // rounding error < 1 sample
-        d_rem_code_phase_chips = d_code_freq_chips * (d_rem_code_phase_samples / static_cast<double>(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;
-                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
-            }
-        }
-        // ########### Output the tracking data to navigation and PVT ##########
-        current_synchro_data.Prompt_I = static_cast<double>((d_correlator_outs[1]).real());
-        current_synchro_data.Prompt_Q = static_cast<double>((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);
-        }
+            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;
-    }
+            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;
+    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;
-        unsigned long int tmp_long;
-        prompt_I = d_correlator_outs[1].real();
-        prompt_Q = d_correlator_outs[1].imag();
-        tmp_E = std::abs<float>(d_correlator_outs[0]);
-        tmp_P = std::abs<float>(d_correlator_outs[1]);
-        tmp_L = std::abs<float>(d_correlator_outs[2]);
-        try
         {
-            // EPR
-            d_dump_file.write(reinterpret_cast<char*>(&tmp_E), sizeof(float));
-            d_dump_file.write(reinterpret_cast<char*>(&tmp_P), sizeof(float));
-            d_dump_file.write(reinterpret_cast<char*>(&tmp_L), sizeof(float));
-            // PROMPT I and Q (to analyze navigation symbols)
-            d_dump_file.write(reinterpret_cast<char*>(&prompt_I), sizeof(float));
-            d_dump_file.write(reinterpret_cast<char*>(&prompt_Q), sizeof(float));
-            // PRN start sample stamp
-            tmp_long = d_sample_counter + d_current_prn_length_samples;
-            d_dump_file.write(reinterpret_cast<char*>(&tmp_long), sizeof(unsigned long int));
-            // accumulated carrier phase
-            d_dump_file.write(reinterpret_cast<char*>(&d_acc_carrier_phase_rad), sizeof(double));
+            // 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<float>(d_correlator_outs[0]);
+            tmp_P = std::abs<float>(d_correlator_outs[1]);
+            tmp_L = std::abs<float>(d_correlator_outs[2]);
+            try
+            {
+                    // EPR
+                    d_dump_file.write(reinterpret_cast<char*>(&tmp_E), sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&tmp_P), sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&tmp_L), sizeof(float));
+                    // PROMPT I and Q (to analyze navigation symbols)
+                    d_dump_file.write(reinterpret_cast<char*>(&prompt_I), sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&prompt_Q), sizeof(float));
+                    // PRN start sample stamp
+                    tmp_long = d_sample_counter + d_current_prn_length_samples;
+                    d_dump_file.write(reinterpret_cast<char*>(&tmp_long), sizeof(unsigned long int));
+                    // accumulated carrier phase
+                    d_dump_file.write(reinterpret_cast<char*>(&d_acc_carrier_phase_rad), sizeof(double));
 
-            // carrier and code frequency
-            d_dump_file.write(reinterpret_cast<char*>(&d_carrier_doppler_hz), sizeof(double));
-            d_dump_file.write(reinterpret_cast<char*>(&d_code_freq_chips), sizeof(double));
+                    // carrier and code frequency
+                    d_dump_file.write(reinterpret_cast<char*>(&d_carrier_doppler_hz), sizeof(double));
+                    d_dump_file.write(reinterpret_cast<char*>(&d_code_freq_chips), sizeof(double));
 
-            // PLL commands
-            d_dump_file.write(reinterpret_cast<char*>(&carr_error_hz), sizeof(double));
-            d_dump_file.write(reinterpret_cast<char*>(&carr_error_filt_hz), sizeof(double));
+                    // PLL commands
+                    d_dump_file.write(reinterpret_cast<char*>(&carr_error_hz), sizeof(double));
+                    d_dump_file.write(reinterpret_cast<char*>(&carr_error_filt_hz), sizeof(double));
 
-            // DLL commands
-            d_dump_file.write(reinterpret_cast<char*>(&code_error_chips), sizeof(double));
-            d_dump_file.write(reinterpret_cast<char*>(&code_error_filt_chips), sizeof(double));
+                    // DLL commands
+                    d_dump_file.write(reinterpret_cast<char*>(&code_error_chips), sizeof(double));
+                    d_dump_file.write(reinterpret_cast<char*>(&code_error_filt_chips), sizeof(double));
 
-            // CN0 and carrier lock test
-            d_dump_file.write(reinterpret_cast<char*>(&d_CN0_SNV_dB_Hz), sizeof(double));
-            d_dump_file.write(reinterpret_cast<char*>(&d_carrier_lock_test), sizeof(double));
+                    // CN0 and carrier lock test
+                    d_dump_file.write(reinterpret_cast<char*>(&d_CN0_SNV_dB_Hz), sizeof(double));
+                    d_dump_file.write(reinterpret_cast<char*>(&d_carrier_lock_test), sizeof(double));
 
-            // AUX vars (for debug purposes)
-            tmp_double = d_rem_code_phase_samples;
-            d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
-            tmp_double = static_cast<double>(d_sample_counter);
-            d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
+                    // AUX vars (for debug purposes)
+                    tmp_double = d_rem_code_phase_samples;
+                    d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
+                    tmp_double = static_cast<double>(d_sample_counter);
+                    d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
+
+                    // PRN
+                    unsigned int prn_ = d_acquisition_gnss_synchro->PRN;
+                    d_dump_file.write(reinterpret_cast<char*>(&prn_), sizeof(unsigned int));
+            }
+            catch (const std::ifstream::failure &e)
+            {
+                    LOG(WARNING) << "Exception writing trk dump file " << e.what();
+            }
         }
-        catch (const std::ifstream::failure &e)
-        {
-            LOG(WARNING) << "Exception writing trk dump file " << e.what();
-        }
-    }
 
     consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates
     d_sample_counter += d_current_prn_length_samples; // count for the processed samples
@@ -504,23 +524,23 @@ void Gps_L1_Ca_Dll_Pll_Tracking_cc::set_channel(unsigned int 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<std::string>(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();
-            }
+            if (d_dump_file.is_open() == false)
+                {
+                    try
+                    {
+                            d_dump_filename.append(boost::lexical_cast<std::string>(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();
+                    }
+                }
         }
-    }
 }
 
 
diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_cc.h
index 92a5d4afb..9fe80fec7 100644
--- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_cc.h
+++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_cc.h
@@ -3,6 +3,7 @@
  * \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,
@@ -44,7 +45,7 @@
 #include "gnss_synchro.h"
 #include "tracking_2nd_DLL_filter.h"
 #include "tracking_2nd_PLL_filter.h"
-#include "cpu_multicorrelator.h"
+#include "cpu_multicorrelator_real_codes.h"
 
 class Gps_L1_Ca_Dll_Pll_Tracking_cc;
 
@@ -126,11 +127,10 @@ private:
     double d_acq_carrier_doppler_hz;
     // correlator
     int d_n_correlator_taps;
-    gr_complex* d_ca_code;
+    float* d_ca_code;
     float* d_local_code_shift_chips;
     gr_complex* d_correlator_outs;
-    cpu_multicorrelator multicorrelator_cpu;
-
+    cpu_multicorrelator_real_codes multicorrelator_cpu;
 
     // tracking vars
     double d_code_freq_chips;
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 014b08678..cbd835b86 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
@@ -132,7 +132,6 @@ Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc(
     d_local_code_shift_chips[1] = 0.0;
     d_local_code_shift_chips[2] = d_early_late_spc_chips;
 
-
     //--- Perform initializations ------------------------------
     multicorrelator_gpu = new cuda_multicorrelator();
     //local code resampler on GPU
@@ -256,41 +255,54 @@ void Gps_L1_Ca_Dll_Pll_Tracking_GPU_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;
+    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;
     d_enable_tracking = true;
 
     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;
+              << " Code Phase correction [samples]=" << delay_correction_samples
+              << " PULL-IN Code Phase [samples]=" << d_acq_code_phase_samples;
 }
 
 
 Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::~Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc()
 {
-
-    d_dump_file.close();
-    cudaFreeHost(in_gpu);
-    cudaFreeHost(d_correlator_outs);
-    cudaFreeHost(d_local_code_shift_chips);
-    cudaFreeHost(d_ca_code);
-    multicorrelator_gpu->free_cuda();
-    delete[] d_Prompt_buffer;
-    delete(multicorrelator_gpu);
+    if (d_dump_file.is_open())
+        {
+            try
+            {
+                    d_dump_file.close();
+            }
+            catch(const std::exception & ex)
+            {
+                    LOG(WARNING) << "Exception in destructor " << ex.what();
+            }
+        }
+    try{
+            cudaFreeHost(in_gpu);
+            cudaFreeHost(d_correlator_outs);
+            cudaFreeHost(d_local_code_shift_chips);
+            cudaFreeHost(d_ca_code);
+            delete[] d_Prompt_buffer;
+            multicorrelator_gpu->free_cuda();
+            delete(multicorrelator_gpu);
+    }
+    catch(const std::exception & ex)
+    {
+            LOG(WARNING) << "Exception in destructor " << ex.what();
+    }
 }
 
 
-
 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)
 {
     // Block input data and block output stream pointers
-    const gr_complex* in = (gr_complex*) input_items[0]; //PRN start block alignment
-    Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0];
+    const gr_complex* in = reinterpret_cast<const gr_complex *>(input_items[0]);
+    Gnss_Synchro **out = reinterpret_cast<Gnss_Synchro **>(&output_items[0]);
 
     // GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder
     Gnss_Synchro current_synchro_data = Gnss_Synchro();
@@ -318,7 +330,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work (int noutput_items __attribu
                     acq_trk_shif_correction_samples = d_correlation_length_samples - fmod(static_cast<double>(acq_to_trk_delay_samples), static_cast<double>(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;
-                    current_synchro_data.fs=d_fs_in;
+                    current_synchro_data.fs = d_fs_in;
                     current_synchro_data.correlation_length_ms = 1;
                     *out[0] = current_synchro_data;
                     d_sample_counter += samples_offset; //count for the processed samples
@@ -459,7 +471,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work (int noutput_items __attribu
         }
 
     //assign the GNURadio block output data
-    current_synchro_data.fs=d_fs_in;
+    current_synchro_data.fs = d_fs_in;
     *out[0] = current_synchro_data;
 
     if(d_dump)
@@ -510,6 +522,10 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work (int noutput_items __attribu
                     d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
                     tmp_double = static_cast<double>(d_sample_counter + d_correlation_length_samples);
                     d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
+
+                    // PRN
+                    unsigned int prn_ = d_acquisition_gnss_synchro->PRN;
+                    d_dump_file.write(reinterpret_cast<char*>(&prn_), sizeof(unsigned int));
             }
             catch (const std::ifstream::failure* e)
             {
@@ -523,6 +539,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work (int noutput_items __attribu
     return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
 }
 
+
 void Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::set_channel(unsigned int channel)
 {
     d_channel = channel;
@@ -538,11 +555,11 @@ void Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::set_channel(unsigned int 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;
+                            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;
+                            LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e->what();
                     }
                 }
         }
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 761d3c39a..9bb40eefa 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
@@ -83,7 +83,7 @@ void Gps_L1_Ca_Tcp_Connector_Tracking_cc::forecast (int noutput_items,
 {
     if (noutput_items != 0)
         {
-            ninput_items_required[0] = (int)d_vector_length*2; //set the required available samples in each call
+            ninput_items_required[0] = static_cast<int>(d_vector_length) * 2; //set the required available samples in each call
         }
 }
 
@@ -125,7 +125,7 @@ Gps_L1_Ca_Tcp_Connector_Tracking_cc::Gps_L1_Ca_Tcp_Connector_Tracking_cc(
 
     // correlator outputs (scalar)
     d_n_correlator_taps = 3; // Very-Early, Early, Prompt, Late, Very-Late
-    d_correlator_outs = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_n_correlator_taps*sizeof(gr_complex), volk_gnsssdr_get_alignment()));
+    d_correlator_outs = static_cast<gr_complex*>(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);
@@ -141,7 +141,7 @@ Gps_L1_Ca_Tcp_Connector_Tracking_cc::Gps_L1_Ca_Tcp_Connector_Tracking_cc(
     d_local_code_shift_chips[1] = 0.0;
     d_local_code_shift_chips[2] = d_early_late_spc_chips;
 
-    d_correlation_length_samples=d_vector_length;
+    d_correlation_length_samples = d_vector_length;
 
     multicorrelator_cpu.init(2 * d_correlation_length_samples, d_n_correlator_taps);
 
@@ -161,7 +161,7 @@ Gps_L1_Ca_Tcp_Connector_Tracking_cc::Gps_L1_Ca_Tcp_Connector_Tracking_cc(
     d_enable_tracking = false;
     d_pull_in = false;
 
-    d_current_prn_length_samples = (int)d_vector_length;
+    d_current_prn_length_samples = static_cast<int>(d_vector_length);
 
     // CN0 estimation and lock detector buffers
     d_cn0_estimation_counter = 0;
@@ -189,6 +189,7 @@ Gps_L1_Ca_Tcp_Connector_Tracking_cc::Gps_L1_Ca_Tcp_Connector_Tracking_cc(
     d_code_phase_step_chips = 0.0;
 }
 
+
 void Gps_L1_Ca_Tcp_Connector_Tracking_cc::start_tracking()
 {
     /*
@@ -201,9 +202,9 @@ void Gps_L1_Ca_Tcp_Connector_Tracking_cc::start_tracking()
 
     long int acq_trk_diff_samples;
     float acq_trk_diff_seconds;
-    acq_trk_diff_samples = (long int)d_sample_counter - (long int)d_acq_sample_stamp;
+    acq_trk_diff_samples =  static_cast<long int>(d_sample_counter) -  static_cast<long int>(d_acq_sample_stamp);
     std::cout << "acq_trk_diff_samples=" << acq_trk_diff_samples << std::endl;
-    acq_trk_diff_seconds = (float)acq_trk_diff_samples / (float)d_fs_in;
+    acq_trk_diff_seconds = static_cast<float>(acq_trk_diff_samples) / static_cast<float>(d_fs_in);
     //doppler effect
     // Fd=(C/(C+Vr))*F
     float radial_velocity;
@@ -216,18 +217,18 @@ void Gps_L1_Ca_Tcp_Connector_Tracking_cc::start_tracking()
     d_code_phase_step_chips = static_cast<double>(d_code_freq_hz) / static_cast<double>(d_fs_in);
     T_chip_mod_seconds = 1/d_code_freq_hz;
     T_prn_mod_seconds = T_chip_mod_seconds * GPS_L1_CA_CODE_LENGTH_CHIPS;
-    T_prn_mod_samples = T_prn_mod_seconds * (float)d_fs_in;
+    T_prn_mod_samples = T_prn_mod_seconds * static_cast<float>(d_fs_in);
 
     d_next_prn_length_samples = round(T_prn_mod_samples);
 
     float T_prn_true_seconds = GPS_L1_CA_CODE_LENGTH_CHIPS / GPS_L1_CA_CODE_RATE_HZ;
-    float T_prn_true_samples = T_prn_true_seconds * (float)d_fs_in;
+    float T_prn_true_samples = T_prn_true_seconds * static_cast<float>(d_fs_in);
     float T_prn_diff_seconds;
     T_prn_diff_seconds = T_prn_true_seconds - T_prn_mod_seconds;
     float N_prn_diff;
     N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds;
     float corrected_acq_phase_samples, delay_correction_samples;
-    corrected_acq_phase_samples = fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * (float)d_fs_in), T_prn_true_samples);
+    corrected_acq_phase_samples = fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast<float>(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;
@@ -259,7 +260,7 @@ void Gps_L1_Ca_Tcp_Connector_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;
+    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
@@ -272,21 +273,35 @@ void Gps_L1_Ca_Tcp_Connector_Tracking_cc::start_tracking()
 }
 
 
-
-
 Gps_L1_Ca_Tcp_Connector_Tracking_cc::~Gps_L1_Ca_Tcp_Connector_Tracking_cc()
 {
-    d_dump_file.close();
-
-    delete[] d_Prompt_buffer;
-    volk_gnsssdr_free(d_ca_code);
-    volk_gnsssdr_free(d_local_code_shift_chips);
-    volk_gnsssdr_free(d_correlator_outs);
-
-    d_tcp_com.close_tcp_connection(d_port);
-    multicorrelator_cpu.free();
+    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);
+            d_tcp_com.close_tcp_connection(d_port);
+            delete[] d_Prompt_buffer;
+            multicorrelator_cpu.free();
+    }
+    catch(const std::exception & ex)
+    {
+            LOG(WARNING) << "Exception in destructor " << ex.what();
+    }
 }
 
+
 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)
 {
@@ -301,8 +316,8 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attri
     Gnss_Synchro current_synchro_data = Gnss_Synchro();
 
     // Block input data and block output stream pointers
-    const gr_complex* in = (gr_complex*) input_items[0];
-    Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0];
+    const gr_complex* in = reinterpret_cast<const gr_complex *>(input_items[0]);
+    Gnss_Synchro **out = reinterpret_cast<Gnss_Synchro **>(&output_items[0]);
 
     if (d_enable_tracking == true)
         {
@@ -319,19 +334,18 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attri
                     float 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_next_prn_length_samples - fmod((float)acq_to_trk_delay_samples, (float)d_next_prn_length_samples);
+                    acq_trk_shif_correction_samples = d_next_prn_length_samples - fmod(static_cast<float>(acq_to_trk_delay_samples), static_cast<float>(d_next_prn_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;
-                    current_synchro_data.fs=d_fs_in;
+                    current_synchro_data.fs = d_fs_in;
                     *out[0] = current_synchro_data;
-                    d_sample_counter_seconds = d_sample_counter_seconds + (((double)samples_offset) / (double)d_fs_in);
+                    d_sample_counter_seconds = d_sample_counter_seconds + (static_cast<double>(samples_offset) / static_cast<double>(d_fs_in));
                     d_sample_counter = d_sample_counter + samples_offset; //count for the processed samples
                     d_pull_in = false;
                     consume_each(samples_offset); //shift input to perform alignement with local replica
                     return 1;
                 }
 
-
             // Update the prn length based on code freq (variable) and
             // sampling frequency (fixed)
             // variable code PRN sample block size
@@ -376,21 +390,21 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attri
 
             // Update the phasestep based on code freq (variable) and
             // sampling frequency (fixed)
-            d_code_phase_step_chips = d_code_freq_hz / (float)d_fs_in; //[chips]
+            d_code_phase_step_chips = d_code_freq_hz / static_cast<float>(d_fs_in); //[chips]
             // variable code PRN sample block size
             double T_chip_seconds;
             double T_prn_seconds;
             double T_prn_samples;
             double K_blk_samples;
-            T_chip_seconds = 1 / (double)d_code_freq_hz;
+            T_chip_seconds = 1.0 / static_cast<double>(d_code_freq_hz);
             T_prn_seconds = T_chip_seconds * GPS_L1_CA_CODE_LENGTH_CHIPS;
-            T_prn_samples = T_prn_seconds * (double)d_fs_in;
+            T_prn_samples = T_prn_seconds * static_cast<double>(d_fs_in);
             d_rem_code_phase_samples = d_next_rem_code_phase_samples;
             K_blk_samples = T_prn_samples + d_rem_code_phase_samples;//-code_error*(double)d_fs_in;
 
             // Update the current PRN delay (code phase in 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 * (double)d_fs_in;
+            double T_prn_true_samples = T_prn_true_seconds * static_cast<double>(d_fs_in);
             d_code_phase_samples = d_code_phase_samples + T_prn_samples - T_prn_true_samples;
             if (d_code_phase_samples < 0)
                 {
@@ -439,15 +453,15 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attri
 
             // ########### Output the tracking data to navigation and PVT ##########
 
-            current_synchro_data.Prompt_I = (double)(*d_Prompt).real();
-            current_synchro_data.Prompt_Q = (double)(*d_Prompt).imag();
+            current_synchro_data.Prompt_I = static_cast<double>((*d_Prompt).real());
+            current_synchro_data.Prompt_Q = static_cast<double>((*d_Prompt).imag());
             //compute remnant code phase samples AFTER the Tracking timestamp
             d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; //rounding error < 1 sample
             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 = (double)d_acc_carrier_phase_rad;
-            current_synchro_data.Carrier_Doppler_hz = (double)d_carrier_doppler_hz;
-            current_synchro_data.CN0_dB_hz = (double)d_CN0_SNV_dB_Hz;
+            current_synchro_data.Carrier_phase_rads = static_cast<double>(d_acc_carrier_phase_rad);
+            current_synchro_data.Carrier_Doppler_hz = static_cast<double>(d_carrier_doppler_hz);
+            current_synchro_data.CN0_dB_hz = static_cast<double>(d_CN0_SNV_dB_Hz);
             current_synchro_data.Flag_valid_symbol_output = true;
             current_synchro_data.correlation_length_ms=1;
         }
@@ -468,9 +482,9 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attri
     current_synchro_data.System = {'G'};
     std::string str_aux = "1C";
     const char * str = str_aux.c_str(); // get a C style null terminated string
-    std::memcpy((void*)current_synchro_data.Signal, str, 3);
+    std::memcpy(static_cast<void*>(current_synchro_data.Signal), str, 3);
 
-    current_synchro_data.fs=d_fs_in;
+    current_synchro_data.fs = d_fs_in;
     *out[0] = current_synchro_data;
 
     if(d_dump)
@@ -488,38 +502,42 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attri
             try
             {
                     // EPR
-                    d_dump_file.write((char*)&tmp_E, sizeof(float));
-                    d_dump_file.write((char*)&tmp_P, sizeof(float));
-                    d_dump_file.write((char*)&tmp_L, sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&tmp_E), sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&tmp_P), sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&tmp_L), sizeof(float));
                     // PROMPT I and Q (to analyze navigation symbols)
-                    d_dump_file.write((char*)&prompt_I, sizeof(float));
-                    d_dump_file.write((char*)&prompt_Q, sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&prompt_I), sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&prompt_Q), sizeof(float));
                     // PRN start sample stamp
                     //tmp_float=(float)d_sample_counter;
-                    d_dump_file.write((char*)&d_sample_counter, sizeof(unsigned long int));
+                    d_dump_file.write(reinterpret_cast<char*>(&d_sample_counter), sizeof(unsigned long int));
                     // accumulated carrier phase
-                    d_dump_file.write((char*)&d_acc_carrier_phase_rad, sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&d_acc_carrier_phase_rad), sizeof(float));
 
                     // carrier and code frequency
-                    d_dump_file.write((char*)&d_carrier_doppler_hz, sizeof(float));
-                    d_dump_file.write((char*)&d_code_freq_hz, sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&d_carrier_doppler_hz), sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&d_code_freq_hz), sizeof(float));
 
                     //PLL commands
-                    d_dump_file.write((char*)&carr_error, sizeof(float));
-                    d_dump_file.write((char*)&carr_nco, sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&carr_error), sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&carr_nco), sizeof(float));
 
                     //DLL commands
-                    d_dump_file.write((char*)&code_error, sizeof(float));
-                    d_dump_file.write((char*)&code_nco, sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&code_error), sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&code_nco), sizeof(float));
 
                     // CN0 and carrier lock test
-                    d_dump_file.write((char*)&d_CN0_SNV_dB_Hz, sizeof(float));
-                    d_dump_file.write((char*)&d_carrier_lock_test, sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&d_CN0_SNV_dB_Hz), sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&d_carrier_lock_test), sizeof(float));
 
                     // AUX vars (for debug purposes)
                     tmp_float = 0;
-                    d_dump_file.write((char*)&tmp_float, sizeof(float));
-                    d_dump_file.write((char*)&d_sample_counter_seconds, sizeof(double));
+                    d_dump_file.write(reinterpret_cast<char*>(&tmp_float), sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&d_sample_counter_seconds), sizeof(double));
+
+                    // PRN
+                    unsigned int prn_ = d_acquisition_gnss_synchro->PRN;
+                    d_dump_file.write(reinterpret_cast<char*>(&prn_), sizeof(unsigned int));
             }
             catch (const std::ifstream::failure &e)
             {
@@ -528,7 +546,7 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attri
         }
 
     consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates
-    d_sample_counter_seconds = d_sample_counter_seconds + ( ((double)d_current_prn_length_samples) / (double)d_fs_in );
+    d_sample_counter_seconds = d_sample_counter_seconds + ( static_cast<double>(d_current_prn_length_samples) / static_cast<double>(d_fs_in) );
     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
diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l2_m_dll_pll_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l2_m_dll_pll_tracking_cc.cc
index 5c3969379..18d6a2fc2 100644
--- a/src/algorithms/tracking/gnuradio_blocks/gps_l2_m_dll_pll_tracking_cc.cc
+++ b/src/algorithms/tracking/gnuradio_blocks/gps_l2_m_dll_pll_tracking_cc.cc
@@ -1,6 +1,6 @@
 /*!
  * \file gps_l2_m_dll_pll_tracking_cc.cc
- * \brief Implementation of a code DLL + carrier PLL tracking block
+ * \brief Implementation of a code DLL + carrier PLL tracking block for GPS L2C
  * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com
  *         Javier Arribas, 2011. jarribas(at)cttc.es
  *
@@ -81,13 +81,12 @@ void gps_l2_m_dll_pll_tracking_cc::forecast (int noutput_items,
         gr_vector_int &ninput_items_required)
 {
     if (noutput_items != 0)
-    {
-        ninput_items_required[0] = static_cast<int>(d_vector_length) * 2; //set the required available samples in each call
-    }
+        {
+            ninput_items_required[0] = static_cast<int>(d_vector_length) * 2; //set the required available samples in each call
+        }
 }
 
 
-
 gps_l2_m_dll_pll_tracking_cc::gps_l2_m_dll_pll_tracking_cc(
         long if_freq,
         long fs_in,
@@ -131,9 +130,9 @@ gps_l2_m_dll_pll_tracking_cc::gps_l2_m_dll_pll_tracking_cc(
     d_n_correlator_taps = 3; // Early, Prompt, and Late
     d_correlator_outs = static_cast<gr_complex*>(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_correlator_outs[n] = gr_complex(0,0);
+        }
     d_local_code_shift_chips = static_cast<float*>(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;
@@ -222,9 +221,9 @@ void gps_l2_m_dll_pll_tracking_cc::start_tracking()
     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<double>(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;
-    }
+        {
+            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;
@@ -241,9 +240,9 @@ void gps_l2_m_dll_pll_tracking_cc::start_tracking()
 
     multicorrelator_cpu.set_local_code_and_taps(static_cast<int>(GPS_L2_M_CODE_LENGTH_CHIPS), d_ca_code, d_local_code_shift_chips);
     for (int n = 0; n < d_n_correlator_taps; n++)
-    {
-        d_correlator_outs[n] = gr_complex(0,0);
-    }
+        {
+            d_correlator_outs[n] = gr_complex(0,0);
+        }
 
     d_carrier_lock_fail_counter = 0;
     d_rem_code_phase_samples = 0;
@@ -257,7 +256,7 @@ void gps_l2_m_dll_pll_tracking_cc::start_tracking()
     sys = sys_.substr(0,1);
 
     // DEBUG OUTPUT
-    std::cout << "Tracking GPS L2CM start on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl;
+    std::cout << "Tracking of GPS L2CM signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl;
     LOG(INFO) << "Starting GPS L2CM tracking of satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel;
 
     // enable tracking
@@ -265,24 +264,39 @@ void gps_l2_m_dll_pll_tracking_cc::start_tracking()
     d_enable_tracking = true;
 
     LOG(INFO) << "GPS L2CM 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;
+              << " Code Phase correction [samples]=" << delay_correction_samples
+              << " PULL-IN Code Phase [samples]=" << d_acq_code_phase_samples;
 }
 
+
 gps_l2_m_dll_pll_tracking_cc::~gps_l2_m_dll_pll_tracking_cc()
 {
-    d_dump_file.close();
-
-    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();
+    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();
+    }
+    catch(const std::exception & ex)
+    {
+            LOG(WARNING) << "Exception in destructor " << ex.what();
+    }
 }
 
 
-
 int gps_l2_m_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)
 {
@@ -296,234 +310,235 @@ int gps_l2_m_dll_pll_tracking_cc::general_work (int noutput_items __attribute__(
     Gnss_Synchro current_synchro_data = Gnss_Synchro();
 
     // Block input data and block output stream pointers
-    const gr_complex* in = (gr_complex*) input_items[0]; //PRN start block alignment
-    Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0];
+    const gr_complex* in = reinterpret_cast<const gr_complex *>(input_items[0]);
+    Gnss_Synchro **out = reinterpret_cast<Gnss_Synchro **>(&output_items[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)
         {
-            int samples_offset;
-            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_current_prn_length_samples - fmod(static_cast<float>(acq_to_trk_delay_samples), static_cast<float>(d_current_prn_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 = d_sample_counter + samples_offset; // count for the processed samples
-            d_pull_in = false;
-            // take into account the carrier cycles accumulated in the pull in signal alignment
-            d_acc_carrier_phase_rad -= d_carrier_phase_step_rad * samples_offset;
+            // Fill the acquisition data
+            current_synchro_data = *d_acquisition_gnss_synchro;
+            // Receiver signal alignment
+            if (d_pull_in == true)
+                {
+                    int samples_offset;
+                    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_current_prn_length_samples - fmod(static_cast<float>(acq_to_trk_delay_samples), static_cast<float>(d_current_prn_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 = d_sample_counter + samples_offset; // count for the processed samples
+                    d_pull_in = false;
+                    // take into account the carrier cycles accumulated in the pull in signal alignment
+                    d_acc_carrier_phase_rad -= d_carrier_phase_step_rad * samples_offset;
+                    current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_rad;
+                    current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz;
+                    current_synchro_data.fs = d_fs_in;
+                    current_synchro_data.correlation_length_ms = 20;
+                    *out[0] = current_synchro_data;
+                    consume_each(samples_offset); // shift input to perform alignment with local replica
+                    return 1;
+                }
+
+            // ################# CARRIER WIPEOFF AND CORRELATORS ##############################
+            // perform carrier wipe-off and compute Early, Prompt and Late correlation
+            multicorrelator_cpu.set_input_output_vectors(d_correlator_outs, in);
+            multicorrelator_cpu.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);
+
+            // ################## PLL ##########################################################
+            // PLL discriminator
+            // Update PLL discriminator [rads/Ti -> Secs/Ti]
+            carr_error_hz = pll_cloop_two_quadrant_atan(d_correlator_outs[1]) / GPS_L2_TWO_PI;
+            // 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_L2_M_CODE_RATE_HZ + ((d_carrier_doppler_hz * GPS_L2_M_CODE_RATE_HZ) / GPS_L2_FREQ_HZ);
+
+            // ################## DLL ##########################################################
+            // DLL discriminator
+            code_error_chips = dll_nc_e_minus_l_normalized(d_correlator_outs[0], d_correlator_outs[2]); // [chips/Ti]
+            // 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<double>(d_code_freq_chips);
+            double T_prn_seconds = T_chip_seconds * GPS_L2_M_CODE_LENGTH_CHIPS;
+            double code_error_filt_secs = (T_prn_seconds * code_error_filt_chips*T_chip_seconds); //[seconds]
+            //double code_error_filt_secs = (GPS_L2_M_PERIOD * code_error_filt_chips) / GPS_L2_M_CODE_RATE_HZ; //[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<double>(d_fs_in);
+            double K_blk_samples = T_prn_samples + d_rem_code_phase_samples + code_error_filt_secs * static_cast<double>(d_fs_in);
+            d_current_prn_length_samples = round(K_blk_samples); // round to a discrete number of samples
+
+            //################### PLL COMMANDS #################################################
+            // carrier phase step (NCO phase increment per sample) [rads/sample]
+            d_carrier_phase_step_rad = GPS_L2_TWO_PI * d_carrier_doppler_hz / static_cast<double>(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_L2_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<double>(d_fs_in);
+            // remnant code phase [chips]
+            d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; // rounding error < 1 sample
+            d_rem_code_phase_chips = d_code_freq_chips * (d_rem_code_phase_samples / static_cast<double>(d_fs_in));
+
+            // ####### CN0 ESTIMATION AND LOCK DETECTORS ######
+            if (d_cn0_estimation_counter < GPS_L2M_CN0_ESTIMATION_SAMPLES)
+                {
+                    // fill buffer with prompt correlator output values
+                    d_Prompt_buffer[d_cn0_estimation_counter] = d_correlator_outs[1];
+                    d_cn0_estimation_counter++;
+                }
+            else
+                {
+                    d_cn0_estimation_counter = 0;
+                    // Code lock indicator
+                    d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, GPS_L2M_CN0_ESTIMATION_SAMPLES, d_fs_in, GPS_L2_M_CODE_LENGTH_CHIPS);
+                    // Carrier lock indicator
+                    d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, GPS_L2M_CN0_ESTIMATION_SAMPLES);
+                    // Loss of lock detection
+                    if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < GPS_L2M_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 > GPS_L2M_MAXIMUM_LOCK_FAIL_COUNTER)
+                        {
+                            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
+                        }
+                }
+            // ########### Output the tracking data to navigation and PVT ##########
+            current_synchro_data.Prompt_I = static_cast<double>(d_correlator_outs[1].real());
+            current_synchro_data.Prompt_Q = static_cast<double>(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.fs=d_fs_in;
+            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 = 20;
-            *out[0] = current_synchro_data;
-            consume_each(samples_offset); // shift input to perform alignment with local replica
-            return 1;
         }
-
-        // ################# CARRIER WIPEOFF AND CORRELATORS ##############################
-        // perform carrier wipe-off and compute Early, Prompt and Late correlation
-        multicorrelator_cpu.set_input_output_vectors(d_correlator_outs, in);
-        multicorrelator_cpu.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);
-
-        // ################## PLL ##########################################################
-        // PLL discriminator
-        // Update PLL discriminator [rads/Ti -> Secs/Ti]
-        carr_error_hz = pll_cloop_two_quadrant_atan(d_correlator_outs[1]) / GPS_L2_TWO_PI;
-        // 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_L2_M_CODE_RATE_HZ + ((d_carrier_doppler_hz * GPS_L2_M_CODE_RATE_HZ) / GPS_L2_FREQ_HZ);
-
-        // ################## DLL ##########################################################
-        // DLL discriminator
-        code_error_chips = dll_nc_e_minus_l_normalized(d_correlator_outs[0], d_correlator_outs[2]); // [chips/Ti]
-        // 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<double>(d_code_freq_chips);
-        double T_prn_seconds = T_chip_seconds * GPS_L2_M_CODE_LENGTH_CHIPS;
-        double code_error_filt_secs = (T_prn_seconds * code_error_filt_chips*T_chip_seconds); //[seconds]
-        //double code_error_filt_secs = (GPS_L2_M_PERIOD * code_error_filt_chips) / GPS_L2_M_CODE_RATE_HZ; //[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<double>(d_fs_in);
-        double K_blk_samples = T_prn_samples + d_rem_code_phase_samples + code_error_filt_secs * static_cast<double>(d_fs_in);
-        d_current_prn_length_samples = round(K_blk_samples); // round to a discrete number of samples
-
-        //################### PLL COMMANDS #################################################
-        // carrier phase step (NCO phase increment per sample) [rads/sample]
-        d_carrier_phase_step_rad = GPS_L2_TWO_PI * d_carrier_doppler_hz / static_cast<double>(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_L2_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<double>(d_fs_in);
-        // remnant code phase [chips]
-        d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; // rounding error < 1 sample
-        d_rem_code_phase_chips = d_code_freq_chips * (d_rem_code_phase_samples / static_cast<double>(d_fs_in));
-
-        // ####### CN0 ESTIMATION AND LOCK DETECTORS ######
-        if (d_cn0_estimation_counter < GPS_L2M_CN0_ESTIMATION_SAMPLES)
-        {
-            // fill buffer with prompt correlator output values
-            d_Prompt_buffer[d_cn0_estimation_counter] = d_correlator_outs[1];
-            d_cn0_estimation_counter++;
-        }
-        else
-        {
-            d_cn0_estimation_counter = 0;
-            // Code lock indicator
-            d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, GPS_L2M_CN0_ESTIMATION_SAMPLES, d_fs_in, GPS_L2_M_CODE_LENGTH_CHIPS);
-            // Carrier lock indicator
-            d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, GPS_L2M_CN0_ESTIMATION_SAMPLES);
-            // Loss of lock detection
-            if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < GPS_L2M_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 > GPS_L2M_MAXIMUM_LOCK_FAIL_COUNTER)
-            {
-                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
-            }
-        }
-        // ########### Output the tracking data to navigation and PVT ##########
-        current_synchro_data.Prompt_I = static_cast<double>(d_correlator_outs[1].real());
-        current_synchro_data.Prompt_Q = static_cast<double>(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 = 20;
-
-    }
     else
-    {
-        for (int n = 0; n < d_n_correlator_taps; n++)
         {
-            d_correlator_outs[n] = gr_complex(0,0);
+            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.correlation_length_ms = 20;
         }
-        current_synchro_data.Tracking_sample_counter =d_sample_counter + d_current_prn_length_samples;
-        current_synchro_data.correlation_length_ms = 20;
-    }
     //assign the GNURadio block output data
-    current_synchro_data.fs=d_fs_in;
+    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[1].real();
-        prompt_Q = d_correlator_outs[1].imag();
-        tmp_E = std::abs<float>(d_correlator_outs[0]);
-        tmp_P = std::abs<float>(d_correlator_outs[1]);
-        tmp_L = std::abs<float>(d_correlator_outs[2]);
-        try
         {
-            // EPR
-            d_dump_file.write(reinterpret_cast<char*>(&tmp_E), sizeof(float));
-            d_dump_file.write(reinterpret_cast<char*>(&tmp_P), sizeof(float));
-            d_dump_file.write(reinterpret_cast<char*>(&tmp_L), sizeof(float));
-            // PROMPT I and Q (to analyze navigation symbols)
-            d_dump_file.write(reinterpret_cast<char*>(&prompt_I), sizeof(float));
-            d_dump_file.write(reinterpret_cast<char*>(&prompt_Q), sizeof(float));
-            // PRN start sample stamp
-            //tmp_float=(float)d_sample_counter;
-            d_dump_file.write(reinterpret_cast<char*>(&d_sample_counter), sizeof(unsigned long int));
-            // accumulated carrier phase
-            d_dump_file.write(reinterpret_cast<char*>(&d_acc_carrier_phase_rad), sizeof(double));
+            // 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[1].real();
+            prompt_Q = d_correlator_outs[1].imag();
+            tmp_E = std::abs<float>(d_correlator_outs[0]);
+            tmp_P = std::abs<float>(d_correlator_outs[1]);
+            tmp_L = std::abs<float>(d_correlator_outs[2]);
+            try
+            {
+                    // EPR
+                    d_dump_file.write(reinterpret_cast<char*>(&tmp_E), sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&tmp_P), sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&tmp_L), sizeof(float));
+                    // PROMPT I and Q (to analyze navigation symbols)
+                    d_dump_file.write(reinterpret_cast<char*>(&prompt_I), sizeof(float));
+                    d_dump_file.write(reinterpret_cast<char*>(&prompt_Q), sizeof(float));
+                    // PRN start sample stamp
+                    //tmp_float=(float)d_sample_counter;
+                    d_dump_file.write(reinterpret_cast<char*>(&d_sample_counter), sizeof(unsigned long int));
+                    // accumulated carrier phase
+                    d_dump_file.write(reinterpret_cast<char*>(&d_acc_carrier_phase_rad), sizeof(double));
 
-            // carrier and code frequency
-            d_dump_file.write(reinterpret_cast<char*>(&d_carrier_doppler_hz), sizeof(double));
-            d_dump_file.write(reinterpret_cast<char*>(&d_code_freq_chips), sizeof(double));
+                    // carrier and code frequency
+                    d_dump_file.write(reinterpret_cast<char*>(&d_carrier_doppler_hz), sizeof(double));
+                    d_dump_file.write(reinterpret_cast<char*>(&d_code_freq_chips), sizeof(double));
 
-            //PLL commands
-            d_dump_file.write(reinterpret_cast<char*>(&carr_error_hz), sizeof(double));
-            d_dump_file.write(reinterpret_cast<char*>(&d_carrier_doppler_hz), sizeof(double));
+                    //PLL commands
+                    d_dump_file.write(reinterpret_cast<char*>(&carr_error_hz), sizeof(double));
+                    d_dump_file.write(reinterpret_cast<char*>(&d_carrier_doppler_hz), sizeof(double));
 
-            //DLL commands
-            d_dump_file.write(reinterpret_cast<char*>(&code_error_chips), sizeof(double));
-            d_dump_file.write(reinterpret_cast<char*>(&code_error_filt_chips), sizeof(double));
+                    //DLL commands
+                    d_dump_file.write(reinterpret_cast<char*>(&code_error_chips), sizeof(double));
+                    d_dump_file.write(reinterpret_cast<char*>(&code_error_filt_chips), sizeof(double));
 
-            // CN0 and carrier lock test
-            d_dump_file.write(reinterpret_cast<char*>(&d_CN0_SNV_dB_Hz), sizeof(double));
-            d_dump_file.write(reinterpret_cast<char*>(&d_carrier_lock_test), sizeof(double));
+                    // CN0 and carrier lock test
+                    d_dump_file.write(reinterpret_cast<char*>(&d_CN0_SNV_dB_Hz), sizeof(double));
+                    d_dump_file.write(reinterpret_cast<char*>(&d_carrier_lock_test), sizeof(double));
 
-            // AUX vars (for debug purposes)
-            tmp_double = d_rem_code_phase_samples;
-            d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
-            tmp_double = static_cast<double>(d_sample_counter + d_current_prn_length_samples);
-            d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
+                    // AUX vars (for debug purposes)
+                    tmp_double = d_rem_code_phase_samples;
+                    d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
+                    tmp_double = static_cast<double>(d_sample_counter + d_current_prn_length_samples);
+                    d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
+
+                    // PRN
+                    unsigned int prn_ = d_acquisition_gnss_synchro->PRN;
+                    d_dump_file.write(reinterpret_cast<char*>(&prn_), sizeof(unsigned int));
+            }
+            catch (std::ifstream::failure& e)
+            {
+                    LOG(WARNING) << "Exception writing trk dump file " << e.what();
+            }
         }
-        catch (std::ifstream::failure& e)
-        {
-            LOG(WARNING) << "Exception writing trk dump file " << e.what();
-        }
-    }
     consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates
     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 gps_l2_m_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<std::string>(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 (std::ifstream::failure& e)
-            {
-                LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what();
-            }
+            if (d_dump_file.is_open() == false)
+                {
+                    try
+                    {
+                            d_dump_filename.append(boost::lexical_cast<std::string>(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 (std::ifstream::failure& e)
+                    {
+                            LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what();
+                    }
+                }
         }
-    }
 }
 
 
-
 void gps_l2_m_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_l2_m_dll_pll_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l2_m_dll_pll_tracking_cc.h
index 0a94f8e92..37942778b 100644
--- a/src/algorithms/tracking/gnuradio_blocks/gps_l2_m_dll_pll_tracking_cc.h
+++ b/src/algorithms/tracking/gnuradio_blocks/gps_l2_m_dll_pll_tracking_cc.h
@@ -1,6 +1,6 @@
 /*!
  * \file gps_l2_m_dll_pll_tracking_cc.h
- * \brief Interface of a code DLL + carrier PLL tracking block
+ * \brief Interface of a code DLL + carrier PLL tracking block for GPS L2C
  * \author Javier Arribas, 2015. jarribas(at)cttc.es
  *
  * Code DLL + carrier PLL according to the algorithms described in:
diff --git a/src/algorithms/tracking/libs/CMakeLists.txt b/src/algorithms/tracking/libs/CMakeLists.txt
index 1e057b4d7..19387889e 100644
--- a/src/algorithms/tracking/libs/CMakeLists.txt
+++ b/src/algorithms/tracking/libs/CMakeLists.txt
@@ -33,6 +33,7 @@ endif(ENABLE_CUDA)
 
 set(TRACKING_LIB_SOURCES   
      cpu_multicorrelator.cc
+     cpu_multicorrelator_real_codes.cc
      cpu_multicorrelator_16sc.cc     
      lock_detectors.cc
      tcp_communication.cc
@@ -49,7 +50,7 @@ if(ENABLE_FPGA)
 endif(ENABLE_FPGA)
 
 include_directories(
-     $(CMAKE_CURRENT_SOURCE_DIR)
+     ${CMAKE_CURRENT_SOURCE_DIR}
      ${CMAKE_SOURCE_DIR}/src/core/system_parameters
      ${CMAKE_SOURCE_DIR}/src/core/interfaces
      ${CMAKE_SOURCE_DIR}/src/core/receiver
diff --git a/src/algorithms/tracking/libs/cpu_multicorrelator.cc b/src/algorithms/tracking/libs/cpu_multicorrelator.cc
index 7551669c0..3a76c8440 100644
--- a/src/algorithms/tracking/libs/cpu_multicorrelator.cc
+++ b/src/algorithms/tracking/libs/cpu_multicorrelator.cc
@@ -123,7 +123,7 @@ bool cpu_multicorrelator::Carrier_wipeoff_multicorrelator_resampler(
     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_x2_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 lv_32fc_t**)d_local_codes_resampled, d_n_correlators, signal_length_samples);
+    volk_gnsssdr_32fc_x2_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_cast<const lv_32fc_t**>(d_local_codes_resampled), d_n_correlators, signal_length_samples);
     return true;
 }
 
diff --git a/src/algorithms/tracking/libs/cpu_multicorrelator_16sc.cc b/src/algorithms/tracking/libs/cpu_multicorrelator_16sc.cc
index fa9f7873c..dd7ed14a4 100644
--- a/src/algorithms/tracking/libs/cpu_multicorrelator_16sc.cc
+++ b/src/algorithms/tracking/libs/cpu_multicorrelator_16sc.cc
@@ -102,7 +102,7 @@ bool cpu_multicorrelator_16sc::Carrier_wipeoff_multicorrelator_resampler(
     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_16ic_x2_rotator_dot_prod_16ic_xn(d_corr_out, d_sig_in, std::exp(lv_32fc_t(0, -phase_step_rad)), phase_offset_as_complex, (const lv_16sc_t**)d_local_codes_resampled, d_n_correlators, signal_length_samples);
+    volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn(d_corr_out, d_sig_in, std::exp(lv_32fc_t(0, -phase_step_rad)), phase_offset_as_complex, const_cast<const lv_16sc_t**>(d_local_codes_resampled), d_n_correlators, signal_length_samples);
     return true;
 }
 
diff --git a/src/algorithms/tracking/libs/cpu_multicorrelator_real_codes.cc b/src/algorithms/tracking/libs/cpu_multicorrelator_real_codes.cc
new file mode 100644
index 000000000..cc0df391c
--- /dev/null
+++ b/src/algorithms/tracking/libs/cpu_multicorrelator_real_codes.cc
@@ -0,0 +1,147 @@
+/*!
+ * \file cpu_multicorrelator_real_codes.cc
+ * \brief High optimized CPU vector multiTAP correlator class with real-valued local codes
+ * \authors <ul>
+ *          <li> Javier Arribas, 2015. jarribas(at)cttc.es
+ *          <li> Cillian O'Driscoll, 2017. cillian.odriscoll(at)gmail.com
+ *          </ul>
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ *
+ * -------------------------------------------------------------------------
+ */
+
+#include "cpu_multicorrelator_real_codes.h"
+#include <cmath>
+#include <iostream>
+#include <volk_gnsssdr/volk_gnsssdr.h>
+
+
+cpu_multicorrelator_real_codes::cpu_multicorrelator_real_codes()
+{
+    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;
+}
+
+
+cpu_multicorrelator_real_codes::~cpu_multicorrelator_real_codes()
+{
+    if(d_local_codes_resampled != nullptr)
+        {
+            cpu_multicorrelator_real_codes::free();
+        }
+}
+
+
+bool cpu_multicorrelator_real_codes::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<float**>(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<float*>(volk_gnsssdr_malloc(size, volk_gnsssdr_get_alignment()));
+        }
+    d_n_correlators = n_correlators;
+    return true;
+}
+
+
+
+bool cpu_multicorrelator_real_codes::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 cpu_multicorrelator_real_codes::set_input_output_vectors(std::complex<float>* corr_out, const std::complex<float>* sig_in)
+{
+    // Save CPU pointers
+    d_sig_in = sig_in;
+    d_corr_out = corr_out;
+    return true;
+}
+
+
+void cpu_multicorrelator_real_codes::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 cpu_multicorrelator_real_codes::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 cpu_multicorrelator_real_codes::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/cpu_multicorrelator_real_codes.h b/src/algorithms/tracking/libs/cpu_multicorrelator_real_codes.h
new file mode 100644
index 000000000..922a12c7a
--- /dev/null
+++ b/src/algorithms/tracking/libs/cpu_multicorrelator_real_codes.h
@@ -0,0 +1,70 @@
+/*!
+ * \file cpu_multicorrelator_real_codes.h
+ * \brief High optimized CPU vector multiTAP correlator class using real-valued local codes
+ * \authors <ul>
+ *          <li> Javier Arribas, 2015. jarribas(at)cttc.es
+ *          <li> Cillian O'Driscoll, 2017, cillian.odriscoll(at)gmail.com
+ *          </ul>
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ *
+ * -------------------------------------------------------------------------
+ */
+
+#ifndef GNSS_SDR_CPU_MULTICORRELATOR_REAL_CODES_H_
+#define GNSS_SDR_CPU_MULTICORRELATOR_REAL_CODES_H_
+
+
+#include <complex>
+
+/*!
+ * \brief Class that implements carrier wipe-off and correlators.
+ */
+class cpu_multicorrelator_real_codes
+{
+public:
+    cpu_multicorrelator_real_codes();
+    ~cpu_multicorrelator_real_codes();
+    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<float>* corr_out, const std::complex<float>* 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<float> *d_sig_in;
+    float **d_local_codes_resampled;
+    const float *d_local_code_in;
+    std::complex<float> *d_corr_out;
+    float *d_shifts_chips;
+    int d_code_length_chips;
+    int d_n_correlators;
+};
+
+
+#endif /* CPU_MULTICORRELATOR_REAL_CODES_H_ */
+
diff --git a/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.cc b/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.cc
index 3ce33110e..cec90a8f3 100644
--- a/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.cc
+++ b/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.cc
@@ -60,6 +60,9 @@
 // logging
 #include <glog/logging.h>
 
+// string manipulation
+#include <string>
+
 #define PAGE_SIZE 0x10000
 #define MAX_LENGTH_DEVICEIO_NAME 50
 #define CODE_RESAMPLER_NUM_BITS_PRECISION 20
@@ -69,20 +72,10 @@
 #define PHASE_CARR_NBITS 32
 #define PHASE_CARR_NBITS_INT 1
 #define PHASE_CARR_NBITS_FRAC PHASE_CARR_NBITS - PHASE_CARR_NBITS_INT
-
-
-
-bool fpga_multicorrelator_8sc::init(int n_correlators)
-{
-    d_n_correlators = n_correlators;
-
-    // instantiate variable length vectors
-    d_initial_index = static_cast<unsigned*>(volk_gnsssdr_malloc(n_correlators * sizeof(unsigned), volk_gnsssdr_get_alignment()));
-    d_initial_interp_counter = static_cast<unsigned*>(volk_gnsssdr_malloc(n_correlators * sizeof(unsigned), volk_gnsssdr_get_alignment()));
-
-    return true;
-}
-
+#define LOCAL_CODE_FPGA_CORRELATOR_SELECT_COUNT 0x20000000
+#define LOCAL_CODE_FPGA_CLEAR_ADDRESS_COUNTER 0x10000000
+#define LOCAL_CODE_FPGA_ENABLE_WRITE_MEMORY 0x0C000000
+#define TEST_REGISTER_TRACK_WRITEVAL 0x55AA
 
 void fpga_multicorrelator_8sc::set_initial_sample(int samples_offset)
 {
@@ -90,10 +83,8 @@ void fpga_multicorrelator_8sc::set_initial_sample(int samples_offset)
 }
 
 
-bool fpga_multicorrelator_8sc::set_local_code_and_taps(
-        int code_length_chips,
-        const lv_16sc_t* local_code_in,
-        float *shifts_chips)
+bool fpga_multicorrelator_8sc::set_local_code_and_taps(int code_length_chips,
+        const lv_16sc_t* local_code_in, float *shifts_chips)
 {
     d_local_code_in = local_code_in;
     d_shifts_chips = shifts_chips;
@@ -124,10 +115,8 @@ void fpga_multicorrelator_8sc::update_local_code(float rem_code_phase_chips)
 
 
 bool 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,
+        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);
@@ -144,7 +133,7 @@ bool fpga_multicorrelator_8sc::Carrier_wipeoff_multicorrelator_resampler(
     int irq_count;
     ssize_t nb;
     // wait for interrupt
-    nb=read(d_fd, &irq_count, sizeof(irq_count));
+    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");
@@ -157,19 +146,41 @@ bool fpga_multicorrelator_8sc::Carrier_wipeoff_multicorrelator_resampler(
 }
 
 
-fpga_multicorrelator_8sc::fpga_multicorrelator_8sc()
+fpga_multicorrelator_8sc::fpga_multicorrelator_8sc(int n_correlators,
+        std::string device_name, unsigned int device_base)
 {
+    d_n_correlators = n_correlators;
+    d_device_name = device_name;
+    d_device_base = device_base;
+    d_device_descriptor = 0;
+    d_map_base = nullptr;
+
+    // instantiate variable length vectors
+    d_initial_index = static_cast<unsigned*>(volk_gnsssdr_malloc(
+            n_correlators * sizeof(unsigned), volk_gnsssdr_get_alignment()));
+    d_initial_interp_counter = static_cast<unsigned*>(volk_gnsssdr_malloc(
+            n_correlators * sizeof(unsigned), volk_gnsssdr_get_alignment()));
+
     d_local_code_in = nullptr;
     d_shifts_chips = nullptr;
     d_corr_out = nullptr;
     d_code_length_chips = 0;
-    d_n_correlators = 0;
+    d_rem_code_phase_chips = 0;
+    d_code_phase_step_chips = 0;
+    d_rem_carrier_phase_in_rad = 0;
+    d_phase_step_rad = 0;
+    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;
 }
 
 
 fpga_multicorrelator_8sc::~fpga_multicorrelator_8sc()
 {
-    close(d_fd);
+    close(d_device_descriptor);
 }
 
 
@@ -197,24 +208,35 @@ 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;
 
-    snprintf(d_device_io_name, MAX_LENGTH_DEVICEIO_NAME, "/dev/uio%d",d_channel);
-    printf("Opening Device Name : %s\n", d_device_io_name);
+    // open the device corresponding to the assigned channel
+    std::string mergedname;
+    std::stringstream devicebasetemp;
 
-    if ((d_fd = open(d_device_io_name, O_RDWR | O_SYNC )) == -1)
+    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" << d_device_io_name;
+            LOG(WARNING) << "Cannot open deviceio" << device_io_name;
         }
-    d_map_base = (volatile unsigned *)mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, d_fd,0);
 
-    if (d_map_base == (void *) -1)
+    d_map_base = reinterpret_cast<volatile unsigned *>(mmap(NULL, PAGE_SIZE,
+            PROT_READ | PROT_WRITE, MAP_SHARED, d_device_descriptor, 0));
+
+    if (d_map_base == reinterpret_cast<void*>(-1))
         {
-            LOG(WARNING) << "Cannot map the FPGA tracking module " << d_channel << "into user memory";
+            LOG(WARNING) << "Cannot map the FPGA tracking module "
+                    << d_channel << "into user memory";
         }
 
     // sanity check : check test register
-    unsigned writeval = 0x55AA;
+    unsigned writeval = TEST_REGISTER_TRACK_WRITEVAL;
     unsigned readval;
     readval = fpga_multicorrelator_8sc::fpga_acquisition_test_register(writeval);
     if (writeval != readval)
@@ -225,11 +247,11 @@ void fpga_multicorrelator_8sc::set_channel(unsigned int channel)
         {
             LOG(INFO) << "Test register sanity check success !";
         }
-
 }
 
 
-unsigned fpga_multicorrelator_8sc::fpga_acquisition_test_register(unsigned writeval)
+unsigned fpga_multicorrelator_8sc::fpga_acquisition_test_register(
+        unsigned writeval)
 {
     unsigned readval;
     // write value to test register
@@ -243,68 +265,59 @@ unsigned fpga_multicorrelator_8sc::fpga_acquisition_test_register(unsigned write
 
 void fpga_multicorrelator_8sc::fpga_configure_tracking_gps_local_code(void)
 {
-    int k,s;
-    unsigned temp;
-    unsigned *ena_write_signals;
-    ena_write_signals = new unsigned[d_n_correlators];
-    ena_write_signals[0] = 0x00000000;
-    ena_write_signals[1] = 0x20000000;
-    for (s = 2; s < d_n_correlators; s++)
-        {
-            ena_write_signals[s]= ena_write_signals[s-1]*2; //0x40000000;
-        }
+    int k, s;
+    unsigned code_chip;
+    unsigned select_fpga_correlator;
+
+    select_fpga_correlator = 0;
 
     for (s = 0; s < d_n_correlators; s++)
         {
-            // clear memory address counter
-            d_map_base[11] = 0x10000000;
-            // write correlator 0
+            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)
                         {
-                            temp = 1;
+                            code_chip = 1;
                         }
                     else
                         {
-                            temp = 0;
+                            code_chip = 0;
                         }
-                    d_map_base[11] = 0x0C000000 | (temp & 0xFFFF) | ena_write_signals[s];
+                    // 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;
                 }
+            select_fpga_correlator = select_fpga_correlator
+                    + LOCAL_CODE_FPGA_CORRELATOR_SELECT_COUNT;
         }
-
-    delete [] ena_write_signals;
 }
 
 
 void fpga_multicorrelator_8sc::fpga_compute_code_shift_parameters(void)
 {
-    float tempvalues[3];
-    float tempvalues2[3];
-    float tempvalues3[3];
+    float temp_calculation;
     int i;
 
     for (i = 0; i < d_n_correlators; i++)
         {
             // initial index calculation
-            tempvalues[i] = floor(d_shifts_chips[i] + d_rem_code_phase_chips);
-            if (tempvalues[i] < 0)
+            temp_calculation = floor(
+                    d_shifts_chips[i] + d_rem_code_phase_chips);
+            if (temp_calculation < 0)
                 {
-                    tempvalues2[i] = tempvalues[i] + 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
                 }
-            else
-                {
-                    tempvalues2[i] = tempvalues[i];
-                }
-            d_initial_index[i] = (unsigned) ((int) tempvalues2[i]) % d_code_length_chips;
+            d_initial_index[i] = static_cast<unsigned>( (static_cast<int>(temp_calculation)) % d_code_length_chips);
 
             // initial interpolator counter calculation
-            tempvalues3[i] = fmod(d_shifts_chips[i]+ d_rem_code_phase_chips,1.0);
-            if (tempvalues3[i] < 0)
+            temp_calculation = fmod(d_shifts_chips[i] + d_rem_code_phase_chips,
+                    1.0);
+            if (temp_calculation < 0)
                 {
-                    tempvalues3[i] = tempvalues3[i] + 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] = (unsigned) floor(MAX_CODE_RESAMPLER_COUNTER * tempvalues3[i]);
+            d_initial_interp_counter[i] = static_cast<unsigned>( floor( MAX_CODE_RESAMPLER_COUNTER * temp_calculation));
         }
 }
 
@@ -314,7 +327,7 @@ void fpga_multicorrelator_8sc::fpga_configure_code_parameters_in_fpga(void)
     int i;
     for (i = 0; i < d_n_correlators; i++)
         {
-            d_map_base[1+i] = d_initial_index[i];
+            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
@@ -325,28 +338,33 @@ 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 = (unsigned) roundf(MAX_CODE_RESAMPLER_COUNTER * d_code_phase_step_chips);
+    d_code_phase_step_chips_num = static_cast<unsigned>( 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)
+    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 = (int) 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<int>( 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 = (int) 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<int>( 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)
         {
@@ -361,7 +379,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[12] = 0; // lock the channel
     d_map_base[13] = d_initial_sample_counter;
 }
 
@@ -370,7 +387,7 @@ void fpga_multicorrelator_8sc::fpga_launch_multicorrelator_fpga(void)
 {
     // enable interrupts
     int reenable = 1;
-    write(d_fd, (void *)&reenable, sizeof(int));
+    write(d_device_descriptor, reinterpret_cast<void*>(&reenable), sizeof(int));
 
     d_map_base[14] = 0; // writing anything to reg 14 launches the tracking
 }
@@ -378,39 +395,28 @@ void fpga_multicorrelator_8sc::fpga_launch_multicorrelator_fpga(void)
 
 void fpga_multicorrelator_8sc::read_tracking_gps_results(void)
 {
-    int *readval_real;
-    int *readval_imag;
+    int readval_real;
+    int readval_imag;
     int k;
-    readval_real = new int[d_n_correlators];
-    readval_imag = new int[d_n_correlators];
-
-    for (k =0 ; k < d_n_correlators; k++)
-        {
-            readval_real[k] = d_map_base[1 + k];
-            if (readval_real[k] >= 1048576)  // 0x100000 (21 bits two's complement)
-                {
-                    readval_real[k] = -2097152 + readval_real[k];
-                }
-            readval_real[k] = readval_real[k] * 2; // the results are shifted two bits to the left due to the complex multiplier in the FPGA
-
-        }
-    for (k = 0; k < d_n_correlators; k++)
-        {
-            readval_imag[k] = d_map_base[1 + d_n_correlators + k];
-            if (readval_imag[k] >= 1048576) // 0x100000 (21 bits two's complement)
-                {
-                    readval_imag[k] = -2097152 + readval_imag[k];
-                }
-            readval_imag[k] = readval_imag[k] * 2; // the results are shifted two bits to the left due to the complex multiplier in the FPGA
-        }
 
     for (k = 0; k < d_n_correlators; k++)
         {
-            d_corr_out[k] = lv_cmake(readval_real[k], readval_imag[k]);
-        }
+            readval_real = d_map_base[1 + k];
+            if (readval_real >= 1048576) // 0x100000 (21 bits two's complement)
+                {
+                    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
 
-    delete[] readval_real;
-    delete[] readval_imag;
+            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] = lv_cmake(readval_real, readval_imag);
+        }
 }
 
 
@@ -419,3 +425,11 @@ 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
 }
+
+
+void fpga_multicorrelator_8sc::lock_channel(void)
+{
+    // lock the channel for processing
+    d_map_base[12] = 0; // lock the channel
+}
+
diff --git a/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.h b/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.h
index 0655b26e0..801ae5332 100644
--- a/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.h
+++ b/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.h
@@ -39,7 +39,6 @@
 
 #include <volk_gnsssdr/volk_gnsssdr.h>
 
-
 #define MAX_LENGTH_DEVICEIO_NAME 50
 
 /*!
@@ -48,17 +47,20 @@
 class fpga_multicorrelator_8sc
 {
 public:
-    fpga_multicorrelator_8sc();
-    ~fpga_multicorrelator_8sc();
-    bool init(int n_correlators);
-    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);
-    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();
+    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);
+    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);
+    void lock_channel(void);
+    void unlock_channel(void);
 
 private:
     const lv_16sc_t *d_local_code_in;
@@ -68,38 +70,45 @@ private:
     int d_n_correlators;
 
     // data related to the hardware module and the driver
-    char d_device_io_name[MAX_LENGTH_DEVICEIO_NAME];  // driver io name
-    int d_fd;                                         // 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;
     float d_rem_carrier_phase_in_rad;
     float d_phase_step_rad;
-    
+
     // configuration data computed in the format that the FPGA expects
-    unsigned *d_initial_index; 
-    unsigned *d_initial_interp_counter; 
+    unsigned *d_initial_index;
+    unsigned *d_initial_interp_counter;
     unsigned d_code_phase_step_chips_num;
     int d_rem_carr_phase_rad_int;
     int d_phase_step_rad_int;
     unsigned d_initial_sample_counter;
 
+    // driver
+    std::string d_device_name;
+    unsigned int d_device_base;
+
+    // results
+    //int *d_readval_real;
+    //int *d_readval_imag;
     // FPGA private functions
     unsigned fpga_acquisition_test_register(unsigned writeval);
-    void fpga_configure_tracking_gps_local_code(void); 
+    void fpga_configure_tracking_gps_local_code(void);
     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 unlock_channel(void);
+
 };
 
-
 #endif /* GNSS_SDR_FPGA_MULTICORRELATOR_H_ */
diff --git a/src/algorithms/tracking/libs/tcp_communication.cc b/src/algorithms/tracking/libs/tcp_communication.cc
index be9022f53..757562d30 100644
--- a/src/algorithms/tracking/libs/tcp_communication.cc
+++ b/src/algorithms/tracking/libs/tcp_communication.cc
@@ -67,7 +67,7 @@ int tcp_communication::listen_tcp_connection(size_t d_port_, size_t d_port_ch0_)
             std::cout << "Socket accepted on port " << d_port_ << std::endl;
     }
 
-    catch(std::exception& e)
+    catch(const std::exception& e)
     {
             std::cerr << "Exception: " << e.what() << std::endl;
     }
@@ -102,7 +102,7 @@ void tcp_communication::send_receive_tcp_packet_galileo_e1(boost::array<float, N
             tcp_data_->proc_pack_carrier_doppler_hz = readbuf.data()[3];
     }
 
-    catch(std::exception& e)
+    catch(const std::exception& e)
     {
             std::cerr << "Exception: " << e.what() << ". Please press Ctrl+C to end the program." << std::endl;
             std::cin >> controlc;
@@ -137,7 +137,7 @@ void tcp_communication::send_receive_tcp_packet_gps_l1_ca(boost::array<float, NU
             tcp_data_->proc_pack_carrier_doppler_hz = readbuf.data()[3];
     }
 
-    catch(std::exception& e)
+    catch(const std::exception& e)
     {
             std::cerr << "Exception: " << e.what() << ". Please press Ctrl+C to end the program." << std::endl;
             std::cin >> controlc;
diff --git a/src/core/interfaces/telemetry_decoder_interface.h b/src/core/interfaces/telemetry_decoder_interface.h
index 5b43794a8..4aac3a694 100644
--- a/src/core/interfaces/telemetry_decoder_interface.h
+++ b/src/core/interfaces/telemetry_decoder_interface.h
@@ -52,7 +52,7 @@ class TelemetryDecoderInterface : public GNSSBlockInterface
 {
 public:
     virtual void reset() = 0;
-    virtual void set_satellite(Gnss_Satellite sat) = 0;
+    virtual void set_satellite(const Gnss_Satellite & sat) = 0;
     virtual void set_channel(int channel) = 0;
 };
 
diff --git a/src/core/libs/CMakeLists.txt b/src/core/libs/CMakeLists.txt
index 11c71cedf..d99bdbde6 100644
--- a/src/core/libs/CMakeLists.txt
+++ b/src/core/libs/CMakeLists.txt
@@ -30,7 +30,7 @@ set(CORE_LIBS_SOURCES
 )
 	
 include_directories(
-    $(CMAKE_CURRENT_SOURCE_DIR)
+    ${CMAKE_CURRENT_SOURCE_DIR}
     ${CMAKE_SOURCE_DIR}/src/core/system_parameters
     ${CMAKE_SOURCE_DIR}/src/core/libs/supl
     ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp
diff --git a/src/core/libs/INIReader.cc b/src/core/libs/INIReader.cc
index 0e3af9242..e5c7e6645 100644
--- a/src/core/libs/INIReader.cc
+++ b/src/core/libs/INIReader.cc
@@ -45,32 +45,34 @@
  * -------------------------------------------------------------------------
  */
 
-#include <cctype>
-#include <cstdlib>
-#include "ini.h"
 #include "INIReader.h"
+#include <cctype> // for tolower
+#include <cstdlib> // for strol
+#include "ini.h"
 
-using std::string;
 
-INIReader::INIReader(string filename)
+INIReader::INIReader(std::string filename)
 {
     _error = ini_parse(filename.c_str(), ValueHandler, this);
 }
 
+
 int INIReader::ParseError()
 {
     return _error;
 }
 
-string INIReader::Get(string section, string name, string default_value)
+
+std::string INIReader::Get(std::string section, std::string name, std::string default_value)
 {
-    string key = MakeKey(section, name);
+    std::string key = MakeKey(section, name);
     return _values.count(key) ? _values[key] : default_value;
 }
 
-long INIReader::GetInteger(string section, string name, long default_value)
+
+long INIReader::GetInteger(std::string section, std::string name, long default_value)
 {
-    string valstr = Get(section, name, "");
+    std::string valstr = Get(section, name, "");
     const char* value = valstr.c_str();
     char* end;
     // This parses "1234" (decimal) and also "0x4D2" (hex)
@@ -78,19 +80,21 @@ long INIReader::GetInteger(string section, string name, long default_value)
     return end > value ? n : default_value;
 }
 
-string INIReader::MakeKey(string section, string name)
+
+std::string INIReader::MakeKey(std::string section, std::string name)
 {
-    string key = section + "." + name;
+    std::string key = section + "." + name;
     // Convert to lower case to make lookups case-insensitive
     for (unsigned int i = 0; i < key.length(); i++)
         key[i] = tolower(key[i]);
     return key;
 }
 
+
 int INIReader::ValueHandler(void* user, const char* section, const char* name,
                             const char* value)
 {
-    INIReader* reader = (INIReader*)user;
+    INIReader* reader = static_cast<INIReader*>(user);
     reader->_values[MakeKey(section, name)] = value;
     return 1;
 }
diff --git a/src/core/libs/gnss_sdr_supl_client.cc b/src/core/libs/gnss_sdr_supl_client.cc
index 225d3e731..fa528f653 100644
--- a/src/core/libs/gnss_sdr_supl_client.cc
+++ b/src/core/libs/gnss_sdr_supl_client.cc
@@ -201,39 +201,39 @@ void gnss_sdr_supl_client::read_supl_data()
     if (assist.set & SUPL_RRLP_ASSIST_REFTIME)
         {
             /* TS 44.031: GPSTOW, range 0-604799.92, resolution 0.08 sec, 23-bit presentation */
-            gps_time.d_TOW = ((double)assist.time.gps_tow)*0.08;
-            gps_time.d_Week = (double)assist.time.gps_week;
-            gps_time.d_tv_sec = (double)assist.time.stamp.tv_sec;
-            gps_time.d_tv_usec = (double)assist.time.stamp.tv_usec;
+            gps_time.d_TOW = static_cast<double>(assist.time.gps_tow) * 0.08;
+            gps_time.d_Week = static_cast<double>(assist.time.gps_week);
+            gps_time.d_tv_sec = static_cast<double>(assist.time.stamp.tv_sec);
+            gps_time.d_tv_usec = static_cast<double>(assist.time.stamp.tv_usec);
             gps_time.valid = true;
         }
 
     // READ UTC MODEL
     if (assist.set & SUPL_RRLP_ASSIST_UTC)
         {
-            gps_utc.d_A0 = ((double)assist.utc.a0)*pow(2.0, -30);
-            gps_utc.d_A1 = ((double)assist.utc.a1)*pow(2.0, -50);
-            gps_utc.d_DeltaT_LS = ((double)assist.utc.delta_tls);
-            gps_utc.d_DeltaT_LSF = ((double)assist.utc.delta_tlsf);
-            gps_utc.d_t_OT = ((double)assist.utc.tot)*pow(2.0,12);
-            gps_utc.i_DN = ((double)assist.utc.dn);
-            gps_utc.i_WN_T = ((double)assist.utc.wnt);
-            gps_utc.i_WN_LSF = ((double)assist.utc.wnlsf);
+            gps_utc.d_A0 = static_cast<double>(assist.utc.a0) * pow(2.0, -30);
+            gps_utc.d_A1 = static_cast<double>(assist.utc.a1) * pow(2.0, -50);
+            gps_utc.d_DeltaT_LS = static_cast<double>(assist.utc.delta_tls);
+            gps_utc.d_DeltaT_LSF = static_cast<double>(assist.utc.delta_tlsf);
+            gps_utc.d_t_OT = static_cast<double>(assist.utc.tot) * pow(2.0,12);
+            gps_utc.i_DN = static_cast<double>(assist.utc.dn);
+            gps_utc.i_WN_T = static_cast<double>(assist.utc.wnt);
+            gps_utc.i_WN_LSF = static_cast<double>(assist.utc.wnlsf);
             gps_utc.valid = true;
         }
 
     // READ IONOSPHERIC MODEL
     if (assist.set & SUPL_RRLP_ASSIST_IONO)
         {
-            gps_iono.d_alpha0 = (double)assist.iono.a0 * ALPHA_0_LSB;
-            gps_iono.d_alpha1 = (double)assist.iono.a1 * ALPHA_1_LSB;
-            gps_iono.d_alpha2 = (double)assist.iono.a2 * ALPHA_2_LSB;
-            gps_iono.d_alpha3 = (double)assist.iono.a3 * ALPHA_3_LSB;
+            gps_iono.d_alpha0 = static_cast<double>(assist.iono.a0) * ALPHA_0_LSB;
+            gps_iono.d_alpha1 = static_cast<double>(assist.iono.a1) * ALPHA_1_LSB;
+            gps_iono.d_alpha2 = static_cast<double>(assist.iono.a2) * ALPHA_2_LSB;
+            gps_iono.d_alpha3 = static_cast<double>(assist.iono.a3) * ALPHA_3_LSB;
 
-            gps_iono.d_beta0 = (double)assist.iono.b0 * BETA_0_LSB;
-            gps_iono.d_beta1 = (double)assist.iono.b1 * BETA_1_LSB;
-            gps_iono.d_beta2 = (double)assist.iono.b2 * BETA_2_LSB;
-            gps_iono.d_beta3 = (double)assist.iono.b3 * BETA_3_LSB;
+            gps_iono.d_beta0 = static_cast<double>(assist.iono.b0) * BETA_0_LSB;
+            gps_iono.d_beta1 = static_cast<double>(assist.iono.b1) * BETA_1_LSB;
+            gps_iono.d_beta2 = static_cast<double>(assist.iono.b2) * BETA_2_LSB;
+            gps_iono.d_beta3 = static_cast<double>(assist.iono.b3) * BETA_3_LSB;
             gps_iono.valid = true;
         }
 
@@ -254,16 +254,16 @@ void gnss_sdr_supl_client::read_supl_data()
                             gps_almanac_iterator = this->gps_almanac_map.find(a->prn);
                         }
                     gps_almanac_iterator->second.i_satellite_PRN = a->prn;
-                    gps_almanac_iterator->second.d_A_f0 = ((double)a->AF0)*pow(2.0, -20);
-                    gps_almanac_iterator->second.d_A_f1 = ((double)a->AF1)*pow(2.0, -38);
-                    gps_almanac_iterator->second.d_Delta_i = ((double)a->Ksii)*pow(2.0, -19);
-                    gps_almanac_iterator->second.d_OMEGA = ((double)a->w)*pow(2.0, -23);
-                    gps_almanac_iterator->second.d_OMEGA0 = ((double)a->OMEGA_0)*pow(2.0, -23);
-                    gps_almanac_iterator->second.d_sqrt_A = ((double)a->A_sqrt)*pow(2.0, -11);
-                    gps_almanac_iterator->second.d_OMEGA_DOT = ((double)a->OMEGA_dot)*pow(2.0, -38);
-                    gps_almanac_iterator->second.d_Toa = ((double)a->toa)*pow(2.0, 12);
-                    gps_almanac_iterator->second.d_e_eccentricity = ((double)a->toa)*pow(2.0, -21);
-                    gps_almanac_iterator->second.d_M_0 = ((double)a->M0)*pow(2.0, -23);
+                    gps_almanac_iterator->second.d_A_f0 = static_cast<double>(a->AF0) * pow(2.0, -20);
+                    gps_almanac_iterator->second.d_A_f1 = static_cast<double>(a->AF1) * pow(2.0, -38);
+                    gps_almanac_iterator->second.d_Delta_i = static_cast<double>(a->Ksii) * pow(2.0, -19);
+                    gps_almanac_iterator->second.d_OMEGA = static_cast<double>(a->w) * pow(2.0, -23);
+                    gps_almanac_iterator->second.d_OMEGA0 = static_cast<double>(a->OMEGA_0) * pow(2.0, -23);
+                    gps_almanac_iterator->second.d_sqrt_A = static_cast<double>(a->A_sqrt) * pow(2.0, -11);
+                    gps_almanac_iterator->second.d_OMEGA_DOT = static_cast<double>(a->OMEGA_dot) * pow(2.0, -38);
+                    gps_almanac_iterator->second.d_Toa = static_cast<double>(a->toa) * pow(2.0, 12);
+                    gps_almanac_iterator->second.d_e_eccentricity = static_cast<double>(a->toa) * pow(2.0, -21);
+                    gps_almanac_iterator->second.d_M_0 = static_cast<double>(a->M0) * pow(2.0, -23);
                 }
         }
 
@@ -288,7 +288,7 @@ void gnss_sdr_supl_client::read_supl_data()
                         {
                             gps_eph_iterator->second.i_GPS_week = assist.time.gps_week;
                             /* TS 44.031: GPSTOW, range 0-604799.92, resolution 0.08 sec, 23-bit presentation */
-                            gps_eph_iterator->second.d_TOW = ((double)assist.time.gps_tow)*0.08;
+                            gps_eph_iterator->second.d_TOW = static_cast<double>(assist.time.gps_tow) * 0.08;
                         }
                     else
                         {
@@ -300,32 +300,32 @@ void gnss_sdr_supl_client::read_supl_data()
                     gps_eph_iterator->second.i_code_on_L2 = e->bits;
                     gps_eph_iterator->second.i_SV_accuracy = e->ura; //User Range Accuracy (URA)
                     gps_eph_iterator->second.i_SV_health = e->health;
-                    gps_eph_iterator->second.d_IODC = (double)e->IODC;
+                    gps_eph_iterator->second.d_IODC = static_cast<double>(e->IODC);
                     //miss P flag (1 bit)
                     //miss SF1 Reserved (87 bits)
-                    gps_eph_iterator->second.d_TGD = ((double)e->tgd)*T_GD_LSB;
-                    gps_eph_iterator->second.d_Toc = ((double)e->toc)*T_OC_LSB;
-                    gps_eph_iterator->second.d_A_f0 = ((double)e->AF0)*A_F0_LSB;
-                    gps_eph_iterator->second.d_A_f1 = ((double)e->AF1)*A_F1_LSB;
-                    gps_eph_iterator->second.d_A_f2 = ((double)e->AF2)*A_F2_LSB;
-                    gps_eph_iterator->second.d_Crc = ((double)e->Crc)*C_RC_LSB;
-                    gps_eph_iterator->second.d_Delta_n = ((double)e->delta_n)*DELTA_N_LSB;
-                    gps_eph_iterator->second.d_M_0 = ((double)e->M0)*M_0_LSB;
-                    gps_eph_iterator->second.d_Cuc = ((double)e->Cuc)*C_UC_LSB;
-                    gps_eph_iterator->second.d_e_eccentricity = ((double)e->e)*E_LSB;
-                    gps_eph_iterator->second.d_Cus = ((double)e->Cus)*C_US_LSB;
-                    gps_eph_iterator->second.d_sqrt_A = ((double)e->A_sqrt)*SQRT_A_LSB;
-                    gps_eph_iterator->second.d_Toe = ((double)e->toe)*T_OE_LSB;
+                    gps_eph_iterator->second.d_TGD = static_cast<double>(e->tgd) * T_GD_LSB;
+                    gps_eph_iterator->second.d_Toc = static_cast<double>(e->toc) * T_OC_LSB;
+                    gps_eph_iterator->second.d_A_f0 = static_cast<double>(e->AF0) * A_F0_LSB;
+                    gps_eph_iterator->second.d_A_f1 = static_cast<double>(e->AF1) * A_F1_LSB;
+                    gps_eph_iterator->second.d_A_f2 = static_cast<double>(e->AF2) * A_F2_LSB;
+                    gps_eph_iterator->second.d_Crc = static_cast<double>(e->Crc) * C_RC_LSB;
+                    gps_eph_iterator->second.d_Delta_n = static_cast<double>(e->delta_n) * DELTA_N_LSB;
+                    gps_eph_iterator->second.d_M_0 = static_cast<double>(e->M0) * M_0_LSB;
+                    gps_eph_iterator->second.d_Cuc = static_cast<double>(e->Cuc) * C_UC_LSB;
+                    gps_eph_iterator->second.d_e_eccentricity = static_cast<double>(e->e) * E_LSB;
+                    gps_eph_iterator->second.d_Cus = static_cast<double>(e->Cus) * C_US_LSB;
+                    gps_eph_iterator->second.d_sqrt_A = static_cast<double>(e->A_sqrt) * SQRT_A_LSB;
+                    gps_eph_iterator->second.d_Toe = static_cast<double>(e->toe) * T_OE_LSB;
                     //miss fit interval flag (1 bit)
                     gps_eph_iterator->second.i_AODO = e->AODA * AODO_LSB;
-                    gps_eph_iterator->second.d_Cic = ((double)e->Cic)*C_IC_LSB;
-                    gps_eph_iterator->second.d_OMEGA0 = ((double)e->OMEGA_0)*OMEGA_0_LSB;
-                    gps_eph_iterator->second.d_Cis = ((double)e->Cis)*C_IS_LSB;
-                    gps_eph_iterator->second.d_i_0 = ((double)e->i0)*I_0_LSB;
-                    gps_eph_iterator->second.d_Crs = ((double)e->Crs)*C_RS_LSB;
-                    gps_eph_iterator->second.d_OMEGA = ((double)e->w)*OMEGA_LSB;
-                    gps_eph_iterator->second.d_OMEGA_DOT = (double)e->OMEGA_dot*OMEGA_DOT_LSB;
-                    gps_eph_iterator->second.d_IDOT = ((double)e->i_dot)*I_DOT_LSB;
+                    gps_eph_iterator->second.d_Cic = static_cast<double>(e->Cic) * C_IC_LSB;
+                    gps_eph_iterator->second.d_OMEGA0 = static_cast<double>(e->OMEGA_0) * OMEGA_0_LSB;
+                    gps_eph_iterator->second.d_Cis = static_cast<double>(e->Cis) * C_IS_LSB;
+                    gps_eph_iterator->second.d_i_0 = static_cast<double>(e->i0) * I_0_LSB;
+                    gps_eph_iterator->second.d_Crs = static_cast<double>(e->Crs) * C_RS_LSB;
+                    gps_eph_iterator->second.d_OMEGA = static_cast<double>(e->w) * OMEGA_LSB;
+                    gps_eph_iterator->second.d_OMEGA_DOT = static_cast<double>(e->OMEGA_dot) * OMEGA_DOT_LSB;
+                    gps_eph_iterator->second.d_IDOT = static_cast<double>(e->i_dot) * I_DOT_LSB;
                 }
         }
 
@@ -348,16 +348,16 @@ void gnss_sdr_supl_client::read_supl_data()
                         }
                     // fill the acquisition assistance structure
                     gps_acq_iterator->second.i_satellite_PRN = e->prn;
-                    gps_acq_iterator->second.d_TOW = (double)assist.acq_time;
-                    gps_acq_iterator->second.d_Doppler0 = (double)e->doppler0;
-                    gps_acq_iterator->second.d_Doppler1 = (double)e->doppler1;
-                    gps_acq_iterator->second.dopplerUncertainty = (double)e->d_win;
-                    gps_acq_iterator->second.Code_Phase = (double)e->code_ph;
-                    gps_acq_iterator->second.Code_Phase_int = (double)e->code_ph_int;
-                    gps_acq_iterator->second.Code_Phase_window = (double)e->code_ph_win;
-                    gps_acq_iterator->second.Azimuth = (double)e->az;
-                    gps_acq_iterator->second.Elevation = (double)e->el;
-                    gps_acq_iterator->second.GPS_Bit_Number = (double)e->bit_num;
+                    gps_acq_iterator->second.d_TOW = static_cast<double>(assist.acq_time);
+                    gps_acq_iterator->second.d_Doppler0 = static_cast<double>(e->doppler0);
+                    gps_acq_iterator->second.d_Doppler1 = static_cast<double>(e->doppler1);
+                    gps_acq_iterator->second.dopplerUncertainty = static_cast<double>(e->d_win);
+                    gps_acq_iterator->second.Code_Phase = static_cast<double>(e->code_ph);
+                    gps_acq_iterator->second.Code_Phase_int = static_cast<double>(e->code_ph_int);
+                    gps_acq_iterator->second.Code_Phase_window = static_cast<double>(e->code_ph_win);
+                    gps_acq_iterator->second.Azimuth = static_cast<double>(e->az);
+                    gps_acq_iterator->second.Elevation = static_cast<double>(e->el);
+                    gps_acq_iterator->second.GPS_Bit_Number = static_cast<double>(e->bit_num);
                 }
         }
 }
diff --git a/src/core/libs/ini.cc b/src/core/libs/ini.cc
index 1e125bab7..459ac962d 100644
--- a/src/core/libs/ini.cc
+++ b/src/core/libs/ini.cc
@@ -53,11 +53,11 @@
  * -------------------------------------------------------------------------
  */
 
-#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
-
 #include "ini.h"
+#include <cctype>
+#include <fstream>
+#include <string>
+
 
 #define MAX_LINE 200
 #define MAX_SECTION 50
@@ -66,33 +66,36 @@
 /* Strip whitespace chars off end of given string, in place. Return s. */
 static char* rstrip(char* s)
 {
-    char* p = s + strlen(s);
+    char* p = s + std::char_traits<char>::length(s);
     while (p > s && isspace(*--p))
         *p = '\0';
     return s;
 }
 
 /* Return pointer to first non-whitespace char in given string. */
-static char* lskip(const char* s)
+static char* lskip(char* s)
 {
     while (*s && isspace(*s))
         s++;
-    return (char*)s;
+    return static_cast<char*>(s);
 }
 
 /* Return pointer to first char c or ';' in given string, or pointer to
    null at end of string if neither found. */
-static char* find_char_or_comment(const char* s, char c)
+static char* find_char_or_comment(char* s, char c)
 {
     while (*s && *s != c && *s != ';')
         s++;
-    return (char*)s;
+    return static_cast<char*>(s);
 }
 
 /* Version of strncpy that ensures dest (size bytes) is null-terminated. */
 static char* strncpy0(char* dest, const char* src, size_t size)
 {
-    strncpy(dest, src, size);
+    for(unsigned int i = 0; i < size - 1; i++)
+        {
+            dest[i] = src[i];
+        }
     dest[size - 1] = '\0';
     return dest;
 }
@@ -107,70 +110,88 @@ int ini_parse(const char* filename,
     char section[MAX_SECTION] = "";
     char prev_name[MAX_NAME] = "";
 
-    FILE* file;
+    std::ifstream file;
     char* start;
     char* end;
     char* name;
     char* value;
     int lineno = 0;
     int error = 0;
+    std::string line_str;
 
-    file = fopen(filename, "r");
-    if (!file)
+    file.open(filename, std::fstream::in);
+    if (!file.is_open())
         return -1;
 
     /* Scan through file line by line */
-    while (fgets(line, sizeof(line), file) != NULL) {
-        lineno++;
-        start = lskip(rstrip(line));
+    while (std::getline(file, line_str))
+        {
+            lineno++;
+            int len_str = line_str.length();
+            const char * read_line = line_str.data();
+            if (len_str > (MAX_LINE - 1)) len_str = MAX_LINE - 1;
+            int i;
+            for(i = 0; i < len_str; i++)
+                {
+                    line[i] = read_line[i];
+                }
+            line[len_str] = '\0';
+            start = lskip(rstrip(line));
 
 #if INI_ALLOW_MULTILINE
-        if (*prev_name && *start && start > line) {
-            /* Non-black line with leading whitespace, treat as continuation
-               of previous name's value (as per Python ConfigParser). */
-            if (!handler(user, section, prev_name, start) && !error)
-                error = lineno;
-        }
-        else
-#endif
-        if (*start == '[') {
-            /* A "[section]" line */
-            end = find_char_or_comment(start + 1, ']');
-            if (*end == ']') {
-                *end = '\0';
-                strncpy0(section, start + 1, sizeof(section));
-                *prev_name = '\0';
-            }
-            else if (!error) {
-                /* No ']' found on section line */
-                error = lineno;
-            }
-        }
-        else if (*start && *start != ';') {
-            /* Not a comment, must be a name=value pair */
-            end = find_char_or_comment(start, '=');
-            if (*end == '=') {
-                *end = '\0';
-                name = rstrip(start);
-                value = lskip(end + 1);
-                end = find_char_or_comment(value, ';');
-                if (*end == ';')
-                    *end = '\0';
-                rstrip(value);
-
-                /* Valid name=value pair found, call handler */
-                strncpy0(prev_name, name, sizeof(prev_name));
-                if (!handler(user, section, name, value) && !error)
+        if (*prev_name && *start && start > line)
+            {
+                /* Non-black line with leading whitespace, treat as continuation
+                of previous name's value (as per Python ConfigParser). */
+                if (!handler(user, section, prev_name, start) && !error)
                     error = lineno;
             }
-            else if (!error) {
-                /* No '=' found on name=value line */
-                error = lineno;
-            }
-        }
-    }
+        else
+#endif
+            if (*start == '[')
+                {
+                    /* A "[section]" line */
+                    end = find_char_or_comment(start + 1, ']');
+                    if (*end == ']')
+                        {
+                            *end = '\0';
+                            strncpy0(section, start + 1, sizeof(section));
+                            *prev_name = '\0';
+                        }
+                    else if (!error)
+                        {
+                            /* No ']' found on section line */
+                            error = lineno;
+                        }
+                }
+            else if (*start && *start != ';')
+                {
+                    /* Not a comment, must be a name=value pair */
+                    end = find_char_or_comment(start, '=');
+                    if (*end == '=')
+                        {
+                            *end = '\0';
+                            name = rstrip(start);
+                            value = lskip(end + 1);
+                            end = find_char_or_comment(value, ';');
+                            if (*end == ';')
+                                *end = '\0';
+                            rstrip(value);
 
-    fclose(file);
+                            /* Valid name=value pair found, call handler */
+                            strncpy0(prev_name, name, sizeof(prev_name));
+                            if (!handler(user, section, name, value) && !error)
+                                error = lineno;
+                        }
+                    else if (!error)
+                        {
+                            /* No '=' found on name=value line */
+                            error = lineno;
+                        }
+                }
+        }
+
+    file.close();
 
     return error;
 }
diff --git a/src/core/libs/ini.h b/src/core/libs/ini.h
index 2fa9e5251..45f1f33d2 100644
--- a/src/core/libs/ini.h
+++ b/src/core/libs/ini.h
@@ -53,13 +53,9 @@
  * -------------------------------------------------------------------------
  */
 
-#ifndef __INI_H__
-#define __INI_H__
+#ifndef GNSS_SDR_INI_H_
+#define GNSS_SDR_INI_H_
 
-/* Make this header file easier to include in C++ code */
-#ifdef __cplusplus
-extern "C" {
-#endif
 
 /* Parse given INI-style file. May have [section]s, name=value pairs
    (whitespace stripped), and comments starting with ';' (semicolon). Section
@@ -84,8 +80,5 @@ int ini_parse(const char* filename,
 #define INI_ALLOW_MULTILINE 1
 #endif
 
-#ifdef __cplusplus
-}
-#endif
 
-#endif /* __INI_H__ */
+#endif  // GNSS_SDR_INI_H_
diff --git a/src/core/libs/supl/asn-rrlp/NativeInteger.c b/src/core/libs/supl/asn-rrlp/NativeInteger.c
index abdb71a8c..bf3939e88 100644
--- a/src/core/libs/supl/asn-rrlp/NativeInteger.c
+++ b/src/core/libs/supl/asn-rrlp/NativeInteger.c
@@ -107,7 +107,7 @@ NativeInteger_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
 		tmp.size = length;
 
 		if((specs&&specs->field_unsigned)
-			? asn_INTEGER2ulong(&tmp, &l)
+			? asn_INTEGER2ulong(&tmp, (unsigned long*)&l)
 			: asn_INTEGER2long(&tmp, &l)) {
 			rval.code = RC_FAIL;
 			rval.consumed = 0;
@@ -187,7 +187,7 @@ NativeInteger_decode_xer(asn_codec_ctx_t *opt_codec_ctx,
 	if(rval.code == RC_OK) {
 		long l;
 		if((specs&&specs->field_unsigned)
-			? asn_INTEGER2ulong(&st, &l)
+			? asn_INTEGER2ulong(&st, (unsigned long*)&l)
 			: asn_INTEGER2long(&st, &l)) {
 			rval.code = RC_FAIL;
 			rval.consumed = 0;
@@ -255,7 +255,7 @@ NativeInteger_decode_uper(asn_codec_ctx_t *opt_codec_ctx,
 				   &tmpintptr, pd);
 	if(rval.code == RC_OK) {
 		if((specs&&specs->field_unsigned)
-			? asn_INTEGER2ulong(&tmpint, native)
+			? asn_INTEGER2ulong(&tmpint, (unsigned long*)native)
 			: asn_INTEGER2long(&tmpint, native))
 			rval.code = RC_FAIL;
 		else
diff --git a/src/core/libs/supl/asn-rrlp/constr_SET_OF.c b/src/core/libs/supl/asn-rrlp/constr_SET_OF.c
index 11eac57a2..0bc891abf 100644
--- a/src/core/libs/supl/asn-rrlp/constr_SET_OF.c
+++ b/src/core/libs/supl/asn-rrlp/constr_SET_OF.c
@@ -915,7 +915,7 @@ SET_OF_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
 			nelems = uper_get_length(pd,
 				ct ? ct->effective_bits : -1, &repeat);
 			ASN_DEBUG("Got to decode %d elements (eff %d)",
-				(int)nelems, (int)ct ? ct->effective_bits : -1);
+				(int)nelems, (long)ct ? ct->effective_bits : -1);
 			if(nelems < 0) _ASN_DECODE_STARVED;
 		}
 
diff --git a/src/core/libs/supl/asn-rrlp/converter-sample.c b/src/core/libs/supl/asn-rrlp/converter-sample.c
index 0a682a275..13baad2e7 100644
--- a/src/core/libs/supl/asn-rrlp/converter-sample.c
+++ b/src/core/libs/supl/asn-rrlp/converter-sample.c
@@ -384,7 +384,7 @@ buffer_dump() {
 			(long)DynamicBuffer.length - 1,
 			(long)8 - DynamicBuffer.unbits);
 	} else {
-		fprintf(stderr, " %d\n", DynamicBuffer.length);
+		fprintf(stderr, " %ld\n", DynamicBuffer.length);
 	}
 }
 
diff --git a/src/core/libs/supl/asn-rrlp/per_support.c b/src/core/libs/supl/asn-rrlp/per_support.c
index e8299c730..02dd02094 100644
--- a/src/core/libs/supl/asn-rrlp/per_support.c
+++ b/src/core/libs/supl/asn-rrlp/per_support.c
@@ -9,26 +9,26 @@
 
 char *
 per_data_string(asn_per_data_t *pd) {
-	static char buf[2][32];
-	static int n;
-	n = (n+1) % 2;
-	snprintf(buf[n], sizeof(buf),
-		"{m=%d span %+d[%d..%d] (%d)}",
-		pd->moved,
-		(((int)pd->buffer) & 0xf),
-		pd->nboff, pd->nbits,
-		pd->nbits - pd->nboff);
-	return buf[n];
+        static char buf[2][32];
+        static int n;
+        n = (n+1) % 2;
+        snprintf(buf[n], sizeof(buf[n]),
+                "{m=%ld span %+ld[%d..%d] (%d)}",
+                (long)pd->moved,
+                (((long)pd->buffer) & 0xf),
+                (int)pd->nboff, (int)pd->nbits,
+                (int)(pd->nbits - pd->nboff));
+        return buf[n];
 }
 
 void
 per_get_undo(asn_per_data_t *pd, int nbits) {
-	if((ssize_t)pd->nboff < nbits) {
-		assert((ssize_t)pd->nboff < nbits);
-	} else {
-		pd->nboff -= nbits;
-		pd->moved -= nbits;
-	}
+        if((ssize_t)pd->nboff < nbits) {
+                assert((ssize_t)pd->nboff < nbits);
+        } else {
+                pd->nboff -= nbits;
+                pd->moved -= nbits;
+        }
 }
 
 /*
@@ -36,83 +36,84 @@ per_get_undo(asn_per_data_t *pd, int nbits) {
  */
 int32_t
 per_get_few_bits(asn_per_data_t *pd, int nbits) {
-	size_t off;	/* Next after last bit offset */
-	ssize_t nleft;	/* Number of bits left in this stream */
-	uint32_t accum;
-	const uint8_t *buf;
+        size_t off;     /* Next after last bit offset */
+        ssize_t nleft;  /* Number of bits left in this stream */
+        uint32_t accum;
+        const uint8_t *buf;
 
-	if(nbits < 0)
-		return -1;
+        if(nbits < 0)
+                return -1;
 
-	nleft = pd->nbits - pd->nboff;
-	if(nbits > nleft) {
-		int32_t tailv, vhead;
-		if(!pd->refill || nbits > 31) return -1;
-		/* Accumulate unused bytes before refill */
-		ASN_DEBUG("Obtain the rest %d bits (want %d)", nleft, nbits);
-		tailv = per_get_few_bits(pd, nleft);
-		if(tailv < 0) return -1;
-		/* Refill (replace pd contents with new data) */
-		if(pd->refill(pd))
-			return -1;
-		nbits -= nleft;
-		vhead = per_get_few_bits(pd, nbits);
-		/* Combine the rest of previous pd with the head of new one */
-		tailv = (tailv << nbits) | vhead;  /* Could == -1 */
-		return tailv;
-	}
+        nleft = pd->nbits - pd->nboff;
+        if(nbits > nleft) {
+                int32_t tailv, vhead;
+                if(!pd->refill || nbits > 31) return -1;
+                /* Accumulate unused bytes before refill */
+                ASN_DEBUG("Obtain the rest %d bits (want %d)",
+                        (int)nleft, (int)nbits);
+                tailv = per_get_few_bits(pd, nleft);
+                if(tailv < 0) return -1;
+                /* Refill (replace pd contents with new data) */
+                if(pd->refill(pd))
+                        return -1;
+                nbits -= nleft;
+                vhead = per_get_few_bits(pd, nbits);
+                /* Combine the rest of previous pd with the head of new one */
+                tailv = (tailv << nbits) | vhead;  /* Could == -1 */
+                return tailv;
+        }
 
-	/*
-	 * Normalize position indicator.
-	 */
-	if(pd->nboff >= 8) {
-		pd->buffer += (pd->nboff >> 3);
-		pd->nbits  -= (pd->nboff & ~0x07);
-		pd->nboff  &= 0x07;
-	}
-	pd->moved += nbits;
-	pd->nboff += nbits;
-	off = pd->nboff;
-	buf = pd->buffer;
+        /*
+         * Normalize position indicator.
+         */
+        if(pd->nboff >= 8) {
+                pd->buffer += (pd->nboff >> 3);
+                pd->nbits  -= (pd->nboff & ~0x07);
+                pd->nboff  &= 0x07;
+        }
+        pd->moved += nbits;
+        pd->nboff += nbits;
+        off = pd->nboff;
+        buf = pd->buffer;
 
-	/*
-	 * Extract specified number of bits.
-	 */
-	if(off <= 8)
-		accum = nbits ? (buf[0]) >> (8 - off) : 0;
-	else if(off <= 16)
-		accum = ((buf[0] << 8) + buf[1]) >> (16 - off);
-	else if(off <= 24)
-		accum = ((buf[0] << 16) + (buf[1] << 8) + buf[2]) >> (24 - off);
-	else if(off <= 31)
-		accum = ((buf[0] << 24) + (buf[1] << 16)
-			+ (buf[2] << 8) + (buf[3])) >> (32 - off);
-	else if(nbits <= 31) {
-		asn_per_data_t tpd = *pd;
-		/* Here are we with our 31-bits limit plus 1..7 bits offset. */
-		per_get_undo(&tpd, nbits);
-		/* The number of available bits in the stream allow
-		 * for the following operations to take place without
-		 * invoking the ->refill() function */
-		accum  = per_get_few_bits(&tpd, nbits - 24) << 24;
-		accum |= per_get_few_bits(&tpd, 24);
-	} else {
-		per_get_undo(pd, nbits);
-		return -1;
-	}
+        /*
+         * Extract specified number of bits.
+         */
+        if(off <= 8)
+                accum = nbits ? (buf[0]) >> (8 - off) : 0;
+        else if(off <= 16)
+                accum = ((buf[0] << 8) + buf[1]) >> (16 - off);
+        else if(off <= 24)
+                accum = ((buf[0] << 16) + (buf[1] << 8) + buf[2]) >> (24 - off);
+        else if(off <= 31)
+                accum = ((buf[0] << 24) + (buf[1] << 16)
+                        + (buf[2] << 8) + (buf[3])) >> (32 - off);
+        else if(nbits <= 31) {
+                asn_per_data_t tpd = *pd;
+                /* Here are we with our 31-bits limit plus 1..7 bits offset. */
+                per_get_undo(&tpd, nbits);
+                /* The number of available bits in the stream allow
+                 * for the following operations to take place without
+                 * invoking the ->refill() function */
+                accum  = per_get_few_bits(&tpd, nbits - 24) << 24;
+                accum |= per_get_few_bits(&tpd, 24);
+        } else {
+                per_get_undo(pd, nbits);
+                return -1;
+        }
 
-	accum &= (((uint32_t)1 << nbits) - 1);
+        accum &= (((uint32_t)1 << nbits) - 1);
 
-	ASN_DEBUG("  [PER got %2d<=%2d bits => span %d %+d[%d..%d]:%02x (%d) => 0x%x]",
-		nbits, nleft,
-		pd->moved,
-		(((int)pd->buffer) & 0xf),
-		pd->nboff, pd->nbits,
-		pd->buffer[0],
-		pd->nbits - pd->nboff,
-		(int)accum);
+        ASN_DEBUG("  [PER got %2d<=%2d bits => span %d %+ld[%d..%d]:%02x (%d) => 0x%x]",
+                (int)nbits, (int)nleft,
+                (int)pd->moved,
+                (((long)pd->buffer) & 0xf),
+                (int)pd->nboff, (int)pd->nbits,
+                ((pd->buffer != NULL)?pd->buffer[0]:0),
+                (int)(pd->nbits - pd->nboff),
+                (int)accum);
 
-	return accum;
+        return accum;
 }
 
 /*
@@ -120,70 +121,76 @@ per_get_few_bits(asn_per_data_t *pd, int nbits) {
  */
 int
 per_get_many_bits(asn_per_data_t *pd, uint8_t *dst, int alright, int nbits) {
-	int32_t value;
+        int32_t value;
 
-	if(alright && (nbits & 7)) {
-		/* Perform right alignment of a first few bits */
-		value = per_get_few_bits(pd, nbits & 0x07);
-		if(value < 0) return -1;
-		*dst++ = value;	/* value is already right-aligned */
-		nbits &= ~7;
-	}
+        if(alright && (nbits & 7)) {
+                /* Perform right alignment of a first few bits */
+                value = per_get_few_bits(pd, nbits & 0x07);
+                if(value < 0) return -1;
+                *dst++ = value; /* value is already right-aligned */
+                nbits &= ~7;
+        }
 
-	while(nbits) {
-		if(nbits >= 24) {
-			value = per_get_few_bits(pd, 24);
-			if(value < 0) return -1;
-			*(dst++) = value >> 16;
-			*(dst++) = value >> 8;
-			*(dst++) = value;
-			nbits -= 24;
-		} else {
-			value = per_get_few_bits(pd, nbits);
-			if(value < 0) return -1;
-			if(nbits & 7) {	/* implies left alignment */
-				value <<= 8 - (nbits & 7),
-				nbits += 8 - (nbits & 7);
-				if(nbits > 24)
-					*dst++ = value >> 24;
-			}
-			if(nbits > 16)
-				*dst++ = value >> 16;
-			if(nbits > 8)
-				*dst++ = value >> 8;
-			*dst++ = value;
-			break;
-		}
-	}
+        while(nbits) {
+                if(nbits >= 24) {
+                        value = per_get_few_bits(pd, 24);
+                        if(value < 0) return -1;
+                        *(dst++) = value >> 16;
+                        *(dst++) = value >> 8;
+                        *(dst++) = value;
+                        nbits -= 24;
+                } else {
+                        value = per_get_few_bits(pd, nbits);
+                        if(value < 0) return -1;
+                        if(nbits & 7) { /* implies left alignment */
+                                value <<= 8 - (nbits & 7),
+                                nbits += 8 - (nbits & 7);
+                                if(nbits > 24)
+                                        *dst++ = value >> 24;
+                        }
+                        if(nbits > 16)
+                                *dst++ = value >> 16;
+                        if(nbits > 8)
+                                *dst++ = value >> 8;
+                        *dst++ = value;
+                        break;
+                }
+        }
 
-	return 0;
+        return 0;
 }
 
 /*
- * Get the length "n" from the stream.
+ * X.691-201508 #10.9 General rules for encoding a length determinant.
+ * Get the optionally constrained length "n" from the stream.
  */
 ssize_t
 uper_get_length(asn_per_data_t *pd, int ebits, int *repeat) {
-	ssize_t value;
+    ssize_t value;
 
-	*repeat = 0;
+    *repeat = 0;
 
-	if(ebits >= 0) return per_get_few_bits(pd, ebits);
+    /* #11.9.4.1 Encoding if constrained (according to effective bits) */
+    if(ebits >= 0 && ebits <= 16) {
+        return per_get_few_bits(pd, ebits);
+    }
 
-	value = per_get_few_bits(pd, 8);
-	if(value < 0) return -1;
-	if((value & 128) == 0)	/* #10.9.3.6 */
-		return (value & 0x7F);
-	if((value & 64) == 0) {	/* #10.9.3.7 */
-		value = ((value & 63) << 8) | per_get_few_bits(pd, 8);
-		if(value < 0) return -1;
-		return value;
-	}
-	value &= 63;	/* this is "m" from X.691, #10.9.3.8 */
-	if(value < 1 || value > 4)
-		return -1;
-	*repeat = 1;
-	return (16384 * value);
+        value = per_get_few_bits(pd, 8);
+    if((value & 0x80) == 0) { /* #11.9.3.6 */
+        return (value & 0x7F);
+    } else if((value & 0x40) == 0) { /* #11.9.3.7 */
+        /* bit 8 ... set to 1 and bit 7 ... set to zero */
+        value = ((value & 0x3f) << 8) | per_get_few_bits(pd, 8);
+        return value; /* potential -1 from per_get_few_bits passes through. */
+    } else if(value < 0) {
+        return -1;
+    }
+    value &= 0x3f; /* this is "m" from X.691, #11.9.3.8 */
+    if(value < 1 || value > 4) {
+        return -1; /* Prohibited by #11.9.3.8 */
+    }
+    *repeat = 1;
+    return (16384 * value);
 }
 
 /*
@@ -193,21 +200,21 @@ uper_get_length(asn_per_data_t *pd, int ebits, int *repeat) {
  */
 ssize_t
 uper_get_nslength(asn_per_data_t *pd) {
-	ssize_t length;
+        ssize_t length;
 
-	ASN_DEBUG("Getting normally small length");
+        ASN_DEBUG("Getting normally small length");
 
-	if(per_get_few_bits(pd, 1) == 0) {
-		length = per_get_few_bits(pd, 6) + 1;
-		if(length <= 0) return -1;
-		ASN_DEBUG("l=%d", length);
-		return length;
-	} else {
-		int repeat;
-		length = uper_get_length(pd, -1, &repeat);
-		if(length >= 0 && !repeat) return length;
-		return -1; /* Error, or do not support >16K extensions */
-	}
+        if(per_get_few_bits(pd, 1) == 0) {
+                length = per_get_few_bits(pd, 6) + 1;
+                if(length <= 0) return -1;
+                ASN_DEBUG("l=%d", (int)length);
+                return length;
+        } else {
+                int repeat;
+                length = uper_get_length(pd, -1, &repeat);
+                if(length >= 0 && !repeat) return length;
+                return -1; /* Error, or do not support >16K extensions */
+        }
 }
 
 /*
@@ -216,135 +223,215 @@ uper_get_nslength(asn_per_data_t *pd) {
  */
 ssize_t
 uper_get_nsnnwn(asn_per_data_t *pd) {
-	ssize_t value;
+        ssize_t value;
 
-	value = per_get_few_bits(pd, 7);
-	if(value & 64) {	/* implicit (value < 0) */
-		value &= 63;
-		value <<= 2;
-		value |= per_get_few_bits(pd, 2);
-		if(value & 128)	/* implicit (value < 0) */
-			return -1;
-		if(value == 0)
-			return 0;
-		if(value >= 3)
-			return -1;
-		value = per_get_few_bits(pd, 8 * value);
-		return value;
-	}
+        value = per_get_few_bits(pd, 7);
+        if(value & 64) {        /* implicit (value < 0) */
+                value &= 63;
+                value <<= 2;
+                value |= per_get_few_bits(pd, 2);
+                if(value & 128) /* implicit (value < 0) */
+                        return -1;
+                if(value == 0)
+                        return 0;
+                if(value >= 3)
+                        return -1;
+                value = per_get_few_bits(pd, 8 * value);
+                return value;
+        }
 
-	return value;
+        return value;
 }
 
 /*
- * Put the normally small non-negative whole number.
- * X.691, #10.6
+ * X.691-11/2008, #11.6
+ * Encoding of a normally small non-negative whole number
  */
 int
 uper_put_nsnnwn(asn_per_outp_t *po, int n) {
-	int bytes;
+        int bytes;
 
-	if(n <= 63) {
-		if(n < 0) return -1;
-		return per_put_few_bits(po, n, 7);
-	}
-	if(n < 256)
-		bytes = 1;
-	else if(n < 65536)
-		bytes = 2;
-	else if(n < 256 * 65536)
-		bytes = 3;
-	else
-		return -1;	/* This is not a "normally small" value */
-	if(per_put_few_bits(po, bytes, 8))
-		return -1;
+        if(n <= 63) {
+                if(n < 0) return -1;
+                return per_put_few_bits(po, n, 7);
+        }
+        if(n < 256)
+                bytes = 1;
+        else if(n < 65536)
+                bytes = 2;
+        else if(n < 256 * 65536)
+                bytes = 3;
+        else
+                return -1;      /* This is not a "normally small" value */
+        if(per_put_few_bits(po, bytes, 8))
+                return -1;
 
-	return per_put_few_bits(po, n, 8 * bytes);
+        return per_put_few_bits(po, n, 8 * bytes);
 }
 
 
+/* X.691-2008/11, #11.5.6 -> #11.3 */
+int uper_get_constrained_whole_number(asn_per_data_t *pd, unsigned long *out_value, int nbits) {
+        unsigned long lhalf;    /* Lower half of the number*/
+        long half;
+
+        if(nbits <= 31) {
+                half = per_get_few_bits(pd, nbits);
+                if(half < 0) return -1;
+                *out_value = half;
+                return 0;
+        }
+
+        if((size_t)nbits > 8 * sizeof(*out_value))
+                return -1;  /* RANGE */
+
+        half = per_get_few_bits(pd, 31);
+        if(half < 0) return -1;
+
+        if(uper_get_constrained_whole_number(pd, &lhalf, nbits - 31))
+                return -1;
+
+        *out_value = ((unsigned long)half << (nbits - 31)) | lhalf;
+        return 0;
+}
+
+
+/* X.691-2008/11, #11.5.6 -> #11.3 */
+int uper_put_constrained_whole_number_s(asn_per_outp_t *po, long v, int nbits) {
+        /*
+         * Assume signed number can be safely coerced into
+         * unsigned of the same range.
+         * The following testing code will likely be optimized out
+         * by compiler if it is true.
+         */
+        unsigned long uvalue1 = ULONG_MAX;
+                 long svalue  = uvalue1;
+        unsigned long uvalue2 = svalue;
+        assert(uvalue1 == uvalue2);
+        return uper_put_constrained_whole_number_u(po, v, nbits);
+}
+
+int uper_put_constrained_whole_number_u(asn_per_outp_t *po, unsigned long v, int nbits) {
+        if(nbits <= 31) {
+                return per_put_few_bits(po, v, nbits);
+        } else {
+                /* Put higher portion first, followed by lower 31-bit */
+                if(uper_put_constrained_whole_number_u(po, v >> 31, nbits - 31))
+                        return -1;
+                return per_put_few_bits(po, v, 31);
+        }
+}
+
+int
+per_put_aligned_flush(asn_per_outp_t *po) {
+    uint32_t unused_bits = (0x7 & (8 - (po->nboff & 0x07)));
+    size_t complete_bytes =
+        (po->buffer ? po->buffer - po->tmpspace : 0) + ((po->nboff + 7) >> 3);
+
+    if(unused_bits) {
+        po->buffer[po->nboff >> 3] &= ~0 << unused_bits;
+    }
+
+    if(po->outper(po->tmpspace, complete_bytes, po->op_key) < 0) {
+        return -1;
+    } else {
+        po->buffer = po->tmpspace;
+        po->nboff = 0;
+        po->nbits = 8 * sizeof(po->tmpspace);
+        po->flushed_bytes += complete_bytes;
+        return 0;
+    }
+}
+
 /*
  * Put a small number of bits (<= 31).
  */
 int
 per_put_few_bits(asn_per_outp_t *po, uint32_t bits, int obits) {
-	size_t off;	/* Next after last bit offset */
-	size_t omsk;	/* Existing last byte meaningful bits mask */
-	uint8_t *buf;
+        size_t off;     /* Next after last bit offset */
+        size_t omsk;    /* Existing last byte meaningful bits mask */
+        uint8_t *buf;
 
-	if(obits <= 0 || obits >= 32) return obits ? -1 : 0;
+        if(obits <= 0 || obits >= 32) return obits ? -1 : 0;
 
-	ASN_DEBUG("[PER put %d bits %x to %p+%d bits]",
-			obits, (int)bits, po->buffer, po->nboff);
+        ASN_DEBUG("[PER put %d bits %x to %p+%d bits]",
+                        obits, (int)bits, po->buffer, (int)po->nboff);
 
-	/*
-	 * Normalize position indicator.
-	 */
-	if(po->nboff >= 8) {
-		po->buffer += (po->nboff >> 3);
-		po->nbits  -= (po->nboff & ~0x07);
-		po->nboff  &= 0x07;
-	}
+        /*
+         * Normalize position indicator.
+         */
+        if(po->nboff >= 8) {
+                po->buffer += (po->nboff >> 3);
+                po->nbits  -= (po->nboff & ~0x07);
+                po->nboff  &= 0x07;
+        }
 
-	/*
-	 * Flush whole-bytes output, if necessary.
-	 */
-	if(po->nboff + obits > po->nbits) {
-		int complete_bytes = (po->buffer - po->tmpspace);
-		ASN_DEBUG("[PER output %d complete + %d]",
-			complete_bytes, po->flushed_bytes);
-		if(po->outper(po->tmpspace, complete_bytes, po->op_key) < 0)
-			return -1;
-		if(po->nboff)
-			po->tmpspace[0] = po->buffer[0];
-		po->buffer = po->tmpspace;
-		po->nbits = 8 * sizeof(po->tmpspace);
-		po->flushed_bytes += complete_bytes;
-	}
+        /*
+         * Flush whole-bytes output, if necessary.
+         */
+        if(po->nboff + obits > po->nbits) {
+                size_t complete_bytes;
+                if(!po->buffer) po->buffer = po->tmpspace;
+                complete_bytes = (po->buffer - po->tmpspace);
+                ASN_DEBUG("[PER output %ld complete + %ld]",
+                        (long)complete_bytes, (long)po->flushed_bytes);
+                if(po->outper(po->tmpspace, complete_bytes, po->op_key) < 0)
+                        return -1;
+                if(po->nboff)
+                        po->tmpspace[0] = po->buffer[0];
+                po->buffer = po->tmpspace;
+                po->nbits = 8 * sizeof(po->tmpspace);
+                po->flushed_bytes += complete_bytes;
+        }
 
-	/*
-	 * Now, due to sizeof(tmpspace), we are guaranteed large enough space.
-	 */
-	buf = po->buffer;
-	omsk = ~((1 << (8 - po->nboff)) - 1);
-	off = (po->nboff += obits);
+        /*
+         * Now, due to sizeof(tmpspace), we are guaranteed large enough space.
+         */
+        buf = po->buffer;
+        omsk = ~((1 << (8 - po->nboff)) - 1);
+        off = (po->nboff + obits);
 
-	/* Clear data of debris before meaningful bits */
-	bits &= (((uint32_t)1 << obits) - 1);
+        /* Clear data of debris before meaningful bits */
+        bits &= (((uint32_t)1 << obits) - 1);
 
-	ASN_DEBUG("[PER out %d %u/%x (t=%d,o=%d) %x&%x=%x]", obits,
-		(int)bits, (int)bits,
-		po->nboff - obits, off, buf[0], omsk&0xff, buf[0] & omsk);
+        ASN_DEBUG("[PER out %d %u/%x (t=%d,o=%d) %x&%x=%x]", obits,
+                (int)bits, (int)bits,
+                (int)po->nboff, (int)off,
+                buf[0], (int)(omsk&0xff),
+                (int)(buf[0] & omsk));
 
-	if(off <= 8)	/* Completely within 1 byte */
-		bits <<= (8 - off),
-		buf[0] = (buf[0] & omsk) | bits;
-	else if(off <= 16)
-		bits <<= (16 - off),
-		buf[0] = (buf[0] & omsk) | (bits >> 8),
-		buf[1] = bits;
-	else if(off <= 24)
-		bits <<= (24 - off),
-		buf[0] = (buf[0] & omsk) | (bits >> 16),
-		buf[1] = bits >> 8,
-		buf[2] = bits;
-	else if(off <= 31)
-		bits <<= (32 - off),
-		buf[0] = (buf[0] & omsk) | (bits >> 24),
-		buf[1] = bits >> 16,
-		buf[2] = bits >> 8,
-		buf[3] = bits;
-	else {
-		ASN_DEBUG("->[PER out split %d]", obits);
-		per_put_few_bits(po, bits >> 8, 24);
-		per_put_few_bits(po, bits, obits - 24);
-		ASN_DEBUG("<-[PER out split %d]", obits);
-	}
+        if(off <= 8)    /* Completely within 1 byte */
+                po->nboff = off,
+                bits <<= (8 - off),
+                buf[0] = (buf[0] & omsk) | bits;
+        else if(off <= 16)
+                po->nboff = off,
+                bits <<= (16 - off),
+                buf[0] = (buf[0] & omsk) | (bits >> 8),
+                buf[1] = bits;
+        else if(off <= 24)
+                po->nboff = off,
+                bits <<= (24 - off),
+                buf[0] = (buf[0] & omsk) | (bits >> 16),
+                buf[1] = bits >> 8,
+                buf[2] = bits;
+        else if(off <= 31)
+                po->nboff = off,
+                bits <<= (32 - off),
+                buf[0] = (buf[0] & omsk) | (bits >> 24),
+                buf[1] = bits >> 16,
+                buf[2] = bits >> 8,
+                buf[3] = bits;
+        else {
+                if(per_put_few_bits(po, bits >> (obits - 24), 24)) return -1;
+                if(per_put_few_bits(po, bits, obits - 24)) return -1;
+        }
 
-	ASN_DEBUG("[PER out %u/%x => %02x buf+%d]",
-		(int)bits, (int)bits, buf[0], po->buffer - po->tmpspace);
+        ASN_DEBUG("[PER out %u/%x => %02x buf+%ld]",
+                (int)bits, (int)bits, buf[0],
+                (long)(po->buffer - po->tmpspace));
 
-	return 0;
+        return 0;
 }
 
 
@@ -354,30 +441,30 @@ per_put_few_bits(asn_per_outp_t *po, uint32_t bits, int obits) {
 int
 per_put_many_bits(asn_per_outp_t *po, const uint8_t *src, int nbits) {
 
-	while(nbits) {
-		uint32_t value;
+        while(nbits) {
+                uint32_t value;
 
-		if(nbits >= 24) {
-			value = (src[0] << 16) | (src[1] << 8) | src[2];
-			src += 3;
-			nbits -= 24;
-			if(per_put_few_bits(po, value, 24))
-				return -1;
-		} else {
-			value = src[0];
-			if(nbits > 8)
-				value = (value << 8) | src[1];
-			if(nbits > 16)
-				value = (value << 8) | src[2];
-			if(nbits & 0x07)
-				value >>= (8 - (nbits & 0x07));
-			if(per_put_few_bits(po, value, nbits))
-				return -1;
-			break;
-		}
-	}
+                if(nbits >= 24) {
+                        value = (src[0] << 16) | (src[1] << 8) | src[2];
+                        src += 3;
+                        nbits -= 24;
+                        if(per_put_few_bits(po, value, 24))
+                                return -1;
+                } else {
+                        value = src[0];
+                        if(nbits > 8)
+                                value = (value << 8) | src[1];
+                        if(nbits > 16)
+                                value = (value << 8) | src[2];
+                        if(nbits & 0x07)
+                                value >>= (8 - (nbits & 0x07));
+                        if(per_put_few_bits(po, value, nbits))
+                                return -1;
+                        break;
+                }
+        }
 
-	return 0;
+        return 0;
 }
 
 /*
@@ -386,18 +473,18 @@ per_put_many_bits(asn_per_outp_t *po, const uint8_t *src, int nbits) {
 ssize_t
 uper_put_length(asn_per_outp_t *po, size_t length) {
 
-	if(length <= 127)	/* #10.9.3.6 */
-		return per_put_few_bits(po, length, 8)
-			? -1 : (ssize_t)length;
-	else if(length < 16384)	/* #10.9.3.7 */
-		return per_put_few_bits(po, length|0x8000, 16)
-			? -1 : (ssize_t)length;
+        if(length <= 127)       /* #10.9.3.6 */
+                return per_put_few_bits(po, length, 8)
+                        ? -1 : (ssize_t)length;
+        else if(length < 16384) /* #10.9.3.7 */
+                return per_put_few_bits(po, length|0x8000, 16)
+                        ? -1 : (ssize_t)length;
 
-	length >>= 14;
-	if(length > 4) length = 4;
+        length >>= 14;
+        if(length > 4) length = 4;
 
-	return per_put_few_bits(po, 0xC0 | length, 8)
-			? -1 : (ssize_t)(length << 14);
+        return per_put_few_bits(po, 0xC0 | length, 8)
+                        ? -1 : (ssize_t)(length << 14);
 }
 
 
@@ -409,17 +496,16 @@ uper_put_length(asn_per_outp_t *po, size_t length) {
 int
 uper_put_nslength(asn_per_outp_t *po, size_t length) {
 
-	if(length <= 64) {
-		/* #10.9.3.4 */
-		if(length == 0) return -1;
-		return per_put_few_bits(po, length-1, 7) ? -1 : 0;
-	} else {
-		if(uper_put_length(po, length) != (ssize_t)length) {
-			/* This might happen in case of >16K extensions */
-			return -1;
-		}
-	}
+        if(length <= 64) {
+                /* #10.9.3.4 */
+                if(length == 0) return -1;
+                return per_put_few_bits(po, length-1, 7) ? -1 : 0;
+        } else {
+                if(uper_put_length(po, length) != (ssize_t)length) {
+                        /* This might happen in case of >16K extensions */
+                        return -1;
+                }
+        }
 
-	return 0;
+        return 0;
 }
-
diff --git a/src/core/libs/supl/asn-rrlp/per_support.h b/src/core/libs/supl/asn-rrlp/per_support.h
index 7cb1a0ca3..c3e7794de 100644
--- a/src/core/libs/supl/asn-rrlp/per_support.h
+++ b/src/core/libs/supl/asn-rrlp/per_support.h
@@ -3,10 +3,10 @@
  * All rights reserved.
  * Redistribution and modifications are permitted subject to BSD license.
  */
-#ifndef	_PER_SUPPORT_H_
-#define	_PER_SUPPORT_H_
+#ifndef _PER_SUPPORT_H_
+#define _PER_SUPPORT_H_
 
-#include <asn_system.h>		/* Platform-specific types */
+#include <asn_system.h>         /* Platform-specific types */
 
 #ifdef __cplusplus
 extern "C" {
@@ -15,23 +15,23 @@ extern "C" {
 /*
  * Pre-computed PER constraints.
  */
-typedef struct asn_per_constraint_s {
-	enum asn_per_constraint_flags {
-		APC_UNCONSTRAINED	= 0x0,	/* No PER visible constraints */
-		APC_SEMI_CONSTRAINED	= 0x1,	/* Constrained at "lb" */
-		APC_CONSTRAINED		= 0x2,	/* Fully constrained */
-		APC_EXTENSIBLE		= 0x4	/* May have extension */
-	} flags;
-	int  range_bits;		/* Full number of bits in the range */
-	int  effective_bits;		/* Effective bits */
-	long lower_bound;		/* "lb" value */
-	long upper_bound;		/* "ub" value */
+typedef const struct asn_per_constraint_s {
+        enum asn_per_constraint_flags {
+                APC_UNCONSTRAINED       = 0x0,  /* No PER visible constraints */
+                APC_SEMI_CONSTRAINED    = 0x1,  /* Constrained at "lb" */
+                APC_CONSTRAINED         = 0x2,  /* Fully constrained */
+                APC_EXTENSIBLE          = 0x4   /* May have extension */
+        } flags;
+        int  range_bits;                /* Full number of bits in the range */
+        int  effective_bits;            /* Effective bits */
+        long lower_bound;               /* "lb" value */
+        long upper_bound;               /* "ub" value */
 } asn_per_constraint_t;
-typedef struct asn_per_constraints_s {
-	asn_per_constraint_t value;
-	asn_per_constraint_t size;
-	int (*value2code)(unsigned int value);
-	int (*code2value)(unsigned int code);
+typedef const struct asn_per_constraints_s {
+        struct asn_per_constraint_s value;
+        struct asn_per_constraint_s size;
+        int (*value2code)(unsigned int value);
+        int (*code2value)(unsigned int code);
 } asn_per_constraints_t;
 
 /*
@@ -62,14 +62,14 @@ void per_get_undo(asn_per_data_t *per_data, int get_nbits);
  * extracted due to EOD or other conditions.
  */
 int per_get_many_bits(asn_per_data_t *pd, uint8_t *dst, int right_align,
-			int get_nbits);
+                        int get_nbits);
 
 /*
  * Get the length "n" from the Unaligned PER stream.
  */
 ssize_t uper_get_length(asn_per_data_t *pd,
-			int effective_bound_bits,
-			int *repeat);
+                        int effective_bound_bits,
+                        int *repeat);
 
 /*
  * Get the normally small length "n".
@@ -81,6 +81,9 @@ ssize_t uper_get_nslength(asn_per_data_t *pd);
  */
 ssize_t uper_get_nsnnwn(asn_per_data_t *pd);
 
+/* X.691-2008/11, #11.5.6 */
+int uper_get_constrained_whole_number(asn_per_data_t *pd, unsigned long *v, int nbits);
+
 /* Non-thread-safe debugging function, don't use it */
 char *per_data_string(asn_per_data_t *pd);
 
@@ -88,13 +91,13 @@ char *per_data_string(asn_per_data_t *pd);
  * This structure supports forming PER output.
  */
 typedef struct asn_per_outp_s {
-	uint8_t *buffer;	/* Pointer into the (tmpspace) */
-	size_t nboff;		/* Bit offset to the meaningful bit */
-	size_t nbits;		/* Number of bits left in (tmpspace) */
-	uint8_t tmpspace[32];	/* Preliminary storage to hold data */
-	int (*outper)(const void *data, size_t size, void *op_key);
-	void *op_key;		/* Key for (outper) data callback */
-	size_t flushed_bytes;	/* Bytes already flushed through (outper) */
+        uint8_t *buffer;        /* Pointer into the (tmpspace) */
+        size_t nboff;           /* Bit offset to the meaningful bit */
+        size_t nbits;           /* Number of bits left in (tmpspace) */
+        uint8_t tmpspace[32];   /* Preliminary storage to hold data */
+        int (*outper)(const void *data, size_t size, void *op_key);
+        void *op_key;           /* Key for (outper) data callback */
+        size_t flushed_bytes;   /* Bytes already flushed through (outper) */
 } asn_per_outp_t;
 
 /* Output a small number of bits (<= 31) */
@@ -103,6 +106,17 @@ int per_put_few_bits(asn_per_outp_t *per_data, uint32_t bits, int obits);
 /* Output a large number of bits */
 int per_put_many_bits(asn_per_outp_t *po, const uint8_t *src, int put_nbits);
 
+/*
+ * Flush whole bytes (0 or more) through (outper) member.
+ * The least significant bits which are not used are guaranteed to be set to 0.
+ * Returns -1 if callback returns -1. Otherwise, 0.
+ */
+int per_put_aligned_flush(asn_per_outp_t *po);
+
+/* X.691-2008/11, #11.5 */
+int uper_put_constrained_whole_number_s(asn_per_outp_t *po, long v, int nbits);
+int uper_put_constrained_whole_number_u(asn_per_outp_t *po, unsigned long v, int nbits);
+
 /*
  * Put the length "n" to the Unaligned PER stream.
  * This function returns the number of units which may be flushed
@@ -125,4 +139,4 @@ int uper_put_nsnnwn(asn_per_outp_t *po, int n);
 }
 #endif
 
-#endif	/* _PER_SUPPORT_H_ */
+#endif  /* _PER_SUPPORT_H_ */
diff --git a/src/core/libs/supl/asn-supl/NativeInteger.c b/src/core/libs/supl/asn-supl/NativeInteger.c
index abdb71a8c..76140a22e 100644
--- a/src/core/libs/supl/asn-supl/NativeInteger.c
+++ b/src/core/libs/supl/asn-supl/NativeInteger.c
@@ -107,7 +107,7 @@ NativeInteger_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
 		tmp.size = length;
 
 		if((specs&&specs->field_unsigned)
-			? asn_INTEGER2ulong(&tmp, &l)
+			? asn_INTEGER2ulong(&tmp, (unsigned long *)&l)
 			: asn_INTEGER2long(&tmp, &l)) {
 			rval.code = RC_FAIL;
 			rval.consumed = 0;
@@ -187,7 +187,7 @@ NativeInteger_decode_xer(asn_codec_ctx_t *opt_codec_ctx,
 	if(rval.code == RC_OK) {
 		long l;
 		if((specs&&specs->field_unsigned)
-			? asn_INTEGER2ulong(&st, &l)
+			? asn_INTEGER2ulong(&st, (unsigned long *)&l)
 			: asn_INTEGER2long(&st, &l)) {
 			rval.code = RC_FAIL;
 			rval.consumed = 0;
@@ -255,7 +255,7 @@ NativeInteger_decode_uper(asn_codec_ctx_t *opt_codec_ctx,
 				   &tmpintptr, pd);
 	if(rval.code == RC_OK) {
 		if((specs&&specs->field_unsigned)
-			? asn_INTEGER2ulong(&tmpint, native)
+			? asn_INTEGER2ulong(&tmpint, (unsigned long *)native)
 			: asn_INTEGER2long(&tmpint, native))
 			rval.code = RC_FAIL;
 		else
diff --git a/src/core/libs/supl/asn-supl/constr_SET_OF.c b/src/core/libs/supl/asn-supl/constr_SET_OF.c
index 11eac57a2..0bc891abf 100644
--- a/src/core/libs/supl/asn-supl/constr_SET_OF.c
+++ b/src/core/libs/supl/asn-supl/constr_SET_OF.c
@@ -915,7 +915,7 @@ SET_OF_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
 			nelems = uper_get_length(pd,
 				ct ? ct->effective_bits : -1, &repeat);
 			ASN_DEBUG("Got to decode %d elements (eff %d)",
-				(int)nelems, (int)ct ? ct->effective_bits : -1);
+				(int)nelems, (long)ct ? ct->effective_bits : -1);
 			if(nelems < 0) _ASN_DECODE_STARVED;
 		}
 
diff --git a/src/core/libs/supl/asn-supl/per_support.c b/src/core/libs/supl/asn-supl/per_support.c
index e8299c730..02dd02094 100644
--- a/src/core/libs/supl/asn-supl/per_support.c
+++ b/src/core/libs/supl/asn-supl/per_support.c
@@ -9,26 +9,26 @@
 
 char *
 per_data_string(asn_per_data_t *pd) {
-	static char buf[2][32];
-	static int n;
-	n = (n+1) % 2;
-	snprintf(buf[n], sizeof(buf),
-		"{m=%d span %+d[%d..%d] (%d)}",
-		pd->moved,
-		(((int)pd->buffer) & 0xf),
-		pd->nboff, pd->nbits,
-		pd->nbits - pd->nboff);
-	return buf[n];
+        static char buf[2][32];
+        static int n;
+        n = (n+1) % 2;
+        snprintf(buf[n], sizeof(buf[n]),
+                "{m=%ld span %+ld[%d..%d] (%d)}",
+                (long)pd->moved,
+                (((long)pd->buffer) & 0xf),
+                (int)pd->nboff, (int)pd->nbits,
+                (int)(pd->nbits - pd->nboff));
+        return buf[n];
 }
 
 void
 per_get_undo(asn_per_data_t *pd, int nbits) {
-	if((ssize_t)pd->nboff < nbits) {
-		assert((ssize_t)pd->nboff < nbits);
-	} else {
-		pd->nboff -= nbits;
-		pd->moved -= nbits;
-	}
+        if((ssize_t)pd->nboff < nbits) {
+                assert((ssize_t)pd->nboff < nbits);
+        } else {
+                pd->nboff -= nbits;
+                pd->moved -= nbits;
+        }
 }
 
 /*
@@ -36,83 +36,84 @@ per_get_undo(asn_per_data_t *pd, int nbits) {
  */
 int32_t
 per_get_few_bits(asn_per_data_t *pd, int nbits) {
-	size_t off;	/* Next after last bit offset */
-	ssize_t nleft;	/* Number of bits left in this stream */
-	uint32_t accum;
-	const uint8_t *buf;
+        size_t off;     /* Next after last bit offset */
+        ssize_t nleft;  /* Number of bits left in this stream */
+        uint32_t accum;
+        const uint8_t *buf;
 
-	if(nbits < 0)
-		return -1;
+        if(nbits < 0)
+                return -1;
 
-	nleft = pd->nbits - pd->nboff;
-	if(nbits > nleft) {
-		int32_t tailv, vhead;
-		if(!pd->refill || nbits > 31) return -1;
-		/* Accumulate unused bytes before refill */
-		ASN_DEBUG("Obtain the rest %d bits (want %d)", nleft, nbits);
-		tailv = per_get_few_bits(pd, nleft);
-		if(tailv < 0) return -1;
-		/* Refill (replace pd contents with new data) */
-		if(pd->refill(pd))
-			return -1;
-		nbits -= nleft;
-		vhead = per_get_few_bits(pd, nbits);
-		/* Combine the rest of previous pd with the head of new one */
-		tailv = (tailv << nbits) | vhead;  /* Could == -1 */
-		return tailv;
-	}
+        nleft = pd->nbits - pd->nboff;
+        if(nbits > nleft) {
+                int32_t tailv, vhead;
+                if(!pd->refill || nbits > 31) return -1;
+                /* Accumulate unused bytes before refill */
+                ASN_DEBUG("Obtain the rest %d bits (want %d)",
+                        (int)nleft, (int)nbits);
+                tailv = per_get_few_bits(pd, nleft);
+                if(tailv < 0) return -1;
+                /* Refill (replace pd contents with new data) */
+                if(pd->refill(pd))
+                        return -1;
+                nbits -= nleft;
+                vhead = per_get_few_bits(pd, nbits);
+                /* Combine the rest of previous pd with the head of new one */
+                tailv = (tailv << nbits) | vhead;  /* Could == -1 */
+                return tailv;
+        }
 
-	/*
-	 * Normalize position indicator.
-	 */
-	if(pd->nboff >= 8) {
-		pd->buffer += (pd->nboff >> 3);
-		pd->nbits  -= (pd->nboff & ~0x07);
-		pd->nboff  &= 0x07;
-	}
-	pd->moved += nbits;
-	pd->nboff += nbits;
-	off = pd->nboff;
-	buf = pd->buffer;
+        /*
+         * Normalize position indicator.
+         */
+        if(pd->nboff >= 8) {
+                pd->buffer += (pd->nboff >> 3);
+                pd->nbits  -= (pd->nboff & ~0x07);
+                pd->nboff  &= 0x07;
+        }
+        pd->moved += nbits;
+        pd->nboff += nbits;
+        off = pd->nboff;
+        buf = pd->buffer;
 
-	/*
-	 * Extract specified number of bits.
-	 */
-	if(off <= 8)
-		accum = nbits ? (buf[0]) >> (8 - off) : 0;
-	else if(off <= 16)
-		accum = ((buf[0] << 8) + buf[1]) >> (16 - off);
-	else if(off <= 24)
-		accum = ((buf[0] << 16) + (buf[1] << 8) + buf[2]) >> (24 - off);
-	else if(off <= 31)
-		accum = ((buf[0] << 24) + (buf[1] << 16)
-			+ (buf[2] << 8) + (buf[3])) >> (32 - off);
-	else if(nbits <= 31) {
-		asn_per_data_t tpd = *pd;
-		/* Here are we with our 31-bits limit plus 1..7 bits offset. */
-		per_get_undo(&tpd, nbits);
-		/* The number of available bits in the stream allow
-		 * for the following operations to take place without
-		 * invoking the ->refill() function */
-		accum  = per_get_few_bits(&tpd, nbits - 24) << 24;
-		accum |= per_get_few_bits(&tpd, 24);
-	} else {
-		per_get_undo(pd, nbits);
-		return -1;
-	}
+        /*
+         * Extract specified number of bits.
+         */
+        if(off <= 8)
+                accum = nbits ? (buf[0]) >> (8 - off) : 0;
+        else if(off <= 16)
+                accum = ((buf[0] << 8) + buf[1]) >> (16 - off);
+        else if(off <= 24)
+                accum = ((buf[0] << 16) + (buf[1] << 8) + buf[2]) >> (24 - off);
+        else if(off <= 31)
+                accum = ((buf[0] << 24) + (buf[1] << 16)
+                        + (buf[2] << 8) + (buf[3])) >> (32 - off);
+        else if(nbits <= 31) {
+                asn_per_data_t tpd = *pd;
+                /* Here are we with our 31-bits limit plus 1..7 bits offset. */
+                per_get_undo(&tpd, nbits);
+                /* The number of available bits in the stream allow
+                 * for the following operations to take place without
+                 * invoking the ->refill() function */
+                accum  = per_get_few_bits(&tpd, nbits - 24) << 24;
+                accum |= per_get_few_bits(&tpd, 24);
+        } else {
+                per_get_undo(pd, nbits);
+                return -1;
+        }
 
-	accum &= (((uint32_t)1 << nbits) - 1);
+        accum &= (((uint32_t)1 << nbits) - 1);
 
-	ASN_DEBUG("  [PER got %2d<=%2d bits => span %d %+d[%d..%d]:%02x (%d) => 0x%x]",
-		nbits, nleft,
-		pd->moved,
-		(((int)pd->buffer) & 0xf),
-		pd->nboff, pd->nbits,
-		pd->buffer[0],
-		pd->nbits - pd->nboff,
-		(int)accum);
+        ASN_DEBUG("  [PER got %2d<=%2d bits => span %d %+ld[%d..%d]:%02x (%d) => 0x%x]",
+                (int)nbits, (int)nleft,
+                (int)pd->moved,
+                (((long)pd->buffer) & 0xf),
+                (int)pd->nboff, (int)pd->nbits,
+                ((pd->buffer != NULL)?pd->buffer[0]:0),
+                (int)(pd->nbits - pd->nboff),
+                (int)accum);
 
-	return accum;
+        return accum;
 }
 
 /*
@@ -120,70 +121,76 @@ per_get_few_bits(asn_per_data_t *pd, int nbits) {
  */
 int
 per_get_many_bits(asn_per_data_t *pd, uint8_t *dst, int alright, int nbits) {
-	int32_t value;
+        int32_t value;
 
-	if(alright && (nbits & 7)) {
-		/* Perform right alignment of a first few bits */
-		value = per_get_few_bits(pd, nbits & 0x07);
-		if(value < 0) return -1;
-		*dst++ = value;	/* value is already right-aligned */
-		nbits &= ~7;
-	}
+        if(alright && (nbits & 7)) {
+                /* Perform right alignment of a first few bits */
+                value = per_get_few_bits(pd, nbits & 0x07);
+                if(value < 0) return -1;
+                *dst++ = value; /* value is already right-aligned */
+                nbits &= ~7;
+        }
 
-	while(nbits) {
-		if(nbits >= 24) {
-			value = per_get_few_bits(pd, 24);
-			if(value < 0) return -1;
-			*(dst++) = value >> 16;
-			*(dst++) = value >> 8;
-			*(dst++) = value;
-			nbits -= 24;
-		} else {
-			value = per_get_few_bits(pd, nbits);
-			if(value < 0) return -1;
-			if(nbits & 7) {	/* implies left alignment */
-				value <<= 8 - (nbits & 7),
-				nbits += 8 - (nbits & 7);
-				if(nbits > 24)
-					*dst++ = value >> 24;
-			}
-			if(nbits > 16)
-				*dst++ = value >> 16;
-			if(nbits > 8)
-				*dst++ = value >> 8;
-			*dst++ = value;
-			break;
-		}
-	}
+        while(nbits) {
+                if(nbits >= 24) {
+                        value = per_get_few_bits(pd, 24);
+                        if(value < 0) return -1;
+                        *(dst++) = value >> 16;
+                        *(dst++) = value >> 8;
+                        *(dst++) = value;
+                        nbits -= 24;
+                } else {
+                        value = per_get_few_bits(pd, nbits);
+                        if(value < 0) return -1;
+                        if(nbits & 7) { /* implies left alignment */
+                                value <<= 8 - (nbits & 7),
+                                nbits += 8 - (nbits & 7);
+                                if(nbits > 24)
+                                        *dst++ = value >> 24;
+                        }
+                        if(nbits > 16)
+                                *dst++ = value >> 16;
+                        if(nbits > 8)
+                                *dst++ = value >> 8;
+                        *dst++ = value;
+                        break;
+                }
+        }
 
-	return 0;
+        return 0;
 }
 
 /*
- * Get the length "n" from the stream.
+ * X.691-201508 #10.9 General rules for encoding a length determinant.
+ * Get the optionally constrained length "n" from the stream.
  */
 ssize_t
 uper_get_length(asn_per_data_t *pd, int ebits, int *repeat) {
-	ssize_t value;
+    ssize_t value;
 
-	*repeat = 0;
+    *repeat = 0;
 
-	if(ebits >= 0) return per_get_few_bits(pd, ebits);
+    /* #11.9.4.1 Encoding if constrained (according to effective bits) */
+    if(ebits >= 0 && ebits <= 16) {
+        return per_get_few_bits(pd, ebits);
+    }
 
-	value = per_get_few_bits(pd, 8);
-	if(value < 0) return -1;
-	if((value & 128) == 0)	/* #10.9.3.6 */
-		return (value & 0x7F);
-	if((value & 64) == 0) {	/* #10.9.3.7 */
-		value = ((value & 63) << 8) | per_get_few_bits(pd, 8);
-		if(value < 0) return -1;
-		return value;
-	}
-	value &= 63;	/* this is "m" from X.691, #10.9.3.8 */
-	if(value < 1 || value > 4)
-		return -1;
-	*repeat = 1;
-	return (16384 * value);
+        value = per_get_few_bits(pd, 8);
+    if((value & 0x80) == 0) { /* #11.9.3.6 */
+        return (value & 0x7F);
+    } else if((value & 0x40) == 0) { /* #11.9.3.7 */
+        /* bit 8 ... set to 1 and bit 7 ... set to zero */
+        value = ((value & 0x3f) << 8) | per_get_few_bits(pd, 8);
+        return value; /* potential -1 from per_get_few_bits passes through. */
+    } else if(value < 0) {
+        return -1;
+    }
+    value &= 0x3f; /* this is "m" from X.691, #11.9.3.8 */
+    if(value < 1 || value > 4) {
+        return -1; /* Prohibited by #11.9.3.8 */
+    }
+    *repeat = 1;
+    return (16384 * value);
 }
 
 /*
@@ -193,21 +200,21 @@ uper_get_length(asn_per_data_t *pd, int ebits, int *repeat) {
  */
 ssize_t
 uper_get_nslength(asn_per_data_t *pd) {
-	ssize_t length;
+        ssize_t length;
 
-	ASN_DEBUG("Getting normally small length");
+        ASN_DEBUG("Getting normally small length");
 
-	if(per_get_few_bits(pd, 1) == 0) {
-		length = per_get_few_bits(pd, 6) + 1;
-		if(length <= 0) return -1;
-		ASN_DEBUG("l=%d", length);
-		return length;
-	} else {
-		int repeat;
-		length = uper_get_length(pd, -1, &repeat);
-		if(length >= 0 && !repeat) return length;
-		return -1; /* Error, or do not support >16K extensions */
-	}
+        if(per_get_few_bits(pd, 1) == 0) {
+                length = per_get_few_bits(pd, 6) + 1;
+                if(length <= 0) return -1;
+                ASN_DEBUG("l=%d", (int)length);
+                return length;
+        } else {
+                int repeat;
+                length = uper_get_length(pd, -1, &repeat);
+                if(length >= 0 && !repeat) return length;
+                return -1; /* Error, or do not support >16K extensions */
+        }
 }
 
 /*
@@ -216,135 +223,215 @@ uper_get_nslength(asn_per_data_t *pd) {
  */
 ssize_t
 uper_get_nsnnwn(asn_per_data_t *pd) {
-	ssize_t value;
+        ssize_t value;
 
-	value = per_get_few_bits(pd, 7);
-	if(value & 64) {	/* implicit (value < 0) */
-		value &= 63;
-		value <<= 2;
-		value |= per_get_few_bits(pd, 2);
-		if(value & 128)	/* implicit (value < 0) */
-			return -1;
-		if(value == 0)
-			return 0;
-		if(value >= 3)
-			return -1;
-		value = per_get_few_bits(pd, 8 * value);
-		return value;
-	}
+        value = per_get_few_bits(pd, 7);
+        if(value & 64) {        /* implicit (value < 0) */
+                value &= 63;
+                value <<= 2;
+                value |= per_get_few_bits(pd, 2);
+                if(value & 128) /* implicit (value < 0) */
+                        return -1;
+                if(value == 0)
+                        return 0;
+                if(value >= 3)
+                        return -1;
+                value = per_get_few_bits(pd, 8 * value);
+                return value;
+        }
 
-	return value;
+        return value;
 }
 
 /*
- * Put the normally small non-negative whole number.
- * X.691, #10.6
+ * X.691-11/2008, #11.6
+ * Encoding of a normally small non-negative whole number
  */
 int
 uper_put_nsnnwn(asn_per_outp_t *po, int n) {
-	int bytes;
+        int bytes;
 
-	if(n <= 63) {
-		if(n < 0) return -1;
-		return per_put_few_bits(po, n, 7);
-	}
-	if(n < 256)
-		bytes = 1;
-	else if(n < 65536)
-		bytes = 2;
-	else if(n < 256 * 65536)
-		bytes = 3;
-	else
-		return -1;	/* This is not a "normally small" value */
-	if(per_put_few_bits(po, bytes, 8))
-		return -1;
+        if(n <= 63) {
+                if(n < 0) return -1;
+                return per_put_few_bits(po, n, 7);
+        }
+        if(n < 256)
+                bytes = 1;
+        else if(n < 65536)
+                bytes = 2;
+        else if(n < 256 * 65536)
+                bytes = 3;
+        else
+                return -1;      /* This is not a "normally small" value */
+        if(per_put_few_bits(po, bytes, 8))
+                return -1;
 
-	return per_put_few_bits(po, n, 8 * bytes);
+        return per_put_few_bits(po, n, 8 * bytes);
 }
 
 
+/* X.691-2008/11, #11.5.6 -> #11.3 */
+int uper_get_constrained_whole_number(asn_per_data_t *pd, unsigned long *out_value, int nbits) {
+        unsigned long lhalf;    /* Lower half of the number*/
+        long half;
+
+        if(nbits <= 31) {
+                half = per_get_few_bits(pd, nbits);
+                if(half < 0) return -1;
+                *out_value = half;
+                return 0;
+        }
+
+        if((size_t)nbits > 8 * sizeof(*out_value))
+                return -1;  /* RANGE */
+
+        half = per_get_few_bits(pd, 31);
+        if(half < 0) return -1;
+
+        if(uper_get_constrained_whole_number(pd, &lhalf, nbits - 31))
+                return -1;
+
+        *out_value = ((unsigned long)half << (nbits - 31)) | lhalf;
+        return 0;
+}
+
+
+/* X.691-2008/11, #11.5.6 -> #11.3 */
+int uper_put_constrained_whole_number_s(asn_per_outp_t *po, long v, int nbits) {
+        /*
+         * Assume signed number can be safely coerced into
+         * unsigned of the same range.
+         * The following testing code will likely be optimized out
+         * by compiler if it is true.
+         */
+        unsigned long uvalue1 = ULONG_MAX;
+                 long svalue  = uvalue1;
+        unsigned long uvalue2 = svalue;
+        assert(uvalue1 == uvalue2);
+        return uper_put_constrained_whole_number_u(po, v, nbits);
+}
+
+int uper_put_constrained_whole_number_u(asn_per_outp_t *po, unsigned long v, int nbits) {
+        if(nbits <= 31) {
+                return per_put_few_bits(po, v, nbits);
+        } else {
+                /* Put higher portion first, followed by lower 31-bit */
+                if(uper_put_constrained_whole_number_u(po, v >> 31, nbits - 31))
+                        return -1;
+                return per_put_few_bits(po, v, 31);
+        }
+}
+
+int
+per_put_aligned_flush(asn_per_outp_t *po) {
+    uint32_t unused_bits = (0x7 & (8 - (po->nboff & 0x07)));
+    size_t complete_bytes =
+        (po->buffer ? po->buffer - po->tmpspace : 0) + ((po->nboff + 7) >> 3);
+
+    if(unused_bits) {
+        po->buffer[po->nboff >> 3] &= ~0 << unused_bits;
+    }
+
+    if(po->outper(po->tmpspace, complete_bytes, po->op_key) < 0) {
+        return -1;
+    } else {
+        po->buffer = po->tmpspace;
+        po->nboff = 0;
+        po->nbits = 8 * sizeof(po->tmpspace);
+        po->flushed_bytes += complete_bytes;
+        return 0;
+    }
+}
+
 /*
  * Put a small number of bits (<= 31).
  */
 int
 per_put_few_bits(asn_per_outp_t *po, uint32_t bits, int obits) {
-	size_t off;	/* Next after last bit offset */
-	size_t omsk;	/* Existing last byte meaningful bits mask */
-	uint8_t *buf;
+        size_t off;     /* Next after last bit offset */
+        size_t omsk;    /* Existing last byte meaningful bits mask */
+        uint8_t *buf;
 
-	if(obits <= 0 || obits >= 32) return obits ? -1 : 0;
+        if(obits <= 0 || obits >= 32) return obits ? -1 : 0;
 
-	ASN_DEBUG("[PER put %d bits %x to %p+%d bits]",
-			obits, (int)bits, po->buffer, po->nboff);
+        ASN_DEBUG("[PER put %d bits %x to %p+%d bits]",
+                        obits, (int)bits, po->buffer, (int)po->nboff);
 
-	/*
-	 * Normalize position indicator.
-	 */
-	if(po->nboff >= 8) {
-		po->buffer += (po->nboff >> 3);
-		po->nbits  -= (po->nboff & ~0x07);
-		po->nboff  &= 0x07;
-	}
+        /*
+         * Normalize position indicator.
+         */
+        if(po->nboff >= 8) {
+                po->buffer += (po->nboff >> 3);
+                po->nbits  -= (po->nboff & ~0x07);
+                po->nboff  &= 0x07;
+        }
 
-	/*
-	 * Flush whole-bytes output, if necessary.
-	 */
-	if(po->nboff + obits > po->nbits) {
-		int complete_bytes = (po->buffer - po->tmpspace);
-		ASN_DEBUG("[PER output %d complete + %d]",
-			complete_bytes, po->flushed_bytes);
-		if(po->outper(po->tmpspace, complete_bytes, po->op_key) < 0)
-			return -1;
-		if(po->nboff)
-			po->tmpspace[0] = po->buffer[0];
-		po->buffer = po->tmpspace;
-		po->nbits = 8 * sizeof(po->tmpspace);
-		po->flushed_bytes += complete_bytes;
-	}
+        /*
+         * Flush whole-bytes output, if necessary.
+         */
+        if(po->nboff + obits > po->nbits) {
+                size_t complete_bytes;
+                if(!po->buffer) po->buffer = po->tmpspace;
+                complete_bytes = (po->buffer - po->tmpspace);
+                ASN_DEBUG("[PER output %ld complete + %ld]",
+                        (long)complete_bytes, (long)po->flushed_bytes);
+                if(po->outper(po->tmpspace, complete_bytes, po->op_key) < 0)
+                        return -1;
+                if(po->nboff)
+                        po->tmpspace[0] = po->buffer[0];
+                po->buffer = po->tmpspace;
+                po->nbits = 8 * sizeof(po->tmpspace);
+                po->flushed_bytes += complete_bytes;
+        }
 
-	/*
-	 * Now, due to sizeof(tmpspace), we are guaranteed large enough space.
-	 */
-	buf = po->buffer;
-	omsk = ~((1 << (8 - po->nboff)) - 1);
-	off = (po->nboff += obits);
+        /*
+         * Now, due to sizeof(tmpspace), we are guaranteed large enough space.
+         */
+        buf = po->buffer;
+        omsk = ~((1 << (8 - po->nboff)) - 1);
+        off = (po->nboff + obits);
 
-	/* Clear data of debris before meaningful bits */
-	bits &= (((uint32_t)1 << obits) - 1);
+        /* Clear data of debris before meaningful bits */
+        bits &= (((uint32_t)1 << obits) - 1);
 
-	ASN_DEBUG("[PER out %d %u/%x (t=%d,o=%d) %x&%x=%x]", obits,
-		(int)bits, (int)bits,
-		po->nboff - obits, off, buf[0], omsk&0xff, buf[0] & omsk);
+        ASN_DEBUG("[PER out %d %u/%x (t=%d,o=%d) %x&%x=%x]", obits,
+                (int)bits, (int)bits,
+                (int)po->nboff, (int)off,
+                buf[0], (int)(omsk&0xff),
+                (int)(buf[0] & omsk));
 
-	if(off <= 8)	/* Completely within 1 byte */
-		bits <<= (8 - off),
-		buf[0] = (buf[0] & omsk) | bits;
-	else if(off <= 16)
-		bits <<= (16 - off),
-		buf[0] = (buf[0] & omsk) | (bits >> 8),
-		buf[1] = bits;
-	else if(off <= 24)
-		bits <<= (24 - off),
-		buf[0] = (buf[0] & omsk) | (bits >> 16),
-		buf[1] = bits >> 8,
-		buf[2] = bits;
-	else if(off <= 31)
-		bits <<= (32 - off),
-		buf[0] = (buf[0] & omsk) | (bits >> 24),
-		buf[1] = bits >> 16,
-		buf[2] = bits >> 8,
-		buf[3] = bits;
-	else {
-		ASN_DEBUG("->[PER out split %d]", obits);
-		per_put_few_bits(po, bits >> 8, 24);
-		per_put_few_bits(po, bits, obits - 24);
-		ASN_DEBUG("<-[PER out split %d]", obits);
-	}
+        if(off <= 8)    /* Completely within 1 byte */
+                po->nboff = off,
+                bits <<= (8 - off),
+                buf[0] = (buf[0] & omsk) | bits;
+        else if(off <= 16)
+                po->nboff = off,
+                bits <<= (16 - off),
+                buf[0] = (buf[0] & omsk) | (bits >> 8),
+                buf[1] = bits;
+        else if(off <= 24)
+                po->nboff = off,
+                bits <<= (24 - off),
+                buf[0] = (buf[0] & omsk) | (bits >> 16),
+                buf[1] = bits >> 8,
+                buf[2] = bits;
+        else if(off <= 31)
+                po->nboff = off,
+                bits <<= (32 - off),
+                buf[0] = (buf[0] & omsk) | (bits >> 24),
+                buf[1] = bits >> 16,
+                buf[2] = bits >> 8,
+                buf[3] = bits;
+        else {
+                if(per_put_few_bits(po, bits >> (obits - 24), 24)) return -1;
+                if(per_put_few_bits(po, bits, obits - 24)) return -1;
+        }
 
-	ASN_DEBUG("[PER out %u/%x => %02x buf+%d]",
-		(int)bits, (int)bits, buf[0], po->buffer - po->tmpspace);
+        ASN_DEBUG("[PER out %u/%x => %02x buf+%ld]",
+                (int)bits, (int)bits, buf[0],
+                (long)(po->buffer - po->tmpspace));
 
-	return 0;
+        return 0;
 }
 
 
@@ -354,30 +441,30 @@ per_put_few_bits(asn_per_outp_t *po, uint32_t bits, int obits) {
 int
 per_put_many_bits(asn_per_outp_t *po, const uint8_t *src, int nbits) {
 
-	while(nbits) {
-		uint32_t value;
+        while(nbits) {
+                uint32_t value;
 
-		if(nbits >= 24) {
-			value = (src[0] << 16) | (src[1] << 8) | src[2];
-			src += 3;
-			nbits -= 24;
-			if(per_put_few_bits(po, value, 24))
-				return -1;
-		} else {
-			value = src[0];
-			if(nbits > 8)
-				value = (value << 8) | src[1];
-			if(nbits > 16)
-				value = (value << 8) | src[2];
-			if(nbits & 0x07)
-				value >>= (8 - (nbits & 0x07));
-			if(per_put_few_bits(po, value, nbits))
-				return -1;
-			break;
-		}
-	}
+                if(nbits >= 24) {
+                        value = (src[0] << 16) | (src[1] << 8) | src[2];
+                        src += 3;
+                        nbits -= 24;
+                        if(per_put_few_bits(po, value, 24))
+                                return -1;
+                } else {
+                        value = src[0];
+                        if(nbits > 8)
+                                value = (value << 8) | src[1];
+                        if(nbits > 16)
+                                value = (value << 8) | src[2];
+                        if(nbits & 0x07)
+                                value >>= (8 - (nbits & 0x07));
+                        if(per_put_few_bits(po, value, nbits))
+                                return -1;
+                        break;
+                }
+        }
 
-	return 0;
+        return 0;
 }
 
 /*
@@ -386,18 +473,18 @@ per_put_many_bits(asn_per_outp_t *po, const uint8_t *src, int nbits) {
 ssize_t
 uper_put_length(asn_per_outp_t *po, size_t length) {
 
-	if(length <= 127)	/* #10.9.3.6 */
-		return per_put_few_bits(po, length, 8)
-			? -1 : (ssize_t)length;
-	else if(length < 16384)	/* #10.9.3.7 */
-		return per_put_few_bits(po, length|0x8000, 16)
-			? -1 : (ssize_t)length;
+        if(length <= 127)       /* #10.9.3.6 */
+                return per_put_few_bits(po, length, 8)
+                        ? -1 : (ssize_t)length;
+        else if(length < 16384) /* #10.9.3.7 */
+                return per_put_few_bits(po, length|0x8000, 16)
+                        ? -1 : (ssize_t)length;
 
-	length >>= 14;
-	if(length > 4) length = 4;
+        length >>= 14;
+        if(length > 4) length = 4;
 
-	return per_put_few_bits(po, 0xC0 | length, 8)
-			? -1 : (ssize_t)(length << 14);
+        return per_put_few_bits(po, 0xC0 | length, 8)
+                        ? -1 : (ssize_t)(length << 14);
 }
 
 
@@ -409,17 +496,16 @@ uper_put_length(asn_per_outp_t *po, size_t length) {
 int
 uper_put_nslength(asn_per_outp_t *po, size_t length) {
 
-	if(length <= 64) {
-		/* #10.9.3.4 */
-		if(length == 0) return -1;
-		return per_put_few_bits(po, length-1, 7) ? -1 : 0;
-	} else {
-		if(uper_put_length(po, length) != (ssize_t)length) {
-			/* This might happen in case of >16K extensions */
-			return -1;
-		}
-	}
+        if(length <= 64) {
+                /* #10.9.3.4 */
+                if(length == 0) return -1;
+                return per_put_few_bits(po, length-1, 7) ? -1 : 0;
+        } else {
+                if(uper_put_length(po, length) != (ssize_t)length) {
+                        /* This might happen in case of >16K extensions */
+                        return -1;
+                }
+        }
 
-	return 0;
+        return 0;
 }
-
diff --git a/src/core/libs/supl/asn-supl/per_support.h b/src/core/libs/supl/asn-supl/per_support.h
index 7cb1a0ca3..c3e7794de 100644
--- a/src/core/libs/supl/asn-supl/per_support.h
+++ b/src/core/libs/supl/asn-supl/per_support.h
@@ -3,10 +3,10 @@
  * All rights reserved.
  * Redistribution and modifications are permitted subject to BSD license.
  */
-#ifndef	_PER_SUPPORT_H_
-#define	_PER_SUPPORT_H_
+#ifndef _PER_SUPPORT_H_
+#define _PER_SUPPORT_H_
 
-#include <asn_system.h>		/* Platform-specific types */
+#include <asn_system.h>         /* Platform-specific types */
 
 #ifdef __cplusplus
 extern "C" {
@@ -15,23 +15,23 @@ extern "C" {
 /*
  * Pre-computed PER constraints.
  */
-typedef struct asn_per_constraint_s {
-	enum asn_per_constraint_flags {
-		APC_UNCONSTRAINED	= 0x0,	/* No PER visible constraints */
-		APC_SEMI_CONSTRAINED	= 0x1,	/* Constrained at "lb" */
-		APC_CONSTRAINED		= 0x2,	/* Fully constrained */
-		APC_EXTENSIBLE		= 0x4	/* May have extension */
-	} flags;
-	int  range_bits;		/* Full number of bits in the range */
-	int  effective_bits;		/* Effective bits */
-	long lower_bound;		/* "lb" value */
-	long upper_bound;		/* "ub" value */
+typedef const struct asn_per_constraint_s {
+        enum asn_per_constraint_flags {
+                APC_UNCONSTRAINED       = 0x0,  /* No PER visible constraints */
+                APC_SEMI_CONSTRAINED    = 0x1,  /* Constrained at "lb" */
+                APC_CONSTRAINED         = 0x2,  /* Fully constrained */
+                APC_EXTENSIBLE          = 0x4   /* May have extension */
+        } flags;
+        int  range_bits;                /* Full number of bits in the range */
+        int  effective_bits;            /* Effective bits */
+        long lower_bound;               /* "lb" value */
+        long upper_bound;               /* "ub" value */
 } asn_per_constraint_t;
-typedef struct asn_per_constraints_s {
-	asn_per_constraint_t value;
-	asn_per_constraint_t size;
-	int (*value2code)(unsigned int value);
-	int (*code2value)(unsigned int code);
+typedef const struct asn_per_constraints_s {
+        struct asn_per_constraint_s value;
+        struct asn_per_constraint_s size;
+        int (*value2code)(unsigned int value);
+        int (*code2value)(unsigned int code);
 } asn_per_constraints_t;
 
 /*
@@ -62,14 +62,14 @@ void per_get_undo(asn_per_data_t *per_data, int get_nbits);
  * extracted due to EOD or other conditions.
  */
 int per_get_many_bits(asn_per_data_t *pd, uint8_t *dst, int right_align,
-			int get_nbits);
+                        int get_nbits);
 
 /*
  * Get the length "n" from the Unaligned PER stream.
  */
 ssize_t uper_get_length(asn_per_data_t *pd,
-			int effective_bound_bits,
-			int *repeat);
+                        int effective_bound_bits,
+                        int *repeat);
 
 /*
  * Get the normally small length "n".
@@ -81,6 +81,9 @@ ssize_t uper_get_nslength(asn_per_data_t *pd);
  */
 ssize_t uper_get_nsnnwn(asn_per_data_t *pd);
 
+/* X.691-2008/11, #11.5.6 */
+int uper_get_constrained_whole_number(asn_per_data_t *pd, unsigned long *v, int nbits);
+
 /* Non-thread-safe debugging function, don't use it */
 char *per_data_string(asn_per_data_t *pd);
 
@@ -88,13 +91,13 @@ char *per_data_string(asn_per_data_t *pd);
  * This structure supports forming PER output.
  */
 typedef struct asn_per_outp_s {
-	uint8_t *buffer;	/* Pointer into the (tmpspace) */
-	size_t nboff;		/* Bit offset to the meaningful bit */
-	size_t nbits;		/* Number of bits left in (tmpspace) */
-	uint8_t tmpspace[32];	/* Preliminary storage to hold data */
-	int (*outper)(const void *data, size_t size, void *op_key);
-	void *op_key;		/* Key for (outper) data callback */
-	size_t flushed_bytes;	/* Bytes already flushed through (outper) */
+        uint8_t *buffer;        /* Pointer into the (tmpspace) */
+        size_t nboff;           /* Bit offset to the meaningful bit */
+        size_t nbits;           /* Number of bits left in (tmpspace) */
+        uint8_t tmpspace[32];   /* Preliminary storage to hold data */
+        int (*outper)(const void *data, size_t size, void *op_key);
+        void *op_key;           /* Key for (outper) data callback */
+        size_t flushed_bytes;   /* Bytes already flushed through (outper) */
 } asn_per_outp_t;
 
 /* Output a small number of bits (<= 31) */
@@ -103,6 +106,17 @@ int per_put_few_bits(asn_per_outp_t *per_data, uint32_t bits, int obits);
 /* Output a large number of bits */
 int per_put_many_bits(asn_per_outp_t *po, const uint8_t *src, int put_nbits);
 
+/*
+ * Flush whole bytes (0 or more) through (outper) member.
+ * The least significant bits which are not used are guaranteed to be set to 0.
+ * Returns -1 if callback returns -1. Otherwise, 0.
+ */
+int per_put_aligned_flush(asn_per_outp_t *po);
+
+/* X.691-2008/11, #11.5 */
+int uper_put_constrained_whole_number_s(asn_per_outp_t *po, long v, int nbits);
+int uper_put_constrained_whole_number_u(asn_per_outp_t *po, unsigned long v, int nbits);
+
 /*
  * Put the length "n" to the Unaligned PER stream.
  * This function returns the number of units which may be flushed
@@ -125,4 +139,4 @@ int uper_put_nsnnwn(asn_per_outp_t *po, int n);
 }
 #endif
 
-#endif	/* _PER_SUPPORT_H_ */
+#endif  /* _PER_SUPPORT_H_ */
diff --git a/src/core/libs/supl/supl.c b/src/core/libs/supl/supl.c
index 1ab843ead..6a06bb252 100644
--- a/src/core/libs/supl/supl.c
+++ b/src/core/libs/supl/supl.c
@@ -217,7 +217,7 @@ int EXPORT supl_decode_rrlp(supl_ulp_t *ulp_pdu, PDU_t **ret_rrlp) {
   
 int EXPORT supl_server_connect(supl_ctx_t *ctx, char *server) {
   int err;
-  const SSL_METHOD *meth;
+  SSL_METHOD *meth;
 
   SSLeay_add_ssl_algorithms();
   // meth = TLSv1_client_method();
diff --git a/src/core/receiver/CMakeLists.txt b/src/core/receiver/CMakeLists.txt
index e4cc6896c..7c3992785 100644
--- a/src/core/receiver/CMakeLists.txt
+++ b/src/core/receiver/CMakeLists.txt
@@ -42,7 +42,7 @@ endif(ENABLE_FPGA)
 
 
 include_directories(
-     $(CMAKE_CURRENT_SOURCE_DIR)
+     ${CMAKE_CURRENT_SOURCE_DIR}
      ${CMAKE_SOURCE_DIR}/src/core/system_parameters
      ${CMAKE_SOURCE_DIR}/src/core/interfaces
      ${CMAKE_SOURCE_DIR}/src/core/libs
diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc
index d0a21d68d..1a1517de5 100644
--- a/src/core/receiver/control_thread.cc
+++ b/src/core/receiver/control_thread.cc
@@ -33,7 +33,6 @@
  */
 
 #include "control_thread.h"
-#include <unistd.h>
 #include <cmath>
 #include <iostream>
 #include <limits>
@@ -187,9 +186,9 @@ bool ControlThread::read_assistance_from_XML()
     std::cout << "SUPL: Try read GPS ephemeris from XML file " << eph_xml_filename << std::endl;
     if (supl_client_ephemeris_.load_ephemeris_xml(eph_xml_filename) == true)
         {
-            std::map<int,Gps_Ephemeris>::iterator gps_eph_iter;
-            for(gps_eph_iter = supl_client_ephemeris_.gps_ephemeris_map.begin();
-                    gps_eph_iter != supl_client_ephemeris_.gps_ephemeris_map.end();
+            std::map<int,Gps_Ephemeris>::const_iterator gps_eph_iter;
+            for(gps_eph_iter = supl_client_ephemeris_.gps_ephemeris_map.cbegin();
+                    gps_eph_iter != supl_client_ephemeris_.gps_ephemeris_map.cend();
                     gps_eph_iter++)
                 {
                     std::cout << "SUPL: Read XML Ephemeris for GPS SV " << gps_eph_iter->first << std::endl;
@@ -315,9 +314,9 @@ void ControlThread::assist_GNSS()
                     error = supl_client_ephemeris_.get_assistance(supl_mcc, supl_mns, supl_lac, supl_ci);
                     if (error == 0)
                         {
-                            std::map<int,Gps_Ephemeris>::iterator gps_eph_iter;
-                            for(gps_eph_iter = supl_client_ephemeris_.gps_ephemeris_map.begin();
-                                    gps_eph_iter != supl_client_ephemeris_.gps_ephemeris_map.end();
+                            std::map<int,Gps_Ephemeris>::const_iterator gps_eph_iter;
+                            for(gps_eph_iter = supl_client_ephemeris_.gps_ephemeris_map.cbegin();
+                                    gps_eph_iter != supl_client_ephemeris_.gps_ephemeris_map.cend();
                                     gps_eph_iter++)
                                 {
                                     std::cout << "SUPL: Received Ephemeris for GPS SV " << gps_eph_iter->first << std::endl;
@@ -352,9 +351,9 @@ void ControlThread::assist_GNSS()
                     error = supl_client_ephemeris_.get_assistance(supl_mcc, supl_mns, supl_lac, supl_ci);
                     if (error == 0)
                         {
-                            std::map<int,Gps_Almanac>::iterator gps_alm_iter;
-                            for(gps_alm_iter = supl_client_ephemeris_.gps_almanac_map.begin();
-                                    gps_alm_iter != supl_client_ephemeris_.gps_almanac_map.end();
+                            std::map<int,Gps_Almanac>::const_iterator gps_alm_iter;
+                            for(gps_alm_iter = supl_client_ephemeris_.gps_almanac_map.cbegin();
+                                    gps_alm_iter != supl_client_ephemeris_.gps_almanac_map.cend();
                                     gps_alm_iter++)
                                 {
                                     std::cout << "SUPL: Received Almanac for GPS SV " << gps_alm_iter->first << std::endl;
@@ -387,9 +386,9 @@ void ControlThread::assist_GNSS()
                     error = supl_client_acquisition_.get_assistance(supl_mcc, supl_mns, supl_lac, supl_ci);
                     if (error == 0)
                         {
-                            std::map<int, Gps_Acq_Assist>::iterator gps_acq_iter;
-                            for(gps_acq_iter = supl_client_acquisition_.gps_acq_map.begin();
-                                    gps_acq_iter != supl_client_acquisition_.gps_acq_map.end();
+                            std::map<int, Gps_Acq_Assist>::const_iterator gps_acq_iter;
+                            for(gps_acq_iter = supl_client_acquisition_.gps_acq_map.cbegin();
+                                    gps_acq_iter != supl_client_acquisition_.gps_acq_map.cend();
                                     gps_acq_iter++)
                                 {
                                     std::cout << "SUPL: Received Acquisition assistance for GPS SV " << gps_acq_iter->first << std::endl;
diff --git a/src/core/receiver/gnss_block_factory.cc b/src/core/receiver/gnss_block_factory.cc
index 6efe76db5..4daad0c79 100644
--- a/src/core/receiver/gnss_block_factory.cc
+++ b/src/core/receiver/gnss_block_factory.cc
@@ -69,7 +69,6 @@
 #include "notch_filter_lite.h"
 #include "gps_l1_ca_pcps_acquisition.h"
 #include "gps_l2_m_pcps_acquisition.h"
-#include "gps_l1_ca_pcps_multithread_acquisition.h"
 #include "gps_l1_ca_pcps_tong_acquisition.h"
 #include "gps_l1_ca_pcps_assisted_acquisition.h"
 #include "gps_l1_ca_pcps_acquisition_fine_doppler.h"
@@ -934,12 +933,6 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetBlock(
                     out_streams));
             block = std::move(block_);
         }
-    else if (implementation.compare("GPS_L1_CA_PCPS_Multithread_Acquisition") == 0)
-        {
-            std::unique_ptr<GNSSBlockInterface> block_(new GpsL1CaPcpsMultithreadAcquisition(configuration.get(), role, in_streams,
-                    out_streams));
-            block = std::move(block_);
-        }
 
 #if OPENCL_BLOCKS
     else if (implementation.compare("GPS_L1_CA_PCPS_OpenCl_Acquisition") == 0)
@@ -1160,12 +1153,6 @@ std::unique_ptr<AcquisitionInterface> GNSSBlockFactory::GetAcqBlock(
                     out_streams));
             block = std::move(block_);
         }
-    else if (implementation.compare("GPS_L1_CA_PCPS_Multithread_Acquisition") == 0)
-        {
-            std::unique_ptr<AcquisitionInterface> block_(new GpsL1CaPcpsMultithreadAcquisition(configuration.get(), role, in_streams,
-                    out_streams));
-            block = std::move(block_);
-        }
 
 #if OPENCL_BLOCKS
     else if (implementation.compare("GPS_L1_CA_PCPS_OpenCl_Acquisition") == 0)
diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc
index f57f3ca04..cf1788cc0 100644
--- a/src/core/receiver/gnss_flowgraph.cc
+++ b/src/core/receiver/gnss_flowgraph.cc
@@ -33,8 +33,6 @@
  */
 
 #include "gnss_flowgraph.h"
-#include "unistd.h"
-
 #include <memory>
 #include <algorithm>
 #include <exception>
@@ -80,7 +78,7 @@ void GNSSFlowgraph::start()
     {
             top_block_->start();
     }
-    catch (std::exception& e)
+    catch (const std::exception & e)
     {
             LOG(WARNING) << "Unable to start flowgraph";
             LOG(ERROR) << e.what();
@@ -123,7 +121,7 @@ void GNSSFlowgraph::connect()
             {
                     sig_source_.at(i)->connect(top_block_);
             }
-            catch (std::exception& e)
+            catch (const std::exception & e)
             {
                     LOG(INFO) << "Can't connect signal source block " << i << " internally";
                     LOG(ERROR) << e.what();
@@ -139,7 +137,7 @@ void GNSSFlowgraph::connect()
             {
                     sig_conditioner_.at(i)->connect(top_block_);
             }
-            catch (std::exception& e)
+            catch (const std::exception & e)
             {
                     LOG(INFO) << "Can't connect signal conditioner block " << i << " internally";
                     LOG(ERROR) << e.what();
@@ -154,7 +152,7 @@ void GNSSFlowgraph::connect()
             {
                     channels_.at(i)->connect(top_block_);
             }
-            catch (std::exception& e)
+            catch (const std::exception & e)
             {
                     LOG(WARNING) << "Can't connect channel " << i << " internally";
                     LOG(ERROR) << e.what();
@@ -167,7 +165,7 @@ void GNSSFlowgraph::connect()
     {
             observables_->connect(top_block_);
     }
-    catch (std::exception& e)
+    catch (const std::exception & e)
     {
             LOG(WARNING) << "Can't connect observables block internally";
             LOG(ERROR) << e.what();
@@ -180,7 +178,7 @@ void GNSSFlowgraph::connect()
     {
             pvt_->connect(top_block_);
     }
-    catch (std::exception& e)
+    catch (const std::exception & e)
     {
             LOG(WARNING) << "Can't connect PVT block internally";
             LOG(ERROR) << e.what();
@@ -248,7 +246,7 @@ void GNSSFlowgraph::connect()
                                 }
                         }
             }
-            catch (std::exception& e)
+            catch (const std::exception & e)
             {
                     LOG(WARNING)  <<  "Can't connect signal source "  <<  i << " to signal conditioner " << i;
                     LOG(ERROR) << e.what();
@@ -268,7 +266,7 @@ void GNSSFlowgraph::connect()
                     top_block_->connect(sig_conditioner_.at(selected_signal_conditioner_ID)->get_right_block(), 0,
                             channels_.at(i)->get_left_block(), 0);
             }
-            catch (std::exception& e)
+            catch (const std::exception & e)
             {
                     LOG(WARNING) << "Can't connect signal conditioner " << selected_signal_conditioner_ID << " to channel " << i;
                     LOG(ERROR) << e.what();
@@ -284,7 +282,7 @@ void GNSSFlowgraph::connect()
                     top_block_->connect(channels_.at(i)->get_right_block(), 0,
                             observables_->get_left_block(), i);
             }
-            catch (std::exception& e)
+            catch (const std::exception & e)
             {
                     LOG(WARNING) << "Can't connect channel " << i << " to observables";
                     LOG(ERROR) << e.what();
@@ -331,7 +329,7 @@ void GNSSFlowgraph::connect()
                     top_block_->msg_connect(channels_.at(i)->get_right_block(), pmt::mp("telemetry"), pvt_->get_left_block(), pmt::mp("telemetry"));
                 }
     }
-    catch (std::exception& e)
+    catch (const std::exception & e)
     {
             LOG(WARNING) << "Can't connect observables to PVT";
             LOG(ERROR) << e.what();
@@ -567,7 +565,7 @@ void GNSSFlowgraph::set_signals_list()
     /*
      * Sets a sequential list of GNSS satellites
      */
-    std::set<unsigned int>::iterator available_gnss_prn_iter;
+    std::set<unsigned int>::const_iterator available_gnss_prn_iter;
 
     /*
      * \TODO Describe GNSS satellites more nicely, with RINEX notation
@@ -651,8 +649,8 @@ void GNSSFlowgraph::set_signals_list()
             /*
              * Loop to create GPS L1 C/A signals
              */
-            for (available_gnss_prn_iter = available_gps_prn.begin();
-                    available_gnss_prn_iter != available_gps_prn.end();
+            for (available_gnss_prn_iter = available_gps_prn.cbegin();
+                    available_gnss_prn_iter != available_gps_prn.cend();
                     available_gnss_prn_iter++)
                 {
                     available_GNSS_signals_.push_back(Gnss_Signal(Gnss_Satellite(std::string("GPS"),
@@ -665,8 +663,8 @@ void GNSSFlowgraph::set_signals_list()
             /*
              * Loop to create GPS L2C M signals
              */
-            for (available_gnss_prn_iter = available_gps_prn.begin();
-                    available_gnss_prn_iter != available_gps_prn.end();
+            for (available_gnss_prn_iter = available_gps_prn.cbegin();
+                    available_gnss_prn_iter != available_gps_prn.cend();
                     available_gnss_prn_iter++)
                 {
                     available_GNSS_signals_.push_back(Gnss_Signal(Gnss_Satellite(std::string("GPS"),
@@ -679,8 +677,8 @@ void GNSSFlowgraph::set_signals_list()
             /*
              * Loop to create SBAS L1 C/A signals
              */
-            for (available_gnss_prn_iter = available_sbas_prn.begin();
-                    available_gnss_prn_iter != available_sbas_prn.end();
+            for (available_gnss_prn_iter = available_sbas_prn.cbegin();
+                    available_gnss_prn_iter != available_sbas_prn.cend();
                     available_gnss_prn_iter++)
                 {
                     available_GNSS_signals_.push_back(Gnss_Signal(Gnss_Satellite(std::string("SBAS"),
@@ -694,8 +692,8 @@ void GNSSFlowgraph::set_signals_list()
             /*
              * Loop to create the list of Galileo E1 B signals
              */
-            for (available_gnss_prn_iter = available_galileo_prn.begin();
-                    available_gnss_prn_iter != available_galileo_prn.end();
+            for (available_gnss_prn_iter = available_galileo_prn.cbegin();
+                    available_gnss_prn_iter != available_galileo_prn.cend();
                     available_gnss_prn_iter++)
                 {
                     available_GNSS_signals_.push_back(Gnss_Signal(Gnss_Satellite(std::string("Galileo"),
@@ -708,8 +706,8 @@ void GNSSFlowgraph::set_signals_list()
             /*
              * Loop to create the list of Galileo E1 B signals
              */
-            for (available_gnss_prn_iter = available_galileo_prn.begin();
-                    available_gnss_prn_iter != available_galileo_prn.end();
+            for (available_gnss_prn_iter = available_galileo_prn.cbegin();
+                    available_gnss_prn_iter != available_galileo_prn.cend();
                     available_gnss_prn_iter++)
                 {
                     available_GNSS_signals_.push_back(Gnss_Signal(Gnss_Satellite(std::string("Galileo"),
@@ -739,14 +737,14 @@ void GNSSFlowgraph::set_signals_list()
                 {
                     Gnss_Signal signal_value = Gnss_Signal(Gnss_Satellite(gnss_system, sat), gnss_signal);
                     available_GNSS_signals_.remove(signal_value);
-                    available_GNSS_signals_.insert(gnss_it, signal_value);
+                    gnss_it = available_GNSS_signals_.insert(gnss_it, signal_value);
                 }
         }
 
     //    **** FOR DEBUGGING THE LIST OF GNSS SIGNALS ****
-    //    std::list<Gnss_Signal>::iterator available_gnss_list_iter;
-    //    for (available_gnss_list_iter = available_GNSS_signals_.begin(); available_gnss_list_iter
-    //    != available_GNSS_signals_.end(); available_gnss_list_iter++)
+    //    std::list<Gnss_Signal>::const_iterator available_gnss_list_iter;
+    //    for (available_gnss_list_iter = available_GNSS_signals_.cbegin(); available_gnss_list_iter
+    //    != available_GNSS_signals_.cend(); available_gnss_list_iter++)
     //        {
     //            std::cout << *available_gnss_list_iter << std::endl;
     //        }
diff --git a/src/core/system_parameters/CMakeLists.txt b/src/core/system_parameters/CMakeLists.txt
index 68b6862cf..df419aebd 100644
--- a/src/core/system_parameters/CMakeLists.txt
+++ b/src/core/system_parameters/CMakeLists.txt
@@ -43,7 +43,7 @@ set(SYSTEM_PARAMETERS_SOURCES
 
 
 include_directories(
-     $(CMAKE_CURRENT_SOURCE_DIR)
+     ${CMAKE_CURRENT_SOURCE_DIR}
      ${CMAKE_SOURCE_DIR}/src/core/receiver
      ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs
      ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib
diff --git a/src/core/system_parameters/GPS_L1_CA.h b/src/core/system_parameters/GPS_L1_CA.h
index 58249a60c..319d918e1 100644
--- a/src/core/system_parameters/GPS_L1_CA.h
+++ b/src/core/system_parameters/GPS_L1_CA.h
@@ -69,7 +69,7 @@ const double GPS_STARTOFFSET_ms = 68.802; //[ms] Initial sign. travel time (this
 
 
 // OBSERVABLE HISTORY DEEP FOR INTERPOLATION
-const int GPS_L1_CA_HISTORY_DEEP = 100;
+const int GPS_L1_CA_HISTORY_DEEP = 500;
 
 // NAVIGATION MESSAGE DEMODULATION AND DECODING
 
diff --git a/src/core/system_parameters/galileo_ephemeris.h b/src/core/system_parameters/galileo_ephemeris.h
index a6dcc515d..c279fd649 100644
--- a/src/core/system_parameters/galileo_ephemeris.h
+++ b/src/core/system_parameters/galileo_ephemeris.h
@@ -89,7 +89,7 @@ public:
     bool E5a_DVS;              //!< E5a Data Validity Status
     double E5b_DVS_5;          //!< E5b Data Validity Status
     double E1B_DVS_5;          //!< E1B Data Validity Status
-    
+
     double BGD_E1E5a_5;        //!< E1-E5a Broadcast Group Delay [s]
     double BGD_E1E5b_5;        //!< E1-E5b Broadcast Group Delay [s]
 
@@ -116,7 +116,7 @@ public:
     /*!
      * \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the ephemeris data on disk file.
      */
-    void serialize(Archive& archive, const unsigned int version)
+    inline void serialize(Archive& archive, const unsigned int version)
     {
         using boost::serialization::make_nvp;
         if(version){};
diff --git a/src/core/system_parameters/gnss_satellite.cc b/src/core/system_parameters/gnss_satellite.cc
index c56bbe52d..2e2e18f00 100644
--- a/src/core/system_parameters/gnss_satellite.cc
+++ b/src/core/system_parameters/gnss_satellite.cc
@@ -121,9 +121,9 @@ Gnss_Satellite& Gnss_Satellite::operator=(const Gnss_Satellite &rhs) {
 void Gnss_Satellite::set_system(const std::string& system_)
 {
     // Set the satellite system {"GPS", "GLONASS", "SBAS", "Galileo", "Compass"}
-    std::set<std::string>::iterator it = system_set.find(system_);
+    std::set<std::string>::const_iterator it = system_set.find(system_);
 
-    if(it != system_set.end())
+    if(it != system_set.cend())
         {
             system = system_;
         }
diff --git a/src/core/system_parameters/gps_cnav_ephemeris.h b/src/core/system_parameters/gps_cnav_ephemeris.h
index df5d1c04f..05f2c5029 100644
--- a/src/core/system_parameters/gps_cnav_ephemeris.h
+++ b/src/core/system_parameters/gps_cnav_ephemeris.h
@@ -130,7 +130,7 @@ public:
     /*!
      * \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the ephemeris data on disk file.
      */
-    void serialize(Archive& archive, const unsigned int version)
+    inline void serialize(Archive& archive, const unsigned int version)
     {
         using boost::serialization::make_nvp;
         if(version){};
diff --git a/src/core/system_parameters/gps_cnav_iono.h b/src/core/system_parameters/gps_cnav_iono.h
index 67c1757ae..426f199cb 100644
--- a/src/core/system_parameters/gps_cnav_iono.h
+++ b/src/core/system_parameters/gps_cnav_iono.h
@@ -63,7 +63,7 @@ public:
     /*!
      * \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the ephemeris data on disk file.
      */
-    void serialize(Archive& archive, const unsigned int version)
+    inline void serialize(Archive& archive, const unsigned int version) const
     {
         using boost::serialization::make_nvp;
         if(version){};
diff --git a/src/core/system_parameters/gps_cnav_navigation_message.cc b/src/core/system_parameters/gps_cnav_navigation_message.cc
index 5b3652387..cf49bba50 100644
--- a/src/core/system_parameters/gps_cnav_navigation_message.cc
+++ b/src/core/system_parameters/gps_cnav_navigation_message.cc
@@ -68,6 +68,7 @@ Gps_CNAV_Navigation_Message::Gps_CNAV_Navigation_Message()
             satelliteBlock[prn_] = gnss_satellite_.what_block("GPS", prn_);
         }
     b_flag_iono_valid = false;
+    b_flag_utc_valid = false;
 }
 
 
diff --git a/src/core/system_parameters/gps_cnav_utc_model.h b/src/core/system_parameters/gps_cnav_utc_model.h
index da50b7ffe..b595a4439 100644
--- a/src/core/system_parameters/gps_cnav_utc_model.h
+++ b/src/core/system_parameters/gps_cnav_utc_model.h
@@ -71,7 +71,7 @@ public:
     /*
      * \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the ephemeris data on disk file.
      */
-    void serialize(Archive& archive, const unsigned int version)
+    inline void serialize(Archive& archive, const unsigned int version)
     {
         using boost::serialization::make_nvp;
         if(version){};
diff --git a/src/core/system_parameters/gps_ephemeris.h b/src/core/system_parameters/gps_ephemeris.h
index c71fde0b6..0a413a927 100644
--- a/src/core/system_parameters/gps_ephemeris.h
+++ b/src/core/system_parameters/gps_ephemeris.h
@@ -132,7 +132,7 @@ public:
     /*!
      * \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the ephemeris data on disk file.
      */
-    void serialize(Archive& archive, const unsigned int version)
+    inline void serialize(Archive& archive, const unsigned int version)
     {
         using boost::serialization::make_nvp;
         if(version){};
@@ -199,7 +199,6 @@ public:
      */
     double sv_clock_relativistic_term(double transmitTime);
 
-
     /*!
      * Default constructor
      */
diff --git a/src/core/system_parameters/gps_iono.h b/src/core/system_parameters/gps_iono.h
index 0544c90a2..a7e59c02b 100644
--- a/src/core/system_parameters/gps_iono.h
+++ b/src/core/system_parameters/gps_iono.h
@@ -63,7 +63,7 @@ public:
     /*!
      * \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the ephemeris data on disk file.
      */
-    void serialize(Archive& archive, const unsigned int version)
+    inline void serialize(Archive& archive, const unsigned int version)
     {
         using boost::serialization::make_nvp;
         if(version){};
diff --git a/src/core/system_parameters/gps_ref_location.h b/src/core/system_parameters/gps_ref_location.h
index ecd824895..1aa734088 100644
--- a/src/core/system_parameters/gps_ref_location.h
+++ b/src/core/system_parameters/gps_ref_location.h
@@ -57,7 +57,7 @@ public:
     /*!
      * \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the Ref location on disk file.
      */
-    void serialize(Archive& archive, const unsigned int version)
+    inline void serialize(Archive& archive, const unsigned int version)
         {
             using boost::serialization::make_nvp;
             if(version){};
diff --git a/src/core/system_parameters/gps_ref_time.h b/src/core/system_parameters/gps_ref_time.h
index 4ef7bef47..fbb246ad3 100644
--- a/src/core/system_parameters/gps_ref_time.h
+++ b/src/core/system_parameters/gps_ref_time.h
@@ -58,7 +58,7 @@ public:
     /*!
      * \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the ref time data on disk file.
      */
-    void serialize(Archive& archive, const unsigned int version)
+    inline void serialize(Archive& archive, const unsigned int version)
     {
         using boost::serialization::make_nvp;
         if(version){};
diff --git a/src/core/system_parameters/gps_utc_model.h b/src/core/system_parameters/gps_utc_model.h
index 54df8b1bf..0d1c48285 100644
--- a/src/core/system_parameters/gps_utc_model.h
+++ b/src/core/system_parameters/gps_utc_model.h
@@ -64,7 +64,7 @@ public:
     /*
      * \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the ephemeris data on disk file.
      */
-    void serialize(Archive& archive, const unsigned int version)
+    inline void serialize(Archive& archive, const unsigned int version)
     {
         using boost::serialization::make_nvp;
         if(version){};
diff --git a/src/core/system_parameters/rtcm.cc b/src/core/system_parameters/rtcm.cc
index 7f1eaa8ad..9999b3671 100644
--- a/src/core/system_parameters/rtcm.cc
+++ b/src/core/system_parameters/rtcm.cc
@@ -65,11 +65,11 @@ Rtcm::~Rtcm()
             {
                     stop_server();
             }
-            catch( boost::exception & e )
+            catch(const boost::exception & e)
             {
                     LOG(WARNING) << "Boost exception: " << boost::diagnostic_information(e);
             }
-            catch(std::exception const&  ex)
+            catch(const std::exception & ex)
             {
                     LOG(WARNING) << "STD exception: " << ex.what();
             }
@@ -95,7 +95,7 @@ void Rtcm::run_server()
             server_is_running = true;
             t.detach();
     }
-    catch (std::exception& e)
+    catch (const std::exception & e)
     {
             std::cerr << "Exception: " << e.what() << "\n";
     }
@@ -462,8 +462,8 @@ std::string Rtcm::print_MT1001(const Gps_Ephemeris & gps_eph, double obs_time, c
     std::map<int, Gnss_Synchro> observablesL1;
     std::map<int, Gnss_Synchro>::const_iterator observables_iter;
 
-    for(observables_iter = observables.begin();
-            observables_iter != observables.end();
+    for(observables_iter = observables.cbegin();
+            observables_iter != observables.cend();
             observables_iter++)
         {
             std::string system_(&observables_iter->second.System, 1);
@@ -477,8 +477,8 @@ std::string Rtcm::print_MT1001(const Gps_Ephemeris & gps_eph, double obs_time, c
     std::bitset<64> header = Rtcm::get_MT1001_4_header(1001, obs_time, observablesL1, ref_id, smooth_int, sync_flag, divergence_free);
     std::string data = header.to_string();
 
-    for(observables_iter = observablesL1.begin();
-            observables_iter != observablesL1.end();
+    for(observables_iter = observablesL1.cbegin();
+            observables_iter != observablesL1.cend();
             observables_iter++)
         {
             std::bitset<58> content = Rtcm::get_MT1001_sat_content(gps_eph, obs_time, observables_iter->second);
@@ -512,8 +512,8 @@ std::string Rtcm::print_MT1002(const Gps_Ephemeris & gps_eph, double obs_time, c
     std::map<int, Gnss_Synchro> observablesL1;
     std::map<int, Gnss_Synchro>::const_iterator observables_iter;
 
-    for(observables_iter = observables.begin();
-            observables_iter != observables.end();
+    for(observables_iter = observables.cbegin();
+            observables_iter != observables.cend();
             observables_iter++)
         {
             std::string system_(&observables_iter->second.System, 1);
@@ -527,8 +527,8 @@ std::string Rtcm::print_MT1002(const Gps_Ephemeris & gps_eph, double obs_time, c
     std::bitset<64> header = Rtcm::get_MT1001_4_header(1002, obs_time, observablesL1, ref_id, smooth_int, sync_flag, divergence_free);
     std::string data = header.to_string();
 
-    for(observables_iter = observablesL1.begin();
-            observables_iter != observablesL1.end();
+    for(observables_iter = observablesL1.cbegin();
+            observables_iter != observablesL1.cend();
             observables_iter++)
         {
             std::bitset<74> content = Rtcm::get_MT1002_sat_content(gps_eph, obs_time, observables_iter->second);
@@ -586,8 +586,8 @@ std::string Rtcm::print_MT1003(const Gps_Ephemeris & ephL1, const Gps_CNAV_Ephem
     std::map<int, Gnss_Synchro>::const_iterator observables_iter;
     std::map<int, Gnss_Synchro>::const_iterator observables_iter2;
 
-    for(observables_iter = observables.begin();
-            observables_iter != observables.end();
+    for(observables_iter = observables.cbegin();
+            observables_iter != observables.cend();
             observables_iter++)
         {
             std::string system_(&observables_iter->second.System, 1);
@@ -607,13 +607,13 @@ std::string Rtcm::print_MT1003(const Gps_Ephemeris & ephL1, const Gps_CNAV_Ephem
     std::vector< std::pair< Gnss_Synchro, Gnss_Synchro > >::const_iterator common_observables_iter;
     std::map<int, Gnss_Synchro> observablesL1_with_L2;
 
-    for(observables_iter = observablesL1.begin();
-            observables_iter != observablesL1.end();
+    for(observables_iter = observablesL1.cbegin();
+            observables_iter != observablesL1.cend();
             observables_iter++)
         {
             unsigned int prn_ = observables_iter->second.PRN;
-            for(observables_iter2 = observablesL2.begin();
-                    observables_iter2 != observablesL2.end();
+            for(observables_iter2 = observablesL2.cbegin();
+                    observables_iter2 != observablesL2.cend();
                     observables_iter2++)
                 {
                     if(observables_iter2->second.PRN == prn_)
@@ -631,8 +631,8 @@ std::string Rtcm::print_MT1003(const Gps_Ephemeris & ephL1, const Gps_CNAV_Ephem
     std::bitset<64> header = Rtcm::get_MT1001_4_header(1003, obs_time, observablesL1_with_L2, ref_id, smooth_int, sync_flag, divergence_free);
     std::string data = header.to_string();
 
-    for(common_observables_iter = common_observables.begin();
-            common_observables_iter != common_observables.end();
+    for(common_observables_iter = common_observables.cbegin();
+            common_observables_iter != common_observables.cend();
             common_observables_iter++)
         {
             std::bitset<101> content = Rtcm::get_MT1003_sat_content(ephL1, ephL2, obs_time, common_observables_iter->first, common_observables_iter->second);
@@ -696,8 +696,8 @@ std::string Rtcm::print_MT1004(const Gps_Ephemeris & ephL1, const Gps_CNAV_Ephem
     std::map<int, Gnss_Synchro>::const_iterator observables_iter;
     std::map<int, Gnss_Synchro>::const_iterator observables_iter2;
 
-    for(observables_iter = observables.begin();
-            observables_iter != observables.end();
+    for(observables_iter = observables.cbegin();
+            observables_iter != observables.cend();
             observables_iter++)
         {
             std::string system_(&observables_iter->second.System, 1);
@@ -717,13 +717,13 @@ std::string Rtcm::print_MT1004(const Gps_Ephemeris & ephL1, const Gps_CNAV_Ephem
     std::vector< std::pair< Gnss_Synchro, Gnss_Synchro > >::const_iterator common_observables_iter;
     std::map<int, Gnss_Synchro> observablesL1_with_L2;
 
-    for(observables_iter = observablesL1.begin();
-            observables_iter != observablesL1.end();
+    for(observables_iter = observablesL1.cbegin();
+            observables_iter != observablesL1.cend();
             observables_iter++)
         {
             unsigned int prn_ = observables_iter->second.PRN;
-            for(observables_iter2 = observablesL2.begin();
-                    observables_iter2 != observablesL2.end();
+            for(observables_iter2 = observablesL2.cbegin();
+                    observables_iter2 != observablesL2.cend();
                     observables_iter2++)
                 {
                     if(observables_iter2->second.PRN == prn_)
@@ -741,8 +741,8 @@ std::string Rtcm::print_MT1004(const Gps_Ephemeris & ephL1, const Gps_CNAV_Ephem
     std::bitset<64> header = Rtcm::get_MT1001_4_header(1004, obs_time, observablesL1_with_L2, ref_id, smooth_int, sync_flag, divergence_free);
     std::string data = header.to_string();
 
-    for(common_observables_iter = common_observables.begin();
-            common_observables_iter != common_observables.end();
+    for(common_observables_iter = common_observables.cbegin();
+            common_observables_iter != common_observables.cend();
             common_observables_iter++)
         {
             std::bitset<125> content = Rtcm::get_MT1004_sat_content(ephL1, ephL2, obs_time, common_observables_iter->first, common_observables_iter->second);
@@ -1037,7 +1037,7 @@ std::string Rtcm::print_MT1008(unsigned int ref_id, const std::string & antenna_
     DF029 = std::bitset<8>(len);
 
     std::string DF030_str_;
-    for(auto it = ant_descriptor.begin(); it != ant_descriptor.end(); it++)
+    for(auto it = ant_descriptor.cbegin(); it != ant_descriptor.cend(); it++)
         {
             char c = *it;
             std::bitset<8> character = std::bitset<8>(c);
@@ -1056,7 +1056,7 @@ std::string Rtcm::print_MT1008(unsigned int ref_id, const std::string & antenna_
     DF032 = std::bitset<8>(len2);
 
     std::string DF033_str_;
-    for(auto it = ant_sn.begin(); it != ant_sn.end(); it++)
+    for(auto it = ant_sn.cbegin(); it != ant_sn.cend(); it++)
         {
             char c = *it;
             std::bitset<8> character = std::bitset<8>(c);
@@ -1317,7 +1317,7 @@ std::string Rtcm::print_MT1029(unsigned int ref_id, const Gps_Ephemeris & gps_ep
     unsigned int i = 0;
     bool first = true;
     std::string text_binary;
-    for(auto it = message.begin(); it != message.end(); it++)
+    for(auto it = message.cbegin(); it != message.cend(); it++)
         {
             char c = *it;
             if(isgraph(c))
@@ -1684,8 +1684,8 @@ std::string Rtcm::get_MSM_1_content_sat_data(const std::map<int, Gnss_Synchro> &
     std::vector<unsigned int> pos;
     std::vector<unsigned int>::iterator it;
 
-    for(gnss_synchro_iter = observables.begin();
-            gnss_synchro_iter != observables.end();
+    for(gnss_synchro_iter = observables.cbegin();
+            gnss_synchro_iter != observables.cend();
             gnss_synchro_iter++)
         {
             it = std::find(pos.begin(), pos.end(), 65 - gnss_synchro_iter->second.PRN);
@@ -1717,8 +1717,8 @@ std::string Rtcm::get_MSM_1_content_signal_data(const std::map<int, Gnss_Synchro
     std::vector<std::pair<int, Gnss_Synchro> > observables_vector;
     std::map<int, Gnss_Synchro>::const_iterator map_iter;
 
-    for(map_iter = observables.begin();
-            map_iter != observables.end();
+    for(map_iter = observables.cbegin();
+            map_iter != observables.cend();
             map_iter++)
         {
             observables_vector.push_back(*map_iter);
@@ -1806,8 +1806,8 @@ std::string Rtcm::get_MSM_2_content_signal_data(const Gps_Ephemeris & ephNAV, co
     std::vector<std::pair<int, Gnss_Synchro> > observables_vector;
     std::map<int, Gnss_Synchro>::const_iterator map_iter;
 
-    for(map_iter = observables.begin();
-            map_iter != observables.end();
+    for(map_iter = observables.cbegin();
+            map_iter != observables.cend();
             map_iter++)
         {
             observables_vector.push_back(*map_iter);
@@ -1902,8 +1902,8 @@ std::string Rtcm::get_MSM_3_content_signal_data(const Gps_Ephemeris & ephNAV, co
     std::vector<std::pair<int, Gnss_Synchro> > observables_vector;
     std::map<int, Gnss_Synchro>::const_iterator map_iter;
 
-    for(map_iter = observables.begin();
-            map_iter != observables.end();
+    for(map_iter = observables.cbegin();
+            map_iter != observables.cend();
             map_iter++)
         {
             observables_vector.push_back(*map_iter);
@@ -2000,8 +2000,8 @@ std::string Rtcm::get_MSM_4_content_sat_data(const std::map<int, Gnss_Synchro> &
     std::vector<unsigned int> pos;
     std::vector<unsigned int>::iterator it;
 
-    for(gnss_synchro_iter = observables.begin();
-            gnss_synchro_iter != observables.end();
+    for(gnss_synchro_iter = observables.cbegin();
+            gnss_synchro_iter != observables.cend();
             gnss_synchro_iter++)
         {
             it = std::find(pos.begin(), pos.end(), 65 - gnss_synchro_iter->second.PRN);
@@ -2040,8 +2040,8 @@ std::string Rtcm::get_MSM_4_content_signal_data(const Gps_Ephemeris & ephNAV, co
     std::vector<std::pair<int, Gnss_Synchro> > observables_vector;
     std::map<int, Gnss_Synchro>::const_iterator map_iter;
 
-    for(map_iter = observables.begin();
-            map_iter != observables.end();
+    for(map_iter = observables.cbegin();
+            map_iter != observables.cend();
             map_iter++)
         {
             observables_vector.push_back(*map_iter);
@@ -2142,8 +2142,8 @@ std::string Rtcm::get_MSM_5_content_sat_data(const std::map<int, Gnss_Synchro> &
     std::vector<unsigned int> pos;
     std::vector<unsigned int>::iterator it;
 
-    for(gnss_synchro_iter = observables.begin();
-            gnss_synchro_iter != observables.end();
+    for(gnss_synchro_iter = observables.cbegin();
+            gnss_synchro_iter != observables.cend();
             gnss_synchro_iter++)
         {
             it = std::find(pos.begin(), pos.end(), 65 - gnss_synchro_iter->second.PRN);
@@ -2187,8 +2187,8 @@ std::string Rtcm::get_MSM_5_content_signal_data(const Gps_Ephemeris & ephNAV, co
     std::vector<std::pair<int, Gnss_Synchro> > observables_vector;
     std::map<int, Gnss_Synchro>::const_iterator map_iter;
 
-    for(map_iter = observables.begin();
-            map_iter != observables.end();
+    for(map_iter = observables.cbegin();
+            map_iter != observables.cend();
             map_iter++)
         {
             observables_vector.push_back(*map_iter);
@@ -2290,8 +2290,8 @@ std::string Rtcm::get_MSM_6_content_signal_data(const Gps_Ephemeris & ephNAV, co
     std::vector<std::pair<int, Gnss_Synchro> > observables_vector;
     std::map<int, Gnss_Synchro>::const_iterator map_iter;
 
-    for(map_iter = observables.begin();
-            map_iter != observables.end();
+    for(map_iter = observables.cbegin();
+            map_iter != observables.cend();
             map_iter++)
         {
             observables_vector.push_back(*map_iter);
@@ -2392,8 +2392,8 @@ std::string Rtcm::get_MSM_7_content_signal_data(const Gps_Ephemeris & ephNAV, co
     std::vector<std::pair<int, Gnss_Synchro> > observables_vector;
     std::map<int, Gnss_Synchro>::const_iterator map_iter;
 
-    for(map_iter = observables.begin();
-            map_iter != observables.end();
+    for(map_iter = observables.cbegin();
+            map_iter != observables.cend();
             map_iter++)
         {
             observables_vector.push_back(*map_iter);
@@ -2442,8 +2442,8 @@ std::vector<std::pair<int, Gnss_Synchro> > Rtcm::sort_by_PRN_mask(const std::vec
         }
     } has_lower_pos;
 
-    for(synchro_map_iter = synchro_map.begin();
-            synchro_map_iter != synchro_map.end();
+    for(synchro_map_iter = synchro_map.cbegin();
+            synchro_map_iter != synchro_map.cend();
             synchro_map_iter++)
 
         {
@@ -2499,8 +2499,8 @@ std::vector<std::pair<int, Gnss_Synchro> > Rtcm::sort_by_signal(const std::vecto
     } has_lower_signalID;
 
 
-    for(synchro_map_iter = synchro_map.begin();
-            synchro_map_iter != synchro_map.end();
+    for(synchro_map_iter = synchro_map.cbegin();
+            synchro_map_iter != synchro_map.cend();
             synchro_map_iter++)
 
         {
@@ -2785,8 +2785,8 @@ int Rtcm::set_DF006(const std::map<int, Gnss_Synchro> & observables)
     //Number of satellites observed in current epoch
     unsigned short int nsats = 0;
     std::map<int, Gnss_Synchro>::const_iterator observables_iter;
-    for(observables_iter = observables.begin();
-            observables_iter != observables.end();
+    for(observables_iter = observables.cbegin();
+            observables_iter != observables.cend();
             observables_iter++)
         {
             nsats++;
@@ -3566,8 +3566,8 @@ int Rtcm::set_DF394(const std::map<int, Gnss_Synchro> & gnss_synchro)
     DF394.reset();
     std::map<int, Gnss_Synchro>::const_iterator gnss_synchro_iter;
     unsigned int mask_position;
-    for(gnss_synchro_iter = gnss_synchro.begin();
-            gnss_synchro_iter != gnss_synchro.end();
+    for(gnss_synchro_iter = gnss_synchro.cbegin();
+            gnss_synchro_iter != gnss_synchro.cend();
             gnss_synchro_iter++)
         {
             mask_position = 64 - gnss_synchro_iter->second.PRN;
@@ -3587,8 +3587,8 @@ int Rtcm::set_DF395(const std::map<int, Gnss_Synchro> & gnss_synchro)
     std::map<int, Gnss_Synchro>::const_iterator gnss_synchro_iter;
     std::string sig;
     unsigned int mask_position;
-    for(gnss_synchro_iter = gnss_synchro.begin();
-            gnss_synchro_iter != gnss_synchro.end();
+    for(gnss_synchro_iter = gnss_synchro.cbegin();
+            gnss_synchro_iter != gnss_synchro.cend();
             gnss_synchro_iter++)
         {
             std::string sig_(gnss_synchro_iter->second.Signal);
@@ -3654,8 +3654,8 @@ std::string Rtcm::set_DF396(const std::map<int, Gnss_Synchro> & observables)
     std::vector<unsigned int> list_of_sats;
     std::vector<int> list_of_signals;
 
-    for(observables_iter = observables.begin();
-            observables_iter != observables.end();
+    for(observables_iter = observables.cbegin();
+            observables_iter != observables.cend();
             observables_iter++)
         {
             list_of_sats.push_back(observables_iter->second.PRN);
@@ -3708,8 +3708,8 @@ std::string Rtcm::set_DF396(const std::map<int, Gnss_Synchro> & observables)
             for(unsigned int sat = 0; sat < num_satellites; sat++)
                 {
                     value = false;
-                    for(observables_iter = observables.begin();
-                            observables_iter != observables.end();
+                    for(observables_iter = observables.cbegin();
+                            observables_iter != observables.cend();
                             observables_iter++)
                         {
                             std::string sig_(observables_iter->second.Signal);
diff --git a/src/core/system_parameters/rtcm.h b/src/core/system_parameters/rtcm.h
index 37cdab1f4..8b3333ffe 100644
--- a/src/core/system_parameters/rtcm.h
+++ b/src/core/system_parameters/rtcm.h
@@ -368,7 +368,7 @@ private:
             return data_;
         }
 
-        std::size_t length() const
+        inline std::size_t length() const
         {
             return header_length + body_length_;
         }
@@ -395,7 +395,7 @@ private:
                 body_length_ = max_body_length;
         }
 
-        bool decode_header()
+        inline bool decode_header()
         {
             char header[header_length + 1] = "";
             std::strncat(header, data_, header_length);
@@ -420,7 +420,7 @@ private:
             return true;
         }
 
-        void encode_header()
+        inline void encode_header()
         {
             char header[header_length + 1] = "";
             std::sprintf(header, "GS%4d", static_cast<int>(body_length_));
@@ -444,19 +444,19 @@ private:
     class Rtcm_Listener_Room
     {
     public:
-        void join(std::shared_ptr<Rtcm_Listener> participant)
+        inline void join(std::shared_ptr<Rtcm_Listener> participant)
         {
             participants_.insert(participant);
             for (auto msg: recent_msgs_)
                 participant->deliver(msg);
         }
 
-        void leave(std::shared_ptr<Rtcm_Listener> participant)
+        inline void leave(std::shared_ptr<Rtcm_Listener> participant)
         {
             participants_.erase(participant);
         }
 
-        void deliver(const Rtcm_Message & msg)
+        inline void deliver(const Rtcm_Message & msg)
         {
             recent_msgs_.push_back(msg);
             while (recent_msgs_.size() > max_recent_msgs)
@@ -480,13 +480,13 @@ private:
     public:
         Rtcm_Session(boost::asio::ip::tcp::socket socket, Rtcm_Listener_Room & room) : socket_(std::move(socket)), room_(room)   { }
 
-        void start()
+        inline void start()
         {
             room_.join(shared_from_this());
             do_read_message_header();
         }
 
-        void deliver(const Rtcm_Message & msg)
+        inline void deliver(const Rtcm_Message & msg)
         {
             bool write_in_progress = !write_msgs_.empty();
             write_msgs_.push_back(msg);
@@ -497,7 +497,7 @@ private:
         }
 
     private:
-        void do_read_message_header()
+        inline void do_read_message_header()
         {
             auto self(shared_from_this());
             boost::asio::async_read(socket_,
@@ -532,7 +532,7 @@ private:
                     });
         }
 
-        void do_read_message_body()
+        inline void do_read_message_body()
         {
             auto self(shared_from_this());
             boost::asio::async_read(socket_,
@@ -555,7 +555,7 @@ private:
                     });
         }
 
-        void do_write()
+        inline void do_write()
         {
             auto self(shared_from_this());
             boost::asio::async_write(socket_,
@@ -597,12 +597,12 @@ private:
             do_connect(endpoint_iterator);
     }
 
-        void close()
+        inline void close()
         {
             io_service_.post([this]() { socket_.close(); });
         }
 
-        void write(const Rtcm_Message & msg)
+        inline void write(const Rtcm_Message & msg)
         {
             io_service_.post(
                     [this, msg]()
@@ -617,7 +617,7 @@ private:
         }
 
     private:
-        void do_connect(boost::asio::ip::tcp::resolver::iterator endpoint_iterator)
+        inline void do_connect(boost::asio::ip::tcp::resolver::iterator endpoint_iterator)
         {
             boost::asio::async_connect(socket_, endpoint_iterator,
                     [this](boost::system::error_code ec, boost::asio::ip::tcp::resolver::iterator)
@@ -633,7 +633,7 @@ private:
                     });
         }
 
-        void do_read_message()
+        inline void do_read_message()
         {
             boost::asio::async_read(socket_,
                     boost::asio::buffer(read_msg_.data(), 1029),
@@ -651,9 +651,8 @@ private:
                     });
         }
 
-        void do_write()
+        inline void do_write()
         {
-
             boost::asio::async_write(socket_,
                     boost::asio::buffer(write_msgs_.front().data(), write_msgs_.front().length()),
                     [this](boost::system::error_code ec, std::size_t /*length*/)
@@ -692,7 +691,7 @@ private:
             c = std::make_shared<Tcp_Internal_Client>(io_service, queue_endpoint_iterator);
     }
 
-        void do_read_queue()
+        inline void do_read_queue()
         {
             for(;;)
                 {
@@ -726,14 +725,14 @@ private:
             do_accept();
     }
 
-        void close_server()
+        inline void close_server()
         {
             socket_.close();
             acceptor_.close();
         }
 
     private:
-        void do_accept()
+        inline void do_accept()
         {
             acceptor_.async_accept(socket_, [this](boost::system::error_code ec)
                     {
@@ -766,7 +765,6 @@ private:
         bool first_client = true;
     };
 
-
     boost::asio::io_service io_service;
     std::shared_ptr< concurrent_queue<std::string> > rtcm_message_queue;
     std::thread t;
diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt
index 6a8e42a1b..e1c2870cb 100644
--- a/src/main/CMakeLists.txt
+++ b/src/main/CMakeLists.txt
@@ -71,7 +71,7 @@ add_definitions( -DGNSS_SDR_VERSION="${VERSION}" )
 
 if(OS_IS_MACOSX)
      if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-         set(MAC_LIBRARIES "-stdlib=libc++ -std=c++11 -framework Accelerate -lc++")
+         set(MAC_LIBRARIES "-framework Accelerate -lc++")
      endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
 endif(OS_IS_MACOSX)
 
diff --git a/src/main/main.cc b/src/main/main.cc
index 59d92d01a..ede009fb9 100644
--- a/src/main/main.cc
+++ b/src/main/main.cc
@@ -38,8 +38,8 @@
 #define GOOGLE_STRIP_LOG 0
 #endif
 
-#include <ctime>
-#include <cstdlib>
+#include <chrono>
+#include <iostream>
 #include <memory>
 #include <boost/exception/diagnostic_information.hpp>
 #include <boost/exception_ptr.hpp>
@@ -102,7 +102,7 @@ int main(int argc, char** argv)
             google::InitGoogleLogging(argv[0]);
             if (FLAGS_log_dir.empty())
                 {
-                    std::cout << "Logging will be done at "
+                    std::cout << "Logging will be written at "
                               << boost::filesystem::temp_directory_path()
                               << std::endl
                               << "Use gnss-sdr --log_dir=/path/to/log to change that."
@@ -118,46 +118,73 @@ int main(int argc, char** argv)
                                       << " does not exist, attempting to create it."
                                       << std::endl;
                             boost::system::error_code ec;
-                            boost::filesystem::create_directory(p, ec);
-                            if(ec != 0)
+                            if(!boost::filesystem::create_directory(p, ec))
                                 {
                                     std::cout << "Could not create the " << FLAGS_log_dir << " folder. GNSS-SDR program ended." << std::endl;
                                     google::ShutDownCommandLineFlags();
-                                    std::exit(0);
+                                    return 1;
                                 }
                         }
-                    std::cout << "Logging with be done at " << FLAGS_log_dir << std::endl;
+                    std::cout << "Logging will be written at " << FLAGS_log_dir << std::endl;
                 }
         }
 
     std::unique_ptr<ControlThread> control_thread(new ControlThread());
 
     // record startup time
-    struct timeval tv;
-    gettimeofday(&tv, NULL);
-    long long int begin = tv.tv_sec * 1000000 + tv.tv_usec;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    start = std::chrono::system_clock::now();
 
     try
     {
             control_thread->run();
     }
-    catch( boost::exception & e )
+    catch(const boost::exception & e)
     {
-            LOG(FATAL) << "Boost exception: " << boost::diagnostic_information(e);
+            if(GOOGLE_STRIP_LOG == 0)
+                {
+                    LOG(WARNING) << "Boost exception: " << boost::diagnostic_information(e);
+                }
+            else
+                {
+                    std::cerr << "Boost exception: " << boost::diagnostic_information(e) << std::endl;
+                }
+            google::ShutDownCommandLineFlags();
+            return 1;
     }
-    catch(std::exception const&  ex)
+    catch(const std::exception & ex)
     {
-            LOG(FATAL) << "STD exception: " << ex.what();
+            if(GOOGLE_STRIP_LOG == 0)
+                {
+                    LOG(WARNING) << "C++ Standard Library exception: " << ex.what();
+                }
+            else
+                {
+                    std::cerr << "C++ Standard Library exception: " << ex.what() << std::endl;
+                }
+            google::ShutDownCommandLineFlags();
+            return 1;
     }
     catch(...)
     {
-            LOG(INFO) << "Unexpected catch";
+            if(GOOGLE_STRIP_LOG == 0)
+                {
+                    LOG(WARNING) << "Unexpected catch. This should not happen.";
+                }
+            else
+                {
+                    std::cerr << "Unexpected catch. This should not happen." << std::endl;
+                }
+            google::ShutDownCommandLineFlags();
+            return 1;
     }
+
     // report the elapsed time
-    gettimeofday(&tv, NULL);
-    long long int end = tv.tv_sec * 1000000 + tv.tv_usec;
-    std::cout << "Total GNSS-SDR run time "
-              << (static_cast<double>(end - begin)) / 1000000.0
+    end = std::chrono::system_clock::now();
+    std::chrono::duration<double> elapsed_seconds = end - start;
+
+    std::cout << "Total GNSS-SDR run time: "
+              << elapsed_seconds.count()
               << " [seconds]" << std::endl;
 
     google::ShutDownCommandLineFlags();
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
index d48c6eda0..4403d3616 100644
--- a/src/tests/CMakeLists.txt
+++ b/src/tests/CMakeLists.txt
@@ -48,7 +48,9 @@ endif(EXISTS $ENV{OECORE_TARGET_SYSROOT})
 if(NOT ${GTEST_DIR_LOCAL})
      # if GTEST_DIR is not defined, we download and build it
      set(gtest_RELEASE 1.8.0)
-     ExternalProject_Add(
+
+     if(CMAKE_VERSION VERSION_LESS 3.2)
+      ExternalProject_Add(
          gtest-${gtest_RELEASE}
          GIT_REPOSITORY https://github.com/google/googletest
          GIT_TAG release-${gtest_RELEASE}
@@ -58,7 +60,23 @@ if(NOT ${GTEST_DIR_LOCAL})
          UPDATE_COMMAND ""
          PATCH_COMMAND ""
          INSTALL_COMMAND ""
-     )
+      )
+     else(CMAKE_VERSION VERSION_LESS 3.2)
+      ExternalProject_Add(
+         gtest-${gtest_RELEASE}
+         GIT_REPOSITORY https://github.com/google/googletest
+         GIT_TAG release-${gtest_RELEASE}
+         SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gtest/gtest-${gtest_RELEASE}
+         BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${gtest_RELEASE}
+         CMAKE_ARGS ${GTEST_COMPILER} -DBUILD_GTEST=ON -DBUILD_GMOCK=OFF ${TOOLCHAIN_ARG}
+         UPDATE_COMMAND ""
+         PATCH_COMMAND ""
+         BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${gtest_RELEASE}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
+                          ${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${gtest_RELEASE}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}
+         INSTALL_COMMAND ""
+      )
+     endif(CMAKE_VERSION VERSION_LESS 3.2)
+
      # Set up variables
      # Set recently downloaded and build Googletest root folder
      set(GTEST_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gtest/gtest-${gtest_RELEASE}/googletest")
@@ -73,11 +91,11 @@ if(NOT ${GTEST_DIR_LOCAL})
              set(binary_dir "${binary_dir}/Debug")
          endif(CMAKE_GENERATOR STREQUAL Xcode)
      endif(OS_IS_MACOSX)
-     set(GTEST_LIBRARY_PATH "${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest.a;${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main.a")
+     set(GTEST_LIBRARY_PATH "${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX};${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}")
      set(GTEST_LIBRARY gtest-${gtest_RELEASE})
      set(GTEST_LIBRARIES
-          ${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest.a
-          ${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main.a
+          ${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
+          ${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}
      )
      set(GTEST_LIB_DIR "${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${gtest_RELEASE}/googletest")
 else(NOT ${GTEST_DIR_LOCAL})
@@ -123,7 +141,9 @@ if(OPENSSL_FOUND)
 endif(OPENSSL_FOUND)
 
 if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-    set(CLANG_FLAGS "-stdlib=libc++ -std=c++11 -lc++")
+    if(OS_IS_MACOSX)
+       set(CLANG_FLAGS "-stdlib=libc++ -lc++")
+    endif(OS_IS_MACOSX)
 endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
 
 if(OPENCL_FOUND)
@@ -183,7 +203,9 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA)
    if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK)
       if(NOT ENABLE_FPGA)
           set(gpstk_RELEASE "2.9")
-          ExternalProject_Add(
+
+          if(CMAKE_VERSION VERSION_LESS 3.2)
+           ExternalProject_Add(
              gpstk-${gpstk_RELEASE}
              GIT_REPOSITORY https://github.com/SGL-UT/GPSTk
              GIT_TAG v${gpstk_RELEASE}
@@ -192,7 +214,21 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA)
              CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} -DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${gpstk_RELEASE}/install -DBUILD_EXT=OFF -DBUILD_PYTHON=OFF
              UPDATE_COMMAND ""
              PATCH_COMMAND ""
-          )
+           )
+          else(CMAKE_VERSION VERSION_LESS 3.2)
+           ExternalProject_Add(
+             gpstk-${gpstk_RELEASE}
+             GIT_REPOSITORY https://github.com/SGL-UT/GPSTk
+             GIT_TAG v${gpstk_RELEASE}
+             SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${gpstk_RELEASE}
+             BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gpstk-${gpstk_RELEASE}
+             CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} -DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${gpstk_RELEASE}/install -DBUILD_EXT=OFF -DBUILD_PYTHON=OFF
+             BUILD_BYPRODUCTS ${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${gpstk_RELEASE}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}
+             UPDATE_COMMAND ""
+             PATCH_COMMAND ""
+           )
+          endif(CMAKE_VERSION VERSION_LESS 3.2)
+
           set(GPSTK_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${gpstk_RELEASE}/install/include CACHE PATH "Local GPSTK headers")
           add_library(gpstk UNKNOWN IMPORTED)
           set_property(TARGET gpstk PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${gpstk_RELEASE}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX})
@@ -204,7 +240,7 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA)
       else(NOT ENABLE_FPGA)
           message(STATUS "GPSTk has not been found, try to install it on target.")
           message(STATUS "Some extra tests requiring GPSTk will not be built.")
-      endif(NOT ENABLE_FPGA)    
+      endif(NOT ENABLE_FPGA)
    else(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK)
        set(gpstk_libs ${GPSTK_LIBRARIES})
        set(GPSTK_INCLUDE_DIRS ${GPSTK_INCLUDE_DIR})
@@ -220,7 +256,7 @@ if(ENABLE_UNIT_TESTING_EXTRA)
       message(STATUS "Downloading some data files for testing...")
       file(DOWNLOAD https://sourceforge.net/projects/gnss-sdr/files/data/gps_l2c_m_prn7_5msps.dat ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/signal_samples/gps_l2c_m_prn7_5msps.dat
            SHOW_PROGRESS
-           EXPECTED_HASH MD5=a6fcbefe155137945d3c33c5ef7bd0f9 )    
+           EXPECTED_HASH MD5=a6fcbefe155137945d3c33c5ef7bd0f9 )
    endif(NOT EXISTS ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples/gps_l2c_m_prn7_5msps.dat)
    if(ENABLE_INSTALL_TESTS)
       install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/signal_samples/gps_l2c_m_prn7_5msps.dat DESTINATION share/gnss-sdr/signal_samples)
@@ -321,7 +357,7 @@ if(ENABLE_UNIT_TESTING)
     if(NOT ${GTEST_DIR_LOCAL})
         add_dependencies(run_tests gtest-${gtest_RELEASE})
     endif(NOT ${GTEST_DIR_LOCAL})
-    
+
     if(ENABLE_INSTALL_TESTS)
         if(EXISTS ${CMAKE_SOURCE_DIR}/install/run_tests)
             file(REMOVE ${CMAKE_SOURCE_DIR}/install/run_tests)
@@ -367,6 +403,7 @@ if(ENABLE_SYSTEM_TESTING)
     set(HOST_SYSTEM "Unknown")
     if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
         set(HOST_SYSTEM "GNU/Linux ${LINUX_DISTRIBUTION} ${LINUX_VER} ${ARCH_}")
+        string(REPLACE "\n" "" HOST_SYSTEM "${HOST_SYSTEM}")
     endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
     if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
         set(HOST_SYSTEM "MacOS")
@@ -438,7 +475,7 @@ if(ENABLE_SYSTEM_TESTING)
                                 COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:position_test>
                                 ${CMAKE_SOURCE_DIR}/install/$<TARGET_FILE_NAME:position_test> )
         endif(ENABLE_INSTALL_TESTS)
-         
+
         if(GPSTK_FOUND OR OWN_GPSTK)
             add_executable(obs_gps_l1_system_test ${CMAKE_CURRENT_SOURCE_DIR}/system-tests/obs_gps_l1_system_test.cc)
             if(NOT ${GTEST_DIR_LOCAL})
@@ -459,14 +496,14 @@ if(ENABLE_SYSTEM_TESTING)
                     file(REMOVE ${CMAKE_SOURCE_DIR}/install/obs_gps_l1_system_test)
                 endif(EXISTS ${CMAKE_SOURCE_DIR}/install/obs_gps_l1_system_test)
                 install(TARGETS obs_gps_l1_system_test RUNTIME DESTINATION bin COMPONENT "obs_gps_l1_system_test")
-            else(ENABLE_INSTALL_TESTS)                                            
+            else(ENABLE_INSTALL_TESTS)
                 add_custom_command(TARGET obs_gps_l1_system_test POST_BUILD
                                    COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:obs_gps_l1_system_test>
                                    ${CMAKE_SOURCE_DIR}/install/$<TARGET_FILE_NAME:obs_gps_l1_system_test> )
             endif(ENABLE_INSTALL_TESTS)
-        endif(GPSTK_FOUND OR OWN_GPSTK)          
+        endif(GPSTK_FOUND OR OWN_GPSTK)
     endif(ENABLE_SYSTEM_TESTING_EXTRA)
-    
+
 endif(ENABLE_SYSTEM_TESTING)
 
 
@@ -498,9 +535,9 @@ if(NOT ${ENABLE_PACKAGING})
      endif(NOT ${GTEST_DIR_LOCAL})
      set_property(TEST control_thread_test PROPERTY TIMEOUT 30)
      set_property(TARGET control_thread_test PROPERTY EXCLUDE_FROM_ALL TRUE)
-     
+
      #########################################################
-     
+
      add_executable(flowgraph_test ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc
                                    ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/gnss_flowgraph_test.cc )
      set_property(TARGET flowgraph_test PROPERTY EXCLUDE_FROM_ALL TRUE)
@@ -520,13 +557,14 @@ if(NOT ${ENABLE_PACKAGING})
      endif(NOT ${GTEST_DIR_LOCAL})
      set_property(TEST flowgraph_test PROPERTY TIMEOUT 30)
      set_property(TARGET flowgraph_test PROPERTY EXCLUDE_FROM_ALL TRUE)
-     
+
      #########################################################
-     
+
      add_executable(gnss_block_test ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc
                                     ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/sources/file_signal_source_test.cc
                                     ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc
                                     ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/adapter/pass_through_test.cc
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/adapter/adapter_test.cc
                                     ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/gnss_block_factory_test.cc
                    )
      set_property(TARGET gnss_block_test PROPERTY EXCLUDE_FROM_ALL TRUE)
@@ -627,4 +665,4 @@ if(${ENABLE_PACKAGING})
 else(${ENABLE_PACKAGING})
      add_dependencies(check control_thread_test flowgraph_test gnss_block_test
                       gnuradio_block_test trk_test)
-endif(${ENABLE_PACKAGING})
\ No newline at end of file
+endif(${ENABLE_PACKAGING})
diff --git a/src/tests/common-files/signal_generator_flags.h b/src/tests/common-files/signal_generator_flags.h
index 8ee56cf1c..029a002c5 100644
--- a/src/tests/common-files/signal_generator_flags.h
+++ b/src/tests/common-files/signal_generator_flags.h
@@ -41,7 +41,7 @@ DEFINE_string(static_position, "30.286502,120.032669,100", "Static receiver posi
 DEFINE_string(dynamic_position, "", "Observer positions file, in .csv or .nmea format");
 DEFINE_string(filename_rinex_obs, "sim.16o", "Filename of output RINEX navigation file");
 DEFINE_string(filename_raw_data, "signal_out.bin", "Filename of output raw data file");
-DEFINE_int32(fs_gen_hz, 2600000, "Sampling frequency [sps]");
+DEFINE_int32(fs_gen_sps, 2600000, "Sampling frequency [sps]");
 DEFINE_int32(test_satellite_PRN, 1, "PRN of the satellite under test (must be visible during the observation time)");
 DEFINE_int32(test_satellite_PRN2, 2, "PRN of the satellite under test (must be visible during the observation time)");
 
diff --git a/src/tests/single_test_main.cc b/src/tests/single_test_main.cc
index f9f91573b..9877e61f2 100644
--- a/src/tests/single_test_main.cc
+++ b/src/tests/single_test_main.cc
@@ -64,7 +64,11 @@ DECLARE_string(log_dir);
 int main(int argc, char **argv)
 {
     google::ParseCommandLineFlags(&argc, &argv, true);
-    testing::InitGoogleTest(&argc, argv);
+    try
+    {
+            testing::InitGoogleTest(&argc, argv);
+    }
+    catch(...) {} // catch the "testing::internal::<unnamed>::ClassUniqueToAlwaysTrue" from gtest
     google::InitGoogleLogging(argv[0]);
     int res = 0;
     try
diff --git a/src/tests/system-tests/obs_gps_l1_system_test.cc b/src/tests/system-tests/obs_gps_l1_system_test.cc
index 5a63924f3..03e1ceabb 100644
--- a/src/tests/system-tests/obs_gps_l1_system_test.cc
+++ b/src/tests/system-tests/obs_gps_l1_system_test.cc
@@ -30,14 +30,12 @@
  */
 
 #include <algorithm>
+#include <chrono>
+#include <cstdlib>
 #include <exception>
 #include <iostream>
-#include <cstring>
-#include <chrono>
 #include <numeric>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/wait.h>
+#include <string>
 #include <thread>
 #include <unistd.h>
 #include <gflags/gflags.h>
@@ -60,7 +58,7 @@ concurrent_queue<Gps_Acq_Assist> global_gps_acq_assist_queue;
 concurrent_map<Gps_Acq_Assist> global_gps_acq_assist_map;
 
 
-class Obs_Gps_L1_System_Test: public ::testing::Test
+class ObsGpsL1SystemTest: public ::testing::Test
 {
 public:
     std::string generator_binary;
@@ -88,7 +86,7 @@ public:
 };
 
 
-bool Obs_Gps_L1_System_Test::check_valid_rinex_nav(std::string filename)
+bool ObsGpsL1SystemTest::check_valid_rinex_nav(std::string filename)
 {
     bool res = false;
     res = gpstk::isRinexNavFile(filename);
@@ -96,7 +94,7 @@ bool Obs_Gps_L1_System_Test::check_valid_rinex_nav(std::string filename)
 }
 
 
-double Obs_Gps_L1_System_Test::compute_stdev(const std::vector<double> & vec)
+double ObsGpsL1SystemTest::compute_stdev(const std::vector<double> & vec)
 {
     double sum__ = std::accumulate(vec.begin(), vec.end(), 0.0);
     double mean__ = sum__ / vec.size();
@@ -109,7 +107,7 @@ double Obs_Gps_L1_System_Test::compute_stdev(const std::vector<double> & vec)
 }
 
 
-bool Obs_Gps_L1_System_Test::check_valid_rinex_obs(std::string filename)
+bool ObsGpsL1SystemTest::check_valid_rinex_obs(std::string filename)
 {
     bool res = false;
     res = gpstk::isRinexObsFile(filename);
@@ -117,7 +115,7 @@ bool Obs_Gps_L1_System_Test::check_valid_rinex_obs(std::string filename)
 }
 
 
-int Obs_Gps_L1_System_Test::configure_generator()
+int ObsGpsL1SystemTest::configure_generator()
 {
     // Configure signal generator
     generator_binary = FLAGS_generator_binary;
@@ -139,7 +137,7 @@ int Obs_Gps_L1_System_Test::configure_generator()
 }
 
 
-int Obs_Gps_L1_System_Test::generate_signal()
+int ObsGpsL1SystemTest::generate_signal()
 {
     pid_t wait_result;
     int child_status;
@@ -164,7 +162,7 @@ int Obs_Gps_L1_System_Test::generate_signal()
 }
 
 
-int Obs_Gps_L1_System_Test::configure_receiver()
+int ObsGpsL1SystemTest::configure_receiver()
 {
     config = std::make_shared<InMemoryConfiguration>();
 
@@ -208,7 +206,7 @@ int Obs_Gps_L1_System_Test::configure_receiver()
     const int display_rate_ms = 500;
     const int output_rate_ms =  100;
 
-    config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(sampling_rate_internal));
+    config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(sampling_rate_internal));
 
     // Set the assistance system parameters
     config->set_property("GNSS-SDR.SUPL_read_gps_assistance_xml", "false");
@@ -322,7 +320,7 @@ int Obs_Gps_L1_System_Test::configure_receiver()
 }
 
 
-int Obs_Gps_L1_System_Test::run_receiver()
+int ObsGpsL1SystemTest::run_receiver()
 {
     std::shared_ptr<ControlThread> control_thread;
     control_thread = std::make_shared<ControlThread>(config);
@@ -331,11 +329,11 @@ int Obs_Gps_L1_System_Test::run_receiver()
     {
             control_thread->run();
     }
-    catch( boost::exception & e )
+    catch(const boost::exception & e)
     {
             std::cout << "Boost exception: " << boost::diagnostic_information(e);
     }
-    catch(std::exception const&  ex)
+    catch(const std::exception & ex)
     {
             std::cout  << "STD exception: " << ex.what();
     }
@@ -353,14 +351,14 @@ int Obs_Gps_L1_System_Test::run_receiver()
     while (fgets(buffer, sizeof(buffer), fp) != NULL)
         {
             std::string aux = std::string(buffer);
-            Obs_Gps_L1_System_Test::generated_rinex_obs = aux.erase(aux.length() - 1, 1);
+            ObsGpsL1SystemTest::generated_rinex_obs = aux.erase(aux.length() - 1, 1);
         }
     pclose(fp);
     return 0;
 }
 
 
-void Obs_Gps_L1_System_Test::check_results()
+void ObsGpsL1SystemTest::check_results()
 {
     std::vector<std::vector<std::pair<double, double>> > pseudorange_ref(33);
     std::vector<std::vector<std::pair<double, double>> > carrierphase_ref(33);
@@ -415,12 +413,12 @@ void Obs_Gps_L1_System_Test::check_results()
                         } // end for
                 } // end while
     } // End of 'try' block
-    catch(gpstk::FFStreamError& e)
+    catch(const gpstk::FFStreamError& e)
     {
             std::cout << e;
             exit(1);
     }
-    catch(gpstk::Exception& e)
+    catch(const gpstk::Exception& e)
     {
             std::cout << e;
             exit(1);
@@ -433,7 +431,7 @@ void Obs_Gps_L1_System_Test::check_results()
 
     try
     {
-            std::string arg2_gen = std::string("./") + Obs_Gps_L1_System_Test::generated_rinex_obs;
+            std::string arg2_gen = std::string("./") + ObsGpsL1SystemTest::generated_rinex_obs;
             gpstk::Rinex3ObsStream r_meas(arg2_gen);
             r_meas.exceptions(std::ios::failbit);
             gpstk::Rinex3ObsData r_meas_data;
@@ -475,12 +473,12 @@ void Obs_Gps_L1_System_Test::check_results()
                         } // end for
                 } // end while
     } // End of 'try' block
-    catch(gpstk::FFStreamError& e)
+    catch(const gpstk::FFStreamError& e)
     {
             std::cout << e;
             exit(1);
     }
-    catch(gpstk::Exception& e)
+    catch(const gpstk::Exception& e)
     {
             std::cout << e;
             exit(1);
@@ -658,7 +656,7 @@ void Obs_Gps_L1_System_Test::check_results()
 }
 
 
-TEST_F(Obs_Gps_L1_System_Test, Observables_system_test)
+TEST_F(ObsGpsL1SystemTest, Observables_system_test)
 {
     std::cout << "Validating input RINEX nav file: " << FLAGS_rinex_nav_file << " ..." << std::endl;
     bool is_rinex_nav_valid = check_valid_rinex_nav(FLAGS_rinex_nav_file);
@@ -685,9 +683,9 @@ TEST_F(Obs_Gps_L1_System_Test, Observables_system_test)
     // Run the receiver
     EXPECT_EQ( run_receiver(), 0) << "Problem executing the software-defined signal generator";
 
-    std::cout << "Validating RINEX obs file obtained by GNSS-SDR: " << Obs_Gps_L1_System_Test::generated_rinex_obs << " ..." << std::endl;
-    is_gen_rinex_obs_valid = check_valid_rinex_obs( "./" + Obs_Gps_L1_System_Test::generated_rinex_obs);
-    EXPECT_EQ(true, is_gen_rinex_obs_valid) << "The RINEX observation file " << Obs_Gps_L1_System_Test::generated_rinex_obs << ", generated by GNSS-SDR, is not well formed.";
+    std::cout << "Validating RINEX obs file obtained by GNSS-SDR: " << ObsGpsL1SystemTest::generated_rinex_obs << " ..." << std::endl;
+    is_gen_rinex_obs_valid = check_valid_rinex_obs( "./" + ObsGpsL1SystemTest::generated_rinex_obs);
+    EXPECT_EQ(true, is_gen_rinex_obs_valid) << "The RINEX observation file " << ObsGpsL1SystemTest::generated_rinex_obs << ", generated by GNSS-SDR, is not well formed.";
     std::cout << "The file is valid." << std::endl;
 
     // Check results
diff --git a/src/tests/system-tests/position_test.cc b/src/tests/system-tests/position_test.cc
index abf9b971d..5b14d0e62 100644
--- a/src/tests/system-tests/position_test.cc
+++ b/src/tests/system-tests/position_test.cc
@@ -29,6 +29,7 @@
  * -------------------------------------------------------------------------
  */
 
+#include <chrono>
 #include <cmath>
 #include <fstream>
 #include <numeric>
@@ -51,7 +52,7 @@ DEFINE_string(config_file_ptest, std::string(""), "File containing the configura
 concurrent_queue<Gps_Acq_Assist> global_gps_acq_assist_queue;
 concurrent_map<Gps_Acq_Assist> global_gps_acq_assist_map;
 
-class Static_Position_System_Test: public ::testing::Test
+class StaticPositionSystemTest: public ::testing::Test
 {
 public:
     std::string generator_binary;
@@ -61,7 +62,7 @@ public:
     std::string p4;
     std::string p5;
 
-    const double baseband_sampling_freq = static_cast<double>(FLAGS_fs_gen_hz);
+    const double baseband_sampling_freq = static_cast<double>(FLAGS_fs_gen_sps);
 
     std::string filename_rinex_obs = FLAGS_filename_rinex_obs;
     std::string filename_raw_data = FLAGS_filename_raw_data;
@@ -76,7 +77,6 @@ public:
     double compute_stdev_precision(const std::vector<double> & vec);
     double compute_stdev_accuracy(const std::vector<double> & vec, double ref);
 
-
     void geodetic2Enu(const double latitude, const double longitude, const double altitude,
                         double* east, double* north, double* up);
 
@@ -87,12 +87,11 @@ public:
 private:
     void geodetic2Ecef(const double latitude, const double longitude, const double altitude,
                             double* x, double* y, double* z);
-
 };
 
 
 
-void Static_Position_System_Test::geodetic2Ecef(const double latitude, const double longitude, const double altitude,
+void StaticPositionSystemTest::geodetic2Ecef(const double latitude, const double longitude, const double altitude,
         double* x, double* y, double* z)
 {
     const double a = 6378137.0; // WGS84
@@ -117,7 +116,7 @@ void Static_Position_System_Test::geodetic2Ecef(const double latitude, const dou
 }
 
 
-void Static_Position_System_Test::geodetic2Enu(const double latitude, const double longitude, const double altitude,
+void StaticPositionSystemTest::geodetic2Enu(double latitude, double longitude, double altitude,
         double* east, double* north, double* up)
 {
     double x, y, z;
@@ -160,7 +159,7 @@ void Static_Position_System_Test::geodetic2Enu(const double latitude, const doub
 }
 
 
-double Static_Position_System_Test::compute_stdev_precision(const std::vector<double> & vec)
+double StaticPositionSystemTest::compute_stdev_precision(const std::vector<double> & vec)
 {
     double sum__ = std::accumulate(vec.begin(), vec.end(), 0.0);
     double mean__ = sum__ / vec.size();
@@ -173,7 +172,7 @@ double Static_Position_System_Test::compute_stdev_precision(const std::vector<do
 }
 
 
-double Static_Position_System_Test::compute_stdev_accuracy(const std::vector<double> & vec, const double ref)
+double StaticPositionSystemTest::compute_stdev_accuracy(const std::vector<double> & vec, const double ref)
 {
     const double mean__ = ref;
     double accum__ = 0.0;
@@ -185,7 +184,7 @@ double Static_Position_System_Test::compute_stdev_accuracy(const std::vector<dou
 }
 
 
-int Static_Position_System_Test::configure_generator()
+int StaticPositionSystemTest::configure_generator()
 {
     // Configure signal generator
     generator_binary = FLAGS_generator_binary;
@@ -207,7 +206,7 @@ int Static_Position_System_Test::configure_generator()
 }
 
 
-int Static_Position_System_Test::generate_signal()
+int StaticPositionSystemTest::generate_signal()
 {
     pid_t wait_result;
     int child_status;
@@ -230,7 +229,7 @@ int Static_Position_System_Test::generate_signal()
 }
 
 
-int Static_Position_System_Test::configure_receiver()
+int StaticPositionSystemTest::configure_receiver()
 {
     if(FLAGS_config_file_ptest.empty())
         {
@@ -275,7 +274,7 @@ int Static_Position_System_Test::configure_receiver()
             const int display_rate_ms = 1000;
             const int output_rate_ms = 1000;
 
-            config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(sampling_rate_internal));
+            config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(sampling_rate_internal));
 
             // Set the assistance system parameters
             config->set_property("GNSS-SDR.SUPL_read_gps_assistance_xml", "false");
@@ -399,7 +398,7 @@ int Static_Position_System_Test::configure_receiver()
 }
 
 
-int Static_Position_System_Test::run_receiver()
+int StaticPositionSystemTest::run_receiver()
 {
     std::shared_ptr<ControlThread> control_thread;
     if(FLAGS_config_file_ptest.empty())
@@ -416,11 +415,11 @@ int Static_Position_System_Test::run_receiver()
     {
             control_thread->run();
     }
-    catch( boost::exception & e )
+    catch(const boost::exception & e)
     {
             std::cout << "Boost exception: " << boost::diagnostic_information(e);
     }
-    catch(std::exception const&  ex)
+    catch(const std::exception & ex)
     {
             std::cout  << "STD exception: " << ex.what();
     }
@@ -440,17 +439,17 @@ int Static_Position_System_Test::run_receiver()
         {
             std::string aux = std::string(buffer);
             EXPECT_EQ(aux.empty(), false);
-            Static_Position_System_Test::generated_kml_file = aux.erase(aux.length() - 1, 1);
+            StaticPositionSystemTest::generated_kml_file = aux.erase(aux.length() - 1, 1);
         }
     pclose(fp);
-    EXPECT_EQ(Static_Position_System_Test::generated_kml_file.empty(), false);
+    EXPECT_EQ(StaticPositionSystemTest::generated_kml_file.empty(), false);
     return 0;
 }
 
 
-void Static_Position_System_Test::check_results()
+void StaticPositionSystemTest::check_results()
 {
-    std::fstream myfile(Static_Position_System_Test::generated_kml_file, std::ios_base::in);
+    std::fstream myfile(StaticPositionSystemTest::generated_kml_file, std::ios_base::in);
     std::string line;
 
     std::vector<double> pos_e;
@@ -479,7 +478,9 @@ void Static_Position_System_Test::check_results()
                     std::string str2;
                     std::istringstream iss(line);
                     double value;
-                    double lat, longitude, h;
+                    double lat = 0.0;
+                    double longitude = 0.0;
+                    double h = 0.0;
                     for (int i = 0; i < 3; i++)
                         {
                             std::getline(iss, str2, ',');
@@ -544,7 +545,7 @@ void Static_Position_System_Test::check_results()
 }
 
 
-TEST_F(Static_Position_System_Test, Position_system_test)
+TEST_F(StaticPositionSystemTest, Position_system_test)
 {
     if(FLAGS_config_file_ptest.empty())
         {
diff --git a/src/tests/system-tests/ttff_gps_l1.cc b/src/tests/system-tests/ttff_gps_l1.cc
index 2d2155e4a..0a1047005 100644
--- a/src/tests/system-tests/ttff_gps_l1.cc
+++ b/src/tests/system-tests/ttff_gps_l1.cc
@@ -32,16 +32,16 @@
 
 #include <cerrno>
 #include <chrono>
-#include <cstdlib>
 #include <cmath>
-#include <ctime>
 #include <limits>
 #include <numeric>
+#include <random>
 #include <string>
 #include <sys/types.h>
 #include <sys/ipc.h>
 #include <sys/msg.h>
 #include <thread>
+#include <boost/date_time/posix_time/posix_time.hpp>
 #include <gflags/gflags.h>
 #include <glog/logging.h>
 #include <gtest/gtest.h>
@@ -74,7 +74,7 @@ typedef struct  {
 } ttff_msgbuf;
 
 
-class TTFF_GPS_L1_CA_Test: public ::testing::Test
+class TfttGpsL1CATest: public ::testing::Test
 {
 public:
     void config_1();
@@ -123,11 +123,11 @@ public:
 };
 
 
-void TTFF_GPS_L1_CA_Test::config_1()
+void TfttGpsL1CATest::config_1()
 {
     config = std::make_shared<InMemoryConfiguration>();
 
-    config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(FLAGS_fs_in));
+    config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(FLAGS_fs_in));
 
     // Set the assistance system parameters
     config->set_property("GNSS-SDR.SUPL_gps_ephemeris_server", "supl.google.com");
@@ -234,7 +234,7 @@ void TTFF_GPS_L1_CA_Test::config_1()
 }
 
 
-void TTFF_GPS_L1_CA_Test::config_2()
+void TfttGpsL1CATest::config_2()
 {
     if(FLAGS_config_file_ttff.empty())
         {
@@ -248,7 +248,7 @@ void TTFF_GPS_L1_CA_Test::config_2()
         }
 
     int d_sampling_rate;
-    d_sampling_rate = config2->property("GNSS-SDR.internal_fs_hz", FLAGS_fs_in);
+    d_sampling_rate = config2->property("GNSS-SDR.internal_fs_sps", FLAGS_fs_in);
     config2->set_property("SignalSource.samples", std::to_string(d_sampling_rate * FLAGS_max_measurement_duration));
 }
 
@@ -295,46 +295,44 @@ void receive_msg()
 }
 
 
-void TTFF_GPS_L1_CA_Test::print_TTFF_report(const std::vector<double> & ttff_v, std::shared_ptr<ConfigurationInterface> config_)
+void TfttGpsL1CATest::print_TTFF_report(const std::vector<double> & ttff_v, std::shared_ptr<ConfigurationInterface> config_)
 {
     std::ofstream ttff_report_file;
     std::string filename = "ttff_report";
     std::string filename_;
 
-    time_t rawtime;
-    struct tm * timeinfo;
-    time ( &rawtime );
-    timeinfo = localtime ( &rawtime );
+    boost::posix_time::ptime pt = boost::posix_time::second_clock::local_time();
+    tm timeinfo = boost::posix_time::to_tm(pt);
 
     std::stringstream strm0;
-    const int year = timeinfo->tm_year - 100;
+    const int year = timeinfo.tm_year - 100;
     strm0 << year;
-    const int month = timeinfo->tm_mon + 1;
+    const int month = timeinfo.tm_mon + 1;
     if(month < 10)
         {
             strm0 << "0";
         }
     strm0 << month;
-    const int day = timeinfo->tm_mday;
+    const int day = timeinfo.tm_mday;
     if(day < 10)
         {
             strm0 << "0";
         }
     strm0 << day << "_";
-    const int hour = timeinfo->tm_hour;
+    const int hour = timeinfo.tm_hour;
     if(hour < 10)
                 {
             strm0 << "0";
         }
     strm0 << hour;
-    const int min = timeinfo->tm_min;
+    const int min = timeinfo.tm_min;
 
     if(min < 10)
         {
             strm0 << "0";
         }
     strm0 << min;
-    const int sec = timeinfo->tm_sec;
+    const int sec = timeinfo.tm_sec;
     if(sec < 10)
         {
             strm0 << "0";
@@ -454,7 +452,7 @@ void TTFF_GPS_L1_CA_Test::print_TTFF_report(const std::vector<double> & ttff_v,
 }
 
 
-TEST_F(TTFF_GPS_L1_CA_Test, ColdStart)
+TEST_F(TfttGpsL1CATest, ColdStart)
 {
     unsigned int num_measurements = 0;
 
@@ -483,30 +481,27 @@ TEST_F(TTFF_GPS_L1_CA_Test, ColdStart)
                 }
 
             // record startup time
-            struct timeval tv;
-            gettimeofday(&tv, NULL);
-            long long int begin = tv.tv_sec * 1000000 + tv.tv_usec;
-
             std::cout << "Starting measurement " << num_measurements + 1 << " / " << FLAGS_num_measurements << std::endl;
-
+            std::chrono::time_point<std::chrono::system_clock> start, end;
+            start = std::chrono::system_clock::now();
             // start receiver
             try
             {
                     control_thread->run();
             }
-            catch( boost::exception & e )
+            catch(const boost::exception & e)
             {
                     std::cout << "Boost exception: " << boost::diagnostic_information(e);
             }
-            catch(std::exception const&  ex)
+            catch(const std::exception & ex)
             {
                     std::cout  << "STD exception: " << ex.what();
             }
 
             // stop clock
-            gettimeofday(&tv, NULL);
-            long long int end = tv.tv_sec * 1000000 + tv.tv_usec;
-            double ttff = static_cast<double>(end - begin) / 1000000.0;
+            end = std::chrono::system_clock::now();
+            std::chrono::duration<double> elapsed_seconds = end - start;
+            double ttff = elapsed_seconds.count();
 
             std::shared_ptr<GNSSFlowgraph> flowgraph = control_thread->flowgraph();
             EXPECT_FALSE(flowgraph->running());
@@ -515,9 +510,10 @@ TEST_F(TTFF_GPS_L1_CA_Test, ColdStart)
             std::cout << "Just finished measurement " << num_measurements << ", which took " << ttff << " seconds." << std::endl;
             if(n < FLAGS_num_measurements - 1)
                 {
-                    std::srand(std::time(0)); // use current time as seed for random generator
-                    int random_variable = std::rand();
-                    float random_variable_0_1 = static_cast<float>(random_variable) / static_cast<float>( RAND_MAX );
+                    std::random_device r;
+                    std::default_random_engine e1(r());
+                    std::uniform_real_distribution<float> uniform_dist(0, 1);
+                    float random_variable_0_1 = uniform_dist(e1);
                     int random_delay_s = static_cast<int>(random_variable_0_1 * 25.0);
                     std::cout << "Waiting a random amount of time (from 5 to 30 s) to start a new measurement... " << std::endl;
                     std::cout << "This time will wait " << random_delay_s + 5 << " s." << std::endl << std::endl;
@@ -538,7 +534,7 @@ TEST_F(TTFF_GPS_L1_CA_Test, ColdStart)
 }
 
 
-TEST_F(TTFF_GPS_L1_CA_Test, HotStart)
+TEST_F(TfttGpsL1CATest, HotStart)
 {
     unsigned int num_measurements = 0;
     TTFF_v.clear();
@@ -567,30 +563,28 @@ TEST_F(TTFF_GPS_L1_CA_Test, HotStart)
                     control_thread = std::make_shared<ControlThread>(config2);
                 }
             // record startup time
-            struct timeval tv;
-            gettimeofday(&tv, NULL);
-            long long int begin = tv.tv_sec * 1000000 + tv.tv_usec;
-
             std::cout << "Starting measurement " << num_measurements + 1 << " / " << FLAGS_num_measurements << std::endl;
+            std::chrono::time_point<std::chrono::system_clock> start, end;
+            start = std::chrono::system_clock::now();
 
             // start receiver
             try
             {
                     control_thread->run();
             }
-            catch( boost::exception & e )
+            catch(const boost::exception & e)
             {
                     std::cout << "Boost exception: " << boost::diagnostic_information(e);
             }
-            catch(std::exception const&  ex)
+            catch(const std::exception & ex)
             {
                     std::cout  << "STD exception: " << ex.what();
             }
 
             // stop clock
-            gettimeofday(&tv, NULL);
-            long long int end = tv.tv_sec * 1000000 + tv.tv_usec;
-            double ttff = static_cast<double>(end - begin) / 1000000.0;
+            end = std::chrono::system_clock::now();
+            std::chrono::duration<double> elapsed_seconds = end - start;
+            double ttff = elapsed_seconds.count();
 
             std::shared_ptr<GNSSFlowgraph> flowgraph = control_thread->flowgraph();
             EXPECT_FALSE(flowgraph->running());
@@ -599,9 +593,10 @@ TEST_F(TTFF_GPS_L1_CA_Test, HotStart)
             std::cout << "Just finished measurement " << num_measurements << ", which took " << ttff << " seconds." << std::endl;
             if(n < FLAGS_num_measurements - 1)
                 {
-                    std::srand(std::time(0)); // use current time as seed for random generator
-                    int random_variable = std::rand();
-                    float random_variable_0_1 = static_cast<float>(random_variable) / static_cast<float>( RAND_MAX );
+                    std::random_device r;
+                    std::default_random_engine e1(r());
+                    std::uniform_real_distribution<float> uniform_dist(0, 1);
+                    float random_variable_0_1 = uniform_dist(e1);
                     int random_delay_s = static_cast<int>(random_variable_0_1 * 25.0);
                     std::cout << "Waiting a random amount of time (from 5 to 30 s) to start new measurement... " << std::endl;
                     std::cout << "This time will wait " << random_delay_s + 5 << " s." << std::endl << std::endl;
@@ -656,7 +651,7 @@ int main(int argc, char **argv)
     if ((sysv_msqid = msgget(sysv_msg_key, msgflg )) == -1)
     {
         std::cout << "GNSS-SDR can not create message queues!" << std::endl;
-        exit(1);
+        return 1;
     }
     ttff_msgbuf msg;
     msg.mtype = 1;
diff --git a/src/tests/test_main.cc b/src/tests/test_main.cc
index dec6bf9f0..36662fb67 100644
--- a/src/tests/test_main.cc
+++ b/src/tests/test_main.cc
@@ -16,7 +16,7 @@
 * 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.
+* (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
@@ -80,8 +80,10 @@ DECLARE_string(log_dir);
 
 #include "unit-tests/signal-processing-blocks/sources/file_signal_source_test.cc"
 #include "unit-tests/signal-processing-blocks/sources/gnss_sdr_valve_test.cc"
+#include "unit-tests/signal-processing-blocks/sources/unpack_2bit_samples_test.cc"
 
 #include "unit-tests/signal-processing-blocks/adapter/pass_through_test.cc"
+#include "unit-tests/signal-processing-blocks/adapter/adapter_test.cc"
 
 #include "unit-tests/signal-processing-blocks/filter/fir_filter_test.cc"
 
@@ -99,7 +101,7 @@ DECLARE_string(log_dir);
 #include "unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc"
 #include "unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc"
 #include "unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc"
-//#include "unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_multithread_acquisition_gsoc2013_test.cc"
+
 #if OPENCL_BLOCKS_TEST
 #include "unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc"
 #endif
@@ -108,6 +110,7 @@ DECLARE_string(log_dir);
 #include "unit-tests/signal-processing-blocks/tracking/galileo_e5a_tracking_test.cc"
 #include "unit-tests/signal-processing-blocks/tracking/tracking_loop_filter_test.cc"
 #include "unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_test.cc"
+#include "unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc"
 
 #if CUDA_BLOCKS_TEST
 #include "unit-tests/signal-processing-blocks/tracking/gpu_multicorrelator_test.cc"
@@ -121,6 +124,7 @@ DECLARE_string(log_dir);
 #include "unit-tests/signal-processing-blocks/pvt/rtcm_test.cc"
 #include "unit-tests/signal-processing-blocks/pvt/rtcm_printer_test.cc"
 #include "unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc"
+#include "unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc"
 
 #if EXTRA_TESTS
 #include "unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc"
diff --git a/src/tests/unit-tests/arithmetic/code_generation_test.cc b/src/tests/unit-tests/arithmetic/code_generation_test.cc
index 204947e5e..a29c14e18 100644
--- a/src/tests/unit-tests/arithmetic/code_generation_test.cc
+++ b/src/tests/unit-tests/arithmetic/code_generation_test.cc
@@ -29,15 +29,14 @@
  * -------------------------------------------------------------------------
  */
 
-
+#include <chrono>
 #include <complex>
-#include <ctime>
 #include "gps_sdr_signal_processing.h"
 #include "gnss_signal_processing.h"
 
 
 
-TEST(CodeGenGPSL1_Test, CodeGeneration)
+TEST(CodeGenerationTest, CodeGenGPSL1Test)
 {
     std::complex<float>* _dest = new std::complex<float>[1023];
     signed int _prn = 1;
@@ -45,138 +44,75 @@ TEST(CodeGenGPSL1_Test, CodeGeneration)
 
     int iterations = 1000;
 
-    struct timeval tv;
-    gettimeofday(&tv, NULL);
-    long long int begin = tv.tv_sec * 1000000 + tv.tv_usec;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    start = std::chrono::system_clock::now();
 
     for(int i = 0; i < iterations; i++)
         {
             gps_l1_ca_code_gen_complex( _dest,  _prn,  _chip_shift);
         }
+
+    end = std::chrono::system_clock::now();
+    std::chrono::duration<double> elapsed_seconds = end - start;
+
     delete[] _dest;
-    gettimeofday(&tv, NULL);
-    long long int end = tv.tv_sec * 1000000 + tv.tv_usec;
-    ASSERT_LE(0, end - begin);
-    std::cout << "Generation completed in " << (end - begin) << " microseconds" << std::endl;
-    
-
-
-    /* std::complex<float>* _dest2 = new std::complex<float>[1023];gettimeofday(&tv, NULL);
-    long long int begin2 = tv.tv_sec * 1000000 + tv.tv_usec;
-
-    for(int i = 0; i < iterations; i++)
-        {
-            gps_l1_ca_code_gen_complex2( _dest2,  _prn,  _chip_shift);
-        }
-
-    gettimeofday(&tv, NULL);
-    long long int end2 = tv.tv_sec * 1000000 + tv.tv_usec;
-    std::cout << "Generation 2 completed in " << (end2 - begin2) << " microseconds" << std::endl;
-
-    for (int j=0; j<1023;j++)
-        {
-            if(_dest[j] != _dest2[j]) std::cout << "Error!" << std::endl;
-        }
-    delete _dest2; */
+    ASSERT_LE(0, elapsed_seconds.count());
+    std::cout << "Generation completed in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
 }
 
 
-
-
-TEST(CodeGenGPSL1Sampled_Test, CodeGeneration)
+TEST(CodeGenerationTest, CodeGenGPSL1SampledTest)
 {
     signed int _prn = 1;
     unsigned int _chip_shift = 4;
-    double _fs = 8000000;
+    double _fs = 8000000.0;
     const signed int _codeFreqBasis = 1023000; //Hz
     const signed int _codeLength = 1023;
-    int _samplesPerCode = round(_fs / (double)(_codeFreqBasis / _codeLength));
+    int _samplesPerCode = round(_fs / static_cast<double>(_codeFreqBasis / _codeLength));
     std::complex<float>* _dest = new std::complex<float>[_samplesPerCode];
 
     int iterations = 1000;
 
-    struct timeval tv;
-    gettimeofday(&tv, NULL);
-    long long int begin = tv.tv_sec * 1000000 + tv.tv_usec;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    start = std::chrono::system_clock::now();
 
     for(int i = 0; i < iterations; i++)
         {
             gps_l1_ca_code_gen_complex_sampled( _dest,  _prn, _fs, _chip_shift);
         }
 
-    gettimeofday(&tv, NULL);
-    long long int end = tv.tv_sec * 1000000 + tv.tv_usec;
+    end = std::chrono::system_clock::now();
+    std::chrono::duration<double> elapsed_seconds = end - start;
+
     delete[] _dest;
-    ASSERT_LE(0, end - begin);
-    std::cout << "Generation completed in " << (end - begin) << " microseconds" << std::endl;
-
-
-    /* std::complex<float>* _dest2 = new std::complex<float>[_samplesPerCode];
-    gettimeofday(&tv, NULL);
-    long long int begin2 = tv.tv_sec * 1000000 + tv.tv_usec;
-
-    for(int i = 0; i < iterations; i++)
-        {
-            gps_l1_ca_code_gen_complex_sampled2( _dest2,  _prn, _fs, _chip_shift);
-        }
-
-    gettimeofday(&tv, NULL);
-    long long int end2 = tv.tv_sec * 1000000 + tv.tv_usec;
-    std::cout << "Generation completed in " << (end2 - begin2) << " microseconds  (New)" << std::endl;
-
-    for (int j=0; j<_samplesPerCode;j++)
-        {
-            if(_dest[j] != _dest2[j]) std::cout << "Error!" << std::endl;
-        }
-    delete[] _dest2; */
+    ASSERT_LE(0, elapsed_seconds.count());
+    std::cout << "Generation completed in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
 }
 
 
-TEST(ComplexCarrier_Test, CodeGeneration)
+TEST(CodeGenerationTest, ComplexConjugateTest)
 {
-    double _fs = 8000000;
-    double _f = 4000;
+    double _fs = 8000000.0;
+    double _f = 4000.0;
     const signed int _codeFreqBasis = 1023000; //Hz
     const signed int _codeLength = 1023;
-    int _samplesPerCode = round(_fs / (double)(_codeFreqBasis / _codeLength));
+    int _samplesPerCode = round(_fs / static_cast<double>(_codeFreqBasis / _codeLength));
     std::complex<float>* _dest = new std::complex<float>[_samplesPerCode];
 
     int iterations = 1000;
 
-    struct timeval tv;
-    gettimeofday(&tv, NULL);
-    long long int begin = tv.tv_sec * 1000000 + tv.tv_usec;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    start = std::chrono::system_clock::now();
 
     for(int i = 0; i < iterations; i++)
         {
             complex_exp_gen_conj( _dest, _f,  _fs,  _samplesPerCode);
         }
 
-    gettimeofday(&tv, NULL);
-    long long int end = tv.tv_sec * 1000000 + tv.tv_usec;
-    delete[] _dest; 
-    ASSERT_LE(0, end - begin);
-    std::cout << "Carrier generation completed in " << (end - begin) << " microseconds" << std::endl;
-    
-    /* std::complex<float>* _dest2 = new std::complex<float>[_samplesPerCode];
-    gettimeofday(&tv, NULL);
-    long long int begin2 = tv.tv_sec * 1000000 + tv.tv_usec;
-
-    for(int i = 0; i < iterations; i++)
-        {
-            complex_exp_gen_conj2( _dest2, _f,  _fs,  _samplesPerCode);
-        }
-
-    gettimeofday(&tv, NULL);
-    long long int end2 = tv.tv_sec * 1000000 + tv.tv_usec;
-    std::cout << "Carrier generation completed in " << (end2 - begin2) << " microseconds  (New)" << std::endl;
-
-    for (int j=0; j<_samplesPerCode;j++)
-        {
-            if(std::abs(_dest[j] - _dest2[j]) > 0.1) std::cout << "Error!" << std::endl;
-        }
-
-    std::cout << _dest[10] << "and " << _dest2[10] << std::endl;
-    delete[] _dest2;*/
+    end = std::chrono::system_clock::now();
+    std::chrono::duration<double> elapsed_seconds = end - start;
 
+    delete[] _dest;
+    ASSERT_LE(0, elapsed_seconds.count());
+    std::cout << "Generation completed in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
 }
diff --git a/src/tests/unit-tests/arithmetic/complex_carrier_test.cc b/src/tests/unit-tests/arithmetic/complex_carrier_test.cc
index a472ba367..69123ea8d 100644
--- a/src/tests/unit-tests/arithmetic/complex_carrier_test.cc
+++ b/src/tests/unit-tests/arithmetic/complex_carrier_test.cc
@@ -29,28 +29,26 @@
  * -------------------------------------------------------------------------
  */
 
-
+#include <chrono>
 #include <complex>
-#include <ctime>
 #include <armadillo>
 #include "gnss_signal_processing.h"
 
 DEFINE_int32(size_carrier_test, 100000, "Size of the arrays used for complex carrier testing");
 
 
-TEST(ComplexCarrier_Test, StandardComplexImplementation)
+TEST(ComplexCarrierTest, StandardComplexImplementation)
 {
     // Dynamic allocation creates new usable space on the program STACK
     // (an area of RAM specifically allocated to the program)
     std::complex<float>* output = new std::complex<float>[FLAGS_size_carrier_test];
-    const double _f = 2000;
-    const double _fs = 2000000;
-    const double phase_step = (double)((GPS_TWO_PI * _f) / _fs);
-    double phase = 0;
+    const double _f = 2000.0;
+    const double _fs = 2000000.0;
+    const double phase_step = static_cast<double>((GPS_TWO_PI * _f) / _fs);
+    double phase = 0.0;
 
-    struct timeval tv;
-    gettimeofday(&tv, NULL);
-    long long int begin = tv.tv_sec * 1000000 + tv.tv_usec;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    start = std::chrono::system_clock::now();
 
     for(int i = 0; i < FLAGS_size_carrier_test; i++)
          {
@@ -58,10 +56,10 @@ TEST(ComplexCarrier_Test, StandardComplexImplementation)
              phase += phase_step;
          }
 
-    gettimeofday(&tv, NULL);
-    long long int end = tv.tv_sec * 1000000 + tv.tv_usec;
+    end = std::chrono::system_clock::now();
+    std::chrono::duration<double> elapsed_seconds = end - start;
     std::cout << "A " << FLAGS_size_carrier_test
-              << "-length complex carrier in standard C++ (dynamic allocation) generated in " << (end - begin)
+              << "-length complex carrier in standard C++ (dynamic allocation) generated in " <<  elapsed_seconds.count() * 1e6
               << " microseconds" << std::endl;
 
     std::complex<float> expected(1,0);
@@ -76,33 +74,33 @@ TEST(ComplexCarrier_Test, StandardComplexImplementation)
             ASSERT_FLOAT_EQ(std::norm(expected), std::norm(mag[i]));
         }
 
-    ASSERT_LE(0, end - begin);
+    ASSERT_LE(0, elapsed_seconds.count() * 1e6);
 }
 
 
-TEST(ComplexCarrier_Test, C11ComplexImplementation)
+TEST(ComplexCarrierTest, C11ComplexImplementation)
 {
     // declaration: load data onto the program data segment
     std::vector<std::complex<float>> output(FLAGS_size_carrier_test);
-    const double _f = 2000;
-    const double _fs = 2000000;
-    const double phase_step = (double)((GPS_TWO_PI * _f) / _fs);
-    double phase = 0;
+    const double _f = 2000.0;
+    const double _fs = 2000000.0;
+    const double phase_step = static_cast<double>((GPS_TWO_PI * _f) / _fs);
+    double phase = 0.0;
+
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    start = std::chrono::system_clock::now();
 
-    struct timeval tv;
-    gettimeofday(&tv, NULL);
-    long long int begin = tv.tv_sec * 1000000 + tv.tv_usec;
     for (int i = 0; i < FLAGS_size_carrier_test; i++)
         {
             output[i] = std::complex<float>(cos(phase), sin(phase));
             phase += phase_step;
         }
-    gettimeofday(&tv, NULL);
-    long long int end = tv.tv_sec * 1000000 + tv.tv_usec;
+    end = std::chrono::system_clock::now();
+    std::chrono::duration<double> elapsed_seconds = end - start;
     std::cout << "A " << FLAGS_size_carrier_test
-              << "-length complex carrier in standard C++ (declaration) generated in " << (end - begin)
+              << "-length complex carrier in standard C++ (declaration) generated in " << elapsed_seconds.count() * 1e6
               << " microseconds" << std::endl;
-    ASSERT_LE(0, end - begin);
+    ASSERT_LE(0, elapsed_seconds.count() * 1e6);
     std::complex<float> expected(1,0);
     std::vector<std::complex<float>> mag(FLAGS_size_carrier_test);
     for(int i = 0; i < FLAGS_size_carrier_test; i++)
@@ -115,21 +113,20 @@ TEST(ComplexCarrier_Test, C11ComplexImplementation)
 
 
 
-TEST(ComplexCarrier_Test, OwnComplexImplementation)
+TEST(ComplexCarrierTest, OwnComplexImplementation)
 {
     std::complex<float>* output = new std::complex<float>[FLAGS_size_carrier_test];
-    double _f = 2000;
-    double _fs = 2000000;
-    struct timeval tv;
-    gettimeofday(&tv, NULL);
-    long long int begin = tv.tv_sec * 1000000 + tv.tv_usec;
+    double _f = 2000.0;
+    double _fs = 2000000.0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    start = std::chrono::system_clock::now();
 
-    complex_exp_gen(output, _f, _fs, (unsigned int)FLAGS_size_carrier_test);
+    complex_exp_gen(output, _f, _fs, static_cast<unsigned int>(FLAGS_size_carrier_test));
 
-    gettimeofday(&tv, NULL);
-    long long int end = tv.tv_sec * 1000000 + tv.tv_usec;
+    end = std::chrono::system_clock::now();
+    std::chrono::duration<double> elapsed_seconds = end - start;
     std::cout << "A " << FLAGS_size_carrier_test
-              << "-length complex carrier using fixed point generated in " << (end - begin)
+              << "-length complex carrier using fixed point generated in " << elapsed_seconds.count() * 1e6
               << " microseconds" << std::endl;
 
     std::complex<float> expected(1,0);
@@ -143,5 +140,5 @@ TEST(ComplexCarrier_Test, OwnComplexImplementation)
         {
             ASSERT_NEAR(std::norm(expected), std::norm(mag[i]), 0.0001);
         }
-    ASSERT_LE(0, end - begin);
+    ASSERT_LE(0, elapsed_seconds.count() * 1e6);
 }
diff --git a/src/tests/unit-tests/arithmetic/conjugate_test.cc b/src/tests/unit-tests/arithmetic/conjugate_test.cc
index 11bf86932..1b0aaa8cb 100644
--- a/src/tests/unit-tests/arithmetic/conjugate_test.cc
+++ b/src/tests/unit-tests/arithmetic/conjugate_test.cc
@@ -30,8 +30,8 @@
  */
 
 
+#include <chrono>
 #include <complex>
-#include <ctime>
 #include <armadillo>
 #include <volk/volk.h>
 #include <volk_gnsssdr/volk_gnsssdr.h>
@@ -40,52 +40,50 @@ DEFINE_int32(size_conjugate_test, 100000, "Size of the arrays used for conjugate
 
 
 
-TEST(Conjugate_Test, StandardCComplexImplementation)
+TEST(ConjugateTest, StandardCComplexImplementation)
 {
     std::complex<float>* input = new std::complex<float>[FLAGS_size_conjugate_test];
     std::complex<float>* output = new std::complex<float>[FLAGS_size_conjugate_test];
     memset(input, 0, sizeof(std::complex<float>) * FLAGS_size_conjugate_test);
 
-    struct timeval tv;
-    gettimeofday(&tv, NULL);
-    long long int begin = tv.tv_sec * 1000000 + tv.tv_usec;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    start = std::chrono::system_clock::now();
 
     for(int i = 0; i < FLAGS_size_conjugate_test; i++)
         {
             output[i] = std::conj(input[i]);
         }
 
-    gettimeofday(&tv, NULL);
-    long long int end = tv.tv_sec * 1000000 + tv.tv_usec;
+    end = std::chrono::system_clock::now();
+    std::chrono::duration<double> elapsed_seconds = end - start;
     std::cout << "Conjugate of a " << FLAGS_size_conjugate_test
-              << "-length complex float vector in standard C finished in " << (end - begin)
+              << "-length complex float vector in standard C finished in " << elapsed_seconds.count() * 1e6
               << " microseconds" << std::endl;
 
     delete[] input;
     delete[] output;
-    ASSERT_LE(0, end - begin);
+    ASSERT_LE(0, elapsed_seconds.count() * 1e6);
 
 }
 
 
-TEST(Conjugate_Test, C11ComplexImplementation)
+TEST(ConjugateTest, C11ComplexImplementation)
 {
     const std::vector<std::complex<float>> input(FLAGS_size_conjugate_test);
     std::vector<std::complex<float>> output(FLAGS_size_conjugate_test);
-    struct timeval tv;
-    gettimeofday(&tv, NULL);
-    long long int begin = tv.tv_sec * 1000000 + tv.tv_usec;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    start = std::chrono::system_clock::now();
     int pos = 0;
     for (const auto &item : input)
         {
             output[pos++] = std::conj(item);
         }
-    gettimeofday(&tv, NULL);
-    long long int end = tv.tv_sec * 1000000 + tv.tv_usec;
+    end = std::chrono::system_clock::now();
+    std::chrono::duration<double> elapsed_seconds = end - start;
     std::cout << "Conjugate of a " << FLAGS_size_conjugate_test
-              << " complex<float> vector (C++11-style) finished in " << (end - begin)
+              << " complex<float> vector (C++11-style) finished in " << elapsed_seconds.count() * 1e6
               << " microseconds" << std::endl;
-    ASSERT_LE(0, end - begin);
+    ASSERT_LE(0, elapsed_seconds.count() * 1e6);
 
     std::complex<float> expected(0,0);
     std::complex<float> result(0,0);
@@ -97,44 +95,42 @@ TEST(Conjugate_Test, C11ComplexImplementation)
 }
 
 
-TEST(Conjugate_Test, ArmadilloComplexImplementation)
+TEST(ConjugateTest, ArmadilloComplexImplementation)
 {
     arma::cx_fvec input(FLAGS_size_conjugate_test, arma::fill::zeros);
     arma::cx_fvec output(FLAGS_size_conjugate_test);
 
-    struct timeval tv;
-    gettimeofday(&tv, NULL);
-    long long int begin = tv.tv_sec * 1000000 + tv.tv_usec;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    start = std::chrono::system_clock::now();
 
     output = arma::conj(input);
 
-    gettimeofday(&tv, NULL);
-    long long int end = tv.tv_sec * 1000000 + tv.tv_usec;
+    end = std::chrono::system_clock::now();
+    std::chrono::duration<double> elapsed_seconds = end - start;
     std::cout << "Conjugate of a " << FLAGS_size_conjugate_test
-              << "-length complex float Armadillo vector finished in " << (end - begin)
+              << "-length complex float Armadillo vector finished in " << elapsed_seconds.count() * 1e6
               << " microseconds" << std::endl;
-    ASSERT_LE(0, end - begin);
+    ASSERT_LE(0, elapsed_seconds.count() * 1e6);
 }
 
 
-TEST(Conjugate_Test, VolkComplexImplementation)
+TEST(ConjugateTest, VolkComplexImplementation)
 {
     std::complex<float>* input = static_cast<std::complex<float>*>(volk_gnsssdr_malloc(FLAGS_size_conjugate_test * sizeof(std::complex<float>), volk_gnsssdr_get_alignment()));
     std::complex<float>* output = static_cast<std::complex<float>*>(volk_gnsssdr_malloc(FLAGS_size_conjugate_test * sizeof(std::complex<float>), volk_gnsssdr_get_alignment()));
     memset(input, 0, sizeof(std::complex<float>) * FLAGS_size_conjugate_test);
 
-    struct timeval tv;
-    gettimeofday(&tv, NULL);
-    long long int begin = tv.tv_sec * 1000000 + tv.tv_usec;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    start = std::chrono::system_clock::now();
 
     volk_32fc_conjugate_32fc(output, input, FLAGS_size_conjugate_test);
 
-    gettimeofday(&tv, NULL);
-    long long int end = tv.tv_sec * 1000000 + tv.tv_usec;
+    end = std::chrono::system_clock::now();
+    std::chrono::duration<double> elapsed_seconds = end - start;
     std::cout << "Conjugate of a "<< FLAGS_size_conjugate_test
-              << "-length complex float vector using VOLK finished in " << (end - begin)
+              << "-length complex float vector using VOLK finished in " << elapsed_seconds.count() * 1e6
               << " microseconds" << std::endl;
-    ASSERT_LE(0, end - begin);
+    ASSERT_LE(0, elapsed_seconds.count() * 1e6);
     volk_gnsssdr_free(input);
     volk_gnsssdr_free(output);
 }
diff --git a/src/tests/unit-tests/arithmetic/fft_length_test.cc b/src/tests/unit-tests/arithmetic/fft_length_test.cc
index 649cd7a90..c16dc2509 100644
--- a/src/tests/unit-tests/arithmetic/fft_length_test.cc
+++ b/src/tests/unit-tests/arithmetic/fft_length_test.cc
@@ -29,16 +29,16 @@
  * -------------------------------------------------------------------------
  */
 
-#include <ctime>
+#include <chrono>
 #include <gnuradio/fft/fft.h>
 
 
 DEFINE_int32(fft_iterations_test, 1000, "Number of averaged iterations in FFT length timing test");
 
-TEST(FFT_Length_Test, MeasureExecutionTime)
+TEST(FFTLengthTest, MeasureExecutionTime)
 {
     unsigned int d_fft_size;
-    struct timeval tv;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
 
     unsigned int fft_sizes [18] = { 1000, 1024, 1960, 2000, 2048, 4000, 4096, 4725, 8000, 8192, 10368, 12000, 16000, 16384, 27000, 32768, 50000, 65536 };
     double execution_times [18];
@@ -50,15 +50,14 @@ TEST(FFT_Length_Test, MeasureExecutionTime)
                     d_fft = new gr::fft::fft_complex(d_fft_size, true);
                     std::fill_n( d_fft->get_inbuf(), d_fft_size, gr_complex( 0.0, 0.0 ) );
 
-                    gettimeofday(&tv, NULL);
-                    long long int begin = tv.tv_sec * 1000000 + tv.tv_usec;
+                    start = std::chrono::system_clock::now();
                     for(int k = 0; k < FLAGS_fft_iterations_test; k++)
                         {
                             d_fft->execute();
                         }
-                    gettimeofday(&tv, NULL);
-                    long long int end = tv.tv_sec * 1000000 + tv.tv_usec;
-                    execution_times[i] = static_cast<double>(end - begin) / (1000000.0 * static_cast<double>(FLAGS_fft_iterations_test));
+                    end = std::chrono::system_clock::now();
+                    std::chrono::duration<double> elapsed_seconds = end - start;
+                    execution_times[i] = elapsed_seconds.count() / static_cast<double>(FLAGS_fft_iterations_test);
                     std::cout << "FFT execution time for length=" << d_fft_size << " : " << execution_times[i] << " [s]" << std::endl;
                     delete d_fft;
                 }
diff --git a/src/tests/unit-tests/arithmetic/magnitude_squared_test.cc b/src/tests/unit-tests/arithmetic/magnitude_squared_test.cc
index 08cde0527..6238b5c75 100644
--- a/src/tests/unit-tests/arithmetic/magnitude_squared_test.cc
+++ b/src/tests/unit-tests/arithmetic/magnitude_squared_test.cc
@@ -31,8 +31,8 @@
  */
 
 
+#include <chrono>
 #include <complex>
-#include <ctime>
 #include <armadillo>
 #include <volk/volk.h>
 #include <volk_gnsssdr/volk_gnsssdr.h>
@@ -40,50 +40,49 @@
 DEFINE_int32(size_magnitude_test, 100000, "Size of the arrays used for magnitude testing");
 
 
-TEST(MagnitudeSquared_Test, StandardCComplexImplementation)
+TEST(MagnitudeSquaredTest, StandardCComplexImplementation)
 {
     std::complex<float>* input = new std::complex<float>[FLAGS_size_magnitude_test];
     float* output = new float[FLAGS_size_magnitude_test];
     unsigned int number = 0;
-    struct timeval tv;
-    gettimeofday(&tv, NULL);
-    long long int begin = tv.tv_sec * 1000000 + tv.tv_usec;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    start = std::chrono::system_clock::now();
 
-    for(number = 0; number < (unsigned int)FLAGS_size_magnitude_test; number++)
+    for(number = 0; number < static_cast<unsigned int>(FLAGS_size_magnitude_test); number++)
         {
             output[number] = (input[number].real() * input[number].real()) + (input[number].imag() * input[number].imag());
         }
 
-    gettimeofday(&tv, NULL);
-    long long int end = tv.tv_sec * 1000000 + tv.tv_usec;
+    end = std::chrono::system_clock::now();
+    std::chrono::duration<double> elapsed_seconds = end - start;
     std::cout << "The squared magnitude of a " << FLAGS_size_magnitude_test
-              << "-length vector in standard C computed in " << (end - begin)
+              << "-length vector in standard C computed in " << elapsed_seconds.count() * 1e6
               << " microseconds" << std::endl;
     delete[] input;
     delete[] output;
-    ASSERT_LE(0, end - begin);
+    ASSERT_LE(0, elapsed_seconds.count() * 1e6);
 }
 
-TEST(MagnitudeSquared_Test, C11ComplexImplementation)
+
+TEST(MagnitudeSquaredTest, C11ComplexImplementation)
 {
     const std::vector<std::complex<float>> input(FLAGS_size_magnitude_test);
     std::vector<float> output(FLAGS_size_magnitude_test);
-    struct timeval tv;
     int pos = 0;
-    gettimeofday(&tv, NULL);
-    long long int begin = tv.tv_sec * 1000000 + tv.tv_usec;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    start = std::chrono::system_clock::now();
 
     for (const auto &item : input)
         {
             output[pos++] = std::norm(item);
         }
 
-    gettimeofday(&tv, NULL);
-    long long int end = tv.tv_sec * 1000000 + tv.tv_usec;
+    end = std::chrono::system_clock::now();
+    std::chrono::duration<double> elapsed_seconds = end - start;
     std::cout << "The squared magnitude of a " << FLAGS_size_magnitude_test
-              << " complex<float> vector (C++11-style) finished in " << (end - begin)
+              << " complex<float> vector (C++11-style) finished in " << elapsed_seconds.count() * 1e6
               << " microseconds" << std::endl;
-    ASSERT_LE(0, end - begin);
+    ASSERT_LE(0, elapsed_seconds.count() * 1e6);
 
     std::complex<float> expected(0,0);
     std::complex<float> result(0,0);
@@ -95,45 +94,42 @@ TEST(MagnitudeSquared_Test, C11ComplexImplementation)
 }
 
 
-TEST(MagnitudeSquared_Test, ArmadilloComplexImplementation)
+TEST(MagnitudeSquaredTest, ArmadilloComplexImplementation)
 {
     arma::cx_fvec input(FLAGS_size_magnitude_test, arma::fill::zeros);
     arma::fvec output(FLAGS_size_magnitude_test);
-    struct timeval tv;
-    gettimeofday(&tv, NULL);
-    long long int begin = tv.tv_sec * 1000000 + tv.tv_usec;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    start = std::chrono::system_clock::now();
 
     output = arma::abs(arma::square(input));
 
-    gettimeofday(&tv, NULL);
-    long long int end = tv.tv_sec * 1000000 + tv.tv_usec;
+    end = std::chrono::system_clock::now();
+    std::chrono::duration<double> elapsed_seconds = end - start;
     std::cout <<  "The squared magnitude of a " << FLAGS_size_magnitude_test
-              << "-length vector using Armadillo computed in " << (end - begin)
+              << "-length vector using Armadillo computed in " << elapsed_seconds.count() * 1e6
               << " microseconds" << std::endl;
-    ASSERT_LE(0, end - begin);
+    ASSERT_LE(0, elapsed_seconds.count() * 1e6);
 }
 
 
-
-TEST(MagnitudeSquared_Test, VolkComplexImplementation)
+TEST(MagnitudeSquaredTest, VolkComplexImplementation)
 {
     std::complex<float>* input = static_cast<std::complex<float>*>(volk_gnsssdr_malloc(FLAGS_size_magnitude_test * sizeof(std::complex<float>), volk_gnsssdr_get_alignment()));
     memset(input, 0, sizeof(std::complex<float>) * FLAGS_size_magnitude_test);
     float* output = static_cast<float*>(volk_gnsssdr_malloc(FLAGS_size_magnitude_test * sizeof(float), volk_gnsssdr_get_alignment()));
-    struct timeval tv;
-    gettimeofday(&tv, NULL);
-    long long int begin = tv.tv_sec * 1000000 + tv.tv_usec;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    start = std::chrono::system_clock::now();
 
     volk_32fc_magnitude_squared_32f(output, input, static_cast<unsigned int>(FLAGS_size_magnitude_test));
 
-    gettimeofday(&tv, NULL);
-    long long int end = tv.tv_sec * 1000000 + tv.tv_usec;
+    end = std::chrono::system_clock::now();
+    std::chrono::duration<double> elapsed_seconds = end - start;
     std::cout <<  "The squared magnitude of a " << FLAGS_size_magnitude_test
-              << "-length vector using VOLK computed in " << (end - begin)
+              << "-length vector using VOLK computed in " << elapsed_seconds.count() * 1e6
               << " microseconds" << std::endl;
     volk_gnsssdr_free(input);
     volk_gnsssdr_free(output);
-    ASSERT_LE(0, end - begin);
+    ASSERT_LE(0, elapsed_seconds.count() * 1e6);
 }
 
 //            volk_32f_accumulator_s32f(&d_input_power, d_magnitude, d_fft_size);
diff --git a/src/tests/unit-tests/arithmetic/multiply_test.cc b/src/tests/unit-tests/arithmetic/multiply_test.cc
index 64e9e4a90..093bca5f9 100644
--- a/src/tests/unit-tests/arithmetic/multiply_test.cc
+++ b/src/tests/unit-tests/arithmetic/multiply_test.cc
@@ -31,8 +31,8 @@
  */
 
 
+#include <chrono>
 #include <complex>
-#include <ctime>
 #include <numeric>
 #include <armadillo>
 #include <volk/volk.h>
@@ -41,24 +41,23 @@
 DEFINE_int32(size_multiply_test, 100000, "Size of the arrays used for multiply testing");
 
 
-TEST(Multiply_Test, StandardCDoubleImplementation)
+TEST(MultiplyTest, StandardCDoubleImplementation)
 {
     double* input = new double[FLAGS_size_multiply_test];
     double* output = new double[FLAGS_size_multiply_test];
     memset(input, 0, sizeof(double) * FLAGS_size_multiply_test);
-    struct timeval tv;
-    gettimeofday(&tv, NULL);
-    long long int begin = tv.tv_sec * 1000000 + tv.tv_usec;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    start = std::chrono::system_clock::now();
 
     for(int i = 0; i < FLAGS_size_multiply_test; i++)
         {
             output[i] = input[i] * input[i];
         }
 
-    gettimeofday(&tv, NULL);
-    long long int end = tv.tv_sec * 1000000 + tv.tv_usec;
+    end = std::chrono::system_clock::now();
+    std::chrono::duration<double> elapsed_seconds = end - start;
     std::cout << "Element-wise multiplication of " << FLAGS_size_multiply_test
-              << " doubles in standard C finished in " << (end - begin)
+              << " doubles in standard C finished in " << elapsed_seconds.count() * 1e6
               << " microseconds" << std::endl;
 
     double acc = 0;
@@ -69,51 +68,49 @@ TEST(Multiply_Test, StandardCDoubleImplementation)
         }
     delete[] input;
     delete[] output;
-    ASSERT_LE(0, end - begin);
+    ASSERT_LE(0, elapsed_seconds.count() * 1e6);
     ASSERT_EQ(expected, acc);
 }
 
 
-TEST(Multiply_Test, ArmadilloImplementation)
+TEST(MultiplyTest, ArmadilloImplementation)
 {
     arma::vec input(FLAGS_size_multiply_test, arma::fill::zeros);
     arma::vec output(FLAGS_size_multiply_test);
 
-    struct timeval tv;
-    gettimeofday(&tv, NULL);
-    long long int begin = tv.tv_sec * 1000000 + tv.tv_usec;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    start = std::chrono::system_clock::now();
 
     output = input % input;
 
-    gettimeofday(&tv, NULL);
-    long long int end = tv.tv_sec * 1000000 + tv.tv_usec;
+    end = std::chrono::system_clock::now();
+    std::chrono::duration<double> elapsed_seconds = end - start;
     std::cout << "Element-wise multiplication of " << FLAGS_size_multiply_test
-              << "-length double Armadillo vectors finished in " << (end - begin)
+              << "-length double Armadillo vectors finished in " << elapsed_seconds.count() * 1e6
               << " microseconds" << std::endl;
-    ASSERT_LE(0, end - begin);
+    ASSERT_LE(0, elapsed_seconds.count() * 1e6);
     ASSERT_EQ(0, arma::norm(output,2));
 }
 
 
 
-TEST(Multiply_Test, StandardCComplexImplementation)
+TEST(MultiplyTest, StandardCComplexImplementation)
 {
     std::complex<float>* input = new std::complex<float>[FLAGS_size_multiply_test];
     std::complex<float>* output = new std::complex<float>[FLAGS_size_multiply_test];
     memset(input, 0, sizeof(std::complex<float>) * FLAGS_size_multiply_test);
-    struct timeval tv;
-    gettimeofday(&tv, NULL);
-    long long int begin = tv.tv_sec * 1000000 + tv.tv_usec;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    start = std::chrono::system_clock::now();
 
     for(int i = 0; i < FLAGS_size_multiply_test; i++)
         {
             output[i] = input[i] * input[i];
         }
 
-    gettimeofday(&tv, NULL);
-    long long int end = tv.tv_sec * 1000000 + tv.tv_usec;
+    end = std::chrono::system_clock::now();
+    std::chrono::duration<double> elapsed_seconds = end - start;
     std::cout << "Element-wise multiplication of " << FLAGS_size_multiply_test
-              << " complex<float> in standard C finished in " << (end - begin)
+              << " complex<float> in standard C finished in " << elapsed_seconds.count() * 1e6
               << " microseconds" << std::endl;
 
     std::complex<float> expected(0,0);
@@ -124,20 +121,19 @@ TEST(Multiply_Test, StandardCComplexImplementation)
          }
     delete[] input;
     delete[] output;
-    ASSERT_LE(0, end - begin);
+    ASSERT_LE(0, elapsed_seconds.count() * 1e6);
     ASSERT_EQ(expected, result);
 }
 
 
 
-TEST(Multiply_Test, C11ComplexImplementation)
+TEST(MultiplyTest, C11ComplexImplementation)
 {
     const std::vector<std::complex<float>> input(FLAGS_size_multiply_test);
     std::vector<std::complex<float>> output(FLAGS_size_multiply_test);
     int pos = 0;
-    struct timeval tv;
-    gettimeofday(&tv, NULL);
-    long long int begin = tv.tv_sec * 1000000 + tv.tv_usec;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    start = std::chrono::system_clock::now();
 
     // Trying a range-based for
     for (const auto &item : input)
@@ -145,12 +141,12 @@ TEST(Multiply_Test, C11ComplexImplementation)
             output[pos++] = item * item;
         }
 
-    gettimeofday(&tv, NULL);
-    long long int end = tv.tv_sec * 1000000 + tv.tv_usec;
+    end = std::chrono::system_clock::now();
+    std::chrono::duration<double> elapsed_seconds = end - start;
     std::cout << "Element-wise multiplication of " << FLAGS_size_multiply_test
-              << " complex<float> vector (C++11-style) finished in " << (end - begin)
+              << " complex<float> vector (C++11-style) finished in " << elapsed_seconds.count() * 1e6
               << " microseconds" << std::endl;
-    ASSERT_LE(0, end - begin);
+    ASSERT_LE(0, elapsed_seconds.count() * 1e6);
 
     std::complex<float> expected(0,0);
     auto result = std::inner_product(output.begin(), output.end(), output.begin(), expected);
@@ -158,47 +154,45 @@ TEST(Multiply_Test, C11ComplexImplementation)
 }
 
 
-TEST(Multiply_Test, ArmadilloComplexImplementation)
+TEST(MultiplyTest, ArmadilloComplexImplementation)
 {
     arma::cx_fvec input(FLAGS_size_multiply_test, arma::fill::zeros);
     arma::cx_fvec output(FLAGS_size_multiply_test);
 
-    struct timeval tv;
-    gettimeofday(&tv, NULL);
-    long long int begin = tv.tv_sec * 1000000 + tv.tv_usec;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    start = std::chrono::system_clock::now();
 
     output = input % input;
 
-    gettimeofday(&tv, NULL);
-    long long int end = tv.tv_sec * 1000000 + tv.tv_usec;
+    end = std::chrono::system_clock::now();
+    std::chrono::duration<double> elapsed_seconds = end - start;
     std::cout << "Element-wise multiplication of " << FLAGS_size_multiply_test
-              << "-length complex float Armadillo vectors finished in " << (end - begin)
+              << "-length complex float Armadillo vectors finished in " << elapsed_seconds.count() * 1e6
               << " microseconds" << std::endl;
-    ASSERT_LE(0, end - begin);
+    ASSERT_LE(0, elapsed_seconds.count() * 1e6);
     ASSERT_EQ(0, arma::norm(output,2));
 }
 
 
 
 
-TEST(Multiply_Test, VolkComplexImplementation)
+TEST(MultiplyTest, VolkComplexImplementation)
 {
     std::complex<float>* input = static_cast<std::complex<float>*>(volk_gnsssdr_malloc(FLAGS_size_multiply_test * sizeof(std::complex<float>), volk_gnsssdr_get_alignment()));
     std::complex<float>* output = static_cast<std::complex<float>*>(volk_gnsssdr_malloc(FLAGS_size_multiply_test * sizeof(std::complex<float>), volk_gnsssdr_get_alignment()));
     memset(input, 0, sizeof(std::complex<float>) * FLAGS_size_multiply_test);
 
-    struct timeval tv;
-    gettimeofday(&tv, NULL);
-    long long int begin = tv.tv_sec * 1000000 + tv.tv_usec;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    start = std::chrono::system_clock::now();
 
     volk_32fc_x2_multiply_32fc(output, input, input, FLAGS_size_multiply_test);
 
-    gettimeofday(&tv, NULL);
-    long long int end = tv.tv_sec * 1000000 + tv.tv_usec;
+    end = std::chrono::system_clock::now();
+    std::chrono::duration<double> elapsed_seconds = end - start;
     std::cout << "Element-wise multiplication of " << FLAGS_size_multiply_test
-              << "-length complex float vector using VOLK finished in " << (end - begin)
+              << "-length complex float vector using VOLK finished in " << elapsed_seconds.count() * 1e6
               << " microseconds" << std::endl;
-    ASSERT_LE(0, end - begin);
+    ASSERT_LE(0, elapsed_seconds.count() * 1e6);
 
     float* mag = static_cast<float*>(volk_gnsssdr_malloc(FLAGS_size_multiply_test * sizeof(float), volk_gnsssdr_get_alignment()));
     volk_32fc_magnitude_32f(mag, output, FLAGS_size_multiply_test);
diff --git a/src/tests/unit-tests/control-plane/control_message_factory_test.cc b/src/tests/unit-tests/control-plane/control_message_factory_test.cc
index a9dde3a02..ebbaac176 100644
--- a/src/tests/unit-tests/control-plane/control_message_factory_test.cc
+++ b/src/tests/unit-tests/control-plane/control_message_factory_test.cc
@@ -38,7 +38,7 @@
 
 
 
-TEST(Control_Message_Factory_Test, GetQueueMessage)
+TEST(ControlMessageFactoryTest, GetQueueMessage)
 {
     std::shared_ptr<ControlMessageFactory> factory = std::make_shared<ControlMessageFactory>();
     gr::message::sptr queue_message = factory->GetQueueMessage(0, 2);
@@ -53,7 +53,7 @@ TEST(Control_Message_Factory_Test, GetQueueMessage)
 
 
 
-TEST(Control_Message_Factory_Test, GetControlMessages)
+TEST(ControlMessageFactoryTest, GetControlMessages)
 {
     std::shared_ptr<ControlMessageFactory> factory = std::make_shared<ControlMessageFactory>();
     gr::message::sptr queue_message = gr::message::make(0, 0, 0, sizeof(ControlMessage));
@@ -74,7 +74,7 @@ TEST(Control_Message_Factory_Test, GetControlMessages)
 
 /*
 
-TEST(Control_Message_Factory_Test, GetControlMessagesWrongSize)
+TEST(ControlMessageFactoryTest, GetControlMessagesWrongSize)
 {
 
     std::shared_ptr<ControlMessageFactory> factory = std::make_shared<ControlMessageFactory>();
diff --git a/src/tests/unit-tests/control-plane/control_thread_test.cc b/src/tests/unit-tests/control-plane/control_thread_test.cc
index accd4f24c..ac3f00bff 100644
--- a/src/tests/unit-tests/control-plane/control_thread_test.cc
+++ b/src/tests/unit-tests/control-plane/control_thread_test.cc
@@ -40,7 +40,6 @@
 #include <sys/msg.h>
 #include <thread>
 #include <boost/lexical_cast.hpp>
-#include <boost/thread.hpp>
 #include <boost/exception/diagnostic_information.hpp>
 #include <boost/exception_ptr.hpp>
 #include <gtest/gtest.h>
@@ -53,7 +52,7 @@
 #include "control_message_factory.h"
 
 
-class Control_Thread_Test: public ::testing::Test
+class ControlThreadTest: public ::testing::Test
 {
 public:
     static int stop_receiver();
@@ -64,7 +63,7 @@ public:
 };
 
 
-int Control_Thread_Test::stop_receiver()
+int ControlThreadTest::stop_receiver()
 {
     message_buffer msg_stop;
     msg_stop.mtype = 1;
@@ -77,7 +76,7 @@ int Control_Thread_Test::stop_receiver()
     while(((msqid_stop = msgget(key_stop, 0644))) == -1){ }
 
     // wait for a couple of seconds
-    std::this_thread::sleep_until(std::chrono::system_clock::now() + std::chrono::seconds(2));
+    std::this_thread::sleep_for(std::chrono::seconds(2));
 
     // Stop the receiver
     msgsnd(msqid_stop, &msg_stop, msgsend_size, IPC_NOWAIT);
@@ -86,7 +85,7 @@ int Control_Thread_Test::stop_receiver()
 }
 
 
-TEST_F(Control_Thread_Test, InstantiateRunControlMessages)
+TEST_F(ControlThreadTest, InstantiateRunControlMessages)
 {
     std::shared_ptr<InMemoryConfiguration> config = std::make_shared<InMemoryConfiguration>();
 
@@ -113,7 +112,7 @@ TEST_F(Control_Thread_Test, InstantiateRunControlMessages)
     config->set_property("TelemetryDecoder_1C.item_type", "gr_complex");
     config->set_property("Observables.implementation", "Hybrid_Observables");
     config->set_property("Observables.item_type", "gr_complex");
-    config->set_property("PVT.implementation", "Hybrid_PVT");
+    config->set_property("PVT.implementation", "RTKLIB_PVT");
     config->set_property("PVT.item_type", "gr_complex");
 
     std::shared_ptr<ControlThread> control_thread = std::make_shared<ControlThread>(config);
@@ -131,11 +130,11 @@ TEST_F(Control_Thread_Test, InstantiateRunControlMessages)
     {
             control_thread->run();
     }
-    catch( boost::exception & e )
+    catch(const boost::exception & e)
     {
             std::cout << "Boost exception: " << boost::diagnostic_information(e);
     }
-    catch(std::exception const&  ex)
+    catch(const std::exception & ex)
     {
             std::cout  << "STD exception: " << ex.what();
     }
@@ -147,7 +146,7 @@ TEST_F(Control_Thread_Test, InstantiateRunControlMessages)
 }
 
 
-TEST_F(Control_Thread_Test, InstantiateRunControlMessages2)
+TEST_F(ControlThreadTest, InstantiateRunControlMessages2)
 {
     std::shared_ptr<InMemoryConfiguration> config = std::make_shared<InMemoryConfiguration>();
     config->set_property("SignalSource.implementation", "File_Signal_Source");
@@ -173,7 +172,7 @@ TEST_F(Control_Thread_Test, InstantiateRunControlMessages2)
     config->set_property("TelemetryDecoder_1C.item_type", "gr_complex");
     config->set_property("Observables.implementation", "Hybrid_Observables");
     config->set_property("Observables.item_type", "gr_complex");
-    config->set_property("PVT.implementation", "Hybrid_PVT");
+    config->set_property("PVT.implementation", "RTKLIB_PVT");
     config->set_property("PVT.item_type", "gr_complex");
 
     std::unique_ptr<ControlThread> control_thread2(new ControlThread(config));
@@ -194,11 +193,11 @@ TEST_F(Control_Thread_Test, InstantiateRunControlMessages2)
     {
             control_thread2->run();
     }
-    catch( boost::exception & e )
+    catch(const boost::exception & e)
     {
             std::cout << "Boost exception: " << boost::diagnostic_information(e);
     }
-    catch(std::exception const&  ex)
+    catch(const std::exception & ex)
     {
             std::cout  << "STD exception: " << ex.what();
     }
@@ -211,7 +210,7 @@ TEST_F(Control_Thread_Test, InstantiateRunControlMessages2)
 
 
 
-TEST_F(Control_Thread_Test, StopReceiverProgrammatically)
+TEST_F(ControlThreadTest, StopReceiverProgrammatically)
 {
     std::shared_ptr<InMemoryConfiguration> config = std::make_shared<InMemoryConfiguration>();
     config->set_property("SignalSource.implementation", "File_Signal_Source");
@@ -237,10 +236,10 @@ TEST_F(Control_Thread_Test, StopReceiverProgrammatically)
     config->set_property("TelemetryDecoder_1C.item_type", "gr_complex");
     config->set_property("Observables.implementation", "Hybrid_Observables");
     config->set_property("Observables.item_type", "gr_complex");
-    config->set_property("PVT.implementation", "Hybrid_PVT");
+    config->set_property("PVT.implementation", "RTKLIB_PVT");
     config->set_property("PVT.item_type", "gr_complex");
 
-    std::unique_ptr<ControlThread> control_thread(new ControlThread(config));
+    std::shared_ptr<ControlThread> control_thread = std::make_shared<ControlThread>(config);
     gr::msg_queue::sptr control_queue = gr::msg_queue::make(0);
     control_thread->set_control_queue(control_queue);
 
@@ -250,11 +249,11 @@ TEST_F(Control_Thread_Test, StopReceiverProgrammatically)
     {
             control_thread->run();
     }
-    catch( boost::exception & e )
+    catch(const boost::exception & e)
     {
             std::cout << "Boost exception: " << boost::diagnostic_information(e);
     }
-    catch(std::exception const&  ex)
+    catch(const std::exception & ex)
     {
             std::cout  << "STD exception: " << ex.what();
     }
diff --git a/src/tests/unit-tests/control-plane/file_configuration_test.cc b/src/tests/unit-tests/control-plane/file_configuration_test.cc
index eba589357..173b7f18b 100644
--- a/src/tests/unit-tests/control-plane/file_configuration_test.cc
+++ b/src/tests/unit-tests/control-plane/file_configuration_test.cc
@@ -36,7 +36,7 @@
 
 
 
-TEST(File_Configuration_Test, OverridedProperties)
+TEST(FileConfigurationTest, OverridedProperties)
 {
     std::string path = std::string(TEST_PATH);
     std::string filename = path + "data/config_file_sample.txt";
@@ -52,7 +52,7 @@ TEST(File_Configuration_Test, OverridedProperties)
 
 
 
-TEST(File_Configuration_Test, LoadFromNonExistentFile)
+TEST(FileConfigurationTest, LoadFromNonExistentFile)
 {
     std::unique_ptr<ConfigurationInterface> configuration(new FileConfiguration("./i_dont_exist.conf"));
     std::string default_value = "default_value";
@@ -62,7 +62,7 @@ TEST(File_Configuration_Test, LoadFromNonExistentFile)
 
 
 
-TEST(File_Configuration_Test, PropertyDoesNotExist)
+TEST(FileConfigurationTest, PropertyDoesNotExist)
 {
     std::string path = std::string(TEST_PATH);
     std::string filename = path + "data/config_file_sample.txt";
diff --git a/src/tests/unit-tests/control-plane/gnss_block_factory_test.cc b/src/tests/unit-tests/control-plane/gnss_block_factory_test.cc
index 4477e56ac..3f6aee435 100644
--- a/src/tests/unit-tests/control-plane/gnss_block_factory_test.cc
+++ b/src/tests/unit-tests/control-plane/gnss_block_factory_test.cc
@@ -46,7 +46,7 @@
 #include "gnss_block_factory.h"
 #include "channel.h"
 
-TEST(GNSS_Block_Factory_Test, InstantiateFileSignalSource)
+TEST(GNSSBlockFactoryTest, InstantiateFileSignalSource)
 {
     std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
     configuration->set_property("SignalSource.implementation", "File_Signal_Source");
@@ -63,7 +63,7 @@ TEST(GNSS_Block_Factory_Test, InstantiateFileSignalSource)
 }
 
 
-TEST(GNSS_Block_Factory_Test, InstantiateWrongSignalSource)
+TEST(GNSSBlockFactoryTest, InstantiateWrongSignalSource)
 {
     std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
     configuration->set_property("SignalSource.implementation", "Pepito");
@@ -76,7 +76,7 @@ TEST(GNSS_Block_Factory_Test, InstantiateWrongSignalSource)
 }
 
 
-TEST(GNSS_Block_Factory_Test, InstantiateSignalConditioner)
+TEST(GNSSBlockFactoryTest, InstantiateSignalConditioner)
 {
     std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
     configuration->set_property("SignalConditioner.implementation", "Signal_Conditioner");
@@ -87,7 +87,7 @@ TEST(GNSS_Block_Factory_Test, InstantiateSignalConditioner)
 }
 
 
-TEST(GNSS_Block_Factory_Test, InstantiateFIRFilter)
+TEST(GNSSBlockFactoryTest, InstantiateFIRFilter)
 {
     std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
     gr::msg_queue::sptr queue = gr::msg_queue::make(0);
@@ -120,7 +120,7 @@ TEST(GNSS_Block_Factory_Test, InstantiateFIRFilter)
     EXPECT_STREQ("Fir_Filter", input_filter->implementation().c_str());
 }
 
-TEST(GNSS_Block_Factory_Test, InstantiateFreqXlatingFIRFilter)
+TEST(GNSSBlockFactoryTest, InstantiateFreqXlatingFIRFilter)
 {
     std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
     gr::msg_queue::sptr queue = gr::msg_queue::make(0);
@@ -155,7 +155,7 @@ TEST(GNSS_Block_Factory_Test, InstantiateFreqXlatingFIRFilter)
     EXPECT_STREQ("Freq_Xlating_Fir_Filter", input_filter->implementation().c_str());
 }
 
-TEST(GNSS_Block_Factory_Test, InstantiateDirectResampler)
+TEST(GNSSBlockFactoryTest, InstantiateDirectResampler)
 {
     std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
     configuration->set_property("Resampler.implementation", "Direct_Resampler");
@@ -165,7 +165,7 @@ TEST(GNSS_Block_Factory_Test, InstantiateDirectResampler)
     EXPECT_STREQ("Direct_Resampler", resampler->implementation().c_str());
 }
 
-TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaPcpsAcquisition)
+TEST(GNSSBlockFactoryTest, InstantiateGpsL1CaPcpsAcquisition)
 {
     std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
     configuration->set_property("Acquisition.implementation", "GPS_L1_CA_PCPS_Acquisition");
@@ -177,7 +177,7 @@ TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaPcpsAcquisition)
 }
 
 
-TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaPcpsQuickSyncAcquisition)
+TEST(GNSSBlockFactoryTest, InstantiateGpsL1CaPcpsQuickSyncAcquisition)
 {
     std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
     configuration->set_property("Acquisition.implementation", "GPS_L1_CA_PCPS_QuickSync_Acquisition");
@@ -188,7 +188,7 @@ TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaPcpsQuickSyncAcquisition)
     EXPECT_STREQ("GPS_L1_CA_PCPS_QuickSync_Acquisition", acquisition->implementation().c_str());
 }
 
-TEST(GNSS_Block_Factory_Test, InstantiateGalileoE1PcpsQuickSyncAmbiguousAcquisition)
+TEST(GNSSBlockFactoryTest, InstantiateGalileoE1PcpsQuickSyncAmbiguousAcquisition)
 {
     std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
     configuration->set_property("Acquisition.implementation", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition");
@@ -200,7 +200,7 @@ TEST(GNSS_Block_Factory_Test, InstantiateGalileoE1PcpsQuickSyncAmbiguousAcquisit
 }
 
 
-TEST(GNSS_Block_Factory_Test, InstantiateGalileoE1PcpsAmbiguousAcquisition)
+TEST(GNSSBlockFactoryTest, InstantiateGalileoE1PcpsAmbiguousAcquisition)
 {
     std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
     configuration->set_property("Acquisition.implementation", "Galileo_E1_PCPS_Ambiguous_Acquisition");
@@ -212,7 +212,7 @@ TEST(GNSS_Block_Factory_Test, InstantiateGalileoE1PcpsAmbiguousAcquisition)
 }
 
 
-TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaDllPllCAidTracking)
+TEST(GNSSBlockFactoryTest, InstantiateGpsL1CaDllPllCAidTracking)
 {
     std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
     configuration->set_property("Tracking.implementation", "GPS_L1_CA_DLL_PLL_C_Aid_Tracking");
@@ -224,7 +224,7 @@ TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaDllPllCAidTracking)
 }
 
 
-TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaDllPllTracking)
+TEST(GNSSBlockFactoryTest, InstantiateGpsL1CaDllPllTracking)
 {
     std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
     configuration->set_property("Tracking.implementation", "GPS_L1_CA_DLL_PLL_Tracking");
@@ -236,7 +236,7 @@ TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaDllPllTracking)
 }
 
 
-TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaTcpConnectorTracking)
+TEST(GNSSBlockFactoryTest, InstantiateGpsL1CaTcpConnectorTracking)
 {
     std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
     configuration->set_property("Tracking.implementation", "GPS_L1_CA_TCP_CONNECTOR_Tracking");
@@ -248,7 +248,7 @@ TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaTcpConnectorTracking)
 }
 
 
-TEST(GNSS_Block_Factory_Test, InstantiateGalileoE1DllPllVemlTracking)
+TEST(GNSSBlockFactoryTest, InstantiateGalileoE1DllPllVemlTracking)
 {
     std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
     configuration->set_property("Tracking.implementation", "Galileo_E1_DLL_PLL_VEML_Tracking");
@@ -260,7 +260,7 @@ TEST(GNSS_Block_Factory_Test, InstantiateGalileoE1DllPllVemlTracking)
 }
 
 
-TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaTelemetryDecoder)
+TEST(GNSSBlockFactoryTest, InstantiateGpsL1CaTelemetryDecoder)
 {
     std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
     configuration->set_property("TelemetryDecoder.implementation", "GPS_L1_CA_Telemetry_Decoder");
@@ -271,7 +271,7 @@ TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaTelemetryDecoder)
 }
 
 
-TEST(GNSS_Block_Factory_Test, InstantiateChannels)
+TEST(GNSSBlockFactoryTest, InstantiateChannels)
 {
     std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
     configuration->set_property("Channels_1C.count", "2");
@@ -285,12 +285,12 @@ TEST(GNSS_Block_Factory_Test, InstantiateChannels)
     gr::msg_queue::sptr queue = gr::msg_queue::make(0);
     std::unique_ptr<GNSSBlockFactory> factory;
     std::unique_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> channels = std::move(factory->GetChannels(configuration, queue));
-    EXPECT_EQ((unsigned int) 2, channels->size());
+    EXPECT_EQ(static_cast<unsigned int>(2), channels->size());
     channels->erase(channels->begin(), channels->end());
 }
 
 
-TEST(GNSS_Block_Factory_Test, InstantiateObservables)
+TEST(GNSSBlockFactoryTest, InstantiateObservables)
 {
     std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
     configuration->set_property("Observables.implementation", "Pass_Through");
@@ -301,7 +301,7 @@ TEST(GNSS_Block_Factory_Test, InstantiateObservables)
 }
 
 
-TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaObservables)
+TEST(GNSSBlockFactoryTest, InstantiateGpsL1CaObservables)
 {
     std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
     configuration->set_property("Observables.implementation", "Hybrid_Observables");
@@ -314,7 +314,7 @@ TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaObservables)
 
 
 
-TEST(GNSS_Block_Factory_Test, InstantiatePvt)
+TEST(GNSSBlockFactoryTest, InstantiatePvt)
 {
     std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
     configuration->set_property("PVT.implementation", "Pass_Through");
@@ -325,7 +325,7 @@ TEST(GNSS_Block_Factory_Test, InstantiatePvt)
 }
 
 
-TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaPvt)
+TEST(GNSSBlockFactoryTest, InstantiateGpsL1CaPvt)
 {
     std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
     configuration->set_property("PVT.implementation", "Hybrid_PVT");
@@ -333,11 +333,11 @@ TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaPvt)
     std::shared_ptr<GNSSBlockInterface> pvt_ = factory->GetPVT(configuration);
     std::shared_ptr<PvtInterface> pvt = std::dynamic_pointer_cast<PvtInterface>(pvt_);
     EXPECT_STREQ("PVT", pvt->role().c_str());
-    EXPECT_STREQ("Hybrid_PVT", pvt->implementation().c_str());
+    EXPECT_STREQ("RTKLIB_PVT", pvt->implementation().c_str());
 }
 
 
-TEST(GNSS_Block_Factory_Test, InstantiateWrongPvt)
+TEST(GNSSBlockFactoryTest, InstantiateWrongPvt)
 {
     std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
     configuration->set_property("PVT.implementation", "Pepito");
@@ -346,4 +346,3 @@ TEST(GNSS_Block_Factory_Test, InstantiateWrongPvt)
     std::shared_ptr<PvtInterface> pvt = std::dynamic_pointer_cast<PvtInterface>(pvt_);
     EXPECT_EQ(nullptr, pvt);
 }
-
diff --git a/src/tests/unit-tests/control-plane/gnss_flowgraph_test.cc b/src/tests/unit-tests/control-plane/gnss_flowgraph_test.cc
index 1dd59576e..8c31aaca2 100644
--- a/src/tests/unit-tests/control-plane/gnss_flowgraph_test.cc
+++ b/src/tests/unit-tests/control-plane/gnss_flowgraph_test.cc
@@ -65,7 +65,7 @@ TEST(GNSSFlowgraph, InstantiateConnectStartStopOldNotation)
     config->set_property("Tracking_1C.implementation", "GPS_L1_CA_DLL_PLL_Tracking");
     config->set_property("TelemetryDecoder_1C.implementation", "GPS_L1_CA_Telemetry_Decoder");
     config->set_property("Observables.implementation", "Hybrid_Observables");
-    config->set_property("PVT.implementation", "Hybrid_PVT");
+    config->set_property("PVT.implementation", "RTKLIB_PVT");
 
     std::shared_ptr<GNSSFlowgraph> flowgraph = std::make_shared<GNSSFlowgraph>(config, gr::msg_queue::make(0));
 
@@ -100,7 +100,7 @@ TEST(GNSSFlowgraph, InstantiateConnectStartStop)
     config->set_property("Tracking_1C.implementation", "GPS_L1_CA_DLL_PLL_Tracking");
     config->set_property("TelemetryDecoder_1C.implementation", "GPS_L1_CA_Telemetry_Decoder");
     config->set_property("Observables.implementation", "Hybrid_Observables");
-    config->set_property("PVT.implementation", "Hybrid_PVT");
+    config->set_property("PVT.implementation", "RTKLIB_PVT");
 
     std::shared_ptr<GNSSFlowgraph> flowgraph = std::make_shared<GNSSFlowgraph>(config, gr::msg_queue::make(0));
 
@@ -134,7 +134,7 @@ TEST(GNSSFlowgraph, InstantiateConnectStartStopGalileoE1B)
     config->set_property("Tracking_1B.implementation", "Galileo_E1_DLL_PLL_VEML_Tracking");
     config->set_property("TelemetryDecoder_1B.implementation", "Galileo_E1B_Telemetry_Decoder");
     config->set_property("Observables.implementation", "Hybrid_Observables");
-    config->set_property("PVT.implementation", "Hybrid_PVT");
+    config->set_property("PVT.implementation", "RTKLIB_PVT");
 
     std::shared_ptr<GNSSFlowgraph> flowgraph = std::make_shared<GNSSFlowgraph>(config, gr::msg_queue::make(0));
 
@@ -266,7 +266,7 @@ TEST(GNSSFlowgraph, InstantiateConnectStartStopHybrid)
     config->set_property("TelemetryDecoder_1B15.decimation_factor", "1");
 
     config->set_property("Observables.implementation", "Hybrid_Observables");
-    config->set_property("PVT.implementation", "Hybrid_PVT");
+    config->set_property("PVT.implementation", "RTKLIB_PVT");
 
     std::shared_ptr<GNSSFlowgraph> flowgraph = std::make_shared<GNSSFlowgraph>(config, gr::msg_queue::make(0));
 
diff --git a/src/tests/unit-tests/control-plane/string_converter_test.cc b/src/tests/unit-tests/control-plane/string_converter_test.cc
index 65ceb93f7..8393e3248 100644
--- a/src/tests/unit-tests/control-plane/string_converter_test.cc
+++ b/src/tests/unit-tests/control-plane/string_converter_test.cc
@@ -34,7 +34,7 @@
 
 
 
-TEST(String_Converter_Test, StringToBool)
+TEST(StringConverterTest, StringToBool)
 {
     std::unique_ptr<StringConverter> converter(new StringConverter());
     bool conversion_result = converter->convert("false", true);
@@ -43,7 +43,7 @@ TEST(String_Converter_Test, StringToBool)
 }
 
 
-TEST(String_Converter_Test, StringToSizeT)
+TEST(StringConverterTest, StringToSizeT)
 {
     // Example using a raw pointer
     StringConverter* converter;
@@ -55,9 +55,7 @@ TEST(String_Converter_Test, StringToSizeT)
 }
 
 
-
-
-TEST(String_Converter_Test, StringToBoolFail)
+TEST(StringConverterTest, StringToBoolFail)
 {
     std::unique_ptr<StringConverter> converter(new StringConverter());
     bool conversion_result = converter->convert("lse", true);
@@ -66,9 +64,7 @@ TEST(String_Converter_Test, StringToBoolFail)
 }
 
 
-
-
-TEST(String_Converter_Test, StringToSizeTFail)
+TEST(StringConverterTest, StringToSizeTFail)
 {
     std::unique_ptr<StringConverter> converter(new StringConverter());
     size_t conversion_result = converter->convert("false", 1);
diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc
index 022a9b9d1..ccaa8c2af 100644
--- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc
@@ -30,9 +30,8 @@
  */
 
 
-#include <ctime>
+#include <chrono>
 #include <iostream>
-#include <boost/chrono.hpp>
 #include <boost/shared_ptr.hpp>
 #include <gnuradio/top_block.h>
 #include <gnuradio/blocks/file_source.h>
@@ -166,6 +165,7 @@ protected:
     double Pfa_a;
 };
 
+
 void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::init()
 {
     message = 0;
@@ -181,6 +181,7 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::init()
     Pfa_a = 0;
 }
 
+
 void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::config_1()
 {
     gnss_synchro.Channel_ID = 0;
@@ -200,7 +201,7 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::config_1()
 
     config = std::make_shared<InMemoryConfiguration>();
 
-    config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
+    config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(fs_in));
 
     config->set_property("SignalSource.fs_hz", std::to_string(fs_in));
 
@@ -248,6 +249,7 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::config_1()
     config->set_property("Acquisition.dump", "false");
 }
 
+
 void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::config_2()
 {
     gnss_synchro.Channel_ID = 0;
@@ -267,7 +269,7 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::config_2()
 
     config = std::make_shared<InMemoryConfiguration>();
 
-    config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
+    config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(fs_in));
 
     config->set_property("SignalSource.fs_hz", std::to_string(fs_in));
 
@@ -333,43 +335,43 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::config_2()
     config->set_property("Acquisition.dump", "false");    
 }
 
+
 void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::start_queue()
 {
     stop = false;
     ch_thread = boost::thread(&GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::wait_message, this);
 }
 
+
 void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::wait_message()
 {
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
 
     while (!stop)
         {
             acquisition->reset();
 
-            gettimeofday(&tv, NULL);
-            begin = tv.tv_sec *1e6 + tv.tv_usec;
+            start = std::chrono::system_clock::now();
 
             try
             {
                     channel_internal_queue.wait_and_pop(message);
             }
-            catch( boost::exception & e )
+            catch( const boost::exception & e )
             {
-                    DLOG(FATAL) << "Boost exception: " << boost::diagnostic_information(e);
+                    LOG(WARNING) << "Boost exception: " << boost::diagnostic_information(e);
             }
 
-            gettimeofday(&tv, NULL);
-            end = tv.tv_sec*1e6 + tv.tv_usec;
+            end = std::chrono::system_clock::now();
+            std::chrono::duration<double> elapsed_seconds = end - start;
 
-            mean_acq_time_us += (end - begin);
+            mean_acq_time_us += elapsed_seconds.count() * 1e6;
 
             process_message();
         }
 }
 
+
 void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::process_message()
 {
     if (message == 1)
@@ -377,7 +379,7 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::process_message()
             detection_counter++;
 
             // The term -5 is here to correct the additional delay introduced by the FIR filter
-            double delay_error_chips = std::abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*1023.0/((double)fs_in*1e-3));
+            double delay_error_chips = std::abs(static_cast<double>(expected_delay_chips) - (static_cast<double>(gnss_synchro.Acq_delay_samples) - 5) * 1023.0 / (static_cast<double>(fs_in)*1e-3));
             double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
 
             mse_delay += std::pow(delay_error_chips, 2);
@@ -391,16 +393,16 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::process_message()
 
     realization_counter++;
 
-    std::cout << "Progress: " << round((float)realization_counter/num_of_realizations*100) << "% \r" << std::flush;
+    std::cout << "Progress: " << round(static_cast<float>(realization_counter) / static_cast<float>(num_of_realizations) * 100.0) << "% \r" << std::flush;
 
     if (realization_counter == num_of_realizations)
         {
             mse_delay /= num_of_realizations;
             mse_doppler /= num_of_realizations;
 
-            Pd = (double)correct_estimation_counter / (double)num_of_realizations;
-            Pfa_a = (double)detection_counter / (double)num_of_realizations;
-            Pfa_p = (double)(detection_counter-correct_estimation_counter) / (double)num_of_realizations;
+            Pd = static_cast<double>(correct_estimation_counter) / static_cast<double>(num_of_realizations);
+            Pfa_a = static_cast<double>(detection_counter) / static_cast<double>(num_of_realizations);
+            Pfa_p = static_cast<double>(detection_counter - correct_estimation_counter) / static_cast<double>(num_of_realizations);
 
             mean_acq_time_us /= num_of_realizations;
 
@@ -409,23 +411,25 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::process_message()
         }
 }
 
+
 void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::stop_queue()
 {
     stop = true;
 }
 
+
 TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, Instantiate)
 {
     config_1();
     std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition", 1, 1);
 }
 
+
 TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ConnectAndRun)
 {
     int nsamples = floor(fs_in*integration_time_ms*1e-3);
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
 
     config_1();
     queue = gr::msg_queue::make(0);
@@ -465,16 +469,16 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ConnectAndRun)
     }) << "Failure connecting the blocks of acquisition test." << std::endl;
 
     EXPECT_NO_THROW( {
-        gettimeofday(&tv, NULL);
-        begin = tv.tv_sec *1e6 + tv.tv_usec;
+        start = std::chrono::system_clock::now();
         top_block->run(); // Start threads and wait
-        gettimeofday(&tv, NULL);
-        end = tv.tv_sec *1e6 + tv.tv_usec;
-    }) << "Failure running he top_block." << std::endl;
+        end = std::chrono::system_clock::now();
+        elapsed_seconds = end - start;
+    }) << "Failure running the top_block." << std::endl;
 
-    std::cout <<  "Processed " << nsamples << " samples in " << (end - begin) << " microseconds" << std::endl;
+    std::cout <<  "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
 }
 
+
 TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ValidationOfResults)
 {
     config_1();
@@ -551,7 +555,7 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ValidationOfResults)
                     EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS.";
                     if (message == 1)
                         {
-                            EXPECT_EQ((unsigned int)1, correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation.";
+                            EXPECT_EQ(static_cast<unsigned int>(1), correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation.";
                         }
 
                 }
@@ -564,6 +568,7 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ValidationOfResults)
         }
 }
 
+
 TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsProbabilities)
 {
     config_2();
diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc
index 45e8d7c3b..cda844b61 100644
--- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc
@@ -31,9 +31,8 @@
  */
 
 
-#include <ctime>
+#include <chrono>
 #include <iostream>
-#include <boost/chrono.hpp>
 #include <gnuradio/top_block.h>
 #include <gnuradio/blocks/file_source.h>
 #include <gnuradio/analog/sig_source_waveform.h>
@@ -203,7 +202,7 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test::config_1()
 
     config = std::make_shared<InMemoryConfiguration>();
 
-    config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
+    config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(fs_in));
 
     config->set_property("SignalSource.fs_hz", std::to_string(fs_in));
 
@@ -275,7 +274,7 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test::config_2()
 
     config = std::make_shared<InMemoryConfiguration>();
 
-    config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
+    config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(fs_in));
 
     config->set_property("SignalSource.fs_hz", std::to_string(fs_in));
 
@@ -355,23 +354,21 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test::start_queue()
 
 void GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test::wait_message()
 {
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
 
     while (!stop)
         {
             acquisition->reset();
 
-            gettimeofday(&tv, NULL);
-            begin = tv.tv_sec*1e6 + tv.tv_usec;
+            start = std::chrono::system_clock::now();
 
             channel_internal_queue.wait_and_pop(message);
 
-            gettimeofday(&tv, NULL);
-            end = tv.tv_sec*1e6 + tv.tv_usec;
+            end = std::chrono::system_clock::now();
+            elapsed_seconds = end - start;
 
-            mean_acq_time_us += (end - begin);
+            mean_acq_time_us += elapsed_seconds.count() * 1e6;
 
             process_message();
         }
@@ -385,7 +382,7 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test::process_message()
             detection_counter++;
 
             // The term -5 is here to correct the additional delay introduced by the FIR filter
-            double delay_error_chips = std::abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*1023.0/((double)fs_in*1e-3));
+            double delay_error_chips = std::abs(static_cast<double>(expected_delay_chips) - (static_cast<double>(gnss_synchro.Acq_delay_samples)- 5 ) * 1023.0 / static_cast<double>(fs_in*1e-3));
             double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
 
             mse_delay += std::pow(delay_error_chips, 2);
@@ -399,18 +396,18 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test::process_message()
 
     realization_counter++;
 
-    std::cout << "Progress: " << round((float)realization_counter/num_of_realizations*100) << "% \r" << std::flush;
+    std::cout << "Progress: " << round(static_cast<float>(realization_counter) / static_cast<float>(num_of_realizations) * 100.0) << "% \r" << std::flush;
 
     if (realization_counter == num_of_realizations)
         {
-            mse_delay /= (double)num_of_realizations;
-            mse_doppler /= (double)num_of_realizations;
+            mse_delay /= static_cast<double>(num_of_realizations);
+            mse_doppler /= static_cast<double>(num_of_realizations);
 
-            Pd = (double)correct_estimation_counter / (double)num_of_realizations;
-            Pfa_a = (double)detection_counter / (double)num_of_realizations;
-            Pfa_p = (double)(detection_counter-correct_estimation_counter) / (double)num_of_realizations;
+            Pd = static_cast<double>(correct_estimation_counter) / static_cast<double>(num_of_realizations);
+            Pfa_a = static_cast<double>(detection_counter) / static_cast<double>(num_of_realizations);
+            Pfa_p = static_cast<double>(detection_counter-correct_estimation_counter) / static_cast<double>(num_of_realizations);
 
-            mean_acq_time_us /= (double)num_of_realizations;
+            mean_acq_time_us /= static_cast<double>(num_of_realizations);
 
             stop_queue();
             top_block->stop();
@@ -435,9 +432,8 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, Instantiate)
 TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ConnectAndRun)
 {
     int nsamples = floor(fs_in*integration_time_ms*1e-3);
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
     top_block = gr::make_top_block("Acquisition test");
     queue = gr::msg_queue::make(0);
     config_1();
@@ -456,14 +452,13 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ConnectAndRun)
     }) << "Failure connecting the blocks of acquisition test." << std::endl;
 
     EXPECT_NO_THROW( {
-        gettimeofday(&tv, NULL);
-        begin = tv.tv_sec*1e6 + tv.tv_usec;
+        start = std::chrono::system_clock::now();
         top_block->run(); // Start threads and wait
-        gettimeofday(&tv, NULL);
-        end = tv.tv_sec*1e6 + tv.tv_usec;
+        end = std::chrono::system_clock::now();
+        elapsed_seconds = end - start;
     }) << "Failure running the top_block." << std::endl;
 
-    std::cout <<  "Processed " << nsamples << " samples in " << (end - begin) << " microseconds" << std::endl;
+    std::cout <<  "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
 }
 
 
@@ -540,7 +535,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ValidationOfResults)
                 EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS.";
                 if (message == 1)
                     {
-                        EXPECT_EQ((unsigned int)1, correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation.";
+                        EXPECT_EQ(static_cast<unsigned int>(1), correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation.";
                     }
             }
             else if (i == 1)
diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc
index 6fe61c632..55cda548c 100644
--- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc
@@ -41,9 +41,8 @@
  */
 
 
-#include <ctime>
+#include <chrono>
 #include <iostream>
-#include <boost/chrono.hpp>
 #include <gnuradio/top_block.h>
 #include <gnuradio/blocks/file_source.h>
 #include <gnuradio/analog/sig_source_waveform.h>
@@ -150,6 +149,7 @@ protected:
     boost::thread ch_thread;
 };
 
+
 void GalileoE1PcpsAmbiguousAcquisitionGSoCTest::init()
 {
     gnss_synchro.Channel_ID = 0;
@@ -158,7 +158,7 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoCTest::init()
     signal.copy(gnss_synchro.Signal, 2, 0);
     gnss_synchro.PRN = 11;
 
-    config->set_property("GNSS-SDR.internal_fs_hz", "4000000");
+    config->set_property("GNSS-SDR.internal_fs_sps", "4000000");
     config->set_property("Acquisition.item_type", "gr_complex");
     config->set_property("Acquisition.if", "0");
     config->set_property("Acquisition.coherent_integration_time_ms", "4");
@@ -171,6 +171,7 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoCTest::init()
     config->set_property("Acquisition0.cboc", "true");
 }
 
+
 void GalileoE1PcpsAmbiguousAcquisitionGSoCTest::start_queue()
 {
     ch_thread = boost::thread(&GalileoE1PcpsAmbiguousAcquisitionGSoCTest::wait_message, this);
@@ -186,7 +187,7 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoCTest::wait_message()
                     channel_internal_queue.wait_and_pop(message);
                     stop_queue();
             }
-            catch( boost::exception & e )
+            catch( const boost::exception & e )
             {
                     DLOG(WARNING) << "Boost exception: " << boost::diagnostic_information(e);
             }
@@ -194,13 +195,13 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoCTest::wait_message()
         }
 }
 
+
 void GalileoE1PcpsAmbiguousAcquisitionGSoCTest::stop_queue()
 {
     stop = true;
 }
 
 
-
 TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, Instantiate)
 {
     init();
@@ -209,13 +210,13 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, Instantiate)
     EXPECT_STREQ("Galileo_E1_PCPS_Ambiguous_Acquisition", acquisition->implementation().c_str());
 }
 
+
 TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, ConnectAndRun)
 {
     int fs_in = 4000000;
     int nsamples = 4*fs_in;
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
     queue = gr::msg_queue::make(0);
     top_block = gr::make_top_block("Acquisition test");
 
@@ -234,20 +235,19 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, ConnectAndRun)
     }) << "Failure connecting the blocks of acquisition test." << std::endl;
 
     EXPECT_NO_THROW( {
-        gettimeofday(&tv, NULL);
-        begin = tv.tv_sec * 1000000 + tv.tv_usec;
+        start = std::chrono::system_clock::now();
         top_block->run(); // Start threads and wait
-        gettimeofday(&tv, NULL);
-        end = tv.tv_sec * 1000000 + tv.tv_usec;
+        end = std::chrono::system_clock::now();
+        elapsed_seconds = end - start;
     }) << "Failure running the top_block." << std::endl;
-    std::cout <<  "Processed " << nsamples << " samples in " << (end - begin) << " microseconds" << std::endl;
+    std::cout <<  "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
 }
 
+
 TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, ValidationOfResults)
 {
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
     queue = gr::msg_queue::make(0);
     top_block = gr::make_top_block("Acquisition test");
 
@@ -292,23 +292,23 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, ValidationOfResults)
 
     ASSERT_NO_THROW( {
         start_queue();
+        acquisition->set_local_code();
         acquisition->init();
         acquisition->reset();
         acquisition->set_state(1);
     }) << "Failure starting acquisition" << std::endl;
 
     EXPECT_NO_THROW( {
-        gettimeofday(&tv, NULL);
-        begin = tv.tv_sec * 1000000 + tv.tv_usec;
+        start = std::chrono::system_clock::now();
         top_block->run(); // Start threads and wait
-        gettimeofday(&tv, NULL);
-        end = tv.tv_sec * 1000000 + tv.tv_usec;
+        end = std::chrono::system_clock::now();
+        elapsed_seconds = end - start;
     }) << "Failure running the top_block." << std::endl;
 
     stop_queue();
 
     unsigned long int nsamples = gnss_synchro.Acq_samplestamp_samples;
-    std::cout <<  "Acquired " << nsamples << " samples in " << (end - begin) << " microseconds" << std::endl;
+    std::cout <<  "Acquired " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
 
     EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 0=ACQ STOP.";
 
diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc
index 3adec6673..46518b583 100644
--- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc
@@ -31,8 +31,7 @@
  */
 
 
-#include <cstdlib>
-#include <ctime>
+#include <chrono>
 #include <iostream>
 #include <boost/make_shared.hpp>
 #include <gnuradio/top_block.h>
@@ -139,7 +138,7 @@ void GalileoE1PcpsAmbiguousAcquisitionTest::init()
     signal.copy(gnss_synchro.Signal, 2, 0);
     gnss_synchro.PRN = 1;
 
-    config->set_property("GNSS-SDR.internal_fs_hz", "4000000");
+    config->set_property("GNSS-SDR.internal_fs_sps", "4000000");
     config->set_property("Acquisition.item_type", "gr_complex");
     config->set_property("Acquisition.if", "0");
     config->set_property("Acquisition.coherent_integration_time_ms", "4");
@@ -152,6 +151,7 @@ void GalileoE1PcpsAmbiguousAcquisitionTest::init()
     config->set_property("Acquisition1.cboc", "true");
 }
 
+
 TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, Instantiate)
 {
     init();
@@ -164,9 +164,8 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ConnectAndRun)
 {
     int fs_in = 4000000;
     int nsamples = 4*fs_in;
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
     top_block = gr::make_top_block("Acquisition test");
     gr::msg_queue::sptr queue = gr::msg_queue::make(0);
     init();
@@ -184,21 +183,19 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ConnectAndRun)
     }) << "Failure connecting the blocks of acquisition test." << std::endl;
 
     EXPECT_NO_THROW( {
-        gettimeofday(&tv, NULL);
-        begin = tv.tv_sec*1000000 + tv.tv_usec;
+        start = std::chrono::system_clock::now();
         top_block->run(); // Start threads and wait
-        gettimeofday(&tv, NULL);
-        end = tv.tv_sec*1000000 + tv.tv_usec;
+        end = std::chrono::system_clock::now();
+        elapsed_seconds = end - start;
     }) << "Failure running the top_block." << std::endl;
-    std::cout <<  "Processed " << nsamples << " samples in " << (end-begin) << " microseconds" << std::endl;
+    std::cout <<  "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
 }
 
 
 TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ValidationOfResults)
 {
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
 
     double expected_delay_samples = 2920; //18250;
     double expected_doppler_hz = -632;
@@ -241,27 +238,27 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ValidationOfResults)
         top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events"));
     }) << "Failure connecting the blocks of acquisition test." << std::endl;
 
+    acquisition->set_local_code();
     acquisition->init();
     acquisition->reset();
     acquisition->set_state(1);
 
     EXPECT_NO_THROW( {
-        gettimeofday(&tv, NULL);
-        begin = tv.tv_sec * 1000000 + tv.tv_usec;
+        start = std::chrono::system_clock::now();
         top_block->run(); // Start threads and wait
-        gettimeofday(&tv, NULL);
-        end = tv.tv_sec * 1000000 + tv.tv_usec;
+        end = std::chrono::system_clock::now();
+        elapsed_seconds = end - start;
     }) << "Failure running the top_block." << std::endl;
 
     unsigned long int nsamples = gnss_synchro.Acq_samplestamp_samples;
-    std::cout <<  "Acquired " << nsamples << " samples in " << (end - begin) << " microseconds" << std::endl;
+    std::cout <<  "Acquired " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
     ASSERT_EQ(1, msg_rx->rx_message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS.";
 
     std::cout << "Delay: " << gnss_synchro.Acq_delay_samples << std::endl;
     std::cout << "Doppler: " << gnss_synchro.Acq_doppler_hz << std::endl;
 
     double delay_error_samples = std::abs(expected_delay_samples - gnss_synchro.Acq_delay_samples);
-    float delay_error_chips = (float)(delay_error_samples * 1023 / 4000000);
+    float delay_error_chips = static_cast<float>(delay_error_samples * 1023 / 4000000);
     double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
 
     EXPECT_LE(doppler_error_hz, 166) << "Doppler error exceeds the expected value: 166 Hz = 2/(3*integration period)";
diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc
index 9d30c87fc..e73ee9912 100644
--- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc
@@ -31,7 +31,7 @@
  */
 
 
-#include <ctime>
+#include <chrono>
 #include <iostream>
 #include <boost/shared_ptr.hpp>
 #include <gnuradio/top_block.h>
@@ -167,6 +167,7 @@ protected:
     double Pfa_a;
 };
 
+
 void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::init()
 {
     message = 0;
@@ -182,6 +183,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::init()
     Pfa_a = 0;
 }
 
+
 void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::config_1()
 {
     gnss_synchro.Channel_ID = 0;
@@ -201,7 +203,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::config_1()
 
     config = std::make_shared<InMemoryConfiguration>();
 
-    config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
+    config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(fs_in));
 
     config->set_property("SignalSource.fs_hz", std::to_string(fs_in));
 
@@ -252,6 +254,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::config_1()
     config->set_property("Acquisition.dump", "false");
 }
 
+
 void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::config_2()
 {
     gnss_synchro.Channel_ID = 0;
@@ -271,7 +274,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::config_2()
 
     config = std::make_shared<InMemoryConfiguration>();
 
-    config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
+    config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(fs_in));
 
     config->set_property("SignalSource.fs_hz", std::to_string(fs_in));
 
@@ -340,6 +343,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::config_2()
     config->set_property("Acquisition.dump", "false");
 }
 
+
 void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::start_queue()
 {
     stop = false;
@@ -349,28 +353,27 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::start_queue()
 
 void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::wait_message()
 {
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
 
     while (!stop)
         {
             acquisition->reset();
 
-            gettimeofday(&tv, NULL);
-            begin = tv.tv_sec *1e6 + tv.tv_usec;
+            start = std::chrono::system_clock::now();
 
             channel_internal_queue.wait_and_pop(message);
 
-            gettimeofday(&tv, NULL);
-            end = tv.tv_sec *1e6 + tv.tv_usec;
+            end = std::chrono::system_clock::now();
+            elapsed_seconds = end - start;
 
-            mean_acq_time_us += (end-begin);
+            mean_acq_time_us += elapsed_seconds.count() * 1e6;
 
             process_message();
         }
 }
 
+
 void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::process_message()
 {
     if (message == 1)
@@ -378,7 +381,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::process_message()
             detection_counter++;
 
             // The term -5 is here to correct the additional delay introduced by the FIR filter
-            double delay_error_chips = std::abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*1023.0/((double)fs_in*1e-3));
+            double delay_error_chips = std::abs(static_cast<double>(expected_delay_chips) - static_cast<double>(gnss_synchro.Acq_delay_samples - 5) * 1023.0 / (static_cast<double>(fs_in) * 1e-3));
             double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
 
             mse_delay += std::pow(delay_error_chips, 2);
@@ -392,16 +395,16 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::process_message()
 
     realization_counter++;
 
-    std::cout << "Progress: " << round((float)realization_counter/num_of_realizations*100) << "% \r" << std::flush;
+    std::cout << "Progress: " << round(static_cast<float>(realization_counter) / static_cast<float>(num_of_realizations) * 100.0) << "% \r" << std::flush;
 
     if (realization_counter == num_of_realizations)
         {
             mse_delay /= num_of_realizations;
             mse_doppler /= num_of_realizations;
 
-            Pd = (double)correct_estimation_counter / (double)num_of_realizations;
-            Pfa_a = (double)detection_counter / (double)num_of_realizations;
-            Pfa_p = (double)(detection_counter-correct_estimation_counter) / (double)num_of_realizations;
+            Pd = static_cast<double>(correct_estimation_counter) / static_cast<double>(num_of_realizations);
+            Pfa_a = static_cast<double>(detection_counter) / static_cast<double>(num_of_realizations);
+            Pfa_p = static_cast<double>(detection_counter-correct_estimation_counter) / static_cast<double>(num_of_realizations);
 
             mean_acq_time_us /= num_of_realizations;
 
@@ -412,11 +415,13 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::process_message()
         }
 }
 
+
 void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::stop_queue()
 {
     stop = true;
 }
 
+
 TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, Instantiate)
 {
     config_1();
@@ -424,12 +429,12 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, Instantiate)
     acquisition = std::dynamic_pointer_cast<GalileoE1PcpsCccwsrAmbiguousAcquisition>(acq_);
 }
 
+
 TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ConnectAndRun)
 {
     int nsamples = floor(fs_in*integration_time_ms*1e-3);
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
 
     config_1();
     top_block = gr::make_top_block("Acquisition test");
@@ -449,16 +454,16 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ConnectAndRun)
     }) << "Failure connecting the blocks of acquisition test."<< std::endl;
 
     EXPECT_NO_THROW( {
-        gettimeofday(&tv, NULL);
-        begin = tv.tv_sec *1e6 + tv.tv_usec;
+        start = std::chrono::system_clock::now();
         top_block->run(); // Start threads and wait
-        gettimeofday(&tv, NULL);
-        end = tv.tv_sec *1e6 + tv.tv_usec;
+        end = std::chrono::system_clock::now();
+        elapsed_seconds = end - start;
     }) << "Failure running the top_block."<< std::endl;
 
-    std::cout <<  "Processed " << nsamples << " samples in " << (end - begin) << " microseconds" << std::endl;
+    std::cout <<  "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
 }
 
+
 TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResults)
 {
     config_1();
@@ -537,7 +542,7 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResults)
                 //EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS.";
                 if (message == 1)
                     {
-                        EXPECT_EQ((unsigned int)1, correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation.";
+                        EXPECT_EQ(static_cast<unsigned int>(1), correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation.";
                     }
             }
             else if (i == 1)
@@ -557,6 +562,7 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResults)
         }
 }
 
+
 TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResultsProbabilities)
 {
     config_2();
diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc
index a35e25cf4..5e9b4d92d 100644
--- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc
@@ -31,7 +31,7 @@
  */
 
 
-#include <ctime>
+#include <chrono>
 #include <fstream>
 #include <iostream>
 #include <stdexcept>
@@ -109,6 +109,7 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx::GalileoE1PcpsQuic
     rx_message = 0;
 }
 
+
 GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx::~GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx()
 {}
 
@@ -127,7 +128,6 @@ protected:
         gnss_synchro = Gnss_Synchro();
         init();
 }
-
     ~GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test()
     {
     }
@@ -201,6 +201,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::init()
     Pmd = 0;
 }
 
+
 void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::config_1()
 {
     gnss_synchro.Channel_ID = 0;
@@ -220,7 +221,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::config_1()
 
     config = std::make_shared<InMemoryConfiguration>();
 
-    config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
+    config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(fs_in));
 
     config->set_property("SignalSource.fs_hz", std::to_string(fs_in));
 
@@ -273,6 +274,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::config_1()
     config->set_property("Acquisition.dump", "false");
 }
 
+
 void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::config_2()
 {
     gnss_synchro.Channel_ID = 0;
@@ -296,7 +298,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::config_2()
 
     config = std::make_shared<InMemoryConfiguration>();
 
-    config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
+    config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(fs_in));
 
     config->set_property("SignalSource.fs_hz", std::to_string(fs_in));
 
@@ -387,7 +389,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::config_3()
 
     config = std::make_shared<InMemoryConfiguration>();
 
-    config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
+    config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(fs_in));
 
     config->set_property("SignalSource.fs_hz", std::to_string(fs_in));
 
@@ -458,36 +460,37 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::config_3()
     config->set_property("Acquisition.dump", "false");
 }
 
+
 void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::start_queue()
 {
     stop = false;
     ch_thread = boost::thread(&GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::wait_message, this);
 }
 
+
 void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::wait_message()
 {
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> begin, end;
+    std::chrono::duration<double> elapsed_seconds(0);
 
     while (!stop)
         {
             acquisition->reset();
 
-            gettimeofday(&tv, NULL);
-            begin = tv.tv_sec*1e6 + tv.tv_usec;
+            begin = std::chrono::system_clock::now();
 
             channel_internal_queue.wait_and_pop(message);
 
-            gettimeofday(&tv, NULL);
-            end = tv.tv_sec*1e6 + tv.tv_usec;
+            end = std::chrono::system_clock::now();
+            elapsed_seconds = end - begin;
 
-            mean_acq_time_us += (end - begin);
+            mean_acq_time_us += elapsed_seconds.count() * 1e6;
 
             process_message();
         }
 }
 
+
 void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::process_message()
 {
     if (message == 1)
@@ -495,7 +498,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::process_message()
             detection_counter++;
 
             // The term -5 is here to correct the additional delay introduced by the FIR filter
-            double delay_error_chips = std::abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples - 5) * 1023.0 / ((double)fs_in * 1e-3));
+            double delay_error_chips = std::abs(static_cast<double>(expected_delay_chips) - static_cast<double>(gnss_synchro.Acq_delay_samples - 5) * 1023.0 / (static_cast<double>(fs_in) * 1e-3));
             double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
 
             mse_delay += std::pow(delay_error_chips, 2);
@@ -505,7 +508,6 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::process_message()
                 {
                     correct_estimation_counter++;
                 }
-
         }
     else if(message == 2 &&  gnss_synchro.PRN == 10)
         {
@@ -520,25 +522,26 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::process_message()
 
     realization_counter++;
 
-    std::cout << "Progress: " << round((float)realization_counter / num_of_realizations * 100) << "% \r" << std::flush;
+    std::cout << "Progress: " << round(static_cast<float>(realization_counter) / static_cast<float>(num_of_realizations) * 100.0) << "% \r" << std::flush;
 
     if (realization_counter == num_of_realizations)
         {
-            mse_delay /= (double)num_of_realizations;
-            mse_doppler /= (double)num_of_realizations;
+            mse_delay /= static_cast<double>(num_of_realizations);
+            mse_doppler /= static_cast<double>(num_of_realizations);
 
-            Pd = (double)correct_estimation_counter / (double)num_of_realizations;
-            Pfa_a = (double)detection_counter / (double)num_of_realizations;
-            Pfa_p = (double)(detection_counter - correct_estimation_counter) / (double)num_of_realizations;
-            Pmd = (double)miss_detection_counter / (double)num_of_realizations;
+            Pd = static_cast<double>(correct_estimation_counter) / static_cast<double>(num_of_realizations);
+            Pfa_a = static_cast<double>(detection_counter) / static_cast<double>(num_of_realizations);
+            Pfa_p = static_cast<double>(detection_counter - correct_estimation_counter) / static_cast<double>(num_of_realizations);
+            Pmd = static_cast<double>(miss_detection_counter) / static_cast<double>(num_of_realizations);
 
-            mean_acq_time_us /= (double)num_of_realizations;
+            mean_acq_time_us /= static_cast<double>(num_of_realizations);
 
             stop_queue();
             top_block->stop();
         }
 }
 
+
 void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::stop_queue()
 {
     stop = true;
@@ -557,9 +560,8 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ConnectAndRun)
 {
     LOG(INFO) << "**Start connect and run test";
     int nsamples = floor(fs_in*integration_time_ms*1e-3);
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> begin, end;
+    std::chrono::duration<double> elapsed_seconds(0);
     top_block = gr::make_top_block("Acquisition test");
     queue = gr::msg_queue::make(0);
 
@@ -581,18 +583,18 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ConnectAndRun)
     }) << "Failure connecting the blocks of acquisition test."<< std::endl;
 
     EXPECT_NO_THROW( {
-        gettimeofday(&tv, NULL);
-        begin = tv.tv_sec * 1e6 + tv.tv_usec;
+        begin = std::chrono::system_clock::now();
         top_block->run(); // Start threads and wait
-        gettimeofday(&tv, NULL);
-        end = tv.tv_sec * 1e6 + tv.tv_usec;
+        end = std::chrono::system_clock::now();
+        elapsed_seconds = end - begin;
     }) << "Failure running the top_block."<< std::endl;
 
-    std::cout << "Processed " << nsamples << " samples in " << (end - begin) << " microseconds" << std::endl;
+    std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
     LOG(INFO) << "----end connect and run test-----";
     LOG(INFO) << "**End connect and run test";
 }
 
+
 TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResults)
 {
     LOG(INFO) << "Start validation of results test";
@@ -671,7 +673,7 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul
             if (i == 0)
                 {
                     EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS.";
-                    EXPECT_EQ((unsigned int)1, correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation.";
+                    EXPECT_EQ(static_cast<unsigned int>(1), correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation.";
                 }
             else if (i == 1)
                 {
@@ -761,7 +763,7 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul
             if (i == 0)
                 {
                     EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS.";
-                    EXPECT_EQ((unsigned int)1, correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation.";
+                    EXPECT_EQ(static_cast<unsigned int>(1), correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation.";
                 }
             else if (i == 1)
                 {
@@ -772,6 +774,7 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul
     DLOG(INFO) << "End validation of results with noise+interference test";
 }
 
+
 TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResultsProbabilities)
 {
     config_2();
@@ -866,8 +869,6 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul
                             pdpfafile << FLAGS_e1_value_threshold << "," << Pd << "," << Pfa_p << "," << Pmd << std::endl;
                             pdpfafile.close();
                         }
-
-
                 }
             else if (i == 1)
                 {
diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc
index 35cde3a96..4c7fd42d6 100644
--- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc
@@ -33,10 +33,9 @@
 
 
 
-#include <ctime>
+#include <chrono>
 #include <iostream>
 #include <boost/shared_ptr.hpp>
-#include <boost/chrono.hpp>
 #include <boost/thread.hpp>
 #include <gnuradio/top_block.h>
 #include <gnuradio/blocks/file_source.h>
@@ -107,9 +106,11 @@ GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx::GalileoE1PcpsTongAmbig
     rx_message = 0;
 }
 
+
 GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx::~GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx()
 {}
 
+
 class GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test: public ::testing::Test
 {
 protected:
@@ -170,6 +171,7 @@ protected:
     double Pfa_a;
 };
 
+
 void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::init()
 {
     message = 0;
@@ -185,6 +187,7 @@ void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::init()
     Pfa_a = 0;
 }
 
+
 void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::config_1()
 {
     gnss_synchro.Channel_ID = 0;
@@ -204,7 +207,7 @@ void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::config_1()
 
     config = std::make_shared<InMemoryConfiguration>();
 
-    config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
+    config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(fs_in));
 
     config->set_property("SignalSource.fs_hz", std::to_string(fs_in));
 
@@ -256,6 +259,7 @@ void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::config_1()
     config->set_property("Acquisition_Galileo.dump", "false");
 }
 
+
 void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::config_2()
 {
     gnss_synchro.Channel_ID = 0;
@@ -275,7 +279,7 @@ void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::config_2()
 
     config = std::make_shared<InMemoryConfiguration>();
 
-    config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
+    config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(fs_in));
 
     config->set_property("SignalSource.fs_hz", std::to_string(fs_in));
 
@@ -345,36 +349,37 @@ void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::config_2()
     config->set_property("Acquisition_Galileo.dump", "false");
 }
 
+
 void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::start_queue()
 {
     stop = false;
     ch_thread = boost::thread(&GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::wait_message, this);
 }
 
+
 void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::wait_message()
 {
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
 
     while (!stop)
         {
             acquisition->reset();
 
-            gettimeofday(&tv, NULL);
-            begin = tv.tv_sec *1e6 + tv.tv_usec;
+            start = std::chrono::system_clock::now();
 
             channel_internal_queue.wait_and_pop(message);
 
-            gettimeofday(&tv, NULL);
-            end = tv.tv_sec *1e6 + tv.tv_usec;
+            end = std::chrono::system_clock::now();
+            elapsed_seconds = end - start;
 
-            mean_acq_time_us += (end - begin);
+            mean_acq_time_us += elapsed_seconds.count() * 1e6;
 
             process_message();
         }
 }
 
+
 void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::process_message()
 {
     if (message == 1)
@@ -382,7 +387,7 @@ void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::process_message()
             detection_counter++;
 
             // The term -5 is here to correct the additional delay introduced by the FIR filter
-            double delay_error_chips = std::abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*1023.0/((double)fs_in*1e-3));
+            double delay_error_chips = std::abs(static_cast<double>(expected_delay_chips) - static_cast<double>(gnss_synchro.Acq_delay_samples - 5)  * 1023.0 / (static_cast<double>(fs_in) * 1e-3));
             double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
 
             mse_delay += std::pow(delay_error_chips, 2);
@@ -396,16 +401,16 @@ void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::process_message()
 
     realization_counter++;
 
-    std::cout << "Progress: " << round((float)realization_counter/num_of_realizations*100) << "% \r" << std::flush;
+    std::cout << "Progress: " << round(static_cast<float>(realization_counter) / static_cast<float>(num_of_realizations) * 100.0) << "% \r" << std::flush;
 
     if (realization_counter == num_of_realizations)
         {
             mse_delay /= num_of_realizations;
             mse_doppler /= num_of_realizations;
 
-            Pd = (double)correct_estimation_counter / (double)num_of_realizations;
-            Pfa_a = (double)detection_counter / (double)num_of_realizations;
-            Pfa_p = (double)(detection_counter-correct_estimation_counter) / (double)num_of_realizations;
+            Pd = static_cast<double>(correct_estimation_counter) / static_cast<double>(num_of_realizations);
+            Pfa_a = static_cast<double>(detection_counter) / static_cast<double>(num_of_realizations);
+            Pfa_p = static_cast<double>(detection_counter - correct_estimation_counter) / static_cast<double>(num_of_realizations);
 
             mean_acq_time_us /= num_of_realizations;
 
@@ -416,11 +421,13 @@ void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::process_message()
         }
 }
 
+
 void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::stop_queue()
 {
     stop = true;
 }
 
+
 TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, Instantiate)
 {
     config_1();
@@ -428,12 +435,12 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, Instantiate)
     acquisition = std::dynamic_pointer_cast<GalileoE1PcpsTongAmbiguousAcquisition>(acq_);
 }
 
+
 TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ConnectAndRun)
 {
     int nsamples = floor(fs_in*integration_time_ms*1e-3);
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
     top_block = gr::make_top_block("Acquisition test");
     queue = gr::msg_queue::make(0);
     config_1();
@@ -449,16 +456,16 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ConnectAndRun)
     }) << "Failure connecting the blocks of acquisition test." << std::endl;
 
     EXPECT_NO_THROW( {
-        gettimeofday(&tv, NULL);
-        begin = tv.tv_sec * 1e6 + tv.tv_usec;
+        start = std::chrono::system_clock::now();
         top_block->run(); // Start threads and wait
-        gettimeofday(&tv, NULL);
-        end = tv.tv_sec * 1e6 + tv.tv_usec;
+        end = std::chrono::system_clock::now();
+        std::chrono::duration<double> elapsed_seconds = end - start;
     }) << "Failure running the top_block." << std::endl;
 
-    std::cout <<  "Processed " << nsamples << " samples in " << (end-begin) << " microseconds" << std::endl;
+    std::cout <<  "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
 }
 
+
 TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ValidationOfResults)
 {
     config_1();
@@ -534,7 +541,7 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ValidationOfResults)
             if (i == 0)
             {
                 EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS.";
-                EXPECT_EQ((unsigned int)1, correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation.";
+                EXPECT_EQ(static_cast<unsigned int>(1), correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation.";
             }
             else if (i == 1)
             {
@@ -547,6 +554,7 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ValidationOfResults)
         }
 }
 
+
 TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsProbabilities)
 {
     config_2();
diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc
index e34961b9f..de4508341 100644
--- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc
@@ -29,19 +29,16 @@
  * -------------------------------------------------------------------------
  */
 
-#include <ctime>
+#include <chrono>
 #include <iostream>
-#include <boost/chrono.hpp>
 #include <gnuradio/top_block.h>
 #include <gnuradio/blocks/file_source.h>
 #include <gnuradio/analog/sig_source_waveform.h>
 #include <gnuradio/analog/sig_source_c.h>
 #include <gnuradio/msg_queue.h>
 #include <gnuradio/blocks/null_sink.h>
-#include "gnss_block_factory.h"
 #include "gnss_block_interface.h"
 #include "in_memory_configuration.h"
-#include "configuration_interface.h"
 #include "gnss_synchro.h"
 #include "galileo_e5a_noncoherent_iq_acquisition_caf.h"
 #include "signal_generator.h"
@@ -51,8 +48,6 @@
 #include "gnss_sdr_valve.h"
 #include "pass_through.h"
 
-#include "gnss_block_factory.h"
-
 
 // ######## GNURADIO BLOCK MESSAGE RECEVER #########
 class GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx;
@@ -105,6 +100,7 @@ GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx::GalileoE5aPcpsAcquisition
     rx_message = 0;
 }
 
+
 GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx::~GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx()
 {}
 
@@ -136,7 +132,6 @@ protected:
     concurrent_queue<int> channel_internal_queue;
     gr::msg_queue::sptr queue;
     gr::top_block_sptr top_block;
-    //std::shared_ptr<GNSSBlockFactory> factory = std::make_shared<GNSSBlockFactory>();
     std::shared_ptr<GalileoE5aNoncoherentIQAcquisitionCaf> acquisition;
 
     std::shared_ptr<InMemoryConfiguration> config;
@@ -183,6 +178,7 @@ protected:
     int sat = 0;
 };
 
+
 void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::init()
 {
     message = 0;
@@ -198,47 +194,32 @@ void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::init()
     Pfa_a = 0;
 }
 
+
 void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::config_1()
 {
     gnss_synchro.Channel_ID = 0;
     gnss_synchro.System = 'E';
-    //    std::string signal = "5I";
-    //    std::string signal = "5Q";
     std::string signal = "5X";
     signal.copy(gnss_synchro.Signal,2,0);
 
-
-    integration_time_ms = 3;
-    //fs_in = 11e6;
-    //fs_in = 18e6;
+    integration_time_ms = 1;
     fs_in = 32e6;
-    //fs_in = 30.69e6;
-    //fs_in = 20.47e6;
 
-    //    unsigned int delay_samples = (delay_chips_[sat] % codelen)
-    //                          * samples_per_code_[sat] / codelen;
-    expected_delay_chips = round(14000*((double)10230000/(double)fs_in));
+    expected_delay_chips = round(14000.0 * 10230000.0 / static_cast<double>(fs_in));
     expected_doppler_hz = 2800;
-    //expected_doppler_hz = 0;
     expected_delay_sec = 94;
-    //    CAF_window_hz = 3000;
     CAF_window_hz = 0;
     Zero_padding = 0;
 
-    //expected_delay_chips = 1000;
-    //expected_doppler_hz = 250;
     max_doppler_error_hz = 2/(3*integration_time_ms*1e-3);
     max_delay_error_chips = 0.50;
 
-    //max_doppler_error_hz = 1000;
-    //max_delay_error_chips = 1;
-
     num_of_realizations = 1;
 
     config = std::make_shared<InMemoryConfiguration>();
 
     config->set_property("Channel.signal",signal);
-    config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
+    config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(fs_in));
     config->set_property("SignalSource.fs_hz", std::to_string(fs_in));
     config->set_property("SignalSource.item_type", "gr_complex");
     config->set_property("SignalSource.num_satellites", "1");
@@ -276,71 +257,62 @@ void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::config_1()
     config->set_property("InputFilter.filter_type", "bandpass");
     config->set_property("InputFilter.grid_density", "16");
 
-    config->set_property("Acquisition_Galileo.item_type", "gr_complex");
-    config->set_property("Acquisition_Galileo.if", "0");
-    config->set_property("Acquisition_Galileo.coherent_integration_time_ms",
+    config->set_property("Acquisition_5X.item_type", "gr_complex");
+    config->set_property("Acquisition_5X.if", "0");
+    config->set_property("Acquisition_5X.coherent_integration_time_ms",
             std::to_string(integration_time_ms));
-    config->set_property("Acquisition_Galileo.max_dwells", "1");
-    config->set_property("Acquisition_Galileo.CAF_window_hz",std::to_string(CAF_window_hz));
-    config->set_property("Acquisition_Galileo.Zero_padding",std::to_string(Zero_padding));
+    config->set_property("Acquisition_5X.max_dwells", "1");
+    config->set_property("Acquisition_5X.CAF_window_hz",std::to_string(CAF_window_hz));
+    config->set_property("Acquisition_5X.Zero_padding",std::to_string(Zero_padding));
 
-    config->set_property("Acquisition_Galileo.implementation", "Galileo_E5a_Noncoherent_IQ_Acquisition_CAF");
-    config->set_property("Acquisition_Galileo.pfa","0.003");
-    //    config->set_property("Acquisition_Galileo.threshold", "0.01");
-    config->set_property("Acquisition_Galileo.doppler_max", "10000");
-    config->set_property("Acquisition_Galileo.doppler_step", "250");
-    //    config->set_property("Acquisition_Galileo.doppler_step", "500");
-    config->set_property("Acquisition_Galileo.bit_transition_flag", "false");
-    config->set_property("Acquisition_Galileo.dump", "false");
+    config->set_property("Acquisition_5X.implementation", "Galileo_E5a_Noncoherent_IQ_Acquisition_CAF");
+    config->set_property("Acquisition_5X.pfa","0.003");
+    //    config->set_property("Acquisition_5X.threshold", "0.01");
+    config->set_property("Acquisition_5X.doppler_max", "10000");
+    config->set_property("Acquisition_5X.doppler_step", "250");
+    config->set_property("Acquisition_5X.bit_transition_flag", "false");
+    config->set_property("Acquisition_5X.dump", "false");
     config->set_property("SignalSource.dump_filename", "../data/acquisition.dat");
 }
 
+
 void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::config_2()
 {
     gnss_synchro.Channel_ID = 0;
     gnss_synchro.System = 'E';
-    std::string signal = "5Q";
-    //std::string signal = "5X";
+    std::string signal = "5X";
     signal.copy(gnss_synchro.Signal,2,0);
 
     integration_time_ms = 3;
-    //fs_in = 10.24e6;
-    //fs_in = 12e6;
-    fs_in = 12e6;
 
-    //expected_delay_chips = 600;
-    //expected_doppler_hz = 750;
+    fs_in = 12e6;
 
     expected_delay_chips = 1000;
     expected_doppler_hz = 250;
     max_doppler_error_hz = 2/(3*integration_time_ms*1e-3);
     max_delay_error_chips = 0.50;
 
-    //max_doppler_error_hz = 1000;
-    //max_delay_error_chips = 1;
-
     num_of_realizations = 1;
 
     config = std::make_shared<InMemoryConfiguration>();
 
-    config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
+    config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(fs_in));
 
-    config->set_property("Acquisition_Galileo.item_type", "gr_complex");
-    config->set_property("Acquisition_Galileo.if", "0");
-    config->set_property("Acquisition_Galileo.coherent_integration_time_ms",
+    config->set_property("Acquisition_5X.item_type", "gr_complex");
+    config->set_property("Acquisition_5X.if", "0");
+    config->set_property("Acquisition_5X.coherent_integration_time_ms",
             std::to_string(integration_time_ms));
-    config->set_property("Acquisition_Galileo.max_dwells", "1");
-    config->set_property("Acquisition_Galileo.implementation", "Galileo_E5a_PCPS_Acquisition");
-    //config->set_property("Acquisition_Galileo.implementation", "Galileo_E5a_Pilot_3ms_Acquisition");
-    //config->set_property("Acquisition_Galileo.implementation", "Galileo_E5ax_2ms_Pcps_Acquisition");
-    config->set_property("Acquisition_Galileo.threshold", "0.1");
-    config->set_property("Acquisition_Galileo.doppler_max", "10000");
-    config->set_property("Acquisition_Galileo.doppler_step", "250");
-    config->set_property("Acquisition_Galileo.bit_transition_flag", "false");
-    config->set_property("Acquisition_Galileo.dump", "false");
+    config->set_property("Acquisition_5X.max_dwells", "1");
+    config->set_property("Acquisition_5X.implementation", "Galileo_E5a_PCPS_Acquisition");
+    config->set_property("Acquisition_5X.threshold", "0.1");
+    config->set_property("Acquisition_5X.doppler_max", "10000");
+    config->set_property("Acquisition_5X.doppler_step", "250");
+    config->set_property("Acquisition_5X.bit_transition_flag", "false");
+    config->set_property("Acquisition_5X.dump", "false");
     config->set_property("SignalSource.dump_filename", "../data/acquisition.dat");
 }
 
+
 void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::config_3()
 {
     gnss_synchro.Channel_ID = 0;
@@ -349,15 +321,9 @@ void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::config_3()
     std::string signal = "5X";
     signal.copy(gnss_synchro.Signal,2,0);
 
-
     integration_time_ms = 3;
-    //fs_in = 10.24e6;
-    //fs_in = 12e6;
     fs_in = 12e6;
 
-    //expected_delay_chips = 600;
-    //expected_doppler_hz = 750;
-
     expected_delay_chips = 0;
     expected_delay_sec = 0;
     expected_doppler_hz = 0;
@@ -373,14 +339,12 @@ void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::config_3()
 
     max_doppler_error_hz = 2/(3*integration_time_ms*1e-3);
     max_delay_error_chips = 0.50;
-    //max_doppler_error_hz = 1000;
-    //max_delay_error_chips = 1;
 
     num_of_realizations = 10;
 
     config = std::make_shared<InMemoryConfiguration>();
 
-    config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
+    config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(fs_in));
 
     config->set_property("SignalSource.fs_hz", std::to_string(fs_in));
 
@@ -446,53 +410,51 @@ void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::config_3()
     config->set_property("InputFilter.filter_type", "bandpass");
     config->set_property("InputFilter.grid_density", "16");
 
-    config->set_property("Acquisition_Galileo.item_type", "gr_complex");
-    config->set_property("Acquisition_Galileo.if", "0");
-    config->set_property("Acquisition_Galileo.coherent_integration_time_ms",
+    config->set_property("Acquisition_5X.item_type", "gr_complex");
+    config->set_property("Acquisition_5X.if", "0");
+    config->set_property("Acquisition_5X.coherent_integration_time_ms",
             std::to_string(integration_time_ms));
-    config->set_property("Acquisition_Galileo.max_dwells", "1");
-    config->set_property("Acquisition_Galileo.implementation", "Galileo_E5a_PCPS_Acquisition");
-    //config->set_property("Acquisition.implementation", "Galileo_E1_PCPS_Ambiguous_Acquisition");
-    //config->set_property("Acquisition.implementation", "Galileo_E5a_Pilot_3ms_Acquisition");
-
-    config->set_property("Acquisition_Galileo.threshold", "0.5");
-    config->set_property("Acquisition_Galileo.doppler_max", "10000");
-    config->set_property("Acquisition_Galileo.doppler_step", "250");
-    config->set_property("Acquisition_Galileo.bit_transition_flag", "false");
-    config->set_property("Acquisition_Galileo.dump", "false");
+    config->set_property("Acquisition_5X.max_dwells", "1");
+    config->set_property("Acquisition_5X.implementation", "Galileo_E5a_PCPS_Acquisition");
+    config->set_property("Acquisition_5X.threshold", "0.5");
+    config->set_property("Acquisition_5X.doppler_max", "10000");
+    config->set_property("Acquisition_5X.doppler_step", "250");
+    config->set_property("Acquisition_5X.bit_transition_flag", "false");
+    config->set_property("Acquisition_5X.dump", "false");
     config->set_property("SignalSource.dump_filename", "../data/acquisition.dat");
 }
 
+
 void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::start_queue()
 {
     stop = false;
     ch_thread = boost::thread(&GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::wait_message, this);
 }
 
+
 void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::wait_message()
 {
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
 
     while (!stop)
         {
             acquisition->reset();
 
-            gettimeofday(&tv, NULL);
-            begin = tv.tv_sec *1e6 + tv.tv_usec;
+            start = std::chrono::system_clock::now();
 
             channel_internal_queue.wait_and_pop(message);
 
-            gettimeofday(&tv, NULL);
-            end = tv.tv_sec *1e6 + tv.tv_usec;
+            end = std::chrono::system_clock::now();
+            elapsed_seconds = end - start;
 
-            mean_acq_time_us += (end-begin);
+            mean_acq_time_us += elapsed_seconds.count() * 1e6;
 
             process_message();
         }
 }
 
+
 void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::process_message()
 {
     if (message == 1)
@@ -502,19 +464,19 @@ void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::process_message()
             switch (sat)
             {
             case 0:
-                delay_error_chips = std::abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*10230.0/((double)fs_in*1e-3));
+                delay_error_chips = std::abs(static_cast<double>(expected_delay_chips) - static_cast<double>(gnss_synchro.Acq_delay_samples - 5) * 10230.0 / (static_cast<double>(fs_in) * 1e-3));
                 doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
                 break;
             case 1:
-                delay_error_chips = std::abs((double)expected_delay_chips1 - (double)(gnss_synchro.Acq_delay_samples-5)*10230.0/((double)fs_in*1e-3));
+                delay_error_chips = std::abs(static_cast<double>(expected_delay_chips1) - static_cast<double>(gnss_synchro.Acq_delay_samples - 5) * 10230.0 / (static_cast<double>(fs_in) * 1e-3));
                 doppler_error_hz = std::abs(expected_doppler_hz1 - gnss_synchro.Acq_doppler_hz);
                 break;
             case 2:
-                delay_error_chips = std::abs((double)expected_delay_chips2 - (double)(gnss_synchro.Acq_delay_samples-5)*10230.0/((double)fs_in*1e-3));
+                delay_error_chips = std::abs(static_cast<double>(expected_delay_chips2) - static_cast<double>(gnss_synchro.Acq_delay_samples - 5) * 10230.0 / (static_cast<double>(fs_in) * 1e-3));
                 doppler_error_hz = std::abs(expected_doppler_hz2 - gnss_synchro.Acq_doppler_hz);
                 break;
             case 3:
-                delay_error_chips = std::abs((double)expected_delay_chips3 - (double)(gnss_synchro.Acq_delay_samples-5)*10230.0/((double)fs_in*1e-3));
+                delay_error_chips = std::abs(static_cast<double>(expected_delay_chips3) - static_cast<double>(gnss_synchro.Acq_delay_samples - 5) * 10230.0 / (static_cast<double>(fs_in) * 1e-3));
                 doppler_error_hz = std::abs(expected_doppler_hz3 - gnss_synchro.Acq_doppler_hz);
                 break;
             default: // case 3
@@ -540,16 +502,16 @@ void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::process_message()
     realization_counter++;
 
     //std::cout << correct_estimation_counter << "correct estimation counter" << std::endl;
-    std::cout << "Progress: " << round((float)realization_counter/num_of_realizations*100) << "% \r" << std::flush;
+    std::cout << "Progress: " << round(static_cast<float>(realization_counter / num_of_realizations * 100)) << "% \r" << std::flush;
     //std::cout << message << "message" <<std::endl;
     if (realization_counter == num_of_realizations)
         {
             mse_delay /= num_of_realizations;
             mse_doppler /= num_of_realizations;
 
-            Pd = (double)correct_estimation_counter / (double)num_of_realizations;
-            Pfa_a = (double)detection_counter / (double)num_of_realizations;
-            Pfa_p = (double)(detection_counter - correct_estimation_counter) / (double)num_of_realizations;
+            Pd = static_cast<double>(correct_estimation_counter) / static_cast<double>(num_of_realizations);
+            Pfa_a = static_cast<double>(detection_counter) / static_cast<double>(num_of_realizations);
+            Pfa_p = static_cast<double>(detection_counter - correct_estimation_counter) / static_cast<double>(num_of_realizations);
 
             mean_acq_time_us /= num_of_realizations;
 
@@ -577,9 +539,8 @@ TEST_F(GalileoE5aPcpsAcquisitionGSoC2014GensourceTest, ConnectAndRun)
     config_1();
     //int nsamples = floor(5*fs_in*integration_time_ms*1e-3);
     int nsamples = 21000*3;
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
     acquisition = std::make_shared<GalileoE5aNoncoherentIQAcquisitionCaf>(config.get(), "Acquisition", 1, 1);
     boost::shared_ptr<GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx> msg_rx = GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx_make(channel_internal_queue);
     queue = gr::msg_queue::make(0);
@@ -595,55 +556,15 @@ TEST_F(GalileoE5aPcpsAcquisitionGSoC2014GensourceTest, ConnectAndRun)
     }) << "Failure connecting the blocks of acquisition test."<< std::endl;
 
     EXPECT_NO_THROW( {
-        gettimeofday(&tv, NULL);
-        begin = tv.tv_sec *1e6 + tv.tv_usec;
+        start = std::chrono::system_clock::now();
         top_block->run(); // Start threads and wait
-        gettimeofday(&tv, NULL);
-        end = tv.tv_sec *1e6 + tv.tv_usec;
+        end = std::chrono::system_clock::now();
+        elapsed_seconds = end - start;
     }) << "Failure running the top_block."<< std::endl;
 
-    std::cout <<  "Processed " << nsamples << " samples in " << (end - begin) << " microseconds" << std::endl;
+    std::cout <<  "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
 }
 
-/*
-TEST_F(GalileoE5aPcpsAcquisitionGSoC2014GensourceTest, SOURCEValidation)
-{
-    config_1();
-    ASSERT_NO_THROW( {
-        boost::shared_ptr<GenSignalSource> signal_source;
-        SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue);
-        FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1);
-        signal_source.reset(new GenSignalSource(signal_generator, filter, "SignalSource", queue));
-        signal_source->connect(top_block);
-
-
-        //top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0);
-
-    }) << "Failure generating signal" << std::endl;
-}
- */
-/*
-TEST_F(GalileoE5aPcpsAcquisitionGSoC2014GensourceTest, SOURCEValidationTOFILE)
-{
-    config_1();
-    ASSERT_NO_THROW( {
-    std::string filename_ = "../data/Tiered_sinknull.dat";
-    boost::shared_ptr<gr::blocks::file_sink> file_sink_;
-
-        boost::shared_ptr<GenSignalSource> signal_source;
-        SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue);
-        FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1);
-        signal_source.reset(new GenSignalSource(signal_generator, filter, "SignalSource", queue));
-        //signal_source->connect(top_block);
-        file_sink_=gr::blocks::file_sink::make(sizeof(gr_complex), filename_.c_str());
-
-        top_block->connect(signal_source->get_right_block(),0,file_sink_,0);
-
-        //top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0);
-
-    }) << "Failure generating signal" << std::endl;
-}
- */
 
 TEST_F(GalileoE5aPcpsAcquisitionGSoC2014GensourceTest, ValidationOfSIM)
 {
@@ -662,28 +583,26 @@ TEST_F(GalileoE5aPcpsAcquisitionGSoC2014GensourceTest, ValidationOfSIM)
     }) << "Failure setting gnss_synchro."<< std::endl;
 
     ASSERT_NO_THROW( {
-        acquisition->set_doppler_max(config->property("Acquisition_Galileo.doppler_max", 10000));
+        acquisition->set_doppler_max(config->property("Acquisition_5X.doppler_max", 5000));
     }) << "Failure setting doppler_max."<< std::endl;
 
     ASSERT_NO_THROW( {
-        acquisition->set_doppler_step(config->property("Acquisition_Galileo.doppler_step", 500));
+        acquisition->set_doppler_step(config->property("Acquisition_5X.doppler_step", 100));
     }) << "Failure setting doppler_step."<< std::endl;
 
     ASSERT_NO_THROW( {
-        acquisition->set_threshold(config->property("Acquisition_Galileo.threshold", 0.0));
+        acquisition->set_threshold(config->property("Acquisition_5X.threshold", 0.0001));
     }) << "Failure setting threshold."<< std::endl;
 
     ASSERT_NO_THROW( {
         acquisition->connect(top_block);
     }) << "Failure connecting acquisition to the top_block."<< std::endl;
 
-    acquisition->init();
-    // USING SIGNAL GENERATOR
+    // USING THE SIGNAL GENERATOR
 
     ASSERT_NO_THROW( {
         boost::shared_ptr<GenSignalSource> signal_source;
         SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue);
-
         FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1);
         filter->connect(top_block);
         signal_source.reset(new GenSignalSource(signal_generator, filter, "SignalSource", queue));
@@ -695,27 +614,6 @@ TEST_F(GalileoE5aPcpsAcquisitionGSoC2014GensourceTest, ValidationOfSIM)
     acquisition->reset();
     acquisition->init();
 
-    // USING SIGNAL FROM FILE SOURCE
-    //unsigned int skiphead_sps = 28000+32000; // 32 Msps
-    //    unsigned int skiphead_sps = 0;
-    //    unsigned int skiphead_sps = 84000;
-
-    // ASSERT_NO_THROW( {
-    //   //noiseless sim
-    //   //std::string file =  "/home/marc/E5a_acquisitions/sim_32M_sec94_PRN11_long.dat";
-    //   // real
-    // std::string file =  "/home/marc/E5a_acquisitions/32MS_complex.dat";
-    //
-    // const char * file_name = file.c_str();
-    // gr::blocks::file_source::sptr file_source = gr::blocks::file_source::make(sizeof(gr_complex), file_name, false);
-    //
-    // gr::blocks::skiphead::sptr skip_head = gr::blocks::skiphead::make(sizeof(gr_complex), skiphead_sps);
-    // top_block->connect(file_source, 0, skip_head, 0);
-    // top_block->connect(skip_head, 0, acquisition->get_left_block(), 0);
-    //
-    //   // top_block->connect(file_source, 0, acquisition->get_left_block(), 0);
-    //  }) << "Failure connecting the blocks of acquisition test." << std::endl;
-
     // i = 0 --> satellite in acquisition is visible
     // i = 1 --> satellite in acquisition is not visible
     for (unsigned int i = 0; i < 1; i++)
@@ -726,21 +624,20 @@ TEST_F(GalileoE5aPcpsAcquisitionGSoC2014GensourceTest, ValidationOfSIM)
             {
             case 0:
                 {
-                    gnss_synchro.PRN = 19; // present
+                    gnss_synchro.PRN = 11; // present
+                    break;
                 }
             case 1:
                 {
-                    gnss_synchro.PRN = 11;
+                    gnss_synchro.PRN = 19; // not present
+                    break;
                 }
             }
 
-            start_queue();
-
-            acquisition->reset();
-            acquisition->init();
             acquisition->set_gnss_synchro(&gnss_synchro);
             acquisition->set_local_code();
             acquisition->set_state(1);
+            start_queue();
 
             EXPECT_NO_THROW( {
                 top_block->run(); // Start threads and wait
@@ -749,18 +646,16 @@ TEST_F(GalileoE5aPcpsAcquisitionGSoC2014GensourceTest, ValidationOfSIM)
             stop_queue();
 
             ch_thread.join();
-            //std::cout << gnss_synchro.Acq_delay_samples << "acq delay" <<std::endl;
-            //std::cout << gnss_synchro.Acq_doppler_hz << "acq doppler" <<std::endl;
-            //std::cout << gnss_synchro.Acq_samplestamp_samples << "acq samples" <<std::endl;
+
             if (i == 0)
                 {
                     EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS.";
                     if (message == 1)
                         {
-                            //std::cout << gnss_synchro.Acq_delay_samples << "acq delay" <<std::endl;
-                            EXPECT_EQ((unsigned int) 1, correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation.";
+                            // std::cout << gnss_synchro.Acq_delay_samples << "acq delay" <<std::endl;
+                            // std::cout << gnss_synchro.Acq_doppler_hz << "acq doppler" <<std::endl;
+                            EXPECT_EQ(static_cast<unsigned int>(1), correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation.";
                         }
-
                 }
             else if (i == 1)
                 {
@@ -768,6 +663,3 @@ TEST_F(GalileoE5aPcpsAcquisitionGSoC2014GensourceTest, ValidationOfSIM)
                 }
         }
 }
-
-
-
diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc
index 202762ea3..a4a6ec153 100644
--- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc
@@ -31,7 +31,7 @@
  */
 
 
-#include <ctime>
+#include <chrono>
 #include <iostream>
 #include <gnuradio/top_block.h>
 #include <gnuradio/blocks/file_source.h>
@@ -171,6 +171,7 @@ protected:
     double Pfa_a;
 };
 
+
 void GpsL1CaPcpsAcquisitionGSoC2013Test::init()
 {
     message = 0;
@@ -186,6 +187,7 @@ void GpsL1CaPcpsAcquisitionGSoC2013Test::init()
     Pfa_a = 0;
 }
 
+
 void GpsL1CaPcpsAcquisitionGSoC2013Test::config_1()
 {
     gnss_synchro.Channel_ID = 0;
@@ -205,7 +207,7 @@ void GpsL1CaPcpsAcquisitionGSoC2013Test::config_1()
 
     config = std::make_shared<InMemoryConfiguration>();
 
-    config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
+    config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(fs_in));
 
     config->set_property("SignalSource.fs_hz", std::to_string(fs_in));
 
@@ -255,6 +257,7 @@ void GpsL1CaPcpsAcquisitionGSoC2013Test::config_1()
     config->set_property("Acquisition.dump", "false");
 }
 
+
 void GpsL1CaPcpsAcquisitionGSoC2013Test::config_2()
 {
     gnss_synchro.Channel_ID = 0;
@@ -274,7 +277,7 @@ void GpsL1CaPcpsAcquisitionGSoC2013Test::config_2()
 
     config = std::make_shared<InMemoryConfiguration>();
 
-    config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
+    config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(fs_in));
 
     config->set_property("SignalSource.fs_hz", std::to_string(fs_in));
 
@@ -342,36 +345,37 @@ void GpsL1CaPcpsAcquisitionGSoC2013Test::config_2()
     config->set_property("Acquisition.dump", "false");
 }
 
+
 void GpsL1CaPcpsAcquisitionGSoC2013Test::start_queue()
 {
     stop = false;
     ch_thread = boost::thread(&GpsL1CaPcpsAcquisitionGSoC2013Test::wait_message, this);
 }
 
+
 void GpsL1CaPcpsAcquisitionGSoC2013Test::wait_message()
 {
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
 
     while (!stop)
         {
             acquisition->reset();
 
-            gettimeofday(&tv, NULL);
-            begin = tv.tv_sec *1e6 + tv.tv_usec;
+            start = std::chrono::system_clock::now();
 
             channel_internal_queue.wait_and_pop(message);
 
-            gettimeofday(&tv, NULL);
-            end = tv.tv_sec *1e6 + tv.tv_usec;
+            end = std::chrono::system_clock::now();
+            elapsed_seconds = end - start;
 
-            mean_acq_time_us += (end-begin);
+            mean_acq_time_us += elapsed_seconds.count() * 1e6;
 
             process_message();
         }
 }
 
+
 void GpsL1CaPcpsAcquisitionGSoC2013Test::process_message()
 {
     if (message == 1)
@@ -379,7 +383,7 @@ void GpsL1CaPcpsAcquisitionGSoC2013Test::process_message()
             detection_counter++;
 
             // The term -5 is here to correct the additional delay introduced by the FIR filter
-            double delay_error_chips = std::abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*1023.0/((double)fs_in*1e-3));
+            double delay_error_chips = std::abs(static_cast<double>(expected_delay_chips) - static_cast<double>(gnss_synchro.Acq_delay_samples - 5) *1023.0 / (static_cast<double>(fs_in) * 1e-3));
             double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
 
             mse_delay += std::pow(delay_error_chips, 2);
@@ -393,16 +397,16 @@ void GpsL1CaPcpsAcquisitionGSoC2013Test::process_message()
 
     realization_counter++;
 
-    std::cout << "Progress: " << round((float)realization_counter/num_of_realizations*100) << "% \r" << std::flush;
+    std::cout << "Progress: " << round(static_cast<float>(realization_counter) / static_cast<float>(num_of_realizations) * 100.0) << "% \r" << std::flush;
 
     if (realization_counter == num_of_realizations)
         {
             mse_delay /= num_of_realizations;
             mse_doppler /= num_of_realizations;
 
-            Pd = (double)correct_estimation_counter / (double)num_of_realizations;
-            Pfa_a = (double)detection_counter / (double)num_of_realizations;
-            Pfa_p = (double)(detection_counter - correct_estimation_counter) / (double)num_of_realizations;
+            Pd = static_cast<double>(correct_estimation_counter) / static_cast<double>(num_of_realizations);
+            Pfa_a = static_cast<double>(detection_counter) / static_cast<double>(num_of_realizations);
+            Pfa_p = static_cast<double>(detection_counter - correct_estimation_counter) / static_cast<double>(num_of_realizations);
 
             mean_acq_time_us /= num_of_realizations;
 
@@ -411,11 +415,13 @@ void GpsL1CaPcpsAcquisitionGSoC2013Test::process_message()
         }
 }
 
+
 void GpsL1CaPcpsAcquisitionGSoC2013Test::stop_queue()
 {
     stop = true;
 }
 
+
 TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, Instantiate)
 {
     config_1();
@@ -423,12 +429,12 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, Instantiate)
     delete acquisition;
 }
 
+
 TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ConnectAndRun)
 {
     int nsamples = floor(fs_in*integration_time_ms*1e-3);
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
     queue = gr::msg_queue::make(0);
     top_block = gr::make_top_block("Acquisition test");
 
@@ -446,18 +452,18 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ConnectAndRun)
     }) << "Failure connecting the blocks of acquisition test."<< std::endl;
 
     EXPECT_NO_THROW( {
-        gettimeofday(&tv, NULL);
-        begin = tv.tv_sec *1e6 + tv.tv_usec;
+        start = std::chrono::system_clock::now();
         top_block->run(); // Start threads and wait
-        gettimeofday(&tv, NULL);
-        end = tv.tv_sec *1e6 + tv.tv_usec;
+        end = std::chrono::system_clock::now();
+        elapsed_seconds = end - start;
     }) << "Failure running the top_block."<< std::endl;
 
-    std::cout <<  "Processed " << nsamples << " samples in " << (end - begin) << " microseconds" << std::endl;
+    std::cout <<  "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
 
     delete acquisition;
 }
 
+
 TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ValidationOfResults)
 {
     config_1();
@@ -531,7 +537,7 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ValidationOfResults)
                 EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS.";
                 if (message == 1)
                     {
-                        EXPECT_EQ((unsigned int) 1, correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation.";
+                        EXPECT_EQ(static_cast<unsigned int>(1), correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation.";
                     }
 
             }
@@ -554,6 +560,7 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ValidationOfResults)
     delete acquisition;
 }
 
+
 TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ValidationOfResultsProbabilities)
 {
     config_2();
diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc
index 23b5e42f5..76aedce64 100644
--- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc
@@ -32,10 +32,8 @@
 
 
 
-#include <ctime>
-#include <cstdlib>
+#include <chrono>
 #include <iostream>
-#include <boost/chrono.hpp>
 #include <boost/make_shared.hpp>
 #include <gnuradio/top_block.h>
 #include <gnuradio/blocks/file_source.h>
@@ -138,34 +136,33 @@ void GpsL1CaPcpsAcquisitionTest::init()
     std::string signal = "1C";
     signal.copy(gnss_synchro.Signal, 2, 0);
     gnss_synchro.PRN = 1;
-    config->set_property("GNSS-SDR.internal_fs_hz", "4000000");
+    config->set_property("GNSS-SDR.internal_fs_sps", "4000000");
     config->set_property("Acquisition.item_type", "gr_complex");
     config->set_property("Acquisition.if", "0");
     config->set_property("Acquisition.coherent_integration_time_ms", "1");
     config->set_property("Acquisition.dump", "false");
     config->set_property("Acquisition.implementation", "GPS_L1_CA_PCPS_Acquisition");
-    config->set_property("Acquisition.threshold", "0.001");
+    config->set_property("Acquisition.threshold", "0.00001");
     config->set_property("Acquisition.doppler_max", "5000");
     config->set_property("Acquisition.doppler_step", "500");
     config->set_property("Acquisition.repeat_satellite", "false");
-    config->set_property("Acquisition.pfa", "0.0");
+    //config->set_property("Acquisition.pfa", "0.0");
 }
 
 
-
 TEST_F(GpsL1CaPcpsAcquisitionTest, Instantiate)
 {
     init();
     boost::shared_ptr<GpsL1CaPcpsAcquisition> acquisition = boost::make_shared<GpsL1CaPcpsAcquisition>(config.get(), "Acquisition", 1, 1);
 }
 
+
 TEST_F(GpsL1CaPcpsAcquisitionTest, ConnectAndRun)
 {
     int fs_in = 4000000;
     int nsamples = 4000;
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
     gr::msg_queue::sptr queue = gr::msg_queue::make(0);
 
     top_block = gr::make_top_block("Acquisition test");
@@ -184,28 +181,28 @@ TEST_F(GpsL1CaPcpsAcquisitionTest, ConnectAndRun)
     }) << "Failure connecting the blocks of acquisition test." << std::endl;
 
     EXPECT_NO_THROW( {
-        gettimeofday(&tv, NULL);
-        begin = tv.tv_sec * 1000000 + tv.tv_usec;
+        start = std::chrono::system_clock::now();
         top_block->run(); // Start threads and wait
-        gettimeofday(&tv, NULL);
-        end = tv.tv_sec * 1000000 + tv.tv_usec;
+        end = std::chrono::system_clock::now();
+        elapsed_seconds = end - start;
     }) << "Failure running the top_block." << std::endl;
 
-    std::cout <<  "Processed " << nsamples << " samples in " << (end - begin) << " microseconds" << std::endl;
+    std::cout <<  "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
 }
 
+
 TEST_F(GpsL1CaPcpsAcquisitionTest, ValidationOfResults)
 {
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
     top_block = gr::make_top_block("Acquisition test");
 
     double expected_delay_samples = 524;
     double expected_doppler_hz = 1680;
-    init();
-    std::shared_ptr<GpsL1CaPcpsAcquisition> acquisition = std::make_shared<GpsL1CaPcpsAcquisition>(config.get(), "Acquisition", 1, 1);
 
+    init();
+
+    std::shared_ptr<GpsL1CaPcpsAcquisition> acquisition = std::make_shared<GpsL1CaPcpsAcquisition>(config.get(), "Acquisition", 1, 1);
     boost::shared_ptr<GpsL1CaPcpsAcquisitionTest_msg_rx> msg_rx = GpsL1CaPcpsAcquisitionTest_msg_rx_make();
 
     ASSERT_NO_THROW( {
@@ -217,15 +214,15 @@ TEST_F(GpsL1CaPcpsAcquisitionTest, ValidationOfResults)
     }) << "Failure setting gnss_synchro." << std::endl;
 
     ASSERT_NO_THROW( {
-        acquisition->set_threshold(0.1);
+        acquisition->set_threshold(0.001);
     }) << "Failure setting threshold." << std::endl;
 
     ASSERT_NO_THROW( {
-        acquisition->set_doppler_max(10000);
+        acquisition->set_doppler_max(5000);
     }) << "Failure setting doppler_max." << std::endl;
 
     ASSERT_NO_THROW( {
-        acquisition->set_doppler_step(250);
+        acquisition->set_doppler_step(100);
     }) << "Failure setting doppler_step." << std::endl;
 
     ASSERT_NO_THROW( {
@@ -234,7 +231,6 @@ TEST_F(GpsL1CaPcpsAcquisitionTest, ValidationOfResults)
 
     ASSERT_NO_THROW( {
         std::string path = std::string(TEST_PATH);
-        //std::string file = path + "signal_samples/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat";
         std::string file = path + "signal_samples/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat";
         const char * file_name = file.c_str();
         gr::blocks::file_source::sptr file_source = gr::blocks::file_source::make(sizeof(gr_complex), file_name, false);
@@ -242,29 +238,25 @@ TEST_F(GpsL1CaPcpsAcquisitionTest, ValidationOfResults)
         top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events"));
     }) << "Failure connecting the blocks of acquisition test." << std::endl;
 
-
+    acquisition->set_local_code();
     acquisition->set_state(1); // Ensure that acquisition starts at the first sample
     acquisition->init();
 
     EXPECT_NO_THROW( {
-        gettimeofday(&tv, NULL);
-        begin = tv.tv_sec * 1000000 + tv.tv_usec;
+        start = std::chrono::system_clock::now();
         top_block->run(); // Start threads and wait
-        gettimeofday(&tv, NULL);
-        end = tv.tv_sec * 1000000 + tv.tv_usec;
+        end = std::chrono::system_clock::now();
+        elapsed_seconds = end - start;
     }) << "Failure running the top_block." << std::endl;
 
-
     unsigned long int nsamples = gnss_synchro.Acq_samplestamp_samples;
-    std::cout <<  "Acquired " << nsamples << " samples in " << (end - begin) << " microseconds" << std::endl;
-
+    std::cout <<  "Acquired " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
     ASSERT_EQ(1, msg_rx->rx_message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS.";
 
     double delay_error_samples = std::abs(expected_delay_samples - gnss_synchro.Acq_delay_samples);
-    float delay_error_chips = (float)(delay_error_samples * 1023 / 4000);
+    float delay_error_chips = static_cast<float>(delay_error_samples * 1023 / 4000);
     double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
 
     EXPECT_LE(doppler_error_hz, 666) << "Doppler error exceeds the expected value: 666 Hz = 2/(3*integration period)";
     EXPECT_LT(delay_error_chips, 0.5) << "Delay error exceeds the expected value: 0.5 chips";
-
 }
diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test_fpga.cc
index 17d905f98..ecf841a7c 100644
--- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test_fpga.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test_fpga.cc
@@ -29,14 +29,11 @@
  * -------------------------------------------------------------------------
  */
 
-
-
-
+#include <chrono>
 #include <cstdlib>
 #include <iostream>
 #include <boost/make_shared.hpp>
 #include <boost/thread.hpp>
-#include <boost/chrono.hpp>
 #include <gnuradio/top_block.h>
 #include <gnuradio/blocks/file_source.h>
 #include <gnuradio/analog/sig_source_waveform.h>
@@ -54,21 +51,20 @@
 
 #include <unistd.h>
 
-#define DMA_ACQ_TRANSFER_SIZE 4000
-#define RX_SIGNAL_MAX_VALUE 127					// 2^7 - 1 for 8-bit signed values
-#define NTIMES_CYCLE_THROUGH_RX_SAMPLES_FILE 50	// number of times we cycle through the file containing the received samples
-#define ONE_SECOND 1000000						// one second in microseconds
-#define FLOAT_SIZE (sizeof(float))				// size of the float variable in characters
-
+#define DMA_ACQ_TRANSFER_SIZE 2046  // DMA transfer size for the acquisition
+#define RX_SIGNAL_MAX_VALUE 127     // 2^7 - 1 for 8-bit signed values
+#define NTIMES_CYCLE_THROUGH_RX_SAMPLES_FILE 50 // number of times we cycle through the file containing the received samples
+#define ONE_SECOND 1000000          // one second in microseconds
+#define FLOAT_SIZE (sizeof(float))  // size of the float variable in characters
 
 // thread that reads the file containing the received samples, scales the samples to the dynamic range of the fixed point values, sends
 // the samples to the DMA and finally it stops the top block
-void thread_acquisition_send_rx_samples(gr::top_block_sptr top_block, const char * file_name)
+void thread_acquisition_send_rx_samples(gr::top_block_sptr top_block,
+        const char * file_name)
 {
-
-    FILE *ptr_myfile; 	// file descriptor
-    int fileLen;		// length of the file containing the received samples
-    int tx_fd;			// DMA descriptor
+    FILE *rx_signal_file; // file descriptor
+    int file_length; // length of the file containing the received samples
+    int dma_descr; // DMA descriptor
 
     // sleep for 1 second to give some time to GNSS-SDR to activate the acquisition module.
     // the acquisition module does not block the RX buffer before activation.
@@ -77,115 +73,103 @@ void thread_acquisition_send_rx_samples(gr::top_block_sptr top_block, const char
     // we want for the test
     usleep(ONE_SECOND);
 
-    char *buffer_temp;					// temporary buffer to convert from binary char to float and from float to char
-    signed char *buffer_char;			// temporary buffer to store the samples to be sent to the DMA
-	buffer_temp = (char *)malloc(FLOAT_SIZE);	// allocate space for the temporary buffer
-	if (!buffer_temp)
-		{
-			fprintf(stderr, "Memory error!");
-		}
+    char *buffer_float; // temporary buffer to convert from binary char to float and from float to char
+    signed char *buffer_DMA; // temporary buffer to store the samples to be sent to the DMA
+    buffer_float = (char *) malloc(FLOAT_SIZE); // allocate space for the temporary buffer
+    if (!buffer_float)
+        {
+            fprintf(stderr, "Memory error!");
+        }
 
-    ptr_myfile = fopen(file_name,"rb");	// file containing the received signal
-	if (!ptr_myfile)
-		{
-			printf("Unable to open file!");
-		}
+    rx_signal_file = fopen(file_name, "rb"); // file containing the received signal
+    if (!rx_signal_file)
+        {
+            printf("Unable to open file!");
+        }
 
-	// determine the length of the file that contains the received signal
-	fseek(ptr_myfile, 0, SEEK_END);
-	fileLen = ftell(ptr_myfile);
-	fseek(ptr_myfile, 0, SEEK_SET);
+    // determine the length of the file that contains the received signal
+    fseek(rx_signal_file, 0, SEEK_END);
+    file_length = ftell(rx_signal_file);
+    fseek(rx_signal_file, 0, SEEK_SET);
 
     // first step: check for the maximum value of the received signal
 
-	float max = 0;
-	float *pointer_float;
-	pointer_float = (float *) &buffer_temp[0];
-	for (int k=0;k<fileLen;k=k+FLOAT_SIZE)
-	{
-		fread(buffer_temp, FLOAT_SIZE, 1, ptr_myfile);
+    float max = 0;
+    float *pointer_float;
+    pointer_float = (float *) &buffer_float[0];
+    for (int k = 0; k < file_length; k = k + FLOAT_SIZE)
+        {
+            fread(buffer_float, FLOAT_SIZE, 1, rx_signal_file);
 
-		if (fabs(pointer_float[0]) > max)
-		{
-			max = (pointer_float[0]);
-		}
+            if (fabs(pointer_float[0]) > max)
+                {
+                    max = (pointer_float[0]);
+                }
+        }
 
-	}
+    // go back to the beginning of the file containing the received samples
+    fseek(rx_signal_file, 0, SEEK_SET);
 
-	// go back to the beginning of the file containing the received samples
-	fseek(ptr_myfile, 0, SEEK_SET);
+    // allocate memory for the samples to be transferred to the DMA
 
-	// allocate memory for the samples to be transferred to the DMA
+    buffer_DMA = (signed char *) malloc(DMA_ACQ_TRANSFER_SIZE);
+    if (!buffer_DMA)
+        {
+            fprintf(stderr, "Memory error!");
+        }
 
-	buffer_char = (signed char *)malloc(DMA_ACQ_TRANSFER_SIZE);
-	if (!buffer_char)
-		{
-			fprintf(stderr, "Memory error!");
-		}
+    // open the DMA descriptor
+    dma_descr = open("/dev/loop_tx", O_WRONLY);
+    if (dma_descr < 0)
+        {
+            printf("can't open loop device\n");
+            exit(1);
+        }
 
-	// open the DMA descriptor
-	tx_fd = open("/dev/loop_tx", O_WRONLY);
-	if ( tx_fd < 0 )
-		{
-			printf("can't open loop device\n");
-			exit(1);
-		}
+    // cycle through the file containing the received samples
 
+    for (int k = 0; k < NTIMES_CYCLE_THROUGH_RX_SAMPLES_FILE; k++)
+        {
+            fseek(rx_signal_file, 0, SEEK_SET);
 
-	// cycle through the file containing the received samples
+            int transfer_size;
+            int num_transferred_samples = 0;
+            while (num_transferred_samples < static_cast<int>((file_length / FLOAT_SIZE)))
+                {
+                    if (((file_length / FLOAT_SIZE) - num_transferred_samples) > DMA_ACQ_TRANSFER_SIZE)
+                        {
+                            transfer_size = DMA_ACQ_TRANSFER_SIZE;
+                            num_transferred_samples = num_transferred_samples + DMA_ACQ_TRANSFER_SIZE;
+                        }
+                    else
+                        {
+                            transfer_size = file_length / FLOAT_SIZE - num_transferred_samples;
+                            num_transferred_samples = file_length / FLOAT_SIZE;
+                        }
 
-	for (int k=0;k<NTIMES_CYCLE_THROUGH_RX_SAMPLES_FILE;k++)
-	{
+                    for (int t = 0; t < transfer_size; t++)
+                        {
+                            fread(buffer_float, FLOAT_SIZE, 1, rx_signal_file);
 
+                            // specify (float) (int) for a quantization maximizing the dynamic range
+                            buffer_DMA[t] = static_cast<signed char>((pointer_float[0] * (RX_SIGNAL_MAX_VALUE - 1) / max));
+                        }
 
-		fseek(ptr_myfile, 0, SEEK_SET);
+                    //send_acquisition_gps_input_samples(buffer_DMA, transfer_size, dma_descr);
+                    assert(transfer_size == write(dma_descr, &buffer_DMA[0], transfer_size));
+                }
+        }
+    fclose(rx_signal_file);
+    free(buffer_float);
+    free(buffer_DMA);
+    close(dma_descr);
 
-		int transfer_size;
-		int num_transferred_samples = 0;
-		while (num_transferred_samples < (int) (fileLen/FLOAT_SIZE))
-		{
-			if (((fileLen/FLOAT_SIZE) - num_transferred_samples) > DMA_ACQ_TRANSFER_SIZE)
-			{
-
-
-				transfer_size = DMA_ACQ_TRANSFER_SIZE;
-				num_transferred_samples = num_transferred_samples + DMA_ACQ_TRANSFER_SIZE;
-
-			}
-			else
-			{
-				transfer_size = fileLen/FLOAT_SIZE - num_transferred_samples;
-				num_transferred_samples = fileLen/FLOAT_SIZE;
-			}
-
-
-			for (int t=0;t<transfer_size;t++)
-			{
-				fread(buffer_temp, FLOAT_SIZE, 1, ptr_myfile);
-
-				// specify (float) (int) for a quantization maximizing the dynamic range
-				buffer_char[t] = (signed char) ((pointer_float[0]*(RX_SIGNAL_MAX_VALUE - 1))/max);
-
-			}
-
-			//send_acquisition_gps_input_samples(buffer_char, transfer_size, tx_fd);
-			assert( transfer_size == write(tx_fd, &buffer_char[0], transfer_size) );
-		}
-
-	}
-	fclose(ptr_myfile);
-	free(buffer_temp);
-	free(buffer_char);
-	close(tx_fd);
-
-	// when all the samples are sent stop the top block
+    // when all the samples are sent stop the top block
 
     top_block->stop();
-
-
-
 }
 
+
 // ######## GNURADIO BLOCK MESSAGE RECEVER #########
 class GpsL1CaPcpsAcquisitionTestFpga_msg_rx;
 
@@ -207,30 +191,34 @@ public:
 
 GpsL1CaPcpsAcquisitionTest_msg_fpga_rx_sptr GpsL1CaPcpsAcquisitionTestFpga_msg_rx_make()
 {
-    return GpsL1CaPcpsAcquisitionTest_msg_fpga_rx_sptr(new GpsL1CaPcpsAcquisitionTestFpga_msg_rx());
+    return GpsL1CaPcpsAcquisitionTest_msg_fpga_rx_sptr(
+            new GpsL1CaPcpsAcquisitionTestFpga_msg_rx());
 }
 
 
 void GpsL1CaPcpsAcquisitionTestFpga_msg_rx::msg_handler_events(pmt::pmt_t msg)
 {
     try
-    {
+        {
             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;
-    }
+        }
 }
 
 
 GpsL1CaPcpsAcquisitionTestFpga_msg_rx::GpsL1CaPcpsAcquisitionTestFpga_msg_rx() :
-    gr::block("GpsL1CaPcpsAcquisitionTestFpga_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0))
+        gr::block("GpsL1CaPcpsAcquisitionTestFpga_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(&GpsL1CaPcpsAcquisitionTestFpga_msg_rx::msg_handler_events, this, _1));
+    this->set_msg_handler(pmt::mp("events"),
+            boost::bind( &GpsL1CaPcpsAcquisitionTestFpga_msg_rx::msg_handler_events, this, _1));
     rx_message = 0;
 }
 
@@ -239,9 +227,7 @@ GpsL1CaPcpsAcquisitionTestFpga_msg_rx::~GpsL1CaPcpsAcquisitionTestFpga_msg_rx()
 {}
 
 
-// ###########################################################
-
-class GpsL1CaPcpsAcquisitionTestFpga: public ::testing::Test
+class GpsL1CaPcpsAcquisitionTestFpga : public ::testing::Test
 {
 protected:
     GpsL1CaPcpsAcquisitionTestFpga()
@@ -272,117 +258,128 @@ void GpsL1CaPcpsAcquisitionTestFpga::init()
     std::string signal = "1C";
     signal.copy(gnss_synchro.Signal, 2, 0);
     gnss_synchro.PRN = 1;
-    config->set_property("GNSS-SDR.internal_fs_hz", "4000000");
+    config->set_property("GNSS-SDR.internal_fs_sps", "4000000");
     config->set_property("Acquisition.item_type", "cshort");
     config->set_property("Acquisition.if", "0");
     config->set_property("Acquisition.coherent_integration_time_ms", "1");
     config->set_property("Acquisition.dump", "false");
-    config->set_property("Acquisition.implementation", "GPS_L1_CA_PCPS_Acquisition");
+    config->set_property("Acquisition.implementation",
+            "GPS_L1_CA_PCPS_Acquisition");
     config->set_property("Acquisition.threshold", "0.001");
     config->set_property("Acquisition.doppler_max", "5000");
     config->set_property("Acquisition.doppler_step", "500");
     config->set_property("Acquisition.repeat_satellite", "false");
     config->set_property("Acquisition.pfa", "0.0");
     config->set_property("Acquisition.select_queue_Fpga", "0");
+    config->set_property("Acquisition.devicename", "/dev/uio0");
 }
 
 
-
 TEST_F(GpsL1CaPcpsAcquisitionTestFpga, Instantiate)
 {
     init();
-    boost::shared_ptr<GpsL1CaPcpsAcquisitionFpga> acquisition = boost::make_shared<GpsL1CaPcpsAcquisitionFpga>(config.get(), "Acquisition", 0, 1);
+    boost::shared_ptr<GpsL1CaPcpsAcquisitionFpga> acquisition =
+            boost::make_shared<GpsL1CaPcpsAcquisitionFpga>(config.get(), "Acquisition", 0, 1);
 }
 
+
 TEST_F(GpsL1CaPcpsAcquisitionTestFpga, ValidationOfResults)
 {
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
     top_block = gr::make_top_block("Acquisition test");
 
     double expected_delay_samples = 524;
     double expected_doppler_hz = 1680;
     init();
 
-    std::shared_ptr<GpsL1CaPcpsAcquisitionFpga> acquisition = std::make_shared<GpsL1CaPcpsAcquisitionFpga>(config.get(), "Acquisition", 0, 1);
+    std::shared_ptr < GpsL1CaPcpsAcquisitionFpga > acquisition =
+            std::make_shared < GpsL1CaPcpsAcquisitionFpga > (config.get(), "Acquisition", 0, 1);
 
     boost::shared_ptr<GpsL1CaPcpsAcquisitionTestFpga_msg_rx> msg_rx = GpsL1CaPcpsAcquisitionTestFpga_msg_rx_make();
 
-    ASSERT_NO_THROW( {
-        acquisition->set_channel(1);
-    }) << "Failure setting channel." << std::endl;
+    ASSERT_NO_THROW(
+                {
+                    acquisition->set_channel(1);
+                })<< "Failure setting channel." << std::endl;
 
-    ASSERT_NO_THROW( {
-        acquisition->set_gnss_synchro(&gnss_synchro);
-    }) << "Failure setting gnss_synchro." << std::endl;
+    ASSERT_NO_THROW(
+                {
+                    acquisition->set_gnss_synchro(&gnss_synchro);
+                })<< "Failure setting gnss_synchro." << std::endl;
 
-    ASSERT_NO_THROW( {
-        acquisition->set_threshold(0.1);
-    }) << "Failure setting threshold." << std::endl;
+    ASSERT_NO_THROW(
+                {
+                    acquisition->set_threshold(0.1);
+                })<< "Failure setting threshold." << std::endl;
 
-    ASSERT_NO_THROW( {
-        acquisition->set_doppler_max(10000);
-    }) << "Failure setting doppler_max." << std::endl;
+    ASSERT_NO_THROW(
+                {
+                    acquisition->set_doppler_max(10000);
+                })<< "Failure setting doppler_max." << std::endl;
 
-    ASSERT_NO_THROW( {
-        acquisition->set_doppler_step(250);
-    }) << "Failure setting doppler_step." << std::endl;
+    ASSERT_NO_THROW(
+                {
+                    acquisition->set_doppler_step(250);
+                })<< "Failure setting doppler_step." << std::endl;
 
-    ASSERT_NO_THROW( {
-        acquisition->connect(top_block);
-    }) << "Failure connecting acquisition to the top_block." << std::endl;
+    ASSERT_NO_THROW(
+                {
+                    acquisition->connect(top_block);
+                })<< "Failure connecting acquisition to the top_block." << std::endl;
 
     // uncomment the next line to load the file from the current directory
     std::string file = "./GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat";
 
-	// uncomment the next two lines to load the file from the signal samples subdirectory
+    // uncomment the next two lines to load the file from the signal samples subdirectory
     //std::string path = std::string(TEST_PATH);
     //std::string file = path + "signal_samples/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat";
 
     const char * file_name = file.c_str();
 
-    ASSERT_NO_THROW( {
-       // for the unit test use dummy blocks to make the flowgraph work and allow the acquisition message to be sent.
-        // in the actual system there is a flowchart running in parallel so this is not needed
+    ASSERT_NO_THROW(
+                {
+                    // for the unit test use dummy blocks to make the flowgraph work and allow the acquisition message to be sent.
+                    // in the actual system there is a flowchart running in parallel so this is not needed
 
-        gr::blocks::file_source::sptr file_source = gr::blocks::file_source::make(sizeof(gr_complex), file_name, false);
-        gr::blocks::null_sink::sptr null_sink = gr::blocks::null_sink::make(sizeof(gr_complex));
-        gr::blocks::throttle::sptr throttle_block = gr::blocks::throttle::make(sizeof(gr_complex),1000);
+                    gr::blocks::file_source::sptr file_source = gr::blocks::file_source::make(sizeof(gr_complex), file_name, false);
+                    gr::blocks::null_sink::sptr null_sink = gr::blocks::null_sink::make(sizeof(gr_complex));
+                    gr::blocks::throttle::sptr throttle_block = gr::blocks::throttle::make(sizeof(gr_complex),1000);
 
-        top_block->connect(file_source, 0, throttle_block, 0);
-        top_block->connect(throttle_block, 0, null_sink, 0);
-        top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events"));
-    }) << "Failure connecting the blocks of acquisition test." << std::endl;
+                    top_block->connect(file_source, 0, throttle_block, 0);
+                    top_block->connect(throttle_block, 0, null_sink, 0);
+                    top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events"));
+                })<< "Failure connecting the blocks of acquisition test." << std::endl;
 
-    acquisition->set_state(1); 	// Ensure that acquisition starts at the first state
+    acquisition->set_state(1); // Ensure that acquisition starts at the first state
     acquisition->init();
-    top_block->start(); 		// Start the top block
+    top_block->start(); // Start the top block
 
     // start thread that sends the DMA samples to the FPGA
-    boost::thread t3{thread_acquisition_send_rx_samples, top_block, file_name};
+    boost::thread t3
+        { thread_acquisition_send_rx_samples, top_block, file_name };
 
-    EXPECT_NO_THROW( {
-        gettimeofday(&tv, NULL);
-        begin = tv.tv_sec * 1000000 + tv.tv_usec;
-        acquisition->reset();	// launch the tracking process
-        top_block->wait();
-        gettimeofday(&tv, NULL);
-        end = tv.tv_sec * 1000000 + tv.tv_usec;
-    }) << "Failure running the top_block." << std::endl;
+    EXPECT_NO_THROW(
+                {
+                    start = std::chrono::system_clock::now();
+                    acquisition->reset(); // launch the tracking process
+                    top_block->wait();
+                    end = std::chrono::system_clock::now();
+                    elapsed_seconds = end - start;
+                })<< "Failure running the top_block." << std::endl;
 
     t3.join();
 
-    std::cout <<  "Ran GpsL1CaPcpsAcquisitionTestFpga in " << (end - begin) << " microseconds" << std::endl;
+    std::cout << "Ran GpsL1CaPcpsAcquisitionTestFpga in " << elapsed_seconds.count() * 1e6
+              << " microseconds" << std::endl;
 
     ASSERT_EQ(1, msg_rx->rx_message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS.";
 
     double delay_error_samples = std::abs(expected_delay_samples - gnss_synchro.Acq_delay_samples);
-    float delay_error_chips = (float)(delay_error_samples * 1023 / 4000);
+    float delay_error_chips = static_cast<float>(delay_error_samples * 1023 / 4000);
     double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
 
     EXPECT_LE(doppler_error_hz, 666) << "Doppler error exceeds the expected value: 666 Hz = 2/(3*integration period)";
     EXPECT_LT(delay_error_chips, 0.5) << "Delay error exceeds the expected value: 0.5 chips";
-
 }
 
diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_multithread_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_multithread_acquisition_gsoc2013_test.cc
deleted file mode 100644
index 229df9567..000000000
--- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_multithread_acquisition_gsoc2013_test.cc
+++ /dev/null
@@ -1,563 +0,0 @@
-/*!
- * \file gps_l1_ca_pcps_multithread_acquisition_gsoc2013_test.cc
- * \brief  This class implements an acquisition test for
- * GpsL1CaPcpsMultithreadAcquisition class.
- * \author Marc Molina, 2013. marc.molina.pena(at)gmail.com
- *
- *
- * -------------------------------------------------------------------------
- *
- * 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 <http://www.gnu.org/licenses/>.
- *
- * -------------------------------------------------------------------------
- */
-
-
-
-#include <ctime>
-#include <iostream>
-#include <boost/shared_ptr.hpp>
-#include <gnuradio/top_block.h>
-#include <gnuradio/blocks/file_source.h>
-#include <gnuradio/analog/sig_source_waveform.h>
-#include <gnuradio/analog/sig_source_c.h>
-#include <gnuradio/blocks/null_sink.h>
-#include <gtest/gtest.h>
-#include "gnss_block_interface.h"
-#include "in_memory_configuration.h"
-#include "configuration_interface.h"
-#include "gnss_synchro.h"
-#include "gps_l1_ca_pcps_multithread_acquisition.h"
-#include "signal_generator.h"
-#include "signal_generator_c.h"
-#include "fir_filter.h"
-#include "gen_signal_source.h"
-#include "gnss_sdr_valve.h"
-#include "signal_generator.h"
-#include "signal_generator.cc"
-#include "signal_generator_c.h"
-#include "signal_generator_c.cc"
-
-
-class GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test: public ::testing::Test
-{
-protected:
-    GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test()
-    {
-        item_size = sizeof(gr_complex);
-        stop = false;
-        message = 0;
-        gnss_synchro = Gnss_Synchro();
-    }
-
-    ~GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test()
-    {
-    }
-
-    void init();
-    void config_1();
-    void config_2();
-    void start_queue();
-    void wait_message();
-    void process_message();
-    void stop_queue();
-
-    gr::msg_queue::sptr queue;
-    gr::top_block_sptr top_block;
-    std::shared_ptr<GpsL1CaPcpsMultithreadAcquisition> acquisition;
-    std::shared_ptr<InMemoryConfiguration> config;
-    Gnss_Synchro gnss_synchro;
-    size_t item_size;
-    bool stop;
-    int message;
-    boost::thread ch_thread;
-
-    unsigned int integration_time_ms = 0;
-    unsigned int fs_in = 0;
-
-    double expected_delay_chips = 0.0;
-    double expected_doppler_hz = 0.0;
-    float max_doppler_error_hz = 0.0;
-    float max_delay_error_chips = 0.0;
-
-    unsigned int num_of_realizations = 0;
-    unsigned int realization_counter = 0;
-    unsigned int detection_counter = 0;
-    unsigned int correct_estimation_counter = 0;
-    unsigned int acquired_samples = 0;
-    unsigned int mean_acq_time_us = 0;
-
-    double mse_doppler = 0.0;
-    double mse_delay = 0.0;
-
-    double Pd = 0.0;
-    double Pfa_p = 0.0;
-    double Pfa_a = 0.0;
-};
-
-void GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test::init()
-{
-    message = 0;
-    realization_counter = 0;
-    detection_counter = 0;
-    correct_estimation_counter = 0;
-    acquired_samples = 0;
-    mse_doppler = 0;
-    mse_delay = 0;
-    mean_acq_time_us = 0;
-    Pd = 0;
-    Pfa_p = 0;
-    Pfa_a = 0;
-}
-
-void GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test::config_1()
-{
-    gnss_synchro.Channel_ID = 0;
-    gnss_synchro.System = 'G';
-    std::string signal = "1C";
-    signal.copy(gnss_synchro.Signal,2,0);
-
-    integration_time_ms = 1;
-    fs_in = 4e6;
-
-    expected_delay_chips = 600;
-    expected_doppler_hz = 750;
-    max_doppler_error_hz = 2/(3*integration_time_ms*1e-3);
-    max_delay_error_chips = 0.50;
-
-    num_of_realizations = 1;
-
-    config = std::make_shared<InMemoryConfiguration>();
-
-    config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
-
-    config->set_property("SignalSource.fs_hz", std::to_string(fs_in));
-
-    config->set_property("SignalSource.item_type", "gr_complex");
-
-    config->set_property("SignalSource.num_satellites", "1");
-
-    config->set_property("SignalSource.system_0", "G");
-    config->set_property("SignalSource.PRN_0", "10");
-    config->set_property("SignalSource.CN0_dB_0", "44");
-    config->set_property("SignalSource.doppler_Hz_0", std::to_string(expected_doppler_hz));
-    config->set_property("SignalSource.delay_chips_0", std::to_string(expected_delay_chips));
-
-    config->set_property("SignalSource.noise_flag", "false");
-    config->set_property("SignalSource.data_flag", "false");
-    config->set_property("SignalSource.BW_BB", "0.97");
-
-    config->set_property("InputFilter.implementation", "Fir_Filter");
-    config->set_property("InputFilter.input_item_type", "gr_complex");
-    config->set_property("InputFilter.output_item_type", "gr_complex");
-    config->set_property("InputFilter.taps_item_type", "float");
-    config->set_property("InputFilter.number_of_taps", "11");
-    config->set_property("InputFilter.number_of_bands", "2");
-    config->set_property("InputFilter.band1_begin", "0.0");
-    config->set_property("InputFilter.band1_end", "0.97");
-    config->set_property("InputFilter.band2_begin", "0.98");
-    config->set_property("InputFilter.band2_end", "1.0");
-    config->set_property("InputFilter.ampl1_begin", "1.0");
-    config->set_property("InputFilter.ampl1_end", "1.0");
-    config->set_property("InputFilter.ampl2_begin", "0.0");
-    config->set_property("InputFilter.ampl2_end", "0.0");
-    config->set_property("InputFilter.band1_error", "1.0");
-    config->set_property("InputFilter.band2_error", "1.0");
-    config->set_property("InputFilter.filter_type", "bandpass");
-    config->set_property("InputFilter.grid_density", "16");
-
-    config->set_property("Acquisition.item_type", "gr_complex");
-    config->set_property("Acquisition.if", "0");
-    config->set_property("Acquisition.coherent_integration_time_ms",
-                         std::to_string(integration_time_ms));
-    config->set_property("Acquisition.max_dwells", "1");
-    config->set_property("Acquisition.implementation", "GPS_L1_CA_PCPS_Multithread_Acquisition");
-    config->set_property("Acquisition.threshold", "0.8");
-    config->set_property("Acquisition.doppler_max", "10000");
-    config->set_property("Acquisition.doppler_step", "250");
-    config->set_property("Acquisition.bit_transition_flag", "false");
-    config->set_property("Acquisition.dump", "false");
-}
-
-void GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test::config_2()
-{
-    gnss_synchro.Channel_ID = 0;
-    gnss_synchro.System = 'G';
-    std::string signal = "1C";
-    signal.copy(gnss_synchro.Signal,2,0);
-
-    integration_time_ms = 1;
-    fs_in = 4e6;
-
-    expected_delay_chips = 600;
-    expected_doppler_hz = 750;
-    max_doppler_error_hz = 2/(3*integration_time_ms*1e-3);
-    max_delay_error_chips = 0.50;
-
-    num_of_realizations = 100;
-
-    config = std::make_shared<InMemoryConfiguration>();
-
-    config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
-
-    config->set_property("SignalSource.fs_hz", std::to_string(fs_in));
-
-    config->set_property("SignalSource.item_type", "gr_complex");
-
-    config->set_property("SignalSource.num_satellites", "4");
-
-    config->set_property("SignalSource.system_0", "G");
-    config->set_property("SignalSource.PRN_0", "10");
-    config->set_property("SignalSource.CN0_dB_0", "44");
-    config->set_property("SignalSource.doppler_Hz_0", std::to_string(expected_doppler_hz));
-    config->set_property("SignalSource.delay_chips_0", std::to_string(expected_delay_chips));
-
-    config->set_property("SignalSource.system_1", "G");
-    config->set_property("SignalSource.PRN_1", "15");
-    config->set_property("SignalSource.CN0_dB_1", "44");
-    config->set_property("SignalSource.doppler_Hz_1", "1000");
-    config->set_property("SignalSource.delay_chips_1", "100");
-
-    config->set_property("SignalSource.system_2", "G");
-    config->set_property("SignalSource.PRN_2", "21");
-    config->set_property("SignalSource.CN0_dB_2", "44");
-    config->set_property("SignalSource.doppler_Hz_2", "2000");
-    config->set_property("SignalSource.delay_chips_2", "200");
-
-    config->set_property("SignalSource.system_3", "G");
-    config->set_property("SignalSource.PRN_3", "22");
-    config->set_property("SignalSource.CN0_dB_3", "44");
-    config->set_property("SignalSource.doppler_Hz_3", "3000");
-    config->set_property("SignalSource.delay_chips_3", "300");
-
-    config->set_property("SignalSource.noise_flag", "true");
-    config->set_property("SignalSource.data_flag", "true");
-    config->set_property("SignalSource.BW_BB", "0.97");
-
-    config->set_property("InputFilter.implementation", "Fir_Filter");
-    config->set_property("InputFilter.input_item_type", "gr_complex");
-    config->set_property("InputFilter.output_item_type", "gr_complex");
-    config->set_property("InputFilter.taps_item_type", "float");
-    config->set_property("InputFilter.number_of_taps", "11");
-    config->set_property("InputFilter.number_of_bands", "2");
-    config->set_property("InputFilter.band1_begin", "0.0");
-    config->set_property("InputFilter.band1_end", "0.97");
-    config->set_property("InputFilter.band2_begin", "0.98");
-    config->set_property("InputFilter.band2_end", "1.0");
-    config->set_property("InputFilter.ampl1_begin", "1.0");
-    config->set_property("InputFilter.ampl1_end", "1.0");
-    config->set_property("InputFilter.ampl2_begin", "0.0");
-    config->set_property("InputFilter.ampl2_end", "0.0");
-    config->set_property("InputFilter.band1_error", "1.0");
-    config->set_property("InputFilter.band2_error", "1.0");
-    config->set_property("InputFilter.filter_type", "bandpass");
-    config->set_property("InputFilter.grid_density", "16");
-
-    config->set_property("Acquisition.item_type", "gr_complex");
-    config->set_property("Acquisition.if", "0");
-    config->set_property("Acquisition.coherent_integration_time_ms",
-                         std::to_string(integration_time_ms));
-    config->set_property("Acquisition.max_dwells", "1");
-    config->set_property("Acquisition.implementation", "GPS_L1_CA_PCPS_Multithread_Acquisition");
-    config->set_property("Acquisition.pfa", "0.1");
-    config->set_property("Acquisition.doppler_max", "10000");
-    config->set_property("Acquisition.doppler_step", "250");
-    config->set_property("Acquisition.bit_transition_flag", "false");
-    config->set_property("Acquisition.dump", "false");
-}
-
-void GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test::start_queue()
-{
-    stop = false;
-    ch_thread = boost::thread(&GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test::wait_message, this);
-}
-
-void GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test::wait_message()
-{
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
-
-    while (!stop)
-        {
-            acquisition->reset();
-
-            gettimeofday(&tv, NULL);
-            begin = tv.tv_sec *1e6 + tv.tv_usec;
-
-            channel_internal_queue.wait_and_pop(message);
-
-            gettimeofday(&tv, NULL);
-            end = tv.tv_sec *1e6 + tv.tv_usec;
-
-            mean_acq_time_us += (end-begin);
-
-            process_message();
-        }
-}
-
-void GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test::process_message()
-{
-    if (message == 1)
-        {
-            detection_counter++;
-
-            // The term -5 is here to correct the additional delay introduced by the FIR filter
-            double delay_error_chips = std::abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*1023.0/((double)fs_in*1e-3));
-            double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
-
-            mse_delay += std::pow(delay_error_chips, 2);
-            mse_doppler += std::pow(doppler_error_hz, 2);
-
-            if ((delay_error_chips < max_delay_error_chips) && (doppler_error_hz < max_doppler_error_hz))
-                {
-                    correct_estimation_counter++;
-                }
-        }
-
-    realization_counter++;
-
-    std::cout << "Progress: " << round((float)realization_counter/num_of_realizations*100) << "% \r" << std::flush;
-
-    if (realization_counter == num_of_realizations)
-        {
-            mse_delay /= num_of_realizations;
-            mse_doppler /= num_of_realizations;
-
-            Pd = (double)correct_estimation_counter / (double)num_of_realizations;
-            Pfa_a = (double)detection_counter / (double)num_of_realizations;
-            Pfa_p = (double)(detection_counter-correct_estimation_counter) / (double)num_of_realizations;
-
-            mean_acq_time_us /= num_of_realizations;
-
-            stop_queue();
-            top_block->stop();
-
-            std::cout << std::endl;
-        }
-}
-
-void GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test::stop_queue()
-{
-    stop = true;
-}
-
-TEST_F(GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test, Instantiate)
-{
-    config_1();
-    acquisition = std::make_shared<GpsL1CaPcpsMultithreadAcquisition>(config.get(), "Acquisition", 1, 1);
-}
-
-TEST_F(GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test, ConnectAndRun)
-{
-    int nsamples = floor(fs_in*integration_time_ms*1e-3);
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
-    queue = gr::msg_queue::make(0);
-    top_block = gr::make_top_block("Acquisition test");
-
-    config_1();
-    acquisition = std::make_shared<GpsL1CaPcpsMultithreadAcquisition>(config.get(), "Acquisition", 1, 1);
-
-    ASSERT_NO_THROW( {
-        acquisition->connect(top_block);
-        boost::shared_ptr<gr::analog::sig_source_c> source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0));
-        boost::shared_ptr<gr::block> valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue);
-        top_block->connect(source, 0, valve, 0);
-        top_block->connect(valve, 0, acquisition->get_left_block(), 0);
-    }) << "Failure connecting the blocks of acquisition test." << std::endl;
-
-    EXPECT_NO_THROW( {
-        gettimeofday(&tv, NULL);
-        begin = tv.tv_sec *1e6 + tv.tv_usec;
-        top_block->run(); // Start threads and wait
-        gettimeofday(&tv, NULL);
-        end = tv.tv_sec *1e6 + tv.tv_usec;
-    }) << "Failure running the top_block." << std::endl;
-
-    std::cout <<  "Processed " << nsamples << " samples in " << (end - begin) << " microseconds" << std::endl;
-}
-
-TEST_F(GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test, ValidationOfResults)
-{
-    config_1();
-    queue = gr::msg_queue::make(0);
-    top_block = gr::make_top_block("Acquisition test");
-
-    acquisition = std::make_shared<GpsL1CaPcpsMultithreadAcquisition>(config.get(), "Acquisition", 1, 1);
-
-    ASSERT_NO_THROW( {
-        acquisition->set_channel(1);
-    }) << "Failure setting channel." << std::endl;
-
-    ASSERT_NO_THROW( {
-        acquisition->set_gnss_synchro(&gnss_synchro);
-    }) << "Failure setting gnss_synchro." << std::endl;
-
-    ASSERT_NO_THROW( {
-        acquisition->set_doppler_max(config->property("Acquisition.doppler_max", 10000));
-    }) << "Failure setting doppler_max." << std::endl;
-
-    ASSERT_NO_THROW( {
-        acquisition->set_doppler_step(config->property("Acquisition.doppler_step", 500));
-    }) << "Failure setting doppler_step." << std::endl;
-
-    ASSERT_NO_THROW( {
-        acquisition->set_threshold(config->property("Acquisition.threshold", 0.0));
-    }) << "Failure setting threshold." << std::endl;
-
-    ASSERT_NO_THROW( {
-        acquisition->connect(top_block);
-    }) << "Failure connecting acquisition to the top_block." << std::endl;
-
-    acquisition->init();
-
-    ASSERT_NO_THROW( {
-        boost::shared_ptr<GenSignalSource> signal_source;
-        SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue);
-        FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1);
-        signal_source.reset(new GenSignalSource(signal_generator, filter, "SignalSource", queue));
-        signal_source->connect(top_block);
-        top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0);
-    }) << "Failure connecting the blocks of acquisition test." << std::endl;
-
-    // i = 0 --> satellite in acquisition is visible
-    // i = 1 --> satellite in acquisition is not visible
-    for (unsigned int i = 0; i < 2; i++)
-        {
-            init();
-
-            if (i == 0)
-                {
-                    gnss_synchro.PRN = 10; // This satellite is visible
-                }
-            else if (i == 1)
-                {
-                    gnss_synchro.PRN = 20; // This satellite is not visible
-                }
-
-            acquisition->set_local_code();
-
-            start_queue();
-
-            EXPECT_NO_THROW( {
-                top_block->run(); // Start threads and wait
-            }) << "Failure running the top_block." << std::endl;
-
-            if (i == 0)
-            {
-                EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS.";
-                if (message == 1)
-                    {
-                        EXPECT_EQ((unsigned int)1, correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation.";
-                    }
-
-            }
-            else if (i == 1)
-            {
-                EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL.";
-            }
-        }
-}
-
-TEST_F(GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test, ValidationOfResultsProbabilities)
-{
-    config_2();
-    queue = gr::msg_queue::make(0);
-    top_block = gr::make_top_block("Acquisition test");
-
-    acquisition = std::make_shared<GpsL1CaPcpsMultithreadAcquisition>(config.get(), "Acquisition", 1, 1);
-
-    ASSERT_NO_THROW( {
-        acquisition->set_channel(1);
-    }) << "Failure setting channel." << std::endl;
-
-    ASSERT_NO_THROW( {
-        acquisition->set_gnss_synchro(&gnss_synchro);
-    }) << "Failure setting gnss_synchro." << std::endl;
-
-    ASSERT_NO_THROW( {
-        acquisition->set_doppler_max(config->property("Acquisition.doppler_max", 10000));
-    }) << "Failure setting doppler_max." << std::endl;
-
-    ASSERT_NO_THROW( {
-        acquisition->set_doppler_step(config->property("Acquisition.doppler_step", 500));
-    }) << "Failure setting doppler_step." << std::endl;
-
-    ASSERT_NO_THROW( {
-        acquisition->set_threshold(config->property("Acquisition.threshold", 0.0));
-    }) << "Failure setting threshold." << std::endl;
-
-    ASSERT_NO_THROW( {
-        acquisition->connect(top_block);
-    }) << "Failure connecting acquisition to the top_block." << std::endl;
-
-    acquisition->init();
-
-    ASSERT_NO_THROW( {
-        boost::shared_ptr<GenSignalSource> signal_source;
-        SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue);
-        FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1);
-        signal_source.reset(new GenSignalSource(signal_generator, filter, "SignalSource", queue));
-        signal_source->connect(top_block);
-        top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0);
-    }) << "Failure connecting the blocks of acquisition test." << std::endl;
-
-    std::cout << "Probability of false alarm (target) = " << 0.1 << std::endl;
-
-    // i = 0 --> satellite in acquisition is visible (prob of detection and prob of detection with wrong estimation)
-    // i = 1 --> satellite in acquisition is not visible (prob of false detection)
-    for (unsigned int i = 0; i < 2; i++)
-        {
-            init();
-
-            if (i == 0)
-                {
-                    gnss_synchro.PRN = 10; // This satellite is visible
-                }
-            else if (i == 1)
-                {
-                    gnss_synchro.PRN = 20; // This satellite is not visible
-                }
-
-            acquisition->set_local_code();
-
-            start_queue();
-
-            EXPECT_NO_THROW( {
-                top_block->run(); // Start threads and wait
-            }) << "Failure running the top_block." << std::endl;
-
-            if (i == 0)
-            {
-                std::cout << "Probability of detection = " << Pd << std::endl;
-                std::cout << "Probability of false alarm (satellite present) = " << Pfa_p << std::endl;
-//                std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl;
-            }
-            else if (i == 1)
-            {
-                std::cout << "Probability of false alarm (satellite absent) = " << Pfa_a << std::endl;
-//                std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl;
-            }
-        }
-
-}
diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc
index b66e54e5d..adb069ca7 100644
--- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc
@@ -31,7 +31,7 @@
  */
 
 
-#include <ctime>
+#include <chrono>
 #include <iostream>
 #include <boost/shared_ptr.hpp>
 #include <gnuradio/top_block.h>
@@ -167,6 +167,7 @@ protected:
     double Pfa_a;
 };
 
+
 void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::init()
 {
     message = 0;
@@ -182,6 +183,7 @@ void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::init()
     Pfa_a = 0;
 }
 
+
 void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::config_1()
 {
     gnss_synchro.Channel_ID = 0;
@@ -201,7 +203,7 @@ void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::config_1()
 
     config = std::make_shared<InMemoryConfiguration>();
 
-    config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
+    config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(fs_in));
 
     config->set_property("SignalSource.fs_hz", std::to_string(fs_in));
 
@@ -251,6 +253,7 @@ void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::config_1()
     config->set_property("Acquisition.dump", "false");
 }
 
+
 void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::config_2()
 {
     gnss_synchro.Channel_ID = 0;
@@ -270,7 +273,7 @@ void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::config_2()
 
     config = std::make_shared<InMemoryConfiguration>();
 
-    config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
+    config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(fs_in));
 
     config->set_property("SignalSource.fs_hz", std::to_string(fs_in));
 
@@ -338,36 +341,37 @@ void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::config_2()
     config->set_property("Acquisition.dump", "false");
 }
 
+
 void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::start_queue()
 {
     stop = false;
     ch_thread = boost::thread(&GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::wait_message, this);
 }
 
+
 void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::wait_message()
 {
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
 
     while (!stop)
         {
             acquisition->reset();
 
-            gettimeofday(&tv, NULL);
-            begin = tv.tv_sec *1e6 + tv.tv_usec;
+            start = std::chrono::system_clock::now();
 
             channel_internal_queue.wait_and_pop(message);
 
-            gettimeofday(&tv, NULL);
-            end = tv.tv_sec *1e6 + tv.tv_usec;
+            end = std::chrono::system_clock::now();
+            elapsed_seconds = end - start;
 
-            mean_acq_time_us += (end-begin);
+            mean_acq_time_us += elapsed_seconds.count() * 1e6;
 
             process_message();
         }
 }
 
+
 void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::process_message()
 {
     if (message == 1)
@@ -375,7 +379,7 @@ void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::process_message()
             detection_counter++;
 
             // The term -5 is here to correct the additional delay introduced by the FIR filter
-            double delay_error_chips = std::abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples- 5 )*1023.0/((double)fs_in*1e-3));
+            double delay_error_chips = std::abs(static_cast<double>(expected_delay_chips) - static_cast<double>(gnss_synchro.Acq_delay_samples - 5) * 1023.0 / (static_cast<double>(fs_in) * 1e-3));
             double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
 
             mse_delay += std::pow(delay_error_chips, 2);
@@ -389,16 +393,16 @@ void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::process_message()
 
     realization_counter++;
 
-    std::cout << "Progress: " << round((float)realization_counter/num_of_realizations*100) << "% \r" << std::flush;
+    std::cout << "Progress: " << round(static_cast<float>(realization_counter) / static_cast<float>(num_of_realizations) * 100) << "% \r" << std::flush;
 
     if (realization_counter == num_of_realizations)
         {
             mse_delay /= num_of_realizations;
             mse_doppler /= num_of_realizations;
 
-            Pd = (double)correct_estimation_counter / (double)num_of_realizations;
-            Pfa_a = (double)detection_counter / (double)num_of_realizations;
-            Pfa_p = (double)(detection_counter-correct_estimation_counter) / (double)num_of_realizations;
+            Pd = static_cast<double>(correct_estimation_counter) / static_cast<double>(num_of_realizations);
+            Pfa_a = static_cast<double>(detection_counter) / static_cast<double>(num_of_realizations);
+            Pfa_p = static_cast<double>(detection_counter - correct_estimation_counter) / static_cast<double>(num_of_realizations);
 
             mean_acq_time_us /= num_of_realizations;
 
@@ -409,23 +413,25 @@ void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::process_message()
         }
 }
 
+
 void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::stop_queue()
 {
     stop = true;
 }
 
+
 TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, Instantiate)
 {
     config_1();
     acquisition = std::make_shared<GpsL1CaPcpsOpenClAcquisition>(config.get(), "Acquisition", 1, 1);
 }
 
+
 TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, ConnectAndRun)
 {
     int nsamples = floor(fs_in*integration_time_ms*1e-3);
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
 
     config_1();
     acquisition = std::make_shared<GpsL1CaPcpsOpenClAcquisition>(config.get(), "Acquisition", 1, 1);
@@ -441,16 +447,16 @@ TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, ConnectAndRun)
     }) << "Failure connecting the blocks of acquisition test." << std::endl;
 
     EXPECT_NO_THROW( {
-        gettimeofday(&tv, NULL);
-        begin = tv.tv_sec * 1e6 + tv.tv_usec;
+        start = std::chrono::system_clock::now();
         top_block->run(); // Start threads and wait
-        gettimeofday(&tv, NULL);
-        end = tv.tv_sec * 1e6 + tv.tv_usec;
+        end = std::chrono::system_clock::now();
+        elapsed_seconds = end - start;
     }) << "Failure running the top_block." << std::endl;
 
-    std::cout <<  "Processed " << nsamples << " samples in " << (end - begin) << " microseconds" << std::endl;
+    std::cout <<  "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
 }
 
+
 TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, ValidationOfResults)
 {
     config_1();
@@ -522,7 +528,7 @@ TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, ValidationOfResults)
                 EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS.";
                 if (message == 1)
                     {
-                        EXPECT_EQ((unsigned int)1, correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation.";
+                        EXPECT_EQ((static_cast<unsigned int>(1), correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation.";
                     }
 
             }
@@ -533,6 +539,7 @@ TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, ValidationOfResults)
         }
 }
 
+
 TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, ValidationOfResultsProbabilities)
 {
     config_2();
diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc
index e67d4068c..bdbeffa10 100644
--- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc
@@ -32,7 +32,7 @@
 
 
 
-#include <ctime>
+#include <chrono>
 #include <iostream>
 #include <stdexcept>
 #include <glog/logging.h>
@@ -108,14 +108,13 @@ GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx::GpsL1CaPcpsQuickSyncAcquisit
     rx_message = 0;
 }
 
+
 GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx::~GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx()
 {}
 
 
 // ###########################################################
 
-
-
 class GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test: public ::testing::Test
 {
 protected:
@@ -198,9 +197,9 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::init()
 
     miss_detection_counter = 0;
     Pmd = 0;
-
 }
 
+
 void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::config_1()
 {
     gnss_synchro.Channel_ID = 0;
@@ -220,7 +219,7 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::config_1()
 
     config = std::make_shared<InMemoryConfiguration>();
 
-    config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
+    config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(fs_in));
 
     config->set_property("SignalSource.fs_hz", std::to_string(fs_in));
     config->set_property("SignalSource.item_type", "gr_complex");
@@ -269,6 +268,7 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::config_1()
     config->set_property("Acquisition.dump", "false");
 }
 
+
 void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::config_2()
 {
     gnss_synchro.Channel_ID = 0;
@@ -292,7 +292,7 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::config_2()
 
     config = std::make_shared<InMemoryConfiguration>();
 
-    config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
+    config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(fs_in));
 
     config->set_property("SignalSource.fs_hz", std::to_string(fs_in));
 
@@ -360,6 +360,7 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::config_2()
     config->set_property("Acquisition.dump", "false");
 }
 
+
 void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::config_3()
 {
     gnss_synchro.Channel_ID = 0;
@@ -383,7 +384,7 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::config_3()
 
     config = std::make_shared<InMemoryConfiguration>();
 
-    config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
+    config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(fs_in));
 
     config->set_property("SignalSource.fs_hz", std::to_string(fs_in));
 
@@ -451,45 +452,45 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::config_3()
     config->set_property("Acquisition.dump", "false");
 }
 
+
 void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::start_queue()
 {
     stop = false;
     ch_thread = boost::thread(&GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::wait_message, this);
 }
 
+
 void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::wait_message()
 {
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
 
     while (!stop)
         {
             acquisition->reset();
 
-            gettimeofday(&tv, NULL);
-            begin = tv.tv_sec * 1e6 + tv.tv_usec;
+            start = std::chrono::system_clock::now();
 
             channel_internal_queue.wait_and_pop(message);
 
-            gettimeofday(&tv, NULL);
-            end = tv.tv_sec * 1e6 + tv.tv_usec;
+            end = std::chrono::system_clock::now();
+            elapsed_seconds = end - start;
 
-            mean_acq_time_us += (end - begin);
+            mean_acq_time_us += elapsed_seconds.count() * 1e6;
 
             process_message();
         }
 }
 
+
 void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::process_message()
 {
-
     if (message == 1)
         {
             detection_counter++;
 
             // The term -5 is here to correct the additional delay introduced by the FIR filter
-            double delay_error_chips = std::abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples - 5) * 1023.0/ ((double)fs_in * 1e-3));
+            double delay_error_chips = std::abs(static_cast<double>(expected_delay_chips) - static_cast<double>(gnss_synchro.Acq_delay_samples - 5) * 1023.0 / (static_cast<double>(fs_in) * 1e-3));
             double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
 
             mse_delay += std::pow(delay_error_chips, 2);
@@ -507,17 +508,17 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::process_message()
 
     realization_counter++;
 
-    std::cout << "Progress: " << round((float)realization_counter / num_of_realizations * 100) << "% \r" << std::flush;
+    std::cout << "Progress: " << round(static_cast<float>(realization_counter) / static_cast<float>(num_of_realizations) * 100.0) << "% \r" << std::flush;
 
     if (realization_counter == num_of_realizations)
         {
             mse_delay /= num_of_realizations;
             mse_doppler /= num_of_realizations;
 
-            Pd = (double)correct_estimation_counter / (double)num_of_realizations;
-            Pfa_a = (double)detection_counter / (double)num_of_realizations;
-            Pfa_p = (double)(detection_counter-correct_estimation_counter) / (double)num_of_realizations;
-            Pmd = (double)miss_detection_counter / (double)num_of_realizations;
+            Pd = static_cast<double>(correct_estimation_counter) / static_cast<double>(num_of_realizations);
+            Pfa_a = static_cast<double>(detection_counter) / static_cast<double>(num_of_realizations);
+            Pfa_p = static_cast<double>(detection_counter - correct_estimation_counter) / static_cast<double>(num_of_realizations);
+            Pmd = static_cast<double>(miss_detection_counter) / static_cast<double>(num_of_realizations);
 
             mean_acq_time_us /= num_of_realizations;
 
@@ -539,12 +540,12 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, Instantiate)
     acquisition = std::make_shared<GpsL1CaPcpsQuickSyncAcquisition>(config.get(), "Acquisition", 1, 1);
 }
 
+
 TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ConnectAndRun)
 {
     int nsamples = floor(fs_in * integration_time_ms * 1e-3);
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
     top_block = gr::make_top_block("Acquisition test");
     queue = gr::msg_queue::make(0);
     boost::shared_ptr<GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx> msg_rx = GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue);
@@ -562,19 +563,16 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ConnectAndRun)
     }) << "Failure connecting the blocks of acquisition test."<< std::endl;
 
     EXPECT_NO_THROW( {
-        gettimeofday(&tv, NULL);
-        begin = tv.tv_sec * 1e6 + tv.tv_usec;
+        start = std::chrono::system_clock::now();
         top_block->run(); // Start threads and wait
-        gettimeofday(&tv, NULL);
-        end = tv.tv_sec * 1e6 + tv.tv_usec;
+        end = std::chrono::system_clock::now();
+        elapsed_seconds = end - start;
     }) << "Failure running the top_block."<< std::endl;
 
-    std::cout <<  "Processed " << nsamples << " samples in " << (end-begin) << " microseconds" << std::endl;
-
+    std::cout <<  "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
 }
 
 
-
 TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResults)
 {
     config_1();
@@ -653,11 +651,9 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResults)
                     EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS.";
                     if (message == 1)
                         {
-
-                            EXPECT_EQ((unsigned int)1, correct_estimation_counter)
+                            EXPECT_EQ(static_cast<unsigned int>(1), correct_estimation_counter)
                                 << "Acquisition failure. Incorrect parameters estimation.";
                         }
-
                 }
             else if (i == 1)
                 {
@@ -749,7 +745,7 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResultsWithNoise
                     EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS.";
                     if (message == 1)
                         {
-                             EXPECT_EQ((unsigned int)1, correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation.";
+                             EXPECT_EQ(static_cast<unsigned int>(1), correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation.";
                         }
 
                 }
diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc
index cb7761b02..b4275a582 100644
--- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc
@@ -32,7 +32,7 @@
 
 
 
-#include <ctime>
+#include <chrono>
 #include <iostream>
 #include <boost/shared_ptr.hpp>
 #include <gnuradio/top_block.h>
@@ -167,6 +167,7 @@ protected:
     double Pfa_a = 0.0;
 };
 
+
 void GpsL1CaPcpsTongAcquisitionGSoC2013Test::init()
 {
     message = 0;
@@ -182,6 +183,7 @@ void GpsL1CaPcpsTongAcquisitionGSoC2013Test::init()
     Pfa_a = 0;
 }
 
+
 void GpsL1CaPcpsTongAcquisitionGSoC2013Test::config_1()
 {
     gnss_synchro.Channel_ID = 0;
@@ -201,7 +203,7 @@ void GpsL1CaPcpsTongAcquisitionGSoC2013Test::config_1()
 
     config = std::make_shared<InMemoryConfiguration>();
 
-    config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
+    config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(fs_in));
 
     config->set_property("SignalSource.fs_hz", std::to_string(fs_in));
 
@@ -251,6 +253,7 @@ void GpsL1CaPcpsTongAcquisitionGSoC2013Test::config_1()
     config->set_property("Acquisition.dump", "false");
 }
 
+
 void GpsL1CaPcpsTongAcquisitionGSoC2013Test::config_2()
 {
     gnss_synchro.Channel_ID = 0;
@@ -270,7 +273,7 @@ void GpsL1CaPcpsTongAcquisitionGSoC2013Test::config_2()
 
     config = std::make_shared<InMemoryConfiguration>();
 
-    config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
+    config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(fs_in));
 
     config->set_property("SignalSource.fs_hz", std::to_string(fs_in));
 
@@ -338,36 +341,36 @@ void GpsL1CaPcpsTongAcquisitionGSoC2013Test::config_2()
     config->set_property("Acquisition.dump", "false");
 }
 
+
 void GpsL1CaPcpsTongAcquisitionGSoC2013Test::start_queue()
 {
     stop = false;
     ch_thread = boost::thread(&GpsL1CaPcpsTongAcquisitionGSoC2013Test::wait_message, this);
 }
 
+
 void GpsL1CaPcpsTongAcquisitionGSoC2013Test::wait_message()
 {
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
 
     while (!stop)
         {
             acquisition->reset();
 
-            gettimeofday(&tv, NULL);
-            begin = tv.tv_sec *1e6 + tv.tv_usec;
+            start = std::chrono::system_clock::now();
 
             channel_internal_queue.wait_and_pop(message);
 
-            gettimeofday(&tv, NULL);
-            end = tv.tv_sec*1e6 + tv.tv_usec;
-
-            mean_acq_time_us += (end - begin);
+            end = std::chrono::system_clock::now();
+            elapsed_seconds = end - start;
 
+            mean_acq_time_us += elapsed_seconds.count() * 1e6;
             process_message();
         }
 }
 
+
 void GpsL1CaPcpsTongAcquisitionGSoC2013Test::process_message()
 {
     if (message == 1)
@@ -375,7 +378,7 @@ void GpsL1CaPcpsTongAcquisitionGSoC2013Test::process_message()
             detection_counter++;
 
             // The term -5 is here to correct the additional delay introduced by the FIR filter
-            double delay_error_chips = std::abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*1023.0/((double)fs_in*1e-3));
+            double delay_error_chips = std::abs(static_cast<double>(expected_delay_chips) - static_cast<double>(gnss_synchro.Acq_delay_samples - 5) * 1023.0 / (static_cast<double>(fs_in) * 1e-3));
             double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
 
             mse_delay += std::pow(delay_error_chips, 2);
@@ -389,16 +392,16 @@ void GpsL1CaPcpsTongAcquisitionGSoC2013Test::process_message()
 
     realization_counter++;
 
-    std::cout << "Progress: " << round((float)realization_counter/num_of_realizations*100) << "% \r" << std::flush;
+    std::cout << "Progress: " << round(static_cast<float>(realization_counter) / static_cast<float>(num_of_realizations) * 100.0) << "% \r" << std::flush;
 
     if (realization_counter == num_of_realizations)
         {
             mse_delay /= num_of_realizations;
             mse_doppler /= num_of_realizations;
 
-            Pd = (double)correct_estimation_counter / (double)num_of_realizations;
-            Pfa_a = (double)detection_counter / (double)num_of_realizations;
-            Pfa_p = (double)(detection_counter-correct_estimation_counter) / (double)num_of_realizations;
+            Pd = static_cast<double>(correct_estimation_counter) / static_cast<double>(num_of_realizations);
+            Pfa_a = static_cast<double>(detection_counter) / static_cast<double>(num_of_realizations);
+            Pfa_p = static_cast<double>(detection_counter - correct_estimation_counter) / static_cast<double>(num_of_realizations);
 
             mean_acq_time_us /= num_of_realizations;
 
@@ -409,23 +412,25 @@ void GpsL1CaPcpsTongAcquisitionGSoC2013Test::process_message()
         }
 }
 
+
 void GpsL1CaPcpsTongAcquisitionGSoC2013Test::stop_queue()
 {
     stop = true;
 }
 
+
 TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, Instantiate)
 {
     config_1();
     acquisition = std::make_shared<GpsL1CaPcpsTongAcquisition>(config.get(), "Acquisition", 1, 1);
 }
 
+
 TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ConnectAndRun)
 {
     int nsamples = floor(fs_in*integration_time_ms*1e-3);
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
     top_block = gr::make_top_block("Acquisition test");
     queue = gr::msg_queue::make(0);
 
@@ -443,16 +448,16 @@ TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ConnectAndRun)
     }) << "Failure connecting the blocks of acquisition test." << std::endl;
 
     EXPECT_NO_THROW( {
-        gettimeofday(&tv, NULL);
-        begin = tv.tv_sec *1e6 + tv.tv_usec;
+        start = std::chrono::system_clock::now();
         top_block->run(); // Start threads and wait
-        gettimeofday(&tv, NULL);
-        end = tv.tv_sec *1e6 + tv.tv_usec;
+        end = std::chrono::system_clock::now();
+        elapsed_seconds = end - start;
     }) << "Failure running the top_block." << std::endl;
 
-    std::cout <<  "Processed " << nsamples << " samples in " << (end - begin) << " microseconds" << std::endl;
+    std::cout <<  "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
 }
 
+
 TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ValidationOfResults)
 {
     config_1();
@@ -529,9 +534,8 @@ TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ValidationOfResults)
                 EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS.";
                 if (message == 1)
                     {
-                        EXPECT_EQ((unsigned int)1, correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation.";
+                        EXPECT_EQ(static_cast<unsigned int>(1), correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation.";
                     }
-
             }
             else if (i == 1)
             {
@@ -542,6 +546,7 @@ TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ValidationOfResults)
         }
 }
 
+
 TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ValidationOfResultsProbabilities)
 {
     config_2();
diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc
index bdfc0dd9a..69b36f01c 100644
--- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc
@@ -32,11 +32,8 @@
 
 
 
-#include <ctime>
-#include <cstdlib>
-#include <cstring>
+#include <chrono>
 #include <iostream>
-#include <boost/chrono.hpp>
 #include <boost/make_shared.hpp>
 #include <gnuradio/top_block.h>
 #include <gnuradio/blocks/file_source.h>
@@ -144,13 +141,13 @@ void GpsL2MPcpsAcquisitionTest::init()
     gnss_synchro.System = 'G';
     std::string signal = "2S";
     //strncpy(gnss_synchro.Signal, signal.c_str(), 3);
-    std::memcpy((void*)gnss_synchro.Signal, signal.c_str(), 3); // copy string into synchro char array: 2 char + null
+    std::memcpy(static_cast<void*>(gnss_synchro.Signal), signal.c_str(), 3); // copy string into synchro char array: 2 char + null
     gnss_synchro.Signal[2] = 0; // make sure that string length is only two characters
     gnss_synchro.PRN = 7;
 
     sampling_freqeuncy_hz  = 5000000;
-    nsamples = round((double)sampling_freqeuncy_hz*GPS_L2_M_PERIOD)*2;
-    config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(sampling_freqeuncy_hz));
+    nsamples = round(static_cast<double>(sampling_freqeuncy_hz) * GPS_L2_M_PERIOD) * 2;
+    config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(sampling_freqeuncy_hz));
     config->set_property("Acquisition.item_type", "gr_complex");
     config->set_property("Acquisition.if", "0");
     config->set_property("Acquisition.dump", "false");
@@ -169,11 +166,11 @@ TEST_F(GpsL2MPcpsAcquisitionTest, Instantiate)
     std::shared_ptr<GpsL2MPcpsAcquisition> acquisition = std::make_shared<GpsL2MPcpsAcquisition>(config.get(), "Acquisition", 1, 1);
 }
 
+
 TEST_F(GpsL2MPcpsAcquisitionTest, ConnectAndRun)
 {
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
     top_block = gr::make_top_block("Acquisition test");
     queue = gr::msg_queue::make(0);
 
@@ -191,21 +188,20 @@ TEST_F(GpsL2MPcpsAcquisitionTest, ConnectAndRun)
     }) << "Failure connecting the blocks of acquisition test." << std::endl;
 
     EXPECT_NO_THROW( {
-        gettimeofday(&tv, NULL);
-        begin = tv.tv_sec * 1000000 + tv.tv_usec;
+        start = std::chrono::system_clock::now();
         top_block->run(); // Start threads and wait
-        gettimeofday(&tv, NULL);
-        end = tv.tv_sec * 1000000 + tv.tv_usec;
+        end = std::chrono::system_clock::now();
+        elapsed_seconds = end - start;
     }) << "Failure running the top_block." << std::endl;
 
-    std::cout <<  "Processed " << nsamples << " samples in " << (end - begin) << " microseconds" << std::endl;
+    std::cout <<  "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
 }
 
+
 TEST_F(GpsL2MPcpsAcquisitionTest, ValidationOfResults)
 {
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
     top_block = gr::make_top_block("Acquisition test");
     queue = gr::msg_queue::make(0);
     double expected_delay_samples = 1;//2004;
@@ -255,22 +251,21 @@ TEST_F(GpsL2MPcpsAcquisitionTest, ValidationOfResults)
         top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events"));
     }) << "Failure connecting the blocks of acquisition test." << std::endl;
 
-
     ASSERT_NO_THROW( {
+        acquisition->set_local_code();
         acquisition->set_state(1); // Ensure that acquisition starts at the first sample
         acquisition->init();
     }) << "Failure set_state and init acquisition test" << std::endl;
 
     EXPECT_NO_THROW( {
-        gettimeofday(&tv, NULL);
-        begin = tv.tv_sec * 1000000 + tv.tv_usec;
+        start = std::chrono::system_clock::now();
         top_block->run(); // Start threads and wait
-        gettimeofday(&tv, NULL);
-        end = tv.tv_sec * 1000000 + tv.tv_usec;
+        end = std::chrono::system_clock::now();
+        elapsed_seconds = end - start;
     }) << "Failure running the top_block." << std::endl;
 
     //unsigned long int Acq_samplestamp_samples = gnss_synchro.Acq_samplestamp_samples;
-    std::cout <<  "Acquisition process runtime duration: " << (end - begin) << " microseconds" << std::endl;
+    std::cout <<  "Acquisition process runtime duration: " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
 
     std::cout <<  "gnss_synchro.Acq_doppler_hz = " << gnss_synchro.Acq_doppler_hz << " Hz" << std::endl;
     std::cout <<  "gnss_synchro.Acq_delay_samples = " << gnss_synchro.Acq_delay_samples << " Samples" << std::endl;
@@ -278,10 +273,9 @@ TEST_F(GpsL2MPcpsAcquisitionTest, ValidationOfResults)
     ASSERT_EQ(1, msg_rx->rx_message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS.";
 
     double delay_error_samples = std::abs(expected_delay_samples - gnss_synchro.Acq_delay_samples);
-    float delay_error_chips = (float)(delay_error_samples * 1023 / 4000);
+    float delay_error_chips = static_cast<float>(delay_error_samples * 1023 / 4000);
     double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
 
     EXPECT_LE(doppler_error_hz, 200) << "Doppler error exceeds the expected value: 666 Hz = 2/(3*integration period)";
     EXPECT_LT(delay_error_chips, 0.5) << "Delay error exceeds the expected value: 0.5 chips";
-
 }
diff --git a/src/tests/unit-tests/signal-processing-blocks/adapter/adapter_test.cc b/src/tests/unit-tests/signal-processing-blocks/adapter/adapter_test.cc
new file mode 100644
index 000000000..a24f1a7e8
--- /dev/null
+++ b/src/tests/unit-tests/signal-processing-blocks/adapter/adapter_test.cc
@@ -0,0 +1,409 @@
+/*!
+ * \file adapter_test.cc
+ * \brief  This file implements tests for the DataTypeAdapter block
+ * \author Carles Fernandez-Prades, 2017. cfernandez(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 <http://www.gnu.org/licenses/>.
+ *
+ * -------------------------------------------------------------------------
+ */
+
+#include <algorithm>
+#include <cstdint>
+#include <fstream>
+#include <iterator>
+#include <system_error>
+#include <vector>
+#include <gnuradio/blocks/file_source.h>
+#include <gtest/gtest.h>
+#include <volk_gnsssdr/volk_gnsssdr.h>
+#include "byte_to_short.h"
+#include "ibyte_to_cbyte.h"
+#include "ibyte_to_complex.h"
+#include "ibyte_to_cshort.h"
+#include "ishort_to_complex.h"
+#include "ishort_to_cshort.h"
+#include "in_memory_configuration.h"
+
+
+class DataTypeAdapter: public ::testing::Test
+{
+public:
+    DataTypeAdapter();
+    ~DataTypeAdapter();
+    int run_byte_to_short_block();
+    int run_ibyte_to_cbyte_block();
+    int run_ibyte_to_complex_block();
+    int run_ibyte_to_cshort_block();
+    int run_ishort_to_complex_block();
+    int run_ishort_to_cshort_block();
+    std::string file_name_input;
+    std::string file_name_output;
+    std::vector<int8_t> input_data_bytes;
+    std::vector<short> input_data_shorts;
+};
+
+
+DataTypeAdapter::DataTypeAdapter()
+{
+    file_name_input = "adapter_test_input.dat";
+    file_name_output = "adapter_test_output.dat";
+    int8_t input_bytes[] = {2, 23, -1, 127, -127, 0};
+    short input_shorts[] = {2, 23, -1, 127, -127, 0, 255, 255};
+
+    const std::vector<int8_t> input_data_bytes_(input_bytes, input_bytes + sizeof(input_bytes) / sizeof(int8_t));
+    input_data_bytes = input_data_bytes_;
+
+    const std::vector<short> input_data_shorts_(input_shorts, input_shorts + sizeof(input_shorts) / sizeof(short));
+    input_data_shorts = input_data_shorts_;
+}
+
+
+DataTypeAdapter::~DataTypeAdapter()
+{}
+
+
+int DataTypeAdapter::run_ishort_to_cshort_block()
+{
+    std::shared_ptr<ConfigurationInterface> config = std::make_shared<InMemoryConfiguration>();
+    config->set_property("Test.implementation", "Ishort_To_Cshort");
+    std::shared_ptr<IshortToCshort> ishort_to_cshort = std::make_shared<IshortToCshort>(config.get(), "Test", 1, 1);
+    std::string expected_implementation = "Ishort_To_Cshort";
+    EXPECT_EQ(expected_implementation, ishort_to_cshort->implementation());
+
+    std::ofstream ofs(file_name_input.c_str(), std::ofstream::binary);
+    for(std::vector<short>::const_iterator i = input_data_shorts.cbegin(); i != input_data_shorts.cend(); ++i)
+        {
+            short aux = *i;
+            ofs.write(reinterpret_cast<const char*>(&aux), sizeof(short));
+        }
+    ofs.close();
+
+    auto top_block = gr::make_top_block("Ishort_To_Cshort test");
+    auto file_source = gr::blocks::file_source::make(sizeof(short), file_name_input.c_str());
+    auto sink = gr::blocks::file_sink::make(sizeof(lv_16sc_t), file_name_output.c_str(), false);
+
+    EXPECT_NO_THROW( {
+        top_block->connect(file_source, 0, ishort_to_cshort->get_left_block(), 0);
+        top_block->connect(ishort_to_cshort->get_right_block(), 0, sink, 0);
+        top_block->run();
+    });
+    return 0;
+}
+
+
+int DataTypeAdapter::run_ishort_to_complex_block()
+{
+    std::shared_ptr<ConfigurationInterface> config = std::make_shared<InMemoryConfiguration>();
+    config->set_property("Test.implementation", "Ishort_To_Complex");
+    std::shared_ptr<IshortToComplex> ishort_to_complex = std::make_shared<IshortToComplex>(config.get(), "Test", 1, 1);
+    std::string expected_implementation = "Ishort_To_Complex";
+    EXPECT_EQ(expected_implementation, ishort_to_complex->implementation());
+
+    std::ofstream ofs(file_name_input.c_str(), std::ofstream::binary);
+    for(std::vector<short>::const_iterator i = input_data_shorts.cbegin(); i != input_data_shorts.cend(); ++i)
+        {
+            short aux = *i;
+            ofs.write(reinterpret_cast<const char*>(&aux), sizeof(short));
+        }
+    ofs.close();
+
+    auto top_block = gr::make_top_block("Ishort_To_Complex test");
+    auto file_source = gr::blocks::file_source::make(sizeof(short), file_name_input.c_str());
+    auto sink = gr::blocks::file_sink::make(sizeof(gr_complex), file_name_output.c_str(), false);
+
+    EXPECT_NO_THROW( {
+        top_block->connect(file_source, 0, ishort_to_complex->get_left_block(), 0);
+        top_block->connect(ishort_to_complex->get_right_block(), 0, sink, 0);
+        top_block->run();
+    });
+    return 0;
+}
+
+
+int DataTypeAdapter::run_ibyte_to_cshort_block()
+{
+    std::shared_ptr<ConfigurationInterface> config = std::make_shared<InMemoryConfiguration>();
+    config->set_property("Test.implementation", "Ibyte_To_Cshort");
+    std::shared_ptr<IbyteToCshort> ibyte_to_cshort = std::make_shared<IbyteToCshort>(config.get(), "Test", 1, 1);
+    std::string expected_implementation = "Ibyte_To_Cshort";
+    EXPECT_EQ(expected_implementation, ibyte_to_cshort->implementation());
+
+    std::ofstream ofs(file_name_input.c_str());
+    for(std::vector<int8_t>::const_iterator i = input_data_bytes.cbegin(); i != input_data_bytes.cend(); ++i)
+        {
+            ofs << *i;
+        }
+    ofs.close();
+
+    auto top_block = gr::make_top_block("Ibyte_To_Cshort test");
+    auto file_source = gr::blocks::file_source::make(sizeof(int8_t), file_name_input.c_str());
+    auto sink = gr::blocks::file_sink::make(sizeof(lv_16sc_t), file_name_output.c_str(), false);
+
+    EXPECT_NO_THROW( {
+        top_block->connect(file_source, 0, ibyte_to_cshort->get_left_block(), 0);
+        top_block->connect(ibyte_to_cshort->get_right_block(), 0, sink, 0);
+        top_block->run();
+    });
+    return 0;
+}
+
+
+int DataTypeAdapter::run_ibyte_to_complex_block()
+{
+    std::shared_ptr<ConfigurationInterface> config = std::make_shared<InMemoryConfiguration>();
+    config->set_property("Test.implementation", "Ibyte_To_Complex");
+    std::shared_ptr<IbyteToComplex> ibyte_to_complex = std::make_shared<IbyteToComplex>(config.get(), "Test", 1, 1);
+    std::string expected_implementation = "Ibyte_To_Complex";
+    EXPECT_EQ(expected_implementation, ibyte_to_complex->implementation());
+
+    std::ofstream ofs(file_name_input.c_str() );
+    for(std::vector<int8_t>::const_iterator i = input_data_bytes.cbegin(); i != input_data_bytes.cend(); ++i)
+        {
+            ofs << *i;
+        }
+    ofs.close();
+
+    auto top_block = gr::make_top_block("Ibyte_To_Complex test");
+    auto file_source = gr::blocks::file_source::make(sizeof(int8_t), file_name_input.c_str());
+    auto sink = gr::blocks::file_sink::make(sizeof(gr_complex), file_name_output.c_str(), false);
+
+    EXPECT_NO_THROW( {
+        top_block->connect(file_source, 0, ibyte_to_complex->get_left_block(), 0);
+        top_block->connect(ibyte_to_complex->get_right_block(), 0, sink, 0);
+        top_block->run();
+    });
+    return 0;
+}
+
+
+int DataTypeAdapter::run_ibyte_to_cbyte_block()
+{
+    std::shared_ptr<ConfigurationInterface> config = std::make_shared<InMemoryConfiguration>();
+    config->set_property("Test.implementation", "Ibyte_To_Cbyte");
+    std::shared_ptr<IbyteToCbyte> ibyte_to_cbyte = std::make_shared<IbyteToCbyte>(config.get(), "Test", 1, 1);
+    std::string expected_implementation = "Ibyte_To_Cbyte";
+    EXPECT_EQ(expected_implementation, ibyte_to_cbyte->implementation());
+
+    std::ofstream ofs(file_name_input.c_str());
+    for(std::vector<int8_t>::const_iterator i = input_data_bytes.cbegin(); i != input_data_bytes.cend(); ++i)
+        {
+            ofs << *i;
+        }
+    ofs.close();
+
+    auto top_block = gr::make_top_block("Ibyte_To_Cbyte test");
+    auto file_source = gr::blocks::file_source::make(sizeof(int8_t), file_name_input.c_str());
+    auto sink = gr::blocks::file_sink::make(sizeof(short), file_name_output.c_str(), false);
+
+    EXPECT_NO_THROW( {
+        top_block->connect(file_source, 0, ibyte_to_cbyte->get_left_block(), 0);
+        top_block->connect(ibyte_to_cbyte->get_right_block(), 0, sink, 0);
+        top_block->run();
+    });
+    return 0;
+}
+
+
+int DataTypeAdapter::run_byte_to_short_block()
+{
+    std::shared_ptr<ConfigurationInterface> config = std::make_shared<InMemoryConfiguration>();
+    config->set_property("Test.implementation", "Byte_To_Short");
+    std::shared_ptr<ByteToShort> byte_to_short = std::make_shared<ByteToShort>(config.get(), "Test", 1, 1);
+    std::string expected_implementation = "Byte_To_Short";
+    EXPECT_EQ(expected_implementation, byte_to_short->implementation());
+
+    std::ofstream ofs(file_name_input.c_str());
+    for(std::vector<int8_t>::const_iterator i = input_data_bytes.cbegin(); i != input_data_bytes.cend(); ++i)
+        {
+            ofs << *i;
+        }
+    ofs.close();
+
+    auto top_block = gr::make_top_block("Byte_To_Short test");
+    auto file_source = gr::blocks::file_source::make(sizeof(int8_t), file_name_input.c_str());
+    auto sink = gr::blocks::file_sink::make(sizeof(int16_t), file_name_output.c_str(), false);
+
+    EXPECT_NO_THROW( {
+        top_block->connect(file_source, 0, byte_to_short->get_left_block(), 0);
+        top_block->connect(byte_to_short->get_right_block(), 0, sink, 0);
+        top_block->run();
+    });
+    return 0;
+}
+
+
+TEST_F(DataTypeAdapter, ByteToShortValidationOfResults)
+{
+    run_byte_to_short_block();
+    std::ifstream ifs(file_name_output.data(), std::ifstream::binary | std::ifstream::in );
+
+    int16_t iSample;
+    int i = 0;
+    try
+    {
+            while(ifs.read(reinterpret_cast<char *>(&iSample), sizeof(int16_t)))
+                {
+                    EXPECT_EQ(input_data_bytes.at(i), static_cast<int8_t>(iSample / 256)); // Scale down!
+                    i++;
+                }
+    }
+    catch(std::system_error& e)
+    {
+            std::cerr << e.code().message() << std::endl;
+    }
+    ifs.close();
+    ASSERT_EQ(remove(file_name_input.c_str()), 0) << "Problem deleting temporary file";
+    ASSERT_EQ(remove(file_name_output.c_str()), 0) << "Problem deleting temporary file";
+}
+
+
+TEST_F(DataTypeAdapter, IbyteToCbyteValidationOfResults)
+{
+    run_ibyte_to_cbyte_block();
+    std::ifstream ifs(file_name_output.data(), std::ifstream::binary | std::ifstream::in );
+    lv_8sc_t iSample;
+    int i = 0;
+    try
+    {
+            while(ifs.read(reinterpret_cast<char *>(&iSample), sizeof(lv_8sc_t)))
+                {
+                    EXPECT_EQ(input_data_bytes.at(i), iSample.real());
+                    i++;
+                    EXPECT_EQ(input_data_bytes.at(i), iSample.imag());
+                    i++;
+                }
+    }
+    catch(std::system_error& e)
+    {
+            std::cerr << e.code().message() << std::endl;
+    }
+    ifs.close();
+    ASSERT_EQ(remove(file_name_input.c_str()), 0) << "Problem deleting temporary file";
+    ASSERT_EQ(remove(file_name_output.c_str()), 0) << "Problem deleting temporary file";
+}
+
+
+TEST_F(DataTypeAdapter, IbyteToComplexValidationOfResults)
+{
+    run_ibyte_to_cbyte_block();
+    std::ifstream ifs(file_name_output.data(), std::ifstream::binary | std::ifstream::in );
+    gr_complex iSample;
+    int i = 0;
+    try
+    {
+            while(ifs.read(reinterpret_cast<char *>(&iSample), sizeof(gr_complex)))
+                {
+                    EXPECT_EQ(input_data_bytes.at(i), static_cast<int8_t>(iSample.real()));
+                    i++;
+                    EXPECT_EQ(input_data_bytes.at(i),  static_cast<int8_t>(iSample.imag()));
+                    i++;
+                }
+    }
+    catch(std::system_error& e)
+    {
+            std::cerr << e.code().message() << std::endl;
+    }
+    ifs.close();
+    ASSERT_EQ(remove(file_name_input.c_str()), 0) << "Problem deleting temporary file";
+    ASSERT_EQ(remove(file_name_output.c_str()), 0) << "Problem deleting temporary file";
+}
+
+
+TEST_F(DataTypeAdapter, IbyteToCshortValidationOfResults)
+{
+    run_ibyte_to_cshort_block();
+    std::ifstream ifs(file_name_output.data(), std::ifstream::binary | std::ifstream::in );
+    lv_16sc_t iSample;
+    int i = 0;
+    try
+    {
+            while(ifs.read(reinterpret_cast<char *>(&iSample), sizeof(lv_16sc_t)))
+                {
+                    EXPECT_EQ(input_data_bytes.at(i), static_cast<int8_t>(iSample.real()));
+                    i++;
+                    EXPECT_EQ(input_data_bytes.at(i),  static_cast<int8_t>(iSample.imag()));
+                    i++;
+                }
+    }
+    catch(std::system_error& e)
+    {
+            std::cerr << e.code().message() << std::endl;
+    }
+    ifs.close();
+    ASSERT_EQ(remove(file_name_input.c_str()), 0) << "Problem deleting temporary file";
+    ASSERT_EQ(remove(file_name_output.c_str()), 0) << "Problem deleting temporary file";
+}
+
+
+TEST_F(DataTypeAdapter, IshortToComplexValidationOfResults)
+{
+    run_ishort_to_complex_block();
+    std::ifstream ifs(file_name_output.data(), std::ifstream::binary | std::ifstream::in );
+    gr_complex iSample;
+    int i = 0;
+    try
+    {
+            while(ifs.read(reinterpret_cast<char *>(&iSample), sizeof(gr_complex)))
+                {
+                    EXPECT_EQ(input_data_shorts.at(i), static_cast<short>(iSample.real()));
+                    i++;
+                    EXPECT_EQ(input_data_shorts.at(i),  static_cast<short>(iSample.imag()));
+                    i++;
+                }
+    }
+    catch(std::system_error& e)
+    {
+            std::cerr << e.code().message() << std::endl;
+    }
+    ifs.close();
+    ASSERT_EQ(remove(file_name_input.c_str()), 0) << "Problem deleting temporary file";
+    ASSERT_EQ(remove(file_name_output.c_str()), 0) << "Problem deleting temporary file";
+}
+
+
+TEST_F(DataTypeAdapter, IshortToCshortValidationOfResults)
+{
+    run_ishort_to_cshort_block();
+    std::ifstream ifs(file_name_output.data(), std::ifstream::binary | std::ifstream::in );
+    lv_16sc_t iSample;
+    int i = 0;
+    try
+    {
+            while(ifs.read(reinterpret_cast<char *>(&iSample), sizeof(lv_16sc_t)))
+                {
+                    EXPECT_EQ(input_data_shorts.at(i), static_cast<short>(iSample.real()));
+                    i++;
+                    EXPECT_EQ(input_data_shorts.at(i),  static_cast<short>(iSample.imag()));
+                    i++;
+                }
+    }
+    catch(std::system_error& e)
+    {
+            std::cerr << e.code().message() << std::endl;
+    }
+    ifs.close();
+    ASSERT_EQ(remove(file_name_input.c_str()), 0) << "Problem deleting temporary file";
+    ASSERT_EQ(remove(file_name_output.c_str()), 0) << "Problem deleting temporary file";
+}
diff --git a/src/tests/unit-tests/signal-processing-blocks/adapter/pass_through_test.cc b/src/tests/unit-tests/signal-processing-blocks/adapter/pass_through_test.cc
index 08429b657..656a0d688 100644
--- a/src/tests/unit-tests/signal-processing-blocks/adapter/pass_through_test.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/adapter/pass_through_test.cc
@@ -37,7 +37,7 @@
 
 
 
-TEST(Pass_Through_Test, Instantiate)
+TEST(PassThroughTest, Instantiate)
 {
     std::shared_ptr<ConfigurationInterface> config = std::make_shared<InMemoryConfiguration>();
     config->set_property("Test.item_type", "gr_complex");
diff --git a/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc b/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc
index 9a90fa4bd..baa3feea0 100644
--- a/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc
@@ -28,8 +28,8 @@
  * -------------------------------------------------------------------------
  */
 
+#include <chrono>
 #include <complex>
-#include <ctime>
 #include <iostream>
 #include <stdint.h>
 #include <gflags/gflags.h>
@@ -51,16 +51,16 @@
 
 DEFINE_int32(filter_test_nsamples, 1000000 , "Number of samples to filter in the tests (max: 2147483647)");
 
-class Fir_Filter_Test: public ::testing::Test
+class FirFilterTest: public ::testing::Test
 {
 protected:
-    Fir_Filter_Test()
+    FirFilterTest()
     {
         queue = gr::msg_queue::make(0);
         item_size = sizeof(gr_complex);
         config = std::make_shared<InMemoryConfiguration>();
     }
-    ~Fir_Filter_Test()
+    ~FirFilterTest()
     {}
 
     void init();
@@ -75,7 +75,8 @@ protected:
     int nsamples = FLAGS_filter_test_nsamples;
 };
 
-void Fir_Filter_Test::init()
+
+void FirFilterTest::init()
 {
     config->set_property("InputFilter.taps_item_type", "float");
     config->set_property("InputFilter.number_of_taps", "5");
@@ -99,32 +100,36 @@ void Fir_Filter_Test::init()
     //config->set_property("InputFilter.dump", "true");
 }
 
-void Fir_Filter_Test::configure_cbyte_cbyte()
+
+void FirFilterTest::configure_cbyte_cbyte()
 {
     config->set_property("InputFilter.input_item_type", "cbyte");
     config->set_property("InputFilter.output_item_type", "cbyte");
 }
 
-void Fir_Filter_Test::configure_gr_complex_gr_complex()
+
+void FirFilterTest::configure_gr_complex_gr_complex()
 {
     config->set_property("InputFilter.input_item_type", "gr_complex");
     config->set_property("InputFilter.output_item_type", "gr_complex");
 }
 
-void Fir_Filter_Test::configure_cshort_cshort()
+
+void FirFilterTest::configure_cshort_cshort()
 {
     config->set_property("InputFilter.input_item_type", "cshort");
     config->set_property("InputFilter.output_item_type", "cshort");
 }
 
-void Fir_Filter_Test::configure_cbyte_gr_complex()
+
+void FirFilterTest::configure_cbyte_gr_complex()
 {
     config->set_property("InputFilter.input_item_type", "cbyte");
     config->set_property("InputFilter.output_item_type", "gr_complex");
 }
 
 
-TEST_F(Fir_Filter_Test, Instantiate_gr_complex_gr_complex)
+TEST_F(FirFilterTest, InstantiateGrComplexGrComplex)
 {
     init();
     configure_gr_complex_gr_complex();
@@ -134,7 +139,7 @@ TEST_F(Fir_Filter_Test, Instantiate_gr_complex_gr_complex)
     ASSERT_EQ(1, res);
 }
 
-TEST_F(Fir_Filter_Test, Instantiate_cshort_cshort)
+TEST_F(FirFilterTest, InstantiateCshortCshort)
 {
     init();
     configure_cshort_cshort();
@@ -144,7 +149,8 @@ TEST_F(Fir_Filter_Test, Instantiate_cshort_cshort)
     ASSERT_EQ(1, res);
 }
 
-TEST_F(Fir_Filter_Test, Instantiate_cbyte_cbyte)
+
+TEST_F(FirFilterTest, InstantiateCbyteCbyte)
 {
     init();
     configure_cbyte_cbyte();
@@ -154,7 +160,8 @@ TEST_F(Fir_Filter_Test, Instantiate_cbyte_cbyte)
     ASSERT_EQ(1, res);
 }
 
-TEST_F(Fir_Filter_Test, Instantiate_cbyte_gr_complex)
+
+TEST_F(FirFilterTest, InstantiateCbyteGrComplex)
 {
     init();
     configure_cbyte_gr_complex();
@@ -164,12 +171,12 @@ TEST_F(Fir_Filter_Test, Instantiate_cbyte_gr_complex)
     ASSERT_EQ(1, res);
 }
 
-TEST_F(Fir_Filter_Test, ConnectAndRun)
+
+TEST_F(FirFilterTest, ConnectAndRun)
 {
     int fs_in = 4000000;
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
     top_block = gr::make_top_block("Fir filter test");
 
     init();
@@ -188,21 +195,19 @@ TEST_F(Fir_Filter_Test, ConnectAndRun)
     }) << "Failure connecting the top_block."<< std::endl;
 
     EXPECT_NO_THROW( {
-        gettimeofday(&tv, NULL);
-        begin = tv.tv_sec * 1000000 + tv.tv_usec;
+        start = std::chrono::system_clock::now();
         top_block->run(); // Start threads and wait
-        gettimeofday(&tv, NULL);
-        end = tv.tv_sec * 1000000 + tv.tv_usec;
+        end = std::chrono::system_clock::now();
+        elapsed_seconds = end - start;
     }) << "Failure running the top_block." << std::endl;
-    std::cout <<  "Filtered " << nsamples << " samples in " << (end-begin) << " microseconds" << std::endl;
+    std::cout <<  "Filtered " << nsamples << " samples in " << elapsed_seconds.count() * 1e6  << " microseconds" << std::endl;
 }
 
 
-TEST_F(Fir_Filter_Test, ConnectAndRunGrcomplex)
+TEST_F(FirFilterTest, ConnectAndRunGrcomplex)
 {
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
     top_block = gr::make_top_block("Fir filter test");
 
     init();
@@ -232,20 +237,18 @@ TEST_F(Fir_Filter_Test, ConnectAndRunGrcomplex)
     }) << "Failure connecting the top_block."<< std::endl;
 
     EXPECT_NO_THROW( {
-        gettimeofday(&tv, NULL);
-        begin = tv.tv_sec * 1000000 + tv.tv_usec;
+        start = std::chrono::system_clock::now();
         top_block->run(); // Start threads and wait
-        gettimeofday(&tv, NULL);
-        end = tv.tv_sec * 1000000 + tv.tv_usec;
+        end = std::chrono::system_clock::now();
+        elapsed_seconds = end - start;
     }) << "Failure running the top_block." << std::endl;
-    std::cout <<  "Filtered " << nsamples << " gr_complex samples in " << (end-begin) << " microseconds" << std::endl;
+    std::cout <<  "Filtered " << nsamples << " gr_complex samples in " << elapsed_seconds.count() * 1e6  << " microseconds" << std::endl;
 }
 
-TEST_F(Fir_Filter_Test, ConnectAndRunCshorts)
+TEST_F(FirFilterTest, ConnectAndRunCshorts)
 {
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
     top_block = gr::make_top_block("Fir filter test");
 
     init();
@@ -277,22 +280,20 @@ TEST_F(Fir_Filter_Test, ConnectAndRunCshorts)
     }) << "Failure connecting the top_block."<< std::endl;
 
     EXPECT_NO_THROW( {
-        gettimeofday(&tv, NULL);
-        begin = tv.tv_sec * 1000000 + tv.tv_usec;
+        start = std::chrono::system_clock::now();
         top_block->run(); // Start threads and wait
-        gettimeofday(&tv, NULL);
-        end = tv.tv_sec * 1000000 + tv.tv_usec;
+        end = std::chrono::system_clock::now();
+        elapsed_seconds = end - start;
     }) << "Failure running the top_block." << std::endl;
-    std::cout <<  "Filtered " << nsamples << " std::complex<int16_t> samples in " << (end-begin) << " microseconds" << std::endl;
+    std::cout <<  "Filtered " << nsamples << " std::complex<int16_t> samples in " << elapsed_seconds.count() * 1e6  << " microseconds" << std::endl;
 }
 
 
 
-TEST_F(Fir_Filter_Test, ConnectAndRunCbytes)
+TEST_F(FirFilterTest, ConnectAndRunCbytes)
 {
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
     top_block = gr::make_top_block("Fir filter test");
 
     init();
@@ -324,21 +325,19 @@ TEST_F(Fir_Filter_Test, ConnectAndRunCbytes)
     }) << "Failure connecting the top_block."<< std::endl;
 
     EXPECT_NO_THROW( {
-        gettimeofday(&tv, NULL);
-        begin = tv.tv_sec * 1000000 + tv.tv_usec;
+        start = std::chrono::system_clock::now();
         top_block->run(); // Start threads and wait
-        gettimeofday(&tv, NULL);
-        end = tv.tv_sec * 1000000 + tv.tv_usec;
+        end = std::chrono::system_clock::now();
+        elapsed_seconds = end - start;
     }) << "Failure running the top_block." << std::endl;
-    std::cout <<  "Filtered " << nsamples << " std::complex<int8_t> samples in " << (end-begin) << " microseconds" << std::endl;
+    std::cout <<  "Filtered " << nsamples << " std::complex<int8_t> samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
 }
 
 
-TEST_F(Fir_Filter_Test, ConnectAndRunCbyteGrcomplex)
+TEST_F(FirFilterTest, ConnectAndRunCbyteGrcomplex)
 {
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
     top_block = gr::make_top_block("Fir filter test");
 
     init();
@@ -370,11 +369,10 @@ TEST_F(Fir_Filter_Test, ConnectAndRunCbyteGrcomplex)
     }) << "Failure connecting the top_block."<< std::endl;
 
     EXPECT_NO_THROW( {
-        gettimeofday(&tv, NULL);
-        begin = tv.tv_sec * 1000000 + tv.tv_usec;
+        start = std::chrono::system_clock::now();
         top_block->run(); // Start threads and wait
-        gettimeofday(&tv, NULL);
-        end = tv.tv_sec * 1000000 + tv.tv_usec;
+        end = std::chrono::system_clock::now();
+        elapsed_seconds = end - start;
     }) << "Failure running the top_block." << std::endl;
-    std::cout <<  "Filtered " << nsamples << " samples in " << (end-begin) << " microseconds" << std::endl;
+    std::cout <<  "Filtered " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
 }
diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt b/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt
index aae96cedc..0ee8ec658 100644
--- a/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt
+++ b/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt
@@ -26,7 +26,7 @@ set(SIGNAL_PROCESSING_TESTING_LIB_SOURCES
 )
 
 include_directories(
-     $(CMAKE_CURRENT_SOURCE_DIR)
+     ${CMAKE_CURRENT_SOURCE_DIR}
      ${GLOG_INCLUDE_DIRS}
      ${GFlags_INCLUDE_DIRS}
 )
diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.cc b/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.cc
index 0773a5613..648938146 100644
--- a/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.cc
@@ -34,15 +34,15 @@ bool observables_dump_reader::read_binary_obs()
 {
     try
     {
-        for(int i=0;i<n_channels;i++)
+        for(int i = 0; i < n_channels; i++)
         {
-
-            d_dump_file.read((char *) &RX_time[i], sizeof(double));
-            d_dump_file.read((char *) &TOW_at_current_symbol_s[i], sizeof(double));
-            d_dump_file.read((char *) &Carrier_Doppler_hz[i], sizeof(double));
-            d_dump_file.read((char *) &Acc_carrier_phase_hz[i], sizeof(double));
-            d_dump_file.read((char *) &Pseudorange_m[i], sizeof(double));
-            d_dump_file.read((char *) &PRN[i], sizeof(double));
+            d_dump_file.read(reinterpret_cast<char *>(&RX_time[i]), sizeof(double));
+            d_dump_file.read(reinterpret_cast<char *>(&TOW_at_current_symbol_s[i]), sizeof(double));
+            d_dump_file.read(reinterpret_cast<char *>(&Carrier_Doppler_hz[i]), sizeof(double));
+            d_dump_file.read(reinterpret_cast<char *>(&Acc_carrier_phase_hz[i]), sizeof(double));
+            d_dump_file.read(reinterpret_cast<char *>(&Pseudorange_m[i]), sizeof(double));
+            d_dump_file.read(reinterpret_cast<char *>(&PRN[i]), sizeof(double));
+            d_dump_file.read(reinterpret_cast<char *>(&valid[i]), sizeof(double));
         }
     }
     catch (const std::ifstream::failure &e)
@@ -52,6 +52,7 @@ bool observables_dump_reader::read_binary_obs()
     return true;
 }
 
+
 bool observables_dump_reader::restart()
 {
     if (d_dump_file.is_open())
@@ -66,10 +67,11 @@ bool observables_dump_reader::restart()
         }
 }
 
+
 long int observables_dump_reader::num_epochs()
 {
     std::ifstream::pos_type size;
-    int number_of_vars_in_epoch = n_channels*6;
+    int number_of_vars_in_epoch = n_channels * 7;
     int epoch_size_bytes = sizeof(double) * number_of_vars_in_epoch;
     std::ifstream tmpfile( d_dump_filename.c_str(), std::ios::binary | std::ios::ate);
     if (tmpfile.is_open())
@@ -84,14 +86,15 @@ long int observables_dump_reader::num_epochs()
         }
 }
 
+
 bool observables_dump_reader::open_obs_file(std::string out_file)
 {
     if (d_dump_file.is_open() == false)
         {
             try
             {
-                    d_dump_filename=out_file;
-                    d_dump_file.exceptions ( std::ifstream::failbit | std::ifstream::badbit );
+                    d_dump_filename = out_file;
+                    d_dump_file.exceptions( std::ifstream::failbit | std::ifstream::badbit );
                     d_dump_file.open(d_dump_filename.c_str(), std::ios::in | std::ios::binary);
                     std::cout << "Observables sum file opened, Log file: " << d_dump_filename.c_str() << std::endl;
                     return true;
@@ -108,16 +111,20 @@ bool observables_dump_reader::open_obs_file(std::string out_file)
         }
 }
 
+
 observables_dump_reader::observables_dump_reader(int n_channels_)
 {
-    n_channels=n_channels_;
-    RX_time=new double[n_channels];
-    TOW_at_current_symbol_s=new double[n_channels];
-    Carrier_Doppler_hz=new double[n_channels];
-    Acc_carrier_phase_hz=new double[n_channels];
-    Pseudorange_m=new double[n_channels];
-    PRN=new double[n_channels];
+    n_channels = n_channels_;
+    RX_time = new double[n_channels];
+    TOW_at_current_symbol_s = new double[n_channels];
+    Carrier_Doppler_hz = new double[n_channels];
+    Acc_carrier_phase_hz = new double[n_channels];
+    Pseudorange_m = new double[n_channels];
+    PRN = new double[n_channels];
+    valid = new double[n_channels];
 }
+
+
 observables_dump_reader::~observables_dump_reader()
 {
     if (d_dump_file.is_open() == true)
@@ -130,4 +137,5 @@ observables_dump_reader::~observables_dump_reader()
     delete[] Acc_carrier_phase_hz;
     delete[] Pseudorange_m;
     delete[] PRN;
+    delete[] valid;
 }
diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.h b/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.h
index acdffa2f2..205c5cd9b 100644
--- a/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.h
+++ b/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.h
@@ -55,6 +55,7 @@ public:
     double* Acc_carrier_phase_hz;
     double* Pseudorange_m;
     double* PRN;
+    double* valid;
 
 private:
     int n_channels;
diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.cc b/src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.cc
index e480699f7..0a0993c70 100644
--- a/src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.cc
@@ -34,9 +34,9 @@ bool tlm_dump_reader::read_binary_obs()
 {
     try
     {
-            d_dump_file.read((char *) &TOW_at_current_symbol, sizeof(double));
-            d_dump_file.read((char *) &Tracking_sample_counter, sizeof(double));
-            d_dump_file.read((char *) &d_TOW_at_Preamble, sizeof(double));
+            d_dump_file.read(reinterpret_cast<char *>(&TOW_at_current_symbol), sizeof(double));
+            d_dump_file.read(reinterpret_cast<char *>(&Tracking_sample_counter), sizeof(unsigned long int));
+            d_dump_file.read(reinterpret_cast<char *>(&d_TOW_at_Preamble), sizeof(double));
     }
     catch (const std::ifstream::failure &e)
     {
@@ -45,6 +45,7 @@ bool tlm_dump_reader::read_binary_obs()
     return true;
 }
 
+
 bool tlm_dump_reader::restart()
 {
     if (d_dump_file.is_open())
@@ -59,11 +60,12 @@ bool tlm_dump_reader::restart()
         }
 }
 
+
 long int tlm_dump_reader::num_epochs()
 {
     std::ifstream::pos_type size;
-    int number_of_vars_in_epoch = 3;
-    int epoch_size_bytes = sizeof(double) * number_of_vars_in_epoch;
+    int number_of_vars_in_epoch = 2;
+    int epoch_size_bytes = sizeof(double) * number_of_vars_in_epoch + sizeof(unsigned long int);
     std::ifstream tmpfile( d_dump_filename.c_str(), std::ios::binary | std::ios::ate);
     if (tmpfile.is_open())
         {
@@ -77,14 +79,15 @@ long int tlm_dump_reader::num_epochs()
         }
 }
 
+
 bool tlm_dump_reader::open_obs_file(std::string out_file)
 {
     if (d_dump_file.is_open() == false)
         {
             try
             {
-                    d_dump_filename=out_file;
-                    d_dump_file.exceptions ( std::ifstream::failbit | std::ifstream::badbit );
+                    d_dump_filename = out_file;
+                    d_dump_file.exceptions( std::ifstream::failbit | std::ifstream::badbit );
                     d_dump_file.open(d_dump_filename.c_str(), std::ios::in | std::ios::binary);
                     std::cout << "TLM dump enabled, Log file: " << d_dump_filename.c_str() << std::endl;
                     return true;
@@ -101,6 +104,7 @@ bool tlm_dump_reader::open_obs_file(std::string out_file)
         }
 }
 
+
 tlm_dump_reader::~tlm_dump_reader()
 {
     if (d_dump_file.is_open() == true)
diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.cc b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.cc
index 3c3c2ac85..9d6e55cdb 100644
--- a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.cc
@@ -33,26 +33,26 @@
 bool tracking_dump_reader::read_binary_obs()
 {
     try {
-            d_dump_file.read((char *) &abs_E, sizeof(float));
-            d_dump_file.read((char *) &abs_P, sizeof(float));
-            d_dump_file.read((char *) &abs_L, sizeof(float));
-            d_dump_file.read((char *) &prompt_I, sizeof(float));
-            d_dump_file.read((char *) &prompt_Q, sizeof(float));
+            d_dump_file.read(reinterpret_cast<char *>(&abs_E), sizeof(float));
+            d_dump_file.read(reinterpret_cast<char *>(&abs_P), sizeof(float));
+            d_dump_file.read(reinterpret_cast<char *>(&abs_L), sizeof(float));
+            d_dump_file.read(reinterpret_cast<char *>(&prompt_I), sizeof(float));
+            d_dump_file.read(reinterpret_cast<char *>(&prompt_Q), sizeof(float));
 
-            d_dump_file.read((char *) &PRN_start_sample_count, sizeof(unsigned long int));
-
-            d_dump_file.read((char *) &acc_carrier_phase_rad, sizeof(double));
-            d_dump_file.read((char *) &carrier_doppler_hz, sizeof(double));
-            d_dump_file.read((char *) &code_freq_chips, sizeof(double));
-            d_dump_file.read((char *) &carr_error_hz, sizeof(double));
-            d_dump_file.read((char *) &carr_error_filt_hz, sizeof(double));
-            d_dump_file.read((char *) &code_error_chips, sizeof(double));
-            d_dump_file.read((char *) &code_error_filt_chips, sizeof(double));
-            d_dump_file.read((char *) &CN0_SNV_dB_Hz, sizeof(double));
-            d_dump_file.read((char *) &carrier_lock_test, sizeof(double));
-            d_dump_file.read((char *) &aux1, sizeof(double));
-            d_dump_file.read((char *) &aux2, sizeof(double));
+            d_dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count), sizeof(unsigned long int));
 
+            d_dump_file.read(reinterpret_cast<char *>(&acc_carrier_phase_rad), sizeof(double));
+            d_dump_file.read(reinterpret_cast<char *>(&carrier_doppler_hz), sizeof(double));
+            d_dump_file.read(reinterpret_cast<char *>(&code_freq_chips), sizeof(double));
+            d_dump_file.read(reinterpret_cast<char *>(&carr_error_hz), sizeof(double));
+            d_dump_file.read(reinterpret_cast<char *>(&carr_error_filt_hz), sizeof(double));
+            d_dump_file.read(reinterpret_cast<char *>(&code_error_chips), sizeof(double));
+            d_dump_file.read(reinterpret_cast<char *>(&code_error_filt_chips), sizeof(double));
+            d_dump_file.read(reinterpret_cast<char *>(&CN0_SNV_dB_Hz), sizeof(double));
+            d_dump_file.read(reinterpret_cast<char *>(&carrier_lock_test), sizeof(double));
+            d_dump_file.read(reinterpret_cast<char *>(&aux1), sizeof(double));
+            d_dump_file.read(reinterpret_cast<char *>(&aux2), sizeof(double));
+            d_dump_file.read(reinterpret_cast<char *>(&PRN), sizeof(unsigned int));
     }
     catch (const std::exception &e)
     {
@@ -61,6 +61,7 @@ bool tracking_dump_reader::read_binary_obs()
     return true;
 }
 
+
 bool tracking_dump_reader::restart()
 {
     if (d_dump_file.is_open())
@@ -75,15 +76,15 @@ bool tracking_dump_reader::restart()
         }
 }
 
+
 long int tracking_dump_reader::num_epochs()
 {
     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;
-    std::ifstream tmpfile( d_dump_filename.c_str(), std::ios::binary | std::ios::ate);
+    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 tmpfile(d_dump_filename.c_str(), std::ios::binary | std::ios::ate);
     if (tmpfile.is_open())
         {
             size = tmpfile.tellg();
@@ -96,6 +97,7 @@ long int tracking_dump_reader::num_epochs()
         }
 }
 
+
 bool tracking_dump_reader::open_obs_file(std::string out_file)
 {
     if (d_dump_file.is_open() == false)
@@ -103,7 +105,7 @@ bool tracking_dump_reader::open_obs_file(std::string out_file)
             try
             {
                     d_dump_filename = out_file;
-                    d_dump_file.exceptions ( std::ifstream::failbit | std::ifstream::badbit );
+                    d_dump_file.exceptions( std::ifstream::failbit | std::ifstream::badbit );
                     d_dump_file.open(d_dump_filename.c_str(), std::ios::in | std::ios::binary);
                     std::cout << "Tracking dump enabled, Log file: " << d_dump_filename.c_str() << std::endl;
                     return true;
@@ -120,6 +122,7 @@ bool tracking_dump_reader::open_obs_file(std::string out_file)
         }
 }
 
+
 tracking_dump_reader::~tracking_dump_reader()
 {
     if (d_dump_file.is_open() == true)
diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.h b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.h
index 6ec71ebb2..1c84ed9e3 100644
--- a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.h
+++ b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.h
@@ -79,6 +79,8 @@ public:
     double aux1;
     double aux2;
 
+    unsigned int PRN;
+
 private:
     std::string d_dump_filename;
     std::ifstream d_dump_file;
diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.cc b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.cc
index c11c1bd51..bd5b2a7fa 100644
--- a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.cc
@@ -34,11 +34,11 @@ bool tracking_true_obs_reader::read_binary_obs()
 {
     try
     {
-            d_dump_file.read((char *) &signal_timestamp_s, sizeof(double));
-            d_dump_file.read((char *) &acc_carrier_phase_cycles, sizeof(double));
-            d_dump_file.read((char *) &doppler_l1_hz, sizeof(double));
-            d_dump_file.read((char *) &prn_delay_chips, sizeof(double));
-            d_dump_file.read((char *) &tow, sizeof(double));
+            d_dump_file.read(reinterpret_cast<char *>(&signal_timestamp_s), sizeof(double));
+            d_dump_file.read(reinterpret_cast<char *>(&acc_carrier_phase_cycles), sizeof(double));
+            d_dump_file.read(reinterpret_cast<char *>(&doppler_l1_hz), sizeof(double));
+            d_dump_file.read(reinterpret_cast<char *>(&prn_delay_chips), sizeof(double));
+            d_dump_file.read(reinterpret_cast<char *>(&tow), sizeof(double));
     }
     catch (const std::exception &e)
     {
@@ -47,6 +47,7 @@ bool tracking_true_obs_reader::read_binary_obs()
     return true;
 }
 
+
 bool tracking_true_obs_reader::restart()
 {
     if (d_dump_file.is_open())
@@ -61,6 +62,7 @@ bool tracking_true_obs_reader::restart()
         }
 }
 
+
 long int tracking_true_obs_reader::num_epochs()
 {
     std::ifstream::pos_type size;
@@ -79,6 +81,7 @@ long int tracking_true_obs_reader::num_epochs()
         }
 }
 
+
 bool tracking_true_obs_reader::open_obs_file(std::string out_file)
 {
     if (d_dump_file.is_open() == false)
@@ -86,7 +89,7 @@ bool tracking_true_obs_reader::open_obs_file(std::string out_file)
             try
             {
                     d_dump_filename = out_file;
-                    d_dump_file.exceptions ( std::ifstream::failbit | std::ifstream::badbit );
+                    d_dump_file.exceptions( std::ifstream::failbit | std::ifstream::badbit );
                     d_dump_file.open(d_dump_filename.c_str(), std::ios::in | std::ios::binary);
                     std::cout << "Observables dump enabled, Log file: " << d_dump_filename.c_str() << std::endl;
                     return true;
@@ -103,6 +106,7 @@ bool tracking_true_obs_reader::open_obs_file(std::string out_file)
         }
 }
 
+
 tracking_true_obs_reader::~tracking_true_obs_reader()
 {
     if (d_dump_file.is_open() == true)
diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/true_observables_reader.cc b/src/tests/unit-tests/signal-processing-blocks/libs/true_observables_reader.cc
index fbe78cca7..f9d63af29 100644
--- a/src/tests/unit-tests/signal-processing-blocks/libs/true_observables_reader.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/libs/true_observables_reader.cc
@@ -36,12 +36,13 @@ bool true_observables_reader::read_binary_obs()
     {
         for(int i=0;i<12;i++)
         {
-            d_dump_file.read((char *) &gps_time_sec[i], sizeof(double));
-            d_dump_file.read((char *) &doppler_l1_hz, sizeof(double));
-            d_dump_file.read((char *) &acc_carrier_phase_l1_cycles[i], sizeof(double));
-            d_dump_file.read((char *) &dist_m[i], sizeof(double));
-            d_dump_file.read((char *) &carrier_phase_l1_cycles[i], sizeof(double));
-            d_dump_file.read((char *) &prn[i], sizeof(double));
+            d_dump_file.read(reinterpret_cast<char *>(&gps_time_sec[i]), sizeof(double));
+            d_dump_file.read(reinterpret_cast<char *>(&doppler_l1_hz), sizeof(double));
+            d_dump_file.read(reinterpret_cast<char *>(&acc_carrier_phase_l1_cycles[i]), sizeof(double));
+            d_dump_file.read(reinterpret_cast<char *>(&dist_m[i]), sizeof(double));
+            d_dump_file.read(reinterpret_cast<char *>(&true_dist_m[i]), sizeof(double));
+            d_dump_file.read(reinterpret_cast<char *>(&carrier_phase_l1_cycles[i]), sizeof(double));
+            d_dump_file.read(reinterpret_cast<char *>(&prn[i]), sizeof(double));
         }
     }
     catch (const std::ifstream::failure &e)
@@ -51,6 +52,7 @@ bool true_observables_reader::read_binary_obs()
     return true;
 }
 
+
 bool true_observables_reader::restart()
 {
     if (d_dump_file.is_open())
@@ -65,6 +67,7 @@ bool true_observables_reader::restart()
         }
 }
 
+
 long int true_observables_reader::num_epochs()
 {
     std::ifstream::pos_type size;
@@ -83,14 +86,15 @@ long int true_observables_reader::num_epochs()
         }
 }
 
+
 bool true_observables_reader::open_obs_file(std::string out_file)
 {
     if (d_dump_file.is_open() == false)
         {
             try
             {
-                    d_dump_filename=out_file;
-                    d_dump_file.exceptions ( std::ifstream::failbit | std::ifstream::badbit );
+                    d_dump_filename = out_file;
+                    d_dump_file.exceptions( std::ifstream::failbit | std::ifstream::badbit );
                     d_dump_file.open(d_dump_filename.c_str(), std::ios::in | std::ios::binary);
                     std::cout << "True observables Log file opened: " << d_dump_filename.c_str() << std::endl;
                     return true;
@@ -107,6 +111,7 @@ bool true_observables_reader::open_obs_file(std::string out_file)
         }
 }
 
+
 true_observables_reader::~true_observables_reader()
 {
     if (d_dump_file.is_open() == true)
diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/true_observables_reader.h b/src/tests/unit-tests/signal-processing-blocks/libs/true_observables_reader.h
index a4fb8767c..8913cf61d 100644
--- a/src/tests/unit-tests/signal-processing-blocks/libs/true_observables_reader.h
+++ b/src/tests/unit-tests/signal-processing-blocks/libs/true_observables_reader.h
@@ -49,6 +49,7 @@ public:
     double doppler_l1_hz[12];
     double acc_carrier_phase_l1_cycles[12];
     double dist_m[12];
+    double true_dist_m[12];
     double carrier_phase_l1_cycles[12];
     double prn[12];
 
diff --git a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc
index 8af9e8480..546bf600a 100644
--- a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc
@@ -30,15 +30,10 @@
  * -------------------------------------------------------------------------
  */
 
-
-#include <exception>
-#include <cstring>
-#include <ctime>
-#include <iostream>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/wait.h>
 #include <unistd.h>
+#include <chrono>
+#include <exception>
+#include <iostream>
 #include <armadillo>
 #include <gnuradio/top_block.h>
 #include <gnuradio/blocks/file_source.h>
@@ -187,19 +182,26 @@ public:
     std::string p4;
     std::string p5;
 
-    const int baseband_sampling_freq = FLAGS_fs_gen_hz;
+    const int baseband_sampling_freq = FLAGS_fs_gen_sps;
 
     std::string filename_rinex_obs = FLAGS_filename_rinex_obs;
     std::string filename_raw_data = FLAGS_filename_raw_data;
 
     int configure_generator();
     int generate_signal();
-    void check_results(
-            arma::vec true_ch0_dist_m, arma::vec true_ch1_dist_m,
-            arma::vec true_ch0_tow_s,
-            arma::vec measuded_ch0_Pseudorange_m,
-            arma::vec measuded_ch1_Pseudorange_m,
-            arma::vec measuded_ch0_RX_time_s);
+    void check_results_carrier_phase(
+            arma::vec & true_ch0_phase_cycles,
+            arma::vec & true_ch1_phase_cycles,
+            arma::vec & true_ch0_tow_s,
+            arma::vec & measuded_ch0_phase_cycles,
+            arma::vec & measuded_ch1_phase_cycles,
+            arma::vec & measuded_ch0_RX_time_s);
+    void check_results_code_psudorange(
+            arma::vec & true_ch0_dist_m, arma::vec & true_ch1_dist_m,
+            arma::vec & true_ch0_tow_s,
+            arma::vec & measuded_ch0_Pseudorange_m,
+            arma::vec & measuded_ch1_Pseudorange_m,
+            arma::vec & measuded_ch0_RX_time_s);
 
     HybridObservablesTest()
     {
@@ -281,34 +283,112 @@ void HybridObservablesTest::configure_receiver()
     gnss_synchro_ch1.PRN = FLAGS_test_satellite_PRN2;
 
 
-    config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(baseband_sampling_freq));
+    config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(baseband_sampling_freq));
 
     // Set Tracking
     config->set_property("Tracking_1C.item_type", "gr_complex");
     config->set_property("Tracking_1C.if", "0");
     config->set_property("Tracking_1C.dump", "true");
     config->set_property("Tracking_1C.dump_filename", "./tracking_ch_");
-    config->set_property("Tracking_1C.pll_bw_hz", "20.0");
-    config->set_property("Tracking_1C.dll_bw_hz", "1.5");
+    config->set_property("Tracking_1C.pll_bw_hz", "15.0");
+    config->set_property("Tracking_1C.dll_bw_hz", "0.5");
     config->set_property("Tracking_1C.early_late_space_chips", "0.5");
 
-
     config->set_property("TelemetryDecoder_1C.dump","true");
-    config->set_property("TelemetryDecoder_1C.decimation_factor","1");
-
-    config->set_property("Observables.history_depth","500");
     config->set_property("Observables.dump","true");
 
 
 }
 
-void HybridObservablesTest::check_results(
-        arma::vec true_ch0_dist_m,
-        arma::vec true_ch1_dist_m,
-        arma::vec true_ch0_tow_s,
-        arma::vec measuded_ch0_Pseudorange_m,
-        arma::vec measuded_ch1_Pseudorange_m,
-        arma::vec measuded_ch0_RX_time_s)
+void HybridObservablesTest::check_results_carrier_phase(
+        arma::vec & true_ch0_phase_cycles,
+        arma::vec & true_ch1_phase_cycles,
+        arma::vec & true_ch0_tow_s,
+        arma::vec & measuded_ch0_phase_cycles,
+        arma::vec & measuded_ch1_phase_cycles,
+        arma::vec & measuded_ch0_RX_time_s)
+{
+    //1. True value interpolation to match the measurement times
+
+    arma::vec true_ch0_phase_interp;
+    arma::vec true_ch1_phase_interp;
+    arma::interp1(true_ch0_tow_s, true_ch0_phase_cycles, measuded_ch0_RX_time_s, true_ch0_phase_interp);
+    arma::interp1(true_ch0_tow_s, true_ch1_phase_cycles, measuded_ch0_RX_time_s, true_ch1_phase_interp);
+
+    //2. RMSE
+    arma::vec err_ch0_cycles;
+    arma::vec err_ch1_cycles;
+
+    //compute error without the accumulated carrier phase offsets (which depends on the receiver starting time)
+    err_ch0_cycles = measuded_ch0_phase_cycles - true_ch0_phase_interp - measuded_ch0_phase_cycles(0) + true_ch0_phase_interp(0);
+    err_ch1_cycles = measuded_ch1_phase_cycles - true_ch1_phase_interp - measuded_ch1_phase_cycles(0) + true_ch1_phase_interp(0);
+
+    arma::vec err2_ch0 = arma::square(err_ch0_cycles);
+    double rmse_ch0 = sqrt(arma::mean(err2_ch0));
+
+    //3. Mean err and variance
+    double error_mean_ch0 = arma::mean(err_ch0_cycles);
+    double error_var_ch0 = arma::var(err_ch0_cycles);
+
+    // 4. Peaks
+    double max_error_ch0 = arma::max(err_ch0_cycles);
+    double min_error_ch0 = arma::min(err_ch0_cycles);
+
+    arma::vec err2_ch1 = arma::square(err_ch1_cycles);
+    double rmse_ch1 = sqrt(arma::mean(err2_ch1));
+
+    //3. Mean err and variance
+    double error_mean_ch1 = arma::mean(err_ch1_cycles);
+    double error_var_ch1 = arma::var(err_ch1_cycles);
+
+    // 4. Peaks
+    double max_error_ch1 = arma::max(err_ch1_cycles);
+    double min_error_ch1 = arma::min(err_ch1_cycles);
+
+
+    //5. report
+    std::streamsize ss = std::cout.precision();
+    std::cout << std::setprecision(10) << "Channel 0 Carrier phase RMSE="
+              << rmse_ch0 << ", mean=" << error_mean_ch0
+              << ", stdev=" << sqrt(error_var_ch0)
+              << " (max,min)=" << max_error_ch0
+              << "," << min_error_ch0
+              << " [cycles]" << std::endl;
+    std::cout.precision (ss);
+
+    ASSERT_LT(rmse_ch0, 1e-2);
+    ASSERT_LT(error_mean_ch0, 1e-2);
+    ASSERT_GT(error_mean_ch0, -1e-2);
+    ASSERT_LT(error_var_ch0, 1e-2);
+    ASSERT_LT(max_error_ch0, 5e-2);
+    ASSERT_GT(min_error_ch0, -5e-2);
+
+    //5. report
+    ss = std::cout.precision();
+    std::cout << std::setprecision(10) << "Channel 1 Carrier phase RMSE="
+              << rmse_ch1 << ", mean=" << error_mean_ch1
+              << ", stdev=" << sqrt(error_var_ch1)
+              << " (max,min)=" << max_error_ch1
+              << "," << min_error_ch1
+              << " [cycles]" << std::endl;
+    std::cout.precision (ss);
+
+    ASSERT_LT(rmse_ch1, 1e-2);
+    ASSERT_LT(error_mean_ch1, 1e-2);
+    ASSERT_GT(error_mean_ch1, -1e-2);
+    ASSERT_LT(error_var_ch1, 1e-2);
+    ASSERT_LT(max_error_ch1, 5e-2);
+    ASSERT_GT(min_error_ch1, -5e-2);
+
+}
+
+void HybridObservablesTest::check_results_code_psudorange(
+        arma::vec & true_ch0_dist_m,
+        arma::vec & true_ch1_dist_m,
+        arma::vec & true_ch0_tow_s,
+        arma::vec & measuded_ch0_Pseudorange_m,
+        arma::vec & measuded_ch1_Pseudorange_m,
+        arma::vec & measuded_ch0_RX_time_s)
 {
     //1. True value interpolation to match the measurement times
 
@@ -318,10 +398,6 @@ void HybridObservablesTest::check_results(
     arma::interp1(true_ch0_tow_s, true_ch1_dist_m, measuded_ch0_RX_time_s, true_ch1_dist_interp);
 
     // generate delta pseudoranges
-    std::cout<<"s1:"<<true_ch0_dist_m.size()<<std::endl;
-    std::cout<<"s2:"<<true_ch1_dist_m.size()<<std::endl;
-    std::cout<<"s3:"<<measuded_ch0_Pseudorange_m.size()<<std::endl;
-    std::cout<<"s4:"<<measuded_ch1_Pseudorange_m.size()<<std::endl;
     arma::vec delta_true_dist_m = true_ch0_dist_interp-true_ch1_dist_interp;
     arma::vec delta_measured_dist_m = measuded_ch0_Pseudorange_m-measuded_ch1_Pseudorange_m;
 
@@ -343,22 +419,24 @@ void HybridObservablesTest::check_results(
     double min_error = arma::min(err);
 
     //5. report
-
+    std::streamsize ss = std::cout.precision();
     std::cout << std::setprecision(10) << "Delta Observables RMSE="
               << rmse << ", mean=" << error_mean
               << ", stdev=" << sqrt(error_var)
               << " (max,min)=" << max_error
               << "," << min_error
               << " [meters]" << std::endl;
+    std::cout.precision (ss);
 
-    ASSERT_LT(rmse, 10E-3);
-    ASSERT_LT(error_mean, 10E-3);
-    ASSERT_GT(error_mean, 10E-3);
-    ASSERT_LT(error_var, 10E-3);
-    ASSERT_LT(max_error, 10E-3);
-    ASSERT_GT(min_error, 10E-3);
+    ASSERT_LT(rmse, 0.5);
+    ASSERT_LT(error_mean, 0.5);
+    ASSERT_GT(error_mean, -0.5);
+    ASSERT_LT(error_var, 0.5);
+    ASSERT_LT(max_error, 2);
+    ASSERT_GT(min_error, -2);
 }
 
+
 TEST_F(HybridObservablesTest, ValidationOfResults)
 {
     // Configure the signal generator
@@ -366,13 +444,12 @@ TEST_F(HybridObservablesTest, ValidationOfResults)
 
     // Generate signal raw signal samples and observations RINEX file
     if (FLAGS_disable_generator==false)
-    {
-        generate_signal();
-    }
+        {
+            generate_signal();
+        }
 
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
 
     configure_receiver();
 
@@ -424,7 +501,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults)
         {
             throw std::exception();
         };
-    })<< "Failure reading true observables file" << std::endl;
+    }) << "Failure reading true observables file" << std::endl;
 
     //restart the epoch counter
     true_obs_data_ch0.restart();
@@ -446,8 +523,6 @@ TEST_F(HybridObservablesTest, ValidationOfResults)
     std::shared_ptr<TelemetryDecoderInterface> tlm_ch0(new GpsL1CaTelemetryDecoder(config.get(), "TelemetryDecoder_1C",1, 1));
     std::shared_ptr<TelemetryDecoderInterface> tlm_ch1(new GpsL1CaTelemetryDecoder(config.get(), "TelemetryDecoder_1C",1, 1));
 
-
-
     ASSERT_NO_THROW( {
         tlm_ch0->set_channel(0);
         tlm_ch1->set_channel(1);
@@ -462,7 +537,6 @@ TEST_F(HybridObservablesTest, ValidationOfResults)
     //Observables
     std::shared_ptr<ObservablesInterface> observables(new HybridObservables(config.get(), "Observables",2, 2));
 
-
     ASSERT_NO_THROW( {
         tracking_ch0->set_channel(gnss_synchro_ch0.Channel_ID);
         tracking_ch1->set_channel(gnss_synchro_ch1.Channel_ID);
@@ -506,11 +580,10 @@ TEST_F(HybridObservablesTest, ValidationOfResults)
     tracking_ch1->start_tracking();
 
     EXPECT_NO_THROW( {
-        gettimeofday(&tv, NULL);
-        begin = tv.tv_sec * 1000000 + tv.tv_usec;
+        start = std::chrono::system_clock::now();
         top_block->run(); // Start threads and wait
-        gettimeofday(&tv, NULL);
-        end = tv.tv_sec * 1000000 + tv.tv_usec;
+        end = std::chrono::system_clock::now();
+        elapsed_seconds = end - start;
     }) << "Failure running the top_block." << std::endl;
 
     //check results
@@ -616,12 +689,41 @@ TEST_F(HybridObservablesTest, ValidationOfResults)
 
     measuded_ch0_RX_time_s = measuded_ch0_RX_time_s.subvec(initial_meas_point(0), measuded_ch0_RX_time_s.size() - 1);
     measuded_ch0_Pseudorange_m = measuded_ch0_Pseudorange_m.subvec(initial_meas_point(0), measuded_ch0_Pseudorange_m.size() - 1);
+    measuded_ch0_Acc_carrier_phase_hz = measuded_ch0_Acc_carrier_phase_hz.subvec(initial_meas_point(0), measuded_ch0_Acc_carrier_phase_hz.size() - 1);
+
     measuded_ch1_RX_time_s = measuded_ch1_RX_time_s.subvec(initial_meas_point(0), measuded_ch1_RX_time_s.size() - 1);
     measuded_ch1_Pseudorange_m = measuded_ch1_Pseudorange_m.subvec(initial_meas_point(0), measuded_ch1_Pseudorange_m.size() - 1);
+    measuded_ch1_Acc_carrier_phase_hz = measuded_ch1_Acc_carrier_phase_hz.subvec(initial_meas_point(0), measuded_ch1_Acc_carrier_phase_hz.size() - 1);
 
-    check_results(true_ch0_dist_m, true_ch1_dist_m, true_ch0_tow_s,
+    //correct the clock error using true values (it is not possible for a receiver to correct
+    //the receiver clock offset error at the observables level because it is required the
+    //decoding of the ephemeris data and solve the PVT equations)
+
+    //find the reference satellite and compute the receiver time offset at obsevable level
+    arma::vec receiver_time_offset_s;
+    if (measuded_ch0_Pseudorange_m(0)<measuded_ch1_Pseudorange_m(0))
+        {
+            receiver_time_offset_s = true_ch0_dist_m / GPS_C_m_s - GPS_STARTOFFSET_ms/1000.0;
+        }
+    else
+        {
+            receiver_time_offset_s = true_ch1_dist_m / GPS_C_m_s - GPS_STARTOFFSET_ms/1000.0;
+        }
+    arma::vec corrected_reference_TOW_s = true_ch0_tow_s - receiver_time_offset_s;
+
+    std::cout <<" receiver_time_offset_s [0]: " << receiver_time_offset_s(0) << std::endl;
+
+    //compare measured observables
+    check_results_code_psudorange(true_ch0_dist_m, true_ch1_dist_m, corrected_reference_TOW_s,
             measuded_ch0_Pseudorange_m,measuded_ch1_Pseudorange_m, measuded_ch0_RX_time_s);
 
-    std::cout <<  "Test completed in " << (end - begin) << " microseconds" << std::endl;
+    check_results_carrier_phase(true_ch0_acc_carrier_phase_cycles,
+            true_ch1_acc_carrier_phase_cycles,
+            corrected_reference_TOW_s,
+            measuded_ch0_Acc_carrier_phase_hz,
+            measuded_ch1_Acc_carrier_phase_hz,
+            measuded_ch0_RX_time_s);
+
+    std::cout <<  "Test completed in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
 }
 
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
new file mode 100644
index 000000000..328b4c998
--- /dev/null
+++ b/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc
@@ -0,0 +1,115 @@
+/*!
+ * \file nma_printer_test.cc
+ * \brief Implements Unit Tests for the Nmea_Printer class.
+ * \author Carles Fernandez-Prades, 2017. cfernandez(at)cttc.es
+ *
+ * -------------------------------------------------------------------------
+ *
+ * Copyright (C) 2010-2016  (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 <http://www.gnu.org/licenses/>.
+ *
+ * -------------------------------------------------------------------------
+ */
+
+
+#include <cstdio>
+#include <iostream>
+#include <fstream>
+#include <string>
+#include "nmea_printer.h"
+
+
+TEST(NmeaPrinterTest, PrintLine)
+{
+    std::string filename("nmea_test.nmea");
+
+    std::shared_ptr<Pvt_Solution> pvt_solution = std::make_shared<Pvt_Solution>();
+
+    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
+    pvt_solution->set_position_UTC_time(pt);
+
+    arma::vec pos = {49.27416667, -123.18533333, 0};
+    pvt_solution->set_rx_pos(pos);
+
+    pvt_solution->set_valid_position(true);
+
+    ASSERT_NO_THROW( {
+        std::shared_ptr<Nmea_Printer> nmea_printer = std::make_shared<Nmea_Printer>(filename, false, "");
+        nmea_printer->Print_Nmea_Line(pvt_solution, false);
+    } ) << "Failure printing NMEA messages.";
+
+    std::ifstream test_file(filename);
+    std::string line;
+    std::string GPRMC("$GPRMC");
+    if(test_file.is_open())
+        {
+            while(getline (test_file,line))
+                {
+                    std::size_t found = line.find(GPRMC);
+                    if (found != std::string::npos)
+                        {
+                            EXPECT_EQ(line, "$GPRMC,225446.000,A,4916.4500,N,12311.1199,W,0.00,0.00,191194,,*1c\r");
+                        }
+                }
+            test_file.close();
+        }
+    EXPECT_EQ(0, remove(filename.c_str())) << "Failure deleting a temporary file.";
+}
+
+
+
+TEST(NmeaPrinterTest, PrintLineLessthan10min)
+{
+    std::string filename("nmea_test.nmea");
+
+    std::shared_ptr<Pvt_Solution> pvt_solution = std::make_shared<Pvt_Solution>();
+
+    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
+    pvt_solution->set_position_UTC_time(pt);
+
+    arma::vec pos = {49.07416667, -123.02527778, 0};
+    pvt_solution->set_rx_pos(pos);
+
+    pvt_solution->set_valid_position(true);
+
+    ASSERT_NO_THROW( {
+        std::shared_ptr<Nmea_Printer> nmea_printer = std::make_shared<Nmea_Printer>(filename, false, "");
+        nmea_printer->Print_Nmea_Line(pvt_solution, false);
+    } ) << "Failure printing NMEA messages.";
+
+    std::ifstream test_file(filename);
+    std::string line;
+    std::string GPRMC("$GPRMC");
+    if(test_file.is_open())
+        {
+            while(getline (test_file,line))
+                {
+                    std::size_t found = line.find(GPRMC);
+                    if (found != std::string::npos)
+                        {
+                            EXPECT_EQ(line, "$GPRMC,225446.000,A,4904.4500,N,12301.5166,W,0.00,0.00,191194,,*1a\r");
+                        }
+                }
+            test_file.close();
+        }
+    EXPECT_EQ(0, remove(filename.c_str())) << "Failure deleting a temporary file.";
+}
diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc
index dfd62d5dd..fdf1d7d2c 100644
--- a/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc
@@ -33,7 +33,7 @@
 #include "rinex_printer.h"
 
 
-TEST(Rinex_Printer_Test, GalileoObsHeader)
+TEST(RinexPrinterTest, GalileoObsHeader)
 {
     std::string line_aux;
     std::string line_str;
@@ -89,7 +89,7 @@ TEST(Rinex_Printer_Test, GalileoObsHeader)
 
 
 
-TEST(Rinex_Printer_Test, MixedObsHeader)
+TEST(RinexPrinterTest, MixedObsHeader)
 {
     std::string line_aux;
     std::string line_aux2;
@@ -133,7 +133,7 @@ TEST(Rinex_Printer_Test, MixedObsHeader)
 }
 
 
-TEST(Rinex_Printer_Test, GalileoObsLog)
+TEST(RinexPrinterTest, GalileoObsLog)
 {
     std::string line_aux;
     std::string line_str;
@@ -158,10 +158,10 @@ TEST(Rinex_Printer_Test, GalileoObsLog)
     gs4.System = *sys.c_str();
 
     std::string sig = "1B";
-    std::memcpy((void*)gs1.Signal, sig.c_str(), 3);
-    std::memcpy((void*)gs2.Signal, sig.c_str(), 3);
-    std::memcpy((void*)gs3.Signal, sig.c_str(), 3);
-    std::memcpy((void*)gs4.Signal, sig.c_str(), 3);
+    std::memcpy(static_cast<void*>(gs1.Signal), sig.c_str(), 3);
+    std::memcpy(static_cast<void*>(gs2.Signal), sig.c_str(), 3);
+    std::memcpy(static_cast<void*>(gs3.Signal), sig.c_str(), 3);
+    std::memcpy(static_cast<void*>(gs4.Signal), sig.c_str(), 3);
 
     gs1.PRN = 3;
     gs2.PRN = 8;
@@ -201,7 +201,7 @@ TEST(Rinex_Printer_Test, GalileoObsLog)
 }
 
 
-TEST(Rinex_Printer_Test, GpsObsLogDualBand)
+TEST(RinexPrinterTest, GpsObsLogDualBand)
 {
     std::string line_aux;
     std::string line_str;
@@ -227,12 +227,12 @@ TEST(Rinex_Printer_Test, GpsObsLogDualBand)
     gs4.System = *sys.c_str();
 
     std::string sig = "1C";
-    std::memcpy((void*)gs1.Signal, sig.c_str(), 3);
-    std::memcpy((void*)gs2.Signal, sig.c_str(), 3);
+    std::memcpy(static_cast<void*>(gs1.Signal), sig.c_str(), 3);
+    std::memcpy(static_cast<void*>(gs2.Signal), sig.c_str(), 3);
 
     sig = "2S";
-    std::memcpy((void*)gs3.Signal, sig.c_str(), 3);
-    std::memcpy((void*)gs4.Signal, sig.c_str(), 3);
+    std::memcpy(static_cast<void*>(gs3.Signal), sig.c_str(), 3);
+    std::memcpy(static_cast<void*>(gs4.Signal), sig.c_str(), 3);
 
     gs1.PRN = 3;
     gs2.PRN = 8;
@@ -283,7 +283,7 @@ TEST(Rinex_Printer_Test, GpsObsLogDualBand)
 }
 
 
-TEST(Rinex_Printer_Test, GalileoObsLogDualBand)
+TEST(RinexPrinterTest, GalileoObsLogDualBand)
 {
     std::string line_aux;
     std::string line_str;
@@ -309,12 +309,12 @@ TEST(Rinex_Printer_Test, GalileoObsLogDualBand)
     gs4.System = *sys.c_str();
 
     std::string sig = "1B";
-    std::memcpy((void*)gs1.Signal, sig.c_str(), 3);
-    std::memcpy((void*)gs2.Signal, sig.c_str(), 3);
+    std::memcpy(static_cast<void*>(gs1.Signal), sig.c_str(), 3);
+    std::memcpy(static_cast<void*>(gs2.Signal), sig.c_str(), 3);
 
     sig = "5X";
-    std::memcpy((void*)gs3.Signal, sig.c_str(), 3);
-    std::memcpy((void*)gs4.Signal, sig.c_str(), 3);
+    std::memcpy(static_cast<void*>(gs3.Signal), sig.c_str(), 3);
+    std::memcpy(static_cast<void*>(gs4.Signal), sig.c_str(), 3);
 
     gs1.PRN = 3;
     gs2.PRN = 8;
@@ -365,7 +365,7 @@ TEST(Rinex_Printer_Test, GalileoObsLogDualBand)
 
 
 
-TEST(Rinex_Printer_Test, MixedObsLog)
+TEST(RinexPrinterTest, MixedObsLog)
 {
     std::string line_aux;
     std::string line_str;
@@ -401,18 +401,18 @@ TEST(Rinex_Printer_Test, MixedObsLog)
     gs8.System = *sys.c_str();
 
     std::string sig = "1C";
-    std::memcpy((void*)gs1.Signal, sig.c_str(), 3);
-    std::memcpy((void*)gs2.Signal, sig.c_str(), 3);
-    std::memcpy((void*)gs3.Signal, sig.c_str(), 3);
-    std::memcpy((void*)gs4.Signal, sig.c_str(), 3);
+    std::memcpy(static_cast<void*>(gs1.Signal), sig.c_str(), 3);
+    std::memcpy(static_cast<void*>(gs2.Signal), sig.c_str(), 3);
+    std::memcpy(static_cast<void*>(gs3.Signal), sig.c_str(), 3);
+    std::memcpy(static_cast<void*>(gs4.Signal), sig.c_str(), 3);
 
     sig = "5X";
-    std::memcpy((void*)gs5.Signal, sig.c_str(), 3);
-    std::memcpy((void*)gs6.Signal, sig.c_str(), 3);
+    std::memcpy(static_cast<void*>(gs5.Signal), sig.c_str(), 3);
+    std::memcpy(static_cast<void*>(gs6.Signal), sig.c_str(), 3);
 
     sig = "1B";
-    std::memcpy((void*)gs7.Signal, sig.c_str(), 3);
-    std::memcpy((void*)gs8.Signal, sig.c_str(), 3);
+    std::memcpy(static_cast<void*>(gs7.Signal), sig.c_str(), 3);
+    std::memcpy(static_cast<void*>(gs8.Signal), sig.c_str(), 3);
 
     gs1.PRN = 3;
     gs2.PRN = 8;
diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_printer_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_printer_test.cc
index 268c05630..13c28d711 100644
--- a/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_printer_test.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_printer_test.cc
@@ -37,7 +37,7 @@
 //#include "gps_ephemeris.h"
 
 
-TEST(Rtcm_Printer_Test, Instantiate)
+TEST(RtcmPrinterTest, Instantiate)
 {
     std::string filename = "hello.rtcm";
     bool flag_rtcm_tty_port = false;
@@ -49,7 +49,7 @@ TEST(Rtcm_Printer_Test, Instantiate)
 }
 
 
-TEST(Rtcm_Printer_Test, Run)
+TEST(RtcmPrinterTest, Run)
 {
     //    std::string file_name = "./gps_ephemeris_rx.xml";
     //    std::map<int,Gps_Ephemeris> gps_ephemeris_map;
@@ -61,7 +61,7 @@ TEST(Rtcm_Printer_Test, Run)
     //            xml >> boost::serialization::make_nvp("GNSS-SDR_ephemeris_map", gps_ephemeris_map);
     //            ifs.close();
     //    }
-    //    catch (std::exception& e)
+    //    catch (const std::exception& e)
     //    {
     //            //LOG(WARNING) << e.what() << "File: " << file_name;
     //            //std::cout << "File not found" << std::endl;
diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_test.cc
index 0680dbfc7..11bd5d7cc 100644
--- a/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_test.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_test.cc
@@ -34,7 +34,7 @@
 #include "rtcm.h"
 #include "Galileo_E1.h"
 
-TEST(Rtcm_Test, Hex_to_bin)
+TEST(RtcmTest, HexToBin)
 {
     auto rtcm = std::make_shared<Rtcm>();
 
@@ -64,7 +64,7 @@ TEST(Rtcm_Test, Hex_to_bin)
 }
 
 
-TEST(Rtcm_Test, Bin_to_hex)
+TEST(RtcmTest, BinToHex)
 {
     auto rtcm = std::make_shared<Rtcm>();
 
@@ -99,7 +99,7 @@ TEST(Rtcm_Test, Bin_to_hex)
 
 
 
-TEST(Rtcm_Test, Hex_to_int)
+TEST(RtcmTest, HexToInt)
 {
     auto rtcm = std::make_shared<Rtcm>();
 
@@ -110,7 +110,7 @@ TEST(Rtcm_Test, Hex_to_int)
 }
 
 
-TEST(Rtcm_Test, Hex_to_uint)
+TEST(RtcmTest, HexToUint)
 {
     auto rtcm = std::make_shared<Rtcm>();
     long unsigned int expected1 = 42;
@@ -118,7 +118,7 @@ TEST(Rtcm_Test, Hex_to_uint)
 }
 
 
-TEST(Rtcm_Test, Bin_to_double)
+TEST(RtcmTest, BinToDouble)
 {
     auto rtcm = std::make_shared<Rtcm>();
 
@@ -135,7 +135,7 @@ TEST(Rtcm_Test, Bin_to_double)
 }
 
 
-TEST(Rtcm_Test, Bin_to_uint)
+TEST(RtcmTest, BinToUint)
 {
     auto rtcm = std::make_shared<Rtcm>();
     long unsigned int expected1 = 42;
@@ -145,17 +145,17 @@ TEST(Rtcm_Test, Bin_to_uint)
 }
 
 
-TEST(Rtcm_Test, Bin_to_int)
+TEST(RtcmTest, BinToInt)
 {
     auto rtcm = std::make_shared<Rtcm>();
-    long unsigned int expected1 = 42;
+    long int expected1 = 42;
     EXPECT_EQ(expected1, rtcm->bin_to_int("00101010"));
-    long unsigned int expected2 = -42;
+    long int expected2 = -42;
     EXPECT_EQ(expected2, rtcm->bin_to_int("11010110"));
 }
 
 
-TEST(Rtcm_Test, Bin_to_binary_data)
+TEST(RtcmTest, BinToBinaryData)
 {
     auto rtcm = std::make_shared<Rtcm>();
     std::string bin_str("1101101011010110");
@@ -171,7 +171,7 @@ TEST(Rtcm_Test, Bin_to_binary_data)
 }
 
 
-TEST(Rtcm_Test, Check_CRC)
+TEST(RtcmTest, CheckCRC)
 {
     auto rtcm = std::make_shared<Rtcm>();
     bool expected_true = true;
@@ -186,7 +186,7 @@ TEST(Rtcm_Test, Check_CRC)
 }
 
 
-TEST(Rtcm_Test, MT1001)
+TEST(RtcmTest, MT1001)
 {
     auto rtcm = std::make_shared<Rtcm>();
     Gps_Ephemeris gps_eph = Gps_Ephemeris();
@@ -198,7 +198,7 @@ TEST(Rtcm_Test, MT1001)
 
     std::string sig = "1C";
     gnss_synchro.System = *sys.c_str();
-    std::memcpy((void*)gnss_synchro.Signal, sig.c_str(), 3);
+    std::memcpy(static_cast<void*>(gnss_synchro.Signal), sig.c_str(), 3);
     gnss_synchro.Pseudorange_m = 20000000.0;
     double obs_time = 25.0;
     std::map<int, Gnss_Synchro> pseudoranges;
@@ -209,7 +209,7 @@ TEST(Rtcm_Test, MT1001)
 }
 
 
-TEST(Rtcm_Test, MT1005)
+TEST(RtcmTest, MT1005)
 {
     auto rtcm = std::make_shared<Rtcm>();
     std::string reference_msg = rtcm->print_MT1005_test();
@@ -232,7 +232,7 @@ TEST(Rtcm_Test, MT1005)
     EXPECT_EQ(expected_false, glonass);
     EXPECT_EQ(expected_false, galileo);
 
-    EXPECT_EQ(2003, ref_id);
+    EXPECT_EQ(static_cast<unsigned int>(2003), ref_id);
     EXPECT_DOUBLE_EQ(1114104.5999, ecef_x);
     EXPECT_DOUBLE_EQ(-4850729.7108, ecef_y);
     EXPECT_DOUBLE_EQ(3975521.4643, ecef_z);
@@ -246,15 +246,14 @@ TEST(Rtcm_Test, MT1005)
     EXPECT_EQ(expected_false, glonass);
     EXPECT_EQ(expected_false, galileo);
 
-    EXPECT_EQ(2003, ref_id);
+    EXPECT_EQ(static_cast<unsigned int>(2003), ref_id);
     EXPECT_DOUBLE_EQ(1114104.5999, ecef_x);
     EXPECT_DOUBLE_EQ(-4850729.7108, ecef_y);
     EXPECT_DOUBLE_EQ(3975521.4643, ecef_z);
 }
 
 
-
-TEST(Rtcm_Test, MT1019)
+TEST(RtcmTest, MT1019)
 {
     auto rtcm = std::make_shared<Rtcm>();
     bool expected_true = true;
@@ -269,7 +268,7 @@ TEST(Rtcm_Test, MT1019)
     std::string tx_msg = rtcm->print_MT1019(gps_eph);
 
     EXPECT_EQ(0, rtcm->read_MT1019(tx_msg, gps_eph_read));
-    EXPECT_EQ(3, gps_eph_read.i_satellite_PRN);
+    EXPECT_EQ(static_cast<unsigned int>(3), gps_eph_read.i_satellite_PRN);
     EXPECT_DOUBLE_EQ(4, gps_eph_read.d_IODC);
     EXPECT_DOUBLE_EQ( 2.0 * E_LSB, gps_eph_read.d_e_eccentricity);
     EXPECT_EQ(expected_true, gps_eph_read.b_fit_interval_flag);
@@ -277,7 +276,7 @@ TEST(Rtcm_Test, MT1019)
 }
 
 
-TEST(Rtcm_Test, MT1029)
+TEST(RtcmTest, MT1029)
 {
     auto rtcm = std::make_shared<Rtcm>();
     std::string s_test("UTF-8 проверка wörter");
@@ -295,7 +294,7 @@ TEST(Rtcm_Test, MT1029)
 }
 
 
-TEST(Rtcm_Test, MT1045)
+TEST(RtcmTest, MT1045)
 {
     auto rtcm = std::make_shared<Rtcm>();
     bool expected_true = true;
@@ -312,12 +311,12 @@ TEST(Rtcm_Test, MT1045)
     EXPECT_EQ(0, rtcm->read_MT1045(tx_msg, gal_eph_read));
     EXPECT_EQ(expected_true, gal_eph_read.E5a_DVS);
     EXPECT_DOUBLE_EQ( 53.0 * OMEGA_dot_3_LSB, gal_eph_read.OMEGA_dot_3);
-    EXPECT_EQ(5, gal_eph_read.i_satellite_PRN);
+    EXPECT_EQ(static_cast<unsigned int>(5), gal_eph_read.i_satellite_PRN);
     EXPECT_EQ(1, rtcm->read_MT1045(rtcm->bin_to_binary_data(rtcm->hex_to_bin("FFFFFFFFFFF")), gal_eph_read));
 }
 
 
-TEST(Rtcm_Test, MSMCell)
+TEST(RtcmTest, MSMCell)
 {
     auto rtcm = std::make_shared<Rtcm>();
     Gps_Ephemeris gps_eph = Gps_Ephemeris();
@@ -349,11 +348,11 @@ TEST(Rtcm_Test, MSMCell)
     gnss_synchro4.System = *gal.c_str();
     gnss_synchro5.System = *gps.c_str();
 
-    std::memcpy((void*)gnss_synchro.Signal, x5.c_str(), 3);
-    std::memcpy((void*)gnss_synchro2.Signal, s2.c_str(), 3);
-    std::memcpy((void*)gnss_synchro3.Signal, c1.c_str(), 3);
-    std::memcpy((void*)gnss_synchro4.Signal, x5.c_str(), 3);
-    std::memcpy((void*)gnss_synchro5.Signal, c1.c_str(), 3);
+    std::memcpy(static_cast<void*>(gnss_synchro.Signal), x5.c_str(), 3);
+    std::memcpy(static_cast<void*>(gnss_synchro2.Signal), s2.c_str(), 3);
+    std::memcpy(static_cast<void*>(gnss_synchro3.Signal), c1.c_str(), 3);
+    std::memcpy(static_cast<void*>(gnss_synchro4.Signal), x5.c_str(), 3);
+    std::memcpy(static_cast<void*>(gnss_synchro5.Signal), c1.c_str(), 3);
 
     gnss_synchro.Pseudorange_m = 20000000.0;
     gnss_synchro2.Pseudorange_m = 20001010.0;
@@ -420,7 +419,7 @@ TEST(Rtcm_Test, MSMCell)
     Gnss_Synchro gnss_synchro6;
     gnss_synchro6.PRN = 10;
     gnss_synchro6.System = *gps.c_str();
-    std::memcpy((void*)gnss_synchro6.Signal, s2.c_str(), 3);
+    std::memcpy(static_cast<void*>(gnss_synchro6.Signal), s2.c_str(), 3);
     gnss_synchro6.Pseudorange_m = 24000000.0;
 
     std::map<int, Gnss_Synchro> pseudoranges3;
@@ -446,7 +445,7 @@ TEST(Rtcm_Test, MSMCell)
 }
 
 
-TEST(Rtcm_Test, MSM1)
+TEST(RtcmTest, MSM1)
 {
     auto rtcm = std::make_shared<Rtcm>();
     bool expected_true = true;
@@ -473,10 +472,10 @@ TEST(Rtcm_Test, MSM1)
     gnss_synchro3.System = *sys.c_str();
     gnss_synchro4.System = *sys.c_str();
 
-    std::memcpy((void*)gnss_synchro.Signal, sig.c_str(), 3);
-    std::memcpy((void*)gnss_synchro2.Signal, sig.c_str(), 3);
-    std::memcpy((void*)gnss_synchro3.Signal, sig2.c_str(), 3);
-    std::memcpy((void*)gnss_synchro4.Signal, sig2.c_str(), 3);
+    std::memcpy(static_cast<void*>(gnss_synchro.Signal), sig.c_str(), 3);
+    std::memcpy(static_cast<void*>(gnss_synchro2.Signal), sig.c_str(), 3);
+    std::memcpy(static_cast<void*>(gnss_synchro3.Signal), sig2.c_str(), 3);
+    std::memcpy(static_cast<void*>(gnss_synchro4.Signal), sig2.c_str(), 3);
 
     gnss_synchro.Pseudorange_m = 20000000.0;
     gnss_synchro2.Pseudorange_m = 20001010.0;
@@ -561,7 +560,7 @@ TEST(Rtcm_Test, MSM1)
 }
 
 
-TEST(Rtcm_Test, InstantiateServer)
+TEST(RtcmTest, InstantiateServer)
 {
     auto rtcm = std::make_shared<Rtcm>();
     rtcm->run_server();
@@ -585,7 +584,7 @@ TEST(Rtcm_Test, InstantiateServer)
 }
 
 
-TEST(Rtcm_Test, InstantiateServerWithoutClosing)
+TEST(RtcmTest, InstantiateServerWithoutClosing)
 {
     auto rtcm = std::make_shared<Rtcm>();
     rtcm->run_server();
diff --git a/src/tests/unit-tests/signal-processing-blocks/resampler/direct_resampler_conditioner_cc_test.cc b/src/tests/unit-tests/signal-processing-blocks/resampler/direct_resampler_conditioner_cc_test.cc
index 017d7bace..fc05039d0 100644
--- a/src/tests/unit-tests/signal-processing-blocks/resampler/direct_resampler_conditioner_cc_test.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/resampler/direct_resampler_conditioner_cc_test.cc
@@ -32,7 +32,7 @@
  */
 
 
-#include <ctime>
+#include <chrono>
 #include <iostream>
 #include <gnuradio/top_block.h>
 #include <gnuradio/analog/sig_source_waveform.h>
@@ -43,18 +43,17 @@
 #include "direct_resampler_conditioner_cc.h"
 
 
-TEST(Direct_Resampler_Conditioner_Cc_Test, InstantiationAndRunTest)
+TEST(DirectResamplerConditionerCcTest, InstantiationAndRunTest)
 {
     double fs_in = 8000000.0; // Input sampling frequency in Hz
     double fs_out = 4000000.0; // sampling freuqncy of the resampled signal in Hz
-    struct timeval tv;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
     int nsamples = 1000000; //Number of samples to be computed
     gr::msg_queue::sptr queue = gr::msg_queue::make(0);
     gr::top_block_sptr top_block = gr::make_top_block("direct_resampler_conditioner_cc_test");
     boost::shared_ptr<gr::analog::sig_source_c> source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000.0, 1.0, gr_complex(0.0));
     boost::shared_ptr<gr::block> valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue);
-    long long int begin = 0;
-    long long int end = 0;
 
     EXPECT_NO_THROW({
         direct_resampler_conditioner_cc_sptr resampler = direct_resampler_make_conditioner_cc(fs_in, fs_out);
@@ -70,13 +69,12 @@ TEST(Direct_Resampler_Conditioner_Cc_Test, InstantiationAndRunTest)
     }) << "Connection failure of direct_resampler_conditioner.";
 
     EXPECT_NO_THROW( {
-        gettimeofday(&tv, NULL);
-        begin = tv.tv_sec *1000000 + tv.tv_usec;
+        start = std::chrono::system_clock::now();
         top_block->run(); // Start threads and wait
-        gettimeofday(&tv, NULL);
-        end = tv.tv_sec *1000000 + tv.tv_usec;
+        end = std::chrono::system_clock::now();
+        elapsed_seconds = end - start;
         top_block->stop();
     }) << "Failure running direct_resampler_conditioner.";
 
-    std::cout <<  "Resampled " << nsamples << " samples in " << (end-begin) << " microseconds" << std::endl;
+    std::cout <<  "Resampled " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
 }
diff --git a/src/tests/unit-tests/signal-processing-blocks/sources/gnss_sdr_valve_test.cc b/src/tests/unit-tests/signal-processing-blocks/sources/gnss_sdr_valve_test.cc
index 55886c56c..19ba9c2e5 100644
--- a/src/tests/unit-tests/signal-processing-blocks/sources/gnss_sdr_valve_test.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/sources/gnss_sdr_valve_test.cc
@@ -38,7 +38,7 @@
 #include <gnuradio/msg_queue.h>
 #include "gnss_sdr_valve.h"
 
-TEST(Valve_Test, CheckEventSentAfter100Samples)
+TEST(ValveTest, CheckEventSentAfter100Samples)
 {
     gr::msg_queue::sptr queue = gr::msg_queue::make(0);
 
diff --git a/src/tests/unit-tests/signal-processing-blocks/sources/unpack_2bit_samples_test.cc b/src/tests/unit-tests/signal-processing-blocks/sources/unpack_2bit_samples_test.cc
index 9d7dfefed..683388e25 100644
--- a/src/tests/unit-tests/signal-processing-blocks/sources/unpack_2bit_samples_test.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/sources/unpack_2bit_samples_test.cc
@@ -79,7 +79,7 @@ std::vector< uint8_t > packData( std::vector< int8_t > const & raw_data,
 
 }
 
-TEST(Unpack_2bit_Samples_Test, CheckBigEndianByte)
+TEST(Unpack2bitSamplesTest, CheckBigEndianByte)
 {
     bool big_endian_bytes = true;
     size_t item_size = 1;
@@ -90,13 +90,13 @@ TEST(Unpack_2bit_Samples_Test, CheckBigEndianByte)
     std::vector< uint8_t > packed_data = packData( raw_data, big_endian_bytes );
     std::vector< uint8_t > unpacked_data;
 
-    gr::top_block_sptr top_block = gr::make_top_block("unpack_2bit_samples_test");
+    gr::top_block_sptr top_block = gr::make_top_block("Unpack2bitSamplesTest");
 
-    gr::blocks::vector_source_b::sptr source = 
+    gr::blocks::vector_source_b::sptr source =
         gr::blocks::vector_source_b::make( packed_data );
 
-    
-    boost::shared_ptr<gr::block> unpacker = 
+
+    boost::shared_ptr<gr::block> unpacker =
         make_unpack_2bit_samples(big_endian_bytes,
                                  item_size,
                                  big_endian_items );
@@ -104,7 +104,7 @@ TEST(Unpack_2bit_Samples_Test, CheckBigEndianByte)
     gr::blocks::stream_to_vector::sptr stov =
         gr::blocks::stream_to_vector::make( item_size, raw_data.size() );
 
-    gr::blocks::vector_sink_b::sptr sink = 
+    gr::blocks::vector_sink_b::sptr sink =
         gr::blocks::vector_sink_b::make( raw_data.size() );
 
 
@@ -126,7 +126,7 @@ TEST(Unpack_2bit_Samples_Test, CheckBigEndianByte)
 
 }
 
-TEST(Unpack_2bit_Samples_Test, CheckLittleEndianByte)
+TEST(Unpack2bitSamplesTest, CheckLittleEndianByte)
 {
     bool big_endian_bytes = false;
     size_t item_size = 1;
@@ -137,13 +137,13 @@ TEST(Unpack_2bit_Samples_Test, CheckLittleEndianByte)
     std::vector< uint8_t > packed_data = packData( raw_data, big_endian_bytes );
     std::vector< uint8_t > unpacked_data;
 
-    gr::top_block_sptr top_block = gr::make_top_block("unpack_2bit_samples_test");
+    gr::top_block_sptr top_block = gr::make_top_block("Unpack2bitSamplesTest");
 
-    gr::blocks::vector_source_b::sptr source = 
+    gr::blocks::vector_source_b::sptr source =
         gr::blocks::vector_source_b::make( packed_data );
 
-    
-    boost::shared_ptr<gr::block> unpacker = 
+
+    boost::shared_ptr<gr::block> unpacker =
         make_unpack_2bit_samples(big_endian_bytes,
                                  item_size,
                                  big_endian_items );
@@ -151,7 +151,7 @@ TEST(Unpack_2bit_Samples_Test, CheckLittleEndianByte)
     gr::blocks::stream_to_vector::sptr stov =
         gr::blocks::stream_to_vector::make( item_size, raw_data.size() );
 
-    gr::blocks::vector_sink_b::sptr sink = 
+    gr::blocks::vector_sink_b::sptr sink =
         gr::blocks::vector_sink_b::make( raw_data.size() );
 
 
@@ -173,7 +173,7 @@ TEST(Unpack_2bit_Samples_Test, CheckLittleEndianByte)
 
 }
 
-TEST(Unpack_2bit_Samples_Test, CheckBigEndianShortBigEndianByte)
+TEST(Unpack2bitSamplesTest, CheckBigEndianShortBigEndianByte)
 {
     bool big_endian_bytes = true;
     size_t item_size = 2;
@@ -199,19 +199,19 @@ TEST(Unpack_2bit_Samples_Test, CheckBigEndianShortBigEndianByte)
 
     // Now create a new big endian buffer:
     std::vector< int16_t > packed_data_short(
-            reinterpret_cast< int16_t *>( &packed_data[0] ), 
-            reinterpret_cast< int16_t * >( &packed_data[0] ) 
+            reinterpret_cast< int16_t *>( &packed_data[0] ),
+            reinterpret_cast< int16_t * >( &packed_data[0] )
             + packed_data.size()/item_size);
-    
+
     std::vector< uint8_t > unpacked_data;
 
-    gr::top_block_sptr top_block = gr::make_top_block("unpack_2bit_samples_test");
+    gr::top_block_sptr top_block = gr::make_top_block("Unpack2bitSamplesTest");
 
-    gr::blocks::vector_source_s::sptr source = 
+    gr::blocks::vector_source_s::sptr source =
         gr::blocks::vector_source_s::make( packed_data_short );
 
-    
-    boost::shared_ptr<gr::block> unpacker = 
+
+    boost::shared_ptr<gr::block> unpacker =
         make_unpack_2bit_samples(big_endian_bytes,
                                  item_size,
                                  big_endian_items );
@@ -219,7 +219,7 @@ TEST(Unpack_2bit_Samples_Test, CheckBigEndianShortBigEndianByte)
     gr::blocks::stream_to_vector::sptr stov =
         gr::blocks::stream_to_vector::make( 1, raw_data.size() );
 
-    gr::blocks::vector_sink_b::sptr sink = 
+    gr::blocks::vector_sink_b::sptr sink =
         gr::blocks::vector_sink_b::make( raw_data.size() );
 
 
@@ -241,7 +241,7 @@ TEST(Unpack_2bit_Samples_Test, CheckBigEndianShortBigEndianByte)
 
 }
 
-TEST(Unpack_2bit_Samples_Test, CheckBigEndianShortLittleEndianByte)
+TEST(Unpack2bitSamplesTest, CheckBigEndianShortLittleEndianByte)
 {
     bool big_endian_bytes = false;
     size_t item_size = 2;
@@ -267,19 +267,19 @@ TEST(Unpack_2bit_Samples_Test, CheckBigEndianShortLittleEndianByte)
 
     // Now create a new big endian buffer:
     std::vector< int16_t > packed_data_short(
-            reinterpret_cast< int16_t *>( &packed_data[0] ), 
-            reinterpret_cast< int16_t * >( &packed_data[0] ) 
+            reinterpret_cast< int16_t *>( &packed_data[0] ),
+            reinterpret_cast< int16_t * >( &packed_data[0] )
             + packed_data.size()/item_size);
-    
+
     std::vector< uint8_t > unpacked_data;
 
-    gr::top_block_sptr top_block = gr::make_top_block("unpack_2bit_samples_test");
+    gr::top_block_sptr top_block = gr::make_top_block("Unpack2bitSamplesTest");
 
-    gr::blocks::vector_source_s::sptr source = 
+    gr::blocks::vector_source_s::sptr source =
         gr::blocks::vector_source_s::make( packed_data_short );
 
-    
-    boost::shared_ptr<gr::block> unpacker = 
+
+    boost::shared_ptr<gr::block> unpacker =
         make_unpack_2bit_samples(big_endian_bytes,
                                  item_size,
                                  big_endian_items );
@@ -287,7 +287,7 @@ TEST(Unpack_2bit_Samples_Test, CheckBigEndianShortLittleEndianByte)
     gr::blocks::stream_to_vector::sptr stov =
         gr::blocks::stream_to_vector::make( 1, raw_data.size() );
 
-    gr::blocks::vector_sink_b::sptr sink = 
+    gr::blocks::vector_sink_b::sptr sink =
         gr::blocks::vector_sink_b::make( raw_data.size() );
 
 
diff --git a/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc b/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc
index 8d2f75fbb..c75139ff6 100644
--- a/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc
@@ -30,15 +30,11 @@
  * -------------------------------------------------------------------------
  */
 
-
-#include <exception>
-#include <cstring>
-#include <ctime>
-#include <iostream>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/wait.h>
 #include <unistd.h>
+#include <chrono>
+#include <exception>
+#include <iostream>
+#include <string>
 #include <armadillo>
 #include <gnuradio/top_block.h>
 #include <gnuradio/blocks/file_source.h>
@@ -183,17 +179,17 @@ public:
     std::string p4;
     std::string p5;
 
-    const int baseband_sampling_freq = FLAGS_fs_gen_hz;
+    const int baseband_sampling_freq = FLAGS_fs_gen_sps;
 
     std::string filename_rinex_obs = FLAGS_filename_rinex_obs;
     std::string filename_raw_data = FLAGS_filename_raw_data;
 
     int configure_generator();
     int generate_signal();
-    void check_results(arma::vec true_time_s,
-            arma::vec true_value,
-            arma::vec meas_time_s,
-            arma::vec meas_value);
+    void check_results(arma::vec & true_time_s,
+            arma::vec & true_value,
+            arma::vec & meas_time_s,
+            arma::vec & meas_value);
 
     GpsL1CATelemetryDecoderTest()
     {
@@ -215,6 +211,7 @@ public:
     size_t item_size;
 };
 
+
 int GpsL1CATelemetryDecoderTest::configure_generator()
 {
     // Configure signal generator
@@ -267,7 +264,7 @@ void GpsL1CATelemetryDecoderTest::configure_receiver()
     signal.copy(gnss_synchro.Signal, 2, 0);
     gnss_synchro.PRN = FLAGS_test_satellite_PRN;
 
-    config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(baseband_sampling_freq));
+    config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(baseband_sampling_freq));
 
     // Set Tracking
     config->set_property("Tracking_1C.item_type", "gr_complex");
@@ -279,24 +276,29 @@ void GpsL1CATelemetryDecoderTest::configure_receiver()
     config->set_property("Tracking_1C.early_late_space_chips", "0.5");
 
     config->set_property("TelemetryDecoder_1C.dump","true");
-    config->set_property("TelemetryDecoder_1C.decimation_factor","1");
-
 }
 
-void GpsL1CATelemetryDecoderTest::check_results(arma::vec true_time_s,
-        arma::vec true_value,
-        arma::vec meas_time_s,
-        arma::vec meas_value)
+
+void GpsL1CATelemetryDecoderTest::check_results(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;
+    arma::uvec true_time_s_valid = find(true_time_s > 0);
+    true_time_s = true_time_s(true_time_s_valid);
+    true_value = true_value(true_time_s_valid);
+    arma::uvec meas_time_s_valid = find(meas_time_s > 0);
+    meas_time_s = meas_time_s(meas_time_s_valid);
+    meas_value = meas_value(meas_time_s_valid);
+
     arma::interp1(true_time_s, true_value, meas_time_s, true_value_interp);
 
     //2. RMSE
     arma::vec err;
 
-    err = meas_value - true_value_interp;
+    err = meas_value - true_value_interp + 0.001;
     arma::vec err2 = arma::square(err);
     double rmse = sqrt(arma::mean(err2));
 
@@ -309,13 +311,14 @@ void GpsL1CATelemetryDecoderTest::check_results(arma::vec true_time_s,
     double min_error = arma::min(err);
 
     //5. report
-
+    std::streamsize ss = std::cout.precision();
     std::cout << std::setprecision(10) << "TLM TOW RMSE="
               << rmse << ", mean=" << error_mean
               << ", stdev=" << sqrt(error_var)
               << " (max,min)=" << max_error
               << "," << min_error
               << " [Seconds]" << std::endl;
+    std::cout.precision (ss);
 
     ASSERT_LT(rmse, 0.2E-6);
     ASSERT_LT(error_mean, 0.2E-6);
@@ -325,20 +328,20 @@ void GpsL1CATelemetryDecoderTest::check_results(arma::vec true_time_s,
     ASSERT_GT(min_error, -0.5E-6);
 }
 
+
 TEST_F(GpsL1CATelemetryDecoderTest, ValidationOfResults)
 {
     // Configure the signal generator
     configure_generator();
 
     // Generate signal raw signal samples and observations RINEX file
-    if (FLAGS_disable_generator==false)
-    {
-        generate_signal();
-    }
+    if (FLAGS_disable_generator == false)
+        {
+            generate_signal();
+        }
 
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
 
     configure_receiver();
 
@@ -411,11 +414,10 @@ TEST_F(GpsL1CATelemetryDecoderTest, ValidationOfResults)
     tracking->start_tracking();
 
     EXPECT_NO_THROW( {
-        gettimeofday(&tv, NULL);
-        begin = tv.tv_sec * 1000000 + tv.tv_usec;
+        start = std::chrono::system_clock::now();
         top_block->run(); // Start threads and wait
-        gettimeofday(&tv, NULL);
-        end = tv.tv_sec * 1000000 + tv.tv_usec;
+        end = std::chrono::system_clock::now();
+        elapsed_seconds = end - start;
     }) << "Failure running the top_block." << std::endl;
 
     //check results
@@ -459,7 +461,7 @@ TEST_F(GpsL1CATelemetryDecoderTest, ValidationOfResults)
     epoch_counter = 0;
     while(tlm_dump.read_binary_obs())
     {
-        tlm_timestamp_s(epoch_counter) = (double)tlm_dump.Tracking_sample_counter/(double)baseband_sampling_freq;
+        tlm_timestamp_s(epoch_counter) = static_cast<double>(tlm_dump.Tracking_sample_counter) / static_cast<double>(baseband_sampling_freq);
         tlm_TOW_at_Preamble(epoch_counter) = tlm_dump.d_TOW_at_Preamble;
         tlm_tow_s(epoch_counter) = tlm_dump.TOW_at_current_symbol;
         epoch_counter++;
@@ -467,12 +469,12 @@ TEST_F(GpsL1CATelemetryDecoderTest, ValidationOfResults)
 
     //Cut measurement initial transitory of the measurements
     arma::uvec initial_meas_point = arma::find(tlm_tow_s >= true_tow_s(0), 1, "first");
-
+    ASSERT_EQ(initial_meas_point.is_empty(), false);
     tlm_timestamp_s = tlm_timestamp_s.subvec(initial_meas_point(0), tlm_timestamp_s.size() - 1);
     tlm_tow_s = tlm_tow_s.subvec(initial_meas_point(0), tlm_tow_s.size() - 1);
 
     check_results(true_timestamp_s, true_tow_s, tlm_timestamp_s, tlm_tow_s);
 
-    std::cout <<  "Test completed in " << (end - begin) << " microseconds" << std::endl;
+    std::cout <<  "Test completed in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
 }
 
diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc
new file mode 100644
index 000000000..ef3c2a293
--- /dev/null
+++ b/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc
@@ -0,0 +1,173 @@
+/*!
+ * \file cpu_multicorrelator_real_codes_test.cc
+ * \brief  This file implements timing tests for the FFT.
+ * \author Carles Fernandez-Prades, 2016. cfernandez(at)cttc.es
+ *
+ *
+ * -------------------------------------------------------------------------
+ *
+ * Copyright (C) 2010-2016  (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 <http://www.gnu.org/licenses/>.
+ *
+ * -------------------------------------------------------------------------
+ */
+
+#include <chrono>
+#include <complex>
+#include <random>
+#include <thread>
+#include <gtest/gtest.h>
+#include <gflags/gflags.h>
+#include <gnuradio/gr_complex.h>
+#include <volk_gnsssdr/volk_gnsssdr.h>
+#include "cpu_multicorrelator_real_codes.h"
+#include "gps_sdr_signal_processing.h"
+#include "GPS_L1_CA.h"
+
+
+DEFINE_int32(cpu_multicorrelator_real_codes_iterations_test, 1000, "Number of averaged iterations in CPU multicorrelator test timing test");
+DEFINE_int32(cpu_multicorrelator_real_codes_max_threads_test, 12, "Number of maximum concurrent correlators in CPU multicorrelator test timing test");
+
+void run_correlator_cpu_real_codes(cpu_multicorrelator_real_codes* correlator,
+                    float d_rem_carrier_phase_rad,
+                    float d_carrier_phase_step_rad,
+                    float d_code_phase_step_chips,
+                    float d_rem_code_phase_chips,
+                    int correlation_size)
+{
+    for(int k = 0; k < FLAGS_cpu_multicorrelator_real_codes_iterations_test; k++)
+        {
+            correlator->Carrier_wipeoff_multicorrelator_resampler(d_rem_carrier_phase_rad,
+                    d_carrier_phase_step_rad,
+                    d_code_phase_step_chips,
+                    d_rem_code_phase_chips,
+                    correlation_size);
+        }
+}
+
+
+TEST(CpuMulticorrelatorRealCodesTest, MeasureExecutionTime)
+{
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
+    int max_threads = FLAGS_cpu_multicorrelator_real_codes_max_threads_test;
+    std::vector<std::thread> thread_pool;
+    cpu_multicorrelator_real_codes* correlator_pool[max_threads];
+    unsigned int correlation_sizes [3] = { 2048, 4096, 8192};
+    double execution_times [3];
+
+    float* d_ca_code;
+    gr_complex* in_cpu;
+    gr_complex* d_correlator_outs;
+
+    int d_n_correlator_taps = 3;
+    int d_vector_length = correlation_sizes[2]; //max correlation size to allocate all the necessary memory
+    float* d_local_code_shift_chips;
+
+    //allocate host memory
+    // Get space for a vector with the C/A code replica sampled 1x/chip
+    d_ca_code = static_cast<float*>(volk_gnsssdr_malloc(static_cast<int>(GPS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(float), volk_gnsssdr_get_alignment()));
+    in_cpu = static_cast<gr_complex*>(volk_gnsssdr_malloc(2 * d_vector_length * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
+
+    // correlator outputs (scalar)
+    d_n_correlator_taps = 3; // Early, Prompt, and Late
+    d_correlator_outs = static_cast<gr_complex*>(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<float*>(volk_gnsssdr_malloc(d_n_correlator_taps*sizeof(float), volk_gnsssdr_get_alignment()));
+    // Set TAPs delay values [chips]
+    float d_early_late_spc_chips = 0.5;
+    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;
+
+    //--- Perform initializations ------------------------------
+
+    //local code resampler on GPU
+    // generate local reference (1 sample per chip)
+    gps_l1_ca_code_gen_float(d_ca_code, 1, 0);
+    // generate inut signal
+    std::random_device r;
+    std::default_random_engine e1(r());
+    std::uniform_real_distribution<float> uniform_dist(0, 1);
+    for (int n = 0; n < 2 * d_vector_length; n++)
+        {
+            in_cpu[n] = std::complex<float>(uniform_dist(e1), uniform_dist(e1));
+        }
+
+    for (int n = 0; n < max_threads; n++)
+        {
+            correlator_pool[n] = new cpu_multicorrelator_real_codes();
+            correlator_pool[n]->init(d_vector_length, d_n_correlator_taps);
+            correlator_pool[n]->set_input_output_vectors(d_correlator_outs, in_cpu);
+            correlator_pool[n]->set_local_code_and_taps(static_cast<int>(GPS_L1_CA_CODE_LENGTH_CHIPS), d_ca_code, d_local_code_shift_chips);
+        }
+
+    float d_rem_carrier_phase_rad = 0.0;
+    float d_carrier_phase_step_rad = 0.1;
+    float d_code_phase_step_chips = 0.3;
+    float d_rem_code_phase_chips = 0.4;
+
+    EXPECT_NO_THROW(
+            for(int correlation_sizes_idx = 0; correlation_sizes_idx < 3; correlation_sizes_idx++)
+                {
+                    for(int current_max_threads = 1; current_max_threads < (max_threads+1); current_max_threads++)
+                        {
+                            std::cout << "Running " << current_max_threads << " concurrent correlators" << std::endl;
+                            start = std::chrono::system_clock::now();
+                            //create the concurrent correlator threads
+                            for (int current_thread = 0; current_thread < current_max_threads; current_thread++)
+                                {
+                                    thread_pool.push_back(std::thread(run_correlator_cpu_real_codes,
+                                            correlator_pool[current_thread],
+                                            d_rem_carrier_phase_rad,
+                                            d_carrier_phase_step_rad,
+                                            d_code_phase_step_chips,
+                                            d_rem_code_phase_chips,
+                                            correlation_sizes[correlation_sizes_idx]));
+                                }
+                            //wait the threads to finish they work and destroy the thread objects
+                            for(auto &t : thread_pool)
+                                {
+                                    t.join();
+                                }
+                            thread_pool.clear();
+                            end = std::chrono::system_clock::now();
+                            elapsed_seconds = end - start;
+                            execution_times[correlation_sizes_idx] = elapsed_seconds.count() / static_cast<double>(FLAGS_cpu_multicorrelator_real_codes_iterations_test);
+                            std::cout << "CPU Multicorrelator (real codes) execution time for length=" << correlation_sizes[correlation_sizes_idx]
+                                      << " : " << execution_times[correlation_sizes_idx] << " [s]" << std::endl;
+                        }
+                }
+    );
+
+    volk_gnsssdr_free(d_local_code_shift_chips);
+    volk_gnsssdr_free(d_correlator_outs);
+    volk_gnsssdr_free(d_ca_code);
+    volk_gnsssdr_free(in_cpu);
+
+    for (int n = 0; n < max_threads; n++)
+        {
+            correlator_pool[n]->free();
+        }
+}
+
diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_test.cc
index e567953c5..661b0a19e 100644
--- a/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_test.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_test.cc
@@ -29,9 +29,13 @@
  * -------------------------------------------------------------------------
  */
 
-#include <ctime>
+#include <chrono>
 #include <complex>
+#include <random>
 #include <thread>
+#include <gtest/gtest.h>
+#include <gflags/gflags.h>
+#include <gnuradio/gr_complex.h>
 #include <volk_gnsssdr/volk_gnsssdr.h>
 #include "cpu_multicorrelator.h"
 #include "gps_sdr_signal_processing.h"
@@ -49,19 +53,21 @@ void run_correlator_cpu(cpu_multicorrelator* correlator,
                     int correlation_size)
 {
     for(int k = 0; k < FLAGS_cpu_multicorrelator_iterations_test; k++)
-    {
-        correlator->Carrier_wipeoff_multicorrelator_resampler(d_rem_carrier_phase_rad,
-                                                                   d_carrier_phase_step_rad,
-                                                                   d_code_phase_step_chips,
-                                                                   d_rem_code_phase_chips,
-                                                                   correlation_size);
-    }
+        {
+            correlator->Carrier_wipeoff_multicorrelator_resampler(d_rem_carrier_phase_rad,
+                    d_carrier_phase_step_rad,
+                    d_code_phase_step_chips,
+                    d_rem_code_phase_chips,
+                    correlation_size);
+        }
 }
 
-TEST(CPU_multicorrelator_test, MeasureExecutionTime)
+
+TEST(CpuMulticorrelatorTest, MeasureExecutionTime)
 {
-    struct timeval tv;
-    int max_threads=FLAGS_cpu_multicorrelator_max_threads_test;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
+    int max_threads = FLAGS_cpu_multicorrelator_max_threads_test;
     std::vector<std::thread> thread_pool;
     cpu_multicorrelator* correlator_pool[max_threads];
     unsigned int correlation_sizes [3] = { 2048, 4096, 8192};
@@ -71,8 +77,8 @@ TEST(CPU_multicorrelator_test, MeasureExecutionTime)
     gr_complex* in_cpu;
     gr_complex* d_correlator_outs;
 
-    int d_n_correlator_taps=3;
-    int d_vector_length=correlation_sizes[2]; //max correlation size to allocate all the necessary memory
+    int d_n_correlator_taps = 3;
+    int d_vector_length = correlation_sizes[2]; //max correlation size to allocate all the necessary memory
     float* d_local_code_shift_chips;
 
     //allocate host memory
@@ -84,12 +90,12 @@ TEST(CPU_multicorrelator_test, MeasureExecutionTime)
     d_n_correlator_taps = 3; // Early, Prompt, and Late
     d_correlator_outs = static_cast<gr_complex*>(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_correlator_outs[n] = gr_complex(0,0);
+        }
     d_local_code_shift_chips = static_cast<float*>(volk_gnsssdr_malloc(d_n_correlator_taps*sizeof(float), volk_gnsssdr_get_alignment()));
     // Set TAPs delay values [chips]
-    float d_early_late_spc_chips=0.5;
+    float d_early_late_spc_chips = 0.5;
     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;
@@ -100,65 +106,68 @@ TEST(CPU_multicorrelator_test, MeasureExecutionTime)
     // generate local reference (1 sample per chip)
     gps_l1_ca_code_gen_complex(d_ca_code, 1, 0);
     // generate inut signal
-    for (int n=0;n<2*d_vector_length;n++)
-    {
-        in_cpu[n]=std::complex<float>(static_cast <float> (rand())/static_cast<float>(RAND_MAX),static_cast <float> (rand())/static_cast<float>(RAND_MAX));
-    }
+    std::random_device r;
+    std::default_random_engine e1(r());
+    std::uniform_real_distribution<float> uniform_dist(0, 1);
+    for (int n = 0; n < 2 * d_vector_length; n++)
+        {
+            in_cpu[n] = std::complex<float>(uniform_dist(e1), uniform_dist(e1));
+        }
 
-    for (int n=0;n<max_threads;n++)
-    {
-        correlator_pool[n] = new cpu_multicorrelator();
-        correlator_pool[n]->init(d_vector_length, d_n_correlator_taps);
-        correlator_pool[n]->set_input_output_vectors(d_correlator_outs, in_cpu);
-        correlator_pool[n]->set_local_code_and_taps(static_cast<int>(GPS_L1_CA_CODE_LENGTH_CHIPS), d_ca_code, d_local_code_shift_chips);
-    }
+    for (int n = 0; n < max_threads; n++)
+        {
+            correlator_pool[n] = new cpu_multicorrelator();
+            correlator_pool[n]->init(d_vector_length, d_n_correlator_taps);
+            correlator_pool[n]->set_input_output_vectors(d_correlator_outs, in_cpu);
+            correlator_pool[n]->set_local_code_and_taps(static_cast<int>(GPS_L1_CA_CODE_LENGTH_CHIPS), d_ca_code, d_local_code_shift_chips);
+        }
 
-    float d_rem_carrier_phase_rad=0.0;
-    float d_carrier_phase_step_rad=0.1;
-    float d_code_phase_step_chips=0.3;
-    float d_rem_code_phase_chips=0.4;
+    float d_rem_carrier_phase_rad = 0.0;
+    float d_carrier_phase_step_rad = 0.1;
+    float d_code_phase_step_chips = 0.3;
+    float d_rem_code_phase_chips = 0.4;
 
     EXPECT_NO_THROW(
-        for(int correlation_sizes_idx = 0; correlation_sizes_idx < 3; correlation_sizes_idx++)
-        {
-            for(int current_max_threads=1; current_max_threads<(max_threads+1); current_max_threads++)
-            {
-                std::cout<<"Running "<<current_max_threads<<" concurrent correlators"<<std::endl;
-                gettimeofday(&tv, NULL);
-                long long int begin = tv.tv_sec * 1000000 + tv.tv_usec;
-                //create the concurrent correlator threads
-                for (int current_thread=0;current_thread<current_max_threads;current_thread++)
+            for(int correlation_sizes_idx = 0; correlation_sizes_idx < 3; correlation_sizes_idx++)
                 {
-                    thread_pool.push_back(std::thread(run_correlator_cpu,
-                            correlator_pool[current_thread],
-                            d_rem_carrier_phase_rad,
-                            d_carrier_phase_step_rad,
-                            d_code_phase_step_chips,
-                            d_rem_code_phase_chips,
-                            correlation_sizes[correlation_sizes_idx]));
-                }
-                //wait the threads to finish they work and destroy the thread objects
-                for(auto &t : thread_pool){
-                    t.join();
-                }
-                thread_pool.clear();
-                gettimeofday(&tv, NULL);
-                long long int end = tv.tv_sec * 1000000 + tv.tv_usec;
-                execution_times[correlation_sizes_idx] = static_cast<double>(end - begin) / (1000000.0 * static_cast<double>(FLAGS_cpu_multicorrelator_iterations_test));
-                std::cout << "CPU Multicorrelator execution time for length=" << correlation_sizes[correlation_sizes_idx] << " : " << execution_times[correlation_sizes_idx] << " [s]" << std::endl;
+                    for(int current_max_threads = 1; current_max_threads < (max_threads+1); current_max_threads++)
+                        {
+                            std::cout << "Running " << current_max_threads << " concurrent correlators" << std::endl;
+                            start = std::chrono::system_clock::now();
+                            //create the concurrent correlator threads
+                            for (int current_thread = 0; current_thread < current_max_threads; current_thread++)
+                                {
+                                    thread_pool.push_back(std::thread(run_correlator_cpu,
+                                            correlator_pool[current_thread],
+                                            d_rem_carrier_phase_rad,
+                                            d_carrier_phase_step_rad,
+                                            d_code_phase_step_chips,
+                                            d_rem_code_phase_chips,
+                                            correlation_sizes[correlation_sizes_idx]));
+                                }
+                            //wait the threads to finish they work and destroy the thread objects
+                            for(auto &t : thread_pool)
+                                {
+                                    t.join();
+                                }
+                            thread_pool.clear();
+                            end = std::chrono::system_clock::now();
+                            elapsed_seconds = end - start;
+                            execution_times[correlation_sizes_idx] = elapsed_seconds.count() / static_cast<double>(FLAGS_cpu_multicorrelator_iterations_test);
+                            std::cout << "CPU Multicorrelator execution time for length=" << correlation_sizes[correlation_sizes_idx]
+                                      << " : " << execution_times[correlation_sizes_idx] << " [s]" << std::endl;
 
-            }
-        }
+                        }
+                }
     );
 
-
     volk_gnsssdr_free(d_local_code_shift_chips);
     volk_gnsssdr_free(d_correlator_outs);
     volk_gnsssdr_free(d_ca_code);
     volk_gnsssdr_free(in_cpu);
 
-    for (int n=0;n<max_threads;n++)
-    {
-        correlator_pool[n]->free();
-    }
+    for (int n = 0; n< max_threads; n++)
+        {
+            correlator_pool[n]->free();
+        }
 }
diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e1_dll_pll_veml_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e1_dll_pll_veml_tracking_test.cc
index 14470d985..4de9eb7ed 100644
--- a/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e1_dll_pll_veml_tracking_test.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e1_dll_pll_veml_tracking_test.cc
@@ -31,7 +31,7 @@
  */
 
 
-#include <ctime>
+#include <chrono>
 #include <iostream>
 #include <gnuradio/top_block.h>
 #include <gnuradio/blocks/file_source.h>
@@ -86,7 +86,7 @@ void GalileoE1DllPllVemlTrackingInternalTest::init()
     signal.copy(gnss_synchro.Signal, 2, 0);
     gnss_synchro.PRN = 11;
 
-    config->set_property("GNSS-SDR.internal_fs_hz", "8000000");
+    config->set_property("GNSS-SDR.internal_fs_sps", "8000000");
     config->set_property("Tracking_Galileo.item_type", "gr_complex");
     config->set_property("Tracking_Galileo.dump", "false");
     config->set_property("Tracking_Galileo.dump_filename", "../data/veml_tracking_ch_");
@@ -98,10 +98,8 @@ void GalileoE1DllPllVemlTrackingInternalTest::init()
 }
 
 
-
 TEST_F(GalileoE1DllPllVemlTrackingInternalTest, Instantiate)
 {
-
     init();
     auto tracking = factory->GetBlock(config, "Tracking", "Galileo_E1_DLL_PLL_VEML_Tracking", 1, 1);
     EXPECT_STREQ("Galileo_E1_DLL_PLL_VEML_Tracking", tracking->implementation().c_str());
@@ -112,9 +110,8 @@ TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ConnectAndRun)
 {
     int fs_in = 8000000;
     int nsamples = 40000000;
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
     init();
     queue = gr::msg_queue::make(0);
     top_block = gr::make_top_block("Tracking test");
@@ -145,23 +142,20 @@ TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ConnectAndRun)
     tracking->start_tracking();
 
     EXPECT_NO_THROW( {
-        gettimeofday(&tv, NULL);
-        begin = tv.tv_sec *1000000 + tv.tv_usec;
+        start = std::chrono::system_clock::now();
         top_block->run();   //Start threads and wait
-        gettimeofday(&tv, NULL);
-        end = tv.tv_sec *1000000 + tv.tv_usec;
+        end = std::chrono::system_clock::now();
+        elapsed_seconds = end - start;
     }) << "Failure running the top_block." << std::endl;
 
-    std::cout <<  "Processed " << nsamples << " samples in " << (end - begin) << " microseconds" << std::endl;
+    std::cout <<  "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
 }
 
 
-
 TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ValidationOfResults)
 {
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
     // int num_samples = 40000000; // 4 Msps
     // unsigned int skiphead_sps = 24000000; // 4 Msps
     int num_samples = 80000000; // 8 Msps
@@ -209,12 +203,11 @@ TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ValidationOfResults)
     tracking->start_tracking();
 
     EXPECT_NO_THROW( {
-        gettimeofday(&tv, NULL);
-        begin = tv.tv_sec *1000000 + tv.tv_usec;
+        start = std::chrono::system_clock::now();
         top_block->run(); // Start threads and wait
-        gettimeofday(&tv, NULL);
-        end = tv.tv_sec *1000000 + tv.tv_usec;
+        end = std::chrono::system_clock::now();
+        elapsed_seconds = end - start;
     }) << "Failure running the top_block." << std::endl;
 
-    std::cout <<  "Tracked " << num_samples << " samples in " << (end - begin) << " microseconds" << std::endl;
+    std::cout <<  "Tracked " << num_samples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
 }
diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e5a_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e5a_tracking_test.cc
index 1ff2478b5..974f4193e 100644
--- a/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e5a_tracking_test.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e5a_tracking_test.cc
@@ -31,7 +31,7 @@
  */
 
 
-#include <ctime>
+#include <chrono>
 #include <iostream>
 #include <gnuradio/top_block.h>
 #include <gnuradio/blocks/file_source.h>
@@ -85,7 +85,7 @@ void GalileoE5aTrackingTest::init()
     signal.copy(gnss_synchro.Signal, 2, 0);
     gnss_synchro.PRN = 11;
 
-    config->set_property("GNSS-SDR.internal_fs_hz", "32000000");
+    config->set_property("GNSS-SDR.internal_fs_sps", "32000000");
     config->set_property("Tracking_Galileo.item_type", "gr_complex");
     config->set_property("Tracking_Galileo.dump", "false");
     config->set_property("Tracking_Galileo.dump_filename", "../data/e5a_tracking_ch_");
@@ -99,11 +99,11 @@ void GalileoE5aTrackingTest::init()
     config->set_property("Tracking_Galileo.ti_ms", "1");
 }
 
+
 TEST_F(GalileoE5aTrackingTest, ValidationOfResults)
 {
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
     int fs_in = 32000000;
     int nsamples = 32000000*5;
     init();
@@ -146,13 +146,12 @@ TEST_F(GalileoE5aTrackingTest, ValidationOfResults)
     tracking->start_tracking();
 
     EXPECT_NO_THROW( {
-        gettimeofday(&tv, NULL);
-        begin = tv.tv_sec *1000000 + tv.tv_usec;
+        start = std::chrono::system_clock::now();
         top_block->run(); // Start threads and wait
-        gettimeofday(&tv, NULL);
-        end = tv.tv_sec *1000000 + tv.tv_usec;
+        end = std::chrono::system_clock::now();
+        elapsed_seconds = end - start;
     }) << "Failure running the top_block." << std::endl;
 
-    std::cout <<  "Tracked " << nsamples << " samples in " << (end - begin) << " microseconds" << std::endl;
+    std::cout <<  "Tracked " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
 }
 
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 bcb4f2396..894afe228 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
@@ -31,7 +31,6 @@
  */
 
 
-#include <ctime>
 #include <iostream>
 #include <unistd.h>
 #include <armadillo>
@@ -43,7 +42,6 @@
 #include <gnuradio/blocks/null_sink.h>
 #include <gnuradio/blocks/skiphead.h>
 #include <gtest/gtest.h>
-#include <sys/wait.h>
 #include "GPS_L1_CA.h"
 #include "gnss_block_factory.h"
 #include "gnss_block_interface.h"
@@ -76,11 +74,13 @@ public:
     ~GpsL1CADllPllTrackingTest_msg_rx(); //!< Default destructor
 };
 
+
 GpsL1CADllPllTrackingTest_msg_rx_sptr GpsL1CADllPllTrackingTest_msg_rx_make()
 {
     return GpsL1CADllPllTrackingTest_msg_rx_sptr(new GpsL1CADllPllTrackingTest_msg_rx());
 }
 
+
 void GpsL1CADllPllTrackingTest_msg_rx::msg_handler_events(pmt::pmt_t msg)
 {
     try
@@ -95,6 +95,7 @@ void GpsL1CADllPllTrackingTest_msg_rx::msg_handler_events(pmt::pmt_t msg)
     }
 }
 
+
 GpsL1CADllPllTrackingTest_msg_rx::GpsL1CADllPllTrackingTest_msg_rx() :
             gr::block("GpsL1CADllPllTrackingTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0))
 {
@@ -103,16 +104,15 @@ GpsL1CADllPllTrackingTest_msg_rx::GpsL1CADllPllTrackingTest_msg_rx() :
     rx_message = 0;
 }
 
+
 GpsL1CADllPllTrackingTest_msg_rx::~GpsL1CADllPllTrackingTest_msg_rx()
 {}
 
 
 // ###########################################################
 
-
 class GpsL1CADllPllTrackingTest: public ::testing::Test
 {
-
 public:
     std::string generator_binary;
     std::string p1;
@@ -121,25 +121,25 @@ public:
     std::string p4;
     std::string p5;
 
-    const int baseband_sampling_freq = FLAGS_fs_gen_hz;
+    const int baseband_sampling_freq = FLAGS_fs_gen_sps;
 
     std::string filename_rinex_obs = FLAGS_filename_rinex_obs;
     std::string filename_raw_data = FLAGS_filename_raw_data;
 
     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);
 
     GpsL1CADllPllTrackingTest()
     {
@@ -214,7 +214,7 @@ void GpsL1CADllPllTrackingTest::configure_receiver()
     signal.copy(gnss_synchro.Signal, 2, 0);
     gnss_synchro.PRN = FLAGS_test_satellite_PRN;
 
-    config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(baseband_sampling_freq));
+    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_Tracking");
     config->set_property("Tracking_1C.item_type", "gr_complex");
@@ -226,14 +226,22 @@ void GpsL1CADllPllTrackingTest::configure_receiver()
     config->set_property("Tracking_1C.early_late_space_chips", "0.5");
 }
 
-void GpsL1CADllPllTrackingTest::check_results_doppler(arma::vec true_time_s,
-        arma::vec true_value,
-        arma::vec meas_time_s,
-        arma::vec meas_value)
+
+void GpsL1CADllPllTrackingTest::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;
+    arma::uvec true_time_s_valid = find(true_time_s > 0);
+    true_time_s = true_time_s(true_time_s_valid);
+    true_value = true_value(true_time_s_valid);
+    arma::uvec meas_time_s_valid = find(meas_time_s > 0);
+    meas_time_s = meas_time_s(meas_time_s_valid);
+    meas_value = meas_value(meas_time_s_valid);
+
     arma::interp1(true_time_s, true_value, meas_time_s, true_value_interp);
 
     //2. RMSE
@@ -252,26 +260,32 @@ void GpsL1CADllPllTrackingTest::check_results_doppler(arma::vec true_time_s,
     double min_error = arma::min(err);
 
     //5. report
-
+    std::streamsize ss = std::cout.precision();
     std::cout << std::setprecision(10) << "TRK Doppler RMSE=" << rmse
               << ", mean=" << error_mean
               << ", stdev="<< sqrt(error_var) << " (max,min)=" << max_error << "," << min_error << " [Hz]" << std::endl;
-
+    std::cout.precision (ss);
 }
 
-void GpsL1CADllPllTrackingTest::check_results_acc_carrier_phase(arma::vec true_time_s,
-        arma::vec true_value,
-        arma::vec meas_time_s,
-        arma::vec meas_value)
+
+void GpsL1CADllPllTrackingTest::check_results_acc_carrier_phase(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;
+    arma::uvec true_time_s_valid = find(true_time_s > 0);
+    true_time_s = true_time_s(true_time_s_valid);
+    true_value = true_value(true_time_s_valid);
+    arma::uvec meas_time_s_valid = find(meas_time_s > 0);
+    meas_time_s = meas_time_s(meas_time_s_valid);
+    meas_value = meas_value(meas_time_s_valid);
+
     arma::interp1(true_time_s, true_value, meas_time_s, true_value_interp);
 
     //2. RMSE
     arma::vec err;
-
     err = meas_value - true_value_interp;
     arma::vec err2 = arma::square(err);
     double rmse = sqrt(arma::mean(err2));
@@ -285,21 +299,28 @@ void GpsL1CADllPllTrackingTest::check_results_acc_carrier_phase(arma::vec true_t
     double min_error = arma::min(err);
 
     //5. report
-
+    std::streamsize ss = std::cout.precision();
     std::cout << std::setprecision(10) << "TRK acc carrier phase RMSE=" << rmse
               << ", mean=" << error_mean
               << ", stdev=" << sqrt(error_var) << " (max,min)=" << max_error << "," << min_error << " [Hz]" << std::endl;
-
+    std::cout.precision (ss);
 }
 
-void GpsL1CADllPllTrackingTest::check_results_codephase(arma::vec true_time_s,
-        arma::vec true_value,
-        arma::vec meas_time_s,
-        arma::vec meas_value)
+
+void GpsL1CADllPllTrackingTest::check_results_codephase(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;
+    arma::uvec true_time_s_valid = find(true_time_s > 0);
+    true_time_s = true_time_s(true_time_s_valid);
+    true_value = true_value(true_time_s_valid);
+    arma::uvec meas_time_s_valid = find(meas_time_s > 0);
+    meas_time_s = meas_time_s(meas_time_s_valid);
+    meas_value = meas_value(meas_time_s_valid);
+
     arma::interp1(true_time_s, true_value, meas_time_s, true_value_interp);
 
     //2. RMSE
@@ -318,23 +339,24 @@ void GpsL1CADllPllTrackingTest::check_results_codephase(arma::vec true_time_s,
     double min_error = arma::min(err);
 
     //5. report
-
+    std::streamsize ss = std::cout.precision();
     std::cout << std::setprecision(10) << "TRK code phase RMSE=" << rmse
               << ", mean=" << error_mean
               << ", stdev=" << sqrt(error_var) << " (max,min)=" << max_error << "," << min_error << " [Chips]" << std::endl;
-
+    std::cout.precision (ss);
 }
 
+
 TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults)
 {
     // Configure the signal generator
     configure_generator();
 
     // Generate signal raw signal samples and observations RINEX file
-    if (FLAGS_disable_generator==false)
-    {
-        generate_signal();
-    }
+    if (FLAGS_disable_generator == false)
+        {
+            generate_signal();
+        }
 
     struct timeval tv;
     long long int begin = 0;
@@ -404,7 +426,6 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults)
 
     tracking->start_tracking();
 
-
     EXPECT_NO_THROW( {
         gettimeofday(&tv, NULL);
         begin = tv.tv_sec * 1000000 + tv.tv_usec;
@@ -418,31 +439,23 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults)
     long int nepoch = true_obs_data.num_epochs();
     std::cout << "True observation epochs=" << nepoch << std::endl;
 
-
-
     arma::vec true_timestamp_s = arma::zeros(nepoch, 1);
     arma::vec true_acc_carrier_phase_cycles = arma::zeros(nepoch, 1);
     arma::vec true_Doppler_Hz = arma::zeros(nepoch, 1);
     arma::vec true_prn_delay_chips = arma::zeros(nepoch, 1);
     arma::vec true_tow_s = arma::zeros(nepoch, 1);
 
-	
     long int epoch_counter = 0;
     while(true_obs_data.read_binary_obs())
         {
-			
-				
             true_timestamp_s(epoch_counter) = true_obs_data.signal_timestamp_s;
             true_acc_carrier_phase_cycles(epoch_counter) = true_obs_data.acc_carrier_phase_cycles;
             true_Doppler_Hz(epoch_counter) = true_obs_data.doppler_l1_hz;
             true_prn_delay_chips(epoch_counter) = true_obs_data.prn_delay_chips;
             true_tow_s(epoch_counter) = true_obs_data.tow;
             epoch_counter++;
-            
-			            
         }
 
-
     //load the measured values
     tracking_dump_reader trk_dump;
     ASSERT_NO_THROW({
@@ -456,7 +469,6 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults)
     nepoch = trk_dump.num_epochs();
     std::cout << "Measured observation epochs=" << nepoch << std::endl;
 
-
     arma::vec trk_timestamp_s = arma::zeros(nepoch, 1);
     arma::vec trk_acc_carrier_phase_cycles = arma::zeros(nepoch, 1);
     arma::vec trk_Doppler_Hz = arma::zeros(nepoch, 1);
@@ -469,9 +481,8 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults)
             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<double>(trk_dump.PRN_start_sample_count) + trk_dump.aux1) / static_cast<double>(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<double>(trk_dump.PRN_start_sample_count) + trk_dump.aux1) / static_cast<double>(baseband_sampling_freq), 1.0e-3) / 1.0e-3);
 
             trk_prn_delay_chips(epoch_counter) = delay_chips;
             epoch_counter++;
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 855115567..1bd317a95 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
@@ -31,13 +31,12 @@
  * -------------------------------------------------------------------------
  */
 
-
-#include <ctime>
+#include <chrono>
+#include <fcntl.h>
 #include <iostream>
 #include <unistd.h>
 #include <armadillo>
 #include <boost/thread.hpp>// to test the FPGA we have to create a simultaneous task to send the samples using the DMA and stop the test
-#include <boost/chrono.hpp> // temporary for debugging
 #include <stdio.h>// FPGA read input file
 #include <gnuradio/top_block.h>
 #include <gnuradio/blocks/file_source.h>
@@ -49,7 +48,6 @@
 #include <gflags/gflags.h>
 #include <glog/logging.h>
 #include <gtest/gtest.h>
-#include <sys/wait.h>
 #include "GPS_L1_CA.h"
 #include "gnss_block_factory.h"
 #include "gnss_block_interface.h"
@@ -62,42 +60,31 @@
 #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 MAX_NUM_TEST_CASES 20
-#define MAX_INPUT_SAMPLES_PER_TEST_CASE (8184)
-#define MAX_INPUT_SAMPLES_TOTAL MAX_INPUT_SAMPLES_PER_TEST_CASE*MAX_NUM_TEST_CASES
-#define DMA_TRANSFER_SIZE 2046
-#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)
-
-
-void wait(int seconds)
+void send_tracking_gps_input_samples(FILE *rx_signal_file,
+        int num_remaining_samples, gr::top_block_sptr top_block)
 {
-    boost::this_thread::sleep_for(boost::chrono::seconds{seconds});
-}
-
-void send_tracking_gps_input_samples(FILE *ptr_myfile, int num_remaining_samples, gr::top_block_sptr top_block)
-{
-    int num_samples_transferred = 0;
-    static int flowgraph_stopped = 0;
-
-    char *buffer;
-
-    // DMA descriptor
-    int tx_fd;
-    tx_fd = open("/dev/loop_tx", O_WRONLY);
-    if ( tx_fd < 0 )
+    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)
         {
             printf("can't open loop device\n");
             exit(1);
         }
 
-    buffer = (char *)malloc(DMA_TRANSFER_SIZE);
-    if (!buffer)
+    buffer_DMA = (char *) malloc(DMA_TRACK_TRANSFER_SIZE);
+    if (!buffer_DMA)
         {
             fprintf(stderr, "Memory error!");
         }
 
-    while(num_remaining_samples > 0)
+    while (num_remaining_samples > 0)
         {
             if (num_remaining_samples < MIN_SAMPLES_REMAINING)
                 {
@@ -108,27 +95,27 @@ void send_tracking_gps_input_samples(FILE *ptr_myfile, int num_remaining_samples
                             flowgraph_stopped = 1;
                         }
                 }
-            if (num_remaining_samples > DMA_TRANSFER_SIZE)
+            if (num_remaining_samples > DMA_TRACK_TRANSFER_SIZE)
                 {
 
-                    fread(buffer, DMA_TRANSFER_SIZE, 1, ptr_myfile);
+                    fread(buffer_DMA, DMA_TRACK_TRANSFER_SIZE, 1,rx_signal_file);
 
-                    assert( DMA_TRANSFER_SIZE == write(tx_fd, &buffer[0], DMA_TRANSFER_SIZE) );
-                    num_remaining_samples = num_remaining_samples - DMA_TRANSFER_SIZE;
-                    num_samples_transferred  = num_samples_transferred  + DMA_TRANSFER_SIZE;
+                    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;
+                    num_samples_transferred = num_samples_transferred + DMA_TRACK_TRANSFER_SIZE;
                 }
             else
                 {
-                    fread(buffer, num_remaining_samples, 1, ptr_myfile);
+                    fread(buffer_DMA, num_remaining_samples, 1, rx_signal_file);
 
-                    assert( num_remaining_samples == write(tx_fd, &buffer[0], num_remaining_samples) );
+                    assert(num_remaining_samples == write(dma_descr, &buffer_DMA[0], num_remaining_samples));
                     num_samples_transferred = num_samples_transferred + num_remaining_samples;
                     num_remaining_samples = 0;
                 }
         }
 
-    free(buffer);
-    close(tx_fd);
+    free(buffer_DMA);
+    close(dma_descr);
 }
 
 
@@ -136,35 +123,33 @@ void send_tracking_gps_input_samples(FILE *ptr_myfile, int num_remaining_samples
 void thread(gr::top_block_sptr top_block, const char * file_name)
 {
     // file descriptor
-    FILE *ptr_myfile;
-    int fileLen;
+    FILE *rx_signal_file; // file descriptor
+    int file_length; // length of the file containing the received samples
 
-    ptr_myfile = fopen(file_name,"rb");
-    if (!ptr_myfile)
+    rx_signal_file = fopen(file_name, "rb");
+    if (!rx_signal_file)
         {
             printf("Unable to open file!");
         }
 
-    fseek(ptr_myfile, 0, SEEK_END);
-    fileLen = ftell(ptr_myfile);
-    fseek(ptr_myfile, 0, SEEK_SET);
+    fseek(rx_signal_file, 0, SEEK_END);
+    file_length = ftell(rx_signal_file);
+    fseek(rx_signal_file, 0, SEEK_SET);
 
-    wait(20); // 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(tx_fd, ptr_myfile, fileLen);
-    send_tracking_gps_input_samples(ptr_myfile, fileLen, top_block);
+    //send_tracking_gps_input_samples(dma_descr, rx_signal_file, file_length);
+    send_tracking_gps_input_samples(rx_signal_file, file_length, top_block);
 
-    fclose(ptr_myfile);
+    fclose(rx_signal_file);
 }
 
 
 // ######## GNURADIO BLOCK MESSAGE RECEVER #########
 class GpsL1CADllPllTrackingTestFpga_msg_rx;
 
-
 typedef boost::shared_ptr<GpsL1CADllPllTrackingTestFpga_msg_rx> GpsL1CADllPllTrackingTestFpga_msg_rx_sptr;
 
-
 GpsL1CADllPllTrackingTestFpga_msg_rx_sptr GpsL1CADllPllTrackingTestFpga_msg_rx_make();
 
 
@@ -183,30 +168,36 @@ public:
 
 GpsL1CADllPllTrackingTestFpga_msg_rx_sptr GpsL1CADllPllTrackingTestFpga_msg_rx_make()
 {
-    return GpsL1CADllPllTrackingTestFpga_msg_rx_sptr(new GpsL1CADllPllTrackingTestFpga_msg_rx());
+    return GpsL1CADllPllTrackingTestFpga_msg_rx_sptr(
+            new GpsL1CADllPllTrackingTestFpga_msg_rx());
 }
 
 
 void GpsL1CADllPllTrackingTestFpga_msg_rx::msg_handler_events(pmt::pmt_t msg)
 {
     try
-    {
+        {
             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;
-    }
+        }
 }
 
 
 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))
+        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));
+    this->set_msg_handler(pmt::mp("events"),
+            boost::bind(
+                    &GpsL1CADllPllTrackingTestFpga_msg_rx::msg_handler_events,
+                    this, _1));
     rx_message = 0;
 }
 
@@ -214,10 +205,10 @@ GpsL1CADllPllTrackingTestFpga_msg_rx::GpsL1CADllPllTrackingTestFpga_msg_rx() :
 GpsL1CADllPllTrackingTestFpga_msg_rx::~GpsL1CADllPllTrackingTestFpga_msg_rx()
 {}
 
+
 // ###########################################################
 
-
-class GpsL1CADllPllTrackingTestFpga: public ::testing::Test
+class GpsL1CADllPllTrackingTestFpga : public ::testing::Test
 {
 public:
     std::string generator_binary;
@@ -227,25 +218,19 @@ public:
     std::string p4;
     std::string p5;
 
-    const int baseband_sampling_freq = FLAGS_fs_gen_hz;
+    const int baseband_sampling_freq = FLAGS_fs_gen_sps;
 
     std::string filename_rinex_obs = FLAGS_filename_rinex_obs;
     std::string filename_raw_data = FLAGS_filename_raw_data;
 
     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()
     {
@@ -256,7 +241,8 @@ public:
     }
 
     ~GpsL1CADllPllTrackingTestFpga()
-    {}
+    {
+    }
 
     void configure_receiver();
 
@@ -274,9 +260,10 @@ int GpsL1CADllPllTrackingTestFpga::configure_generator()
     generator_binary = FLAGS_generator_binary;
 
     p1 = std::string("-rinex_nav_file=") + FLAGS_rinex_nav_file;
-    if(FLAGS_dynamic_position.empty())
+    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
         {
@@ -293,7 +280,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)
@@ -307,7 +295,7 @@ int GpsL1CADllPllTrackingTestFpga::generate_signal()
 
     waitpid(pid, &child_status, 0);
 
-    std::cout << "Signal and Observables RINEX and RAW files created."  << std::endl;
+    std::cout << "Signal and Observables RINEX and RAW files created." << std::endl;
     return 0;
 }
 
@@ -320,9 +308,11 @@ void GpsL1CADllPllTrackingTestFpga::configure_receiver()
     signal.copy(gnss_synchro.Signal, 2, 0);
     gnss_synchro.PRN = FLAGS_test_satellite_PRN;
 
-    config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(baseband_sampling_freq));
+    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");
     config->set_property("Tracking_1C.item_type", "cshort");
     config->set_property("Tracking_1C.if", "0");
     config->set_property("Tracking_1C.dump", "true");
@@ -330,16 +320,22 @@ void GpsL1CADllPllTrackingTestFpga::configure_receiver()
     config->set_property("Tracking_1C.pll_bw_hz", "30.0");
     config->set_property("Tracking_1C.dll_bw_hz", "2.0");
     config->set_property("Tracking_1C.early_late_space_chips", "0.5");
+    config->set_property("Tracking_1C.devicename", "/dev/uio");
+    config->set_property("Tracking_1C.device_base", "1");
 }
 
 
-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;
+    arma::uvec true_time_s_valid = find(true_time_s > 0);
+    true_time_s = true_time_s(true_time_s_valid);
+    true_value = true_value(true_time_s_valid);
+    arma::uvec meas_time_s_valid = find(meas_time_s > 0);
+    meas_time_s = meas_time_s(meas_time_s_valid);
+    meas_value = meas_value(meas_time_s_valid);
     arma::interp1(true_time_s, true_value, meas_time_s, true_value_interp);
 
     //2. RMSE
@@ -358,19 +354,27 @@ void GpsL1CADllPllTrackingTestFpga::check_results_doppler(arma::vec true_time_s,
     double min_error = arma::min(err);
 
     //5. report
+    std::streamsize ss = std::cout.precision();
     std::cout << std::setprecision(10) << "TRK Doppler RMSE=" << rmse
-              << ", mean=" << error_mean
-              << ", stdev="<< sqrt(error_var) << " (max,min)=" << max_error << "," << min_error << " [Hz]" << std::endl;
+              << ", mean=" << error_mean << ", stdev=" << sqrt(error_var)
+              << " (max,min)=" << max_error << "," << min_error << " [Hz]"
+              << std::endl;
+    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)
+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)
 {
     //1. True value interpolation to match the measurement times
     arma::vec true_value_interp;
+    arma::uvec true_time_s_valid = find(true_time_s > 0);
+    true_time_s = true_time_s(true_time_s_valid);
+    true_value = true_value(true_time_s_valid);
+    arma::uvec meas_time_s_valid = find(meas_time_s > 0);
+    meas_time_s = meas_time_s(meas_time_s_valid);
+    meas_value = meas_value(meas_time_s_valid);
     arma::interp1(true_time_s, true_value, meas_time_s, true_value_interp);
 
     //2. RMSE
@@ -389,20 +393,27 @@ void GpsL1CADllPllTrackingTestFpga::check_results_acc_carrier_phase(arma::vec tr
     double min_error = arma::min(err);
 
     //5. report
+    std::streamsize ss = std::cout.precision();
     std::cout << std::setprecision(10) << "TRK acc carrier phase RMSE=" << rmse
-              << ", mean=" << error_mean
-              << ", stdev=" << sqrt(error_var) << " (max,min)=" << max_error << "," << min_error << " [Hz]" << std::endl;
-
+              << ", mean=" << error_mean << ", stdev=" << sqrt(error_var)
+              << " (max,min)=" << max_error << "," << min_error << " [Hz]"
+              << std::endl;
+    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)
+void GpsL1CADllPllTrackingTestFpga::check_results_codephase(
+        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;
+    arma::uvec true_time_s_valid = find(true_time_s > 0);
+    true_time_s = true_time_s(true_time_s_valid);
+    true_value = true_value(true_time_s_valid);
+    arma::uvec meas_time_s_valid = find(meas_time_s > 0);
+    meas_time_s = meas_time_s(meas_time_s_valid);
+    meas_value = meas_value(meas_time_s_valid);
     arma::interp1(true_time_s, true_value, meas_time_s, true_value_interp);
 
     //2. RMSE
@@ -420,9 +431,12 @@ void GpsL1CADllPllTrackingTestFpga::check_results_codephase(arma::vec true_time_
     double min_error = arma::min(err);
 
     //5. report
+    std::streamsize ss = std::cout.precision();
     std::cout << std::setprecision(10) << "TRK code phase RMSE=" << rmse
-              << ", mean=" << error_mean
-              << ", stdev=" << sqrt(error_var) << " (max,min)=" << max_error << "," << min_error << " [Chips]" << std::endl;
+              << ", mean=" << error_mean << ", stdev=" << sqrt(error_var)
+              << " (max,min)=" << max_error << "," << min_error << " [Chips]"
+              << std::endl;
+    std::cout.precision (ss);
 }
 
 
@@ -433,9 +447,8 @@ TEST_F(GpsL1CADllPllTrackingTestFpga, ValidationOfResultsFpga)
     // DO not generate signal raw signal samples and observations RINEX file by default
     //generate_signal();
 
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
 
     configure_receiver();
 
@@ -446,69 +459,81 @@ TEST_F(GpsL1CADllPllTrackingTestFpga, ValidationOfResultsFpga)
     std::string true_obs_file = std::string("./gps_l1_ca_obs_prn");
     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)
-            {
-                throw std::exception();
-            };
-    }) << "Failure opening true observables file" << std::endl;
+    ASSERT_NO_THROW(
+                {
+                    if (true_obs_data.open_obs_file(true_obs_file) == false)
+                        {
+                            throw std::exception();
+                        };
+                })<< "Failure opening true observables file" << std::endl;
 
     top_block = gr::make_top_block("Tracking test");
-    std::shared_ptr<TrackingInterface> tracking = std::make_shared<GpsL1CaDllPllCAidTrackingFpga>(config.get(), "Tracking_1C", 1, 1);
+    std::shared_ptr<GpsL1CaDllPllCAidTrackingFpga> tracking = std::make_shared<GpsL1CaDllPllCAidTrackingFpga> (config.get(), "Tracking_1C", 1, 1);
 
     boost::shared_ptr<GpsL1CADllPllTrackingTestFpga_msg_rx> 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)
-            {
-                throw std::exception();
-            };
-    }) << "Failure reading true observables file" << std::endl;
+    ASSERT_NO_THROW(
+                {
+                    if (true_obs_data.read_binary_obs() == false)
+                        {
+                            throw std::exception();
+                        };
+                })<< "Failure reading true observables file" << std::endl;
 
     //restart the epoch counter
     true_obs_data.restart();
 
-    std::cout << "Initial Doppler [Hz]=" << true_obs_data.doppler_l1_hz << " 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;
+    std::cout << "Initial Doppler [Hz]=" << true_obs_data.doppler_l1_hz
+              << " 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_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." << std::endl;
+    ASSERT_NO_THROW(
+                {
+                    tracking->set_channel(gnss_synchro.Channel_ID);
+                })<< "Failure setting channel." << std::endl;
 
-    ASSERT_NO_THROW( {
-        tracking->set_gnss_synchro(&gnss_synchro);
-    }) << "Failure setting gnss_synchro." << std::endl;
+    ASSERT_NO_THROW(
+                {
+                    tracking->set_gnss_synchro(&gnss_synchro);
+                })<< "Failure setting gnss_synchro." << std::endl;
 
-    ASSERT_NO_THROW( {
-        tracking->connect(top_block);
-    }) << "Failure connecting tracking to the top_block." << std::endl;
+    ASSERT_NO_THROW(
+                {
+                    tracking->connect(top_block);
+                })<< "Failure connecting tracking to the top_block." << std::endl;
 
-    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." << std::endl;
+    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." << std::endl;
 
     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;
+    std::string file = "./" + filename_raw_data;
     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( {
-        gettimeofday(&tv, NULL);
-        begin = tv.tv_sec * 1000000 + tv.tv_usec;
-        top_block->run(); // Start threads and wait
-        tracking.reset();
-        gettimeofday(&tv, NULL);
-        end = tv.tv_sec * 1000000 + tv.tv_usec;
-    }) << "Failure running the top_block." << std::endl;
+    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." << std::endl;
 
     // wait until child thread terminates
     t.join();
@@ -525,7 +550,7 @@ TEST_F(GpsL1CADllPllTrackingTestFpga, ValidationOfResultsFpga)
     arma::vec true_tow_s = arma::zeros(nepoch, 1);
 
     long int epoch_counter = 0;
-    while(true_obs_data.read_binary_obs())
+    while (true_obs_data.read_binary_obs())
         {
             true_timestamp_s(epoch_counter) = true_obs_data.signal_timestamp_s;
             true_acc_carrier_phase_cycles(epoch_counter) = true_obs_data.acc_carrier_phase_cycles;
@@ -537,12 +562,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)
-            {
-                throw std::exception();
-            };
-    }) << "Failure opening tracking dump file" << std::endl;
+    ASSERT_NO_THROW(
+                {
+                    if (trk_dump.open_obs_file(std::string("./tracking_ch_0.dat")) == false)
+                        {
+                            throw std::exception();
+                        };
+                })<< "Failure opening tracking dump file" << std::endl;
 
     nepoch = trk_dump.num_epochs();
     std::cout << "Measured observation epochs=" << nepoch << std::endl;
@@ -553,15 +579,16 @@ TEST_F(GpsL1CADllPllTrackingTestFpga, ValidationOfResultsFpga)
     arma::vec trk_prn_delay_chips = arma::zeros(nepoch, 1);
 
     epoch_counter = 0;
-    while(trk_dump.read_binary_obs())
+    while (trk_dump.read_binary_obs())
         {
-            trk_timestamp_s(epoch_counter) = static_cast<double>(trk_dump.PRN_start_sample_count) / static_cast<double>(baseband_sampling_freq);
+            trk_timestamp_s(epoch_counter) = static_cast<double>(trk_dump.PRN_start_sample_count)
+                            / static_cast<double>(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<double>(trk_dump.PRN_start_sample_count) + trk_dump.aux1) / static_cast<double>(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<double>(trk_dump.PRN_start_sample_count) + trk_dump.aux1)
+                                    / static_cast<double>(baseband_sampling_freq), 1.0e-3) / 1.0e-3);
 
             trk_prn_delay_chips(epoch_counter) = delay_chips;
             epoch_counter++;
@@ -569,7 +596,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);
@@ -578,7 +605,9 @@ 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);
+    check_results_acc_carrier_phase(true_timestamp_s,
+            true_acc_carrier_phase_cycles, trk_timestamp_s,
+            trk_acc_carrier_phase_cycles);
 
-    std::cout <<  "Signal tracking completed in " << (end - begin) << " microseconds" << std::endl;
+    std::cout << "Signal tracking completed in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
 }
diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc
index 372c8c5e6..220543ffd 100644
--- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc
@@ -31,7 +31,7 @@
  */
 
 
-#include <ctime>
+#include <chrono>
 #include <iostream>
 #include <gnuradio/top_block.h>
 #include <gnuradio/blocks/file_source.h>
@@ -70,11 +70,13 @@ public:
 
 };
 
+
 GpsL2MDllPllTrackingTest_msg_rx_sptr GpsL2MDllPllTrackingTest_msg_rx_make()
 {
     return GpsL2MDllPllTrackingTest_msg_rx_sptr(new GpsL2MDllPllTrackingTest_msg_rx());
 }
 
+
 void GpsL2MDllPllTrackingTest_msg_rx::msg_handler_events(pmt::pmt_t msg)
 {
     try
@@ -89,6 +91,7 @@ void GpsL2MDllPllTrackingTest_msg_rx::msg_handler_events(pmt::pmt_t msg)
     }
 }
 
+
 GpsL2MDllPllTrackingTest_msg_rx::GpsL2MDllPllTrackingTest_msg_rx() :
             gr::block("GpsL2MDllPllTrackingTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0))
 {
@@ -97,13 +100,13 @@ GpsL2MDllPllTrackingTest_msg_rx::GpsL2MDllPllTrackingTest_msg_rx() :
     rx_message = 0;
 }
 
+
 GpsL2MDllPllTrackingTest_msg_rx::~GpsL2MDllPllTrackingTest_msg_rx()
 {}
 
 
 // ###########################################################
 
-
 class GpsL2MDllPllTrackingTest: public ::testing::Test
 {
 protected:
@@ -137,7 +140,7 @@ void GpsL2MDllPllTrackingTest::init()
     signal.copy(gnss_synchro.Signal, 2, 0);
     gnss_synchro.PRN = 7;
 
-    config->set_property("GNSS-SDR.internal_fs_hz", "5000000");
+    config->set_property("GNSS-SDR.internal_fs_sps", "5000000");
     config->set_property("Tracking_2S.item_type", "gr_complex");
     config->set_property("Tracking_2S.dump", "false");
     config->set_property("Tracking_2S.dump_filename", "../data/L2m_tracking_ch_");
@@ -148,11 +151,11 @@ void GpsL2MDllPllTrackingTest::init()
     config->set_property("Tracking_2S.dll_bw_hz", "0.5");
 }
 
+
 TEST_F(GpsL2MDllPllTrackingTest, ValidationOfResults)
 {
-    struct timeval tv;
-    long long int begin = 0;
-    long long int end = 0;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
     int fs_in = 5000000;
     int nsamples = fs_in*9;
 
@@ -195,14 +198,13 @@ TEST_F(GpsL2MDllPllTrackingTest, ValidationOfResults)
     tracking->start_tracking();
 
     EXPECT_NO_THROW( {
-        gettimeofday(&tv, NULL);
-        begin = tv.tv_sec *1000000 + tv.tv_usec;
+        start = std::chrono::system_clock::now();
         top_block->run(); // Start threads and wait
-        gettimeofday(&tv, NULL);
-        end = tv.tv_sec *1000000 + tv.tv_usec;
+        end = std::chrono::system_clock::now();
+        elapsed_seconds = end - start;
     }) << "Failure running the top_block." << std::endl;
 
     // TODO: Verify tracking results
-    std::cout <<  "Tracked " << nsamples << " samples in " << (end - begin) << " microseconds" << std::endl;
+    std::cout <<  "Tracked " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
 }
 
diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gpu_multicorrelator_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gpu_multicorrelator_test.cc
index 17fcdb68f..432dcaa45 100644
--- a/src/tests/unit-tests/signal-processing-blocks/tracking/gpu_multicorrelator_test.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gpu_multicorrelator_test.cc
@@ -29,7 +29,7 @@
  * -------------------------------------------------------------------------
  */
 
-#include <ctime>
+#include <chrono>
 #include <complex>
 #include <thread>
 #include <cuda.h>
@@ -52,20 +52,22 @@ void run_correlator_gpu(cuda_multicorrelator* correlator,
                     int d_n_correlator_taps)
 {
     for(int k = 0; k < FLAGS_cpu_multicorrelator_iterations_test; k++)
-    {
-        correlator->Carrier_wipeoff_multicorrelator_resampler_cuda(d_rem_carrier_phase_rad,
-                                                                            d_carrier_phase_step_rad,
-                                                                            d_code_phase_step_chips,
-                                                                            d_rem_code_phase_chips,
-                                                                            correlation_size,
-                                                                            d_n_correlator_taps);
-    }
+        {
+            correlator->Carrier_wipeoff_multicorrelator_resampler_cuda(d_rem_carrier_phase_rad,
+                    d_carrier_phase_step_rad,
+                    d_code_phase_step_chips,
+                    d_rem_code_phase_chips,
+                    correlation_size,
+                    d_n_correlator_taps);
+        }
 }
 
-TEST(GPU_multicorrelator_test, MeasureExecutionTime)
+
+TEST(GpuMulticorrelatorTest, MeasureExecutionTime)
 {
-    struct timeval tv;
-    int max_threads=FLAGS_gpu_multicorrelator_max_threads_test;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds(0);
+    int max_threads = FLAGS_gpu_multicorrelator_max_threads_test;
     std::vector<std::thread> thread_pool;
     cuda_multicorrelator* correlator_pool[max_threads];
     unsigned int correlation_sizes [3] = { 2048, 4096, 8192};
@@ -75,8 +77,8 @@ TEST(GPU_multicorrelator_test, MeasureExecutionTime)
     gr_complex* in_gpu;
     gr_complex* d_correlator_outs;
 
-    int d_n_correlator_taps=3;
-    int d_vector_length=correlation_sizes[2]; //max correlation size to allocate all the necessary memory
+    int d_n_correlator_taps = 3;
+    int d_vector_length = correlation_sizes[2]; //max correlation size to allocate all the necessary memory
     float* d_local_code_shift_chips;
     // Set GPU flags
     cudaSetDeviceFlags(cudaDeviceMapHost);
@@ -96,61 +98,60 @@ TEST(GPU_multicorrelator_test, MeasureExecutionTime)
     // generate local reference (1 sample per chip)
     gps_l1_ca_code_gen_complex(d_ca_code, 1, 0);
     // generate inut signal
-    for (int n=0;n<2*d_vector_length;n++)
-    {
-        in_gpu[n]=std::complex<float>(static_cast <float> (rand())/static_cast<float>(RAND_MAX),static_cast <float> (rand())/static_cast<float>(RAND_MAX));
-    }
+    for (int n = 0; n < 2 * d_vector_length; n++)
+        {
+            in_gpu[n] = std::complex<float>(static_cast<float>(rand()) / static_cast<float>(RAND_MAX), static_cast<float>(rand()) / static_cast<float>(RAND_MAX));
+        }
     // Set TAPs delay values [chips]
-    float d_early_late_spc_chips=0.5;
+    float d_early_late_spc_chips = 0.5;
     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;
-    for (int n=0;n<max_threads;n++)
-    {
-        correlator_pool[n] = new cuda_multicorrelator();
-        correlator_pool[n]->init_cuda_integrated_resampler(d_vector_length, GPS_L1_CA_CODE_LENGTH_CHIPS, d_n_correlator_taps);
-        correlator_pool[n]->set_input_output_vectors(d_correlator_outs, in_gpu);
-    }
+    for (int n = 0; n < max_threads; n++)
+        {
+            correlator_pool[n] = new cuda_multicorrelator();
+            correlator_pool[n]->init_cuda_integrated_resampler(d_vector_length, GPS_L1_CA_CODE_LENGTH_CHIPS, d_n_correlator_taps);
+            correlator_pool[n]->set_input_output_vectors(d_correlator_outs, in_gpu);
+        }
 
-    float d_rem_carrier_phase_rad=0.0;
-    float d_carrier_phase_step_rad=0.1;
-    float d_code_phase_step_chips=0.3;
-    float d_rem_code_phase_chips=0.4;
+    float d_rem_carrier_phase_rad = 0.0;
+    float d_carrier_phase_step_rad = 0.1;
+    float d_code_phase_step_chips = 0.3;
+    float d_rem_code_phase_chips = 0.4;
 
     EXPECT_NO_THROW(
-        for(int correlation_sizes_idx = 0; correlation_sizes_idx < 3; correlation_sizes_idx++)
-            {
-                for(int current_max_threads=1; current_max_threads<(max_threads+1); current_max_threads++)
+            for(int correlation_sizes_idx = 0; correlation_sizes_idx < 3; correlation_sizes_idx++)
                 {
-                    std::cout<<"Running "<<current_max_threads<<" concurrent correlators"<<std::endl;
-                    gettimeofday(&tv, NULL);
-                    long long int begin = tv.tv_sec * 1000000 + tv.tv_usec;
-                    //create the concurrent correlator threads
-                    for (int current_thread=0;current_thread<current_max_threads;current_thread++)
-                    {
-                        //cudaProfilerStart();
-                        thread_pool.push_back(std::thread(run_correlator_gpu,
-                                correlator_pool[current_thread],
-                                d_rem_carrier_phase_rad,
-                                d_carrier_phase_step_rad,
-                                d_code_phase_step_chips,
-                                d_rem_code_phase_chips,
-                                correlation_sizes[correlation_sizes_idx],
-                                d_n_correlator_taps));
-                        //cudaProfilerStop();
-                    }
-                    //wait the threads to finish they work and destroy the thread objects
-                    for(auto &t : thread_pool){
-                         t.join();
-                     }
-                    thread_pool.clear();
-                    gettimeofday(&tv, NULL);
-                    long long int end = tv.tv_sec * 1000000 + tv.tv_usec;
-                    execution_times[correlation_sizes_idx] = static_cast<double>(end - begin) / (1000000.0 * static_cast<double>(FLAGS_gpu_multicorrelator_iterations_test));
-                    std::cout << "GPU Multicorrelator execution time for length=" << correlation_sizes[correlation_sizes_idx] << " : " << execution_times[correlation_sizes_idx] << " [s]" << std::endl;
-
+                    for(int current_max_threads = 1; current_max_threads < (max_threads+1); current_max_threads++)
+                        {
+                            std::cout << "Running " << current_max_threads << " concurrent correlators" << std::endl;
+                            start = std::chrono::system_clock::now();
+                            //create the concurrent correlator threads
+                            for (int current_thread = 0; current_thread < current_max_threads; current_thread++)
+                                {
+                                    //cudaProfilerStart();
+                                    thread_pool.push_back(std::thread(run_correlator_gpu,
+                                            correlator_pool[current_thread],
+                                            d_rem_carrier_phase_rad,
+                                            d_carrier_phase_step_rad,
+                                            d_code_phase_step_chips,
+                                            d_rem_code_phase_chips,
+                                            correlation_sizes[correlation_sizes_idx],
+                                            d_n_correlator_taps));
+                                    //cudaProfilerStop();
+                                }
+                            //wait the threads to finish they work and destroy the thread objects
+                            for(auto &t : thread_pool)
+                                {
+                                    t.join();
+                                }
+                            thread_pool.clear();
+                            end = std::chrono::system_clock::now();
+                            elapsed_seconds = end - start;
+                            execution_times[correlation_sizes_idx] = elapsed_seconds.count() / static_cast<double>(FLAGS_gpu_multicorrelator_iterations_test);
+                            std::cout << "GPU Multicorrelator execution time for length=" << correlation_sizes[correlation_sizes_idx] << " : " << execution_times[correlation_sizes_idx] << " [s]" << std::endl;
+                        }
                 }
-    		}
     );
 
     cudaFreeHost(in_gpu);
@@ -158,11 +159,8 @@ TEST(GPU_multicorrelator_test, MeasureExecutionTime)
     cudaFreeHost(d_local_code_shift_chips);
     cudaFreeHost(d_ca_code);
 
-    for (int n=0;n<max_threads;n++)
-    {
-        correlator_pool[n]->free_cuda();
-    }
-
-
-
+    for (int n = 0; n < max_threads; n++)
+        {
+            correlator_pool[n]->free_cuda();
+        }
 }
diff --git a/src/utils/front-end-cal/front_end_cal.cc b/src/utils/front-end-cal/front_end_cal.cc
index a3d0cf04d..233abc45a 100644
--- a/src/utils/front-end-cal/front_end_cal.cc
+++ b/src/utils/front-end-cal/front_end_cal.cc
@@ -31,7 +31,6 @@
 
 #include "front_end_cal.h"
 #include <cmath>
-#include <ctime>
 #include <memory>
 #include <exception>
 #include <boost/filesystem.hpp>
diff --git a/src/utils/front-end-cal/main.cc b/src/utils/front-end-cal/main.cc
index ce249aa20..cc53987f4 100644
--- a/src/utils/front-end-cal/main.cc
+++ b/src/utils/front-end-cal/main.cc
@@ -32,7 +32,9 @@
 #define FRONT_END_CAL_VERSION "0.0.1"
 #endif
 
-#include <ctime>
+#include <stdlib.h>
+#include <chrono>
+#include <ctime> // for ctime
 #include <exception>
 #include <memory>
 #include <queue>
@@ -214,7 +216,7 @@ bool front_end_capture(std::shared_ptr<ConfigurationInterface> configuration)
     sink = gr::blocks::file_sink::make(sizeof(gr_complex), "tmp_capture.dat");
 
     //--- Find number of samples per spreading code ---
-    long fs_in_ = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
+    long fs_in_ = configuration->property("GNSS-SDR.internal_fs_sps", 2048000);
     int samples_per_code = round(fs_in_
             / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS));
     int nsamples = samples_per_code * 50;
@@ -359,7 +361,7 @@ int main(int argc, char** argv)
     signal.copy(gnss_synchro->Signal, 2, 0);
     gnss_synchro->PRN = 1;
 
-    long fs_in_ = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
+    long fs_in_ = configuration->property("GNSS-SDR.internal_fs_sps", 2048000);
 
     GNSSBlockFactory block_factory;
     acquisition = new GpsL1CaPcpsAcquisitionFineDoppler(configuration.get(), "Acquisition", 1, 1);
@@ -372,8 +374,15 @@ int main(int argc, char** argv)
 
     gr::block_sptr source;
     source = gr::blocks::file_source::make(sizeof(gr_complex), "tmp_capture.dat");
-
-    boost::shared_ptr<FrontEndCal_msg_rx> msg_rx = FrontEndCal_msg_rx_make();
+    boost::shared_ptr<FrontEndCal_msg_rx> msg_rx;
+    try
+    {
+            msg_rx = FrontEndCal_msg_rx_make();
+    }
+    catch(const std::exception & e)
+    {
+            std::cout << "Failure connecting the message port system: " << e.what() << std::endl; exit(0);
+    }
 
     //gr_basic_block_sptr head = gr_make_head(sizeof(gr_complex), nsamples);
     //gr_head_sptr head_sptr = boost::dynamic_pointer_cast<gr_head>(head);
@@ -402,9 +411,9 @@ int main(int argc, char** argv)
     boost::thread ch_thread;
 
     // record startup time
-    struct timeval tv;
-    gettimeofday(&tv, NULL);
-    long long int begin = tv.tv_sec * 1000000 + tv.tv_usec;
+    std::chrono::time_point<std::chrono::system_clock> start, end;
+    std::chrono::duration<double> elapsed_seconds;
+    start = std::chrono::system_clock::now();
 
     bool start_msg = true;
 
@@ -461,10 +470,10 @@ int main(int argc, char** argv)
     std::cout << "]" << std::endl;
 
     // report the elapsed time
-    gettimeofday(&tv, NULL);
-    long long int end = tv.tv_sec * 1000000 + tv.tv_usec;
+    end = std::chrono::system_clock::now();
+    elapsed_seconds = end - start;
     std::cout << "Total signal acquisition run time "
-              << ((double)(end - begin))/1000000.0
+              << elapsed_seconds.count()
               << " [seconds]" << std::endl;
 
     //6. find TOW from SUPL assistance
diff --git a/src/utils/matlab/galileo_e1_dll_pll_veml_plot_sample_32bits.m b/src/utils/matlab/galileo_e1_dll_pll_veml_plot_sample.m
similarity index 57%
rename from src/utils/matlab/galileo_e1_dll_pll_veml_plot_sample_32bits.m
rename to src/utils/matlab/galileo_e1_dll_pll_veml_plot_sample.m
index 6acbc3268..7e543b180 100644
--- a/src/utils/matlab/galileo_e1_dll_pll_veml_plot_sample_32bits.m
+++ b/src/utils/matlab/galileo_e1_dll_pll_veml_plot_sample.m
@@ -1,5 +1,5 @@
 % /*!
-%  * \file galileo_l1_ca_dll_pll_vml_plot_sample_64bits.m
+%  * \file galileo_l1_ca_dll_pll_vml_plot_sample.m
 %  * \brief Read GNSS-SDR Tracking dump binary file using the provided
 %  function and plot some internal variables
 %  * \author Javier Arribas, 2011. jarribas(at)cttc.es
@@ -29,26 +29,32 @@
 %  */ 
 close all;
 clear all;
-samplingFreq       = 20480000/4;     %[Hz]
-channels=8;
-%path='/home/javier/workspace/gnss-sdr/trunk/install/';
-path='/home/gnss/workspace/gnss-sdr/trunk/data/';
-clear PRN_absolute_sample_start;
+
+if ~exist('galileo_e1_dll_pll_veml_read_tracking_dump.m','file')
+    addpath('./libs')
+end
+
+samplingFreq = 5000000;     %[Hz]
+channels = 7;   % Number of channels
+first_channel = 0;  % Number of the first channel
+
+path = '/Users/carlesfernandez/git/cttc/build/';  %% CHANGE THIS PATH
+
 for N=1:1:channels
-    tracking_log_path=[path 'veml_tracking_ch_' num2str(N-1) '.dat'];
-    GNSS_tracking(N)= galileo_e1_dll_pll_veml_read_tracking_dump_32bits(tracking_log_path);   
+    tracking_log_path = [path 'track_ch' num2str(N+first_channel-1) '.dat']; %% CHANGE track_ch BY YOUR dump_filename
+    GNSS_tracking(N)= galileo_e1_dll_pll_veml_read_tracking_dump(tracking_log_path);   
 end
 
 % GNSS-SDR format conversion to MATLAB GPS receiver
 
 for N=1:1:channels
         trackResults(N).status = 'T'; %fake track
-        trackResults(N).codeFreq = GNSS_tracking(N).code_freq_hz.';
-        trackResults(N).carrFreq = GNSS_tracking(N).carrier_doppler_hz.';
-        trackResults(N).dllDiscr = GNSS_tracking(N).code_error.';
-        trackResults(N).dllDiscrFilt = GNSS_tracking(N).code_nco.';
-        trackResults(N).pllDiscr = GNSS_tracking(N).carr_error.';
-        trackResults(N).pllDiscrFilt = GNSS_tracking(N).carr_nco.';
+        trackResults(N).codeFreq       = GNSS_tracking(N).code_freq_hz.';
+        trackResults(N).carrFreq       = GNSS_tracking(N).carrier_doppler_hz.';
+        trackResults(N).dllDiscr       = GNSS_tracking(N).code_error.';
+        trackResults(N).dllDiscrFilt   = GNSS_tracking(N).code_nco.';
+        trackResults(N).pllDiscr       = GNSS_tracking(N).carr_error.';
+        trackResults(N).pllDiscrFilt   = GNSS_tracking(N).carr_nco.';
 
         trackResults(N).I_P = GNSS_tracking(N).prompt_I.';
         trackResults(N).Q_P = GNSS_tracking(N).prompt_Q.';
@@ -61,7 +67,7 @@ for N=1:1:channels
         trackResults(N).Q_E = zeros(1,length(GNSS_tracking(N).E));
         trackResults(N).Q_L = zeros(1,length(GNSS_tracking(N).L));
         trackResults(N).Q_VL = zeros(1,length(GNSS_tracking(N).VL));
-        trackResults(N).PRN = N; %fake PRN
+        trackResults(N).PRN = GNSS_tracking(N).PRN.';
         
         % Use original MATLAB tracking plot function
         settings.numberOfChannels = channels;
@@ -69,25 +75,5 @@ for N=1:1:channels
         plotVEMLTracking(N,trackResults,settings)
 end
 
-% for N=1:1:channels
-% %  figure;
-% %  plot([GNSS_tracking(N).E,GNSS_tracking(N).P,GNSS_tracking(N).L],'-*');
-% %  title(['Early, Prompt, and Late correlator absolute value output for channel ' num2str(N)']);
-% %  figure;
-% %  plot(GNSS_tracking(N).prompt_I,GNSS_tracking(N).prompt_Q,'+');
-% %  title(['Navigation constellation plot for channel ' num2str(N)]);
-% %  figure;
-% %  
-% %  plot(GNSS_tracking(N).prompt_Q,'r');
-% %  hold on;
-% %  plot(GNSS_tracking(N).prompt_I);
-% %  title(['Navigation symbols I(red) Q(blue) for channel ' num2str(N)]);
-% %  
-%  figure;
-%  t=0:4:length(GNSS_tracking(N).carrier_doppler_hz)*4-1;
-%  t=t/1000;
-%  plot(t,GNSS_tracking(N).carrier_doppler_hz/1000);
-%  xlabel('Time(s)');ylabel('Doppler(KHz)');title(['Doppler frequency channel ' num2str(N)]);
-% end
 
 
diff --git a/src/utils/matlab/galileo_e1_dll_pll_veml_plot_sample_64bits.m b/src/utils/matlab/galileo_e1_dll_pll_veml_plot_sample_64bits.m
deleted file mode 100644
index 798b5f30b..000000000
--- a/src/utils/matlab/galileo_e1_dll_pll_veml_plot_sample_64bits.m
+++ /dev/null
@@ -1,93 +0,0 @@
-% /*!
-%  * \file galileo_l1_ca_dll_pll_vml_plot_sample_64bits.m
-%  * \brief Read GNSS-SDR Tracking dump binary file using the provided
-%  function and plot some internal variables
-%  * \author Javier Arribas, 2011. jarribas(at)cttc.es
-%  * -------------------------------------------------------------------------
-%  *
-%  * Copyright (C) 2010-2011  (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 <http://www.gnu.org/licenses/>.
-%  *
-%  * -------------------------------------------------------------------------
-%  */ 
-close all;
-clear all;
-samplingFreq       = 64e6/8;     %[Hz]
-channels=1;
-%path='/home/javier/workspace/gnss-sdr/trunk/install/';
-path='/home/luis/dev/gnss-sdr/trunk/data/';
-clear PRN_absolute_sample_start;
-for N=1:1:channels
-    tracking_log_path=[path 'veml_tracking_ch_' num2str(N-1) '.dat'];
-    GNSS_tracking(N)= galileo_e1_dll_pll_veml_read_tracking_dump(tracking_log_path);   
-end
-
-% GNSS-SDR format conversion to MATLAB GPS receiver
-
-for N=1:1:channels
-        trackResults(N).status='T'; %fake track
-        trackResults(N).codeFreq=GNSS_tracking(N).code_freq_hz.';
-        trackResults(N).carrFreq=GNSS_tracking(N).carrier_doppler_hz.';
-        trackResults(N).dllDiscr       = GNSS_tracking(N).code_error.';
-        trackResults(N).dllDiscrFilt   = GNSS_tracking(N).code_nco.';
-        trackResults(N).pllDiscr       = GNSS_tracking(N).carr_error.';
-        trackResults(N).pllDiscrFilt   = GNSS_tracking(N).carr_nco.';
-
-        trackResults(N).I_P=GNSS_tracking(N).prompt_I.';
-        trackResults(N).Q_P=GNSS_tracking(N).prompt_Q.';
-
-        trackResults(N).I_VE= GNSS_tracking(N).VE.';
-        trackResults(N).I_E= GNSS_tracking(N).E.';
-        trackResults(N).I_L = GNSS_tracking(N).L.';
-        trackResults(N).I_VL = GNSS_tracking(N).VL.';
-        trackResults(N).Q_VE = zeros(1,length(GNSS_tracking(N).VE));
-        trackResults(N).Q_E = zeros(1,length(GNSS_tracking(N).E));
-        trackResults(N).Q_L =zeros(1,length(GNSS_tracking(N).L));
-        trackResults(N).Q_VL =zeros(1,length(GNSS_tracking(N).VL));
-        trackResults(N).PRN=N; %fake PRN
-        
-        % Use original MATLAB tracking plot function
-        settings.numberOfChannels=channels;
-        settings.msToProcess=length(GNSS_tracking(N).E)*4;
-        plotVEMLTracking(N,trackResults,settings)
-end
-
-% for N=1:1:channels
-% %  figure;
-% %  plot([GNSS_tracking(N).E,GNSS_tracking(N).P,GNSS_tracking(N).L],'-*');
-% %  title(['Early, Prompt, and Late correlator absolute value output for channel ' num2str(N)']);
-% %  figure;
-% %  plot(GNSS_tracking(N).prompt_I,GNSS_tracking(N).prompt_Q,'+');
-% %  title(['Navigation constellation plot for channel ' num2str(N)]);
-% %  figure;
-% %  
-% %  plot(GNSS_tracking(N).prompt_Q,'r');
-% %  hold on;
-% %  plot(GNSS_tracking(N).prompt_I);
-% %  title(['Navigation symbols I(red) Q(blue) for channel ' num2str(N)]);
-% %  
-%  figure;
-%  t=0:4:length(GNSS_tracking(N).carrier_doppler_hz)*4-1;
-%  t=t/1000;
-%  plot(t,GNSS_tracking(N).carrier_doppler_hz/1000);
-%  xlabel('Time(s)');ylabel('Doppler(KHz)');title(['Doppler frequency channel ' num2str(N)]);
-% end
-
-
diff --git a/src/utils/matlab/galileo_e1b_observables_plot_sample.m b/src/utils/matlab/galileo_e1b_observables_plot_sample.m
deleted file mode 100644
index 604be3fe3..000000000
--- a/src/utils/matlab/galileo_e1b_observables_plot_sample.m
+++ /dev/null
@@ -1,22 +0,0 @@
-% Read observables dump
-
-clear all;
-close all;
-
-%IFEN NSR Sampler Fs=20480000
-% GNSS-SDR decimation factor 8
-samplingFreq       = 20480000/8;     %[Hz]
-channels=4;
-path='/home/gnss/workspace/gnss-sdr/trunk/install/';
-observables_log_path=[path 'observables.dat'];
-GNSS_observables= gps_l1_ca_read_observables_dump(channels,observables_log_path);   
-
-
-skip=9000;
-ref_channel=1;
-plot(GNSS_observables.d_TOW_at_current_symbol(ref_channel,skip:end),GNSS_observables.Pseudorange_m(:,skip:end).')
-title('psudoranges');
-figure                   
-plot(GNSS_observables.d_TOW_at_current_symbol(ref_channel,skip:end),GNSS_observables.Prn_timestamp_ms(:,skip:end).')                       
-title('Prn_timestamps');
-  
\ No newline at end of file
diff --git a/src/utils/matlab/galileo_e5a_dll_pll_plot_sample_64bits.m b/src/utils/matlab/galileo_e5a_dll_pll_plot_sample.m
similarity index 69%
rename from src/utils/matlab/galileo_e5a_dll_pll_plot_sample_64bits.m
rename to src/utils/matlab/galileo_e5a_dll_pll_plot_sample.m
index 6a4c993e3..54ee9d81e 100644
--- a/src/utils/matlab/galileo_e5a_dll_pll_plot_sample_64bits.m
+++ b/src/utils/matlab/galileo_e5a_dll_pll_plot_sample.m
@@ -1,5 +1,5 @@
 % /*!
-%  * \file galileo_e5a_dll_pll_plot_sample_64bits.m
+%  * \file galileo_e5a_dll_pll_plot_sample.m
 %  * \brief Read GNSS-SDR Tracking dump binary file using the provided
 %  function and plot some internal variables
 %  * \author Javier Arribas, Marc Sales 2014. jarribas(at)cttc.es
@@ -30,41 +30,48 @@
 %  */ 
 close all;
 clear all;
-samplingFreq       =  64e6/32;     %[Hz]
-channels=1;
-%path='/home/javier/workspace/gnss-sdr/trunk/install/';
-path='/home/marc/git/gnss-sdr/data/';
-clear PRN_absolute_sample_start;
+
+if ~exist('gps_l1_ca_dll_pll_read_tracking_dump.m','file')
+    addpath('./libs')
+end
+
+
+samplingFreq = 5000000;     %[Hz]
+channels = 1;
+first_channel = 30;
+
+path = '/Users/carlesfernandez/git/cttc/build/';  %% CHANGE THIS PATH
+
 for N=1:1:channels
-    tracking_log_path=[path 'e5a_tracking_ch_' num2str(N-1) '.dat'];
-    GNSS_tracking(N)= gps_l1_ca_dll_pll_read_tracking_dump_64bits(tracking_log_path);   
+    tracking_log_path = [path 'tracking_ch_' num2str(N+first_channel-1) '.dat']; %% CHANGE tracking_ch_ BY YOUR dump_filename
+    GNSS_tracking(N)= gps_l1_ca_dll_pll_read_tracking_dump(tracking_log_path);   
 end
 
 % GNSS-SDR format conversion to MATLAB GPS receiver
 
 for N=1:1:channels
-        trackResults(N).status='T'; %fake track
-        trackResults(N).codeFreq=GNSS_tracking(N).code_freq_hz.';
-        trackResults(N).carrFreq=GNSS_tracking(N).carrier_doppler_hz.';
+        trackResults(N).status = 'T'; %fake track
+        trackResults(N).codeFreq = GNSS_tracking(N).code_freq_hz.';
+        trackResults(N).carrFreq = GNSS_tracking(N).carrier_doppler_hz.';
         trackResults(N).dllDiscr       = GNSS_tracking(N).code_error.';
         trackResults(N).dllDiscrFilt   = GNSS_tracking(N).code_nco.';
         trackResults(N).pllDiscr       = GNSS_tracking(N).carr_error.';
         trackResults(N).pllDiscrFilt   = GNSS_tracking(N).carr_nco.';
 
-        trackResults(N).I_PN=GNSS_tracking(N).prompt_I.';
-        trackResults(N).Q_PN=GNSS_tracking(N).prompt_Q.';
-        trackResults(N).Q_P=zeros(1,length(GNSS_tracking(N).P));
-        trackResults(N).I_P=GNSS_tracking(N).P.';
+        trackResults(N).I_PN = GNSS_tracking(N).prompt_I.';
+        trackResults(N).Q_PN = GNSS_tracking(N).prompt_Q.';
+        trackResults(N).Q_P = zeros(1,length(GNSS_tracking(N).P));
+        trackResults(N).I_P = GNSS_tracking(N).P.';
 
-        trackResults(N).I_E= GNSS_tracking(N).E.';
+        trackResults(N).I_E = GNSS_tracking(N).E.';
         trackResults(N).I_L = GNSS_tracking(N).L.';
         trackResults(N).Q_E = zeros(1,length(GNSS_tracking(N).E));
-        trackResults(N).Q_L =zeros(1,length(GNSS_tracking(N).E));
-        trackResults(N).PRN=N; %fake PRN
+        trackResults(N).Q_L = zeros(1,length(GNSS_tracking(N).E));
+        trackResults(N).PRN = GNSS_tracking(N).PRN.';
         
         % Use original MATLAB tracking plot function
-        settings.numberOfChannels=channels;
-        settings.msToProcess=length(GNSS_tracking(N).E);
+        settings.numberOfChannels = channels;
+        settings.msToProcess = length(GNSS_tracking(N).E);
         plotTrackingE5a(N,trackResults,settings)
 end
 
diff --git a/src/utils/matlab/gps_l1_ca_dll_fll_pll_plot_sample.m b/src/utils/matlab/gps_l1_ca_dll_fll_pll_plot_sample.m
deleted file mode 100644
index 155bc5cf0..000000000
--- a/src/utils/matlab/gps_l1_ca_dll_fll_pll_plot_sample.m
+++ /dev/null
@@ -1,88 +0,0 @@
-% /*!
-%  * \file gps_l1_ca_dll_fll_pll_plot_sample.m
-%  * \brief Read GNSS-SDR Tracking dump binary file using the provided
-%  function and plot some internal variables
-%  * \author Javier Arribas, 2011. jarribas(at)cttc.es
-%  * -------------------------------------------------------------------------
-%  *
-%  * Copyright (C) 2010-2011  (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 <http://www.gnu.org/licenses/>.
-%  *
-%  * -------------------------------------------------------------------------
-%  */ 
-%close all;
-%clear all;
-samplingFreq       = 64e6/16;     %[Hz]
-channels=4;
-path='/home/javier/workspace/gnss-sdr-ref/trunk/install/';
-for N=1:1:channels
-    tracking_log_path=[path 'tracking_ch_' num2str(N-1) '.dat'];
-    GNSS_tracking(N)= gps_l1_ca_dll_fll_pll_read_tracking_dump(tracking_log_path,samplingFreq);   
-end
-
-% GNSS-SDR format conversion to MATLAB GPS receiver
-channel_PRN_ID=[32,14,20,11];
-tracking_loop_start=1;%10001;
-tracking_loop_end=70000;
-for N=1:1:channels
-        trackResults_sdr(N).status='T'; %fake track
-        trackResults_sdr(N).codeFreq=GNSS_tracking(N).code_freq_hz(tracking_loop_start:tracking_loop_end).';
-        trackResults_sdr(N).carrFreq=GNSS_tracking(N).carrier_doppler_hz(tracking_loop_start:tracking_loop_end).';
-        trackResults_sdr(N).dllDiscr       = GNSS_tracking(N).code_error_chips(tracking_loop_start:tracking_loop_end).';
-        trackResults_sdr(N).dllDiscrFilt   = GNSS_tracking(N).code_phase_samples(tracking_loop_start:tracking_loop_end).';
-        trackResults_sdr(N).pllDiscr       = GNSS_tracking(N).PLL_discriminator_hz(tracking_loop_start:tracking_loop_end).';
-        trackResults_sdr(N).pllDiscrFilt   = GNSS_tracking(N).carr_nco(tracking_loop_start:tracking_loop_end).';
-        trackResults_sdr(N).absoluteSample = (GNSS_tracking(N).var2(tracking_loop_start:tracking_loop_end)+GNSS_tracking(N).var1(tracking_loop_start:tracking_loop_end)).';
-        
-        trackResults_sdr(N).prn_delay_ms = 1000*trackResults_sdr(N).absoluteSample/samplingFreq;
-        %trackResults_sdr(N).absoluteSample = (GNSS_tracking(N).PRN_start_sample(tracking_loop_start:tracking_loop_end)+GNSS_tracking(N).var1(tracking_loop_start:tracking_loop_end)).';
-
-        trackResults_sdr(N).I_P=GNSS_tracking(N).prompt_I(tracking_loop_start:tracking_loop_end).';
-        trackResults_sdr(N).Q_P=GNSS_tracking(N).prompt_Q(tracking_loop_start:tracking_loop_end).';
-
-        trackResults_sdr(N).I_E= GNSS_tracking(N).E(tracking_loop_start:tracking_loop_end).';
-        trackResults_sdr(N).I_L = GNSS_tracking(N).L(tracking_loop_start:tracking_loop_end).';
-        trackResults_sdr(N).Q_E = zeros(1,tracking_loop_end-tracking_loop_start+1);
-        trackResults_sdr(N).Q_L =zeros(1,tracking_loop_end-tracking_loop_start+1);
-        trackResults_sdr(N).PRN=channel_PRN_ID(N);
-        
-        % Use original MATLAB tracking plot function
-        settings.numberOfChannels=channels;
-        settings.msToProcess=tracking_loop_end-tracking_loop_start+1;
-        %plotTracking(N,trackResults_sdr,settings)
-end
-
-
-% for N=1:1:channels
-%  figure;
-%  plot([GNSS_tracking(N).E,GNSS_tracking(N).P,GNSS_tracking(N).L],'-*');
-%  title(['Early, Prompt, and Late correlator absolute value output for channel ' num2str(N)']);
-%  figure;
-%  plot(GNSS_tracking(N).prompt_I,GNSS_tracking(N).prompt_Q,'+');
-%  title(['Navigation constellation plot for channel ' num2str(N)]);
-%  figure;
-%  
-%  plot(GNSS_tracking(N).prompt_Q,'r');
-%  hold on;
-%  plot(GNSS_tracking(N).prompt_I);
-%  title(['Navigation symbols I(red) Q(blue) for channel ' num2str(N)]);
-% end
-
-
diff --git a/src/utils/matlab/gps_l1_ca_dll_pll_plot_sample.m b/src/utils/matlab/gps_l1_ca_dll_pll_plot_sample.m
index faf136e42..c1c884eaa 100644
--- a/src/utils/matlab/gps_l1_ca_dll_pll_plot_sample.m
+++ b/src/utils/matlab/gps_l1_ca_dll_pll_plot_sample.m
@@ -29,54 +29,47 @@
 %  */ 
 close all;
 clear all;
-samplingFreq       = 64e6/16;     %[Hz]
-channels=4;
-path='/home/javier/workspace/gnss-sdr/trunk/install/';
-clear PRN_absolute_sample_start;
+
+if ~exist('gps_l1_ca_dll_pll_read_tracking_dump.m','file')
+    addpath('./libs')
+end
+
+
+samplingFreq = 2600000;     %[Hz]
+channels = 2;
+first_channel = 0;
+
+path = '/home/javier/git/gnss-sdr/build/';  %% CHANGE THIS PATH
+
 for N=1:1:channels
-    tracking_log_path=[path 'tracking_ch_' num2str(N-1) '.dat'];
-    GNSS_tracking(N)= gps_l1_ca_dll_pll_read_tracking_dump(tracking_log_path);   
+    tracking_log_path = [path 'tracking_ch_' num2str(N+first_channel-1) '.dat']; %% CHANGE epl_tracking_ch_ BY YOUR dump_filename
+    GNSS_tracking(N)= gps_l1_ca_dll_pll_read_tracking_dump(tracking_log_path);
 end
 
 % GNSS-SDR format conversion to MATLAB GPS receiver
 
 for N=1:1:channels
-        trackResults(N).status='T'; %fake track
-        trackResults(N).codeFreq=GNSS_tracking(N).code_freq_hz.';
-        trackResults(N).carrFreq=GNSS_tracking(N).carrier_doppler_hz.';
+        trackResults(N).status = 'T'; %fake track
+        trackResults(N).codeFreq       = GNSS_tracking(N).code_freq_hz.';
+        trackResults(N).carrFreq       = GNSS_tracking(N).carrier_doppler_hz.';
         trackResults(N).dllDiscr       = GNSS_tracking(N).code_error.';
         trackResults(N).dllDiscrFilt   = GNSS_tracking(N).code_nco.';
         trackResults(N).pllDiscr       = GNSS_tracking(N).carr_error.';
         trackResults(N).pllDiscrFilt   = GNSS_tracking(N).carr_nco.';
 
-        trackResults(N).I_P=GNSS_tracking(N).prompt_I.';
-        trackResults(N).Q_P=GNSS_tracking(N).prompt_Q.';
+        trackResults(N).I_P = GNSS_tracking(N).prompt_I.';
+        trackResults(N).Q_P = GNSS_tracking(N).prompt_Q.';
 
-        trackResults(N).I_E= GNSS_tracking(N).E.';
+        trackResults(N).I_E = GNSS_tracking(N).E.';
         trackResults(N).I_L = GNSS_tracking(N).L.';
         trackResults(N).Q_E = zeros(1,length(GNSS_tracking(N).E));
-        trackResults(N).Q_L =zeros(1,length(GNSS_tracking(N).E));
-        trackResults(N).PRN=N; %fake PRN
+        trackResults(N).Q_L = zeros(1,length(GNSS_tracking(N).E));
+        trackResults(N).PRN = ones(1,length(GNSS_tracking(N).E));
         
         % Use original MATLAB tracking plot function
-        settings.numberOfChannels=channels;
-        settings.msToProcess=length(GNSS_tracking(N).E);
+        settings.numberOfChannels = channels;
+        settings.msToProcess = length(GNSS_tracking(N).E);
         plotTracking(N,trackResults,settings)
 end
 
-% for N=1:1:channels
-%  figure;
-%  plot([GNSS_tracking(N).E,GNSS_tracking(N).P,GNSS_tracking(N).L],'-*');
-%  title(['Early, Prompt, and Late correlator absolute value output for channel ' num2str(N)']);
-%  figure;
-%  plot(GNSS_tracking(N).prompt_I,GNSS_tracking(N).prompt_Q,'+');
-%  title(['Navigation constellation plot for channel ' num2str(N)]);
-%  figure;
-%  
-%  plot(GNSS_tracking(N).prompt_Q,'r');
-%  hold on;
-%  plot(GNSS_tracking(N).prompt_I);
-%  title(['Navigation symbols I(red) Q(blue) for channel ' num2str(N)]);
-% end
-
 
diff --git a/src/utils/matlab/gps_l1_ca_dll_pll_plot_sample_64bits.m b/src/utils/matlab/gps_l1_ca_dll_pll_plot_sample_64bits.m
deleted file mode 100644
index b3ed5ca33..000000000
--- a/src/utils/matlab/gps_l1_ca_dll_pll_plot_sample_64bits.m
+++ /dev/null
@@ -1,89 +0,0 @@
-% /*!
-%  * \file gps_l1_ca_dll_pll_plot_sample_64bits.m
-%  * \brief Read GNSS-SDR Tracking dump binary file using the provided
-%  function and plot some internal variables
-%  * \author Javier Arribas, 2011. jarribas(at)cttc.es
-%  * -------------------------------------------------------------------------
-%  *
-%  * Copyright (C) 2010-2011  (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 <http://www.gnu.org/licenses/>.
-%  *
-%  * -------------------------------------------------------------------------
-%  */ 
-close all;
-clear all;
-samplingFreq       =  64e6/32;     %[Hz]
-channels=1;
-%path='/home/javier/workspace/gnss-sdr/trunk/install/';
-path='/home/luis/dev/gnss-sdr/trunk/data/';
-clear PRN_absolute_sample_start;
-for N=1:1:channels
-    tracking_log_path=[path 'tracking_ch_' num2str(N-1) '.dat'];
-    GNSS_tracking(N)= gps_l1_ca_dll_pll_read_tracking_dump_64bits(tracking_log_path);   
-end
-
-% GNSS-SDR format conversion to MATLAB GPS receiver
-
-for N=1:1:channels
-        trackResults(N).status='T'; %fake track
-        trackResults(N).codeFreq=GNSS_tracking(N).code_freq_hz.';
-        trackResults(N).carrFreq=GNSS_tracking(N).carrier_doppler_hz.';
-        trackResults(N).dllDiscr       = GNSS_tracking(N).code_error.';
-        trackResults(N).dllDiscrFilt   = GNSS_tracking(N).code_nco.';
-        trackResults(N).pllDiscr       = GNSS_tracking(N).carr_error.';
-        trackResults(N).pllDiscrFilt   = GNSS_tracking(N).carr_nco.';
-
-        trackResults(N).I_P=GNSS_tracking(N).prompt_I.';
-        trackResults(N).Q_P=GNSS_tracking(N).prompt_Q.';
-
-        trackResults(N).I_E= GNSS_tracking(N).E.';
-        trackResults(N).I_L = GNSS_tracking(N).L.';
-        trackResults(N).Q_E = zeros(1,length(GNSS_tracking(N).E));
-        trackResults(N).Q_L =zeros(1,length(GNSS_tracking(N).E));
-        trackResults(N).PRN=N; %fake PRN
-        
-        % Use original MATLAB tracking plot function
-        settings.numberOfChannels=channels;
-        settings.msToProcess=length(GNSS_tracking(N).E);
-        plotTracking(N,trackResults,settings)
-end
-
-for N=1:1:channels
-%  figure;
-%  plot([GNSS_tracking(N).E,GNSS_tracking(N).P,GNSS_tracking(N).L],'-*');
-%  title(['Early, Prompt, and Late correlator absolute value output for channel ' num2str(N)']);
-%  figure;
-%  plot(GNSS_tracking(N).prompt_I,GNSS_tracking(N).prompt_Q,'+');
-%  title(['Navigation constellation plot for channel ' num2str(N)]);
-%  figure;
-%  
-%  plot(GNSS_tracking(N).prompt_Q,'r');
-%  hold on;
-%  plot(GNSS_tracking(N).prompt_I);
-%  title(['Navigation symbols I(red) Q(blue) for channel ' num2str(N)]);
-%  
- figure;
- t=0:length(GNSS_tracking(N).carrier_doppler_hz)-1;
- t=t/1000;
- plot(t,GNSS_tracking(N).carrier_doppler_hz/1000);
- xlabel('Time(s)');ylabel('Doppler(KHz)');title(['Doppler frequency channel ' num2str(N)]);
-end
-
-
diff --git a/src/utils/matlab/gps_l1_ca_observables_plot_sample.m b/src/utils/matlab/gps_l1_ca_observables_plot_sample.m
deleted file mode 100644
index c7a85a60f..000000000
--- a/src/utils/matlab/gps_l1_ca_observables_plot_sample.m
+++ /dev/null
@@ -1,9 +0,0 @@
-% Read observables dump
-
-%clear all;
-
-samplingFreq       = 64e6/16;     %[Hz]
-channels=4;
-path='/home/gnss/workspace/gnss-sdr/trunk/install/';
-observables_log_path=[path 'observables.dat'];
-GNSS_observables= gps_l1_ca_read_observables_dump(channels,observables_log_path);   
diff --git a/src/utils/matlab/hybrid_observables_plot_sample.m b/src/utils/matlab/hybrid_observables_plot_sample.m
new file mode 100644
index 000000000..8857da352
--- /dev/null
+++ b/src/utils/matlab/hybrid_observables_plot_sample.m
@@ -0,0 +1,115 @@
+% Read observables dump
+
+%clear all;
+clearvars;
+close all;
+addpath('./libs');
+samplingFreq       = 2600000;     %[Hz]
+channels=2;
+path='/home/javier/git/gnss-sdr/build/';
+observables_log_path=[path 'observables.dat'];
+GNSS_observables= read_hybrid_observables_dump(channels,observables_log_path);
+
+%optional:
+%search all channels having good satellite simultaneously
+min_idx=1;
+for n=1:1:channels
+    idx=find(GNSS_observables.valid(n,:)>0,1,'first');
+    if min_idx<idx
+        min_idx=idx;
+    end
+end
+
+min_idx=min_idx;
+%plot observables from that index
+figure;
+plot(GNSS_observables.RX_time(1,min_idx+1:end),GNSS_observables.Pseudorange_m(:,min_idx+1:end)');
+title('Pseudoranges [m]')
+xlabel('TOW [s]')
+ylabel('[m]');
+
+figure;
+plot(GNSS_observables.RX_time(1,min_idx+1:end),GNSS_observables.Carrier_phase_hz(:,min_idx+1:end)');
+title('Accumulated carrier phase')
+xlabel('TOW [s]')
+ylabel('[cycles]');
+
+figure;
+plot(GNSS_observables.RX_time(1,min_idx+1:end),GNSS_observables.Carrier_Doppler_hz(:,min_idx+1:end)');
+title('Doppler frequency')
+xlabel('TOW [s]')
+ylabel('[Hz]');
+
+
+%read true obs from simulator (optional)
+GPS_STARTOFFSET_s = 68.802e-3;
+
+true_observables_log_path='/home/javier/git/gnss-sdr/build/obs_out.bin';
+GNSS_true_observables= read_true_sim_observables_dump(true_observables_log_path);
+
+%correct the clock error using true values (it is not possible for a receiver to correct
+%the receiver clock offset error at the observables level because it is required the
+%decoding of the ephemeris data and solve the PVT equations)
+
+SPEED_OF_LIGHT_M_S = 299792458.0; 
+
+%find the reference satellite
+[~,ref_sat_ch]=min(GNSS_observables.Pseudorange_m(:,min_idx+1));
+shift_time_s=GNSS_true_observables.Pseudorange_m(ref_sat_ch,:)/SPEED_OF_LIGHT_M_S-GPS_STARTOFFSET_s;
+
+
+%Compute deltas if required and interpolate to measurement time
+delta_true_psudorange_m=GNSS_true_observables.Pseudorange_m(1,:)-GNSS_true_observables.Pseudorange_m(2,:);
+delta_true_interp_psudorange_m=interp1(GNSS_true_observables.RX_time(1,:)-shift_time_s, ...
+    delta_true_psudorange_m,GNSS_observables.RX_time(1,min_idx+1:end),'lineal','extrap');
+true_interp_acc_carrier_phase_ch1_hz=interp1(GNSS_true_observables.RX_time(1,:)-shift_time_s, ...
+    GNSS_true_observables.Carrier_phase_hz(1,:),GNSS_observables.RX_time(1,min_idx+1:end),'lineal','extrap');
+true_interp_acc_carrier_phase_ch2_hz=interp1(GNSS_true_observables.RX_time(1,:)-shift_time_s, ...
+    GNSS_true_observables.Carrier_phase_hz(2,:),GNSS_observables.RX_time(2,min_idx+1:end),'lineal','extrap');
+
+%Compute measurement errors
+
+delta_measured_psudorange_m=GNSS_observables.Pseudorange_m(1,min_idx+1:end)-GNSS_observables.Pseudorange_m(2,min_idx+1:end);
+psudorange_error_m=delta_measured_psudorange_m-delta_true_interp_psudorange_m;
+psudorange_rms_m=sqrt(sum(psudorange_error_m.^2)/length(psudorange_error_m))
+
+acc_carrier_error_ch1_hz=GNSS_observables.Carrier_phase_hz(1,min_idx+1:end)-true_interp_acc_carrier_phase_ch1_hz...
+    -GNSS_observables.Carrier_phase_hz(1,min_idx+1)+true_interp_acc_carrier_phase_ch1_hz(1);
+
+acc_phase_rms_ch1_hz=sqrt(sum(acc_carrier_error_ch1_hz.^2)/length(acc_carrier_error_ch1_hz))
+
+acc_carrier_error_ch2_hz=GNSS_observables.Carrier_phase_hz(2,min_idx+1:end)-true_interp_acc_carrier_phase_ch2_hz...
+    -GNSS_observables.Carrier_phase_hz(2,min_idx+1)+true_interp_acc_carrier_phase_ch2_hz(1);
+acc_phase_rms_ch2_hz=sqrt(sum(acc_carrier_error_ch2_hz.^2)/length(acc_carrier_error_ch2_hz))
+
+
+%plot results
+figure;
+plot(GNSS_true_observables.RX_time(1,:),delta_true_psudorange_m,'g');
+hold on;
+plot(GNSS_observables.RX_time(1,min_idx+1:end),delta_measured_psudorange_m,'b');
+title('TRUE vs. measured Pseudoranges [m]')
+xlabel('TOW [s]')
+ylabel('[m]');
+
+figure;
+plot(GNSS_observables.RX_time(1,min_idx+1:end),psudorange_error_m)
+title('Pseudoranges error [m]')
+xlabel('TOW [s]')
+ylabel('[m]');
+
+figure;
+plot(GNSS_observables.RX_time(1,min_idx+1:end),acc_carrier_error_ch1_hz)
+title('Accumulated carrier phase error CH1 [hz]')
+xlabel('TOW [s]')
+ylabel('[hz]');
+
+figure;
+plot(GNSS_observables.RX_time(1,min_idx+1:end),acc_carrier_error_ch2_hz)
+title('Accumulated carrier phase error CH2 [hz]')
+xlabel('TOW [s]')
+ylabel('[hz]');
+
+
+
+
diff --git a/src/utils/matlab/libs/galileo_e1_dll_pll_veml_read_tracking_dump.m b/src/utils/matlab/libs/galileo_e1_dll_pll_veml_read_tracking_dump.m
index 4be05dd3a..0ccb1bb40 100644
--- a/src/utils/matlab/libs/galileo_e1_dll_pll_veml_read_tracking_dump.m
+++ b/src/utils/matlab/libs/galileo_e1_dll_pll_veml_read_tracking_dump.m
@@ -25,23 +25,39 @@
 %  * along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
 %  *
 %  * -------------------------------------------------------------------------
-%  */             
-function [GNSS_tracking] = galileo_e1_dll_pll_veml_read_tracking_dump (filename, count)
+%  */         
 
+function [GNSS_tracking] = galileo_e1_dll_pll_veml_read_tracking_dump (filename, count)
   %% usage: galileo_e1_dll_pll_veml_read_tracking_dump (filename, [count])
   %%
   %% open GNSS-SDR tracking binary log file .dat and return the contents
   %%
 
   m = nargchk (1,2,nargin);
-  num_float_vars=17;
-  num_unsigned_long_int_vars=1;
-  num_double_vars=1;
-  double_size_bytes=8;
-  unsigned_long_int_size_bytes=8;
-  float_size_bytes=4;
-  skip_bytes_each_read=float_size_bytes*num_float_vars+unsigned_long_int_size_bytes*num_unsigned_long_int_vars+double_size_bytes*num_double_vars;
-  bytes_shift=0;
+  
+  num_float_vars = 17;
+  num_unsigned_long_int_vars = 1;
+  num_double_vars = 1;
+  num_unsigned_int_vars = 1;
+  
+  if(~isempty(strfind(computer('arch'), '64')))
+      % 64-bit computer
+      double_size_bytes = 8;
+      unsigned_long_int_size_bytes = 8;
+      float_size_bytes = 4;
+      unsigned_int_size_bytes = 4;
+  else
+      double_size_bytes = 8;
+      unsigned_long_int_size_bytes = 4;
+      float_size_bytes = 4;
+      unsigned_int_size_bytes = 4;
+  end
+  
+  skip_bytes_each_read = float_size_bytes * num_float_vars + unsigned_long_int_size_bytes * num_unsigned_long_int_vars + ...
+   double_size_bytes * num_double_vars + num_unsigned_int_vars*unsigned_int_size_bytes;
+  
+  bytes_shift = 0;
+        
   if (m)
     usage (m);
   end
@@ -53,140 +69,85 @@ function [GNSS_tracking] = galileo_e1_dll_pll_veml_read_tracking_dump (filename,
   f = fopen (filename, 'rb');
   if (f < 0)
   else
-    v1 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
+    v1 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes);
+        bytes_shift = bytes_shift + float_size_bytes;
+    fseek(f,bytes_shift,'bof'); % move to next float
+    v2 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes);
+        bytes_shift = bytes_shift + float_size_bytes;
+    fseek(f,bytes_shift,'bof'); % move to next float
+    v3 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes);
+        bytes_shift = bytes_shift + float_size_bytes;
+    fseek(f,bytes_shift,'bof'); % move to next float
+    v4 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes);
+        bytes_shift = bytes_shift + float_size_bytes;
+    fseek(f,bytes_shift,'bof'); % move to next float
+    v5 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes);
+        bytes_shift = bytes_shift + float_size_bytes;
+    fseek(f,bytes_shift,'bof'); % move to next float
+    v6 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes);
+        bytes_shift = bytes_shift + float_size_bytes;
+    fseek(f,bytes_shift,'bof'); % move to next float
+    v7 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes);
+        bytes_shift = bytes_shift + float_size_bytes;
     fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v2 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
+    v8 = fread (f, count, 'long', skip_bytes_each_read - unsigned_long_int_size_bytes);
+        bytes_shift = bytes_shift + unsigned_long_int_size_bytes;
+    fseek(f,bytes_shift,'bof'); % move to next float
+    v9 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes);
+        bytes_shift = bytes_shift + float_size_bytes;
+    fseek(f,bytes_shift,'bof'); % move to next float
+    v10 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes);
+        bytes_shift = bytes_shift + float_size_bytes;
+    fseek(f,bytes_shift,'bof'); % move to next float
+    v11 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes);
+        bytes_shift = bytes_shift + float_size_bytes;
+    fseek(f,bytes_shift,'bof'); % move to next float
+    v12 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes);
+        bytes_shift = bytes_shift + float_size_bytes;
+    fseek(f,bytes_shift,'bof'); % move to next float
+    v13 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes);
+        bytes_shift = bytes_shift + float_size_bytes;
+    fseek(f,bytes_shift,'bof'); % move to next float
+    v14 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes);
+        bytes_shift = bytes_shift + float_size_bytes;
+    fseek(f,bytes_shift,'bof'); % move to next float
+    v15 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes);
+        bytes_shift = bytes_shift + float_size_bytes;
+    fseek(f,bytes_shift,'bof'); % move to next float
+    v16 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes);
+        bytes_shift = bytes_shift + float_size_bytes;
     fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v3 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v4 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v5 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v6 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v7 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v8 = fread (f, count, 'uint64',skip_bytes_each_read-unsigned_long_int_size_bytes);
-        bytes_shift=bytes_shift+unsigned_long_int_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v9 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v10 = fread (f, count, '*float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v11 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v12 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v13 = fread (f, count, '*float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v14 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v15 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v16 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v17 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-            bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v18 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-            bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v19 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
+    v17 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes);
+        bytes_shift = bytes_shift + float_size_bytes;
+    fseek(f,bytes_shift,'bof'); % move to next float
+    v18 = fread (f, count, 'float', skip_bytes_each_read-float_size_bytes);
+        bytes_shift = bytes_shift + float_size_bytes;
+    fseek(f,bytes_shift,'bof'); % move to next double
+    v19 = fread (f, count, 'double', skip_bytes_each_read - double_size_bytes);  
+        bytes_shift = bytes_shift + double_size_bytes;
+    fseek(f,bytes_shift,'bof'); % move to next unsigned int
+    v20 = fread (f, count, 'uint', skip_bytes_each_read - unsigned_int_size_bytes);
     fclose (f);
     
-    %%%%%%%% output vars %%%%%%%%
-    
-%                     // EPR
-%                     d_dump_file.write((char*)&tmp_VE, sizeof(float));
-%                     d_dump_file.write((char*)&tmp_E, sizeof(float));
-%                     d_dump_file.write((char*)&tmp_P, sizeof(float));
-%                     d_dump_file.write((char*)&tmp_L, sizeof(float));
-%                     d_dump_file.write((char*)&tmp_VL, sizeof(float));
-%                     // PROMPT I and Q (to analyze navigation symbols)
-%                     d_dump_file.write((char*)&prompt_I, sizeof(float));
-%                     d_dump_file.write((char*)&prompt_Q, sizeof(float));
-%                     // PRN start sample stamp
-%                     //tmp_float=(float)d_sample_counter;
-%                     d_dump_file.write((char*)&d_sample_counter, sizeof(unsigned long int));
-%                     // accumulated carrier phase
-%                     d_dump_file.write((char*)&d_acc_carrier_phase_rad, sizeof(float));
-% 
-%                     // carrier and code frequency
-%                     d_dump_file.write((char*)&d_carrier_doppler_hz, sizeof(float));
-%                     d_dump_file.write((char*)&d_code_freq_hz, sizeof(float));
-% 
-%                     //PLL commands
-%                     d_dump_file.write((char*)&carr_error, sizeof(float));
-%                     d_dump_file.write((char*)&carr_nco, sizeof(float));
-% 
-%                     //DLL commands
-%                     d_dump_file.write((char*)&code_error, sizeof(float));
-%                     d_dump_file.write((char*)&code_nco, sizeof(float));
-% 
-%                     // CN0 and carrier lock test
-%                     d_dump_file.write((char*)&d_CN0_SNV_dB_Hz, sizeof(float));
-%                     d_dump_file.write((char*)&d_carrier_lock_test, sizeof(float));
-% 
-%                     // AUX vars (for debug purposes)
-%                     tmp_float = d_rem_code_phase_samples;
-%                     d_dump_file.write((char*)&tmp_float, sizeof(float));
-%                     tmp_double=(double)(d_sample_counter+d_current_prn_length_samples);
-%                     d_dump_file.write((char*)&tmp_double, sizeof(double));
-                
-    VE=v1;
-    E=v2;
-    P=v3;
-    L=v4;
-    VL=v5;
-    prompt_I=v6;
-    prompt_Q=v7;
-    PRN_start_sample=v8;
-    acc_carrier_phase_rad=v9;
-    carrier_doppler_hz=v10;
-    code_freq_hz=v11;
-    carr_error=v12;
-    carr_nco=v13;
-    code_error=v14;
-    code_nco=v15;
-    CN0_SNV_dB_Hz=v16;
-    carrier_lock_test=v17;
-    var1=v18;
-    var2=v19;
-    
-    GNSS_tracking.VE=VE;
-    GNSS_tracking.E=E;
-    GNSS_tracking.P=P;
-    GNSS_tracking.L=L;
-    GNSS_tracking.VL=VL;
-    GNSS_tracking.prompt_I=prompt_I;
-    GNSS_tracking.prompt_Q=prompt_Q;
-    GNSS_tracking.PRN_start_sample=PRN_start_sample;
-    GNSS_tracking.acc_carrier_phase_rad=acc_carrier_phase_rad;
-    GNSS_tracking.carrier_doppler_hz=carrier_doppler_hz;
-    GNSS_tracking.code_freq_hz=code_freq_hz;
-    GNSS_tracking.carr_error=carr_error;
-    GNSS_tracking.carr_nco=carr_nco;
-    GNSS_tracking.code_error=code_error;
-    GNSS_tracking.code_nco=code_nco;
-    GNSS_tracking.CN0_SNV_dB_Hz=CN0_SNV_dB_Hz;
-    GNSS_tracking.carrier_lock_test=carrier_lock_test;
-    GNSS_tracking.var1=var1;
-    GNSS_tracking.var2=var2;
+    GNSS_tracking.VE = v1;
+    GNSS_tracking.E = v2;
+    GNSS_tracking.P = v3;
+    GNSS_tracking.L = v4;
+    GNSS_tracking.VL = v5;
+    GNSS_tracking.prompt_I = v6;
+    GNSS_tracking.prompt_Q = v7;
+    GNSS_tracking.PRN_start_sample = v8;
+    GNSS_tracking.acc_carrier_phase_rad = v9;
+    GNSS_tracking.carrier_doppler_hz = v10;
+    GNSS_tracking.code_freq_hz = v11;
+    GNSS_tracking.carr_error = v12;
+    GNSS_tracking.carr_nco = v13;
+    GNSS_tracking.code_error = v14;
+    GNSS_tracking.code_nco = v15;
+    GNSS_tracking.CN0_SNV_dB_Hz = v16;
+    GNSS_tracking.carrier_lock_test = v17;
+    GNSS_tracking.var1 = v18;
+    GNSS_tracking.var2 = v19;
+    GNSS_tracking.PRN = v20;
   end
   
diff --git a/src/utils/matlab/libs/galileo_e1_dll_pll_veml_read_tracking_dump_32bits.m b/src/utils/matlab/libs/galileo_e1_dll_pll_veml_read_tracking_dump_32bits.m
deleted file mode 100644
index f7dab9fc3..000000000
--- a/src/utils/matlab/libs/galileo_e1_dll_pll_veml_read_tracking_dump_32bits.m
+++ /dev/null
@@ -1,192 +0,0 @@
-% /*!
-%  * \file galileo_e1_dll_pll_veml_read_tracking_dump.m
-%  * \brief Read GNSS-SDR Tracking dump binary file into MATLAB.
-%  * \author Luis Esteve, 2012. luis(at)epsilon-formacion.com
-%  * -------------------------------------------------------------------------
-%  *
-%  * Copyright (C) 2010-2012  (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 <http://www.gnu.org/licenses/>.
-%  *
-%  * -------------------------------------------------------------------------
-%  */             
-function [GNSS_tracking] = galileo_e1_dll_pll_veml_read_tracking_dump_32bits (filename, count)
-
-  %% usage: galileo_e1_dll_pll_veml_read_tracking_dump (filename, [count])
-  %%
-  %% open GNSS-SDR tracking binary log file .dat and return the contents
-  %%
-
-  m = nargchk (1,2,nargin);
-  num_float_vars=17;
-  num_unsigned_long_int_vars=1;
-  num_double_vars=1;
-  double_size_bytes=8;
-  unsigned_long_int_size_bytes=4;
-  float_size_bytes=4;
-  skip_bytes_each_read=float_size_bytes*num_float_vars+unsigned_long_int_size_bytes*num_unsigned_long_int_vars+double_size_bytes*num_double_vars;
-  bytes_shift=0;
-  if (m)
-    usage (m);
-  end
-
-  if (nargin < 2)
-    count = Inf;
-  end
-    %loops_counter = fread (f, count, 'uint32',4*12);
-  f = fopen (filename, 'rb');
-  if (f < 0)
-  else
-    v1 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v2 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v3 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v4 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v5 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v6 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v7 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v8 = fread (f, count, 'uint32',skip_bytes_each_read-unsigned_long_int_size_bytes);
-        bytes_shift=bytes_shift+unsigned_long_int_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v9 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v10 = fread (f, count, '*float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v11 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v12 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v13 = fread (f, count, '*float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v14 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v15 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v16 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v17 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-            bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v18 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-            bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v19 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
-    fclose (f);
-    
-    %%%%%%%% output vars %%%%%%%%
-    
-%                     // EPR
-%                     d_dump_file.write((char*)&tmp_VE, sizeof(float));
-%                     d_dump_file.write((char*)&tmp_E, sizeof(float));
-%                     d_dump_file.write((char*)&tmp_P, sizeof(float));
-%                     d_dump_file.write((char*)&tmp_L, sizeof(float));
-%                     d_dump_file.write((char*)&tmp_VL, sizeof(float));
-%                     // PROMPT I and Q (to analyze navigation symbols)
-%                     d_dump_file.write((char*)&prompt_I, sizeof(float));
-%                     d_dump_file.write((char*)&prompt_Q, sizeof(float));
-%                     // PRN start sample stamp
-%                     //tmp_float=(float)d_sample_counter;
-%                     d_dump_file.write((char*)&d_sample_counter, sizeof(unsigned long int));
-%                     // accumulated carrier phase
-%                     d_dump_file.write((char*)&d_acc_carrier_phase_rad, sizeof(float));
-% 
-%                     // carrier and code frequency
-%                     d_dump_file.write((char*)&d_carrier_doppler_hz, sizeof(float));
-%                     d_dump_file.write((char*)&d_code_freq_hz, sizeof(float));
-% 
-%                     //PLL commands
-%                     d_dump_file.write((char*)&carr_error, sizeof(float));
-%                     d_dump_file.write((char*)&carr_nco, sizeof(float));
-% 
-%                     //DLL commands
-%                     d_dump_file.write((char*)&code_error, sizeof(float));
-%                     d_dump_file.write((char*)&code_nco, sizeof(float));
-% 
-%                     // CN0 and carrier lock test
-%                     d_dump_file.write((char*)&d_CN0_SNV_dB_Hz, sizeof(float));
-%                     d_dump_file.write((char*)&d_carrier_lock_test, sizeof(float));
-% 
-%                     // AUX vars (for debug purposes)
-%                     tmp_float = d_rem_code_phase_samples;
-%                     d_dump_file.write((char*)&tmp_float, sizeof(float));
-%                     tmp_double=(double)(d_sample_counter+d_current_prn_length_samples);
-%                     d_dump_file.write((char*)&tmp_double, sizeof(double));
-                
-    VE=v1;
-    E=v2;
-    P=v3;
-    L=v4;
-    VL=v5;
-    prompt_I=v6;
-    prompt_Q=v7;
-    PRN_start_sample=v8;
-    acc_carrier_phase_rad=v9;
-    carrier_doppler_hz=v10;
-    code_freq_hz=v11;
-    carr_error=v12;
-    carr_nco=v13;
-    code_error=v14;
-    code_nco=v15;
-    CN0_SNV_dB_Hz=v16;
-    carrier_lock_test=v17;
-    var1=v18;
-    var2=v19;
-    
-    GNSS_tracking.VE=VE;
-    GNSS_tracking.E=E;
-    GNSS_tracking.P=P;
-    GNSS_tracking.L=L;
-    GNSS_tracking.VL=VL;
-    GNSS_tracking.prompt_I=prompt_I;
-    GNSS_tracking.prompt_Q=prompt_Q;
-    GNSS_tracking.PRN_start_sample=PRN_start_sample;
-    GNSS_tracking.acc_carrier_phase_rad=acc_carrier_phase_rad;
-    GNSS_tracking.carrier_doppler_hz=carrier_doppler_hz;
-    GNSS_tracking.code_freq_hz=code_freq_hz;
-    GNSS_tracking.carr_error=carr_error;
-    GNSS_tracking.carr_nco=carr_nco;
-    GNSS_tracking.code_error=code_error;
-    GNSS_tracking.code_nco=code_nco;
-    GNSS_tracking.CN0_SNV_dB_Hz=CN0_SNV_dB_Hz;
-    GNSS_tracking.carrier_lock_test=carrier_lock_test;
-    GNSS_tracking.var1=var1;
-    GNSS_tracking.var2=var2;
-  end
-  
diff --git a/src/utils/matlab/libs/gps_l1_ca_dll_pll_read_observables_dump.m b/src/utils/matlab/libs/gps_l1_ca_dll_pll_read_observables_dump.m
deleted file mode 100644
index a5bc2adcc..000000000
--- a/src/utils/matlab/libs/gps_l1_ca_dll_pll_read_observables_dump.m
+++ /dev/null
@@ -1,60 +0,0 @@
-% Javier Arribas 2011             
-function [observables] = gps_l1_ca_dll_pll_read_observables_dump (channels, filename, count)
-
-  %% usage: read_tracking_dat (filename, [count])
-  %%
-  %% open GNSS-SDR tracking binary log file .dat and return the contents
-  %%
-
-  m = nargchk (1,2,nargin);
-  num_double_vars=5;
-  double_size_bytes=8;
-  skip_bytes_each_read=double_size_bytes*num_double_vars*channels;
-  bytes_shift=0;
-  if (m)
-    usage (m);
-  end
-
-  if (nargin < 3)
-    count = Inf;
-  end
-    %loops_counter = fread (f, count, 'uint32',4*12);
-  f = fopen (filename, 'rb');
-  if (f < 0)
-  else
-    for N=1:1:channels
-        observables.preamble_delay_ms(N,:) = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
-        bytes_shift=bytes_shift+double_size_bytes;
-        fseek(f,bytes_shift,'bof'); % move to next interleaved
-        observables.prn_delay_ms(N,:) = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
-        bytes_shift=bytes_shift+double_size_bytes;
-        fseek(f,bytes_shift,'bof'); % move to next interleaved
-        observables.Pseudorange_m(N,:) = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
-        bytes_shift=bytes_shift+double_size_bytes;
-        fseek(f,bytes_shift,'bof'); % move to next interleaved
-        observables.Pseudorange_symbol_shift(N,:) = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
-        bytes_shift=bytes_shift+double_size_bytes;
-        fseek(f,bytes_shift,'bof'); % move to next interleaved
-        observables.PRN(N,:) = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
-        bytes_shift=bytes_shift+double_size_bytes;
-        fseek(f,bytes_shift,'bof'); % move to next interleaved
-    end
-
-    fclose (f);
-    
-    %%%%%%%% output vars %%%%%%%%
-%     for (unsigned int i=0; i<d_nchannels ; i++)
-%         {
-%             tmp_double = current_gnss_synchro[i].Preamble_delay_ms;
-%             d_dump_file.write((char*)&tmp_double, sizeof(double));
-%             tmp_double = current_gnss_synchro[i].Prn_delay_ms;
-%             d_dump_file.write((char*)&tmp_double, sizeof(double));
-%             tmp_double = current_gnss_synchro[i].Pseudorange_m;
-%             d_dump_file.write((char*)&tmp_double, sizeof(double));
-%             tmp_double = current_gnss_synchro[i].Pseudorange_symbol_shift;
-%             d_dump_file.write((char*)&tmp_double, sizeof(double));
-%             tmp_double = current_gnss_synchro[i].PRN;
-%             d_dump_file.write((char*)&tmp_double, sizeof(double));
-%         }
-  end
-  
diff --git a/src/utils/matlab/libs/gps_l1_ca_dll_pll_read_tracking_dump.m b/src/utils/matlab/libs/gps_l1_ca_dll_pll_read_tracking_dump.m
index b8e3424e7..4a060118f 100644
--- a/src/utils/matlab/libs/gps_l1_ca_dll_pll_read_tracking_dump.m
+++ b/src/utils/matlab/libs/gps_l1_ca_dll_pll_read_tracking_dump.m
@@ -28,24 +28,33 @@
 %  */             
 function [GNSS_tracking] = gps_l1_ca_dll_pll_read_tracking_dump (filename, count)
 
-  %% usage: gps_l1_ca_dll_pll_read_tracking_dump (filename, [count])
+  %% usage: gps_l1_ca_dll_pll_read_tracking_dump_64bits (filename, [count])
   %%
   %% open GNSS-SDR tracking binary log file .dat and return the contents
   %%
 
   m = nargchk (1,2,nargin);
-  num_float_vars=16;
-  num_double_vars=2;
+  num_float_vars=5;
+  num_unsigned_long_int_vars=1;
+  num_double_vars=11;
+  num_unsigned_int_vars=1;
   double_size_bytes=8;
+  unsigned_long_int_size_bytes=8;
   float_size_bytes=4;
-  skip_bytes_each_read=float_size_bytes*num_float_vars+double_size_bytes*num_double_vars;
+  long_int_size_bytes=4;
+  
+  skip_bytes_each_read=float_size_bytes*num_float_vars+unsigned_long_int_size_bytes*num_unsigned_long_int_vars+double_size_bytes*num_double_vars+long_int_size_bytes*num_unsigned_int_vars;
   bytes_shift=0;
   if (m)
     usage (m);
   end
 
   if (nargin < 2)
-    count = Inf;
+    %count = Inf;
+    file_stats = dir(filename);
+    %round num bytes to read to integer number of samples (to protect the script from binary
+    %dump end file transitory)
+    count = (file_stats.bytes - mod(file_stats.bytes,skip_bytes_each_read))/skip_bytes_each_read;
   end
     %loops_counter = fread (f, count, 'uint32',4*12);
   f = fopen (filename, 'rb');
@@ -65,82 +74,85 @@ function [GNSS_tracking] = gps_l1_ca_dll_pll_read_tracking_dump (filename, count
     fseek(f,bytes_shift,'bof'); % move to next interleaved float
     v5 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
         bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v6 = fread (f, count, 'uint32',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v7 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v8 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v9 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v10 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v11 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v12 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v13 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v14 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v15 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-            bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v16 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-            bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
+    fseek(f,bytes_shift,'bof'); % move to next interleaved unsigned_long_int
+    v6 = fread (f, count, 'uint64',skip_bytes_each_read-unsigned_long_int_size_bytes);
+        bytes_shift=bytes_shift+unsigned_long_int_size_bytes;
+    fseek(f,bytes_shift,'bof'); % move to next interleaved double
+    v7 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
+        bytes_shift=bytes_shift+double_size_bytes;
+    fseek(f,bytes_shift,'bof'); % move to next interleaved double
+    v8 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
+        bytes_shift=bytes_shift+double_size_bytes;
+    fseek(f,bytes_shift,'bof'); % move to next interleaved double
+    v9 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
+        bytes_shift=bytes_shift+double_size_bytes;
+    fseek(f,bytes_shift,'bof'); % move to next interleaved double
+    v10 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
+        bytes_shift=bytes_shift+double_size_bytes;
+    fseek(f,bytes_shift,'bof'); % move to next interleaved double
+    v11 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
+        bytes_shift=bytes_shift+double_size_bytes;
+    fseek(f,bytes_shift,'bof'); % move to next interleaved double
+    v12 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
+        bytes_shift=bytes_shift+double_size_bytes;
+    fseek(f,bytes_shift,'bof'); % move to next interleaved double
+    v13 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
+        bytes_shift=bytes_shift+double_size_bytes;
+    fseek(f,bytes_shift,'bof'); % move to next interleaved double
+    v14 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
+        bytes_shift=bytes_shift+double_size_bytes;
+    fseek(f,bytes_shift,'bof'); % move to next interleaved double
+    v15 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
+        bytes_shift=bytes_shift+double_size_bytes;
+    fseek(f,bytes_shift,'bof'); % move to next interleaved double
+    v16 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
+        bytes_shift=bytes_shift+double_size_bytes;
+    fseek(f,bytes_shift,'bof'); % move to next interleaved double
     v17 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
-            bytes_shift=bytes_shift+double_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v18 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
+        bytes_shift=bytes_shift+double_size_bytes;
+    fseek(f,bytes_shift,'bof'); % move to next interleaved double
+    v18 = fread (f, count, 'uint32',skip_bytes_each_read-double_size_bytes);
     fclose (f);
     
     %%%%%%%% output vars %%%%%%%%
     
-% 				// EPR
-% 				d_dump_file.write((char*)&tmp_E, sizeof(float));
-% 				d_dump_file.write((char*)&tmp_P, sizeof(float));
-% 				d_dump_file.write((char*)&tmp_L, sizeof(float));
-% 				// PROMPT I and Q (to analyze navigation symbols)
-% 				d_dump_file.write((char*)&prompt_I, sizeof(float));
-% 				d_dump_file.write((char*)&prompt_Q, sizeof(float));
-% 				// PRN start sample stamp
-% 				//tmp_float=(float)d_sample_counter;
-% 				d_dump_file.write((char*)&d_sample_counter, sizeof(unsigned long int));
-% 				// accumulated carrier phase
-% 				d_dump_file.write((char*)&d_acc_carrier_phase_rad, sizeof(float));
+%                     // EPR
+%                     d_dump_file.write(reinterpret_cast<char*>(&tmp_E), sizeof(float));
+%                     d_dump_file.write(reinterpret_cast<char*>(&tmp_P), sizeof(float));
+%                     d_dump_file.write(reinterpret_cast<char*>(&tmp_L), sizeof(float));
+%                     // PROMPT I and Q (to analyze navigation symbols)
+%                     d_dump_file.write(reinterpret_cast<char*>(&prompt_I), sizeof(float));
+%                     d_dump_file.write(reinterpret_cast<char*>(&prompt_Q), sizeof(float));
+%                     // PRN start sample stamp
+%                     //tmp_float=(float)d_sample_counter;
+%                     d_dump_file.write(reinterpret_cast<char*>(&d_sample_counter), sizeof(unsigned long int));
+%                     // accumulated carrier phase
+%                     d_dump_file.write(reinterpret_cast<char*>(&d_acc_carrier_phase_rad), sizeof(double));
 % 
-% 				// carrier and code frequency
-% 				d_dump_file.write((char*)&d_carrier_doppler_hz, sizeof(float));
-% 				d_dump_file.write((char*)&d_code_freq_hz, sizeof(float));
+%                     // carrier and code frequency
+%                     d_dump_file.write(reinterpret_cast<char*>(&d_carrier_doppler_hz), sizeof(double));
+%                     d_dump_file.write(reinterpret_cast<char*>(&d_code_freq_chips), sizeof(double));
 % 
-% 				//PLL commands
-% 				d_dump_file.write((char*)&carr_error, sizeof(float));
-% 				d_dump_file.write((char*)&carr_nco, sizeof(float));
+%                     //PLL commands
+%                     d_dump_file.write(reinterpret_cast<char*>(&carr_phase_error_secs_Ti), sizeof(double));
+%                     d_dump_file.write(reinterpret_cast<char*>(&d_carrier_doppler_hz), sizeof(double));
 % 
-% 				//DLL commands
-% 				d_dump_file.write((char*)&code_error, sizeof(float));
-% 				d_dump_file.write((char*)&code_nco, sizeof(float));
+%                     //DLL commands
+%                     d_dump_file.write(reinterpret_cast<char*>(&code_error_chips_Ti), sizeof(double));
+%                     d_dump_file.write(reinterpret_cast<char*>(&code_error_filt_chips), sizeof(double));
 % 
-% 				// CN0 and carrier lock test
-% 				d_dump_file.write((char*)&d_CN0_SNV_dB_Hz, sizeof(float));
-% 				d_dump_file.write((char*)&d_carrier_lock_test, sizeof(float));
+%                     // CN0 and carrier lock test
+%                     d_dump_file.write(reinterpret_cast<char*>(&d_CN0_SNV_dB_Hz), sizeof(double));
+%                     d_dump_file.write(reinterpret_cast<char*>(&d_carrier_lock_test), sizeof(double));
 % 
-% 				// AUX vars (for debug purposes)
-% 				tmp_float=0;
-% 				d_dump_file.write((char*)&tmp_float, sizeof(float));
-% 				d_dump_file.write((char*)&d_sample_counter_seconds, sizeof(double));
-                
+%                     // AUX vars (for debug purposes)
+%                     tmp_double = d_rem_code_phase_samples;
+%                     d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
+%                     tmp_double = static_cast<double>(d_sample_counter + d_current_prn_length_samples);
+%                     d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
+%                             // PRN
+%             unsigned int prn_ = d_acquisition_gnss_synchro->PRN;
+%             d_dump_file.write(reinterpret_cast<char*>(&prn_), sizeof(unsigned int));
     E=v1;
     P=v2;
     L=v3;
@@ -158,7 +170,7 @@ function [GNSS_tracking] = gps_l1_ca_dll_pll_read_tracking_dump (filename, count
     carrier_lock_test=v15;
     var1=v16;
     var2=v17;
-    var3=v18;
+    PRN=v18;
     
     GNSS_tracking.E=E;
     GNSS_tracking.P=P;
@@ -171,12 +183,12 @@ function [GNSS_tracking] = gps_l1_ca_dll_pll_read_tracking_dump (filename, count
     GNSS_tracking.code_freq_hz=code_freq_hz;
     GNSS_tracking.carr_error=carr_error;
     GNSS_tracking.carr_nco=carr_nco;
-    GNSS_tracking.code_error=code_error;
+    GNSS_tracking.code_error=code_error
     GNSS_tracking.code_nco=code_nco;
     GNSS_tracking.CN0_SNV_dB_Hz=CN0_SNV_dB_Hz;
     GNSS_tracking.carrier_lock_test=carrier_lock_test;
-    GNSS_tracking.var1=var1;
+    GNSS_tracking.d_rem_code_phase_samples=var1;
     GNSS_tracking.var2=var2;
-    GNSS_tracking.var3=var3;
+    GNSS_tracking.PRN=PRN;
   end
   
diff --git a/src/utils/matlab/libs/gps_l1_ca_dll_pll_read_tracking_dump_64bits.m b/src/utils/matlab/libs/gps_l1_ca_dll_pll_read_tracking_dump_64bits.m
deleted file mode 100644
index f7d0bb97a..000000000
--- a/src/utils/matlab/libs/gps_l1_ca_dll_pll_read_tracking_dump_64bits.m
+++ /dev/null
@@ -1,179 +0,0 @@
-% /*!
-%  * \file gps_l1_ca_dll_pll_read_tracking_dump.m
-%  * \brief Read GNSS-SDR Tracking dump binary file into MATLAB.
-%  * \author Javier Arribas, 2011. jarribas(at)cttc.es
-%  * -------------------------------------------------------------------------
-%  *
-%  * Copyright (C) 2010-2011  (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 <http://www.gnu.org/licenses/>.
-%  *
-%  * -------------------------------------------------------------------------
-%  */             
-function [GNSS_tracking] = gps_l1_ca_dll_pll_read_tracking_dump_64bits (filename, count)
-
-  %% usage: gps_l1_ca_dll_pll_read_tracking_dump_64bits (filename, [count])
-  %%
-  %% open GNSS-SDR tracking binary log file .dat and return the contents
-  %%
-
-  m = nargchk (1,2,nargin);
-  num_float_vars=15;
-  num_unsigned_long_int_vars=1;
-  num_double_vars=1;
-  double_size_bytes=8;
-  unsigned_long_int_size_bytes=8;
-  float_size_bytes=4;
-  skip_bytes_each_read=float_size_bytes*num_float_vars+unsigned_long_int_size_bytes*num_unsigned_long_int_vars+double_size_bytes*num_double_vars;
-  bytes_shift=0;
-  if (m)
-    usage (m);
-  end
-
-  if (nargin < 2)
-    count = Inf;
-  end
-    %loops_counter = fread (f, count, 'uint32',4*12);
-  f = fopen (filename, 'rb');
-  if (f < 0)
-  else
-    v1 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v2 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v3 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v4 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v5 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v6 = fread (f, count, 'uint64',skip_bytes_each_read-unsigned_long_int_size_bytes);
-        bytes_shift=bytes_shift+unsigned_long_int_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v7 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v8 = fread (f, count, '*float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v9 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v10 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v11 = fread (f, count, '*float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v12 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v13 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v14 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-        bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v15 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-            bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v16 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
-            bytes_shift=bytes_shift+float_size_bytes;
-    fseek(f,bytes_shift,'bof'); % move to next interleaved float
-    v17 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
-    fclose (f);
-    
-    %%%%%%%% output vars %%%%%%%%
-    
-% 				// EPR
-% 				d_dump_file.write((char*)&tmp_E, sizeof(float));
-% 				d_dump_file.write((char*)&tmp_P, sizeof(float));
-% 				d_dump_file.write((char*)&tmp_L, sizeof(float));
-% 				// PROMPT I and Q (to analyze navigation symbols)
-% 				d_dump_file.write((char*)&prompt_I, sizeof(float));
-% 				d_dump_file.write((char*)&prompt_Q, sizeof(float));
-% 				// PRN start sample stamp
-% 				//tmp_float=(float)d_sample_counter;
-% 				d_dump_file.write((char*)&d_sample_counter, sizeof(unsigned long int));
-% 				// accumulated carrier phase
-% 				d_dump_file.write((char*)&d_acc_carrier_phase_rad, sizeof(float));
-% 
-% 				// carrier and code frequency
-% 				d_dump_file.write((char*)&d_carrier_doppler_hz, sizeof(float));
-% 				d_dump_file.write((char*)&d_code_freq_hz, sizeof(float));
-% 
-% 				//PLL commands
-% 				d_dump_file.write((char*)&carr_error, sizeof(float));
-% 				d_dump_file.write((char*)&carr_nco, sizeof(float));
-% 
-% 				//DLL commands
-% 				d_dump_file.write((char*)&code_error, sizeof(float));
-% 				d_dump_file.write((char*)&code_nco, sizeof(float));
-% 
-% 				// CN0 and carrier lock test
-% 				d_dump_file.write((char*)&d_CN0_SNV_dB_Hz, sizeof(float));
-% 				d_dump_file.write((char*)&d_carrier_lock_test, sizeof(float));
-% 
-% 				// AUX vars (for debug purposes)
-% 				tmp_float=0;
-% 				d_dump_file.write((char*)&tmp_float, sizeof(float));
-% 				d_dump_file.write((char*)&d_sample_counter_seconds, sizeof(double));
-                
-    E=v1;
-    P=v2;
-    L=v3;
-    prompt_I=v4;
-    prompt_Q=v5;
-    PRN_start_sample=v6;
-    acc_carrier_phase_rad=v7;
-    carrier_doppler_hz=v8;
-    code_freq_hz=v9;
-    carr_error=v10;
-    carr_nco=v11;
-    code_error=v12;
-    code_nco=v13;
-    CN0_SNV_dB_Hz=v14;
-    carrier_lock_test=v15;
-    var1=v16;
-    var2=v17;
-    
-    GNSS_tracking.E=E;
-    GNSS_tracking.P=P;
-    GNSS_tracking.L=L;
-    GNSS_tracking.prompt_I=prompt_I;
-    GNSS_tracking.prompt_Q=prompt_Q;
-    GNSS_tracking.PRN_start_sample=PRN_start_sample;
-    GNSS_tracking.acc_carrier_phase_rad=acc_carrier_phase_rad;
-    GNSS_tracking.carrier_doppler_hz=carrier_doppler_hz;
-    GNSS_tracking.code_freq_hz=code_freq_hz;
-    GNSS_tracking.carr_error=carr_error;
-    GNSS_tracking.carr_nco=carr_nco;
-    GNSS_tracking.code_error=code_error;
-    GNSS_tracking.code_nco=code_nco;
-    GNSS_tracking.CN0_SNV_dB_Hz=CN0_SNV_dB_Hz;
-    GNSS_tracking.carrier_lock_test=carrier_lock_test;
-    GNSS_tracking.var1=var1;
-    GNSS_tracking.var2=var2;
-  end
-  
diff --git a/src/utils/matlab/libs/plotTracking.m b/src/utils/matlab/libs/plotTracking.m
index 28764f3e9..d2e31f537 100644
--- a/src/utils/matlab/libs/plotTracking.m
+++ b/src/utils/matlab/libs/plotTracking.m
@@ -49,7 +49,7 @@ for channelNr = channelList
     clf(channelNr +200);
     set(channelNr +200, 'Name', ['Channel ', num2str(channelNr), ...
                                  ' (PRN ', ...
-                                 num2str(trackResults(channelNr).PRN), ...
+                                 num2str(trackResults(channelNr).PRN(end-1)), ...
                                  ') results']);
 
 %% Draw axes ==============================================================
@@ -122,7 +122,7 @@ for channelNr = channelList
 
         %----- PLL discriminator filtered----------------------------------
         plot  (handles(3, 1), timeAxisInSeconds, ...
-                              trackResults(channelNr).pllDiscrFilt, 'b');      
+                              trackResults(channelNr).pllDiscrFilt(1:settings.msToProcess), 'b');      
 
         grid  (handles(3, 1));
         axis  (handles(3, 1), 'tight');
diff --git a/src/utils/matlab/libs/plotVEMLTracking.m b/src/utils/matlab/libs/plotVEMLTracking.m
index da219e102..8af2225f9 100644
--- a/src/utils/matlab/libs/plotVEMLTracking.m
+++ b/src/utils/matlab/libs/plotVEMLTracking.m
@@ -49,7 +49,7 @@ for channelNr = channelList
     clf(channelNr +200);
     set(channelNr +200, 'Name', ['Channel ', num2str(channelNr), ...
                                  ' (PRN ', ...
-                                 num2str(trackResults(channelNr).PRN), ...
+                                 num2str(trackResults(channelNr).PRN(end-1)), ...
                                  ') results']);
 
 %% Draw axes ==============================================================
diff --git a/src/utils/matlab/libs/gps_l1_ca_read_observables_dump.m b/src/utils/matlab/libs/read_hybrid_observables_dump.m
similarity index 61%
rename from src/utils/matlab/libs/gps_l1_ca_read_observables_dump.m
rename to src/utils/matlab/libs/read_hybrid_observables_dump.m
index 32c3c1eba..b14090a2a 100644
--- a/src/utils/matlab/libs/gps_l1_ca_read_observables_dump.m
+++ b/src/utils/matlab/libs/read_hybrid_observables_dump.m
@@ -1,5 +1,5 @@
 % Javier Arribas 2011             
-function [observables] = gps_l1_ca_read_observables_dump (channels, filename, count)
+function [observables] = read_hybrid_observables_dump (channels, filename, count)
 
   %% usage: read_tracking_dat (filename, [count])
   %%
@@ -7,7 +7,7 @@ function [observables] = gps_l1_ca_read_observables_dump (channels, filename, co
   %%
 
   m = nargchk (1,2,nargin);
-  num_double_vars=5;
+  num_double_vars=7;
   double_size_bytes=8;
   skip_bytes_each_read=double_size_bytes*num_double_vars*channels;
   bytes_shift=0;
@@ -23,19 +23,25 @@ function [observables] = gps_l1_ca_read_observables_dump (channels, filename, co
   if (f < 0)
   else
     for N=1:1:channels
+        observables.RX_time(N,:) = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
+        bytes_shift=bytes_shift+double_size_bytes;
+        fseek(f,bytes_shift,'bof'); % move to next interleaved
         observables.d_TOW_at_current_symbol(N,:) = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
         bytes_shift=bytes_shift+double_size_bytes;
         fseek(f,bytes_shift,'bof'); % move to next interleaved
-        observables.Prn_timestamp_ms(N,:) = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
+        observables.Carrier_Doppler_hz(N,:) = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
+        bytes_shift=bytes_shift+double_size_bytes;
+        fseek(f,bytes_shift,'bof'); % move to next interleaved
+        observables.Carrier_phase_hz(N,:) = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
         bytes_shift=bytes_shift+double_size_bytes;
         fseek(f,bytes_shift,'bof'); % move to next interleaved
         observables.Pseudorange_m(N,:) = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
         bytes_shift=bytes_shift+double_size_bytes;
         fseek(f,bytes_shift,'bof'); % move to next interleaved
-        observables.Flag_valid_pseudorange(N,:) = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
+        observables.PRN(N,:) = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
         bytes_shift=bytes_shift+double_size_bytes;
         fseek(f,bytes_shift,'bof'); % move to next interleaved
-        observables.PRN(N,:) = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
+        observables.valid(N,:) = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
         bytes_shift=bytes_shift+double_size_bytes;
         fseek(f,bytes_shift,'bof'); % move to next interleaved
     end
@@ -44,18 +50,22 @@ function [observables] = gps_l1_ca_read_observables_dump (channels, filename, co
     
     %%%%%%%% output vars %%%%%%%%
 %     double tmp_double;
-%     for (unsigned int i=0; i<d_nchannels ; i++)
+%     for (unsigned int i = 0; i < d_nchannels; i++)
 %         {
-%             tmp_double = current_gnss_synchro[i].d_TOW_at_current_symbol;
+%             tmp_double = current_gnss_synchro[i].RX_time;
 %             d_dump_file.write((char*)&tmp_double, sizeof(double));
-%             tmp_double = current_gnss_synchro[i].Prn_timestamp_ms;
+%             tmp_double = current_gnss_synchro[i].TOW_at_current_symbol_s;
+%             d_dump_file.write((char*)&tmp_double, sizeof(double));
+%             tmp_double = current_gnss_synchro[i].Carrier_Doppler_hz;
+%             d_dump_file.write((char*)&tmp_double, sizeof(double));
+%             tmp_double = current_gnss_synchro[i].Carrier_phase_rads/GPS_TWO_PI;
 %             d_dump_file.write((char*)&tmp_double, sizeof(double));
 %             tmp_double = current_gnss_synchro[i].Pseudorange_m;
 %             d_dump_file.write((char*)&tmp_double, sizeof(double));
-%             tmp_double = (double)(current_gnss_synchro[i].Flag_valid_pseudorange==true);
-%             d_dump_file.write((char*)&tmp_double, sizeof(double));
 %             tmp_double = current_gnss_synchro[i].PRN;
 %             d_dump_file.write((char*)&tmp_double, sizeof(double));
-%             }
+%             tmp_double = current_gnss_synchro[i].Flag_valid_pseudorange;
+%             d_dump_file.write((char*)&tmp_double, sizeof(double));
+%         }
   end
   
diff --git a/src/utils/matlab/libs/read_true_sim_observables_dump.m b/src/utils/matlab/libs/read_true_sim_observables_dump.m
new file mode 100644
index 000000000..af2001b69
--- /dev/null
+++ b/src/utils/matlab/libs/read_true_sim_observables_dump.m
@@ -0,0 +1,65 @@
+% Javier Arribas 2011             
+function [observables] = read_true_sim_observables_dump (filename, count)
+
+  %% usage: read_true_sim_observables_dump (filename, [count])
+  %%
+  %% open gnss-sdr-sim observables dump and read all chennels
+  %%
+
+  m = nargchk (1,2,nargin);
+  channels=12; %Simulator always use 12 channels
+  num_double_vars=7;
+  double_size_bytes=8;
+  skip_bytes_each_read=double_size_bytes*num_double_vars*channels;
+  bytes_shift=0;
+
+  if (m)
+    usage (m);
+  end
+
+  if (nargin < 2)
+    count = Inf;
+  end
+    %loops_counter = fread (f, count, 'uint32',4*12);
+  f = fopen (filename, 'rb');
+  if (f < 0)
+  else
+    for N=1:1:channels
+        observables.RX_time(N,:) = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
+        bytes_shift=bytes_shift+double_size_bytes;
+        fseek(f,bytes_shift,'bof'); % move to next interleaved
+        observables.Carrier_Doppler_hz(N,:) = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
+        bytes_shift=bytes_shift+double_size_bytes;
+        fseek(f,bytes_shift,'bof'); % move to next interleaved
+        observables.Carrier_phase_hz(N,:) = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
+        bytes_shift=bytes_shift+double_size_bytes;
+        fseek(f,bytes_shift,'bof'); % move to next interleaved
+        observables.Pseudorange_m(N,:) = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
+        bytes_shift=bytes_shift+double_size_bytes;
+        fseek(f,bytes_shift,'bof'); % move to next interleaved
+        observables.True_range_m(N,:) = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
+        bytes_shift=bytes_shift+double_size_bytes;
+        fseek(f,bytes_shift,'bof'); % move to next interleaved
+        observables.Carrier_phase_hz_v2(N,:) = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
+        bytes_shift=bytes_shift+double_size_bytes;
+        fseek(f,bytes_shift,'bof'); % move to next interleaved
+        observables.PRN(N,:) = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
+        bytes_shift=bytes_shift+double_size_bytes;
+        fseek(f,bytes_shift,'bof'); % move to next interleaved
+    end
+
+    fclose (f);
+    
+%     %%%%%%%% output vars %%%%%%%%
+%         for(int i=0;i<12;i++)
+%         {
+%             d_dump_file.read((char *) &gps_time_sec[i], sizeof(double));
+%             d_dump_file.read((char *) &doppler_l1_hz, sizeof(double));
+%             d_dump_file.read((char *) &acc_carrier_phase_l1_cycles[i], sizeof(double));
+%             d_dump_file.read((char *) &dist_m[i], sizeof(double));
+%             d_dump_file.read((char *) &true_dist_m[i], sizeof(double));
+%             d_dump_file.read((char *) &carrier_phase_l1_cycles[i], sizeof(double));
+%             d_dump_file.read((char *) &prn[i], sizeof(double));
+%         }
+  end
+  
diff --git a/src/utils/matlab/plotTrackingE5a.m b/src/utils/matlab/plotTrackingE5a.m
index f8a76b7d2..b017accf3 100644
--- a/src/utils/matlab/plotTrackingE5a.m
+++ b/src/utils/matlab/plotTrackingE5a.m
@@ -66,7 +66,7 @@ for channelNr = channelList
 
 %% Plot all figures =======================================================
 
-        timeAxisInSeconds = (1:settings.msToProcess)/1000;
+        timeAxisInSeconds = (1:settings.msToProcess-1)/1000;
 
         %----- Discrete-Time Scatter Plot ---------------------------------
         plot(handles(1, 1), trackResults(channelNr).I_PN,...
@@ -81,7 +81,7 @@ for channelNr = channelList
 
         %----- Nav bits ---------------------------------------------------
         plot  (handles(1, 2), timeAxisInSeconds, ...
-                              trackResults(channelNr).I_PN);
+                              trackResults(channelNr).I_PN(1:settings.msToProcess-1));
 
         grid  (handles(1, 2));
         title (handles(1, 2), 'Bits of the navigation message');
@@ -90,7 +90,7 @@ for channelNr = channelList
 
         %----- PLL discriminator unfiltered--------------------------------
         plot  (handles(2, 1), timeAxisInSeconds, ...
-                              trackResults(channelNr).pllDiscr, 'r');      
+                              trackResults(channelNr).pllDiscr(1:settings.msToProcess-1), 'r');      
 
         grid  (handles(2, 1));
         axis  (handles(2, 1), 'tight');
@@ -100,12 +100,12 @@ for channelNr = channelList
 
         %----- Correlation ------------------------------------------------
         plot(handles(2, 2), timeAxisInSeconds, ...
-                            [sqrt(trackResults(channelNr).I_E.^2 + ...
-                                  trackResults(channelNr).Q_E.^2)', ...
-                             sqrt(trackResults(channelNr).I_P.^2 + ...
-                                  trackResults(channelNr).Q_P.^2)', ...
-                             sqrt(trackResults(channelNr).I_L.^2 + ...
-                                  trackResults(channelNr).Q_L.^2)'], ...
+                            [sqrt(trackResults(channelNr).I_E(1:settings.msToProcess-1).^2 + ...
+                                  trackResults(channelNr).Q_E(1:settings.msToProcess-1).^2)', ...
+                             sqrt(trackResults(channelNr).I_P(1:settings.msToProcess-1).^2 + ...
+                                  trackResults(channelNr).Q_P(1:settings.msToProcess-1).^2)', ...
+                             sqrt(trackResults(channelNr).I_L(1:settings.msToProcess-1).^2 + ...
+                                  trackResults(channelNr).Q_L(1:settings.msToProcess-1).^2)'], ...
                             '-*');
 
         grid  (handles(2, 2));
@@ -122,7 +122,7 @@ for channelNr = channelList
 
         %----- PLL discriminator filtered----------------------------------
         plot  (handles(3, 1), timeAxisInSeconds, ...
-                              trackResults(channelNr).pllDiscrFilt, 'b');      
+                              trackResults(channelNr).pllDiscrFilt(1:settings.msToProcess-1), 'b');      
 
         grid  (handles(3, 1));
         axis  (handles(3, 1), 'tight');
@@ -132,7 +132,7 @@ for channelNr = channelList
 
         %----- DLL discriminator unfiltered--------------------------------
         plot  (handles(3, 2), timeAxisInSeconds, ...
-                              trackResults(channelNr).dllDiscr, 'r');      
+                              trackResults(channelNr).dllDiscr(1:settings.msToProcess-1), 'r');      
 
         grid  (handles(3, 2));
         axis  (handles(3, 2), 'tight');
@@ -142,7 +142,7 @@ for channelNr = channelList
 
         %----- DLL discriminator filtered----------------------------------
         plot  (handles(3, 3), timeAxisInSeconds, ...
-                              trackResults(channelNr).dllDiscrFilt, 'b');      
+                              trackResults(channelNr).dllDiscrFilt(1:settings.msToProcess-1), 'b');      
 
         grid  (handles(3, 3));
         axis  (handles(3, 3), 'tight');