1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-16 13:10:35 +00:00

Add float code generation in some signals

This commit is contained in:
Antonio Ramos 2018-03-13 12:38:33 +01:00
parent e4bada8176
commit bdce8b6a66
15 changed files with 654 additions and 415 deletions

View File

@ -71,6 +71,23 @@ void gps_l2c_m_code_gen_complex(std::complex<float>* _dest, unsigned int _prn)
delete[] _code; delete[] _code;
} }
void gps_l2c_m_code_gen_float(float* _dest, unsigned int _prn)
{
int32_t* _code = new int32_t[GPS_L2_M_CODE_LENGTH_CHIPS];
if (_prn > 0 and _prn < 51)
{
gps_l2c_m_code(_code, _prn);
}
for (signed int i = 0; i < GPS_L2_M_CODE_LENGTH_CHIPS; i++)
{
_dest[i] = 1.0 - 2.0 * static_cast<float>(_code[i]);
}
delete[] _code;
}
/* /*
* Generates complex GPS L2C M code for the desired SV ID and sampled to specific sampling frequency * Generates complex GPS L2C M code for the desired SV ID and sampled to specific sampling frequency

View File

@ -38,7 +38,7 @@
//!Generates complex GPS L2C M code for the desired SV ID //!Generates complex GPS L2C M code for the desired SV ID
void gps_l2c_m_code_gen_complex(std::complex<float>* _dest, unsigned int _prn); void gps_l2c_m_code_gen_complex(std::complex<float>* _dest, unsigned int _prn);
void gps_l2c_m_code_gen_float(float* _dest, unsigned int _prn);
//! Generates complex GPS L2C M code for the desired SV ID, and sampled to specific sampling frequency //! Generates complex GPS L2C M code for the desired SV ID, and sampled to specific sampling frequency
void gps_l2c_m_code_gen_complex_sampled(std::complex<float>* _dest, unsigned int _prn, signed int _fs); void gps_l2c_m_code_gen_complex_sampled(std::complex<float>* _dest, unsigned int _prn, signed int _fs);

View File

@ -197,6 +197,22 @@ void gps_l5i_code_gen_complex(std::complex<float>* _dest, unsigned int _prn)
delete[] _code; delete[] _code;
} }
void gps_l5i_code_gen_float(float* _dest, unsigned int _prn)
{
int32_t* _code = new int32_t[GPS_L5i_CODE_LENGTH_CHIPS];
if (_prn > 0 and _prn < 51)
{
make_l5i(_code, _prn - 1);
}
for (signed int i = 0; i < GPS_L5i_CODE_LENGTH_CHIPS; i++)
{
_dest[i] = 1.0 - 2.0 * static_cast<float>(_code[i]);
}
delete[] _code;
}
/* /*
* Generates complex GPS L5i code for the desired SV ID and sampled to specific sampling frequency * Generates complex GPS L5i code for the desired SV ID and sampled to specific sampling frequency
@ -264,7 +280,22 @@ void gps_l5q_code_gen_complex(std::complex<float>* _dest, unsigned int _prn)
delete[] _code; delete[] _code;
} }
void gps_l5q_code_gen_float(float* _dest, unsigned int _prn)
{
int32_t* _code = new int32_t[GPS_L5q_CODE_LENGTH_CHIPS];
if (_prn > 0 and _prn < 51)
{
make_l5q(_code, _prn - 1);
}
for (signed int i = 0; i < GPS_L5q_CODE_LENGTH_CHIPS; i++)
{
_dest[i] = 1.0 - 2.0 * static_cast<float>(_code[i]);
}
delete[] _code;
}
/* /*
* Generates complex GPS L5i code for the desired SV ID and sampled to specific sampling frequency * Generates complex GPS L5i code for the desired SV ID and sampled to specific sampling frequency
*/ */

View File

