1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-09-09 14:26:04 +00:00

Remove tabs from the source code

This commit is contained in:
Carles Fernandez
2016-05-02 23:46:30 +02:00
parent fbfc4a28ba
commit 831cc75153
141 changed files with 2154 additions and 2164 deletions

View File

@@ -207,7 +207,7 @@ void galileo_e1_pvt_cc::print_receiver_status(Gnss_Synchro** channels_synchroniz
int galileo_e1_pvt_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), int galileo_e1_pvt_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)),
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items __attribute__((unused))) gr_vector_const_void_star &input_items, gr_vector_void_star &output_items __attribute__((unused)))
{ {
d_sample_counter++; d_sample_counter++;

View File

@@ -29,7 +29,7 @@
*/ */
#ifndef GNSS_SDR_GALILEO_E1_PVT_CC_H #ifndef GNSS_SDR_GALILEO_E1_PVT_CC_H
#define GNSS_SDR_GALILEO_E1_PVT_CC_H #define GNSS_SDR_GALILEO_E1_PVT_CC_H
#include <fstream> #include <fstream>
#include <string> #include <string>

View File

@@ -255,7 +255,7 @@ void gps_l1_ca_pvt_cc::print_receiver_status(Gnss_Synchro** channels_synchroniza
int gps_l1_ca_pvt_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), int gps_l1_ca_pvt_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)),
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items __attribute__((unused))) gr_vector_const_void_star &input_items, gr_vector_void_star &output_items __attribute__((unused)))
{ {
gnss_pseudoranges_map.clear(); gnss_pseudoranges_map.clear();
d_sample_counter++; d_sample_counter++;

View File

@@ -28,7 +28,7 @@
*/ */
#ifndef GNSS_SDR_GPS_L1_CA_PVT_CC_H #ifndef GNSS_SDR_GPS_L1_CA_PVT_CC_H
#define GNSS_SDR_GPS_L1_CA_PVT_CC_H #define GNSS_SDR_GPS_L1_CA_PVT_CC_H
#include <fstream> #include <fstream>
#include <string> #include <string>

View File

@@ -235,7 +235,7 @@ void hybrid_pvt_cc::print_receiver_status(Gnss_Synchro** channels_synchronizatio
int hybrid_pvt_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), int hybrid_pvt_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)),
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items __attribute__((unused))) gr_vector_const_void_star &input_items, gr_vector_void_star &output_items __attribute__((unused)))
{ {
d_sample_counter++; d_sample_counter++;
bool arrived_galileo_almanac = false; bool arrived_galileo_almanac = false;

View File

@@ -29,7 +29,7 @@
*/ */
#ifndef GNSS_SDR_HYBRID_PVT_CC_H #ifndef GNSS_SDR_HYBRID_PVT_CC_H
#define GNSS_SDR_HYBRID_PVT_CC_H #define GNSS_SDR_HYBRID_PVT_CC_H
#include <fstream> #include <fstream>
#include <utility> #include <utility>

View File

@@ -96,17 +96,17 @@ bool Kml_Printer::set_headers(std::string filename, bool time_tag_name)
kml_file << std::setprecision(14); kml_file << std::setprecision(14);
kml_file << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl kml_file << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl
<< "<kml xmlns=\"http://www.opengis.net/kml/2.2\">" << std::endl << "<kml xmlns=\"http://www.opengis.net/kml/2.2\">" << std::endl
<< " <Document>" << std::endl << " <Document>" << std::endl
<< " <name>GNSS Track</name>" << std::endl << " <name>GNSS Track</name>" << std::endl
<< " <description>GNSS-SDR Receiver position log file created at " << asctime (timeinfo) << " <description>GNSS-SDR Receiver position log file created at " << asctime (timeinfo)
<< " </description>" << std::endl << " </description>" << std::endl
<< "<Style id=\"yellowLineGreenPoly\">" << std::endl << "<Style id=\"yellowLineGreenPoly\">" << std::endl
<< " <LineStyle>" << std::endl << " <LineStyle>" << std::endl
<< " <color>7f00ffff</color>" << std::endl << " <color>7f00ffff</color>" << std::endl
<< " <width>1</width>" << std::endl << " <width>1</width>" << std::endl
<< " </LineStyle>" << std::endl << " </LineStyle>" << std::endl
<< "<PolyStyle>" << std::endl << "<PolyStyle>" << std::endl
<< " <color>7f00ff00</color>" << std::endl << " <color>7f00ff00</color>" << std::endl
<< "</PolyStyle>" << std::endl << "</PolyStyle>" << std::endl
<< "</Style>" << std::endl << "</Style>" << std::endl
<< "<Placemark>" << std::endl << "<Placemark>" << std::endl

View File

@@ -34,7 +34,7 @@
*/ */
#ifndef GNSS_SDR_NMEA_PRINTER_H_ #ifndef GNSS_SDR_NMEA_PRINTER_H_
#define GNSS_SDR_NMEA_PRINTER_H_ #define GNSS_SDR_NMEA_PRINTER_H_
#include <iostream> #include <iostream>

View File

@@ -1312,8 +1312,8 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int,Gps_Ephe
std::map<int,Gps_Ephemeris>::const_iterator gps_ephemeris_iter; std::map<int,Gps_Ephemeris>::const_iterator gps_ephemeris_iter;
for(gps_ephemeris_iter = eph_map.begin(); for(gps_ephemeris_iter = eph_map.begin();
gps_ephemeris_iter != eph_map.end(); gps_ephemeris_iter != eph_map.end();
gps_ephemeris_iter++) gps_ephemeris_iter++)
{ {
// -------- SV / EPOCH / SV CLK // -------- SV / EPOCH / SV CLK
boost::posix_time::ptime p_utc_time = Rinex_Printer::compute_GPS_time(gps_ephemeris_iter->second, gps_ephemeris_iter->second.d_Toc); boost::posix_time::ptime p_utc_time = Rinex_Printer::compute_GPS_time(gps_ephemeris_iter->second, gps_ephemeris_iter->second.d_Toc);
@@ -2815,7 +2815,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c
// Add extra 0 if seconds are < 10 // Add extra 0 if seconds are < 10
if (seconds < 10) if (seconds < 10)
{ {
line +=std::string(1, '0'); line += std::string(1, '0');
} }
line += Rinex_Printer::asString(seconds, 7); line += Rinex_Printer::asString(seconds, 7);
line += std::string(2, ' '); line += std::string(2, ' ');

View File

@@ -49,7 +49,7 @@
*/ */
#ifndef GNSS_SDR_RINEX_PRINTER_H_ #ifndef GNSS_SDR_RINEX_PRINTER_H_
#define GNSS_SDR_RINEX_PRINTER_H_ #define GNSS_SDR_RINEX_PRINTER_H_
#include <string> #include <string>
#include <fstream> #include <fstream>

View File

@@ -117,8 +117,7 @@ GalileoE1Pcps8msAmbiguousAcquisition::~GalileoE1Pcps8msAmbiguousAcquisition()
} }
void void GalileoE1Pcps8msAmbiguousAcquisition::set_channel(unsigned int channel)
GalileoE1Pcps8msAmbiguousAcquisition::set_channel(unsigned int channel)
{ {
channel_ = channel; channel_ = channel;
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
@@ -128,34 +127,31 @@ GalileoE1Pcps8msAmbiguousAcquisition::set_channel(unsigned int channel)
} }
void void GalileoE1Pcps8msAmbiguousAcquisition::set_threshold(float threshold)
GalileoE1Pcps8msAmbiguousAcquisition::set_threshold(float threshold)
{ {
float pfa = configuration_->property(role_+ boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0);
float pfa = configuration_->property(role_+ boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0); if(pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0);
if(pfa==0.0) pfa = configuration_->property(role_+".pfa", 0.0); if(pfa == 0.0)
if(pfa==0.0)
{ {
threshold_ = threshold; threshold_ = threshold;
} }
else else
{ {
threshold_ = calculate_threshold(pfa); threshold_ = calculate_threshold(pfa);
} }
DLOG(INFO) <<"Channel "<<channel_<<" Threshold = " << threshold_; DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_;
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
acquisition_cc_->set_threshold(threshold_); acquisition_cc_->set_threshold(threshold_);
} }
} }
void void GalileoE1Pcps8msAmbiguousAcquisition::set_doppler_max(unsigned int doppler_max)
GalileoE1Pcps8msAmbiguousAcquisition::set_doppler_max(unsigned int doppler_max)
{ {
doppler_max_ = doppler_max; doppler_max_ = doppler_max;
@@ -166,8 +162,7 @@ GalileoE1Pcps8msAmbiguousAcquisition::set_doppler_max(unsigned int doppler_max)
} }
void void GalileoE1Pcps8msAmbiguousAcquisition::set_doppler_step(unsigned int doppler_step)
GalileoE1Pcps8msAmbiguousAcquisition::set_doppler_step(unsigned int doppler_step)
{ {
doppler_step_ = doppler_step; doppler_step_ = doppler_step;
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
@@ -177,8 +172,7 @@ GalileoE1Pcps8msAmbiguousAcquisition::set_doppler_step(unsigned int doppler_step
} }
void void GalileoE1Pcps8msAmbiguousAcquisition::set_gnss_synchro(
GalileoE1Pcps8msAmbiguousAcquisition::set_gnss_synchro(
Gnss_Synchro* gnss_synchro) Gnss_Synchro* gnss_synchro)
{ {
gnss_synchro_ = gnss_synchro; gnss_synchro_ = gnss_synchro;
@@ -189,8 +183,7 @@ GalileoE1Pcps8msAmbiguousAcquisition::set_gnss_synchro(
} }
signed int signed int GalileoE1Pcps8msAmbiguousAcquisition::mag()
GalileoE1Pcps8msAmbiguousAcquisition::mag()
{ {
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
@@ -203,16 +196,14 @@ GalileoE1Pcps8msAmbiguousAcquisition::mag()
} }
void void GalileoE1Pcps8msAmbiguousAcquisition::init()
GalileoE1Pcps8msAmbiguousAcquisition::init()
{ {
acquisition_cc_->init(); acquisition_cc_->init();
set_local_code(); set_local_code();
} }
void void GalileoE1Pcps8msAmbiguousAcquisition::set_local_code()
GalileoE1Pcps8msAmbiguousAcquisition::set_local_code()
{ {
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
@@ -238,8 +229,7 @@ GalileoE1Pcps8msAmbiguousAcquisition::set_local_code()
} }
void void GalileoE1Pcps8msAmbiguousAcquisition::reset()
GalileoE1Pcps8msAmbiguousAcquisition::reset()
{ {
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
@@ -268,8 +258,7 @@ float GalileoE1Pcps8msAmbiguousAcquisition::calculate_threshold(float pfa)
} }
void void GalileoE1Pcps8msAmbiguousAcquisition::connect(gr::top_block_sptr top_block)
GalileoE1Pcps8msAmbiguousAcquisition::connect(gr::top_block_sptr top_block)
{ {
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
@@ -278,8 +267,7 @@ GalileoE1Pcps8msAmbiguousAcquisition::connect(gr::top_block_sptr top_block)
} }
void void GalileoE1Pcps8msAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block)
GalileoE1Pcps8msAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block)
{ {
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {

View File

@@ -51,8 +51,7 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition
DLOG(INFO) << "role " << role; DLOG(INFO) << "role " << role;
item_type_ = configuration_->property(role + ".item_type", item_type_ = configuration_->property(role + ".item_type", default_item_type);
default_item_type);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
if_ = configuration_->property(role + ".ifreq", 0); if_ = configuration_->property(role + ".ifreq", 0);
@@ -119,8 +118,7 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::~GalileoE1PcpsCccwsrAmbiguousAcquisitio
} }
void void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_channel(unsigned int channel)
GalileoE1PcpsCccwsrAmbiguousAcquisition::set_channel(unsigned int channel)
{ {
channel_ = channel; channel_ = channel;
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
@@ -130,36 +128,33 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::set_channel(unsigned int channel)
} }
void void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_threshold(float threshold)
GalileoE1PcpsCccwsrAmbiguousAcquisition::set_threshold(float threshold)
{ {
// float pfa = configuration_->property(role_+ boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0);
// float pfa = configuration_->property(role_+ boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0); // if(pfa==0.0) pfa = configuration_->property(role_+".pfa", 0.0);
// if(pfa==0.0) pfa = configuration_->property(role_+".pfa", 0.0); // if(pfa==0.0)
// {
// if(pfa==0.0) // threshold_ = threshold;
// { // }
// threshold_ = threshold; // else
// } // {
// else // threshold_ = calculate_threshold(pfa);
// { // }
// threshold_ = calculate_threshold(pfa);
// }
threshold_ = threshold; threshold_ = threshold;
DLOG(INFO) <<"Channel "<<channel_<<" Threshold = " << threshold_; DLOG(INFO) <<"Channel "<<channel_<<" Threshold = " << threshold_;
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
acquisition_cc_->set_threshold(threshold_); acquisition_cc_->set_threshold(threshold_);
} }
} }
void void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_doppler_max(unsigned int doppler_max)
GalileoE1PcpsCccwsrAmbiguousAcquisition::set_doppler_max(unsigned int doppler_max)
{ {
doppler_max_ = doppler_max; doppler_max_ = doppler_max;
@@ -170,8 +165,7 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::set_doppler_max(unsigned int doppler_ma
} }
void void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_doppler_step(unsigned int doppler_step)
GalileoE1PcpsCccwsrAmbiguousAcquisition::set_doppler_step(unsigned int doppler_step)
{ {
doppler_step_ = doppler_step; doppler_step_ = doppler_step;
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
@@ -180,8 +174,7 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::set_doppler_step(unsigned int doppler_s
} }
} }
void void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_gnss_synchro(
GalileoE1PcpsCccwsrAmbiguousAcquisition::set_gnss_synchro(
Gnss_Synchro* gnss_synchro) Gnss_Synchro* gnss_synchro)
{ {
gnss_synchro_ = gnss_synchro; gnss_synchro_ = gnss_synchro;
@@ -192,8 +185,7 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::set_gnss_synchro(
} }
signed int signed int GalileoE1PcpsCccwsrAmbiguousAcquisition::mag()
GalileoE1PcpsCccwsrAmbiguousAcquisition::mag()
{ {
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
@@ -206,22 +198,20 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::mag()
} }
void void GalileoE1PcpsCccwsrAmbiguousAcquisition::init()
GalileoE1PcpsCccwsrAmbiguousAcquisition::init()
{ {
acquisition_cc_->init(); acquisition_cc_->init();
set_local_code(); set_local_code();
} }
void void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_local_code()
GalileoE1PcpsCccwsrAmbiguousAcquisition::set_local_code()
{ {
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
bool cboc = configuration_->property( bool cboc = configuration_->property(
"Acquisition" + boost::lexical_cast<std::string>(channel_) "Acquisition" + boost::lexical_cast<std::string>(channel_)
+ ".cboc", false); + ".cboc", false);
char signal[3]; char signal[3];
@@ -240,8 +230,7 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::set_local_code()
} }
void void GalileoE1PcpsCccwsrAmbiguousAcquisition::reset()
GalileoE1PcpsCccwsrAmbiguousAcquisition::reset()
{ {
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
@@ -249,10 +238,9 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::reset()
} }
} }
void void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_state(int state)
GalileoE1PcpsCccwsrAmbiguousAcquisition::set_state(int state)
{ {
acquisition_cc_->set_state(state); acquisition_cc_->set_state(state);
} }
@@ -260,12 +248,11 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::set_state(int state)
float GalileoE1PcpsCccwsrAmbiguousAcquisition::calculate_threshold(float pfa) float GalileoE1PcpsCccwsrAmbiguousAcquisition::calculate_threshold(float pfa)
{ {
if(pfa){ /* Not implemented*/}; if(pfa){ /* Not implemented*/};
return 0.0; return 0.0;
} }
void void GalileoE1PcpsCccwsrAmbiguousAcquisition::connect(gr::top_block_sptr top_block)
GalileoE1PcpsCccwsrAmbiguousAcquisition::connect(gr::top_block_sptr top_block)
{ {
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
@@ -275,8 +262,7 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::connect(gr::top_block_sptr top_block)
} }
void void GalileoE1PcpsCccwsrAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block)
GalileoE1PcpsCccwsrAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block)
{ {
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {

View File

@@ -121,8 +121,7 @@ GalileoE1PcpsTongAmbiguousAcquisition::~GalileoE1PcpsTongAmbiguousAcquisition()
} }
void void GalileoE1PcpsTongAmbiguousAcquisition::set_channel(unsigned int channel)
GalileoE1PcpsTongAmbiguousAcquisition::set_channel(unsigned int channel)
{ {
channel_ = channel; channel_ = channel;
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
@@ -132,34 +131,32 @@ GalileoE1PcpsTongAmbiguousAcquisition::set_channel(unsigned int channel)
} }
void void GalileoE1PcpsTongAmbiguousAcquisition::set_threshold(float threshold)
GalileoE1PcpsTongAmbiguousAcquisition::set_threshold(float threshold)
{ {
float pfa = configuration_->property(role_+ boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0); float pfa = configuration_->property(role_+ boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0);
if(pfa == 0.0) pfa = configuration_->property(role_+".pfa", 0.0); if(pfa == 0.0) pfa = configuration_->property(role_+".pfa", 0.0);
if(pfa == 0.0) if(pfa == 0.0)
{ {
threshold_ = threshold; threshold_ = threshold;
} }
else else
{ {
threshold_ = calculate_threshold(pfa); threshold_ = calculate_threshold(pfa);
} }
DLOG(INFO) <<"Channel "<<channel_<<" Threshold = " << threshold_; DLOG(INFO) <<"Channel "<<channel_<<" Threshold = " << threshold_;
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
acquisition_cc_->set_threshold(threshold_); acquisition_cc_->set_threshold(threshold_);
} }
} }
void void GalileoE1PcpsTongAmbiguousAcquisition::set_doppler_max(unsigned int doppler_max)
GalileoE1PcpsTongAmbiguousAcquisition::set_doppler_max(unsigned int doppler_max)
{ {
doppler_max_ = doppler_max; doppler_max_ = doppler_max;
@@ -170,8 +167,7 @@ GalileoE1PcpsTongAmbiguousAcquisition::set_doppler_max(unsigned int doppler_max)
} }
void void GalileoE1PcpsTongAmbiguousAcquisition::set_doppler_step(unsigned int doppler_step)
GalileoE1PcpsTongAmbiguousAcquisition::set_doppler_step(unsigned int doppler_step)
{ {
doppler_step_ = doppler_step; doppler_step_ = doppler_step;
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
@@ -182,8 +178,7 @@ GalileoE1PcpsTongAmbiguousAcquisition::set_doppler_step(unsigned int doppler_ste
} }
void void GalileoE1PcpsTongAmbiguousAcquisition::set_gnss_synchro(
GalileoE1PcpsTongAmbiguousAcquisition::set_gnss_synchro(
Gnss_Synchro* gnss_synchro) Gnss_Synchro* gnss_synchro)
{ {
gnss_synchro_ = gnss_synchro; gnss_synchro_ = gnss_synchro;
@@ -194,8 +189,7 @@ GalileoE1PcpsTongAmbiguousAcquisition::set_gnss_synchro(
} }
signed int signed int GalileoE1PcpsTongAmbiguousAcquisition::mag()
GalileoE1PcpsTongAmbiguousAcquisition::mag()
{ {
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
@@ -208,16 +202,14 @@ GalileoE1PcpsTongAmbiguousAcquisition::mag()
} }
void void GalileoE1PcpsTongAmbiguousAcquisition::init()
GalileoE1PcpsTongAmbiguousAcquisition::init()
{ {
acquisition_cc_->init(); acquisition_cc_->init();
set_local_code(); set_local_code();
} }
void void GalileoE1PcpsTongAmbiguousAcquisition::set_local_code()
GalileoE1PcpsTongAmbiguousAcquisition::set_local_code()
{ {
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
@@ -243,8 +235,7 @@ GalileoE1PcpsTongAmbiguousAcquisition::set_local_code()
} }
void void GalileoE1PcpsTongAmbiguousAcquisition::reset()
GalileoE1PcpsTongAmbiguousAcquisition::reset()
{ {
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
@@ -252,36 +243,34 @@ GalileoE1PcpsTongAmbiguousAcquisition::reset()
} }
} }
void void GalileoE1PcpsTongAmbiguousAcquisition::set_state(int state)
GalileoE1PcpsTongAmbiguousAcquisition::set_state(int state)
{ {
acquisition_cc_->set_state(state); acquisition_cc_->set_state(state);
} }
float GalileoE1PcpsTongAmbiguousAcquisition::calculate_threshold(float pfa) float GalileoE1PcpsTongAmbiguousAcquisition::calculate_threshold(float pfa)
{ {
unsigned int frequency_bins = 0; unsigned int frequency_bins = 0;
for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_) for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_)
{ {
frequency_bins++; frequency_bins++;
} }
DLOG(INFO) << "Channel " << channel_ << " Pfa = " << pfa; DLOG(INFO) << "Channel " << channel_ << " Pfa = " << pfa;
unsigned int ncells = vector_length_ * frequency_bins; unsigned int ncells = vector_length_ * frequency_bins;
double exponent = 1 / static_cast<double>(ncells); double exponent = 1 / static_cast<double>(ncells);
double val = pow(1.0-pfa,exponent); double val = pow(1.0-pfa,exponent);
double lambda = double(vector_length_); double lambda = double(vector_length_);
boost::math::exponential_distribution<double> mydist (lambda); boost::math::exponential_distribution<double> mydist (lambda);
float threshold = (float)quantile(mydist,val); float threshold = (float)quantile(mydist,val);
return threshold; return threshold;
} }
void void GalileoE1PcpsTongAmbiguousAcquisition::connect(gr::top_block_sptr top_block)
GalileoE1PcpsTongAmbiguousAcquisition::connect(gr::top_block_sptr top_block)
{ {
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
@@ -290,8 +279,7 @@ GalileoE1PcpsTongAmbiguousAcquisition::connect(gr::top_block_sptr top_block)
} }
void void GalileoE1PcpsTongAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block)
GalileoE1PcpsTongAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block)
{ {
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {

View File

@@ -4,7 +4,7 @@
* Galileo E5a data and pilot Signals * Galileo E5a data and pilot Signals
* \author Marc Sales, 2014. marcsales92(at)gmail.com * \author Marc Sales, 2014. marcsales92(at)gmail.com
* \based on work from: * \based on work from:
* <ul> * <ul>
* <li> Javier Arribas, 2011. jarribas(at)cttc.es * <li> Javier Arribas, 2011. jarribas(at)cttc.es
* <li> Luis Esteve, 2012. luis(at)epsilon-formacion.com * <li> Luis Esteve, 2012. luis(at)epsilon-formacion.com
* <li> Marc Molina, 2013. marc.molina.pena@gmail.com * <li> Marc Molina, 2013. marc.molina.pena@gmail.com

View File

@@ -4,7 +4,7 @@
* Galileo E5a data and pilot Signals * Galileo E5a data and pilot Signals
* \author Marc Sales, 2014. marcsales92(at)gmail.com * \author Marc Sales, 2014. marcsales92(at)gmail.com
* \based on work from: * \based on work from:
* <ul> * <ul>
* <li> Javier Arribas, 2011. jarribas(at)cttc.es * <li> Javier Arribas, 2011. jarribas(at)cttc.es
* <li> Luis Esteve, 2012. luis(at)epsilon-formacion.com * <li> Luis Esteve, 2012. luis(at)epsilon-formacion.com
* <li> Marc Molina, 2013. marc.molina.pena@gmail.com * <li> Marc Molina, 2013. marc.molina.pena@gmail.com

View File

@@ -51,7 +51,7 @@ class ConfigurationInterface;
class GpsL1CaPcpsAcquisitionFineDoppler: public AcquisitionInterface class GpsL1CaPcpsAcquisitionFineDoppler: public AcquisitionInterface
{ {
public: public:
GpsL1CaPcpsAcquisitionFineDoppler(ConfigurationInterface* configuration, GpsL1CaPcpsAcquisitionFineDoppler(ConfigurationInterface* configuration,
std::string role, unsigned int in_streams, std::string role, unsigned int in_streams,
unsigned int out_streams, boost::shared_ptr<gr::msg_queue> queue); unsigned int out_streams, boost::shared_ptr<gr::msg_queue> queue);

View File

@@ -119,35 +119,35 @@ void GpsL1CaPcpsMultithreadAcquisition::set_channel(unsigned int channel)
{ {
channel_ = channel; channel_ = channel;
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
acquisition_cc_->set_channel(channel_); acquisition_cc_->set_channel(channel_);
} }
} }
void GpsL1CaPcpsMultithreadAcquisition::set_threshold(float threshold) void GpsL1CaPcpsMultithreadAcquisition::set_threshold(float threshold)
{ {
float pfa = configuration_->property(role_ + boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0); float pfa = configuration_->property(role_ + boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0);
if(pfa == 0.0) if(pfa == 0.0)
{ {
pfa = configuration_->property(role_+".pfa", 0.0); pfa = configuration_->property(role_+".pfa", 0.0);
}
if(pfa == 0.0)
{
threshold_ = threshold;
}
else
{
threshold_ = calculate_threshold(pfa);
} }
if(pfa == 0.0)
{
threshold_ = threshold;
}
else
{
threshold_ = calculate_threshold(pfa);
}
DLOG(INFO) <<"Channel "<<channel_<<" Threshold = " << threshold_; DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_;
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
acquisition_cc_->set_threshold(threshold_); acquisition_cc_->set_threshold(threshold_);
} }
} }
@@ -155,9 +155,9 @@ void GpsL1CaPcpsMultithreadAcquisition::set_doppler_max(unsigned int doppler_max
{ {
doppler_max_ = doppler_max; doppler_max_ = doppler_max;
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
acquisition_cc_->set_doppler_max(doppler_max_); acquisition_cc_->set_doppler_max(doppler_max_);
} }
} }
@@ -205,53 +205,53 @@ void GpsL1CaPcpsMultithreadAcquisition::init()
void GpsL1CaPcpsMultithreadAcquisition::set_local_code() void GpsL1CaPcpsMultithreadAcquisition::set_local_code()
{ {
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
std::complex<float>* code = new std::complex<float>[code_length_]; std::complex<float>* code = new std::complex<float>[code_length_];
gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0); gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0);
for (unsigned int i = 0; i < sampled_ms_; i++) for (unsigned int i = 0; i < sampled_ms_; i++)
{ {
memcpy(&(code_[i*code_length_]), code, memcpy(&(code_[i*code_length_]), code,
sizeof(gr_complex)*code_length_); sizeof(gr_complex)*code_length_);
} }
acquisition_cc_->set_local_code(code_); acquisition_cc_->set_local_code(code_);
delete[] code; delete[] code;
} }
} }
void GpsL1CaPcpsMultithreadAcquisition::reset() void GpsL1CaPcpsMultithreadAcquisition::reset()
{ {
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
acquisition_cc_->set_active(true); acquisition_cc_->set_active(true);
} }
} }
float GpsL1CaPcpsMultithreadAcquisition::calculate_threshold(float pfa) float GpsL1CaPcpsMultithreadAcquisition::calculate_threshold(float pfa)
{ {
//Calculate the threshold //Calculate the threshold
unsigned int frequency_bins = 0; unsigned int frequency_bins = 0;
for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_) for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_)
{ {
frequency_bins++; frequency_bins++;
} }
DLOG(INFO) << "Channel "<< channel_ << " Pfa = " << pfa; DLOG(INFO) << "Channel "<< channel_ << " Pfa = " << pfa;
unsigned int ncells = vector_length_ * frequency_bins; unsigned int ncells = vector_length_ * frequency_bins;
double exponent = 1 / static_cast<double>(ncells); double exponent = 1 / static_cast<double>(ncells);
double val = pow(1.0 - pfa, exponent); double val = pow(1.0 - pfa, exponent);
double lambda = double(vector_length_); double lambda = double(vector_length_);
boost::math::exponential_distribution<double> mydist (lambda); boost::math::exponential_distribution<double> mydist (lambda);
float threshold = (float)quantile(mydist,val); float threshold = (float)quantile(mydist,val);
return threshold; return threshold;
} }
@@ -268,9 +268,9 @@ void GpsL1CaPcpsMultithreadAcquisition::connect(gr::top_block_sptr top_block)
void GpsL1CaPcpsMultithreadAcquisition::disconnect(gr::top_block_sptr top_block) void GpsL1CaPcpsMultithreadAcquisition::disconnect(gr::top_block_sptr top_block)
{ {
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
top_block->disconnect(stream_to_vector_, 0, acquisition_cc_, 0); top_block->disconnect(stream_to_vector_, 0, acquisition_cc_, 0);
} }
} }

