mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-15 19:55:47 +00:00
Dump carrier_phase_rate and modify matlab file
This commit is contained in:
parent
b66540b776
commit
2903e48e39
@ -86,17 +86,17 @@ static inline void volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn_g
|
||||
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.0, 0.0);
|
||||
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, 0);
|
||||
result[n_vec] = lv_cmake(0.0f, 0.0f);
|
||||
}
|
||||
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
|
||||
tmp32_1 = *in_common++ * (*phase);
|
||||
// Regenerate phase
|
||||
if (n % 256 == 0)
|
||||
{
|
||||
#ifdef __cplusplus
|
||||
@ -118,387 +118,4 @@ static inline void volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn_g
|
||||
|
||||
#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;
|
||||
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;
|
||||
__VOLK_ATTR_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
|
||||
|
||||
|
||||
#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_a_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;
|
||||
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;
|
||||
__VOLK_ATTR_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_load_ps(aPtr);
|
||||
a1Val = _mm256_load_ps(aPtr + 8);
|
||||
a2Val = _mm256_load_ps(aPtr + 16);
|
||||
a3Val = _mm256_load_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_high_dynamic_rotator_dot_prod_32fc_xn_H */
|
||||
|
@ -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.use_high_dynamics_resampler = configuration->property(role + ".high_dyn", false);
|
||||
if (configuration->property(role + ".cp_smoother_length", 10) < 1)
|
||||
{
|
||||
trk_param.smoother_length = 1;
|
||||
std::cout << TEXT_RED << "WARNING: GPS L1 C/A. cp_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 + ".cp_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);
|
||||
|
@ -811,11 +811,11 @@ void dll_pll_veml_tracking::update_tracking_vars()
|
||||
// carrier phase difference = carrier_phase(t2) - carrier_phase(t1)
|
||||
double cp_diff = -d_carrier_phase_step_rad; // The previous cp value is stored in the variable
|
||||
d_carrier_phase_step_rad = PI_2 * d_carrier_doppler_hz / trk_parameters.fs_in;
|
||||
cp_diff += d_carrier_phase_step_rad; // The new cp value is added to the previous in order to obtain the difference
|
||||
// carrier phase rate step (NCO phase increment rate per sample) [rads/sample^2]
|
||||
cp_diff /= static_cast<double>(d_current_prn_length_samples);
|
||||
if (trk_parameters.use_high_dynamics_resampler)
|
||||
{
|
||||
cp_diff += d_carrier_phase_step_rad; // The new cp value is added to the previous in order to obtain the difference
|
||||
// carrier phase rate step (NCO phase increment rate per sample) [rads/sample^2]
|
||||
cp_diff /= static_cast<double>(d_current_prn_length_samples);
|
||||
d_cp_history.push_back(cp_diff);
|
||||
if (d_cp_history.full())
|
||||
{
|
||||
@ -974,6 +974,9 @@ 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<char *>(&tmp_float), sizeof(float));
|
||||
// carrier phase rate [Hz/s^2]
|
||||
tmp_float = d_carrier_phase_rate_step_rad * trk_parameters.fs_in * trk_parameters.fs_in / PI_2;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));
|
||||
tmp_float = d_code_freq_chips;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));
|
||||
// PLL commands
|
||||
@ -1013,7 +1016,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 = 18;
|
||||
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;
|
||||
@ -1049,6 +1052,7 @@ 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 *carr_error_hz = new float[num_epoch];
|
||||
float *carr_error_filt_hz = new float[num_epoch];
|
||||
@ -1076,6 +1080,7 @@ int32_t dll_pll_veml_tracking::save_matfile()
|
||||
dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(uint64_t));
|
||||
dump_file.read(reinterpret_cast<char *>(&acc_carrier_phase_rad[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&carrier_doppler_hz[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&carrier_doppler_rate_hz[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&code_freq_chips[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&carr_error_hz[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&carr_error_filt_hz[i]), sizeof(float));
|
||||
@ -1103,6 +1108,7 @@ 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[] carr_error_hz;
|
||||
delete[] carr_error_filt_hz;
|
||||
@ -1166,6 +1172,10 @@ 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);
|
||||
@ -1217,6 +1227,7 @@ 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[] carr_error_hz;
|
||||
delete[] carr_error_filt_hz;
|
||||
|
@ -33,7 +33,7 @@ function [GNSS_tracking] = dll_pll_veml_read_tracking_dump (filename, count)
|
||||
|
||||
m = nargchk (1,2,nargin);
|
||||
|
||||
num_float_vars = 17;
|
||||
num_float_vars = 18;
|
||||
num_unsigned_long_int_vars = 1;
|
||||
num_double_vars = 1;
|
||||
num_unsigned_int_vars = 1;
|
||||
@ -114,17 +114,20 @@ else
|
||||
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
|
||||
fseek(f,bytes_shift,'bof'); % move to next 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 float
|
||||
v18 = fread (f, count, 'float', skip_bytes_each_read-float_size_bytes);
|
||||
v19 = 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);
|
||||
v20 = 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);
|
||||
v21 = fread (f, count, 'uint', skip_bytes_each_read - unsigned_int_size_bytes);
|
||||
fclose (f);
|
||||
|
||||
GNSS_tracking.VE = v1;
|
||||
@ -137,15 +140,16 @@ else
|
||||
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;
|
||||
GNSS_tracking.carrier_doppler_rate_hz = v11;
|
||||
GNSS_tracking.code_freq_hz = v12;
|
||||
GNSS_tracking.carr_error = v13;
|
||||
GNSS_tracking.carr_nco = v14;
|
||||
GNSS_tracking.code_error = v15;
|
||||
GNSS_tracking.code_nco = v16;
|
||||
GNSS_tracking.CN0_SNV_dB_Hz = v17;
|
||||
GNSS_tracking.carrier_lock_test = v18;
|
||||
GNSS_tracking.var1 = v19;
|
||||
GNSS_tracking.var2 = v20;
|
||||
GNSS_tracking.PRN = v21;
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user