1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-02-11 16:40:09 +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)),
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++;

View File

@ -29,7 +29,7 @@
*/
#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 <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)),
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();
d_sample_counter++;

View File

@ -28,7 +28,7 @@
*/
#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 <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)),
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++;
bool arrived_galileo_almanac = false;

View File

@ -29,7 +29,7 @@
*/
#ifndef GNSS_SDR_HYBRID_PVT_CC_H
#define GNSS_SDR_HYBRID_PVT_CC_H
#define GNSS_SDR_HYBRID_PVT_CC_H
#include <fstream>
#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 << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl
<< "<kml xmlns=\"http://www.opengis.net/kml/2.2\">" << std::endl
<< " <Document>" << std::endl
<< " <name>GNSS Track</name>" << std::endl
<< " <description>GNSS-SDR Receiver position log file created at " << asctime (timeinfo)
<< " </description>" << std::endl
<< " <Document>" << std::endl
<< " <name>GNSS Track</name>" << std::endl
<< " <description>GNSS-SDR Receiver position log file created at " << asctime (timeinfo)
<< " </description>" << std::endl
<< "<Style id=\"yellowLineGreenPoly\">" << std::endl
<< " <LineStyle>" << std::endl
<< " <color>7f00ffff</color>" << std::endl
<< " <width>1</width>" << std::endl
<< " </LineStyle>" << std::endl
<< " <color>7f00ffff</color>" << std::endl
<< " <width>1</width>" << std::endl
<< " </LineStyle>" << std::endl
<< "<PolyStyle>" << std::endl
<< " <color>7f00ff00</color>" << std::endl
<< " <color>7f00ff00</color>" << std::endl
<< "</PolyStyle>" << std::endl
<< "</Style>" << std::endl
<< "<Placemark>" << std::endl

View File