View File

@@ -116,35 +116,35 @@ void GpsL1CaPcpsOpenClAcquisition::set_channel(unsigned int channel)
{ {
channel_ = channel; channel_ = channel;
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
acquisition_cc_->set_channel(channel_); acquisition_cc_->set_channel(channel_);
} }
} }
void GpsL1CaPcpsOpenClAcquisition::set_threshold(float threshold) void GpsL1CaPcpsOpenClAcquisition::set_threshold(float threshold)
{ {
float pfa = configuration_->property(role_ + boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0); float pfa = configuration_->property(role_ + boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0);
if(pfa==0.0) if(pfa == 0.0)
{ {
pfa = configuration_->property(role_+".pfa", 0.0); pfa = configuration_->property(role_ + ".pfa", 0.0);
}
if(pfa == 0.0)
{
threshold_ = threshold;
}
else
{
threshold_ = calculate_threshold(pfa);
} }
if(pfa==0.0)
{
threshold_ = threshold;
}
else
{
threshold_ = calculate_threshold(pfa);
}
DLOG(INFO) <<"Channel "<<channel_<<" Threshold = " << threshold_; DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_;
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
acquisition_cc_->set_threshold(threshold_); acquisition_cc_->set_threshold(threshold_);
} }
} }
@@ -152,9 +152,9 @@ void GpsL1CaPcpsOpenClAcquisition::set_doppler_max(unsigned int doppler_max)
{ {
doppler_max_ = doppler_max; doppler_max_ = doppler_max;
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
acquisition_cc_->set_doppler_max(doppler_max_); acquisition_cc_->set_doppler_max(doppler_max_);
} }
} }
@@ -202,53 +202,53 @@ void GpsL1CaPcpsOpenClAcquisition::init()
void GpsL1CaPcpsOpenClAcquisition::set_local_code() void GpsL1CaPcpsOpenClAcquisition::set_local_code()
{ {
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
std::complex<float>* code = new std::complex<float>[code_length_]; std::complex<float>* code = new std::complex<float>[code_length_];
gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0); gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0);
for (unsigned int i = 0; i < sampled_ms_; i++) for (unsigned int i = 0; i < sampled_ms_; i++)
{ {
memcpy(&(code_[i*code_length_]), code, memcpy(&(code_[i*code_length_]), code,
sizeof(gr_complex)*code_length_); sizeof(gr_complex)*code_length_);
} }
acquisition_cc_->set_local_code(code_); acquisition_cc_->set_local_code(code_);
delete[] code; delete[] code;
} }
} }
void GpsL1CaPcpsOpenClAcquisition::reset() void GpsL1CaPcpsOpenClAcquisition::reset()
{ {
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
acquisition_cc_->set_active(true); acquisition_cc_->set_active(true);
} }
} }
float GpsL1CaPcpsOpenClAcquisition::calculate_threshold(float pfa) float GpsL1CaPcpsOpenClAcquisition::calculate_threshold(float pfa)
{ {
//Calculate the threshold //Calculate the threshold
unsigned int frequency_bins = 0; unsigned int frequency_bins = 0;
for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_) for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_)
{ {
frequency_bins++; frequency_bins++;
} }
DLOG(INFO) << "Channel " << channel_ << " Pfa = " << pfa; DLOG(INFO) << "Channel " << channel_ << " Pfa = " << pfa;
unsigned int ncells = vector_length_ * frequency_bins; unsigned int ncells = vector_length_ * frequency_bins;
double exponent = 1 / static_cast<double>(ncells); double exponent = 1 / static_cast<double>(ncells);
double val = pow(1.0 - pfa, exponent); double val = pow(1.0 - pfa, exponent);
double lambda = double(vector_length_); double lambda = double(vector_length_);
boost::math::exponential_distribution<double> mydist (lambda); boost::math::exponential_distribution<double> mydist (lambda);
float threshold = (float)quantile(mydist,val); float threshold = (float)quantile(mydist,val);
return threshold; return threshold;
} }
@@ -258,16 +258,15 @@ void GpsL1CaPcpsOpenClAcquisition::connect(gr::top_block_sptr top_block)
{ {
top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0); top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0);
} }
} }
void GpsL1CaPcpsOpenClAcquisition::disconnect(gr::top_block_sptr top_block) void GpsL1CaPcpsOpenClAcquisition::disconnect(gr::top_block_sptr top_block)
{ {
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
top_block->disconnect(stream_to_vector_, 0, acquisition_cc_, 0); top_block->disconnect(stream_to_vector_, 0, acquisition_cc_, 0);
} }
} }

View File

@@ -4,7 +4,7 @@
* Galileo E5a data and pilot Signals * Galileo E5a data and pilot Signals
* \author Marc Sales, 2014. marcsales92(at)gmail.com * \author Marc Sales, 2014. marcsales92(at)gmail.com
* \based on work from: * \based on work from:
* <ul> * <ul>
* <li> Javier Arribas, 2011. jarribas(at)cttc.es * <li> Javier Arribas, 2011. jarribas(at)cttc.es
* <li> Luis Esteve, 2012. luis(at)epsilon-formacion.com * <li> Luis Esteve, 2012. luis(at)epsilon-formacion.com
* <li> Marc Molina, 2013. marc.molina.pena@gmail.com * <li> Marc Molina, 2013. marc.molina.pena@gmail.com
@@ -363,11 +363,11 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
*/ */
int acquisition_message = -1; //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL int acquisition_message = -1; //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL
/* States: 0 Stop Channel /* States: 0 Stop Channel
* 1 Load the buffer until it reaches fft_size * 1 Load the buffer until it reaches fft_size
* 2 Acquisition algorithm * 2 Acquisition algorithm
* 3 Positive acquisition * 3 Positive acquisition
* 4 Negative acquisition * 4 Negative acquisition
*/ */
switch (d_state) switch (d_state)
{ {

View File

@@ -4,7 +4,7 @@
* Galileo E5a data and pilot Signals * Galileo E5a data and pilot Signals
* \author Marc Sales, 2014. marcsales92(at)gmail.com * \author Marc Sales, 2014. marcsales92(at)gmail.com
* \based on work from: * \based on work from:
* <ul> * <ul>
* <li> Javier Arribas, 2011. jarribas(at)cttc.es * <li> Javier Arribas, 2011. jarribas(at)cttc.es
* <li> Luis Esteve, 2012. luis(at)epsilon-formacion.com * <li> Luis Esteve, 2012. luis(at)epsilon-formacion.com
* <li> Marc Molina, 2013. marc.molina.pena@gmail.com * <li> Marc Molina, 2013. marc.molina.pena@gmail.com
@@ -53,7 +53,7 @@ typedef boost::shared_ptr<galileo_e5a_noncoherentIQ_acquisition_caf_cc> galileo_
galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr
galileo_e5a_noncoherentIQ_make_acquisition_caf_cc(unsigned int sampled_ms, galileo_e5a_noncoherentIQ_make_acquisition_caf_cc(unsigned int sampled_ms,
unsigned int max_dwells, unsigned int max_dwells,
unsigned int doppler_max, long freq, long fs_in, unsigned int doppler_max, long freq, long fs_in,
int samples_per_ms, int samples_per_code, int samples_per_ms, int samples_per_code,
bool bit_transition_flag, bool bit_transition_flag,
@@ -74,8 +74,8 @@ class galileo_e5a_noncoherentIQ_acquisition_caf_cc: public gr::block
private: private:
friend galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr friend galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr
galileo_e5a_noncoherentIQ_make_acquisition_caf_cc( galileo_e5a_noncoherentIQ_make_acquisition_caf_cc(
unsigned int sampled_ms, unsigned int sampled_ms,
unsigned int max_dwells, unsigned int max_dwells,
unsigned int doppler_max, long freq, long fs_in, unsigned int doppler_max, long freq, long fs_in,
int samples_per_ms, int samples_per_code, int samples_per_ms, int samples_per_code,
bool bit_transition_flag, bool bit_transition_flag,
@@ -86,8 +86,8 @@ private:
int Zero_padding_); int Zero_padding_);
galileo_e5a_noncoherentIQ_acquisition_caf_cc( galileo_e5a_noncoherentIQ_acquisition_caf_cc(
unsigned int sampled_ms, unsigned int sampled_ms,
unsigned int max_dwells, unsigned int max_dwells,
unsigned int doppler_max, long freq, long fs_in, unsigned int doppler_max, long freq, long fs_in,
int samples_per_ms, int samples_per_code, int samples_per_ms, int samples_per_code,
bool bit_transition_flag, bool bit_transition_flag,

View File

@@ -192,13 +192,13 @@ void galileo_pcps_8ms_acquisition_cc::set_state(int state)
d_state = state; d_state = state;
if (d_state == 1) if (d_state == 1)
{ {
d_gnss_synchro->Acq_delay_samples = 0.0; d_gnss_synchro->Acq_delay_samples = 0.0;
d_gnss_synchro->Acq_doppler_hz = 0.0; d_gnss_synchro->Acq_doppler_hz = 0.0;
d_gnss_synchro->Acq_samplestamp_samples = 0; d_gnss_synchro->Acq_samplestamp_samples = 0;
d_well_count = 0; d_well_count = 0;
d_mag = 0.0; d_mag = 0.0;
d_input_power = 0.0; d_input_power = 0.0;
d_test_statistics = 0.0; d_test_statistics = 0.0;
} }
else if (d_state == 0) else if (d_state == 0)
{} {}

View File

@@ -76,41 +76,40 @@ private:
void calculate_magnitudes(gr_complex* fft_begin, int doppler_shift, void calculate_magnitudes(gr_complex* fft_begin, int doppler_shift,
int doppler_offset); int doppler_offset);
long d_fs_in;
long d_fs_in; long d_freq;
long d_freq; int d_samples_per_ms;
int d_samples_per_ms;
int d_samples_per_code; int d_samples_per_code;
unsigned int d_doppler_resolution; unsigned int d_doppler_resolution;
float d_threshold; float d_threshold;
std::string d_satellite_str; std::string d_satellite_str;
unsigned int d_doppler_max; unsigned int d_doppler_max;
unsigned int d_doppler_step; unsigned int d_doppler_step;
unsigned int d_sampled_ms; unsigned int d_sampled_ms;
unsigned int d_max_dwells; unsigned int d_max_dwells;
unsigned int d_well_count; unsigned int d_well_count;
unsigned int d_fft_size; unsigned int d_fft_size;
unsigned long int d_sample_counter; unsigned long int d_sample_counter;
gr_complex** d_grid_doppler_wipeoffs; gr_complex** d_grid_doppler_wipeoffs;
unsigned int d_num_doppler_bins; unsigned int d_num_doppler_bins;
gr_complex* d_fft_code_A; gr_complex* d_fft_code_A;
gr_complex* d_fft_code_B; gr_complex* d_fft_code_B;
gr::fft::fft_complex* d_fft_if; gr::fft::fft_complex* d_fft_if;
gr::fft::fft_complex* d_ifft; gr::fft::fft_complex* d_ifft;
Gnss_Synchro *d_gnss_synchro; Gnss_Synchro *d_gnss_synchro;
unsigned int d_code_phase; unsigned int d_code_phase;
float d_doppler_freq; float d_doppler_freq;
float d_mag; float d_mag;
float* d_magnitude; float* d_magnitude;
float d_input_power; float d_input_power;
float d_test_statistics; float d_test_statistics;
gr::msg_queue::sptr d_queue; gr::msg_queue::sptr d_queue;
std::ofstream d_dump_file; std::ofstream d_dump_file;
bool d_active; bool d_active;
int d_state; int d_state;
bool d_dump; bool d_dump;
unsigned int d_channel; unsigned int d_channel;
std::string d_dump_filename; std::string d_dump_filename;
public: public:
/*! /*!

View File

@@ -61,9 +61,9 @@ pcps_acquisition_fine_doppler_cc::pcps_acquisition_fine_doppler_cc(
int max_dwells, unsigned int sampled_ms, int doppler_max, int doppler_min, long freq, int max_dwells, unsigned int sampled_ms, int doppler_max, int doppler_min, long freq,
long fs_in, int samples_per_ms, boost::shared_ptr<gr::msg_queue> queue, bool dump, long fs_in, int samples_per_ms, boost::shared_ptr<gr::msg_queue> queue, bool dump,
std::string dump_filename) : std::string dump_filename) :
gr::block("pcps_acquisition_fine_doppler_cc", gr::block("pcps_acquisition_fine_doppler_cc",
gr::io_signature::make(1, 1, sizeof(gr_complex)), gr::io_signature::make(1, 1, sizeof(gr_complex)),
gr::io_signature::make(0, 0, sizeof(gr_complex))) gr::io_signature::make(0, 0, sizeof(gr_complex)))
{ {
this->message_port_register_out(pmt::mp("events")); this->message_port_register_out(pmt::mp("events"));
d_sample_counter = 0; // SAMPLE COUNTER d_sample_counter = 0; // SAMPLE COUNTER
@@ -393,32 +393,32 @@ int pcps_acquisition_fine_doppler_cc::estimate_Doppler(gr_vector_const_void_star
DLOG(INFO) << "Error estimating fine frequency Doppler"; DLOG(INFO) << "Error estimating fine frequency Doppler";
//debug log //debug log
// //
// std::cout<<"FFT maximum present at "<<fftFreqBins[tmp_index_freq]<<" [Hz]"<<std::endl; // std::cout<<"FFT maximum present at "<<fftFreqBins[tmp_index_freq]<<" [Hz]"<<std::endl;
// std::stringstream filename; // std::stringstream filename;
// std::streamsize n = sizeof(gr_complex) * (d_fft_size); // std::streamsize n = sizeof(gr_complex) * (d_fft_size);
// //
// filename.str(""); // filename.str("");
// filename << "../data/code_prn_" << d_gnss_synchro->PRN << ".dat"; // filename << "../data/code_prn_" << d_gnss_synchro->PRN << ".dat";
// d_dump_file.open(filename.str().c_str(), std::ios::out // d_dump_file.open(filename.str().c_str(), std::ios::out
// | std::ios::binary); // | std::ios::binary);
// d_dump_file.write((char*)code_replica, n); //write directly |abs(x)|^2 in this Doppler bin? // d_dump_file.write((char*)code_replica, n); //write directly |abs(x)|^2 in this Doppler bin?
// d_dump_file.close(); // d_dump_file.close();
// //
// filename.str(""); // filename.str("");
// filename << "../data/signal_prn_" << d_gnss_synchro->PRN << ".dat"; // filename << "../data/signal_prn_" << d_gnss_synchro->PRN << ".dat";
// d_dump_file.open(filename.str().c_str(), std::ios::out // d_dump_file.open(filename.str().c_str(), std::ios::out
// | std::ios::binary); // | std::ios::binary);
// d_dump_file.write((char*)in, n); //write directly |abs(x)|^2 in this Doppler bin? // d_dump_file.write((char*)in, n); //write directly |abs(x)|^2 in this Doppler bin?
// d_dump_file.close(); // d_dump_file.close();
// //
// //
// n = sizeof(float) * (fft_size_extended); // n = sizeof(float) * (fft_size_extended);
// filename.str(""); // filename.str("");
// filename << "../data/fft_prn_" << d_gnss_synchro->PRN << ".dat"; // filename << "../data/fft_prn_" << d_gnss_synchro->PRN << ".dat";
// d_dump_file.open(filename.str().c_str(), std::ios::out // d_dump_file.open(filename.str().c_str(), std::ios::out
// | std::ios::binary); // | std::ios::binary);
// d_dump_file.write((char*)p_tmp_vector, n); //write directly |abs(x)|^2 in this Doppler bin? // d_dump_file.write((char*)p_tmp_vector, n); //write directly |abs(x)|^2 in this Doppler bin?
// d_dump_file.close(); // d_dump_file.close();
} }
@@ -436,17 +436,17 @@ int pcps_acquisition_fine_doppler_cc::general_work(int noutput_items,
{ {
/*! /*!
* TODO: High sensitivity acquisition algorithm: * TODO: High sensitivity acquisition algorithm:
* State Mechine: * State Mechine:
* S0. StandBy. If d_active==1 -> S1 * S0. StandBy. If d_active==1 -> S1
* S1. ComputeGrid. Perform the FFT acqusition doppler and delay grid. * S1. ComputeGrid. Perform the FFT acqusition doppler and delay grid.
* Accumulate the search grid matrix (#doppler_bins x #fft_size) * Accumulate the search grid matrix (#doppler_bins x #fft_size)
* Compare maximum to threshold and decide positive or negative * Compare maximum to threshold and decide positive or negative
* If T>=gamma -> S4 else * If T>=gamma -> S4 else
* If d_well_count<max_dwells -> S2 * If d_well_count<max_dwells -> S2
* else -> S5. * else -> S5.
* S4. Positive_Acq: Send message and stop acq -> S0 * S4. Positive_Acq: Send message and stop acq -> S0
* S5. Negative_Acq: Send message and stop acq -> S0 * S5. Negative_Acq: Send message and stop acq -> S0
*/ */
switch (d_state) switch (d_state)

View File

@@ -95,9 +95,8 @@ private:
std::string dump_filename); std::string dump_filename);
void update_local_carrier(gr_complex* carrier_vector, void update_local_carrier(gr_complex* carrier_vector,
int correlator_length_samples, int correlator_length_samples,
float freq); float freq);
long d_fs_in; long d_fs_in;
long d_freq; long d_freq;

View File

@@ -50,7 +50,6 @@ pcps_assisted_acquisition_cc_sptr pcps_make_assisted_acquisition_cc(
long fs_in, int samples_per_ms, boost::shared_ptr<gr::msg_queue> queue, bool dump, long fs_in, int samples_per_ms, boost::shared_ptr<gr::msg_queue> queue, bool dump,
std::string dump_filename) std::string dump_filename)
{ {
return pcps_assisted_acquisition_cc_sptr( return pcps_assisted_acquisition_cc_sptr(
new pcps_assisted_acquisition_cc(max_dwells, sampled_ms, doppler_max, doppler_min, freq, new pcps_assisted_acquisition_cc(max_dwells, sampled_ms, doppler_max, doppler_min, freq,
fs_in, samples_per_ms, queue, dump, dump_filename)); fs_in, samples_per_ms, queue, dump, dump_filename));
@@ -62,9 +61,9 @@ pcps_assisted_acquisition_cc::pcps_assisted_acquisition_cc(
int max_dwells, unsigned int sampled_ms, int doppler_max, int doppler_min, long freq, int max_dwells, unsigned int sampled_ms, int doppler_max, int doppler_min, long freq,
long fs_in, int samples_per_ms, boost::shared_ptr<gr::msg_queue> queue, bool dump, long fs_in, int samples_per_ms, boost::shared_ptr<gr::msg_queue> queue, bool dump,
std::string dump_filename) : std::string dump_filename) :
gr::block("pcps_assisted_acquisition_cc", gr::block("pcps_assisted_acquisition_cc",
gr::io_signature::make(1, 1, sizeof(gr_complex)), gr::io_signature::make(1, 1, sizeof(gr_complex)),
gr::io_signature::make(0, 0, sizeof(gr_complex))) gr::io_signature::make(0, 0, sizeof(gr_complex)))
{ {
this->message_port_register_out(pmt::mp("events")); this->message_port_register_out(pmt::mp("events"));
d_sample_counter = 0; // SAMPLE COUNTER d_sample_counter = 0; // SAMPLE COUNTER
@@ -379,20 +378,20 @@ int pcps_assisted_acquisition_cc::general_work(int noutput_items,
gr_vector_void_star &output_items __attribute__((unused))) gr_vector_void_star &output_items __attribute__((unused)))
{ {
/*! /*!
* TODO: High sensitivity acquisition algorithm: * TODO: High sensitivity acquisition algorithm:
* State Mechine: * State Mechine:
* S0. StandBy. If d_active==1 -> S1 * S0. StandBy. If d_active==1 -> S1
* S1. GetAssist. Define search grid with assistance information. Reset grid matrix -> S2 * S1. GetAssist. Define search grid with assistance information. Reset grid matrix -> S2
* S2. ComputeGrid. Perform the FFT acqusition doppler and delay grid. * S2. ComputeGrid. Perform the FFT acqusition doppler and delay grid.
* Accumulate the search grid matrix (#doppler_bins x #fft_size) * Accumulate the search grid matrix (#doppler_bins x #fft_size)
* Compare maximum to threshold and decide positive or negative * Compare maximum to threshold and decide positive or negative
* If T>=gamma -> S4 else * If T>=gamma -> S4 else
* If d_well_count<max_dwells -> S2 * If d_well_count<max_dwells -> S2
* else if !disable_assist -> S3 * else if !disable_assist -> S3
* else -> S5. * else -> S5.
* S3. RedefineGrid. Open the grid search to unasisted acquisition. Reset counters and grid. -> S2 * S3. RedefineGrid. Open the grid search to unasisted acquisition. Reset counters and grid. -> S2
* S4. Positive_Acq: Send message and stop acq -> S0 * S4. Positive_Acq: Send message and stop acq -> S0
* S5. Negative_Acq: Send message and stop acq -> S0 * S5. Negative_Acq: Send message and stop acq -> S0
*/ */
switch (d_state) switch (d_state)

View File

@@ -102,41 +102,41 @@ private:
int doppler_offset); int doppler_offset);
long d_fs_in; long d_fs_in;
long d_freq; long d_freq;
int d_samples_per_ms; int d_samples_per_ms;
int d_samples_per_code; int d_samples_per_code;
unsigned int d_doppler_resolution; unsigned int d_doppler_resolution;
float d_threshold; float d_threshold;
std::string d_satellite_str; std::string d_satellite_str;
unsigned int d_doppler_max; unsigned int d_doppler_max;
unsigned int d_doppler_step; unsigned int d_doppler_step;
unsigned int d_sampled_ms; unsigned int d_sampled_ms;
unsigned int d_max_dwells; unsigned int d_max_dwells;
unsigned int d_well_count; unsigned int d_well_count;
unsigned int d_fft_size; unsigned int d_fft_size;
unsigned long int d_sample_counter; unsigned long int d_sample_counter;
gr_complex** d_grid_doppler_wipeoffs; gr_complex** d_grid_doppler_wipeoffs;
unsigned int d_num_doppler_bins; unsigned int d_num_doppler_bins;
gr_complex* d_fft_codes; gr_complex* d_fft_codes;
gr::fft::fft_complex* d_fft_if; gr::fft::fft_complex* d_fft_if;
gr::fft::fft_complex* d_ifft; gr::fft::fft_complex* d_ifft;
Gnss_Synchro *d_gnss_synchro; Gnss_Synchro *d_gnss_synchro;
unsigned int d_code_phase; unsigned int d_code_phase;
float d_doppler_freq; float d_doppler_freq;
float d_mag; float d_mag;
float* d_magnitude; float* d_magnitude;
float d_input_power; float d_input_power;
float d_test_statistics; float d_test_statistics;
bool d_bit_transition_flag; bool d_bit_transition_flag;
gr::msg_queue::sptr d_queue; gr::msg_queue::sptr d_queue;
std::ofstream d_dump_file; std::ofstream d_dump_file;
bool d_active; bool d_active;
int d_state; int d_state;
bool d_core_working; bool d_core_working;
bool d_dump; bool d_dump;
unsigned int d_channel; unsigned int d_channel;
std::string d_dump_filename; std::string d_dump_filename;
gr_complex** d_in_buffer; gr_complex** d_in_buffer;
std::vector<unsigned long int> d_sample_counter_buffer; std::vector<unsigned long int> d_sample_counter_buffer;
unsigned int d_in_dwell_count; unsigned int d_in_dwell_count;

View File

@@ -134,6 +134,7 @@ pcps_quicksync_acquisition_cc::pcps_quicksync_acquisition_cc(
// DLOG(INFO) << "END CONSTRUCTOR"; // DLOG(INFO) << "END CONSTRUCTOR";
} }
pcps_quicksync_acquisition_cc::~pcps_quicksync_acquisition_cc() pcps_quicksync_acquisition_cc::~pcps_quicksync_acquisition_cc()
{ {
//DLOG(INFO) << "START DESTROYER"; //DLOG(INFO) << "START DESTROYER";
@@ -478,8 +479,8 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items,
std::streamsize n = sizeof(float) * (d_fft_size); // complex file write std::streamsize n = sizeof(float) * (d_fft_size); // complex file write
filename.str(""); filename.str("");
filename << "../data/test_statistics_" << d_gnss_synchro->System filename << "../data/test_statistics_" << d_gnss_synchro->System
<< "_" << d_gnss_synchro->Signal << "_sat_" << "_" << d_gnss_synchro->Signal << "_sat_"
<< d_gnss_synchro->PRN << "_doppler_" << doppler << ".dat"; << d_gnss_synchro->PRN << "_doppler_" << doppler << ".dat";
d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary); d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary);
d_dump_file.write((char*)d_magnitude_folded, n); //write directly |abs(x)|^2 in this Doppler bin? d_dump_file.write((char*)d_magnitude_folded, n); //write directly |abs(x)|^2 in this Doppler bin?
d_dump_file.close(); d_dump_file.close();
@@ -562,7 +563,7 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items,
DLOG(INFO) << "test statistics value " << d_test_statistics; DLOG(INFO) << "test statistics value " << d_test_statistics;
DLOG(INFO) << "test statistics threshold " << d_threshold; DLOG(INFO) << "test statistics threshold " << d_threshold;
DLOG(INFO) << "folding factor "<<d_folding_factor; DLOG(INFO) << "folding factor "<<d_folding_factor;
DLOG(INFO) << "possible delay corr output"; DLOG(INFO) << "possible delay corr output";
for (int i = 0; i < static_cast<int>(d_folding_factor); i++) DLOG(INFO) << d_possible_delay[i] << "\t\t\t" << d_corr_output_f[i]; for (int i = 0; i < static_cast<int>(d_folding_factor); i++) DLOG(INFO) << d_possible_delay[i] << "\t\t\t" << d_corr_output_f[i];
DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples;
DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz;

View File

@@ -137,7 +137,7 @@ ChannelFsm::ChannelFsm()
ChannelFsm::ChannelFsm(std::shared_ptr<AcquisitionInterface> acquisition) : ChannelFsm::ChannelFsm(std::shared_ptr<AcquisitionInterface> acquisition) :
acq_(acquisition) acq_(acquisition)
{ {
trk_ = nullptr; trk_ = nullptr;
channel_ = 0; channel_ = 0;
@@ -177,7 +177,7 @@ void ChannelFsm::Event_failed_tracking_standby()
} }
//void ChannelFsm::Event_failed_tracking_reacq() { //void ChannelFsm::Event_failed_tracking_reacq() {
// this->process_event(Ev_channel_failed_tracking_reacq()); // this->process_event(Ev_channel_failed_tracking_reacq());
//} //}
void ChannelFsm::set_acquisition(std::shared_ptr<AcquisitionInterface> acquisition) void ChannelFsm::set_acquisition(std::shared_ptr<AcquisitionInterface> acquisition)

View File

@@ -202,16 +202,16 @@ void FirFilter::connect(gr::top_block_sptr top_block)
} }
} }
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0) else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0)
&& (output_item_type_.compare("gr_complex") == 0)) && (output_item_type_.compare("gr_complex") == 0))
{ {
top_block->connect(cshort_to_float_x2_, 0, fir_filter_fff_1_, 0); top_block->connect(cshort_to_float_x2_, 0, fir_filter_fff_1_, 0);
top_block->connect(cshort_to_float_x2_, 1, fir_filter_fff_2_, 0); top_block->connect(cshort_to_float_x2_, 1, fir_filter_fff_2_, 0);
top_block->connect(fir_filter_fff_1_, 0, float_to_complex_, 0); top_block->connect(fir_filter_fff_1_, 0, float_to_complex_, 0);
top_block->connect(fir_filter_fff_2_, 0, float_to_complex_, 1); top_block->connect(fir_filter_fff_2_, 0, float_to_complex_, 1);
if (dump_) if (dump_)
{ {
top_block->connect(float_to_complex_, 0, file_sink_, 0); top_block->connect(float_to_complex_, 0, file_sink_, 0);
} }
} }
else else
{ {
@@ -272,16 +272,16 @@ void FirFilter::disconnect(gr::top_block_sptr top_block)
} }
} }
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0) else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0)
&& (output_item_type_.compare("gr_complex") == 0)) && (output_item_type_.compare("gr_complex") == 0))
{ {
top_block->disconnect(cshort_to_float_x2_, 0, fir_filter_fff_1_, 0); top_block->disconnect(cshort_to_float_x2_, 0, fir_filter_fff_1_, 0);
top_block->disconnect(cshort_to_float_x2_, 1, fir_filter_fff_2_, 0); top_block->disconnect(cshort_to_float_x2_, 1, fir_filter_fff_2_, 0);
top_block->disconnect(fir_filter_fff_1_, 0, float_to_complex_, 0); top_block->disconnect(fir_filter_fff_1_, 0, float_to_complex_, 0);
top_block->disconnect(fir_filter_fff_2_, 0, float_to_complex_, 1); top_block->disconnect(fir_filter_fff_2_, 0, float_to_complex_, 1);
if (dump_) if (dump_)
{ {
top_block->disconnect(float_to_complex_, 0, file_sink_, 0); top_block->disconnect(float_to_complex_, 0, file_sink_, 0);
} }
} }
else else
{ {
@@ -314,7 +314,7 @@ gr::basic_block_sptr FirFilter::get_left_block()
return cbyte_to_float_x2_; return cbyte_to_float_x2_;
} }
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0) else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0)
&& (output_item_type_.compare("gr_complex") == 0)) && (output_item_type_.compare("gr_complex") == 0))
{ {
return cshort_to_float_x2_; return cshort_to_float_x2_;
} }
@@ -350,7 +350,7 @@ gr::basic_block_sptr FirFilter::get_right_block()
return char_x2_cbyte_; return char_x2_cbyte_;
} }
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0) else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0)
&& (output_item_type_.compare("gr_complex") == 0)) && (output_item_type_.compare("gr_complex") == 0))
{ {
return float_to_complex_; return float_to_complex_;
} }

