1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-11-15 14:25:00 +00:00

Fix Glonass Acquisition tests

Broken by removal of if parameter in Acquisition blocks. Solved by using a Freq_Xlating_Fir_Filter for IF shift
This commit is contained in:
Carles Fernandez 2018-06-07 12:08:42 +02:00
parent ebd8b46e51
commit c0dd986b95
2 changed files with 40 additions and 17 deletions

View File

@ -46,7 +46,7 @@
#include "glonass_l1_ca_pcps_acquisition.h"
#include "signal_generator.h"
#include "signal_generator_c.h"
#include "fir_filter.h"
#include "freq_xlating_fir_filter.h"
#include "gen_signal_source.h"
#include "gnss_sdr_valve.h"
#include "boost/shared_ptr.hpp"
@ -226,7 +226,7 @@ void GlonassL1CaPcpsAcquisitionGSoC2017Test::config_1()
config->set_property("SignalSource.data_flag", "false");
config->set_property("SignalSource.BW_BB", "0.97");
config->set_property("InputFilter.implementation", "Fir_Filter");
config->set_property("InputFilter.implementation", "Freq_Xlating_Fir_Filter");
config->set_property("InputFilter.input_item_type", "gr_complex");
config->set_property("InputFilter.output_item_type", "gr_complex");
config->set_property("InputFilter.taps_item_type", "float");
@ -244,6 +244,8 @@ void GlonassL1CaPcpsAcquisitionGSoC2017Test::config_1()
config->set_property("InputFilter.band2_error", "1.0");
config->set_property("InputFilter.filter_type", "bandpass");
config->set_property("InputFilter.grid_density", "16");
config->set_property("InputFilter.sampling_frequency", std::to_string(fs_in));
config->set_property("InputFilter.IF", "4000000");
config->set_property("Acquisition.item_type", "gr_complex");
config->set_property("Acquisition.coherent_integration_time_ms",
@ -313,7 +315,7 @@ void GlonassL1CaPcpsAcquisitionGSoC2017Test::config_2()
config->set_property("SignalSource.data_flag", "true");
config->set_property("SignalSource.BW_BB", "0.97");
config->set_property("InputFilter.implementation", "Fir_Filter");
config->set_property("InputFilter.implementation", "Freq_Xlating_Fir_Filter");
config->set_property("InputFilter.input_item_type", "gr_complex");
config->set_property("InputFilter.output_item_type", "gr_complex");
config->set_property("InputFilter.taps_item_type", "float");
@ -331,6 +333,8 @@ void GlonassL1CaPcpsAcquisitionGSoC2017Test::config_2()
config->set_property("InputFilter.band2_error", "1.0");
config->set_property("InputFilter.filter_type", "bandpass");
config->set_property("InputFilter.grid_density", "16");
config->set_property("InputFilter.sampling_frequency", std::to_string(fs_in));
config->set_property("InputFilter.IF", "4000000");
config->set_property("Acquisition.item_type", "gr_complex");
config->set_property("Acquisition.coherent_integration_time_ms",
@ -503,12 +507,11 @@ TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ValidationOfResults)
acquisition->init();
ASSERT_NO_THROW({
boost::shared_ptr<GenSignalSource> 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);
std::shared_ptr<SignalGenerator> signal_generator = std::make_shared<SignalGenerator>(config.get(), "SignalSource", 0, 1, queue);
std::shared_ptr<FreqXlatingFirFilter> filter = std::make_shared<FreqXlatingFirFilter>(config.get(), "InputFilter", 1, 1);
signal_generator->connect(top_block);
top_block->connect(signal_generator->get_right_block(), 0, filter->get_left_block(), 0);
top_block->connect(filter->get_right_block(), 0, acquisition->get_left_block(), 0);
}) << "Failure connecting the blocks of acquisition test.";
// i = 0 --> satellite in acquisition is visible
@ -598,12 +601,11 @@ TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ValidationOfResultsProbabilities)
acquisition->init();
ASSERT_NO_THROW({
boost::shared_ptr<GenSignalSource> 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);
std::shared_ptr<SignalGenerator> signal_generator = std::make_shared<SignalGenerator>(config.get(), "SignalSource", 0, 1, queue);
std::shared_ptr<FreqXlatingFirFilter> filter = std::make_shared<FreqXlatingFirFilter>(config.get(), "InputFilter", 1, 1);
signal_generator->connect(top_block);
top_block->connect(signal_generator->get_right_block(), 0, filter->get_left_block(), 0);
top_block->connect(filter->get_right_block(), 0, acquisition->get_left_block(), 0);
}) << "Failure connecting the blocks of acquisition test.";
std::cout << "Probability of false alarm (target) = " << 0.1 << std::endl;

