mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-12-15 12:40:35 +00:00
Add more info in acquisition dumps
This commit is contained in:
parent
47c9ad0160
commit
020603c3b8
@ -60,6 +60,7 @@ pcps_acquisition::pcps_acquisition(const Acq_Conf& conf_) : gr::block("pcps_acqu
|
||||
acq_parameters = conf_;
|
||||
d_sample_counter = 0; // SAMPLE COUNTER
|
||||
d_active = false;
|
||||
d_positive_acq = 0;
|
||||
d_state = 0;
|
||||
d_old_freq = 0;
|
||||
d_well_count = 0;
|
||||
@ -376,6 +377,36 @@ void pcps_acquisition::dump_results(int effective_fft_size)
|
||||
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
|
||||
Mat_VarFree(matvar);
|
||||
|
||||
matvar = Mat_VarCreate("d_positive_acq", MAT_C_INT32, MAT_T_INT32, 1, dims, &d_positive_acq, 0);
|
||||
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
|
||||
Mat_VarFree(matvar);
|
||||
|
||||
float aux = static_cast<float>(d_gnss_synchro->Acq_doppler_hz);
|
||||
matvar = Mat_VarCreate("acq_doppler_hz", MAT_C_SINGLE, MAT_T_SINGLE, 1, dims, &aux, 0);
|
||||
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
|
||||
Mat_VarFree(matvar);
|
||||
|
||||
aux = static_cast<float>(d_gnss_synchro->Acq_delay_samples);
|
||||
matvar = Mat_VarCreate("acq_delay_samples", MAT_C_SINGLE, MAT_T_SINGLE, 1, dims, &aux, 0);
|
||||
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
|
||||
Mat_VarFree(matvar);
|
||||
|
||||
matvar = Mat_VarCreate("test_statistic", MAT_C_SINGLE, MAT_T_SINGLE, 1, dims, &d_test_statistics, 0);
|
||||
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
|
||||
Mat_VarFree(matvar);
|
||||
|
||||
matvar = Mat_VarCreate("threshold", MAT_C_SINGLE, MAT_T_SINGLE, 1, dims, &d_threshold, 0);
|
||||
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
|
||||
Mat_VarFree(matvar);
|
||||
|
||||
matvar = Mat_VarCreate("input_power", MAT_C_SINGLE, MAT_T_SINGLE, 1, dims, &d_input_power, 0);
|
||||
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
|
||||
Mat_VarFree(matvar);
|
||||
|
||||
matvar = Mat_VarCreate("sample_counter", MAT_C_UINT64, MAT_T_UINT64, 1, dims, &d_sample_counter, 0);
|
||||
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
|
||||
Mat_VarFree(matvar);
|
||||
|
||||
Mat_Close(matfp);
|
||||
}
|
||||
}
|
||||
@ -554,11 +585,6 @@ void pcps_acquisition::acquisition_core(unsigned long int samp_count)
|
||||
}
|
||||
}
|
||||
}
|
||||
// Record results to file if required
|
||||
if (acq_parameters.dump)
|
||||
{
|
||||
pcps_acquisition::dump_results(effective_fft_size);
|
||||
}
|
||||
lk.lock();
|
||||
if (!acq_parameters.bit_transition_flag)
|
||||
{
|
||||
@ -572,6 +598,7 @@ void pcps_acquisition::acquisition_core(unsigned long int samp_count)
|
||||
send_positive_acquisition();
|
||||
d_step_two = false;
|
||||
d_state = 0; // Positive acquisition
|
||||
d_positive_acq = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -583,6 +610,7 @@ void pcps_acquisition::acquisition_core(unsigned long int samp_count)
|
||||
{
|
||||
send_positive_acquisition();
|
||||
d_state = 0; // Positive acquisition
|
||||
d_positive_acq = 1;
|
||||
}
|
||||
}
|
||||
else if (d_well_count == acq_parameters.max_dwells)
|
||||
@ -605,6 +633,7 @@ void pcps_acquisition::acquisition_core(unsigned long int samp_count)
|
||||
send_positive_acquisition();
|
||||
d_step_two = false;
|
||||
d_state = 0; // Positive acquisition
|
||||
d_positive_acq = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -616,6 +645,7 @@ void pcps_acquisition::acquisition_core(unsigned long int samp_count)
|
||||
{
|
||||
send_positive_acquisition();
|
||||
d_state = 0; // Positive acquisition
|
||||
d_positive_acq = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -626,6 +656,11 @@ void pcps_acquisition::acquisition_core(unsigned long int samp_count)
|
||||
}
|
||||
}
|
||||
d_worker_active = false;
|
||||
// Record results to file if required
|
||||
if (acq_parameters.dump)
|
||||
{
|
||||
pcps_acquisition::dump_results(effective_fft_size);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -100,6 +100,7 @@ private:
|
||||
bool d_worker_active;
|
||||
bool d_cshort;
|
||||
bool d_step_two;
|
||||
int d_positive_acq;
|
||||
float d_threshold;
|
||||
float d_mag;
|
||||
float d_input_power;
|
||||
|
@ -175,7 +175,7 @@ void GpsL1CaPcpsAcquisitionTest::plot_grid()
|
||||
unsigned int sat = static_cast<unsigned int>(gnss_synchro.PRN);
|
||||
|
||||
unsigned int samples_per_code = static_cast<unsigned int>(round(4000000 / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS))); // !!
|
||||
acquisition_dump_reader acq_dump(basename, sat, doppler_max, doppler_step, samples_per_code);
|
||||
acquisition_dump_reader acq_dump(basename, sat, doppler_max, doppler_step, samples_per_code, 1);
|
||||
|
||||
if (!acq_dump.read_binary_acq()) std::cout << "Error reading files" << std::endl;
|
||||
|
||||
|
@ -73,17 +73,27 @@ bool acquisition_dump_reader::read_binary_acq()
|
||||
Mat_Close(matfile);
|
||||
return false;
|
||||
}
|
||||
matvar_t* var2_ = Mat_VarRead(matfile, "doppler_max");
|
||||
d_doppler_max = *static_cast<unsigned int*>(var2_->data);
|
||||
Mat_VarFree(var2_);
|
||||
|
||||
var2_ = Mat_VarRead(matfile, "doppler_step");
|
||||
d_doppler_step = *static_cast<unsigned int*>(var2_->data);
|
||||
Mat_VarFree(var2_);
|
||||
|
||||
var2_ = Mat_VarRead(matfile, "input_power");
|
||||
float normalization_factor = *static_cast<float*>(var2_->data);
|
||||
Mat_VarFree(var2_);
|
||||
|
||||
std::vector<std::vector<float> >::iterator it1;
|
||||
std::vector<float>::iterator it2;
|
||||
float* aux = static_cast<float*>(var_->data);
|
||||
int k = 0;
|
||||
float normalization_factor = std::pow(d_samples_per_code, 2);
|
||||
for (it1 = mag.begin(); it1 != mag.end(); it1++)
|
||||
{
|
||||
for (it2 = it1->begin(); it2 != it1->end(); it2++)
|
||||
{
|
||||
*it2 = static_cast<float>(std::sqrt(aux[k])) / normalization_factor;
|
||||
*it2 = static_cast<float>(aux[k]) / normalization_factor;
|
||||
k++;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user