1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-14 04:00:34 +00:00

Update tests

This commit is contained in:
Gastd 2017-07-20 18:41:35 -03:00
parent 88177d772e
commit 195c836922
2 changed files with 27 additions and 49 deletions

View File

@ -161,10 +161,10 @@ void GlonassL1CaPcpsAcquisitionGSoC2017Test::config_1()
signal.copy(gnss_synchro.Signal,2,0); signal.copy(gnss_synchro.Signal,2,0);
integration_time_ms = 1; integration_time_ms = 1;
fs_in = 62316000; fs_in = 31.75e6;
expected_delay_chips = 457; expected_delay_chips = 255;
expected_doppler_hz = -2000; expected_doppler_hz = -1500;
max_doppler_error_hz = 2/(3*integration_time_ms*1e-3); max_doppler_error_hz = 2/(3*integration_time_ms*1e-3);
max_delay_error_chips = 0.50; max_delay_error_chips = 0.50;
@ -178,7 +178,7 @@ void GlonassL1CaPcpsAcquisitionGSoC2017Test::config_1()
config->set_property("SignalSource.item_type", "gr_complex"); 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.system_0", "R");
config->set_property("SignalSource.PRN_0", "10"); 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.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.delay_chips_0", std::to_string(expected_delay_chips));
config->set_property("SignalSource.system_1", "R"); config->set_property("SignalSource.noise_flag", "true");
config->set_property("SignalSource.PRN_1", "15"); config->set_property("SignalSource.data_flag", "false");
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.BW_BB", "0.97"); config->set_property("SignalSource.BW_BB", "0.97");
config->set_property("InputFilter.implementation", "Fir_Filter"); config->set_property("InputFilter.implementation", "Fir_Filter");
@ -228,7 +210,7 @@ void GlonassL1CaPcpsAcquisitionGSoC2017Test::config_1()
config->set_property("InputFilter.grid_density", "16"); config->set_property("InputFilter.grid_density", "16");
config->set_property("Acquisition.item_type", "gr_complex"); config->set_property("Acquisition.item_type", "gr_complex");
config->set_property("Acquisition.if", "9540000"); config->set_property("Acquisition.if", "4000000");
config->set_property("Acquisition.coherent_integration_time_ms", config->set_property("Acquisition.coherent_integration_time_ms",
std::to_string(integration_time_ms)); std::to_string(integration_time_ms));
config->set_property("Acquisition.max_dwells", "1"); config->set_property("Acquisition.max_dwells", "1");
@ -237,7 +219,7 @@ void GlonassL1CaPcpsAcquisitionGSoC2017Test::config_1()
config->set_property("Acquisition.doppler_max", "10000"); config->set_property("Acquisition.doppler_max", "10000");
config->set_property("Acquisition.doppler_step", "250"); config->set_property("Acquisition.doppler_step", "250");
config->set_property("Acquisition.bit_transition_flag", "false"); config->set_property("Acquisition.bit_transition_flag", "false");
config->set_property("Acquisition.dump", "false"); config->set_property("Acquisition.dump", "true");
} }
void GlonassL1CaPcpsAcquisitionGSoC2017Test::config_2() void GlonassL1CaPcpsAcquisitionGSoC2017Test::config_2()
@ -248,9 +230,9 @@ void GlonassL1CaPcpsAcquisitionGSoC2017Test::config_2()
signal.copy(gnss_synchro.Signal,2,0); signal.copy(gnss_synchro.Signal,2,0);
integration_time_ms = 1; integration_time_ms = 1;
fs_in = 62316000; fs_in = 31.75e6;
expected_delay_chips = 457; expected_delay_chips = 374;
expected_doppler_hz = -2000; expected_doppler_hz = -2000;
max_doppler_error_hz = 2/(3*integration_time_ms*1e-3); max_doppler_error_hz = 2/(3*integration_time_ms*1e-3);
max_delay_error_chips = 0.50; max_delay_error_chips = 0.50;
@ -285,14 +267,14 @@ void GlonassL1CaPcpsAcquisitionGSoC2017Test::config_2()
config->set_property("SignalSource.doppler_Hz_2", "2000"); config->set_property("SignalSource.doppler_Hz_2", "2000");
config->set_property("SignalSource.delay_chips_2", "200"); config->set_property("SignalSource.delay_chips_2", "200");
config->set_property("SignalSource.system_3", "G"); config->set_property("SignalSource.system_3", "R");
config->set_property("SignalSource.PRN_3", "22"); config->set_property("SignalSource.PRN_3", "22");
config->set_property("SignalSource.CN0_dB_3", "44"); config->set_property("SignalSource.CN0_dB_3", "44");
config->set_property("SignalSource.doppler_Hz_3", "3000"); config->set_property("SignalSource.doppler_Hz_3", "3000");
config->set_property("SignalSource.delay_chips_3", "300"); config->set_property("SignalSource.delay_chips_3", "300");
config->set_property("SignalSource.noise_flag", "false"); config->set_property("SignalSource.noise_flag", "true");
config->set_property("SignalSource.data_flag", "false"); config->set_property("SignalSource.data_flag", "true");
config->set_property("SignalSource.BW_BB", "0.97"); config->set_property("SignalSource.BW_BB", "0.97");
config->set_property("InputFilter.implementation", "Fir_Filter"); config->set_property("InputFilter.implementation", "Fir_Filter");
@ -315,12 +297,12 @@ void GlonassL1CaPcpsAcquisitionGSoC2017Test::config_2()
config->set_property("InputFilter.grid_density", "16"); config->set_property("InputFilter.grid_density", "16");
config->set_property("Acquisition.item_type", "gr_complex"); config->set_property("Acquisition.item_type", "gr_complex");
config->set_property("Acquisition.if", "9540000"); config->set_property("Acquisition.if", "4000000");
config->set_property("Acquisition.coherent_integration_time_ms", config->set_property("Acquisition.coherent_integration_time_ms",
std::to_string(integration_time_ms)); std::to_string(integration_time_ms));
config->set_property("Acquisition.max_dwells", "1"); config->set_property("Acquisition.max_dwells", "1");
config->set_property("Acquisition.implementation", "GLONASS_L1_CA_PCPS_Acquisition"); 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_max", "10000");
config->set_property("Acquisition.doppler_step", "250"); config->set_property("Acquisition.doppler_step", "250");
config->set_property("Acquisition.bit_transition_flag", "false"); config->set_property("Acquisition.bit_transition_flag", "false");
@ -366,14 +348,10 @@ void GlonassL1CaPcpsAcquisitionGSoC2017Test::process_message()
// The term -5 is here to correct the additional delay introduced by the FIR filter // The term -5 is here to correct the additional delay introduced by the FIR filter
// The value 511.0 must be a variable, chips/length // 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 delay_error_chips = std::abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*511.0/((double)fs_in*1e-3));
// std::cout << "delay_error_chips = " << delay_error_chips << std::endl;
double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz); 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); mse_delay += std::pow(delay_error_chips, 2);
// std::cout << "mse_delay = " << mse_delay << std::endl;
mse_doppler += std::pow(doppler_error_hz, 2); 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)) if ((delay_error_chips < max_delay_error_chips) && (doppler_error_hz < max_doppler_error_hz))
{ {
@ -470,11 +448,11 @@ TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ValidationOfResults)
}) << "Failure setting doppler_max."<< std::endl; }) << "Failure setting doppler_max."<< std::endl;
ASSERT_NO_THROW( { ASSERT_NO_THROW( {
acquisition->set_doppler_step(250); acquisition->set_doppler_step(500);
}) << "Failure setting doppler_step."<< std::endl; }) << "Failure setting doppler_step."<< std::endl;
ASSERT_NO_THROW( { ASSERT_NO_THROW( {
acquisition->set_threshold(0.05); acquisition->set_threshold(0.5);
}) << "Failure setting threshold."<< std::endl; }) << "Failure setting threshold."<< std::endl;
ASSERT_NO_THROW( { ASSERT_NO_THROW( {
@ -484,14 +462,14 @@ TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ValidationOfResults)
acquisition->init(); acquisition->init();
//ASSERT_NO_THROW( { ASSERT_NO_THROW( {
boost::shared_ptr<GenSignalSource> signal_source; boost::shared_ptr<GenSignalSource> signal_source;
SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue);
FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1);
signal_source.reset(new GenSignalSource(signal_generator, filter, "SignalSource", queue)); signal_source.reset(new GenSignalSource(signal_generator, filter, "SignalSource", queue));
signal_source->connect(top_block); signal_source->connect(top_block);
top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0); 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 = 0 --> satellite in acquisition is visible
// i = 1 --> satellite in acquisition is not visible // i = 1 --> satellite in acquisition is not visible
@ -588,7 +566,7 @@ TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ValidationOfResultsProbabilities)
top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0); 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;
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 = 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) // i = 1 --> satellite in acquisition is not visible (prob of false detection)
@ -602,7 +580,7 @@ TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ValidationOfResultsProbabilities)
} }
else if (i == 1) else if (i == 1)
{ {
gnss_synchro.PRN = 20; // This satellite is not visible gnss_synchro.PRN = 1; // This satellite is not visible
} }
acquisition->set_local_code(); acquisition->set_local_code();

