mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-06-25 22:52:52 +00:00
minor cleaning
This commit is contained in:
parent
4d072833c5
commit
fbaa3276ce
@ -51,8 +51,7 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
|
||||
|
||||
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", 4000000);
|
||||
if_ = configuration_->property(role + ".ifreq", 0);
|
||||
@ -62,15 +61,14 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
|
||||
|
||||
if (sampled_ms_ % 4 != 0)
|
||||
{
|
||||
sampled_ms_ = (int)(sampled_ms_/4) * 4;
|
||||
sampled_ms_ = (int)(sampled_ms_ / 4) * 4;
|
||||
LOG(WARNING) << "coherent_integration_time should be multiple of "
|
||||
<< "Galileo code length (4 ms). coherent_integration_time = "
|
||||
<< sampled_ms_ << " ms will be used.";
|
||||
|
||||
}
|
||||
|
||||
bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
|
||||
use_CFAR_algorithm_flag_=configuration_->property(role + ".use_CFAR_algorithm", true); //will be false in future versions
|
||||
use_CFAR_algorithm_flag_ = configuration_->property(role + ".use_CFAR_algorithm", true); //will be false in future versions
|
||||
|
||||
if (!bit_transition_flag_)
|
||||
{
|
||||
@ -81,23 +79,15 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
|
||||
max_dwells_ = 2;
|
||||
}
|
||||
|
||||
dump_filename_ = configuration_->property(role + ".dump_filename",
|
||||
default_dump_filename);
|
||||
dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
|
||||
|
||||
//--- Find number of samples per spreading code (4 ms) -----------------
|
||||
|
||||
code_length_ = round(
|
||||
fs_in_
|
||||
/ (Galileo_E1_CODE_CHIP_RATE_HZ
|
||||
/ Galileo_E1_B_CODE_LENGTH_CHIPS));
|
||||
|
||||
|
||||
|
||||
code_length_ = round(fs_in_ / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS));
|
||||
int samples_per_ms = round(code_length_ / 4.0);
|
||||
|
||||
vector_length_ = sampled_ms_ * samples_per_ms;
|
||||
|
||||
if( bit_transition_flag_ ){
|
||||
if( bit_transition_flag_ )
|
||||
{
|
||||
vector_length_ *= 2;
|
||||
}
|
||||
|
||||
@ -133,8 +123,7 @@ GalileoE1PcpsAmbiguousAcquisition::~GalileoE1PcpsAmbiguousAcquisition()
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
GalileoE1PcpsAmbiguousAcquisition::set_channel(unsigned int channel)
|
||||
void GalileoE1PcpsAmbiguousAcquisition::set_channel(unsigned int channel)
|
||||
{
|
||||
channel_ = channel;
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
@ -144,15 +133,13 @@ GalileoE1PcpsAmbiguousAcquisition::set_channel(unsigned int channel)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
GalileoE1PcpsAmbiguousAcquisition::set_threshold(float threshold)
|
||||
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) pfa = configuration_->property(role_ + ".pfa", 0.0);
|
||||
|
||||
if(pfa==0.0)
|
||||
if(pfa == 0.0)
|
||||
{
|
||||
threshold_ = threshold;
|
||||
}
|
||||
@ -161,7 +148,7 @@ GalileoE1PcpsAmbiguousAcquisition::set_threshold(float threshold)
|
||||
threshold_ = calculate_threshold(pfa);
|
||||
}
|
||||
|
||||
DLOG(INFO) <<"Channel "<<channel_<<" Threshold = " << threshold_;
|
||||
DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_;
|
||||
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
@ -170,11 +157,9 @@ GalileoE1PcpsAmbiguousAcquisition::set_threshold(float threshold)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
GalileoE1PcpsAmbiguousAcquisition::set_doppler_max(unsigned int doppler_max)
|
||||
void GalileoE1PcpsAmbiguousAcquisition::set_doppler_max(unsigned int doppler_max)
|
||||
{
|
||||
doppler_max_ = doppler_max;
|
||||
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
acquisition_cc_->set_doppler_max(doppler_max_);
|
||||
@ -182,8 +167,7 @@ GalileoE1PcpsAmbiguousAcquisition::set_doppler_max(unsigned int doppler_max)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
GalileoE1PcpsAmbiguousAcquisition::set_doppler_step(unsigned int doppler_step)
|
||||
void GalileoE1PcpsAmbiguousAcquisition::set_doppler_step(unsigned int doppler_step)
|
||||
{
|
||||
doppler_step_ = doppler_step;
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
@ -193,9 +177,7 @@ GalileoE1PcpsAmbiguousAcquisition::set_doppler_step(unsigned int doppler_step)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
GalileoE1PcpsAmbiguousAcquisition::set_channel_queue(
|
||||
concurrent_queue<int> *channel_internal_queue)
|
||||
void GalileoE1PcpsAmbiguousAcquisition::set_channel_queue(concurrent_queue<int> *channel_internal_queue)
|
||||
{
|
||||
channel_internal_queue_ = channel_internal_queue;
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
@ -205,9 +187,7 @@ GalileoE1PcpsAmbiguousAcquisition::set_channel_queue(
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
GalileoE1PcpsAmbiguousAcquisition::set_gnss_synchro(
|
||||
Gnss_Synchro* gnss_synchro)
|
||||
void GalileoE1PcpsAmbiguousAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro)
|
||||
{
|
||||
gnss_synchro_ = gnss_synchro;
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
@ -217,8 +197,7 @@ GalileoE1PcpsAmbiguousAcquisition::set_gnss_synchro(
|
||||
}
|
||||
|
||||
|
||||
signed int
|
||||
GalileoE1PcpsAmbiguousAcquisition::mag()
|
||||
signed int GalileoE1PcpsAmbiguousAcquisition::mag()
|
||||
{
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
@ -231,16 +210,14 @@ GalileoE1PcpsAmbiguousAcquisition::mag()
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
GalileoE1PcpsAmbiguousAcquisition::init()
|
||||
void GalileoE1PcpsAmbiguousAcquisition::init()
|
||||
{
|
||||
acquisition_cc_->init();
|
||||
set_local_code();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
GalileoE1PcpsAmbiguousAcquisition::set_local_code()
|
||||
void GalileoE1PcpsAmbiguousAcquisition::set_local_code()
|
||||
{
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
@ -253,10 +230,9 @@ GalileoE1PcpsAmbiguousAcquisition::set_local_code()
|
||||
galileo_e1_code_gen_complex_sampled(code, gnss_synchro_->Signal,
|
||||
cboc, gnss_synchro_->PRN, fs_in_, 0, false);
|
||||
|
||||
for (unsigned int i = 0; i < sampled_ms_/4; i++)
|
||||
for (unsigned int i = 0; i < sampled_ms_ / 4; i++)
|
||||
{
|
||||
memcpy(&(code_[i*code_length_]), code,
|
||||
sizeof(gr_complex)*code_length_);
|
||||
memcpy(&(code_[i*code_length_]), code, sizeof(gr_complex)*code_length_);
|
||||
}
|
||||
|
||||
acquisition_cc_->set_local_code(code_);
|
||||
@ -266,8 +242,7 @@ GalileoE1PcpsAmbiguousAcquisition::set_local_code()
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
GalileoE1PcpsAmbiguousAcquisition::reset()
|
||||
void GalileoE1PcpsAmbiguousAcquisition::reset()
|
||||
{
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
@ -275,12 +250,13 @@ GalileoE1PcpsAmbiguousAcquisition::reset()
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
GalileoE1PcpsAmbiguousAcquisition::set_state(int state)
|
||||
|
||||
void GalileoE1PcpsAmbiguousAcquisition::set_state(int state)
|
||||
{
|
||||
acquisition_cc_->set_state(state);
|
||||
}
|
||||
|
||||
|
||||
float GalileoE1PcpsAmbiguousAcquisition::calculate_threshold(float pfa)
|
||||
{
|
||||
unsigned int frequency_bins = 0;
|
||||
@ -302,8 +278,7 @@ float GalileoE1PcpsAmbiguousAcquisition::calculate_threshold(float pfa)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
GalileoE1PcpsAmbiguousAcquisition::connect(gr::top_block_sptr top_block)
|
||||
void GalileoE1PcpsAmbiguousAcquisition::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
@ -312,8 +287,7 @@ GalileoE1PcpsAmbiguousAcquisition::connect(gr::top_block_sptr top_block)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
GalileoE1PcpsAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block)
|
||||
void GalileoE1PcpsAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
|
@ -57,8 +57,7 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf(
|
||||
|
||||
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", 32000000);
|
||||
if_ = configuration_->property(role + ".ifreq", 0);
|
||||
@ -69,26 +68,25 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf(
|
||||
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1);
|
||||
if (sampled_ms_ > 3)
|
||||
{
|
||||
sampled_ms_=3;
|
||||
sampled_ms_ = 3;
|
||||
DLOG(INFO) << "Coherent integration time should be 3 ms or less. Changing to 3ms ";
|
||||
std::cout<<"Too high coherent integration time. Changing to 3ms" << std::endl;
|
||||
std::cout << "Too high coherent integration time. Changing to 3ms" << std::endl;
|
||||
}
|
||||
if (Zero_padding > 0)
|
||||
{
|
||||
sampled_ms_ = 2;
|
||||
DLOG(INFO) << "Zero padding activated. Changing to 1ms code + 1ms zero padding ";
|
||||
std::cout<<"Zero padding activated. Changing to 1ms code + 1ms zero padding" << std::endl;
|
||||
std::cout << "Zero padding activated. Changing to 1ms code + 1ms zero padding" << std::endl;
|
||||
}
|
||||
|
||||
max_dwells_ = configuration_->property(role + ".max_dwells", 1);
|
||||
|
||||
dump_filename_ = configuration_->property(role + ".dump_filename",
|
||||
default_dump_filename);
|
||||
dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
|
||||
|
||||
//--- Find number of samples per spreading code (1ms)-------------------------
|
||||
code_length_ = round(fs_in_/ Galileo_E5a_CODE_CHIP_RATE_HZ*Galileo_E5a_CODE_LENGTH_CHIPS);
|
||||
code_length_ = round(fs_in_ / Galileo_E5a_CODE_CHIP_RATE_HZ * Galileo_E5a_CODE_LENGTH_CHIPS);
|
||||
|
||||
vector_length_=code_length_ * sampled_ms_;
|
||||
vector_length_ = code_length_ * sampled_ms_;
|
||||
|
||||
codeI_= new gr_complex[vector_length_];
|
||||
codeQ_= new gr_complex[vector_length_];
|
||||
@ -137,14 +135,15 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_channel(unsigned int channel)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GalileoE5aNoncoherentIQAcquisitionCaf::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) pfa = configuration_->property(role_ + ".pfa", 0.0);
|
||||
|
||||
if(pfa==0.0)
|
||||
if(pfa == 0.0)
|
||||
{
|
||||
threshold_ = threshold;
|
||||
}
|
||||
@ -153,7 +152,7 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_threshold(float threshold)
|
||||
threshold_ = calculate_threshold(pfa);
|
||||
}
|
||||
|
||||
DLOG(INFO) <<"Channel "<<channel_<<" Threshold = " << threshold_;
|
||||
DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_;
|
||||
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
@ -172,6 +171,7 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_doppler_max(unsigned int doppler
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GalileoE5aNoncoherentIQAcquisitionCaf::set_doppler_step(unsigned int doppler_step)
|
||||
{
|
||||
doppler_step_ = doppler_step;
|
||||
@ -181,6 +181,7 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_doppler_step(unsigned int dopple
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GalileoE5aNoncoherentIQAcquisitionCaf::set_channel_queue(
|
||||
concurrent_queue<int> *channel_internal_queue)
|
||||
{
|
||||
@ -222,11 +223,11 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::init()
|
||||
set_local_code();
|
||||
}
|
||||
|
||||
|
||||
void GalileoE5aNoncoherentIQAcquisitionCaf::set_local_code()
|
||||
{
|
||||
if (item_type_.compare("gr_complex")==0)
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
|
||||
std::complex<float>* codeI = new std::complex<float>[code_length_];
|
||||
std::complex<float>* codeQ = new std::complex<float>[code_length_];
|
||||
|
||||
@ -281,6 +282,7 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_local_code()
|
||||
|
||||
}
|
||||
|
||||
|
||||
void GalileoE5aNoncoherentIQAcquisitionCaf::reset()
|
||||
{
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
@ -309,6 +311,7 @@ float GalileoE5aNoncoherentIQAcquisitionCaf::calculate_threshold(float pfa)
|
||||
return threshold;
|
||||
}
|
||||
|
||||
|
||||
void GalileoE5aNoncoherentIQAcquisitionCaf::set_state(int state)
|
||||
{
|
||||
acquisition_cc_->set_state(state);
|
||||
@ -328,6 +331,7 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::disconnect(gr::top_block_sptr top_bl
|
||||
// Nothing to disconnect internally
|
||||
}
|
||||
|
||||
|
||||
gr::basic_block_sptr GalileoE5aNoncoherentIQAcquisitionCaf::get_left_block()
|
||||
{
|
||||
return acquisition_cc_;
|
||||
|
Loading…
x
Reference in New Issue
Block a user