1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-01-16 20:23:02 +00:00

Cleaning includes

plus some code cleaning
This commit is contained in:
Carles Fernandez 2016-01-05 10:59:37 +01:00
parent 1c3a9f98ee
commit 0a1aa50c4a
25 changed files with 196 additions and 254 deletions

View File

@ -30,8 +30,6 @@
*/ */
#include "galileo_e1_pcps_8ms_ambiguous_acquisition.h" #include "galileo_e1_pcps_8ms_ambiguous_acquisition.h"
#include <iostream>
#include <string>
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
#include <boost/math/distributions/exponential.hpp> #include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h> #include <glog/logging.h>
@ -68,7 +66,6 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition(
LOG(WARNING) << "coherent_integration_time should be multiple of " LOG(WARNING) << "coherent_integration_time should be multiple of "
<< "Galileo code length (4 ms). coherent_integration_time = " << "Galileo code length (4 ms). coherent_integration_time = "
<< sampled_ms_ << " ms will be used."; << sampled_ms_ << " ms will be used.";
} }
max_dwells_ = configuration_->property(role + ".max_dwells", 1); max_dwells_ = configuration_->property(role + ".max_dwells", 1);

View File

@ -30,7 +30,6 @@
*/ */
#include "galileo_e1_pcps_ambiguous_acquisition.h" #include "galileo_e1_pcps_ambiguous_acquisition.h"
#include <iostream>
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
#include <boost/math/distributions/exponential.hpp> #include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h> #include <glog/logging.h>

View File

@ -30,11 +30,9 @@
*/ */
#include "galileo_e1_pcps_cccwsr_ambiguous_acquisition.h" #include "galileo_e1_pcps_cccwsr_ambiguous_acquisition.h"
#include <iostream>
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
#include <boost/math/distributions/exponential.hpp> #include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h> #include <glog/logging.h>
#include <volk/volk.h>
#include "galileo_e1_signal_processing.h" #include "galileo_e1_signal_processing.h"
#include "Galileo_E1.h" #include "Galileo_E1.h"
#include "configuration_interface.h" #include "configuration_interface.h"

View File

@ -30,11 +30,9 @@
*/ */
#include "galileo_e1_pcps_quicksync_ambiguous_acquisition.h" #include "galileo_e1_pcps_quicksync_ambiguous_acquisition.h"
#include <iostream>
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
#include <boost/math/distributions/exponential.hpp> #include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h> #include <glog/logging.h>
#include <cmath>
#include "galileo_e1_signal_processing.h" #include "galileo_e1_signal_processing.h"
#include "Galileo_E1.h" #include "Galileo_E1.h"
#include "configuration_interface.h" #include "configuration_interface.h"

View File

@ -30,7 +30,6 @@
*/ */
#include "galileo_e1_pcps_tong_ambiguous_acquisition.h" #include "galileo_e1_pcps_tong_ambiguous_acquisition.h"
#include <iostream>
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
#include <boost/math/distributions/exponential.hpp> #include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h> #include <glog/logging.h>

View File

@ -36,12 +36,9 @@
*/ */
#include "galileo_e5a_noncoherent_iq_acquisition_caf.h" #include "galileo_e5a_noncoherent_iq_acquisition_caf.h"
#include <iostream>
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
#include <stdexcept>
#include <boost/math/distributions/exponential.hpp> #include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/msg_queue.h>
#include "galileo_e5_signal_processing.h" #include "galileo_e5_signal_processing.h"
#include "Galileo_E5a.h" #include "Galileo_E5a.h"
#include "configuration_interface.h" #include "configuration_interface.h"

View File