@ -34,7 +34,7 @@
*/
#ifndef GNSS_SDR_NMEA_PRINTER_H_
#define GNSS_SDR_NMEA_PRINTER_H_
#define GNSS_SDR_NMEA_PRINTER_H_
#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;
for(gps_ephemeris_iter = eph_map.begin();
gps_ephemeris_iter != eph_map.end();
gps_ephemeris_iter++)
gps_ephemeris_iter != eph_map.end();
gps_ephemeris_iter++)
{
// -------- 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);
@ -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
if (seconds < 10)
{
line +=std::string(1, '0');
line += std::string(1, '0');
}
line += Rinex_Printer::asString(seconds, 7);
line += std::string(2, ' ');

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -51,7 +51,7 @@ class ConfigurationInterface;
class GpsL1CaPcpsAcquisitionFineDoppler: public AcquisitionInterface
{
public:
GpsL1CaPcpsAcquisitionFineDoppler(ConfigurationInterface* configuration,
GpsL1CaPcpsAcquisitionFineDoppler(ConfigurationInterface* configuration,
std::string role, unsigned int in_streams,
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;
if (item_type_.compare("gr_complex") == 0)
{
acquisition_cc_->set_channel(channel_);
}
{
acquisition_cc_->set_channel(channel_);
}
}
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)
{
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;
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()
{
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++)
{
memcpy(&(code_[i*code_length_]), code,
sizeof(gr_complex)*code_length_);
}
for (unsigned int i = 0; i < sampled_ms_; i++)
{
memcpy(&(code_[i*code_length_]), code,
sizeof(gr_complex)*code_length_);
}
acquisition_cc_->set_local_code(code_);
acquisition_cc_->set_local_code(code_);
delete[] code;
}
delete[] code;
}
}
void GpsL1CaPcpsMultithreadAcquisition::reset()
{
if (item_type_.compare("gr_complex") == 0)
{
acquisition_cc_->set_active(true);
}
{
acquisition_cc_->set_active(true);
}
}
float GpsL1CaPcpsMultithreadAcquisition::calculate_threshold(float pfa)
{
//Calculate the threshold
//Calculate the threshold
unsigned int frequency_bins = 0;
for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_)
{
frequency_bins++;
}
unsigned int frequency_bins = 0;
for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_)
{
frequency_bins++;
}
DLOG(INFO) << "Channel "<< channel_ << " Pfa = " << pfa;
DLOG(INFO) << "Channel "<< channel_ << " Pfa = " << pfa;
unsigned int ncells = vector_length_ * frequency_bins;
double exponent = 1 / static_cast<double>(ncells);
double val = pow(1.0 - pfa, exponent);
double lambda = double(vector_length_);
boost::math::exponential_distribution<double> mydist (lambda);
float threshold = (float)quantile(mydist,val);
unsigned int ncells = vector_length_ * frequency_bins;
double exponent = 1 / static_cast<double>(ncells);
double val = pow(1.0 - pfa, exponent);
double lambda = double(vector_length_);
boost::math::exponential_distribution<double> mydist (lambda);
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)
{
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;
if (item_type_.compare("gr_complex") == 0)
{
acquisition_cc_->set_channel(channel_);
}
{
acquisition_cc_->set_channel(channel_);
}
}
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)
{
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;
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()
{
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++)
{
memcpy(&(code_[i*code_length_]), code,
sizeof(gr_complex)*code_length_);
}
for (unsigned int i = 0; i < sampled_ms_; i++)
{
memcpy(&(code_[i*code_length_]), code,
sizeof(gr_complex)*code_length_);
}
acquisition_cc_->set_local_code(code_);
acquisition_cc_->set_local_code(code_);
delete[] code;
}
delete[] code;
}
}
void GpsL1CaPcpsOpenClAcquisition::reset()
{
if (item_type_.compare("gr_complex") == 0)
{
acquisition_cc_->set_active(true);
}
{
acquisition_cc_->set_active(true);
}
}
float GpsL1CaPcpsOpenClAcquisition::calculate_threshold(float pfa)
{
//Calculate the threshold
//Calculate the threshold
unsigned int frequency_bins = 0;
for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_)
{
frequency_bins++;
}
unsigned int frequency_bins = 0;
for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_)
{
frequency_bins++;
}
DLOG(INFO) << "Channel " << channel_ << " Pfa = " << pfa;
DLOG(INFO) << "Channel " << channel_ << " Pfa = " << pfa;
unsigned int ncells = vector_length_ * frequency_bins;
double exponent = 1 / static_cast<double>(ncells);
double val = pow(1.0 - pfa, exponent);
double lambda = double(vector_length_);
boost::math::exponential_distribution<double> mydist (lambda);
float threshold = (float)quantile(mydist,val);
unsigned int ncells = vector_length_ * frequency_bins;
double exponent = 1 / static_cast<double>(ncells);
double val = pow(1.0 - pfa, exponent);
double lambda = double(vector_length_);
boost::math::exponential_distribution<double> mydist (lambda);
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);
}
}
void GpsL1CaPcpsOpenClAcquisition::disconnect(gr::top_block_sptr top_block)
{
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
* \author Marc Sales, 2014. marcsales92(at)gmail.com
* \based on work from:
* <ul>
* <ul>
* <li> Javier Arribas, 2011. jarribas(at)cttc.es
* <li> Luis Esteve, 2012. luis(at)epsilon-formacion.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
/* States: 0 Stop Channel
* 1 Load the buffer until it reaches fft_size
* 2 Acquisition algorithm
* 3 Positive acquisition
* 4 Negative acquisition
/* States: 0 Stop Channel
* 1 Load the buffer until it reaches fft_size
* 2 Acquisition algorithm
* 3 Positive acquisition
* 4 Negative acquisition
*/
switch (d_state)
{

View File

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

View File

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

View File

@ -76,41 +76,40 @@ private:
void calculate_magnitudes(gr_complex* fft_begin, int doppler_shift,
int doppler_offset);
long d_fs_in;
long d_freq;
int d_samples_per_ms;
long d_fs_in;
long d_freq;
int d_samples_per_ms;
int d_samples_per_code;
unsigned int d_doppler_resolution;
float d_threshold;
unsigned int d_doppler_resolution;
float d_threshold;
std::string d_satellite_str;
unsigned int d_doppler_max;
unsigned int d_doppler_step;
unsigned int d_sampled_ms;
unsigned int d_doppler_max;
unsigned int d_doppler_step;
unsigned int d_sampled_ms;
unsigned int d_max_dwells;
unsigned int d_well_count;
unsigned int d_fft_size;
unsigned long int d_sample_counter;
unsigned int d_fft_size;
unsigned long int d_sample_counter;
gr_complex** d_grid_doppler_wipeoffs;
unsigned int d_num_doppler_bins;
gr_complex* d_fft_code_A;
gr_complex* d_fft_code_B;
gr::fft::fft_complex* d_fft_if;
gr::fft::fft_complex* d_ifft;
gr::fft::fft_complex* d_fft_if;
gr::fft::fft_complex* d_ifft;
Gnss_Synchro *d_gnss_synchro;
unsigned int d_code_phase;
float d_doppler_freq;
float d_mag;
unsigned int d_code_phase;
float d_doppler_freq;
float d_mag;
float* d_magnitude;
float d_input_power;
float d_test_statistics;
float d_input_power;
float d_test_statistics;
gr::msg_queue::sptr d_queue;
std::ofstream d_dump_file;
bool d_active;
std::ofstream d_dump_file;
bool d_active;
int d_state;
bool d_dump;
unsigned int d_channel;
std::string d_dump_filename;
bool d_dump;
unsigned int d_channel;
std::string d_dump_filename;
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,
long fs_in, int samples_per_ms, boost::shared_ptr<gr::msg_queue> queue, bool dump,
std::string dump_filename) :
gr::block("pcps_acquisition_fine_doppler_cc",
gr::io_signature::make(1, 1, sizeof(gr_complex)),
gr::io_signature::make(0, 0, sizeof(gr_complex)))
gr::block("pcps_acquisition_fine_doppler_cc",
gr::io_signature::make(1, 1, sizeof(gr_complex)),
gr::io_signature::make(0, 0, sizeof(gr_complex)))
{
this->message_port_register_out(pmt::mp("events"));
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";
//debug log
//
// std::cout<<"FFT maximum present at "<<fftFreqBins[tmp_index_freq]<<" [Hz]"<<std::endl;
// std::stringstream filename;
// std::streamsize n = sizeof(gr_complex) * (d_fft_size);
// std::cout<<"FFT maximum present at "<<fftFreqBins[tmp_index_freq]<<" [Hz]"<<std::endl;
// std::stringstream filename;
// std::streamsize n = sizeof(gr_complex) * (d_fft_size);
//
// filename.str("");
// filename << "../data/code_prn_" << d_gnss_synchro->PRN << ".dat";
// d_dump_file.open(filename.str().c_str(), std::ios::out
// | std::ios::binary);
// d_dump_file.write((char*)code_replica, n); //write directly |abs(x)|^2 in this Doppler bin?
// d_dump_file.close();
// filename.str("");
// filename << "../data/code_prn_" << d_gnss_synchro->PRN << ".dat";
// d_dump_file.open(filename.str().c_str(), std::ios::out
// | std::ios::binary);
// d_dump_file.write((char*)code_replica, n); //write directly |abs(x)|^2 in this Doppler bin?
// d_dump_file.close();
//
// filename.str("");
// filename << "../data/signal_prn_" << d_gnss_synchro->PRN << ".dat";
// d_dump_file.open(filename.str().c_str(), std::ios::out
// | std::ios::binary);
// d_dump_file.write((char*)in, n); //write directly |abs(x)|^2 in this Doppler bin?
// d_dump_file.close();
// filename.str("");
// filename << "../data/signal_prn_" << d_gnss_synchro->PRN << ".dat";
// d_dump_file.open(filename.str().c_str(), std::ios::out
// | std::ios::binary);
// d_dump_file.write((char*)in, n); //write directly |abs(x)|^2 in this Doppler bin?
// d_dump_file.close();
//
//
// n = sizeof(float) * (fft_size_extended);
// filename.str("");
// filename << "../data/fft_prn_" << d_gnss_synchro->PRN << ".dat";
// d_dump_file.open(filename.str().c_str(), std::ios::out
// | std::ios::binary);
// d_dump_file.write((char*)p_tmp_vector, n); //write directly |abs(x)|^2 in this Doppler bin?
// d_dump_file.close();
// n = sizeof(float) * (fft_size_extended);
// filename.str("");
// filename << "../data/fft_prn_" << d_gnss_synchro->PRN << ".dat";
// d_dump_file.open(filename.str().c_str(), std::ios::out
// | std::ios::binary);
// d_dump_file.write((char*)p_tmp_vector, n); //write directly |abs(x)|^2 in this Doppler bin?
// d_dump_file.close();
}
@ -436,17 +436,17 @@ int pcps_acquisition_fine_doppler_cc::general_work(int noutput_items,
{
/*!
* TODO: High sensitivity acquisition algorithm:
* State Mechine:
* S0. StandBy. If d_active==1 -> S1
* S1. ComputeGrid. Perform the FFT acqusition doppler and delay grid.
* Accumulate the search grid matrix (#doppler_bins x #fft_size)
* Compare maximum to threshold and decide positive or negative
* If T>=gamma -> S4 else
* If d_well_count<max_dwells -> S2
* else -> S5.
* S4. Positive_Acq: Send message and stop acq -> S0
* S5. Negative_Acq: Send message and stop acq -> S0
* TODO: High sensitivity acquisition algorithm:
* State Mechine:
* S0. StandBy. If d_active==1 -> S1
* S1. ComputeGrid. Perform the FFT acqusition doppler and delay grid.
* Accumulate the search grid matrix (#doppler_bins x #fft_size)
* Compare maximum to threshold and decide positive or negative
* If T>=gamma -> S4 else
* If d_well_count<max_dwells -> S2
* else -> S5.
* S4. Positive_Acq: Send message and stop acq -> S0
* S5. Negative_Acq: Send message and stop acq -> S0
*/
switch (d_state)

View File

@ -95,9 +95,8 @@ private:
std::string dump_filename);
void update_local_carrier(gr_complex* carrier_vector,
int correlator_length_samples,
float freq);
int correlator_length_samples,
float freq);
long d_fs_in;
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,
std::string dump_filename)
{
return pcps_assisted_acquisition_cc_sptr(
new pcps_assisted_acquisition_cc(max_dwells, sampled_ms, doppler_max, doppler_min, freq,
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,
long fs_in, int samples_per_ms, boost::shared_ptr<gr::msg_queue> queue, bool dump,
std::string dump_filename) :
gr::block("pcps_assisted_acquisition_cc",
gr::io_signature::make(1, 1, sizeof(gr_complex)),
gr::io_signature::make(0, 0, sizeof(gr_complex)))
gr::block("pcps_assisted_acquisition_cc",
gr::io_signature::make(1, 1, sizeof(gr_complex)),
gr::io_signature::make(0, 0, sizeof(gr_complex)))
{
this->message_port_register_out(pmt::mp("events"));
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)))
{
/*!
* TODO: High sensitivity acquisition algorithm:
* State Mechine:
* S0. StandBy. If d_active==1 -> S1
* S1. GetAssist. Define search grid with assistance information. Reset grid matrix -> S2
* S2. ComputeGrid. Perform the FFT acqusition doppler and delay grid.
* Accumulate the search grid matrix (#doppler_bins x #fft_size)
* Compare maximum to threshold and decide positive or negative
* If T>=gamma -> S4 else
* If d_well_count<max_dwells -> S2
* else if !disable_assist -> S3
* else -> S5.
* S3. RedefineGrid. Open the grid search to unasisted acquisition. Reset counters and grid. -> S2
* S4. Positive_Acq: Send message and stop acq -> S0
* S5. Negative_Acq: Send message and stop acq -> S0
* TODO: High sensitivity acquisition algorithm:
* State Mechine:
* S0. StandBy. If d_active==1 -> S1
* S1. GetAssist. Define search grid with assistance information. Reset grid matrix -> S2
* S2. ComputeGrid. Perform the FFT acqusition doppler and delay grid.
* Accumulate the search grid matrix (#doppler_bins x #fft_size)
* Compare maximum to threshold and decide positive or negative
* If T>=gamma -> S4 else
* If d_well_count<max_dwells -> S2
* else if !disable_assist -> S3
* else -> S5.
* S3. RedefineGrid. Open the grid search to unasisted acquisition. Reset counters and grid. -> S2
* S4. Positive_Acq: Send message and stop acq -> S0
* S5. Negative_Acq: Send message and stop acq -> S0
*/
switch (d_state)

View File

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

View File

@ -134,6 +134,7 @@ pcps_quicksync_acquisition_cc::pcps_quicksync_acquisition_cc(
// DLOG(INFO) << "END CONSTRUCTOR";
}
pcps_quicksync_acquisition_cc::~pcps_quicksync_acquisition_cc()
{
//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
filename.str("");
filename << "../data/test_statistics_" << d_gnss_synchro->System
<< "_" << d_gnss_synchro->Signal << "_sat_"
<< d_gnss_synchro->PRN << "_doppler_" << doppler << ".dat";
<< "_" << d_gnss_synchro->Signal << "_sat_"
<< d_gnss_synchro->PRN << "_doppler_" << doppler << ".dat";
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.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 threshold " << d_threshold;
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];
DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples;
DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz;

View File

@ -137,7 +137,7 @@ ChannelFsm::ChannelFsm()
ChannelFsm::ChannelFsm(std::shared_ptr<AcquisitionInterface> acquisition) :
acq_(acquisition)
acq_(acquisition)
{
trk_ = nullptr;
channel_ = 0;
@ -177,7 +177,7 @@ void ChannelFsm::Event_failed_tracking_standby()
}
//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)

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)
&& (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_, 1, fir_filter_fff_2_, 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);
if (dump_)
{
top_block->connect(float_to_complex_, 0, file_sink_, 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_2_, 0, float_to_complex_, 1);
if (dump_)
{
top_block->connect(float_to_complex_, 0, file_sink_, 0);
}
}
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)
&& (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_, 1, fir_filter_fff_2_, 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);
if (dump_)
{
top_block->disconnect(float_to_complex_, 0, file_sink_, 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_2_, 0, float_to_complex_, 1);
if (dump_)
{
top_block->disconnect(float_to_complex_, 0, file_sink_, 0);
}
}
else
{
@ -314,7 +314,7 @@ gr::basic_block_sptr FirFilter::get_left_block()
return cbyte_to_float_x2_;
}
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_;
}
@ -350,7 +350,7 @@ gr::basic_block_sptr FirFilter::get_right_block()
return char_x2_cbyte_;
}
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_;
}

View File