View File

@ -103,8 +103,8 @@ void GlonassL1CaPcpsAcquisitionTest::init()
gnss_synchro.System = 'R'; gnss_synchro.System = 'R';
std::string signal = "1G"; std::string signal = "1G";
signal.copy(gnss_synchro.Signal, 2, 0); signal.copy(gnss_synchro.Signal, 2, 0);
gnss_synchro.PRN = 10; gnss_synchro.PRN = 1;
config->set_property("GNSS-SDR.internal_fs_hz", "62316000"); config->set_property("GNSS-SDR.internal_fs_hz", "62314000");
config->set_property("Acquisition.item_type", "gr_complex"); config->set_property("Acquisition.item_type", "gr_complex");
config->set_property("Acquisition.if", "9540000"); config->set_property("Acquisition.if", "9540000");
config->set_property("Acquisition.coherent_integration_time_ms", "1"); config->set_property("Acquisition.coherent_integration_time_ms", "1");
@ -128,8 +128,8 @@ TEST_F(GlonassL1CaPcpsAcquisitionTest, Instantiate)
TEST_F(GlonassL1CaPcpsAcquisitionTest, ConnectAndRun) TEST_F(GlonassL1CaPcpsAcquisitionTest, ConnectAndRun)
{ {
int fs_in = 62316000; int fs_in = 62314000;
int nsamples = 62316; int nsamples = 62314;
struct timeval tv; struct timeval tv;
long long int begin = 0; long long int begin = 0;
long long int end = 0; long long int end = 0;
@ -168,8 +168,8 @@ TEST_F(GlonassL1CaPcpsAcquisitionTest, ValidationOfResults)
long long int end = 0; long long int end = 0;
top_block = gr::make_top_block("Acquisition test"); top_block = gr::make_top_block("Acquisition test");
double expected_delay_samples = 31839; double expected_delay_samples = 31874;
double expected_doppler_hz = 250; double expected_doppler_hz = -9500;
init(); init();
std::shared_ptr<GlonassL1CaPcpsAcquisition> acquisition = std::make_shared<GlonassL1CaPcpsAcquisition>(config.get(), "Acquisition", 1, 1); std::shared_ptr<GlonassL1CaPcpsAcquisition> acquisition = std::make_shared<GlonassL1CaPcpsAcquisition>(config.get(), "Acquisition", 1, 1);