@ -54,119 +54,121 @@ public:
std::string role, unsigned int in_streams, std::string role, unsigned int in_streams,
unsigned int out_streams, boost::shared_ptr<gr::msg_queue> queue); unsigned int out_streams, boost::shared_ptr<gr::msg_queue> queue);
virtual ~GalileoE5aNoncoherentIQAcquisitionCaf(); virtual ~GalileoE5aNoncoherentIQAcquisitionCaf();
std::string role() std::string role()
{ {
return role_; return role_;
} }
/*!
* \brief Returns "Galileo_E5a_Noncoherent_IQ_Acquisition_CAF"
*/
std::string implementation()
{
return "Galileo_E5a_Noncoherent_IQ_Acquisition_CAF";
}
size_t item_size()
{
return item_size_;
}
void connect(gr::top_block_sptr top_block); /*!
void disconnect(gr::top_block_sptr top_block); * \brief Returns "Galileo_E5a_Noncoherent_IQ_Acquisition_CAF"
gr::basic_block_sptr get_left_block(); */
gr::basic_block_sptr get_right_block(); std::string implementation()
{
return "Galileo_E5a_Noncoherent_IQ_Acquisition_CAF";
}
/*! size_t item_size()
* \brief Set acquisition/tracking common Gnss_Synchro object pointer {
* to efficiently exchange synchronization data between acquisition and return item_size_;
* tracking blocks }
*/
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
/*! void connect(gr::top_block_sptr top_block);
* \brief Set acquisition channel unique ID void disconnect(gr::top_block_sptr top_block);
*/ gr::basic_block_sptr get_left_block();
void set_channel(unsigned int channel); gr::basic_block_sptr get_right_block();
/*! /*!
* \brief Set statistics threshold of PCPS algorithm * \brief Set acquisition/tracking common Gnss_Synchro object pointer
*/ * to efficiently exchange synchronization data between acquisition and
void set_threshold(float threshold); * tracking blocks
*/
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
/*! /*!
* \brief Set maximum Doppler off grid search * \brief Set acquisition channel unique ID
*/ */
void set_doppler_max(unsigned int doppler_max); void set_channel(unsigned int channel);
/*! /*!
* \brief Set Doppler steps for the grid search * \brief Set statistics threshold of PCPS algorithm
*/ */
void set_doppler_step(unsigned int doppler_step); void set_threshold(float threshold);
/*! /*!
* \brief Set tracking channel internal queue * \brief Set maximum Doppler off grid search
*/ */
void set_channel_queue(concurrent_queue<int> *channel_internal_queue); void set_doppler_max(unsigned int doppler_max);
/*! /*!
* \brief Initializes acquisition algorithm. * \brief Set Doppler steps for the grid search
*/ */
void init(); void set_doppler_step(unsigned int doppler_step);
/*! /*!
* \brief Sets local Galileo E5a code for PCPS acquisition algorithm. * \brief Set tracking channel internal queue
*/ */
void set_local_code(); void set_channel_queue(concurrent_queue<int> *channel_internal_queue);
/*! /*!
* \brief Returns the maximum peak of grid search * \brief Initializes acquisition algorithm.
*/ */
signed int mag(); void init();
/*! /*!
* \brief Restart acquisition algorithm * \brief Sets local Galileo E5a code for PCPS acquisition algorithm.
*/ */
void reset(); void set_local_code();
/*! /*!
* \brief If set to 1, ensures that acquisition starts at the * \brief Returns the maximum peak of grid search
* first available sample. */
* \param state - int=1 forces start of acquisition signed int mag();
*/
void set_state(int state); /*!
* \brief Restart acquisition algorithm
*/
void reset();
/*!
* \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);
private: private:
ConfigurationInterface* configuration_; ConfigurationInterface* configuration_;
galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr acquisition_cc_; galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr acquisition_cc_;
gr::blocks::stream_to_vector::sptr stream_to_vector_; gr::blocks::stream_to_vector::sptr stream_to_vector_;
size_t item_size_; size_t item_size_;
std::string item_type_; std::string item_type_;
unsigned int vector_length_; unsigned int vector_length_;
unsigned int code_length_; unsigned int code_length_;
bool bit_transition_flag_; bool bit_transition_flag_;
unsigned int channel_; unsigned int channel_;
float threshold_; float threshold_;
unsigned int doppler_max_; unsigned int doppler_max_;
unsigned int doppler_step_; unsigned int doppler_step_;
unsigned int shift_resolution_; unsigned int shift_resolution_;
unsigned int sampled_ms_; unsigned int sampled_ms_;
unsigned int max_dwells_; unsigned int max_dwells_;
long fs_in_; long fs_in_;
long if_; long if_;
bool dump_; bool dump_;
std::string dump_filename_; std::string dump_filename_;
int Zero_padding; int Zero_padding;
int CAF_window_hz_; int CAF_window_hz_;
std::complex<float> * codeI_; std::complex<float> * codeI_;
std::complex<float> * codeQ_; std::complex<float> * codeQ_;
bool both_signal_components; bool both_signal_components;
Gnss_Synchro * gnss_synchro_; Gnss_Synchro * gnss_synchro_;
std::string role_; std::string role_;
unsigned int in_streams_; unsigned int in_streams_;
unsigned int out_streams_; unsigned int out_streams_;
boost::shared_ptr<gr::msg_queue> queue_; boost::shared_ptr<gr::msg_queue> queue_;
concurrent_queue<int> *channel_internal_queue_; concurrent_queue<int> *channel_internal_queue_;
float calculate_threshold(float pfa); float calculate_threshold(float pfa);
}; };
#endif /* GALILEO_E5A_NONCOHERENT_IQ_ACQUISITION_CAF_H_ */ #endif /* GALILEO_E5A_NONCOHERENT_IQ_ACQUISITION_CAF_H_ */

View File