View File

@@ -41,53 +41,55 @@ beamformer_sptr make_beamformer()
return beamformer_sptr(new beamformer()); return beamformer_sptr(new beamformer());
} }
beamformer::beamformer()
: gr::sync_block("beamformer",
gr::io_signature::make(GNSS_SDR_BEAMFORMER_CHANNELS, GNSS_SDR_BEAMFORMER_CHANNELS,sizeof(gr_complex)),
gr::io_signature::make(1, 1,sizeof(gr_complex)))
{
//initialize weight vector beamformer::beamformer()
: gr::sync_block("beamformer",
gr::io_signature::make(GNSS_SDR_BEAMFORMER_CHANNELS, GNSS_SDR_BEAMFORMER_CHANNELS,sizeof(gr_complex)),
gr::io_signature::make(1, 1,sizeof(gr_complex)))
{
//initialize weight vector
if (posix_memalign((void**)&weight_vector, 16, GNSS_SDR_BEAMFORMER_CHANNELS * sizeof(gr_complex)) == 0){}; if (posix_memalign((void**)&weight_vector, 16, GNSS_SDR_BEAMFORMER_CHANNELS * sizeof(gr_complex)) == 0){};
for (int i=0;i<GNSS_SDR_BEAMFORMER_CHANNELS;i++) for (int i = 0; i< GNSS_SDR_BEAMFORMER_CHANNELS; i++)
{ {
weight_vector[i]=gr_complex(1,0); weight_vector[i]=gr_complex(1,0);
} }
} }
beamformer::~beamformer() beamformer::~beamformer()
{ {
free(weight_vector); free(weight_vector);
} }
int beamformer::work(int noutput_items,gr_vector_const_void_star &input_items, int beamformer::work(int noutput_items,gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items) gr_vector_void_star &output_items)
{ {
gr_complex *out = (gr_complex *) output_items[0]; gr_complex *out = (gr_complex *) output_items[0];
// channel output buffers // channel output buffers
// gr_complex *ch1 = (gr_complex *) input_items[0]; // gr_complex *ch1 = (gr_complex *) input_items[0];
// gr_complex *ch2 = (gr_complex *) input_items[1]; // gr_complex *ch2 = (gr_complex *) input_items[1];
// gr_complex *ch3 = (gr_complex *) input_items[2]; // gr_complex *ch3 = (gr_complex *) input_items[2];
// gr_complex *ch4 = (gr_complex *) input_items[3]; // gr_complex *ch4 = (gr_complex *) input_items[3];
// gr_complex *ch5 = (gr_complex *) input_items[4]; // gr_complex *ch5 = (gr_complex *) input_items[4];
// gr_complex *ch6 = (gr_complex *) input_items[5]; // gr_complex *ch6 = (gr_complex *) input_items[5];
// gr_complex *ch7 = (gr_complex *) input_items[6]; // gr_complex *ch7 = (gr_complex *) input_items[6];
// gr_complex *ch8 = (gr_complex *) input_items[7]; // gr_complex *ch8 = (gr_complex *) input_items[7];
// NON-VOLK beamforming operation // NON-VOLK beamforming operation
//TODO: Implement VOLK SIMD-accelerated beamformer! //TODO: Implement VOLK SIMD-accelerated beamformer!
gr_complex sum; gr_complex sum;
for(int n=0;n<noutput_items;n++) for(int n = 0; n < noutput_items; n++)
{ {
sum=gr_complex(0,0); sum = gr_complex(0,0);
for (int i=0;i<GNSS_SDR_BEAMFORMER_CHANNELS;i++) for (int i = 0; i < GNSS_SDR_BEAMFORMER_CHANNELS; i++)
{ {
sum=sum+((gr_complex *) input_items[i])[n]*weight_vector[i]; sum = sum + ((gr_complex*)input_items[i])[n] * weight_vector[i];
} }
out[n]=sum; out[n] = sum;
} }
return noutput_items; return noutput_items;
} }

View File

