1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-06-25 22:43:14 +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;

View File

@ -1322,7 +1322,7 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
}
else
{
printf("test operation\n");
//printf("test operation\n");
// during the unit tests the counter value may be reset after the acquisition process. We have to take this into account
absolute_samples_offset = static_cast<uint64_t>(current_synchro_data.Acq_delay_samples + current_synchro_data.Acq_samplestamp_samples);
//printf("333333 absolute_samples_offset = %llu\n", absolute_samples_offset);
@ -1704,7 +1704,7 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
}
if (current_synchro_data.Flag_valid_symbol_output)
{
//printf("tracking sending synchro data\n");
//printf("tracking sending synchro data ");
current_synchro_data.fs = static_cast<int64_t>(trk_parameters.fs_in);
current_synchro_data.Tracking_sample_counter = d_sample_counter + static_cast<uint64_t>(d_current_prn_length_samples);
*out[0] = current_synchro_data;

View File

@ -79,7 +79,7 @@
#define TEST_OBS_MAX_INPUT_COMPLEX_SAMPLES_TOTAL 8192 // maximum DMA sample block size in complex samples
#define TEST_OBS_COMPLEX_SAMPLE_SIZE 2 // sample size in bytes
#define TEST_OBS_NUM_QUEUES 2 // number of queues (1 for GPS L1/Galileo E1, and 1 for GPS L5/Galileo E5)
#define TEST_OBS_NSAMPLES_TRACKING 500000000 // number of samples during which we test the tracking module
#define TEST_OBS_NSAMPLES_TRACKING 1000000000 // number of samples during which we test the tracking module
#define TEST_OBS_NSAMPLES_FINAL 50000 // number of samples sent after running tracking to unblock the SW if it is waiting for an interrupt of the tracking module
#define TEST_OBS_NSAMPLES_ACQ_DOPPLER_SWEEP 50000000 // number of samples sent to the acquisition module when running acquisition when the HW controls the doppler loop
#define DOWNAMPLING_FILTER_INIT_SAMPLES 100 // some samples to initialize the state of the downsampling filter
@ -519,12 +519,12 @@ bool HybridObservablesTestFpga::acquire_signal()
if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking_Fpga") == 0)
{
baseband_sampling_freq_acquisition = baseband_sampling_freq/4; // downsampling filter in L1/E1
printf(" aaaaaa baseband_sampling_freq_acquisition = %d\n", baseband_sampling_freq_acquisition);
//printf(" aaaaaa baseband_sampling_freq_acquisition = %d\n", baseband_sampling_freq_acquisition);
}
else if (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking_Fpga") == 0)
{
baseband_sampling_freq_acquisition = baseband_sampling_freq/4; // downsampling filter in L1/E1
printf(" aaaaaa baseband_sampling_freq_acquisition = %d\n", baseband_sampling_freq_acquisition);
//printf(" aaaaaa baseband_sampling_freq_acquisition = %d\n", baseband_sampling_freq_acquisition);
}
// 1. Setup GNU Radio flowgraph (file_source -> Acquisition_10m)
@ -566,7 +566,7 @@ bool HybridObservablesTestFpga::acquire_signal()
//printf("AAAAAAAAAAAAAAAAAAAAA\n");
if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking_Fpga") == 0)
{
printf("AAAAAAAAAAAAAAAAAAAAA2222\n");
//printf("AAAAAAAAAAAAAAAAAAAAA2222\n");
tmp_gnss_synchro.System = 'G';
std::string signal = "1C";
signal.copy(tmp_gnss_synchro.Signal, 2, 0);
@ -663,7 +663,7 @@ bool HybridObservablesTestFpga::acquire_signal()
throw(std::exception());
}
printf("BBBBBBBBBBBBBBBBBBBBBBBBBB\n");
//printf("BBBBBBBBBBBBBBBBBBBBBBBBBB\n");
//gr::blocks::file_source::sptr file_source;
@ -744,13 +744,13 @@ bool HybridObservablesTestFpga::acquire_signal()
{
code_length = static_cast<unsigned int>(std::round(static_cast<double>(baseband_sampling_freq_acquisition) / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)));
nsamples_to_transfer = static_cast<unsigned int>(std::round(static_cast<double>(baseband_sampling_freq) / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)));
printf("dddddd code_length = %d nsamples_to_transfer = %d\n", code_length, nsamples_to_transfer);
//printf("dddddd code_length = %d nsamples_to_transfer = %d\n", code_length, nsamples_to_transfer);
}
else if (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking_Fpga") == 0)
{
code_length = static_cast<unsigned int>(std::round(static_cast<double>(baseband_sampling_freq_acquisition) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)));
nsamples_to_transfer = static_cast<unsigned int>(std::round(static_cast<double>(baseband_sampling_freq) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)));
printf("dddddd code_length = %d nsamples_to_transfer = %d\n", code_length, nsamples_to_transfer);
//printf("dddddd code_length = %d nsamples_to_transfer = %d\n", code_length, nsamples_to_transfer);
}
else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking_Fpga") == 0)
{
@ -1979,7 +1979,7 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults)
}
}
printf("@@@@@@@@@@@@@@@@@@@@@@@@@@ First part is done\n");
//printf("@@@@@@@@@@@@@@@@@@@@@@@@@@ First part is done\n");
unsigned int code_length;
//unsigned int nsamples_to_transfer;
@ -2158,7 +2158,7 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults)
args.skip_used_samples = 0;
//}
printf("2222222222222 CREATE PROCES\n");
//printf("2222222222222 CREATE PROCES\n");
printf("%s\n", file.c_str());
if (pthread_create(&thread_DMA, NULL, handler_DMA_obs_test, (void *)&args) < 0)
{
@ -2176,7 +2176,7 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults)
pthread_mutex_unlock(&mutex_obs_test);
top_block->start();
printf("33333333333333333333 top block started\n");
//printf("33333333333333333333 top block started\n");
@ -2190,11 +2190,11 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults)
// wait for the child DMA process to finish
pthread_join(thread_DMA, NULL);
printf("444444444444 CHILD PROCESS FINISHED\n");
//printf("444444444444 CHILD PROCESS FINISHED\n");
top_block->stop();
printf("55555555555 TOP BLOCK STOPPED\n");
//printf("55555555555 TOP BLOCK STOPPED\n");
// send more samples to unblock the tracking process in case it was waiting for samples
args.file = file;
@ -2214,7 +2214,7 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults)
printf("ERROR cannot create DMA Process\n");
}
pthread_join(thread_DMA, NULL);
printf("777777777 PROCESS FINISHED \n");
//printf("777777777 PROCESS FINISHED \n");
pthread_mutex_lock(&mutex_obs_test);
send_samples_start_obs_test = 0;