@ -41,53 +41,55 @@ beamformer_sptr make_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){};
for (int i=0;i<GNSS_SDR_BEAMFORMER_CHANNELS;i++)
{
weight_vector[i]=gr_complex(1,0);
}
for (int i = 0; i< GNSS_SDR_BEAMFORMER_CHANNELS; i++)
{
weight_vector[i]=gr_complex(1,0);
}
}
beamformer::~beamformer()
{
free(weight_vector);
free(weight_vector);
}
int beamformer::work(int noutput_items,gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
{
gr_complex *out = (gr_complex *) output_items[0];
// channel output buffers
// gr_complex *ch1 = (gr_complex *) input_items[0];
// gr_complex *ch2 = (gr_complex *) input_items[1];
// gr_complex *ch3 = (gr_complex *) input_items[2];
// gr_complex *ch4 = (gr_complex *) input_items[3];
// gr_complex *ch5 = (gr_complex *) input_items[4];
// gr_complex *ch6 = (gr_complex *) input_items[5];
// gr_complex *ch7 = (gr_complex *) input_items[6];
// gr_complex *ch8 = (gr_complex *) input_items[7];
// channel output buffers
// gr_complex *ch1 = (gr_complex *) input_items[0];
// gr_complex *ch2 = (gr_complex *) input_items[1];
// gr_complex *ch3 = (gr_complex *) input_items[2];
// gr_complex *ch4 = (gr_complex *) input_items[3];
// gr_complex *ch5 = (gr_complex *) input_items[4];
// gr_complex *ch6 = (gr_complex *) input_items[5];
// gr_complex *ch7 = (gr_complex *) input_items[6];
// gr_complex *ch8 = (gr_complex *) input_items[7];
// NON-VOLK beamforming operation
// NON-VOLK beamforming operation
//TODO: Implement VOLK SIMD-accelerated beamformer!
gr_complex sum;
for(int n=0;n<noutput_items;n++)
{
sum=gr_complex(0,0);
for (int i=0;i<GNSS_SDR_BEAMFORMER_CHANNELS;i++)
{
sum=sum+((gr_complex *) input_items[i])[n]*weight_vector[i];
}
out[n]=sum;
}
gr_complex sum;
for(int n = 0; n < noutput_items; n++)
{
sum = gr_complex(0,0);
for (int i = 0; i < GNSS_SDR_BEAMFORMER_CHANNELS; i++)
{
sum = sum + ((gr_complex*)input_items[i])[n] * weight_vector[i];
}
out[n] = sum;
}
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;
int a[4];
if ((_prn < 1) || (_prn > 50))
{
return;
}
{
return;
}
if (_Signal[0] == '5' && _Signal[1] == 'Q')
{
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));
_dest[index] = std::complex<float>(0.0, float(a[0]));
_dest[index + 1] = std::complex<float>(0.0, float(a[1]));
_dest[index + 2] = std::complex<float>(0.0, float(a[2]));
_dest[index + 3] = std::complex<float>(0.0, float(a[3]));
index = index + 4;
}
// 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));
_dest[index] = std::complex<float>(float(0.0), a[0]);
_dest[index + 1] = std::complex<float>(float(0.0), a[1]);
}
{
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));
_dest[index] = std::complex<float>(0.0, float(a[0]));
_dest[index + 1] = std::complex<float>(0.0, float(a[1]));
_dest[index + 2] = std::complex<float>(0.0, float(a[2]));
_dest[index + 3] = std::complex<float>(0.0, float(a[3]));
index = index + 4;
}
// 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));
_dest[index] = std::complex<float>(float(0.0), a[0]);
_dest[index + 1] = std::complex<float>(float(0.0), a[1]);
}
else if (_Signal[0] == '5' && _Signal[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));
_dest[index] = std::complex<float>(float(a[0]), 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 + 3] = std::complex<float>(float(a[3]), 0.0);
index = index + 4;
}
// 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));
_dest[index] = std::complex<float>(float(a[0]), 0.0);
_dest[index + 1] = std::complex<float>(float(a[1]), 0.0);
}
{
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));
_dest[index] = std::complex<float>(float(a[0]), 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 + 3] = std::complex<float>(float(a[3]), 0.0);
index = index + 4;
}
// 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));
_dest[index] = std::complex<float>(float(a[0]), 0.0);
_dest[index + 1] = std::complex<float>(float(a[1]), 0.0);
}
else if (_Signal[0] == '5' && _Signal[1] == 'X')
{
int b[4];
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(b, Galileo_E5a_Q_PRIMARY_CODE[prn].at(i));
_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 + 2] = std::complex<float>(float(a[2]),float(b[2]));
_dest[index + 3] = std::complex<float>(float(a[3]),float(b[3]));
index = index + 4;
}
// 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(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 + 1] = std::complex<float>(float(a[1]), float(b[1]));
}
{
int b[4];
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(b, Galileo_E5a_Q_PRIMARY_CODE[prn].at(i));
_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 + 2] = std::complex<float>(float(a[2]),float(b[2]));
_dest[index + 3] = std::complex<float>(float(a[3]),float(b[3]));
index = index + 4;
}
// 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(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 + 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],
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 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.
*/
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_ */

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));
return valve_;
@ -61,11 +58,10 @@ int gnss_sdr_valve::work (int noutput_items,
{
if (d_ncopied_items >= d_nitems)
{
ControlMessageFactory* cmf = new ControlMessageFactory();
d_queue->handle(cmf->GetQueueMessage(200,0));
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);
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,
unsigned long long nitems,
gr::msg_queue::sptr queue);
unsigned long long d_nitems;
unsigned long long d_ncopied_items;
unsigned long long d_nitems;
unsigned long long d_ncopied_items;
gr::msg_queue::sptr d_queue;
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)
{
switch(_from)
{
case '0':
*(_dest) = 1;
*(_dest+1) = 1;
*(_dest+2) = 1;
*(_dest+3) = 1;
break;
case '1':
*(_dest) = 1;
*(_dest+1) = 1;
*(_dest+2) = 1;
*(_dest+3) = -1;
break;
case '2':
*(_dest) = 1;
*(_dest+1) = 1;
*(_dest+2) = -1;
*(_dest+3) = 1;
break;
case '3':
*(_dest) = 1;
*(_dest+1) = 1;
*(_dest+2) = -1;
*(_dest+3) = -1;
break;
case '4':
*(_dest) = 1;
*(_dest+1) = -1;
*(_dest+2) = 1;
*(_dest+3) = 1;
break;
case '5':
*(_dest) = 1;
*(_dest+1) = -1;
*(_dest+2) = 1;
*(_dest+3) = -1;
break;
case '6':
*(_dest) = 1;
*(_dest+1) = -1;
*(_dest+2) = -1;
*(_dest+3) = 1;
break;
case '7':
*(_dest) = 1;
*(_dest+1) = -1;
*(_dest+2) = -1;
*(_dest+3) = -1;
break;
case '8':
*(_dest) = -1;
*(_dest+1) = 1;
*(_dest+2) = 1;
*(_dest+3) = 1;
break;
case '9':
*(_dest) = -1;
*(_dest+1) = 1;
*(_dest+2) = 1;
*(_dest+3) = -1;
break;
case 'A':
*(_dest) = -1;
*(_dest+1) = 1;
*(_dest+2) = -1;
*(_dest+3) = 1;
break;
case 'B':
*(_dest) = -1;
*(_dest+1) = 1;
*(_dest+2) = -1;
*(_dest+3) = -1;
break;
case 'C':
*(_dest) = -1;
*(_dest+1) = -1;
*(_dest+2) = 1;
*(_dest+3) = 1;
break;
case 'D':
*(_dest) = -1;
*(_dest+1) = -1;
*(_dest+2) = 1;
*(_dest+3) = -1;
break;
case 'E':
*(_dest) = -1;
*(_dest+1) = -1;
*(_dest+2) = -1;
*(_dest+3) = 1;
break;
case 'F':
*(_dest) = -1;
*(_dest+1) = -1;
*(_dest+2) = -1;
*(_dest+3) = -1;
break;
}
switch(_from)
{
case '0':
*(_dest) = 1;
*(_dest+1) = 1;
*(_dest+2) = 1;
*(_dest+3) = 1;
break;
case '1':
*(_dest) = 1;
*(_dest+1) = 1;
*(_dest+2) = 1;
*(_dest+3) = -1;
break;
case '2':
*(_dest) = 1;
*(_dest+1) = 1;
*(_dest+2) = -1;
*(_dest+3) = 1;
break;
case '3':
*(_dest) = 1;
*(_dest+1) = 1;
*(_dest+2) = -1;
*(_dest+3) = -1;
break;
case '4':
*(_dest) = 1;
*(_dest+1) = -1;
*(_dest+2) = 1;
*(_dest+3) = 1;
break;
case '5':
*(_dest) = 1;
*(_dest+1) = -1;
*(_dest+2) = 1;
*(_dest+3) = -1;
break;
case '6':
*(_dest) = 1;
*(_dest+1) = -1;
*(_dest+2) = -1;
*(_dest+3) = 1;
break;
case '7':
*(_dest) = 1;
*(_dest+1) = -1;
*(_dest+2) = -1;
*(_dest+3) = -1;
break;
case '8':
*(_dest) = -1;
*(_dest+1) = 1;
*(_dest+2) = 1;
*(_dest+3) = 1;
break;
case '9':
*(_dest) = -1;
*(_dest+1) = 1;
*(_dest+2) = 1;
*(_dest+3) = -1;
break;
case 'A':
*(_dest) = -1;
*(_dest+1) = 1;
*(_dest+2) = -1;
*(_dest+3) = 1;
break;
case 'B':
*(_dest) = -1;
*(_dest+1) = 1;
*(_dest+2) = -1;
*(_dest+3) = -1;
break;
case 'C':
*(_dest) = -1;
*(_dest+1) = -1;
*(_dest+2) = 1;
*(_dest+3) = 1;
break;
case 'D':
*(_dest) = -1;
*(_dest+1) = -1;
*(_dest+2) = 1;
*(_dest+3) = -1;
break;
case 'E':
*(_dest) = -1;
*(_dest+1) = -1;
*(_dest+2) = -1;
*(_dest+3) = 1;
break;
case 'F':
*(_dest) = -1;
*(_dest+1) = -1;
*(_dest+2) = -1;
*(_dest+3) = -1;
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
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 - 87; // SBAS PRNs are at array indices 31 to 50 (offset: -120+33 =-87)
}
{
prn_idx = _prn - 88; // SBAS PRNs are at array indices 31 to 50 (offset: -120+33-1 =-88)
}
else
{
prn_idx = _prn - 1;
}
{
prn_idx = _prn - 1;
}
/* A simple error check */
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)
{
if(top_block) { /* top_block is not null */};
DLOG(INFO) << "nothing to connect internally";
if(top_block) { /* top_block is not null */};
DLOG(INFO) << "nothing to connect internally";
}
void Pass_Through::disconnect(gr::top_block_sptr top_block)
{
if(top_block) { /* top_block is not null */};
// Nothing to disconnect
if(top_block) { /* top_block is not null */};
// Nothing to disconnect
}