@ -38,9 +38,11 @@
//!Generates complex GPS L5i M code for the desired SV ID //!Generates complex GPS L5i M code for the desired SV ID
void gps_l5i_code_gen_complex(std::complex<float>* _dest, unsigned int _prn); void gps_l5i_code_gen_complex(std::complex<float>* _dest, unsigned int _prn);
void gps_l5i_code_gen_float(float* _dest, unsigned int _prn);
//!Generates complex GPS L5q M code for the desired SV ID //!Generates complex GPS L5q M code for the desired SV ID
void gps_l5q_code_gen_complex(std::complex<float>* _dest, unsigned int _prn); void gps_l5q_code_gen_complex(std::complex<float>* _dest, unsigned int _prn);
void gps_l5q_code_gen_float(float* _dest, unsigned int _prn);
//! Generates complex GPS L5i M code for the desired SV ID, and sampled to specific sampling frequency //! Generates complex GPS L5i M code for the desired SV ID, and sampled to specific sampling frequency
void gps_l5i_code_gen_complex_sampled(std::complex<float>* _dest, unsigned int _prn, signed int _fs); void gps_l5i_code_gen_complex_sampled(std::complex<float>* _dest, unsigned int _prn, signed int _fs);

View File

@ -70,9 +70,9 @@ gps_l5_telemetry_decoder_cc::gps_l5_telemetry_decoder_cc(
d_TOW_at_Preamble = 0.0; d_TOW_at_Preamble = 0.0;
//initialize the CNAV frame decoder (libswiftcnav) //initialize the CNAV frame decoder (libswiftcnav)
cnav_msg_decoder_init(&d_cnav_decoder); cnav_msg_decoder_init(&d_cnav_decoder);
for (int aux = 0; aux < GPS_L5_NH_CODE_LENGTH; aux++) for (int aux = 0; aux < GPS_L5i_NH_CODE_LENGTH; aux++)
{ {
if (GPS_L5_NH_CODE[aux] == 0) if (GPS_L5i_NH_CODE[aux] == 0)
{ {
bits_NH[aux] = -1.0; bits_NH[aux] = -1.0;
} }
@ -119,9 +119,9 @@ int gps_l5_telemetry_decoder_cc::general_work(int noutput_items __attribute__((u
int symbol_value = 0; int symbol_value = 0;
//Search correlation with Neuman-Hofman Code (see IS-GPS-705D) //Search correlation with Neuman-Hofman Code (see IS-GPS-705D)
if (sym_hist.size() == GPS_L5_NH_CODE_LENGTH) if (sym_hist.size() == GPS_L5i_NH_CODE_LENGTH)
{ {
for (int i = 0; i < GPS_L5_NH_CODE_LENGTH; i++) for (int i = 0; i < GPS_L5i_NH_CODE_LENGTH; i++)
{ {
if ((bits_NH[i] * sym_hist.at(i)) > 0.0) if ((bits_NH[i] * sym_hist.at(i)) > 0.0)
{ {
@ -132,7 +132,7 @@ int gps_l5_telemetry_decoder_cc::general_work(int noutput_items __attribute__((u
corr_NH -= 1; corr_NH -= 1;
} }
} }
if (abs(corr_NH) == GPS_L5_NH_CODE_LENGTH) if (abs(corr_NH) == GPS_L5i_NH_CODE_LENGTH)
{ {
sync_NH = true; sync_NH = true;
if (corr_NH > 0) if (corr_NH > 0)

View File

@ -42,8 +42,7 @@
#include <utility> #include <utility>
#include <vector> #include <vector>
extern "C" extern "C" {
{
#include "cnav_msg.h" #include "cnav_msg.h"
#include "edc.h" #include "edc.h"
#include "bits.h" #include "bits.h"
@ -91,7 +90,7 @@ private:
bool d_flag_valid_word; bool d_flag_valid_word;
Gps_CNAV_Navigation_Message d_CNAV_Message; Gps_CNAV_Navigation_Message d_CNAV_Message;
double bits_NH[GPS_L5_NH_CODE_LENGTH]; double bits_NH[GPS_L5i_NH_CODE_LENGTH];
std::deque<double> sym_hist; std::deque<double> sym_hist;
bool sync_NH; bool sync_NH;
bool new_sym; bool new_sym;

View File

@ -51,7 +51,6 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking(
//################# CONFIGURATION PARAMETERS ######################## //################# CONFIGURATION PARAMETERS ########################
int fs_in; int fs_in;
int vector_length; int vector_length;
int f_if;
bool dump; bool dump;
std::string dump_filename; std::string dump_filename;
std::string item_type; std::string item_type;
@ -64,11 +63,10 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking(
float very_early_late_space_chips; float very_early_late_space_chips;
float early_late_space_narrow_chips; float early_late_space_narrow_chips;
float very_early_late_space_narrow_chips; float very_early_late_space_narrow_chips;
unified_ = configuration->property(role + ".unified", true);
item_type = configuration->property(role + ".item_type", default_item_type); item_type = configuration->property(role + ".item_type", default_item_type);
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
f_if = configuration->property(role + ".if", 0);
dump = configuration->property(role + ".dump", false); dump = configuration->property(role + ".dump", false);
pll_bw_hz = configuration->property(role + ".pll_bw_hz", 5.0); pll_bw_hz = configuration->property(role + ".pll_bw_hz", 5.0);
if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast<float>(FLAGS_pll_bw_hz); if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast<float>(FLAGS_pll_bw_hz);
@ -93,23 +91,45 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking(
//################# MAKE TRACKING GNURadio object ################### //################# MAKE TRACKING GNURadio object ###################
if (item_type.compare("gr_complex") == 0) if (item_type.compare("gr_complex") == 0)
{ {
item_size_ = sizeof(gr_complex); if (unified_)
tracking_ = galileo_e1_dll_pll_veml_make_tracking_cc( {
f_if, char sig_[3] = "1B";
fs_in, item_size_ = sizeof(gr_complex);
vector_length, tracking_unified_ = dll_pll_veml_make_tracking(
dump, fs_in,
dump_filename, vector_length,
pll_bw_hz, dump,
dll_bw_hz, dump_filename,
pll_bw_narrow_hz, pll_bw_hz,
dll_bw_narrow_hz, dll_bw_hz,
early_late_space_chips, pll_bw_narrow_hz,
very_early_late_space_chips, dll_bw_narrow_hz,
early_late_space_narrow_chips, early_late_space_chips,
very_early_late_space_narrow_chips, very_early_late_space_chips,
extend_correlation_symbols, early_late_space_narrow_chips,
track_pilot); very_early_late_space_narrow_chips,
extend_correlation_symbols,
track_pilot, 'E', sig_);
}
else
{
tracking_ = galileo_e1_dll_pll_veml_make_tracking_cc(
0,
fs_in,
vector_length,
dump,
dump_filename,
pll_bw_hz,
dll_bw_hz,
pll_bw_narrow_hz,
dll_bw_narrow_hz,
early_late_space_chips,
very_early_late_space_chips,
early_late_space_narrow_chips,
very_early_late_space_narrow_chips,
extend_correlation_symbols,
track_pilot);
}
} }
else else
{ {
@ -130,7 +150,10 @@ GalileoE1DllPllVemlTracking::~GalileoE1DllPllVemlTracking()
void GalileoE1DllPllVemlTracking::start_tracking() void GalileoE1DllPllVemlTracking::start_tracking()
{ {
tracking_->start_tracking(); if (unified_)
tracking_unified_->start_tracking();
else
tracking_->start_tracking();
} }
@ -140,13 +163,19 @@ void GalileoE1DllPllVemlTracking::start_tracking()
void GalileoE1DllPllVemlTracking::set_channel(unsigned int channel) void GalileoE1DllPllVemlTracking::set_channel(unsigned int channel)
{ {
channel_ = channel; channel_ = channel;
tracking_->set_channel(channel); if (unified_)
tracking_unified_->set_channel(channel);
else
tracking_->set_channel(channel);
} }
void GalileoE1DllPllVemlTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) void GalileoE1DllPllVemlTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{ {
tracking_->set_gnss_synchro(p_gnss_synchro); if (unified_)
tracking_unified_->set_gnss_synchro(p_gnss_synchro);
else
tracking_->set_gnss_synchro(p_gnss_synchro);
} }
@ -170,11 +199,17 @@ void GalileoE1DllPllVemlTracking::disconnect(gr::top_block_sptr top_block)
gr::basic_block_sptr GalileoE1DllPllVemlTracking::get_left_block() gr::basic_block_sptr GalileoE1DllPllVemlTracking::get_left_block()
{ {
return tracking_; if (unified_)
return tracking_unified_;
else
return tracking_;
} }
gr::basic_block_sptr GalileoE1DllPllVemlTracking::get_right_block() gr::basic_block_sptr GalileoE1DllPllVemlTracking::get_right_block()
{ {
return tracking_; if (unified_)
return tracking_unified_;
else
return tracking_;
} }

View File

@ -39,6 +39,7 @@
#include "tracking_interface.h" #include "tracking_interface.h"
#include "galileo_e1_dll_pll_veml_tracking_cc.h" #include "galileo_e1_dll_pll_veml_tracking_cc.h"
#include "dll_pll_veml_tracking.h"
#include <string> #include <string>
@ -95,11 +96,13 @@ public:
private: private:
galileo_e1_dll_pll_veml_tracking_cc_sptr tracking_; galileo_e1_dll_pll_veml_tracking_cc_sptr tracking_;
dll_pll_veml_tracking_sptr tracking_unified_;
size_t item_size_; size_t item_size_;
unsigned int channel_; unsigned int channel_;
std::string role_; std::string role_;
unsigned int in_streams_; unsigned int in_streams_;
unsigned int out_streams_; unsigned int out_streams_;
bool unified_;
}; };
#endif // GNSS_SDR_GALILEO_E1_DLL_PLL_VEML_TRACKING_H_ #endif // GNSS_SDR_GALILEO_E1_DLL_PLL_VEML_TRACKING_H_

View File

@ -52,7 +52,6 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking(
//################# CONFIGURATION PARAMETERS ######################## //################# CONFIGURATION PARAMETERS ########################
int fs_in; int fs_in;
int vector_length; int vector_length;
int f_if;
bool dump; bool dump;
std::string dump_filename; std::string dump_filename;
std::string item_type; std::string item_type;
@ -63,8 +62,8 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking(
item_type = configuration->property(role + ".item_type", default_item_type); item_type = configuration->property(role + ".item_type", default_item_type);
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
f_if = configuration->property(role + ".if", 0);
dump = configuration->property(role + ".dump", false); dump = configuration->property(role + ".dump", false);
unified_ = configuration->property(role + ".unified", true);
pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0); pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0);
if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast<float>(FLAGS_pll_bw_hz); if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast<float>(FLAGS_pll_bw_hz);
dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0);
@ -73,20 +72,44 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking(
std::string default_dump_filename = "./track_ch"; std::string default_dump_filename = "./track_ch";
dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); //unused! dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); //unused!
vector_length = std::round(fs_in / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); vector_length = std::round(fs_in / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS));
int symbols_extended_correlator = configuration->property(role + ".extend_correlation_symbols", 1);
if (symbols_extended_correlator < 1) symbols_extended_correlator = 1;
//################# MAKE TRACKING GNURadio object ################### //################# MAKE TRACKING GNURadio object ###################
if (item_type.compare("gr_complex") == 0) if (item_type.compare("gr_complex") == 0)
{ {
item_size_ = sizeof(gr_complex); if (unified_)
tracking_ = gps_l1_ca_dll_pll_make_tracking_cc( {
f_if, char sig_[3] = "1C";
fs_in, item_size_ = sizeof(gr_complex);
vector_length, tracking_unified_ = dll_pll_veml_make_tracking(
dump, fs_in,
dump_filename, vector_length,
pll_bw_hz, dump,
dll_bw_hz, dump_filename,
early_late_space_chips); pll_bw_hz,
dll_bw_hz,
pll_bw_hz,
dll_bw_hz,
early_late_space_chips,
early_late_space_chips,
early_late_space_chips,
early_late_space_chips,
symbols_extended_correlator,
false,
'G', sig_);
}
else
{
tracking_ = gps_l1_ca_dll_pll_make_tracking_cc(
0,
fs_in,
vector_length,
dump,
dump_filename,
pll_bw_hz,
dll_bw_hz,
early_late_space_chips);
}
} }
else else
{ {
@ -105,7 +128,10 @@ GpsL1CaDllPllTracking::~GpsL1CaDllPllTracking()
void GpsL1CaDllPllTracking::start_tracking() void GpsL1CaDllPllTracking::start_tracking()
{ {
tracking_->start_tracking(); if (unified_)
tracking_unified_->start_tracking();
else
tracking_->start_tracking();
} }
@ -115,13 +141,19 @@ void GpsL1CaDllPllTracking::start_tracking()
void GpsL1CaDllPllTracking::set_channel(unsigned int channel) void GpsL1CaDllPllTracking::set_channel(unsigned int channel)
{ {
channel_ = channel; channel_ = channel;
tracking_->set_channel(channel); if (unified_)
tracking_unified_->set_channel(channel);
else
tracking_->set_channel(channel);
} }
void GpsL1CaDllPllTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) void GpsL1CaDllPllTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{ {
tracking_->set_gnss_synchro(p_gnss_synchro); if (unified_)
tracking_unified_->set_gnss_synchro(p_gnss_synchro);
else
tracking_->set_gnss_synchro(p_gnss_synchro);
} }
@ -145,11 +177,17 @@ void GpsL1CaDllPllTracking::disconnect(gr::top_block_sptr top_block)
gr::basic_block_sptr GpsL1CaDllPllTracking::get_left_block() gr::basic_block_sptr GpsL1CaDllPllTracking::get_left_block()
{ {
return tracking_; if (unified_)
return tracking_unified_;
else
return tracking_;
} }
gr::basic_block_sptr GpsL1CaDllPllTracking::get_right_block() gr::basic_block_sptr GpsL1CaDllPllTracking::get_right_block()
{ {
return tracking_; if (unified_)
return tracking_unified_;
else
return tracking_;
} }

View File

@ -40,6 +40,7 @@
#include "tracking_interface.h" #include "tracking_interface.h"
#include "gps_l1_ca_dll_pll_tracking_cc.h" #include "gps_l1_ca_dll_pll_tracking_cc.h"
#include "dll_pll_veml_tracking.h"
#include <string> #include <string>
class ConfigurationInterface; class ConfigurationInterface;
@ -93,11 +94,13 @@ public:
private: private:
gps_l1_ca_dll_pll_tracking_cc_sptr tracking_; gps_l1_ca_dll_pll_tracking_cc_sptr tracking_;
dll_pll_veml_tracking_sptr tracking_unified_;
size_t item_size_; size_t item_size_;
unsigned int channel_; unsigned int channel_;
std::string role_; std::string role_;
unsigned int in_streams_; unsigned int in_streams_;
unsigned int out_streams_; unsigned int out_streams_;
bool unified_;
}; };
#endif // GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_H_ #endif // GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_H_

View File

@ -37,13 +37,14 @@
#define DLL_PLL_MAXIMUM_LOCK_FAIL_COUNTER 50 #define DLL_PLL_MAXIMUM_LOCK_FAIL_COUNTER 50
#define DLL_PLL_CARRIER_LOCK_THRESHOLD 0.85 #define DLL_PLL_CARRIER_LOCK_THRESHOLD 0.85
#include <fstream>
#include <string>
#include <gnuradio/block.h>
#include "gnss_synchro.h" #include "gnss_synchro.h"
#include "tracking_2nd_DLL_filter.h" #include "tracking_2nd_DLL_filter.h"
#include "tracking_2nd_PLL_filter.h" #include "tracking_2nd_PLL_filter.h"
#include "cpu_multicorrelator_real_codes.h" #include "cpu_multicorrelator_real_codes.h"
#include <fstream>
#include <string>
#include <gnuradio/block.h>
class dll_pll_veml_tracking; class dll_pll_veml_tracking;
@ -57,7 +58,7 @@ dll_pll_veml_tracking_sptr dll_pll_veml_make_tracking(double fs_in, unsigned int
float early_late_space_narrow_chips, float early_late_space_narrow_chips,
float very_early_late_space_narrow_chips, float very_early_late_space_narrow_chips,
int extend_correlation_symbols, bool track_pilot, int extend_correlation_symbols, bool track_pilot,
char system, char signal[3], bool veml); char system, char signal[3]);
/*! /*!
* \brief This class implements a code DLL + carrier PLL VEML (Very Early * \brief This class implements a code DLL + carrier PLL VEML (Very Early
@ -91,7 +92,7 @@ private:
float very_early_late_space_chips, float early_late_space_narrow_chips, float very_early_late_space_chips, float early_late_space_narrow_chips,
float very_early_late_space_narrow_chips, float very_early_late_space_narrow_chips,
int extend_correlation_symbols, bool track_pilot, int extend_correlation_symbols, bool track_pilot,
char system, char signal[3], bool veml); char system, char signal[3]);
dll_pll_veml_tracking(double fs_in, unsigned int vector_length, dll_pll_veml_tracking(double fs_in, unsigned int vector_length,
bool dump, bool dump,
@ -106,62 +107,63 @@ private:
float very_early_late_space_narrow_chips, float very_early_late_space_narrow_chips,
int extend_correlation_symbols, int extend_correlation_symbols,
bool track_pilot, bool track_pilot,
char system, char signal[3], bool veml); char system, char signal[3]);
bool cn0_and_tracking_lock_status(); bool cn0_and_tracking_lock_status();
bool acquire_secondary();
void do_correlation_step(const gr_complex *input_samples); void do_correlation_step(const gr_complex *input_samples);
void run_dll_pll(bool disable_costas_loop); void run_dll_pll(bool disable_costas_loop);
void update_local_code(); void update_tracking_vars();
void update_local_carrier();
bool acquire_secondary();
void clear_tracking_vars(); void clear_tracking_vars();
void save_correlation_results();
void log_data(); void log_data();
int save_matfile();
// tracking configuration vars // tracking configuration vars
bool d_dump; bool d_dump;
bool d_veml; bool d_veml;
bool d_secondary;
unsigned int d_secondary_code_length;
std::string *d_secondary_code_string;
Gnss_Synchro *d_acquisition_gnss_synchro;
unsigned int d_vector_length; unsigned int d_vector_length;
unsigned int d_channel; unsigned int d_channel;
// long d_fs_in;
double d_fs_in; double d_fs_in;
Gnss_Synchro *d_acquisition_gnss_synchro;
//Signal parameters //Signal parameters
bool d_secondary;
bool interchange_iq;
double d_signal_carrier_freq; double d_signal_carrier_freq;
double d_code_period; double d_code_period;
double d_code_chip_rate; double d_code_chip_rate;
unsigned int d_secondary_code_length;
unsigned int d_code_length_chips; unsigned int d_code_length_chips;
unsigned int d_code_samples_per_chip; // All signals have 1 sample per chip code except Gal. E1 which has 2 (CBOC disabled) or 12 (CBOC enabled)
int d_symbols_per_bit;
std::string systemName;
std::string signal_type;
std::string *d_secondary_code_string;
//tracking state machine //tracking state machine
int d_state; int d_state;
//Integration period in samples //Integration period in samples
int d_correlation_length_samples;
int d_correlation_length_ms; int d_correlation_length_ms;
int d_n_correlator_taps; int d_n_correlator_taps;
double d_early_late_spc_chips; float d_early_late_spc_chips;
double d_very_early_late_spc_chips; float d_very_early_late_spc_chips;
double d_early_late_spc_narrow_chips; float d_early_late_spc_narrow_chips;
double d_very_early_late_spc_narrow_chips; float d_very_early_late_spc_narrow_chips;
float *d_tracking_code; float *d_tracking_code;
float *d_data_code; float *d_data_code;
float *d_local_code_shift_chips; float *d_local_code_shift_chips;
float *d_null_shift; float *d_prompt_data_shift;
gr_complex *d_correlator_outs;
cpu_multicorrelator_real_codes multicorrelator_cpu; cpu_multicorrelator_real_codes multicorrelator_cpu;
//TODO: currently the multicorrelator does not support adding extra correlator
//with different local code, thus we need extra multicorrelator instance.
//Implement this functionality inside multicorrelator class
//as an enhancement to increase the performance
cpu_multicorrelator_real_codes correlator_data_cpu; //for data channel cpu_multicorrelator_real_codes correlator_data_cpu; //for data channel
/* TODO: currently the multicorrelator does not support adding extra correlator
with different local code, thus we need extra multicorrelator instance.
Implement this functionality inside multicorrelator class
as an enhancement to increase the performance
*/
gr_complex *d_correlator_outs;
gr_complex *d_Very_Early; gr_complex *d_Very_Early;
gr_complex *d_Early; gr_complex *d_Early;
gr_complex *d_Prompt; gr_complex *d_Prompt;
@ -178,6 +180,7 @@ private:
gr_complex d_P_accu; gr_complex d_P_accu;
gr_complex d_L_accu; gr_complex d_L_accu;
gr_complex d_VL_accu; gr_complex d_VL_accu;
gr_complex d_last_prompt;
bool d_track_pilot; bool d_track_pilot;
gr_complex *d_Prompt_Data; gr_complex *d_Prompt_Data;
@ -206,39 +209,34 @@ private:
double d_carr_error_filt_hz; double d_carr_error_filt_hz;
double d_code_error_chips; double d_code_error_chips;
double d_code_error_filt_chips; double d_code_error_filt_chips;
double d_K_blk_samples; double d_K_blk_samples;
double d_code_freq_chips; double d_code_freq_chips;
double d_carrier_doppler_hz; double d_carrier_doppler_hz;
double d_acc_carrier_phase_rad; double d_acc_carrier_phase_rad;
double d_rem_code_phase_chips; double d_rem_code_phase_chips;
double d_code_phase_samples; double d_code_phase_samples;
double T_chip_seconds;
double T_prn_seconds;
double T_prn_samples;
double K_blk_samples;
//PRN period in samples //PRN period in samples
int d_current_prn_length_samples; int d_current_prn_length_samples;
//processing samples counters //processing samples counters
unsigned long int d_sample_counter; unsigned long int d_sample_counter;
unsigned long int d_acq_sample_stamp; unsigned long int d_acq_sample_stamp;
// CN0 estimation and lock detector // CN0 estimation and lock detector
int d_cn0_estimation_counter; int d_cn0_estimation_counter;
std::deque<gr_complex> d_Prompt_buffer_deque; int d_carrier_lock_fail_counter;
gr_complex *d_Prompt_buffer;
double d_carrier_lock_test; double d_carrier_lock_test;
double d_CN0_SNV_dB_Hz; double d_CN0_SNV_dB_Hz;
double d_carrier_lock_threshold; double d_carrier_lock_threshold;
int d_carrier_lock_fail_counter; std::deque<gr_complex> d_Prompt_buffer_deque;
gr_complex *d_Prompt_buffer;
// file dump // file dump
std::string d_dump_filename; std::string d_dump_filename;
std::ofstream d_dump_file; std::ofstream d_dump_file;
std::string systemName;
std::string signal_type;
int save_matfile();
}; };
#endif //GNSS_SDR_DLL_PLL_VEML_TRACKING_H #endif //GNSS_SDR_DLL_PLL_VEML_TRACKING_H

View File

@ -122,7 +122,7 @@ bool cpu_multicorrelator_real_codes::Carrier_wipeoff_multicorrelator_resampler(
lv_32fc_t phase_offset_as_complex[1]; lv_32fc_t phase_offset_as_complex[1];
phase_offset_as_complex[0] = lv_cmake(std::cos(rem_carrier_phase_in_rad), -std::sin(rem_carrier_phase_in_rad)); phase_offset_as_complex[0] = lv_cmake(std::cos(rem_carrier_phase_in_rad), -std::sin(rem_carrier_phase_in_rad));
// call VOLK_GNSSSDR kernel // call VOLK_GNSSSDR kernel
volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn(d_corr_out, d_sig_in, std::exp(lv_32fc_t(0.0, -phase_step_rad)), phase_offset_as_complex, (const float**)d_local_codes_resampled, d_n_correlators, signal_length_samples); volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn(d_corr_out, d_sig_in, std::exp(lv_32fc_t(0.0, -phase_step_rad)), phase_offset_as_complex, const_cast<const float**>(d_local_codes_resampled), d_n_correlators, signal_length_samples);
return true; return true;
} }

View File

@ -36,6 +36,7 @@
#include "GPS_CNAV.h" #include "GPS_CNAV.h"
#include "MATH_CONSTANTS.h" #include "MATH_CONSTANTS.h"
#include <cstdint> #include <cstdint>
#include <string>
// Physical constants // Physical constants
@ -181,7 +182,11 @@ const int GPS_L5_SYMBOLS_PER_BIT = 2;
const int GPS_L5_SAMPLES_PER_SYMBOL = 10; const int GPS_L5_SAMPLES_PER_SYMBOL = 10;
const int GPS_L5_CNAV_DATA_PAGE_SYMBOLS = 600; const int GPS_L5_CNAV_DATA_PAGE_SYMBOLS = 600;
const int GPS_L5_CNAV_DATA_PAGE_DURATION_S = 6; const int GPS_L5_CNAV_DATA_PAGE_DURATION_S = 6;
const int GPS_L5_NH_CODE_LENGTH = 10; const int GPS_L5i_NH_CODE_LENGTH = 10;
const int GPS_L5_NH_CODE[10] = {0, 0, 0, 0, 1, 1, 0, 1, 0, 1}; const int GPS_L5i_NH_CODE[10] = {0, 0, 0, 0, 1, 1, 0, 1, 0, 1};
const std::string GPS_L5i_NH_CODE_STR = "0000110101";
const int GPS_L5q_NH_CODE_LENGTH = 20;
const int GPS_L5q_NH_CODE[20] = {0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0};
const std::string GPS_L5q_NH_CODE_STR = "00000100110101001110";
#endif /* GNSS_SDR_GPS_L5_H_ */ #endif /* GNSS_SDR_GPS_L5_H_ */

View File

@ -50,7 +50,7 @@ public:
double Acq_delay_samples; //!< Set by Acquisition processing block double Acq_delay_samples; //!< Set by Acquisition processing block
double Acq_doppler_hz; //!< Set by Acquisition processing block double Acq_doppler_hz; //!< Set by Acquisition processing block
unsigned long int Acq_samplestamp_samples; //!< Set by Acquisition processing block unsigned long int Acq_samplestamp_samples; //!< Set by Acquisition processing block
bool Flag_valid_acquisition; //!< Set by Acquisition processing block bool Flag_valid_acquisition = false; //!< Set by Acquisition processing block
//Tracking //Tracking
long int fs; //!< Set by Tracking processing block long int fs; //!< Set by Tracking processing block
double Prompt_I; //!< Set by Tracking processing block double Prompt_I; //!< Set by Tracking processing block
@ -61,17 +61,17 @@ public:
double Code_phase_samples; //!< Set by Tracking processing block double Code_phase_samples; //!< Set by Tracking processing block
unsigned long int Tracking_sample_counter; //!< Set by Tracking processing block unsigned long int Tracking_sample_counter; //!< Set by Tracking processing block
bool Flag_valid_symbol_output; //!< Set by Tracking processing block bool Flag_valid_symbol_output = false; //!< Set by Tracking processing block
int correlation_length_ms; //!< Set by Tracking processing block int correlation_length_ms; //!< Set by Tracking processing block
//Telemetry Decoder //Telemetry Decoder
bool Flag_valid_word; //!< Set by Telemetry Decoder processing block bool Flag_valid_word = false; //!< Set by Telemetry Decoder processing block
double TOW_at_current_symbol_s; //!< Set by Telemetry Decoder processing block double TOW_at_current_symbol_s; //!< Set by Telemetry Decoder processing block
// Observables // Observables
double Pseudorange_m; //!< Set by Observables processing block double Pseudorange_m; //!< Set by Observables processing block
double RX_time; //!< Set by Observables processing block double RX_time; //!< Set by Observables processing block
bool Flag_valid_pseudorange; //!< Set by Observables processing block bool Flag_valid_pseudorange = false; //!< Set by Observables processing block
}; };
#endif #endif