mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-11-24 02:54:54 +00:00
Merge branch 'next' of https://github.com/gnss-sdr/gnss-sdr into glonass
This commit is contained in:
@@ -419,8 +419,6 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Glonass_Gnav_Utc_M
|
||||
{
|
||||
if(glonass_gnav_almanac.i_satellite_freq_channel){}
|
||||
std::string line;
|
||||
stringVersion = "3.02";
|
||||
version = 3;
|
||||
|
||||
// -------- Line 1
|
||||
line = std::string(5, ' ');
|
||||
@@ -643,8 +641,6 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& gali
|
||||
//Avoid compiler warning, there is not time system correction between Galileo and GLONASS
|
||||
if(galileo_almanac.A_0G_10){}
|
||||
std::string line;
|
||||
stringVersion = "3.02";
|
||||
version = 3;
|
||||
|
||||
// -------- Line 1
|
||||
line = std::string(5, ' ');
|
||||
@@ -753,8 +749,6 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& gali
|
||||
void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& iono, const Galileo_Utc_Model& utc_model, const Galileo_Almanac& galileo_almanac)
|
||||
{
|
||||
std::string line;
|
||||
stringVersion = "3.02";
|
||||
version = 3;
|
||||
|
||||
// -------- Line 1
|
||||
line = std::string(5, ' ');
|
||||
@@ -1159,8 +1153,6 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, co
|
||||
void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc_model, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model, const Galileo_Almanac& galileo_almanac)
|
||||
{
|
||||
std::string line;
|
||||
stringVersion = "3.02";
|
||||
version = 3;
|
||||
|
||||
// -------- Line 1
|
||||
line = std::string(5, ' ');
|
||||
@@ -5198,6 +5190,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps
|
||||
out << line << std::endl;
|
||||
}
|
||||
|
||||
|
||||
void Rinex_Printer::update_obs_header(std::fstream& out, const Glonass_Gnav_Utc_Model& utc_model)
|
||||
{
|
||||
if(utc_model.d_N_4)
|
||||
@@ -5585,7 +5578,6 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri
|
||||
}
|
||||
line += Rinex_Printer::rightJustify(boost::lexical_cast<std::string>(numSatellitesObserved), 3);
|
||||
|
||||
|
||||
// Receiver clock offset (optional)
|
||||
//line += rightJustify(asString(clockOffset, 12), 15);
|
||||
|
||||
@@ -5655,6 +5647,9 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double gps_obs_time, const std::map<int,Gnss_Synchro>& observables)
|
||||
{
|
||||
if(glonass_gnav_eph.d_m){} // avoid warning, not needed
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
/*!
|
||||
* \file freq_xlating_fir_filter.cc
|
||||
* \brief Adapts a gnuradio gr_freq_xlating_fir_filter designed with gr_remez
|
||||
* \brief Adapts a gnuradio gr_freq_xlating_fir_filter designed with gr_remez or gr_firdes
|
||||
* \author Luis Esteve, 2012. luis(at)epsilon-formacion.com
|
||||
* Antonio Ramos, 2017. antonio.ramos(at)cttc.es
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors)
|
||||
* Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
@@ -32,6 +33,7 @@
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <gnuradio/blocks/file_sink.h>
|
||||
#include <gnuradio/filter/pm_remez.h>
|
||||
#include <gnuradio/filter/firdes.h>
|
||||
#include <glog/logging.h>
|
||||
#include <volk/volk.h>
|
||||
#include "configuration_interface.h"
|
||||
@@ -343,8 +345,8 @@ void FreqXlatingFirFilter::init()
|
||||
std::string default_output_item_type = "gr_complex";
|
||||
std::string default_taps_item_type = "float";
|
||||
std::string default_dump_filename = "../data/input_filter.dat";
|
||||
double default_intermediate_freq = 0;
|
||||
double default_sampling_freq = 4000000;
|
||||
double default_intermediate_freq = 0.0;
|
||||
double default_sampling_freq = 4000000.0;
|
||||
int default_number_of_taps = 6;
|
||||
unsigned int default_number_of_bands = 2;
|
||||
std::vector<double> default_bands = { 0.0, 0.4, 0.6, 1.0 };
|
||||
@@ -364,46 +366,54 @@ void FreqXlatingFirFilter::init()
|
||||
sampling_freq_ = config_->property(role_ + ".sampling_frequency", default_sampling_freq);
|
||||
int number_of_taps = config_->property(role_ + ".number_of_taps", default_number_of_taps);
|
||||
unsigned int number_of_bands = config_->property(role_ + ".number_of_bands", default_number_of_bands);
|
||||
|
||||
std::vector<double> bands;
|
||||
std::vector<double> ampl;
|
||||
std::vector<double> error_w;
|
||||
std::string option;
|
||||
double option_value;
|
||||
|
||||
for (unsigned int i = 0; i < number_of_bands; i++)
|
||||
{
|
||||
option = ".band" + boost::lexical_cast<std::string>(i + 1) + "_begin";
|
||||
option_value = config_->property(role_ + option, default_bands[i]);
|
||||
bands.push_back(option_value);
|
||||
|
||||
option = ".band" + boost::lexical_cast<std::string>(i + 1) + "_end";
|
||||
option_value = config_->property(role_ + option, default_bands[i]);
|
||||
bands.push_back(option_value);
|
||||
|
||||
option = ".ampl" + boost::lexical_cast<std::string>(i + 1) + "_begin";
|
||||
option_value = config_->property(role_ + option, default_bands[i]);
|
||||
ampl.push_back(option_value);
|
||||
|
||||
option = ".ampl" + boost::lexical_cast<std::string>(i + 1) + "_end";
|
||||
option_value = config_->property(role_ + option, default_bands[i]);
|
||||
ampl.push_back(option_value);
|
||||
|
||||
option = ".band" + boost::lexical_cast<std::string>(i + 1) + "_error";
|
||||
option_value = config_->property(role_ + option, default_bands[i]);
|
||||
error_w.push_back(option_value);
|
||||
}
|
||||
|
||||
std::string filter_type = config_->property(role_ + ".filter_type", default_filter_type);
|
||||
int grid_density = config_->property(role_ + ".grid_density", default_grid_density);
|
||||
|
||||
std::vector<double> taps_d = gr::filter::pm_remez(number_of_taps - 1, bands, ampl,
|
||||
error_w, filter_type, grid_density);
|
||||
|
||||
taps_.reserve(taps_d.size());
|
||||
for (std::vector<double>::iterator it = taps_d.begin(); it != taps_d.end(); it++)
|
||||
if(filter_type.compare("lowpass") != 0)
|
||||
{
|
||||
taps_.push_back(float(*it));
|
||||
//std::cout<<"TAP="<<float(*it)<<std::endl;
|
||||
std::vector<double> taps_d;
|
||||
std::vector<double> bands;
|
||||
std::vector<double> ampl;
|
||||
std::vector<double> error_w;
|
||||
std::string option;
|
||||
double option_value;
|
||||
|
||||
for (unsigned int i = 0; i < number_of_bands; i++)
|
||||
{
|
||||
option = ".band" + boost::lexical_cast<std::string>(i + 1) + "_begin";
|
||||
option_value = config_->property(role_ + option, default_bands[i]);
|
||||
bands.push_back(option_value);
|
||||
|
||||
option = ".band" + boost::lexical_cast<std::string>(i + 1) + "_end";
|
||||
option_value = config_->property(role_ + option, default_bands[i]);
|
||||
bands.push_back(option_value);
|
||||
|
||||
option = ".ampl" + boost::lexical_cast<std::string>(i + 1) + "_begin";
|
||||
option_value = config_->property(role_ + option, default_bands[i]);
|
||||
ampl.push_back(option_value);
|
||||
|
||||
option = ".ampl" + boost::lexical_cast<std::string>(i + 1) + "_end";
|
||||
option_value = config_->property(role_ + option, default_bands[i]);
|
||||
ampl.push_back(option_value);
|
||||
|
||||
option = ".band" + boost::lexical_cast<std::string>(i + 1) + "_error";
|
||||
option_value = config_->property(role_ + option, default_bands[i]);
|
||||
error_w.push_back(option_value);
|
||||
}
|
||||
|
||||
int grid_density = config_->property(role_ + ".grid_density", default_grid_density);
|
||||
taps_d = gr::filter::pm_remez(number_of_taps - 1, bands, ampl, error_w, filter_type, grid_density);
|
||||
taps_.reserve(taps_d.size());
|
||||
for (std::vector<double>::iterator it = taps_d.begin(); it != taps_d.end(); it++)
|
||||
{
|
||||
taps_.push_back(static_cast<float>(*it));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
double default_bw = 2000000.0;
|
||||
double bw_ = config_->property(role_ + ".bw", default_bw);
|
||||
double default_tw = bw_ / 10.0;
|
||||
double tw_ = config_->property(role_ + ".tw", default_tw);
|
||||
taps_ = gr::filter::firdes::low_pass(1.0, sampling_freq_, bw_, tw_);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,10 +28,13 @@
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "pulse_blanking_filter.h"
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <vector>
|
||||
#include <cmath>
|
||||
#include <glog/logging.h>
|
||||
#include <gnuradio/filter/firdes.h>
|
||||
#include "configuration_interface.h"
|
||||
#include "pulse_blanking_filter.h"
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
@@ -41,6 +44,7 @@ PulseBlankingFilter::PulseBlankingFilter(ConfigurationInterface* configuration,
|
||||
out_streams_(out_streams)
|
||||
{
|
||||
size_t item_size;
|
||||
xlat_ = false;
|
||||
std::string default_input_item_type = "gr_complex";
|
||||
std::string default_output_item_type = "gr_complex";
|
||||
std::string default_dump_filename = "../data/input_filter.dat";
|
||||
@@ -71,7 +75,21 @@ PulseBlankingFilter::PulseBlankingFilter(ConfigurationInterface* configuration,
|
||||
item_size = sizeof(gr_complex); //avoids uninitialization
|
||||
input_size_ = sizeof(gr_complex); //avoids uninitialization
|
||||
}
|
||||
|
||||
double default_if = 0.0;
|
||||
double if_aux = config_->property(role_ + ".if", default_if);
|
||||
double if_ = config_->property(role_ + ".IF", if_aux);
|
||||
if (std::abs(if_) > 1.0)
|
||||
{
|
||||
xlat_ = true;
|
||||
double default_sampling_freq = 4000000.0;
|
||||
double sampling_freq_ = config_->property(role_ + ".sampling_frequency", default_sampling_freq);
|
||||
double default_bw = 2000000.0;
|
||||
double bw_ = config_->property(role_ + ".bw", default_bw);
|
||||
double default_tw = bw_ / 10.0;
|
||||
double tw_ = config_->property(role_ + ".tw", default_tw);
|
||||
const std::vector<float> taps = gr::filter::firdes::low_pass(1.0, sampling_freq_, bw_ , tw_);
|
||||
freq_xlating_ = gr::filter::freq_xlating_fir_filter_ccf::make(1, taps, if_, sampling_freq_);
|
||||
}
|
||||
if (dump_)
|
||||
{
|
||||
DLOG(INFO) << "Dumping output into file " << dump_filename_;
|
||||
@@ -95,6 +113,10 @@ void PulseBlankingFilter::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
top_block->connect(pulse_blanking_cc_, 0, file_sink_, 0);
|
||||
}
|
||||
if (xlat_)
|
||||
{
|
||||
top_block->connect(freq_xlating_, 0, pulse_blanking_cc_, 0);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
@@ -113,6 +135,10 @@ void PulseBlankingFilter::disconnect(gr::top_block_sptr top_block)
|
||||
{
|
||||
top_block->disconnect(pulse_blanking_cc_, 0, file_sink_, 0);
|
||||
}
|
||||
if (xlat_)
|
||||
{
|
||||
top_block->disconnect(freq_xlating_, 0, pulse_blanking_cc_, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -125,7 +151,14 @@ gr::basic_block_sptr PulseBlankingFilter::get_left_block()
|
||||
{
|
||||
if (input_item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
return pulse_blanking_cc_;
|
||||
if (xlat_)
|
||||
{
|
||||
return freq_xlating_;
|
||||
}
|
||||
else
|
||||
{
|
||||
return pulse_blanking_cc_;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -33,8 +33,8 @@
|
||||
#define GNSS_SDR_PULSE_BLANKING_FILTER_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <gnuradio/blocks/file_sink.h>
|
||||
#include <gnuradio/filter/freq_xlating_fir_filter_ccf.h>
|
||||
#include "gnss_block_interface.h"
|
||||
#include "pulse_blanking_cc.h"
|
||||
|
||||
@@ -73,6 +73,7 @@ public:
|
||||
private:
|
||||
ConfigurationInterface* config_;
|
||||
bool dump_;
|
||||
bool xlat_;
|
||||
std::string dump_filename_;
|
||||
std::string input_item_type_;
|
||||
size_t input_size_;
|
||||
@@ -82,6 +83,7 @@ private:
|
||||
unsigned int out_streams_;
|
||||
gr::blocks::file_sink::sptr file_sink_;
|
||||
pulse_blanking_cc_sptr pulse_blanking_cc_;
|
||||
gr::filter::freq_xlating_fir_filter_ccf::sptr freq_xlating_;
|
||||
};
|
||||
|
||||
#endif // GNSS_SDR_PULSE_BLANKING_FILTER_H_
|
||||
|
||||
Reference in New Issue
Block a user