Merge Gabriel's glonass-sdr branch

This commit is contained in:
Carles Fernandez 2017-08-23 22:35:22 +02:00 committed by Damian Miralles
parent fa8cb9dd5c
commit ed021f043f
6 changed files with 44 additions and 45 deletions

View File

@ -266,9 +266,9 @@ float GlonassL1CaPcpsAcquisition::calculate_threshold(float pfa)
unsigned int ncells = vector_length_ * frequency_bins;
double exponent = 1 / static_cast<double>(ncells);
double val = pow(1.0 - pfa, exponent);
double lambda = double(vector_length_);
double lambda = static_cast<double>(vector_length_);
boost::math::exponential_distribution<double> mydist (lambda);
float threshold = (float)quantile(mydist,val);
float threshold = static_cast<float>(quantile(mydist,val));
return threshold;
}

View File

@ -29,7 +29,7 @@ public:
virtual ~GlonassL1CaPcpsAcquisition();
std::string role()
inline std::string role() override
{
return role_;
}
@ -37,66 +37,67 @@ public:
/*!
* \brief Returns "GLONASS_L1_CA_PCPS_Acquisition"
*/
std::string implementation()
inline std::string implementation() override
{
return "GLONASS_L1_CA_PCPS_Acquisition";
}
size_t item_size()
inline size_t item_size() override
{
return item_size_;
}
void connect(gr::top_block_sptr top_block);
void disconnect(gr::top_block_sptr top_block);
gr::basic_block_sptr get_left_block();
gr::basic_block_sptr get_right_block();
void connect(gr::top_block_sptr top_block) override;
void disconnect(gr::top_block_sptr top_block) override;
gr::basic_block_sptr get_left_block() override;
gr::basic_block_sptr get_right_block() override;
/*!
* \brief Set acquisition/tracking common Gnss_Synchro object pointer
* to efficiently exchange synchronization data between acquisition and
* tracking blocks
*/
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
/*!
* \brief Set acquisition channel unique ID
*/
void set_channel(unsigned int channel);
void set_channel(unsigned int channel) override;
/*!
* \brief Set statistics threshold of PCPS algorithm
*/
void set_threshold(float threshold);
void set_threshold(float threshold) override;
/*!
* \brief Set maximum Doppler off grid search
*/
void set_doppler_max(unsigned int doppler_max);
void set_doppler_max(unsigned int doppler_max) override;
/*!
* \brief Set Doppler steps for the grid search
*/
void set_doppler_step(unsigned int doppler_step);
void set_doppler_step(unsigned int doppler_step) override;
/*!
* \brief Initializes acquisition algorithm.
*/
void init();
void init() override;
/*!
* \brief Sets local code for GPS L1/CA PCPS acquisition algorithm.
*/
void set_local_code();
void set_local_code() override;
/*!
* \brief Returns the maximum peak of grid search
*/
signed int mag();
signed int mag() override;
/*!
* \brief Restart acquisition algorithm
*/
void reset();
void reset() override;
/*!
* \brief If state = 1, it forces the block to start acquiring from the first sample

View File

@ -15,7 +15,6 @@ class ConfigurationInterface;
class GlonassL1CaDllPllCAidTracking : public TrackingInterface
{
public:
GlonassL1CaDllPllCAidTracking(ConfigurationInterface* configuration,
std::string role,
unsigned int in_streams,
@ -23,40 +22,39 @@ public:
virtual ~GlonassL1CaDllPllCAidTracking();
std::string role()
inline std::string role() override
{
return role_;
}
//! Returns "GLONASS_L1_CA_DLL_PLL_C_Aid_Tracking"
std::string implementation()
inline std::string implementation() override
{
return "GLONASS_L1_CA_DLL_PLL_C_Aid_Tracking";
}
size_t item_size()
inline size_t item_size() override
{
return item_size_;
}
void connect(gr::top_block_sptr top_block);
void disconnect(gr::top_block_sptr top_block);
gr::basic_block_sptr get_left_block();
gr::basic_block_sptr get_right_block();
void connect(gr::top_block_sptr top_block) override;
void disconnect(gr::top_block_sptr top_block) override;
gr::basic_block_sptr get_left_block() override;
gr::basic_block_sptr get_right_block() override;
/*!
* \brief Set tracking channel unique ID
*/
void set_channel(unsigned int channel);
void set_channel(unsigned int channel) override;
/*!
* \brief Set acquisition/tracking common Gnss_Synchro object pointer
* to efficiently exchange synchronization data between acquisition and tracking blocks
*/
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
void start_tracking();
void start_tracking() override;
private:
glonass_l1_ca_dll_pll_c_aid_tracking_cc_sptr tracking_cc;

View File

@ -59,39 +59,39 @@ public:
virtual ~GlonassL1CaDllPllTracking();
std::string role()
inline std::string role() override
{
return role_;
}
//! Returns "GLONASS_L1_CA_DLL_PLL_Tracking"
std::string implementation()
inline std::string implementation() override
{
return "GLONASS_L1_CA_DLL_PLL_Tracking";
}
size_t item_size()
inline size_t item_size() override
{
return item_size_;
}
void connect(gr::top_block_sptr top_block);
void disconnect(gr::top_block_sptr top_block);
gr::basic_block_sptr get_left_block();
gr::basic_block_sptr get_right_block();
void connect(gr::top_block_sptr top_block) override;
void disconnect(gr::top_block_sptr top_block) override;
gr::basic_block_sptr get_left_block() override;
gr::basic_block_sptr get_right_block() override;
/*!
* \brief Set tracking channel unique ID
*/
void set_channel(unsigned int channel);
void set_channel(unsigned int channel) override;
/*!
* \brief Set acquisition/tracking common Gnss_Synchro object pointer
* to efficiently exchange synchronization data between acquisition and tracking blocks
*/
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
void start_tracking();
void start_tracking() override;
private:
glonass_l1_ca_dll_pll_tracking_cc_sptr tracking_;

View File

@ -286,8 +286,8 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __a
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
{
// Block input data and block output stream pointers
const gr_complex* in = (gr_complex*) input_items[0]; //PRN start block alignment
Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0];
const gr_complex* in = reinterpret_cast<const gr_complex*>(input_items[0]); //PRN start block alignment
Gnss_Synchro **out = reinterpret_cast<Gnss_Synchro **>(&output_items[0]);
// GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder
Gnss_Synchro current_synchro_data = Gnss_Synchro();

View File

@ -270,8 +270,8 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribu
double code_error_filt_chips = 0.0;
// Block input data and block output stream pointers
const gr_complex* in = (gr_complex*) input_items[0]; //PRN start block alignment
Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0];
const gr_complex* in = reinterpret_cast<const gr_complex*>(input_items[0]); // PRN start block alignment
Gnss_Synchro **out = reinterpret_cast<Gnss_Synchro **>(&output_items[0]);
// GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder
Gnss_Synchro current_synchro_data = Gnss_Synchro();