View File

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

View File

@ -47,10 +47,10 @@ class ConfigurationInterface;
class HybridObservables : public ObservablesInterface
{
public:
HybridObservables(ConfigurationInterface* configuration,
std::string role,
unsigned int in_streams,
unsigned int out_streams);
HybridObservables(ConfigurationInterface* configuration,
std::string role,
unsigned int in_streams,
unsigned int out_streams);
virtual ~HybridObservables();
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) :
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::block("galileo_e1_observables_cc", gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)),
gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)))
{
// initialize internal vars
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,
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 **out = (Gnss_Synchro **) &output_items[0]; // Get the output pointer

View File

@ -31,7 +31,7 @@
#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>

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) :
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::block("gps_l1_ca_observables_cc", gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)),
gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)))
{
// initialize internal vars
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,
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 **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()));
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,acc_phase_vec_rads,desired_symbol_TOW,acc_phase_vec_interp_rads);
// 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);
// Curve fitting to cuadratic function
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
#define GNSS_SDR_GPS_L1_CA_OBSERVABLES_CC_H
#define GNSS_SDR_GPS_L1_CA_OBSERVABLES_CC_H
#include <deque>
#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) :
gr::block("hybrid_observables_cc", gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)),
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)))
{
// initialize internal vars
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,
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 **out = (Gnss_Synchro **) &output_items[0]; // Get the output pointer

View File

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

View File

@ -37,7 +37,7 @@
*/
#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 <volk/volk.h>

View File

@ -30,7 +30,7 @@
*/
#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 <volk/volk.h>

View File

@ -41,9 +41,9 @@
using google::LogMessage;
SignalGenerator::SignalGenerator(ConfigurationInterface* configuration,
std::string role, unsigned int in_stream,
unsigned int out_stream, boost::shared_ptr<gr::msg_queue> queue) :
role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue)
std::string role, unsigned int in_stream,
unsigned int out_stream, boost::shared_ptr<gr::msg_queue> queue) :
role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue)
{
std::string default_item_type = "gr_complex";
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
unsigned int vector_length = 0;
if (std::find(system.begin(), system.end(), "E") != system.end())
{
if (signal1[0].at(0)=='5')
{
vector_length = round((float) fs_in / (Galileo_E5a_CODE_CHIP_RATE_HZ
/ Galileo_E5a_CODE_LENGTH_CHIPS));
}
else
{
vector_length = round((float)fs_in / (Galileo_E1_CODE_CHIP_RATE_HZ
/ Galileo_E1_B_CODE_LENGTH_CHIPS))
* Galileo_E1_C_SECONDARY_CODE_LENGTH;
}
}
{
if (signal1[0].at(0)=='5')
{
vector_length = round((float) fs_in / (Galileo_E5a_CODE_CHIP_RATE_HZ
/ Galileo_E5a_CODE_LENGTH_CHIPS));
}
else
{
vector_length = round((float)fs_in / (Galileo_E1_CODE_CHIP_RATE_HZ
/ Galileo_E1_B_CODE_LENGTH_CHIPS))
* Galileo_E1_C_SECONDARY_CODE_LENGTH;
}
}
else if (std::find(system.begin(), system.end(), "G") != system.end())
{
vector_length = round((float)fs_in
/ (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS));
}
{
vector_length = round((float)fs_in
/ (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS));
}
if (item_type_.compare("gr_complex") == 0)
{
item_size_ = sizeof(gr_complex);
DLOG(INFO) << "Item size " << item_size_;
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);
@ -146,10 +146,10 @@ void SignalGenerator::connect(gr::top_block_sptr top_block)
DLOG(INFO) << "connected gen_source to vector_to_stream";
if (dump_)
{
top_block->connect(vector_to_stream_, 0, file_sink_, 0);
DLOG(INFO) << "connected vector_to_stream_ to file sink";
}
{
top_block->connect(vector_to_stream_, 0, file_sink_, 0);
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);
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<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) :
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)),
signal_(signal1),
system_(system),
@ -112,23 +111,23 @@ void signal_generator_c::init()
}
else if (system_[sat] == "E")
{
if (signal_[sat].at(0) == '5')
{
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
/ codelen)));
num_of_codes_per_vector_.push_back(1);
if (signal_[sat].at(0) == '5')
{
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
/ codelen)));
num_of_codes_per_vector_.push_back(1);
data_bit_duration_ms_.push_back(1e3/Galileo_E5a_SYMBOL_RATE_BPS);
}
else
{
samples_per_code_.push_back(round(static_cast<float>(fs_in_) / (Galileo_E1_CODE_CHIP_RATE_HZ
/ Galileo_E1_B_CODE_LENGTH_CHIPS)));
data_bit_duration_ms_.push_back(1e3/Galileo_E5a_SYMBOL_RATE_BPS);
}
else
{
samples_per_code_.push_back(round(static_cast<float>(fs_in_) / (Galileo_E1_CODE_CHIP_RATE_HZ
/ Galileo_E1_B_CODE_LENGTH_CHIPS)));
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);
}
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);
}
}
}
random_ = new gr::random();
@ -150,7 +149,7 @@ void signal_generator_c::generate_codes()
{
// Generate one code-period of 1C signal
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.
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++)
{
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")
{
if(signal_[sat].at(0) == '5')
{
char signal[3];
strcpy(signal, "5X");
if(signal_[sat].at(0) == '5')
{
char signal[3];
strcpy(signal, "5X");
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]);
//noise
if (noise_flag_)
{
for (unsigned int i = 0; i < vector_length_; i++)
{
sampled_code_data_[sat][i] *= sqrt(pow(10, CN0_dB_[sat] / 10) / BW_BB_ / 2);
}
}
}
else
{
// Generate one code-period of E1B signal
bool cboc = true;
char signal[3];
strcpy(signal, "1B");
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]);
//noise
if (noise_flag_)
{
for (unsigned int i = 0; i < vector_length_; i++)
{
sampled_code_data_[sat][i] *= sqrt(pow(10, CN0_dB_[sat] / 10) / BW_BB_ / 2);
}
}
}
else
{
// Generate one code-period of E1B signal
bool cboc = true;
char signal[3];
strcpy(signal, "1B");
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]);
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]);
// Obtain the desired CN0 assuming that Pn = 1.
if (noise_flag_)
{
for (unsigned int i = 0; i < samples_per_code_[sat]; i++)
{
code[i] *= sqrt(pow(10, CN0_dB_[sat] / 10) / BW_BB_ / 2);
}
}
// Obtain the desired CN0 assuming that Pn = 1.
if (noise_flag_)
{
for (unsigned int i = 0; i < samples_per_code_[sat]; i++)
{
code[i] *= sqrt(pow(10, CN0_dB_[sat] / 10) / BW_BB_ / 2);
}
}
// Concatenate "num_of_codes_per_vector_" codes
for (unsigned int i = 0; i < num_of_codes_per_vector_[sat]; i++)
{
memcpy(&(sampled_code_data_[sat][i * samples_per_code_[sat]]),
code, sizeof(gr_complex) * samples_per_code_[sat]);
}
// Concatenate "num_of_codes_per_vector_" codes
for (unsigned int i = 0; i < num_of_codes_per_vector_[sat]; i++)
{
memcpy(&(sampled_code_data_[sat][i * samples_per_code_[sat]]),
code, sizeof(gr_complex) * samples_per_code_[sat]);
}
// Generate E1C signal (25 code-periods, with secondary code)
sampled_code_pilot_[sat] = static_cast<gr_complex*>(std::malloc(vector_length_ * sizeof(gr_complex)));
// Generate E1C signal (25 code-periods, with secondary code)
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_,
static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS) - delay_chips_[sat], true);
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);
// Obtain the desired CN0 assuming that Pn = 1.
if (noise_flag_)
{
for (unsigned int i = 0; i < vector_length_; i++)
{
sampled_code_pilot_[sat][i] *= sqrt(pow(10, CN0_dB_[sat] / 10) / BW_BB_ / 2);
}
}
}
// Obtain the desired CN0 assuming that Pn = 1.
if (noise_flag_)
{
for (unsigned int i = 0; i < vector_length_; i++)
{
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()
{
/* for (unsigned int sat = 0; sat < num_sats_; sat++)
/* for (unsigned int sat = 0; sat < num_sats_; sat++)
{
std::free(sampled_code_data_[sat]);
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)),
gr_vector_int &ninput_items __attribute__((unused)),
gr_vector_const_void_star &input_items __attribute__((unused)),
gr_vector_void_star &output_items)
gr_vector_int &ninput_items __attribute__((unused)),
gr_vector_const_void_star &input_items __attribute__((unused)),
gr_vector_void_star &output_items)
{
gr_complex *out = (gr_complex *) output_items[0];
@ -281,102 +280,102 @@ gr_vector_void_star &output_items)
if (system_[sat] == "G")
{
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 (k = 0; k < delay_samples; k++)
{
out[out_idx] += sampled_code_data_[sat][out_idx]
* current_data_bits_[sat]
* complex_phase_[out_idx];
* current_data_bits_[sat]
* complex_phase_[out_idx];
out_idx++;
}
if (ms_counter_[sat] == 0 && data_flag_)
{
// New random data bit
current_data_bits_[sat] = gr_complex((rand() % 2) == 0 ? 1 : -1, 0);
}
{
// New random data bit
current_data_bits_[sat] = gr_complex((rand() % 2) == 0 ? 1 : -1, 0);
}
for (k = delay_samples; k < samples_per_code_[sat]; k++)
{
out[out_idx] += sampled_code_data_[sat][out_idx]
* current_data_bits_[sat]
* complex_phase_[out_idx];
* current_data_bits_[sat]
* complex_phase_[out_idx];
out_idx++;
}
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")
{
if(signal_[sat].at(0)=='5')
{
// EACH WORK outputs 1 modulated primary code
int codelen = static_cast<int>(Galileo_E5a_CODE_LENGTH_CHIPS);
unsigned int delay_samples = (delay_chips_[sat] % codelen)
* samples_per_code_[sat] / codelen;
for (k = 0; k < delay_samples; k++)
{
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]) )
* complex_phase_[out_idx];
out_idx++;
}
if(signal_[sat].at(0)=='5')
{
// EACH WORK outputs 1 modulated primary code
int codelen = static_cast<int>(Galileo_E5a_CODE_LENGTH_CHIPS);
unsigned int delay_samples = (delay_chips_[sat] % codelen)
* samples_per_code_[sat] / codelen;
for (k = 0; k < delay_samples; k++)
{
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]) )
* complex_phase_[out_idx];
out_idx++;
}
if (ms_counter_[sat]%data_bit_duration_ms_[sat] == 0 && data_flag_)
{
// New random data bit
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);
pilot_modulation_[sat] = (Galileo_E5a_Q_SECONDARY_CODE[PRN_[sat] - 1].at((ms_counter_[sat] + delay_sec_[sat]) % 100) == '0' ? 1 : -1);
if (ms_counter_[sat]%data_bit_duration_ms_[sat] == 0 && data_flag_)
{
// New random data bit
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);
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++)
{
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]) )
* complex_phase_[out_idx];
out_idx++;
}
}
else
{
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;
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] ,
sampled_code_data_[sat][out_idx].imag() * pilot_modulation_[sat]) )
* complex_phase_[out_idx];
out_idx++;
}
}
else
{
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;
for (i = 0; i < num_of_codes_per_vector_[sat]; i++)
{
for (k = 0; k < delay_samples; k++)
{
out[out_idx] += (sampled_code_data_[sat][out_idx] * current_data_bits_[sat]
- sampled_code_pilot_[sat][out_idx]) * complex_phase_[out_idx];
out_idx++;
}
for (i = 0; i < num_of_codes_per_vector_[sat]; i++)
{
for (k = 0; k < delay_samples; k++)
{
out[out_idx] += (sampled_code_data_[sat][out_idx] * current_data_bits_[sat]
- sampled_code_pilot_[sat][out_idx]) * complex_phase_[out_idx];
out_idx++;
}
if (ms_counter_[sat] == 0 && data_flag_)
{
// New random data bit
current_data_bits_[sat] = gr_complex((rand() % 2) == 0 ? 1 : -1, 0);
}
if (ms_counter_[sat] == 0 && data_flag_)
{
// New random data bit
current_data_bits_[sat] = gr_complex((rand() % 2) == 0 ? 1 : -1, 0);
}
for (k = delay_samples; k < samples_per_code_[sat]; k++)
{
out[out_idx] += (sampled_code_data_[sat][out_idx] * current_data_bits_[sat]
- sampled_code_pilot_[sat][out_idx])
* complex_phase_[out_idx];
out_idx++;
}
for (k = delay_samples; k < samples_per_code_[sat]; k++)
{
out[out_idx] += (sampled_code_data_[sat][out_idx] * current_data_bits_[sat]
- sampled_code_pilot_[sat][out_idx])
* complex_phase_[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_;
public:
~signal_generator_c (); // public destructor
~signal_generator_c(); // public destructor
// Where all the action really happens

View File

@ -46,13 +46,13 @@ using google::LogMessage;
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,
std::string role, unsigned int in_streams, unsigned int out_streams,
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_item_type = "short";
@ -99,11 +99,11 @@ FileSignalSource::FileSignalSource(ConfigurationInterface* configuration,
}
else if (item_type_.compare("byte") == 0)
{
item_size_ = sizeof(int8_t);
item_size_ = sizeof(int8_t);
}
else if (item_type_.compare("ibyte") == 0)
{
item_size_ = sizeof(int8_t);
item_size_ = sizeof(int8_t);
is_complex = true;
}
else

View File

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

View File

@ -45,13 +45,13 @@
using google::LogMessage;
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,
std::string role, unsigned int in_streams, unsigned int out_streams,
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_item_type = "byte";

View File

@ -50,7 +50,7 @@ class ConfigurationInterface;
class OsmosdrSignalSource: public GNSSBlockInterface
{
public:
OsmosdrSignalSource(ConfigurationInterface* configuration,
OsmosdrSignalSource(ConfigurationInterface* configuration,
std::string role, unsigned int in_stream,
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_filename_ = configuration->property(role + ".dump_filename", default_dump_file);
dump_=false;
dump_ = false;
std::string default_ethernet_dev = "eth0";
eth_device_ = configuration->property(role + ".ethernet_dev", default_ethernet_dev);
@ -88,7 +88,7 @@ RawArraySignalSource::RawArraySignalSource(ConfigurationInterface* configuration
}
if (dump_)
{
//TODO: multichannel recorder
//TODO: multichannel recorder
DLOG(INFO) << "Dumping output into file " << dump_filename_;
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_)
{
//TODO: multichannel recorder
//TODO: multichannel recorder
top_block->connect(raw_array_source_, 0, file_sink_, 0);
DLOG(INFO) << "connected raw_array_source_ to file sink";
}
@ -125,7 +125,7 @@ void RawArraySignalSource::disconnect(gr::top_block_sptr top_block)
{
if (dump_)
{
//TODO: multichannel recorder
//TODO: multichannel recorder
top_block->disconnect(raw_array_source_, 0, file_sink_, 0);
}
}

View File

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

View File

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

View File

@ -51,7 +51,7 @@ class ConfigurationInterface;
class RtlTcpSignalSource: public GNSSBlockInterface
{
public:
RtlTcpSignalSource(ConfigurationInterface* configuration,
RtlTcpSignalSource(ConfigurationInterface* configuration,
std::string role, unsigned int in_stream,
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,
std::string role, unsigned int in_streams, unsigned int out_streams,
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_item_type = "int";

View File

@ -44,13 +44,13 @@
using google::LogMessage;
//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,
std::string role, unsigned int in_streams, unsigned int out_streams,
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_item_type = "byte";
@ -104,7 +104,7 @@ TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(ConfigurationInterface* con
<< std::endl;
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);
}
@ -172,14 +172,10 @@ TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(ConfigurationInterface* con
}
TwoBitCpxFileSignalSource::~TwoBitCpxFileSignalSource()
{}
void TwoBitCpxFileSignalSource::connect(gr::top_block_sptr top_block)
{
if (samples_ > 0)
@ -302,9 +298,6 @@ void TwoBitCpxFileSignalSource::disconnect(gr::top_block_sptr top_block)
}
gr::basic_block_sptr TwoBitCpxFileSignalSource::get_left_block()
{
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()
{
if (samples_ > 0)

View File

@ -46,13 +46,13 @@
using google::LogMessage;
//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,
std::string role, unsigned int in_streams, unsigned int out_streams,
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_item_type = "byte";
@ -101,7 +101,6 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac
item_size_ = sizeof(char);
}
if( sample_type_.compare("real") == 0 )
{
is_complex_ = false;
@ -236,14 +235,10 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac
}
TwoBitPackedFileSignalSource::~TwoBitPackedFileSignalSource()
{}
void TwoBitPackedFileSignalSource::connect(gr::top_block_sptr top_block)
{
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)
{
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()
{
return valve_;

View File

@ -44,278 +44,318 @@ using boost::asio::ip::tcp;
// Buffer constants
// TODO: Make these configurable
enum {
RTL_TCP_BUFFER_SIZE = 1024 * 16, // 16 KB
RTL_TCP_PAYLOAD_SIZE = 1024 * 4 // 4 KB
RTL_TCP_BUFFER_SIZE = 1024 * 16, // 16 KB
RTL_TCP_PAYLOAD_SIZE = 1024 * 4 // 4 KB
};
rtl_tcp_signal_source_c_sptr
rtl_tcp_make_signal_source_c(const std::string &address,
short port,
bool flip_iq)
short port,
bool flip_iq)
{
return gnuradio::get_initial_sptr (new rtl_tcp_signal_source_c (address,
port,
flip_iq));
port,
flip_iq));
}
rtl_tcp_signal_source_c::rtl_tcp_signal_source_c(const std::string &address,
short port,
bool flip_iq)
: gr::sync_block ("rtl_tcp_signal_source_c",
gr::io_signature::make(0, 0, 0),
gr::io_signature::make(1, 1, sizeof(gr_complex))),
socket_ (io_service_),
data_ (RTL_TCP_PAYLOAD_SIZE),
flip_iq_(flip_iq),
buffer_ (RTL_TCP_BUFFER_SIZE),
unread_ (0)
short port,
bool flip_iq)
: gr::sync_block ("rtl_tcp_signal_source_c",
gr::io_signature::make(0, 0, 0),
gr::io_signature::make(1, 1, sizeof(gr_complex))),
socket_ (io_service_),
data_ (RTL_TCP_PAYLOAD_SIZE),
flip_iq_(flip_iq),
buffer_ (RTL_TCP_BUFFER_SIZE),
unread_ (0)
{
boost::system::error_code ec;
boost::system::error_code ec;
// 1. Setup lookup table
for (unsigned i = 0; i < 0xff; i++) {
lookup_[i] = ((float)(i & 0xff) - 127.4f) * (1.0f / 128.0f);
}
// 1. Setup lookup table
for (unsigned i = 0; i < 0xff; i++)
{
lookup_[i] = ((float)(i & 0xff) - 127.4f) * (1.0f / 128.0f);
}
// 2. Set socket options
ip::address addr = ip::address::from_string (address, ec);
if (ec) {
std::cout << address << " is not an IP address" << std::endl;
LOG (ERROR) << address << " is not an IP address";
return;
}
ip::tcp::endpoint ep (addr, port);
socket_.open (ep.protocol( ), ec);
if (ec) {
std::cout << "Failed to open socket." << std::endl;
LOG (ERROR) << "Failed to open socket.";
}
// 2. Set socket options
ip::address addr = ip::address::from_string (address, ec);
if (ec)
{
std::cout << address << " is not an IP address" << std::endl;
LOG (ERROR) << address << " is not an IP address";
return;
}
ip::tcp::endpoint ep (addr, port);
socket_.open (ep.protocol( ), ec);
if (ec)
{
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);
if (ec) {
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) {
std::cout << "Failed to set linger option: " << ec << std::endl;
LOG (WARNING) << "Failed to set linger option";
}
socket_.set_option (boost::asio::socket_base::reuse_address (true), ec);
if (ec)
{
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)
{
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);
if (ec) {
std::cout << "Failed to connect to " << addr << ":" << port
<< "(" << ec << ")" << std::endl;
LOG (ERROR) << "Failed to connect to " << addr << ":" << port
<< "(" << ec << ")";
return;
}
std::cout << "Connected to " << addr << ":" << port << std::endl;
LOG (INFO) << "Connected to " << addr << ":" << port;
socket_.connect(ep, ec);
if (ec)
{
std::cout << "Failed to connect to " << addr << ":" << port
<< "(" << ec << ")" << std::endl;
LOG (ERROR) << "Failed to connect to " << addr << ":" << port
<< "(" << ec << ")";
return;
}
std::cout << "Connected to " << addr << ":" << port << std::endl;
LOG (INFO) << "Connected to " << addr << ":" << port;
// 4. Set nodelay
socket_.set_option (tcp::no_delay (true), ec);
if (ec) {
std::cout << "Failed to set no delay option." << std::endl;
LOG (WARNING) << "Failed to set no delay option";
}
// 4. Set nodelay
socket_.set_option (tcp::no_delay (true), ec);
if (ec)
{
std::cout << "Failed to set no delay option." << std::endl;
LOG (WARNING) << "Failed to set no delay option";
}
// 5. Receive dongle info
ec = info_.read (socket_);
if (ec) {
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;
LOG (INFO) << "Found " << info_.get_type_name() << " tuner.";
}
// 5. Receive dongle info
ec = info_.read (socket_);
if (ec)
{
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;
LOG (INFO) << "Found " << info_.get_type_name() << " tuner.";
}
// 6. Start reading
boost::asio::async_read (socket_, boost::asio::buffer (data_),
boost::bind (&rtl_tcp_signal_source_c::handle_read,
this, _1, _2));
boost::thread (boost::bind (&boost::asio::io_service::run, &io_service_));
// 6. Start reading
boost::asio::async_read (socket_, boost::asio::buffer (data_),
boost::bind (&rtl_tcp_signal_source_c::handle_read,
this, _1, _2));
boost::thread (boost::bind (&boost::asio::io_service::run, &io_service_));
}
rtl_tcp_signal_source_c::~rtl_tcp_signal_source_c()
{
io_service_.stop ();
}
int rtl_tcp_signal_source_c::work (int noutput_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)
{
gr_complex *out = reinterpret_cast <gr_complex *>( output_items[0] );
int i = 0;
if (io_service_.stopped ()) {
return -1;
}
gr_complex *out = reinterpret_cast <gr_complex *>( output_items[0] );
int i = 0;
if (io_service_.stopped ())
{
return -1;
}
{
boost::mutex::scoped_lock lock (mutex_);
not_empty_.wait (lock, boost::bind (&rtl_tcp_signal_source_c::not_empty,
this));
{
boost::mutex::scoped_lock lock (mutex_);
not_empty_.wait (lock, boost::bind (&rtl_tcp_signal_source_c::not_empty,
this));
for ( ; i < noutput_items && unread_ > 1; i++ ) {
float re = buffer_[--unread_];
float im = buffer_[--unread_];
if (flip_iq_) {
out[i] = gr_complex (im, re);
}
else {
out[i] = gr_complex (re, im);
}
for ( ; i < noutput_items && unread_ > 1; i++ )
{
float re = buffer_[--unread_];
float im = buffer_[--unread_];
if (flip_iq_)
{
out[i] = gr_complex (im, re);
}
else
{
out[i] = gr_complex (re, im);
}
}
}
}
not_full_.notify_one ();
return i == 0 ? -1 : i;
not_full_.notify_one ();
return i == 0 ? -1 : i;
}
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) {
void rtl_tcp_signal_source_c::set_frequency (int frequency)
{
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";
}
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_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);
boost::system::error_code ec =
rtl_tcp_command (RTL_TCP_SET_GAIN, clipped, socket_);
if (ec) {
std::cout << "Failed to set gain" << std::endl;
LOG (WARNING) << "Failed to set gain";
}
boost::system::error_code ec = rtl_tcp_command (RTL_TCP_SET_GAIN, clipped, socket_);
if (ec)
{
std::cout << "Failed to set gain" << std::endl;
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
struct range {
double start, stop, step;
double start, stop, step;
};
if (info_.get_tuner_type () != rtl_tcp_dongle_info::TUNER_E4000) {
return;
}
if (info_.get_tuner_type () != rtl_tcp_dongle_info::TUNER_E4000)
{
return;
}
std::vector<range> ranges = {
{ -3, 6, 9 },
{ 0, 9, 3 },
{ 0, 9, 3 },
{ 0, 2, 1 },
{ 3, 15, 3},
{ 3, 15, 3}
{ -3, 6, 9 },
{ 0, 9, 3 },
{ 0, 9, 3 },
{ 0, 2, 1 },
{ 3, 15, 3},
{ 3, 15, 3}
};
std::map <int, double> gains;
for (int i = 0; i < static_cast<int>(ranges.size ()); i++) {
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 (int i = 0; i < static_cast<int>(ranges.size ()); i++)
{
gains[i+1] = ranges[i].start;
}
}
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";
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++)
{
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) {
std::cout << "Error during read: " << ec << std::endl;
LOG (WARNING) << "Error during read: " << ec;
boost::mutex::scoped_lock lock (mutex_);
io_service_.stop ();
not_empty_.notify_one ();
}
else {
{
// Unpack read data
boost::mutex::scoped_lock lock (mutex_);
not_full_.wait (lock,
boost::bind (&rtl_tcp_signal_source_c::not_full,
this));
for (size_t i = 0; i < bytes_transferred; i++) {
while (!not_full( )) {
// uh-oh, buffer overflow
// wait until there's space for more
not_empty_.notify_one (); // needed?
not_full_.wait (lock,
boost::bind (&rtl_tcp_signal_source_c::not_full,
this));
}
buffer_.push_front (lookup_[data_[i]]);
unread_++;
if (ec)
{
std::cout << "Error during read: " << ec << std::endl;
LOG (WARNING) << "Error during read: " << ec;
boost::mutex::scoped_lock lock (mutex_);
io_service_.stop ();
not_empty_.notify_one ();
}
else
{
{
// Unpack read data
boost::mutex::scoped_lock lock (mutex_);
not_full_.wait (lock,
boost::bind (&rtl_tcp_signal_source_c::not_full,
this));
for (size_t i = 0; i < bytes_transferred; i++)
{
while (!not_full( ))
{
// uh-oh, buffer overflow
// wait until there's space for more
not_empty_.notify_one (); // needed?
not_full_.wait (lock,
boost::bind (&rtl_tcp_signal_source_c::not_full,
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
#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 <boost/asio.hpp>
@ -67,8 +67,8 @@ public:
~rtl_tcp_signal_source_c();
int work (int noutput_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);
void set_frequency (int frequency);
void set_sample_rate (int sample_rate);
@ -80,13 +80,13 @@ private:
typedef boost::circular_buffer_space_optimized<float> buffer_type;
friend rtl_tcp_signal_source_c_sptr
rtl_tcp_make_signal_source_c(const std::string &address,
short port,
bool flip_iq);
rtl_tcp_make_signal_source_c(const std::string &address,
short port,
bool flip_iq);
rtl_tcp_signal_source_c(const std::string &address,
short port,
bool flip_iq);
short port,
bool flip_iq);
rtl_tcp_dongle_info info_;
@ -108,16 +108,15 @@ private:
// async read callback
void handle_read (const boost::system::error_code &ec,
size_t bytes_transferred);
size_t bytes_transferred);
inline bool not_full ( ) const {
return unread_ < buffer_.capacity( );
return unread_ < buffer_.capacity( );
}
inline bool not_empty ( ) const {
return unread_ > 0 || io_service_.stopped ();
}
};
#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",
gr::io_signature::make(1, 1, item_size),
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),
item_size_(item_size),
big_endian_items_(big_endian_items),

View File

@ -38,7 +38,7 @@
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",
gr::io_signature::make(1, 1, sizeof(signed char)),
gr::io_signature::make(1, 1, sizeof(short)),
4)
gr::io_signature::make(1, 1, sizeof(signed char)),
gr::io_signature::make(1, 1, sizeof(short)),
4)
{}
unpack_byte_2bit_cpx_samples::~unpack_byte_2bit_cpx_samples()

View File

@ -34,7 +34,7 @@
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());
}
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(float)),
4)
gr::io_signature::make(1, 1, sizeof(signed char)),
gr::io_signature::make(1, 1, sizeof(float)),
4)
{}
unpack_byte_2bit_samples::~unpack_byte_2bit_samples()
{}
int unpack_byte_2bit_samples::work(int noutput_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)
{
const signed char *in = (const signed char *)input_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());
}
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(float)),
2)
gr::io_signature::make(1, 1, sizeof(int)),
gr::io_signature::make(1, 1, sizeof(float)),
2)
{}
unpack_intspir_1bit_samples::~unpack_intspir_1bit_samples()
{}
int unpack_intspir_1bit_samples::work(int noutput_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)
{
const signed int *in = (const signed int *)input_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)
// For historical reasons, values are float versions of short int limits (32767)
signed int val = in[i];
if(((val >> ((channel - 1)*2)) & 1) == 1)
{
out[n++] = static_cast<float>(32767.0);
}
else
{
out[n++] = static_cast<float>(-32767.0);
}
if(((val >> (2*channel - 1)) & 1) == 1)
{
out[n++] = static_cast<float>(32767.0);
}
else
{
out[n++] = static_cast<float>(-32767.0);
}
if(((val >> ((channel - 1)*2)) & 1) == 1)
{
out[n++] = static_cast<float>(32767.0);
}
else
{
out[n++] = static_cast<float>(-32767.0);
}
if(((val >> (2*channel - 1)) & 1) == 1)
{
out[n++] = static_cast<float>(32767.0);
}
else
{
out[n++] = static_cast<float>(-32767.0);
}
}
return noutput_items;
}

View File

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

View File

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

View File

@ -77,16 +77,16 @@ void SbasL1TelemetryDecoder::set_satellite(Gnss_Satellite satellite)
void SbasL1TelemetryDecoder::connect(gr::top_block_sptr top_block)
{
if(top_block) { /* top_block is not null */};
// Nothing to connect internally
if(top_block) { /* top_block is not null */};
// Nothing to connect internally
DLOG(INFO) << "nothing to connect internally";
}
void SbasL1TelemetryDecoder::disconnect(gr::top_block_sptr top_block)
{
if(top_block) { /* top_block is not null */};
// Nothing to disconnect
if(top_block) { /* top_block is not null */};
// 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(
Gnss_Satellite satellite,
bool dump) :
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::block("galileo_e1b_telemetry_decoder_cc", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)),
gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)))
{
// Telemetry Bit transition synchronization port out
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()
{
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)
{
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)),
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 preamble_diff = 0;
@ -303,7 +299,7 @@ int galileo_e1b_telemetry_decoder_cc::general_work (int noutput_items __attribut
//******* preamble correlation ********
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];
}
@ -439,7 +435,6 @@ int galileo_e1b_telemetry_decoder_cc::general_work (int noutput_items __attribut
//this page has no timing information
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;
}
}
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;
}
void galileo_e1b_telemetry_decoder_cc::set_satellite(Gnss_Satellite satellite)
{
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
* \author Marc Sales, 2014. marcsales92(at)gmail.com
* \based on work from:
* <ul>
* <ul>
* <li> Javier Arribas, 2011. jarribas(at)cttc.es
* </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)),
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
Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0];
/* Terminology: Prompt: output from tracking Prompt correlator (Prompt samples)
* Symbol: encoded navigation bits. 1 symbol = 20 samples in E5a
* Bit: decoded navigation bits forming words as described in Galileo ICD
* States: 0 Receiving dummy samples.
* 1 Preamble not locked
* 3 Preamble lock
/* Terminology: Prompt: output from tracking Prompt correlator (Prompt samples)
* Symbol: encoded navigation bits. 1 symbol = 20 samples in E5a
* Bit: decoded navigation bits forming words as described in Galileo ICD
* States: 0 Receiving dummy samples.
* 1 Preamble not locked
* 3 Preamble lock
*/
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] = 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_symbol_counter++;
d_prompt_counter = 0;
@ -333,7 +333,7 @@ int galileo_e5a_telemetry_decoder_cc::general_work (int noutput_items __attribut
bool corr_flag=true;
int corr_sign = 0; // sequence can be found inverted
// 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];
}
@ -399,18 +399,18 @@ int galileo_e5a_telemetry_decoder_cc::general_work (int noutput_items __attribut
// **** Attempt Preamble correlation ****
bool corr_flag = true;
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];
// 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)
// {
// //exit for if one bit doesn't correlate
// 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++)
// {
// 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
// corr_flag = false;
// break;
// }
// break;
// }
// }
// 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];
}

