1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-01-12 10:20:32 +00:00

Code cleaning and documentation

git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@151 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
Carles Fernandez 2012-01-31 00:03:08 +00:00
parent 9625070ea9
commit c186828669
9 changed files with 91 additions and 81 deletions

View File

@ -170,11 +170,11 @@ gr_basic_block_sptr Channel::get_right_block()
void Channel::set_signal(Gnss_Signal gnss_signal)
{
gnss_signal_=gnss_signal;
gnss_signal_.get_signal().copy(gnss_synchro_.Signal,2,0);
gnss_synchro_.PRN=gnss_signal_.get_satellite().get_PRN();
gnss_synchro_.System=gnss_signal_.get_satellite().get_system_short().c_str()[0];
acq_->init();
gnss_signal_ = gnss_signal;
gnss_signal_.get_signal().copy(gnss_synchro_.Signal,2,0);
gnss_synchro_.PRN = gnss_signal_.get_satellite().get_PRN();
gnss_synchro_.System = gnss_signal_.get_satellite().get_system_short().c_str()[0];
acq_->init();
nav_->set_satellite(gnss_signal_.get_satellite());
}
@ -240,7 +240,7 @@ void Channel::process_channel_messages()
case 1:
LOG_AT_LEVEL(INFO) << "Channel " << channel_
<< " ACQ SUCCESS satellite " << gnss_synchro_.System << " "<< gnss_synchro_.PRN;
<< " ACQ SUCCESS satellite " << gnss_synchro_.System << " " << gnss_synchro_.PRN;
channel_fsm_.Event_gps_valid_acquisition();
break;

View File

@ -1,5 +1,5 @@
/*!
* \file correlator.h
* \file correlator.cc
* \brief Highly optimized vector correlator class
* \author Javier Arribas, 2011. jarribas(at)cttc.es
*
@ -55,11 +55,11 @@ void Correlator::Carrier_wipeoff_and_EPL_generic(int signal_length_samples,const
//std::cout<<"length="<<signal_length_samples<<std::endl;
*E_out=0;
*P_out=0;
*L_out=0;
*E_out = 0;
*P_out = 0;
*L_out = 0;
// perform Early, Prompt and Late correlation
for(int i=0; i<signal_length_samples; ++i)
for(int i=0; i < signal_length_samples; ++i)
{
//Perform the carrier wipe-off
bb_signal_sample = input[i] * carrier[i];
@ -126,14 +126,14 @@ void Correlator::cpu_arch_test_volk_32fc_x2_dot_prod_32fc_a()
else
{
std::cout << "Detected architectures in this machine for volk_32fc_x2_dot_prod_32fc_a:" << std::endl;
for (unsigned int i=0; i<arch_list.size(); ++i)
for (unsigned int i=0; i < arch_list.size(); ++i)
{
std::cout << "Arch " << i << ":" << arch_list.at(i) << std::endl;
}
// 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);
}
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;
}
@ -165,14 +165,14 @@ void Correlator::cpu_arch_test_volk_32fc_x2_multiply_32fc_a()
for (unsigned int i=0; i < arch_list.size(); ++i)
{
std::cout << "Arch " << i << ":" << arch_list.at(i) << std::endl;
if (arch_list.at(i).find("sse")!=std::string::npos)
if (arch_list.at(i).find("sse") != std::string::npos)
{
// TODO: Make a test to find the best architecture
this->volk_32fc_x2_multiply_32fc_a_best_arch = arch_list.at(i);
}
}
}
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;
}

View File

@ -39,7 +39,11 @@
/*!
* \brief High optimized vector correlator class
* \brief Class that implements carrier wipe-off and correlators.
*
* Implemented versions:
* - Generic: Standard C++ implementation.
* - Volk: uses VOLK (Vector-Optimized Library of Kernels) and uses the processor's SIMD instruction sets. See http://gnuradio.org/redmine/projects/gnuradio/wiki/Volk
*
*/
class Correlator

View File

