mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-21 22:47:09 +00:00
Improve handling of change in GNU Radio 3.9 FFT API
Fix compilation of some optional blocks when linking against GR 3.9 Fix warning -Wembedded-directive: embedding a directive within macro arguments has undefined behavior
This commit is contained in:
parent
ede02f91df
commit
4fea48f603
@ -21,6 +21,10 @@ SPDX-FileCopyrightText: 2011-2021 Carles Fernandez-Prades <carles.fernandez@cttc
|
|||||||
whether it is already installed or not.
|
whether it is already installed or not.
|
||||||
- Fix building when using the Xcode generator, Xcode >= 12 and CMake >= 3.19.
|
- Fix building when using the Xcode generator, Xcode >= 12 and CMake >= 3.19.
|
||||||
|
|
||||||
|
### Improvements in Maintainability:
|
||||||
|
|
||||||
|
- Improved handling of change in GNU Radio 3.9 FFT API.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [GNSS-SDR v0.0.14](https://github.com/gnss-sdr/gnss-sdr/releases/tag/v0.0.14)
|
## [GNSS-SDR v0.0.14](https://github.com/gnss-sdr/gnss-sdr/releases/tag/v0.0.14)
|
||||||
|
@ -123,7 +123,6 @@ if(ENABLE_FPGA)
|
|||||||
PRIVATE
|
PRIVATE
|
||||||
algorithms_libs
|
algorithms_libs
|
||||||
core_libs
|
core_libs
|
||||||
Gnuradio::fft
|
|
||||||
Volk::volk
|
Volk::volk
|
||||||
Volkgnsssdr::volkgnsssdr
|
Volkgnsssdr::volkgnsssdr
|
||||||
)
|
)
|
||||||
|
@ -19,8 +19,8 @@
|
|||||||
#include "Galileo_E1.h"
|
#include "Galileo_E1.h"
|
||||||
#include "configuration_interface.h"
|
#include "configuration_interface.h"
|
||||||
#include "galileo_e1_signal_replica.h"
|
#include "galileo_e1_signal_replica.h"
|
||||||
|
#include "gnss_sdr_fft.h"
|
||||||
#include "gnss_sdr_flags.h"
|
#include "gnss_sdr_flags.h"
|
||||||
#include "gnss_sdr_make_unique.h"
|
|
||||||
#include "uio_fpga.h"
|
#include "uio_fpga.h"
|
||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
#include <gnuradio/fft/fft.h> // for fft_complex
|
#include <gnuradio/fft/fft.h> // for fft_complex
|
||||||
@ -92,7 +92,7 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
|
|||||||
|
|
||||||
// compute all the GALILEO E1 PRN Codes (this is done only once in the class constructor in order to avoid re-computing the PRN codes every time
|
// compute all the GALILEO E1 PRN Codes (this is done only once in the class constructor in order to avoid re-computing the PRN codes every time
|
||||||
// a channel is assigned)
|
// a channel is assigned)
|
||||||
auto fft_if = std::make_unique<gr::fft::fft_complex>(nsamples_total, true); // Direct FFT
|
auto fft_if = gnss_fft_fwd_make_unique(nsamples_total); // Direct FFT
|
||||||
volk_gnsssdr::vector<std::complex<float>> code(nsamples_total); // buffer for the local code
|
volk_gnsssdr::vector<std::complex<float>> code(nsamples_total); // buffer for the local code
|
||||||
volk_gnsssdr::vector<gr_complex> fft_codes_padded(nsamples_total);
|
volk_gnsssdr::vector<gr_complex> fft_codes_padded(nsamples_total);
|
||||||
d_all_fft_codes_ = std::vector<uint32_t>(nsamples_total * GALILEO_E1_NUMBER_OF_CODES); // memory containing all the possible fft codes for PRN 0 to 32
|
d_all_fft_codes_ = std::vector<uint32_t>(nsamples_total * GALILEO_E1_NUMBER_OF_CODES); // memory containing all the possible fft codes for PRN 0 to 32
|
||||||
|
@ -19,11 +19,10 @@
|
|||||||
#include "Galileo_E5a.h"
|
#include "Galileo_E5a.h"
|
||||||
#include "configuration_interface.h"
|
#include "configuration_interface.h"
|
||||||
#include "galileo_e5_signal_replica.h"
|
#include "galileo_e5_signal_replica.h"
|
||||||
|
#include "gnss_sdr_fft.h"
|
||||||
#include "gnss_sdr_flags.h"
|
#include "gnss_sdr_flags.h"
|
||||||
#include "gnss_sdr_make_unique.h"
|
|
||||||
#include "uio_fpga.h"
|
#include "uio_fpga.h"
|
||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
#include <gnuradio/fft/fft.h> // for fft_complex
|
|
||||||
#include <gnuradio/gr_complex.h> // for gr_complex
|
#include <gnuradio/gr_complex.h> // for gr_complex
|
||||||
#include <volk/volk.h> // for volk_32fc_conjugate_32fc
|
#include <volk/volk.h> // for volk_32fc_conjugate_32fc
|
||||||
#include <volk_gnsssdr/volk_gnsssdr_alloc.h>
|
#include <volk_gnsssdr/volk_gnsssdr_alloc.h>
|
||||||
@ -94,7 +93,7 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(
|
|||||||
|
|
||||||
// compute all the GALILEO E5 PRN Codes (this is done only once in the class constructor in order to avoid re-computing the PRN codes every time
|
// compute all the GALILEO E5 PRN Codes (this is done only once in the class constructor in order to avoid re-computing the PRN codes every time
|
||||||
// a channel is assigned)
|
// a channel is assigned)
|
||||||
auto fft_if = std::make_unique<gr::fft::fft_complex>(nsamples_total, true); // Direct FFT
|
auto fft_if = gnss_fft_fwd_make_unique(nsamples_total); // Direct FFT
|
||||||
volk_gnsssdr::vector<std::complex<float>> code(nsamples_total);
|
volk_gnsssdr::vector<std::complex<float>> code(nsamples_total);
|
||||||
volk_gnsssdr::vector<std::complex<float>> fft_codes_padded(nsamples_total);
|
volk_gnsssdr::vector<std::complex<float>> fft_codes_padded(nsamples_total);
|
||||||
d_all_fft_codes_ = std::vector<uint32_t>(nsamples_total * GALILEO_E5A_NUMBER_OF_CODES); // memory containing all the possible fft codes for PRN 0 to 32
|
d_all_fft_codes_ = std::vector<uint32_t>(nsamples_total * GALILEO_E5A_NUMBER_OF_CODES); // memory containing all the possible fft codes for PRN 0 to 32
|
||||||
|
@ -20,10 +20,10 @@
|
|||||||
#include "Galileo_E5b.h"
|
#include "Galileo_E5b.h"
|
||||||
#include "configuration_interface.h"
|
#include "configuration_interface.h"
|
||||||
#include "galileo_e5_signal_replica.h"
|
#include "galileo_e5_signal_replica.h"
|
||||||
|
#include "gnss_sdr_fft.h"
|
||||||
#include "gnss_sdr_flags.h"
|
#include "gnss_sdr_flags.h"
|
||||||
#include "uio_fpga.h"
|
#include "uio_fpga.h"
|
||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
#include <gnuradio/fft/fft.h> // for fft_complex
|
|
||||||
#include <gnuradio/gr_complex.h> // for gr_complex
|
#include <gnuradio/gr_complex.h> // for gr_complex
|
||||||
#include <volk/volk.h> // for volk_32fc_conjugate_32fc
|
#include <volk/volk.h> // for volk_32fc_conjugate_32fc
|
||||||
#include <volk_gnsssdr/volk_gnsssdr_alloc.h>
|
#include <volk_gnsssdr/volk_gnsssdr_alloc.h>
|
||||||
@ -93,7 +93,7 @@ GalileoE5bPcpsAcquisitionFpga::GalileoE5bPcpsAcquisitionFpga(const Configuration
|
|||||||
|
|
||||||
// compute all the GALILEO E5b PRN Codes (this is done only once in the class constructor in order to avoid re-computing the PRN codes every time
|
// compute all the GALILEO E5b PRN Codes (this is done only once in the class constructor in order to avoid re-computing the PRN codes every time
|
||||||
// a channel is assigned)
|
// a channel is assigned)
|
||||||
auto fft_if = std::unique_ptr<gr::fft::fft_complex>(new gr::fft::fft_complex(nsamples_total, true)); // Direct FFT
|
auto fft_if = gnss_fft_fwd_make_unique(nsamples_total); // Direct FFT
|
||||||
volk_gnsssdr::vector<std::complex<float>> code(nsamples_total); // Buffer for local code
|
volk_gnsssdr::vector<std::complex<float>> code(nsamples_total); // Buffer for local code
|
||||||
volk_gnsssdr::vector<std::complex<float>> fft_codes_padded(nsamples_total);
|
volk_gnsssdr::vector<std::complex<float>> fft_codes_padded(nsamples_total);
|
||||||
d_all_fft_codes_ = std::vector<uint32_t>(nsamples_total * GALILEO_E5B_NUMBER_OF_CODES); // memory containing all the possible fft codes for PRN 0 to 32
|
d_all_fft_codes_ = std::vector<uint32_t>(nsamples_total * GALILEO_E5B_NUMBER_OF_CODES); // memory containing all the possible fft codes for PRN 0 to 32
|
||||||
|
@ -21,12 +21,11 @@
|
|||||||
#include "gps_l1_ca_pcps_acquisition_fpga.h"
|
#include "gps_l1_ca_pcps_acquisition_fpga.h"
|
||||||
#include "GPS_L1_CA.h"
|
#include "GPS_L1_CA.h"
|
||||||
#include "configuration_interface.h"
|
#include "configuration_interface.h"
|
||||||
|
#include "gnss_sdr_fft.h"
|
||||||
#include "gnss_sdr_flags.h"
|
#include "gnss_sdr_flags.h"
|
||||||
#include "gnss_sdr_make_unique.h"
|
|
||||||
#include "gps_sdr_signal_replica.h"
|
#include "gps_sdr_signal_replica.h"
|
||||||
#include "uio_fpga.h"
|
#include "uio_fpga.h"
|
||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
#include <gnuradio/fft/fft.h>
|
|
||||||
#include <gnuradio/gr_complex.h> // for gr_complex
|
#include <gnuradio/gr_complex.h> // for gr_complex
|
||||||
#include <volk/volk.h> // for volk_32fc_conjugate_32fc
|
#include <volk/volk.h> // for volk_32fc_conjugate_32fc
|
||||||
#include <volk_gnsssdr/volk_gnsssdr_alloc.h>
|
#include <volk_gnsssdr/volk_gnsssdr_alloc.h>
|
||||||
@ -86,7 +85,7 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
|
|||||||
|
|
||||||
// compute all the GPS L1 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time
|
// compute all the GPS L1 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time
|
||||||
// a channel is assigned)
|
// a channel is assigned)
|
||||||
auto fft_if = std::make_unique<gr::fft::fft_complex>(nsamples_total, true);
|
auto fft_if = gnss_fft_fwd_make_unique(nsamples_total);
|
||||||
// allocate memory to compute all the PRNs and compute all the possible codes
|
// allocate memory to compute all the PRNs and compute all the possible codes
|
||||||
volk_gnsssdr::vector<std::complex<float>> code(nsamples_total);
|
volk_gnsssdr::vector<std::complex<float>> code(nsamples_total);
|
||||||
volk_gnsssdr::vector<std::complex<float>> fft_codes_padded(nsamples_total);
|
volk_gnsssdr::vector<std::complex<float>> fft_codes_padded(nsamples_total);
|
||||||
|
@ -20,13 +20,12 @@
|
|||||||
#include "gps_l2_m_pcps_acquisition_fpga.h"
|
#include "gps_l2_m_pcps_acquisition_fpga.h"
|
||||||
#include "GPS_L2C.h"
|
#include "GPS_L2C.h"
|
||||||
#include "configuration_interface.h"
|
#include "configuration_interface.h"
|
||||||
|
#include "gnss_sdr_fft.h"
|
||||||
#include "gnss_sdr_flags.h"
|
#include "gnss_sdr_flags.h"
|
||||||
#include "gnss_sdr_make_unique.h"
|
|
||||||
#include "gnss_synchro.h"
|
#include "gnss_synchro.h"
|
||||||
#include "gps_l2c_signal_replica.h"
|
#include "gps_l2c_signal_replica.h"
|
||||||
#include "uio_fpga.h"
|
#include "uio_fpga.h"
|
||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
#include <gnuradio/fft/fft.h> // for fft_complex
|
|
||||||
#include <gnuradio/gr_complex.h> // for gr_complex
|
#include <gnuradio/gr_complex.h> // for gr_complex
|
||||||
#include <volk/volk.h> // for volk_32fc_conjugate_32fc
|
#include <volk/volk.h> // for volk_32fc_conjugate_32fc
|
||||||
#include <volk_gnsssdr/volk_gnsssdr_alloc.h>
|
#include <volk_gnsssdr/volk_gnsssdr_alloc.h>
|
||||||
@ -86,7 +85,7 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga(
|
|||||||
|
|
||||||
// compute all the GPS L2C PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time
|
// compute all the GPS L2C PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time
|
||||||
// a channel is assigned)
|
// a channel is assigned)
|
||||||
auto fft_if = std::make_unique<gr::fft::fft_complex>(nsamples_total, true); // Direct FFT
|
auto fft_if = gnss_fft_fwd_make_unique(nsamples_total); // Direct FFT
|
||||||
// allocate memory to compute all the PRNs and compute all the possible codes
|
// allocate memory to compute all the PRNs and compute all the possible codes
|
||||||
volk_gnsssdr::vector<std::complex<float>> code(nsamples_total);
|
volk_gnsssdr::vector<std::complex<float>> code(nsamples_total);
|
||||||
volk_gnsssdr::vector<std::complex<float>> fft_codes_padded(nsamples_total);
|
volk_gnsssdr::vector<std::complex<float>> fft_codes_padded(nsamples_total);
|
||||||
|
@ -21,12 +21,11 @@
|
|||||||
#include "gps_l5i_pcps_acquisition_fpga.h"
|
#include "gps_l5i_pcps_acquisition_fpga.h"
|
||||||
#include "GPS_L5.h"
|
#include "GPS_L5.h"
|
||||||
#include "configuration_interface.h"
|
#include "configuration_interface.h"
|
||||||
|
#include "gnss_sdr_fft.h"
|
||||||
#include "gnss_sdr_flags.h"
|
#include "gnss_sdr_flags.h"
|
||||||
#include "gnss_sdr_make_unique.h"
|
|
||||||
#include "gps_l5_signal_replica.h"
|
#include "gps_l5_signal_replica.h"
|
||||||
#include "uio_fpga.h"
|
#include "uio_fpga.h"
|
||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
#include <gnuradio/fft/fft.h> // for fft_complex
|
|
||||||
#include <gnuradio/gr_complex.h> // for gr_complex
|
#include <gnuradio/gr_complex.h> // for gr_complex
|
||||||
#include <volk/volk.h> // for volk_32fc_conjugate_32fc
|
#include <volk/volk.h> // for volk_32fc_conjugate_32fc
|
||||||
#include <volk_gnsssdr/volk_gnsssdr_alloc.h>
|
#include <volk_gnsssdr/volk_gnsssdr_alloc.h>
|
||||||
@ -90,7 +89,7 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga(
|
|||||||
|
|
||||||
// compute all the GPS L5 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time
|
// compute all the GPS L5 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time
|
||||||
// a channel is assigned)
|
// a channel is assigned)
|
||||||
auto fft_if = std::make_unique<gr::fft::fft_complex>(nsamples_total, true); // Direct FFT
|
auto fft_if = gnss_fft_fwd_make_unique(nsamples_total); // Direct FFT
|
||||||
volk_gnsssdr::vector<std::complex<float>> code(nsamples_total);
|
volk_gnsssdr::vector<std::complex<float>> code(nsamples_total);
|
||||||
volk_gnsssdr::vector<std::complex<float>> fft_codes_padded(nsamples_total);
|
volk_gnsssdr::vector<std::complex<float>> fft_codes_padded(nsamples_total);
|
||||||
d_all_fft_codes_ = std::vector<uint32_t>(nsamples_total * NUM_PRNs); // memory containing all the possible fft codes for PRN 0 to 32
|
d_all_fft_codes_ = std::vector<uint32_t>(nsamples_total * NUM_PRNs); // memory containing all the possible fft codes for PRN 0 to 32
|
||||||
|
@ -81,8 +81,6 @@ target_link_libraries(acquisition_gr_blocks
|
|||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(acquisition_gr_blocks
|
target_include_directories(acquisition_gr_blocks
|
||||||
PUBLIC
|
|
||||||
${CMAKE_SOURCE_DIR}/src/algorithms/libs
|
|
||||||
PRIVATE
|
PRIVATE
|
||||||
${CMAKE_SOURCE_DIR}/src/core/receiver
|
${CMAKE_SOURCE_DIR}/src/core/receiver
|
||||||
)
|
)
|
||||||
@ -93,12 +91,6 @@ if(GNURADIO_USES_STD_POINTERS)
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(GNURADIO_FFT_USES_TEMPLATES)
|
|
||||||
target_compile_definitions(acquisition_gr_blocks
|
|
||||||
PUBLIC -DGNURADIO_FFT_USES_TEMPLATES=1
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(ENABLE_ARMA_NO_DEBUG)
|
if(ENABLE_ARMA_NO_DEBUG)
|
||||||
target_compile_definitions(acquisition_gr_blocks
|
target_compile_definitions(acquisition_gr_blocks
|
||||||
PUBLIC -DARMA_NO_BOUND_CHECKING=1
|
PUBLIC -DARMA_NO_BOUND_CHECKING=1
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
|
|
||||||
#include "galileo_e5a_noncoherent_iq_acquisition_caf_cc.h"
|
#include "galileo_e5a_noncoherent_iq_acquisition_caf_cc.h"
|
||||||
#include "MATH_CONSTANTS.h"
|
#include "MATH_CONSTANTS.h"
|
||||||
#include "gnss_sdr_make_unique.h"
|
|
||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
#include <gnuradio/io_signature.h>
|
#include <gnuradio/io_signature.h>
|
||||||
#include <volk/volk.h>
|
#include <volk/volk.h>
|
||||||
@ -119,18 +118,9 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc::galileo_e5a_noncoherentIQ_acquisit
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if GNURADIO_FFT_USES_TEMPLATES
|
d_fft_if = gnss_fft_fwd_make_unique(d_fft_size);
|
||||||
// Direct FFT
|
d_ifft = gnss_fft_rev_make_unique(d_fft_size);
|
||||||
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 = dump;
|
||||||
d_dump_filename = dump_filename;
|
d_dump_filename = dump_filename;
|
||||||
|
|
||||||
|
@ -25,9 +25,9 @@
|
|||||||
#define GNSS_SDR_GALILEO_E5A_NONCOHERENT_IQ_ACQUISITION_CAF_CC_H
|
#define GNSS_SDR_GALILEO_E5A_NONCOHERENT_IQ_ACQUISITION_CAF_CC_H
|
||||||
|
|
||||||
#include "channel_fsm.h"
|
#include "channel_fsm.h"
|
||||||
|
#include "gnss_sdr_fft.h"
|
||||||
#include "gnss_synchro.h"
|
#include "gnss_synchro.h"
|
||||||
#include <gnuradio/block.h>
|
#include <gnuradio/block.h>
|
||||||
#include <gnuradio/fft/fft.h>
|
|
||||||
#include <gnuradio/gr_complex.h>
|
#include <gnuradio/gr_complex.h>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@ -204,13 +204,9 @@ private:
|
|||||||
float estimate_input_power(gr_complex* in);
|
float estimate_input_power(gr_complex* in);
|
||||||
|
|
||||||
std::weak_ptr<ChannelFsm> d_channel_fsm;
|
std::weak_ptr<ChannelFsm> d_channel_fsm;
|
||||||
#if GNURADIO_FFT_USES_TEMPLATES
|
std::unique_ptr<gnss_fft_complex_fwd> d_fft_if;
|
||||||
std::unique_ptr<gr::fft::fft_complex_fwd> d_fft_if;
|
std::unique_ptr<gnss_fft_complex_rev> d_ifft;
|
||||||
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<gr_complex>> d_grid_doppler_wipeoffs;
|
||||||
std::vector<gr_complex> d_fft_code_I_A;
|
std::vector<gr_complex> d_fft_code_I_A;
|
||||||
std::vector<gr_complex> d_fft_code_I_B;
|
std::vector<gr_complex> d_fft_code_I_B;
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
#include "galileo_pcps_8ms_acquisition_cc.h"
|
#include "galileo_pcps_8ms_acquisition_cc.h"
|
||||||
#include "MATH_CONSTANTS.h"
|
#include "MATH_CONSTANTS.h"
|
||||||
#include "gnss_sdr_make_unique.h"
|
|
||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
#include <gnuradio/io_signature.h>
|
#include <gnuradio/io_signature.h>
|
||||||
#include <volk/volk.h>
|
#include <volk/volk.h>
|
||||||
@ -76,18 +75,8 @@ galileo_pcps_8ms_acquisition_cc::galileo_pcps_8ms_acquisition_cc(
|
|||||||
d_fft_code_A = std::vector<gr_complex>(d_fft_size, lv_cmake(0.0F, 0.0F));
|
d_fft_code_A = std::vector<gr_complex>(d_fft_size, lv_cmake(0.0F, 0.0F));
|
||||||
d_fft_code_B = std::vector<gr_complex>(d_fft_size, lv_cmake(0.0F, 0.0F));
|
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);
|
d_magnitude = std::vector<float>(d_fft_size, 0.0F);
|
||||||
|
d_fft_if = gnss_fft_fwd_make_unique(d_fft_size);
|
||||||
#if GNURADIO_FFT_USES_TEMPLATES
|
d_ifft = gnss_fft_rev_make_unique(d_fft_size);
|
||||||
// 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
|
// For dumping samples into a file
|
||||||
d_dump = dump;
|
d_dump = dump;
|
||||||
|
@ -19,9 +19,9 @@
|
|||||||
#define GNSS_SDR_PCPS_8MS_ACQUISITION_CC_H
|
#define GNSS_SDR_PCPS_8MS_ACQUISITION_CC_H
|
||||||
|
|
||||||
#include "channel_fsm.h"
|
#include "channel_fsm.h"
|
||||||
|
#include "gnss_sdr_fft.h"
|
||||||
#include "gnss_synchro.h"
|
#include "gnss_synchro.h"
|
||||||
#include <gnuradio/block.h>
|
#include <gnuradio/block.h>
|
||||||
#include <gnuradio/fft/fft.h>
|
|
||||||
#include <gnuradio/gr_complex.h>
|
#include <gnuradio/gr_complex.h>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@ -190,13 +190,9 @@ private:
|
|||||||
int32_t doppler_offset);
|
int32_t doppler_offset);
|
||||||
|
|
||||||
std::weak_ptr<ChannelFsm> d_channel_fsm;
|
std::weak_ptr<ChannelFsm> d_channel_fsm;
|
||||||
#if GNURADIO_FFT_USES_TEMPLATES
|
std::unique_ptr<gnss_fft_complex_fwd> d_fft_if;
|
||||||
std::unique_ptr<gr::fft::fft_complex_fwd> d_fft_if;
|
std::unique_ptr<gnss_fft_complex_rev> d_ifft;
|
||||||
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<gr_complex>> d_grid_doppler_wipeoffs;
|
||||||
std::vector<gr_complex> d_fft_code_A;
|
std::vector<gr_complex> d_fft_code_A;
|
||||||
std::vector<gr_complex> d_fft_code_B;
|
std::vector<gr_complex> d_fft_code_B;
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
#include "MATH_CONSTANTS.h" // for TWO_PI
|
#include "MATH_CONSTANTS.h" // for TWO_PI
|
||||||
#include "gnss_frequencies.h"
|
#include "gnss_frequencies.h"
|
||||||
#include "gnss_sdr_create_directory.h"
|
#include "gnss_sdr_create_directory.h"
|
||||||
#include "gnss_sdr_make_unique.h"
|
|
||||||
#include "gnss_synchro.h"
|
#include "gnss_synchro.h"
|
||||||
#if HAS_STD_FILESYSTEM
|
#if HAS_STD_FILESYSTEM
|
||||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||||
@ -126,18 +125,8 @@ pcps_acquisition::pcps_acquisition(const Acq_Conf& conf_) : gr::block("pcps_acqu
|
|||||||
d_tmp_buffer = volk_gnsssdr::vector<float>(d_fft_size);
|
d_tmp_buffer = volk_gnsssdr::vector<float>(d_fft_size);
|
||||||
d_fft_codes = volk_gnsssdr::vector<std::complex<float>>(d_fft_size);
|
d_fft_codes = volk_gnsssdr::vector<std::complex<float>>(d_fft_size);
|
||||||
d_input_signal = volk_gnsssdr::vector<std::complex<float>>(d_fft_size);
|
d_input_signal = volk_gnsssdr::vector<std::complex<float>>(d_fft_size);
|
||||||
|
d_fft_if = gnss_fft_fwd_make_unique(d_fft_size);
|
||||||
#if GNURADIO_FFT_USES_TEMPLATES
|
d_ifft = gnss_fft_rev_make_unique(d_fft_size);
|
||||||
// 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_gnss_synchro = nullptr;
|
||||||
d_worker_active = false;
|
d_worker_active = false;
|
||||||
|
@ -44,10 +44,10 @@
|
|||||||
|
|
||||||
#include "acq_conf.h"
|
#include "acq_conf.h"
|
||||||
#include "channel_fsm.h"
|
#include "channel_fsm.h"
|
||||||
|
#include "gnss_sdr_fft.h"
|
||||||
#include <armadillo>
|
#include <armadillo>
|
||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
#include <gnuradio/block.h>
|
#include <gnuradio/block.h>
|
||||||
#include <gnuradio/fft/fft.h>
|
|
||||||
#include <gnuradio/gr_complex.h> // for gr_complex
|
#include <gnuradio/gr_complex.h> // for gr_complex
|
||||||
#include <gnuradio/thread/thread.h> // for scoped_lock
|
#include <gnuradio/thread/thread.h> // for scoped_lock
|
||||||
#include <gnuradio/types.h> // for gr_vector_const_void_star
|
#include <gnuradio/types.h> // for gr_vector_const_void_star
|
||||||
@ -240,14 +240,8 @@ private:
|
|||||||
volk_gnsssdr::vector<std::complex<float>> d_data_buffer;
|
volk_gnsssdr::vector<std::complex<float>> d_data_buffer;
|
||||||
volk_gnsssdr::vector<lv_16sc_t> d_data_buffer_sc;
|
volk_gnsssdr::vector<lv_16sc_t> d_data_buffer_sc;
|
||||||
|
|
||||||
#if GNURADIO_FFT_USES_TEMPLATES
|
std::unique_ptr<gnss_fft_complex_fwd> d_fft_if;
|
||||||
std::unique_ptr<gr::fft::fft_complex_fwd> d_fft_if;
|
std::unique_ptr<gnss_fft_complex_rev> d_ifft;
|
||||||
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;
|
std::weak_ptr<ChannelFsm> d_channel_fsm;
|
||||||
|
|
||||||
Acq_Conf d_acq_parameters;
|
Acq_Conf d_acq_parameters;
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
#include "pcps_acquisition_fine_doppler_cc.h"
|
#include "pcps_acquisition_fine_doppler_cc.h"
|
||||||
#include "GPS_L1_CA.h" // for GPS_L1_CA_CHIP_PERIOD_S
|
#include "GPS_L1_CA.h" // for GPS_L1_CA_CHIP_PERIOD_S
|
||||||
#include "gnss_sdr_create_directory.h"
|
#include "gnss_sdr_create_directory.h"
|
||||||
#include "gnss_sdr_make_unique.h"
|
|
||||||
#include "gps_sdr_signal_replica.h"
|
#include "gps_sdr_signal_replica.h"
|
||||||
#if HAS_STD_FILESYSTEM
|
#if HAS_STD_FILESYSTEM
|
||||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||||
@ -77,17 +76,8 @@ pcps_acquisition_fine_doppler_cc::pcps_acquisition_fine_doppler_cc(const Acq_Con
|
|||||||
d_fft_codes.reserve(d_fft_size);
|
d_fft_codes.reserve(d_fft_size);
|
||||||
d_magnitude.reserve(d_fft_size);
|
d_magnitude.reserve(d_fft_size);
|
||||||
d_10_ms_buffer.reserve(50 * d_samples_per_ms);
|
d_10_ms_buffer.reserve(50 * d_samples_per_ms);
|
||||||
#if GNURADIO_FFT_USES_TEMPLATES
|
d_fft_if = gnss_fft_fwd_make_unique(d_fft_size);
|
||||||
// Direct FFT
|
d_ifft = gnss_fft_rev_make_unique(d_fft_size);
|
||||||
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
|
// For dumping samples into a file
|
||||||
d_dump = conf_.dump;
|
d_dump = conf_.dump;
|
||||||
@ -383,11 +373,9 @@ int pcps_acquisition_fine_doppler_cc::estimate_Doppler()
|
|||||||
int signal_samples = prn_replicas * d_fft_size;
|
int signal_samples = prn_replicas * d_fft_size;
|
||||||
// int fft_size_extended = nextPowerOf2(signal_samples * zero_padding_factor);
|
// int fft_size_extended = nextPowerOf2(signal_samples * zero_padding_factor);
|
||||||
int fft_size_extended = 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);
|
auto fft_operator = gnss_fft_fwd_make_unique(fft_size_extended);
|
||||||
#else
|
|
||||||
auto fft_operator = std::make_unique<gr::fft::fft_complex>(fft_size_extended, true);
|
|
||||||
#endif
|
|
||||||
// zero padding the entire vector
|
// zero padding the entire vector
|
||||||
std::fill_n(fft_operator->get_inbuf(), fft_size_extended, gr_complex(0.0, 0.0));
|
std::fill_n(fft_operator->get_inbuf(), fft_size_extended, gr_complex(0.0, 0.0));
|
||||||
|
|
||||||
|
@ -41,10 +41,10 @@
|
|||||||
|
|
||||||
#include "acq_conf.h"
|
#include "acq_conf.h"
|
||||||
#include "channel_fsm.h"
|
#include "channel_fsm.h"
|
||||||
|
#include "gnss_sdr_fft.h"
|
||||||
#include "gnss_synchro.h"
|
#include "gnss_synchro.h"
|
||||||
#include <armadillo>
|
#include <armadillo>
|
||||||
#include <gnuradio/block.h>
|
#include <gnuradio/block.h>
|
||||||
#include <gnuradio/fft/fft.h>
|
|
||||||
#include <gnuradio/gr_complex.h>
|
#include <gnuradio/gr_complex.h>
|
||||||
#include <volk_gnsssdr/volk_gnsssdr_alloc.h> // for volk_gnsssdr::vector
|
#include <volk_gnsssdr/volk_gnsssdr_alloc.h> // for volk_gnsssdr::vector
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
@ -197,13 +197,8 @@ private:
|
|||||||
bool start();
|
bool start();
|
||||||
|
|
||||||
std::weak_ptr<ChannelFsm> d_channel_fsm;
|
std::weak_ptr<ChannelFsm> d_channel_fsm;
|
||||||
#if GNURADIO_FFT_USES_TEMPLATES
|
std::unique_ptr<gnss_fft_complex_fwd> d_fft_if;
|
||||||
std::unique_ptr<gr::fft::fft_complex_fwd> d_fft_if;
|
std::unique_ptr<gnss_fft_complex_rev> d_ifft;
|
||||||
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<std::complex<float>>> d_grid_doppler_wipeoffs;
|
||||||
volk_gnsssdr::vector<volk_gnsssdr::vector<float>> d_grid_data;
|
volk_gnsssdr::vector<volk_gnsssdr::vector<float>> d_grid_data;
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
#include "pcps_assisted_acquisition_cc.h"
|
#include "pcps_assisted_acquisition_cc.h"
|
||||||
#include "MATH_CONSTANTS.h"
|
#include "MATH_CONSTANTS.h"
|
||||||
#include "concurrent_map.h"
|
#include "concurrent_map.h"
|
||||||
#include "gnss_sdr_make_unique.h"
|
|
||||||
#include "gps_acq_assist.h"
|
#include "gps_acq_assist.h"
|
||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
#include <gnuradio/io_signature.h>
|
#include <gnuradio/io_signature.h>
|
||||||
@ -69,17 +68,8 @@ pcps_assisted_acquisition_cc::pcps_assisted_acquisition_cc(
|
|||||||
d_disable_assist = false;
|
d_disable_assist = false;
|
||||||
d_fft_codes.reserve(d_fft_size);
|
d_fft_codes.reserve(d_fft_size);
|
||||||
|
|
||||||
#if GNURADIO_FFT_USES_TEMPLATES
|
d_fft_if = gnss_fft_fwd_make_unique(d_fft_size);
|
||||||
// Direct FFT
|
d_ifft = gnss_fft_rev_make_unique(d_fft_size);
|
||||||
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
|
// For dumping samples into a file
|
||||||
d_dump = dump;
|
d_dump = dump;
|
||||||
|
@ -35,9 +35,9 @@
|
|||||||
#define GNSS_SDR_PCPS_ASSISTED_ACQUISITION_CC_H
|
#define GNSS_SDR_PCPS_ASSISTED_ACQUISITION_CC_H
|
||||||
|
|
||||||
#include "channel_fsm.h"
|
#include "channel_fsm.h"
|
||||||
|
#include "gnss_sdr_fft.h"
|
||||||
#include "gnss_synchro.h"
|
#include "gnss_synchro.h"
|
||||||
#include <gnuradio/block.h>
|
#include <gnuradio/block.h>
|
||||||
#include <gnuradio/fft/fft.h>
|
|
||||||
#include <gnuradio/gr_complex.h>
|
#include <gnuradio/gr_complex.h>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@ -198,13 +198,8 @@ private:
|
|||||||
void redefine_grid();
|
void redefine_grid();
|
||||||
|
|
||||||
std::weak_ptr<ChannelFsm> d_channel_fsm;
|
std::weak_ptr<ChannelFsm> d_channel_fsm;
|
||||||
#if GNURADIO_FFT_USES_TEMPLATES
|
std::unique_ptr<gnss_fft_complex_fwd> d_fft_if;
|
||||||
std::unique_ptr<gr::fft::fft_complex_fwd> d_fft_if;
|
std::unique_ptr<gnss_fft_complex_rev> d_ifft;
|
||||||
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<std::complex<float>>> d_grid_doppler_wipeoffs;
|
||||||
std::vector<std::vector<float>> d_grid_data;
|
std::vector<std::vector<float>> d_grid_data;
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
|
|
||||||
#include "pcps_cccwsr_acquisition_cc.h"
|
#include "pcps_cccwsr_acquisition_cc.h"
|
||||||
#include "MATH_CONSTANTS.h" // TWO_PI
|
#include "MATH_CONSTANTS.h" // TWO_PI
|
||||||
#include "gnss_sdr_make_unique.h"
|
|
||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
#include <gnuradio/io_signature.h>
|
#include <gnuradio/io_signature.h>
|
||||||
#include <volk/volk.h>
|
#include <volk/volk.h>
|
||||||
@ -86,17 +85,9 @@ pcps_cccwsr_acquisition_cc::pcps_cccwsr_acquisition_cc(
|
|||||||
d_correlation_minus.reserve(d_fft_size);
|
d_correlation_minus.reserve(d_fft_size);
|
||||||
d_magnitude.reserve(d_fft_size);
|
d_magnitude.reserve(d_fft_size);
|
||||||
|
|
||||||
#if GNURADIO_FFT_USES_TEMPLATES
|
d_fft_if = gnss_fft_fwd_make_unique(d_fft_size);
|
||||||
// Direct FFT
|
d_ifft = gnss_fft_rev_make_unique(d_fft_size);
|
||||||
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
|
// For dumping samples into a file
|
||||||
d_dump = dump;
|
d_dump = dump;
|
||||||
d_dump_filename = dump_filename;
|
d_dump_filename = dump_filename;
|
||||||
|
@ -24,9 +24,9 @@
|
|||||||
#define GNSS_SDR_PCPS_CCCWSR_ACQUISITION_CC_H
|
#define GNSS_SDR_PCPS_CCCWSR_ACQUISITION_CC_H
|
||||||
|
|
||||||
#include "channel_fsm.h"
|
#include "channel_fsm.h"
|
||||||
|
#include "gnss_sdr_fft.h"
|
||||||
#include "gnss_synchro.h"
|
#include "gnss_synchro.h"
|
||||||
#include <gnuradio/block.h>
|
#include <gnuradio/block.h>
|
||||||
#include <gnuradio/fft/fft.h>
|
|
||||||
#include <gnuradio/gr_complex.h>
|
#include <gnuradio/gr_complex.h>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@ -183,13 +183,8 @@ private:
|
|||||||
|
|
||||||
std::weak_ptr<ChannelFsm> d_channel_fsm;
|
std::weak_ptr<ChannelFsm> d_channel_fsm;
|
||||||
|
|
||||||
#if GNURADIO_FFT_USES_TEMPLATES
|
std::unique_ptr<gnss_fft_complex_fwd> d_fft_if;
|
||||||
std::unique_ptr<gr::fft::fft_complex_fwd> d_fft_if;
|
std::unique_ptr<gnss_fft_complex_rev> d_ifft;
|
||||||
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<gr_complex>> d_grid_doppler_wipeoffs;
|
||||||
std::vector<gr_complex> d_fft_code_data;
|
std::vector<gr_complex> d_fft_code_data;
|
||||||
|
@ -36,7 +36,6 @@
|
|||||||
|
|
||||||
#include "pcps_opencl_acquisition_cc.h"
|
#include "pcps_opencl_acquisition_cc.h"
|
||||||
#include "MATH_CONSTANTS.h" // TWO_PI
|
#include "MATH_CONSTANTS.h" // TWO_PI
|
||||||
#include "gnss_sdr_make_unique.h"
|
|
||||||
#include "opencl/fft_base_kernels.h"
|
#include "opencl/fft_base_kernels.h"
|
||||||
#include "opencl/fft_internal.h"
|
#include "opencl/fft_internal.h"
|
||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
@ -112,10 +111,10 @@ pcps_opencl_acquisition_cc::pcps_opencl_acquisition_cc(
|
|||||||
if (d_opencl != 0)
|
if (d_opencl != 0)
|
||||||
{
|
{
|
||||||
// Direct FFT
|
// Direct FFT
|
||||||
d_fft_if = std::make_unique<gr::fft::fft_complex>(d_fft_size, true);
|
d_fft_if = gnss_fft_fwd_make_unique(d_fft_size);
|
||||||
|
|
||||||
// Inverse FFT
|
// Inverse FFT
|
||||||
d_ifft = std::make_unique<gr::fft::fft_complex>(d_fft_size, false);
|
d_ifft = gnss_fft_rev_make_unique(d_fft_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
// For dumping samples into a file
|
// For dumping samples into a file
|
||||||
|
@ -40,10 +40,10 @@
|
|||||||
#define CL_SILENCE_DEPRECATION
|
#define CL_SILENCE_DEPRECATION
|
||||||
#include "channel_fsm.h"
|
#include "channel_fsm.h"
|
||||||
#include "gnss_block_interface.h"
|
#include "gnss_block_interface.h"
|
||||||
|
#include "gnss_sdr_fft.h"
|
||||||
#include "gnss_synchro.h"
|
#include "gnss_synchro.h"
|
||||||
#include "opencl/fft_internal.h"
|
#include "opencl/fft_internal.h"
|
||||||
#include <gnuradio/block.h>
|
#include <gnuradio/block.h>
|
||||||
#include <gnuradio/fft/fft.h>
|
|
||||||
#include <gnuradio/gr_complex.h>
|
#include <gnuradio/gr_complex.h>
|
||||||
#include "opencl/cl.hpp"
|
#include "opencl/cl.hpp"
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
@ -239,8 +239,8 @@ private:
|
|||||||
|
|
||||||
std::weak_ptr<ChannelFsm> d_channel_fsm;
|
std::weak_ptr<ChannelFsm> d_channel_fsm;
|
||||||
|
|
||||||
std::unique_ptr<gr::fft::fft_complex> d_fft_if;
|
std::unique_ptr<gnss_fft_complex_fwd> d_fft_if;
|
||||||
std::unique_ptr<gr::fft::fft_complex> d_ifft;
|
std::unique_ptr<gnss_fft_complex_rev> d_ifft;
|
||||||
|
|
||||||
std::vector<std::vector<gr_complex>> d_grid_doppler_wipeoffs;
|
std::vector<std::vector<gr_complex>> d_grid_doppler_wipeoffs;
|
||||||
std::vector<std::vector<gr_complex>> d_in_buffer;
|
std::vector<std::vector<gr_complex>> d_in_buffer;
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
#include "pcps_quicksync_acquisition_cc.h"
|
#include "pcps_quicksync_acquisition_cc.h"
|
||||||
#include "MATH_CONSTANTS.h"
|
#include "MATH_CONSTANTS.h"
|
||||||
#include "gnss_sdr_make_unique.h"
|
|
||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
#include <gnuradio/io_signature.h>
|
#include <gnuradio/io_signature.h>
|
||||||
#include <volk/volk.h>
|
#include <volk/volk.h>
|
||||||
@ -95,17 +94,8 @@ pcps_quicksync_acquisition_cc::pcps_quicksync_acquisition_cc(
|
|||||||
original form to perform later correlation in time domain*/
|
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));
|
d_code = std::vector<gr_complex>(d_samples_per_code, lv_cmake(0.0F, 0.0F));
|
||||||
|
|
||||||
#if GNURADIO_FFT_USES_TEMPLATES
|
d_fft_if = gnss_fft_fwd_make_unique(d_fft_size);
|
||||||
// Direct FFT
|
d_ifft = gnss_fft_rev_make_unique(d_fft_size);
|
||||||
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
|
// For dumping samples into a file
|
||||||
d_dump = dump;
|
d_dump = dump;
|
||||||
|
@ -38,9 +38,9 @@
|
|||||||
#define GNSS_SDR_PCPS_QUICKSYNC_ACQUISITION_CC_H
|
#define GNSS_SDR_PCPS_QUICKSYNC_ACQUISITION_CC_H
|
||||||
|
|
||||||
#include "channel_fsm.h"
|
#include "channel_fsm.h"
|
||||||
|
#include "gnss_sdr_fft.h"
|
||||||
#include "gnss_synchro.h"
|
#include "gnss_synchro.h"
|
||||||
#include <gnuradio/block.h>
|
#include <gnuradio/block.h>
|
||||||
#include <gnuradio/fft/fft.h>
|
|
||||||
#include <gnuradio/gr_complex.h>
|
#include <gnuradio/gr_complex.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
@ -212,13 +212,8 @@ private:
|
|||||||
|
|
||||||
std::weak_ptr<ChannelFsm> d_channel_fsm;
|
std::weak_ptr<ChannelFsm> d_channel_fsm;
|
||||||
|
|
||||||
#if GNURADIO_FFT_USES_TEMPLATES
|
std::unique_ptr<gnss_fft_complex_fwd> d_fft_if;
|
||||||
std::unique_ptr<gr::fft::fft_complex_fwd> d_fft_if;
|
std::unique_ptr<gnss_fft_complex_rev> d_ifft;
|
||||||
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<gr_complex>> d_grid_doppler_wipeoffs;
|
||||||
std::vector<gr_complex> d_code;
|
std::vector<gr_complex> d_code;
|
||||||
|
@ -36,7 +36,6 @@
|
|||||||
|
|
||||||
#include "pcps_tong_acquisition_cc.h"
|
#include "pcps_tong_acquisition_cc.h"
|
||||||
#include "MATH_CONSTANTS.h" // for TWO_PI
|
#include "MATH_CONSTANTS.h" // for TWO_PI
|
||||||
#include "gnss_sdr_make_unique.h"
|
|
||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
#include <gnuradio/io_signature.h>
|
#include <gnuradio/io_signature.h>
|
||||||
#include <volk/volk.h>
|
#include <volk/volk.h>
|
||||||
@ -102,17 +101,9 @@ pcps_tong_acquisition_cc::pcps_tong_acquisition_cc(
|
|||||||
d_fft_codes.reserve(d_fft_size);
|
d_fft_codes.reserve(d_fft_size);
|
||||||
d_magnitude.reserve(d_fft_size);
|
d_magnitude.reserve(d_fft_size);
|
||||||
|
|
||||||
#if GNURADIO_FFT_USES_TEMPLATES
|
d_fft_if = gnss_fft_fwd_make_unique(d_fft_size);
|
||||||
// Direct FFT
|
d_ifft = gnss_fft_rev_make_unique(d_fft_size);
|
||||||
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
|
// For dumping samples into a file
|
||||||
d_dump = dump;
|
d_dump = dump;
|
||||||
d_dump_filename = dump_filename;
|
d_dump_filename = dump_filename;
|
||||||
|
@ -38,9 +38,9 @@
|
|||||||
#define GNSS_SDR_PCPS_TONG_ACQUISITION_CC_H
|
#define GNSS_SDR_PCPS_TONG_ACQUISITION_CC_H
|
||||||
|
|
||||||
#include "channel_fsm.h"
|
#include "channel_fsm.h"
|
||||||
|
#include "gnss_sdr_fft.h"
|
||||||
#include "gnss_synchro.h"
|
#include "gnss_synchro.h"
|
||||||
#include <gnuradio/block.h>
|
#include <gnuradio/block.h>
|
||||||
#include <gnuradio/fft/fft.h>
|
|
||||||
#include <gnuradio/gr_complex.h>
|
#include <gnuradio/gr_complex.h>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <memory> // for weak_ptr
|
#include <memory> // for weak_ptr
|
||||||
@ -199,14 +199,8 @@ private:
|
|||||||
int32_t doppler_offset);
|
int32_t doppler_offset);
|
||||||
|
|
||||||
std::weak_ptr<ChannelFsm> d_channel_fsm;
|
std::weak_ptr<ChannelFsm> d_channel_fsm;
|
||||||
|
std::unique_ptr<gnss_fft_complex_fwd> d_fft_if;
|
||||||
#if GNURADIO_FFT_USES_TEMPLATES
|
std::unique_ptr<gnss_fft_complex_rev> d_ifft;
|
||||||
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<gr_complex>> d_grid_doppler_wipeoffs;
|
||||||
std::vector<std::vector<float>> d_grid_data;
|
std::vector<std::vector<float>> d_grid_data;
|
||||||
|
@ -43,8 +43,8 @@ target_link_libraries(input_filter_gr_blocks
|
|||||||
Gnuradio::blocks
|
Gnuradio::blocks
|
||||||
Gnuradio::filter
|
Gnuradio::filter
|
||||||
Volkgnsssdr::volkgnsssdr
|
Volkgnsssdr::volkgnsssdr
|
||||||
PRIVATE
|
|
||||||
algorithms_libs
|
algorithms_libs
|
||||||
|
PRIVATE
|
||||||
Volk::volk
|
Volk::volk
|
||||||
Log4cpp::log4cpp
|
Log4cpp::log4cpp
|
||||||
)
|
)
|
||||||
@ -60,13 +60,6 @@ if(GNURADIO_USES_STD_POINTERS)
|
|||||||
)
|
)
|
||||||
endif()
|
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(ENABLE_CLANG_TIDY)
|
||||||
if(CLANG_TIDY_EXE)
|
if(CLANG_TIDY_EXE)
|
||||||
set_target_properties(input_filter_gr_blocks
|
set_target_properties(input_filter_gr_blocks
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "notch_cc.h"
|
#include "notch_cc.h"
|
||||||
#include "gnss_sdr_make_unique.h"
|
|
||||||
#include <boost/math/distributions/chi_squared.hpp>
|
#include <boost/math/distributions/chi_squared.hpp>
|
||||||
#include <gnuradio/io_signature.h>
|
#include <gnuradio/io_signature.h>
|
||||||
#include <volk/volk.h>
|
#include <volk/volk.h>
|
||||||
@ -57,11 +56,7 @@ Notch::Notch(float pfa,
|
|||||||
angle_ = volk_gnsssdr::vector<float>(length_);
|
angle_ = volk_gnsssdr::vector<float>(length_);
|
||||||
power_spect_ = volk_gnsssdr::vector<float>(length_);
|
power_spect_ = volk_gnsssdr::vector<float>(length_);
|
||||||
last_out_ = gr_complex(0.0, 0.0);
|
last_out_ = gr_complex(0.0, 0.0);
|
||||||
#if GNURADIO_FFT_USES_TEMPLATES
|
d_fft_ = gnss_fft_fwd_make_unique(length_);
|
||||||
d_fft_ = std::make_unique<gr::fft::fft_complex_fwd>(length_);
|
|
||||||
#else
|
|
||||||
d_fft_ = std::make_unique<gr::fft::fft_complex>(length_, true);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,8 +19,8 @@
|
|||||||
#define GNSS_SDR_NOTCH_CC_H
|
#define GNSS_SDR_NOTCH_CC_H
|
||||||
|
|
||||||
#include "gnss_block_interface.h"
|
#include "gnss_block_interface.h"
|
||||||
|
#include "gnss_sdr_fft.h"
|
||||||
#include <gnuradio/block.h>
|
#include <gnuradio/block.h>
|
||||||
#include <gnuradio/fft/fft.h>
|
|
||||||
#include <volk_gnsssdr/volk_gnsssdr_alloc.h> // for volk_gnsssdr::vector
|
#include <volk_gnsssdr/volk_gnsssdr_alloc.h> // for volk_gnsssdr::vector
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@ -57,11 +57,8 @@ public:
|
|||||||
private:
|
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);
|
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);
|
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_;
|
std::unique_ptr<gnss_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<gr_complex> c_samples_;
|
||||||
volk_gnsssdr::vector<float> angle_;
|
volk_gnsssdr::vector<float> angle_;
|
||||||
volk_gnsssdr::vector<float> power_spect_;
|
volk_gnsssdr::vector<float> power_spect_;
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "notch_lite_cc.h"
|
#include "notch_lite_cc.h"
|
||||||
#include "gnss_sdr_make_unique.h"
|
|
||||||
#include <boost/math/distributions/chi_squared.hpp>
|
#include <boost/math/distributions/chi_squared.hpp>
|
||||||
#include <gnuradio/io_signature.h>
|
#include <gnuradio/io_signature.h>
|
||||||
#include <volk/volk.h>
|
#include <volk/volk.h>
|
||||||
@ -63,11 +62,7 @@ NotchLite::NotchLite(float p_c_factor,
|
|||||||
angle1_ = 0.0;
|
angle1_ = 0.0;
|
||||||
angle2_ = 0.0;
|
angle2_ = 0.0;
|
||||||
power_spect_ = volk_gnsssdr::vector<float>(length_);
|
power_spect_ = volk_gnsssdr::vector<float>(length_);
|
||||||
#if GNURADIO_FFT_USES_TEMPLATES
|
d_fft_ = gnss_fft_fwd_make_unique(length_);
|
||||||
d_fft_ = std::make_unique<gr::fft::fft_complex_fwd>(length_);
|
|
||||||
#else
|
|
||||||
d_fft_ = std::make_unique<gr::fft::fft_complex>(length_, true);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,8 +19,8 @@
|
|||||||
#define GNSS_SDR_NOTCH_LITE_CC_H
|
#define GNSS_SDR_NOTCH_LITE_CC_H
|
||||||
|
|
||||||
#include "gnss_block_interface.h"
|
#include "gnss_block_interface.h"
|
||||||
|
#include "gnss_sdr_fft.h"
|
||||||
#include <gnuradio/block.h>
|
#include <gnuradio/block.h>
|
||||||
#include <gnuradio/fft/fft.h>
|
|
||||||
#include <volk_gnsssdr/volk_gnsssdr_alloc.h> // for volk_gnsssdr::vector
|
#include <volk_gnsssdr/volk_gnsssdr_alloc.h> // for volk_gnsssdr::vector
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@ -58,11 +58,8 @@ public:
|
|||||||
private:
|
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);
|
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);
|
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_;
|
std::unique_ptr<gnss_fft_complex_fwd> d_fft_;
|
||||||
#else
|
|
||||||
std::unique_ptr<gr::fft::fft_complex> d_fft_;
|
|
||||||
#endif
|
|
||||||
volk_gnsssdr::vector<float> power_spect_;
|
volk_gnsssdr::vector<float> power_spect_;
|
||||||
gr_complex last_out_;
|
gr_complex last_out_;
|
||||||
gr_complex z_0_;
|
gr_complex z_0_;
|
||||||
|
@ -53,6 +53,7 @@ set(GNSS_SPLIBS_HEADERS
|
|||||||
conjugate_ic.h
|
conjugate_ic.h
|
||||||
cshort_to_float_x2.h
|
cshort_to_float_x2.h
|
||||||
gnss_sdr_create_directory.h
|
gnss_sdr_create_directory.h
|
||||||
|
gnss_sdr_fft.h
|
||||||
gnss_sdr_make_unique.h
|
gnss_sdr_make_unique.h
|
||||||
gnss_circular_deque.h
|
gnss_circular_deque.h
|
||||||
geofunctions.h
|
geofunctions.h
|
||||||
@ -108,6 +109,7 @@ target_link_libraries(algorithms_libs
|
|||||||
Boost::headers
|
Boost::headers
|
||||||
Gnuradio::runtime
|
Gnuradio::runtime
|
||||||
Gnuradio::blocks
|
Gnuradio::blocks
|
||||||
|
Gnuradio::fft
|
||||||
PRIVATE
|
PRIVATE
|
||||||
core_system_parameters
|
core_system_parameters
|
||||||
Volk::volk
|
Volk::volk
|
||||||
@ -128,6 +130,12 @@ if(has_span)
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(GNURADIO_FFT_USES_TEMPLATES)
|
||||||
|
target_compile_definitions(algorithms_libs
|
||||||
|
PUBLIC -DGNURADIO_FFT_USES_TEMPLATES=1
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(ENABLE_OPENCL)
|
if(ENABLE_OPENCL)
|
||||||
target_link_libraries(algorithms_libs PUBLIC OpenCL::OpenCL)
|
target_link_libraries(algorithms_libs PUBLIC OpenCL::OpenCL)
|
||||||
target_include_directories(algorithms_libs PUBLIC
|
target_include_directories(algorithms_libs PUBLIC
|
||||||
|
63
src/algorithms/libs/gnss_sdr_fft.h
Normal file
63
src/algorithms/libs/gnss_sdr_fft.h
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
/*!
|
||||||
|
* \file gnss_sdr_fft.h
|
||||||
|
* \brief Helper file for FFT interface
|
||||||
|
* \author Carles Fernandez Prades, 2021. cfernandez(at)cttc.es
|
||||||
|
*
|
||||||
|
* -----------------------------------------------------------------------------
|
||||||
|
*
|
||||||
|
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||||
|
* This file is part of GNSS-SDR.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2010-2021 (see AUTHORS file for a list of contributors)
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
*
|
||||||
|
* -----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef GNSS_SDR_GNSS_SDR_FFT_H
|
||||||
|
#define GNSS_SDR_GNSS_SDR_FFT_H
|
||||||
|
|
||||||
|
#include "gnss_sdr_make_unique.h"
|
||||||
|
#include <gnuradio/fft/fft.h>
|
||||||
|
|
||||||
|
#if GNURADIO_FFT_USES_TEMPLATES
|
||||||
|
using gnss_fft_complex_fwd = gr::fft::fft_complex_fwd;
|
||||||
|
using gnss_fft_complex_rev = gr::fft::fft_complex_rev;
|
||||||
|
template <typename T>
|
||||||
|
using gnss_fft_fwd_unique_ptr = std::unique_ptr<T>;
|
||||||
|
template <typename... Args>
|
||||||
|
gnss_fft_fwd_unique_ptr<gr::fft::fft_complex_fwd> gnss_fft_fwd_make_unique(Args&&... args)
|
||||||
|
{
|
||||||
|
return std::make_unique<gr::fft::fft_complex_fwd>(std::forward<Args>(args)...);
|
||||||
|
}
|
||||||
|
template <typename T>
|
||||||
|
using gnss_fft_rev_unique_ptr = std::unique_ptr<T>;
|
||||||
|
template <typename... Args>
|
||||||
|
gnss_fft_rev_unique_ptr<gr::fft::fft_complex_rev> gnss_fft_rev_make_unique(Args&&... args)
|
||||||
|
{
|
||||||
|
return std::make_unique<gr::fft::fft_complex_rev>(std::forward<Args>(args)...);
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
using gnss_fft_complex_fwd = gr::fft::fft_complex;
|
||||||
|
using gnss_fft_complex_rev = gr::fft::fft_complex;
|
||||||
|
template <typename T>
|
||||||
|
using gnss_fft_fwd_unique_ptr = std::unique_ptr<T>;
|
||||||
|
template <typename... Args>
|
||||||
|
gnss_fft_fwd_unique_ptr<gr::fft::fft_complex> gnss_fft_fwd_make_unique(Args&&... args)
|
||||||
|
{
|
||||||
|
return std::make_unique<gr::fft::fft_complex>(std::forward<Args>(args)..., true);
|
||||||
|
}
|
||||||
|
template <typename T>
|
||||||
|
using gnss_fft_rev_unique_ptr = std::unique_ptr<T>;
|
||||||
|
template <typename... Args>
|
||||||
|
gnss_fft_rev_unique_ptr<gr::fft::fft_complex> gnss_fft_rev_make_unique(Args&&... args)
|
||||||
|
{
|
||||||
|
return std::make_unique<gr::fft::fft_complex>(std::forward<Args>(args)..., false);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // GNSS_SDR_GNSS_SDR_FFT_H
|
@ -500,7 +500,7 @@ static void buffer_dump()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fprintf(stderr, " %ld\n", DynamicBuffer.length);
|
fprintf(stderr, " %lu\n", DynamicBuffer.length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -533,11 +533,6 @@ if(ENABLE_UNIT_TESTING)
|
|||||||
PRIVATE -DGNURADIO_USES_STD_POINTERS=1
|
PRIVATE -DGNURADIO_USES_STD_POINTERS=1
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
if(GNURADIO_FFT_USES_TEMPLATES)
|
|
||||||
target_compile_definitions(run_tests
|
|
||||||
PUBLIC -DGNURADIO_FFT_USES_TEMPLATES=1
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
if(ENABLE_UNIT_TESTING_EXTRA)
|
if(ENABLE_UNIT_TESTING_EXTRA)
|
||||||
target_link_libraries(run_tests PRIVATE Gpstk::gpstk)
|
target_link_libraries(run_tests PRIVATE Gpstk::gpstk)
|
||||||
if(GPSTK_OLDER_THAN_8)
|
if(GPSTK_OLDER_THAN_8)
|
||||||
|
@ -15,10 +15,9 @@
|
|||||||
* -----------------------------------------------------------------------------
|
* -----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "gnss_sdr_make_unique.h"
|
#include "gnss_sdr_fft.h"
|
||||||
#include "gnuplot_i.h"
|
#include "gnuplot_i.h"
|
||||||
#include "test_flags.h"
|
#include "test_flags.h"
|
||||||
#include <gnuradio/fft/fft.h>
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
@ -71,11 +70,7 @@ TEST(FFTLengthTest, MeasureExecutionTime)
|
|||||||
EXPECT_NO_THROW(
|
EXPECT_NO_THROW(
|
||||||
for (it = fft_sizes_v.cbegin(); it != fft_sizes_v.cend(); ++it) {
|
for (it = fft_sizes_v.cbegin(); it != fft_sizes_v.cend(); ++it) {
|
||||||
d_fft_size = *it;
|
d_fft_size = *it;
|
||||||
#if GNURADIO_FFT_USES_TEMPLATES
|
auto d_fft = gnss_fft_fwd_make_unique(d_fft_size);
|
||||||
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);
|
std::generate_n(d_fft->get_inbuf(), d_fft_size, gen);
|
||||||
|
|
||||||
start = std::chrono::system_clock::now();
|
start = std::chrono::system_clock::now();
|
||||||
|
@ -16,9 +16,8 @@
|
|||||||
* -----------------------------------------------------------------------------
|
* -----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "gnss_sdr_make_unique.h"
|
#include "gnss_sdr_fft.h"
|
||||||
#include <armadillo>
|
#include <armadillo>
|
||||||
#include <gnuradio/fft/fft.h>
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
@ -36,11 +35,7 @@ TEST(FFTSpeedTest, ArmadilloVSGNURadioExecutionTime)
|
|||||||
for (unsigned int fft_size
|
for (unsigned int fft_size
|
||||||
: fft_sizes) {
|
: fft_sizes) {
|
||||||
d_fft_size = fft_size;
|
d_fft_size = fft_size;
|
||||||
#if GNURADIO_FFT_USES_TEMPLATES
|
auto d_gr_fft = gnss_fft_fwd_make_unique(d_fft_size);
|
||||||
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::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 = 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);
|
arma::cx_fvec d_arma_fft_result(d_fft_size);
|
||||||
|
Loading…
Reference in New Issue
Block a user