mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-22 15:07:23 +00:00
Start migration to GNU Radio 3.7 new C++ API. This commit replaces some components of gnuradio-core by the new components gr-blocks, gr-fft and gr-filter.
git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@282 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
parent
0760fa0f3e
commit
818d9e14b5
@ -46,7 +46,7 @@ project
|
|||||||
project : requirements
|
project : requirements
|
||||||
<define>OMNITHREAD_POSIX
|
<define>OMNITHREAD_POSIX
|
||||||
<cxxflags>"-msse2 -mfpmath=sse -std=c++0x -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free"
|
<cxxflags>"-msse2 -mfpmath=sse -std=c++0x -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free"
|
||||||
<linkflags>"-larmadillo -lboost_system -lboost_filesystem -lboost_thread -lboost_date_time -llapack -lblas -lprofiler -ltcmalloc -lvolk"
|
<linkflags>"-lgnuradio-blocks -lgnuradio-fft -lgnuradio-filter -larmadillo -lboost_system -lboost_filesystem -lboost_thread -lboost_date_time -llapack -lblas -lprofiler -ltcmalloc -lvolk"
|
||||||
<include>src/algorithms/acquisition/adapters
|
<include>src/algorithms/acquisition/adapters
|
||||||
<include>src/algorithms/acquisition/gnuradio_blocks
|
<include>src/algorithms/acquisition/gnuradio_blocks
|
||||||
<include>src/algorithms/channel/adapters
|
<include>src/algorithms/channel/adapters
|
||||||
@ -85,7 +85,10 @@ project : requirements
|
|||||||
<include>$GNURADIO_ROOT/gnuradio-core/src/lib/general
|
<include>$GNURADIO_ROOT/gnuradio-core/src/lib/general
|
||||||
<include>$GNURADIO_ROOT/gnuradio-core/src/lib/gengen
|
<include>$GNURADIO_ROOT/gnuradio-core/src/lib/gengen
|
||||||
<include>$GNURADIO_ROOT/gr-uhd/include
|
<include>$GNURADIO_ROOT/gr-uhd/include
|
||||||
<include>$GNURADIO_ROOT/volk/lib
|
<include>$GNURADIO_ROOT/gr-blocks/include
|
||||||
|
<include>$GNURADIO_ROOT/gr-fft/include
|
||||||
|
<include>$GNURADIO_ROOT/gr-filter/include
|
||||||
|
#<include>$GNURADIO_ROOT/volk/lib
|
||||||
<include>$OSMOSDR_ROOT/include/osmosdr
|
<include>$OSMOSDR_ROOT/include/osmosdr
|
||||||
<include>$(GTEST_DIR)/include
|
<include>$(GTEST_DIR)/include
|
||||||
<threading>multi
|
<threading>multi
|
||||||
|
@ -588,7 +588,7 @@ void gps_l1_ca_ls_pvt::togeod(double *dphi, double *dlambda, double *h, double a
|
|||||||
}
|
}
|
||||||
if (i == (maxit-1))
|
if (i == (maxit-1))
|
||||||
{
|
{
|
||||||
DLOG(INFO) << "The computation of geodetic coordinates did not converged" << std::endl;
|
DLOG(INFO) << "The computation of geodetic coordinates did not converge";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*dphi = (*dphi) * rtd;
|
*dphi = (*dphi) * rtd;
|
||||||
|
@ -37,10 +37,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <boost/lexical_cast.hpp>
|
#include <boost/lexical_cast.hpp>
|
||||||
#include <gnuradio/gr_io_signature.h>
|
#include <gnuradio/gr_io_signature.h>
|
||||||
#include <gnuradio/gr_stream_to_vector.h>
|
|
||||||
#include <gnuradio/gr_vector_to_stream.h>
|
|
||||||
#include <gnuradio/gr_complex_to_interleaved_short.h>
|
|
||||||
#include <gnuradio/gr_interleaved_short_to_complex.h>
|
|
||||||
#include <glog/log_severity.h>
|
#include <glog/log_severity.h>
|
||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
|
|
||||||
@ -86,8 +82,9 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
|
|||||||
acquisition_cc_ = pcps_make_acquisition_cc(sampled_ms_,
|
acquisition_cc_ = pcps_make_acquisition_cc(sampled_ms_,
|
||||||
shift_resolution_, if_, fs_in_, samples_per_ms, queue_,
|
shift_resolution_, if_, fs_in_, samples_per_ms, queue_,
|
||||||
dump_, dump_filename_);
|
dump_, dump_filename_);
|
||||||
stream_to_vector_ = gr_make_stream_to_vector(item_size_,
|
//stream_to_vector_ = gr_make_stream_to_vector(item_size_,
|
||||||
vector_length_);
|
// vector_length_);
|
||||||
|
stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_);
|
||||||
DLOG(INFO) << "stream_to_vector("
|
DLOG(INFO) << "stream_to_vector("
|
||||||
<< stream_to_vector_->unique_id() << ")";
|
<< stream_to_vector_->unique_id() << ")";
|
||||||
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id()
|
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id()
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#include "acquisition_interface.h"
|
#include "acquisition_interface.h"
|
||||||
#include "pcps_acquisition_cc.h"
|
#include "pcps_acquisition_cc.h"
|
||||||
#include <gnuradio/gr_msg_queue.h>
|
#include <gnuradio/gr_msg_queue.h>
|
||||||
|
#include <gnuradio/blocks/stream_to_vector.h>
|
||||||
|
|
||||||
class ConfigurationInterface;
|
class ConfigurationInterface;
|
||||||
|
|
||||||
@ -121,9 +122,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
ConfigurationInterface* configuration_;
|
ConfigurationInterface* configuration_;
|
||||||
pcps_acquisition_cc_sptr acquisition_cc_;
|
pcps_acquisition_cc_sptr acquisition_cc_;
|
||||||
gr_block_sptr stream_to_vector_;
|
gr::blocks::stream_to_vector::sptr stream_to_vector_;
|
||||||
gr_block_sptr complex_to_short_;
|
|
||||||
gr_block_sptr short_to_complex_;
|
|
||||||
size_t item_size_;
|
size_t item_size_;
|
||||||
std::string item_type_;
|
std::string item_type_;
|
||||||
unsigned int vector_length_;
|
unsigned int vector_length_;
|
||||||
|
@ -38,10 +38,6 @@
|
|||||||
#include "configuration_interface.h"
|
#include "configuration_interface.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <gnuradio/gr_io_signature.h>
|
#include <gnuradio/gr_io_signature.h>
|
||||||
#include <gnuradio/gr_stream_to_vector.h>
|
|
||||||
#include <gnuradio/gr_vector_to_stream.h>
|
|
||||||
#include <gnuradio/gr_complex_to_interleaved_short.h>
|
|
||||||
#include <gnuradio/gr_interleaved_short_to_complex.h>
|
|
||||||
#include <glog/log_severity.h>
|
#include <glog/log_severity.h>
|
||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
|
|
||||||
@ -83,8 +79,9 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition(
|
|||||||
acquisition_cc_ = pcps_make_acquisition_cc(sampled_ms_,
|
acquisition_cc_ = pcps_make_acquisition_cc(sampled_ms_,
|
||||||
shift_resolution_, if_, fs_in_, vector_length_, queue_,
|
shift_resolution_, if_, fs_in_, vector_length_, queue_,
|
||||||
dump_, dump_filename_);
|
dump_, dump_filename_);
|
||||||
stream_to_vector_ = gr_make_stream_to_vector(item_size_,
|
|
||||||
vector_length_);
|
stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_);
|
||||||
|
|
||||||
DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id()
|
DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id()
|
||||||
<< ")";
|
<< ")";
|
||||||
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id()
|
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id()
|
||||||
|
@ -39,6 +39,8 @@
|
|||||||
#include "acquisition_interface.h"
|
#include "acquisition_interface.h"
|
||||||
#include "pcps_acquisition_cc.h"
|
#include "pcps_acquisition_cc.h"
|
||||||
#include <gnuradio/gr_msg_queue.h>
|
#include <gnuradio/gr_msg_queue.h>
|
||||||
|
#include <gnuradio/blocks/stream_to_vector.h>
|
||||||
|
|
||||||
|
|
||||||
class ConfigurationInterface;
|
class ConfigurationInterface;
|
||||||
|
|
||||||
@ -122,9 +124,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
pcps_acquisition_cc_sptr acquisition_cc_;
|
pcps_acquisition_cc_sptr acquisition_cc_;
|
||||||
gr_block_sptr stream_to_vector_;
|
gr::blocks::stream_to_vector::sptr stream_to_vector_;
|
||||||
gr_block_sptr complex_to_short_;
|
|
||||||
gr_block_sptr short_to_complex_;
|
|
||||||
size_t item_size_;
|
size_t item_size_;
|
||||||
std::string item_type_;
|
std::string item_type_;
|
||||||
unsigned int vector_length_;
|
unsigned int vector_length_;
|
||||||
|
@ -80,10 +80,10 @@ pcps_acquisition_cc::pcps_acquisition_cc(
|
|||||||
if (posix_memalign((void**)&d_fft_codes, 16, d_fft_size * sizeof(gr_complex)) == 0){};
|
if (posix_memalign((void**)&d_fft_codes, 16, d_fft_size * sizeof(gr_complex)) == 0){};
|
||||||
|
|
||||||
// Direct FFT
|
// Direct FFT
|
||||||
d_fft_if = new gri_fft_complex(d_fft_size, true);
|
d_fft_if = new gr::fft::fft_complex(d_fft_size, true);
|
||||||
|
|
||||||
// Inverse FFT
|
// Inverse FFT
|
||||||
d_ifft = new gri_fft_complex(d_fft_size, false);
|
d_ifft = new gr::fft::fft_complex(d_fft_size, false);
|
||||||
|
|
||||||
// For dumping samples into a file
|
// For dumping samples into a file
|
||||||
d_dump = dump;
|
d_dump = dump;
|
||||||
|
@ -53,7 +53,7 @@
|
|||||||
#include <gnuradio/gr_block.h>
|
#include <gnuradio/gr_block.h>
|
||||||
#include <gnuradio/gr_msg_queue.h>
|
#include <gnuradio/gr_msg_queue.h>
|
||||||
#include <gnuradio/gr_complex.h>
|
#include <gnuradio/gr_complex.h>
|
||||||
#include <gnuradio/gri_fft.h>
|
#include <gnuradio/fft/fft.h>
|
||||||
#include <queue>
|
#include <queue>
|
||||||
#include <boost/thread/mutex.hpp>
|
#include <boost/thread/mutex.hpp>
|
||||||
#include <boost/thread/thread.hpp>
|
#include <boost/thread/thread.hpp>
|
||||||
@ -72,7 +72,8 @@ pcps_make_acquisition_cc(unsigned int sampled_ms,
|
|||||||
* \brief This class implements a Parallel Code Phase Search Acquisition
|
* \brief This class implements a Parallel Code Phase Search Acquisition
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class pcps_acquisition_cc: public gr_block {
|
class pcps_acquisition_cc: public gr_block
|
||||||
|
{
|
||||||
private:
|
private:
|
||||||
friend pcps_acquisition_cc_sptr
|
friend pcps_acquisition_cc_sptr
|
||||||
pcps_make_acquisition_cc(unsigned int sampled_ms,
|
pcps_make_acquisition_cc(unsigned int sampled_ms,
|
||||||
@ -101,8 +102,8 @@ private:
|
|||||||
unsigned long int d_sample_counter;
|
unsigned long int d_sample_counter;
|
||||||
gr_complex* d_carrier;
|
gr_complex* d_carrier;
|
||||||
gr_complex* d_fft_codes;
|
gr_complex* d_fft_codes;
|
||||||
gri_fft_complex* d_fft_if;
|
gr::fft::fft_complex* d_fft_if;
|
||||||
gri_fft_complex* d_ifft;
|
gr::fft::fft_complex* d_ifft;
|
||||||
Gnss_Synchro *d_gnss_synchro;
|
Gnss_Synchro *d_gnss_synchro;
|
||||||
unsigned int d_code_phase;
|
unsigned int d_code_phase;
|
||||||
float d_doppler_freq;
|
float d_doppler_freq;
|
||||||
|
@ -69,7 +69,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct gps_channel_acquiring_fsm_S1: public sc::state<
|
struct gps_channel_acquiring_fsm_S1: public sc::state<
|
||||||
gps_channel_acquiring_fsm_S1, GpsL1CaChannelFsm> {
|
gps_channel_acquiring_fsm_S1, GpsL1CaChannelFsm> {
|
||||||
public:
|
public:
|
||||||
typedef mpl::list<sc::transition<
|
typedef mpl::list<sc::transition<
|
||||||
Ev_gps_channel_failed_acquisition_no_repeat,
|
Ev_gps_channel_failed_acquisition_no_repeat,
|
||||||
|
@ -29,7 +29,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ishort_to_complex.h"
|
#include "ishort_to_complex.h"
|
||||||
#include <gnuradio/gr_interleaved_short_to_complex.h>
|
|
||||||
#include "configuration_interface.h"
|
#include "configuration_interface.h"
|
||||||
#include <gnuradio/gr_io_signature.h>
|
#include <gnuradio/gr_io_signature.h>
|
||||||
#include <gnuradio/gr_file_sink.h>
|
#include <gnuradio/gr_file_sink.h>
|
||||||
@ -60,7 +59,8 @@ IshortToComplex::IshortToComplex(ConfigurationInterface* configuration, std::str
|
|||||||
|
|
||||||
size_t item_size=sizeof(gr_complex);
|
size_t item_size=sizeof(gr_complex);
|
||||||
|
|
||||||
gr_interleaved_short_to_complex_ = gr_make_interleaved_short_to_complex();
|
gr_interleaved_short_to_complex_ = gr::blocks::interleaved_short_to_complex::make();
|
||||||
|
|
||||||
DLOG(INFO) << "data_type_adapter_(" << gr_interleaved_short_to_complex_->unique_id() << ")";
|
DLOG(INFO) << "data_type_adapter_(" << gr_interleaved_short_to_complex_->unique_id() << ")";
|
||||||
|
|
||||||
if (dump_)
|
if (dump_)
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#include "gnss_synchro.h"
|
#include "gnss_synchro.h"
|
||||||
#include "gnss_block_interface.h"
|
#include "gnss_block_interface.h"
|
||||||
#include <gnuradio/gr_interleaved_short_to_complex.h>
|
#include <gnuradio/blocks/interleaved_short_to_complex.h>
|
||||||
#include <gnuradio/gr_msg_queue.h>
|
#include <gnuradio/gr_msg_queue.h>
|
||||||
|
|
||||||
class ConfigurationInterface;
|
class ConfigurationInterface;
|
||||||
@ -70,7 +70,7 @@ public:
|
|||||||
gr_basic_block_sptr get_right_block();
|
gr_basic_block_sptr get_right_block();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
gr_interleaved_short_to_complex_sptr gr_interleaved_short_to_complex_;
|
gr::blocks::interleaved_short_to_complex::sptr gr_interleaved_short_to_complex_;
|
||||||
ConfigurationInterface* config_;
|
ConfigurationInterface* config_;
|
||||||
bool dump_;
|
bool dump_;
|
||||||
std::string dump_filename_;
|
std::string dump_filename_;
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
#include <boost/lexical_cast.hpp>
|
#include <boost/lexical_cast.hpp>
|
||||||
#include <gnuradio/gr_io_signature.h>
|
#include <gnuradio/gr_io_signature.h>
|
||||||
#include <gnuradio/gr_file_sink.h>
|
#include <gnuradio/gr_file_sink.h>
|
||||||
#include <gnuradio/gr_remez.h>
|
#include <gnuradio/filter/pm_remez.h>
|
||||||
#include <glog/log_severity.h>
|
#include <glog/log_severity.h>
|
||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ FirFilter::FirFilter(ConfigurationInterface* configuration, std::string role,
|
|||||||
&& (output_item_type_.compare("gr_complex") == 0))
|
&& (output_item_type_.compare("gr_complex") == 0))
|
||||||
{
|
{
|
||||||
item_size = sizeof(gr_complex);
|
item_size = sizeof(gr_complex);
|
||||||
fir_filter_ccf_ = gr_make_fir_filter_ccf(1, taps_);
|
fir_filter_ccf_ = gr::filter::fir_filter_ccf::make(1, taps_);
|
||||||
DLOG(INFO) << "input_filter(" << fir_filter_ccf_->unique_id() << ")";
|
DLOG(INFO) << "input_filter(" << fir_filter_ccf_->unique_id() << ")";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -165,11 +165,11 @@ void FirFilter::init()
|
|||||||
|
|
||||||
std::string filter_type = config_->property(role_ + ".filter_type", default_filter_type);
|
std::string filter_type = config_->property(role_ + ".filter_type", default_filter_type);
|
||||||
int grid_density = config_->property(role_ + ".grid_density", default_grid_density);
|
int grid_density = config_->property(role_ + ".grid_density", default_grid_density);
|
||||||
// gr_remez implements the Parks-McClellan FIR filter design.
|
// pm_remez implements the Parks-McClellan FIR filter design.
|
||||||
// It calculates the optimal (in the Chebyshev/minimax sense) FIR filter
|
// It calculates the optimal (in the Chebyshev/minimax sense) FIR filter
|
||||||
// impulse response given a set of band edges, the desired response on
|
// impulse response given a set of band edges, the desired response on
|
||||||
// those bands, and the weight given to the error in those bands.
|
// those bands, and the weight given to the error in those bands.
|
||||||
std::vector<double> taps_d = gr_remez(number_of_taps - 1, bands, ampl, error_w, filter_type, 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());
|
taps_.reserve(taps_d.size());
|
||||||
for (std::vector<double>::iterator it = taps_d.begin(); it != taps_d.end(); it++)
|
for (std::vector<double>::iterator it = taps_d.begin(); it != taps_d.end(); it++)
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*!
|
/*!
|
||||||
* \file fir_filter.h
|
* \file fir_filter.h
|
||||||
* \brief Adapts a gnuradio gr_fir_filter designed with gr_remez
|
* \brief Adapts a gnuradio gr_fir_filter designed with pm_remez
|
||||||
* \author Luis Esteve, 2012. luis(at)epsilon-formacion.com
|
* \author Luis Esteve, 2012. luis(at)epsilon-formacion.com
|
||||||
*
|
*
|
||||||
* Detailed description of the file here if needed.
|
* Detailed description of the file here if needed.
|
||||||
@ -35,18 +35,13 @@
|
|||||||
|
|
||||||
#include "gnss_synchro.h"
|
#include "gnss_synchro.h"
|
||||||
#include "gnss_block_interface.h"
|
#include "gnss_block_interface.h"
|
||||||
#include <gnuradio/gr_fir_filter_ccc.h>
|
#include <gnuradio/filter/fir_filter_ccf.h>
|
||||||
#include <gnuradio/gr_fir_filter_ccf.h>
|
|
||||||
#include <gnuradio/gr_fir_filter_fcc.h>
|
|
||||||
#include <gnuradio/gr_fir_filter_fff.h>
|
|
||||||
#include <gnuradio/gr_fir_filter_fsf.h>
|
|
||||||
#include <gnuradio/gr_fir_filter_scc.h>
|
|
||||||
#include <gnuradio/gr_msg_queue.h>
|
#include <gnuradio/gr_msg_queue.h>
|
||||||
|
|
||||||
class ConfigurationInterface;
|
class ConfigurationInterface;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief This class adapts a GNU Radio gr_fir_filter designed with gr_remez
|
* \brief This class adapts a GNU Radio gr_fir_filter designed with pm_remez
|
||||||
*
|
*
|
||||||
* See Parks-McClellan FIR filter design, http://en.wikipedia.org/wiki/Parks-McClellan_filter_design_algorithm
|
* See Parks-McClellan FIR filter design, http://en.wikipedia.org/wiki/Parks-McClellan_filter_design_algorithm
|
||||||
* Calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response
|
* Calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response
|
||||||
@ -79,7 +74,7 @@ public:
|
|||||||
gr_basic_block_sptr get_right_block();
|
gr_basic_block_sptr get_right_block();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
gr_fir_filter_ccf_sptr fir_filter_ccf_;
|
gr::filter::fir_filter_ccf::sptr fir_filter_ccf_;
|
||||||
ConfigurationInterface* config_;
|
ConfigurationInterface* config_;
|
||||||
bool dump_;
|
bool dump_;
|
||||||
std::string dump_filename_;
|
std::string dump_filename_;
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
#include <boost/lexical_cast.hpp>
|
#include <boost/lexical_cast.hpp>
|
||||||
#include <gnuradio/gr_io_signature.h>
|
#include <gnuradio/gr_io_signature.h>
|
||||||
#include <gnuradio/gr_file_sink.h>
|
#include <gnuradio/gr_file_sink.h>
|
||||||
#include <gnuradio/gr_remez.h>
|
#include <gnuradio/filter/pm_remez.h>
|
||||||
#include <glog/log_severity.h>
|
#include <glog/log_severity.h>
|
||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ FreqXlatingFirFilter::FreqXlatingFirFilter(ConfigurationInterface* configuration
|
|||||||
&& (output_item_type_.compare("gr_complex") == 0))
|
&& (output_item_type_.compare("gr_complex") == 0))
|
||||||
{
|
{
|
||||||
item_size = sizeof(gr_complex);
|
item_size = sizeof(gr_complex);
|
||||||
freq_xlating_fir_filter_ccf_ = gr_make_freq_xlating_fir_filter_ccf(decimation_factor, taps_, intermediate_freq_, sampling_freq_);
|
freq_xlating_fir_filter_ccf_ = gr::filter::freq_xlating_fir_filter_ccf::make(decimation_factor, taps_, intermediate_freq_, sampling_freq_);
|
||||||
DLOG(INFO) << "input_filter(" << freq_xlating_fir_filter_ccf_->unique_id() << ")";
|
DLOG(INFO) << "input_filter(" << freq_xlating_fir_filter_ccf_->unique_id() << ")";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -172,8 +172,10 @@ void FreqXlatingFirFilter::init()
|
|||||||
|
|
||||||
std::string filter_type = config_->property(role_ + ".filter_type", default_filter_type);
|
std::string filter_type = config_->property(role_ + ".filter_type", default_filter_type);
|
||||||
int grid_density = config_->property(role_ + ".grid_density", default_grid_density);
|
int grid_density = config_->property(role_ + ".grid_density", default_grid_density);
|
||||||
std::vector<double> taps_d = gr_remez(number_of_taps - 1, bands, ampl,
|
|
||||||
|
std::vector<double> taps_d = gr::filter::pm_remez(number_of_taps - 1, bands, ampl,
|
||||||
error_w, filter_type, grid_density);
|
error_w, filter_type, grid_density);
|
||||||
|
|
||||||
taps_.reserve(taps_d.size());
|
taps_.reserve(taps_d.size());
|
||||||
for (std::vector<double>::iterator it = taps_d.begin(); it != taps_d.end(); it++)
|
for (std::vector<double>::iterator it = taps_d.begin(); it != taps_d.end(); it++)
|
||||||
{
|
{
|
||||||
|
@ -35,16 +35,13 @@
|
|||||||
|
|
||||||
#include "gnss_synchro.h"
|
#include "gnss_synchro.h"
|
||||||
#include "gnss_block_interface.h"
|
#include "gnss_block_interface.h"
|
||||||
#include <gnuradio/gr_freq_xlating_fir_filter_ccc.h>
|
#include <gnuradio/filter/freq_xlating_fir_filter_ccf.h>
|
||||||
#include <gnuradio/gr_freq_xlating_fir_filter_ccf.h>
|
|
||||||
#include <gnuradio/gr_freq_xlating_fir_filter_fcc.h>
|
|
||||||
#include <gnuradio/gr_freq_xlating_fir_filter_scc.h>
|
|
||||||
#include <gnuradio/gr_msg_queue.h>
|
#include <gnuradio/gr_msg_queue.h>
|
||||||
|
|
||||||
class ConfigurationInterface;
|
class ConfigurationInterface;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief This class adapts a gnuradio gr_freq_xlating_fir_filter designed with gr_remez
|
* \brief This class adapts a gnuradio gr_freq_xlating_fir_filter designed with pm_remez
|
||||||
*
|
*
|
||||||
* Construct a FIR filter with the given taps and a composite frequency
|
* Construct a FIR filter with the given taps and a composite frequency
|
||||||
* translation that shifts intermediate_freq_ down to zero Hz. The frequency
|
* translation that shifts intermediate_freq_ down to zero Hz. The frequency
|
||||||
@ -81,7 +78,7 @@ public:
|
|||||||
gr_basic_block_sptr get_right_block();
|
gr_basic_block_sptr get_right_block();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
gr_freq_xlating_fir_filter_ccf_sptr freq_xlating_fir_filter_ccf_;
|
gr::filter::freq_xlating_fir_filter_ccf::sptr freq_xlating_fir_filter_ccf_;
|
||||||
ConfigurationInterface* config_;
|
ConfigurationInterface* config_;
|
||||||
bool dump_;
|
bool dump_;
|
||||||
std::string dump_filename_;
|
std::string dump_filename_;
|
||||||
|
@ -38,8 +38,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef NCO_LIB_CC_H
|
#ifndef GNSS_SDR_NCO_LIB_CC_H_
|
||||||
#define NCO_LIB_CC_H
|
#define GNSS_SDR_NCO_LIB_CC_H_
|
||||||
|
|
||||||
#include <gr_fxpt.h>
|
#include <gr_fxpt.h>
|
||||||
#include <xmmintrin.h>
|
#include <xmmintrin.h>
|
||||||
|
@ -34,8 +34,8 @@
|
|||||||
#include "configuration_interface.h"
|
#include "configuration_interface.h"
|
||||||
#include "gps_l1_ca_observables_cc.h"
|
#include "gps_l1_ca_observables_cc.h"
|
||||||
#include <gnuradio/gr_io_signature.h>
|
#include <gnuradio/gr_io_signature.h>
|
||||||
#include <gnuradio/gr_stream_to_vector.h>
|
//#include <gnuradio/gr_stream_to_vector.h>
|
||||||
#include <gnuradio/gr_vector_to_stream.h>
|
//#include <gnuradio/gr_vector_to_stream.h>
|
||||||
#include <glog/log_severity.h>
|
#include <glog/log_severity.h>
|
||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
|
|
||||||
|
@ -182,7 +182,7 @@ int gps_l1_ca_observables_cc::general_work (int noutput_items, gr_vector_int &ni
|
|||||||
current_gnss_synchro[i].Pseudorange_symbol_shift = 0.0;
|
current_gnss_synchro[i].Pseudorange_symbol_shift = 0.0;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* 2. Compute RAW pseudorranges: Use only the valid channels (channels that are tracking a satellite)
|
* 2. Compute RAW pseudoranges: Use only the valid channels (channels that are tracking a satellite)
|
||||||
*/
|
*/
|
||||||
if(current_gnss_synchro_map.size() > 0 and flag_history_ok == true)
|
if(current_gnss_synchro_map.size() > 0 and flag_history_ok == true)
|
||||||
{
|
{
|
||||||
@ -219,18 +219,18 @@ int gps_l1_ca_observables_cc::general_work (int noutput_items, gr_vector_int &ni
|
|||||||
if (reference_channel != gnss_synchro_iter->second.Channel_ID)
|
if (reference_channel != gnss_synchro_iter->second.Channel_ID)
|
||||||
{
|
{
|
||||||
// compute the required symbol history shift in order to match the reference symbol
|
// compute the required symbol history shift in order to match the reference symbol
|
||||||
history_shift = gnss_synchro_iter->second.Preamble_symbol_counter-current_symbol;
|
history_shift = gnss_synchro_iter->second.Preamble_symbol_counter - current_symbol;
|
||||||
if (history_shift < (int)MAX_TOA_DELAY_MS ) // and history_shift>=0)
|
if (history_shift < (int)MAX_TOA_DELAY_MS ) // and history_shift>=0)
|
||||||
{
|
{
|
||||||
tmp_gnss_synchro= d_history_gnss_synchro_deque[gnss_synchro_iter->second.Channel_ID][history_shift];
|
tmp_gnss_synchro= d_history_gnss_synchro_deque[gnss_synchro_iter->second.Channel_ID][history_shift];
|
||||||
gnss_synchro_aligned_map.insert(std::pair<int,Gnss_Synchro>(gnss_synchro_iter->second.Channel_ID,tmp_gnss_synchro));
|
gnss_synchro_aligned_map.insert(std::pair<int,Gnss_Synchro>(gnss_synchro_iter->second.Channel_ID, tmp_gnss_synchro));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 3 Compute the pseudorranges using the aligned data map
|
* 3 Compute the pseudoranges using the aligned data map
|
||||||
*/
|
*/
|
||||||
double min_symbol_timestamp_ms;
|
double min_symbol_timestamp_ms;
|
||||||
double max_symbol_timestamp_ms;
|
double max_symbol_timestamp_ms;
|
||||||
|
@ -54,7 +54,6 @@ FileSignalSource::FileSignalSource(ConfigurationInterface* configuration,
|
|||||||
gr_msg_queue_sptr queue) :
|
gr_msg_queue_sptr 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/sc2_d16.dat";
|
std::string default_filename = "../data/sc2_d16.dat";
|
||||||
std::string default_item_type = "short";
|
std::string default_item_type = "short";
|
||||||
std::string default_dump_filename = "../data/sc2_d16.dat";
|
std::string default_dump_filename = "../data/sc2_d16.dat";
|
||||||
@ -117,7 +116,7 @@ FileSignalSource::FileSignalSource(ConfigurationInterface* configuration,
|
|||||||
|
|
||||||
DLOG(INFO) << "file_source(" << file_source_->unique_id() << ")";
|
DLOG(INFO) << "file_source(" << file_source_->unique_id() << ")";
|
||||||
|
|
||||||
if (samples_ == 0)
|
if (samples_ == 0) // read all file
|
||||||
{
|
{
|
||||||
/*!
|
/*!
|
||||||
* BUG workaround: The GNURadio file source does not stop the receiver after reaching the End of File.
|
* BUG workaround: The GNURadio file source does not stop the receiver after reaching the End of File.
|
||||||
@ -136,23 +135,31 @@ FileSignalSource::FileSignalSource(ConfigurationInterface* configuration,
|
|||||||
LOG_AT_LEVEL(ERROR) << "file_signal_source: Unable to open the samples file " << filename_.c_str();
|
LOG_AT_LEVEL(ERROR) << "file_signal_source: Unable to open the samples file " << filename_.c_str();
|
||||||
}
|
}
|
||||||
std::cout << std::setprecision(16);
|
std::cout << std::setprecision(16);
|
||||||
std::cout <<"Processing file " << filename_ << ", which contains " << (double)size << " [bytes]" << std::endl;
|
std::cout << "Processing file " << filename_ << ", which contains " << (double)size << " [bytes]" << std::endl;
|
||||||
if (size > 0)
|
if (size > 0)
|
||||||
{
|
{
|
||||||
samples_ = floor((double)size / (double)item_size()) - ceil(0.1 * (double)sampling_frequency_); //process all the samples available in the file excluding the last 100 ms
|
samples_ = floor((double)size / (double)item_size()) - ceil(0.1 * (double)sampling_frequency_); //process all the samples available in the file excluding the last 100 ms
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CHECK(samples_ > 0) << "File does not contain enough samples to process.";
|
||||||
double signal_duration_s;
|
double signal_duration_s;
|
||||||
signal_duration_s = (double)samples_ * ( 1 /(double)sampling_frequency_);
|
signal_duration_s = (double)samples_ * ( 1 /(double)sampling_frequency_);
|
||||||
DLOG(INFO) << "Total samples to be processed= "<< samples_ << " GNSS signal duration= " << signal_duration_s << " [s]";
|
DLOG(INFO) << "Total samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]";
|
||||||
std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]" << std::endl;
|
std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]" << std::endl;
|
||||||
// if samples != 0 then enable a flow valve to stop the process after n samples
|
// if samples_ > 0 then enable a flow valve to stop the process after n samples
|
||||||
if (samples_ != 0)
|
//if (samples_ > 0)
|
||||||
{
|
//{
|
||||||
valve_ = gnss_sdr_make_valve(item_size_, samples_, queue_);
|
valve_ = gnss_sdr_make_valve(item_size_, samples_, queue_);
|
||||||
DLOG(INFO) << "valve(" << valve_->unique_id() << ")";
|
DLOG(INFO) << "valve(" << valve_->unique_id() << ")";
|
||||||
}
|
//}
|
||||||
|
//else
|
||||||
|
//{
|
||||||
|
// std::cout << "Not enough samples to process." << std::endl;
|
||||||
|
// here we should exit the program
|
||||||
|
//throw;
|
||||||
|
//LOG(FATAL)
|
||||||
|
|
||||||
|
//}
|
||||||
|
|
||||||
if (dump_)
|
if (dump_)
|
||||||
{
|
{
|
||||||
@ -185,7 +192,7 @@ FileSignalSource::~FileSignalSource()
|
|||||||
|
|
||||||
void FileSignalSource::connect(gr_top_block_sptr top_block)
|
void FileSignalSource::connect(gr_top_block_sptr top_block)
|
||||||
{
|
{
|
||||||
if (samples_ != 0)
|
if (samples_ > 0)
|
||||||
{
|
{
|
||||||
if (enable_throttle_control_ == true)
|
if (enable_throttle_control_ == true)
|
||||||
{
|
{
|
||||||
@ -240,7 +247,7 @@ void FileSignalSource::connect(gr_top_block_sptr top_block)
|
|||||||
|
|
||||||
void FileSignalSource::disconnect(gr_top_block_sptr top_block)
|
void FileSignalSource::disconnect(gr_top_block_sptr top_block)
|
||||||
{
|
{
|
||||||
if (samples_ != 0)
|
if (samples_ > 0)
|
||||||
{
|
{
|
||||||
if (enable_throttle_control_ == true)
|
if (enable_throttle_control_ == true)
|
||||||
{
|
{
|
||||||
@ -305,7 +312,7 @@ gr_basic_block_sptr FileSignalSource::get_left_block()
|
|||||||
|
|
||||||
gr_basic_block_sptr FileSignalSource::get_right_block()
|
gr_basic_block_sptr FileSignalSource::get_right_block()
|
||||||
{
|
{
|
||||||
if (samples_ != 0)
|
if (samples_ > 0)
|
||||||
{
|
{
|
||||||
return valve_;
|
return valve_;
|
||||||
}
|
}
|
||||||
|
@ -34,8 +34,8 @@
|
|||||||
#include "configuration_interface.h"
|
#include "configuration_interface.h"
|
||||||
#include "gps_l1_ca_telemetry_decoder_cc.h"
|
#include "gps_l1_ca_telemetry_decoder_cc.h"
|
||||||
#include <gnuradio/gr_io_signature.h>
|
#include <gnuradio/gr_io_signature.h>
|
||||||
#include <gnuradio/gr_stream_to_vector.h>
|
//#include <gnuradio/gr_stream_to_vector.h>
|
||||||
#include <gnuradio/gr_vector_to_stream.h>
|
//#include <gnuradio/gr_vector_to_stream.h>
|
||||||
#include <glog/log_severity.h>
|
#include <glog/log_severity.h>
|
||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
|
|
||||||
|
@ -191,7 +191,8 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items, gr_vector_i
|
|||||||
corr_value += d_preambles_symbols[i];
|
corr_value += d_preambles_symbols[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
d_flag_preamble=false;
|
d_flag_preamble = false;
|
||||||
|
|
||||||
//******* frame sync ******************
|
//******* frame sync ******************
|
||||||
if (abs(corr_value) >= 160)
|
if (abs(corr_value) >= 160)
|
||||||
{
|
{
|
||||||
@ -206,7 +207,7 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items, gr_vector_i
|
|||||||
d_frame_bit_index = 8;
|
d_frame_bit_index = 8;
|
||||||
d_stat = 1; // enter into frame pre-detection status
|
d_stat = 1; // enter into frame pre-detection status
|
||||||
}
|
}
|
||||||
else if (d_stat == 1) //check 6 seconds of preample separation
|
else if (d_stat == 1) //check 6 seconds of preamble separation
|
||||||
{
|
{
|
||||||
preamble_diff = abs(d_sample_counter - d_preamble_index);
|
preamble_diff = abs(d_sample_counter - d_preamble_index);
|
||||||
if (abs(preamble_diff - 6000) < 1)
|
if (abs(preamble_diff - 6000) < 1)
|
||||||
@ -238,6 +239,7 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items, gr_vector_i
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//******* SYMBOL TO BIT *******
|
//******* SYMBOL TO BIT *******
|
||||||
d_symbol_accumulator += in[0][d_samples_per_bit*8 - 1].Prompt_I; // accumulate the input value in d_symbol_accumulator
|
d_symbol_accumulator += in[0][d_samples_per_bit*8 - 1].Prompt_I; // accumulate the input value in d_symbol_accumulator
|
||||||
d_symbol_accumulator_counter++;
|
d_symbol_accumulator_counter++;
|
||||||
@ -245,7 +247,7 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items, gr_vector_i
|
|||||||
{
|
{
|
||||||
if (d_symbol_accumulator > 0)
|
if (d_symbol_accumulator > 0)
|
||||||
{ //symbol to bit
|
{ //symbol to bit
|
||||||
d_GPS_frame_4bytes +=1; //insert the telemetry bit in LSB
|
d_GPS_frame_4bytes += 1; //insert the telemetry bit in LSB
|
||||||
}
|
}
|
||||||
d_symbol_accumulator = 0;
|
d_symbol_accumulator = 0;
|
||||||
d_symbol_accumulator_counter = 0;
|
d_symbol_accumulator_counter = 0;
|
||||||
|
@ -275,8 +275,8 @@ void Gps_L1_Ca_Dll_Pll_Tracking_cc::update_local_code()
|
|||||||
tcode_chips = -rem_code_phase_chips;
|
tcode_chips = -rem_code_phase_chips;
|
||||||
|
|
||||||
// Alternative EPL code generation (40% of speed improvement!)
|
// Alternative EPL code generation (40% of speed improvement!)
|
||||||
early_late_spc_samples=round(d_early_late_spc_chips/code_phase_step_chips);
|
early_late_spc_samples = round(d_early_late_spc_chips / code_phase_step_chips);
|
||||||
epl_loop_length_samples=d_current_prn_length_samples+early_late_spc_samples*2;
|
epl_loop_length_samples = d_current_prn_length_samples + early_late_spc_samples*2;
|
||||||
for (int i=0; i<epl_loop_length_samples; i++)
|
for (int i=0; i<epl_loop_length_samples; i++)
|
||||||
{
|
{
|
||||||
associated_chip_index = 1 + round(fmod(tcode_chips - d_early_late_spc_chips, code_length_chips));
|
associated_chip_index = 1 + round(fmod(tcode_chips - d_early_late_spc_chips, code_length_chips));
|
||||||
@ -399,15 +399,15 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items, gr_vector_in
|
|||||||
consume_each(samples_available);
|
consume_each(samples_available);
|
||||||
|
|
||||||
// make an output to not stop the rest of the processing blocks
|
// make an output to not stop the rest of the processing blocks
|
||||||
current_synchro_data.Prompt_I=0.0;
|
current_synchro_data.Prompt_I = 0.0;
|
||||||
current_synchro_data.Prompt_Q=0.0;
|
current_synchro_data.Prompt_Q = 0.0;
|
||||||
current_synchro_data.Tracking_timestamp_secs=(double)d_sample_counter/(double)d_fs_in;
|
current_synchro_data.Tracking_timestamp_secs = (double)d_sample_counter/(double)d_fs_in;
|
||||||
current_synchro_data.Carrier_phase_rads=0.0;
|
current_synchro_data.Carrier_phase_rads = 0.0;
|
||||||
current_synchro_data.Code_phase_secs=0.0;
|
current_synchro_data.Code_phase_secs = 0.0;
|
||||||
current_synchro_data.CN0_dB_hz=0.0;
|
current_synchro_data.CN0_dB_hz = 0.0;
|
||||||
current_synchro_data.Flag_valid_tracking=false;
|
current_synchro_data.Flag_valid_tracking = false;
|
||||||
|
|
||||||
*out[0] =current_synchro_data;
|
*out[0] = current_synchro_data;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -635,13 +635,8 @@ void Gps_L1_Ca_Dll_Pll_Tracking_cc::set_channel_queue(concurrent_queue<int> *cha
|
|||||||
d_channel_internal_queue = channel_internal_queue;
|
d_channel_internal_queue = channel_internal_queue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Gps_L1_Ca_Dll_Pll_Tracking_cc::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
|
void Gps_L1_Ca_Dll_Pll_Tracking_cc::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
|
||||||
{
|
{
|
||||||
d_acquisition_gnss_synchro = p_gnss_synchro;
|
d_acquisition_gnss_synchro = p_gnss_synchro;
|
||||||
|
|
||||||
// Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
|
||||||
//DLOG(INFO) << "Tracking code phase set to " << d_acq_code_phase_samples;
|
|
||||||
//DLOG(INFO) << "Tracking carrier doppler set to " << d_acq_carrier_doppler_hz;
|
|
||||||
//DLOG(INFO) << "Tracking Satellite set to " << d_satellite;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user