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:
Luis Esteve 2013-05-26 23:59:04 +00:00
parent e728450192
commit e6dfa1971d
7 changed files with 131 additions and 137 deletions

View File

@ -177,14 +177,12 @@ Resampler.sample_freq_out=4000000
;######### CHANNELS GLOBAL CONFIG ############
;#count: Number of available satellite channels.
Channels.count=8
Channels.count=1
;#in_acquisition: Number of channels simultaneously acquiring
Channels.in_acquisition=1
;######### CHANNEL 0 CONFIG ############
;#system: GPS, GLONASS, GALILEO, SBAS or COMPASS
;#system: GPS, GLONASS, Galileo, SBAS or Compass
;#if the option is disabled by default is assigned GPS
Channel0.system=GPS
Channel.system=GPS
;#signal:
;# "1C" GPS L1 C/A
@ -243,10 +241,18 @@ Channel0.system=GPS
;# "6Q" COMPASS E6 Q
;# "6X" COMPASS E6 IQ
;#if the option is disabled by default is assigned "1C" GPS L1 C/A
Channel.signal=1C
;######### SPECIFIC CHANNELS CONFIG ######
;#The following options are specific to each channel and overwrite the generic options
;######### CHANNEL 0 CONFIG ############
Channel0.system=GPS
Channel0.signal=1C
;#satellite: Satellite PRN ID for this channel. Disable this option to random search
Channel0.satellite=15
Channel0.satellite=11
;######### CHANNEL 1 CONFIG ############
@ -254,30 +260,6 @@ Channel1.system=GPS
Channel1.signal=1C
Channel1.satellite=18
;######### CHANNEL 2 CONFIG ############
Channel2.system=GPS
Channel2.signal=1C
Channel2.satellite=16
;######### CHANNEL 3 CONFIG ############
Channel3.system=GPS
Channel3.signal=1C
Channel3.satellite=21
;######### CHANNEL 4 CONFIG ############
Channel4.system=GPS
Channel4.signal=1C
Channel4.satellite=3
;######### CHANNEL 5 CONFIG ############
Channel5.system=GPS
Channel5.signal=1C
;Channel5.satellite=21
;######### ACQUISITION GLOBAL CONFIG ############
@ -291,79 +273,40 @@ Acquisition.item_type=gr_complex
Acquisition.if=0
;#sampled_ms: Signal block duration for the acquisition signal detection [ms]
Acquisition.sampled_ms=1
;#implementation: Acquisition algorithm selection for this channel: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
Acquisition.implementation=GPS_L1_CA_PCPS_Acquisition
;#threshold: Acquisition threshold
Acquisition.threshold=0.005
;#doppler_max: Maximum expected Doppler shift [Hz]
Acquisition.doppler_max=7500
;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
Acquisition.pfa=0.0001
;#doppler_max: Maximum expected Doppler shift [Hz]
Acquisition.doppler_max=10000
;#doppler_max: Doppler step in the grid search [Hz]
Acquisition.doppler_step=500
;######### ACQUISITION CHANNELS CONFIG ######
;#The following options are specific to each channel and overwrite the generic options
;######### ACQUISITION CH 0 CONFIG ############
;#implementation: Acquisition algorithm selection for this channel: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
Acquisition0.implementation=GPS_L1_CA_PCPS_Acquisition
;#threshold: Acquisition threshold
Acquisition0.threshold=50
;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
Acquisition0.pfa=0.001
;#doppler_max: Maximum expected Doppler shift [Hz]
Acquisition0.doppler_max=10000
;#doppler_max: Doppler step in the grid search [Hz]
Acquisition0.doppler_step=250
;#repeat_satellite: Use only jointly with the satellite PRN ID option.
Acquisition0.repeat_satellite = false
;Acquisition0.implementation=GPS_L1_CA_PCPS_Acquisition
;Acquisition0.threshold=0.005
;Acquisition0.pfa=0.001
;Acquisition0.doppler_max=10000
;Acquisition0.doppler_step=250
;#repeat_satellite: Use only jointly with the satellite PRN ID option. The default value is false
;Acquisition0.repeat_satellite = false
;######### ACQUISITION CH 1 CONFIG ############
Acquisition1.implementation=GPS_L1_CA_PCPS_Acquisition
Acquisition1.threshold=50
Acquisition1.doppler_max=10000
Acquisition1.doppler_step=250
;######### ACQUISITION CH 2 CONFIG ############
Acquisition2.implementation=GPS_L1_CA_PCPS_Acquisition
Acquisition2.threshold=50
Acquisition2.doppler_max=10000
Acquisition2.doppler_step=250
;######### ACQUISITION CH 3 CONFIG ############
Acquisition3.implementation=GPS_L1_CA_PCPS_Acquisition
Acquisition3.threshold=50
Acquisition3.doppler_max=10000
Acquisition3.doppler_step=250
;######### ACQUISITION CH 4 CONFIG ############
Acquisition4.implementation=GPS_L1_CA_PCPS_Acquisition
Acquisition4.threshold=50
Acquisition4.doppler_max=10000
Acquisition4.doppler_step=250
;######### ACQUISITION CH 5 CONFIG ############
Acquisition5.implementation=GPS_L1_CA_PCPS_Acquisition
Acquisition5.threshold=50
Acquisition5.doppler_max=10000
Acquisition5.doppler_step=250
;######### ACQUISITION CH 6 CONFIG ############
Acquisition6.implementation=GPS_L1_CA_PCPS_Acquisition
Acquisition6.threshold=50
Acquisition6.doppler_max=10000
Acquisition6.doppler_step=250
;######### ACQUISITION CH 7 CONFIG ############
Acquisition7.implementation=GPS_L1_CA_PCPS_Acquisition
Acquisition7.threshold=50
Acquisition7.doppler_max=10000
Acquisition7.doppler_step=250
;######### ACQUISITION CH 8 CONFIG ############
Acquisition8.implementation=GPS_L1_CA_PCPS_Acquisition
Acquisition8.threshold=50
Acquisition8.doppler_max=10000
Acquisition8.doppler_step=250
;Acquisition1.implementation=GPS_L1_CA_PCPS_Acquisition
;Acquisition1.threshold=0.005
;Acquisition1.pfa=0.001
;Acquisition1.doppler_max=10000
;Acquisition1.doppler_step=250
;Acquisition1.repeat_satellite = false
;######### TRACKING GLOBAL CONFIG ############

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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)

