From f2a537e40311e5d01453eecbdbfc26b92dbf809f Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 24 Nov 2019 11:33:32 +0100 Subject: [PATCH] Remove old code from acquisition adapters --- .../adapters/beidou_b1i_pcps_acquisition.cc | 31 +-------------- .../adapters/beidou_b1i_pcps_acquisition.h | 1 - .../adapters/beidou_b3i_pcps_acquisition.cc | 35 +---------------- .../adapters/beidou_b3i_pcps_acquisition.h | 1 - .../galileo_e1_pcps_ambiguous_acquisition.cc | 39 +------------------ .../galileo_e1_pcps_ambiguous_acquisition.h | 1 - .../adapters/galileo_e5a_pcps_acquisition.cc | 39 +------------------ .../adapters/galileo_e5a_pcps_acquisition.h | 1 - .../glonass_l1_ca_pcps_acquisition.cc | 39 +------------------ .../adapters/glonass_l1_ca_pcps_acquisition.h | 1 - .../glonass_l2_ca_pcps_acquisition.cc | 39 +------------------ .../adapters/glonass_l2_ca_pcps_acquisition.h | 1 - .../adapters/gps_l1_ca_pcps_acquisition.cc | 34 +--------------- .../adapters/gps_l1_ca_pcps_acquisition.h | 1 - .../adapters/gps_l2_m_pcps_acquisition.cc | 38 +----------------- .../adapters/gps_l2_m_pcps_acquisition.h | 1 - .../adapters/gps_l5i_pcps_acquisition.cc | 38 +----------------- .../adapters/gps_l5i_pcps_acquisition.h | 1 - .../gnuradio_blocks/pcps_acquisition.cc | 12 +----- src/algorithms/acquisition/libs/acq_conf.cc | 2 +- 20 files changed, 11 insertions(+), 344 deletions(-) diff --git a/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.cc index f177dd3a8..ee40d981d 100644 --- a/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.cc @@ -37,7 +37,6 @@ #include "beidou_b1i_signal_processing.h" #include "configuration_interface.h" #include "gnss_sdr_flags.h" -#include #include #include #include @@ -103,18 +102,7 @@ void BeidouB1iPcpsAcquisition::stop_acquisition() void BeidouB1iPcpsAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + ".pfa", 0.0); - - if (pfa == 0.0) - { - threshold_ = threshold; - } - else - { - threshold_ = calculate_threshold(pfa); - } - - DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; + threshold_ = threshold; acquisition_->set_threshold(threshold_); } @@ -185,23 +173,6 @@ void BeidouB1iPcpsAcquisition::set_state(int state) } -float BeidouB1iPcpsAcquisition::calculate_threshold(float pfa) -{ - // Calculate the threshold - uint32_t frequency_bins = 0; - frequency_bins = (2 * doppler_max_ + doppler_step_) / doppler_step_; - DLOG(INFO) << "Channel " << channel_ << " Pfa = " << pfa; - uint32_t ncells = vector_length_ * frequency_bins; - double exponent = 1 / static_cast(ncells); - double val = pow(1.0 - pfa, exponent); - auto lambda = static_cast(vector_length_); - boost::math::exponential_distribution mydist(lambda); - auto threshold = static_cast(quantile(mydist, val)); - - return threshold; -} - - void BeidouB1iPcpsAcquisition::connect(gr::top_block_sptr top_block) { if (item_type_ == "gr_complex") diff --git a/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.h b/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.h index b80804a18..056077a29 100644 --- a/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.h @@ -183,7 +183,6 @@ private: unsigned int num_codes_; unsigned int in_streams_; unsigned int out_streams_; - float calculate_threshold(float pfa); }; #endif /* GNSS_SDR_BEIDOU_B1I_PCPS_ACQUISITION_H_ */ diff --git a/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.cc index b41df23af..709d1b4fb 100644 --- a/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.cc @@ -35,7 +35,6 @@ #include "beidou_b3i_signal_processing.h" #include "configuration_interface.h" #include "gnss_sdr_flags.h" -#include #include #include @@ -101,22 +100,7 @@ void BeidouB3iPcpsAcquisition::stop_acquisition() void BeidouB3iPcpsAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); - - if (pfa == 0.0) - { - pfa = configuration_->property(role_ + ".pfa", 0.0); - } - if (pfa == 0.0) - { - threshold_ = threshold; - } - else - { - threshold_ = calculate_threshold(pfa); - } - - DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; + threshold_ = threshold; acquisition_->set_threshold(threshold_); } @@ -186,23 +170,6 @@ void BeidouB3iPcpsAcquisition::set_state(int state) } -float BeidouB3iPcpsAcquisition::calculate_threshold(float pfa) -{ - // Calculate the threshold - unsigned int frequency_bins = 0; - frequency_bins = (2 * doppler_max_ + doppler_step_) / doppler_step_; - DLOG(INFO) << "Channel " << channel_ << " Pfa = " << pfa; - unsigned int ncells = vector_length_ * frequency_bins; - double exponent = 1.0 / static_cast(ncells); - double val = pow(1.0 - pfa, exponent); - auto lambda = static_cast(vector_length_); - boost::math::exponential_distribution mydist(lambda); - auto threshold = static_cast(quantile(mydist, val)); - - return threshold; -} - - void BeidouB3iPcpsAcquisition::connect(gr::top_block_sptr top_block) { if (item_type_ == "gr_complex") diff --git a/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.h b/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.h index 54c26aac9..920d7e0b2 100644 --- a/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.h @@ -182,7 +182,6 @@ private: unsigned int num_codes_; unsigned int in_streams_; unsigned int out_streams_; - float calculate_threshold(float pfa); }; #endif /* GNSS_SDR_BEIDOU_B3I_PCPS_ACQUISITION_H_ */ diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc index 2c26e60cc..53699d384 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc @@ -103,23 +103,7 @@ void GalileoE1PcpsAmbiguousAcquisition::stop_acquisition() void GalileoE1PcpsAmbiguousAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); - - if (pfa == 0.0) - { - pfa = configuration_->property(role_ + ".pfa", 0.0); - } - - if (pfa == 0.0) - { - threshold_ = threshold; - } - else - { - threshold_ = calculate_threshold(pfa); - } - - DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; + threshold_ = threshold; acquisition_->set_threshold(threshold_); } @@ -231,27 +215,6 @@ void GalileoE1PcpsAmbiguousAcquisition::set_state(int state) } -float GalileoE1PcpsAmbiguousAcquisition::calculate_threshold(float pfa) -{ - unsigned int frequency_bins = 0; - for (int doppler = static_cast(-doppler_max_); doppler <= static_cast(doppler_max_); doppler += doppler_step_) - { - frequency_bins++; - } - - DLOG(INFO) << "Channel " << channel_ << " Pfa = " << pfa; - - unsigned int ncells = vector_length_ * frequency_bins; - double exponent = 1 / static_cast(ncells); - double val = pow(1.0 - pfa, exponent); - auto lambda = static_cast(vector_length_); - boost::math::exponential_distribution mydist(lambda); - auto threshold = static_cast(quantile(mydist, val)); - - return threshold; -} - - void GalileoE1PcpsAmbiguousAcquisition::connect(gr::top_block_sptr top_block) { if (item_type_ == "gr_complex") diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.h index 2870ebe0f..0d0623f51 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.h @@ -188,7 +188,6 @@ private: std::string role_; unsigned int in_streams_; unsigned int out_streams_; - float calculate_threshold(float pfa); }; #endif /* GNSS_SDR_GALILEO_E1_PCPS_AMBIGUOUS_ACQUISITION_H_ */ diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc index 1bf013a3e..e24a52863 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc @@ -34,7 +34,6 @@ #include "configuration_interface.h" #include "galileo_e5_signal_processing.h" #include "gnss_sdr_flags.h" -#include #include #include #include @@ -103,24 +102,7 @@ void GalileoE5aPcpsAcquisition::stop_acquisition() void GalileoE5aPcpsAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); - - if (pfa == 0.0) - { - pfa = configuration_->property(role_ + ".pfa", 0.0); - } - - if (pfa == 0.0) - { - threshold_ = threshold; - } - - else - { - threshold_ = calculate_threshold(pfa); - } - - DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; + threshold_ = threshold; acquisition_->set_threshold(threshold_); } @@ -211,25 +193,6 @@ void GalileoE5aPcpsAcquisition::reset() } -float GalileoE5aPcpsAcquisition::calculate_threshold(float pfa) -{ - unsigned int frequency_bins = 0; - for (int doppler = static_cast(-doppler_max_); doppler <= static_cast(doppler_max_); doppler += doppler_step_) - { - frequency_bins++; - } - DLOG(INFO) << "Channel " << channel_ << " Pfa = " << pfa; - unsigned int ncells = vector_length_ * frequency_bins; - double exponent = 1 / static_cast(ncells); - double val = pow(1.0 - pfa, exponent); - auto lambda = static_cast(vector_length_); - boost::math::exponential_distribution mydist(lambda); - auto threshold = static_cast(quantile(mydist, val)); - - return threshold; -} - - void GalileoE5aPcpsAcquisition::set_state(int state) { acquisition_->set_state(state); diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h index 136720090..e32812a0c 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h @@ -154,7 +154,6 @@ public: void set_resampler_latency(uint32_t latency_samples) override; private: - float calculate_threshold(float pfa); ConfigurationInterface* configuration_; pcps_acquisition_sptr acquisition_; Acq_Conf acq_parameters_; diff --git a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc index 8f750ec0b..15c49392b 100644 --- a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc @@ -37,7 +37,6 @@ #include "configuration_interface.h" #include "glonass_l1_signal_processing.h" #include "gnss_sdr_flags.h" -#include #include #include @@ -104,18 +103,7 @@ void GlonassL1CaPcpsAcquisition::stop_acquisition() void GlonassL1CaPcpsAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + ".pfa", 0.0); - - if (pfa == 0.0) - { - threshold_ = threshold; - } - else - { - threshold_ = calculate_threshold(pfa); - } - - DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; + threshold_ = threshold; acquisition_->set_threshold(threshold_); } @@ -187,31 +175,6 @@ void GlonassL1CaPcpsAcquisition::set_state(int state) } -float GlonassL1CaPcpsAcquisition::calculate_threshold(float pfa) -{ - // Calculate the threshold - unsigned int frequency_bins = 0; - /* - for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_) - { - frequency_bins++; - } - */ - - frequency_bins = (2 * doppler_max_ + doppler_step_) / doppler_step_; - - DLOG(INFO) << "Channel " << channel_ << " Pfa = " << pfa; - unsigned int ncells = vector_length_ * frequency_bins; - double exponent = 1 / static_cast(ncells); - double val = pow(1.0 - pfa, exponent); - auto lambda = static_cast(vector_length_); - boost::math::exponential_distribution mydist(lambda); - auto threshold = static_cast(quantile(mydist, val)); - - return threshold; -} - - void GlonassL1CaPcpsAcquisition::connect(gr::top_block_sptr top_block) { if (item_type_ == "gr_complex") diff --git a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.h b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.h index bcd992929..4fc401ba4 100644 --- a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.h @@ -178,7 +178,6 @@ private: std::string role_; unsigned int in_streams_; unsigned int out_streams_; - float calculate_threshold(float pfa); }; #endif /* GNSS_SDR_GLONASS_L1_CA_PCPS_ACQUISITION_H_ */ diff --git a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc index d198e526f..a94ced25d 100644 --- a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc @@ -36,7 +36,6 @@ #include "configuration_interface.h" #include "glonass_l2_signal_processing.h" #include "gnss_sdr_flags.h" -#include #include #include @@ -103,18 +102,7 @@ void GlonassL2CaPcpsAcquisition::stop_acquisition() void GlonassL2CaPcpsAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + ".pfa", 0.0); - - if (pfa == 0.0) - { - threshold_ = threshold; - } - else - { - threshold_ = calculate_threshold(pfa); - } - - DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; + threshold_ = threshold; acquisition_->set_threshold(threshold_); } @@ -186,31 +174,6 @@ void GlonassL2CaPcpsAcquisition::set_state(int state) } -float GlonassL2CaPcpsAcquisition::calculate_threshold(float pfa) -{ - // Calculate the threshold - unsigned int frequency_bins = 0; - /* - for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_) - { - frequency_bins++; - } - */ - - frequency_bins = (2 * doppler_max_ + doppler_step_) / doppler_step_; - - DLOG(INFO) << "Channel " << channel_ << " Pfa = " << pfa; - unsigned int ncells = vector_length_ * frequency_bins; - double exponent = 1 / static_cast(ncells); - double val = pow(1.0 - pfa, exponent); - auto lambda = static_cast(vector_length_); - boost::math::exponential_distribution mydist(lambda); - auto threshold = static_cast(quantile(mydist, val)); - - return threshold; -} - - void GlonassL2CaPcpsAcquisition::connect(gr::top_block_sptr top_block) { if (item_type_ == "gr_complex") diff --git a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.h b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.h index c98e47db5..5e5e7469d 100644 --- a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.h @@ -177,7 +177,6 @@ private: std::string role_; unsigned int in_streams_; unsigned int out_streams_; - float calculate_threshold(float pfa); }; #endif /* GNSS_SDR_GLONASS_L2_CA_PCPS_ACQUISITION_H_ */ diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc index 3b7fa3cf9..8a70ed971 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc @@ -39,7 +39,6 @@ #include "configuration_interface.h" #include "gnss_sdr_flags.h" #include "gps_sdr_signal_processing.h" -#include #include #include #include @@ -107,18 +106,7 @@ void GpsL1CaPcpsAcquisition::stop_acquisition() void GpsL1CaPcpsAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + ".pfa", 0.0); - - if (pfa == 0.0) - { - threshold_ = threshold; - } - else - { - threshold_ = calculate_threshold(pfa); - } - - DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; + threshold_ = threshold; acquisition_->set_threshold(threshold_); } @@ -202,26 +190,6 @@ void GpsL1CaPcpsAcquisition::set_state(int state) } -float GpsL1CaPcpsAcquisition::calculate_threshold(float pfa) -{ - // Calculate the threshold - unsigned int frequency_bins = 0; - for (int doppler = static_cast(-doppler_max_); doppler <= static_cast(doppler_max_); doppler += doppler_step_) - { - frequency_bins++; - } - DLOG(INFO) << "Channel " << channel_ << " Pfa = " << pfa; - unsigned int ncells = vector_length_ * frequency_bins; - double exponent = 1 / static_cast(ncells); - double val = pow(1.0 - pfa, exponent); - auto lambda = static_cast(vector_length_); - boost::math::exponential_distribution mydist(lambda); - auto threshold = static_cast(quantile(mydist, val)); - - return threshold; -} - - void GpsL1CaPcpsAcquisition::connect(gr::top_block_sptr top_block) { if (item_type_ == "gr_complex") diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h index 0bd8e1c7b..7a933e584 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h @@ -190,7 +190,6 @@ private: std::string role_; unsigned int in_streams_; unsigned int out_streams_; - float calculate_threshold(float pfa); }; #endif /* GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_H_ */ diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc index 673067b19..aea3082b6 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc @@ -37,7 +37,6 @@ #include "configuration_interface.h" #include "gnss_sdr_flags.h" #include "gps_l2c_signal.h" -#include #include #include @@ -103,22 +102,7 @@ void GpsL2MPcpsAcquisition::stop_acquisition() void GpsL2MPcpsAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); - - if (pfa == 0.0) - { - pfa = configuration_->property(role_ + ".pfa", 0.0); - } - if (pfa == 0.0) - { - threshold_ = threshold; - } - else - { - threshold_ = calculate_threshold(pfa); - } - - DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; + threshold_ = threshold; acquisition_->set_threshold(threshold_); } @@ -205,26 +189,6 @@ void GpsL2MPcpsAcquisition::set_state(int state) } -float GpsL2MPcpsAcquisition::calculate_threshold(float pfa) -{ - // Calculate the threshold - unsigned int frequency_bins = 0; - for (int doppler = static_cast(-doppler_max_); doppler <= static_cast(doppler_max_); doppler += doppler_step_) - { - frequency_bins++; - } - DLOG(INFO) << "Channel " << channel_ << " Pfa = " << pfa; - unsigned int ncells = vector_length_ * frequency_bins; - double exponent = 1.0 / static_cast(ncells); - double val = pow(1.0 - pfa, exponent); - auto lambda = static_cast(vector_length_); - boost::math::exponential_distribution mydist(lambda); - auto threshold = static_cast(quantile(mydist, val)); - - return threshold; -} - - void GpsL2MPcpsAcquisition::connect(gr::top_block_sptr top_block) { if (item_type_ == "gr_complex") diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h index 6d8abe994..dbc608f6b 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h @@ -188,7 +188,6 @@ private: unsigned int in_streams_; unsigned int out_streams_; unsigned int num_codes_; - float calculate_threshold(float pfa); }; #endif /* GNSS_SDR_GPS_L2_M_PCPS_ACQUISITION_H_ */ diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc index b712e58b6..b937b2832 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc @@ -37,7 +37,6 @@ #include "configuration_interface.h" #include "gnss_sdr_flags.h" #include "gps_l5_signal.h" -#include #include #include @@ -105,22 +104,7 @@ void GpsL5iPcpsAcquisition::stop_acquisition() void GpsL5iPcpsAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); - - if (pfa == 0.0) - { - pfa = configuration_->property(role_ + ".pfa", 0.0); - } - if (pfa == 0.0) - { - threshold_ = threshold; - } - else - { - threshold_ = calculate_threshold(pfa); - } - - DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; + threshold_ = threshold; acquisition_->set_threshold(threshold_); } @@ -207,26 +191,6 @@ void GpsL5iPcpsAcquisition::set_state(int state) } -float GpsL5iPcpsAcquisition::calculate_threshold(float pfa) -{ - // Calculate the threshold - unsigned int frequency_bins = 0; - for (int doppler = static_cast(-doppler_max_); doppler <= static_cast(doppler_max_); doppler += doppler_step_) - { - frequency_bins++; - } - DLOG(INFO) << "Channel " << channel_ << " Pfa = " << pfa; - unsigned int ncells = vector_length_ * frequency_bins; - double exponent = 1.0 / static_cast(ncells); - double val = pow(1.0 - pfa, exponent); - auto lambda = static_cast(vector_length_); - boost::math::exponential_distribution mydist(lambda); - auto threshold = static_cast(quantile(mydist, val)); - - return threshold; -} - - void GpsL5iPcpsAcquisition::connect(gr::top_block_sptr top_block) { if (item_type_ == "gr_complex") diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h index 7a44e0e56..8812c3fa7 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h @@ -188,7 +188,6 @@ private: unsigned int num_codes_; unsigned int in_streams_; unsigned int out_streams_; - float calculate_threshold(float pfa); }; #endif /* GNSS_SDR_GPS_L5I_PCPS_ACQUISITION_H_ */ diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc index 42d5ca210..4ce10bab2 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc @@ -665,14 +665,6 @@ void pcps_acquisition::acquisition_core(uint64_t samp_count) lk.unlock(); - //if (d_use_CFAR_algorithm_flag or acq_parameters.bit_transition_flag) - //{ - //// Compute the input signal power estimation - //volk_32fc_magnitude_squared_32f(d_tmp_buffer.data(), in, d_fft_size); - //volk_32f_accumulator_s32f(&d_input_power, d_tmp_buffer.data(), d_fft_size); - //d_input_power /= static_cast(d_fft_size); - //} - // Doppler frequency grid loop if (!d_step_two) { @@ -930,7 +922,7 @@ void pcps_acquisition::calculate_threshold() int num_bins = effective_fft_size * num_doppler_bins; - d_threshold = 2.0 * boost::math::gamma_p_inv(2 * acq_parameters.max_dwells, std::pow(1.0 - pfa, 1.0 / static_cast(num_bins))); + d_threshold = 2.0 * boost::math::gamma_p_inv(2.0 * acq_parameters.max_dwells, std::pow(1.0 - pfa, 1.0 / static_cast(num_bins))); } @@ -977,8 +969,6 @@ int pcps_acquisition::general_work(int noutput_items __attribute__((unused)), d_gnss_synchro->Acq_samplestamp_samples = 0ULL; d_gnss_synchro->Acq_doppler_step = 0U; d_mag = 0.0; - d_input_power = 0.0; - d_test_statistics = 0.0; d_state = 1; d_buffer_count = 0U; if (!acq_parameters.blocking_on_standby) diff --git a/src/algorithms/acquisition/libs/acq_conf.cc b/src/algorithms/acquisition/libs/acq_conf.cc index 8b5d4faec..d56b65634 100644 --- a/src/algorithms/acquisition/libs/acq_conf.cc +++ b/src/algorithms/acquisition/libs/acq_conf.cc @@ -44,7 +44,7 @@ Acq_Conf::Acq_Conf() chips_per_second = 1023000; doppler_max = 5000; doppler_min = -5000; - doppler_step = 0.0; + doppler_step = 250.0; num_doppler_bins_step2 = 4U; doppler_step2 = 125.0; pfa = 0.0;