mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-11-06 02:03:04 +00:00
Modernize code
Automatize memory management De-clutter clan-tidy warnings by fixing obvious issues
This commit is contained in:
@@ -40,9 +40,9 @@
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <volk/volk.h>
|
||||
#include <volk_gnsssdr/volk_gnsssdr.h>
|
||||
#include <array>
|
||||
#include <exception>
|
||||
#include <sstream>
|
||||
#include <utility>
|
||||
|
||||
|
||||
galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr galileo_e5a_noncoherentIQ_make_acquisition_caf_cc(
|
||||
@@ -310,9 +310,8 @@ void galileo_e5a_noncoherentIQ_acquisition_caf_cc::init()
|
||||
d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex *>(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
|
||||
int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
|
||||
float phase_step_rad = GALILEO_TWO_PI * doppler / static_cast<float>(d_fs_in);
|
||||
float _phase[1];
|
||||
_phase[0] = 0;
|
||||
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], -phase_step_rad, _phase, d_fft_size);
|
||||
std::array<float, 1> _phase{};
|
||||
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], -phase_step_rad, _phase.data(), d_fft_size);
|
||||
}
|
||||
|
||||
/* CAF Filtering to resolve doppler ambiguity. Phase and quadrature must be processed
|
||||
|
||||
@@ -34,9 +34,9 @@
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <volk/volk.h>
|
||||
#include <volk_gnsssdr/volk_gnsssdr.h>
|
||||
#include <array>
|
||||
#include <exception>
|
||||
#include <sstream>
|
||||
#include <utility>
|
||||
|
||||
|
||||
galileo_pcps_8ms_acquisition_cc_sptr galileo_pcps_8ms_make_acquisition_cc(
|
||||
@@ -192,9 +192,8 @@ void galileo_pcps_8ms_acquisition_cc::init()
|
||||
d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex *>(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
|
||||
int32_t doppler = -static_cast<int32_t>(d_doppler_max) + d_doppler_step * doppler_index;
|
||||
float phase_step_rad = static_cast<float>(GALILEO_TWO_PI) * doppler / static_cast<float>(d_fs_in);
|
||||
float _phase[1];
|
||||
_phase[0] = 0;
|
||||
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], -phase_step_rad, _phase, d_fft_size);
|
||||
std::array<float, 1> _phase{};
|
||||
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], -phase_step_rad, _phase.data(), d_fft_size);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -358,7 +357,7 @@ int galileo_pcps_8ms_acquisition_cc::general_work(int noutput_items,
|
||||
std::streamsize n = 2 * sizeof(float) * (d_fft_size); // complex file write
|
||||
filename.str("");
|
||||
filename << "../data/test_statistics_" << d_gnss_synchro->System
|
||||
<< "_" << d_gnss_synchro->Signal << "_sat_"
|
||||
<< "_" << d_gnss_synchro->Signal[0] << d_gnss_synchro->Signal[1] << "_sat_"
|
||||
<< d_gnss_synchro->PRN << "_doppler_" << doppler << ".dat";
|
||||
d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary);
|
||||
d_dump_file.write(reinterpret_cast<char *>(d_ifft->get_outbuf()), n); //write directly |abs(x)|^2 in this Doppler bin?
|
||||
|
||||
@@ -284,9 +284,8 @@ void pcps_acquisition::update_local_carrier(gsl::span<gr_complex> carrier_vector
|
||||
{
|
||||
phase_step_rad = GPS_TWO_PI * freq / static_cast<float>(acq_parameters.fs_in);
|
||||
}
|
||||
float _phase[1];
|
||||
_phase[0] = 0.0;
|
||||
volk_gnsssdr_s32f_sincos_32fc(carrier_vector.data(), -phase_step_rad, _phase, carrier_vector.length());
|
||||
std::array<float, 1> _phase{};
|
||||
volk_gnsssdr_s32f_sincos_32fc(carrier_vector.data(), -phase_step_rad, _phase.data(), carrier_vector.length());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -158,11 +158,11 @@ pcps_acquisition_fine_doppler_cc::pcps_acquisition_fine_doppler_cc(const Acq_Con
|
||||
unsigned int pcps_acquisition_fine_doppler_cc::nextPowerOf2(unsigned int n)
|
||||
{
|
||||
n--;
|
||||
n |= n >> 1;
|
||||
n |= n >> 2;
|
||||
n |= n >> 4;
|
||||
n |= n >> 8;
|
||||
n |= n >> 16;
|
||||
n |= n >> 1U;
|
||||
n |= n >> 2U;
|
||||
n |= n >> 4U;
|
||||
n |= n >> 8U;
|
||||
n |= n >> 16U;
|
||||
n++;
|
||||
return n;
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <volk/volk.h>
|
||||
#include <volk_gnsssdr/volk_gnsssdr.h>
|
||||
#include <array>
|
||||
#include <exception>
|
||||
#include <sstream>
|
||||
#include <utility>
|
||||
@@ -233,9 +234,8 @@ void pcps_assisted_acquisition_cc::redefine_grid()
|
||||
// doppler search steps
|
||||
// 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);
|
||||
float _phase[1];
|
||||
_phase[0] = 0;
|
||||
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index].data(), -phase_step_rad, _phase, d_fft_size);
|
||||
std::array<float, 1> _phase{};
|
||||
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index].data(), -phase_step_rad, _phase.data(), d_fft_size);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -206,9 +206,8 @@ void pcps_cccwsr_acquisition_cc::init()
|
||||
|
||||
int32_t doppler = -static_cast<int32_t>(d_doppler_max) + d_doppler_step * doppler_index;
|
||||
float phase_step_rad = GPS_TWO_PI * doppler / static_cast<float>(d_fs_in);
|
||||
float _phase[1];
|
||||
_phase[0] = 0;
|
||||
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], -phase_step_rad, _phase, d_fft_size);
|
||||
std::array<float, 1> _phase{};
|
||||
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], -phase_step_rad, _phase.data(), d_fft_size);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -57,11 +57,11 @@
|
||||
#include <volk/volk.h>
|
||||
#include <volk_gnsssdr/volk_gnsssdr.h>
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <exception>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <utility>
|
||||
|
||||
|
||||
pcps_opencl_acquisition_cc_sptr pcps_make_opencl_acquisition_cc(
|
||||
@@ -324,9 +324,8 @@ void pcps_opencl_acquisition_cc::init()
|
||||
|
||||
int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
|
||||
float phase_step_rad = static_cast<float>(GPS_TWO_PI) * doppler / static_cast<float>(d_fs_in);
|
||||
float _phase[1];
|
||||
_phase[0] = 0;
|
||||
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], -phase_step_rad, _phase, d_fft_size);
|
||||
std::array<float, 1> _phase{};
|
||||
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], -phase_step_rad, _phase.data(), d_fft_size);
|
||||
|
||||
if (d_opencl == 0)
|
||||
{
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
#include <cmath>
|
||||
#include <exception>
|
||||
#include <sstream>
|
||||
#include <utility>
|
||||
|
||||
|
||||
pcps_quicksync_acquisition_cc_sptr pcps_quicksync_make_acquisition_cc(
|
||||
@@ -235,9 +234,8 @@ void pcps_quicksync_acquisition_cc::init()
|
||||
d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_samples_per_code * d_folding_factor * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
|
||||
int32_t doppler = -static_cast<int32_t>(d_doppler_max) + d_doppler_step * doppler_index;
|
||||
float phase_step_rad = GPS_TWO_PI * doppler / static_cast<float>(d_fs_in);
|
||||
float _phase[1];
|
||||
_phase[0] = 0;
|
||||
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], -phase_step_rad, _phase, d_samples_per_code * d_folding_factor);
|
||||
std::array<float, 1> _phase{};
|
||||
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], -phase_step_rad, _phase.data(), d_samples_per_code * d_folding_factor);
|
||||
}
|
||||
// DLOG(INFO) << "end init";
|
||||
}
|
||||
|
||||
@@ -54,9 +54,9 @@
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <volk/volk.h>
|
||||
#include <volk_gnsssdr/volk_gnsssdr.h>
|
||||
#include <array>
|
||||
#include <exception>
|
||||
#include <sstream>
|
||||
#include <utility>
|
||||
|
||||
|
||||
pcps_tong_acquisition_cc_sptr pcps_tong_make_acquisition_cc(
|
||||
@@ -211,9 +211,8 @@ void pcps_tong_acquisition_cc::init()
|
||||
|
||||
int32_t doppler = -static_cast<int32_t>(d_doppler_max) + d_doppler_step * doppler_index;
|
||||
float phase_step_rad = GPS_TWO_PI * doppler / static_cast<float>(d_fs_in);
|
||||
float _phase[1];
|
||||
_phase[0] = 0;
|
||||
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], -phase_step_rad, _phase, d_fft_size);
|
||||
std::array<float, 1> _phase{};
|
||||
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], -phase_step_rad, _phase.data(), d_fft_size);
|
||||
|
||||
d_grid_data[doppler_index] = static_cast<float *>(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment()));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user