diff --git a/cmake/Modules/FindGPSTK.cmake b/cmake/Modules/FindGPSTK.cmake
index 515878d5a..137a34b5b 100644
--- a/cmake/Modules/FindGPSTK.cmake
+++ b/cmake/Modules/FindGPSTK.cmake
@@ -24,10 +24,10 @@
# also defined, but not for general use are
# GPSTK_LIBRARY, where to find the GPSTK library.
-FIND_PATH(GPSTK_INCLUDE_DIR Rinex3ObsBase.hpp
- HINTS /usr/include/gpstk
- /usr/local/include/gpstk
- /opt/local/include/gpstk )
+FIND_PATH(GPSTK_INCLUDE_DIR gpstk/Rinex3ObsBase.hpp
+ HINTS /usr/include
+ /usr/local/include
+ /opt/local/include )
SET(GPSTK_NAMES ${GPSTK_NAMES} gpstk libgpstk)
FIND_LIBRARY(GPSTK_LIBRARY NAMES ${GPSTK_NAMES}
diff --git a/src/algorithms/libs/rtklib/rtklib_pntpos.cc b/src/algorithms/libs/rtklib/rtklib_pntpos.cc
index d4a10fe65..13a94502a 100644
--- a/src/algorithms/libs/rtklib/rtklib_pntpos.cc
+++ b/src/algorithms/libs/rtklib/rtklib_pntpos.cc
@@ -246,7 +246,7 @@ double prange(const obsd_t *obs, const nav_t *nav, const double *azel,
else if (obs->code[i] != CODE_NONE and obs->code[j] == CODE_NONE)
{
P1 += P1_C1; /* C1->P1 */
- PC = P1 + P1_P2;
+ PC = P1 - P1_P2;
}
else if (obs->code[i] == CODE_NONE and obs->code[j] != CODE_NONE)
{
diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn.h
new file mode 100644
index 000000000..e20d229e3
--- /dev/null
+++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn.h
@@ -0,0 +1,122 @@
+/*!
+ * \file volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn.h
+ * \brief VOLK_GNSSSDR kernel: multiplies N complex (32-bit float per component) vectors
+ * by a common vector, phase rotated and accumulates the results in N float complex outputs.
+ * \authors
+ * - Antonio Ramos 2018. antonio.ramosdet(at)gmail.com
+ *
+ *
+ * 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-2018 (see AUTHORS file for a list of contributors)
+ *
+ * GNSS-SDR is a software defined Global Navigation
+ * Satellite Systems receiver
+ *
+ * This file is part of GNSS-SDR.
+ *
+ * GNSS-SDR is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GNSS-SDR is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNSS-SDR. If not, see .
+ *
+ * -------------------------------------------------------------------------
+ */
+
+/*!
+ * \page volk_gnsssdr_32fc_32f_high_dynamic_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.
+ *
+ * Dispatcher Prototype
+ * \code
+ * void volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn(lv_32fc_t* result, const lv_32fc_t* in_common, const lv_32fc_t phase_inc, const lv_32fc_t phase_inc_rate, lv_32fc_t* phase, const float** in_a, int num_a_vectors, unsigned int num_points);
+ * \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_inc_rate: Phase increment rate = lv_cmake(cos(phase_step_rate_rad), sin(phase_step_rate_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_high_dynamic_rotator_dot_prod_32fc_xn_H
+#define INCLUDED_volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn_H
+
+
+#include
+#include
+#include
+#include
+#include
+
+#ifdef LV_HAVE_GENERIC
+
+static inline void volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn_generic(lv_32fc_t* result, const lv_32fc_t* in_common, const lv_32fc_t phase_inc, const lv_32fc_t phase_inc_rate, lv_32fc_t* phase, const float** in_a, int num_a_vectors, unsigned int num_points)
+{
+ lv_32fc_t tmp32_1;
+#ifdef __cplusplus
+ lv_32fc_t half_phase_inc_rate = std::sqrt(phase_inc_rate);
+#else
+ lv_32fc_t half_phase_inc_rate = csqrtf(phase_inc_rate);
+#endif
+ lv_32fc_t constant_rotation = phase_inc * half_phase_inc_rate;
+ lv_32fc_t delta_phase_rate = lv_cmake(1.0f, 0.0f);
+ int n_vec;
+ unsigned int n;
+ for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+ {
+ result[n_vec] = lv_cmake(0.0f, 0.0f);
+ }
+ for (n = 0; n < num_points; n++)
+ {
+ tmp32_1 = *in_common++ * (*phase);
+ // Regenerate phase
+ if (n % 256 == 0)
+ {
+#ifdef __cplusplus
+ (*phase) /= std::abs((*phase));
+ delta_phase_rate /= std::abs(delta_phase_rate);
+#else
+ (*phase) /= hypotf(lv_creal(*phase), lv_cimag(*phase));
+ delta_phase_rate /= hypotf(lv_creal(delta_phase_rate), lv_cimag(delta_phase_rate));
+#endif
+ }
+ (*phase) *= (constant_rotation * delta_phase_rate);
+ delta_phase_rate *= phase_inc_rate;
+ for (n_vec = 0; n_vec < num_a_vectors; n_vec++)
+ {
+ result[n_vec] += (tmp32_1 * in_a[n_vec][n]);
+ }
+ }
+}
+
+#endif /*LV_HAVE_GENERIC*/
+
+#endif /* INCLUDED_volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn_H */
diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_high_dynamic_rotator_dotprodxnpuppet_32fc.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_high_dynamic_rotator_dotprodxnpuppet_32fc.h
new file mode 100644
index 000000000..b2bc1b740
--- /dev/null
+++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_high_dynamic_rotator_dotprodxnpuppet_32fc.h
@@ -0,0 +1,163 @@
+/*!
+ * \file volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc.h
+ * \brief Volk puppet for the multiple 16-bit complex dot product kernel.
+ * \authors
+ * - Carles Fernandez Prades 2016 cfernandez at cttc dot cat
+ *
+ *
+ * Volk puppet for integrating the resampler into volk's test system
+ *
+ * -------------------------------------------------------------------------
+ *
+ * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
+ *
+ * GNSS-SDR is a software defined Global Navigation
+ * Satellite Systems receiver
+ *
+ * This file is part of GNSS-SDR.
+ *
+ * GNSS-SDR is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GNSS-SDR is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNSS-SDR. If not, see .
+ *
+ * -------------------------------------------------------------------------
+ */
+
+#ifndef INCLUDED_volk_gnsssdr_32fc_32f_high_dynamic_rotator_dotprodxnpuppet_32fc_H
+#define INCLUDED_volk_gnsssdr_32fc_32f_high_dynamic_rotator_dotprodxnpuppet_32fc_H
+
+#include "volk_gnsssdr/volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn.h"
+#include
+#include
+#include
+
+#ifdef LV_HAVE_GENERIC
+
+static inline void volk_gnsssdr_32fc_32f_high_dynamic_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));
+ lv_32fc_t phase_inc_rate[1];
+ phase_inc_rate[0] = lv_cmake(cos(phase_step_rad * 0.001), sin(phase_step_rad * 0.001));
+ int n;
+ int num_a_vectors = 3;
+ float** in_a = (float**)volk_gnsssdr_malloc(sizeof(float*) * num_a_vectors, volk_gnsssdr_get_alignment());
+ for (n = 0; n < num_a_vectors; n++)
+ {
+ in_a[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment());
+ memcpy((float*)in_a[n], (float*)in, sizeof(float) * num_points);
+ }
+ volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn_generic(result, local_code, phase_inc[0], phase_inc_rate[0], phase, (const float**)in_a, num_a_vectors, num_points);
+
+ for (n = 0; n < num_a_vectors; n++)
+ {
+ volk_gnsssdr_free(in_a[n]);
+ }
+ volk_gnsssdr_free(in_a);
+}
+#endif // Generic
+
+//
+//#ifdef LV_HAVE_GENERIC
+//static inline void volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc_generic_reload(lv_32fc_t* result, const lv_32fc_t* local_code, const float* in, unsigned int num_points)
+//{
+// // phases must be normalized. Phase rotator expects a complex exponential input!
+// float rem_carrier_phase_in_rad = 0.25;
+// float phase_step_rad = 0.1;
+// lv_32fc_t phase[1];
+// phase[0] = lv_cmake(cos(rem_carrier_phase_in_rad), sin(rem_carrier_phase_in_rad));
+// lv_32fc_t phase_inc[1];
+// phase_inc[0] = lv_cmake(cos(phase_step_rad), sin(phase_step_rad));
+// int n;
+// int num_a_vectors = 3;
+// float** in_a = (float**)volk_gnsssdr_malloc(sizeof(float*) * num_a_vectors, volk_gnsssdr_get_alignment());
+// for (n = 0; n < num_a_vectors; n++)
+// {
+// in_a[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment());
+// memcpy((float*)in_a[n], (float*)in, sizeof(float) * num_points);
+// }
+// volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_generic_reload(result, local_code, phase_inc[0], phase, (const float**)in_a, num_a_vectors, num_points);
+//
+// for (n = 0; n < num_a_vectors; n++)
+// {
+// volk_gnsssdr_free(in_a[n]);
+// }
+// volk_gnsssdr_free(in_a);
+//}
+//
+//#endif // Generic
+//
+//#ifdef LV_HAVE_AVX
+//static inline void volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc_u_avx(lv_32fc_t* result, const lv_32fc_t* local_code, const float* in, unsigned int num_points)
+//{
+// // phases must be normalized. Phase rotator expects a complex exponential input!
+// float rem_carrier_phase_in_rad = 0.25;
+// float phase_step_rad = 0.1;
+// lv_32fc_t phase[1];
+// phase[0] = lv_cmake(cos(rem_carrier_phase_in_rad), sin(rem_carrier_phase_in_rad));
+// lv_32fc_t phase_inc[1];
+// phase_inc[0] = lv_cmake(cos(phase_step_rad), sin(phase_step_rad));
+// int n;
+// int num_a_vectors = 3;
+// float** in_a = (float**)volk_gnsssdr_malloc(sizeof(float*) * num_a_vectors, volk_gnsssdr_get_alignment());
+// for (n = 0; n < num_a_vectors; n++)
+// {
+// in_a[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment());
+// memcpy((float*)in_a[n], (float*)in, sizeof(float) * num_points);
+// }
+// volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_u_avx(result, local_code, phase_inc[0], phase, (const float**)in_a, num_a_vectors, num_points);
+//
+// for (n = 0; n < num_a_vectors; n++)
+// {
+// volk_gnsssdr_free(in_a[n]);
+// }
+// volk_gnsssdr_free(in_a);
+//}
+//
+//#endif // AVX
+//
+//
+//#ifdef LV_HAVE_AVX
+//static inline void volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc_a_avx(lv_32fc_t* result, const lv_32fc_t* local_code, const float* in, unsigned int num_points)
+//{
+// // phases must be normalized. Phase rotator expects a complex exponential input!
+// float rem_carrier_phase_in_rad = 0.25;
+// float phase_step_rad = 0.1;
+// lv_32fc_t phase[1];
+// phase[0] = lv_cmake(cos(rem_carrier_phase_in_rad), sin(rem_carrier_phase_in_rad));
+// lv_32fc_t phase_inc[1];
+// phase_inc[0] = lv_cmake(cos(phase_step_rad), sin(phase_step_rad));
+// int n;
+// int num_a_vectors = 3;
+// float** in_a = (float**)volk_gnsssdr_malloc(sizeof(float*) * num_a_vectors, volk_gnsssdr_get_alignment());
+// for (n = 0; n < num_a_vectors; n++)
+// {
+// in_a[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment());
+// memcpy((float*)in_a[n], (float*)in, sizeof(float) * num_points);
+// }
+// volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_a_avx(result, local_code, phase_inc[0], phase, (const float**)in_a, num_a_vectors, num_points);
+//
+// for (n = 0; n < num_a_vectors; n++)
+// {
+// volk_gnsssdr_free(in_a[n]);
+// }
+// volk_gnsssdr_free(in_a);
+//}
+//
+//#endif // AVX
+
+#endif // INCLUDED_volk_gnsssdr_32fc_32f_high_dynamic_rotator_dotprodxnpuppet_32fc_H
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 389e03b14..51a96b171 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
@@ -99,6 +99,7 @@ std::vector init_test_list(volk_gnsssdr_test_params_t
QA(VOLK_INIT_PUPP(volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic, volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn, test_params_int16))
QA(VOLK_INIT_PUPP(volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc, volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn, test_params_int1))
QA(VOLK_INIT_PUPP(volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc, volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn, test_params_int1));
+ QA(VOLK_INIT_PUPP(volk_gnsssdr_32fc_32f_high_dynamic_rotator_dotprodxnpuppet_32fc, volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn, test_params_int1));
return test_cases;
}
diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc
index cb5468af0..81d385cf5 100644
--- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc
+++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc
@@ -484,7 +484,7 @@ int hybrid_observables_cc::general_work(int noutput_items __attribute__((unused)
if (T_rx_clock_step_samples == 0)
{
T_rx_clock_step_samples = std::round(static_cast(in[d_nchannels_in - 1][0].fs) * 1e-3); // 1 ms
- std::cout << "Observables clock step samples set to " << T_rx_clock_step_samples << std::endl;
+ LOG(INFO) << "Observables clock step samples set to " << T_rx_clock_step_samples;
usleep(1000000);
}
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 48e821674..8a57fd975 100644
--- a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc
+++ b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc
@@ -59,6 +59,16 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking(
trk_param.fs_in = fs_in;
bool dump = configuration->property(role + ".dump", false);
trk_param.dump = dump;
+ trk_param.high_dyn = configuration->property(role + ".high_dyn", false);
+ if (configuration->property(role + ".smoother_length", 10) < 1)
+ {
+ trk_param.smoother_length = 1;
+ std::cout << TEXT_RED << "WARNING: Gal. E1. smoother_length must be bigger than 0. It has been set to 1" << TEXT_RESET << std::endl;
+ }
+ else
+ {
+ trk_param.smoother_length = configuration->property(role + ".smoother_length", 10);
+ }
float pll_bw_hz = configuration->property(role + ".pll_bw_hz", 5.0);
if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz);
trk_param.pll_bw_hz = pll_bw_hz;
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 fe6f4a7d6..00b37d7c1 100644
--- a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc
+++ b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc
@@ -59,6 +59,16 @@ GalileoE5aDllPllTracking::GalileoE5aDllPllTracking(
trk_param.fs_in = fs_in;
bool dump = configuration->property(role + ".dump", false);
trk_param.dump = dump;
+ trk_param.high_dyn = configuration->property(role + ".high_dyn", false);
+ if (configuration->property(role + ".smoother_length", 10) < 1)
+ {
+ trk_param.smoother_length = 1;
+ std::cout << TEXT_RED << "WARNING: Gal. E5a. smoother_length must be bigger than 0. It has been set to 1" << TEXT_RESET << std::endl;
+ }
+ else
+ {
+ trk_param.smoother_length = configuration->property(role + ".smoother_length", 10);
+ }
float pll_bw_hz = configuration->property(role + ".pll_bw_hz", 20.0);
if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz);
trk_param.pll_bw_hz = pll_bw_hz;
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 ffa6e1000..b9a8b2c6e 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
@@ -57,6 +57,16 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking(
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
int fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
trk_param.fs_in = fs_in;
+ trk_param.high_dyn = configuration->property(role + ".high_dyn", false);
+ if (configuration->property(role + ".smoother_length", 10) < 1)
+ {
+ trk_param.smoother_length = 1;
+ std::cout << TEXT_RED << "WARNING: GPS L1 C/A. smoother_length must be bigger than 0. It has been set to 1" << TEXT_RESET << std::endl;
+ }
+ else
+ {
+ trk_param.smoother_length = configuration->property(role + ".smoother_length", 10);
+ }
bool dump = configuration->property(role + ".dump", false);
trk_param.dump = dump;
float pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0);
diff --git a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc
index 11e2572c3..1775a7a89 100644
--- a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc
+++ b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc
@@ -59,6 +59,16 @@ GpsL5DllPllTracking::GpsL5DllPllTracking(
trk_param.fs_in = fs_in;
bool dump = configuration->property(role + ".dump", false);
trk_param.dump = dump;
+ trk_param.high_dyn = configuration->property(role + ".high_dyn", false);
+ if (configuration->property(role + ".smoother_length", 10) < 1)
+ {
+ trk_param.smoother_length = 1;
+ std::cout << TEXT_RED << "WARNING: GPS L5. smoother_length must be bigger than 0. It has been set to 1" << TEXT_RESET << std::endl;
+ }
+ else
+ {
+ trk_param.smoother_length = configuration->property(role + ".smoother_length", 10);
+ }
float pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0);
if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz);
trk_param.pll_bw_hz = pll_bw_hz;
diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc
index 4f2879983..a52ed894d 100755
--- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc
+++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc
@@ -58,6 +58,7 @@
#include
#include
#include
+#include
using google::LogMessage;
@@ -355,6 +356,7 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl
{
// Extra correlator for the data component
correlator_data_cpu.init(2 * trk_parameters.vector_length, 1);
+ correlator_data_cpu.set_high_dynamics_resampler(trk_parameters.high_dyn);
d_data_code = static_cast(volk_gnsssdr_malloc(2 * d_code_length_chips * sizeof(float), volk_gnsssdr_get_alignment()));
}
else
@@ -363,7 +365,7 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl
}
// --- Initializations ---
- multicorrelator_cpu.set_high_dynamics_resampler(trk_parameters.use_high_dynamics_resampler);
+ multicorrelator_cpu.set_high_dynamics_resampler(trk_parameters.high_dyn);
// Initial code frequency basis of NCO
d_code_freq_chips = d_code_chip_rate;
// Residual code phase (in chips)
@@ -397,12 +399,22 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl
d_code_phase_step_chips = 0.0;
d_code_phase_rate_step_chips = 0.0;
d_carrier_phase_step_rad = 0.0;
+ d_carrier_phase_rate_step_rad = 0.0;
d_rem_code_phase_chips = 0.0;
- d_K_blk_samples = 0.0;
d_code_phase_samples = 0.0;
d_last_prompt = gr_complex(0.0, 0.0);
d_state = 0; // initial state: standby
clear_tracking_vars();
+ if (trk_parameters.smoother_length > 0)
+ {
+ d_carr_ph_history.resize(trk_parameters.smoother_length * 2);
+ d_code_ph_history.resize(trk_parameters.smoother_length * 2);
+ }
+ else
+ {
+ d_carr_ph_history.resize(1);
+ d_code_ph_history.resize(1);
+ }
}
@@ -424,6 +436,7 @@ void dll_pll_veml_tracking::start_tracking()
// new chip and PRN sequence periods based on acq Doppler
d_code_freq_chips = radial_velocity * d_code_chip_rate;
d_code_phase_step_chips = d_code_freq_chips / trk_parameters.fs_in;
+ d_code_phase_rate_step_chips = 0.0;
double T_chip_mod_seconds = 1.0 / d_code_freq_chips;
double T_prn_mod_seconds = T_chip_mod_seconds * static_cast(d_code_length_chips);
double T_prn_mod_samples = T_prn_mod_seconds * trk_parameters.fs_in;
@@ -446,7 +459,9 @@ void dll_pll_veml_tracking::start_tracking()
d_carrier_doppler_hz = d_acq_carrier_doppler_hz;
d_carrier_phase_step_rad = PI_2 * d_carrier_doppler_hz / trk_parameters.fs_in;
-
+ d_carrier_phase_rate_step_rad = 0.0;
+ d_carr_ph_history.clear();
+ d_code_ph_history.clear();
// DLL/PLL filter initialization
d_carrier_loop_filter.initialize(); // initialize the carrier filter
d_code_loop_filter.initialize(); // initialize the code filter
@@ -706,7 +721,7 @@ void dll_pll_veml_tracking::do_correlation_step(const gr_complex *input_samples)
multicorrelator_cpu.set_input_output_vectors(d_correlator_outs, input_samples);
multicorrelator_cpu.Carrier_wipeoff_multicorrelator_resampler(
d_rem_carr_phase_rad,
- d_carrier_phase_step_rad,
+ d_carrier_phase_step_rad, d_carrier_phase_rate_step_rad,
static_cast(d_rem_code_phase_chips) * static_cast(d_code_samples_per_chip),
static_cast(d_code_phase_step_chips) * static_cast(d_code_samples_per_chip),
static_cast(d_code_phase_rate_step_chips) * static_cast(d_code_samples_per_chip),
@@ -718,7 +733,7 @@ void dll_pll_veml_tracking::do_correlation_step(const gr_complex *input_samples)
correlator_data_cpu.set_input_output_vectors(d_Prompt_Data, input_samples);
correlator_data_cpu.Carrier_wipeoff_multicorrelator_resampler(
d_rem_carr_phase_rad,
- d_carrier_phase_step_rad,
+ d_carrier_phase_step_rad, d_carrier_phase_rate_step_rad,
static_cast(d_rem_code_phase_chips) * static_cast(d_code_samples_per_chip),
static_cast(d_code_phase_step_chips) * static_cast(d_code_samples_per_chip),
static_cast(d_code_phase_rate_step_chips) * static_cast(d_code_samples_per_chip),
@@ -777,6 +792,10 @@ void dll_pll_veml_tracking::clear_tracking_vars()
d_current_symbol = 0;
d_Prompt_buffer_deque.clear();
d_last_prompt = gr_complex(0.0, 0.0);
+ d_carrier_phase_rate_step_rad = 0.0;
+ d_code_phase_rate_step_chips = 0.0;
+ d_carr_ph_history.clear();
+ d_code_ph_history.clear();
}
@@ -796,15 +815,60 @@ void dll_pll_veml_tracking::update_tracking_vars()
//################### PLL COMMANDS #################################################
// carrier phase step (NCO phase increment per sample) [rads/sample]
d_carrier_phase_step_rad = PI_2 * d_carrier_doppler_hz / trk_parameters.fs_in;
+ // carrier phase rate step (NCO phase increment rate per sample) [rads/sample^2]
+ if (trk_parameters.high_dyn)
+ {
+ d_carr_ph_history.push_back(std::pair(d_carrier_phase_step_rad, static_cast(d_current_prn_length_samples)));
+ if (d_carr_ph_history.full())
+ {
+ double tmp_cp1 = 0.0;
+ double tmp_cp2 = 0.0;
+ double tmp_samples = 0.0;
+ for (unsigned int k = 0; k < trk_parameters.smoother_length; k++)
+ {
+ tmp_cp1 += d_carr_ph_history.at(k).first;
+ tmp_cp2 += d_carr_ph_history.at(trk_parameters.smoother_length * 2 - k - 1).first;
+ tmp_samples += d_carr_ph_history.at(trk_parameters.smoother_length * 2 - k - 1).second;
+ }
+ tmp_cp1 /= static_cast(trk_parameters.smoother_length);
+ tmp_cp2 /= static_cast(trk_parameters.smoother_length);
+ d_carrier_phase_rate_step_rad = (tmp_cp2 - tmp_cp1) / tmp_samples;
+ }
+ }
+ //std::cout << d_carrier_phase_rate_step_rad * trk_parameters.fs_in * trk_parameters.fs_in / PI_2 << std::endl;
// remnant carrier phase to prevent overflow in the code NCO
- d_rem_carr_phase_rad += d_carrier_phase_step_rad * static_cast(d_current_prn_length_samples);
+ d_rem_carr_phase_rad += static_cast(d_carrier_phase_step_rad * static_cast(d_current_prn_length_samples) + 0.5 * d_carrier_phase_rate_step_rad * static_cast(d_current_prn_length_samples) * static_cast(d_current_prn_length_samples));
d_rem_carr_phase_rad = fmod(d_rem_carr_phase_rad, PI_2);
+
+
// carrier phase accumulator
- d_acc_carrier_phase_rad -= d_carrier_phase_step_rad * static_cast(d_current_prn_length_samples);
+ //double a = d_carrier_phase_step_rad * static_cast(d_current_prn_length_samples);
+ //double b = 0.5 * d_carrier_phase_rate_step_rad * static_cast(d_current_prn_length_samples) * static_cast(d_current_prn_length_samples);
+ //std::cout << fmod(b, PI_2) / fmod(a, PI_2) << std::endl;
+ d_acc_carrier_phase_rad -= (d_carrier_phase_step_rad * static_cast(d_current_prn_length_samples) + 0.5 * d_carrier_phase_rate_step_rad * static_cast(d_current_prn_length_samples) * static_cast(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 / trk_parameters.fs_in;
+ if (trk_parameters.high_dyn)
+ {
+ d_code_ph_history.push_back(std::pair(d_code_phase_step_chips, static_cast(d_current_prn_length_samples)));
+ if (d_code_ph_history.full())
+ {
+ double tmp_cp1 = 0.0;
+ double tmp_cp2 = 0.0;
+ double tmp_samples = 0.0;
+ for (unsigned int k = 0; k < trk_parameters.smoother_length; k++)
+ {
+ tmp_cp1 += d_code_ph_history.at(k).first;
+ tmp_cp2 += d_code_ph_history.at(trk_parameters.smoother_length * 2 - k - 1).first;
+ tmp_samples += d_code_ph_history.at(trk_parameters.smoother_length * 2 - k - 1).second;
+ }
+ tmp_cp1 /= static_cast(trk_parameters.smoother_length);
+ tmp_cp2 /= static_cast(trk_parameters.smoother_length);
+ d_code_phase_rate_step_chips = (tmp_cp2 - tmp_cp1) / tmp_samples;
+ }
+ }
// remnant code phase [chips]
d_rem_code_phase_samples = K_blk_samples - static_cast(d_current_prn_length_samples); // rounding error < 1 sample
d_rem_code_phase_chips = d_code_freq_chips * d_rem_code_phase_samples / trk_parameters.fs_in;
@@ -947,8 +1011,14 @@ void dll_pll_veml_tracking::log_data(bool integrating)
// carrier and code frequency
tmp_float = d_carrier_doppler_hz;
d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float));
+ // carrier phase rate [Hz/s]
+ tmp_float = d_carrier_phase_rate_step_rad * trk_parameters.fs_in * trk_parameters.fs_in / PI_2;
+ d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float));
tmp_float = d_code_freq_chips;
d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float));
+ // code phase rate [chips/s^2]
+ tmp_float = d_code_phase_rate_step_chips * trk_parameters.fs_in * trk_parameters.fs_in;
+ d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float));
// PLL commands
tmp_float = d_carr_error_hz;
d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float));
@@ -986,7 +1056,7 @@ int32_t dll_pll_veml_tracking::save_matfile()
// READ DUMP FILE
std::ifstream::pos_type size;
int32_t number_of_double_vars = 1;
- int32_t number_of_float_vars = 17;
+ int32_t number_of_float_vars = 19;
int32_t epoch_size_bytes = sizeof(uint64_t) + sizeof(double) * number_of_double_vars +
sizeof(float) * number_of_float_vars + sizeof(uint32_t);
std::ifstream dump_file;
@@ -1022,7 +1092,9 @@ int32_t dll_pll_veml_tracking::save_matfile()
uint64_t *PRN_start_sample_count = new uint64_t[num_epoch];
float *acc_carrier_phase_rad = new float[num_epoch];
float *carrier_doppler_hz = new float[num_epoch];
+ float *carrier_doppler_rate_hz = new float[num_epoch];
float *code_freq_chips = new float[num_epoch];
+ float *code_freq_rate_chips = new float[num_epoch];
float *carr_error_hz = new float[num_epoch];
float *carr_error_filt_hz = new float[num_epoch];
float *code_error_chips = new float[num_epoch];
@@ -1049,7 +1121,9 @@ int32_t dll_pll_veml_tracking::save_matfile()
dump_file.read(reinterpret_cast(&PRN_start_sample_count[i]), sizeof(uint64_t));
dump_file.read(reinterpret_cast(&acc_carrier_phase_rad[i]), sizeof(float));
dump_file.read(reinterpret_cast(&carrier_doppler_hz[i]), sizeof(float));
+ dump_file.read(reinterpret_cast(&carrier_doppler_rate_hz[i]), sizeof(float));
dump_file.read(reinterpret_cast(&code_freq_chips[i]), sizeof(float));
+ dump_file.read(reinterpret_cast(&code_freq_rate_chips[i]), sizeof(float));
dump_file.read(reinterpret_cast(&carr_error_hz[i]), sizeof(float));
dump_file.read(reinterpret_cast(&carr_error_filt_hz[i]), sizeof(float));
dump_file.read(reinterpret_cast(&code_error_chips[i]), sizeof(float));
@@ -1076,7 +1150,9 @@ int32_t dll_pll_veml_tracking::save_matfile()
delete[] PRN_start_sample_count;
delete[] acc_carrier_phase_rad;
delete[] carrier_doppler_hz;
+ delete[] carrier_doppler_rate_hz;
delete[] code_freq_chips;
+ delete[] code_freq_rate_chips;
delete[] carr_error_hz;
delete[] carr_error_filt_hz;
delete[] code_error_chips;
@@ -1139,10 +1215,18 @@ int32_t dll_pll_veml_tracking::save_matfile()
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
Mat_VarFree(matvar);
+ matvar = Mat_VarCreate("carrier_doppler_rate_hz", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, carrier_doppler_rate_hz, 0);
+ Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
+ Mat_VarFree(matvar);
+
matvar = Mat_VarCreate("code_freq_chips", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, code_freq_chips, 0);
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
Mat_VarFree(matvar);
+ matvar = Mat_VarCreate("code_freq_rate_chips", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, code_freq_rate_chips, 0);
+ Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
+ Mat_VarFree(matvar);
+
matvar = Mat_VarCreate("carr_error_hz", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, carr_error_hz, 0);
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
Mat_VarFree(matvar);
@@ -1190,7 +1274,9 @@ int32_t dll_pll_veml_tracking::save_matfile()
delete[] PRN_start_sample_count;
delete[] acc_carrier_phase_rad;
delete[] carrier_doppler_hz;
+ delete[] carrier_doppler_rate_hz;
delete[] code_freq_chips;
+ delete[] code_freq_rate_chips;
delete[] carr_error_hz;
delete[] carr_error_filt_hz;
delete[] code_error_chips;
diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h
index 97f0c54cc..226a540c8 100755
--- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h
+++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h
@@ -41,6 +41,7 @@
#include
#include