View File

@ -662,7 +662,7 @@ bool TrackingPullInTestFpga::acquire_signal(int SV_ID)
acquisition_GpsE1_Fpga->set_channel(0);
acquisition_GpsE1_Fpga->set_threshold(config->property("Acquisition.threshold", FLAGS_external_signal_acquisition_threshold));
acquisition_GpsE1_Fpga->connect(top_block);
printf(" bbbbbbbb baseband_sampling_freq_acquisition = %d\n", baseband_sampling_freq_acquisition);
//printf(" bbbbbbbb baseband_sampling_freq_acquisition = %d\n", baseband_sampling_freq_acquisition);
}
else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking_Fpga") == 0)
{
@ -730,7 +730,7 @@ bool TrackingPullInTestFpga::acquire_signal(int SV_ID)
else if (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking_Fpga") == 0)
{
top_block->msg_connect(acquisition_GpsE1_Fpga->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events"));
printf(" cccccc baseband_sampling_freq_acquisition = %d\n", baseband_sampling_freq_acquisition);
//printf(" cccccc baseband_sampling_freq_acquisition = %d\n", baseband_sampling_freq_acquisition);
}
else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking_Fpga") == 0)
{
@ -784,7 +784,7 @@ bool TrackingPullInTestFpga::acquire_signal(int SV_ID)
{
code_length = static_cast<unsigned int>(std::round(static_cast<double>(baseband_sampling_freq_acquisition) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)));
nsamples_to_transfer = static_cast<unsigned int>(std::round(static_cast<double>(baseband_sampling_freq) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)));
printf("dddddd code_length = %d nsamples_to_transfer = %d\n", code_length, nsamples_to_transfer);
//printf("dddddd code_length = %d nsamples_to_transfer = %d\n", code_length, nsamples_to_transfer);
}
else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking_Fpga") == 0)
{
@ -809,7 +809,7 @@ bool TrackingPullInTestFpga::acquire_signal(int SV_ID)
else if (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking_Fpga") == 0)
{
acquisition_GpsE1_Fpga->set_single_doppler_flag(1);
printf("eeeeeee just set doppler flag\n");
//printf("eeeeeee just set doppler flag\n");
}
else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking_Fpga") == 0)
{