1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-14 04:00:34 +00:00
This commit is contained in:
Carles Fernandez 2016-03-30 22:56:37 +02:00
parent 864c81b082
commit 1946e3b6e3
13 changed files with 79 additions and 65 deletions

View File

@ -40,7 +40,7 @@
#include <gnuradio/io_signature.h> #include <gnuradio/io_signature.h>
#include <glog/logging.h> #include <glog/logging.h>
#include <volk/volk.h> #include <volk/volk.h>
#include "gnss_signal_processing.h" #include <volk_gnsssdr/volk_gnsssdr.h>
#include "control_message_factory.h" #include "control_message_factory.h"
using google::LogMessage; using google::LogMessage;
@ -277,6 +277,7 @@ void galileo_e5a_noncoherentIQ_acquisition_caf_cc::init()
d_gnss_synchro->Acq_samplestamp_samples = 0; d_gnss_synchro->Acq_samplestamp_samples = 0;
d_mag = 0.0; d_mag = 0.0;
d_input_power = 0.0; d_input_power = 0.0;
const double GALILEO_TWO_PI = 6.283185307179600;
// Count the number of bins // Count the number of bins
d_num_doppler_bins = 0; d_num_doppler_bins = 0;
@ -293,7 +294,10 @@ void galileo_e5a_noncoherentIQ_acquisition_caf_cc::init()
{ {
d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex*>(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex*>(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()));
int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index; int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
complex_exp_gen_conj(d_grid_doppler_wipeoffs[doppler_index], d_freq + doppler, d_fs_in, d_fft_size); float phase_step_rad = GALILEO_TWO_PI * (d_freq + 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);
} }
/* CAF Filtering to resolve doppler ambiguity. Phase and quadrature must be processed /* CAF Filtering to resolve doppler ambiguity. Phase and quadrature must be processed

View File

@ -34,7 +34,7 @@
#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>
#include "gnss_signal_processing.h" #include <volk_gnsssdr/volk_gnsssdr.h>
#include "control_message_factory.h" #include "control_message_factory.h"
using google::LogMessage; using google::LogMessage;
@ -157,7 +157,7 @@ void galileo_pcps_8ms_acquisition_cc::init()
d_gnss_synchro->Acq_samplestamp_samples = 0; d_gnss_synchro->Acq_samplestamp_samples = 0;
d_mag = 0.0; d_mag = 0.0;
d_input_power = 0.0; d_input_power = 0.0;
const double GALILEO_TWO_PI = 6.283185307179600;
// Count the number of bins // Count the number of bins
d_num_doppler_bins = 0; d_num_doppler_bins = 0;
for (int doppler = static_cast<int>(-d_doppler_max); for (int doppler = static_cast<int>(-d_doppler_max);
@ -173,7 +173,10 @@ void galileo_pcps_8ms_acquisition_cc::init()
{ {
d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex*>(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex*>(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()));
int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index; int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
complex_exp_gen_conj(d_grid_doppler_wipeoffs[doppler_index], d_freq + doppler, d_fs_in, d_fft_size); float phase_step_rad = static_cast<float>(GALILEO_TWO_PI) * (d_freq + 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);
} }
} }

View File

@ -38,9 +38,9 @@
#include <gnuradio/io_signature.h> #include <gnuradio/io_signature.h>
#include <glog/logging.h> #include <glog/logging.h>
#include <volk/volk.h> #include <volk/volk.h>
#include <volk_gnsssdr/volk_gnsssdr.h>
#include "gnss_signal_processing.h" #include "gnss_signal_processing.h"
#include "control_message_factory.h" #include "control_message_factory.h"
#include <gnuradio/fxpt.h> // fixed point sine and cosine
#include "GPS_L1_CA.h" //GPS_TWO_PI #include "GPS_L1_CA.h" //GPS_TWO_PI
@ -174,18 +174,10 @@ void pcps_acquisition_cc::set_local_code(std::complex<float> * code)
void pcps_acquisition_cc::update_local_carrier(gr_complex* carrier_vector, int correlator_length_samples, float freq) void pcps_acquisition_cc::update_local_carrier(gr_complex* carrier_vector, int correlator_length_samples, float freq)
{ {
float sin_f, cos_f;
float phase_step_rad = GPS_TWO_PI * freq / static_cast<float>(d_fs_in); float phase_step_rad = GPS_TWO_PI * freq / static_cast<float>(d_fs_in);
float _phase[1];
int phase_step_rad_i = gr::fxpt::float_to_fixed(phase_step_rad); _phase[0] = 0;
int phase_rad_i = 0; volk_gnsssdr_s32f_sincos_32fc(carrier_vector, - phase_step_rad, _phase, correlator_length_samples);
for(int i = 0; i < correlator_length_samples; i++)
{
gr::fxpt::sincos(phase_rad_i, &sin_f, &cos_f);
carrier_vector[i] = gr_complex(cos_f, -sin_f);
phase_rad_i += phase_step_rad_i;
}
} }
void pcps_acquisition_cc::init() void pcps_acquisition_cc::init()

View File

@ -36,7 +36,7 @@
#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>
#include "nco_lib.h" #include <volk_gnsssdr/volk_gnsssdr.h>
#include "concurrent_map.h" #include "concurrent_map.h"
#include "gnss_signal_processing.h" #include "gnss_signal_processing.h"
#include "gps_sdr_signal_processing.h" #include "gps_sdr_signal_processing.h"
@ -192,6 +192,8 @@ void pcps_acquisition_fine_doppler_cc::reset_grid()
} }
} }
} }
void pcps_acquisition_fine_doppler_cc::update_carrier_wipeoff() void pcps_acquisition_fine_doppler_cc::update_carrier_wipeoff()
{ {
// create the carrier Doppler wipeoff signals // create the carrier Doppler wipeoff signals
@ -200,13 +202,14 @@ void pcps_acquisition_fine_doppler_cc::update_carrier_wipeoff()
d_grid_doppler_wipeoffs = new gr_complex*[d_num_doppler_points]; d_grid_doppler_wipeoffs = new gr_complex*[d_num_doppler_points];
for (int doppler_index = 0; doppler_index < d_num_doppler_points; doppler_index++) for (int doppler_index = 0; doppler_index < d_num_doppler_points; doppler_index++)
{ {
doppler_hz = d_config_doppler_min + d_doppler_step*doppler_index; doppler_hz = d_config_doppler_min + d_doppler_step*doppler_index;
// doppler search steps // doppler search steps
// compute the carrier doppler wipe-off signal and store it // compute the carrier doppler wipe-off signal and store it
phase_step_rad = static_cast<float>(GPS_TWO_PI) * ( d_freq + doppler_hz ) / static_cast<float>(d_fs_in); phase_step_rad = static_cast<float>(GPS_TWO_PI) * ( d_freq + doppler_hz ) / static_cast<float>(d_fs_in);
d_grid_doppler_wipeoffs[doppler_index] = new gr_complex[d_fft_size]; d_grid_doppler_wipeoffs[doppler_index] = new gr_complex[d_fft_size];
fxp_nco(d_grid_doppler_wipeoffs[doppler_index], d_fft_size,0, phase_step_rad); float _phase[1];
_phase[0] = 0;
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], - phase_step_rad, _phase, d_fft_size);
} }
} }

View File

@ -41,7 +41,6 @@
#include "gnss_signal_processing.h" #include "gnss_signal_processing.h"
#include "control_message_factory.h" #include "control_message_factory.h"
#include <volk_gnsssdr/volk_gnsssdr.h> #include <volk_gnsssdr/volk_gnsssdr.h>
#include <gnuradio/fxpt.h> // fixed point sine and cosine
#include "GPS_L1_CA.h" //GPS_TWO_PI #include "GPS_L1_CA.h" //GPS_TWO_PI
using google::LogMessage; using google::LogMessage;
@ -177,18 +176,10 @@ void pcps_acquisition_sc::set_local_code(std::complex<float> * code)
void pcps_acquisition_sc::update_local_carrier(gr_complex* carrier_vector, int correlator_length_samples, float freq) void pcps_acquisition_sc::update_local_carrier(gr_complex* carrier_vector, int correlator_length_samples, float freq)
{ {
float sin_f, cos_f;
float phase_step_rad = GPS_TWO_PI * freq / static_cast<float>(d_fs_in); float phase_step_rad = GPS_TWO_PI * freq / static_cast<float>(d_fs_in);
float _phase[1];
int phase_step_rad_i = gr::fxpt::float_to_fixed(phase_step_rad); _phase[0] = 0;
int phase_rad_i = 0; volk_gnsssdr_s32f_sincos_32fc(carrier_vector, - phase_step_rad, _phase, correlator_length_samples);
for(int i = 0; i < correlator_length_samples; i++)
{
gr::fxpt::sincos(phase_rad_i, &sin_f, &cos_f);
carrier_vector[i] = gr_complex(cos_f, -sin_f);
phase_rad_i += phase_step_rad_i;
}
} }
void pcps_acquisition_sc::init() void pcps_acquisition_sc::init()

View File

@ -35,7 +35,7 @@
#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>
#include "nco_lib.h" #include <volk_gnsssdr/volk_gnsssdr.h>
#include "concurrent_map.h" #include "concurrent_map.h"
#include "gnss_signal_processing.h" #include "gnss_signal_processing.h"
#include "control_message_factory.h" #include "control_message_factory.h"
@ -252,7 +252,9 @@ void pcps_assisted_acquisition_cc::redefine_grid()
// compute the carrier doppler wipe-off signal and store it // compute the carrier doppler wipe-off signal and store it
phase_step_rad = static_cast<float>(GPS_TWO_PI) * doppler_hz / static_cast<float>(d_fs_in); phase_step_rad = static_cast<float>(GPS_TWO_PI) * doppler_hz / static_cast<float>(d_fs_in);
d_grid_doppler_wipeoffs[doppler_index] = new gr_complex[d_fft_size]; d_grid_doppler_wipeoffs[doppler_index] = new gr_complex[d_fft_size];
fxp_nco(d_grid_doppler_wipeoffs[doppler_index], d_fft_size, 0, phase_step_rad); float _phase[1];
_phase[0] = 0;
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], - phase_step_rad, _phase, d_fft_size);
} }
} }

View File

@ -39,8 +39,9 @@
#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>
#include "gnss_signal_processing.h" #include <volk_gnsssdr/volk_gnsssdr.h>
#include "control_message_factory.h" #include "control_message_factory.h"
#include "GPS_L1_CA.h" //GPS_TWO_PI
using google::LogMessage; using google::LogMessage;
@ -188,8 +189,10 @@ void pcps_cccwsr_acquisition_cc::init()
d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex*>(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex*>(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()));
int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index; int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
complex_exp_gen_conj(d_grid_doppler_wipeoffs[doppler_index], float phase_step_rad = GPS_TWO_PI * (d_freq + doppler) / static_cast<float>(d_fs_in);
d_freq + doppler, d_fs_in, d_fft_size); float _phase[1];
_phase[0] = 0;
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], - phase_step_rad, _phase, d_fft_size);
} }
} }

View File

@ -39,8 +39,9 @@
#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>
#include "gnss_signal_processing.h" #include <volk_gnsssdr/volk_gnsssdr.h>
#include "control_message_factory.h" #include "control_message_factory.h"
#include "GPS_L1_CA.h" //GPS_TWO_PI
using google::LogMessage; using google::LogMessage;
@ -172,10 +173,11 @@ void pcps_multithread_acquisition_cc::init()
for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++)
{ {
d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex*>(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex*>(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()));
int doppler = -(int)d_doppler_max + d_doppler_step * doppler_index; int doppler = -(int)d_doppler_max + d_doppler_step * doppler_index;
complex_exp_gen_conj(d_grid_doppler_wipeoffs[doppler_index], float phase_step_rad = static_cast<float>(GPS_TWO_PI) * (d_freq + doppler) / static_cast<float>(d_fs_in);
d_freq + doppler, d_fs_in, d_fft_size); float _phase[1];
_phase[0] = 0;
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], - phase_step_rad, _phase, d_fft_size);
} }
} }

View File

@ -56,11 +56,11 @@
#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>
#include "gnss_signal_processing.h" #include <volk_gnsssdr/volk_gnsssdr.h>
#include "control_message_factory.h" #include "control_message_factory.h"
#include "fft_base_kernels.h" #include "fft_base_kernels.h"
#include "fft_internal.h" #include "fft_internal.h"
#include "GPS_L1_CA.h" //GPS_TWO_PI
using google::LogMessage; using google::LogMessage;
@ -316,8 +316,10 @@ void pcps_opencl_acquisition_cc::init()
d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex*>(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex*>(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()));
int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index; int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
complex_exp_gen_conj(d_grid_doppler_wipeoffs[doppler_index], float phase_step_rad = static_cast<float>(GPS_TWO_PI) * (d_freq + doppler) / static_cast<float>(d_fs_in);
d_freq + doppler, d_fs_in, d_fft_size); float _phase[1];
_phase[0] = 0;
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], - phase_step_rad, _phase, d_fft_size);
if (d_opencl == 0) if (d_opencl == 0)
{ {

View File

@ -34,9 +34,9 @@
#include <gnuradio/io_signature.h> #include <gnuradio/io_signature.h>
#include <glog/logging.h> #include <glog/logging.h>
#include <volk/volk.h> #include <volk/volk.h>
#include <volk_gnsssdr/volk_gnsssdr.h>
#include "control_message_factory.h" #include "control_message_factory.h"
#include "gnss_signal_processing.h" #include "GPS_L1_CA.h"
using google::LogMessage; using google::LogMessage;
@ -220,9 +220,10 @@ void pcps_quicksync_acquisition_cc::init()
{ {
d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex*>(volk_malloc(d_samples_per_code * d_folding_factor * sizeof(gr_complex), volk_get_alignment())); d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex*>(volk_malloc(d_samples_per_code * d_folding_factor * sizeof(gr_complex), volk_get_alignment()));
int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index; int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
complex_exp_gen_conj(d_grid_doppler_wipeoffs[doppler_index], float phase_step_rad = GPS_TWO_PI * (d_freq + doppler) / static_cast<float>(d_fs_in);
d_freq + doppler, d_fs_in, float _phase[1];
d_samples_per_code * d_folding_factor); _phase[0] = 0;
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], - phase_step_rad, _phase, d_samples_per_code * d_folding_factor);
} }
// DLOG(INFO) << "end init"; // DLOG(INFO) << "end init";
} }

View File

@ -53,8 +53,9 @@
#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>
#include <volk_gnsssdr/volk_gnsssdr.h>
#include "control_message_factory.h" #include "control_message_factory.h"
#include "gnss_signal_processing.h" #include "GPS_L1_CA.h" //GPS_TWO_PI
using google::LogMessage; using google::LogMessage;
@ -185,9 +186,10 @@ void pcps_tong_acquisition_cc::init()
d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex*>(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex*>(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()));
int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index; int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
float phase_step_rad = GPS_TWO_PI * (d_freq + doppler) / static_cast<float>(d_fs_in);
complex_exp_gen_conj(d_grid_doppler_wipeoffs[doppler_index], float _phase[1];
d_freq + doppler, d_fs_in, d_fft_size); _phase[0] = 0;
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index], - phase_step_rad, _phase, d_fft_size);
d_grid_data[doppler_index] = static_cast<float*>(volk_malloc(d_fft_size * sizeof(float), volk_get_alignment())); d_grid_data[doppler_index] = static_cast<float*>(volk_malloc(d_fft_size * sizeof(float), volk_get_alignment()));

View File

@ -27,13 +27,20 @@ include_directories(
${GLOG_INCLUDE_DIRS} ${GLOG_INCLUDE_DIRS}
${GFlags_INCLUDE_DIRS} ${GFlags_INCLUDE_DIRS}
${GNURADIO_RUNTIME_INCLUDE_DIRS} ${GNURADIO_RUNTIME_INCLUDE_DIRS}
${VOLK_GNSSSDR_INCLUDE_DIRS}
) )
file(GLOB SIGNAL_GENERATOR_BLOCK_HEADERS "*.h") file(GLOB SIGNAL_GENERATOR_BLOCK_HEADERS "*.h")
add_library(signal_generator_blocks ${SIGNAL_GENERATOR_BLOCK_SOURCES} ${SIGNAL_GENERATOR_BLOCK_HEADERS}) add_library(signal_generator_blocks ${SIGNAL_GENERATOR_BLOCK_SOURCES} ${SIGNAL_GENERATOR_BLOCK_HEADERS})
source_group(Headers FILES ${SIGNAL_GENERATOR_BLOCK_HEADERS}) source_group(Headers FILES ${SIGNAL_GENERATOR_BLOCK_HEADERS})
target_link_libraries(signal_generator_blocks gnss_system_parameters target_link_libraries(signal_generator_blocks gnss_system_parameters gnss_sp_libs
${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES}
${GNURADIO_FFT_LIBRARIES} ${GNURADIO_FFT_LIBRARIES}
${VOLK_LIBRARIES} ${ORC_LIBRARIES} ${VOLK_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES}
) )
if(VOLK_GNSSSDR_FOUND)
# add_dependencies(signal_generator_blocks glog-${glog_RELEASE})
else(VOLK_GNSSSDR_FOUND)
add_dependencies(signal_generator_blocks volk_gnsssdr_module)
endif()

View File

@ -34,9 +34,9 @@
#include <fstream> #include <fstream>
#include <gnuradio/io_signature.h> #include <gnuradio/io_signature.h>
#include <volk/volk.h> #include <volk/volk.h>
#include <volk_gnsssdr/volk_gnsssdr.h>
#include "gps_sdr_signal_processing.h" #include "gps_sdr_signal_processing.h"
#include "galileo_e1_signal_processing.h" #include "galileo_e1_signal_processing.h"
#include "nco_lib.h"
#include "galileo_e5_signal_processing.h" #include "galileo_e5_signal_processing.h"
#include "Galileo_E1.h" #include "Galileo_E1.h"
#include "Galileo_E5a.h" #include "Galileo_E5a.h"
@ -271,7 +271,9 @@ gr_vector_void_star &output_items)
for (unsigned int sat = 0; sat < num_sats_; sat++) for (unsigned int sat = 0; sat < num_sats_; sat++)
{ {
float phase_step_rad = -static_cast<float>(GPS_TWO_PI) * doppler_Hz_[sat] / static_cast<float>(fs_in_); float phase_step_rad = -static_cast<float>(GPS_TWO_PI) * doppler_Hz_[sat] / static_cast<float>(fs_in_);
fxp_nco(complex_phase_, vector_length_, start_phase_rad_[sat], phase_step_rad); float _phase[1];
_phase[0] = -start_phase_rad_[sat];
volk_gnsssdr_s32f_sincos_32fc(complex_phase_, -phase_step_rad, _phase, vector_length_);
start_phase_rad_[sat] += vector_length_ * phase_step_rad; start_phase_rad_[sat] += vector_length_ * phase_step_rad;
out_idx = 0; out_idx = 0;