@@ -44,64 +44,64 @@ void galileo_e5_a_code_gen_complex_primary(std::complex<float>* _dest, signed in
unsigned int index = 0; unsigned int index = 0;
int a[4]; int a[4];
if ((_prn < 1) || (_prn > 50)) if ((_prn < 1) || (_prn > 50))
{ {
return; return;
} }
if (_Signal[0] == '5' && _Signal[1] == 'Q') if (_Signal[0] == '5' && _Signal[1] == 'Q')
{ {
for (size_t i = 0; i < Galileo_E5a_Q_PRIMARY_CODE[prn].length() - 1; i++) for (size_t i = 0; i < Galileo_E5a_Q_PRIMARY_CODE[prn].length() - 1; i++)
{ {
hex_to_binary_converter(a, Galileo_E5a_Q_PRIMARY_CODE[prn].at(i)); hex_to_binary_converter(a, Galileo_E5a_Q_PRIMARY_CODE[prn].at(i));
_dest[index] = std::complex<float>(0.0, float(a[0])); _dest[index] = std::complex<float>(0.0, float(a[0]));
_dest[index + 1] = std::complex<float>(0.0, float(a[1])); _dest[index + 1] = std::complex<float>(0.0, float(a[1]));
_dest[index + 2] = std::complex<float>(0.0, float(a[2])); _dest[index + 2] = std::complex<float>(0.0, float(a[2]));
_dest[index + 3] = std::complex<float>(0.0, float(a[3])); _dest[index + 3] = std::complex<float>(0.0, float(a[3]));
index = index + 4; index = index + 4;
} }
// last 2 bits are filled up zeros // last 2 bits are filled up zeros
hex_to_binary_converter(a, Galileo_E5a_Q_PRIMARY_CODE[prn].at(Galileo_E5a_Q_PRIMARY_CODE[prn].length() - 1)); hex_to_binary_converter(a, Galileo_E5a_Q_PRIMARY_CODE[prn].at(Galileo_E5a_Q_PRIMARY_CODE[prn].length() - 1));
_dest[index] = std::complex<float>(float(0.0), a[0]); _dest[index] = std::complex<float>(float(0.0), a[0]);
_dest[index + 1] = std::complex<float>(float(0.0), a[1]); _dest[index + 1] = std::complex<float>(float(0.0), a[1]);
} }
else if (_Signal[0] == '5' && _Signal[1] == 'I') else if (_Signal[0] == '5' && _Signal[1] == 'I')
{ {
for (size_t i = 0; i < Galileo_E5a_I_PRIMARY_CODE[prn].length() - 1; i++) for (size_t i = 0; i < Galileo_E5a_I_PRIMARY_CODE[prn].length() - 1; i++)
{ {
hex_to_binary_converter(a, Galileo_E5a_I_PRIMARY_CODE[prn].at(i)); hex_to_binary_converter(a, Galileo_E5a_I_PRIMARY_CODE[prn].at(i));
_dest[index] = std::complex<float>(float(a[0]), 0.0); _dest[index] = std::complex<float>(float(a[0]), 0.0);
_dest[index + 1] = std::complex<float>(float(a[1]), 0.0); _dest[index + 1] = std::complex<float>(float(a[1]), 0.0);
_dest[index + 2] = std::complex<float>(float(a[2]), 0.0); _dest[index + 2] = std::complex<float>(float(a[2]), 0.0);
_dest[index + 3] = std::complex<float>(float(a[3]), 0.0); _dest[index + 3] = std::complex<float>(float(a[3]), 0.0);
index = index + 4; index = index + 4;
} }
// last 2 bits are filled up zeros // last 2 bits are filled up zeros
hex_to_binary_converter(a, Galileo_E5a_I_PRIMARY_CODE[prn].at(Galileo_E5a_I_PRIMARY_CODE[prn].length() - 1)); hex_to_binary_converter(a, Galileo_E5a_I_PRIMARY_CODE[prn].at(Galileo_E5a_I_PRIMARY_CODE[prn].length() - 1));
_dest[index] = std::complex<float>(float(a[0]), 0.0); _dest[index] = std::complex<float>(float(a[0]), 0.0);
_dest[index + 1] = std::complex<float>(float(a[1]), 0.0); _dest[index + 1] = std::complex<float>(float(a[1]), 0.0);
} }
else if (_Signal[0] == '5' && _Signal[1] == 'X') else if (_Signal[0] == '5' && _Signal[1] == 'X')
{ {
int b[4]; int b[4];
for (size_t i = 0; i < Galileo_E5a_I_PRIMARY_CODE[prn].length() - 1; i++) for (size_t i = 0; i < Galileo_E5a_I_PRIMARY_CODE[prn].length() - 1; i++)
{ {
hex_to_binary_converter(a, Galileo_E5a_I_PRIMARY_CODE[prn].at(i)); hex_to_binary_converter(a, Galileo_E5a_I_PRIMARY_CODE[prn].at(i));
hex_to_binary_converter(b, Galileo_E5a_Q_PRIMARY_CODE[prn].at(i)); hex_to_binary_converter(b, Galileo_E5a_Q_PRIMARY_CODE[prn].at(i));
_dest[index] = std::complex<float>(float(a[0]),float(b[0])); _dest[index] = std::complex<float>(float(a[0]),float(b[0]));
_dest[index + 1] = std::complex<float>(float(a[1]),float(b[1])); _dest[index + 1] = std::complex<float>(float(a[1]),float(b[1]));
_dest[index + 2] = std::complex<float>(float(a[2]),float(b[2])); _dest[index + 2] = std::complex<float>(float(a[2]),float(b[2]));
_dest[index + 3] = std::complex<float>(float(a[3]),float(b[3])); _dest[index + 3] = std::complex<float>(float(a[3]),float(b[3]));
index = index + 4; index = index + 4;
} }
// last 2 bits are filled up zeros // last 2 bits are filled up zeros
hex_to_binary_converter(a, Galileo_E5a_I_PRIMARY_CODE[prn].at(Galileo_E5a_I_PRIMARY_CODE[prn].length() - 1)); hex_to_binary_converter(a, Galileo_E5a_I_PRIMARY_CODE[prn].at(Galileo_E5a_I_PRIMARY_CODE[prn].length() - 1));
hex_to_binary_converter(b, Galileo_E5a_Q_PRIMARY_CODE[prn].at(Galileo_E5a_Q_PRIMARY_CODE[prn].length() - 1)); hex_to_binary_converter(b, Galileo_E5a_Q_PRIMARY_CODE[prn].at(Galileo_E5a_Q_PRIMARY_CODE[prn].length() - 1));
_dest[index] = std::complex<float>(float(a[0]), float(b[0])); _dest[index] = std::complex<float>(float(a[0]), float(b[0]));
_dest[index + 1] = std::complex<float>(float(a[1]), float(b[1])); _dest[index + 1] = std::complex<float>(float(a[1]), float(b[1]));
} }
} }
void galileo_e5_a_code_gen_complex_sampled(std::complex<float>* _dest, char _Signal[3], void galileo_e5_a_code_gen_complex_sampled(std::complex<float>* _dest, char _Signal[3],
unsigned int _prn, signed int _fs, unsigned int _chip_shift) unsigned int _prn, signed int _fs, unsigned int _chip_shift)
{ {
unsigned int _samplesPerCode; unsigned int _samplesPerCode;
unsigned int delay; unsigned int delay;

View File

@@ -51,7 +51,7 @@ void galileo_e5_a_code_gen_tiered(std::complex<float>* _dest,std::complex<float>
* bool _pilot generates E5aQ code if true and E5aI (data signal) if false. * bool _pilot generates E5aQ code if true and E5aI (data signal) if false.
*/ */
void galileo_e5_a_code_gen_complex_sampled(std::complex<float>* _dest, void galileo_e5_a_code_gen_complex_sampled(std::complex<float>* _dest,
char _Signal[3], unsigned int _prn, signed int _fs, unsigned int _chip_shift); char _Signal[3], unsigned int _prn, signed int _fs, unsigned int _chip_shift);
#endif /* GNSS_SDR_GALILEO_E5_SIGNAL_PROCESSING_H_ */ #endif /* GNSS_SDR_GALILEO_E5_SIGNAL_PROCESSING_H_ */

View File

@@ -44,10 +44,7 @@ gnss_sdr_valve::gnss_sdr_valve (size_t sizeof_stream_item,
{} {}
boost::shared_ptr<gr::block> gnss_sdr_make_valve (size_t sizeof_stream_item, unsigned long long nitems, gr::msg_queue::sptr queue)
boost::shared_ptr<gr::block> gnss_sdr_make_valve (size_t sizeof_stream_item,
unsigned long long nitems,
gr::msg_queue::sptr queue)
{ {
boost::shared_ptr<gnss_sdr_valve> valve_(new gnss_sdr_valve(sizeof_stream_item, nitems, queue)); boost::shared_ptr<gnss_sdr_valve> valve_(new gnss_sdr_valve(sizeof_stream_item, nitems, queue));
return valve_; return valve_;
@@ -61,11 +58,10 @@ int gnss_sdr_valve::work (int noutput_items,
{ {
if (d_ncopied_items >= d_nitems) if (d_ncopied_items >= d_nitems)
{ {
ControlMessageFactory* cmf = new ControlMessageFactory(); ControlMessageFactory* cmf = new ControlMessageFactory();
d_queue->handle(cmf->GetQueueMessage(200,0)); d_queue->handle(cmf->GetQueueMessage(200,0));
delete cmf; delete cmf;
return -1; // Done! return -1; // Done!
} }
unsigned long long n = std::min(d_nitems - d_ncopied_items, (long long unsigned int)noutput_items); unsigned long long n = std::min(d_nitems - d_ncopied_items, (long long unsigned int)noutput_items);
if (n == 0) return 0; if (n == 0) return 0;

View File

@@ -54,8 +54,8 @@ class gnss_sdr_valve : public gr::sync_block
gnss_sdr_valve (size_t sizeof_stream_item, gnss_sdr_valve (size_t sizeof_stream_item,
unsigned long long nitems, unsigned long long nitems,
gr::msg_queue::sptr queue); gr::msg_queue::sptr queue);
unsigned long long d_nitems; unsigned long long d_nitems;
unsigned long long d_ncopied_items; unsigned long long d_ncopied_items;
gr::msg_queue::sptr d_queue; gr::msg_queue::sptr d_queue;
public: public:

View File

@@ -55,105 +55,105 @@ void complex_exp_gen_conj(std::complex<float>* _dest, double _f, double _fs, uns
void hex_to_binary_converter(int * _dest, char _from) void hex_to_binary_converter(int * _dest, char _from)
{ {
switch(_from) switch(_from)
{ {
case '0': case '0':
*(_dest) = 1; *(_dest) = 1;
*(_dest+1) = 1; *(_dest+1) = 1;
*(_dest+2) = 1; *(_dest+2) = 1;
*(_dest+3) = 1; *(_dest+3) = 1;
break; break;
case '1': case '1':
*(_dest) = 1; *(_dest) = 1;
*(_dest+1) = 1; *(_dest+1) = 1;
*(_dest+2) = 1; *(_dest+2) = 1;
*(_dest+3) = -1; *(_dest+3) = -1;
break; break;
case '2': case '2':
*(_dest) = 1; *(_dest) = 1;
*(_dest+1) = 1; *(_dest+1) = 1;
*(_dest+2) = -1; *(_dest+2) = -1;
*(_dest+3) = 1; *(_dest+3) = 1;
break; break;
case '3': case '3':
*(_dest) = 1; *(_dest) = 1;
*(_dest+1) = 1; *(_dest+1) = 1;
*(_dest+2) = -1; *(_dest+2) = -1;
*(_dest+3) = -1; *(_dest+3) = -1;
break; break;
case '4': case '4':
*(_dest) = 1; *(_dest) = 1;
*(_dest+1) = -1; *(_dest+1) = -1;
*(_dest+2) = 1; *(_dest+2) = 1;
*(_dest+3) = 1; *(_dest+3) = 1;
break; break;
case '5': case '5':
*(_dest) = 1; *(_dest) = 1;
*(_dest+1) = -1; *(_dest+1) = -1;
*(_dest+2) = 1; *(_dest+2) = 1;
*(_dest+3) = -1; *(_dest+3) = -1;
break; break;
case '6': case '6':
*(_dest) = 1; *(_dest) = 1;
*(_dest+1) = -1; *(_dest+1) = -1;
*(_dest+2) = -1; *(_dest+2) = -1;
*(_dest+3) = 1; *(_dest+3) = 1;
break; break;
case '7': case '7':
*(_dest) = 1; *(_dest) = 1;
*(_dest+1) = -1; *(_dest+1) = -1;
*(_dest+2) = -1; *(_dest+2) = -1;
*(_dest+3) = -1; *(_dest+3) = -1;
break; break;
case '8': case '8':
*(_dest) = -1; *(_dest) = -1;
*(_dest+1) = 1; *(_dest+1) = 1;
*(_dest+2) = 1; *(_dest+2) = 1;
*(_dest+3) = 1; *(_dest+3) = 1;
break; break;
case '9': case '9':
*(_dest) = -1; *(_dest) = -1;
*(_dest+1) = 1; *(_dest+1) = 1;
*(_dest+2) = 1; *(_dest+2) = 1;
*(_dest+3) = -1; *(_dest+3) = -1;
break; break;
case 'A': case 'A':
*(_dest) = -1; *(_dest) = -1;
*(_dest+1) = 1; *(_dest+1) = 1;
*(_dest+2) = -1; *(_dest+2) = -1;
*(_dest+3) = 1; *(_dest+3) = 1;
break; break;
case 'B': case 'B':
*(_dest) = -1; *(_dest) = -1;
*(_dest+1) = 1; *(_dest+1) = 1;
*(_dest+2) = -1; *(_dest+2) = -1;
*(_dest+3) = -1; *(_dest+3) = -1;
break; break;
case 'C': case 'C':
*(_dest) = -1; *(_dest) = -1;
*(_dest+1) = -1; *(_dest+1) = -1;
*(_dest+2) = 1; *(_dest+2) = 1;
*(_dest+3) = 1; *(_dest+3) = 1;
break; break;
case 'D': case 'D':
*(_dest) = -1; *(_dest) = -1;
*(_dest+1) = -1; *(_dest+1) = -1;
*(_dest+2) = 1; *(_dest+2) = 1;
*(_dest+3) = -1; *(_dest+3) = -1;
break; break;
case 'E': case 'E':
*(_dest) = -1; *(_dest) = -1;
*(_dest+1) = -1; *(_dest+1) = -1;
*(_dest+2) = -1; *(_dest+2) = -1;
*(_dest+3) = 1; *(_dest+3) = 1;
break; break;
case 'F': case 'F':
*(_dest) = -1; *(_dest) = -1;
*(_dest+1) = -1; *(_dest+1) = -1;
*(_dest+2) = -1; *(_dest+2) = -1;
*(_dest+3) = -1; *(_dest+3) = -1;
break; break;
} }
} }

View File

@@ -54,14 +54,13 @@ void gps_l1_ca_code_gen_complex(std::complex<float>* _dest, signed int _prn, uns
// compute delay array index for given PRN number // compute delay array index for given PRN number
if(120 <= _prn && _prn <= 138) if(120 <= _prn && _prn <= 138)
{ {
prn_idx = _prn - 88; // SBAS PRNs are at array indices 31 to 50 (offset: -120+33-1 =-88) prn_idx = _prn - 88; // SBAS PRNs are at array indices 31 to 50 (offset: -120+33-1 =-88)
//prn_idx = _prn - 87; // SBAS PRNs are at array indices 31 to 50 (offset: -120+33 =-87) }
}
else else
{ {
prn_idx = _prn - 1; prn_idx = _prn - 1;
} }
/* A simple error check */ /* A simple error check */
if((prn_idx < 0) || (prn_idx > 51)) if((prn_idx < 0) || (prn_idx > 51))

View File

@@ -109,16 +109,16 @@ Pass_Through::~Pass_Through()
void Pass_Through::connect(gr::top_block_sptr top_block) void Pass_Through::connect(gr::top_block_sptr top_block)
{ {
if(top_block) { /* top_block is not null */}; if(top_block) { /* top_block is not null */};
DLOG(INFO) << "nothing to connect internally"; DLOG(INFO) << "nothing to connect internally";
} }
void Pass_Through::disconnect(gr::top_block_sptr top_block) void Pass_Through::disconnect(gr::top_block_sptr top_block)
{ {
if(top_block) { /* top_block is not null */}; if(top_block) { /* top_block is not null */};
// Nothing to disconnect // Nothing to disconnect
} }

View File

@@ -47,10 +47,10 @@ class ConfigurationInterface;
class GalileoE1Observables : public ObservablesInterface class GalileoE1Observables : public ObservablesInterface
{ {
public: public:
GalileoE1Observables(ConfigurationInterface* configuration, GalileoE1Observables(ConfigurationInterface* configuration,
std::string role, std::string role,
unsigned int in_streams, unsigned int in_streams,
unsigned int out_streams); unsigned int out_streams);
virtual ~GalileoE1Observables(); virtual ~GalileoE1Observables();
std::string role() std::string role()
{ {

View File

@@ -47,10 +47,10 @@ class ConfigurationInterface;
class HybridObservables : public ObservablesInterface class HybridObservables : public ObservablesInterface
{ {
public: public:
HybridObservables(ConfigurationInterface* configuration, HybridObservables(ConfigurationInterface* configuration,
std::string role, std::string role,
unsigned int in_streams, unsigned int in_streams,
unsigned int out_streams); unsigned int out_streams);
virtual ~HybridObservables(); virtual ~HybridObservables();
std::string role() std::string role()
{ {

View File

@@ -57,8 +57,8 @@ galileo_e1_make_observables_cc(unsigned int nchannels, bool dump, std::string du
galileo_e1_observables_cc::galileo_e1_observables_cc(unsigned int nchannels, bool dump, std::string dump_filename, int output_rate_ms, bool flag_averaging) : galileo_e1_observables_cc::galileo_e1_observables_cc(unsigned int nchannels, bool dump, std::string dump_filename, int output_rate_ms, bool flag_averaging) :
gr::block("galileo_e1_observables_cc", gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)), gr::block("galileo_e1_observables_cc", gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)),
gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro))) gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)))
{ {
// initialize internal vars // initialize internal vars
d_dump = dump; d_dump = dump;
@@ -117,7 +117,7 @@ bool Galileo_pairCompare_gnss_synchro_d_TOW_at_current_symbol(const std::pair<in
int galileo_e1_observables_cc::general_work (int noutput_items, gr_vector_int &ninput_items, int galileo_e1_observables_cc::general_work (int noutput_items, gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
{ {
Gnss_Synchro **in = (Gnss_Synchro **) &input_items[0]; // Get the input pointer Gnss_Synchro **in = (Gnss_Synchro **) &input_items[0]; // Get the input pointer
Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0]; // Get the output pointer Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0]; // Get the output pointer

View File

@@ -31,7 +31,7 @@
#ifndef GNSS_SDR_GALILEO_E1_OBSERVABLES_CC_H #ifndef GNSS_SDR_GALILEO_E1_OBSERVABLES_CC_H
#define GNSS_SDR_GALILEO_E1_OBSERVABLES_CC_H #define GNSS_SDR_GALILEO_E1_OBSERVABLES_CC_H
#include <fstream> #include <fstream>

View File

@@ -54,8 +54,8 @@ gps_l1_ca_make_observables_cc(unsigned int nchannels, bool dump, std::string dum
gps_l1_ca_observables_cc::gps_l1_ca_observables_cc(unsigned int nchannels, bool dump, std::string dump_filename, int output_rate_ms, bool flag_averaging) : gps_l1_ca_observables_cc::gps_l1_ca_observables_cc(unsigned int nchannels, bool dump, std::string dump_filename, int output_rate_ms, bool flag_averaging) :
gr::block("gps_l1_ca_observables_cc", gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)), gr::block("gps_l1_ca_observables_cc", gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)),
gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro))) gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)))
{ {
// initialize internal vars // initialize internal vars
d_dump = dump; d_dump = dump;
@@ -111,7 +111,7 @@ bool pairCompare_gnss_synchro_d_TOW_at_current_symbol(const std::pair<int,Gnss_S
int gps_l1_ca_observables_cc::general_work (int noutput_items, gr_vector_int &ninput_items, int gps_l1_ca_observables_cc::general_work (int noutput_items, gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
{ {
Gnss_Synchro **in = (Gnss_Synchro **) &input_items[0]; // Get the input pointer Gnss_Synchro **in = (Gnss_Synchro **) &input_items[0]; // Get the input pointer
Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0]; // Get the output pointer Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0]; // Get the output pointer
@@ -219,8 +219,8 @@ int gps_l1_ca_observables_cc::general_work (int noutput_items, gr_vector_int &ni
dopper_vec_hz = arma::vec(std::vector<double>(d_carrier_doppler_queue_hz[gnss_synchro_iter->second.Channel_ID].begin(), d_carrier_doppler_queue_hz[gnss_synchro_iter->second.Channel_ID].end())); dopper_vec_hz = arma::vec(std::vector<double>(d_carrier_doppler_queue_hz[gnss_synchro_iter->second.Channel_ID].begin(), d_carrier_doppler_queue_hz[gnss_synchro_iter->second.Channel_ID].end()));
desired_symbol_TOW[0] = symbol_TOW_vec_s[GPS_L1_CA_HISTORY_DEEP - 1] + delta_rx_time_ms / 1000.0; desired_symbol_TOW[0] = symbol_TOW_vec_s[GPS_L1_CA_HISTORY_DEEP - 1] + delta_rx_time_ms / 1000.0;
// arma::interp1(symbol_TOW_vec_s,dopper_vec_hz,desired_symbol_TOW,dopper_vec_interp_hz); // arma::interp1(symbol_TOW_vec_s,dopper_vec_hz,desired_symbol_TOW,dopper_vec_interp_hz);
// arma::interp1(symbol_TOW_vec_s,acc_phase_vec_rads,desired_symbol_TOW,acc_phase_vec_interp_rads); // arma::interp1(symbol_TOW_vec_s,acc_phase_vec_rads,desired_symbol_TOW,acc_phase_vec_interp_rads);
// Curve fitting to cuadratic function // Curve fitting to cuadratic function
arma::mat A = arma::ones<arma::mat> (GPS_L1_CA_HISTORY_DEEP, 2); arma::mat A = arma::ones<arma::mat> (GPS_L1_CA_HISTORY_DEEP, 2);

View File

@@ -29,7 +29,7 @@
#ifndef GNSS_SDR_GPS_L1_CA_OBSERVABLES_CC_H #ifndef GNSS_SDR_GPS_L1_CA_OBSERVABLES_CC_H
#define GNSS_SDR_GPS_L1_CA_OBSERVABLES_CC_H #define GNSS_SDR_GPS_L1_CA_OBSERVABLES_CC_H
#include <deque> #include <deque>
#include <fstream> #include <fstream>

View File

@@ -55,8 +55,8 @@ hybrid_make_observables_cc(unsigned int nchannels, bool dump, std::string dump_f
hybrid_observables_cc::hybrid_observables_cc(unsigned int nchannels, bool dump, std::string dump_filename, int output_rate_ms, bool flag_averaging) : hybrid_observables_cc::hybrid_observables_cc(unsigned int nchannels, bool dump, std::string dump_filename, int output_rate_ms, bool flag_averaging) :
gr::block("hybrid_observables_cc", gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)), gr::block("hybrid_observables_cc", gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)),
gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro))) gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)))
{ {
// initialize internal vars // initialize internal vars
d_dump = dump; d_dump = dump;
@@ -111,7 +111,7 @@ bool Hybrid_pairCompare_gnss_synchro_d_TOW_at_current_symbol(const std::pair<int
int hybrid_observables_cc::general_work (int noutput_items, gr_vector_int &ninput_items, int hybrid_observables_cc::general_work (int noutput_items, gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
{ {
Gnss_Synchro **in = (Gnss_Synchro **) &input_items[0]; // Get the input pointer Gnss_Synchro **in = (Gnss_Synchro **) &input_items[0]; // Get the input pointer
Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0]; // Get the output pointer Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0]; // Get the output pointer

View File

@@ -31,7 +31,7 @@
#ifndef GNSS_SDR_HYBRID_OBSERVABLES_CC_H #ifndef GNSS_SDR_HYBRID_OBSERVABLES_CC_H
#define GNSS_SDR_HYBRID_OBSERVABLES_CC_H #define GNSS_SDR_HYBRID_OBSERVABLES_CC_H
#include <fstream> #include <fstream>
#include <string> #include <string>

View File

@@ -37,7 +37,7 @@
*/ */
#ifndef GNSS_SDR_DIRECT_RESAMPLER_CONDITIONER_CC_H #ifndef GNSS_SDR_DIRECT_RESAMPLER_CONDITIONER_CC_H
#define GNSS_SDR_DIRECT_RESAMPLER_CONDITIONER_CC_H #define GNSS_SDR_DIRECT_RESAMPLER_CONDITIONER_CC_H
#include <gnuradio/block.h> #include <gnuradio/block.h>
#include <volk/volk.h> #include <volk/volk.h>

View File

@@ -30,7 +30,7 @@
*/ */
#ifndef GNSS_SDR_DIRECT_RESAMPLER_CONDITIONER_CS_H #ifndef GNSS_SDR_DIRECT_RESAMPLER_CONDITIONER_CS_H
#define GNSS_SDR_DIRECT_RESAMPLER_CONDITIONER_CS_H #define GNSS_SDR_DIRECT_RESAMPLER_CONDITIONER_CS_H
#include <gnuradio/block.h> #include <gnuradio/block.h>
#include <volk/volk.h> #include <volk/volk.h>

View File

@@ -41,9 +41,9 @@
using google::LogMessage; using google::LogMessage;
SignalGenerator::SignalGenerator(ConfigurationInterface* configuration, SignalGenerator::SignalGenerator(ConfigurationInterface* configuration,
std::string role, unsigned int in_stream, std::string role, unsigned int in_stream,
unsigned int out_stream, boost::shared_ptr<gr::msg_queue> queue) : unsigned int out_stream, boost::shared_ptr<gr::msg_queue> queue) :
role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue) role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue)
{ {
std::string default_item_type = "gr_complex"; std::string default_item_type = "gr_complex";
std::string default_dump_file = "./data/gen_source.dat"; std::string default_dump_file = "./data/gen_source.dat";
@@ -84,31 +84,31 @@ SignalGenerator::SignalGenerator(ConfigurationInterface* configuration,
// If there is only GPS signal (Galileo signal not present) -> vector duration = 1 ms // If there is only GPS signal (Galileo signal not present) -> vector duration = 1 ms
unsigned int vector_length = 0; unsigned int vector_length = 0;
if (std::find(system.begin(), system.end(), "E") != system.end()) if (std::find(system.begin(), system.end(), "E") != system.end())
{ {
if (signal1[0].at(0)=='5') if (signal1[0].at(0)=='5')
{ {
vector_length = round((float) fs_in / (Galileo_E5a_CODE_CHIP_RATE_HZ vector_length = round((float) fs_in / (Galileo_E5a_CODE_CHIP_RATE_HZ
/ Galileo_E5a_CODE_LENGTH_CHIPS)); / Galileo_E5a_CODE_LENGTH_CHIPS));
} }
else else
{ {
vector_length = round((float)fs_in / (Galileo_E1_CODE_CHIP_RATE_HZ vector_length = round((float)fs_in / (Galileo_E1_CODE_CHIP_RATE_HZ
/ Galileo_E1_B_CODE_LENGTH_CHIPS)) / Galileo_E1_B_CODE_LENGTH_CHIPS))
* Galileo_E1_C_SECONDARY_CODE_LENGTH; * Galileo_E1_C_SECONDARY_CODE_LENGTH;
} }
} }
else if (std::find(system.begin(), system.end(), "G") != system.end()) else if (std::find(system.begin(), system.end(), "G") != system.end())
{ {
vector_length = round((float)fs_in vector_length = round((float)fs_in
/ (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS));
} }
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
item_size_ = sizeof(gr_complex); item_size_ = sizeof(gr_complex);
DLOG(INFO) << "Item size " << item_size_; DLOG(INFO) << "Item size " << item_size_;
gen_source_ = signal_make_generator_c(signal1, system, PRN, CN0_dB, doppler_Hz, delay_chips, delay_sec, gen_source_ = signal_make_generator_c(signal1, system, PRN, CN0_dB, doppler_Hz, delay_chips, delay_sec,
data_flag, noise_flag, fs_in, vector_length, BW_BB); data_flag, noise_flag, fs_in, vector_length, BW_BB);
vector_to_stream_ = gr::blocks::vector_to_stream::make(item_size_, vector_length); vector_to_stream_ = gr::blocks::vector_to_stream::make(item_size_, vector_length);
@@ -146,10 +146,10 @@ void SignalGenerator::connect(gr::top_block_sptr top_block)
DLOG(INFO) << "connected gen_source to vector_to_stream"; DLOG(INFO) << "connected gen_source to vector_to_stream";
if (dump_) if (dump_)
{ {
top_block->connect(vector_to_stream_, 0, file_sink_, 0); top_block->connect(vector_to_stream_, 0, file_sink_, 0);
DLOG(INFO) << "connected vector_to_stream_ to file sink"; DLOG(INFO) << "connected vector_to_stream_ to file sink";
} }
} }
} }
@@ -161,9 +161,9 @@ void SignalGenerator::disconnect(gr::top_block_sptr top_block)
{ {
top_block->disconnect(gen_source_, 0, vector_to_stream_, 0); top_block->disconnect(gen_source_, 0, vector_to_stream_, 0);
if (dump_) if (dump_)
{ {
top_block->disconnect(vector_to_stream_, 0, file_sink_, 0); top_block->disconnect(vector_to_stream_, 0, file_sink_, 0);
} }
} }
} }

View File

@@ -63,8 +63,7 @@ signal_generator_c::signal_generator_c (std::vector<std::string> signal1, std::v
const std::vector<float> &CN0_dB, const std::vector<float> &doppler_Hz, const std::vector<float> &CN0_dB, const std::vector<float> &doppler_Hz,
const std::vector<unsigned int> &delay_chips,const std::vector<unsigned int> &delay_sec ,bool data_flag, bool noise_flag, const std::vector<unsigned int> &delay_chips,const std::vector<unsigned int> &delay_sec ,bool data_flag, bool noise_flag,
unsigned int fs_in, unsigned int vector_length, float BW_BB) : unsigned int fs_in, unsigned int vector_length, float BW_BB) :
gr::block ("signal_gen_cc", gr::io_signature::make(0, 0, sizeof(gr_complex)),
gr::block ("signal_gen_cc", gr::io_signature::make(0, 0, sizeof(gr_complex)),
gr::io_signature::make(1, 1, sizeof(gr_complex) * vector_length)), gr::io_signature::make(1, 1, sizeof(gr_complex) * vector_length)),
signal_(signal1), signal_(signal1),
system_(system), system_(system),
@@ -112,23 +111,23 @@ void signal_generator_c::init()
} }
else if (system_[sat] == "E") else if (system_[sat] == "E")
{ {
if (signal_[sat].at(0) == '5') if (signal_[sat].at(0) == '5')
{ {
int codelen = static_cast<int>(Galileo_E5a_CODE_LENGTH_CHIPS); int codelen = static_cast<int>(Galileo_E5a_CODE_LENGTH_CHIPS);
samples_per_code_.push_back(round(static_cast<float>(fs_in_) / (Galileo_E5a_CODE_CHIP_RATE_HZ samples_per_code_.push_back(round(static_cast<float>(fs_in_) / (Galileo_E5a_CODE_CHIP_RATE_HZ
/ codelen))); / codelen)));
num_of_codes_per_vector_.push_back(1); num_of_codes_per_vector_.push_back(1);
data_bit_duration_ms_.push_back(1e3/Galileo_E5a_SYMBOL_RATE_BPS); data_bit_duration_ms_.push_back(1e3/Galileo_E5a_SYMBOL_RATE_BPS);
} }
else else
{ {
samples_per_code_.push_back(round(static_cast<float>(fs_in_) / (Galileo_E1_CODE_CHIP_RATE_HZ samples_per_code_.push_back(round(static_cast<float>(fs_in_) / (Galileo_E1_CODE_CHIP_RATE_HZ
/ Galileo_E1_B_CODE_LENGTH_CHIPS))); / Galileo_E1_B_CODE_LENGTH_CHIPS)));
num_of_codes_per_vector_.push_back(static_cast<int>(Galileo_E1_C_SECONDARY_CODE_LENGTH)); num_of_codes_per_vector_.push_back(static_cast<int>(Galileo_E1_C_SECONDARY_CODE_LENGTH));
data_bit_duration_ms_.push_back(1e3 / Galileo_E1_B_SYMBOL_RATE_BPS); data_bit_duration_ms_.push_back(1e3 / Galileo_E1_B_SYMBOL_RATE_BPS);
} }
} }
} }
random_ = new gr::random(); random_ = new gr::random();
@@ -150,7 +149,7 @@ void signal_generator_c::generate_codes()
{ {
// Generate one code-period of 1C signal // Generate one code-period of 1C signal
gps_l1_ca_code_gen_complex_sampled(code, PRN_[sat], fs_in_, gps_l1_ca_code_gen_complex_sampled(code, PRN_[sat], fs_in_,
static_cast<int>(GPS_L1_CA_CODE_LENGTH_CHIPS) - delay_chips_[sat]); static_cast<int>(GPS_L1_CA_CODE_LENGTH_CHIPS) - delay_chips_[sat]);
// Obtain the desired CN0 assuming that Pn = 1. // Obtain the desired CN0 assuming that Pn = 1.
if (noise_flag_) if (noise_flag_)
@@ -165,70 +164,70 @@ void signal_generator_c::generate_codes()
for (unsigned int i = 0; i < num_of_codes_per_vector_[sat]; i++) for (unsigned int i = 0; i < num_of_codes_per_vector_[sat]; i++)
{ {
memcpy(&(sampled_code_data_[sat][i * samples_per_code_[sat]]), memcpy(&(sampled_code_data_[sat][i * samples_per_code_[sat]]),
code, sizeof(gr_complex) * samples_per_code_[sat]); code, sizeof(gr_complex) * samples_per_code_[sat]);
} }
} }
else if (system_[sat] == "E") else if (system_[sat] == "E")
{ {
if(signal_[sat].at(0) == '5') if(signal_[sat].at(0) == '5')
{ {
char signal[3]; char signal[3];
strcpy(signal, "5X"); strcpy(signal, "5X");
galileo_e5_a_code_gen_complex_sampled(sampled_code_data_[sat] , signal, PRN_[sat], fs_in_, galileo_e5_a_code_gen_complex_sampled(sampled_code_data_[sat] , signal, PRN_[sat], fs_in_,
static_cast<int>(Galileo_E5a_CODE_LENGTH_CHIPS) - delay_chips_[sat]); static_cast<int>(Galileo_E5a_CODE_LENGTH_CHIPS) - delay_chips_[sat]);
//noise //noise
if (noise_flag_) if (noise_flag_)
{ {
for (unsigned int i = 0; i < vector_length_; i++) for (unsigned int i = 0; i < vector_length_; i++)
{ {
sampled_code_data_[sat][i] *= sqrt(pow(10, CN0_dB_[sat] / 10) / BW_BB_ / 2); sampled_code_data_[sat][i] *= sqrt(pow(10, CN0_dB_[sat] / 10) / BW_BB_ / 2);
} }
} }
} }
else else
{ {
// Generate one code-period of E1B signal // Generate one code-period of E1B signal
bool cboc = true; bool cboc = true;
char signal[3]; char signal[3];
strcpy(signal, "1B"); strcpy(signal, "1B");
galileo_e1_code_gen_complex_sampled(code, signal, cboc, PRN_[sat], fs_in_, galileo_e1_code_gen_complex_sampled(code, signal, cboc, PRN_[sat], fs_in_,
static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS) - delay_chips_[sat]); static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS) - delay_chips_[sat]);
// Obtain the desired CN0 assuming that Pn = 1. // Obtain the desired CN0 assuming that Pn = 1.
if (noise_flag_) if (noise_flag_)
{ {
for (unsigned int i = 0; i < samples_per_code_[sat]; i++) for (unsigned int i = 0; i < samples_per_code_[sat]; i++)
{ {
code[i] *= sqrt(pow(10, CN0_dB_[sat] / 10) / BW_BB_ / 2); code[i] *= sqrt(pow(10, CN0_dB_[sat] / 10) / BW_BB_ / 2);
} }
} }
// Concatenate "num_of_codes_per_vector_" codes // Concatenate "num_of_codes_per_vector_" codes
for (unsigned int i = 0; i < num_of_codes_per_vector_[sat]; i++) for (unsigned int i = 0; i < num_of_codes_per_vector_[sat]; i++)
{ {
memcpy(&(sampled_code_data_[sat][i * samples_per_code_[sat]]), memcpy(&(sampled_code_data_[sat][i * samples_per_code_[sat]]),
code, sizeof(gr_complex) * samples_per_code_[sat]); code, sizeof(gr_complex) * samples_per_code_[sat]);
} }
// Generate E1C signal (25 code-periods, with secondary code) // Generate E1C signal (25 code-periods, with secondary code)
sampled_code_pilot_[sat] = static_cast<gr_complex*>(std::malloc(vector_length_ * sizeof(gr_complex))); sampled_code_pilot_[sat] = static_cast<gr_complex*>(std::malloc(vector_length_ * sizeof(gr_complex)));
strcpy(signal, "1C"); strcpy(signal, "1C");
galileo_e1_code_gen_complex_sampled(sampled_code_pilot_[sat], signal, cboc, PRN_[sat], fs_in_, galileo_e1_code_gen_complex_sampled(sampled_code_pilot_[sat], signal, cboc, PRN_[sat], fs_in_,
static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS) - delay_chips_[sat], true); static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS) - delay_chips_[sat], true);
// Obtain the desired CN0 assuming that Pn = 1. // Obtain the desired CN0 assuming that Pn = 1.
if (noise_flag_) if (noise_flag_)
{ {
for (unsigned int i = 0; i < vector_length_; i++) for (unsigned int i = 0; i < vector_length_; i++)
{ {
sampled_code_pilot_[sat][i] *= sqrt(pow(10, CN0_dB_[sat] / 10) / BW_BB_ / 2); sampled_code_pilot_[sat][i] *= sqrt(pow(10, CN0_dB_[sat] / 10) / BW_BB_ / 2);
} }
} }
} }
} }
} }
} }
@@ -237,7 +236,7 @@ void signal_generator_c::generate_codes()
signal_generator_c::~signal_generator_c() signal_generator_c::~signal_generator_c()
{ {
/* for (unsigned int sat = 0; sat < num_sats_; sat++) /* for (unsigned int sat = 0; sat < num_sats_; sat++)
{ {
std::free(sampled_code_data_[sat]); std::free(sampled_code_data_[sat]);
if (system_[sat] == "E" && signal_[sat].at(0) != '5') if (system_[sat] == "E" && signal_[sat].at(0) != '5')
@@ -251,9 +250,9 @@ signal_generator_c::~signal_generator_c()
int signal_generator_c::general_work (int noutput_items __attribute__((unused)), int signal_generator_c::general_work (int noutput_items __attribute__((unused)),
gr_vector_int &ninput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)),
gr_vector_const_void_star &input_items __attribute__((unused)), gr_vector_const_void_star &input_items __attribute__((unused)),
gr_vector_void_star &output_items) gr_vector_void_star &output_items)
{ {
gr_complex *out = (gr_complex *) output_items[0]; gr_complex *out = (gr_complex *) output_items[0];
@@ -281,102 +280,102 @@ gr_vector_void_star &output_items)
if (system_[sat] == "G") if (system_[sat] == "G")
{ {
unsigned int delay_samples = (delay_chips_[sat] % static_cast<int>(GPS_L1_CA_CODE_LENGTH_CHIPS)) unsigned int delay_samples = (delay_chips_[sat] % static_cast<int>(GPS_L1_CA_CODE_LENGTH_CHIPS))
* samples_per_code_[sat] / GPS_L1_CA_CODE_LENGTH_CHIPS; * samples_per_code_[sat] / GPS_L1_CA_CODE_LENGTH_CHIPS;
for (i = 0; i < num_of_codes_per_vector_[sat]; i++) for (i = 0; i < num_of_codes_per_vector_[sat]; i++)
{ {
for (k = 0; k < delay_samples; k++) for (k = 0; k < delay_samples; k++)
{ {
out[out_idx] += sampled_code_data_[sat][out_idx] out[out_idx] += sampled_code_data_[sat][out_idx]
* current_data_bits_[sat] * current_data_bits_[sat]
* complex_phase_[out_idx]; * complex_phase_[out_idx];
out_idx++; out_idx++;
} }
if (ms_counter_[sat] == 0 && data_flag_) if (ms_counter_[sat] == 0 && data_flag_)
{ {
// New random data bit // New random data bit
current_data_bits_[sat] = gr_complex((rand() % 2) == 0 ? 1 : -1, 0); current_data_bits_[sat] = gr_complex((rand() % 2) == 0 ? 1 : -1, 0);
} }
for (k = delay_samples; k < samples_per_code_[sat]; k++) for (k = delay_samples; k < samples_per_code_[sat]; k++)
{ {
out[out_idx] += sampled_code_data_[sat][out_idx] out[out_idx] += sampled_code_data_[sat][out_idx]
* current_data_bits_[sat] * current_data_bits_[sat]
* complex_phase_[out_idx]; * complex_phase_[out_idx];
out_idx++; out_idx++;
} }
ms_counter_[sat] = (ms_counter_[sat] + static_cast<int>(round(1e3*GPS_L1_CA_CODE_PERIOD))) ms_counter_[sat] = (ms_counter_[sat] + static_cast<int>(round(1e3*GPS_L1_CA_CODE_PERIOD)))
% data_bit_duration_ms_[sat]; % data_bit_duration_ms_[sat];
} }
} }
else if (system_[sat] == "E") else if (system_[sat] == "E")
{ {
if(signal_[sat].at(0)=='5') if(signal_[sat].at(0)=='5')
{ {
// EACH WORK outputs 1 modulated primary code // EACH WORK outputs 1 modulated primary code
int codelen = static_cast<int>(Galileo_E5a_CODE_LENGTH_CHIPS); int codelen = static_cast<int>(Galileo_E5a_CODE_LENGTH_CHIPS);
unsigned int delay_samples = (delay_chips_[sat] % codelen) unsigned int delay_samples = (delay_chips_[sat] % codelen)
* samples_per_code_[sat] / codelen; * samples_per_code_[sat] / codelen;
for (k = 0; k < delay_samples; k++) for (k = 0; k < delay_samples; k++)
{ {
out[out_idx] += (gr_complex(sampled_code_data_[sat][out_idx].real()*data_modulation_[sat], out[out_idx] += (gr_complex(sampled_code_data_[sat][out_idx].real()*data_modulation_[sat],
sampled_code_data_[sat][out_idx].imag()*pilot_modulation_[sat]) ) sampled_code_data_[sat][out_idx].imag()*pilot_modulation_[sat]) )
* complex_phase_[out_idx]; * complex_phase_[out_idx];
out_idx++; out_idx++;
} }
if (ms_counter_[sat]%data_bit_duration_ms_[sat] == 0 && data_flag_) if (ms_counter_[sat]%data_bit_duration_ms_[sat] == 0 && data_flag_)
{ {
// New random data bit // New random data bit
current_data_bit_int_[sat] = (rand()%2) == 0 ? 1 : -1; current_data_bit_int_[sat] = (rand()%2) == 0 ? 1 : -1;
} }
data_modulation_[sat] = current_data_bit_int_[sat] * (Galileo_E5a_I_SECONDARY_CODE.at((ms_counter_[sat]+delay_sec_[sat]) % 20) == '0' ? 1 : -1); data_modulation_[sat] = current_data_bit_int_[sat] * (Galileo_E5a_I_SECONDARY_CODE.at((ms_counter_[sat]+delay_sec_[sat]) % 20) == '0' ? 1 : -1);
pilot_modulation_[sat] = (Galileo_E5a_Q_SECONDARY_CODE[PRN_[sat] - 1].at((ms_counter_[sat] + delay_sec_[sat]) % 100) == '0' ? 1 : -1); pilot_modulation_[sat] = (Galileo_E5a_Q_SECONDARY_CODE[PRN_[sat] - 1].at((ms_counter_[sat] + delay_sec_[sat]) % 100) == '0' ? 1 : -1);
ms_counter_[sat] = ms_counter_[sat] + static_cast<int>(round(1e3*GALILEO_E5a_CODE_PERIOD)); ms_counter_[sat] = ms_counter_[sat] + static_cast<int>(round(1e3*GALILEO_E5a_CODE_PERIOD));
for (k = delay_samples; k < samples_per_code_[sat]; k++) for (k = delay_samples; k < samples_per_code_[sat]; k++)
{ {
out[out_idx] += (gr_complex(sampled_code_data_[sat][out_idx].real() * data_modulation_[sat] , out[out_idx] += (gr_complex(sampled_code_data_[sat][out_idx].real() * data_modulation_[sat] ,
sampled_code_data_[sat][out_idx].imag() * pilot_modulation_[sat]) ) sampled_code_data_[sat][out_idx].imag() * pilot_modulation_[sat]) )
* complex_phase_[out_idx]; * complex_phase_[out_idx];
out_idx++; out_idx++;
} }
} }
else else
{ {
unsigned int delay_samples = (delay_chips_[sat] % static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS)) unsigned int delay_samples = (delay_chips_[sat] % static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS))
* samples_per_code_[sat] / Galileo_E1_B_CODE_LENGTH_CHIPS; * samples_per_code_[sat] / Galileo_E1_B_CODE_LENGTH_CHIPS;
for (i = 0; i < num_of_codes_per_vector_[sat]; i++) for (i = 0; i < num_of_codes_per_vector_[sat]; i++)
{ {
for (k = 0; k < delay_samples; k++) for (k = 0; k < delay_samples; k++)
{ {
out[out_idx] += (sampled_code_data_[sat][out_idx] * current_data_bits_[sat] out[out_idx] += (sampled_code_data_[sat][out_idx] * current_data_bits_[sat]
- sampled_code_pilot_[sat][out_idx]) * complex_phase_[out_idx]; - sampled_code_pilot_[sat][out_idx]) * complex_phase_[out_idx];
out_idx++; out_idx++;
} }
if (ms_counter_[sat] == 0 && data_flag_) if (ms_counter_[sat] == 0 && data_flag_)
{ {
// New random data bit // New random data bit
current_data_bits_[sat] = gr_complex((rand() % 2) == 0 ? 1 : -1, 0); current_data_bits_[sat] = gr_complex((rand() % 2) == 0 ? 1 : -1, 0);
} }
for (k = delay_samples; k < samples_per_code_[sat]; k++) for (k = delay_samples; k < samples_per_code_[sat]; k++)
{ {
out[out_idx] += (sampled_code_data_[sat][out_idx] * current_data_bits_[sat] out[out_idx] += (sampled_code_data_[sat][out_idx] * current_data_bits_[sat]
- sampled_code_pilot_[sat][out_idx]) - sampled_code_pilot_[sat][out_idx])
* complex_phase_[out_idx]; * complex_phase_[out_idx];
out_idx++; out_idx++;
} }
ms_counter_[sat] = (ms_counter_[sat] + static_cast<int>(round(1e3 * Galileo_E1_CODE_PERIOD))) % data_bit_duration_ms_[sat]; ms_counter_[sat] = (ms_counter_[sat] + static_cast<int>(round(1e3 * Galileo_E1_CODE_PERIOD))) % data_bit_duration_ms_[sat];
} }
} }
} }
} }

View File

@@ -124,7 +124,7 @@ private:
unsigned int work_counter_; unsigned int work_counter_;
public: public:
~signal_generator_c (); // public destructor ~signal_generator_c(); // public destructor
// Where all the action really happens // Where all the action really happens

View File

@@ -46,13 +46,13 @@ using google::LogMessage;
DEFINE_string(signal_source, "-", DEFINE_string(signal_source, "-",
"If defined, path to the file containing the signal samples (overrides the configuration file)"); "If defined, path to the file containing the signal samples (overrides the configuration file)");
FileSignalSource::FileSignalSource(ConfigurationInterface* configuration, FileSignalSource::FileSignalSource(ConfigurationInterface* configuration,
std::string role, unsigned int in_streams, unsigned int out_streams, std::string role, unsigned int in_streams, unsigned int out_streams,
boost::shared_ptr<gr::msg_queue> queue) : boost::shared_ptr<gr::msg_queue> queue) :
role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue) role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue)
{ {
std::string default_filename = "./example_capture.dat"; std::string default_filename = "./example_capture.dat";
std::string default_item_type = "short"; std::string default_item_type = "short";
@@ -99,11 +99,11 @@ FileSignalSource::FileSignalSource(ConfigurationInterface* configuration,
} }
else if (item_type_.compare("byte") == 0) else if (item_type_.compare("byte") == 0)
{ {
item_size_ = sizeof(int8_t); item_size_ = sizeof(int8_t);
} }
else if (item_type_.compare("ibyte") == 0) else if (item_type_.compare("ibyte") == 0)
{ {
item_size_ = sizeof(int8_t); item_size_ = sizeof(int8_t);
is_complex = true; is_complex = true;
} }
else else

View File

@@ -47,7 +47,7 @@ class ConfigurationInterface;
class Gn3sSignalSource: public GNSSBlockInterface class Gn3sSignalSource: public GNSSBlockInterface
{ {
public: public:
Gn3sSignalSource(ConfigurationInterface* configuration, Gn3sSignalSource(ConfigurationInterface* configuration,
std::string role, unsigned int in_stream, std::string role, unsigned int in_stream,
unsigned int out_stream, gr::msg_queue::sptr queue); unsigned int out_stream, gr::msg_queue::sptr queue);

View File

@@ -45,13 +45,13 @@
using google::LogMessage; using google::LogMessage;
DEFINE_string(nsr_signal_source, "-", DEFINE_string(nsr_signal_source, "-",
"If defined, path to the file containing the NSR (byte to 2-bit packed) signal samples (overrides the configuration file)"); "If defined, path to the file containing the NSR (byte to 2-bit packed) signal samples (overrides the configuration file)");
NsrFileSignalSource::NsrFileSignalSource(ConfigurationInterface* configuration, NsrFileSignalSource::NsrFileSignalSource(ConfigurationInterface* configuration,
std::string role, unsigned int in_streams, unsigned int out_streams, std::string role, unsigned int in_streams, unsigned int out_streams,
boost::shared_ptr<gr::msg_queue> queue) : boost::shared_ptr<gr::msg_queue> queue) :
role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue) role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue)
{ {
std::string default_filename = "../data/my_capture.dat"; std::string default_filename = "../data/my_capture.dat";
std::string default_item_type = "byte"; std::string default_item_type = "byte";

View File

@@ -50,7 +50,7 @@ class ConfigurationInterface;
class OsmosdrSignalSource: public GNSSBlockInterface class OsmosdrSignalSource: public GNSSBlockInterface
{ {
public: public:
OsmosdrSignalSource(ConfigurationInterface* configuration, OsmosdrSignalSource(ConfigurationInterface* configuration,
std::string role, unsigned int in_stream, std::string role, unsigned int in_stream,
unsigned int out_stream, boost::shared_ptr<gr::msg_queue> queue); unsigned int out_stream, boost::shared_ptr<gr::msg_queue> queue);

View File

@@ -50,7 +50,7 @@ RawArraySignalSource::RawArraySignalSource(ConfigurationInterface* configuration
//dump_ = configuration->property(role + ".dump", false); //dump_ = configuration->property(role + ".dump", false);
//dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file); //dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file);
dump_=false; dump_ = false;
std::string default_ethernet_dev = "eth0"; std::string default_ethernet_dev = "eth0";
eth_device_ = configuration->property(role + ".ethernet_dev", default_ethernet_dev); eth_device_ = configuration->property(role + ".ethernet_dev", default_ethernet_dev);
@@ -88,7 +88,7 @@ RawArraySignalSource::RawArraySignalSource(ConfigurationInterface* configuration
} }
if (dump_) if (dump_)
{ {
//TODO: multichannel recorder //TODO: multichannel recorder
DLOG(INFO) << "Dumping output into file " << dump_filename_; DLOG(INFO) << "Dumping output into file " << dump_filename_;
file_sink_ = gr::blocks::file_sink::make(item_size_, dump_filename_.c_str()); file_sink_ = gr::blocks::file_sink::make(item_size_, dump_filename_.c_str());
} }
@@ -109,7 +109,7 @@ void RawArraySignalSource::connect(gr::top_block_sptr top_block)
{ {
if (dump_) if (dump_)
{ {
//TODO: multichannel recorder //TODO: multichannel recorder
top_block->connect(raw_array_source_, 0, file_sink_, 0); top_block->connect(raw_array_source_, 0, file_sink_, 0);
DLOG(INFO) << "connected raw_array_source_ to file sink"; DLOG(INFO) << "connected raw_array_source_ to file sink";
} }
@@ -125,7 +125,7 @@ void RawArraySignalSource::disconnect(gr::top_block_sptr top_block)
{ {
if (dump_) if (dump_)
{ {
//TODO: multichannel recorder //TODO: multichannel recorder
top_block->disconnect(raw_array_source_, 0, file_sink_, 0); top_block->disconnect(raw_array_source_, 0, file_sink_, 0);
} }
} }

View File

@@ -47,7 +47,7 @@ class ConfigurationInterface;
class RawArraySignalSource: public GNSSBlockInterface class RawArraySignalSource: public GNSSBlockInterface
{ {
public: public:
RawArraySignalSource(ConfigurationInterface* configuration, RawArraySignalSource(ConfigurationInterface* configuration,
std::string role, unsigned int in_stream, std::string role, unsigned int in_stream,
unsigned int out_stream, gr::msg_queue::sptr queue); unsigned int out_stream, gr::msg_queue::sptr queue);

View File

@@ -80,13 +80,13 @@ RtlTcpSignalSource::RtlTcpSignalSource(ConfigurationInterface* configuration,
// 1. Make the gr block // 1. Make the gr block
try try
{ {
std::cout << "Connecting to " << address_ << ":" << port_ << std::endl; std::cout << "Connecting to " << address_ << ":" << port_ << std::endl;
LOG (INFO) << "Connecting to " << address_ << ":" << port_; LOG (INFO) << "Connecting to " << address_ << ":" << port_;
signal_source_ = rtl_tcp_make_signal_source_c (address_, port_, flip_iq_); signal_source_ = rtl_tcp_make_signal_source_c (address_, port_, flip_iq_);
} }
catch( boost::exception & e ) catch( boost::exception & e )
{ {
DLOG(FATAL) << "Boost exception: " << boost::diagnostic_information(e); DLOG(FATAL) << "Boost exception: " << boost::diagnostic_information(e);
} }
// 2 set sampling rate // 2 set sampling rate
@@ -99,25 +99,25 @@ RtlTcpSignalSource::RtlTcpSignalSource(ConfigurationInterface* configuration,
signal_source_->set_agc_mode(true); signal_source_->set_agc_mode(true);
if (this->AGC_enabled_ == true) if (this->AGC_enabled_ == true)
{ {
std::cout << "AGC enabled" << std::endl; std::cout << "AGC enabled" << std::endl;
LOG(INFO) << "AGC enabled"; LOG(INFO) << "AGC enabled";
signal_source_->set_agc_mode(true); signal_source_->set_agc_mode(true);
} }
else else
{ {
std::cout << "AGC disabled" << std::endl; std::cout << "AGC disabled" << std::endl;
LOG(INFO) << "AGC disabled"; LOG(INFO) << "AGC disabled";
signal_source_->set_agc_mode(false); signal_source_->set_agc_mode(false);
std::cout << "Setting gain to " << gain_ << std::endl; std::cout << "Setting gain to " << gain_ << std::endl;
LOG(INFO) << "Setting gain to " << gain_; LOG(INFO) << "Setting gain to " << gain_;
signal_source_->set_gain(gain_); signal_source_->set_gain(gain_);
std::cout << "Setting IF gain to " << if_gain_ << std::endl; std::cout << "Setting IF gain to " << if_gain_ << std::endl;
LOG(INFO) << "Setting IF gain to " << if_gain_; LOG(INFO) << "Setting IF gain to " << if_gain_;
signal_source_->set_if_gain(if_gain_); signal_source_->set_if_gain(if_gain_);
} }
} }
else else
{ {
@@ -145,43 +145,58 @@ RtlTcpSignalSource::~RtlTcpSignalSource()
{} {}
void RtlTcpSignalSource::connect(gr::top_block_sptr top_block) { void RtlTcpSignalSource::connect(gr::top_block_sptr top_block)
if ( samples_ ) { {
top_block->connect (signal_source_, 0, valve_, 0); if ( samples_ )
DLOG(INFO) << "connected rtl tcp source to valve"; {
if ( dump_ ) { top_block->connect (signal_source_, 0, valve_, 0);
top_block->connect(valve_, 0, file_sink_, 0); DLOG(INFO) << "connected rtl tcp source to valve";
DLOG(INFO) << "connected valve to file sink"; if ( dump_ )
} {
} top_block->connect(valve_, 0, file_sink_, 0);
else if ( dump_ ) { DLOG(INFO) << "connected valve to file sink";
top_block->connect(signal_source_, 0, file_sink_, 0); }
DLOG(INFO) << "connected rtl tcp source to file sink"; }
} else if ( dump_ )
{
top_block->connect(signal_source_, 0, file_sink_, 0);
DLOG(INFO) << "connected rtl tcp source to file sink";
}
} }
void RtlTcpSignalSource::disconnect(gr::top_block_sptr top_block) {
if ( samples_ ) { void RtlTcpSignalSource::disconnect(gr::top_block_sptr top_block)
top_block->disconnect (signal_source_, 0, valve_, 0); {
if ( dump_ ) { if ( samples_ )
top_block->disconnect(valve_, 0, file_sink_, 0); {
} top_block->disconnect (signal_source_, 0, valve_, 0);
} if ( dump_ )
else if ( dump_ ) { {
top_block->disconnect(signal_source_, 0, file_sink_, 0); top_block->disconnect(valve_, 0, file_sink_, 0);
} }
}
else if ( dump_ )
{
top_block->disconnect(signal_source_, 0, file_sink_, 0);
}
} }
gr::basic_block_sptr RtlTcpSignalSource::get_left_block() {
gr::basic_block_sptr RtlTcpSignalSource::get_left_block()
{
LOG(WARNING) << "Trying to get signal source left block."; LOG(WARNING) << "Trying to get signal source left block.";
return gr::basic_block_sptr(); return gr::basic_block_sptr();
} }
gr::basic_block_sptr RtlTcpSignalSource::get_right_block() {
if (samples_ != 0) { gr::basic_block_sptr RtlTcpSignalSource::get_right_block()
return valve_; {
} if (samples_ != 0)
else { {
return signal_source_; return valve_;
} }
else
{
return signal_source_;
}
} }

View File

@@ -51,7 +51,7 @@ class ConfigurationInterface;
class RtlTcpSignalSource: public GNSSBlockInterface class RtlTcpSignalSource: public GNSSBlockInterface
{ {
public: public:
RtlTcpSignalSource(ConfigurationInterface* configuration, RtlTcpSignalSource(ConfigurationInterface* configuration,
std::string role, unsigned int in_stream, std::string role, unsigned int in_stream,
unsigned int out_stream, boost::shared_ptr<gr::msg_queue> queue); unsigned int out_stream, boost::shared_ptr<gr::msg_queue> queue);

View File

@@ -50,7 +50,7 @@ DEFINE_string(spir_signal_source, "-",
SpirFileSignalSource::SpirFileSignalSource(ConfigurationInterface* configuration, SpirFileSignalSource::SpirFileSignalSource(ConfigurationInterface* configuration,
std::string role, unsigned int in_streams, unsigned int out_streams, std::string role, unsigned int in_streams, unsigned int out_streams,
boost::shared_ptr<gr::msg_queue> queue) : boost::shared_ptr<gr::msg_queue> queue) :
role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue) role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue)
{ {
std::string default_filename = "../data/my_capture.dat"; std::string default_filename = "../data/my_capture.dat";
std::string default_item_type = "int"; std::string default_item_type = "int";

View File

@@ -44,13 +44,13 @@
using google::LogMessage; using google::LogMessage;
//DEFINE_string(two_bit_cpx_signal_source, "-", //DEFINE_string(two_bit_cpx_signal_source, "-",
// "If defined, path to the file containing the NSR (byte to 2-bit packed) signal samples (overrides the configuration file)"); // "If defined, path to the file containing the NSR (byte to 2-bit packed) signal samples (overrides the configuration file)");
TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(ConfigurationInterface* configuration, TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(ConfigurationInterface* configuration,
std::string role, unsigned int in_streams, unsigned int out_streams, std::string role, unsigned int in_streams, unsigned int out_streams,
boost::shared_ptr<gr::msg_queue> queue) : boost::shared_ptr<gr::msg_queue> queue) :
role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue) role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue)
{ {
std::string default_filename = "../data/my_capture.dat"; std::string default_filename = "../data/my_capture.dat";
std::string default_item_type = "byte"; std::string default_item_type = "byte";
@@ -104,7 +104,7 @@ TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(ConfigurationInterface* con
<< std::endl; << std::endl;
LOG(WARNING) << "file_signal_source: Unable to open the samples file " LOG(WARNING) << "file_signal_source: Unable to open the samples file "
<< filename_.c_str() << ", exiting the program."; << filename_.c_str() << ", exiting the program.";
throw(e); throw(e);
} }
@@ -172,14 +172,10 @@ TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(ConfigurationInterface* con
} }
TwoBitCpxFileSignalSource::~TwoBitCpxFileSignalSource() TwoBitCpxFileSignalSource::~TwoBitCpxFileSignalSource()
{} {}
void TwoBitCpxFileSignalSource::connect(gr::top_block_sptr top_block) void TwoBitCpxFileSignalSource::connect(gr::top_block_sptr top_block)
{ {
if (samples_ > 0) if (samples_ > 0)
@@ -302,9 +298,6 @@ void TwoBitCpxFileSignalSource::disconnect(gr::top_block_sptr top_block)
} }
gr::basic_block_sptr TwoBitCpxFileSignalSource::get_left_block() gr::basic_block_sptr TwoBitCpxFileSignalSource::get_left_block()
{ {
LOG(WARNING) << "Left block of a signal source should not be retrieved"; LOG(WARNING) << "Left block of a signal source should not be retrieved";
@@ -313,9 +306,6 @@ gr::basic_block_sptr TwoBitCpxFileSignalSource::get_left_block()
} }
gr::basic_block_sptr TwoBitCpxFileSignalSource::get_right_block() gr::basic_block_sptr TwoBitCpxFileSignalSource::get_right_block()
{ {
if (samples_ > 0) if (samples_ > 0)

View File

@@ -46,13 +46,13 @@
using google::LogMessage; using google::LogMessage;
//DEFINE_string(two_bit_packed_signal_source, "-", //DEFINE_string(two_bit_packed_signal_source, "-",
// "If defined, path to the file containing the NSR (byte to 2-bit packed) signal samples (overrides the configuration file)"); // "If defined, path to the file containing the NSR (byte to 2-bit packed) signal samples (overrides the configuration file)");
TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterface* configuration, TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterface* configuration,
std::string role, unsigned int in_streams, unsigned int out_streams, std::string role, unsigned int in_streams, unsigned int out_streams,
boost::shared_ptr<gr::msg_queue> queue) : boost::shared_ptr<gr::msg_queue> queue) :
role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue) role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue)
{ {
std::string default_filename = "../data/my_capture.dat"; std::string default_filename = "../data/my_capture.dat";
std::string default_item_type = "byte"; std::string default_item_type = "byte";
@@ -101,7 +101,6 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac
item_size_ = sizeof(char); item_size_ = sizeof(char);
} }
if( sample_type_.compare("real") == 0 ) if( sample_type_.compare("real") == 0 )
{ {
is_complex_ = false; is_complex_ = false;
@@ -236,14 +235,10 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac
} }
TwoBitPackedFileSignalSource::~TwoBitPackedFileSignalSource() TwoBitPackedFileSignalSource::~TwoBitPackedFileSignalSource()
{} {}
void TwoBitPackedFileSignalSource::connect(gr::top_block_sptr top_block) void TwoBitPackedFileSignalSource::connect(gr::top_block_sptr top_block)
{ {
gr::basic_block_sptr left_block = file_source_; gr::basic_block_sptr left_block = file_source_;
@@ -276,10 +271,6 @@ void TwoBitPackedFileSignalSource::connect(gr::top_block_sptr top_block)
} }
void TwoBitPackedFileSignalSource::disconnect(gr::top_block_sptr top_block) void TwoBitPackedFileSignalSource::disconnect(gr::top_block_sptr top_block)
{ {
gr::basic_block_sptr left_block = file_source_; gr::basic_block_sptr left_block = file_source_;
@@ -321,9 +312,6 @@ gr::basic_block_sptr TwoBitPackedFileSignalSource::get_left_block()
} }
gr::basic_block_sptr TwoBitPackedFileSignalSource::get_right_block() gr::basic_block_sptr TwoBitPackedFileSignalSource::get_right_block()
{ {
return valve_; return valve_;

View File

@@ -44,278 +44,318 @@ using boost::asio::ip::tcp;
// Buffer constants // Buffer constants
// TODO: Make these configurable // TODO: Make these configurable
enum { enum {
RTL_TCP_BUFFER_SIZE = 1024 * 16, // 16 KB RTL_TCP_BUFFER_SIZE = 1024 * 16, // 16 KB
RTL_TCP_PAYLOAD_SIZE = 1024 * 4 // 4 KB RTL_TCP_PAYLOAD_SIZE = 1024 * 4 // 4 KB
}; };
rtl_tcp_signal_source_c_sptr rtl_tcp_signal_source_c_sptr
rtl_tcp_make_signal_source_c(const std::string &address, rtl_tcp_make_signal_source_c(const std::string &address,
short port, short port,
bool flip_iq) bool flip_iq)
{ {
return gnuradio::get_initial_sptr (new rtl_tcp_signal_source_c (address, return gnuradio::get_initial_sptr (new rtl_tcp_signal_source_c (address,
port, port,
flip_iq)); flip_iq));
} }
rtl_tcp_signal_source_c::rtl_tcp_signal_source_c(const std::string &address, rtl_tcp_signal_source_c::rtl_tcp_signal_source_c(const std::string &address,
short port, short port,
bool flip_iq) bool flip_iq)
: gr::sync_block ("rtl_tcp_signal_source_c", : gr::sync_block ("rtl_tcp_signal_source_c",
gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0),
gr::io_signature::make(1, 1, sizeof(gr_complex))), gr::io_signature::make(1, 1, sizeof(gr_complex))),
socket_ (io_service_), socket_ (io_service_),
data_ (RTL_TCP_PAYLOAD_SIZE), data_ (RTL_TCP_PAYLOAD_SIZE),
flip_iq_(flip_iq), flip_iq_(flip_iq),
buffer_ (RTL_TCP_BUFFER_SIZE), buffer_ (RTL_TCP_BUFFER_SIZE),
unread_ (0) unread_ (0)
{ {
boost::system::error_code ec; boost::system::error_code ec;
// 1. Setup lookup table // 1. Setup lookup table
for (unsigned i = 0; i < 0xff; i++) { for (unsigned i = 0; i < 0xff; i++)
lookup_[i] = ((float)(i & 0xff) - 127.4f) * (1.0f / 128.0f); {
} lookup_[i] = ((float)(i & 0xff) - 127.4f) * (1.0f / 128.0f);
}
// 2. Set socket options // 2. Set socket options
ip::address addr = ip::address::from_string (address, ec); ip::address addr = ip::address::from_string (address, ec);
if (ec) { if (ec)
std::cout << address << " is not an IP address" << std::endl; {
LOG (ERROR) << address << " is not an IP address"; std::cout << address << " is not an IP address" << std::endl;
return; LOG (ERROR) << address << " is not an IP address";
} return;
ip::tcp::endpoint ep (addr, port); }
socket_.open (ep.protocol( ), ec); ip::tcp::endpoint ep (addr, port);
if (ec) { socket_.open (ep.protocol( ), ec);
std::cout << "Failed to open socket." << std::endl; if (ec)
LOG (ERROR) << "Failed to open socket."; {
} std::cout << "Failed to open socket." << std::endl;
LOG (ERROR) << "Failed to open socket.";
}
socket_.set_option (boost::asio::socket_base::reuse_address (true), ec); socket_.set_option (boost::asio::socket_base::reuse_address (true), ec);
if (ec) { if (ec)
std::cout << "Failed to set reuse address option: " << ec << std::endl; {
LOG (WARNING) << "Failed to set reuse address option"; std::cout << "Failed to set reuse address option: " << ec << std::endl;
} LOG (WARNING) << "Failed to set reuse address option";
socket_.set_option (boost::asio::socket_base::linger (true, 0), ec); }
if (ec) { socket_.set_option (boost::asio::socket_base::linger (true, 0), ec);
std::cout << "Failed to set linger option: " << ec << std::endl; if (ec)
LOG (WARNING) << "Failed to set linger option"; {
} std::cout << "Failed to set linger option: " << ec << std::endl;
LOG (WARNING) << "Failed to set linger option";
}
// 3. Connect socket // 3. Connect socket
socket_.connect(ep, ec); socket_.connect(ep, ec);
if (ec) { if (ec)
std::cout << "Failed to connect to " << addr << ":" << port {
<< "(" << ec << ")" << std::endl; std::cout << "Failed to connect to " << addr << ":" << port
LOG (ERROR) << "Failed to connect to " << addr << ":" << port << "(" << ec << ")" << std::endl;
<< "(" << ec << ")"; LOG (ERROR) << "Failed to connect to " << addr << ":" << port
return; << "(" << ec << ")";
} return;
std::cout << "Connected to " << addr << ":" << port << std::endl; }
LOG (INFO) << "Connected to " << addr << ":" << port; std::cout << "Connected to " << addr << ":" << port << std::endl;
LOG (INFO) << "Connected to " << addr << ":" << port;
// 4. Set nodelay // 4. Set nodelay
socket_.set_option (tcp::no_delay (true), ec); socket_.set_option (tcp::no_delay (true), ec);
if (ec) { if (ec)
std::cout << "Failed to set no delay option." << std::endl; {
LOG (WARNING) << "Failed to set no delay option"; std::cout << "Failed to set no delay option." << std::endl;
} LOG (WARNING) << "Failed to set no delay option";
}
// 5. Receive dongle info // 5. Receive dongle info
ec = info_.read (socket_); ec = info_.read (socket_);
if (ec) { if (ec)
std::cout << "Failed to read dongle info." << std::endl; {
LOG (WARNING) << "Failed to read dongle info"; std::cout << "Failed to read dongle info." << std::endl;
} LOG (WARNING) << "Failed to read dongle info";
else if (info_.is_valid ()) { }
std::cout << "Found " << info_.get_type_name() << " tuner." << std::endl; else if (info_.is_valid ())
LOG (INFO) << "Found " << info_.get_type_name() << " tuner."; {
} std::cout << "Found " << info_.get_type_name() << " tuner." << std::endl;
LOG (INFO) << "Found " << info_.get_type_name() << " tuner.";
}
// 6. Start reading // 6. Start reading
boost::asio::async_read (socket_, boost::asio::buffer (data_), boost::asio::async_read (socket_, boost::asio::buffer (data_),
boost::bind (&rtl_tcp_signal_source_c::handle_read, boost::bind (&rtl_tcp_signal_source_c::handle_read,
this, _1, _2)); this, _1, _2));
boost::thread (boost::bind (&boost::asio::io_service::run, &io_service_)); boost::thread (boost::bind (&boost::asio::io_service::run, &io_service_));
} }
rtl_tcp_signal_source_c::~rtl_tcp_signal_source_c() rtl_tcp_signal_source_c::~rtl_tcp_signal_source_c()
{ {
io_service_.stop (); io_service_.stop ();
} }
int rtl_tcp_signal_source_c::work (int noutput_items, int rtl_tcp_signal_source_c::work (int noutput_items,
gr_vector_const_void_star &/*input_items*/, gr_vector_const_void_star &/*input_items*/,
gr_vector_void_star &output_items) gr_vector_void_star &output_items)
{ {
gr_complex *out = reinterpret_cast <gr_complex *>( output_items[0] ); gr_complex *out = reinterpret_cast <gr_complex *>( output_items[0] );
int i = 0; int i = 0;
if (io_service_.stopped ()) { if (io_service_.stopped ())
return -1; {
} return -1;
}
{ {
boost::mutex::scoped_lock lock (mutex_); boost::mutex::scoped_lock lock (mutex_);
not_empty_.wait (lock, boost::bind (&rtl_tcp_signal_source_c::not_empty, not_empty_.wait (lock, boost::bind (&rtl_tcp_signal_source_c::not_empty,
this)); this));
for ( ; i < noutput_items && unread_ > 1; i++ ) { for ( ; i < noutput_items && unread_ > 1; i++ )
float re = buffer_[--unread_]; {
float im = buffer_[--unread_]; float re = buffer_[--unread_];
if (flip_iq_) { float im = buffer_[--unread_];
out[i] = gr_complex (im, re); if (flip_iq_)
} {
else { out[i] = gr_complex (im, re);
out[i] = gr_complex (re, im); }
} else
{
out[i] = gr_complex (re, im);
}
}
} }
} not_full_.notify_one ();
not_full_.notify_one (); return i == 0 ? -1 : i;
return i == 0 ? -1 : i;
} }
void rtl_tcp_signal_source_c::set_frequency (int frequency) { void rtl_tcp_signal_source_c::set_frequency (int frequency)
boost::system::error_code ec = {
rtl_tcp_command (RTL_TCP_SET_FREQUENCY, frequency, socket_);
if (ec) {
std::cout << "Failed to set frequency" << std::endl;
LOG (WARNING) << "Failed to set frequency";
}
}
void rtl_tcp_signal_source_c::set_sample_rate (int sample_rate) {
boost::system::error_code ec =
rtl_tcp_command (RTL_TCP_SET_SAMPLE_RATE, sample_rate, socket_);
if (ec) {
std::cout << "Failed to set sample rate" << std::endl;
LOG (WARNING) << "Failed to set sample rate";
}
}
void rtl_tcp_signal_source_c::set_agc_mode (bool agc) {
boost::system::error_code ec = boost::system::error_code ec =
rtl_tcp_command (RTL_TCP_SET_GAIN_MODE, !agc, socket_); rtl_tcp_command (RTL_TCP_SET_FREQUENCY, frequency, socket_);
if (ec) { if (ec)
std::cout << "Failed to set gain mode" << std::endl; {
LOG (WARNING) << "Failed to set gain mode"; std::cout << "Failed to set frequency" << std::endl;
} LOG (WARNING) << "Failed to set frequency";
ec = }
rtl_tcp_command (RTL_TCP_SET_AGC_MODE, agc, socket_);
if (ec) {
std::cout << "Failed to set gain mode" << std::endl;
LOG (WARNING) << "Failed to set gain mode";
}
} }
void rtl_tcp_signal_source_c::set_gain (int gain) {
void rtl_tcp_signal_source_c::set_sample_rate (int sample_rate)
{
boost::system::error_code ec =
rtl_tcp_command (RTL_TCP_SET_SAMPLE_RATE, sample_rate, socket_);
if (ec)
{
std::cout << "Failed to set sample rate" << std::endl;
LOG (WARNING) << "Failed to set sample rate";
}
}
void rtl_tcp_signal_source_c::set_agc_mode (bool agc)
{
boost::system::error_code ec =
rtl_tcp_command (RTL_TCP_SET_GAIN_MODE, !agc, socket_);
if (ec)
{
std::cout << "Failed to set gain mode" << std::endl;
LOG (WARNING) << "Failed to set gain mode";
}
ec = rtl_tcp_command (RTL_TCP_SET_AGC_MODE, agc, socket_);
if (ec)
{
std::cout << "Failed to set gain mode" << std::endl;
LOG (WARNING) << "Failed to set gain mode";
}
}
void rtl_tcp_signal_source_c::set_gain (int gain)
{
unsigned clipped = static_cast<unsigned> (info_.clip_gain (gain) * 10.0); unsigned clipped = static_cast<unsigned> (info_.clip_gain (gain) * 10.0);
boost::system::error_code ec = boost::system::error_code ec = rtl_tcp_command (RTL_TCP_SET_GAIN, clipped, socket_);
rtl_tcp_command (RTL_TCP_SET_GAIN, clipped, socket_); if (ec)
if (ec) { {
std::cout << "Failed to set gain" << std::endl; std::cout << "Failed to set gain" << std::endl;
LOG (WARNING) << "Failed to set gain"; LOG (WARNING) << "Failed to set gain";
} }
} }
void rtl_tcp_signal_source_c::set_if_gain (int gain) {
void rtl_tcp_signal_source_c::set_if_gain (int gain)
{
// from gr-osmosdr // from gr-osmosdr
struct range { struct range {
double start, stop, step; double start, stop, step;
}; };
if (info_.get_tuner_type () != rtl_tcp_dongle_info::TUNER_E4000) { if (info_.get_tuner_type () != rtl_tcp_dongle_info::TUNER_E4000)
return; {
} return;
}
std::vector<range> ranges = { std::vector<range> ranges = {
{ -3, 6, 9 }, { -3, 6, 9 },
{ 0, 9, 3 }, { 0, 9, 3 },
{ 0, 9, 3 }, { 0, 9, 3 },
{ 0, 2, 1 }, { 0, 2, 1 },
{ 3, 15, 3}, { 3, 15, 3},
{ 3, 15, 3} { 3, 15, 3}
}; };
std::map <int, double> gains; std::map <int, double> gains;
for (int i = 0; i < static_cast<int>(ranges.size ()); i++) { for (int i = 0; i < static_cast<int>(ranges.size ()); i++)
gains[i+1] = ranges[i].start; {
} gains[i+1] = ranges[i].start;
for (int i = ranges.size() - 1; i >= 0; i--) {
const range &r = ranges[i];
double error = gain;
for (double g = r.start; g < r.stop; g += r.step) {
double sum = 0;
for (int j = 0; j < static_cast<int> ( gains.size() ); j++) {
if (i == j) {
sum += g;
}
else {
sum += gains[j + 1];
}
}
double err = std::abs (gain - sum);
if (err < error) {
error = err;
gains[i+1] = g;
}
} }
}
for (unsigned stage = 1; stage <= gains.size(); stage++) { for (int i = ranges.size() - 1; i >= 0; i--)
int stage_gain = static_cast<int>( gains[stage] * 10 ); {
unsigned param = (stage << 16) | (stage_gain & 0xffff); const range &r = ranges[i];
boost::system::error_code ec = double error = gain;
rtl_tcp_command (RTL_TCP_SET_IF_GAIN, param, socket_);
if (ec) { for (double g = r.start; g < r.stop; g += r.step)
std::cout << "Failed to set if gain" << std::endl; {
LOG (WARNING) << "Failed to set if gain"; double sum = 0;
for (int j = 0; j < static_cast<int> ( gains.size() ); j++)
{
if (i == j)
{
sum += g;
}
else
{
sum += gains[j + 1];
}
}
double err = std::abs (gain - sum);
if (err < error)
{
error = err;
gains[i+1] = g;
}
}
}
for (unsigned stage = 1; stage <= gains.size(); stage++)
{
int stage_gain = static_cast<int>( gains[stage] * 10 );
unsigned param = (stage << 16) | (stage_gain & 0xffff);
boost::system::error_code ec = rtl_tcp_command (RTL_TCP_SET_IF_GAIN, param, socket_);
if (ec)
{
std::cout << "Failed to set if gain" << std::endl;
LOG (WARNING) << "Failed to set if gain";
}
} }
}
} }
void
rtl_tcp_signal_source_c::handle_read (const boost::system::error_code &ec,
size_t bytes_transferred) void rtl_tcp_signal_source_c::handle_read (const boost::system::error_code &ec,
size_t bytes_transferred)
{ {
if (ec) { if (ec)
std::cout << "Error during read: " << ec << std::endl; {
LOG (WARNING) << "Error during read: " << ec; std::cout << "Error during read: " << ec << std::endl;
boost::mutex::scoped_lock lock (mutex_); LOG (WARNING) << "Error during read: " << ec;
io_service_.stop (); boost::mutex::scoped_lock lock (mutex_);
not_empty_.notify_one (); io_service_.stop ();
} not_empty_.notify_one ();
else { }
{ else
// Unpack read data {
boost::mutex::scoped_lock lock (mutex_); {
not_full_.wait (lock, // Unpack read data
boost::bind (&rtl_tcp_signal_source_c::not_full, boost::mutex::scoped_lock lock (mutex_);
this)); not_full_.wait (lock,
boost::bind (&rtl_tcp_signal_source_c::not_full,
for (size_t i = 0; i < bytes_transferred; i++) { this));
while (!not_full( )) {
// uh-oh, buffer overflow for (size_t i = 0; i < bytes_transferred; i++)
// wait until there's space for more {
not_empty_.notify_one (); // needed? while (!not_full( ))
not_full_.wait (lock, {
boost::bind (&rtl_tcp_signal_source_c::not_full, // uh-oh, buffer overflow
this)); // wait until there's space for more
} not_empty_.notify_one (); // needed?
not_full_.wait (lock,
buffer_.push_front (lookup_[data_[i]]); boost::bind (&rtl_tcp_signal_source_c::not_full,
unread_++; this));
}
buffer_.push_front (lookup_[data_[i]]);
unread_++;
}
}
// let woker know that more data is available
not_empty_.notify_one ();
// Read some more
boost::asio::async_read (socket_,
boost::asio::buffer (data_),
boost::bind (&rtl_tcp_signal_source_c::handle_read,
this, _1, _2));
} }
}
// let woker know that more data is available
not_empty_.notify_one ();
// Read some more
boost::asio::async_read (socket_,
boost::asio::buffer (data_),
boost::bind (&rtl_tcp_signal_source_c::handle_read,
this, _1, _2));
}
} }

