From 0ebc8af42bfe6d792fa03710c486506a4af7ece1 Mon Sep 17 00:00:00 2001 From: Gastd Date: Thu, 20 Jul 2017 18:41:35 -0300 Subject: [PATCH] Update tests --- ...ss_l1_ca_pcps_acquisition_gsoc2017_test.cc | 45 +++++-------------- 1 file changed, 12 insertions(+), 33 deletions(-) diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc index ea6c895e7..2899b4844 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc @@ -178,7 +178,7 @@ void GlonassL1CaPcpsAcquisitionGSoC2017Test::config_1() config->set_property("SignalSource.item_type", "gr_complex"); - config->set_property("SignalSource.num_satellites", "4"); + config->set_property("SignalSource.num_satellites", "1"); config->set_property("SignalSource.system_0", "R"); config->set_property("SignalSource.PRN_0", "10"); @@ -186,26 +186,8 @@ void GlonassL1CaPcpsAcquisitionGSoC2017Test::config_1() config->set_property("SignalSource.doppler_Hz_0", std::to_string(expected_doppler_hz)); config->set_property("SignalSource.delay_chips_0", std::to_string(expected_delay_chips)); - config->set_property("SignalSource.system_1", "R"); - config->set_property("SignalSource.PRN_1", "15"); - config->set_property("SignalSource.CN0_dB_1", "44"); - config->set_property("SignalSource.doppler_Hz_1", "1000"); - config->set_property("SignalSource.delay_chips_1", "100"); - - config->set_property("SignalSource.system_2", "R"); - config->set_property("SignalSource.PRN_2", "21"); - config->set_property("SignalSource.CN0_dB_2", "44"); - config->set_property("SignalSource.doppler_Hz_2", "2000"); - config->set_property("SignalSource.delay_chips_2", "200"); - - config->set_property("SignalSource.system_3", "G"); - config->set_property("SignalSource.PRN_3", "22"); - config->set_property("SignalSource.CN0_dB_3", "44"); - config->set_property("SignalSource.doppler_Hz_3", "3000"); - config->set_property("SignalSource.delay_chips_3", "300"); - - config->set_property("SignalSource.noise_flag", "false"); - config->set_property("SignalSource.data_flag", "true"); + config->set_property("SignalSource.noise_flag", "true"); + config->set_property("SignalSource.data_flag", "false"); config->set_property("SignalSource.BW_BB", "0.97"); config->set_property("InputFilter.implementation", "Fir_Filter"); @@ -237,7 +219,7 @@ void GlonassL1CaPcpsAcquisitionGSoC2017Test::config_1() config->set_property("Acquisition.doppler_max", "10000"); config->set_property("Acquisition.doppler_step", "250"); config->set_property("Acquisition.bit_transition_flag", "false"); - config->set_property("Acquisition.dump", "false"); + config->set_property("Acquisition.dump", "true"); } void GlonassL1CaPcpsAcquisitionGSoC2017Test::config_2() @@ -291,8 +273,8 @@ void GlonassL1CaPcpsAcquisitionGSoC2017Test::config_2() config->set_property("SignalSource.doppler_Hz_3", "3000"); config->set_property("SignalSource.delay_chips_3", "300"); - config->set_property("SignalSource.noise_flag", "false"); - config->set_property("SignalSource.data_flag", "false"); + config->set_property("SignalSource.noise_flag", "true"); + config->set_property("SignalSource.data_flag", "true"); config->set_property("SignalSource.BW_BB", "0.97"); config->set_property("InputFilter.implementation", "Fir_Filter"); @@ -320,7 +302,7 @@ void GlonassL1CaPcpsAcquisitionGSoC2017Test::config_2() std::to_string(integration_time_ms)); config->set_property("Acquisition.max_dwells", "1"); config->set_property("Acquisition.implementation", "GLONASS_L1_CA_PCPS_Acquisition"); - config->set_property("Acquisition.pfa", "0.0001"); + config->set_property("Acquisition.pfa", "0.1"); config->set_property("Acquisition.doppler_max", "10000"); config->set_property("Acquisition.doppler_step", "250"); config->set_property("Acquisition.bit_transition_flag", "false"); @@ -367,12 +349,9 @@ void GlonassL1CaPcpsAcquisitionGSoC2017Test::process_message() // The value 511.0 must be a variable, chips/length double delay_error_chips = std::abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*511.0/((double)fs_in*1e-3)); double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz); - // std::cout << "doppler_error_hz = " << doppler_error_hz << std::endl; mse_delay += std::pow(delay_error_chips, 2); - // std::cout << "mse_delay = " << mse_delay << std::endl; mse_doppler += std::pow(doppler_error_hz, 2); - // std::cout << "mse_doppler = " << mse_doppler << std::endl; if ((delay_error_chips < max_delay_error_chips) && (doppler_error_hz < max_doppler_error_hz)) { @@ -469,11 +448,11 @@ TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ValidationOfResults) }) << "Failure setting doppler_max."<< std::endl; ASSERT_NO_THROW( { - acquisition->set_doppler_step(250); + acquisition->set_doppler_step(500); }) << "Failure setting doppler_step."<< std::endl; ASSERT_NO_THROW( { - acquisition->set_threshold(0.05); + acquisition->set_threshold(0.5); }) << "Failure setting threshold."<< std::endl; ASSERT_NO_THROW( { @@ -483,14 +462,14 @@ TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ValidationOfResults) acquisition->init(); - //ASSERT_NO_THROW( { + ASSERT_NO_THROW( { boost::shared_ptr signal_source; SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); signal_source.reset(new GenSignalSource(signal_generator, filter, "SignalSource", queue)); signal_source->connect(top_block); top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0); - //}) << "Failure connecting the blocks of acquisition test." << std::endl; + }) << "Failure connecting the blocks of acquisition test." << std::endl; // i = 0 --> satellite in acquisition is visible // i = 1 --> satellite in acquisition is not visible @@ -587,7 +566,7 @@ TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ValidationOfResultsProbabilities) top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0); }) << "Failure connecting the blocks of acquisition test." << std::endl; - std::cout << "Probability of false alarm (target) = " << 0.0001 << std::endl; + std::cout << "Probability of false alarm (target) = " << 0.1 << std::endl; // i = 0 --> satellite in acquisition is visible (prob of detection and prob of detection with wrong estimation) // i = 1 --> satellite in acquisition is not visible (prob of false detection)