1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-14 20:20:35 +00:00
This commit is contained in:
Carles Fernandez 2019-03-02 11:48:55 +01:00
commit 0072cd02c3
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
4 changed files with 47 additions and 63 deletions

View File

@ -205,12 +205,11 @@ void GNSSFlowgraph::connect()
DLOG(INFO) << "blocks connected internally";
// Signal Source (i) > Signal conditioner (i) >
int RF_Channels = 0;
int signal_conditioner_ID = 0;
#ifndef ENABLE_FPGA
int RF_Channels = 0;
int signal_conditioner_ID = 0;
for (int i = 0; i < sources_count_; i++)
{
try
@ -357,12 +356,13 @@ void GNSSFlowgraph::connect()
#endif
// Signal conditioner (selected_signal_source) >> channels (i) (dependent of their associated SignalSource_ID)
int selected_signal_conditioner_ID = 0;
bool use_acq_resampler = configuration_->property("GNSS-SDR.use_acquisition_resampler", false);
uint32_t fs = configuration_->property("GNSS-SDR.internal_fs_sps", 0);
for (unsigned int i = 0; i < channels_count_; i++)
{
#ifndef ENABLE_FPGA
int selected_signal_conditioner_ID = 0;
bool use_acq_resampler = configuration_->property("GNSS-SDR.use_acquisition_resampler", false);
uint32_t fs = configuration_->property("GNSS-SDR.internal_fs_sps", 0);
if (configuration_->property(sig_source_.at(0)->role() + ".enable_FPGA", false) == false)
{
try
@ -861,9 +861,11 @@ void GNSSFlowgraph::disconnect()
}
#endif
// Signal conditioner (selected_signal_source) >> channels (i) (dependent of their associated SignalSource_ID)
int selected_signal_conditioner_ID;
for (unsigned int i = 0; i < channels_count_; i++)
{
#ifndef ENABLE_FPGA
int selected_signal_conditioner_ID;
try
{
selected_signal_conditioner_ID = configuration_->property("Channel" + std::to_string(i) + ".RF_channel_ID", 0);
@ -874,7 +876,6 @@ void GNSSFlowgraph::disconnect()
top_block_->disconnect_all();
return;
}
#ifndef ENABLE_FPGA
try
{
top_block_->disconnect(sig_conditioner_.at(selected_signal_conditioner_ID)->get_right_block(), 0,

View File

@ -81,13 +81,15 @@ void thread_acquisition_send_rx_samples(gr::top_block_sptr top_block,
buffer_float = (char *)malloc(FLOAT_SIZE); // allocate space for the temporary buffer
if (!buffer_float)
{
fprintf(stderr, "Memory error!");
std::cerr << "Memory error!" << std::endl;
return;
}
rx_signal_file = fopen(file_name, "rb"); // file containing the received signal
if (!rx_signal_file)
{
printf("Unable to open file!");
std::cerr << "Unable to open file!" << std::endl;
return;
}
// determine the length of the file that contains the received signal
@ -96,7 +98,6 @@ void thread_acquisition_send_rx_samples(gr::top_block_sptr top_block,
fseek(rx_signal_file, 0, SEEK_SET);
// first step: check for the maximum value of the received signal
float max = 0;
float *pointer_float;
pointer_float = (float *)&buffer_float[0];
@ -118,23 +119,21 @@ void thread_acquisition_send_rx_samples(gr::top_block_sptr top_block,
fseek(rx_signal_file, 0, SEEK_SET);
// allocate memory for the samples to be transferred to the DMA
buffer_DMA = (signed char *)malloc(DMA_ACQ_TRANSFER_SIZE);
if (!buffer_DMA)
{
fprintf(stderr, "Memory error!");
std::cerr << "Memory error!" << std::endl;
}
// open the DMA descriptor
dma_descr = open("/dev/loop_tx", O_WRONLY);
if (dma_descr < 0)
{
printf("can't open loop device\n");
exit(1);
std::cerr << "Can't open loop device\n";
return;
}
// cycle through the file containing the received samples
for (int k = 0; k < NTIMES_CYCLE_THROUGH_RX_SAMPLES_FILE; k++)
{
fseek(rx_signal_file, 0, SEEK_SET);
@ -176,7 +175,6 @@ void thread_acquisition_send_rx_samples(gr::top_block_sptr top_block,
close(dma_descr);
// when all the samples are sent stop the top block
top_block->stop();
}

View File

@ -424,10 +424,8 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults)
//*************************************************
//***** STEP 2: Prepare the parameters sweep ******
//*************************************************
std::vector<double> generator_CN0_values;
//data containers for config param sweep
std::vector<std::vector<double>> mean_doppler_error_sweep; //swep config param and cn0 sweep
std::vector<std::vector<double>> std_dev_doppler_error_sweep; //swep config param and cn0 sweep
@ -449,16 +447,13 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults)
double acq_doppler_hz = 0.0;
Tracking_True_Obs_Reader true_obs_data;
// CONFIG PARAM SWEEP LOOP
std::vector<double> PLL_wide_bw_values;
std::vector<double> DLL_wide_bw_values;
//***********************************************************
//***** STEP 2: Tracking configuration parameters sweep *****
//***********************************************************
if (FLAGS_PLL_bw_hz_start == FLAGS_PLL_bw_hz_stop)
{
if (FLAGS_DLL_bw_hz_start == FLAGS_DLL_bw_hz_stop)
@ -490,8 +485,6 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults)
//*********************************************
//***** STEP 3: Generate the input signal *****
//*********************************************
std::vector<double> cno_vector;
if (FLAGS_CN0_dBHz_start == FLAGS_CN0_dBHz_stop)
{
@ -587,7 +580,6 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults)
true_obs_data.restart();
}
std::chrono::time_point<std::chrono::system_clock> start, end;
top_block = gr::make_top_block("Tracking test");
@ -625,7 +617,6 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults)
top_block->msg_connect(tracking->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events"));
}) << "Failure connecting the blocks of tracking test.";
//********************************************************************
//***** STEP 5: Perform the signal tracking and read the results *****
//********************************************************************
@ -736,7 +727,6 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults)
trk_Doppler_Hz = trk_Doppler_Hz.subvec(initial_meas_point(0), trk_Doppler_Hz.size() - 1);
trk_prn_delay_chips = trk_prn_delay_chips.subvec(initial_meas_point(0), trk_prn_delay_chips.size() - 1);
double mean_error;
double std_dev_error;
double rmse;
@ -781,7 +771,6 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults)
std::cout << "Tracking output could not be used, possible loss of lock " << ex.what() << std::endl;
}
}
} //CN0 LOOP
if (!FLAGS_enable_external_signal_file)
@ -917,7 +906,6 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults)
g5.set_xlabel("Time [s]");
g5.set_ylabel("Code delay error [Chips]");
for (unsigned int current_cn0_idx = 0; current_cn0_idx < generator_CN0_values_sweep_copy.at(config_idx).size(); current_cn0_idx++)
{
try
@ -952,7 +940,6 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults)
g5b.set_xlabel("Time [s]");
g5b.set_ylabel("Code delay error [meters]");
for (unsigned int current_cn0_idx = 0; current_cn0_idx < generator_CN0_values_sweep_copy.at(config_idx).size(); current_cn0_idx++)
{
try
@ -973,7 +960,6 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults)
g5b.savetops("Code_error_meters");
g5b.savetopdf("Code_error_meters", 18);
Gnuplot g6("points");
if (FLAGS_show_plots)
{
@ -988,7 +974,6 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults)
g6.set_xlabel("Time [s]");
g6.set_ylabel("Accumulated carrier phase error [Cycles]");
for (unsigned int current_cn0_idx = 0; current_cn0_idx < generator_CN0_values_sweep_copy.at(config_idx).size(); current_cn0_idx++)
{
try
@ -1064,7 +1049,6 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults)
if (generator_CN0_values.size() > 1)
{
//plot metrics
Gnuplot g7("linespoints");
if (FLAGS_show_plots)
{
@ -1098,7 +1082,6 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults)
g7.savetops("Doppler_error_metrics");
g7.savetopdf("Doppler_error_metrics", 18);
Gnuplot g8("linespoints");
g8.set_title("Accumulated carrier phase error metrics (PRN #" + std::to_string(FLAGS_test_satellite_PRN) + ")");
g8.set_grid();
@ -1155,6 +1138,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults)
}
}
bool GpsL1CADllPllTrackingTest::save_mat_xy(std::vector<double>& x, std::vector<double>& y, std::string filename)
{
try

View File

@ -79,14 +79,15 @@ void send_tracking_gps_input_samples(FILE *rx_signal_file,
dma_descr = open("/dev/loop_tx", O_WRONLY);
if (dma_descr < 0)
{
printf("can't open loop device\n");
exit(1);
std::cerr << "Can't open loop device\n";
return;
}
buffer_DMA = (char *)malloc(DMA_TRACK_TRANSFER_SIZE);
if (!buffer_DMA)
{
fprintf(stderr, "Memory error!");
std::cerr << "Memory error!" << std::endl;
return;
}
while (num_remaining_samples > 0)
@ -140,7 +141,8 @@ void sending_thread(gr::top_block_sptr top_block, const char *file_name)
rx_signal_file = fopen(file_name, "rb");
if (!rx_signal_file)
{
printf("Unable to open file!");
std::cerr << "Unable to open file!" << std::endl;
return;
}
fseek(rx_signal_file, 0, SEEK_END);
@ -347,7 +349,6 @@ void GpsL1CADllPllTrackingTestFpga::check_results_doppler(arma::vec &true_time_s
// 2. RMSE
arma::vec err;
err = meas_value - true_value_interp;
arma::vec err2 = arma::square(err);
double rmse = sqrt(arma::mean(err2));
@ -356,7 +357,7 @@ void GpsL1CADllPllTrackingTestFpga::check_results_doppler(arma::vec &true_time_s
double error_mean = arma::mean(err);
double error_var = arma::var(err);
// 5. Peaks
// 4. Peaks
double max_error = arma::max(err);
double min_error = arma::min(err);