1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-11-01 15:53:03 +00:00

adapted the software to a bit size for the local copy of the FFT of the GNSS code to 10 bits per sample.

worked on the observables tests.
This commit is contained in:
Marc Majoral
2018-11-13 19:51:12 +01:00
parent 37c7576e12
commit 7023e879db
8 changed files with 40 additions and 40 deletions

View File

@@ -246,8 +246,8 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
// static_cast<int>(floor(256*fft_codes_padded[i].imag() * (pow(2, 7) - 1) / max)));
// d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(floor(16*fft_codes_padded[i].real() * (pow(2, 11) - 1) / max)),
// static_cast<int>(floor(16*fft_codes_padded[i].imag() * (pow(2, 11) - 1) / max)));
d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(floor(fft_codes_padded[i].real() * (pow(2, 5) - 1) / max)),
static_cast<int>(floor(fft_codes_padded[i].imag() * (pow(2, 5) - 1) / max)));
d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(floor(fft_codes_padded[i].real() * (pow(2, 9) - 1) / max)),
static_cast<int>(floor(fft_codes_padded[i].imag() * (pow(2, 9) - 1) / max)));
// tmp_re = static_cast<int>(floor(fft_codes_padded[i].real() * (pow(2, 7) - 1) / max));
// tmp_im = static_cast<int>(floor(fft_codes_padded[i].imag() * (pow(2, 7) - 1) / max));
@@ -313,7 +313,7 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
delete fft_if;
delete[] fft_codes_padded;
acq_parameters.total_block_exp = 11;
acq_parameters.total_block_exp = 12;
acquisition_fpga_ = pcps_make_acquisition_fpga(acq_parameters);
DLOG(INFO) << "acquisition(" << acquisition_fpga_->unique_id() << ")";

View File

@@ -178,8 +178,8 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf
}
for (unsigned int i = 0; i < nsamples_total; i++) // map the FFT to the dynamic range of the fixed point values an copy to buffer containing all FFTs
{
d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(floor(fft_codes_padded[i].real() * (pow(2, 5) - 1) / max)),
static_cast<int>(floor(fft_codes_padded[i].imag() * (pow(2, 5) - 1) / max)));
d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(floor(fft_codes_padded[i].real() * (pow(2, 9) - 1) / max)),
static_cast<int>(floor(fft_codes_padded[i].imag() * (pow(2, 9) - 1) / max)));
}
}

View File

@@ -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,9 +89,9 @@ 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);
//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);
@@ -165,8 +165,8 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
// static_cast<int>(16*floor(fft_codes_padded[i].imag() * (pow(2, 11) - 1) / max)));
//d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(floor(fft_codes_padded[i].real() * (pow(2, 15) - 1) / max)),
// static_cast<int>(floor(fft_codes_padded[i].imag() * (pow(2, 15) - 1) / max)));
d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(floor(fft_codes_padded[i].real() * (pow(2, 5) - 1) / max)),
static_cast<int>(floor(fft_codes_padded[i].imag() * (pow(2, 5) - 1) / max)));
d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(floor(fft_codes_padded[i].real() * (pow(2, 9) - 1) / max)),
static_cast<int>(floor(fft_codes_padded[i].imag() * (pow(2, 9) - 1) / max)));
}
@@ -191,7 +191,7 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
delete fft_if;
delete[] fft_codes_padded;
acq_parameters.total_block_exp = 9;
acq_parameters.total_block_exp = 10;
acquisition_fpga_ = pcps_make_acquisition_fpga(acq_parameters);
DLOG(INFO) << "acquisition(" << acquisition_fpga_->unique_id() << ")";

View File

@@ -167,8 +167,8 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga(
// static_cast<int>(16*floor(fft_codes_padded[i].imag() * (pow(2, 11) - 1) / max)));
//d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(floor(fft_codes_padded[i].real() * (pow(2, 15) - 1) / max)),
// static_cast<int>(floor(fft_codes_padded[i].imag() * (pow(2, 15) - 1) / max)));
d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(floor(fft_codes_padded[i].real() * (pow(2, 5) - 1) / max)),
static_cast<int>(floor(fft_codes_padded[i].imag() * (pow(2, 5) - 1) / max)));
d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(floor(fft_codes_padded[i].real() * (pow(2, 9) - 1) / max)),
static_cast<int>(floor(fft_codes_padded[i].imag() * (pow(2, 9) - 1) / max)));
}
@@ -211,7 +211,7 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga(
// acquisition_fpga_ = pcps_make_acquisition(acq_parameters);
// DLOG(INFO) << "acquisition(" << acquisition_fpga_->unique_id() << ")";
acq_parameters.total_block_exp = 9;
acq_parameters.total_block_exp = 10;
acquisition_fpga_ = pcps_make_acquisition_fpga(acq_parameters);
DLOG(INFO) << "acquisition(" << acquisition_fpga_->unique_id() << ")";

View File

@@ -65,10 +65,10 @@
//#define SELECT_24_BITS 0x00FFFFFF
//#define SHL_12_BITS 4096
// 16-bits
#define SELECT_LSBits 0x0FFFF
#define SELECT_MSBbits 0xFFFF0000
#define SELECT_32_BITS 0xFFFFFFFF
#define SHL_16_BITS 65536
#define SELECT_LSBits 0x000003FF
#define SELECT_MSBbits 0x000FFC00
#define SELECT_ALL_CODE_BITS 0x000FFFFF
#define SHL_CODE_BITS 1024
bool fpga_acquisition::init()
@@ -231,9 +231,9 @@ void fpga_acquisition::fpga_configure_acquisition_local_code(lv_16sc_t fft_local
//local_code = (tmp & SELECT_LSB) | ((tmp2 * SHL_8_BITS) & SELECT_MSB); // put together the real part and the imaginary part
//fft_data = MEM_LOCAL_CODE_WR_ENABLE | (local_code & SELECT_16_BITS);
//local_code = (tmp & SELECT_LSBits) | ((tmp2 * SHL_12_BITS) & SELECT_MSBbits); // put together the real part and the imaginary part
local_code = (tmp & SELECT_LSBits) | ((tmp2 * SHL_16_BITS) & SELECT_MSBbits); // put together the real part and the imaginary part
local_code = (tmp & SELECT_LSBits) | ((tmp2 * SHL_CODE_BITS) & SELECT_MSBbits); // put together the real part and the imaginary part
//fft_data = MEM_LOCAL_CODE_WR_ENABLE | (local_code & SELECT_24_BITS);
fft_data = local_code & SELECT_32_BITS;
fft_data = local_code & SELECT_ALL_CODE_BITS;
d_map_base[6] = fft_data;