@ -63,13 +63,11 @@ Gnss_Satellite::~Gnss_Satellite()
void Gnss_Satellite::reset()
{
system_set = {"GPS", "GLONASS", "SBAS", "Galileo", "Compass"};
satelliteSystem["GPS"] = "G";
satelliteSystem["GLONASS"] = "R";
satelliteSystem["SBAS"] = "S";
satelliteSystem["Galileo"] = "E";
satelliteSystem["Compass"] = "C";
PRN = 0;
system = std::string("");
block = std::string("");
@ -188,6 +186,10 @@ void Gnss_Satellite::set_PRN(unsigned int PRN_)
{
PRN = 11;
}
else if (PRN_ == 12)
{
PRN = 12;
}
else
{
DLOG(INFO) << "This PRN is not defined";
@ -228,8 +230,7 @@ std::string Gnss_Satellite::get_system() const
std::string Gnss_Satellite::get_system_short() const
{
// Get the satellite system {"GPS", "GLONASS", "SBAS", "Galileo", "Compass"}
// Get the satellite system {"G", "R", "S", "E", "C"}
return satelliteSystem.at(system);
}
@ -479,6 +480,7 @@ void Gnss_Satellite::set_block(std::string system_, unsigned int PRN_ )
break;
case 120 :
block = std::string("EGNOS"); // EGNOS AOR-E Broadcast satellite http://www.egnos-pro.esa.int/index.html
break;
case 124 :
block = std::string("EGNOS"); // EGNOS ESA ARTEMIS used for EGNOS Operations
break;
@ -497,7 +499,8 @@ void Gnss_Satellite::set_block(std::string system_, unsigned int PRN_ )
block = std::string("IOV"); // PFM, the ProtoFlight Model (GSAT0101), launched from French Guiana at 10:30 GMT on October 21, 2011
break;
case 12 :
block =std::string("IOV"); // Galileo In-Orbit Validation (IOV) satellite FM2 (Flight Model 2) also known as GSAT0102, launched the same day
block = std::string("IOV"); // Galileo In-Orbit Validation (IOV) satellite FM2 (Flight Model 2) also known as GSAT0102, launched the same day
break;
default:
block = std::string("Unknown");
}

View File

@ -36,6 +36,8 @@
#include <set>
#include <iostream>
#include <map>
/*
* \brief This class represents a GNSS satellite.
*
@ -45,15 +47,15 @@
class Gnss_Satellite
{
public:
Gnss_Satellite(); //!< Default Constructor.
Gnss_Satellite(); //!< Default Constructor.
Gnss_Satellite(std::string system_, unsigned int PRN_); //!< Concrete GNSS satellite Constructor.
~Gnss_Satellite(); //!< Default Destructor.
~Gnss_Satellite(); //!< Default Destructor.
unsigned int get_PRN() const; //!< Gets satellite's PRN
std::string get_system() const; //!< Gets the satellite system {"GPS", "GLONASS", "SBAS", "Galileo", "Compass"}
std::string get_system_short() const; //!< Gets the satellite system {"GPS", "GLONASS", "SBAS", "Galileo", "Compass"}
std::string get_system_short() const; //!< Gets the satellite system {"G", "R", "SBAS", "E", "C"}
std::string get_block() const; //!< Gets the satellite block. If GPS, returns {"IIA", "IIR", "IIR-M", "IIF"}
friend bool operator== (const Gnss_Satellite &, const Gnss_Satellite &); // operator== for comparison
friend std::ostream& operator<<(std::ostream &, const Gnss_Satellite &); // operator<< for pretty printing
friend bool operator== (const Gnss_Satellite &, const Gnss_Satellite &); //!< operator== for comparison
friend std::ostream& operator<<(std::ostream &, const Gnss_Satellite &); //!< operator<< for pretty printing
//Gnss_Satellite& operator=(const Gnss_Satellite &);
private:
unsigned int PRN;

View File

@ -32,26 +32,33 @@
Gnss_Signal::Gnss_Signal()
{
this->signal="";
this->signal = "";
}
Gnss_Signal::Gnss_Signal(Gnss_Satellite satellite_,std::string signal_)
{
this->satellite=satellite_;
this->signal=signal_;
this->satellite = satellite_;
this->signal = signal_;
}
Gnss_Signal::~Gnss_Signal()
{
}
{}
std::string Gnss_Signal::get_signal() const
{
return this->signal;
}
Gnss_Satellite Gnss_Signal::get_satellite() const
{
return this->satellite;
}
std::ostream& operator<<(std::ostream &out, const Gnss_Signal &sig) // output
{
//std::string psystem = sat::get_system()
@ -59,6 +66,7 @@ std::ostream& operator<<(std::ostream &out, const Gnss_Signal &sig) // output
return out;
}
bool operator== (const Gnss_Signal &sig1, const Gnss_Signal &sig2)
{
bool equal = false;

View File

@ -41,19 +41,17 @@
*/
class Gnss_Signal
{
private:
Gnss_Satellite satellite;
std::string signal;
Gnss_Satellite satellite;
std::string signal;
public:
Gnss_Signal();
Gnss_Signal(Gnss_Satellite satellite_,std::string signal_);
~Gnss_Signal();
std::string get_signal() const;
Gnss_Satellite get_satellite() const;
Gnss_Signal();
Gnss_Signal(Gnss_Satellite satellite_, std::string signal_);
~Gnss_Signal();
std::string get_signal() const;
Gnss_Satellite get_satellite() const;
friend bool operator== (const Gnss_Signal &, const Gnss_Signal &); // operator== for comparison
friend std::ostream& operator<<(std::ostream &, const Gnss_Signal &); // operator<< for pretty printing
};
#endif

View File

@ -33,37 +33,34 @@
Gnss_Synchro::Gnss_Synchro()
{
// Satellite and signal info
//System=" ";
//Signal=" ";
PRN=0;
// Acquisition
Acq_delay_samples=0.0;
Acq_doppler_hz=0.0;
Acq_samplestamp_samples=0;
Flag_valid_acquisition=false;
//Tracking
Prompt_I=0.0;
Prompt_Q=0.0;
Carrier_phase_rads=0.0;
Code_phase_secs=0.0;
Tracking_timestamp_secs=0.0;
CN0_dB_hz=0.0;
Flag_valid_tracking=false;
//Telemetry Decoder
Preamble_delay_ms=0.0;
Prn_delay_ms=0.0;
Preamble_code_phase_ms=0.0;
Preamble_code_phase_correction_ms=0.0;
Channel_ID=0;
Flag_valid_word=false;
Flag_preamble=false;
// Pseudorange
Pseudorange_m=0.0;
Pseudorange_timestamp_ms=0.0;
Flag_valid_pseudorange=false;
PRN = 0;
// Acquisition
Acq_delay_samples = 0.0;
Acq_doppler_hz = 0.0;
Acq_samplestamp_samples = 0;
Flag_valid_acquisition = false;
//Tracking
Prompt_I = 0.0;
Prompt_Q = 0.0;
Carrier_phase_rads = 0.0;
Code_phase_secs = 0.0;
Tracking_timestamp_secs = 0.0;
CN0_dB_hz = 0.0;
Flag_valid_tracking = false;
//Telemetry Decoder
Preamble_delay_ms = 0.0;
Prn_delay_ms = 0.0;
Preamble_code_phase_ms = 0.0;
Preamble_code_phase_correction_ms = 0.0;
Channel_ID = 0;
Flag_valid_word = false;
Flag_preamble = false;
// Pseudorange
Pseudorange_m = 0.0;
Pseudorange_timestamp_ms = 0.0;
Flag_valid_pseudorange = false;
}
Gnss_Synchro::~Gnss_Synchro()
{
}
{}

View File

@ -1,6 +1,6 @@
/*!
* \file gnss_synchro.h
* \brief Implementation of the Gnss_Synchro class
* \brief Interface of the Gnss_Synchro class
* \author
* Luis Esteve, 2012. luis(at)epsilon-formacion.com
* Javier Arribas, 2012. jarribas(at)cttc.es
@ -33,16 +33,14 @@
#include "gnss_signal.h"
#include <string>
class Gnss_Synchro{
private:
/*!
* \brief This is the class that contains the information that flows through the blocks.
*/
class Gnss_Synchro
{
public:
Gnss_Synchro();
~Gnss_Synchro();
//Gnss_Signal Signal;
// Satellite and signal info
char System;
char Signal[3];
@ -72,7 +70,7 @@ public:
double Pseudorange_m;
double Pseudorange_timestamp_ms;
bool Flag_valid_pseudorange;
};
#endif