@ -34,11 +34,8 @@
*/ */
#include "gps_l1_ca_pcps_acquisition.h" #include "gps_l1_ca_pcps_acquisition.h"
#include <iostream>
#include <stdexcept>
#include <boost/math/distributions/exponential.hpp> #include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/msg_queue.h>
#include "gps_sdr_signal_processing.h" #include "gps_sdr_signal_processing.h"
#include "GPS_L1_CA.h" #include "GPS_L1_CA.h"
#include "configuration_interface.h" #include "configuration_interface.h"
@ -85,7 +82,7 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition(
vector_length_ = code_length_ * sampled_ms_; vector_length_ = code_length_ * sampled_ms_;
code_= new gr_complex[vector_length_]; code_ = new gr_complex[vector_length_];
// if (item_type_.compare("gr_complex") == 0 ) // if (item_type_.compare("gr_complex") == 0 )
// { // {
@ -274,7 +271,7 @@ float GpsL1CaPcpsAcquisition::calculate_threshold(float pfa)
{ {
frequency_bins++; frequency_bins++;
} }
DLOG(INFO) << "Channel " << channel_<< " Pfa = " << pfa; DLOG(INFO) << "Channel " << channel_ << " Pfa = " << pfa;
unsigned int ncells = vector_length_ * frequency_bins; unsigned int ncells = vector_length_ * frequency_bins;
double exponent = 1 / static_cast<double>(ncells); double exponent = 1 / static_cast<double>(ncells);
double val = pow(1.0 - pfa, exponent); double val = pow(1.0 - pfa, exponent);
@ -310,7 +307,6 @@ void GpsL1CaPcpsAcquisition::connect(gr::top_block_sptr top_block)
{ {
LOG(WARNING) << item_type_ << " unknown acquisition item type"; LOG(WARNING) << item_type_ << " unknown acquisition item type";
} }
} }

View File

