mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-11-10 04:03:02 +00:00
Simplifying the configuration file:
- Some channel and acquisition properties are now common for all channels - You can choose between channel-specific properties or properties common to all - Updating config file with the new options git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@360 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
@@ -121,6 +121,9 @@ void
|
||||
GalileoE1PcpsAmbiguousAcquisition::set_threshold(float threshold)
|
||||
{
|
||||
float pfa = configuration_->property(role_+ boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0);
|
||||
|
||||
if(pfa==0.0) pfa = configuration_->property(role_+".pfa", 0.0);
|
||||
|
||||
if(pfa==0.0)
|
||||
{
|
||||
threshold_ = threshold;
|
||||
@@ -130,6 +133,8 @@ GalileoE1PcpsAmbiguousAcquisition::set_threshold(float threshold)
|
||||
threshold_ = calculate_threshold(pfa);
|
||||
}
|
||||
|
||||
DLOG(INFO) <<"Channel "<<channel_<<" Threshold = " << threshold_;
|
||||
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
acquisition_cc_->set_threshold(threshold_);
|
||||
@@ -235,16 +240,15 @@ float GalileoE1PcpsAmbiguousAcquisition::calculate_threshold(float pfa)
|
||||
frequency_bins++;
|
||||
}
|
||||
|
||||
DLOG(INFO) <<"Pfa = "<< pfa;
|
||||
DLOG(INFO) <<"Channel "<<channel_<<" Pfa = "<< pfa;
|
||||
|
||||
unsigned int ncells = vector_length_*frequency_bins;
|
||||
double exponent = 1/(double)ncells;
|
||||
double val = pow(1.0-pfa,exponent);
|
||||
boost::math::exponential_distribution<double> mydist (0.5);
|
||||
double lambda = double(vector_length_);
|
||||
boost::math::exponential_distribution<double> mydist (lambda);
|
||||
float threshold = (float)quantile(mydist,val);
|
||||
|
||||
DLOG(INFO) << "Threshold = " << threshold;
|
||||
|
||||
return threshold;
|
||||
}
|
||||
|
||||
|
||||
@@ -119,6 +119,9 @@ 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);
|
||||
|
||||
if(pfa==0.0) pfa = configuration_->property(role_+".pfa", 0.0);
|
||||
|
||||
if(pfa==0.0)
|
||||
{
|
||||
threshold_ = threshold;
|
||||
@@ -128,6 +131,8 @@ void GpsL1CaPcpsAcquisition::set_threshold(float threshold)
|
||||
threshold_ = calculate_threshold(pfa);
|
||||
}
|
||||
|
||||
DLOG(INFO) <<"Channel "<<channel_<<" Threshold = " << threshold_;
|
||||
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
acquisition_cc_->set_threshold(threshold_);
|
||||
@@ -218,16 +223,15 @@ float GpsL1CaPcpsAcquisition::calculate_threshold(float pfa)
|
||||
frequency_bins++;
|
||||
}
|
||||
|
||||
DLOG(INFO) <<"Pfa = "<< pfa;
|
||||
DLOG(INFO) <<"Channel "<<channel_<<" Pfa = "<< pfa;
|
||||
|
||||
unsigned int ncells = vector_length_*frequency_bins;
|
||||
double exponent = 1/(double)ncells;
|
||||
double val = pow(1.0-pfa,exponent);
|
||||
boost::math::exponential_distribution<double> mydist (0.5);
|
||||
double lambda = double(vector_length_);
|
||||
boost::math::exponential_distribution<double> mydist (lambda);
|
||||
float threshold = (float)quantile(mydist,val);
|
||||
|
||||
DLOG(INFO) << "Threshold = " << threshold;
|
||||
|
||||
return threshold;
|
||||
}
|
||||
|
||||
|
||||
@@ -191,6 +191,8 @@ int pcps_acquisition_cc::general_work(int noutput_items,
|
||||
for (doppler = (int)(-d_doppler_max); doppler <= (int)d_doppler_max; doppler += d_doppler_step)
|
||||
{
|
||||
// doppler search steps
|
||||
//TODO: Create a run time lookup table with all the required Doppler wipe-off LO signals, by allocating a memory space (aligned) and by initializing it when the Doppler step is assigned
|
||||
// then, use the arrays to multiply the incomming signal, instead of computing the sine and cosine online.
|
||||
// Perform the carrier wipe-off
|
||||
complex_exp_gen_conj(d_carrier, d_freq + doppler, d_fs_in, d_fft_size);
|
||||
if (is_unaligned()==true)
|
||||
@@ -255,7 +257,8 @@ int pcps_acquisition_cc::general_work(int noutput_items,
|
||||
}
|
||||
|
||||
// 5- Compute the test statistics and compare to the threshold
|
||||
d_test_statistics = 2 * d_fft_size * d_mag / d_input_power;
|
||||
//d_test_statistics = 2 * d_fft_size * d_mag / d_input_power;
|
||||
d_test_statistics = d_mag / d_input_power;
|
||||
|
||||
// 6- Declare positive or negative acquisition using a message queue
|
||||
if (d_test_statistics > d_threshold)
|
||||
|
||||
@@ -64,16 +64,29 @@ Channel::Channel(ConfigurationInterface *configuration, unsigned int channel,
|
||||
acq_->set_gnss_synchro(&gnss_synchro_);
|
||||
trk_->set_gnss_synchro(&gnss_synchro_);
|
||||
|
||||
// IMPORTANT: Do not change the order of the following 3 methods
|
||||
// IMPORTANT: Do not change the order between set_doppler_max, set_doppler_step and set_threshold
|
||||
|
||||
acq_->set_doppler_max(configuration->property("Acquisition"
|
||||
+ boost::lexical_cast<std::string>(channel_) + ".doppler_max",
|
||||
10000));
|
||||
acq_->set_doppler_step(configuration->property("Acquisition"
|
||||
+ boost::lexical_cast<std::string>(channel_) + ".doppler_step",
|
||||
250));
|
||||
acq_->set_threshold(configuration->property("Acquisition"
|
||||
+ boost::lexical_cast<std::string>(channel_) + ".threshold", 0.0));
|
||||
unsigned int doppler_max = configuration->property("Acquisition" + boost::lexical_cast<std::string>(channel_)
|
||||
+ ".doppler_max",0);
|
||||
if(doppler_max==0) doppler_max = configuration->property("Acquisition.doppler_max",0);
|
||||
|
||||
DLOG(INFO) << "Channel "<< channel_<<" Doppler_max = " << doppler_max << std::endl;
|
||||
|
||||
acq_->set_doppler_max(doppler_max);
|
||||
|
||||
unsigned int doppler_step = configuration->property("Acquisition" + boost::lexical_cast<std::string>(channel_)
|
||||
+ ".doppler_step",0);
|
||||
if(doppler_step==0) doppler_step = configuration->property("Acquisition.doppler_step",0);
|
||||
|
||||
DLOG(INFO) << "Channel "<< channel_<<" Doppler_step = " << doppler_step << std::endl;
|
||||
|
||||
acq_->set_doppler_step(doppler_step);
|
||||
|
||||
float threshold = configuration->property("Acquisition" + boost::lexical_cast<std::string>(channel_)
|
||||
+ ".threshold",0.0);
|
||||
if(threshold==0.0) threshold = configuration->property("Acquisition.threshold",0);
|
||||
|
||||
acq_->set_threshold(threshold);
|
||||
|
||||
repeat_ = configuration->property("Acquisition" + boost::lexical_cast<
|
||||
std::string>(channel_) + ".repeat_satellite", false);
|
||||
|
||||
Reference in New Issue
Block a user