mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-11-04 17:16:26 +00:00
- Improved speed for samples inconsistency check in tracking modules, and
- Added a total elapsed run time counter in main: now it is possible to compare the post-processing time with the signal duration. The elapsed time is reported in STD::COUT when GNSS-SDR finish the main thread. git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@156 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
parent
0046d9169c
commit
0a62725445
@ -369,18 +369,6 @@ int Gps_L1_Ca_Dll_Fll_Pll_Tracking_cc::general_work (int noutput_items, gr_vecto
|
|||||||
const gr_complex* in = (gr_complex*) input_items[0]; //block input samples pointer
|
const gr_complex* in = (gr_complex*) input_items[0]; //block input samples pointer
|
||||||
Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0]; //block output streams pointer
|
Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0]; //block output streams pointer
|
||||||
|
|
||||||
// check for samples consistency (this should be done before in the receiver / here only if the source is a file)
|
|
||||||
for(int i=0; i<d_current_prn_length_samples; i++)
|
|
||||||
{
|
|
||||||
if (std::isnan(in[i].real()) == true or std::isnan(in[i].imag()) == true)// or std::isinf(in[i].real())==true or std::isinf(in[i].imag())==true)
|
|
||||||
{
|
|
||||||
const int samples_available = ninput_items[0];
|
|
||||||
d_sample_counter = d_sample_counter + samples_available;
|
|
||||||
LOG_AT_LEVEL(WARNING) << "Detected NaN samples at sample number " << d_sample_counter;
|
|
||||||
consume_each(samples_available);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Update the prn length based on code freq (variable) and
|
// Update the prn length based on code freq (variable) and
|
||||||
// sampling frequency (fixed)
|
// sampling frequency (fixed)
|
||||||
// variable code PRN sample block size
|
// variable code PRN sample block size
|
||||||
@ -400,6 +388,28 @@ int Gps_L1_Ca_Dll_Fll_Pll_Tracking_cc::general_work (int noutput_items, gr_vecto
|
|||||||
d_Prompt,
|
d_Prompt,
|
||||||
d_Late);
|
d_Late);
|
||||||
|
|
||||||
|
// check for samples consistency (this should be done before in the receiver / here only if the source is a file)
|
||||||
|
if (std::isnan((*d_Prompt).real()) == true or std::isnan((*d_Prompt).imag()) == true )// or std::isinf(in[i].real())==true or std::isinf(in[i].imag())==true)
|
||||||
|
{
|
||||||
|
const int samples_available = ninput_items[0];
|
||||||
|
d_sample_counter = d_sample_counter + samples_available;
|
||||||
|
LOG_AT_LEVEL(WARNING) << "Detected NaN samples at sample number " << d_sample_counter;
|
||||||
|
consume_each(samples_available);
|
||||||
|
|
||||||
|
// make an output to not stop the rest of the processing blocks
|
||||||
|
current_synchro_data.Prompt_I=0.0;
|
||||||
|
current_synchro_data.Prompt_Q=0.0;
|
||||||
|
current_synchro_data.Tracking_timestamp_secs=d_sample_counter_seconds;
|
||||||
|
current_synchro_data.Carrier_phase_rads=0.0;
|
||||||
|
current_synchro_data.Code_phase_secs=0.0;
|
||||||
|
current_synchro_data.CN0_dB_hz=0.0;
|
||||||
|
current_synchro_data.Flag_valid_tracking=false;
|
||||||
|
|
||||||
|
*out[0] =current_synchro_data;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* DLL, FLL, and PLL discriminators
|
* DLL, FLL, and PLL discriminators
|
||||||
*/
|
*/
|
||||||
|
@ -394,18 +394,6 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items, gr_vector_in
|
|||||||
const gr_complex* in = (gr_complex*) input_items[0]; //PRN start block alignement
|
const gr_complex* in = (gr_complex*) input_items[0]; //PRN start block alignement
|
||||||
Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0];
|
Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0];
|
||||||
|
|
||||||
// check for samples consistency
|
|
||||||
for(int i=0; i<d_current_prn_length_samples; i++)
|
|
||||||
{
|
|
||||||
if (std::isnan(in[i].real()) == true or std::isnan(in[i].imag()) == true)// or std::isinf(in[i].real())==true or std::isinf(in[i].imag())==true)
|
|
||||||
{
|
|
||||||
const int samples_available = ninput_items[0];
|
|
||||||
d_sample_counter = d_sample_counter + samples_available;
|
|
||||||
LOG_AT_LEVEL(WARNING) << "Detected NaN samples at sample number " << d_sample_counter << std::endl;
|
|
||||||
consume_each(samples_available);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Update the prn length based on code freq (variable) and
|
// Update the prn length based on code freq (variable) and
|
||||||
// sampling frequency (fixed)
|
// sampling frequency (fixed)
|
||||||
// variable code PRN sample block size
|
// variable code PRN sample block size
|
||||||
@ -425,6 +413,28 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items, gr_vector_in
|
|||||||
d_Prompt,
|
d_Prompt,
|
||||||
d_Late);
|
d_Late);
|
||||||
|
|
||||||
|
// check for samples consistency (this should be done before in the receiver / here only if the source is a file)
|
||||||
|
if (std::isnan((*d_Prompt).real()) == true or std::isnan((*d_Prompt).imag()) == true )// or std::isinf(in[i].real())==true or std::isinf(in[i].imag())==true)
|
||||||
|
{
|
||||||
|
const int samples_available = ninput_items[0];
|
||||||
|
d_sample_counter = d_sample_counter + samples_available;
|
||||||
|
LOG_AT_LEVEL(WARNING) << "Detected NaN samples at sample number " << d_sample_counter;
|
||||||
|
consume_each(samples_available);
|
||||||
|
|
||||||
|
// make an output to not stop the rest of the processing blocks
|
||||||
|
current_synchro_data.Prompt_I=0.0;
|
||||||
|
current_synchro_data.Prompt_Q=0.0;
|
||||||
|
current_synchro_data.Tracking_timestamp_secs=d_sample_counter_seconds;
|
||||||
|
current_synchro_data.Carrier_phase_rads=0.0;
|
||||||
|
current_synchro_data.Code_phase_secs=0.0;
|
||||||
|
current_synchro_data.CN0_dB_hz=0.0;
|
||||||
|
current_synchro_data.Flag_valid_tracking=false;
|
||||||
|
|
||||||
|
*out[0] =current_synchro_data;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
// Compute PLL error and update carrier NCO -
|
// Compute PLL error and update carrier NCO -
|
||||||
carr_error = pll_cloop_two_quadrant_atan(*d_Prompt) / (float)TWO_PI;
|
carr_error = pll_cloop_two_quadrant_atan(*d_Prompt) / (float)TWO_PI;
|
||||||
// Implement carrier loop filter and generate NCO command
|
// Implement carrier loop filter and generate NCO command
|
||||||
|
@ -101,9 +101,6 @@ void Correlator::Carrier_wipeoff_and_EPL_volk(int signal_length_samples,const gr
|
|||||||
//free(carrier_aligned);
|
//free(carrier_aligned);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Correlator::cpu_arch_test_volk_32fc_x2_dot_prod_32fc_a()
|
void Correlator::cpu_arch_test_volk_32fc_x2_dot_prod_32fc_a()
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@ -133,14 +130,11 @@ void Correlator::cpu_arch_test_volk_32fc_x2_dot_prod_32fc_a()
|
|||||||
// TODO: Make a test to find the best architecture
|
// TODO: Make a test to find the best architecture
|
||||||
this->volk_32fc_x2_dot_prod_32fc_a_best_arch = arch_list.at(arch_list.size() - 1);
|
this->volk_32fc_x2_dot_prod_32fc_a_best_arch = arch_list.at(arch_list.size() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << "Selected architecture for volk_32fc_x2_dot_prod_32fc_a is " << this->volk_32fc_x2_dot_prod_32fc_a_best_arch << std::endl;
|
std::cout << "Selected architecture for volk_32fc_x2_dot_prod_32fc_a is " << this->volk_32fc_x2_dot_prod_32fc_a_best_arch << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Correlator::cpu_arch_test_volk_32fc_x2_multiply_32fc_a()
|
void Correlator::cpu_arch_test_volk_32fc_x2_multiply_32fc_a()
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@ -172,21 +166,16 @@ void Correlator::cpu_arch_test_volk_32fc_x2_multiply_32fc_a()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << "Selected architecture for volk_32fc_x2_multiply_32fc_a_best_arch is " << this->volk_32fc_x2_multiply_32fc_a_best_arch << std::endl;
|
std::cout << "Selected architecture for volk_32fc_x2_multiply_32fc_a_best_arch is " << this->volk_32fc_x2_multiply_32fc_a_best_arch << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Correlator::Correlator ()
|
Correlator::Correlator ()
|
||||||
{
|
{
|
||||||
cpu_arch_test_volk_32fc_x2_dot_prod_32fc_a();
|
cpu_arch_test_volk_32fc_x2_dot_prod_32fc_a();
|
||||||
cpu_arch_test_volk_32fc_x2_multiply_32fc_a();
|
cpu_arch_test_volk_32fc_x2_multiply_32fc_a();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Correlator::~Correlator ()
|
Correlator::~Correlator ()
|
||||||
{}
|
{}
|
||||||
|
@ -42,6 +42,8 @@
|
|||||||
#include <boost/thread/thread.hpp>
|
#include <boost/thread/thread.hpp>
|
||||||
#include "concurrent_queue.h"
|
#include "concurrent_queue.h"
|
||||||
#include "gps_navigation_message.h"
|
#include "gps_navigation_message.h"
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
using google::LogMessage;
|
using google::LogMessage;
|
||||||
|
|
||||||
@ -97,8 +99,18 @@ int main(int argc, char** argv)
|
|||||||
|
|
||||||
ControlThread *control_thread = new ControlThread();
|
ControlThread *control_thread = new ControlThread();
|
||||||
|
|
||||||
|
// record startup time
|
||||||
|
struct timeval tv;
|
||||||
|
gettimeofday(&tv, NULL);
|
||||||
|
long long int begin = tv.tv_sec * 1000000 + tv.tv_usec;
|
||||||
|
|
||||||
control_thread->run();
|
control_thread->run();
|
||||||
|
|
||||||
|
// report the elapsed time
|
||||||
|
gettimeofday(&tv, NULL);
|
||||||
|
long long int end = tv.tv_sec * 1000000 + tv.tv_usec;
|
||||||
|
std::cout << "Total GNSS-SDR run time " << ((double)(end - begin))/1000000.0<< " [seconds]"<< std::endl;
|
||||||
|
|
||||||
delete control_thread;
|
delete control_thread;
|
||||||
|
|
||||||
google::ShutDownCommandLineFlags();
|
google::ShutDownCommandLineFlags();
|
||||||
|
Loading…
Reference in New Issue
Block a user