View File

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

View File

@ -29,7 +29,7 @@
*/
#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 <string>
@ -130,7 +130,6 @@ private:
std::string d_dump_filename;
std::ofstream d_dump_file;
};
#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)),
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
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
{
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;
}
else

View File

@ -29,7 +29,7 @@
*/
#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 <deque>

View File

@ -40,10 +40,10 @@
using google::LogMessage;
// logging levels
#define EVENT 2 // logs important events which don't occur every block
#define FLOW 3 // logs the function calls of block processing functions
#define EVENT 2 // logs important events which don't occur every block
#define FLOW 3 // logs the function calls of block processing functions
#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)),
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];
// get pointers on in- and output gnss-synchro objects
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
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
* Output parameters:
* Output parameters:
* \return (returned int): The symbol's parity = 1 for odd and 0 for even
*
* \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[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
* (i.e. the state after encoding this bit)
* (i.e. the state after encoding this bit)
*
* This function is used by nsc_transit()
*/
@ -193,7 +193,7 @@ static void Viterbi(int output_u_int[],
float *prev_section, *next_section;
int *prev_bit;
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 max_val;
@ -222,7 +222,7 @@ static void Viterbi(int output_u_int[],
for (t = 0; t < LL + mm; t++)
{
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 */
for (i = 0; i < number_symbols; i++)

View File

@ -34,11 +34,11 @@
#include <glog/logging.h>
// logging
#define EVENT 2 // logs important events which don't occur every block
#define FLOW 3 // logs the function calls of block processing functions
#define BLOCK 4 // once per block
#define SAMPLE 5 // about one log entry per sample
#define LMORE 6 // many entries per sample / very specific stuff
#define EVENT 2 // logs important events which don't occur every block
#define FLOW 3 // logs the function calls of block processing functions
#define BLOCK 4 // once per block
#define SAMPLE 5 // about one log entry per sample
#define LMORE 6 // many entries per sample / very specific stuff
const float MAXLOG = 1e7; /* Define infinity */
@ -95,10 +95,10 @@ void Viterbi_Decoder::reset()
/* Function decode_block()
Description: Uses the Viterbi algorithm to perform hard-decision decoding of a convolutional code.
Input parameters:
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)
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)
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)
{
@ -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.
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:
rec_array The received vector, of length nn
symbol The hypothetical symbol
nn The length of the received vector
rec_array The received vector, of length nn
symbol The hypothetical symbol
nn The length of the received vector
This function is used by siso() */
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.
Input parameters:
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).
g[] An n-element vector containing the code generators in binary form.
KK The constraint length of the convolutional code.
nn number of symbols bits per input bits (rate 1/nn)
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).
g[] An n-element vector containing the code generators in binary form.
KK The constraint length of the convolutional code.
nn number of symbols bits per input bits (rate 1/nn)
Output parameters:
output_p[] An n-element vector containing the encoded bits.
state_out_p[] An integer containing the final state of the encoder
output_p[] An n-element vector containing the encoded bits.
state_out_p[] An integer containing the final state of the encoder
(i.e. the state after encoding this bit)
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)
{
if(top_block) { /* top_block is not null */};
//nothing to connect, now the tracking uses gr_sync_decimator
if(top_block) { /* top_block is not null */};
//nothing to connect, now the tracking uses gr_sync_decimator
}
void GalileoE1DllPllVemlTracking::disconnect(gr::top_block_sptr top_block)
{
if(top_block) { /* top_block is not null */};
//nothing to disconnect, now the tracking uses gr_sync_decimator
if(top_block) { /* top_block is not null */};
//nothing to disconnect, now the tracking uses gr_sync_decimator
}
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)
{
if(top_block) { /* top_block is not null */};
//nothing to connect, now the tracking uses gr_sync_decimator
if(top_block) { /* top_block is not null */};
//nothing to connect, now the tracking uses gr_sync_decimator
}
void GalileoE1TcpConnectorTracking::disconnect(gr::top_block_sptr top_block)
{
if(top_block) { /* top_block is not null */};
//nothing to disconnect, now the tracking uses gr_sync_decimator
if(top_block) { /* top_block is not null */};
//nothing to disconnect, now the tracking uses gr_sync_decimator
}
gr::basic_block_sptr GalileoE1TcpConnectorTracking::get_left_block()