View File

@@ -36,7 +36,7 @@
*/ */
#ifndef GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_C_H #ifndef GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_C_H
#define GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_C_H #define GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_C_H
#include "rtl_tcp_dongle_info.h" #include "rtl_tcp_dongle_info.h"
#include <boost/asio.hpp> #include <boost/asio.hpp>
@@ -67,8 +67,8 @@ public:
~rtl_tcp_signal_source_c(); ~rtl_tcp_signal_source_c();
int work (int noutput_items, int work (int noutput_items,
gr_vector_const_void_star &input_items, gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items); gr_vector_void_star &output_items);
void set_frequency (int frequency); void set_frequency (int frequency);
void set_sample_rate (int sample_rate); void set_sample_rate (int sample_rate);
@@ -80,13 +80,13 @@ private:
typedef boost::circular_buffer_space_optimized<float> buffer_type; typedef boost::circular_buffer_space_optimized<float> buffer_type;
friend rtl_tcp_signal_source_c_sptr friend rtl_tcp_signal_source_c_sptr
rtl_tcp_make_signal_source_c(const std::string &address, rtl_tcp_make_signal_source_c(const std::string &address,
short port, short port,
bool flip_iq); bool flip_iq);
rtl_tcp_signal_source_c(const std::string &address, rtl_tcp_signal_source_c(const std::string &address,
short port, short port,
bool flip_iq); bool flip_iq);
rtl_tcp_dongle_info info_; rtl_tcp_dongle_info info_;
@@ -108,16 +108,15 @@ private:
// async read callback // async read callback
void handle_read (const boost::system::error_code &ec, void handle_read (const boost::system::error_code &ec,
size_t bytes_transferred); size_t bytes_transferred);
inline bool not_full ( ) const { inline bool not_full ( ) const {
return unread_ < buffer_.capacity( ); return unread_ < buffer_.capacity( );
} }
inline bool not_empty ( ) const { inline bool not_empty ( ) const {
return unread_ > 0 || io_service_.stopped (); return unread_ > 0 || io_service_.stopped ();
} }
}; };
#endif //GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_C_H #endif //GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_C_H