View File

@ -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);

View File

@ -189,6 +189,10 @@ GNSSBlockInterface* GNSSBlockFactory::GetChannel(
stream << channel;
std::string id = stream.str();
DLOG(INFO) << "Instantiating channel " << id;
DLOG(INFO) << "Getting Channel " << id << " with" << std::endl << " Acquisition Implementation: "
<< acq << std::endl << " Tracking Implementation: " << trk << std::endl << " Telemetry "
"Decoder implementation: " << tlm;
return new Channel(configuration, channel, GetBlock(configuration,
"Channel", "Pass_Through", 1, 1, queue),
(AcquisitionInterface*)GetBlock(configuration, "Acquisition",
@ -207,27 +211,29 @@ std::vector<GNSSBlockInterface*>* GNSSBlockFactory::GetChannels(
std::string default_implementation = "Pass_Through";
unsigned int channel_count =
configuration->property("Channels.count", 12);
DLOG(INFO) << "Getting " << channel_count << " channels";
std::vector<GNSSBlockInterface*>* channels = new std::vector<
GNSSBlockInterface*>();
std::string tracking = configuration->property("Tracking.implementation",
default_implementation);
std::string telemetry_decoder = configuration->property(
"TelemetryDecoder.implementation", default_implementation);
std::string acquisition_implementation = configuration->property(
"Acquisition.implementation", default_implementation);
for (unsigned int i = 0; i < channel_count; i++)
{
std::string acquisition_implementation_name = "Acquisition"
+ boost::lexical_cast<std::string>(i) + ".implementation";
std::string acquisition_implementation = configuration->property(
acquisition_implementation_name, default_implementation);
std::string acquisition_implementation_specific = configuration->property(
"Acquisition"+ boost::lexical_cast<std::string>(i) + ".implementation",
default_implementation);
if(acquisition_implementation_specific.compare(default_implementation) != 0)
{
acquisition_implementation = acquisition_implementation_specific;
}
channels->push_back(GetChannel(configuration,
acquisition_implementation, tracking, telemetry_decoder, i,
queue));
// std::cout << "getchannel_" << i << ", acq_implementation_name: "
// << acquisition_implementation_name << ", implementation: "
// << acquisition_implementation << std::endl;
}
DLOG(INFO) << "Getting " << channel_count << " channels";
return channels;
}

View File

@ -538,48 +538,60 @@ void GNSSFlowgraph::set_signals_list()
std::set<unsigned int>::iterator available_gnss_prn_iter;
Gnss_Signal signal_value;
/*
* Loop to create the list of GNSS Signals
* To add signals from other systems, add another loop 'for'
*/
/*
* Loop to create GPS L1 C/A signals
*/
for (available_gnss_prn_iter = available_gps_prn.begin(); available_gnss_prn_iter
!= available_gps_prn.end(); available_gnss_prn_iter++)
{
signal_value = Gnss_Signal(Gnss_Satellite(std::string("GPS"),
*available_gnss_prn_iter), std::string("1C"));
available_GNSS_signals_.push_back(signal_value);
available_GNSS_signals_.push_back(Gnss_Signal(Gnss_Satellite(std::string("GPS"),
*available_gnss_prn_iter), std::string("1C")));
}
/*
* Loop to create the list of Galileo E1 B signals
*/
std::set<unsigned int> available_galileo_prn = { 11, 12 };
for (available_gnss_prn_iter = available_galileo_prn.begin(); available_gnss_prn_iter
!= available_galileo_prn.end(); available_gnss_prn_iter++)
{
signal_value = Gnss_Signal(Gnss_Satellite(std::string("Galileo"),
*available_gnss_prn_iter), std::string("1B"));
available_GNSS_signals_.push_back(signal_value);
// signal_value = Gnss_Signal(Gnss_Satellite(std::string("Galileo"),
// *available_gnss_prn_iter), std::string("1C"));
// available_GNSS_signals_.push_back(signal_value);
available_GNSS_signals_.push_back(Gnss_Signal(Gnss_Satellite(std::string("Galileo"),
*available_gnss_prn_iter), std::string("1B")));
}
/*
* Ordering the list of signals from configuration file
*/
std::list<Gnss_Signal>::iterator gnss_it = available_GNSS_signals_.begin();
std::string default_system = (configuration_->property("Channel.system",std::string("GPS")));
std::string default_signal = configuration_->property("Channel.signal",std::string("1C"));
for (unsigned int i = 0; i < channels_count_; i++)
{
std::string default_system = "GPS";
std::string default_signal = "1C";
std::string gnss_system = (configuration_->property("Channel"
+ boost::lexical_cast<std::string>(i) + ".system",
default_system));
DLOG(INFO) << "Channel " << i << " system " << gnss_system;
std::string gnss_signal = (configuration_->property("Channel"
+ boost::lexical_cast<std::string>(i) + ".signal",
default_signal));
DLOG(INFO) << "Channel " << i << " signal " << gnss_signal;
unsigned int sat = configuration_->property("Channel"
+ boost::lexical_cast<std::string>(i) + ".satellite", 0);
@ -589,12 +601,21 @@ void GNSSFlowgraph::set_signals_list()
}
else
{
signal_value = Gnss_Signal(Gnss_Satellite(gnss_system, sat),
Gnss_Signal signal_value = Gnss_Signal(Gnss_Satellite(gnss_system, sat),
gnss_signal);
DLOG(INFO) << "Channel " << i << " " << signal_value;
available_GNSS_signals_.remove(signal_value);
available_GNSS_signals_.insert(gnss_it, signal_value);
}
}
// **** FOR DEBUGGING THE LIST OF GNSS SIGNALS ****
//
// std::list<Gnss_Signal>::iterator available_gnss_list_iter;
// for (available_gnss_list_iter = available_GNSS_signals_.begin(); available_gnss_list_iter
// != available_GNSS_signals_.end(); available_gnss_list_iter++)
// {
// std::cout << *available_gnss_list_iter << std::endl;
// }
}