View File

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

View File

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

View File

@ -100,23 +100,25 @@ GpsL1CaDllPllCAidTracking::GpsL1CaDllPllCAidTracking(
extend_correlation_ms,
early_late_space_chips);
DLOG(INFO) << "tracking(" << tracking_cc->unique_id() << ")";
}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(
f_if,
fs_in,
vector_length,
queue_,
dump,
dump_filename,
pll_bw_hz,
dll_bw_hz,
pll_bw_narrow_hz,
dll_bw_narrow_hz,
early_late_space_chips);
DLOG(INFO) << "tracking(" << tracking_sc->unique_id() << ")";
}else
}
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(
f_if,
fs_in,
vector_length,
queue_,
dump,
dump_filename,
pll_bw_hz,
dll_bw_hz,
pll_bw_narrow_hz,
dll_bw_narrow_hz,
early_late_space_chips);
DLOG(INFO) << "tracking(" << tracking_sc->unique_id() << ")";
}
else
{
item_size_ = sizeof(gr_complex);
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)
{
if(top_block) { /* top_block is not null */};
//nothing to connect, now the tracking uses gr_sync_decimator
if(top_block) { /* top_block is not null */};
//nothing to connect, now the tracking uses gr_sync_decimator
}
void GpsL1CaDllPllCAidTracking::disconnect(gr::top_block_sptr top_block)
{
if(top_block) { /* top_block is not null */};
//nothing to disconnect, now the tracking uses gr_sync_decimator
if(top_block) { /* top_block is not null */};
//nothing to disconnect, now the tracking uses gr_sync_decimator
}
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)
{
if(top_block) { /* top_block is not null */};
//nothing to connect, now the tracking uses gr_sync_decimator
if(top_block) { /* top_block is not null */};
//nothing to connect, now the tracking uses gr_sync_decimator
}
void GpsL1CaDllPllTrackingGPU::disconnect(gr::top_block_sptr top_block)
{
if(top_block) { /* top_block is not null */};
//nothing to disconnect, now the tracking uses gr_sync_decimator
if(top_block) { /* top_block is not null */};
//nothing to disconnect, now the tracking uses gr_sync_decimator
}
gr::basic_block_sptr GpsL1CaDllPllTrackingGPU::get_left_block()

