mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-16 12:12:57 +00:00
The sincos kernel now accepts an initial phase
This commit is contained in:
parent
485a405bab
commit
1983562496
@ -295,8 +295,9 @@ void galileo_e5a_noncoherentIQ_acquisition_caf_cc::init()
|
|||||||
d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex*>(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()));
|
d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex*>(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()));
|
||||||
int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
|
int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
|
||||||
float phase_step_rad = GALILEO_TWO_PI * (d_freq + doppler) / static_cast<float>(d_fs_in);
|
float phase_step_rad = GALILEO_TWO_PI * (d_freq + doppler) / static_cast<float>(d_fs_in);
|
||||||
|
float _phase[1];
|
||||||
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], - phase_step_rad, d_fft_size);
|
_phase[0] = 0;
|
||||||
|
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], - phase_step_rad, _phase, d_fft_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CAF Filtering to resolve doppler ambiguity. Phase and quadrature must be processed
|
/* CAF Filtering to resolve doppler ambiguity. Phase and quadrature must be processed
|
||||||
|
@ -174,7 +174,9 @@ void galileo_pcps_8ms_acquisition_cc::init()
|
|||||||
d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex*>(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()));
|
d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex*>(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()));
|
||||||
int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
|
int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
|
||||||
float phase_step_rad = static_cast<float>(GALILEO_TWO_PI) * (d_freq + doppler) / static_cast<float>(d_fs_in);
|
float phase_step_rad = static_cast<float>(GALILEO_TWO_PI) * (d_freq + doppler) / static_cast<float>(d_fs_in);
|
||||||
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], - phase_step_rad, d_fft_size);
|
float _phase[1];
|
||||||
|
_phase[0] = 0;
|
||||||
|
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], - phase_step_rad, _phase, d_fft_size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,7 +175,9 @@ void pcps_acquisition_cc::set_local_code(std::complex<float> * code)
|
|||||||
void pcps_acquisition_cc::update_local_carrier(gr_complex* carrier_vector, int correlator_length_samples, float freq)
|
void pcps_acquisition_cc::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_step_rad = GPS_TWO_PI * freq / static_cast<float>(d_fs_in);
|
||||||
volk_gnsssdr_s32f_sincos_32fc(carrier_vector, - phase_step_rad, correlator_length_samples);
|
float _phase[1];
|
||||||
|
_phase[0] = 0;
|
||||||
|
volk_gnsssdr_s32f_sincos_32fc(carrier_vector, - phase_step_rad, _phase, correlator_length_samples);
|
||||||
}
|
}
|
||||||
|
|
||||||
void pcps_acquisition_cc::init()
|
void pcps_acquisition_cc::init()
|
||||||
|
@ -207,7 +207,9 @@ void pcps_acquisition_fine_doppler_cc::update_carrier_wipeoff()
|
|||||||
// compute the carrier doppler wipe-off signal and store it
|
// compute the carrier doppler wipe-off signal and store it
|
||||||
phase_step_rad = static_cast<float>(GPS_TWO_PI) * ( d_freq + doppler_hz ) / static_cast<float>(d_fs_in);
|
phase_step_rad = static_cast<float>(GPS_TWO_PI) * ( d_freq + doppler_hz ) / static_cast<float>(d_fs_in);
|
||||||
d_grid_doppler_wipeoffs[doppler_index] = new gr_complex[d_fft_size];
|
d_grid_doppler_wipeoffs[doppler_index] = new gr_complex[d_fft_size];
|
||||||
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], - phase_step_rad, d_fft_size);
|
float _phase[1];
|
||||||
|
_phase[0] = 0;
|
||||||
|
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], - phase_step_rad, _phase, d_fft_size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,7 +177,9 @@ void pcps_acquisition_sc::set_local_code(std::complex<float> * code)
|
|||||||
void pcps_acquisition_sc::update_local_carrier(gr_complex* carrier_vector, int correlator_length_samples, float freq)
|
void pcps_acquisition_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_step_rad = GPS_TWO_PI * freq / static_cast<float>(d_fs_in);
|
||||||
volk_gnsssdr_s32f_sincos_32fc(carrier_vector, - phase_step_rad, correlator_length_samples);
|
float _phase[1];
|
||||||
|
_phase[0] = 0;
|
||||||
|
volk_gnsssdr_s32f_sincos_32fc(carrier_vector, - phase_step_rad, _phase, correlator_length_samples);
|
||||||
}
|
}
|
||||||
|
|
||||||
void pcps_acquisition_sc::init()
|
void pcps_acquisition_sc::init()
|
||||||
|
@ -252,7 +252,9 @@ void pcps_assisted_acquisition_cc::redefine_grid()
|
|||||||
// compute the carrier doppler wipe-off signal and store it
|
// compute the carrier doppler wipe-off signal and store it
|
||||||
phase_step_rad = static_cast<float>(GPS_TWO_PI) * doppler_hz / static_cast<float>(d_fs_in);
|
phase_step_rad = static_cast<float>(GPS_TWO_PI) * doppler_hz / static_cast<float>(d_fs_in);
|
||||||
d_grid_doppler_wipeoffs[doppler_index] = new gr_complex[d_fft_size];
|
d_grid_doppler_wipeoffs[doppler_index] = new gr_complex[d_fft_size];
|
||||||
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], - phase_step_rad, d_fft_size);
|
float _phase[1];
|
||||||
|
_phase[0] = 0;
|
||||||
|
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], - phase_step_rad, _phase, d_fft_size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -190,8 +190,9 @@ void pcps_cccwsr_acquisition_cc::init()
|
|||||||
|
|
||||||
int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
|
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);
|
float phase_step_rad = GPS_TWO_PI * (d_freq + doppler) / static_cast<float>(d_fs_in);
|
||||||
|
float _phase[1];
|
||||||
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], - phase_step_rad, d_fft_size);
|
_phase[0] = 0;
|
||||||
|
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], - phase_step_rad, _phase, d_fft_size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,10 +173,11 @@ void pcps_multithread_acquisition_cc::init()
|
|||||||
for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++)
|
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()));
|
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;
|
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_step_rad = static_cast<float>(GPS_TWO_PI) * (d_freq + doppler) / static_cast<float>(d_fs_in);
|
||||||
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], - phase_step_rad, d_fft_size);
|
float _phase[1];
|
||||||
|
_phase[0] = 0;
|
||||||
|
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], - phase_step_rad, _phase, d_fft_size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -317,7 +317,9 @@ void pcps_opencl_acquisition_cc::init()
|
|||||||
|
|
||||||
int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
|
int doppler = -static_cast<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_step_rad = static_cast<float>(GPS_TWO_PI) * (d_freq + doppler) / static_cast<float>(d_fs_in);
|
||||||
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], - phase_step_rad, d_fft_size);
|
float _phase[1];
|
||||||
|
_phase[0] = 0;
|
||||||
|
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], - phase_step_rad, _phase, d_fft_size);
|
||||||
|
|
||||||
if (d_opencl == 0)
|
if (d_opencl == 0)
|
||||||
{
|
{
|
||||||
|
@ -221,8 +221,9 @@ void pcps_quicksync_acquisition_cc::init()
|
|||||||
d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex*>(volk_malloc(d_samples_per_code * d_folding_factor * sizeof(gr_complex), volk_get_alignment()));
|
d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex*>(volk_malloc(d_samples_per_code * d_folding_factor * sizeof(gr_complex), volk_get_alignment()));
|
||||||
int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
|
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);
|
float phase_step_rad = GPS_TWO_PI * (d_freq + doppler) / static_cast<float>(d_fs_in);
|
||||||
|
float _phase[1];
|
||||||
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], - phase_step_rad, d_samples_per_code * d_folding_factor);
|
_phase[0] = 0;
|
||||||
|
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], - phase_step_rad, _phase, d_samples_per_code * d_folding_factor);
|
||||||
}
|
}
|
||||||
// DLOG(INFO) << "end init";
|
// DLOG(INFO) << "end init";
|
||||||
}
|
}
|
||||||
|
@ -187,8 +187,9 @@ void pcps_tong_acquisition_cc::init()
|
|||||||
|
|
||||||
int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
|
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);
|
float phase_step_rad = GPS_TWO_PI * (d_freq + doppler) / static_cast<float>(d_fs_in);
|
||||||
|
float _phase[1];
|
||||||
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], - phase_step_rad, d_fft_size);
|
_phase[0] = 0;
|
||||||
|
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], - phase_step_rad, _phase, d_fft_size);
|
||||||
|
|
||||||
d_grid_data[doppler_index] = static_cast<float*>(volk_malloc(d_fft_size * sizeof(float), volk_get_alignment()));
|
d_grid_data[doppler_index] = static_cast<float*>(volk_malloc(d_fft_size * sizeof(float), volk_get_alignment()));
|
||||||
|
|
||||||
|
@ -42,15 +42,17 @@
|
|||||||
*
|
*
|
||||||
* <b>Dispatcher Prototype</b>
|
* <b>Dispatcher Prototype</b>
|
||||||
* \code
|
* \code
|
||||||
* void volk_gnsssdr_s32f_sincos_32fc(lv_32fc_t* out, const float phase_inc, unsigned int num_points)
|
* void volk_gnsssdr_s32f_sincos_32fc(lv_32fc_t* out, const float phase_inc, float* phase, unsigned int num_points)
|
||||||
* \endcode
|
* \endcode
|
||||||
*
|
*
|
||||||
* \b Inputs
|
* \b Inputs
|
||||||
* \li phase_inc: Phase increment per sample, in radians.
|
* \li phase_inc: Phase increment per sample, in radians.
|
||||||
|
* \li phase: Pointer to a float containing the initial phase, in radians.
|
||||||
* \li num_points: Number of components in \p in to be computed.
|
* \li num_points: Number of components in \p in to be computed.
|
||||||
*
|
*
|
||||||
* \b Outputs
|
* \b Outputs
|
||||||
* \li out: Vector of the form lv_32fc_t out[n] = lv_cmake(cos(in[n]), sin(in[n]))
|
* \li out: Vector of the form lv_32fc_t out[n] = lv_cmake(cos(in[n]), sin(in[n]))
|
||||||
|
* \li phase: Pointer to a float containing the final phase, in radians.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -67,13 +69,13 @@
|
|||||||
#include <emmintrin.h>
|
#include <emmintrin.h>
|
||||||
/* Adapted from http://gruntthepeon.free.fr/ssemath/sse_mathfun.h, original code from Julien Pommier */
|
/* Adapted from http://gruntthepeon.free.fr/ssemath/sse_mathfun.h, original code from Julien Pommier */
|
||||||
/* Based on algorithms from the cephes library http://www.netlib.org/cephes/ */
|
/* Based on algorithms from the cephes library http://www.netlib.org/cephes/ */
|
||||||
static inline void volk_gnsssdr_s32f_sincos_32fc_a_sse2(lv_32fc_t* out, const float phase_inc, unsigned int num_points)
|
static inline void volk_gnsssdr_s32f_sincos_32fc_a_sse2(lv_32fc_t* out, const float phase_inc, float* phase, unsigned int num_points)
|
||||||
{
|
{
|
||||||
lv_32fc_t* bPtr = out;
|
lv_32fc_t* bPtr = out;
|
||||||
|
|
||||||
const unsigned int sse_iters = num_points / 4;
|
const unsigned int sse_iters = num_points / 4;
|
||||||
unsigned int number = 0;
|
unsigned int number = 0;
|
||||||
float _phase;
|
float _phase = (*phase);
|
||||||
|
|
||||||
__m128 sine, cosine, aux, x, four_phases_reg;
|
__m128 sine, cosine, aux, x, four_phases_reg;
|
||||||
__m128 xmm1, xmm2, xmm3 = _mm_setzero_ps(), sign_bit_sin, y;
|
__m128 xmm1, xmm2, xmm3 = _mm_setzero_ps(), sign_bit_sin, y;
|
||||||
@ -101,7 +103,7 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_a_sse2(lv_32fc_t* out, const fl
|
|||||||
static const float _ps_0p5[4] __attribute__((aligned(16))) = { 0.5f, 0.5f, 0.5f, 0.5f };
|
static const float _ps_0p5[4] __attribute__((aligned(16))) = { 0.5f, 0.5f, 0.5f, 0.5f };
|
||||||
static const float _ps_1[4] __attribute__((aligned(16))) = { 1.0f, 1.0f, 1.0f, 1.0f };
|
static const float _ps_1[4] __attribute__((aligned(16))) = { 1.0f, 1.0f, 1.0f, 1.0f };
|
||||||
|
|
||||||
float four_phases[4] __attribute__((aligned(16))) = { 0.0f, phase_inc, 2 * phase_inc, 3 * phase_inc };
|
float four_phases[4] __attribute__((aligned(16))) = { _phase, _phase + phase_inc, _phase + 2 * phase_inc, _phase + 3 * phase_inc };
|
||||||
float four_phases_inc[4] __attribute__((aligned(16))) = { 4 * phase_inc, 4 * phase_inc, 4 * phase_inc, 4 * phase_inc };
|
float four_phases_inc[4] __attribute__((aligned(16))) = { 4 * phase_inc, 4 * phase_inc, 4 * phase_inc, 4 * phase_inc };
|
||||||
four_phases_reg = _mm_load_ps(four_phases);
|
four_phases_reg = _mm_load_ps(four_phases);
|
||||||
const __m128 four_phases_inc_reg = _mm_load_ps(four_phases_inc);
|
const __m128 four_phases_inc_reg = _mm_load_ps(four_phases_inc);
|
||||||
@ -207,12 +209,13 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_a_sse2(lv_32fc_t* out, const fl
|
|||||||
four_phases_reg = _mm_add_ps(four_phases_reg, four_phases_inc_reg);
|
four_phases_reg = _mm_add_ps(four_phases_reg, four_phases_inc_reg);
|
||||||
}
|
}
|
||||||
|
|
||||||
_phase = phase_inc * (sse_iters * 4);
|
_phase = _phase + phase_inc * (sse_iters * 4);
|
||||||
for(number = sse_iters * 4; number < num_points; number++)
|
for(number = sse_iters * 4; number < num_points; number++)
|
||||||
{
|
{
|
||||||
*bPtr++ = lv_cmake((float)cos(_phase), (float)sin(_phase) );
|
*bPtr++ = lv_cmake((float)cos((_phase)), (float)sin((_phase)) );
|
||||||
_phase += phase_inc;
|
_phase += phase_inc;
|
||||||
}
|
}
|
||||||
|
(*phase) = _phase;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* LV_HAVE_SSE2 */
|
#endif /* LV_HAVE_SSE2 */
|
||||||
@ -222,13 +225,14 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_a_sse2(lv_32fc_t* out, const fl
|
|||||||
#include <emmintrin.h>
|
#include <emmintrin.h>
|
||||||
/* Adapted from http://gruntthepeon.free.fr/ssemath/sse_mathfun.h, original code from Julien Pommier */
|
/* Adapted from http://gruntthepeon.free.fr/ssemath/sse_mathfun.h, original code from Julien Pommier */
|
||||||
/* Based on algorithms from the cephes library http://www.netlib.org/cephes/ */
|
/* Based on algorithms from the cephes library http://www.netlib.org/cephes/ */
|
||||||
static inline void volk_gnsssdr_s32f_sincos_32fc_u_sse2(lv_32fc_t* out, const float phase_inc, unsigned int num_points)
|
static inline void volk_gnsssdr_s32f_sincos_32fc_u_sse2(lv_32fc_t* out, const float phase_inc, float* phase, unsigned int num_points)
|
||||||
{
|
{
|
||||||
lv_32fc_t* bPtr = out;
|
lv_32fc_t* bPtr = out;
|
||||||
|
|
||||||
const unsigned int sse_iters = num_points / 4;
|
const unsigned int sse_iters = num_points / 4;
|
||||||
unsigned int number = 0;
|
unsigned int number = 0;
|
||||||
float _phase;
|
|
||||||
|
float _phase = (*phase);
|
||||||
|
|
||||||
__m128 sine, cosine, aux, x, four_phases_reg;
|
__m128 sine, cosine, aux, x, four_phases_reg;
|
||||||
__m128 xmm1, xmm2, xmm3 = _mm_setzero_ps(), sign_bit_sin, y;
|
__m128 xmm1, xmm2, xmm3 = _mm_setzero_ps(), sign_bit_sin, y;
|
||||||
@ -256,7 +260,7 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_u_sse2(lv_32fc_t* out, const fl
|
|||||||
static const float _ps_0p5[4] __attribute__((aligned(16))) = { 0.5f, 0.5f, 0.5f, 0.5f };
|
static const float _ps_0p5[4] __attribute__((aligned(16))) = { 0.5f, 0.5f, 0.5f, 0.5f };
|
||||||
static const float _ps_1[4] __attribute__((aligned(16))) = { 1.0f, 1.0f, 1.0f, 1.0f };
|
static const float _ps_1[4] __attribute__((aligned(16))) = { 1.0f, 1.0f, 1.0f, 1.0f };
|
||||||
|
|
||||||
float four_phases[4] __attribute__((aligned(16))) = { 0.0f, phase_inc, 2 * phase_inc, 3 * phase_inc };
|
float four_phases[4] __attribute__((aligned(16))) = { _phase, _phase + phase_inc, _phase + 2 * phase_inc, _phase + 3 * phase_inc };
|
||||||
float four_phases_inc[4] __attribute__((aligned(16))) = { 4 * phase_inc, 4 * phase_inc, 4 * phase_inc, 4 * phase_inc };
|
float four_phases_inc[4] __attribute__((aligned(16))) = { 4 * phase_inc, 4 * phase_inc, 4 * phase_inc, 4 * phase_inc };
|
||||||
four_phases_reg = _mm_load_ps(four_phases);
|
four_phases_reg = _mm_load_ps(four_phases);
|
||||||
const __m128 four_phases_inc_reg = _mm_load_ps(four_phases_inc);
|
const __m128 four_phases_inc_reg = _mm_load_ps(four_phases_inc);
|
||||||
@ -362,26 +366,29 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_u_sse2(lv_32fc_t* out, const fl
|
|||||||
four_phases_reg = _mm_add_ps(four_phases_reg, four_phases_inc_reg);
|
four_phases_reg = _mm_add_ps(four_phases_reg, four_phases_inc_reg);
|
||||||
}
|
}
|
||||||
|
|
||||||
_phase = phase_inc * (sse_iters * 4);
|
_phase = _phase + phase_inc * (sse_iters * 4);
|
||||||
for(number = sse_iters * 4; number < num_points; number++)
|
for(number = sse_iters * 4; number < num_points; number++)
|
||||||
{
|
{
|
||||||
*bPtr++ = lv_cmake((float)cos(_phase), (float)sin(_phase) );
|
*bPtr++ = lv_cmake((float)cos(_phase), (float)sin(_phase) );
|
||||||
_phase += phase_inc;
|
_phase += phase_inc;
|
||||||
}
|
}
|
||||||
|
(*phase) = _phase;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* LV_HAVE_SSE2 */
|
#endif /* LV_HAVE_SSE2 */
|
||||||
|
|
||||||
|
|
||||||
#ifdef LV_HAVE_GENERIC
|
#ifdef LV_HAVE_GENERIC
|
||||||
|
|
||||||
static inline void volk_gnsssdr_s32f_sincos_32fc_generic(lv_32fc_t* out, const float phase_inc, unsigned int num_points)
|
static inline void volk_gnsssdr_s32f_sincos_32fc_generic(lv_32fc_t* out, const float phase_inc, float* phase, unsigned int num_points)
|
||||||
{
|
{
|
||||||
float _phase = 0.0;
|
float _phase = (*phase);
|
||||||
for(unsigned int i = 0; i < num_points; i++)
|
for(unsigned int i = 0; i < num_points; i++)
|
||||||
{
|
{
|
||||||
*out++ = lv_cmake((float)cos(_phase), (float)sin(_phase) );
|
*out++ = lv_cmake((float)cos(_phase), (float)sin(_phase) );
|
||||||
_phase += phase_inc;
|
_phase += phase_inc;
|
||||||
}
|
}
|
||||||
|
(*phase) = _phase;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* LV_HAVE_GENERIC */
|
#endif /* LV_HAVE_GENERIC */
|
||||||
@ -390,7 +397,7 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_generic(lv_32fc_t* out, const f
|
|||||||
#ifdef LV_HAVE_GENERIC
|
#ifdef LV_HAVE_GENERIC
|
||||||
#include <volk_gnsssdr/volk_gnsssdr_sine_table.h>
|
#include <volk_gnsssdr/volk_gnsssdr_sine_table.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
static inline void volk_gnsssdr_s32f_sincos_32fc_generic_fxpt(lv_32fc_t* out, const float phase_inc, unsigned int num_points)
|
static inline void volk_gnsssdr_s32f_sincos_32fc_generic_fxpt(lv_32fc_t* out, const float phase_inc, float* phase, unsigned int num_points)
|
||||||
{
|
{
|
||||||
float _in, s, c;
|
float _in, s, c;
|
||||||
int32_t x, sin_index, cos_index, d;
|
int32_t x, sin_index, cos_index, d;
|
||||||
@ -401,7 +408,7 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_generic_fxpt(lv_32fc_t* out, co
|
|||||||
const int32_t Nbits = 10;
|
const int32_t Nbits = 10;
|
||||||
const int32_t diffbits = bitlength - Nbits;
|
const int32_t diffbits = bitlength - Nbits;
|
||||||
uint32_t ux;
|
uint32_t ux;
|
||||||
float _phase = 0.0;
|
float _phase = (*phase);
|
||||||
for(unsigned int i = 0; i < num_points; i++)
|
for(unsigned int i = 0; i < num_points; i++)
|
||||||
{
|
{
|
||||||
_in = _phase;
|
_in = _phase;
|
||||||
@ -420,6 +427,7 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_generic_fxpt(lv_32fc_t* out, co
|
|||||||
*out++ = lv_cmake((float)c, (float)s );
|
*out++ = lv_cmake((float)c, (float)s );
|
||||||
_phase += phase_inc;
|
_phase += phase_inc;
|
||||||
}
|
}
|
||||||
|
(*phase) = _phase;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* LV_HAVE_GENERIC */
|
#endif /* LV_HAVE_GENERIC */
|
||||||
@ -429,12 +437,13 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_generic_fxpt(lv_32fc_t* out, co
|
|||||||
#include <arm_neon.h>
|
#include <arm_neon.h>
|
||||||
/* Adapted from http://gruntthepeon.free.fr/ssemath/neon_mathfun.h, original code from Julien Pommier */
|
/* Adapted from http://gruntthepeon.free.fr/ssemath/neon_mathfun.h, original code from Julien Pommier */
|
||||||
/* Based on algorithms from the cephes library http://www.netlib.org/cephes/ */
|
/* Based on algorithms from the cephes library http://www.netlib.org/cephes/ */
|
||||||
static inline void volk_gnsssdr_s32f_sincos_32fc_neon(lv_32fc_t* out, const float phase_inc, unsigned int num_points)
|
static inline void volk_gnsssdr_s32f_sincos_32fc_neon(lv_32fc_t* out, const float phase_inc, float* phase, unsigned int num_points)
|
||||||
{
|
{
|
||||||
lv_32fc_t* bPtr = out;
|
lv_32fc_t* bPtr = out;
|
||||||
const unsigned int neon_iters = num_points / 4;
|
const unsigned int neon_iters = num_points / 4;
|
||||||
|
float _phase = (*phase);
|
||||||
|
|
||||||
__VOLK_ATTR_ALIGNED(16) float32_t four_phases[4] = { 0.0f , phase_inc, 2 * phase_inc, 3 * phase_inc };
|
__VOLK_ATTR_ALIGNED(16) float32_t four_phases[4] = { _phase, _phase + phase_inc, _phase + 2 * phase_inc, _phase + 3 * phase_inc };
|
||||||
float four_inc = 4 * phase_inc;
|
float four_inc = 4 * phase_inc;
|
||||||
__VOLK_ATTR_ALIGNED(16) float32_t four_phases_inc[4] = { four_inc, four_inc, four_inc, four_inc };
|
__VOLK_ATTR_ALIGNED(16) float32_t four_phases_inc[4] = { four_inc, four_inc, four_inc, four_inc };
|
||||||
|
|
||||||
@ -453,7 +462,6 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_neon(lv_32fc_t* out, const floa
|
|||||||
const float32_t c_cephes_FOPI = 1.27323954473516;
|
const float32_t c_cephes_FOPI = 1.27323954473516;
|
||||||
|
|
||||||
unsigned int number = 0;
|
unsigned int number = 0;
|
||||||
float _phase;
|
|
||||||
|
|
||||||
float32x4_t x, xmm1, xmm2, xmm3, y, y1, y2, ys, yc, z;
|
float32x4_t x, xmm1, xmm2, xmm3, y, y1, y2, ys, yc, z;
|
||||||
float32x4x2_t result;
|
float32x4x2_t result;
|
||||||
@ -535,6 +543,7 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_neon(lv_32fc_t* out, const floa
|
|||||||
*bPtr++ = lv_cmake((float)cos(_phase), (float)sin(_phase) );
|
*bPtr++ = lv_cmake((float)cos(_phase), (float)sin(_phase) );
|
||||||
_phase += phase_inc;
|
_phase += phase_inc;
|
||||||
}
|
}
|
||||||
|
(*phase) = _phase:
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* LV_HAVE_NEON */
|
#endif /* LV_HAVE_NEON */
|
||||||
|
@ -0,0 +1,95 @@
|
|||||||
|
/*!
|
||||||
|
* \file volk_gnsssdr_s32f_sincospuppet_32fc.h
|
||||||
|
* \brief VOLK_GNSSSDR puppet for the sincos kernel.
|
||||||
|
* \authors <ul>
|
||||||
|
* <li> Carles Fernandez Prades 2016 cfernandez at cttc dot cat
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* VOLK_GNSSSDR puppet for integrating the sincos kernel into the 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_s32f_sincospuppet_32fc_H
|
||||||
|
#define INCLUDED_volk_gnsssdr_s32f_sincospuppet_32fc_H
|
||||||
|
|
||||||
|
|
||||||
|
#include <volk_gnsssdr/volk_gnsssdr_complex.h>
|
||||||
|
#include "volk_gnsssdr/volk_gnsssdr_s32f_sincos_32fc.h"
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef LV_HAVE_GENERIC
|
||||||
|
static inline void volk_gnsssdr_s32f_sincospuppet_32fc_generic(lv_32fc_t* out, const float phase_inc, unsigned int num_points)
|
||||||
|
{
|
||||||
|
float phase[1];
|
||||||
|
phase[0] = 3;
|
||||||
|
volk_gnsssdr_s32f_sincos_32fc_generic(out, phase_inc, phase, num_points);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* LV_HAVE_GENERIC */
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef LV_HAVE_GENERIC
|
||||||
|
static inline void volk_gnsssdr_s32f_sincospuppet_32fc_generic_fxpt(lv_32fc_t* out, const float phase_inc, unsigned int num_points)
|
||||||
|
{
|
||||||
|
float phase[1];
|
||||||
|
phase[0] = 3;
|
||||||
|
volk_gnsssdr_s32f_sincos_32fc_generic_fxpt(out, phase_inc, phase, num_points);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* LV_HAVE_GENERIC */
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef LV_HAVE_SSE2
|
||||||
|
static inline void volk_gnsssdr_s32f_sincospuppet_32fc_a_sse2(lv_32fc_t* out, const float phase_inc, unsigned int num_points)
|
||||||
|
{
|
||||||
|
float phase[1];
|
||||||
|
phase[0] = 3;
|
||||||
|
volk_gnsssdr_s32f_sincos_32fc_a_sse2(out, phase_inc, phase, num_points);
|
||||||
|
}
|
||||||
|
#endif /* LV_HAVE_SSE2 */
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef LV_HAVE_SSE2
|
||||||
|
static inline void volk_gnsssdr_s32f_sincospuppet_32fc_u_sse2(lv_32fc_t* out, const float phase_inc, unsigned int num_points)
|
||||||
|
{
|
||||||
|
float phase[1];
|
||||||
|
phase[0] = 3;
|
||||||
|
volk_gnsssdr_s32f_sincos_32fc_u_sse2(out, phase_inc, phase, num_points);
|
||||||
|
}
|
||||||
|
#endif /* LV_HAVE_SSE2 */
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef LV_HAVE_NEON
|
||||||
|
static inline void volk_gnsssdr_s32f_sincospuppet_32fc_neon(lv_32fc_t* out, const float phase_inc, unsigned int num_points)
|
||||||
|
{
|
||||||
|
float phase[1];
|
||||||
|
phase[0] = 3;
|
||||||
|
volk_gnsssdr_s32f_sincos_32fc_neon(out, phase_inc, phase, num_points);
|
||||||
|
}
|
||||||
|
#endif /* LV_HAVE_NEON */
|
||||||
|
|
||||||
|
#endif /* INCLUDED_volk_gnsssdr_s32f_sincospuppet_32fc_H */
|
@ -78,12 +78,12 @@ std::vector<volk_gnsssdr_test_case_t> init_test_list(volk_gnsssdr_test_params_t
|
|||||||
(VOLK_INIT_TEST(volk_gnsssdr_8u_x2_multiply_8u, test_params_more_iters))
|
(VOLK_INIT_TEST(volk_gnsssdr_8u_x2_multiply_8u, test_params_more_iters))
|
||||||
(VOLK_INIT_TEST(volk_gnsssdr_64f_accumulator_64f, test_params))
|
(VOLK_INIT_TEST(volk_gnsssdr_64f_accumulator_64f, test_params))
|
||||||
(VOLK_INIT_TEST(volk_gnsssdr_32f_sincos_32fc, test_params_inacc))
|
(VOLK_INIT_TEST(volk_gnsssdr_32f_sincos_32fc, test_params_inacc))
|
||||||
(VOLK_INIT_TEST(volk_gnsssdr_s32f_sincos_32fc, test_params_inacc2))
|
|
||||||
(VOLK_INIT_TEST(volk_gnsssdr_32fc_convert_8ic, test_params))
|
(VOLK_INIT_TEST(volk_gnsssdr_32fc_convert_8ic, test_params))
|
||||||
(VOLK_INIT_TEST(volk_gnsssdr_32fc_convert_16ic, test_params_more_iters))
|
(VOLK_INIT_TEST(volk_gnsssdr_32fc_convert_16ic, test_params_more_iters))
|
||||||
(VOLK_INIT_TEST(volk_gnsssdr_16ic_x2_dot_prod_16ic, test_params))
|
(VOLK_INIT_TEST(volk_gnsssdr_16ic_x2_dot_prod_16ic, test_params))
|
||||||
(VOLK_INIT_TEST(volk_gnsssdr_16ic_x2_multiply_16ic, test_params_more_iters))
|
(VOLK_INIT_TEST(volk_gnsssdr_16ic_x2_multiply_16ic, test_params_more_iters))
|
||||||
(VOLK_INIT_TEST(volk_gnsssdr_16ic_convert_32fc, test_params_more_iters))
|
(VOLK_INIT_TEST(volk_gnsssdr_16ic_convert_32fc, test_params_more_iters))
|
||||||
|
(VOLK_INIT_PUPP(volk_gnsssdr_s32f_sincospuppet_32fc, volk_gnsssdr_s32f_sincos_32fc, test_params_inacc2))
|
||||||
(VOLK_INIT_PUPP(volk_gnsssdr_16ic_rotatorpuppet_16ic, volk_gnsssdr_16ic_s32fc_x2_rotator_16ic, test_params_int1))
|
(VOLK_INIT_PUPP(volk_gnsssdr_16ic_rotatorpuppet_16ic, volk_gnsssdr_16ic_s32fc_x2_rotator_16ic, test_params_int1))
|
||||||
(VOLK_INIT_PUPP(volk_gnsssdr_16ic_resamplerpuppet_16ic, volk_gnsssdr_16ic_resampler_16ic, test_params))
|
(VOLK_INIT_PUPP(volk_gnsssdr_16ic_resamplerpuppet_16ic, volk_gnsssdr_16ic_resampler_16ic, test_params))
|
||||||
(VOLK_INIT_PUPP(volk_gnsssdr_16ic_resamplerxnpuppet_16ic, volk_gnsssdr_16ic_xn_resampler_16ic_xn, test_params))
|
(VOLK_INIT_PUPP(volk_gnsssdr_16ic_resamplerxnpuppet_16ic, volk_gnsssdr_16ic_xn_resampler_16ic_xn, test_params))
|
||||||
|
Loading…
Reference in New Issue
Block a user