@ -34,7 +34,6 @@
#include "gps_l1_ca_pcps_acquisition_fine_doppler.h" #include "gps_l1_ca_pcps_acquisition_fine_doppler.h"
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/io_signature.h>
#include "gps_sdr_signal_processing.h" #include "gps_sdr_signal_processing.h"
#include "GPS_L1_CA.h" #include "GPS_L1_CA.h"
#include "configuration_interface.h" #include "configuration_interface.h"
@ -53,7 +52,6 @@ GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler(
DLOG(INFO) << "role " << role; DLOG(INFO) << "role " << role;
item_type_ = configuration->property(role + ".item_type", default_item_type); item_type_ = configuration->property(role + ".item_type", default_item_type);
fs_in_ = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in_ = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
if_ = configuration->property(role + ".ifreq", 0); if_ = configuration->property(role + ".ifreq", 0);
dump_ = configuration->property(role + ".dump", false); dump_ = configuration->property(role + ".dump", false);
@ -67,7 +65,7 @@ GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler(
vector_length_ = round(fs_in_ vector_length_ = round(fs_in_
/ (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS));
code_= new gr_complex[vector_length_]; code_ = new gr_complex[vector_length_];
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
@ -75,7 +73,6 @@ GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler(
acquisition_cc_ = pcps_make_acquisition_fine_doppler_cc(max_dwells_,sampled_ms_, acquisition_cc_ = pcps_make_acquisition_fine_doppler_cc(max_dwells_,sampled_ms_,
doppler_max_, doppler_min_, if_, fs_in_, vector_length_, queue_, doppler_max_, doppler_min_, if_, fs_in_, vector_length_, queue_,
dump_, dump_filename_); dump_, dump_filename_);
} }
else else
{ {
@ -161,22 +158,21 @@ void GpsL1CaPcpsAcquisitionFineDoppler::set_local_code()
void GpsL1CaPcpsAcquisitionFineDoppler::reset() void GpsL1CaPcpsAcquisitionFineDoppler::reset()
{ {
acquisition_cc_->set_active(true); acquisition_cc_->set_active(true);
} }
void GpsL1CaPcpsAcquisitionFineDoppler::connect(boost::shared_ptr<gr::top_block> top_block) void GpsL1CaPcpsAcquisitionFineDoppler::connect(boost::shared_ptr<gr::top_block> top_block)
{ {
if(top_block) { /* top_block is not null */}; if(top_block) { /* top_block is not null */};
//nothing to disconnect, now the tracking uses gr_sync_decimator //nothing to disconnect, now the tracking uses gr_sync_decimator
} }
void GpsL1CaPcpsAcquisitionFineDoppler::disconnect(boost::shared_ptr<gr::top_block> top_block) void GpsL1CaPcpsAcquisitionFineDoppler::disconnect(boost::shared_ptr<gr::top_block> top_block)
{ {
if(top_block) { /* top_block is not null */}; if(top_block) { /* top_block is not null */};
//nothing to disconnect, now the tracking uses gr_sync_decimator //nothing to disconnect, now the tracking uses gr_sync_decimator
} }

View File

@ -33,7 +33,6 @@
*/ */
#include "gps_l1_ca_pcps_assisted_acquisition.h" #include "gps_l1_ca_pcps_assisted_acquisition.h"
#include <iostream>
#include <glog/logging.h> #include <glog/logging.h>
#include "gps_sdr_signal_processing.h" #include "gps_sdr_signal_processing.h"
#include "GPS_L1_CA.h" #include "GPS_L1_CA.h"
@ -54,9 +53,7 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition(
DLOG(INFO) << "role " << role; DLOG(INFO) << "role " << role;
item_type_ = configuration->property(role + ".item_type", item_type_ = configuration->property(role + ".item_type", default_item_type);
default_item_type);
fs_in_ = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in_ = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
if_ = configuration->property(role + ".ifreq", 0); if_ = configuration->property(role + ".ifreq", 0);
dump_ = configuration->property(role + ".dump", false); dump_ = configuration->property(role + ".dump", false);
@ -64,14 +61,13 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition(
doppler_min_ = configuration->property(role + ".doppler_min", -5000); doppler_min_ = configuration->property(role + ".doppler_min", -5000);
sampled_ms_ = configuration->property(role + ".coherent_integration_time_ms", 1); sampled_ms_ = configuration->property(role + ".coherent_integration_time_ms", 1);
max_dwells_= configuration->property(role + ".max_dwells", 1); max_dwells_= configuration->property(role + ".max_dwells", 1);
dump_filename_ = configuration->property(role + ".dump_filename", dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
default_dump_filename);
//--- Find number of samples per spreading code ------------------------- //--- Find number of samples per spreading code -------------------------
vector_length_ = round(fs_in_ vector_length_ = round(fs_in_
/ (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS));
code_= new gr_complex[vector_length_]; code_ = new gr_complex[vector_length_];
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
@ -164,21 +160,21 @@ void GpsL1CaPcpsAssistedAcquisition::set_local_code()
void GpsL1CaPcpsAssistedAcquisition::reset() void GpsL1CaPcpsAssistedAcquisition::reset()
{ {
acquisition_cc_->set_active(true); acquisition_cc_->set_active(true);
} }
void GpsL1CaPcpsAssistedAcquisition::connect(gr::top_block_sptr top_block) void GpsL1CaPcpsAssistedAcquisition::connect(gr::top_block_sptr top_block)
{ {
if(top_block) { /* top_block is not null */}; if(top_block) { /* top_block is not null */};
//nothing to disconnect, now the tracking uses gr_sync_decimator //nothing to disconnect, now the tracking uses gr_sync_decimator
} }
void GpsL1CaPcpsAssistedAcquisition::disconnect(gr::top_block_sptr top_block) void GpsL1CaPcpsAssistedAcquisition::disconnect(gr::top_block_sptr top_block)
{ {
if(top_block) { /* top_block is not null */}; if(top_block) { /* top_block is not null */};
//nothing to disconnect, now the tracking uses gr_sync_decimator //nothing to disconnect, now the tracking uses gr_sync_decimator
} }

View File

@ -30,11 +30,8 @@
*/ */
#include "gps_l1_ca_pcps_multithread_acquisition.h" #include "gps_l1_ca_pcps_multithread_acquisition.h"
#include <iostream>
#include <stdexcept>
#include <boost/math/distributions/exponential.hpp> #include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/msg_queue.h>
#include "gps_sdr_signal_processing.h" #include "gps_sdr_signal_processing.h"
#include "GPS_L1_CA.h" #include "GPS_L1_CA.h"
#include "configuration_interface.h" #include "configuration_interface.h"
@ -83,7 +80,7 @@ GpsL1CaPcpsMultithreadAcquisition::GpsL1CaPcpsMultithreadAcquisition(
vector_length_ = code_length_ * sampled_ms_; vector_length_ = code_length_ * sampled_ms_;
code_= new gr_complex[vector_length_]; code_ = new gr_complex[vector_length_];
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {

View File

@ -30,11 +30,8 @@
*/ */
#include "gps_l1_ca_pcps_opencl_acquisition.h" #include "gps_l1_ca_pcps_opencl_acquisition.h"
#include <iostream>
#include <stdexcept>
#include <boost/math/distributions/exponential.hpp> #include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/msg_queue.h>
#include "gps_sdr_signal_processing.h" #include "gps_sdr_signal_processing.h"
#include "GPS_L1_CA.h" #include "GPS_L1_CA.h"
#include "configuration_interface.h" #include "configuration_interface.h"

View File

@ -31,12 +31,8 @@
*/ */
#include "gps_l1_ca_pcps_quicksync_acquisition.h" #include "gps_l1_ca_pcps_quicksync_acquisition.h"
#include <iostream>
#include <cmath>
#include <stdexcept>
#include <boost/math/distributions/exponential.hpp> #include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/msg_queue.h>
#include "gps_sdr_signal_processing.h" #include "gps_sdr_signal_processing.h"
#include "GPS_L1_CA.h" #include "GPS_L1_CA.h"
#include "configuration_interface.h" #include "configuration_interface.h"
@ -49,7 +45,7 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition(
ConfigurationInterface* configuration, std::string role, ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams, unsigned int in_streams, unsigned int out_streams,
gr::msg_queue::sptr queue) : gr::msg_queue::sptr queue) :
role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue) role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue)
{ {
configuration_ = configuration; configuration_ = configuration;
std::string default_item_type = "gr_complex"; std::string default_item_type = "gr_complex";
@ -92,7 +88,7 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition(
<< sampled_ms_ << " ms will be used instead."; << sampled_ms_ << " ms will be used instead.";
} }
vector_length_ = code_length_ * sampled_ms_; vector_length_ = code_length_ * sampled_ms_;
bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
if (!bit_transition_flag_) if (!bit_transition_flag_)
@ -110,11 +106,11 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition(
code_ = new gr_complex[code_length_](); code_ = new gr_complex[code_length_]();
/*Object relevant information for debugging*/ /*Object relevant information for debugging*/
LOG(INFO) << "Implementation: " << this->implementation() LOG(INFO) << "Implementation: " << this->implementation()
<< ", Vector Length: " << vector_length_ << ", Vector Length: " << vector_length_
<< ", Samples per ms: " << samples_per_ms << ", Samples per ms: " << samples_per_ms
<< ", Folding factor: " << folding_factor_ << ", Folding factor: " << folding_factor_
<< ", Sampled ms: " << sampled_ms_ << ", Sampled ms: " << sampled_ms_
<< ", Code Length: " << code_length_; << ", Code Length: " << code_length_;
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
@ -179,7 +175,7 @@ void GpsL1CaPcpsQuickSyncAcquisition::set_threshold(float threshold)
threshold_ = calculate_threshold(pfa); threshold_ = calculate_threshold(pfa);
} }
DLOG(INFO) <<"Channel "<<channel_<<" Threshold = " << threshold_; DLOG(INFO) << "Channel "<< channel_ << " Threshold = " << threshold_;
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
@ -205,7 +201,6 @@ void GpsL1CaPcpsQuickSyncAcquisition::set_doppler_step(unsigned int doppler_step
{ {
acquisition_cc_->set_doppler_step(doppler_step_); acquisition_cc_->set_doppler_step(doppler_step_);
} }
} }
@ -261,10 +256,10 @@ void GpsL1CaPcpsQuickSyncAcquisition::set_local_code()
for (unsigned int i = 0; i < (sampled_ms_/folding_factor_); i++) for (unsigned int i = 0; i < (sampled_ms_/folding_factor_); i++)
{ {
memcpy(&(code_[i*code_length_]), code, memcpy(&(code_[i*code_length_]), code,
sizeof(gr_complex)*code_length_); sizeof(gr_complex)*code_length_);
} }
//memcpy(code_, code,sizeof(gr_complex)*code_length_); //memcpy(code_, code,sizeof(gr_complex)*code_length_);
acquisition_cc_->set_local_code(code_); acquisition_cc_->set_local_code(code_);

View File

@ -30,11 +30,8 @@
*/ */
#include "gps_l1_ca_pcps_tong_acquisition.h" #include "gps_l1_ca_pcps_tong_acquisition.h"
#include <iostream>
#include <stdexcept>
#include <boost/math/distributions/exponential.hpp> #include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/msg_queue.h>
#include "gps_sdr_signal_processing.h" #include "gps_sdr_signal_processing.h"
#include "GPS_L1_CA.h" #include "GPS_L1_CA.h"
#include "configuration_interface.h" #include "configuration_interface.h"
@ -54,8 +51,7 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition(
DLOG(INFO) << "role " << role; DLOG(INFO) << "role " << role;
item_type_ = configuration_->property(role + ".item_type", item_type_ = configuration_->property(role + ".item_type", default_item_type);
default_item_type);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
if_ = configuration_->property(role + ".ifreq", 0); if_ = configuration_->property(role + ".ifreq", 0);
@ -66,8 +62,7 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition(
tong_init_val_ = configuration->property(role + ".tong_init_val", 1); tong_init_val_ = configuration->property(role + ".tong_init_val", 1);
tong_max_val_ = configuration->property(role + ".tong_max_val", 2); tong_max_val_ = configuration->property(role + ".tong_max_val", 2);
dump_filename_ = configuration_->property(role + ".dump_filename", dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
default_dump_filename);
//--- Find number of samples per spreading code ------------------------- //--- Find number of samples per spreading code -------------------------
code_length_ = round(fs_in_ code_length_ = round(fs_in_
@ -75,7 +70,7 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition(
vector_length_ = code_length_ * sampled_ms_; vector_length_ = code_length_ * sampled_ms_;
code_= new gr_complex[vector_length_]; code_ = new gr_complex[vector_length_];
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
@ -86,10 +81,8 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition(
stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_); 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) << "stream_to_vector(" << stream_to_vector_->unique_id() << ")";
<< ")"; DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id()
<< ")";
} }
else else
{ {
@ -125,22 +118,22 @@ void GpsL1CaPcpsTongAcquisition::set_channel(unsigned int channel)
void GpsL1CaPcpsTongAcquisition::set_threshold(float threshold) void GpsL1CaPcpsTongAcquisition::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) if (item_type_.compare("gr_complex") == 0)
{ {
@ -230,6 +223,7 @@ void GpsL1CaPcpsTongAcquisition::set_local_code()
} }
} }
void GpsL1CaPcpsTongAcquisition::reset() void GpsL1CaPcpsTongAcquisition::reset()
{ {
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
@ -238,6 +232,7 @@ void GpsL1CaPcpsTongAcquisition::reset()
} }
} }
void GpsL1CaPcpsTongAcquisition::set_state(int state) void GpsL1CaPcpsTongAcquisition::set_state(int state)
{ {
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
@ -246,28 +241,29 @@ void GpsL1CaPcpsTongAcquisition::set_state(int state)
} }
} }
float GpsL1CaPcpsTongAcquisition::calculate_threshold(float pfa) float GpsL1CaPcpsTongAcquisition::calculate_threshold(float pfa)
{ {
//Calculate the threshold //Calculate the threshold
unsigned int frequency_bins = 0;
unsigned int frequency_bins = 0; for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_)
for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_)
{ {
frequency_bins++; frequency_bins++;
} }
DLOG(INFO) << "Channel "<< channel_ <<" Pfa = "<< pfa; DLOG(INFO) << "Channel "<< channel_ <<" Pfa = "<< pfa;
unsigned int ncells = vector_length_ * frequency_bins; unsigned int ncells = vector_length_ * frequency_bins;
double exponent = 1 / static_cast<double>(ncells); double exponent = 1 / static_cast<double>(ncells);
double val = pow(1.0 - pfa,exponent); double val = pow(1.0 - pfa,exponent);
double lambda = double(vector_length_); double lambda = double(vector_length_);
boost::math::exponential_distribution<double> mydist (lambda); boost::math::exponential_distribution<double> mydist (lambda);
float threshold = (float)quantile(mydist, val); float threshold = (float)quantile(mydist, val);
return threshold; return threshold;
} }
void GpsL1CaPcpsTongAcquisition::connect(gr::top_block_sptr top_block) void GpsL1CaPcpsTongAcquisition::connect(gr::top_block_sptr top_block)
{ {
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)

View File

@ -32,12 +32,8 @@
*/ */
#include "gps_l2_m_pcps_acquisition.h" #include "gps_l2_m_pcps_acquisition.h"
#include <iostream>
#include <fstream>
#include <stdexcept>
#include <boost/math/distributions/exponential.hpp> #include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/msg_queue.h>
#include "gps_l2c_signal.h" #include "gps_l2c_signal.h"
#include "GPS_L2C.h" #include "GPS_L2C.h"
#include "configuration_interface.h" #include "configuration_interface.h"
@ -57,8 +53,7 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition(
LOG(INFO) << "role " << role; LOG(INFO) << "role " << role;
item_type_ = configuration_->property(role + ".item_type", item_type_ = configuration_->property(role + ".item_type", default_item_type);
default_item_type);
//float pfa = configuration_->property(role + ".pfa", 0.0); //float pfa = configuration_->property(role + ".pfa", 0.0);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
@ -77,16 +72,15 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition(
max_dwells_ = 2; max_dwells_ = 2;
} }
dump_filename_ = configuration_->property(role + ".dump_filename", dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
default_dump_filename);
//--- Find number of samples per spreading code ------------------------- //--- Find number of samples per spreading code -------------------------
code_length_ = round((double)fs_in_ code_length_ = round(static_cast<double>(fs_in_)
/ (GPS_L2_M_CODE_RATE_HZ / (double)GPS_L2_M_CODE_LENGTH_CHIPS)); / (GPS_L2_M_CODE_RATE_HZ / static_cast<double>(GPS_L2_M_CODE_LENGTH_CHIPS)));
vector_length_ = code_length_; vector_length_ = code_length_;
code_= new gr_complex[vector_length_]; code_ = new gr_complex[vector_length_];
// if (item_type_.compare("gr_complex") == 0 ) // if (item_type_.compare("gr_complex") == 0 )
// { // {
@ -161,11 +155,11 @@ void GpsL2MPcpsAcquisition::set_threshold(float threshold)
threshold_ = calculate_threshold(pfa); threshold_ = calculate_threshold(pfa);
} }
DLOG(INFO) <<"Channel "<<channel_<<" Threshold = " << threshold_; DLOG(INFO) << "Channel " << channel_ <<" Threshold = " << threshold_;
// if (item_type_.compare("gr_complex") == 0) // if (item_type_.compare("gr_complex") == 0)
// { // {
acquisition_cc_->set_threshold(threshold_); acquisition_cc_->set_threshold(threshold_);
// } // }
} }
@ -277,13 +271,13 @@ float GpsL2MPcpsAcquisition::calculate_threshold(float pfa)
{ {
//Calculate the threshold //Calculate the threshold
unsigned int frequency_bins = 0; unsigned int frequency_bins = 0;
for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_) for (int doppler = static_cast<int>(-doppler_max_); doppler <= static_cast<int>(doppler_max_); doppler += doppler_step_)
{ {
frequency_bins++; frequency_bins++;
} }
DLOG(INFO) << "Channel " << channel_<< " Pfa = " << pfa; DLOG(INFO) << "Channel " << channel_<< " Pfa = " << pfa;
unsigned int ncells = vector_length_ * frequency_bins; unsigned int ncells = vector_length_ * frequency_bins;
double exponent = 1 / static_cast<double>(ncells); double exponent = 1.0 / static_cast<double>(ncells);
double val = pow(1.0 - pfa, exponent); double val = pow(1.0 - pfa, exponent);
double lambda = double(vector_length_); double lambda = double(vector_length_);
boost::math::exponential_distribution<double> mydist (lambda); boost::math::exponential_distribution<double> mydist (lambda);

View File

@ -52,8 +52,6 @@
#include <fstream> #include <fstream>
#include <string> #include <string>
#include <boost/thread/mutex.hpp>
#include <boost/thread/thread.hpp>
#include <gnuradio/block.h> #include <gnuradio/block.h>
#include <gnuradio/msg_queue.h> #include <gnuradio/msg_queue.h>
#include <gnuradio/gr_complex.h> #include <gnuradio/gr_complex.h>
@ -225,7 +223,6 @@ public:
d_doppler_step = doppler_step; d_doppler_step = doppler_step;
} }
/*! /*!
* \brief Set tracking channel internal queue. * \brief Set tracking channel internal queue.
* \param channel_internal_queue - Channel's internal blocks information queue. * \param channel_internal_queue - Channel's internal blocks information queue.

View File

@ -51,10 +51,8 @@ class ConfigurationInterface;
*/ */
class GalileoE1DllPllVemlTracking : public TrackingInterface class GalileoE1DllPllVemlTracking : public TrackingInterface
{ {
public: public:
GalileoE1DllPllVemlTracking(ConfigurationInterface* configuration,
GalileoE1DllPllVemlTracking(ConfigurationInterface* configuration,
std::string role, std::string role,
unsigned int in_streams, unsigned int in_streams,
unsigned int out_streams, unsigned int out_streams,
@ -103,12 +101,9 @@ public:
void start_tracking(); void start_tracking();
private: private:
galileo_e1_dll_pll_veml_tracking_cc_sptr tracking_; galileo_e1_dll_pll_veml_tracking_cc_sptr tracking_;
size_t item_size_; size_t item_size_;
unsigned int channel_; unsigned int channel_;
std::string role_; std::string role_;
unsigned int in_streams_; unsigned int in_streams_;
unsigned int out_streams_; unsigned int out_streams_;

View File

@ -52,10 +52,8 @@ class ConfigurationInterface;
*/ */
class GalileoE1TcpConnectorTracking : public TrackingInterface class GalileoE1TcpConnectorTracking : public TrackingInterface
{ {
public: public:
GalileoE1TcpConnectorTracking(ConfigurationInterface* configuration,
GalileoE1TcpConnectorTracking(ConfigurationInterface* configuration,
std::string role, std::string role,
unsigned int in_streams, unsigned int in_streams,
unsigned int out_streams, unsigned int out_streams,
@ -67,6 +65,7 @@ public:
{ {
return role_; return role_;
} }
//! Returns "Galileo_E1_TCP_CONNECTOR_Tracking" //! Returns "Galileo_E1_TCP_CONNECTOR_Tracking"
std::string implementation() std::string implementation()
{ {
@ -103,12 +102,9 @@ public:
void start_tracking(); void start_tracking();
private: private:
galileo_e1_tcp_connector_tracking_cc_sptr tracking_; galileo_e1_tcp_connector_tracking_cc_sptr tracking_;
size_t item_size_; size_t item_size_;
unsigned int channel_; unsigned int channel_;
std::string role_; std::string role_;
unsigned int in_streams_; unsigned int in_streams_;
unsigned int out_streams_; unsigned int out_streams_;

View File

@ -53,7 +53,6 @@ class ConfigurationInterface;
class GalileoE5aDllPllTracking : public TrackingInterface class GalileoE5aDllPllTracking : public TrackingInterface
{ {
public: public:
GalileoE5aDllPllTracking(ConfigurationInterface* configuration, GalileoE5aDllPllTracking(ConfigurationInterface* configuration,
std::string role, std::string role,
unsigned int in_streams, unsigned int in_streams,
@ -82,7 +81,6 @@ public:
gr::basic_block_sptr get_left_block(); gr::basic_block_sptr get_left_block();
gr::basic_block_sptr get_right_block(); gr::basic_block_sptr get_right_block();
/*! /*!
* \brief Set tracking channel unique ID * \brief Set tracking channel unique ID
*/ */

View File

@ -51,10 +51,8 @@ class ConfigurationInterface;
*/ */
class GalileoVolkE1DllPllVemlTracking : public TrackingInterface class GalileoVolkE1DllPllVemlTracking : public TrackingInterface
{ {
public: public:
GalileoVolkE1DllPllVemlTracking(ConfigurationInterface* configuration,
GalileoVolkE1DllPllVemlTracking(ConfigurationInterface* configuration,
std::string role, std::string role,
unsigned int in_streams, unsigned int in_streams,
unsigned int out_streams, unsigned int out_streams,
@ -103,12 +101,9 @@ public:
void start_tracking(); void start_tracking();
private: private:
galileo_volk_e1_dll_pll_veml_tracking_cc_sptr tracking_; galileo_volk_e1_dll_pll_veml_tracking_cc_sptr tracking_;
size_t item_size_; size_t item_size_;
unsigned int channel_; unsigned int channel_;
std::string role_; std::string role_;
unsigned int in_streams_; unsigned int in_streams_;
unsigned int out_streams_; unsigned int out_streams_;

View File

@ -52,7 +52,7 @@ class ConfigurationInterface;
class GpsL1CaDllFllPllTracking : public TrackingInterface class GpsL1CaDllFllPllTracking : public TrackingInterface
{ {
public: public:
GpsL1CaDllFllPllTracking(ConfigurationInterface* configuration, GpsL1CaDllFllPllTracking(ConfigurationInterface* configuration,
std::string role, std::string role,
unsigned int in_streams, unsigned int in_streams,
unsigned int out_streams, unsigned int out_streams,

View File

@ -37,8 +37,7 @@
*/ */
#include "gps_l1_ca_dll_pll_optim_tracking.h" #include "gps_l1_ca_dll_pll_optim_tracking.h"
#include <boost/math/special_functions/round.hpp> #include <cmath>
#include <gnuradio/io_signature.h>
#include <glog/logging.h> #include <glog/logging.h>
#include "GPS_L1_CA.h" #include "GPS_L1_CA.h"
#include "configuration_interface.h" #include "configuration_interface.h"

View File

@ -64,7 +64,6 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking(
float dll_bw_hz; float dll_bw_hz;
float early_late_space_chips; float early_late_space_chips;
item_type = configuration->property(role + ".item_type", default_item_type); item_type = configuration->property(role + ".item_type", default_item_type);
//vector_length = configuration->property(role + ".vector_length", 2048);
fs_in = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
f_if = configuration->property(role + ".if", 0); f_if = configuration->property(role + ".if", 0);
dump = configuration->property(role + ".dump", false); dump = configuration->property(role + ".dump", false);
@ -72,8 +71,7 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking(
dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0);
early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5);
std::string default_dump_filename = "./track_ch"; std::string default_dump_filename = "./track_ch";
dump_filename = configuration->property(role + ".dump_filename", dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); //unused!
default_dump_filename); //unused!
vector_length = std::round(fs_in / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); vector_length = std::round(fs_in / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS));
//################# MAKE TRACKING GNURadio object ################### //################# MAKE TRACKING GNURadio object ###################
@ -111,6 +109,7 @@ void GpsL1CaDllPllTracking::start_tracking()
tracking_->start_tracking(); tracking_->start_tracking();
} }
/* /*
* Set tracking channel unique ID * Set tracking channel unique ID
*/ */
@ -120,6 +119,7 @@ void GpsL1CaDllPllTracking::set_channel(unsigned int channel)
tracking_->set_channel(channel); tracking_->set_channel(channel);
} }
/* /*
* Set tracking channel internal queue * Set tracking channel internal queue
*/ */
@ -130,28 +130,33 @@ void GpsL1CaDllPllTracking::set_channel_queue(
tracking_->set_channel_queue(channel_internal_queue_); tracking_->set_channel_queue(channel_internal_queue_);
} }
void GpsL1CaDllPllTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) void GpsL1CaDllPllTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{ {
tracking_->set_gnss_synchro(p_gnss_synchro); tracking_->set_gnss_synchro(p_gnss_synchro);
} }
void GpsL1CaDllPllTracking::connect(gr::top_block_sptr top_block) void GpsL1CaDllPllTracking::connect(gr::top_block_sptr top_block)
{ {
if(top_block) { /* top_block is not null */}; if(top_block) { /* top_block is not null */};
//nothing to connect, now the tracking uses gr_sync_decimator //nothing to connect, now the tracking uses gr_sync_decimator
} }
void GpsL1CaDllPllTracking::disconnect(gr::top_block_sptr top_block) void GpsL1CaDllPllTracking::disconnect(gr::top_block_sptr top_block)
{ {
if(top_block) { /* top_block is not null */}; if(top_block) { /* top_block is not null */};
//nothing to disconnect, now the tracking uses gr_sync_decimator //nothing to disconnect, now the tracking uses gr_sync_decimator
} }
gr::basic_block_sptr GpsL1CaDllPllTracking::get_left_block() gr::basic_block_sptr GpsL1CaDllPllTracking::get_left_block()
{ {
return tracking_; return tracking_;
} }
gr::basic_block_sptr GpsL1CaDllPllTracking::get_right_block() gr::basic_block_sptr GpsL1CaDllPllTracking::get_right_block()
{ {
return tracking_; return tracking_;

View File

@ -52,8 +52,7 @@ class ConfigurationInterface;
class GpsL1CaDllPllTracking : public TrackingInterface class GpsL1CaDllPllTracking : public TrackingInterface
{ {
public: public:
GpsL1CaDllPllTracking(ConfigurationInterface* configuration,
GpsL1CaDllPllTracking(ConfigurationInterface* configuration,
std::string role, std::string role,
unsigned int in_streams, unsigned int in_streams,
unsigned int out_streams, unsigned int out_streams,
@ -71,6 +70,7 @@ public:
{ {
return "GPS_L1_CA_DLL_PLL_Tracking"; return "GPS_L1_CA_DLL_PLL_Tracking";
} }
size_t item_size() size_t item_size()
{ {
return item_size_; return item_size_;

View File

@ -52,8 +52,7 @@ class ConfigurationInterface;
class GpsL2MDllPllTracking : public TrackingInterface class GpsL2MDllPllTracking : public TrackingInterface
{ {
public: public:
GpsL2MDllPllTracking(ConfigurationInterface* configuration,
GpsL2MDllPllTracking(ConfigurationInterface* configuration,
std::string role, std::string role,
unsigned int in_streams, unsigned int in_streams,
unsigned int out_streams, unsigned int out_streams,
@ -71,6 +70,7 @@ public:
{ {
return "gps_l2_m_dll_pll_tracking"; return "gps_l2_m_dll_pll_tracking";
} }
size_t item_size() size_t item_size()
{ {
return item_size_; return item_size_;