From fd5cd42b9ae91eaf6262b5420879f859242dac6a Mon Sep 17 00:00:00 2001 From: Luis Esteve Date: Wed, 11 May 2016 01:39:11 +0200 Subject: [PATCH] Correct minor bug in pcps acquisition blocks Change the initialization of max_dwells in pcps acquisition adpaters due its value is forced to be 1 in gr_block constructor if boolean "bit_transition_flag" is set to TRUE Resolves: #24 --- .../galileo_e1_pcps_ambiguous_acquisition.cc | 9 +------- .../adapters/gps_l1_ca_pcps_acquisition.cc | 22 ++++++------------- .../adapters/gps_l2_m_pcps_acquisition.cc | 14 +++++------- .../gnuradio_blocks/pcps_acquisition_cc.cc | 4 ++-- 4 files changed, 16 insertions(+), 33 deletions(-) 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 a8d717b0e..3ade9229a 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc @@ -69,14 +69,7 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition( 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 - if (!bit_transition_flag_) - { - max_dwells_ = configuration_->property(role + ".max_dwells", 1); - } - else - { - max_dwells_ = 2; - } + max_dwells_ = configuration_->property(role + ".max_dwells", 1); dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); 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 8c6a4eedd..5b6e7594a 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc @@ -66,14 +66,7 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( 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 - if (!bit_transition_flag_) - { - max_dwells_ = configuration_->property(role + ".max_dwells", 1); - } - else - { - max_dwells_ = 2; - } + max_dwells_ = configuration_->property(role + ".max_dwells", 1); dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); @@ -82,6 +75,11 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( vector_length_ = code_length_ * sampled_ms_; + if( bit_transition_flag_ ) + { + vector_length_ *= 2; + } + code_ = new gr_complex[vector_length_]; if (item_type_.compare("cshort") == 0 ) @@ -102,13 +100,7 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_); DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id() << ")"; - //now is supported natively by the acquisition (_sc variant) - // if (item_type_.compare("cshort") == 0) - // { - // cshort_to_float_x2_ = make_cshort_to_float_x2(); - // float_to_complex_ = gr::blocks::float_to_complex::make(); - // } - + if (item_type_.compare("cbyte") == 0) { cbyte_to_float_x2_ = make_complex_byte_to_float_x2(); 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 14ea78c6f..2948ee95e 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc @@ -63,14 +63,7 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition( 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 - if (!bit_transition_flag_) - { - max_dwells_ = configuration_->property(role + ".max_dwells", 1); - } - else - { - max_dwells_ = 2; - } + max_dwells_ = configuration_->property(role + ".max_dwells", 1); dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); @@ -80,6 +73,11 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition( vector_length_ = code_length_; + if( bit_transition_flag_ ) + { + vector_length_ *= 2; + } + code_ = new gr_complex[vector_length_]; // if (item_type_.compare("gr_complex") == 0 ) diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.cc index d8fbe79a4..7ba621841 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.cc @@ -90,7 +90,7 @@ pcps_acquisition_cc::pcps_acquisition_cc( d_bit_transition_flag = bit_transition_flag; d_use_CFAR_algorithm_flag = use_CFAR_algorithm_flag; d_threshold = 0.0; - d_doppler_step = 250; + d_doppler_step = 0; d_code_phase = 0; d_test_statistics = 0.0; d_channel = 0; @@ -111,7 +111,7 @@ pcps_acquisition_cc::pcps_acquisition_cc( if( d_bit_transition_flag ) { d_fft_size *= 2; - d_max_dwells = 1; + d_max_dwells = 1; //Activation of d_bit_transition_flag invalidates the value of d_max_dwells } d_fft_codes = static_cast(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()));