mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-12-15 12:40:35 +00:00
Fix acquisition with rata rates higher than 16 Msps in 4ms code periods
while not requiring a very recent version of VOLK
This commit is contained in:
parent
7e0e99dc4b
commit
438ba45c16
@ -47,32 +47,6 @@ include_directories(
|
||||
)
|
||||
|
||||
|
||||
## Workaround for issues with the change of VOLK API
|
||||
## See https://github.com/gnuradio/volk/issues/84
|
||||
## and https://github.com/gnss-sdr/gnss-sdr/issues/31
|
||||
|
||||
if(NOT VOLK_VERSION)
|
||||
set(VOLK_VERSION "1.2.2")
|
||||
endif(NOT VOLK_VERSION)
|
||||
|
||||
if(VOLK_VERSION VERSION_EQUAL 1.2.2)
|
||||
find_file(VOLK_GREATER_THAN_122
|
||||
NAMES volk/volk_32f_index_max_32u.h
|
||||
HINTS ${CMAKE_INSTALL_PREFIX}/include
|
||||
PATHS /usr/local/include
|
||||
/usr/include
|
||||
${CMAKE_INSTALL_PREFIX}/include
|
||||
)
|
||||
if(VOLK_GREATER_THAN_122)
|
||||
set(VOLK_VERSION "1.2.3+")
|
||||
endif(VOLK_GREATER_THAN_122)
|
||||
endif(VOLK_VERSION VERSION_EQUAL 1.2.2)
|
||||
|
||||
if(VOLK_VERSION VERSION_GREATER 1.2.2)
|
||||
add_definitions(-DVOLK_GT_122=1)
|
||||
endif(VOLK_VERSION VERSION_GREATER 1.2.2)
|
||||
|
||||
|
||||
if(OPENCL_FOUND)
|
||||
include_directories( ${OPENCL_INCLUDE_DIRS} )
|
||||
if(OS_IS_MACOSX)
|
||||
|
@ -475,7 +475,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
|
||||
|
||||
// Search maximum
|
||||
volk_32fc_magnitude_squared_32f(d_magnitudeIA, d_ifft->get_outbuf(), d_fft_size);
|
||||
volk_32f_index_max_32u(&indext_IA, d_magnitudeIA, d_fft_size);
|
||||
volk_gnsssdr_32f_index_max_32u(&indext_IA, d_magnitudeIA, d_fft_size);
|
||||
// Normalize the maximum value to correct the scale factor introduced by FFTW
|
||||
magt_IA = d_magnitudeIA[indext_IA] / (fft_normalization_factor * fft_normalization_factor);
|
||||
|
||||
@ -486,7 +486,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
|
||||
d_fft_if->get_outbuf(), d_fft_code_Q_A, d_fft_size);
|
||||
d_ifft->execute();
|
||||
volk_32fc_magnitude_squared_32f(d_magnitudeQA, d_ifft->get_outbuf(), d_fft_size);
|
||||
volk_32f_index_max_32u(&indext_QA, d_magnitudeQA, d_fft_size);
|
||||
volk_gnsssdr_32f_index_max_32u(&indext_QA, d_magnitudeQA, d_fft_size);
|
||||
magt_QA = d_magnitudeQA[indext_QA] / (fft_normalization_factor * fft_normalization_factor);
|
||||
}
|
||||
if (d_sampled_ms > 1) // If Integration time > 1 code
|
||||
@ -496,7 +496,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
|
||||
d_fft_if->get_outbuf(), d_fft_code_I_B, d_fft_size);
|
||||
d_ifft->execute();
|
||||
volk_32fc_magnitude_squared_32f(d_magnitudeIB, d_ifft->get_outbuf(), d_fft_size);
|
||||
volk_32f_index_max_32u(&indext_IB, d_magnitudeIB, d_fft_size);
|
||||
volk_gnsssdr_32f_index_max_32u(&indext_IB, d_magnitudeIB, d_fft_size);
|
||||
magt_IB = d_magnitudeIB[indext_IB] / (fft_normalization_factor * fft_normalization_factor);
|
||||
|
||||
if (d_both_signal_components == true)
|
||||
@ -506,7 +506,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
|
||||
d_fft_if->get_outbuf(), d_fft_code_Q_B, d_fft_size);
|
||||
d_ifft->execute();
|
||||
volk_32fc_magnitude_squared_32f(d_magnitudeQB, d_ifft->get_outbuf(), d_fft_size);
|
||||
volk_32f_index_max_32u(&indext_QB, d_magnitudeQB, d_fft_size);
|
||||
volk_gnsssdr_32f_index_max_32u(&indext_QB, d_magnitudeQB, d_fft_size);
|
||||
magt_QB = d_magnitudeIB[indext_QB] / (fft_normalization_factor * fft_normalization_factor);
|
||||
}
|
||||
}
|
||||
@ -543,7 +543,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
|
||||
}
|
||||
}
|
||||
}
|
||||
volk_32f_index_max_32u(&indext, d_magnitudeIA, d_fft_size);
|
||||
volk_gnsssdr_32f_index_max_32u(&indext, d_magnitudeIA, d_fft_size);
|
||||
magt = d_magnitudeIA[indext] / (fft_normalization_factor * fft_normalization_factor);
|
||||
}
|
||||
else
|
||||
@ -572,7 +572,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
|
||||
}
|
||||
}
|
||||
}
|
||||
volk_32f_index_max_32u(&indext, d_magnitudeIB, d_fft_size);
|
||||
volk_gnsssdr_32f_index_max_32u(&indext, d_magnitudeIB, d_fft_size);
|
||||
magt = d_magnitudeIB[indext] / (fft_normalization_factor * fft_normalization_factor);
|
||||
}
|
||||
}
|
||||
@ -590,7 +590,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
|
||||
d_magnitudeIA[i] += d_magnitudeQA[i];
|
||||
}
|
||||
}
|
||||
volk_32f_index_max_32u(&indext, d_magnitudeIA, d_fft_size);
|
||||
volk_gnsssdr_32f_index_max_32u(&indext, d_magnitudeIA, d_fft_size);
|
||||
magt = d_magnitudeIA[indext] / (fft_normalization_factor * fft_normalization_factor);
|
||||
}
|
||||
|
||||
@ -728,7 +728,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
|
||||
}
|
||||
|
||||
// Recompute the maximum doppler peak
|
||||
volk_32f_index_max_32u(&indext, d_CAF_vector, d_num_doppler_bins);
|
||||
volk_gnsssdr_32f_index_max_32u(&indext, d_CAF_vector, d_num_doppler_bins);
|
||||
doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * indext;
|
||||
d_gnss_synchro->Acq_doppler_hz = static_cast<double>(doppler);
|
||||
// Dump if required, appended at the end of the file
|
||||
|
@ -293,7 +293,7 @@ int galileo_pcps_8ms_acquisition_cc::general_work(int noutput_items,
|
||||
|
||||
// Search maximum
|
||||
volk_32fc_magnitude_squared_32f(d_magnitude, d_ifft->get_outbuf(), d_fft_size);
|
||||
volk_32f_index_max_32u(&indext_A, d_magnitude, d_fft_size);
|
||||
volk_gnsssdr_32f_index_max_32u(&indext_A, d_magnitude, d_fft_size);
|
||||
|
||||
// Normalize the maximum value to correct the scale factor introduced by FFTW
|
||||
magt_A = d_magnitude[indext_A] / (fft_normalization_factor * fft_normalization_factor);
|
||||
@ -309,7 +309,7 @@ int galileo_pcps_8ms_acquisition_cc::general_work(int noutput_items,
|
||||
|
||||
// Search maximum
|
||||
volk_32fc_magnitude_squared_32f(d_magnitude, d_ifft->get_outbuf(), d_fft_size);
|
||||
volk_32f_index_max_32u(&indext_B, d_magnitude, d_fft_size);
|
||||
volk_gnsssdr_32f_index_max_32u(&indext_B, d_magnitude, d_fft_size);
|
||||
|
||||
// Normalize the maximum value to correct the scale factor introduced by FFTW
|
||||
magt_B = d_magnitude[indext_B] / (fft_normalization_factor * fft_normalization_factor);
|
||||
|
@ -336,7 +336,7 @@ int pcps_acquisition_cc::general_work(int noutput_items,
|
||||
// Search maximum
|
||||
size_t offset = ( d_bit_transition_flag ? effective_fft_size : 0 );
|
||||
volk_32fc_magnitude_squared_32f(d_magnitude, d_ifft->get_outbuf() + offset, effective_fft_size);
|
||||
volk_32f_index_max_32u(&indext, d_magnitude, effective_fft_size);
|
||||
volk_gnsssdr_32f_index_max_32u(&indext, d_magnitude, effective_fft_size);
|
||||
magt = d_magnitude[indext];
|
||||
|
||||
if (d_use_CFAR_algorithm_flag == true)
|
||||
|
@ -227,7 +227,7 @@ double pcps_acquisition_fine_doppler_cc::search_maximum()
|
||||
|
||||
for (int i=0;i<d_num_doppler_points;i++)
|
||||
{
|
||||
volk_32f_index_max_32u(&tmp_intex_t, d_grid_data[i], d_fft_size);
|
||||
volk_gnsssdr_32f_index_max_32u(&tmp_intex_t, d_grid_data[i], d_fft_size);
|
||||
if (d_grid_data[i][tmp_intex_t] > magt)
|
||||
{
|
||||
magt = d_grid_data[i][tmp_intex_t];
|
||||
@ -360,7 +360,7 @@ int pcps_acquisition_fine_doppler_cc::estimate_Doppler(gr_vector_const_void_star
|
||||
volk_32fc_magnitude_squared_32f(p_tmp_vector, fft_operator->get_outbuf(), fft_size_extended);
|
||||
|
||||
uint32_t tmp_index_freq = 0;
|
||||
volk_32f_index_max_32u(&tmp_index_freq, p_tmp_vector, fft_size_extended);
|
||||
volk_gnsssdr_32f_index_max_32u(&tmp_index_freq, p_tmp_vector, fft_size_extended);
|
||||
|
||||
//case even
|
||||
int counter = 0;
|
||||
|
@ -334,7 +334,7 @@ int pcps_acquisition_sc::general_work(int noutput_items,
|
||||
// Search maximum
|
||||
size_t offset = ( d_bit_transition_flag ? effective_fft_size : 0 );
|
||||
volk_32fc_magnitude_squared_32f(d_magnitude, d_ifft->get_outbuf() + offset, effective_fft_size);
|
||||
volk_32f_index_max_32u(&indext, d_magnitude, effective_fft_size);
|
||||
volk_gnsssdr_32f_index_max_32u(&indext, d_magnitude, effective_fft_size);
|
||||
magt = d_magnitude[indext];
|
||||
|
||||
if (d_use_CFAR_algorithm_flag == true)
|
||||
|
@ -273,7 +273,7 @@ double pcps_assisted_acquisition_cc::search_maximum()
|
||||
|
||||
for (int i=0;i<d_num_doppler_points;i++)
|
||||
{
|
||||
volk_32f_index_max_32u_a(&tmp_intex_t,d_grid_data[i],d_fft_size);
|
||||
volk_gnsssdr_32f_index_max_32u(&tmp_intex_t,d_grid_data[i],d_fft_size);
|
||||
if (d_grid_data[i][tmp_intex_t] > magt)
|
||||
{
|
||||
magt = d_grid_data[i][index_time];
|
||||
|
@ -331,11 +331,11 @@ int pcps_cccwsr_acquisition_cc::general_work(int noutput_items,
|
||||
}
|
||||
|
||||
volk_32fc_magnitude_squared_32f(d_magnitude, d_correlation_plus, d_fft_size);
|
||||
volk_32f_index_max_32u(&indext_plus, d_magnitude, d_fft_size);
|
||||
volk_gnsssdr_32f_index_max_32u(&indext_plus, d_magnitude, d_fft_size);
|
||||
magt_plus = d_magnitude[indext_plus] / (fft_normalization_factor * fft_normalization_factor);
|
||||
|
||||
volk_32fc_magnitude_squared_32f(d_magnitude, d_correlation_minus, d_fft_size);
|
||||
volk_32f_index_max_32u(&indext_minus, d_magnitude, d_fft_size);
|
||||
volk_gnsssdr_32f_index_max_32u(&indext_minus, d_magnitude, d_fft_size);
|
||||
magt_minus = d_magnitude[indext_minus] / (fft_normalization_factor * fft_normalization_factor);
|
||||
|
||||
if (magt_plus >= magt_minus)
|
||||
|
@ -246,7 +246,7 @@ void pcps_multithread_acquisition_cc::acquisition_core()
|
||||
|
||||
// Search maximum
|
||||
volk_32fc_magnitude_squared_32f(d_magnitude, d_ifft->get_outbuf(), d_fft_size);
|
||||
volk_32f_index_max_32u(&indext, d_magnitude, 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);
|
||||
|
@ -431,7 +431,7 @@ void pcps_opencl_acquisition_cc::acquisition_core_volk()
|
||||
|
||||
// Search maximum
|
||||
volk_32fc_magnitude_squared_32f(d_magnitude, d_ifft->get_outbuf(), d_fft_size);
|
||||
volk_32f_index_max_32u(&indext, d_magnitude, 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);
|
||||
@ -593,7 +593,7 @@ void pcps_opencl_acquisition_cc::acquisition_core_opencl()
|
||||
|
||||
// Search maximum
|
||||
// @TODO: find an efficient way to search the maximum with OpenCL in the GPU.
|
||||
volk_32f_index_max_32u(&indext, d_magnitude, 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);
|
||||
|
@ -401,7 +401,7 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items,
|
||||
introduced by FFTW*/
|
||||
//volk_32f_s32f_multiply_32f_a(d_magnitude_folded,d_magnitude_folded,
|
||||
// (1 / (fft_normalization_factor * fft_normalization_factor)), d_fft_size);
|
||||
volk_32f_index_max_32u(&indext, d_magnitude_folded, d_fft_size);
|
||||
volk_gnsssdr_32f_index_max_32u(&indext, d_magnitude_folded, d_fft_size);
|
||||
|
||||
magt = d_magnitude_folded[indext] / (fft_normalization_factor * fft_normalization_factor);
|
||||
|
||||
@ -454,7 +454,7 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items,
|
||||
}
|
||||
/*Obtain maximun value of correlation given the possible delay selected */
|
||||
volk_32fc_magnitude_squared_32f(d_corr_output_f, complex_acumulator, d_folding_factor);
|
||||
volk_32f_index_max_32u(&indext, d_corr_output_f, d_folding_factor);
|
||||
volk_gnsssdr_32f_index_max_32u(&indext, d_corr_output_f, d_folding_factor);
|
||||
|
||||
/*Now save the real code phase in the gnss_syncro block for use in other stages*/
|
||||
d_gnss_synchro->Acq_delay_samples = static_cast<double>(d_possible_delay[indext]);
|
||||
|
@ -335,7 +335,7 @@ int pcps_tong_acquisition_cc::general_work(int noutput_items,
|
||||
volk_32f_x2_add_32f(d_grid_data[doppler_index], d_magnitude, d_grid_data[doppler_index], d_fft_size);
|
||||
|
||||
// Search maximum
|
||||
volk_32f_index_max_32u(&indext, d_grid_data[doppler_index], d_fft_size);
|
||||
volk_gnsssdr_32f_index_max_32u(&indext, d_grid_data[doppler_index], d_fft_size);
|
||||
|
||||
magt = d_grid_data[doppler_index][indext];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user