mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-26 08:56:58 +00:00
working on tests
This commit is contained in:
parent
ff0f3aeb36
commit
8f407f9bf1
@ -294,6 +294,16 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::reset()
|
||||
}
|
||||
}
|
||||
|
||||
void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_state(int state)
|
||||
{
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
acquisition_cc_->set_state(state);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
float GalileoE1PcpsQuickSyncAmbiguousAcquisition::calculate_threshold(float pfa)
|
||||
{
|
||||
unsigned int frequency_bins = 0;
|
||||
|
@ -129,6 +129,8 @@ public:
|
||||
*/
|
||||
void reset();
|
||||
|
||||
void set_state(int state);
|
||||
|
||||
private:
|
||||
ConfigurationInterface* configuration_;
|
||||
pcps_quicksync_acquisition_cc_sptr acquisition_cc_;
|
||||
|
@ -60,6 +60,7 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition(
|
||||
|
||||
item_type_ = configuration_->property(role + ".item_type",
|
||||
default_item_type);
|
||||
//float pfa = configuration_->property(role + ".pfa", 0.0);
|
||||
|
||||
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
if_ = configuration_->property(role + ".ifreq", 0);
|
||||
@ -129,27 +130,27 @@ void GpsL1CaPcpsAcquisition::set_channel(unsigned int channel)
|
||||
|
||||
void GpsL1CaPcpsAcquisition::set_threshold(float threshold)
|
||||
{
|
||||
float pfa = configuration_->property(role_ + boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0);
|
||||
float pfa = configuration_->property(role_ + boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0);
|
||||
|
||||
if(pfa == 0.0)
|
||||
if(pfa == 0.0)
|
||||
{
|
||||
pfa = configuration_->property(role_+".pfa", 0.0);
|
||||
pfa = configuration_->property(role_+".pfa", 0.0);
|
||||
}
|
||||
if(pfa == 0.0)
|
||||
{
|
||||
threshold_ = threshold;
|
||||
}
|
||||
else
|
||||
{
|
||||
threshold_ = calculate_threshold(pfa);
|
||||
}
|
||||
if(pfa == 0.0)
|
||||
{
|
||||
threshold_ = threshold;
|
||||
}
|
||||
else
|
||||
{
|
||||
threshold_ = calculate_threshold(pfa);
|
||||
}
|
||||
|
||||
DLOG(INFO) <<"Channel "<<channel_<<" Threshold = " << threshold_;
|
||||
DLOG(INFO) <<"Channel "<<channel_<<" Threshold = " << threshold_;
|
||||
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
acquisition_cc_->set_threshold(threshold_);
|
||||
}
|
||||
{
|
||||
acquisition_cc_->set_threshold(threshold_);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -244,6 +245,15 @@ void GpsL1CaPcpsAcquisition::reset()
|
||||
}
|
||||
}
|
||||
|
||||
void GpsL1CaPcpsAcquisition::set_state(int state)
|
||||
{
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
acquisition_cc_->set_state(state);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
float GpsL1CaPcpsAcquisition::calculate_threshold(float pfa)
|
||||
{
|
||||
|
@ -134,6 +134,8 @@ public:
|
||||
*/
|
||||
void reset();
|
||||
|
||||
void set_state(int state);
|
||||
|
||||
private:
|
||||
ConfigurationInterface* configuration_;
|
||||
pcps_acquisition_cc_sptr acquisition_cc_;
|
||||
|
@ -276,6 +276,14 @@ void GpsL1CaPcpsQuickSyncAcquisition::reset()
|
||||
}
|
||||
}
|
||||
|
||||
void GpsL1CaPcpsQuickSyncAcquisition::set_state(int state)
|
||||
{
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
acquisition_cc_->set_state(state);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
float GpsL1CaPcpsQuickSyncAcquisition::calculate_threshold(float pfa)
|
||||
{
|
||||
|
@ -132,7 +132,7 @@ public:
|
||||
*/
|
||||
void reset();
|
||||
|
||||
|
||||
void set_state(int state);
|
||||
private:
|
||||
ConfigurationInterface* configuration_;
|
||||
pcps_quicksync_acquisition_cc_sptr acquisition_cc_;
|
||||
|
@ -229,6 +229,14 @@ void GpsL1CaPcpsTongAcquisition::reset()
|
||||
}
|
||||
}
|
||||
|
||||
void GpsL1CaPcpsTongAcquisition::set_state(int state)
|
||||
{
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
acquisition_cc_->set_state(state);
|
||||
}
|
||||
}
|
||||
|
||||
float GpsL1CaPcpsTongAcquisition::calculate_threshold(float pfa)
|
||||
{
|
||||
//Calculate the threshold
|
||||
|
@ -131,6 +131,8 @@ public:
|
||||
|
||||
void reset();
|
||||
|
||||
void set_state(int state);
|
||||
|
||||
private:
|
||||
ConfigurationInterface* configuration_;
|
||||
pcps_tong_acquisition_cc_sptr acquisition_cc_;
|
||||
|
@ -281,6 +281,29 @@ void galileo_e5a_noncoherentIQ_acquisition_caf_cc::init()
|
||||
}
|
||||
|
||||
|
||||
|
||||
void galileo_e5a_noncoherentIQ_acquisition_caf_cc::set_state(int state)
|
||||
{
|
||||
d_state = state;
|
||||
if (d_state == 1)
|
||||
{
|
||||
d_gnss_synchro->Acq_delay_samples = 0.0;
|
||||
d_gnss_synchro->Acq_doppler_hz = 0.0;
|
||||
d_gnss_synchro->Acq_samplestamp_samples = 0;
|
||||
d_well_count = 0;
|
||||
d_mag = 0.0;
|
||||
d_input_power = 0.0;
|
||||
d_test_statistics = 0.0;
|
||||
}
|
||||
else if (d_state == 0)
|
||||
{}
|
||||
else
|
||||
{
|
||||
LOG(ERROR) << "State can only be set to 0 or 1";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items,
|
||||
gr_vector_int &ninput_items, gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items)
|
||||
|
@ -203,6 +203,13 @@ public:
|
||||
d_active = active;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief If set to 1, ensures that acquisition starts at the
|
||||
* first available sample.
|
||||
* \param state - int=1 forces start of acquisition
|
||||
*/
|
||||
void set_state(int state);
|
||||
|
||||
/*!
|
||||
* \brief Set acquisition channel unique ID
|
||||
* \param channel - receiver channel.
|
||||
|
@ -166,6 +166,30 @@ void galileo_pcps_8ms_acquisition_cc::init()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void galileo_pcps_8ms_acquisition_cc::set_state(int state)
|
||||
{
|
||||
d_state = state;
|
||||
if (d_state == 1)
|
||||
{
|
||||
d_gnss_synchro->Acq_delay_samples = 0.0;
|
||||
d_gnss_synchro->Acq_doppler_hz = 0.0;
|
||||
d_gnss_synchro->Acq_samplestamp_samples = 0;
|
||||
d_well_count = 0;
|
||||
d_mag = 0.0;
|
||||
d_input_power = 0.0;
|
||||
d_test_statistics = 0.0;
|
||||
}
|
||||
else if (d_state == 0)
|
||||
{}
|
||||
else
|
||||
{
|
||||
LOG(ERROR) << "State can only be set to 0 or 1";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
int galileo_pcps_8ms_acquisition_cc::general_work(int noutput_items,
|
||||
gr_vector_int &ninput_items, gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items)
|
||||
|
@ -161,6 +161,13 @@ public:
|
||||
d_active = active;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief If set to 1, ensures that acquisition starts at the
|
||||
* first available sample.
|
||||
* \param state - int=1 forces start of acquisition
|
||||
*/
|
||||
void set_state(int state);
|
||||
|
||||
/*!
|
||||
* \brief Set acquisition channel unique ID
|
||||
* \param channel - receiver channel.
|
||||
|
@ -158,6 +158,29 @@ void pcps_acquisition_cc::init()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void pcps_acquisition_cc::set_state(int state)
|
||||
{
|
||||
d_state = state;
|
||||
if (d_state == 1)
|
||||
{
|
||||
d_gnss_synchro->Acq_delay_samples = 0.0;
|
||||
d_gnss_synchro->Acq_doppler_hz = 0.0;
|
||||
d_gnss_synchro->Acq_samplestamp_samples = 0;
|
||||
d_well_count = 0;
|
||||
d_mag = 0.0;
|
||||
d_input_power = 0.0;
|
||||
d_test_statistics = 0.0;
|
||||
}
|
||||
else if (d_state == 0)
|
||||
{}
|
||||
else
|
||||
{
|
||||
LOG(ERROR) << "State can only be set to 0 or 1";
|
||||
}
|
||||
}
|
||||
|
||||
int pcps_acquisition_cc::general_work(int noutput_items,
|
||||
gr_vector_int &ninput_items, gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items)
|
||||
|
@ -182,6 +182,13 @@ public:
|
||||
d_active = active;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief If set to 1, ensures that acquisition starts at the
|
||||
* first available sample.
|
||||
* \param state - int=1 forces start of acquisition
|
||||
*/
|
||||
void set_state(int state);
|
||||
|
||||
/*!
|
||||
* \brief Set acquisition channel unique ID
|
||||
* \param channel - receiver channel.
|
||||
|
@ -45,8 +45,8 @@
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef GNSS_SDR_PCPS_acquisition_fine_doppler_cc_H_
|
||||
#define GNSS_SDR_PCPS_acquisition_fine_doppler_cc_H_
|
||||
#ifndef GNSS_SDR_PCPS_ACQUISITION_FINE_DOPPLER_CC_H_
|
||||
#define GNSS_SDR_PCPS_ACQUISITION_FINE_DOPPLER_CC_H_
|
||||
|
||||
#include <fstream>
|
||||
#include <queue>
|
||||
@ -61,8 +61,10 @@
|
||||
#include "gnss_synchro.h"
|
||||
|
||||
class pcps_acquisition_fine_doppler_cc;
|
||||
|
||||
typedef boost::shared_ptr<pcps_acquisition_fine_doppler_cc>
|
||||
pcps_acquisition_fine_doppler_cc_sptr;
|
||||
|
||||
pcps_acquisition_fine_doppler_cc_sptr
|
||||
pcps_make_acquisition_fine_doppler_cc(int max_dwells, unsigned int sampled_ms,
|
||||
int doppler_max, int doppler_min, long freq, long fs_in, int samples_per_ms,
|
||||
@ -78,166 +80,166 @@ pcps_make_acquisition_fine_doppler_cc(int max_dwells, unsigned int sampled_ms,
|
||||
class pcps_acquisition_fine_doppler_cc: public gr::block
|
||||
{
|
||||
private:
|
||||
friend pcps_acquisition_fine_doppler_cc_sptr
|
||||
pcps_make_acquisition_fine_doppler_cc(int max_dwells, unsigned int sampled_ms,
|
||||
int doppler_max, int doppler_min, long freq, long fs_in,
|
||||
int samples_per_ms, boost::shared_ptr<gr::msg_queue> queue, bool dump,
|
||||
std::string dump_filename);
|
||||
friend pcps_acquisition_fine_doppler_cc_sptr
|
||||
pcps_make_acquisition_fine_doppler_cc(int max_dwells, unsigned int sampled_ms,
|
||||
int doppler_max, int doppler_min, long freq, long fs_in,
|
||||
int samples_per_ms, boost::shared_ptr<gr::msg_queue> queue, bool dump,
|
||||
std::string dump_filename);
|
||||
|
||||
pcps_acquisition_fine_doppler_cc(int max_dwells, unsigned int sampled_ms,
|
||||
int doppler_max, int doppler_min, long freq, long fs_in,
|
||||
int samples_per_ms, boost::shared_ptr<gr::msg_queue> queue, bool dump,
|
||||
std::string dump_filename);
|
||||
pcps_acquisition_fine_doppler_cc(int max_dwells, unsigned int sampled_ms,
|
||||
int doppler_max, int doppler_min, long freq, long fs_in,
|
||||
int samples_per_ms, boost::shared_ptr<gr::msg_queue> queue, bool dump,
|
||||
std::string dump_filename);
|
||||
|
||||
void calculate_magnitudes(gr_complex* fft_begin, int doppler_shift,
|
||||
int doppler_offset);
|
||||
void calculate_magnitudes(gr_complex* fft_begin, int doppler_shift,
|
||||
int doppler_offset);
|
||||
|
||||
int compute_and_accumulate_grid(gr_vector_const_void_star &input_items);
|
||||
int estimate_Doppler(gr_vector_const_void_star &input_items, int available_samples);
|
||||
float estimate_input_power(gr_vector_const_void_star &input_items);
|
||||
double search_maximum();
|
||||
void reset_grid();
|
||||
void update_carrier_wipeoff();
|
||||
void free_grid_memory();
|
||||
int compute_and_accumulate_grid(gr_vector_const_void_star &input_items);
|
||||
int estimate_Doppler(gr_vector_const_void_star &input_items, int available_samples);
|
||||
float estimate_input_power(gr_vector_const_void_star &input_items);
|
||||
double search_maximum();
|
||||
void reset_grid();
|
||||
void update_carrier_wipeoff();
|
||||
void free_grid_memory();
|
||||
|
||||
long d_fs_in;
|
||||
long d_freq;
|
||||
int d_samples_per_ms;
|
||||
int d_max_dwells;
|
||||
unsigned int d_doppler_resolution;
|
||||
int d_gnuradio_forecast_samples;
|
||||
float d_threshold;
|
||||
std::string d_satellite_str;
|
||||
int d_config_doppler_max;
|
||||
int d_config_doppler_min;
|
||||
long d_fs_in;
|
||||
long d_freq;
|
||||
int d_samples_per_ms;
|
||||
int d_max_dwells;
|
||||
unsigned int d_doppler_resolution;
|
||||
int d_gnuradio_forecast_samples;
|
||||
float d_threshold;
|
||||
std::string d_satellite_str;
|
||||
int d_config_doppler_max;
|
||||
int d_config_doppler_min;
|
||||
|
||||
int d_num_doppler_points;
|
||||
int d_num_doppler_points;
|
||||
int d_doppler_step;
|
||||
unsigned int d_sampled_ms;
|
||||
unsigned int d_fft_size;
|
||||
unsigned long int d_sample_counter;
|
||||
gr_complex* d_carrier;
|
||||
gr_complex* d_fft_codes;
|
||||
float* d_magnitude;
|
||||
unsigned int d_sampled_ms;
|
||||
unsigned int d_fft_size;
|
||||
unsigned long int d_sample_counter;
|
||||
gr_complex* d_carrier;
|
||||
gr_complex* d_fft_codes;
|
||||
float* d_magnitude;
|
||||
|
||||
float** d_grid_data;
|
||||
gr_complex** d_grid_doppler_wipeoffs;
|
||||
float** d_grid_data;
|
||||
gr_complex** d_grid_doppler_wipeoffs;
|
||||
|
||||
gr::fft::fft_complex* d_fft_if;
|
||||
gr::fft::fft_complex* d_ifft;
|
||||
Gnss_Synchro *d_gnss_synchro;
|
||||
unsigned int d_code_phase;
|
||||
float d_doppler_freq;
|
||||
float d_input_power;
|
||||
float d_test_statistics;
|
||||
boost::shared_ptr<gr::msg_queue> d_queue;
|
||||
concurrent_queue<int> *d_channel_internal_queue;
|
||||
std::ofstream d_dump_file;
|
||||
int d_state;
|
||||
bool d_active;
|
||||
int d_well_count;
|
||||
bool d_dump;
|
||||
unsigned int d_channel;
|
||||
gr::fft::fft_complex* d_fft_if;
|
||||
gr::fft::fft_complex* d_ifft;
|
||||
Gnss_Synchro *d_gnss_synchro;
|
||||
unsigned int d_code_phase;
|
||||
float d_doppler_freq;
|
||||
float d_input_power;
|
||||
float d_test_statistics;
|
||||
boost::shared_ptr<gr::msg_queue> d_queue;
|
||||
concurrent_queue<int> *d_channel_internal_queue;
|
||||
std::ofstream d_dump_file;
|
||||
int d_state;
|
||||
bool d_active;
|
||||
int d_well_count;
|
||||
bool d_dump;
|
||||
unsigned int d_channel;
|
||||
|
||||
std::string d_dump_filename;
|
||||
std::string d_dump_filename;
|
||||
|
||||
public:
|
||||
/*!
|
||||
* \brief Default destructor.
|
||||
*/
|
||||
~pcps_acquisition_fine_doppler_cc();
|
||||
/*!
|
||||
* \brief Default destructor.
|
||||
*/
|
||||
~pcps_acquisition_fine_doppler_cc();
|
||||
|
||||
/*!
|
||||
* \brief Set acquisition/tracking common Gnss_Synchro object pointer
|
||||
* to exchange synchronization data between acquisition and tracking blocks.
|
||||
* \param p_gnss_synchro Satellite information shared by the processing blocks.
|
||||
*/
|
||||
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
|
||||
{
|
||||
d_gnss_synchro = p_gnss_synchro;
|
||||
}
|
||||
/*!
|
||||
* \brief Set acquisition/tracking common Gnss_Synchro object pointer
|
||||
* to exchange synchronization data between acquisition and tracking blocks.
|
||||
* \param p_gnss_synchro Satellite information shared by the processing blocks.
|
||||
*/
|
||||
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
|
||||
{
|
||||
d_gnss_synchro = p_gnss_synchro;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Returns the maximum peak of grid search.
|
||||
*/
|
||||
unsigned int mag()
|
||||
{
|
||||
return d_test_statistics;
|
||||
}
|
||||
/*!
|
||||
* \brief Returns the maximum peak of grid search.
|
||||
*/
|
||||
unsigned int mag()
|
||||
{
|
||||
return d_test_statistics;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Initializes acquisition algorithm.
|
||||
*/
|
||||
void init();
|
||||
/*!
|
||||
* \brief Initializes acquisition algorithm.
|
||||
*/
|
||||
void init();
|
||||
|
||||
/*!
|
||||
* \brief Sets local code for PCPS acquisition algorithm.
|
||||
* \param code - Pointer to the PRN code.
|
||||
*/
|
||||
void set_local_code(std::complex<float> * code);
|
||||
/*!
|
||||
* \brief Sets local code for PCPS acquisition algorithm.
|
||||
* \param code - Pointer to the PRN code.
|
||||
*/
|
||||
void set_local_code(std::complex<float> * code);
|
||||
|
||||
/*!
|
||||
* \brief Starts acquisition algorithm, turning from standby mode to
|
||||
* active mode
|
||||
* \param active - bool that activates/deactivates the block.
|
||||
*/
|
||||
void set_active(bool active)
|
||||
{
|
||||
d_active = active;
|
||||
}
|
||||
/*!
|
||||
* \brief Starts acquisition algorithm, turning from standby mode to
|
||||
* active mode
|
||||
* \param active - bool that activates/deactivates the block.
|
||||
*/
|
||||
void set_active(bool active)
|
||||
{
|
||||
d_active = active;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Set acquisition channel unique ID
|
||||
* \param channel - receiver channel.
|
||||
*/
|
||||
void set_channel(unsigned int channel)
|
||||
{
|
||||
d_channel = channel;
|
||||
}
|
||||
/*!
|
||||
* \brief Set acquisition channel unique ID
|
||||
* \param channel - receiver channel.
|
||||
*/
|
||||
void set_channel(unsigned int channel)
|
||||
{
|
||||
d_channel = channel;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Set statistics threshold of PCPS algorithm.
|
||||
* \param threshold - Threshold for signal detection (check \ref Navitec2012,
|
||||
* Algorithm 1, for a definition of this threshold).
|
||||
*/
|
||||
void set_threshold(float threshold)
|
||||
{
|
||||
d_threshold = threshold;
|
||||
}
|
||||
/*!
|
||||
* \brief Set statistics threshold of PCPS algorithm.
|
||||
* \param threshold - Threshold for signal detection (check \ref Navitec2012,
|
||||
* Algorithm 1, for a definition of this threshold).
|
||||
*/
|
||||
void set_threshold(float threshold)
|
||||
{
|
||||
d_threshold = threshold;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Set maximum Doppler grid search
|
||||
* \param doppler_max - Maximum Doppler shift considered in the grid search [Hz].
|
||||
*/
|
||||
void set_doppler_max(unsigned int doppler_max)
|
||||
{
|
||||
d_config_doppler_max = doppler_max;
|
||||
}
|
||||
/*!
|
||||
* \brief Set maximum Doppler grid search
|
||||
* \param doppler_max - Maximum Doppler shift considered in the grid search [Hz].
|
||||
*/
|
||||
void set_doppler_max(unsigned int doppler_max)
|
||||
{
|
||||
d_config_doppler_max = doppler_max;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Set Doppler steps for the grid search
|
||||
* \param doppler_step - Frequency bin of the search grid [Hz].
|
||||
*/
|
||||
void set_doppler_step(unsigned int doppler_step);
|
||||
/*!
|
||||
* \brief Set Doppler steps for the grid search
|
||||
* \param doppler_step - Frequency bin of the search grid [Hz].
|
||||
*/
|
||||
void set_doppler_step(unsigned int doppler_step);
|
||||
|
||||
|
||||
/*!
|
||||
* \brief Set tracking channel internal queue.
|
||||
* \param channel_internal_queue - Channel's internal blocks information queue.
|
||||
*/
|
||||
void set_channel_queue(concurrent_queue<int> *channel_internal_queue)
|
||||
{
|
||||
d_channel_internal_queue = channel_internal_queue;
|
||||
}
|
||||
/*!
|
||||
* \brief Set tracking channel internal queue.
|
||||
* \param channel_internal_queue - Channel's internal blocks information queue.
|
||||
*/
|
||||
void set_channel_queue(concurrent_queue<int> *channel_internal_queue)
|
||||
{
|
||||
d_channel_internal_queue = channel_internal_queue;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Parallel Code Phase Search Acquisition signal processing.
|
||||
*/
|
||||
int general_work(int noutput_items, gr_vector_int &ninput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
/*!
|
||||
* \brief Parallel Code Phase Search Acquisition signal processing.
|
||||
*/
|
||||
int general_work(int noutput_items, gr_vector_int &ninput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
|
||||
void forecast (int noutput_items, gr_vector_int &ninput_items_required);
|
||||
void forecast (int noutput_items, gr_vector_int &ninput_items_required);
|
||||
|
||||
};
|
||||
|
||||
|
@ -182,6 +182,29 @@ void pcps_cccwsr_acquisition_cc::init()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void pcps_cccwsr_acquisition_cc::set_state(int state)
|
||||
{
|
||||
d_state = state;
|
||||
if (d_state == 1)
|
||||
{
|
||||
d_gnss_synchro->Acq_delay_samples = 0.0;
|
||||
d_gnss_synchro->Acq_doppler_hz = 0.0;
|
||||
d_gnss_synchro->Acq_samplestamp_samples = 0;
|
||||
d_well_count = 0;
|
||||
d_mag = 0.0;
|
||||
d_input_power = 0.0;
|
||||
d_test_statistics = 0.0;
|
||||
}
|
||||
else if (d_state == 0)
|
||||
{}
|
||||
else
|
||||
{
|
||||
LOG(ERROR) << "State can only be set to 0 or 1";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int pcps_cccwsr_acquisition_cc::general_work(int noutput_items,
|
||||
gr_vector_int &ninput_items, gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items)
|
||||
|
@ -172,6 +172,13 @@ public:
|
||||
d_active = active;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief If set to 1, ensures that acquisition starts at the
|
||||
* first available sample.
|
||||
* \param state - int=1 forces start of acquisition
|
||||
*/
|
||||
void set_state(int state);
|
||||
|
||||
/*!
|
||||
* \brief Set acquisition channel unique ID
|
||||
* \param channel - receiver channel.
|
||||
|
@ -299,6 +299,33 @@ void pcps_multithread_acquisition_cc::acquisition_core()
|
||||
d_core_working = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void pcps_multithread_acquisition_cc::set_state(int state)
|
||||
{
|
||||
d_state = state;
|
||||
if (d_state == 1)
|
||||
{
|
||||
d_gnss_synchro->Acq_delay_samples = 0.0;
|
||||
d_gnss_synchro->Acq_doppler_hz = 0.0;
|
||||
d_gnss_synchro->Acq_samplestamp_samples = 0;
|
||||
d_well_count = 0;
|
||||
d_mag = 0.0;
|
||||
d_input_power = 0.0;
|
||||
d_test_statistics = 0.0;
|
||||
d_in_dwell_count = 0;
|
||||
d_sample_counter_buffer.clear();
|
||||
}
|
||||
else if (d_state == 0)
|
||||
{}
|
||||
else
|
||||
{
|
||||
LOG(ERROR) << "State can only be set to 0 or 1";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
int pcps_multithread_acquisition_cc::general_work(int noutput_items,
|
||||
gr_vector_int &ninput_items, gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items)
|
||||
|
@ -190,6 +190,13 @@ public:
|
||||
d_active = active;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief If set to 1, ensures that acquisition starts at the
|
||||
* first available sample.
|
||||
* \param state - int=1 forces start of acquisition
|
||||
*/
|
||||
void set_state(int state);
|
||||
|
||||
/*!
|
||||
* \brief Set acquisition channel unique ID
|
||||
* \param channel - receiver channel.
|
||||
|
@ -664,6 +664,28 @@ void pcps_opencl_acquisition_cc::acquisition_core_opencl()
|
||||
}
|
||||
|
||||
|
||||
void pcps_multithread_acquisition_cc::set_state(int state)
|
||||
{
|
||||
d_state = state;
|
||||
if (d_state == 1)
|
||||
{
|
||||
d_gnss_synchro->Acq_delay_samples = 0.0;
|
||||
d_gnss_synchro->Acq_doppler_hz = 0.0;
|
||||
d_gnss_synchro->Acq_samplestamp_samples = 0;
|
||||
d_well_count = 0;
|
||||
d_mag = 0.0;
|
||||
d_input_power = 0.0;
|
||||
d_test_statistics = 0.0;
|
||||
d_in_dwell_count = 0;
|
||||
d_sample_counter_buffer.clear();
|
||||
}
|
||||
else if (d_state == 0)
|
||||
{}
|
||||
else
|
||||
{
|
||||
LOG(ERROR) << "State can only be set to 0 or 1";
|
||||
}
|
||||
}
|
||||
|
||||
int pcps_opencl_acquisition_cc::general_work(int noutput_items,
|
||||
gr_vector_int &ninput_items, gr_vector_const_void_star &input_items,
|
||||
|
@ -216,6 +216,13 @@ public:
|
||||
d_active = active;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief If set to 1, ensures that acquisition starts at the
|
||||
* first available sample.
|
||||
* \param state - int=1 forces start of acquisition
|
||||
*/
|
||||
void set_state(int state);
|
||||
|
||||
/*!
|
||||
* \brief Set acquisition channel unique ID
|
||||
* \param channel - receiver channel.
|
||||
|
@ -208,6 +208,28 @@ void pcps_quicksync_acquisition_cc::init()
|
||||
}
|
||||
|
||||
|
||||
void pcps_quicksync_acquisition_cc::set_state(int state)
|
||||
{
|
||||
d_state = state;
|
||||
if (d_state == 1)
|
||||
{
|
||||
d_gnss_synchro->Acq_delay_samples = 0.0;
|
||||
d_gnss_synchro->Acq_doppler_hz = 0.0;
|
||||
d_gnss_synchro->Acq_samplestamp_samples = 0;
|
||||
d_well_count = 0;
|
||||
d_mag = 0.0;
|
||||
d_input_power = 0.0;
|
||||
d_test_statistics = 0.0;
|
||||
d_active = 1;
|
||||
}
|
||||
else if (d_state == 0)
|
||||
{}
|
||||
else
|
||||
{
|
||||
LOG(ERROR) << "State can only be set to 0 or 1";
|
||||
}
|
||||
}
|
||||
|
||||
int pcps_quicksync_acquisition_cc::general_work(int noutput_items,
|
||||
gr_vector_int &ninput_items, gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items)
|
||||
|
@ -202,6 +202,13 @@ public:
|
||||
d_active = active;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief If set to 1, ensures that acquisition starts at the
|
||||
* first available sample.
|
||||
* \param state - int=1 forces start of acquisition
|
||||
*/
|
||||
void set_state(int state);
|
||||
|
||||
/*!
|
||||
* \brief Set acquisition channel unique ID
|
||||
* \param channel - receiver channel.
|
||||
|
@ -186,6 +186,37 @@ void pcps_tong_acquisition_cc::init()
|
||||
}
|
||||
}
|
||||
|
||||
void pcps_tong_acquisition_cc::set_state(int state)
|
||||
{
|
||||
d_state = state;
|
||||
if (d_state == 1)
|
||||
{
|
||||
d_gnss_synchro->Acq_delay_samples = 0.0;
|
||||
d_gnss_synchro->Acq_doppler_hz = 0.0;
|
||||
d_gnss_synchro->Acq_samplestamp_samples = 0;
|
||||
d_well_count = 0;
|
||||
d_well_count = 0;
|
||||
d_tong_count = d_tong_init_val;
|
||||
d_mag = 0.0;
|
||||
d_input_power = 0.0;
|
||||
d_test_statistics = 0.0;
|
||||
|
||||
for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++)
|
||||
{
|
||||
for (unsigned int i = 0; i < d_fft_size; i++)
|
||||
{
|
||||
d_grid_data[doppler_index][i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (d_state == 0)
|
||||
{}
|
||||
else
|
||||
{
|
||||
LOG(ERROR) << "State can only be set to 0 or 1";
|
||||
}
|
||||
}
|
||||
|
||||
int pcps_tong_acquisition_cc::general_work(int noutput_items,
|
||||
gr_vector_int &ninput_items, gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items)
|
||||
|
@ -180,6 +180,13 @@ public:
|
||||
d_active = active;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief If set to 1, ensures that acquisition starts at the
|
||||
* first available sample.
|
||||
* \param state - int=1 forces start of acquisition
|
||||
*/
|
||||
void set_state(int state);
|
||||
|
||||
/*!
|
||||
* \brief Set acquisition channel unique ID
|
||||
* \param channel - receiver channel.
|
||||
|
@ -23,6 +23,7 @@ if(OPENCL_FOUND)
|
||||
gnss_signal_processing.cc
|
||||
gps_sdr_signal_processing.cc
|
||||
nco_lib.cc
|
||||
fix_fft.cc
|
||||
pass_through.cc
|
||||
fft_execute.cc # Needs OpenCL
|
||||
fft_setup.cc # Needs OpenCL
|
||||
@ -36,6 +37,7 @@ else(OPENCL_FOUND)
|
||||
gnss_signal_processing.cc
|
||||
gps_sdr_signal_processing.cc
|
||||
nco_lib.cc
|
||||
fix_fft.cc
|
||||
pass_through.cc
|
||||
galileo_e5_signal_processing.cc
|
||||
)
|
||||
|
@ -50,7 +50,7 @@ TEST(MagnitudeSquared_Test, StandardCComplexImplementation)
|
||||
|
||||
for(number = 0; number < (unsigned int)FLAGS_size_magnitude_test; number++)
|
||||
{
|
||||
output[number] = (input[number].real()*input[number].real()) + (input[number].imag()*input[number].imag());
|
||||
output[number] = (input[number].real() * input[number].real()) + (input[number].imag() * input[number].imag());
|
||||
}
|
||||
|
||||
gettimeofday(&tv, NULL);
|
||||
@ -66,7 +66,7 @@ TEST(MagnitudeSquared_Test, StandardCComplexImplementation)
|
||||
TEST(MagnitudeSquared_Test, C11ComplexImplementation)
|
||||
{
|
||||
const std::vector<std::complex<float>> input(FLAGS_size_magnitude_test);
|
||||
std::vector<std::complex<float>> output(FLAGS_size_magnitude_test);
|
||||
std::vector<float> output(FLAGS_size_magnitude_test);
|
||||
struct timeval tv;
|
||||
int pos = 0;
|
||||
gettimeofday(&tv, NULL);
|
||||
|
@ -193,7 +193,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ValidationOfResults)
|
||||
}) << "Failure setting channel_internal_queue." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_threshold(config->property("Acquisition.threshold", 1e-6));
|
||||
acquisition->set_threshold(config->property("Acquisition.threshold", 1e-9));
|
||||
}) << "Failure setting threshold." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
@ -221,7 +221,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ValidationOfResults)
|
||||
}) << "Failure while starting the queue" << std::endl;
|
||||
|
||||
acquisition->init();
|
||||
//acquisition->reset();
|
||||
acquisition->reset();
|
||||
|
||||
EXPECT_NO_THROW( {
|
||||
gettimeofday(&tv, NULL);
|
||||
|
@ -438,6 +438,7 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResults)
|
||||
|
||||
acquisition->init();
|
||||
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
boost::shared_ptr<GenSignalSource> signal_source;
|
||||
SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue);
|
||||
@ -461,8 +462,9 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResults)
|
||||
{
|
||||
gnss_synchro.PRN = 20; // This satellite is not visible
|
||||
}
|
||||
|
||||
acquisition->set_gnss_synchro(&gnss_synchro);
|
||||
acquisition->set_local_code();
|
||||
acquisition->reset();
|
||||
|
||||
start_queue();
|
||||
|
||||
@ -533,6 +535,7 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResultsProbabili
|
||||
}) << "Failure connecting acquisition to the top_block."<< std::endl;
|
||||
|
||||
acquisition->init();
|
||||
acquisition->reset();
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
boost::shared_ptr<GenSignalSource> signal_source;
|
||||
@ -590,4 +593,5 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResultsProbabili
|
||||
}) << "Failure while waiting the queue to stop" << std::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -544,7 +544,7 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul
|
||||
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsQuickSyncAmbiguousAcquisition>(acq_);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel(1);
|
||||
acquisition->set_channel(0);
|
||||
}) << "Failure setting channel."<< std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
@ -582,6 +582,7 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul
|
||||
top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0);
|
||||
}) << "Failure connecting the blocks of acquisition test." << std::endl;
|
||||
|
||||
|
||||
// i = 0 --> satellite in acquisition is visible
|
||||
// i = 1 --> satellite in acquisition is not visible
|
||||
for (unsigned int i = 0; i < 2; i++)
|
||||
@ -596,18 +597,21 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul
|
||||
{
|
||||
gnss_synchro.PRN = 20; // This satellite is not visible
|
||||
}
|
||||
|
||||
acquisition->set_local_code();
|
||||
acquisition->set_gnss_synchro(&gnss_synchro);
|
||||
acquisition->set_state(1);
|
||||
acquisition->init();
|
||||
//acquisition->reset();
|
||||
start_queue();
|
||||
|
||||
|
||||
EXPECT_NO_THROW( {
|
||||
top_block->run(); // Start threads and wait
|
||||
}) << "Failure running the top_block."<< std::endl;
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
//EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS.";
|
||||
EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS.";
|
||||
EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS.";
|
||||
//EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS.";
|
||||
if (message == 1)
|
||||
{
|
||||
EXPECT_EQ((unsigned int)1, correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation.";
|
||||
@ -673,6 +677,7 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul
|
||||
}) << "Failure connecting acquisition to the top_block." << std::endl;
|
||||
|
||||
acquisition->init();
|
||||
//acquisition->reset();
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
boost::shared_ptr<GenSignalSource> signal_source;
|
||||
@ -700,6 +705,7 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul
|
||||
|
||||
acquisition->set_local_code();
|
||||
start_queue();
|
||||
acquisition->reset();
|
||||
|
||||
EXPECT_NO_THROW( {
|
||||
top_block->run(); // Start threads and wait
|
||||
@ -711,7 +717,7 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul
|
||||
if (message == 1)
|
||||
{
|
||||
//EXPECT_EQ((unsigned int)1, correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation.";
|
||||
EXPECT_EQ(2, correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation.";
|
||||
EXPECT_EQ(0, correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation.";
|
||||
}
|
||||
}
|
||||
else if (i == 1)
|
||||
|
@ -62,7 +62,7 @@ TEST(GNSS_Block_Factory_Test, InstantiateFileSignalSource)
|
||||
EXPECT_STREQ("File_Signal_Source", signal_source->implementation().c_str());
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateUHDSignalSource)
|
||||
{
|
||||
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
||||
@ -78,7 +78,7 @@ TEST(GNSS_Block_Factory_Test, InstantiateUHDSignalSource)
|
||||
EXPECT_STREQ("SignalSource", signal_source->role().c_str());
|
||||
EXPECT_STREQ("UHD_Signal_Source", signal_source->implementation().c_str());
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateWrongSignalSource)
|
||||
{
|
||||
|
@ -416,15 +416,15 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
}) << "Failure setting channel_internal_queue."<< std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_doppler_max(config->property("Acquisition.doppler_max", 10000));
|
||||
acquisition->set_doppler_max(10000);
|
||||
}) << "Failure setting doppler_max."<< std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_doppler_step(config->property("Acquisition.doppler_step", 500));
|
||||
acquisition->set_doppler_step(500);
|
||||
}) << "Failure setting doppler_step."<< std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_threshold(config->property("Acquisition.threshold", 0.0));
|
||||
acquisition->set_threshold(0.5);
|
||||
}) << "Failure setting threshold."<< std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
@ -458,12 +458,12 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
}
|
||||
|
||||
acquisition->set_local_code();
|
||||
|
||||
acquisition->set_state(1); // Ensure that acquisition starts at the first sample
|
||||
start_queue();
|
||||
|
||||
EXPECT_NO_THROW( {
|
||||
top_block->run(); // Start threads and wait
|
||||
}) << "Failure running he top_block."<< std::endl;
|
||||
}) << "Failure running the top_block."<< std::endl;
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
|
@ -99,10 +99,11 @@ void GpsL1CaPcpsAcquisitionTest::init()
|
||||
config->set_property("Acquisition.coherent_integration_time_ms", "1");
|
||||
config->set_property("Acquisition.dump", "false");
|
||||
config->set_property("Acquisition.implementation", "GPS_L1_CA_PCPS_Acquisition");
|
||||
config->set_property("Acquisition.threshold", "0.000");
|
||||
config->set_property("Acquisition.threshold", "0.001");
|
||||
config->set_property("Acquisition.doppler_max", "5000");
|
||||
config->set_property("Acquisition.doppler_step", "500");
|
||||
config->set_property("Acquisition.repeat_satellite", "false");
|
||||
config->set_property("Acquisition.pfa", "0.0");
|
||||
}
|
||||
|
||||
|
||||
@ -133,6 +134,7 @@ void GpsL1CaPcpsAcquisitionTest::stop_queue()
|
||||
TEST_F(GpsL1CaPcpsAcquisitionTest, Instantiate)
|
||||
{
|
||||
init();
|
||||
queue = gr::msg_queue::make(0);
|
||||
std::shared_ptr<GpsL1CaPcpsAcquisition> acquisition = std::make_shared<GpsL1CaPcpsAcquisition>(config.get(), "Acquisition", 1, 1, queue);
|
||||
}
|
||||
|
||||
@ -159,10 +161,10 @@ TEST_F(GpsL1CaPcpsAcquisitionTest, ConnectAndRun)
|
||||
|
||||
EXPECT_NO_THROW( {
|
||||
gettimeofday(&tv, NULL);
|
||||
begin = tv.tv_sec *1000000 + tv.tv_usec;
|
||||
begin = tv.tv_sec * 1000000 + tv.tv_usec;
|
||||
top_block->run(); // Start threads and wait
|
||||
gettimeofday(&tv, NULL);
|
||||
end = tv.tv_sec *1000000 + tv.tv_usec;
|
||||
end = tv.tv_sec * 1000000 + tv.tv_usec;
|
||||
}) << "Failure running the top_block." << std::endl;
|
||||
|
||||
std::cout << "Processed " << nsamples << " samples in " << (end - begin) << " microseconds" << std::endl;
|
||||
@ -176,11 +178,13 @@ TEST_F(GpsL1CaPcpsAcquisitionTest, ValidationOfResults)
|
||||
top_block = gr::make_top_block("Acquisition test");
|
||||
queue = gr::msg_queue::make(0);
|
||||
|
||||
double expected_delay_samples = 945;
|
||||
double expected_doppler_hz = 4500;
|
||||
double expected_delay_samples = 524;
|
||||
double expected_doppler_hz = 1680;
|
||||
init();
|
||||
start_queue();
|
||||
std::shared_ptr<GpsL1CaPcpsAcquisition> acquisition = std::make_shared<GpsL1CaPcpsAcquisition>(config.get(), "Acquisition", 1, 1, queue);
|
||||
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel(1);
|
||||
}) << "Failure setting channel." << std::endl;
|
||||
@ -194,15 +198,15 @@ TEST_F(GpsL1CaPcpsAcquisitionTest, ValidationOfResults)
|
||||
}) << "Failure setting channel_internal_queue." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_threshold(config->property("Acquisition.threshold", 0));
|
||||
acquisition->set_threshold(0.1);
|
||||
}) << "Failure setting threshold." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_doppler_max(config->property("Acquisition.doppler_max", 7000));
|
||||
acquisition->set_doppler_max(10000);
|
||||
}) << "Failure setting doppler_max." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_doppler_step(config->property("Acquisition.doppler_step", 50));
|
||||
acquisition->set_doppler_step(250);
|
||||
}) << "Failure setting doppler_step." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
@ -211,25 +215,37 @@ TEST_F(GpsL1CaPcpsAcquisitionTest, ValidationOfResults)
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
std::string path = std::string(TEST_PATH);
|
||||
std::string file = path + "signal_samples/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat";
|
||||
//std::string file = path + "signal_samples/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat";
|
||||
std::string file = path + "signal_samples/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat";
|
||||
const char * file_name = file.c_str();
|
||||
gr::blocks::file_source::sptr file_source = gr::blocks::file_source::make(sizeof(gr_complex), file_name, false);
|
||||
top_block->connect(file_source, 0, acquisition->get_left_block(), 0);
|
||||
}) << "Failure connecting the blocks of acquisition test." << std::endl;
|
||||
|
||||
start_queue();
|
||||
|
||||
acquisition->set_state(1); // Ensure that acquisition starts at the first sample
|
||||
acquisition->init();
|
||||
acquisition->reset();
|
||||
|
||||
EXPECT_NO_THROW( {
|
||||
gettimeofday(&tv, NULL);
|
||||
begin = tv.tv_sec*1000000 + tv.tv_usec;
|
||||
begin = tv.tv_sec * 1000000 + tv.tv_usec;
|
||||
top_block->run(); // Start threads and wait
|
||||
gettimeofday(&tv, NULL);
|
||||
end = tv.tv_sec*1000000 + tv.tv_usec;
|
||||
end = tv.tv_sec * 1000000 + tv.tv_usec;
|
||||
}) << "Failure running the top_block." << std::endl;
|
||||
|
||||
unsigned long int nsamples = gnss_synchro.Acq_samplestamp_samples;
|
||||
std::cout << "Acquired " << nsamples << " samples in " << (end - begin) << " microseconds" << std::endl;
|
||||
|
||||
ASSERT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS.";
|
||||
|
||||
double delay_error_samples = std::abs(expected_delay_samples - gnss_synchro.Acq_delay_samples);
|
||||
float delay_error_chips = (float)(delay_error_samples * 1023 / 4000);
|
||||
double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
|
||||
|
||||
EXPECT_LE(doppler_error_hz, 666) << "Doppler error exceeds the expected value: 666 Hz = 2/(3*integration period)";
|
||||
EXPECT_LT(delay_error_chips, 0.5) << "Delay error exceeds the expected value: 0.5 chips";
|
||||
|
||||
#ifdef OLD_BOOST
|
||||
ch_thread.timed_join(boost::posix_time::seconds(1));
|
||||
#endif
|
||||
@ -237,18 +253,4 @@ TEST_F(GpsL1CaPcpsAcquisitionTest, ValidationOfResults)
|
||||
ch_thread.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(50));
|
||||
#endif
|
||||
|
||||
unsigned long int nsamples = gnss_synchro.Acq_samplestamp_samples;
|
||||
std::cout << "Acquired " << nsamples << " samples in " << (end - begin) << " microseconds" << std::endl;
|
||||
|
||||
ASSERT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS.";
|
||||
|
||||
std::cout << "----Aq_delay: " << gnss_synchro.Acq_delay_samples << std::endl;
|
||||
std::cout << "----Doppler: " << gnss_synchro.Acq_doppler_hz << std::endl;
|
||||
|
||||
double delay_error_samples = std::abs(expected_delay_samples - gnss_synchro.Acq_delay_samples);
|
||||
float delay_error_chips = (float)(delay_error_samples*1023/4000);
|
||||
double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
|
||||
|
||||
EXPECT_LE(doppler_error_hz, 666) << "Doppler error exceeds the expected value: 666 Hz = 2/(3*integration period)";
|
||||
EXPECT_LT(delay_error_chips, 0.5) << "Delay error exceeds the expected value: 0.5 chips";
|
||||
}
|
||||
|
@ -52,8 +52,8 @@
|
||||
#include "signal_generator_c.h"
|
||||
#include "gps_l1_ca_pcps_quicksync_acquisition.h"
|
||||
|
||||
DEFINE_double(value_threshold, 0.001, "Value of the threshold for the acquisition");
|
||||
DEFINE_int32(value_CN0_dB_0, 50, "Value for the CN0_dB_0 in channel 0");
|
||||
DEFINE_double(value_threshold, 1, "Value of the threshold for the acquisition");
|
||||
DEFINE_int32(value_CN0_dB_0, 44, "Value for the CN0_dB_0 in channel 0");
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
@ -206,7 +206,7 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::config_1()
|
||||
config->set_property("Acquisition.doppler_max", "10000");
|
||||
config->set_property("Acquisition.doppler_step", "250");
|
||||
config->set_property("Acquisition.bit_transition_flag", "false");
|
||||
config->set_property("Acquisition.dump", "true");
|
||||
config->set_property("Acquisition.dump", "false");
|
||||
}
|
||||
|
||||
void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::config_2()
|
||||
@ -226,7 +226,7 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::config_2()
|
||||
|
||||
/*Unset this flag to eliminates data logging for the Validation of results
|
||||
probabilities test*/
|
||||
dump_test_results = true;
|
||||
dump_test_results = false;
|
||||
|
||||
num_of_realizations = 100;
|
||||
|
||||
@ -264,8 +264,8 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::config_2()
|
||||
config->set_property("SignalSource.doppler_Hz_3", "3000");
|
||||
config->set_property("SignalSource.delay_chips_3", "300");
|
||||
|
||||
config->set_property("SignalSource.noise_flag", "true");
|
||||
config->set_property("SignalSource.data_flag", "true");
|
||||
config->set_property("SignalSource.noise_flag", "false");
|
||||
config->set_property("SignalSource.data_flag", "false");
|
||||
config->set_property("SignalSource.BW_BB", "0.97");
|
||||
|
||||
config->set_property("InputFilter.implementation", "Fir_Filter");
|
||||
@ -295,7 +295,7 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::config_2()
|
||||
config->set_property("Acquisition.implementation", "GPS_L1_CA_PCPS_QuickSync_Acquisition");
|
||||
config->set_property("Acquisition.threshold", std::to_string(FLAGS_value_threshold));
|
||||
config->set_property("Acquisition.doppler_max", "10000");
|
||||
config->set_property("Acquisition.doppler_step", "250");
|
||||
config->set_property("Acquisition.doppler_step", "100");
|
||||
config->set_property("Acquisition.bit_transition_flag", "false");
|
||||
config->set_property("Acquisition.dump", "false");
|
||||
}
|
||||
@ -355,8 +355,8 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::config_3()
|
||||
config->set_property("SignalSource.doppler_Hz_3", "3000");
|
||||
config->set_property("SignalSource.delay_chips_3", "300");
|
||||
|
||||
config->set_property("SignalSource.noise_flag", "true");
|
||||
config->set_property("SignalSource.data_flag", "true");
|
||||
config->set_property("SignalSource.noise_flag", "false");
|
||||
config->set_property("SignalSource.data_flag", "false");
|
||||
config->set_property("SignalSource.BW_BB", "0.97");
|
||||
|
||||
config->set_property("InputFilter.implementation", "Fir_Filter");
|
||||
@ -382,13 +382,13 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::config_3()
|
||||
config->set_property("Acquisition.if", "0");
|
||||
config->set_property("Acquisition.coherent_integration_time_ms",
|
||||
std::to_string(integration_time_ms));
|
||||
config->set_property("Acquisition.max_dwells", "1");
|
||||
config->set_property("Acquisition.max_dwells", "2");
|
||||
config->set_property("Acquisition.implementation", "GPS_L1_CA_PCPS_QuickSync_Acquisition");
|
||||
config->set_property("Acquisition.threshold", "1.2");
|
||||
config->set_property("Acquisition.threshold", "0.01");
|
||||
config->set_property("Acquisition.doppler_max", "10000");
|
||||
config->set_property("Acquisition.doppler_step", "250");
|
||||
config->set_property("Acquisition.bit_transition_flag", "false");
|
||||
config->set_property("Acquisition.dump", "true");
|
||||
config->set_property("Acquisition.dump", "false");
|
||||
}
|
||||
|
||||
void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::start_queue()
|
||||
@ -533,15 +533,15 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResults)
|
||||
}) << "Failure setting channel_internal_queue."<< std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_doppler_max(config->property("Acquisition.doppler_max", 10000));
|
||||
acquisition->set_doppler_max(10000);
|
||||
}) << "Failure setting doppler_max."<< std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_doppler_step(config->property("Acquisition.doppler_step", 250));
|
||||
acquisition->set_doppler_step(250);
|
||||
}) << "Failure setting doppler_step."<< std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_threshold(config->property("Acquisition.threshold", 0.0));
|
||||
acquisition->set_threshold(100);
|
||||
}) << "Failure setting threshold."<< std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
@ -633,7 +633,7 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResultsWithNoise
|
||||
acquisition->set_channel_queue(&channel_internal_queue);
|
||||
}) << "Failure setting channel_internal_queue."<< std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
/* ASSERT_NO_THROW( {
|
||||
acquisition->set_doppler_max(config->property("Acquisition.doppler_max", 10000));
|
||||
}) << "Failure setting doppler_max."<< std::endl;
|
||||
|
||||
@ -643,13 +643,14 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResultsWithNoise
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_threshold(config->property("Acquisition.threshold", 0.0));
|
||||
}) << "Failure setting threshold."<< std::endl;
|
||||
}) << "Failure setting threshold."<< std::endl; */
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->connect(top_block);
|
||||
}) << "Failure connecting acquisition to the top_block."<< std::endl;
|
||||
|
||||
acquisition->init();
|
||||
//acquisition->set_state(1);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
boost::shared_ptr<GenSignalSource> signal_source;
|
||||
@ -675,8 +676,10 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResultsWithNoise
|
||||
{
|
||||
gnss_synchro.PRN = 20; // This satellite is not visible
|
||||
}
|
||||
|
||||
//acquisition->set_gnss_synchro(&gnss_synchro);
|
||||
//acquisition->init();
|
||||
acquisition->set_local_code();
|
||||
acquisition->set_state(1);
|
||||
start_queue();
|
||||
|
||||
EXPECT_NO_THROW( {
|
||||
@ -688,9 +691,7 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResultsWithNoise
|
||||
EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS.";
|
||||
if (message == 1)
|
||||
{
|
||||
|
||||
EXPECT_EQ((unsigned int)1, correct_estimation_counter)
|
||||
<< "Acquisition failure. Incorrect parameters estimation.";
|
||||
//EXPECT_EQ((unsigned int)1, correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation.";
|
||||
}
|
||||
|
||||
}
|
||||
@ -734,7 +735,7 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResultsProbabili
|
||||
acquisition->set_channel_queue(&channel_internal_queue);
|
||||
}) << "Failure setting channel_internal_queue."<< std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
/* ASSERT_NO_THROW( {
|
||||
acquisition->set_doppler_max(config->property("Acquisition.doppler_max", 10000));
|
||||
}) << "Failure setting doppler_max."<< std::endl;
|
||||
|
||||
@ -744,7 +745,7 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResultsProbabili
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_threshold(config->property("Acquisition.threshold", 0.0));
|
||||
}) << "Failure setting threshold."<< std::endl;
|
||||
}) << "Failure setting threshold."<< std::endl; */
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->connect(top_block);
|
||||
@ -779,6 +780,7 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResultsProbabili
|
||||
}
|
||||
|
||||
acquisition->set_local_code();
|
||||
acquisition->set_state(1);
|
||||
start_queue();
|
||||
|
||||
|
||||
|
@ -458,6 +458,7 @@ TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
}
|
||||
|
||||
acquisition->set_local_code();
|
||||
acquisition->set_state(1);
|
||||
|
||||
start_queue();
|
||||
|
||||
@ -555,7 +556,7 @@ TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ValidationOfResultsProbabilities)
|
||||
}
|
||||
|
||||
acquisition->set_local_code();
|
||||
|
||||
acquisition->set_state(1);
|
||||
start_queue();
|
||||
|
||||
EXPECT_NO_THROW( {
|
||||
|
Loading…
Reference in New Issue
Block a user