View File

@ -2,7 +2,7 @@
* \file gps_l1_ca_tcp_connector_tracking.cc
* \brief Implementation of an adapter of a TCP connector block based on code DLL + carrier PLL
* \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
*
* 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)
{
if(top_block) { /* top_block is not null */};
//nothing to connect, now the tracking uses gr_sync_decimator
if(top_block) { /* top_block is not null */};
//nothing to connect, now the tracking uses gr_sync_decimator
}
void GpsL1CaTcpConnectorTracking::disconnect(gr::top_block_sptr top_block)
{
if(top_block) { /* top_block is not null */};
//nothing to disconnect, now the tracking uses gr_sync_decimator
if(top_block) { /* top_block is not null */};
//nothing to disconnect, now the tracking uses gr_sync_decimator
}
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)
{
if(top_block) { /* top_block is not null */};
//nothing to connect, now the tracking uses gr_sync_decimator
if(top_block) { /* top_block is not null */};
//nothing to connect, now the tracking uses gr_sync_decimator
}
void GpsL2MDllPllTracking::disconnect(gr::top_block_sptr top_block)
{
if(top_block) { /* top_block is not null */};
//nothing to disconnect, now the tracking uses gr_sync_decimator
if(top_block) { /* top_block is not null */};
//nothing to disconnect, now the tracking uses gr_sync_decimator
}
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 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(
d_rem_carr_phase_rad,
carr_phase_step_rad,
rem_code_phase_half_chips,
code_phase_step_half_chips,
d_correlation_length_samples);
d_rem_carr_phase_rad,
carr_phase_step_rad,
rem_code_phase_half_chips,
code_phase_step_half_chips,
d_correlation_length_samples);
// ################## PLL ##########################################################
// PLL discriminator
@ -410,11 +410,11 @@ int galileo_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items __attri
}
else
{
*d_Early = gr_complex(0,0);
*d_Prompt = gr_complex(0,0);
*d_Late = gr_complex(0,0);
// 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);
*d_Early = gr_complex(0,0);
*d_Prompt = gr_complex(0,0);
*d_Late = gr_complex(0,0);
// 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);
}
//assign the GNURadio block output data
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 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(
d_rem_carr_phase_rad,
carr_phase_step_rad,
rem_code_phase_half_chips,
code_phase_step_half_chips,
d_correlation_length_samples);
d_rem_carr_phase_rad,
carr_phase_step_rad,
rem_code_phase_half_chips,
code_phase_step_half_chips,
d_correlation_length_samples);
// ################## TCP CONNECTOR ##########################################################
//! Variable used for control

