mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-11-13 05:37:20 +00:00
corrected a bug in the fpga tracking pull-in test where a parameter was rewritten with an incorrect value
modified the fpga tracking pull-in test to take into account the downsampling factor in the L1/E1 queue
This commit is contained in:
@@ -69,10 +69,10 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
|
||||
printf("downsampling_factor = %f\n", downsampling_factor);
|
||||
acq_parameters.downsampling_factor = downsampling_factor;
|
||||
//fs_in = fs_in/2.0; // downampling filter
|
||||
//printf("fs_in pre downsampling = %ld\n", fs_in);
|
||||
printf("fs_in pre downsampling = %ld\n", fs_in);
|
||||
|
||||
fs_in = fs_in/downsampling_factor;
|
||||
//printf("fs_in post downsampling = %ld\n", fs_in);
|
||||
printf("fs_in post downsampling = %ld\n", fs_in);
|
||||
|
||||
//printf("####### DEBUG Acq: fs_in = %d\n", fs_in);
|
||||
acq_parameters.fs_in = fs_in;
|
||||
@@ -89,7 +89,7 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
|
||||
float nbits = ceilf(log2f((float)code_length*2));
|
||||
unsigned int nsamples_total = pow(2, nbits);
|
||||
unsigned int vector_length = nsamples_total;
|
||||
//printf("acq adapter vector_length = %d\n", vector_length);
|
||||
printf("acq adapter vector_length = %d\n", vector_length);
|
||||
unsigned int select_queue_Fpga = configuration_->property(role + ".select_queue_Fpga", 0);
|
||||
printf("select queue = %d\n", select_queue_Fpga);
|
||||
acq_parameters.select_queue_Fpga = select_queue_Fpga;
|
||||
@@ -265,6 +265,7 @@ void GpsL1CaPcpsAcquisitionFpga::set_local_code()
|
||||
|
||||
void GpsL1CaPcpsAcquisitionFpga::reset()
|
||||
{
|
||||
//printf("######### acq RESET called\n");
|
||||
acquisition_fpga_->set_active(true);
|
||||
//printf("acq reset end dddsss\n");
|
||||
}
|
||||
|
||||
@@ -137,8 +137,16 @@ void pcps_acquisition_fpga::init()
|
||||
d_gnss_synchro->Acq_samplestamp_samples = 0;
|
||||
d_mag = 0.0;
|
||||
d_input_power = 0.0;
|
||||
d_num_doppler_bins = static_cast<uint32_t>(std::ceil(static_cast<double>(static_cast<int32_t>(acq_parameters.doppler_max) - static_cast<int32_t>(-acq_parameters.doppler_max)) / static_cast<double>(d_doppler_step))) + 1;
|
||||
//printf("acq gnuradioblock doppler_max = %lu\n", (unsigned long) static_cast<int32_t>(acq_parameters.doppler_max));
|
||||
|
||||
if (d_single_doppler_flag == 1)
|
||||
{
|
||||
d_num_doppler_bins = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
d_num_doppler_bins = static_cast<uint32_t>(std::ceil(static_cast<double>(static_cast<int32_t>(acq_parameters.doppler_max) - static_cast<int32_t>(-acq_parameters.doppler_max)) / static_cast<double>(d_doppler_step))) + 1;
|
||||
}
|
||||
//printf("acq gnuradioblock doppler_max = %lu\n", (unsigned long) static_cast<int32_t>(acq_parameters.doppler_max));
|
||||
//printf("acq gnuradioblock doppler_step = %lu\n", (unsigned long) d_doppler_step);
|
||||
//printf("acq gnuradioblock d_num_doppler_bins = %lu\n", (unsigned long) d_num_doppler_bins);
|
||||
acquisition_fpga->init();
|
||||
@@ -251,7 +259,7 @@ void pcps_acquisition_fpga::set_active(bool active)
|
||||
// while(1)
|
||||
//{
|
||||
|
||||
|
||||
//printf("######### acq ENTERING SET ACTIVE\n");
|
||||
|
||||
// run loop in hw
|
||||
//printf("LAUNCH ACQ\n");
|
||||
@@ -260,6 +268,7 @@ void pcps_acquisition_fpga::set_active(bool active)
|
||||
acquisition_fpga->configure_acquisition();
|
||||
acquisition_fpga->set_doppler_sweep(d_num_doppler_bins);
|
||||
|
||||
//printf("d_num_doppler_bins = %d\n", (int) d_num_doppler_bins);
|
||||
acquisition_fpga->write_local_code();
|
||||
|
||||
//acquisition_fpga->set_doppler_sweep(2);
|
||||
@@ -275,6 +284,8 @@ void pcps_acquisition_fpga::set_active(bool active)
|
||||
//printf("reading results for channel %d\n", (int) d_channel);
|
||||
acquisition_fpga->read_acquisition_results(&indext, &firstpeak, &secondpeak, &initial_sample, &d_input_power, &d_doppler_index, &total_block_exp);
|
||||
|
||||
//printf("returned d_doppler_index = %d\n", d_doppler_index);
|
||||
|
||||
//printf("gnuradio block : d_total_block_exp = %d total_block_exp = %d\n", (int) d_total_block_exp, (int) total_block_exp);
|
||||
|
||||
if (total_block_exp > d_total_block_exp)
|
||||
@@ -358,13 +369,14 @@ void pcps_acquisition_fpga::set_active(bool active)
|
||||
//printf("yes here\n");
|
||||
d_gnss_synchro->Acq_delay_samples = static_cast<double>(d_downsampling_factor*(indext % acq_parameters.samples_per_code));
|
||||
//d_gnss_synchro->Acq_samplestamp_samples = d_downsampling_factor*d_sample_counter - 81*0.25*d_downsampling_factor; // delay due to the downsampling filter in the acquisition
|
||||
d_gnss_synchro->Acq_samplestamp_samples = d_downsampling_factor*d_sample_counter - 81*0.5; // delay due to the downsampling filter in the acquisition
|
||||
d_gnss_synchro->Acq_samplestamp_samples = d_downsampling_factor*d_sample_counter - 33; //41; //+ 81*0.5; // delay due to the downsampling filter in the acquisition
|
||||
//d_gnss_synchro->Acq_samplestamp_samples = d_downsampling_factor*d_sample_counter - 81/d_downsampling_factor; // delay due to the downsampling filter in the acquisition
|
||||
//d_gnss_synchro->Acq_delay_samples = static_cast<double>(2*(indext % acq_parameters.samples_per_code));
|
||||
//d_gnss_synchro->Acq_delay_samples = static_cast<double>(2*(indext));
|
||||
//d_gnss_synchro->Acq_samplestamp_samples = d_sample_counter*2 - 81;
|
||||
//d_gnss_synchro->Acq_delay_samples = static_cast<double>(indext % acq_parameters.samples_per_code);
|
||||
//d_gnss_synchro->Acq_samplestamp_samples = d_sample_counter;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -428,7 +440,8 @@ void pcps_acquisition_fpga::set_active(bool active)
|
||||
|
||||
//printf("acq d_gnss_synchro->Acq_delay_samples = %f\n: ",d_gnss_synchro->Acq_delay_samples);
|
||||
//printf("acq d_gnss_synchro->Acq_samplestamp_samples = %d\n", (unsigned int) d_gnss_synchro->Acq_samplestamp_samples);
|
||||
|
||||
//printf("acq d_gnss_synchro->Acq_doppler_hz = %f\n", d_gnss_synchro->Acq_doppler_hz);
|
||||
//printf("acq d_gnss_synchro->PRN = %d\n", (int) d_gnss_synchro->PRN);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -437,7 +450,7 @@ void pcps_acquisition_fpga::set_active(bool active)
|
||||
send_negative_acquisition();
|
||||
}
|
||||
|
||||
|
||||
//printf("######### acq LEAVING SET ACTIVE\n");
|
||||
//printf("acq set active end\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -255,6 +255,7 @@ void fpga_acquisition::run_acquisition(void)
|
||||
|
||||
// launch the acquisition process
|
||||
//printf("acq lib launchin acquisition ...\n");
|
||||
//printf("acq lib launch acquisition\n");
|
||||
d_map_base[8] = LAUNCH_ACQUISITION; // writing a 1 to reg 8 launches the acquisition process
|
||||
//printf("acq lib waiting for interrupt ...\n");
|
||||
int32_t irq_count;
|
||||
@@ -263,6 +264,7 @@ void fpga_acquisition::run_acquisition(void)
|
||||
uint32_t result_valid = 0;
|
||||
|
||||
usleep(50);
|
||||
//printf("acq lib waiting for result valid\n");
|
||||
while(result_valid == 0)
|
||||
{
|
||||
read_result_valid(&result_valid); // polling
|
||||
@@ -342,6 +344,7 @@ void fpga_acquisition::set_doppler_sweep(uint32_t num_sweeps)
|
||||
float phase_step_rad_int_temp;
|
||||
int32_t phase_step_rad_int;
|
||||
//int32_t doppler = static_cast<int32_t>(-d_doppler_max) + d_doppler_step * doppler_index;
|
||||
//printf("executing with doppler = %d\n", (int) d_doppler_max);
|
||||
int32_t doppler = static_cast<int32_t>(d_doppler_max);
|
||||
//float phase_step_rad = GPS_TWO_PI * (d_freq + doppler) / static_cast<float>(d_fs_in);
|
||||
float phase_step_rad = GPS_TWO_PI * (doppler) / static_cast<float>(d_fs_in);
|
||||
@@ -364,6 +367,7 @@ void fpga_acquisition::set_doppler_sweep(uint32_t num_sweeps)
|
||||
//printf("AAA writing phase_step_rad_int for initial doppler = %d to d map base 3\n", phase_step_rad_int);
|
||||
d_map_base[3] = phase_step_rad_int;
|
||||
|
||||
//printf("executing with doppler step = %d\n", (int) d_doppler_step);
|
||||
// repeat the calculation with the doppler step
|
||||
doppler = static_cast<int32_t>(d_doppler_step);
|
||||
phase_step_rad = GPS_TWO_PI * (doppler) / static_cast<float>(d_fs_in);
|
||||
|
||||
Reference in New Issue
Block a user