mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-11-04 17:23:20 +00:00
solved a bug which caused the tracking pull-in test not to work correctly with Galileo E1 when using the downsampling filter in the acquisition.
This commit is contained in:
@@ -69,8 +69,12 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
|
||||
|
||||
//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);
|
||||
|
||||
|
||||
@@ -121,8 +125,11 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
|
||||
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 nsamples_total (= 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;
|
||||
std::string default_device_name = "/dev/uio0";
|
||||
std::string device_name = configuration_->property(role + ".devicename", default_device_name);
|
||||
|
||||
@@ -438,10 +438,10 @@ void pcps_acquisition_fpga::set_active(bool active)
|
||||
send_positive_acquisition();
|
||||
d_state = 0; // Positive acquisition
|
||||
|
||||
// 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);
|
||||
//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
|
||||
{
|
||||
@@ -477,7 +477,9 @@ void pcps_acquisition_fpga::read_acquisition_results(uint32_t *max_index,
|
||||
float *max_magnitude, float *second_magnitude, uint64_t *initial_sample, uint32_t *doppler_index, uint32_t *total_fft_scaling_factor)
|
||||
{
|
||||
float input_power; // not used
|
||||
acquisition_fpga->read_acquisition_results(max_index, max_magnitude, second_magnitude, initial_sample, &input_power, doppler_index, total_fft_scaling_factor);
|
||||
uint32_t max_index_tmp;
|
||||
uint64_t initial_sample_tmp;
|
||||
acquisition_fpga->read_acquisition_results(&max_index_tmp, max_magnitude, second_magnitude, &initial_sample_tmp, &input_power, doppler_index, total_fft_scaling_factor);
|
||||
|
||||
|
||||
if (d_select_queue_Fpga == 0)
|
||||
@@ -485,9 +487,9 @@ void pcps_acquisition_fpga::read_acquisition_results(uint32_t *max_index,
|
||||
if (d_downsampling_factor > 1)
|
||||
{
|
||||
//printf("yes here\n");
|
||||
*max_index = static_cast<double>(d_downsampling_factor*(*max_index));
|
||||
*max_index = static_cast<double>(d_downsampling_factor*(max_index_tmp));
|
||||
//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
|
||||
*initial_sample = d_downsampling_factor*(*initial_sample) - 44; //33; //41; //+ 81*0.5; // delay due to the downsampling filter in the acquisition
|
||||
*initial_sample = (initial_sample_tmp)*d_downsampling_factor - 44; //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));
|
||||
@@ -505,6 +507,7 @@ void pcps_acquisition_fpga::read_acquisition_results(uint32_t *max_index,
|
||||
//d_gnss_synchro->Acq_samplestamp_samples = d_downsampling_factor*d_sample_counter - 81*0.5*d_downsampling_factor;
|
||||
}
|
||||
}
|
||||
// printf("gnuradioblock acq samplestamp = %d\n", (int) *initial_sample);
|
||||
// else
|
||||
// {
|
||||
// d_gnss_synchro->Acq_delay_samples = static_cast<double>(indext % acq_parameters.samples_per_code);
|
||||
|
||||
@@ -135,6 +135,7 @@ fpga_acquisition::fpga_acquisition(std::string device_name,
|
||||
d_map_base = nullptr; // driver memory map
|
||||
d_all_fft_codes = all_fft_codes;
|
||||
|
||||
//printf("acq internal device name = %s\n", d_device_name.c_str());
|
||||
// open communication with HW accelerator
|
||||
if ((d_fd = open(d_device_name.c_str(), O_RDWR | O_SYNC)) == -1)
|
||||
{
|
||||
@@ -239,7 +240,7 @@ void fpga_acquisition::fpga_configure_acquisition_local_code(lv_16sc_t fft_local
|
||||
//printf("debug local code %d real = %d imag = %d local_code = %d fft_data = %d\n", k, tmp, tmp2, local_code, fft_data);
|
||||
//printf("debug local code %d real = 0x%08X imag = 0x%08X local_code = 0x%08X fft_data = 0x%08X\n", k, tmp, tmp2, local_code, fft_data);
|
||||
}
|
||||
//printf("d_vector_length = %d\n", d_vector_length);
|
||||
//printf("acq d_vector_length = %d\n", d_vector_length);
|
||||
//while(1);
|
||||
}
|
||||
|
||||
@@ -269,6 +270,7 @@ void fpga_acquisition::run_acquisition(void)
|
||||
{
|
||||
read_result_valid(&result_valid); // polling
|
||||
}
|
||||
//printf("result valid\n");
|
||||
// wait for interrupt
|
||||
//nb = read(d_fd, &irq_count, sizeof(irq_count));
|
||||
//usleep(500000); // debug
|
||||
@@ -382,7 +384,7 @@ void fpga_acquisition::set_doppler_sweep(uint32_t num_sweeps)
|
||||
phase_step_rad_int = static_cast<int32_t>(phase_step_rad_int_temp * (POW_2_29)); // * 2^29 (in total it makes x2^31 in two steps to avoid the warnings
|
||||
//printf("AAA writing phase_step_rad_int for doppler step = %d to d map base 4\n", phase_step_rad_int);
|
||||
d_map_base[4] = phase_step_rad_int;
|
||||
//printf("AAA writing num sweeps to d map base 5 = %d\n", num_sweeps);
|
||||
//printf("AAA writing num sweeps to d map base 5 = 1\n");
|
||||
d_map_base[5] = 1; // 1 sweep
|
||||
|
||||
}
|
||||
@@ -442,9 +444,9 @@ void fpga_acquisition::configure_acquisition()
|
||||
//printf("acq lib configure acquisition called\n");
|
||||
//printf("AAA d_select_queue = %d\n", d_select_queue);
|
||||
d_map_base[0] = d_select_queue;
|
||||
//printf("AAA writing d_vector_length = %d to d map base 1\n ", d_vector_length);
|
||||
//printf("acq internal writing d_vector_length = %d to d map base 1\n ", d_vector_length);
|
||||
d_map_base[1] = d_vector_length;
|
||||
//printf("AAA writing d_nsamples = %d to d map base 2\n ", d_nsamples);
|
||||
//printf("acq interal writing d_nsamples = %d to d map base 2\n ", d_nsamples);
|
||||
d_map_base[2] = d_nsamples;
|
||||
//printf("AAA writing LOG2 d_vector_length = %d to d map base 7\n ", (int)log2((float)d_vector_length));
|
||||
d_map_base[7] = static_cast<int32_t>(log2(static_cast<float>(d_vector_length))); // log2 FFTlength
|
||||
|
||||
Reference in New Issue
Block a user