View File

@@ -104,7 +104,7 @@ unpack_2bit_samples::unpack_2bit_samples( bool big_endian_bytes,
: sync_interpolator("unpack_2bit_samples", : sync_interpolator("unpack_2bit_samples",
gr::io_signature::make(1, 1, item_size), gr::io_signature::make(1, 1, item_size),
gr::io_signature::make(1, 1, sizeof(char)), gr::io_signature::make(1, 1, sizeof(char)),
4*item_size ), // we make 4 bytes out for every byte in 4*item_size ), // we make 4 bytes out for every byte in
big_endian_bytes_(big_endian_bytes), big_endian_bytes_(big_endian_bytes),
item_size_(item_size), item_size_(item_size),
big_endian_items_(big_endian_items), big_endian_items_(big_endian_items),

View File

@@ -38,7 +38,7 @@
struct byte_2bit_struct struct byte_2bit_struct
{ {
signed two_bit_sample:2; // <- 2 bits wide only signed two_bit_sample:2; // <- 2 bits wide only
}; };
@@ -48,9 +48,9 @@ unpack_byte_2bit_cpx_samples_sptr make_unpack_byte_2bit_cpx_samples()
} }
unpack_byte_2bit_cpx_samples::unpack_byte_2bit_cpx_samples() : sync_interpolator("unpack_byte_2bit_cpx_samples", unpack_byte_2bit_cpx_samples::unpack_byte_2bit_cpx_samples() : sync_interpolator("unpack_byte_2bit_cpx_samples",
gr::io_signature::make(1, 1, sizeof(signed char)), gr::io_signature::make(1, 1, sizeof(signed char)),
gr::io_signature::make(1, 1, sizeof(short)), gr::io_signature::make(1, 1, sizeof(short)),
4) 4)
{} {}
unpack_byte_2bit_cpx_samples::~unpack_byte_2bit_cpx_samples() unpack_byte_2bit_cpx_samples::~unpack_byte_2bit_cpx_samples()

View File

@@ -34,7 +34,7 @@
struct byte_2bit_struct struct byte_2bit_struct
{ {
signed two_bit_sample:2; // <- 2 bits wide only signed two_bit_sample:2; // <- 2 bits wide only
}; };
@@ -43,18 +43,21 @@ unpack_byte_2bit_samples_sptr make_unpack_byte_2bit_samples()
return unpack_byte_2bit_samples_sptr(new unpack_byte_2bit_samples()); return unpack_byte_2bit_samples_sptr(new unpack_byte_2bit_samples());
} }
unpack_byte_2bit_samples::unpack_byte_2bit_samples() : sync_interpolator("unpack_byte_2bit_samples", unpack_byte_2bit_samples::unpack_byte_2bit_samples() : sync_interpolator("unpack_byte_2bit_samples",
gr::io_signature::make(1, 1, sizeof(signed char)), gr::io_signature::make(1, 1, sizeof(signed char)),
gr::io_signature::make(1, 1, sizeof(float)), gr::io_signature::make(1, 1, sizeof(float)),
4) 4)
{} {}
unpack_byte_2bit_samples::~unpack_byte_2bit_samples() unpack_byte_2bit_samples::~unpack_byte_2bit_samples()
{} {}
int unpack_byte_2bit_samples::work(int noutput_items, int unpack_byte_2bit_samples::work(int noutput_items,
gr_vector_const_void_star &input_items, gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items) gr_vector_void_star &output_items)
{ {
const signed char *in = (const signed char *)input_items[0]; const signed char *in = (const signed char *)input_items[0];
float *out = (float*)output_items[0]; float *out = (float*)output_items[0];

View File

@@ -39,18 +39,21 @@ unpack_intspir_1bit_samples_sptr make_unpack_intspir_1bit_samples()
return unpack_intspir_1bit_samples_sptr(new unpack_intspir_1bit_samples()); return unpack_intspir_1bit_samples_sptr(new unpack_intspir_1bit_samples());
} }
unpack_intspir_1bit_samples::unpack_intspir_1bit_samples() : sync_interpolator("unpack_intspir_1bit_samples", unpack_intspir_1bit_samples::unpack_intspir_1bit_samples() : sync_interpolator("unpack_intspir_1bit_samples",
gr::io_signature::make(1, 1, sizeof(int)), gr::io_signature::make(1, 1, sizeof(int)),
gr::io_signature::make(1, 1, sizeof(float)), gr::io_signature::make(1, 1, sizeof(float)),
2) 2)
{} {}
unpack_intspir_1bit_samples::~unpack_intspir_1bit_samples() unpack_intspir_1bit_samples::~unpack_intspir_1bit_samples()
{} {}
int unpack_intspir_1bit_samples::work(int noutput_items, int unpack_intspir_1bit_samples::work(int noutput_items,
gr_vector_const_void_star &input_items, gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items) gr_vector_void_star &output_items)
{ {
const signed int *in = (const signed int *)input_items[0]; const signed int *in = (const signed int *)input_items[0];
float *out = (float*)output_items[0]; float *out = (float*)output_items[0];
@@ -62,22 +65,22 @@ int unpack_intspir_1bit_samples::work(int noutput_items,
// Read packed input sample (1 byte = 1 complex sample) // Read packed input sample (1 byte = 1 complex sample)
// For historical reasons, values are float versions of short int limits (32767) // For historical reasons, values are float versions of short int limits (32767)
signed int val = in[i]; signed int val = in[i];
if(((val >> ((channel - 1)*2)) & 1) == 1) if(((val >> ((channel - 1)*2)) & 1) == 1)
{ {
out[n++] = static_cast<float>(32767.0); out[n++] = static_cast<float>(32767.0);
} }
else else
{ {
out[n++] = static_cast<float>(-32767.0); out[n++] = static_cast<float>(-32767.0);
} }
if(((val >> (2*channel - 1)) & 1) == 1) if(((val >> (2*channel - 1)) & 1) == 1)
{ {
out[n++] = static_cast<float>(32767.0); out[n++] = static_cast<float>(32767.0);
} }
else else
{ {
out[n++] = static_cast<float>(-32767.0); out[n++] = static_cast<float>(-32767.0);
} }
} }
return noutput_items; return noutput_items;
} }

View File

@@ -4,7 +4,7 @@
* to a TelemetryDecoderInterface * to a TelemetryDecoderInterface
* \author Marc Sales, 2014. marcsales92(at)gmail.com * \author Marc Sales, 2014. marcsales92(at)gmail.com
* \based on work from: * \based on work from:
* <ul> * <ul>
* <li> Javier Arribas, 2011. jarribas(at)cttc.es * <li> Javier Arribas, 2011. jarribas(at)cttc.es
* </ul> * </ul>
* *

View File

@@ -4,7 +4,7 @@
* to a TelemetryDecoderInterface * to a TelemetryDecoderInterface
* \author Marc Sales, 2014. marcsales92(at)gmail.com * \author Marc Sales, 2014. marcsales92(at)gmail.com
* \based on work from: * \based on work from:
* <ul> * <ul>
* <li> Javier Arribas, 2011. jarribas(at)cttc.es * <li> Javier Arribas, 2011. jarribas(at)cttc.es
* </ul> * </ul>
* *

View File

@@ -77,16 +77,16 @@ void SbasL1TelemetryDecoder::set_satellite(Gnss_Satellite satellite)
void SbasL1TelemetryDecoder::connect(gr::top_block_sptr top_block) void SbasL1TelemetryDecoder::connect(gr::top_block_sptr top_block)
{ {
if(top_block) { /* top_block is not null */}; if(top_block) { /* top_block is not null */};
// Nothing to connect internally // Nothing to connect internally
DLOG(INFO) << "nothing to connect internally"; DLOG(INFO) << "nothing to connect internally";
} }
void SbasL1TelemetryDecoder::disconnect(gr::top_block_sptr top_block) void SbasL1TelemetryDecoder::disconnect(gr::top_block_sptr top_block)
{ {
if(top_block) { /* top_block is not null */}; if(top_block) { /* top_block is not null */};
// Nothing to disconnect // Nothing to disconnect
} }

View File

