1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-15 12:40:35 +00:00

minor corrections

This commit is contained in:
Marc Majoral 2019-01-31 15:36:11 +01:00
parent ed5dc6a442
commit ec80df40dc
2 changed files with 548 additions and 549 deletions

View File

@ -82,7 +82,7 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max;
acq_parameters.doppler_max = doppler_max_;
unsigned int sampled_ms = configuration_->property(role + ".coherent_integration_time_ms", 4);
unsigned int sampled_ms = configuration_->property(role + ".coherent_integration_time_ms", 1);
acq_parameters.sampled_ms = sampled_ms;
auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)));
acq_parameters.code_length = code_length;

View File

@ -543,22 +543,24 @@ bool HybridObservablesTestFpga::acquire_signal()
tmp_gnss_synchro.Channel_ID = 0;
config = std::make_shared<InMemoryConfiguration>();
config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(baseband_sampling_freq));
config->set_property("Acquisition.blocking_on_standby", "true");
config->set_property("Acquisition.blocking", "true");
config->set_property("Acquisition.dump", "false");
config->set_property("Acquisition.dump_filename", "./data/acquisition.dat");
config->set_property("Acquisition.use_CFAR_algorithm", "false");
//config->set_property("Acquisition.blocking_on_standby", "true"); -- not used in the HW
//config->set_property("Acquisition.blocking", "true"); -- not used in the HW
//config->set_property("Acquisition.dump", "false"); -- not used in the HW
//config->set_property("Acquisition.dump_filename", "./data/acquisition.dat"); -- not used in the HW
//config->set_property("Acquisition.use_CFAR_algorithm", "false"); -- not used in the HW at this moment
config->set_property("Acquisition.item_type", "cshort");
config->set_property("Acquisition.if", "0");
//config->set_property("Acquisition.item_type", "cshort");
//config->set_property("Acquisition.if", "0");
//config->set_property("Acquisition.sampled_ms", "4");
//config->set_property("Acquisition.select_queue_Fpga", "0");
config->set_property("Acquisition.devicename", "/dev/uio0");
//config->set_property("Acquisition.devicename", "/dev/uio0");
if (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking_Fpga") == 0)
{
config->set_property("Acquisition.acquire_pilot", "false");
}
config->set_property("Acquisition.max_dwells", std::to_string(FLAGS_external_signal_acquisition_dwells));
//if (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking_Fpga") == 0)
//{
// config->set_property("Acquisition.acquire_pilot", "false"); -- ALREADY THE DEFAULT VALUE
//}
//std::shared_ptr<AcquisitionInterface> acquisition;
@ -572,15 +574,15 @@ bool HybridObservablesTestFpga::acquire_signal()
//printf("AAAAAAAAAAAAAAAAAAAAA\n");
if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking_Fpga") == 0)
{
config->set_property("Acquisition.select_queue_Fpga", "0");
config->set_property("Acquisition.sampled_ms", "1");
//config->set_property("Acquisition.select_queue_Fpga", "0");
//config->set_property("Acquisition.sampled_ms", "1");
//printf("AAAAAAAAAAAAAAAAAAAAA2222\n");
tmp_gnss_synchro.System = 'G';
std::string signal = "1C";
signal.copy(tmp_gnss_synchro.Signal, 2, 0);
tmp_gnss_synchro.PRN = SV_ID;
System_and_Signal = "GPS L1 CA";
config->set_property("Acquisition.max_dwells", std::to_string(FLAGS_external_signal_acquisition_dwells));
//config->set_property("Acquisition.max_dwells", std::to_string(FLAGS_external_signal_acquisition_dwells));
////acquisition = std::make_shared<GpsL1CaPcpsAcquisitionFineDoppler>(config.get(), "Acquisition", 1, 0);
//acquisition = std::make_shared<GpsL1CaPcpsAcquisition>(config.get(), "Acquisition", 1, 0);
acquisition_GpsL1Ca_Fpga = std::make_shared<GpsL1CaPcpsAcquisitionFpga>(config.get(), "Acquisition", 0, 0);
@ -592,14 +594,14 @@ bool HybridObservablesTestFpga::acquire_signal()
}
else if (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking_Fpga") == 0)
{
config->set_property("Acquisition.select_queue_Fpga", "0");
config->set_property("Acquisition.sampled_ms", "4");
//config->set_property("Acquisition.select_queue_Fpga", "0");
//config->set_property("Acquisition.sampled_ms", "4");
tmp_gnss_synchro.System = 'E';
std::string signal = "1B";
signal.copy(tmp_gnss_synchro.Signal, 2, 0);
tmp_gnss_synchro.PRN = SV_ID;
System_and_Signal = "Galileo E1B";
config->set_property("Acquisition.max_dwells", std::to_string(FLAGS_external_signal_acquisition_dwells));
//config->set_property("Acquisition.max_dwells", std::to_string(FLAGS_external_signal_acquisition_dwells));
//acquisition = std::make_shared<GalileoE1PcpsAmbiguousAcquisition>(config.get(), "Acquisition", 1, 0);
acquisition_GpsE1_Fpga = std::make_shared<GalileoE1PcpsAmbiguousAcquisitionFpga>(config.get(), "Acquisition", 0, 0);
@ -637,14 +639,14 @@ bool HybridObservablesTestFpga::acquire_signal()
else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking_Fpga") == 0)
{
config->set_property("Acquisition.select_queue_Fpga", "1");
config->set_property("Acquisition.sampled_ms", "1");
//config->set_property("Acquisition.select_queue_Fpga", "1");
//config->set_property("Acquisition.sampled_ms", "1");
tmp_gnss_synchro.System = 'E';
std::string signal = "5X";
signal.copy(tmp_gnss_synchro.Signal, 2, 0);
tmp_gnss_synchro.PRN = SV_ID;
System_and_Signal = "Galileo E5a";
config->set_property("Acquisition.max_dwells", std::to_string(FLAGS_external_signal_acquisition_dwells));
//config->set_property("Acquisition.max_dwells", std::to_string(FLAGS_external_signal_acquisition_dwells));
//acquisition = std::make_shared<GalileoE5aPcpsAcquisition>(config.get(), "Acquisition", 1, 0);
acquisition_GpsE5a_Fpga = std::make_shared<GalileoE5aPcpsAcquisitionFpga>(config.get(), "Acquisition", 0, 0);
@ -655,14 +657,14 @@ bool HybridObservablesTestFpga::acquire_signal()
}
else if (implementation.compare("GPS_L5_DLL_PLL_Tracking_Fpga") == 0)
{
config->set_property("Acquisition.select_queue_Fpga", "1");
config->set_property("Acquisition.sampled_ms", "1");
//config->set_property("Acquisition.select_queue_Fpga", "1");
//config->set_property("Acquisition.sampled_ms", "1");
tmp_gnss_synchro.System = 'G';
std::string signal = "L5";
signal.copy(tmp_gnss_synchro.Signal, 2, 0);
tmp_gnss_synchro.PRN = SV_ID;
System_and_Signal = "GPS L5I";
config->set_property("Acquisition.max_dwells", std::to_string(FLAGS_external_signal_acquisition_dwells));
//config->set_property("Acquisition.max_dwells", std::to_string(FLAGS_external_signal_acquisition_dwells));
//acquisition = std::make_shared<GpsL5iPcpsAcquisition>(config.get(), "Acquisition", 1, 0);
acquisition_GpsL5_Fpga = std::make_shared<GpsL5iPcpsAcquisitionFpga>(config.get(), "Acquisition", 0, 0);
@ -777,9 +779,6 @@ bool HybridObservablesTestFpga::acquire_signal()
nsamples_to_transfer = static_cast<unsigned int>(std::round(static_cast<double>(baseband_sampling_freq) / (GPS_L5i_CODE_RATE_HZ / GPS_L5i_CODE_LENGTH_CHIPS)));
}
//printf("DDDDDDD3 code_length = %d\n", code_length);
float nbits = ceilf(log2f((float)code_length*2));
unsigned int fft_size = pow(2, nbits);
unsigned int nsamples_total = fft_size;
@ -904,7 +903,7 @@ bool HybridObservablesTestFpga::acquire_signal()
//----------------------------------------------------------------------------------
// send the previous samples to set the downsampling filter in a good condition
send_samples_start_obs_test = 0;
if (skip_samples_already_used == 1)
if (test_observables_skip_samples_already_used == 1)
{
args.skip_used_samples = (PRN -1)*fft_size - DOWNAMPLING_FILTER_INIT_SAMPLES; // set the counter 2000 samples before
}
@ -931,7 +930,7 @@ bool HybridObservablesTestFpga::acquire_signal()
// debug
args.nsamples_tx = nsamples_to_transfer; //fft_size; //50000; // max size of the FFT
if (skip_samples_already_used == 1)
if (test_observables_skip_samples_already_used == 1)
{
args.skip_used_samples = (PRN -1)*fft_size + DOWNSAMPLING_FILTER_DELAY + DOWNSAMPLING_FILTER_OFFSET_SAMPLES;
}
@ -945,7 +944,7 @@ bool HybridObservablesTestFpga::acquire_signal()
// debug
args.nsamples_tx = nsamples_to_transfer; //fft_size; //50000; // max size of the FFT
if (skip_samples_already_used == 1)
if (test_observables_skip_samples_already_used == 1)
{
args.skip_used_samples = (PRN -1)*fft_size;
}
@ -1067,10 +1066,10 @@ bool HybridObservablesTestFpga::acquire_signal()
}
// power_sum = (power_sum - max_magnitude) / (fft_size - 1);
// float test_statistics = (max_magnitude / power_sum);
// float threshold = config->property("Acquisition.threshold", FLAGS_external_signal_acquisition_threshold);
// if (test_statistics > threshold)
// power_sum = (power_sum - max_magnitude) / (fft_size - 1);
// float test_statistics = (max_magnitude / power_sum);
// float threshold = config->property("Acquisition.threshold", FLAGS_external_signal_acquisition_threshold);
// if (test_statistics > threshold)
float test_statistics = max_magnitude/second_magnitude;
float threshold = config->property("Acquisition.threshold", FLAGS_external_signal_acquisition_threshold);
if (test_statistics > threshold)
@ -1290,9 +1289,9 @@ bool HybridObservablesTestFpga::acquire_signal()
acquisition_GpsL5_Fpga->reset(); // set active
}
// pthread_mutex_lock(&mutex); // it doesn't work if it is done here
// send_samples_start = 1;
// pthread_mutex_unlock(&mutex);
// pthread_mutex_lock(&mutex); // it doesn't work if it is done here
// send_samples_start = 1;
// pthread_mutex_unlock(&mutex);
if (start_msg == true)
{
@ -1336,72 +1335,72 @@ bool HybridObservablesTestFpga::acquire_signal()
std::cout << " . ";
}
// while (msg_rx->rx_message == 0)
// {
// usleep(100000);
// }
// while (msg_rx->rx_message == 0)
// {
// usleep(100000);
// }
// if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking_Fpga") == 0)
// {
// acquisition_GpsL1Ca_Fpga->read_acquisition_results(&max_index_iteration, &max_magnitude_iteration, &second_magnitude_iteration, &initial_sample_iteration, &doppler_index_iteration, &total_fft_scaling_factor);
// //acquisition_GpsL1Ca_Fpga->read_fpga_total_scale_factor(&total_fft_scaling_factor, &fw_fft_scaling_factor);
// }
// else if (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking_Fpga") == 0)
// {
// //printf("iiiiiiiiiiiiii\n");
// acquisition_GpsE1_Fpga->read_acquisition_results(&max_index_iteration, &max_magnitude_iteration, &second_magnitude_iteration, &initial_sample_iteration, &doppler_index_iteration, &total_fft_scaling_factor);
// //acquisition_GpsE1_Fpga->read_fpga_total_scale_factor(&total_fft_scaling_factor, &fw_fft_scaling_factor);
// }
// else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking_Fpga") == 0)
// {
// acquisition_GpsE5a_Fpga->read_acquisition_results(&max_index_iteration, &max_magnitude_iteration, &second_magnitude_iteration, &initial_sample_iteration, &doppler_index_iteration, &total_fft_scaling_factor);
// //acquisition_GpsE5a_Fpga->read_fpga_total_scale_factor(&total_fft_scaling_factor, &fw_fft_scaling_factor);
// }
// else if (implementation.compare("GPS_L5_DLL_PLL_Tracking_Fpga") == 0)
// {
// acquisition_GpsL5_Fpga->read_acquisition_results(&max_index_iteration, &max_magnitude_iteration, &second_magnitude_iteration, &initial_sample_iteration, &doppler_index_iteration, &total_fft_scaling_factor);
// //acquisition_GpsL5_Fpga->read_fpga_total_scale_factor(&total_fft_scaling_factor, &fw_fft_scaling_factor);
// }
//
// if ((implementation.compare("GPS_L1_CA_DLL_PLL_Tracking_Fpga") == 0) or (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking_Fpga") == 0))
// {
// int interpolation_factor = 4;
// //index_debug[PRN - 1] = max_index_iteration;
// max_index = max_index_iteration; // - interpolation_factor*(DOWNSAMPLING_FILTER_DELAY - 1);
// max_magnitude = max_magnitude_iteration;
// second_magnitude = second_magnitude_iteration;
// //samplestamp_debug[PRN - 1] = initial_sample_iteration;
// initial_sample = 0; //initial_sample_iteration;
// doppler_index = doppler_index_iteration;
// doppler_shift_selected = -acq_doppler_max + acq_doppler_step * (doppler_index_iteration - 1);
// }
// else
// {
// max_index = max_index_iteration;
// max_magnitude = max_magnitude_iteration;
// second_magnitude = second_magnitude_iteration;
// initial_sample = initial_sample_iteration;
// doppler_index = doppler_index_iteration;
// doppler_shift_selected = -acq_doppler_max + acq_doppler_step * (doppler_index_iteration - 1);
// }
// if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking_Fpga") == 0)
// {
// acquisition_GpsL1Ca_Fpga->read_acquisition_results(&max_index_iteration, &max_magnitude_iteration, &second_magnitude_iteration, &initial_sample_iteration, &doppler_index_iteration, &total_fft_scaling_factor);
// //acquisition_GpsL1Ca_Fpga->read_fpga_total_scale_factor(&total_fft_scaling_factor, &fw_fft_scaling_factor);
// }
// else if (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking_Fpga") == 0)
// {
// //printf("iiiiiiiiiiiiii\n");
// acquisition_GpsE1_Fpga->read_acquisition_results(&max_index_iteration, &max_magnitude_iteration, &second_magnitude_iteration, &initial_sample_iteration, &doppler_index_iteration, &total_fft_scaling_factor);
// //acquisition_GpsE1_Fpga->read_fpga_total_scale_factor(&total_fft_scaling_factor, &fw_fft_scaling_factor);
// }
// else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking_Fpga") == 0)
// {
// acquisition_GpsE5a_Fpga->read_acquisition_results(&max_index_iteration, &max_magnitude_iteration, &second_magnitude_iteration, &initial_sample_iteration, &doppler_index_iteration, &total_fft_scaling_factor);
// //acquisition_GpsE5a_Fpga->read_fpga_total_scale_factor(&total_fft_scaling_factor, &fw_fft_scaling_factor);
// }
// else if (implementation.compare("GPS_L5_DLL_PLL_Tracking_Fpga") == 0)
// {
// acquisition_GpsL5_Fpga->read_acquisition_results(&max_index_iteration, &max_magnitude_iteration, &second_magnitude_iteration, &initial_sample_iteration, &doppler_index_iteration, &total_fft_scaling_factor);
// //acquisition_GpsL5_Fpga->read_fpga_total_scale_factor(&total_fft_scaling_factor, &fw_fft_scaling_factor);
// }
//
// if ((implementation.compare("GPS_L1_CA_DLL_PLL_Tracking_Fpga") == 0) or (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking_Fpga") == 0))
// {
// int interpolation_factor = 4;
// //index_debug[PRN - 1] = max_index_iteration;
// max_index = max_index_iteration; // - interpolation_factor*(DOWNSAMPLING_FILTER_DELAY - 1);
// max_magnitude = max_magnitude_iteration;
// second_magnitude = second_magnitude_iteration;
// //samplestamp_debug[PRN - 1] = initial_sample_iteration;
// initial_sample = 0; //initial_sample_iteration;
// doppler_index = doppler_index_iteration;
// doppler_shift_selected = -acq_doppler_max + acq_doppler_step * (doppler_index_iteration - 1);
// }
// else
// {
// max_index = max_index_iteration;
// max_magnitude = max_magnitude_iteration;
// second_magnitude = second_magnitude_iteration;
// initial_sample = initial_sample_iteration;
// doppler_index = doppler_index_iteration;
// doppler_shift_selected = -acq_doppler_max + acq_doppler_step * (doppler_index_iteration - 1);
// }
top_block->stop();
// float test_statistics = max_magnitude/second_magnitude;
// float threshold = config->property("Acquisition.threshold", FLAGS_external_signal_acquisition_threshold);
// if (test_statistics > threshold)
// {
// //printf("XXXXXXXXXXXXXXXXXXXXXXXXXXX max index = %d = %d \n", max_index, max_index % nsamples_total);
// std::cout << " " << PRN << " ";
// doppler_measurements_map.insert(std::pair<int, double>(PRN, static_cast<double>(doppler_shift_selected)));
// code_delay_measurements_map.insert(std::pair<int, double>(PRN, static_cast<double>(max_index % nsamples_total)));
// code_delay_measurements_map.insert(std::pair<int, double>(PRN, static_cast<double>(max_index)));
// acq_samplestamp_map.insert(std::pair<int, double>(PRN, initial_sample)); // should be 0 (first sample upon which acq starts is always 0 in this case)
// }
// else
// {
// std::cout << " . ";
// }
// float test_statistics = max_magnitude/second_magnitude;
// float threshold = config->property("Acquisition.threshold", FLAGS_external_signal_acquisition_threshold);
// if (test_statistics > threshold)
// {
// //printf("XXXXXXXXXXXXXXXXXXXXXXXXXXX max index = %d = %d \n", max_index, max_index % nsamples_total);
// std::cout << " " << PRN << " ";
// doppler_measurements_map.insert(std::pair<int, double>(PRN, static_cast<double>(doppler_shift_selected)));
// code_delay_measurements_map.insert(std::pair<int, double>(PRN, static_cast<double>(max_index % nsamples_total)));
// code_delay_measurements_map.insert(std::pair<int, double>(PRN, static_cast<double>(max_index)));
// acq_samplestamp_map.insert(std::pair<int, double>(PRN, initial_sample)); // should be 0 (first sample upon which acq starts is always 0 in this case)
// }
// else
// {
// std::cout << " . ";
// }
std::cout.flush();