View File

@ -46,6 +46,7 @@
#include "in_memory_configuration.h"
#include "gnss_sdr_valve.h"
#include "gnss_synchro.h"
#include "freq_xlating_fir_filter.h"
#include "glonass_l1_ca_pcps_acquisition.h"
@ -138,6 +139,25 @@ void GlonassL1CaPcpsAcquisitionTest::init()
signal.copy(gnss_synchro.Signal, 2, 0);
gnss_synchro.PRN = 1;
config->set_property("GNSS-SDR.internal_fs_sps", "62314000");
config->set_property("InputFilter.IF", "9540000");
config->set_property("InputFilter.input_item_type", "gr_complex");
config->set_property("InputFilter.output_item_type", "gr_complex");
config->set_property("InputFilter.taps_item_type", "float");
config->set_property("InputFilter.number_of_taps", "11");
config->set_property("InputFilter.number_of_bands", "2");
config->set_property("InputFilter.band1_begin", "0.0");
config->set_property("InputFilter.band1_end", "0.97");
config->set_property("InputFilter.band2_begin", "0.98");
config->set_property("InputFilter.band2_end", "1.0");
config->set_property("InputFilter.ampl1_begin", "1.0");
config->set_property("InputFilter.ampl1_end", "1.0");
config->set_property("InputFilter.ampl2_begin", "0.0");
config->set_property("InputFilter.ampl2_end", "0.0");
config->set_property("InputFilter.band1_error", "1.0");
config->set_property("InputFilter.band2_error", "1.0");
config->set_property("InputFilter.filter_type", "bandpass");
config->set_property("InputFilter.grid_density", "16");
config->set_property("InputFilter.sampling_frequency", "62314000");
config->set_property("Acquisition_1G.item_type", "gr_complex");
config->set_property("Acquisition_1G.coherent_integration_time_ms", "1");
config->set_property("Acquisition_1G.dump", "true");
@ -201,7 +221,7 @@ TEST_F(GlonassL1CaPcpsAcquisitionTest, ValidationOfResults)
double expected_doppler_hz = -9500;
init();
std::shared_ptr<GlonassL1CaPcpsAcquisition> acquisition = std::make_shared<GlonassL1CaPcpsAcquisition>(config.get(), "Acquisition_1G", 1, 0);
std::shared_ptr<FreqXlatingFirFilter> input_filter = std::make_shared<FreqXlatingFirFilter>(config.get(), "InputFilter", 1, 1);
boost::shared_ptr<GlonassL1CaPcpsAcquisitionTest_msg_rx> msg_rx = GlonassL1CaPcpsAcquisitionTest_msg_rx_make();
ASSERT_NO_THROW({
@ -237,7 +257,8 @@ TEST_F(GlonassL1CaPcpsAcquisitionTest, ValidationOfResults)
std::string file = path + "signal_samples/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat";
const char* file_name = file.c_str();
gr::blocks::file_source::sptr file_source = gr::blocks::file_source::make(sizeof(gr_complex), file_name, false);
top_block->connect(file_source, 0, acquisition->get_left_block(), 0);
top_block->connect(file_source, 0, input_filter->get_left_block(), 0);
top_block->connect(input_filter->get_right_block(), 0, acquisition->get_left_block(), 0);
top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events"));
}) << "Failure connecting the blocks of acquisition test.";