mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-05 15:00:33 +00:00
re-enabled the possibility to run the FPGA tracking pull-in tests and observables tests running the doppler wipeoff in the HW. The FPGA now uses the same block of received samples to test all the doppler shifts.
This commit is contained in:
parent
3e46f658f6
commit
f7050766bc
@ -430,11 +430,11 @@ void pcps_acquisition_fpga::set_active(bool active)
|
||||
if (d_test_statistics > d_threshold)
|
||||
{
|
||||
d_active = false;
|
||||
// printf("##### d_test_statistics = %f\n", d_test_statistics);
|
||||
// printf("##### debug_d_max_absolute =%f\n",debug_d_max_absolute);
|
||||
// printf("##### debug_d_input_power_absolute =%f\n",debug_d_input_power_absolute);
|
||||
// printf("##### initial_sample = %llu\n",initial_sample);
|
||||
// printf("##### debug_doppler_index = %d\n",debug_doppler_index);
|
||||
// printf("##### d_test_statistics = %f\n", d_test_statistics);
|
||||
// printf("##### firstpeak =%f\n",firstpeak);
|
||||
// printf("##### secondpeak =%f\n",secondpeak);
|
||||
// printf("##### d_gnss_synchro->Acq_delay_samples = %d\n",(int) d_gnss_synchro->Acq_delay_samples);
|
||||
// printf("##### d_gnss_synchro->Acq_samplestamp_samples = %d\n",(int) d_gnss_synchro->Acq_samplestamp_samples);
|
||||
send_positive_acquisition();
|
||||
d_state = 0; // Positive acquisition
|
||||
|
||||
|
@ -93,6 +93,7 @@ bool test_observables_skip_samples_already_used = 1; // if test_observables_dopp
|
||||
// (exactly in the same way as the SW)
|
||||
// if test_observables_doppler_control_in_sw = 1 and test_observables_skip_samples_already_used = 0 => the sampe samples are used for each PRN loop
|
||||
// if test_observables_doppler_control_in_sw = 0 => test_observables_skip_samples_already_used is not applicable
|
||||
bool doppler_loop_control_in_sw_obs_test = 0;
|
||||
|
||||
// ######## GNURADIO BLOCK MESSAGE RECEVER FOR TRACKING MESSAGES #########
|
||||
class HybridObservablesTest_msg_rx_Fpga;
|
||||
@ -771,7 +772,11 @@ bool HybridObservablesTestFpga::acquire_signal()
|
||||
unsigned int nsamples_total = fft_size;
|
||||
//printf("EEEEEEEEEEEEEEEEEEEEE nbits = %f nsamples_total = %d\n", nbits, fft_size);
|
||||
|
||||
int acq_doppler_max = config->property("Acquisition.doppler_max", FLAGS_external_signal_acquisition_doppler_max_hz);
|
||||
int acq_doppler_step = config->property("Acquisition.doppler_step", FLAGS_external_signal_acquisition_doppler_step_hz);
|
||||
|
||||
if (doppler_loop_control_in_sw_obs_test == 1)
|
||||
{
|
||||
|
||||
if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking_Fpga") == 0)
|
||||
{
|
||||
@ -791,8 +796,6 @@ bool HybridObservablesTestFpga::acquire_signal()
|
||||
acquisition_GpsL5_Fpga->set_single_doppler_flag(1);
|
||||
}
|
||||
|
||||
int acq_doppler_max = config->property("Acquisition.doppler_max", FLAGS_external_signal_acquisition_doppler_max_hz);
|
||||
int acq_doppler_step = config->property("Acquisition.doppler_step", FLAGS_external_signal_acquisition_doppler_step_hz);
|
||||
|
||||
int num_doppler_steps = (2*acq_doppler_max)/acq_doppler_step + 1;
|
||||
|
||||
@ -1051,10 +1054,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)
|
||||
@ -1118,6 +1121,277 @@ bool HybridObservablesTestFpga::acquire_signal()
|
||||
std::cin >> dummy_val;
|
||||
}
|
||||
}
|
||||
}
|
||||
else // DOPPLER CONTROL IN HW
|
||||
{
|
||||
|
||||
for (unsigned int PRN = 1; PRN < MAX_PRN_IDX; PRN++)
|
||||
//for (unsigned int PRN = 0; PRN < 17; PRN++)
|
||||
{
|
||||
|
||||
uint32_t max_index = 0;
|
||||
float max_magnitude = 0.0;
|
||||
float second_magnitude = 0.0;
|
||||
uint64_t initial_sample = 0;
|
||||
//float power_sum = 0;
|
||||
uint32_t doppler_index = 0;
|
||||
|
||||
uint32_t max_index_iteration;
|
||||
uint32_t total_fft_scaling_factor;
|
||||
uint32_t fw_fft_scaling_factor;
|
||||
float max_magnitude_iteration;
|
||||
float second_magnitude_iteration;
|
||||
uint64_t initial_sample_iteration;
|
||||
//float power_sum_iteration;
|
||||
uint32_t doppler_index_iteration;
|
||||
int doppler_shift_selected;
|
||||
int doppler_num = 0;
|
||||
|
||||
tmp_gnss_synchro.PRN = PRN;
|
||||
|
||||
if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking_Fpga") == 0)
|
||||
{
|
||||
acquisition_GpsL1Ca_Fpga->reset_acquisition(); // reset the whole system including the sample counters
|
||||
acquisition_GpsL1Ca_Fpga->set_doppler_max(acq_doppler_max);
|
||||
acquisition_GpsL1Ca_Fpga->set_doppler_step(acq_doppler_step);
|
||||
|
||||
acquisition_GpsL1Ca_Fpga->set_gnss_synchro(&tmp_gnss_synchro);
|
||||
acquisition_GpsL1Ca_Fpga->init();
|
||||
acquisition_GpsL1Ca_Fpga->set_local_code();
|
||||
args.freq_band = 0;
|
||||
}
|
||||
else if (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking_Fpga") == 0)
|
||||
{
|
||||
//printf("starting configuring acquisition\n");
|
||||
acquisition_GpsE1_Fpga->reset_acquisition(); // reset the whole system including the sample counters
|
||||
acquisition_GpsE1_Fpga->set_doppler_max(acq_doppler_max);
|
||||
acquisition_GpsE1_Fpga->set_doppler_step(acq_doppler_step);
|
||||
|
||||
acquisition_GpsE1_Fpga->set_gnss_synchro(&tmp_gnss_synchro);
|
||||
acquisition_GpsE1_Fpga->init();
|
||||
acquisition_GpsE1_Fpga->set_local_code();
|
||||
args.freq_band = 0;
|
||||
//printf("ffffffffffff ending configuring acquisition\n");
|
||||
}
|
||||
else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking_Fpga") == 0)
|
||||
{
|
||||
acquisition_GpsE5a_Fpga->reset_acquisition(); // reset the whole system including the sample counters
|
||||
acquisition_GpsE5a_Fpga->set_doppler_max(acq_doppler_max);
|
||||
acquisition_GpsE5a_Fpga->set_doppler_step(acq_doppler_step);
|
||||
|
||||
acquisition_GpsE5a_Fpga->set_gnss_synchro(&tmp_gnss_synchro);
|
||||
acquisition_GpsE5a_Fpga->init();
|
||||
acquisition_GpsE5a_Fpga->set_local_code();
|
||||
args.freq_band = 1;
|
||||
}
|
||||
else if (implementation.compare("GPS_L5_DLL_PLL_Tracking_Fpga") == 0)
|
||||
{
|
||||
acquisition_GpsL5_Fpga->reset_acquisition(); // reset the whole system including the sample counters
|
||||
acquisition_GpsL5_Fpga->set_doppler_max(acq_doppler_max);
|
||||
acquisition_GpsL5_Fpga->set_doppler_step(acq_doppler_step);
|
||||
|
||||
acquisition_GpsL5_Fpga->set_gnss_synchro(&tmp_gnss_synchro);
|
||||
acquisition_GpsL5_Fpga->init();
|
||||
acquisition_GpsL5_Fpga->set_local_code();
|
||||
args.freq_band = 1;
|
||||
}
|
||||
|
||||
args.file = file;
|
||||
|
||||
|
||||
if ((implementation.compare("GPS_L1_CA_DLL_PLL_Tracking_Fpga") == 0) or (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking_Fpga") == 0))
|
||||
{
|
||||
//printf("gggggggg \n");
|
||||
//----------------------------------------------------------------------------------
|
||||
// send the previous samples to set the downsampling filter in a good condition
|
||||
send_samples_start = 0;
|
||||
|
||||
args.skip_used_samples = - DOWNAMPLING_FILTER_INIT_SAMPLES; // set the counter 2000 samples before
|
||||
|
||||
args.nsamples_tx = DOWNAMPLING_FILTER_INIT_SAMPLES + DOWNSAMPLING_FILTER_DELAY + DOWNSAMPLING_FILTER_OFFSET_SAMPLES; //50000; // max size of the FFT
|
||||
|
||||
//printf("sending pre init %d\n", args.nsamples_tx);
|
||||
|
||||
if (pthread_create(&thread_DMA, NULL, handler_DMA, (void *)&args) < 0)
|
||||
{
|
||||
printf("ERROR cannot create DMA Process\n");
|
||||
}
|
||||
pthread_mutex_lock(&mutex);
|
||||
send_samples_start = 1;
|
||||
pthread_mutex_unlock(&mutex);
|
||||
pthread_join(thread_DMA, NULL);
|
||||
send_samples_start = 0;
|
||||
//printf("finished sending samples init filter status\n");
|
||||
//-----------------------------------------------------------------------------------
|
||||
|
||||
// debug
|
||||
args.nsamples_tx = nsamples_to_transfer; //fft_size; //50000; // max size of the FFT
|
||||
|
||||
args.skip_used_samples = DOWNSAMPLING_FILTER_DELAY + DOWNSAMPLING_FILTER_OFFSET_SAMPLES;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// debug
|
||||
args.nsamples_tx = nsamples_to_transfer; //fft_size; //50000; // max size of the FFT
|
||||
|
||||
args.skip_used_samples = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// create DMA child process
|
||||
//printf("||||||||1 args freq_band = %d\n", args.freq_band);
|
||||
//printf("sending samples main DMA %d\n", args.nsamples_tx);
|
||||
if (pthread_create(&thread_DMA, NULL, handler_DMA, (void *)&args) < 0)
|
||||
{
|
||||
printf("ERROR cannot create DMA Process\n");
|
||||
}
|
||||
|
||||
msg_rx->rx_message = 0;
|
||||
top_block->start();
|
||||
|
||||
pthread_mutex_lock(&mutex);
|
||||
send_samples_start = 1;
|
||||
pthread_mutex_unlock(&mutex);
|
||||
|
||||
if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking_Fpga") == 0)
|
||||
{
|
||||
acquisition_GpsL1Ca_Fpga->reset(); // set active
|
||||
}
|
||||
else if (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking_Fpga") == 0)
|
||||
{
|
||||
//printf("hhhhhhhhhhhh\n");
|
||||
acquisition_GpsE1_Fpga->reset(); // set active
|
||||
}
|
||||
else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking_Fpga") == 0)
|
||||
{
|
||||
acquisition_GpsE5a_Fpga->reset(); // set active
|
||||
}
|
||||
else if (implementation.compare("GPS_L5_DLL_PLL_Tracking_Fpga") == 0)
|
||||
{
|
||||
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);
|
||||
|
||||
if (start_msg == true)
|
||||
{
|
||||
std::cout << "Reading external signal file: " << FLAGS_signal_file << std::endl;
|
||||
std::cout << "Searching for " << System_and_Signal << " Satellites..." << std::endl;
|
||||
std::cout << "[";
|
||||
start_msg = false;
|
||||
}
|
||||
|
||||
// wait for the child DMA process to finish
|
||||
pthread_join(thread_DMA, NULL);
|
||||
|
||||
pthread_mutex_lock(&mutex);
|
||||
send_samples_start = 0;
|
||||
pthread_mutex_unlock(&mutex);
|
||||
|
||||
while (msg_rx->rx_message == 0)
|
||||
{
|
||||
usleep(100000);
|
||||
}
|
||||
if (msg_rx->rx_message == 1)
|
||||
{
|
||||
std::cout << " " << PRN << " ";
|
||||
|
||||
tmp_gnss_synchro.Acq_doppler_hz = tmp_gnss_synchro.Acq_doppler_hz;
|
||||
tmp_gnss_synchro.Acq_delay_samples = tmp_gnss_synchro.Acq_delay_samples;
|
||||
tmp_gnss_synchro.Acq_samplestamp_samples = 0; // do not take into account the filter internal state initialisation
|
||||
tmp_gnss_synchro.Acq_samplestamp_samples = tmp_gnss_synchro.Acq_samplestamp_samples; // delay due to the downsampling filter in the acquisition
|
||||
|
||||
|
||||
gnss_synchro_vec.push_back(tmp_gnss_synchro);
|
||||
|
||||
|
||||
// doppler_measurements_map.insert(std::pair<int, double>(PRN, tmp_gnss_synchro.Acq_doppler_hz));
|
||||
// code_delay_measurements_map.insert(std::pair<int, double>(PRN, tmp_gnss_synchro.Acq_delay_samples));
|
||||
// tmp_gnss_synchro.Acq_samplestamp_samples = 0; // do not take into account the filter internal state initialisation
|
||||
// acq_samplestamp_map.insert(std::pair<int, double>(PRN, tmp_gnss_synchro.Acq_samplestamp_samples));
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << " . ";
|
||||
}
|
||||
|
||||
// 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);
|
||||
// }
|
||||
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 << " . ";
|
||||
// }
|
||||
|
||||
std::cout.flush();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
// }
|
||||
std::cout << "]" << std::endl;
|
||||
std::cout << "-------------------------------------------\n";
|
||||
@ -2174,11 +2448,14 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults)
|
||||
{
|
||||
tracking_ch_vec.at(n)->start_tracking();
|
||||
}
|
||||
|
||||
|
||||
//printf("222222222222222222 bis\n");
|
||||
pthread_mutex_lock(&mutex_obs_test);
|
||||
send_samples_start_obs_test = 1;
|
||||
pthread_mutex_unlock(&mutex_obs_test);
|
||||
|
||||
|
||||
top_block->start();
|
||||
//printf("33333333333333333333 top block started\n");
|
||||
|
||||
@ -2191,13 +2468,17 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults)
|
||||
elapsed_seconds = end - start;
|
||||
}) << "Failure running the top_block.";
|
||||
|
||||
|
||||
// wait for the child DMA process to finish
|
||||
pthread_join(thread_DMA, NULL);
|
||||
|
||||
|
||||
|
||||
//printf("444444444444 CHILD PROCESS FINISHED\n");
|
||||
|
||||
top_block->stop();
|
||||
|
||||
|
||||
//printf("55555555555 TOP BLOCK STOPPED\n");
|
||||
|
||||
// send more samples to unblock the tracking process in case it was waiting for samples
|
||||
@ -2220,9 +2501,11 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults)
|
||||
pthread_join(thread_DMA, NULL);
|
||||
//printf("777777777 PROCESS FINISHED \n");
|
||||
|
||||
pthread_mutex_lock(&mutex_obs_test);
|
||||
send_samples_start_obs_test = 0;
|
||||
pthread_mutex_unlock(&mutex_obs_test);
|
||||
|
||||
|
||||
// pthread_mutex_lock(&mutex_obs_test);
|
||||
// send_samples_start_obs_test = 0;
|
||||
// pthread_mutex_unlock(&mutex_obs_test);
|
||||
|
||||
|
||||
|
||||
@ -2277,6 +2560,8 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults)
|
||||
ASSERT_EQ(ReadRinexObs(&true_obs_vec, gnss_synchro_master), true)
|
||||
<< "Failure reading RINEX file";
|
||||
}
|
||||
|
||||
|
||||
//read measured values
|
||||
observables_dump_reader estimated_observables(tracking_ch_vec.size());
|
||||
ASSERT_NO_THROW({
|
||||
@ -2461,5 +2746,6 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
std::cout << "Test completed in " << elapsed_seconds.count() << " [s]" << std::endl;
|
||||
}
|
||||
|
@ -80,7 +80,7 @@
|
||||
bool show_results_table = 0; // 1 => show matrix of (doppler, (max value, power sum)) results, 0=> do not show it
|
||||
bool skip_samples_already_used = 0; // if skip_samples_already_used = 1 => for each PRN loop skip the samples used in the previous PRN loops
|
||||
// (exactly in the same way as the SW)
|
||||
bool doppler_loop_control_in_sw = 1;
|
||||
bool doppler_loop_control_in_sw = 0;
|
||||
|
||||
|
||||
|
||||
@ -1187,6 +1187,8 @@ bool TrackingPullInTestFpga::acquire_signal(int SV_ID)
|
||||
int doppler_shift_selected;
|
||||
int doppler_num = 0;
|
||||
|
||||
tmp_gnss_synchro.PRN = PRN;
|
||||
|
||||
if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking_Fpga") == 0)
|
||||
{
|
||||
acquisition_GpsL1Ca_Fpga->reset_acquisition(); // reset the whole system including the sample counters
|
||||
@ -1335,70 +1337,86 @@ bool TrackingPullInTestFpga::acquire_signal(int SV_ID)
|
||||
{
|
||||
usleep(100000);
|
||||
}
|
||||
|
||||
if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking_Fpga") == 0)
|
||||
if (msg_rx->rx_message == 1)
|
||||
{
|
||||
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();
|
||||
|
||||
//power_sum = (power_sum - max_magnitude) / (fft_size - 1);
|
||||
//float test_statistics = (max_magnitude / power_sum);
|
||||
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)
|
||||
doppler_measurements_map.insert(std::pair<int, double>(PRN, tmp_gnss_synchro.Acq_doppler_hz));
|
||||
code_delay_measurements_map.insert(std::pair<int, double>(PRN, tmp_gnss_synchro.Acq_delay_samples));
|
||||
tmp_gnss_synchro.Acq_samplestamp_samples = 0; // do not take into account the filter internal state initialisation
|
||||
acq_samplestamp_map.insert(std::pair<int, double>(PRN, tmp_gnss_synchro.Acq_samplestamp_samples));
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << " . ";
|
||||
}
|
||||
|
||||
// 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);
|
||||
// }
|
||||
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 << " . ";
|
||||
// }
|
||||
|
||||
std::cout.flush();
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user