mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-18 21:23:02 +00:00
Merge branch 'next' of https://github.com/gnss-sdr/gnss-sdr into vtl_experimental
This commit is contained in:
commit
364d957522
@ -287,6 +287,13 @@ if(GNURADIO_VERSION VERSION_GREATER 3.8.99)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# Detect if FFT are templates
|
||||
if(EXISTS ${GNURADIO_FFT_INCLUDE_DIRS}/gnuradio/fft/fft_vfc.h)
|
||||
set(GNURADIO_FFT_USES_TEMPLATES FALSE)
|
||||
else()
|
||||
set(GNURADIO_FFT_USES_TEMPLATES TRUE)
|
||||
endif()
|
||||
|
||||
# Search for IIO component
|
||||
if(GNURADIO_VERSION VERSION_GREATER 3.8.99)
|
||||
pkg_check_modules(PC_GNURADIO_IIO QUIET gnuradio-iio)
|
||||
|
@ -28,6 +28,7 @@ SPDX-FileCopyrightText: 2011-2020 Carles Fernandez-Prades <carles.fernandez@cttc
|
||||
- Added a common shared pointer definition `gnss_shared_ptr`, which allows to
|
||||
handle the `boost::shared_ptr` to `std::shared_ptr` transition in GNU Radio
|
||||
3.9 API more nicely.
|
||||
- Support new FFT blocks' templated API in GNU Radio 3.9.
|
||||
|
||||
### Improvements in Portability:
|
||||
|
||||
|
@ -96,6 +96,12 @@ if(GNURADIO_USES_STD_POINTERS)
|
||||
)
|
||||
endif()
|
||||
|
||||
if(GNURADIO_FFT_USES_TEMPLATES)
|
||||
target_compile_definitions(acquisition_gr_blocks
|
||||
PUBLIC -DGNURADIO_FFT_USES_TEMPLATES=1
|
||||
)
|
||||
endif()
|
||||
|
||||
if(ENABLE_ARMA_NO_DEBUG)
|
||||
target_compile_definitions(acquisition_gr_blocks
|
||||
PUBLIC -DARMA_NO_BOUND_CHECKING=1
|
||||
|
@ -69,8 +69,8 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc::galileo_e5a_noncoherentIQ_acquisit
|
||||
int CAF_window_hz_,
|
||||
int Zero_padding_,
|
||||
bool enable_monitor_output) : gr::block("galileo_e5a_noncoherentIQ_acquisition_caf_cc",
|
||||
gr::io_signature::make(1, 1, sizeof(gr_complex)),
|
||||
gr::io_signature::make(0, 1, sizeof(Gnss_Synchro)))
|
||||
gr::io_signature::make(1, 1, sizeof(gr_complex)),
|
||||
gr::io_signature::make(0, 1, sizeof(Gnss_Synchro)))
|
||||
{
|
||||
this->message_port_register_out(pmt::mp("events"));
|
||||
d_sample_counter = 0ULL; // SAMPLE COUNTER
|
||||
@ -122,12 +122,17 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc::galileo_e5a_noncoherentIQ_acquisit
|
||||
}
|
||||
}
|
||||
|
||||
#if GNURADIO_FFT_USES_TEMPLATES
|
||||
// Direct FFT
|
||||
d_fft_if = std::make_unique<gr::fft::fft_complex_fwd>(d_fft_size);
|
||||
// Inverse FFT
|
||||
d_ifft = std::make_unique<gr::fft::fft_complex_rev>(d_fft_size);
|
||||
#else
|
||||
// Direct FFT
|
||||
d_fft_if = std::make_unique<gr::fft::fft_complex>(d_fft_size, true);
|
||||
|
||||
// Inverse FFT
|
||||
d_ifft = std::make_unique<gr::fft::fft_complex>(d_fft_size, false);
|
||||
|
||||
#endif
|
||||
// For dumping samples into a file
|
||||
d_dump = dump;
|
||||
d_dump_filename = dump_filename;
|
||||
@ -303,7 +308,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
|
||||
*/
|
||||
|
||||
int acquisition_message = -1; // 0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL
|
||||
int return_value = 0; // 0=Produces no Gnss_Synchro objects
|
||||
int return_value = 0; // 0=Produces no Gnss_Synchro objects
|
||||
/* States: 0 Stop Channel
|
||||
* 1 Load the buffer until it reaches fft_size
|
||||
* 2 Acquisition algorithm
|
||||
|
@ -207,9 +207,13 @@ private:
|
||||
float estimate_input_power(gr_complex* in);
|
||||
|
||||
std::weak_ptr<ChannelFsm> d_channel_fsm;
|
||||
#if GNURADIO_FFT_USES_TEMPLATES
|
||||
std::unique_ptr<gr::fft::fft_complex_fwd> d_fft_if;
|
||||
std::unique_ptr<gr::fft::fft_complex_rev> d_ifft;
|
||||
#else
|
||||
std::unique_ptr<gr::fft::fft_complex> d_fft_if;
|
||||
std::unique_ptr<gr::fft::fft_complex> d_ifft;
|
||||
|
||||
#endif
|
||||
std::vector<std::vector<gr_complex>> d_grid_doppler_wipeoffs;
|
||||
std::vector<gr_complex> d_fft_code_I_A;
|
||||
std::vector<gr_complex> d_fft_code_I_B;
|
||||
|
@ -57,8 +57,8 @@ galileo_pcps_8ms_acquisition_cc::galileo_pcps_8ms_acquisition_cc(
|
||||
bool dump,
|
||||
const std::string &dump_filename,
|
||||
bool enable_monitor_output) : gr::block("galileo_pcps_8ms_acquisition_cc",
|
||||
gr::io_signature::make(1, 1, static_cast<int>(sizeof(gr_complex) * sampled_ms * samples_per_ms)),
|
||||
gr::io_signature::make(0, 1, sizeof(Gnss_Synchro)))
|
||||
gr::io_signature::make(1, 1, static_cast<int>(sizeof(gr_complex) * sampled_ms * samples_per_ms)),
|
||||
gr::io_signature::make(0, 1, sizeof(Gnss_Synchro)))
|
||||
{
|
||||
this->message_port_register_out(pmt::mp("events"));
|
||||
d_sample_counter = 0ULL; // SAMPLE COUNTER
|
||||
@ -80,11 +80,17 @@ galileo_pcps_8ms_acquisition_cc::galileo_pcps_8ms_acquisition_cc(
|
||||
d_fft_code_B = std::vector<gr_complex>(d_fft_size, lv_cmake(0.0F, 0.0F));
|
||||
d_magnitude = std::vector<float>(d_fft_size, 0.0F);
|
||||
|
||||
#if GNURADIO_FFT_USES_TEMPLATES
|
||||
// Direct FFT
|
||||
d_fft_if = std::make_unique<gr::fft::fft_complex_fwd>(d_fft_size);
|
||||
// Inverse FFT
|
||||
d_ifft = std::make_unique<gr::fft::fft_complex_rev>(d_fft_size);
|
||||
#else
|
||||
// Direct FFT
|
||||
d_fft_if = std::make_unique<gr::fft::fft_complex>(d_fft_size, true);
|
||||
|
||||
// Inverse FFT
|
||||
d_ifft = std::make_unique<gr::fft::fft_complex>(d_fft_size, false);
|
||||
#endif
|
||||
|
||||
// For dumping samples into a file
|
||||
d_dump = dump;
|
||||
|
@ -193,9 +193,13 @@ private:
|
||||
int32_t doppler_offset);
|
||||
|
||||
std::weak_ptr<ChannelFsm> d_channel_fsm;
|
||||
#if GNURADIO_FFT_USES_TEMPLATES
|
||||
std::unique_ptr<gr::fft::fft_complex_fwd> d_fft_if;
|
||||
std::unique_ptr<gr::fft::fft_complex_rev> d_ifft;
|
||||
#else
|
||||
std::unique_ptr<gr::fft::fft_complex> d_fft_if;
|
||||
std::unique_ptr<gr::fft::fft_complex> d_ifft;
|
||||
|
||||
#endif
|
||||
std::vector<std::vector<gr_complex>> d_grid_doppler_wipeoffs;
|
||||
std::vector<gr_complex> d_fft_code_A;
|
||||
std::vector<gr_complex> d_fft_code_B;
|
||||
|
@ -130,11 +130,17 @@ pcps_acquisition::pcps_acquisition(const Acq_Conf& conf_) : gr::block("pcps_acqu
|
||||
d_fft_codes = volk_gnsssdr::vector<std::complex<float>>(d_fft_size);
|
||||
d_input_signal = volk_gnsssdr::vector<std::complex<float>>(d_fft_size);
|
||||
|
||||
#if GNURADIO_FFT_USES_TEMPLATES
|
||||
// Direct FFT
|
||||
d_fft_if = std::make_unique<gr::fft::fft_complex_fwd>(d_fft_size);
|
||||
// Inverse FFT
|
||||
d_ifft = std::make_unique<gr::fft::fft_complex_rev>(d_fft_size);
|
||||
#else
|
||||
// Direct FFT
|
||||
d_fft_if = std::make_unique<gr::fft::fft_complex>(d_fft_size, true);
|
||||
|
||||
// Inverse FFT
|
||||
d_ifft = std::make_unique<gr::fft::fft_complex>(d_fft_size, false);
|
||||
#endif
|
||||
|
||||
d_gnss_synchro = nullptr;
|
||||
d_worker_active = false;
|
||||
@ -1022,15 +1028,16 @@ int pcps_acquisition::general_work(int noutput_items __attribute__((unused)),
|
||||
// Send outputs to the monitor
|
||||
if (d_acq_parameters.enable_monitor_output)
|
||||
{
|
||||
auto **out = reinterpret_cast<Gnss_Synchro **>(&output_items[0]);
|
||||
auto** out = reinterpret_cast<Gnss_Synchro**>(&output_items[0]);
|
||||
if (!d_monitor_queue.empty())
|
||||
{
|
||||
int num_gnss_synchro_objects = d_monitor_queue.size();
|
||||
for (int i = 0; i < num_gnss_synchro_objects; ++i) {
|
||||
Gnss_Synchro current_synchro_data = d_monitor_queue.front();
|
||||
d_monitor_queue.pop();
|
||||
*out[i] = current_synchro_data;
|
||||
}
|
||||
for (int i = 0; i < num_gnss_synchro_objects; ++i)
|
||||
{
|
||||
Gnss_Synchro current_synchro_data = d_monitor_queue.front();
|
||||
d_monitor_queue.pop();
|
||||
*out[i] = current_synchro_data;
|
||||
}
|
||||
return num_gnss_synchro_objects;
|
||||
}
|
||||
}
|
||||
|
@ -243,8 +243,14 @@ private:
|
||||
volk_gnsssdr::vector<std::complex<float>> d_data_buffer;
|
||||
volk_gnsssdr::vector<lv_16sc_t> d_data_buffer_sc;
|
||||
|
||||
#if GNURADIO_FFT_USES_TEMPLATES
|
||||
std::unique_ptr<gr::fft::fft_complex_fwd> d_fft_if;
|
||||
std::unique_ptr<gr::fft::fft_complex_rev> d_ifft;
|
||||
#else
|
||||
std::unique_ptr<gr::fft::fft_complex> d_fft_if;
|
||||
std::unique_ptr<gr::fft::fft_complex> d_ifft;
|
||||
#endif
|
||||
|
||||
std::weak_ptr<ChannelFsm> d_channel_fsm;
|
||||
|
||||
Acq_Conf d_acq_parameters;
|
||||
|
@ -80,11 +80,17 @@ pcps_acquisition_fine_doppler_cc::pcps_acquisition_fine_doppler_cc(const Acq_Con
|
||||
d_fft_codes.reserve(d_fft_size);
|
||||
d_magnitude.reserve(d_fft_size);
|
||||
d_10_ms_buffer.reserve(50 * d_samples_per_ms);
|
||||
#if GNURADIO_FFT_USES_TEMPLATES
|
||||
// Direct FFT
|
||||
d_fft_if = std::make_unique<gr::fft::fft_complex_fwd>(d_fft_size);
|
||||
// Inverse FFT
|
||||
d_ifft = std::make_unique<gr::fft::fft_complex_rev>(d_fft_size);
|
||||
#else
|
||||
// Direct FFT
|
||||
d_fft_if = std::make_unique<gr::fft::fft_complex>(d_fft_size, true);
|
||||
|
||||
// Inverse FFT
|
||||
d_ifft = std::make_unique<gr::fft::fft_complex>(d_fft_size, false);
|
||||
#endif
|
||||
|
||||
// For dumping samples into a file
|
||||
d_dump = conf_.dump;
|
||||
@ -380,7 +386,11 @@ int pcps_acquisition_fine_doppler_cc::estimate_Doppler()
|
||||
int signal_samples = prn_replicas * d_fft_size;
|
||||
// int fft_size_extended = nextPowerOf2(signal_samples * zero_padding_factor);
|
||||
int fft_size_extended = signal_samples * zero_padding_factor;
|
||||
#if GNURADIO_FFT_USES_TEMPLATES
|
||||
auto fft_operator = std::make_unique<gr::fft::fft_complex_fwd>(fft_size_extended);
|
||||
#else
|
||||
auto fft_operator = std::make_unique<gr::fft::fft_complex>(fft_size_extended, true);
|
||||
#endif
|
||||
// zero padding the entire vector
|
||||
std::fill_n(fft_operator->get_inbuf(), fft_size_extended, gr_complex(0.0, 0.0));
|
||||
|
||||
|
@ -200,8 +200,13 @@ private:
|
||||
bool start();
|
||||
|
||||
std::weak_ptr<ChannelFsm> d_channel_fsm;
|
||||
#if GNURADIO_FFT_USES_TEMPLATES
|
||||
std::unique_ptr<gr::fft::fft_complex_fwd> d_fft_if;
|
||||
std::unique_ptr<gr::fft::fft_complex_rev> d_ifft;
|
||||
#else
|
||||
std::unique_ptr<gr::fft::fft_complex> d_fft_if;
|
||||
std::unique_ptr<gr::fft::fft_complex> d_ifft;
|
||||
#endif
|
||||
|
||||
volk_gnsssdr::vector<volk_gnsssdr::vector<std::complex<float>>> d_grid_doppler_wipeoffs;
|
||||
volk_gnsssdr::vector<volk_gnsssdr::vector<float>> d_grid_data;
|
||||
|
@ -52,8 +52,8 @@ pcps_assisted_acquisition_cc::pcps_assisted_acquisition_cc(
|
||||
int32_t max_dwells, uint32_t sampled_ms, int32_t doppler_max, int32_t doppler_min,
|
||||
int64_t fs_in, int32_t samples_per_ms, bool dump, const std::string &dump_filename,
|
||||
bool enable_monitor_output) : gr::block("pcps_assisted_acquisition_cc",
|
||||
gr::io_signature::make(1, 1, sizeof(gr_complex)),
|
||||
gr::io_signature::make(0, 1, sizeof(Gnss_Synchro)))
|
||||
gr::io_signature::make(1, 1, sizeof(gr_complex)),
|
||||
gr::io_signature::make(0, 1, sizeof(Gnss_Synchro)))
|
||||
{
|
||||
this->message_port_register_out(pmt::mp("events"));
|
||||
d_sample_counter = 0ULL; // SAMPLE COUNTER
|
||||
@ -72,16 +72,22 @@ pcps_assisted_acquisition_cc::pcps_assisted_acquisition_cc(
|
||||
d_disable_assist = false;
|
||||
d_fft_codes.reserve(d_fft_size);
|
||||
|
||||
#if GNURADIO_FFT_USES_TEMPLATES
|
||||
// Direct FFT
|
||||
d_fft_if = std::make_unique<gr::fft::fft_complex_fwd>(d_fft_size);
|
||||
// Inverse FFT
|
||||
d_ifft = std::make_unique<gr::fft::fft_complex_rev>(d_fft_size);
|
||||
#else
|
||||
// Direct FFT
|
||||
d_fft_if = std::make_unique<gr::fft::fft_complex>(d_fft_size, true);
|
||||
|
||||
// Inverse FFT
|
||||
d_ifft = std::make_unique<gr::fft::fft_complex>(d_fft_size, false);
|
||||
#endif
|
||||
|
||||
// For dumping samples into a file
|
||||
d_dump = dump;
|
||||
d_dump_filename = dump_filename;
|
||||
|
||||
|
||||
d_enable_monitor_output = enable_monitor_output;
|
||||
|
||||
d_doppler_resolution = 0;
|
||||
|
@ -201,8 +201,13 @@ private:
|
||||
void redefine_grid();
|
||||
|
||||
std::weak_ptr<ChannelFsm> d_channel_fsm;
|
||||
#if GNURADIO_FFT_USES_TEMPLATES
|
||||
std::unique_ptr<gr::fft::fft_complex_fwd> d_fft_if;
|
||||
std::unique_ptr<gr::fft::fft_complex_rev> d_ifft;
|
||||
#else
|
||||
std::unique_ptr<gr::fft::fft_complex> d_fft_if;
|
||||
std::unique_ptr<gr::fft::fft_complex> d_ifft;
|
||||
#endif
|
||||
|
||||
std::vector<std::vector<std::complex<float>>> d_grid_doppler_wipeoffs;
|
||||
std::vector<std::vector<float>> d_grid_data;
|
||||
|
@ -62,8 +62,8 @@ pcps_cccwsr_acquisition_cc::pcps_cccwsr_acquisition_cc(
|
||||
bool dump,
|
||||
const std::string &dump_filename,
|
||||
bool enable_monitor_output) : gr::block("pcps_cccwsr_acquisition_cc",
|
||||
gr::io_signature::make(1, 1, static_cast<int>(sizeof(gr_complex) * sampled_ms * samples_per_ms)),
|
||||
gr::io_signature::make(0, 1, sizeof(Gnss_Synchro)))
|
||||
gr::io_signature::make(1, 1, static_cast<int>(sizeof(gr_complex) * sampled_ms * samples_per_ms)),
|
||||
gr::io_signature::make(0, 1, sizeof(Gnss_Synchro)))
|
||||
{
|
||||
this->message_port_register_out(pmt::mp("events"));
|
||||
d_sample_counter = 0ULL; // SAMPLE COUNTER
|
||||
@ -89,12 +89,17 @@ pcps_cccwsr_acquisition_cc::pcps_cccwsr_acquisition_cc(
|
||||
d_correlation_minus.reserve(d_fft_size);
|
||||
d_magnitude.reserve(d_fft_size);
|
||||
|
||||
#if GNURADIO_FFT_USES_TEMPLATES
|
||||
// Direct FFT
|
||||
d_fft_if = std::make_unique<gr::fft::fft_complex_fwd>(d_fft_size);
|
||||
// Inverse FFT
|
||||
d_ifft = std::make_unique<gr::fft::fft_complex_rev>(d_fft_size);
|
||||
#else
|
||||
// Direct FFT
|
||||
d_fft_if = std::make_unique<gr::fft::fft_complex>(d_fft_size, true);
|
||||
|
||||
// Inverse FFT
|
||||
d_ifft = std::make_unique<gr::fft::fft_complex>(d_fft_size, false);
|
||||
|
||||
#endif
|
||||
// For dumping samples into a file
|
||||
d_dump = dump;
|
||||
d_dump_filename = dump_filename;
|
||||
|
@ -186,8 +186,13 @@ private:
|
||||
|
||||
std::weak_ptr<ChannelFsm> d_channel_fsm;
|
||||
|
||||
#if GNURADIO_FFT_USES_TEMPLATES
|
||||
std::unique_ptr<gr::fft::fft_complex_fwd> d_fft_if;
|
||||
std::unique_ptr<gr::fft::fft_complex_rev> d_ifft;
|
||||
#else
|
||||
std::unique_ptr<gr::fft::fft_complex> d_fft_if;
|
||||
std::unique_ptr<gr::fft::fft_complex> d_ifft;
|
||||
#endif
|
||||
|
||||
std::vector<std::vector<gr_complex>> d_grid_doppler_wipeoffs;
|
||||
std::vector<gr_complex> d_fft_code_data;
|
||||
|
@ -42,8 +42,8 @@
|
||||
|
||||
#define CL_SILENCE_DEPRECATION
|
||||
#include "channel_fsm.h"
|
||||
#include "gnss_synchro.h"
|
||||
#include "gnss_block_interface.h"
|
||||
#include "gnss_synchro.h"
|
||||
#include "opencl/fft_internal.h"
|
||||
#include <gnuradio/block.h>
|
||||
#include <gnuradio/fft/fft.h>
|
||||
|
@ -64,8 +64,8 @@ pcps_quicksync_acquisition_cc::pcps_quicksync_acquisition_cc(
|
||||
bool dump,
|
||||
const std::string& dump_filename,
|
||||
bool enable_monitor_output) : gr::block("pcps_quicksync_acquisition_cc",
|
||||
gr::io_signature::make(1, 1, static_cast<int>(sizeof(gr_complex) * sampled_ms * samples_per_ms)),
|
||||
gr::io_signature::make(0, 1, sizeof(Gnss_Synchro)))
|
||||
gr::io_signature::make(1, 1, static_cast<int>(sizeof(gr_complex) * sampled_ms * samples_per_ms)),
|
||||
gr::io_signature::make(0, 1, sizeof(Gnss_Synchro)))
|
||||
{
|
||||
this->message_port_register_out(pmt::mp("events"));
|
||||
d_sample_counter = 0ULL; // SAMPLE COUNTER
|
||||
@ -98,10 +98,17 @@ pcps_quicksync_acquisition_cc::pcps_quicksync_acquisition_cc(
|
||||
original form to perform later correlation in time domain*/
|
||||
d_code = std::vector<gr_complex>(d_samples_per_code, lv_cmake(0.0F, 0.0F));
|
||||
|
||||
#if GNURADIO_FFT_USES_TEMPLATES
|
||||
// Direct FFT
|
||||
d_fft_if = std::make_unique<gr::fft::fft_complex_fwd>(d_fft_size);
|
||||
// Inverse FFT
|
||||
d_ifft = std::make_unique<gr::fft::fft_complex_rev>(d_fft_size);
|
||||
#else
|
||||
// Direct FFT
|
||||
d_fft_if = std::make_unique<gr::fft::fft_complex>(d_fft_size, true);
|
||||
// Inverse FFT
|
||||
d_ifft = std::make_unique<gr::fft::fft_complex>(d_fft_size, false);
|
||||
#endif
|
||||
|
||||
// For dumping samples into a file
|
||||
d_dump = dump;
|
||||
@ -516,7 +523,7 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items,
|
||||
// Copy and push current Gnss_Synchro to monitor queue
|
||||
if (d_enable_monitor_output)
|
||||
{
|
||||
auto **out = reinterpret_cast<Gnss_Synchro **>(&output_items[0]);
|
||||
auto** out = reinterpret_cast<Gnss_Synchro**>(&output_items[0]);
|
||||
Gnss_Synchro current_synchro_data = Gnss_Synchro();
|
||||
current_synchro_data = *d_gnss_synchro;
|
||||
*out[0] = current_synchro_data;
|
||||
|
@ -215,8 +215,13 @@ private:
|
||||
|
||||
std::weak_ptr<ChannelFsm> d_channel_fsm;
|
||||
|
||||
#if GNURADIO_FFT_USES_TEMPLATES
|
||||
std::unique_ptr<gr::fft::fft_complex_fwd> d_fft_if;
|
||||
std::unique_ptr<gr::fft::fft_complex_rev> d_ifft;
|
||||
#else
|
||||
std::unique_ptr<gr::fft::fft_complex> d_fft_if;
|
||||
std::unique_ptr<gr::fft::fft_complex> d_ifft;
|
||||
#endif
|
||||
|
||||
std::vector<std::vector<gr_complex>> d_grid_doppler_wipeoffs;
|
||||
std::vector<gr_complex> d_code;
|
||||
|
@ -80,8 +80,8 @@ pcps_tong_acquisition_cc::pcps_tong_acquisition_cc(
|
||||
bool dump,
|
||||
const std::string &dump_filename,
|
||||
bool enable_monitor_output) : gr::block("pcps_tong_acquisition_cc",
|
||||
gr::io_signature::make(1, 1, static_cast<int>(sizeof(gr_complex) * sampled_ms * samples_per_ms)),
|
||||
gr::io_signature::make(0, 1, sizeof(Gnss_Synchro)))
|
||||
gr::io_signature::make(1, 1, static_cast<int>(sizeof(gr_complex) * sampled_ms * samples_per_ms)),
|
||||
gr::io_signature::make(0, 1, sizeof(Gnss_Synchro)))
|
||||
{
|
||||
this->message_port_register_out(pmt::mp("events"));
|
||||
d_sample_counter = 0ULL; // SAMPLE COUNTER
|
||||
@ -105,12 +105,17 @@ pcps_tong_acquisition_cc::pcps_tong_acquisition_cc(
|
||||
d_fft_codes.reserve(d_fft_size);
|
||||
d_magnitude.reserve(d_fft_size);
|
||||
|
||||
#if GNURADIO_FFT_USES_TEMPLATES
|
||||
// Direct FFT
|
||||
d_fft_if = std::make_unique<gr::fft::fft_complex_fwd>(d_fft_size);
|
||||
// Inverse FFT
|
||||
d_ifft = std::make_unique<gr::fft::fft_complex_rev>(d_fft_size);
|
||||
#else
|
||||
// Direct FFT
|
||||
d_fft_if = std::make_unique<gr::fft::fft_complex>(d_fft_size, true);
|
||||
|
||||
// Inverse FFT
|
||||
d_ifft = std::make_unique<gr::fft::fft_complex>(d_fft_size, false);
|
||||
|
||||
#endif
|
||||
// For dumping samples into a file
|
||||
d_dump = dump;
|
||||
d_dump_filename = dump_filename;
|
||||
|
@ -203,8 +203,13 @@ private:
|
||||
|
||||
std::weak_ptr<ChannelFsm> d_channel_fsm;
|
||||
|
||||
#if GNURADIO_FFT_USES_TEMPLATES
|
||||
std::unique_ptr<gr::fft::fft_complex_fwd> d_fft_if;
|
||||
std::unique_ptr<gr::fft::fft_complex_rev> d_ifft;
|
||||
#else
|
||||
std::unique_ptr<gr::fft::fft_complex> d_fft_if;
|
||||
std::unique_ptr<gr::fft::fft_complex> d_ifft;
|
||||
#endif
|
||||
|
||||
std::vector<std::vector<gr_complex>> d_grid_doppler_wipeoffs;
|
||||
std::vector<std::vector<float>> d_grid_data;
|
||||
|
@ -63,6 +63,13 @@ if(GNURADIO_USES_STD_POINTERS)
|
||||
)
|
||||
endif()
|
||||
|
||||
if(GNURADIO_FFT_USES_TEMPLATES)
|
||||
target_compile_definitions(input_filter_gr_blocks
|
||||
PUBLIC -DGNURADIO_FFT_USES_TEMPLATES=1
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
if(ENABLE_CLANG_TIDY)
|
||||
if(CLANG_TIDY_EXE)
|
||||
set_target_properties(input_filter_gr_blocks
|
||||
|
@ -60,7 +60,11 @@ Notch::Notch(float pfa,
|
||||
angle_ = volk_gnsssdr::vector<float>(length_);
|
||||
power_spect_ = volk_gnsssdr::vector<float>(length_);
|
||||
last_out_ = gr_complex(0.0, 0.0);
|
||||
#if GNURADIO_FFT_USES_TEMPLATES
|
||||
d_fft_ = std::make_unique<gr::fft::fft_complex_fwd>(length_);
|
||||
#else
|
||||
d_fft_ = std::make_unique<gr::fft::fft_complex>(length_, true);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -59,7 +59,11 @@ public:
|
||||
private:
|
||||
friend notch_sptr make_notch_filter(float pfa, float p_c_factor, int32_t length, int32_t n_segments_est, int32_t n_segments_reset);
|
||||
Notch(float pfa, float p_c_factor, int32_t length, int32_t n_segments_est, int32_t n_segments_reset);
|
||||
#if GNURADIO_FFT_USES_TEMPLATES
|
||||
std::unique_ptr<gr::fft::fft_complex_fwd> d_fft_;
|
||||
#else
|
||||
std::unique_ptr<gr::fft::fft_complex> d_fft_;
|
||||
#endif
|
||||
volk_gnsssdr::vector<gr_complex> c_samples_;
|
||||
volk_gnsssdr::vector<float> angle_;
|
||||
volk_gnsssdr::vector<float> power_spect_;
|
||||
|
@ -65,7 +65,11 @@ NotchLite::NotchLite(float p_c_factor,
|
||||
angle1_ = 0.0;
|
||||
angle2_ = 0.0;
|
||||
power_spect_ = volk_gnsssdr::vector<float>(length_);
|
||||
#if GNURADIO_FFT_USES_TEMPLATES
|
||||
d_fft_ = std::make_unique<gr::fft::fft_complex_fwd>(length_);
|
||||
#else
|
||||
d_fft_ = std::make_unique<gr::fft::fft_complex>(length_, true);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -60,7 +60,11 @@ public:
|
||||
private:
|
||||
friend notch_lite_sptr make_notch_filter_lite(float p_c_factor, float pfa, int32_t length, int32_t n_segments_est, int32_t n_segments_reset, int32_t n_segments_coeff);
|
||||
NotchLite(float p_c_factor, float pfa, int32_t length, int32_t n_segments_est, int32_t n_segments_reset, int32_t n_segments_coeff);
|
||||
#if GNURADIO_FFT_USES_TEMPLATES
|
||||
std::unique_ptr<gr::fft::fft_complex_fwd> d_fft_;
|
||||
#else
|
||||
std::unique_ptr<gr::fft::fft_complex> d_fft_;
|
||||
#endif
|
||||
volk_gnsssdr::vector<float> power_spect_;
|
||||
gr_complex last_out_;
|
||||
gr_complex z_0_;
|
||||
|
@ -519,6 +519,11 @@ if(ENABLE_UNIT_TESTING)
|
||||
PRIVATE -DGNURADIO_USES_STD_POINTERS=1
|
||||
)
|
||||
endif()
|
||||
if(GNURADIO_FFT_USES_TEMPLATES)
|
||||
target_compile_definitions(run_tests
|
||||
PUBLIC -DGNURADIO_FFT_USES_TEMPLATES=1
|
||||
)
|
||||
endif()
|
||||
if(ENABLE_UNIT_TESTING_EXTRA)
|
||||
target_link_libraries(run_tests PRIVATE Gpstk::gpstk)
|
||||
endif()
|
||||
|
@ -74,8 +74,11 @@ TEST(FFTLengthTest, MeasureExecutionTime)
|
||||
EXPECT_NO_THROW(
|
||||
for (it = fft_sizes_v.cbegin(); it != fft_sizes_v.cend(); ++it) {
|
||||
d_fft_size = *it;
|
||||
#if GNURADIO_FFT_USES_TEMPLATES
|
||||
auto d_fft = std::make_unique<gr::fft::fft_complex_fwd>(d_fft_size);
|
||||
#else
|
||||
auto d_fft = std::make_unique<gr::fft::fft_complex>(d_fft_size, true);
|
||||
|
||||
#endif
|
||||
std::generate_n(d_fft->get_inbuf(), d_fft_size, gen);
|
||||
|
||||
start = std::chrono::system_clock::now();
|
||||
|
@ -39,7 +39,11 @@ TEST(FFTSpeedTest, ArmadilloVSGNURadioExecutionTime)
|
||||
for (unsigned int fft_size
|
||||
: fft_sizes) {
|
||||
d_fft_size = fft_size;
|
||||
#if GNURADIO_FFT_USES_TEMPLATES
|
||||
auto d_gr_fft = std::make_unique<gr::fft::fft_complex_fwd>(d_fft_size);
|
||||
#else
|
||||
auto d_gr_fft = std::make_unique<gr::fft::fft_complex>(d_fft_size, true);
|
||||
#endif
|
||||
arma::arma_rng::set_seed_random();
|
||||
arma::cx_fvec d_arma_fft = arma::cx_fvec(d_fft_size).randn() + gr_complex(0.0, 1.0) * arma::cx_fvec(d_fft_size).randn();
|
||||
arma::cx_fvec d_arma_fft_result(d_fft_size);
|
||||
|
Loading…
Reference in New Issue
Block a user