@@ -116,8 +116,8 @@ void galileo_e1b_telemetry_decoder_cc::deinterleaver(int rows, int cols, double
galileo_e1b_telemetry_decoder_cc::galileo_e1b_telemetry_decoder_cc( galileo_e1b_telemetry_decoder_cc::galileo_e1b_telemetry_decoder_cc(
Gnss_Satellite satellite, Gnss_Satellite satellite,
bool dump) : bool dump) :
gr::block("galileo_e1b_telemetry_decoder_cc", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), gr::block("galileo_e1b_telemetry_decoder_cc", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)),
gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)))
{ {
// Telemetry Bit transition synchronization port out // Telemetry Bit transition synchronization port out
this->message_port_register_out(pmt::mp("preamble_timestamp_s")); this->message_port_register_out(pmt::mp("preamble_timestamp_s"));
@@ -176,8 +176,6 @@ galileo_e1b_telemetry_decoder_cc::galileo_e1b_telemetry_decoder_cc(
} }
galileo_e1b_telemetry_decoder_cc::~galileo_e1b_telemetry_decoder_cc() galileo_e1b_telemetry_decoder_cc::~galileo_e1b_telemetry_decoder_cc()
{ {
delete d_preambles_symbols; delete d_preambles_symbols;
@@ -185,8 +183,6 @@ galileo_e1b_telemetry_decoder_cc::~galileo_e1b_telemetry_decoder_cc()
} }
void galileo_e1b_telemetry_decoder_cc::decode_word(double *page_part_symbols,int frame_length) void galileo_e1b_telemetry_decoder_cc::decode_word(double *page_part_symbols,int frame_length)
{ {
double page_part_symbols_deint[frame_length]; double page_part_symbols_deint[frame_length];
@@ -288,7 +284,7 @@ void galileo_e1b_telemetry_decoder_cc::decode_word(double *page_part_symbols,int
int galileo_e1b_telemetry_decoder_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), int galileo_e1b_telemetry_decoder_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)),
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
{ {
int corr_value = 0; int corr_value = 0;
int preamble_diff = 0; int preamble_diff = 0;
@@ -303,7 +299,7 @@ int galileo_e1b_telemetry_decoder_cc::general_work (int noutput_items __attribut
//******* preamble correlation ******** //******* preamble correlation ********
for (int i = 0; i < d_symbols_per_preamble; i++) for (int i = 0; i < d_symbols_per_preamble; i++)
{ {
if (in[0][i].Prompt_I < 0) // symbols clipping if (in[0][i].Prompt_I < 0) // symbols clipping
{ {
corr_value -= d_preambles_symbols[i]; corr_value -= d_preambles_symbols[i];
} }
@@ -439,7 +435,6 @@ int galileo_e1b_telemetry_decoder_cc::general_work (int noutput_items __attribut
//this page has no timing information //this page has no timing information
d_TOW_at_Preamble = d_TOW_at_Preamble + GALILEO_INAV_PAGE_SECONDS; d_TOW_at_Preamble = d_TOW_at_Preamble + GALILEO_INAV_PAGE_SECONDS;
d_TOW_at_current_symbol = d_TOW_at_current_symbol + GALILEO_E1_CODE_PERIOD;// + GALILEO_INAV_PAGE_PART_SYMBOLS*GALILEO_E1_CODE_PERIOD; d_TOW_at_current_symbol = d_TOW_at_current_symbol + GALILEO_E1_CODE_PERIOD;// + GALILEO_INAV_PAGE_PART_SYMBOLS*GALILEO_E1_CODE_PERIOD;
} }
} }
else //if there is not a new preamble, we define the TOW of the current symbol else //if there is not a new preamble, we define the TOW of the current symbol
@@ -512,6 +507,7 @@ void galileo_e1b_telemetry_decoder_cc::set_decimation(int decimation)
d_decimation_output_factor = decimation; d_decimation_output_factor = decimation;
} }
void galileo_e1b_telemetry_decoder_cc::set_satellite(Gnss_Satellite satellite) void galileo_e1b_telemetry_decoder_cc::set_satellite(Gnss_Satellite satellite)
{ {
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());

View File

@@ -3,7 +3,7 @@
* \brief Implementation of a Galileo FNAV message demodulator block * \brief Implementation of a Galileo FNAV message demodulator block
* \author Marc Sales, 2014. marcsales92(at)gmail.com * \author Marc Sales, 2014. marcsales92(at)gmail.com
* \based on work from: * \based on work from:
* <ul> * <ul>
* <li> Javier Arribas, 2011. jarribas(at)cttc.es * <li> Javier Arribas, 2011. jarribas(at)cttc.es
* </ul> * </ul>
* *
@@ -267,18 +267,18 @@ galileo_e5a_telemetry_decoder_cc::~galileo_e5a_telemetry_decoder_cc()
int galileo_e5a_telemetry_decoder_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), int galileo_e5a_telemetry_decoder_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)),
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
{ {
// //
const Gnss_Synchro **in = (const Gnss_Synchro **) &input_items[0]; //Get the input samples pointer const Gnss_Synchro **in = (const Gnss_Synchro **) &input_items[0]; //Get the input samples pointer
Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0]; Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0];
/* Terminology: Prompt: output from tracking Prompt correlator (Prompt samples) /* Terminology: Prompt: output from tracking Prompt correlator (Prompt samples)
* Symbol: encoded navigation bits. 1 symbol = 20 samples in E5a * Symbol: encoded navigation bits. 1 symbol = 20 samples in E5a
* Bit: decoded navigation bits forming words as described in Galileo ICD * Bit: decoded navigation bits forming words as described in Galileo ICD
* States: 0 Receiving dummy samples. * States: 0 Receiving dummy samples.
* 1 Preamble not locked * 1 Preamble not locked
* 3 Preamble lock * 3 Preamble lock
*/ */
switch (d_state) switch (d_state)
{ {
@@ -325,7 +325,7 @@ int galileo_e5a_telemetry_decoder_cc::general_work (int noutput_items __attribut
{ {
d_page_symbols[d_symbol_counter] = -1; d_page_symbols[d_symbol_counter] = -1;
} }
// d_page_symbols[d_symbol_counter] = d_current_symbol_float/(float)GALILEO_FNAV_CODES_PER_SYMBOL; // d_page_symbols[d_symbol_counter] = d_current_symbol_float/(float)GALILEO_FNAV_CODES_PER_SYMBOL;
d_current_symbol = 0; d_current_symbol = 0;
d_symbol_counter++; d_symbol_counter++;
d_prompt_counter = 0; d_prompt_counter = 0;
@@ -333,7 +333,7 @@ int galileo_e5a_telemetry_decoder_cc::general_work (int noutput_items __attribut
bool corr_flag=true; bool corr_flag=true;
int corr_sign = 0; // sequence can be found inverted int corr_sign = 0; // sequence can be found inverted
// check if the preamble starts positive correlated or negative correlated // check if the preamble starts positive correlated or negative correlated
if (d_page_symbols[d_symbol_counter - GALILEO_FNAV_PREAMBLE_LENGTH_BITS] < 0) // symbols clipping if (d_page_symbols[d_symbol_counter - GALILEO_FNAV_PREAMBLE_LENGTH_BITS] < 0) // symbols clipping
{ {
corr_sign=-d_preamble_bits[0]; corr_sign=-d_preamble_bits[0];
} }
@@ -399,18 +399,18 @@ int galileo_e5a_telemetry_decoder_cc::general_work (int noutput_items __attribut
// **** Attempt Preamble correlation **** // **** Attempt Preamble correlation ****
bool corr_flag = true; bool corr_flag = true;
int corr_sign = 0; // sequence can be found inverted int corr_sign = 0; // sequence can be found inverted
// corr_sign = d_preamble_bits[0] * d_page_symbols[d_symbol_counter - GALILEO_FNAV_PREAMBLE_LENGTH_BITS]; // corr_sign = d_preamble_bits[0] * d_page_symbols[d_symbol_counter - GALILEO_FNAV_PREAMBLE_LENGTH_BITS];
// for (int i = 1; i < GALILEO_FNAV_PREAMBLE_LENGTH_BITS; i++) // for (int i = 1; i < GALILEO_FNAV_PREAMBLE_LENGTH_BITS; i++)
// { // {
// if ((d_preamble_bits[i] * d_page_symbols[i + d_symbol_counter - GALILEO_FNAV_PREAMBLE_LENGTH_BITS]) != corr_sign) // if ((d_preamble_bits[i] * d_page_symbols[i + d_symbol_counter - GALILEO_FNAV_PREAMBLE_LENGTH_BITS]) != corr_sign)
// { // {
// //exit for if one bit doesn't correlate // //exit for if one bit doesn't correlate
// corr_flag = false; // corr_flag = false;
// break; // break;
// } // }
// } // }
// check if the preamble starts positive correlated or negative correlated // check if the preamble starts positive correlated or negative correlated
if (d_page_symbols[d_symbol_counter - GALILEO_FNAV_PREAMBLE_LENGTH_BITS] < 0) // symbols clipping if (d_page_symbols[d_symbol_counter - GALILEO_FNAV_PREAMBLE_LENGTH_BITS] < 0) // symbols clipping
{ {
corr_sign=-d_preamble_bits[0]; corr_sign=-d_preamble_bits[0];
} }

View File

@@ -3,7 +3,7 @@
* \brief Implementation of a Galileo FNAV message demodulator block * \brief Implementation of a Galileo FNAV message demodulator block
* \author Marc Sales, 2014. marcsales92(at)gmail.com * \author Marc Sales, 2014. marcsales92(at)gmail.com
* \based on work from: * \based on work from:
* <ul> * <ul>
* <li> Javier Arribas, 2011. jarribas(at)cttc.es * <li> Javier Arribas, 2011. jarribas(at)cttc.es
* </ul> * </ul>
* *

View File

@@ -143,7 +143,7 @@ bool gps_l1_ca_telemetry_decoder_cc::gps_word_parityCheck(unsigned int gpsword)
int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)),
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
{ {
int corr_value = 0; int corr_value = 0;
int preamble_diff_ms = 0; int preamble_diff_ms = 0;
@@ -180,7 +180,7 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attribute_
d_GPS_FSM.Event_gps_word_preamble(); d_GPS_FSM.Event_gps_word_preamble();
//record the preamble sample stamp //record the preamble sample stamp
d_preamble_time_seconds = in[0][0].Tracking_timestamp_secs; // record the preamble sample stamp d_preamble_time_seconds = in[0][0].Tracking_timestamp_secs; // record the preamble sample stamp
DLOG(INFO) << "Preamble detection for SAT " << this->d_satellite << "in[0][0].Tracking_timestamp_secs=" << round(in[0][0].Tracking_timestamp_secs * 1000.0); DLOG(INFO) << "Preamble detection for SAT " << this->d_satellite << "in[0][0].Tracking_timestamp_secs=" << round(in[0][0].Tracking_timestamp_secs * 1000.0);
//sync the symbol to bits integrator //sync the symbol to bits integrator
d_symbol_accumulator = 0; d_symbol_accumulator_counter = 0; d_symbol_accumulator = 0; d_symbol_accumulator_counter = 0;
d_frame_bit_index = 0; d_frame_bit_index = 0;
@@ -191,7 +191,7 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attribute_
preamble_diff_ms = round((in[0][0].Tracking_timestamp_secs - d_preamble_time_seconds) * 1000.0); preamble_diff_ms = round((in[0][0].Tracking_timestamp_secs - d_preamble_time_seconds) * 1000.0);
if (abs(preamble_diff_ms - GPS_SUBFRAME_MS) < 1) if (abs(preamble_diff_ms - GPS_SUBFRAME_MS) < 1)
{ {
DLOG(INFO) << "Preamble confirmation for SAT " << this->d_satellite << "in[0][0].Tracking_timestamp_secs=" << round(in[0][0].Tracking_timestamp_secs * 1000.0); DLOG(INFO) << "Preamble confirmation for SAT " << this->d_satellite << "in[0][0].Tracking_timestamp_secs=" << round(in[0][0].Tracking_timestamp_secs * 1000.0);
d_GPS_FSM.Event_gps_word_preamble(); d_GPS_FSM.Event_gps_word_preamble();
d_flag_preamble = true; d_flag_preamble = true;
d_preamble_time_seconds = in[0][0].Tracking_timestamp_secs;// - d_preamble_duration_seconds; //record the PRN start sample index associated to the preamble d_preamble_time_seconds = in[0][0].Tracking_timestamp_secs;// - d_preamble_duration_seconds; //record the PRN start sample index associated to the preamble

View File

@@ -29,7 +29,7 @@
*/ */
#ifndef GNSS_SDR_GPS_L1_CA_TELEMETRY_DECODER_CC_H #ifndef GNSS_SDR_GPS_L1_CA_TELEMETRY_DECODER_CC_H
#define GNSS_SDR_GPS_L1_CA_TELEMETRY_DECODER_CC_H #define GNSS_SDR_GPS_L1_CA_TELEMETRY_DECODER_CC_H
#include <fstream> #include <fstream>
#include <string> #include <string>
@@ -130,7 +130,6 @@ private:
std::string d_dump_filename; std::string d_dump_filename;
std::ofstream d_dump_file; std::ofstream d_dump_file;
}; };
#endif #endif

View File

@@ -110,7 +110,7 @@ void gps_l2_m_telemetry_decoder_cc::set_decimation(int decimation)
int gps_l2_m_telemetry_decoder_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), int gps_l2_m_telemetry_decoder_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)),
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
{ {
// get pointers on in- and output gnss-synchro objects // get pointers on in- and output gnss-synchro objects
const Gnss_Synchro *in = (const Gnss_Synchro *) input_items[0]; // input const Gnss_Synchro *in = (const Gnss_Synchro *) input_items[0]; // input
@@ -128,7 +128,7 @@ int gps_l2_m_telemetry_decoder_cc::general_work (int noutput_items __attribute__
{ {
if (in[0].Flag_valid_symbol_output == false) // check if the tracking is locked if (in[0].Flag_valid_symbol_output == false) // check if the tracking is locked
{ {
LOG(INFO)<< "Discarting channel "<<d_channel<<" tracking not ready!"<<std::endl; LOG(INFO) << "Discarting channel " << d_channel << " tracking not ready!" << std::endl;
d_flag_valid_word = false; d_flag_valid_word = false;
} }
else else

View File

@@ -29,7 +29,7 @@
*/ */
#ifndef GNSS_SDR_GPS_L2_M_TELEMETRY_DECODER_CC_H #ifndef GNSS_SDR_GPS_L2_M_TELEMETRY_DECODER_CC_H
#define GNSS_SDR_GPS_L2_M_TELEMETRY_DECODER_CC_H #define GNSS_SDR_GPS_L2_M_TELEMETRY_DECODER_CC_H
#include <algorithm> // for copy #include <algorithm> // for copy
#include <deque> #include <deque>

View File

@@ -40,10 +40,10 @@
using google::LogMessage; using google::LogMessage;
// logging levels // logging levels
#define EVENT 2 // logs important events which don't occur every block #define EVENT 2 // logs important events which don't occur every block
#define FLOW 3 // logs the function calls of block processing functions #define FLOW 3 // logs the function calls of block processing functions
#define SAMP_SYNC 4 // about 1 log entry per sample -> high output #define SAMP_SYNC 4 // about 1 log entry per sample -> high output
#define LMORE 5 // #define LMORE 5 //
@@ -95,12 +95,12 @@ void sbas_l1_telemetry_decoder_cc::forecast (int noutput_items, gr_vector_int &n
int sbas_l1_telemetry_decoder_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), int sbas_l1_telemetry_decoder_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)),
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
{ {
VLOG(FLOW) << "general_work(): " << "noutput_items=" << noutput_items << "\toutput_items real size=" << output_items.size() << "\tninput_items size=" << ninput_items.size() << "\tinput_items real size=" << input_items.size() << "\tninput_items[0]=" << ninput_items[0]; VLOG(FLOW) << "general_work(): " << "noutput_items=" << noutput_items << "\toutput_items real size=" << output_items.size() << "\tninput_items size=" << ninput_items.size() << "\tinput_items real size=" << input_items.size() << "\tninput_items[0]=" << ninput_items[0];
// get pointers on in- and output gnss-synchro objects // get pointers on in- and output gnss-synchro objects
const Gnss_Synchro *in = (const Gnss_Synchro *) input_items[0]; // input const Gnss_Synchro *in = (const Gnss_Synchro *) input_items[0]; // input
Gnss_Synchro *out = (Gnss_Synchro *) output_items[0]; // output Gnss_Synchro *out = (Gnss_Synchro *) output_items[0]; // output
// store the time stamp of the first sample in the processed sample block // store the time stamp of the first sample in the processed sample block
double sample_stamp = in[0].Tracking_timestamp_secs; double sample_stamp = in[0].Tracking_timestamp_secs;

View File

@@ -49,7 +49,7 @@ const float MAXLOG = 1e7; /* Define infinity */
/*! /*!
* \brief Determines if a symbol has odd (1) or even (0) parity * \brief Determines if a symbol has odd (1) or even (0) parity
* Output parameters: * Output parameters:
* \return (returned int): The symbol's parity = 1 for odd and 0 for even * \return (returned int): The symbol's parity = 1 for odd and 0 for even
* *
* \param[in] symbol The integer-valued symbol * \param[in] symbol The integer-valued symbol
@@ -82,7 +82,7 @@ static int parity_counter(int symbol, int length)
* \param[in] KK The constraint length of the convolutional code. * \param[in] KK The constraint length of the convolutional code.
* \param[out] output_p[] An n-element vector containing the encoded bits. * \param[out] output_p[] An n-element vector containing the encoded bits.
* \param[out] state_out_p[] An integer containing the final state of the encoder * \param[out] state_out_p[] An integer containing the final state of the encoder
* (i.e. the state after encoding this bit) * (i.e. the state after encoding this bit)
* *
* This function is used by nsc_transit() * This function is used by nsc_transit()
*/ */
@@ -193,7 +193,7 @@ static void Viterbi(int output_u_int[],
float *prev_section, *next_section; float *prev_section, *next_section;
int *prev_bit; int *prev_bit;
int *prev_state; int *prev_state;
float *metric_c; /* Set of all possible branch metrics */ float *metric_c; /* Set of all possible branch metrics */
float *rec_array; /* Received values for one trellis section */ float *rec_array; /* Received values for one trellis section */
float max_val; float max_val;
@@ -222,7 +222,7 @@ static void Viterbi(int output_u_int[],
for (t = 0; t < LL + mm; t++) for (t = 0; t < LL + mm; t++)
{ {
for (i = 0; i < nn; i++) for (i = 0; i < nn; i++)
rec_array[i] = static_cast<float>(input_c[nn*t + i]); rec_array[i] = static_cast<float>(input_c[nn*t + i]);
/* precompute all possible branch metrics */ /* precompute all possible branch metrics */
for (i = 0; i < number_symbols; i++) for (i = 0; i < number_symbols; i++)

View File

@@ -34,11 +34,11 @@
#include <glog/logging.h> #include <glog/logging.h>
// logging // logging
#define EVENT 2 // logs important events which don't occur every block #define EVENT 2 // logs important events which don't occur every block
#define FLOW 3 // logs the function calls of block processing functions #define FLOW 3 // logs the function calls of block processing functions
#define BLOCK 4 // once per block #define BLOCK 4 // once per block
#define SAMPLE 5 // about one log entry per sample #define SAMPLE 5 // about one log entry per sample
#define LMORE 6 // many entries per sample / very specific stuff #define LMORE 6 // many entries per sample / very specific stuff
const float MAXLOG = 1e7; /* Define infinity */ const float MAXLOG = 1e7; /* Define infinity */
@@ -95,10 +95,10 @@ void Viterbi_Decoder::reset()
/* Function decode_block() /* Function decode_block()
Description: Uses the Viterbi algorithm to perform hard-decision decoding of a convolutional code. Description: Uses the Viterbi algorithm to perform hard-decision decoding of a convolutional code.
Input parameters: Input parameters:
r[] The received signal in LLR-form. For BPSK, must be in form r = 2*a*y/(sigma^2). r[] The received signal in LLR-form. For BPSK, must be in form r = 2*a*y/(sigma^2).
LL The number of data bits to be decoded (doesn't include the mm zero-tail-bits) LL The number of data bits to be decoded (doesn't include the mm zero-tail-bits)
Output parameters: Output parameters:
output_u_int[] Hard decisions on the data bits (without the mm zero-tail-bits) output_u_int[] Hard decisions on the data bits (without the mm zero-tail-bits)
*/ */
float Viterbi_Decoder::decode_block(const double input_c[], int output_u_int[], const int LL) float Viterbi_Decoder::decode_block(const double input_c[], int output_u_int[], const int LL)
{ {
@@ -359,12 +359,12 @@ int Viterbi_Decoder::do_tb_and_decode(int traceback_length, int requested_decodi
Description: Computes the branch metric used for decoding. Description: Computes the branch metric used for decoding.
Output parameters: Output parameters:
(returned float) The metric between the hypothetical symbol and the recevieved vector (returned float) The metric between the hypothetical symbol and the recevieved vector
Input parameters: Input parameters:
rec_array The received vector, of length nn rec_array The received vector, of length nn
symbol The hypothetical symbol symbol The hypothetical symbol
nn The length of the received vector nn The length of the received vector
This function is used by siso() */ This function is used by siso() */
float float
@@ -412,15 +412,15 @@ Viterbi_Decoder::nsc_transit(int output_p[], int trans_p[], int input, const int
Takes in one input bit at a time, and produces a n-bit output. Takes in one input bit at a time, and produces a n-bit output.
Input parameters: Input parameters:
input The input data bit (i.e. a 0 or 1). input The input data bit (i.e. a 0 or 1).
state_in The starting state of the encoder (an int from 0 to 2^m-1). state_in The starting state of the encoder (an int from 0 to 2^m-1).
g[] An n-element vector containing the code generators in binary form. g[] An n-element vector containing the code generators in binary form.
KK The constraint length of the convolutional code. KK The constraint length of the convolutional code.
nn number of symbols bits per input bits (rate 1/nn) nn number of symbols bits per input bits (rate 1/nn)
Output parameters: Output parameters:
output_p[] An n-element vector containing the encoded bits. output_p[] An n-element vector containing the encoded bits.
state_out_p[] An integer containing the final state of the encoder state_out_p[] An integer containing the final state of the encoder
(i.e. the state after encoding this bit) (i.e. the state after encoding this bit)
This function is used by rsc_encode(), nsc_transit(), rsc_transit(), and nsc_transit() */ This function is used by rsc_encode(), nsc_transit(), rsc_transit(), and nsc_transit() */

View File

@@ -129,14 +129,14 @@ void GalileoE1DllPllVemlTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
void GalileoE1DllPllVemlTracking::connect(gr::top_block_sptr top_block) void GalileoE1DllPllVemlTracking::connect(gr::top_block_sptr top_block)
{ {
if(top_block) { /* top_block is not null */}; if(top_block) { /* top_block is not null */};
//nothing to connect, now the tracking uses gr_sync_decimator //nothing to connect, now the tracking uses gr_sync_decimator
} }
void GalileoE1DllPllVemlTracking::disconnect(gr::top_block_sptr top_block) void GalileoE1DllPllVemlTracking::disconnect(gr::top_block_sptr top_block)
{ {
if(top_block) { /* top_block is not null */}; if(top_block) { /* top_block is not null */};
//nothing to disconnect, now the tracking uses gr_sync_decimator //nothing to disconnect, now the tracking uses gr_sync_decimator
} }
gr::basic_block_sptr GalileoE1DllPllVemlTracking::get_left_block() gr::basic_block_sptr GalileoE1DllPllVemlTracking::get_left_block()

View File

@@ -130,14 +130,14 @@ void GalileoE1TcpConnectorTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchr
void GalileoE1TcpConnectorTracking::connect(gr::top_block_sptr top_block) void GalileoE1TcpConnectorTracking::connect(gr::top_block_sptr top_block)
{ {
if(top_block) { /* top_block is not null */}; if(top_block) { /* top_block is not null */};
//nothing to connect, now the tracking uses gr_sync_decimator //nothing to connect, now the tracking uses gr_sync_decimator
} }
void GalileoE1TcpConnectorTracking::disconnect(gr::top_block_sptr top_block) void GalileoE1TcpConnectorTracking::disconnect(gr::top_block_sptr top_block)
{ {
if(top_block) { /* top_block is not null */}; if(top_block) { /* top_block is not null */};
//nothing to disconnect, now the tracking uses gr_sync_decimator //nothing to disconnect, now the tracking uses gr_sync_decimator
} }
gr::basic_block_sptr GalileoE1TcpConnectorTracking::get_left_block() gr::basic_block_sptr GalileoE1TcpConnectorTracking::get_left_block()

View File

@@ -6,7 +6,7 @@
* Galileo E5a data and pilot Signals * Galileo E5a data and pilot Signals
* \author Marc Sales, 2014. marcsales92(at)gmail.com * \author Marc Sales, 2014. marcsales92(at)gmail.com
* \based on work from: * \based on work from:
* <ul> * <ul>
* <li> Javier Arribas, 2011. jarribas(at)cttc.es * <li> Javier Arribas, 2011. jarribas(at)cttc.es
* <li> Luis Esteve, 2012. luis(at)epsilon-formacion.com * <li> Luis Esteve, 2012. luis(at)epsilon-formacion.com
* </ul> * </ul>
@@ -137,14 +137,14 @@ void GalileoE5aDllPllTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
void GalileoE5aDllPllTracking::connect(gr::top_block_sptr top_block) void GalileoE5aDllPllTracking::connect(gr::top_block_sptr top_block)
{ {
if(top_block) { /* top_block is not null */}; if(top_block) { /* top_block is not null */};
//nothing to connect, now the tracking uses gr_sync_decimator //nothing to connect, now the tracking uses gr_sync_decimator
} }
void GalileoE5aDllPllTracking::disconnect(gr::top_block_sptr top_block) void GalileoE5aDllPllTracking::disconnect(gr::top_block_sptr top_block)
{ {
if(top_block) { /* top_block is not null */}; if(top_block) { /* top_block is not null */};
//nothing to disconnect, now the tracking uses gr_sync_decimator //nothing to disconnect, now the tracking uses gr_sync_decimator
} }
gr::basic_block_sptr GalileoE5aDllPllTracking::get_left_block() gr::basic_block_sptr GalileoE5aDllPllTracking::get_left_block()

View File

@@ -6,7 +6,7 @@
* Galileo E5a data and pilot Signals * Galileo E5a data and pilot Signals
* \author Marc Sales, 2014. marcsales92(at)gmail.com * \author Marc Sales, 2014. marcsales92(at)gmail.com
* \based on work from: * \based on work from:
* <ul> * <ul>
* <li> Javier Arribas, 2011. jarribas(at)cttc.es * <li> Javier Arribas, 2011. jarribas(at)cttc.es
* <li> Luis Esteve, 2012. luis(at)epsilon-formacion.com * <li> Luis Esteve, 2012. luis(at)epsilon-formacion.com
* </ul> * </ul>

View File

@@ -100,23 +100,25 @@ GpsL1CaDllPllCAidTracking::GpsL1CaDllPllCAidTracking(
extend_correlation_ms, extend_correlation_ms,
early_late_space_chips); early_late_space_chips);
DLOG(INFO) << "tracking(" << tracking_cc->unique_id() << ")"; DLOG(INFO) << "tracking(" << tracking_cc->unique_id() << ")";
}else if(item_type_.compare("cshort") == 0) }
{ else if(item_type_.compare("cshort") == 0)
item_size_ = sizeof(lv_16sc_t); {
tracking_sc = gps_l1_ca_dll_pll_c_aid_make_tracking_sc( item_size_ = sizeof(lv_16sc_t);
f_if, tracking_sc = gps_l1_ca_dll_pll_c_aid_make_tracking_sc(
fs_in, f_if,
vector_length, fs_in,
queue_, vector_length,
dump, queue_,
dump_filename, dump,
pll_bw_hz, dump_filename,
dll_bw_hz, pll_bw_hz,
pll_bw_narrow_hz, dll_bw_hz,
dll_bw_narrow_hz, pll_bw_narrow_hz,
early_late_space_chips); dll_bw_narrow_hz,
DLOG(INFO) << "tracking(" << tracking_sc->unique_id() << ")"; early_late_space_chips);
}else DLOG(INFO) << "tracking(" << tracking_sc->unique_id() << ")";
}
else
{ {
item_size_ = sizeof(gr_complex); item_size_ = sizeof(gr_complex);
LOG(WARNING) << item_type_ << " unknown tracking item type."; LOG(WARNING) << item_type_ << " unknown tracking item type.";
@@ -185,14 +187,14 @@ void GpsL1CaDllPllCAidTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
void GpsL1CaDllPllCAidTracking::connect(gr::top_block_sptr top_block) void GpsL1CaDllPllCAidTracking::connect(gr::top_block_sptr top_block)
{ {
if(top_block) { /* top_block is not null */}; if(top_block) { /* top_block is not null */};
//nothing to connect, now the tracking uses gr_sync_decimator //nothing to connect, now the tracking uses gr_sync_decimator
} }
void GpsL1CaDllPllCAidTracking::disconnect(gr::top_block_sptr top_block) void GpsL1CaDllPllCAidTracking::disconnect(gr::top_block_sptr top_block)
{ {
if(top_block) { /* top_block is not null */}; if(top_block) { /* top_block is not null */};
//nothing to disconnect, now the tracking uses gr_sync_decimator //nothing to disconnect, now the tracking uses gr_sync_decimator
} }
gr::basic_block_sptr GpsL1CaDllPllCAidTracking::get_left_block() gr::basic_block_sptr GpsL1CaDllPllCAidTracking::get_left_block()

View File

@@ -125,14 +125,14 @@ void GpsL1CaDllPllTrackingGPU::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
void GpsL1CaDllPllTrackingGPU::connect(gr::top_block_sptr top_block) void GpsL1CaDllPllTrackingGPU::connect(gr::top_block_sptr top_block)
{ {
if(top_block) { /* top_block is not null */}; if(top_block) { /* top_block is not null */};
//nothing to connect, now the tracking uses gr_sync_decimator //nothing to connect, now the tracking uses gr_sync_decimator
} }
void GpsL1CaDllPllTrackingGPU::disconnect(gr::top_block_sptr top_block) void GpsL1CaDllPllTrackingGPU::disconnect(gr::top_block_sptr top_block)
{ {
if(top_block) { /* top_block is not null */}; if(top_block) { /* top_block is not null */};
//nothing to disconnect, now the tracking uses gr_sync_decimator //nothing to disconnect, now the tracking uses gr_sync_decimator
} }
gr::basic_block_sptr GpsL1CaDllPllTrackingGPU::get_left_block() gr::basic_block_sptr GpsL1CaDllPllTrackingGPU::get_left_block()

View File

@@ -2,7 +2,7 @@
* \file gps_l1_ca_tcp_connector_tracking.cc * \file gps_l1_ca_tcp_connector_tracking.cc
* \brief Implementation of an adapter of a TCP connector block based on code DLL + carrier PLL * \brief Implementation of an adapter of a TCP connector block based on code DLL + carrier PLL
* \author David Pubill, 2012. dpubill(at)cttc.es * \author David Pubill, 2012. dpubill(at)cttc.es
* Luis Esteve, 2012. luis(at)epsilon-formacion.com * Luis Esteve, 2012. luis(at)epsilon-formacion.com
* Javier Arribas, 2011. jarribas(at)cttc.es * Javier Arribas, 2011. jarribas(at)cttc.es
* *
* Code DLL + carrier PLL according to the algorithms described in: * Code DLL + carrier PLL according to the algorithms described in:
@@ -123,14 +123,14 @@ void GpsL1CaTcpConnectorTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
void GpsL1CaTcpConnectorTracking::connect(gr::top_block_sptr top_block) void GpsL1CaTcpConnectorTracking::connect(gr::top_block_sptr top_block)
{ {
if(top_block) { /* top_block is not null */}; if(top_block) { /* top_block is not null */};
//nothing to connect, now the tracking uses gr_sync_decimator //nothing to connect, now the tracking uses gr_sync_decimator
} }
void GpsL1CaTcpConnectorTracking::disconnect(gr::top_block_sptr top_block) void GpsL1CaTcpConnectorTracking::disconnect(gr::top_block_sptr top_block)
{ {
if(top_block) { /* top_block is not null */}; if(top_block) { /* top_block is not null */};
//nothing to disconnect, now the tracking uses gr_sync_decimator //nothing to disconnect, now the tracking uses gr_sync_decimator
} }
gr::basic_block_sptr GpsL1CaTcpConnectorTracking::get_left_block() gr::basic_block_sptr GpsL1CaTcpConnectorTracking::get_left_block()

View File

@@ -125,14 +125,14 @@ void GpsL2MDllPllTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
void GpsL2MDllPllTracking::connect(gr::top_block_sptr top_block) void GpsL2MDllPllTracking::connect(gr::top_block_sptr top_block)
{ {
if(top_block) { /* top_block is not null */}; if(top_block) { /* top_block is not null */};
//nothing to connect, now the tracking uses gr_sync_decimator //nothing to connect, now the tracking uses gr_sync_decimator
} }
void GpsL2MDllPllTracking::disconnect(gr::top_block_sptr top_block) void GpsL2MDllPllTracking::disconnect(gr::top_block_sptr top_block)
{ {
if(top_block) { /* top_block is not null */}; if(top_block) { /* top_block is not null */};
//nothing to disconnect, now the tracking uses gr_sync_decimator //nothing to disconnect, now the tracking uses gr_sync_decimator
} }
gr::basic_block_sptr GpsL2MDllPllTracking::get_left_block() gr::basic_block_sptr GpsL2MDllPllTracking::get_left_block()

View File

@@ -309,11 +309,11 @@ int galileo_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items __attri
double code_phase_step_half_chips = (2.0 * d_code_freq_chips) / (static_cast<double>(d_fs_in)); double code_phase_step_half_chips = (2.0 * d_code_freq_chips) / (static_cast<double>(d_fs_in));
double rem_code_phase_half_chips = d_rem_code_phase_samples * (2.0*d_code_freq_chips / d_fs_in); double rem_code_phase_half_chips = d_rem_code_phase_samples * (2.0*d_code_freq_chips / d_fs_in);
multicorrelator_cpu.Carrier_wipeoff_multicorrelator_resampler( multicorrelator_cpu.Carrier_wipeoff_multicorrelator_resampler(
d_rem_carr_phase_rad, d_rem_carr_phase_rad,
carr_phase_step_rad, carr_phase_step_rad,
rem_code_phase_half_chips, rem_code_phase_half_chips,
code_phase_step_half_chips, code_phase_step_half_chips,
d_correlation_length_samples); d_correlation_length_samples);
// ################## PLL ########################################################## // ################## PLL ##########################################################
// PLL discriminator // PLL discriminator
@@ -410,11 +410,11 @@ int galileo_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items __attri
} }
else else
{ {
*d_Early = gr_complex(0,0); *d_Early = gr_complex(0,0);
*d_Prompt = gr_complex(0,0); *d_Prompt = gr_complex(0,0);
*d_Late = gr_complex(0,0); *d_Late = gr_complex(0,0);
// GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder // GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder
current_synchro_data.Tracking_timestamp_secs = (static_cast<double>(d_sample_counter) + static_cast<double>(d_rem_code_phase_samples)) / static_cast<double>(d_fs_in); current_synchro_data.Tracking_timestamp_secs = (static_cast<double>(d_sample_counter) + static_cast<double>(d_rem_code_phase_samples)) / static_cast<double>(d_fs_in);
} }
//assign the GNURadio block output data //assign the GNURadio block output data
current_synchro_data.System = {'E'}; current_synchro_data.System = {'E'};

View File

@@ -303,11 +303,11 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attr
double code_phase_step_half_chips = (2.0 * d_code_freq_chips) / (static_cast<double>(d_fs_in)); double code_phase_step_half_chips = (2.0 * d_code_freq_chips) / (static_cast<double>(d_fs_in));
double rem_code_phase_half_chips = d_rem_code_phase_samples * (2.0*d_code_freq_chips / d_fs_in); double rem_code_phase_half_chips = d_rem_code_phase_samples * (2.0*d_code_freq_chips / d_fs_in);
multicorrelator_cpu.Carrier_wipeoff_multicorrelator_resampler( multicorrelator_cpu.Carrier_wipeoff_multicorrelator_resampler(
d_rem_carr_phase_rad, d_rem_carr_phase_rad,
carr_phase_step_rad, carr_phase_step_rad,
rem_code_phase_half_chips, rem_code_phase_half_chips,
code_phase_step_half_chips, code_phase_step_half_chips,
d_correlation_length_samples); d_correlation_length_samples);
// ################## TCP CONNECTOR ########################################################## // ################## TCP CONNECTOR ##########################################################
//! Variable used for control //! Variable used for control

View File

@@ -37,7 +37,7 @@
*/ */
#ifndef GNSS_SDR_GALILEO_E1_TCP_CONNECTOR_TRACKING_CC_H #ifndef GNSS_SDR_GALILEO_E1_TCP_CONNECTOR_TRACKING_CC_H
#define GNSS_SDR_GALILEO_E1_TCP_CONNECTOR_TRACKING_CC_H #define GNSS_SDR_GALILEO_E1_TCP_CONNECTOR_TRACKING_CC_H
#include <fstream> #include <fstream>
#include <map> #include <map>

View File

@@ -4,7 +4,7 @@
* tracking block for Galileo E5a signals * tracking block for Galileo E5a signals
* \author Marc Sales, 2014. marcsales92(at)gmail.com * \author Marc Sales, 2014. marcsales92(at)gmail.com
* \based on work from: * \based on work from:
* <ul> * <ul>
* <li> Javier Arribas, 2011. jarribas(at)cttc.es * <li> Javier Arribas, 2011. jarribas(at)cttc.es
* <li> Luis Esteve, 2012. luis(at)epsilon-formacion.com * <li> Luis Esteve, 2012. luis(at)epsilon-formacion.com
* </ul> * </ul>
@@ -323,51 +323,51 @@ void Galileo_E5a_Dll_Pll_Tracking_cc::acquire_secondary()
// 1. Transform replica to 1 and -1 // 1. Transform replica to 1 and -1
int sec_code_signed[Galileo_E5a_Q_SECONDARY_CODE_LENGTH]; int sec_code_signed[Galileo_E5a_Q_SECONDARY_CODE_LENGTH];
for (unsigned int i = 0; i < Galileo_E5a_Q_SECONDARY_CODE_LENGTH; i++) for (unsigned int i = 0; i < Galileo_E5a_Q_SECONDARY_CODE_LENGTH; i++)
{ {
if (Galileo_E5a_Q_SECONDARY_CODE[d_acquisition_gnss_synchro->PRN-1].at(i) == '0') if (Galileo_E5a_Q_SECONDARY_CODE[d_acquisition_gnss_synchro->PRN - 1].at(i) == '0')
{ {
sec_code_signed[i] = 1; sec_code_signed[i] = 1;
} }
else else
{ {
sec_code_signed[i] = -1; sec_code_signed[i] = -1;
} }
} }
// 2. Transform buffer to 1 and -1 // 2. Transform buffer to 1 and -1
int in_corr[CN0_ESTIMATION_SAMPLES]; int in_corr[CN0_ESTIMATION_SAMPLES];
for (unsigned int i = 0; i < CN0_ESTIMATION_SAMPLES; i++) for (unsigned int i = 0; i < CN0_ESTIMATION_SAMPLES; i++)
{ {
if (d_Prompt_buffer[i].real() >0) if (d_Prompt_buffer[i].real() >0)
{ {
in_corr[i] = 1; in_corr[i] = 1;
} }
else else
{ {
in_corr[i] = -1; in_corr[i] = -1;
} }
} }
// 3. Serial search // 3. Serial search
int out_corr; int out_corr;
int current_best_ = 0; int current_best_ = 0;
for (unsigned int i = 0; i < Galileo_E5a_Q_SECONDARY_CODE_LENGTH; i++) for (unsigned int i = 0; i < Galileo_E5a_Q_SECONDARY_CODE_LENGTH; i++)
{ {
out_corr = 0; out_corr = 0;
for (unsigned int j = 0; j < CN0_ESTIMATION_SAMPLES; j++) for (unsigned int j = 0; j < CN0_ESTIMATION_SAMPLES; j++)
{ {
//reverse replica sign since i*i=-1 (conjugated complex) //reverse replica sign since i*i=-1 (conjugated complex)
out_corr += in_corr[j] * -sec_code_signed[(j+i) % Galileo_E5a_Q_SECONDARY_CODE_LENGTH]; out_corr += in_corr[j] * -sec_code_signed[(j + i) % Galileo_E5a_Q_SECONDARY_CODE_LENGTH];
} }
if (abs(out_corr) > current_best_) if (abs(out_corr) > current_best_)
{ {
current_best_ = abs(out_corr); current_best_ = abs(out_corr);
d_secondary_delay = i; d_secondary_delay = i;
} }
} }
if (current_best_ == CN0_ESTIMATION_SAMPLES) // all bits correlate if (current_best_ == CN0_ESTIMATION_SAMPLES) // all bits correlate
{ {
d_secondary_lock = true; d_secondary_lock = true;
d_secondary_delay = (d_secondary_delay + CN0_ESTIMATION_SAMPLES - 1) % Galileo_E5a_Q_SECONDARY_CODE_LENGTH; d_secondary_delay = (d_secondary_delay + CN0_ESTIMATION_SAMPLES - 1) % Galileo_E5a_Q_SECONDARY_CODE_LENGTH;
} }
} }
@@ -388,10 +388,10 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute
// Fill the acquisition data // Fill the acquisition data
current_synchro_data = *d_acquisition_gnss_synchro; current_synchro_data = *d_acquisition_gnss_synchro;
/* States: 0 Tracking not enabled /* States: 0 Tracking not enabled
* 1 Pull-in of primary code (alignment). * 1 Pull-in of primary code (alignment).
* 3 Tracking algorithm. Correlates EPL each loop and accumulates the result * 3 Tracking algorithm. Correlates EPL each loop and accumulates the result
* until it reaches integration time. * until it reaches integration time.
*/ */
switch (d_state) switch (d_state)
{ {
@@ -402,7 +402,7 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute
d_Prompt = gr_complex(0,0); d_Prompt = gr_complex(0,0);
d_Late = gr_complex(0,0); d_Late = gr_complex(0,0);
d_Prompt_data = gr_complex(0,0); d_Prompt_data = gr_complex(0,0);
current_synchro_data.Tracking_timestamp_secs = static_cast<double>(d_sample_counter) / static_cast<double>(d_fs_in); current_synchro_data.Tracking_timestamp_secs = static_cast<double>(d_sample_counter) / static_cast<double>(d_fs_in);
*out[0] = current_synchro_data; *out[0] = current_synchro_data;
break; break;
@@ -440,8 +440,8 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute
// Secondary code Chip // Secondary code Chip
if (d_secondary_lock) if (d_secondary_lock)
{ {
// sec_sign_Q = gr_complex((Galileo_E5a_Q_SECONDARY_CODE[d_acquisition_gnss_synchro->PRN-1].at(d_secondary_delay)=='0' ? 1 : -1),0); // sec_sign_Q = gr_complex((Galileo_E5a_Q_SECONDARY_CODE[d_acquisition_gnss_synchro->PRN-1].at(d_secondary_delay)=='0' ? 1 : -1),0);
// sec_sign_I = gr_complex((Galileo_E5a_I_SECONDARY_CODE.at(d_secondary_delay%Galileo_E5a_I_SECONDARY_CODE_LENGTH)=='0' ? 1 : -1),0); // sec_sign_I = gr_complex((Galileo_E5a_I_SECONDARY_CODE.at(d_secondary_delay%Galileo_E5a_I_SECONDARY_CODE_LENGTH)=='0' ? 1 : -1),0);
sec_sign_Q = gr_complex((Galileo_E5a_Q_SECONDARY_CODE[d_acquisition_gnss_synchro->PRN-1].at(d_secondary_delay) == '0' ? -1 : 1), 0); sec_sign_Q = gr_complex((Galileo_E5a_Q_SECONDARY_CODE[d_acquisition_gnss_synchro->PRN-1].at(d_secondary_delay) == '0' ? -1 : 1), 0);
sec_sign_I = gr_complex((Galileo_E5a_I_SECONDARY_CODE.at(d_secondary_delay % Galileo_E5a_I_SECONDARY_CODE_LENGTH) == '0' ? -1 : 1), 0); sec_sign_I = gr_complex((Galileo_E5a_I_SECONDARY_CODE.at(d_secondary_delay % Galileo_E5a_I_SECONDARY_CODE_LENGTH) == '0' ? -1 : 1), 0);
} }
@@ -480,18 +480,18 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute
double code_phase_step_chips = d_code_freq_chips / (static_cast<double>(d_fs_in)); double code_phase_step_chips = d_code_freq_chips / (static_cast<double>(d_fs_in));
double rem_code_phase_chips = d_rem_code_phase_samples * (d_code_freq_chips / d_fs_in); double rem_code_phase_chips = d_rem_code_phase_samples * (d_code_freq_chips / d_fs_in);
multicorrelator_cpu_Q.Carrier_wipeoff_multicorrelator_resampler( multicorrelator_cpu_Q.Carrier_wipeoff_multicorrelator_resampler(
d_rem_carr_phase_rad, d_rem_carr_phase_rad,
carr_phase_step_rad, carr_phase_step_rad,
rem_code_phase_chips, rem_code_phase_chips,
code_phase_step_chips, code_phase_step_chips,
d_current_prn_length_samples); d_current_prn_length_samples);
multicorrelator_cpu_I.Carrier_wipeoff_multicorrelator_resampler( multicorrelator_cpu_I.Carrier_wipeoff_multicorrelator_resampler(
d_rem_carr_phase_rad, d_rem_carr_phase_rad,
carr_phase_step_rad, carr_phase_step_rad,
rem_code_phase_chips, rem_code_phase_chips,
code_phase_step_chips, code_phase_step_chips,
d_current_prn_length_samples); d_current_prn_length_samples);
// Accumulate results (coherent integration since there are no bit transitions in pilot signal) // Accumulate results (coherent integration since there are no bit transitions in pilot signal)

View File

@@ -4,7 +4,7 @@
* tracking block for Galileo E5a signals * tracking block for Galileo E5a signals
* \author Marc Sales, 2014. marcsales92(at)gmail.com * \author Marc Sales, 2014. marcsales92(at)gmail.com
* \based on work from: * \based on work from:
* <ul> * <ul>
* <li> Javier Arribas, 2011. jarribas(at)cttc.es * <li> Javier Arribas, 2011. jarribas(at)cttc.es
* <li> Luis Esteve, 2012. luis(at)epsilon-formacion.com * <li> Luis Esteve, 2012. luis(at)epsilon-formacion.com
* </ul> * </ul>

View File

@@ -336,8 +336,8 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __attri
double old_d_rem_code_phase_samples; double old_d_rem_code_phase_samples;
if (d_enable_tracking == true) if (d_enable_tracking == true)
{ {
// Fill the acquisition data // Fill the acquisition data
current_synchro_data = *d_acquisition_gnss_synchro; current_synchro_data = *d_acquisition_gnss_synchro;
// Receiver signal alignment // Receiver signal alignment
if (d_pull_in == true) if (d_pull_in == true)
{ {
@@ -360,10 +360,10 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __attri
// perform carrier wipe-off and compute Early, Prompt and Late correlation // perform carrier wipe-off and compute Early, Prompt and Late correlation
multicorrelator_cpu.set_input_output_vectors(d_correlator_outs,in); multicorrelator_cpu.set_input_output_vectors(d_correlator_outs,in);
multicorrelator_cpu.Carrier_wipeoff_multicorrelator_resampler(d_rem_carrier_phase_rad, multicorrelator_cpu.Carrier_wipeoff_multicorrelator_resampler(d_rem_carrier_phase_rad,
d_carrier_phase_step_rad, d_carrier_phase_step_rad,
d_rem_code_phase_chips, d_rem_code_phase_chips,
d_code_phase_step_chips, d_code_phase_step_chips,
d_correlation_length_samples); d_correlation_length_samples);
// ####### coherent intergration extension // ####### coherent intergration extension
// keep the last symbols // keep the last symbols

View File

@@ -35,7 +35,7 @@
*/ */
#ifndef GNSS_SDR_GPS_L1_CA_DLL_PLL_C_AID_TRACKING_CC_H #ifndef GNSS_SDR_GPS_L1_CA_DLL_PLL_C_AID_TRACKING_CC_H
#define GNSS_SDR_GPS_L1_CA_DLL_PLL_C_AID_TRACKING_CC_H #define GNSS_SDR_GPS_L1_CA_DLL_PLL_C_AID_TRACKING_CC_H
#include <fstream> #include <fstream>
#include <map> #include <map>

View File

@@ -136,7 +136,7 @@ gps_l1_ca_dll_pll_c_aid_tracking_sc::gps_l1_ca_dll_pll_c_aid_tracking_sc(
d_correlator_outs_16sc = static_cast<lv_16sc_t*>(volk_malloc(d_n_correlator_taps*sizeof(lv_16sc_t), volk_get_alignment())); d_correlator_outs_16sc = static_cast<lv_16sc_t*>(volk_malloc(d_n_correlator_taps*sizeof(lv_16sc_t), volk_get_alignment()));
for (int n = 0; n < d_n_correlator_taps; n++) for (int n = 0; n < d_n_correlator_taps; n++)
{ {
d_correlator_outs_16sc[n] = lv_16sc_t(0,0); d_correlator_outs_16sc[n] = lv_16sc_t(0,0);
} }
d_local_code_shift_chips = static_cast<float*>(volk_malloc(d_n_correlator_taps*sizeof(float), volk_get_alignment())); d_local_code_shift_chips = static_cast<float*>(volk_malloc(d_n_correlator_taps*sizeof(float), volk_get_alignment()));
@@ -314,7 +314,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __attri
double old_d_rem_code_phase_samples; double old_d_rem_code_phase_samples;
if (d_enable_tracking == true) if (d_enable_tracking == true)
{ {
// Fill the acquisition data // Fill the acquisition data
current_synchro_data = *d_acquisition_gnss_synchro; current_synchro_data = *d_acquisition_gnss_synchro;
// Receiver signal alignment // Receiver signal alignment
if (d_pull_in == true) if (d_pull_in == true)

View File

@@ -35,7 +35,7 @@
*/ */
#ifndef GNSS_SDR_GPS_L1_CA_DLL_PLL_C_AID_TRACKING_SC_H #ifndef GNSS_SDR_GPS_L1_CA_DLL_PLL_C_AID_TRACKING_SC_H
#define GNSS_SDR_GPS_L1_CA_DLL_PLL_C_AID_TRACKING_SC_H #define GNSS_SDR_GPS_L1_CA_DLL_PLL_C_AID_TRACKING_SC_H
#include <fstream> #include <fstream>
#include <queue> #include <queue>

View File

@@ -325,10 +325,10 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute__
// perform carrier wipe-off and compute Early, Prompt and Late correlation // perform carrier wipe-off and compute Early, Prompt and Late correlation
multicorrelator_cpu.set_input_output_vectors(d_correlator_outs, in); multicorrelator_cpu.set_input_output_vectors(d_correlator_outs, in);
multicorrelator_cpu.Carrier_wipeoff_multicorrelator_resampler(d_rem_carr_phase_rad, multicorrelator_cpu.Carrier_wipeoff_multicorrelator_resampler(d_rem_carr_phase_rad,
d_carrier_phase_step_rad, d_carrier_phase_step_rad,
d_rem_code_phase_chips, d_rem_code_phase_chips,
d_code_phase_step_chips, d_code_phase_step_chips,
d_current_prn_length_samples); d_current_prn_length_samples);
// ################## PLL ########################################################## // ################## PLL ##########################################################
// PLL discriminator // PLL discriminator

View File

@@ -35,7 +35,7 @@
*/ */
#ifndef GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_CC_H #ifndef GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_CC_H
#define GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_CC_H #define GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_CC_H
#include <fstream> #include <fstream>
#include <map> #include <map>

View File

@@ -310,8 +310,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work (int noutput_items __attribu
double old_d_rem_code_phase_samples; double old_d_rem_code_phase_samples;
if (d_enable_tracking == true) if (d_enable_tracking == true)
{ {
// Fill the acquisition data
// Fill the acquisition data
current_synchro_data = *d_acquisition_gnss_synchro; current_synchro_data = *d_acquisition_gnss_synchro;
// Receiver signal alignment // Receiver signal alignment
if (d_pull_in == true) if (d_pull_in == true)
@@ -338,10 +337,10 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work (int noutput_items __attribu
memcpy(in_gpu, in, sizeof(gr_complex) * d_correlation_length_samples); memcpy(in_gpu, in, sizeof(gr_complex) * d_correlation_length_samples);
cudaProfilerStart(); cudaProfilerStart();
multicorrelator_gpu->Carrier_wipeoff_multicorrelator_resampler_cuda( static_cast<float>(d_rem_carrier_phase_rad), multicorrelator_gpu->Carrier_wipeoff_multicorrelator_resampler_cuda( static_cast<float>(d_rem_carrier_phase_rad),
static_cast<float>(d_carrier_phase_step_rad), static_cast<float>(d_carrier_phase_step_rad),
static_cast<float>(d_code_phase_step_chips), static_cast<float>(d_code_phase_step_chips),
static_cast<float>(d_rem_code_phase_chips), static_cast<float>(d_rem_code_phase_chips),
d_correlation_length_samples, d_n_correlator_taps); d_correlation_length_samples, d_n_correlator_taps);
cudaProfilerStop(); cudaProfilerStop();
//std::cout<<"c_out[0]="<<d_correlator_outs[0]<<"c_out[1]="<<d_correlator_outs[1]<<"c_out[2]="<<d_correlator_outs[2]<<std::endl; //std::cout<<"c_out[0]="<<d_correlator_outs[0]<<"c_out[1]="<<d_correlator_outs[1]<<"c_out[2]="<<d_correlator_outs[2]<<std::endl;
@@ -388,7 +387,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work (int noutput_items __attribu
d_rem_code_phase_samples = K_blk_samples - static_cast<double>(d_correlation_length_samples); //rounding error < 1 sample d_rem_code_phase_samples = K_blk_samples - static_cast<double>(d_correlation_length_samples); //rounding error < 1 sample
// UPDATE REMNANT CARRIER PHASE // UPDATE REMNANT CARRIER PHASE
CORRECTED_INTEGRATION_TIME_S=(static_cast<double>(d_correlation_length_samples)/static_cast<double>(d_fs_in)); CORRECTED_INTEGRATION_TIME_S = (static_cast<double>(d_correlation_length_samples)/static_cast<double>(d_fs_in));
//remnant carrier phase [rad] //remnant carrier phase [rad]
d_rem_carrier_phase_rad = fmod(d_rem_carrier_phase_rad + GPS_TWO_PI * d_carrier_doppler_hz * CORRECTED_INTEGRATION_TIME_S, GPS_TWO_PI); d_rem_carrier_phase_rad = fmod(d_rem_carrier_phase_rad + GPS_TWO_PI * d_carrier_doppler_hz * CORRECTED_INTEGRATION_TIME_S, GPS_TWO_PI);
// UPDATE CARRIER PHASE ACCUULATOR // UPDATE CARRIER PHASE ACCUULATOR

Some files were not shown because too many files have changed in this diff Show More