mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-06-02 06:34:08 +00:00
Merge branch 'next' of https://github.com/gnss-sdr/gnss-sdr into next
This commit is contained in:
commit
7b562e8686
@ -204,8 +204,11 @@ Acquisition_1C.if=0
|
||||
Acquisition_1C.sampled_ms=1
|
||||
;#implementation: Acquisition algorithm selection for this channel: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
|
||||
Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition
|
||||
;#use_CFAR_algorithm: If enabled, acquisition estimates the input signal power to implement CFAR detection algorithms
|
||||
;#notice that this affects the Acquisition threshold range!
|
||||
Acquisition_1C.use_CFAR_algorithm=false;
|
||||
;#threshold: Acquisition threshold
|
||||
Acquisition_1C.threshold=0.045
|
||||
Acquisition_1C.threshold=11
|
||||
;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
|
||||
;Acquisition_1C.pfa=0.01
|
||||
;#doppler_max: Maximum expected Doppler shift [Hz]
|
||||
|
@ -70,6 +70,7 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
|
||||
}
|
||||
|
||||
bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
|
||||
use_CFAR_algorithm_flag_=configuration_->property(role + ".use_CFAR_algorithm", true); //will be false in future versions
|
||||
|
||||
if (!bit_transition_flag_)
|
||||
{
|
||||
@ -107,7 +108,7 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
|
||||
item_size_ = sizeof(gr_complex);
|
||||
acquisition_cc_ = pcps_make_acquisition_cc(sampled_ms_, max_dwells_,
|
||||
shift_resolution_, if_, fs_in_, samples_per_ms, code_length_,
|
||||
bit_transition_flag_, queue_, dump_, dump_filename_);
|
||||
bit_transition_flag_, use_CFAR_algorithm_flag_, queue_, dump_, dump_filename_);
|
||||
stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_);
|
||||
DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id() << ")";
|
||||
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
|
||||
|
@ -143,6 +143,7 @@ private:
|
||||
unsigned int vector_length_;
|
||||
unsigned int code_length_;
|
||||
bool bit_transition_flag_;
|
||||
bool use_CFAR_algorithm_flag_;
|
||||
unsigned int channel_;
|
||||
float threshold_;
|
||||
unsigned int doppler_max_;
|
||||
|
@ -65,6 +65,7 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition(
|
||||
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1);
|
||||
|
||||
bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
|
||||
use_CFAR_algorithm_flag_=configuration_->property(role + ".use_CFAR_algorithm", true); //will be false in future versions
|
||||
|
||||
if (!bit_transition_flag_)
|
||||
{
|
||||
@ -89,14 +90,14 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition(
|
||||
item_size_ = sizeof(lv_16sc_t);
|
||||
acquisition_sc_ = pcps_make_acquisition_sc(sampled_ms_, max_dwells_,
|
||||
shift_resolution_, if_, fs_in_, code_length_, code_length_,
|
||||
bit_transition_flag_, queue_, dump_, dump_filename_);
|
||||
bit_transition_flag_, use_CFAR_algorithm_flag_, queue_, dump_, dump_filename_);
|
||||
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
|
||||
|
||||
}else{
|
||||
item_size_ = sizeof(gr_complex);
|
||||
acquisition_cc_ = pcps_make_acquisition_cc(sampled_ms_, max_dwells_,
|
||||
shift_resolution_, if_, fs_in_, code_length_, code_length_,
|
||||
bit_transition_flag_, queue_, dump_, dump_filename_);
|
||||
bit_transition_flag_, use_CFAR_algorithm_flag_, queue_, dump_, dump_filename_);
|
||||
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
|
||||
}
|
||||
|
||||
|
@ -157,6 +157,7 @@ private:
|
||||
unsigned int vector_length_;
|
||||
unsigned int code_length_;
|
||||
bool bit_transition_flag_;
|
||||
bool use_CFAR_algorithm_flag_;
|
||||
unsigned int channel_;
|
||||
float threshold_;
|
||||
unsigned int doppler_max_;
|
||||
|
@ -62,6 +62,7 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition(
|
||||
shift_resolution_ = configuration_->property(role + ".doppler_max", 15);
|
||||
|
||||
bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
|
||||
use_CFAR_algorithm_flag_=configuration_->property(role + ".use_CFAR_algorithm", true); //will be false in future versions
|
||||
|
||||
if (!bit_transition_flag_)
|
||||
{
|
||||
@ -87,7 +88,7 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition(
|
||||
item_size_ = sizeof(gr_complex);
|
||||
acquisition_cc_ = pcps_make_acquisition_cc(1, max_dwells_,
|
||||
shift_resolution_, if_, fs_in_, code_length_, code_length_,
|
||||
bit_transition_flag_, queue_, dump_, dump_filename_);
|
||||
bit_transition_flag_, use_CFAR_algorithm_flag_, queue_, dump_, dump_filename_);
|
||||
|
||||
stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_);
|
||||
|
||||
|
@ -152,6 +152,7 @@ private:
|
||||
unsigned int vector_length_;
|
||||
unsigned int code_length_;
|
||||
bool bit_transition_flag_;
|
||||
bool use_CFAR_algorithm_flag_;
|
||||
unsigned int channel_;
|
||||
float threshold_;
|
||||
unsigned int doppler_max_;
|
||||
|
@ -40,6 +40,8 @@
|
||||
#include <volk/volk.h>
|
||||
#include "gnss_signal_processing.h"
|
||||
#include "control_message_factory.h"
|
||||
#include <gnuradio/fxpt.h> // fixed point sine and cosine
|
||||
#include "GPS_L1_CA.h" //GPS_TWO_PI
|
||||
|
||||
|
||||
using google::LogMessage;
|
||||
@ -48,21 +50,21 @@ pcps_acquisition_cc_sptr pcps_make_acquisition_cc(
|
||||
unsigned int sampled_ms, unsigned int max_dwells,
|
||||
unsigned int doppler_max, long freq, long fs_in,
|
||||
int samples_per_ms, int samples_per_code,
|
||||
bool bit_transition_flag,
|
||||
bool bit_transition_flag, bool use_CFAR_algorithm_flag,
|
||||
gr::msg_queue::sptr queue, bool dump,
|
||||
std::string dump_filename)
|
||||
{
|
||||
|
||||
return pcps_acquisition_cc_sptr(
|
||||
new pcps_acquisition_cc(sampled_ms, max_dwells, doppler_max, freq, fs_in, samples_per_ms,
|
||||
samples_per_code, bit_transition_flag, queue, dump, dump_filename));
|
||||
samples_per_code, bit_transition_flag, use_CFAR_algorithm_flag, queue, dump, dump_filename));
|
||||
}
|
||||
|
||||
pcps_acquisition_cc::pcps_acquisition_cc(
|
||||
unsigned int sampled_ms, unsigned int max_dwells,
|
||||
unsigned int doppler_max, long freq, long fs_in,
|
||||
int samples_per_ms, int samples_per_code,
|
||||
bool bit_transition_flag,
|
||||
bool bit_transition_flag, bool use_CFAR_algorithm_flag,
|
||||
gr::msg_queue::sptr queue, bool dump,
|
||||
std::string dump_filename) :
|
||||
gr::block("pcps_acquisition_cc",
|
||||
@ -86,6 +88,7 @@ pcps_acquisition_cc::pcps_acquisition_cc(
|
||||
d_input_power = 0.0;
|
||||
d_num_doppler_bins = 0;
|
||||
d_bit_transition_flag = bit_transition_flag;
|
||||
d_use_CFAR_algorithm_flag=use_CFAR_algorithm_flag;
|
||||
d_threshold = 0.0;
|
||||
d_doppler_step = 250;
|
||||
d_code_phase = 0;
|
||||
@ -169,6 +172,22 @@ void pcps_acquisition_cc::set_local_code(std::complex<float> * code)
|
||||
volk_32fc_conjugate_32fc(d_fft_codes, d_fft_if->get_outbuf(), d_fft_size);
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
int phase_step_rad_i = gr::fxpt::float_to_fixed(phase_step_rad);
|
||||
int phase_rad_i = 0;
|
||||
|
||||
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()
|
||||
{
|
||||
d_gnss_synchro->Acq_delay_samples = 0.0;
|
||||
@ -186,7 +205,7 @@ void pcps_acquisition_cc::init()
|
||||
{
|
||||
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;
|
||||
complex_exp_gen(d_grid_doppler_wipeoffs[doppler_index], -d_freq - doppler, d_fs_in, d_fft_size);
|
||||
update_local_carrier(d_grid_doppler_wipeoffs[doppler_index], d_fft_size, d_freq + doppler);
|
||||
}
|
||||
}
|
||||
|
||||
@ -281,10 +300,13 @@ int pcps_acquisition_cc::general_work(int noutput_items,
|
||||
<< d_threshold << ", doppler_max: " << d_doppler_max
|
||||
<< ", doppler_step: " << d_doppler_step;
|
||||
|
||||
// 1- Compute the input signal power estimation
|
||||
volk_32fc_magnitude_squared_32f(d_magnitude, in, d_fft_size);
|
||||
volk_32f_accumulator_s32f(&d_input_power, d_magnitude, d_fft_size);
|
||||
d_input_power /= static_cast<float>(d_fft_size);
|
||||
if (d_use_CFAR_algorithm_flag==true)
|
||||
{
|
||||
// 1- (optional) Compute the input signal power estimation
|
||||
volk_32fc_magnitude_squared_32f(d_magnitude, in, d_fft_size);
|
||||
volk_32f_accumulator_s32f(&d_input_power, d_magnitude, d_fft_size);
|
||||
d_input_power /= static_cast<float>(d_fft_size);
|
||||
}
|
||||
// 2- Doppler frequency search loop
|
||||
for (unsigned int doppler_index=0; doppler_index < d_num_doppler_bins; doppler_index++)
|
||||
{
|
||||
@ -311,15 +333,25 @@ int pcps_acquisition_cc::general_work(int noutput_items,
|
||||
size_t offset = ( d_bit_transition_flag ? effective_fft_size : 0 );
|
||||
volk_32fc_magnitude_squared_32f(d_magnitude, d_ifft->get_outbuf() + offset, effective_fft_size);
|
||||
volk_32f_index_max_16u(&indext, d_magnitude, effective_fft_size);
|
||||
magt = d_magnitude[indext];
|
||||
|
||||
// Normalize the maximum value to correct the scale factor introduced by FFTW
|
||||
magt = d_magnitude[indext] / (fft_normalization_factor * fft_normalization_factor);
|
||||
|
||||
if (d_use_CFAR_algorithm_flag==true)
|
||||
{
|
||||
// Normalize the maximum value to correct the scale factor introduced by FFTW
|
||||
magt = d_magnitude[indext] / (fft_normalization_factor * fft_normalization_factor);
|
||||
}
|
||||
// 4- record the maximum peak and the associated synchronization parameters
|
||||
if (d_mag < magt)
|
||||
{
|
||||
d_mag = magt;
|
||||
|
||||
if (d_use_CFAR_algorithm_flag==false)
|
||||
{
|
||||
// Search grid noise floor approximation for this doppler line
|
||||
volk_32f_accumulator_s32f(&d_input_power, d_magnitude, effective_fft_size);
|
||||
d_input_power=(d_input_power-d_mag)/(effective_fft_size-1);
|
||||
}
|
||||
|
||||
// In case that d_bit_transition_flag = true, we compare the potentially
|
||||
// new maximum test statistics (d_mag/d_input_power) with the value in
|
||||
// d_test_statistics. When the second dwell is being processed, the value
|
||||
@ -327,6 +359,7 @@ int pcps_acquisition_cc::general_work(int noutput_items,
|
||||
// the maximum test statistics in the previous dwell is greater than
|
||||
// current d_mag/d_input_power). Note that d_test_statistics is not
|
||||
// restarted between consecutive dwells in multidwell operation.
|
||||
|
||||
if (d_test_statistics < (d_mag / d_input_power) || !d_bit_transition_flag)
|
||||
{
|
||||
d_gnss_synchro->Acq_delay_samples = static_cast<double>(indext % d_samples_per_code);
|
||||
|
@ -67,7 +67,7 @@ pcps_acquisition_cc_sptr
|
||||
pcps_make_acquisition_cc(unsigned int sampled_ms, unsigned int max_dwells,
|
||||
unsigned int doppler_max, long freq, long fs_in,
|
||||
int samples_per_ms, int samples_per_code,
|
||||
bool bit_transition_flag,
|
||||
bool bit_transition_flag, bool use_CFAR_algorithm_flag,
|
||||
gr::msg_queue::sptr queue, bool dump,
|
||||
std::string dump_filename);
|
||||
|
||||
@ -84,19 +84,18 @@ private:
|
||||
pcps_make_acquisition_cc(unsigned int sampled_ms, unsigned int max_dwells,
|
||||
unsigned int doppler_max, long freq, long fs_in,
|
||||
int samples_per_ms, int samples_per_code,
|
||||
bool bit_transition_flag,
|
||||
bool bit_transition_flag, bool use_CFAR_algorithm_flag,
|
||||
gr::msg_queue::sptr queue, bool dump,
|
||||
std::string dump_filename);
|
||||
|
||||
pcps_acquisition_cc(unsigned int sampled_ms, unsigned int max_dwells,
|
||||
unsigned int doppler_max, long freq, long fs_in,
|
||||
int samples_per_ms, int samples_per_code,
|
||||
bool bit_transition_flag,
|
||||
bool bit_transition_flag, bool use_CFAR_algorithm_flag,
|
||||
gr::msg_queue::sptr queue, bool dump,
|
||||
std::string dump_filename);
|
||||
|
||||
void calculate_magnitudes(gr_complex* fft_begin, int doppler_shift,
|
||||
int doppler_offset);
|
||||
void update_local_carrier(gr_complex* carrier_vector, int correlator_length_samples, float freq);
|
||||
|
||||
long d_fs_in;
|
||||
long d_freq;
|
||||
@ -125,6 +124,7 @@ private:
|
||||
float d_input_power;
|
||||
float d_test_statistics;
|
||||
bool d_bit_transition_flag;
|
||||
bool d_use_CFAR_algorithm_flag;
|
||||
gr::msg_queue::sptr d_queue;
|
||||
concurrent_queue<int> *d_channel_internal_queue;
|
||||
std::ofstream d_dump_file;
|
||||
|
@ -41,6 +41,8 @@
|
||||
#include "gnss_signal_processing.h"
|
||||
#include "control_message_factory.h"
|
||||
#include <volk_gnsssdr/volk_gnsssdr.h>
|
||||
#include <gnuradio/fxpt.h> // fixed point sine and cosine
|
||||
#include "GPS_L1_CA.h" //GPS_TWO_PI
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
@ -48,21 +50,21 @@ pcps_acquisition_sc_sptr pcps_make_acquisition_sc(
|
||||
unsigned int sampled_ms, unsigned int max_dwells,
|
||||
unsigned int doppler_max, long freq, long fs_in,
|
||||
int samples_per_ms, int samples_per_code,
|
||||
bool bit_transition_flag,
|
||||
bool bit_transition_flag, bool use_CFAR_algorithm_flag,
|
||||
gr::msg_queue::sptr queue, bool dump,
|
||||
std::string dump_filename)
|
||||
{
|
||||
|
||||
return pcps_acquisition_sc_sptr(
|
||||
new pcps_acquisition_sc(sampled_ms, max_dwells, doppler_max, freq, fs_in, samples_per_ms,
|
||||
samples_per_code, bit_transition_flag, queue, dump, dump_filename));
|
||||
samples_per_code, bit_transition_flag, use_CFAR_algorithm_flag, queue, dump, dump_filename));
|
||||
}
|
||||
|
||||
pcps_acquisition_sc::pcps_acquisition_sc(
|
||||
unsigned int sampled_ms, unsigned int max_dwells,
|
||||
unsigned int doppler_max, long freq, long fs_in,
|
||||
int samples_per_ms, int samples_per_code,
|
||||
bool bit_transition_flag,
|
||||
bool bit_transition_flag, bool use_CFAR_algorithm_flag,
|
||||
gr::msg_queue::sptr queue, bool dump,
|
||||
std::string dump_filename) :
|
||||
gr::block("pcps_acquisition_sc",
|
||||
@ -86,6 +88,7 @@ pcps_acquisition_sc::pcps_acquisition_sc(
|
||||
d_input_power = 0.0;
|
||||
d_num_doppler_bins = 0;
|
||||
d_bit_transition_flag = bit_transition_flag;
|
||||
d_use_CFAR_algorithm_flag=use_CFAR_algorithm_flag;
|
||||
d_threshold = 0.0;
|
||||
d_doppler_step = 250;
|
||||
d_code_phase = 0;
|
||||
@ -172,6 +175,22 @@ void pcps_acquisition_sc::set_local_code(std::complex<float> * code)
|
||||
volk_32fc_conjugate_32fc(d_fft_codes, d_fft_if->get_outbuf(), d_fft_size);
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
int phase_step_rad_i = gr::fxpt::float_to_fixed(phase_step_rad);
|
||||
int phase_rad_i = 0;
|
||||
|
||||
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()
|
||||
{
|
||||
d_gnss_synchro->Acq_delay_samples = 0.0;
|
||||
@ -189,7 +208,7 @@ void pcps_acquisition_sc::init()
|
||||
{
|
||||
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;
|
||||
complex_exp_gen(d_grid_doppler_wipeoffs[doppler_index], -d_freq - doppler, d_fs_in, d_fft_size);
|
||||
update_local_carrier(d_grid_doppler_wipeoffs[doppler_index], d_fft_size, d_freq + doppler);
|
||||
}
|
||||
}
|
||||
|
||||
@ -273,11 +292,9 @@ int pcps_acquisition_sc::general_work(int noutput_items,
|
||||
|
||||
float fft_normalization_factor = static_cast<float>(d_fft_size) * static_cast<float>(d_fft_size);
|
||||
|
||||
d_input_power = 0.0;
|
||||
d_mag = 0.0;
|
||||
|
||||
d_sample_counter += d_fft_size; // sample counter
|
||||
|
||||
d_well_count++;
|
||||
|
||||
DLOG(INFO) << "Channel: " << d_channel
|
||||
@ -286,10 +303,13 @@ int pcps_acquisition_sc::general_work(int noutput_items,
|
||||
<< d_threshold << ", doppler_max: " << d_doppler_max
|
||||
<< ", doppler_step: " << d_doppler_step;
|
||||
|
||||
// 1- Compute the input signal power estimation
|
||||
volk_32fc_magnitude_squared_32f(d_magnitude, d_in_32fc, d_fft_size);
|
||||
volk_32f_accumulator_s32f(&d_input_power, d_magnitude, d_fft_size);
|
||||
d_input_power /= static_cast<float>(d_fft_size);
|
||||
if (d_use_CFAR_algorithm_flag==true)
|
||||
{
|
||||
// 1- (optional) Compute the input signal power estimation
|
||||
volk_32fc_magnitude_squared_32f(d_magnitude, d_in_32fc, d_fft_size);
|
||||
volk_32f_accumulator_s32f(&d_input_power, d_magnitude, d_fft_size);
|
||||
d_input_power /= static_cast<float>(d_fft_size);
|
||||
}
|
||||
// 2- Doppler frequency search loop
|
||||
for (unsigned int doppler_index=0; doppler_index < d_num_doppler_bins; doppler_index++)
|
||||
{
|
||||
@ -316,15 +336,27 @@ int pcps_acquisition_sc::general_work(int noutput_items,
|
||||
size_t offset = ( d_bit_transition_flag ? effective_fft_size : 0 );
|
||||
volk_32fc_magnitude_squared_32f(d_magnitude, d_ifft->get_outbuf() + offset, effective_fft_size);
|
||||
volk_32f_index_max_16u(&indext, d_magnitude, effective_fft_size);
|
||||
magt = d_magnitude[indext];
|
||||
|
||||
if (d_use_CFAR_algorithm_flag==true)
|
||||
{
|
||||
// Normalize the maximum value to correct the scale factor introduced by FFTW
|
||||
magt = d_magnitude[indext] / (fft_normalization_factor * fft_normalization_factor);
|
||||
}
|
||||
|
||||
// Normalize the maximum value to correct the scale factor introduced by FFTW
|
||||
magt = d_magnitude[indext] / (fft_normalization_factor * fft_normalization_factor);
|
||||
|
||||
// 4- record the maximum peak and the associated synchronization parameters
|
||||
if (d_mag < magt)
|
||||
{
|
||||
d_mag = magt;
|
||||
|
||||
if (d_use_CFAR_algorithm_flag==false)
|
||||
{
|
||||
// Search grid noise floor approximation for this doppler line
|
||||
volk_32f_accumulator_s32f(&d_input_power, d_magnitude, effective_fft_size);
|
||||
d_input_power=(d_input_power-d_mag)/(effective_fft_size-1);
|
||||
}
|
||||
|
||||
// In case that d_bit_transition_flag = true, we compare the potentially
|
||||
// new maximum test statistics (d_mag/d_input_power) with the value in
|
||||
// d_test_statistics. When the second dwell is being processed, the value
|
||||
@ -332,6 +364,7 @@ int pcps_acquisition_sc::general_work(int noutput_items,
|
||||
// the maximum test statistics in the previous dwell is greater than
|
||||
// current d_mag/d_input_power). Note that d_test_statistics is not
|
||||
// restarted between consecutive dwells in multidwell operation.
|
||||
|
||||
if (d_test_statistics < (d_mag / d_input_power) || !d_bit_transition_flag)
|
||||
{
|
||||
d_gnss_synchro->Acq_delay_samples = static_cast<double>(indext % d_samples_per_code);
|
||||
@ -339,8 +372,9 @@ int pcps_acquisition_sc::general_work(int noutput_items,
|
||||
d_gnss_synchro->Acq_samplestamp_samples = d_sample_counter;
|
||||
|
||||
// 5- Compute the test statistics and compare to the threshold
|
||||
//d_test_statistics = 2 * d_fft_size * d_mag / d_input_power;
|
||||
d_test_statistics = d_mag / d_input_power;
|
||||
//std::cout<<"d_input_power="<<d_input_power<<" d_test_statistics="<<d_test_statistics<<" d_gnss_synchro->Acq_doppler_hz ="<<d_gnss_synchro->Acq_doppler_hz <<std::endl;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -455,18 +489,3 @@ int pcps_acquisition_sc::general_work(int noutput_items,
|
||||
output_items.clear(); // removes a warning
|
||||
return noutput_items;
|
||||
}
|
||||
|
||||
|
||||
//void pcps_acquisition_sc::forecast (int noutput_items, gr_vector_int &ninput_items_required)
|
||||
//{
|
||||
//// COD:
|
||||
//// For zero-padded case we need one extra code period
|
||||
//if( d_bit_transition_flag )
|
||||
//{
|
||||
//ninput_items_required[0] = noutput_items*(d_samples_per_code * d_max_dwells + d_samples_per_code);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
//ninput_items_required[0] = noutput_items*d_fft_size*d_max_dwells;
|
||||
//}
|
||||
//}
|
||||
|
@ -67,7 +67,7 @@ pcps_acquisition_sc_sptr
|
||||
pcps_make_acquisition_sc(unsigned int sampled_ms, unsigned int max_dwells,
|
||||
unsigned int doppler_max, long freq, long fs_in,
|
||||
int samples_per_ms, int samples_per_code,
|
||||
bool bit_transition_flag,
|
||||
bool bit_transition_flag, bool use_CFAR_algorithm_flag,
|
||||
gr::msg_queue::sptr queue, bool dump,
|
||||
std::string dump_filename);
|
||||
|
||||
@ -84,19 +84,21 @@ private:
|
||||
pcps_make_acquisition_sc(unsigned int sampled_ms, unsigned int max_dwells,
|
||||
unsigned int doppler_max, long freq, long fs_in,
|
||||
int samples_per_ms, int samples_per_code,
|
||||
bool bit_transition_flag,
|
||||
bool bit_transition_flag, bool use_CFAR_algorithm_flag,
|
||||
gr::msg_queue::sptr queue, bool dump,
|
||||
std::string dump_filename);
|
||||
|
||||
pcps_acquisition_sc(unsigned int sampled_ms, unsigned int max_dwells,
|
||||
unsigned int doppler_max, long freq, long fs_in,
|
||||
int samples_per_ms, int samples_per_code,
|
||||
bool bit_transition_flag,
|
||||
bool bit_transition_flag, bool use_CFAR_algorithm_flag,
|
||||
gr::msg_queue::sptr queue, bool dump,
|
||||
std::string dump_filename);
|
||||
|
||||
void calculate_magnitudes(gr_complex* fft_begin, int doppler_shift,
|
||||
int doppler_offset);
|
||||
void update_local_carrier(gr_complex* carrier_vector,
|
||||
int correlator_length_samples,
|
||||
float freq);
|
||||
|
||||
|
||||
long d_fs_in;
|
||||
long d_freq;
|
||||
@ -126,6 +128,7 @@ private:
|
||||
float d_input_power;
|
||||
float d_test_statistics;
|
||||
bool d_bit_transition_flag;
|
||||
bool d_use_CFAR_algorithm_flag;
|
||||
gr::msg_queue::sptr d_queue;
|
||||
concurrent_queue<int> *d_channel_internal_queue;
|
||||
std::ofstream d_dump_file;
|
||||
|
@ -32,8 +32,8 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -Wall")
|
||||
|
||||
option(ENABLE_STRIP "Create a stripped volk_gnsssdr_profile binary (without shared libraries)" OFF)
|
||||
|
||||
set(CMAKE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) #allows this to be a sub-project
|
||||
set(CMAKE_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) #allows this to be a sub-project
|
||||
set(PROJECT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) #allows this to be a sub-project
|
||||
set(PROJECT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) #allows this to be a sub-project
|
||||
list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules) #location for custom "Modules"
|
||||
|
||||
include(VolkBuildTypes)
|
||||
@ -119,13 +119,13 @@ endif(ENABLE_ORC)
|
||||
find_package(Doxygen)
|
||||
if(DOXYGEN_FOUND)
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/Doxyfile.in
|
||||
${CMAKE_BINARY_DIR}/Doxyfile
|
||||
${PROJECT_SOURCE_DIR}/Doxyfile.in
|
||||
${PROJECT_BINARY_DIR}/Doxyfile
|
||||
@ONLY)
|
||||
|
||||
add_custom_target(doc
|
||||
${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
${DOXYGEN_EXECUTABLE} ${PROJECT_BINARY_DIR}/Doxyfile
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
||||
COMMENT "Generating documentation with Doxygen" VERBATIM
|
||||
)
|
||||
endif(DOXYGEN_FOUND)
|
||||
@ -159,22 +159,22 @@ set(VOLK_LIBRARY_DIR lib${LIB_SUFFIX})
|
||||
set(VOLK_INCLUDE_DIR include)
|
||||
|
||||
install(
|
||||
DIRECTORY ${CMAKE_SOURCE_DIR}/kernels/volk_gnsssdr
|
||||
DIRECTORY ${PROJECT_SOURCE_DIR}/kernels/volk_gnsssdr
|
||||
DESTINATION include COMPONENT "volk_gnsssdr_devel"
|
||||
FILES_MATCHING PATTERN "*.h"
|
||||
)
|
||||
|
||||
install(FILES
|
||||
${CMAKE_SOURCE_DIR}/include/volk_gnsssdr/volk_gnsssdr_prefs.h
|
||||
${CMAKE_SOURCE_DIR}/include/volk_gnsssdr/volk_gnsssdr_complex.h
|
||||
${CMAKE_SOURCE_DIR}/include/volk_gnsssdr/volk_gnsssdr_common.h
|
||||
${CMAKE_SOURCE_DIR}/include/volk_gnsssdr/volk_gnsssdr_avx_intrinsics.h
|
||||
${CMAKE_SOURCE_DIR}/include/volk_gnsssdr/volk_gnsssdr_sse3_intrinsics.h
|
||||
${CMAKE_BINARY_DIR}/include/volk_gnsssdr/volk_gnsssdr.h
|
||||
${CMAKE_BINARY_DIR}/include/volk_gnsssdr/volk_gnsssdr_cpu.h
|
||||
${CMAKE_BINARY_DIR}/include/volk_gnsssdr/volk_gnsssdr_config_fixed.h
|
||||
${CMAKE_BINARY_DIR}/include/volk_gnsssdr/volk_gnsssdr_typedefs.h
|
||||
${CMAKE_SOURCE_DIR}/include/volk_gnsssdr/volk_gnsssdr_malloc.h
|
||||
${PROJECT_SOURCE_DIR}/include/volk_gnsssdr/volk_gnsssdr_prefs.h
|
||||
${PROJECT_SOURCE_DIR}/include/volk_gnsssdr/volk_gnsssdr_complex.h
|
||||
${PROJECT_SOURCE_DIR}/include/volk_gnsssdr/volk_gnsssdr_common.h
|
||||
${PROJECT_SOURCE_DIR}/include/volk_gnsssdr/volk_gnsssdr_avx_intrinsics.h
|
||||
${PROJECT_SOURCE_DIR}/include/volk_gnsssdr/volk_gnsssdr_sse3_intrinsics.h
|
||||
${PROJECT_BINARY_DIR}/include/volk_gnsssdr/volk_gnsssdr.h
|
||||
${PROJECT_BINARY_DIR}/include/volk_gnsssdr/volk_gnsssdr_cpu.h
|
||||
${PROJECT_BINARY_DIR}/include/volk_gnsssdr/volk_gnsssdr_config_fixed.h
|
||||
${PROJECT_BINARY_DIR}/include/volk_gnsssdr/volk_gnsssdr_typedefs.h
|
||||
${PROJECT_SOURCE_DIR}/include/volk_gnsssdr/volk_gnsssdr_malloc.h
|
||||
DESTINATION include/volk_gnsssdr
|
||||
COMPONENT "volk_gnsssdr_devel"
|
||||
)
|
||||
@ -205,7 +205,7 @@ endif(APPLE)
|
||||
# Create uninstall target
|
||||
########################################################################
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in
|
||||
${PROJECT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
|
||||
@ONLY)
|
||||
|
||||
@ -226,8 +226,8 @@ endif()
|
||||
########################################################################
|
||||
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/cmake/Modules/VolkConfigVersion.cmake.in
|
||||
${CMAKE_BINARY_DIR}/cmake/Modules/VolkConfigVersion.cmake
|
||||
${PROJECT_SOURCE_DIR}/cmake/Modules/VolkConfigVersion.cmake.in
|
||||
${PROJECT_BINARY_DIR}/cmake/Modules/VolkConfigVersion.cmake
|
||||
@ONLY)
|
||||
|
||||
|
||||
|
@ -674,7 +674,7 @@ FILE_VERSION_FILTER =
|
||||
# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
|
||||
# tag is left empty.
|
||||
|
||||
LAYOUT_FILE = @CMAKE_SOURCE_DIR@/DoxygenLayout.xml
|
||||
LAYOUT_FILE = @PROJECT_SOURCE_DIR@/DoxygenLayout.xml
|
||||
|
||||
# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
|
||||
# the reference definitions. This must be a list of .bib files. The .bib
|
||||
@ -756,7 +756,7 @@ WARN_LOGFILE =
|
||||
# spaces.
|
||||
# Note: If this tag is empty the current directory is searched.
|
||||
|
||||
INPUT = @CMAKE_SOURCE_DIR@
|
||||
INPUT = @PROJECT_SOURCE_DIR@
|
||||
|
||||
# This tag can be used to specify the character encoding of the source files
|
||||
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
|
||||
@ -832,7 +832,7 @@ RECURSIVE = YES
|
||||
# Note that relative paths are relative to the directory from which doxygen is
|
||||
# run.
|
||||
|
||||
EXCLUDE = @CMAKE_BINARY_DIR@
|
||||
EXCLUDE = @PROJECT_BINARY_DIR@
|
||||
|
||||
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
|
||||
# directories that are symbolic links (a Unix file system feature) are excluded
|
||||
|
@ -21,16 +21,16 @@
|
||||
# Setup profiler
|
||||
########################################################################
|
||||
if(MSVC)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/cmake/msvc)
|
||||
include_directories(${PROJECT_SOURCE_DIR}/cmake/msvc)
|
||||
endif(MSVC)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${CMAKE_SOURCE_DIR}/include
|
||||
${CMAKE_BINARY_DIR}/include
|
||||
${CMAKE_SOURCE_DIR}/lib
|
||||
${CMAKE_BINARY_DIR}/lib
|
||||
${PROJECT_SOURCE_DIR}/include
|
||||
${PROJECT_BINARY_DIR}/include
|
||||
${PROJECT_SOURCE_DIR}/lib
|
||||
${PROJECT_BINARY_DIR}/lib
|
||||
${Boost_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
@ -50,7 +50,7 @@ endif(ORC_FOUND)
|
||||
# MAKE volk_gnsssdr_profile
|
||||
add_executable(volk_gnsssdr_profile
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/volk_gnsssdr_profile.cc
|
||||
${CMAKE_SOURCE_DIR}/lib/qa_utils.cc
|
||||
${PROJECT_SOURCE_DIR}/lib/qa_utils.cc
|
||||
)
|
||||
|
||||
if(ENABLE_STATIC_LIBS)
|
||||
|
@ -111,7 +111,7 @@ file(TO_CMAKE_PATH ${VOLK_PYTHON_DIR} VOLK_PYTHON_DIR)
|
||||
# Usage: VOLK_UNIQUE_TARGET(<description> <dependencies list>)
|
||||
########################################################################
|
||||
function(VOLK_UNIQUE_TARGET desc)
|
||||
file(RELATIVE_PATH reldir ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR})
|
||||
file(RELATIVE_PATH reldir ${PROJECT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR})
|
||||
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import re, hashlib
|
||||
unique = hashlib.md5('${reldir}${ARGN}').hexdigest()[:5]
|
||||
print(re.sub('\\W', '_', '${desc} ${reldir} ' + unique))"
|
||||
@ -163,13 +163,13 @@ function(VOLK_PYTHON_INSTALL)
|
||||
#the command to generate the pyc files
|
||||
add_custom_command(
|
||||
DEPENDS ${pysrcfiles} OUTPUT ${pycfiles}
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_BINARY_DIR}/python_compile_helper.py ${pysrcfiles} ${pycfiles}
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_BINARY_DIR}/python_compile_helper.py ${pysrcfiles} ${pycfiles}
|
||||
)
|
||||
|
||||
#the command to generate the pyo files
|
||||
add_custom_command(
|
||||
DEPENDS ${pysrcfiles} OUTPUT ${pyofiles}
|
||||
COMMAND ${PYTHON_EXECUTABLE} -O ${CMAKE_BINARY_DIR}/python_compile_helper.py ${pysrcfiles} ${pyofiles}
|
||||
COMMAND ${PYTHON_EXECUTABLE} -O ${PROJECT_BINARY_DIR}/python_compile_helper.py ${pysrcfiles} ${pyofiles}
|
||||
)
|
||||
|
||||
#create install rule and add generated files to target list
|
||||
@ -192,7 +192,7 @@ function(VOLK_PYTHON_INSTALL)
|
||||
foreach(pyfile ${VOLK_PYTHON_INSTALL_PROGRAMS})
|
||||
get_filename_component(pyfile_name ${pyfile} NAME)
|
||||
get_filename_component(pyfile ${pyfile} ABSOLUTE)
|
||||
string(REPLACE "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" pyexefile "${pyfile}.exe")
|
||||
string(REPLACE "${PROJECT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}" pyexefile "${pyfile}.exe")
|
||||
list(APPEND python_install_gen_targets ${pyexefile})
|
||||
|
||||
get_filename_component(pyexefile_path ${pyexefile} PATH)
|
||||
@ -227,7 +227,7 @@ endfunction(VOLK_PYTHON_INSTALL)
|
||||
########################################################################
|
||||
# Write the python helper script that generates byte code files
|
||||
########################################################################
|
||||
file(WRITE ${CMAKE_BINARY_DIR}/python_compile_helper.py "
|
||||
file(WRITE ${PROJECT_BINARY_DIR}/python_compile_helper.py "
|
||||
import sys, py_compile
|
||||
files = sys.argv[1:]
|
||||
srcs, gens = files[:len(files)/2], files[len(files)/2:]
|
||||
|
@ -32,12 +32,12 @@ set(MAINT_VERSION ${VERSION_INFO_MAINT_VERSION})
|
||||
########################################################################
|
||||
find_package(Git)
|
||||
|
||||
if(GIT_FOUND AND EXISTS ${CMAKE_SOURCE_DIR}/.git)
|
||||
if(GIT_FOUND AND EXISTS ${PROJECT_SOURCE_DIR}/.git)
|
||||
message(STATUS "Extracting version information from git describe...")
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} describe --always --abbrev=8 --long
|
||||
OUTPUT_VARIABLE GIT_DESCRIBE OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||
)
|
||||
else()
|
||||
if(NOT VOLK_GIT_COUNT)
|
||||
|
@ -97,7 +97,7 @@ endif()
|
||||
########################################################################
|
||||
execute_process(
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
|
||||
${CMAKE_SOURCE_DIR}/gen/volk_gnsssdr_compile_utils.py
|
||||
${PROJECT_SOURCE_DIR}/gen/volk_gnsssdr_compile_utils.py
|
||||
--mode "arch_flags" --compiler "${COMPILER_NAME}"
|
||||
OUTPUT_VARIABLE arch_flag_lines OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
@ -285,7 +285,7 @@ message(STATUS "Available architectures: ${available_archs}")
|
||||
########################################################################
|
||||
execute_process(
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
|
||||
${CMAKE_SOURCE_DIR}/gen/volk_gnsssdr_compile_utils.py
|
||||
${PROJECT_SOURCE_DIR}/gen/volk_gnsssdr_compile_utils.py
|
||||
--mode "machines" --archs "${available_archs}"
|
||||
OUTPUT_VARIABLE available_machines OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
@ -317,9 +317,9 @@ message(STATUS "Available machines: ${available_machines}")
|
||||
########################################################################
|
||||
|
||||
#dependencies are all python, xml, and header implementation files
|
||||
file(GLOB xml_files ${CMAKE_SOURCE_DIR}/gen/*.xml)
|
||||
file(GLOB py_files ${CMAKE_SOURCE_DIR}/gen/*.py)
|
||||
file(GLOB h_files ${CMAKE_SOURCE_DIR}/kernels/volk_gnsssdr/*.h)
|
||||
file(GLOB xml_files ${PROJECT_SOURCE_DIR}/gen/*.xml)
|
||||
file(GLOB py_files ${PROJECT_SOURCE_DIR}/gen/*.py)
|
||||
file(GLOB h_files ${PROJECT_SOURCE_DIR}/kernels/volk_gnsssdr/*.h)
|
||||
|
||||
macro(gen_template tmpl output)
|
||||
list(APPEND volk_gnsssdr_gen_sources ${output})
|
||||
@ -327,21 +327,21 @@ macro(gen_template tmpl output)
|
||||
OUTPUT ${output}
|
||||
DEPENDS ${xml_files} ${py_files} ${h_files} ${tmpl}
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
|
||||
${CMAKE_SOURCE_DIR}/gen/volk_gnsssdr_tmpl_utils.py
|
||||
${PROJECT_SOURCE_DIR}/gen/volk_gnsssdr_tmpl_utils.py
|
||||
--input ${tmpl} --output ${output} ${ARGN}
|
||||
)
|
||||
endmacro(gen_template)
|
||||
|
||||
make_directory(${CMAKE_BINARY_DIR}/include/volk_gnsssdr)
|
||||
make_directory(${PROJECT_BINARY_DIR}/include/volk_gnsssdr)
|
||||
|
||||
gen_template(${CMAKE_SOURCE_DIR}/tmpl/volk_gnsssdr.tmpl.h ${CMAKE_BINARY_DIR}/include/volk_gnsssdr/volk_gnsssdr.h)
|
||||
gen_template(${CMAKE_SOURCE_DIR}/tmpl/volk_gnsssdr.tmpl.c ${CMAKE_BINARY_DIR}/lib/volk_gnsssdr.c)
|
||||
gen_template(${CMAKE_SOURCE_DIR}/tmpl/volk_gnsssdr_typedefs.tmpl.h ${CMAKE_BINARY_DIR}/include/volk_gnsssdr/volk_gnsssdr_typedefs.h)
|
||||
gen_template(${CMAKE_SOURCE_DIR}/tmpl/volk_gnsssdr_cpu.tmpl.h ${CMAKE_BINARY_DIR}/include/volk_gnsssdr/volk_gnsssdr_cpu.h)
|
||||
gen_template(${CMAKE_SOURCE_DIR}/tmpl/volk_gnsssdr_cpu.tmpl.c ${CMAKE_BINARY_DIR}/lib/volk_gnsssdr_cpu.c)
|
||||
gen_template(${CMAKE_SOURCE_DIR}/tmpl/volk_gnsssdr_config_fixed.tmpl.h ${CMAKE_BINARY_DIR}/include/volk_gnsssdr/volk_gnsssdr_config_fixed.h)
|
||||
gen_template(${CMAKE_SOURCE_DIR}/tmpl/volk_gnsssdr_machines.tmpl.h ${CMAKE_BINARY_DIR}/lib/volk_gnsssdr_machines.h)
|
||||
gen_template(${CMAKE_SOURCE_DIR}/tmpl/volk_gnsssdr_machines.tmpl.c ${CMAKE_BINARY_DIR}/lib/volk_gnsssdr_machines.c)
|
||||
gen_template(${PROJECT_SOURCE_DIR}/tmpl/volk_gnsssdr.tmpl.h ${PROJECT_BINARY_DIR}/include/volk_gnsssdr/volk_gnsssdr.h)
|
||||
gen_template(${PROJECT_SOURCE_DIR}/tmpl/volk_gnsssdr.tmpl.c ${PROJECT_BINARY_DIR}/lib/volk_gnsssdr.c)
|
||||
gen_template(${PROJECT_SOURCE_DIR}/tmpl/volk_gnsssdr_typedefs.tmpl.h ${PROJECT_BINARY_DIR}/include/volk_gnsssdr/volk_gnsssdr_typedefs.h)
|
||||
gen_template(${PROJECT_SOURCE_DIR}/tmpl/volk_gnsssdr_cpu.tmpl.h ${PROJECT_BINARY_DIR}/include/volk_gnsssdr/volk_gnsssdr_cpu.h)
|
||||
gen_template(${PROJECT_SOURCE_DIR}/tmpl/volk_gnsssdr_cpu.tmpl.c ${PROJECT_BINARY_DIR}/lib/volk_gnsssdr_cpu.c)
|
||||
gen_template(${PROJECT_SOURCE_DIR}/tmpl/volk_gnsssdr_config_fixed.tmpl.h ${PROJECT_BINARY_DIR}/include/volk_gnsssdr/volk_gnsssdr_config_fixed.h)
|
||||
gen_template(${PROJECT_SOURCE_DIR}/tmpl/volk_gnsssdr_machines.tmpl.h ${PROJECT_BINARY_DIR}/lib/volk_gnsssdr_machines.h)
|
||||
gen_template(${PROJECT_SOURCE_DIR}/tmpl/volk_gnsssdr_machines.tmpl.c ${PROJECT_BINARY_DIR}/lib/volk_gnsssdr_machines.c)
|
||||
|
||||
set(BASE_CFLAGS NONE)
|
||||
string(TOUPPER ${CMAKE_BUILD_TYPE} CBTU)
|
||||
@ -367,12 +367,12 @@ set(COMPILER_INFO "${CMAKE_C_COMPILER}:::${CMAKE_C_FLAGS_${GRCBTU}} ${CMAKE_C_FL
|
||||
foreach(machine_name ${available_machines})
|
||||
#generate machine source
|
||||
set(machine_source ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_machine_${machine_name}.c)
|
||||
gen_template(${CMAKE_SOURCE_DIR}/tmpl/volk_gnsssdr_machine_xxx.tmpl.c ${machine_source} ${machine_name})
|
||||
gen_template(${PROJECT_SOURCE_DIR}/tmpl/volk_gnsssdr_machine_xxx.tmpl.c ${machine_source} ${machine_name})
|
||||
|
||||
#determine machine flags
|
||||
execute_process(
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
|
||||
${CMAKE_SOURCE_DIR}/gen/volk_gnsssdr_compile_utils.py
|
||||
${PROJECT_SOURCE_DIR}/gen/volk_gnsssdr_compile_utils.py
|
||||
--mode "machine_flags" --machine "${machine_name}" --compiler "${COMPILER_NAME}"
|
||||
OUTPUT_VARIABLE ${machine_name}_flags OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
@ -398,9 +398,9 @@ string(REPLACE "\n" " \\n" COMPILER_INFO ${COMPILER_INFO})
|
||||
# Set local include directories first
|
||||
########################################################################
|
||||
include_directories(
|
||||
${CMAKE_BINARY_DIR}/include
|
||||
${CMAKE_SOURCE_DIR}/include
|
||||
${CMAKE_SOURCE_DIR}/kernels
|
||||
${PROJECT_BINARY_DIR}/include
|
||||
${PROJECT_SOURCE_DIR}/include
|
||||
${PROJECT_SOURCE_DIR}/kernels
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
@ -425,8 +425,8 @@ if(${CMAKE_VERSION} VERSION_GREATER "2.8.9")
|
||||
# setup architecture specific assembler flags
|
||||
set(ARCH_ASM_FLAGS "-mfpu=neon -g")
|
||||
# then add the files
|
||||
include_directories(${CMAKE_SOURCE_DIR}/kernels/volk_gnsssdr/asm/neon)
|
||||
file(GLOB asm_files ${CMAKE_SOURCE_DIR}/kernels/volk_gnsssdr/asm/neon/*.s)
|
||||
include_directories(${PROJECT_SOURCE_DIR}/kernels/volk_gnsssdr/asm/neon)
|
||||
file(GLOB asm_files ${PROJECT_SOURCE_DIR}/kernels/volk_gnsssdr/asm/neon/*.s)
|
||||
foreach(asm_file ${asm_files})
|
||||
list(APPEND volk_gnsssdr_sources ${asm_file})
|
||||
message(STATUS "Adding source file: ${asm_file}")
|
||||
@ -458,7 +458,7 @@ if(ORC_FOUND)
|
||||
list(APPEND volk_gnsssdr_libraries ${ORC_LIBRARIES})
|
||||
|
||||
#setup orc functions
|
||||
file(GLOB orc_files ${CMAKE_SOURCE_DIR}/kernels/volk_gnsssdr/asm/orc/*.orc)
|
||||
file(GLOB orc_files ${PROJECT_SOURCE_DIR}/kernels/volk_gnsssdr/asm/orc/*.orc)
|
||||
foreach(orc_file ${orc_files})
|
||||
|
||||
#extract the name for the generated c source from the orc file
|
||||
@ -516,7 +516,7 @@ PROPERTIES COMPILE_DEFINITIONS "${machine_defs}")
|
||||
|
||||
if(MSVC)
|
||||
#add compatibility includes for stdint types
|
||||
include_directories(${CMAKE_SOURCE_DIR}/cmake/msvc)
|
||||
include_directories(${PROJECT_SOURCE_DIR}/cmake/msvc)
|
||||
add_definitions(-DHAVE_CONFIG_H)
|
||||
#compile the sources as C++ due to the lack of complex.h under MSVC
|
||||
set_source_files_properties(${volk_gnsssdr_sources} PROPERTIES LANGUAGE CXX)
|
||||
@ -528,7 +528,7 @@ if(CMAKE_VERSION VERSION_GREATER "2.8.7")
|
||||
add_library(volk_gnsssdr_obj OBJECT ${volk_gnsssdr_sources})
|
||||
|
||||
#Add dynamic library
|
||||
file(GLOB orc ${CMAKE_SOURCE_DIR}/kernels/volk_gnsssdr/asm/orc/*.orc)
|
||||
file(GLOB orc ${PROJECT_SOURCE_DIR}/kernels/volk_gnsssdr/asm/orc/*.orc)
|
||||
|
||||
if(ENABLE_STATIC_LIBS)
|
||||
add_library(volk_gnsssdr STATIC $<TARGET_OBJECTS:volk_gnsssdr_obj> ${orc})
|
||||
|
@ -128,21 +128,33 @@ galileo_e1_dll_pll_veml_tracking_cc::galileo_e1_dll_pll_veml_tracking_cc(
|
||||
|
||||
// Initialization of local code replica
|
||||
// Get space for a vector with the sinboc(1,1) replica sampled 2x/chip
|
||||
d_ca_code = static_cast<gr_complex*>(volk_malloc((2 * Galileo_E1_B_CODE_LENGTH_CHIPS + 4) * sizeof(gr_complex), volk_get_alignment()));
|
||||
|
||||
d_very_early_code = static_cast<gr_complex*>(volk_malloc(2 * d_vector_length * sizeof(gr_complex), volk_get_alignment()));
|
||||
d_early_code = static_cast<gr_complex*>(volk_malloc(2 * d_vector_length * sizeof(gr_complex), volk_get_alignment()));
|
||||
d_prompt_code = static_cast<gr_complex*>(volk_malloc(2 * d_vector_length * sizeof(gr_complex), volk_get_alignment()));
|
||||
d_late_code = static_cast<gr_complex*>(volk_malloc(2 * d_vector_length * sizeof(gr_complex), volk_get_alignment()));
|
||||
d_very_late_code = static_cast<gr_complex*>(volk_malloc(2 * d_vector_length * sizeof(gr_complex), volk_get_alignment()));
|
||||
d_carr_sign = static_cast<gr_complex*>(volk_malloc(2*d_vector_length * sizeof(gr_complex), volk_get_alignment()));
|
||||
d_ca_code = static_cast<gr_complex*>(volk_malloc((2*Galileo_E1_B_CODE_LENGTH_CHIPS) * sizeof(gr_complex), volk_get_alignment()));
|
||||
|
||||
// correlator outputs (scalar)
|
||||
d_Very_Early = static_cast<gr_complex*>(volk_malloc(sizeof(gr_complex), volk_get_alignment()));
|
||||
d_Early = static_cast<gr_complex*>(volk_malloc(sizeof(gr_complex), volk_get_alignment()));
|
||||
d_Prompt = static_cast<gr_complex*>(volk_malloc(sizeof(gr_complex), volk_get_alignment()));
|
||||
d_Late = static_cast<gr_complex*>(volk_malloc(sizeof(gr_complex), volk_get_alignment()));
|
||||
d_Very_Late = static_cast<gr_complex*>(volk_malloc(sizeof(gr_complex), volk_get_alignment()));
|
||||
d_n_correlator_taps = 5; // Very-Early, Early, Prompt, Late, Very-Late
|
||||
d_correlator_outs = static_cast<gr_complex*>(volk_malloc(d_n_correlator_taps*sizeof(gr_complex), volk_get_alignment()));
|
||||
for (int n = 0; n < d_n_correlator_taps; n++)
|
||||
{
|
||||
d_correlator_outs[n] = gr_complex(0,0);
|
||||
}
|
||||
// map memory pointers of correlator outputs
|
||||
d_Very_Early=&d_correlator_outs[0];
|
||||
d_Early=&d_correlator_outs[1];
|
||||
d_Prompt=&d_correlator_outs[2];
|
||||
d_Late=&d_correlator_outs[3];
|
||||
d_Very_Late=&d_correlator_outs[4];
|
||||
|
||||
d_local_code_shift_chips = static_cast<float*>(volk_malloc(d_n_correlator_taps*sizeof(float), volk_get_alignment()));
|
||||
// Set TAPs delay values [chips]
|
||||
d_local_code_shift_chips[0] = - d_very_early_late_spc_chips*2.0;
|
||||
d_local_code_shift_chips[1] = - d_very_early_late_spc_chips;
|
||||
d_local_code_shift_chips[2] = 0.0;
|
||||
d_local_code_shift_chips[3] = d_very_early_late_spc_chips;
|
||||
d_local_code_shift_chips[4] = d_very_early_late_spc_chips*2.0;
|
||||
|
||||
d_correlation_length_samples=d_vector_length;
|
||||
|
||||
multicorrelator_cpu.init(2 * d_correlation_length_samples, d_n_correlator_taps);
|
||||
|
||||
//--- Initializations ------------------------------
|
||||
// Initial code frequency basis of NCO
|
||||
@ -198,18 +210,19 @@ void galileo_e1_dll_pll_veml_tracking_cc::start_tracking()
|
||||
d_carrier_loop_filter.initialize(); // initialize the carrier filter
|
||||
d_code_loop_filter.initialize(); // initialize the code filter
|
||||
|
||||
// generate local reference ALWAYS starting at chip 2 (2 samples per chip)
|
||||
galileo_e1_code_gen_complex_sampled(&d_ca_code[2],
|
||||
// generate local reference ALWAYS starting at chip 1 (2 samples per chip)
|
||||
galileo_e1_code_gen_complex_sampled(d_ca_code,
|
||||
d_acquisition_gnss_synchro->Signal,
|
||||
false,
|
||||
d_acquisition_gnss_synchro->PRN,
|
||||
2 * Galileo_E1_CODE_CHIP_RATE_HZ,
|
||||
0);
|
||||
// Fill head and tail
|
||||
d_ca_code[0] = d_ca_code[static_cast<int>(2 * Galileo_E1_B_CODE_LENGTH_CHIPS)];
|
||||
d_ca_code[1] = d_ca_code[static_cast<int>(2 * Galileo_E1_B_CODE_LENGTH_CHIPS + 1)];
|
||||
d_ca_code[static_cast<int>(2 * Galileo_E1_B_CODE_LENGTH_CHIPS + 2)] = d_ca_code[2];
|
||||
d_ca_code[static_cast<int>(2 * Galileo_E1_B_CODE_LENGTH_CHIPS + 3)] = d_ca_code[3];
|
||||
|
||||
multicorrelator_cpu.set_local_code_and_taps(static_cast<int>(2*Galileo_E1_B_CODE_LENGTH_CHIPS), d_ca_code, d_local_code_shift_chips);
|
||||
for (int n = 0; n < d_n_correlator_taps; n++)
|
||||
{
|
||||
d_correlator_outs[n] = gr_complex(0,0);
|
||||
}
|
||||
|
||||
d_carrier_lock_fail_counter = 0;
|
||||
d_rem_code_phase_samples = 0.0;
|
||||
@ -235,77 +248,16 @@ void galileo_e1_dll_pll_veml_tracking_cc::start_tracking()
|
||||
<< " PULL-IN Code Phase [samples]=" << d_acq_code_phase_samples;
|
||||
}
|
||||
|
||||
|
||||
void galileo_e1_dll_pll_veml_tracking_cc::update_local_code()
|
||||
{
|
||||
double tcode_half_chips;
|
||||
double rem_code_phase_half_chips;
|
||||
int associated_chip_index;
|
||||
int code_length_half_chips = static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS) * 2;
|
||||
double code_phase_step_chips;
|
||||
double code_phase_step_half_chips;
|
||||
int early_late_spc_samples;
|
||||
int very_early_late_spc_samples;
|
||||
int epl_loop_length_samples;
|
||||
|
||||
// unified loop for VE, E, P, L, VL code vectors
|
||||
code_phase_step_chips = d_code_freq_chips / (static_cast<double>(d_fs_in));
|
||||
code_phase_step_half_chips = (2.0 * d_code_freq_chips) / (static_cast<double>(d_fs_in));
|
||||
|
||||
rem_code_phase_half_chips = d_rem_code_phase_samples * (2*d_code_freq_chips / d_fs_in);
|
||||
tcode_half_chips = - rem_code_phase_half_chips;
|
||||
|
||||
early_late_spc_samples = std::round(d_early_late_spc_chips / code_phase_step_chips);
|
||||
very_early_late_spc_samples = std::round(d_very_early_late_spc_chips / code_phase_step_chips);
|
||||
|
||||
epl_loop_length_samples = d_current_prn_length_samples + very_early_late_spc_samples * 2;
|
||||
|
||||
for (int i = 0; i < epl_loop_length_samples; i++)
|
||||
{
|
||||
associated_chip_index = 2 + std::round(std::fmod(tcode_half_chips - 2 * d_very_early_late_spc_chips, code_length_half_chips));
|
||||
d_very_early_code[i] = d_ca_code[associated_chip_index];
|
||||
tcode_half_chips = tcode_half_chips + code_phase_step_half_chips;
|
||||
}
|
||||
memcpy(d_early_code, &d_very_early_code[very_early_late_spc_samples - early_late_spc_samples], d_current_prn_length_samples * sizeof(gr_complex));
|
||||
memcpy(d_prompt_code, &d_very_early_code[very_early_late_spc_samples], d_current_prn_length_samples * sizeof(gr_complex));
|
||||
memcpy(d_late_code, &d_very_early_code[very_early_late_spc_samples + early_late_spc_samples], d_current_prn_length_samples * sizeof(gr_complex));
|
||||
memcpy(d_very_late_code, &d_very_early_code[2 * very_early_late_spc_samples], d_current_prn_length_samples * sizeof(gr_complex));
|
||||
}
|
||||
|
||||
|
||||
void galileo_e1_dll_pll_veml_tracking_cc::update_local_carrier()
|
||||
{
|
||||
float sin_f, cos_f;
|
||||
float phase_step_rad = static_cast<float>(2 * GALILEO_PI) * d_carrier_doppler_hz / static_cast<float>(d_fs_in);
|
||||
int phase_step_rad_i = gr::fxpt::float_to_fixed(phase_step_rad);
|
||||
int phase_rad_i = gr::fxpt::float_to_fixed(d_rem_carr_phase_rad);
|
||||
|
||||
for(int i = 0; i < d_current_prn_length_samples; i++)
|
||||
{
|
||||
gr::fxpt::sincos(phase_rad_i, &sin_f, &cos_f);
|
||||
d_carr_sign[i] = std::complex<float>(cos_f, -sin_f);
|
||||
phase_rad_i += phase_step_rad_i;
|
||||
}
|
||||
}
|
||||
|
||||
galileo_e1_dll_pll_veml_tracking_cc::~galileo_e1_dll_pll_veml_tracking_cc()
|
||||
{
|
||||
d_dump_file.close();
|
||||
|
||||
volk_free(d_very_early_code);
|
||||
volk_free(d_early_code);
|
||||
volk_free(d_prompt_code);
|
||||
volk_free(d_late_code);
|
||||
volk_free(d_very_late_code);
|
||||
volk_free(d_carr_sign);
|
||||
volk_free(d_Very_Early);
|
||||
volk_free(d_Early);
|
||||
volk_free(d_Prompt);
|
||||
volk_free(d_Late);
|
||||
volk_free(d_Very_Late);
|
||||
volk_free(d_local_code_shift_chips);
|
||||
volk_free(d_correlator_outs);
|
||||
volk_free(d_ca_code);
|
||||
|
||||
delete[] d_Prompt_buffer;
|
||||
multicorrelator_cpu.free();
|
||||
}
|
||||
|
||||
|
||||
@ -346,24 +298,19 @@ int galileo_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items, gr_vec
|
||||
const gr_complex* in = (gr_complex*) input_items[0];
|
||||
Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0];
|
||||
|
||||
// Generate local code and carrier replicas (using \hat{f}_d(k-1))
|
||||
update_local_code();
|
||||
update_local_carrier();
|
||||
// ################# CARRIER WIPEOFF AND CORRELATORS ##############################
|
||||
// perform carrier wipe-off and compute Early, Prompt and Late correlation
|
||||
multicorrelator_cpu.set_input_output_vectors(d_correlator_outs,in);
|
||||
|
||||
// perform carrier wipe-off and compute Very Early, Early, Prompt, Late and Very Late correlation
|
||||
d_correlator.Carrier_wipeoff_and_VEPL_volk(d_current_prn_length_samples,
|
||||
in,
|
||||
d_carr_sign,
|
||||
d_very_early_code,
|
||||
d_early_code,
|
||||
d_prompt_code,
|
||||
d_late_code,
|
||||
d_very_late_code,
|
||||
d_Very_Early,
|
||||
d_Early,
|
||||
d_Prompt,
|
||||
d_Late,
|
||||
d_Very_Late);
|
||||
double carr_phase_step_rad = GALILEO_TWO_PI * d_carrier_doppler_hz / static_cast<double>(d_fs_in);
|
||||
double code_phase_step_half_chips = (2.0 * d_code_freq_chips) / (static_cast<double>(d_fs_in));
|
||||
double rem_code_phase_half_chips = d_rem_code_phase_samples * (2.0*d_code_freq_chips / d_fs_in);
|
||||
multicorrelator_cpu.Carrier_wipeoff_multicorrelator_resampler(
|
||||
d_rem_carr_phase_rad,
|
||||
carr_phase_step_rad,
|
||||
rem_code_phase_half_chips,
|
||||
code_phase_step_half_chips,
|
||||
d_correlation_length_samples);
|
||||
|
||||
// ################## PLL ##########################################################
|
||||
// PLL discriminator
|
||||
|
@ -41,7 +41,7 @@
|
||||
#include "gnss_synchro.h"
|
||||
#include "tracking_2nd_DLL_filter.h"
|
||||
#include "tracking_2nd_PLL_filter.h"
|
||||
#include "correlator.h"
|
||||
#include "cpu_multicorrelator.h"
|
||||
|
||||
class galileo_e1_dll_pll_veml_tracking_cc;
|
||||
|
||||
@ -123,17 +123,16 @@ private:
|
||||
long d_if_freq;
|
||||
long d_fs_in;
|
||||
|
||||
//Integration period in samples
|
||||
int d_correlation_length_samples;
|
||||
int d_n_correlator_taps;
|
||||
double d_early_late_spc_chips;
|
||||
double d_very_early_late_spc_chips;
|
||||
|
||||
gr_complex* d_ca_code;
|
||||
|
||||
gr_complex* d_very_early_code;
|
||||
gr_complex* d_early_code;
|
||||
gr_complex* d_prompt_code;
|
||||
gr_complex* d_late_code;
|
||||
gr_complex* d_very_late_code;
|
||||
gr_complex* d_carr_sign;
|
||||
float* d_local_code_shift_chips;
|
||||
gr_complex* d_correlator_outs;
|
||||
cpu_multicorrelator multicorrelator_cpu;
|
||||
|
||||
gr_complex *d_Very_Early;
|
||||
gr_complex *d_Early;
|
||||
@ -153,9 +152,6 @@ private:
|
||||
double d_acq_code_phase_samples;
|
||||
double d_acq_carrier_doppler_hz;
|
||||
|
||||
// correlator
|
||||
Correlator d_correlator;
|
||||
|
||||
// tracking vars
|
||||
double d_code_freq_chips;
|
||||
double d_carrier_doppler_hz;
|
||||
|
Loading…
x
Reference in New Issue
Block a user