View File

@ -37,7 +37,7 @@
*/
#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 <map>

View File

@ -4,7 +4,7 @@
* tracking block for Galileo E5a signals
* \author Marc Sales, 2014. marcsales92(at)gmail.com
* \based on work from:
* <ul>
* <ul>
* <li> Javier Arribas, 2011. jarribas(at)cttc.es
* <li> Luis Esteve, 2012. luis(at)epsilon-formacion.com
* </ul>
@ -323,51 +323,51 @@ void Galileo_E5a_Dll_Pll_Tracking_cc::acquire_secondary()
// 1. Transform replica to 1 and -1
int sec_code_signed[Galileo_E5a_Q_SECONDARY_CODE_LENGTH];
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')
{
sec_code_signed[i] = 1;
}
else
{
sec_code_signed[i] = -1;
}
}
{
if (Galileo_E5a_Q_SECONDARY_CODE[d_acquisition_gnss_synchro->PRN - 1].at(i) == '0')
{
sec_code_signed[i] = 1;
}
else
{
sec_code_signed[i] = -1;
}
}
// 2. Transform buffer to 1 and -1
int in_corr[CN0_ESTIMATION_SAMPLES];
for (unsigned int i = 0; i < CN0_ESTIMATION_SAMPLES; i++)
{
if (d_Prompt_buffer[i].real() >0)
{
in_corr[i] = 1;
}
else
{
in_corr[i] = -1;
}
}
{
if (d_Prompt_buffer[i].real() >0)
{
in_corr[i] = 1;
}
else
{
in_corr[i] = -1;
}
}
// 3. Serial search
int out_corr;
int current_best_ = 0;
for (unsigned int i = 0; i < Galileo_E5a_Q_SECONDARY_CODE_LENGTH; i++)
{
out_corr = 0;
for (unsigned int j = 0; j < CN0_ESTIMATION_SAMPLES; j++)
{
//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];
}
if (abs(out_corr) > current_best_)
{
current_best_ = abs(out_corr);
d_secondary_delay = i;
}
}
{
out_corr = 0;
for (unsigned int j = 0; j < CN0_ESTIMATION_SAMPLES; j++)
{
//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];
}
if (abs(out_corr) > current_best_)
{
current_best_ = abs(out_corr);
d_secondary_delay = i;
}
}
if (current_best_ == CN0_ESTIMATION_SAMPLES) // all bits correlate
{
d_secondary_lock = true;
d_secondary_delay = (d_secondary_delay + CN0_ESTIMATION_SAMPLES - 1) % Galileo_E5a_Q_SECONDARY_CODE_LENGTH;
}
{
d_secondary_lock = true;
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
current_synchro_data = *d_acquisition_gnss_synchro;
/* States: 0 Tracking not enabled
* 1 Pull-in of primary code (alignment).
* 3 Tracking algorithm. Correlates EPL each loop and accumulates the result
* until it reaches integration time.
/* States: 0 Tracking not enabled
* 1 Pull-in of primary code (alignment).
* 3 Tracking algorithm. Correlates EPL each loop and accumulates the result
* until it reaches integration time.
*/
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_Late = 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;
break;
@ -440,8 +440,8 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute
// Secondary code Chip
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_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_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_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 rem_code_phase_chips = d_rem_code_phase_samples * (d_code_freq_chips / d_fs_in);
multicorrelator_cpu_Q.Carrier_wipeoff_multicorrelator_resampler(
d_rem_carr_phase_rad,
carr_phase_step_rad,
rem_code_phase_chips,
code_phase_step_chips,
d_current_prn_length_samples);
d_rem_carr_phase_rad,
carr_phase_step_rad,
rem_code_phase_chips,
code_phase_step_chips,
d_current_prn_length_samples);
multicorrelator_cpu_I.Carrier_wipeoff_multicorrelator_resampler(
d_rem_carr_phase_rad,
carr_phase_step_rad,
rem_code_phase_chips,
code_phase_step_chips,
d_current_prn_length_samples);
d_rem_carr_phase_rad,
carr_phase_step_rad,
rem_code_phase_chips,
code_phase_step_chips,
d_current_prn_length_samples);
// 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
* \author Marc Sales, 2014. marcsales92(at)gmail.com
* \based on work from:
* <ul>
* <ul>
* <li> Javier Arribas, 2011. jarribas(at)cttc.es
* <li> Luis Esteve, 2012. luis(at)epsilon-formacion.com
* </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;
if (d_enable_tracking == true)
{
// Fill the acquisition data
current_synchro_data = *d_acquisition_gnss_synchro;
// Fill the acquisition data
current_synchro_data = *d_acquisition_gnss_synchro;
// Receiver signal alignment
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
multicorrelator_cpu.set_input_output_vectors(d_correlator_outs,in);
multicorrelator_cpu.Carrier_wipeoff_multicorrelator_resampler(d_rem_carrier_phase_rad,
d_carrier_phase_step_rad,
d_rem_code_phase_chips,
d_code_phase_step_chips,
d_correlation_length_samples);
d_carrier_phase_step_rad,
d_rem_code_phase_chips,
d_code_phase_step_chips,
d_correlation_length_samples);
// ####### coherent intergration extension
// keep the last symbols

View File

@ -35,7 +35,7 @@
*/
#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 <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()));
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()));
@ -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;
if (d_enable_tracking == true)
{
// Fill the acquisition data
// Fill the acquisition data
current_synchro_data = *d_acquisition_gnss_synchro;
// Receiver signal alignment
if (d_pull_in == true)

View File

@ -35,7 +35,7 @@
*/
#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 <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
multicorrelator_cpu.set_input_output_vectors(d_correlator_outs, in);
multicorrelator_cpu.Carrier_wipeoff_multicorrelator_resampler(d_rem_carr_phase_rad,
d_carrier_phase_step_rad,
d_rem_code_phase_chips,
d_code_phase_step_chips,
d_current_prn_length_samples);
d_carrier_phase_step_rad,
d_rem_code_phase_chips,
d_code_phase_step_chips,
d_current_prn_length_samples);
// ################## PLL ##########################################################
// PLL discriminator

View File

@ -35,7 +35,7 @@
*/
#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 <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;
if (d_enable_tracking == true)
{
// Fill the acquisition data
// Fill the acquisition data
current_synchro_data = *d_acquisition_gnss_synchro;
// Receiver signal alignment
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);
cudaProfilerStart();
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_code_phase_step_chips),
static_cast<float>(d_rem_code_phase_chips),
d_correlation_length_samples, d_n_correlator_taps);
static_cast<float>(d_carrier_phase_step_rad),
static_cast<float>(d_code_phase_step_chips),
static_cast<float>(d_rem_code_phase_chips),
d_correlation_length_samples, d_n_correlator_taps);
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;
@ -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
// 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]
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

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