mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-12-15 04:30:33 +00:00
Remove pcps_acq_sc
Integrate cshort into pcps_acq_cc
This commit is contained in:
parent
41712e4722
commit
25634963cc
@ -91,21 +91,13 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
|
||||
if (item_type_.compare("cshort") == 0 )
|
||||
{
|
||||
item_size_ = sizeof(lv_16sc_t);
|
||||
acquisition_sc_ = pcps_make_acquisition_sc(sampled_ms_, max_dwells_,
|
||||
doppler_max_, if_, fs_in_, samples_per_ms, code_length_,
|
||||
bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_,
|
||||
dump_filename_);
|
||||
DLOG(INFO) << "acquisition(" << acquisition_sc_->unique_id() << ")";
|
||||
}
|
||||
else
|
||||
{
|
||||
item_size_ = sizeof(gr_complex);
|
||||
acquisition_cc_ = pcps_make_acquisition_cc(sampled_ms_, max_dwells_,
|
||||
doppler_max_, if_, fs_in_, samples_per_ms, code_length_,
|
||||
bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_,
|
||||
dump_filename_);
|
||||
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
|
||||
}
|
||||
else { item_size_ = sizeof(gr_complex); }
|
||||
acquisition_cc_ = pcps_make_acquisition_cc(sampled_ms_, max_dwells_,
|
||||
doppler_max_, if_, fs_in_, samples_per_ms, code_length_,
|
||||
bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_,
|
||||
dump_filename_, item_size_);
|
||||
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
|
||||
|
||||
stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_);
|
||||
DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id() << ")";
|
||||
@ -132,14 +124,7 @@ GalileoE1PcpsAmbiguousAcquisition::~GalileoE1PcpsAmbiguousAcquisition()
|
||||
void GalileoE1PcpsAmbiguousAcquisition::set_channel(unsigned int channel)
|
||||
{
|
||||
channel_ = channel;
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_channel(channel_);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_channel(channel_);
|
||||
}
|
||||
acquisition_cc_->set_channel(channel_);
|
||||
}
|
||||
|
||||
|
||||
@ -160,14 +145,7 @@ void GalileoE1PcpsAmbiguousAcquisition::set_threshold(float threshold)
|
||||
|
||||
DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_;
|
||||
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_threshold(threshold_);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_threshold(threshold_);
|
||||
}
|
||||
acquisition_cc_->set_threshold(threshold_);
|
||||
}
|
||||
|
||||
|
||||
@ -175,14 +153,7 @@ void GalileoE1PcpsAmbiguousAcquisition::set_doppler_max(unsigned int doppler_max
|
||||
{
|
||||
doppler_max_ = doppler_max;
|
||||
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_doppler_max(doppler_max_);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_doppler_max(doppler_max_);
|
||||
}
|
||||
acquisition_cc_->set_doppler_max(doppler_max_);
|
||||
}
|
||||
|
||||
|
||||
@ -190,14 +161,7 @@ void GalileoE1PcpsAmbiguousAcquisition::set_doppler_step(unsigned int doppler_st
|
||||
{
|
||||
doppler_step_ = doppler_step;
|
||||
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_doppler_step(doppler_step_);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_doppler_step(doppler_step_);
|
||||
}
|
||||
acquisition_cc_->set_doppler_step(doppler_step_);
|
||||
}
|
||||
|
||||
|
||||
@ -205,41 +169,19 @@ void GalileoE1PcpsAmbiguousAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_sync
|
||||
{
|
||||
gnss_synchro_ = gnss_synchro;
|
||||
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_gnss_synchro(gnss_synchro_);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_gnss_synchro(gnss_synchro_);
|
||||
}
|
||||
acquisition_cc_->set_gnss_synchro(gnss_synchro_);
|
||||
}
|
||||
|
||||
|
||||
signed int GalileoE1PcpsAmbiguousAcquisition::mag()
|
||||
{
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
return acquisition_sc_->mag();
|
||||
}
|
||||
else
|
||||
{
|
||||
return acquisition_cc_->mag();
|
||||
}
|
||||
return acquisition_cc_->mag();
|
||||
}
|
||||
|
||||
|
||||
void GalileoE1PcpsAmbiguousAcquisition::init()
|
||||
{
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->init();
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->init();
|
||||
}
|
||||
|
||||
acquisition_cc_->init();
|
||||
//set_local_code();
|
||||
}
|
||||
|
||||
@ -271,42 +213,20 @@ void GalileoE1PcpsAmbiguousAcquisition::set_local_code()
|
||||
memcpy(&(code_[i*code_length_]), code, sizeof(gr_complex)*code_length_);
|
||||
}
|
||||
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_local_code(code_);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_local_code(code_);
|
||||
}
|
||||
|
||||
acquisition_cc_->set_local_code(code_);
|
||||
delete[] code;
|
||||
}
|
||||
|
||||
|
||||
void GalileoE1PcpsAmbiguousAcquisition::reset()
|
||||
{
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_active(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_active(true);
|
||||
}
|
||||
acquisition_cc_->set_active(true);
|
||||
}
|
||||
|
||||
|
||||
void GalileoE1PcpsAmbiguousAcquisition::set_state(int state)
|
||||
{
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_state(state);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_state(state);
|
||||
}
|
||||
acquisition_cc_->set_state(state);
|
||||
}
|
||||
|
||||
|
||||
@ -339,7 +259,7 @@ void GalileoE1PcpsAmbiguousAcquisition::connect(gr::top_block_sptr top_block)
|
||||
}
|
||||
else if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
top_block->connect(stream_to_vector_, 0, acquisition_sc_, 0);
|
||||
top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0);
|
||||
}
|
||||
else if (item_type_.compare("cbyte") == 0)
|
||||
{
|
||||
@ -363,7 +283,7 @@ void GalileoE1PcpsAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block)
|
||||
}
|
||||
else if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
top_block->disconnect(stream_to_vector_, 0, acquisition_sc_, 0);
|
||||
top_block->disconnect(stream_to_vector_, 0, acquisition_cc_, 0);
|
||||
}
|
||||
else if (item_type_.compare("cbyte") == 0)
|
||||
{
|
||||
@ -405,13 +325,6 @@ gr::basic_block_sptr GalileoE1PcpsAmbiguousAcquisition::get_left_block()
|
||||
|
||||
gr::basic_block_sptr GalileoE1PcpsAmbiguousAcquisition::get_right_block()
|
||||
{
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
return acquisition_sc_;
|
||||
}
|
||||
else
|
||||
{
|
||||
return acquisition_cc_;
|
||||
}
|
||||
return acquisition_cc_;
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,6 @@
|
||||
#include "gnss_synchro.h"
|
||||
#include "acquisition_interface.h"
|
||||
#include "pcps_acquisition_cc.h"
|
||||
#include "pcps_acquisition_sc.h"
|
||||
#include "complex_byte_to_float_x2.h"
|
||||
#include <volk_gnsssdr/volk_gnsssdr.h>
|
||||
|
||||
@ -136,7 +135,6 @@ public:
|
||||
private:
|
||||
ConfigurationInterface* configuration_;
|
||||
pcps_acquisition_cc_sptr acquisition_cc_;
|
||||
pcps_acquisition_sc_sptr acquisition_sc_;
|
||||
gr::blocks::stream_to_vector::sptr stream_to_vector_;
|
||||
gr::blocks::float_to_complex::sptr float_to_complex_;
|
||||
complex_byte_to_float_x2_sptr cbyte_to_float_x2_;
|
||||
|
@ -84,20 +84,15 @@ GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition(
|
||||
if (item_type_.compare("cshort") == 0 )
|
||||
{
|
||||
item_size_ = sizeof(lv_16sc_t);
|
||||
acquisition_sc_ = pcps_make_acquisition_sc(sampled_ms_, max_dwells_,
|
||||
doppler_max_, if_, fs_in_, code_length_, code_length_,
|
||||
bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_, dump_filename_);
|
||||
DLOG(INFO) << "acquisition(" << acquisition_sc_->unique_id() << ")";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
item_size_ = sizeof(gr_complex);
|
||||
acquisition_cc_ = pcps_make_acquisition_cc(sampled_ms_, max_dwells_,
|
||||
doppler_max_, if_, fs_in_, code_length_, code_length_,
|
||||
bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_, dump_filename_);
|
||||
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
|
||||
}
|
||||
acquisition_cc_ = pcps_make_acquisition_cc(sampled_ms_, max_dwells_,
|
||||
doppler_max_, if_, fs_in_, code_length_, code_length_,
|
||||
bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_, dump_filename_, item_size_);
|
||||
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
|
||||
|
||||
stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_);
|
||||
DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id() << ")";
|
||||
@ -124,14 +119,7 @@ GlonassL1CaPcpsAcquisition::~GlonassL1CaPcpsAcquisition()
|
||||
void GlonassL1CaPcpsAcquisition::set_channel(unsigned int channel)
|
||||
{
|
||||
channel_ = channel;
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_channel(channel_);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_channel(channel_);
|
||||
}
|
||||
acquisition_cc_->set_channel(channel_);
|
||||
}
|
||||
|
||||
|
||||
@ -150,14 +138,7 @@ void GlonassL1CaPcpsAcquisition::set_threshold(float threshold)
|
||||
|
||||
DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_;
|
||||
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_threshold(threshold_);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_threshold(threshold_);
|
||||
}
|
||||
acquisition_cc_->set_threshold(threshold_);
|
||||
}
|
||||
|
||||
|
||||
@ -165,14 +146,7 @@ void GlonassL1CaPcpsAcquisition::set_doppler_max(unsigned int doppler_max)
|
||||
{
|
||||
doppler_max_ = doppler_max;
|
||||
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_doppler_max(doppler_max_);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_doppler_max(doppler_max_);
|
||||
}
|
||||
acquisition_cc_->set_doppler_max(doppler_max_);
|
||||
}
|
||||
|
||||
|
||||
@ -180,14 +154,7 @@ void GlonassL1CaPcpsAcquisition::set_doppler_step(unsigned int doppler_step)
|
||||
{
|
||||
doppler_step_ = doppler_step;
|
||||
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_doppler_step(doppler_step_);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_doppler_step(doppler_step_);
|
||||
}
|
||||
acquisition_cc_->set_doppler_step(doppler_step_);
|
||||
}
|
||||
|
||||
|
||||
@ -195,40 +162,19 @@ void GlonassL1CaPcpsAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro)
|
||||
{
|
||||
gnss_synchro_ = gnss_synchro;
|
||||
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_gnss_synchro(gnss_synchro_);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_gnss_synchro(gnss_synchro_);
|
||||
}
|
||||
acquisition_cc_->set_gnss_synchro(gnss_synchro_);
|
||||
}
|
||||
|
||||
|
||||
signed int GlonassL1CaPcpsAcquisition::mag()
|
||||
{
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
return acquisition_sc_->mag();
|
||||
}
|
||||
else
|
||||
{
|
||||
return acquisition_cc_->mag();
|
||||
}
|
||||
return acquisition_cc_->mag();
|
||||
}
|
||||
|
||||
|
||||
void GlonassL1CaPcpsAcquisition::init()
|
||||
{
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->init();
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->init();
|
||||
}
|
||||
acquisition_cc_->init();
|
||||
|
||||
set_local_code();
|
||||
}
|
||||
@ -246,42 +192,20 @@ void GlonassL1CaPcpsAcquisition::set_local_code()
|
||||
sizeof(gr_complex)*code_length_);
|
||||
}
|
||||
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_local_code(code_);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_local_code(code_);
|
||||
}
|
||||
|
||||
acquisition_cc_->set_local_code(code_);
|
||||
delete[] code;
|
||||
}
|
||||
|
||||
|
||||
void GlonassL1CaPcpsAcquisition::reset()
|
||||
{
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_active(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_active(true);
|
||||
}
|
||||
acquisition_cc_->set_active(true);
|
||||
}
|
||||
|
||||
|
||||
void GlonassL1CaPcpsAcquisition::set_state(int state)
|
||||
{
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_state(state);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_state(state);
|
||||
}
|
||||
acquisition_cc_->set_state(state);
|
||||
}
|
||||
|
||||
|
||||
@ -318,7 +242,7 @@ void GlonassL1CaPcpsAcquisition::connect(gr::top_block_sptr top_block)
|
||||
}
|
||||
else if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
top_block->connect(stream_to_vector_, 0, acquisition_sc_, 0);
|
||||
top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0);
|
||||
}
|
||||
else if (item_type_.compare("cbyte") == 0)
|
||||
{
|
||||
@ -342,7 +266,7 @@ void GlonassL1CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block)
|
||||
}
|
||||
else if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
top_block->disconnect(stream_to_vector_, 0, acquisition_sc_, 0);
|
||||
top_block->disconnect(stream_to_vector_, 0, acquisition_cc_, 0);
|
||||
}
|
||||
else if (item_type_.compare("cbyte") == 0)
|
||||
{
|
||||
@ -384,12 +308,5 @@ gr::basic_block_sptr GlonassL1CaPcpsAcquisition::get_left_block()
|
||||
|
||||
gr::basic_block_sptr GlonassL1CaPcpsAcquisition::get_right_block()
|
||||
{
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
return acquisition_sc_;
|
||||
}
|
||||
else
|
||||
{
|
||||
return acquisition_cc_;
|
||||
}
|
||||
return acquisition_cc_;
|
||||
}
|
||||
|
@ -40,7 +40,6 @@
|
||||
#include "gnss_synchro.h"
|
||||
#include "acquisition_interface.h"
|
||||
#include "pcps_acquisition_cc.h"
|
||||
#include "pcps_acquisition_sc.h"
|
||||
#include "complex_byte_to_float_x2.h"
|
||||
|
||||
|
||||
@ -137,7 +136,6 @@ public:
|
||||
private:
|
||||
ConfigurationInterface* configuration_;
|
||||
pcps_acquisition_cc_sptr acquisition_cc_;
|
||||
pcps_acquisition_sc_sptr acquisition_sc_;
|
||||
gr::blocks::stream_to_vector::sptr stream_to_vector_;
|
||||
gr::blocks::float_to_complex::sptr float_to_complex_;
|
||||
complex_byte_to_float_x2_sptr cbyte_to_float_x2_;
|
||||
|
@ -85,19 +85,15 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition(
|
||||
if (item_type_.compare("cshort") == 0 )
|
||||
{
|
||||
item_size_ = sizeof(lv_16sc_t);
|
||||
acquisition_sc_ = pcps_make_acquisition_sc(sampled_ms_, max_dwells_,
|
||||
doppler_max_, if_, fs_in_, code_length_, code_length_,
|
||||
bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_, dump_filename_);
|
||||
DLOG(INFO) << "acquisition(" << acquisition_sc_->unique_id() << ")";
|
||||
}
|
||||
else
|
||||
{
|
||||
item_size_ = sizeof(gr_complex);
|
||||
acquisition_cc_ = pcps_make_acquisition_cc(sampled_ms_, max_dwells_,
|
||||
doppler_max_, if_, fs_in_, code_length_, code_length_,
|
||||
bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_, dump_filename_);
|
||||
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
|
||||
}
|
||||
acquisition_cc_ = pcps_make_acquisition_cc(sampled_ms_, max_dwells_,
|
||||
doppler_max_, if_, fs_in_, code_length_, code_length_,
|
||||
bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_, dump_filename_, item_size_);
|
||||
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
|
||||
|
||||
stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_);
|
||||
DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id() << ")";
|
||||
@ -124,14 +120,7 @@ GpsL1CaPcpsAcquisition::~GpsL1CaPcpsAcquisition()
|
||||
void GpsL1CaPcpsAcquisition::set_channel(unsigned int channel)
|
||||
{
|
||||
channel_ = channel;
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_channel(channel_);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_channel(channel_);
|
||||
}
|
||||
acquisition_cc_->set_channel(channel_);
|
||||
}
|
||||
|
||||
|
||||
@ -150,15 +139,7 @@ void GpsL1CaPcpsAcquisition::set_threshold(float threshold)
|
||||
|
||||
DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_;
|
||||
|
||||
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_threshold(threshold_);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_threshold(threshold_);
|
||||
}
|
||||
acquisition_cc_->set_threshold(threshold_);
|
||||
}
|
||||
|
||||
|
||||
@ -166,14 +147,7 @@ void GpsL1CaPcpsAcquisition::set_doppler_max(unsigned int doppler_max)
|
||||
{
|
||||
doppler_max_ = doppler_max;
|
||||
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_doppler_max(doppler_max_);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_doppler_max(doppler_max_);
|
||||
}
|
||||
acquisition_cc_->set_doppler_max(doppler_max_);
|
||||
}
|
||||
|
||||
|
||||
@ -181,14 +155,7 @@ void GpsL1CaPcpsAcquisition::set_doppler_step(unsigned int doppler_step)
|
||||
{
|
||||
doppler_step_ = doppler_step;
|
||||
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_doppler_step(doppler_step_);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_doppler_step(doppler_step_);
|
||||
}
|
||||
acquisition_cc_->set_doppler_step(doppler_step_);
|
||||
}
|
||||
|
||||
|
||||
@ -196,41 +163,19 @@ void GpsL1CaPcpsAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro)
|
||||
{
|
||||
gnss_synchro_ = gnss_synchro;
|
||||
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_gnss_synchro(gnss_synchro_);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_gnss_synchro(gnss_synchro_);
|
||||
}
|
||||
acquisition_cc_->set_gnss_synchro(gnss_synchro_);
|
||||
}
|
||||
|
||||
|
||||
signed int GpsL1CaPcpsAcquisition::mag()
|
||||
{
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
return acquisition_sc_->mag();
|
||||
}
|
||||
else
|
||||
{
|
||||
return acquisition_cc_->mag();
|
||||
}
|
||||
return acquisition_cc_->mag();
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaPcpsAcquisition::init()
|
||||
{
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->init();
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->init();
|
||||
}
|
||||
|
||||
acquisition_cc_->init();
|
||||
//set_local_code();
|
||||
}
|
||||
|
||||
@ -247,42 +192,20 @@ void GpsL1CaPcpsAcquisition::set_local_code()
|
||||
sizeof(gr_complex)*code_length_);
|
||||
}
|
||||
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_local_code(code_);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_local_code(code_);
|
||||
}
|
||||
|
||||
acquisition_cc_->set_local_code(code_);
|
||||
delete[] code;
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaPcpsAcquisition::reset()
|
||||
{
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_active(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_active(true);
|
||||
}
|
||||
acquisition_cc_->set_active(true);
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaPcpsAcquisition::set_state(int state)
|
||||
{
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_state(state);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_state(state);
|
||||
}
|
||||
acquisition_cc_->set_state(state);
|
||||
}
|
||||
|
||||
|
||||
@ -315,7 +238,7 @@ void GpsL1CaPcpsAcquisition::connect(gr::top_block_sptr top_block)
|
||||
}
|
||||
else if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
top_block->connect(stream_to_vector_, 0, acquisition_sc_, 0);
|
||||
top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0);
|
||||
}
|
||||
else if (item_type_.compare("cbyte") == 0)
|
||||
{
|
||||
@ -339,7 +262,7 @@ void GpsL1CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block)
|
||||
}
|
||||
else if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
top_block->disconnect(stream_to_vector_, 0, acquisition_sc_, 0);
|
||||
top_block->disconnect(stream_to_vector_, 0, acquisition_cc_, 0);
|
||||
}
|
||||
else if (item_type_.compare("cbyte") == 0)
|
||||
{
|
||||
@ -381,13 +304,6 @@ gr::basic_block_sptr GpsL1CaPcpsAcquisition::get_left_block()
|
||||
|
||||
gr::basic_block_sptr GpsL1CaPcpsAcquisition::get_right_block()
|
||||
{
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
return acquisition_sc_;
|
||||
}
|
||||
else
|
||||
{
|
||||
return acquisition_cc_;
|
||||
}
|
||||
return acquisition_cc_;
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,6 @@
|
||||
#include "gnss_synchro.h"
|
||||
#include "acquisition_interface.h"
|
||||
#include "pcps_acquisition_cc.h"
|
||||
#include "pcps_acquisition_sc.h"
|
||||
#include "complex_byte_to_float_x2.h"
|
||||
#include <volk_gnsssdr/volk_gnsssdr.h>
|
||||
|
||||
@ -141,7 +140,6 @@ public:
|
||||
private:
|
||||
ConfigurationInterface* configuration_;
|
||||
pcps_acquisition_cc_sptr acquisition_cc_;
|
||||
pcps_acquisition_sc_sptr acquisition_sc_;
|
||||
gr::blocks::stream_to_vector::sptr stream_to_vector_;
|
||||
gr::blocks::float_to_complex::sptr float_to_complex_;
|
||||
complex_byte_to_float_x2_sptr cbyte_to_float_x2_;
|
||||
|
@ -85,21 +85,16 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition(
|
||||
if (item_type_.compare("cshort") == 0 )
|
||||
{
|
||||
item_size_ = sizeof(lv_16sc_t);
|
||||
acquisition_sc_ = pcps_make_acquisition_sc(1, max_dwells_,
|
||||
doppler_max_, if_, fs_in_, code_length_, code_length_,
|
||||
bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_, dump_filename_);
|
||||
DLOG(INFO) << "acquisition(" << acquisition_sc_->unique_id() << ")";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
item_size_ = sizeof(gr_complex);
|
||||
acquisition_cc_ = pcps_make_acquisition_cc(1, max_dwells_,
|
||||
}
|
||||
acquisition_cc_ = pcps_make_acquisition_cc(1, max_dwells_,
|
||||
doppler_max_, if_, fs_in_, code_length_, code_length_,
|
||||
bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_,
|
||||
dump_filename_);
|
||||
dump_filename_, item_size_);
|
||||
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
|
||||
}
|
||||
|
||||
stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_);
|
||||
DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id() << ")";
|
||||
@ -126,14 +121,7 @@ GpsL2MPcpsAcquisition::~GpsL2MPcpsAcquisition()
|
||||
void GpsL2MPcpsAcquisition::set_channel(unsigned int channel)
|
||||
{
|
||||
channel_ = channel;
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_channel(channel_);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_channel(channel_);
|
||||
}
|
||||
acquisition_cc_->set_channel(channel_);
|
||||
}
|
||||
|
||||
|
||||
@ -156,14 +144,7 @@ void GpsL2MPcpsAcquisition::set_threshold(float threshold)
|
||||
|
||||
DLOG(INFO) << "Channel " << channel_ <<" Threshold = " << threshold_;
|
||||
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_threshold(threshold_);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_threshold(threshold_);
|
||||
}
|
||||
acquisition_cc_->set_threshold(threshold_);
|
||||
}
|
||||
|
||||
|
||||
@ -171,14 +152,7 @@ void GpsL2MPcpsAcquisition::set_doppler_max(unsigned int doppler_max)
|
||||
{
|
||||
doppler_max_ = doppler_max;
|
||||
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_doppler_max(doppler_max_);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_doppler_max(doppler_max_);
|
||||
}
|
||||
acquisition_cc_->set_doppler_max(doppler_max_);
|
||||
}
|
||||
|
||||
|
||||
@ -188,14 +162,7 @@ void GpsL2MPcpsAcquisition::set_doppler_step(unsigned int doppler_step)
|
||||
{
|
||||
doppler_step_ = doppler_step;
|
||||
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_doppler_step(doppler_step_);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_doppler_step(doppler_step_);
|
||||
}
|
||||
acquisition_cc_->set_doppler_step(doppler_step_);
|
||||
}
|
||||
|
||||
|
||||
@ -203,41 +170,19 @@ void GpsL2MPcpsAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro)
|
||||
{
|
||||
gnss_synchro_ = gnss_synchro;
|
||||
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_gnss_synchro(gnss_synchro_);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_gnss_synchro(gnss_synchro_);
|
||||
}
|
||||
acquisition_cc_->set_gnss_synchro(gnss_synchro_);
|
||||
}
|
||||
|
||||
|
||||
signed int GpsL2MPcpsAcquisition::mag()
|
||||
{
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
return acquisition_sc_->mag();
|
||||
}
|
||||
else
|
||||
{
|
||||
return acquisition_cc_->mag();
|
||||
}
|
||||
return acquisition_cc_->mag();
|
||||
}
|
||||
|
||||
|
||||
void GpsL2MPcpsAcquisition::init()
|
||||
{
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->init();
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->init();
|
||||
}
|
||||
|
||||
acquisition_cc_->init();
|
||||
//set_local_code();
|
||||
}
|
||||
|
||||
@ -247,49 +192,18 @@ void GpsL2MPcpsAcquisition::set_local_code()
|
||||
|
||||
gps_l2c_m_code_gen_complex_sampled(code_, gnss_synchro_->PRN, fs_in_);
|
||||
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_local_code(code_);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_local_code(code_);
|
||||
}
|
||||
|
||||
// //debug
|
||||
// std::ofstream d_dump_file;
|
||||
// std::stringstream filename;
|
||||
// std::streamsize n = 2 * sizeof(float) * (code_length_); // complex file write
|
||||
// filename.str("");
|
||||
// filename << "../data/local_prn_sampled.dat";
|
||||
// d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary);
|
||||
// d_dump_file.write(reinterpret_cast<char*>(code_), n);
|
||||
// d_dump_file.close();
|
||||
acquisition_cc_->set_local_code(code_);
|
||||
}
|
||||
|
||||
|
||||
void GpsL2MPcpsAcquisition::reset()
|
||||
{
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_active(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_active(true);
|
||||
}
|
||||
acquisition_cc_->set_active(true);
|
||||
}
|
||||
|
||||
void GpsL2MPcpsAcquisition::set_state(int state)
|
||||
{
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_state(state);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_state(state);
|
||||
}
|
||||
acquisition_cc_->set_state(state);
|
||||
}
|
||||
|
||||
|
||||
@ -322,7 +236,7 @@ void GpsL2MPcpsAcquisition::connect(gr::top_block_sptr top_block)
|
||||
}
|
||||
else if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
top_block->connect(stream_to_vector_, 0, acquisition_sc_, 0);
|
||||
top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0);
|
||||
}
|
||||
else if (item_type_.compare("cbyte") == 0)
|
||||
{
|
||||
@ -346,7 +260,7 @@ void GpsL2MPcpsAcquisition::disconnect(gr::top_block_sptr top_block)
|
||||
}
|
||||
else if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
top_block->disconnect(stream_to_vector_, 0, acquisition_sc_, 0);
|
||||
top_block->disconnect(stream_to_vector_, 0, acquisition_cc_, 0);
|
||||
}
|
||||
else if (item_type_.compare("cbyte") == 0)
|
||||
{
|
||||
@ -388,13 +302,6 @@ gr::basic_block_sptr GpsL2MPcpsAcquisition::get_left_block()
|
||||
|
||||
gr::basic_block_sptr GpsL2MPcpsAcquisition::get_right_block()
|
||||
{
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
return acquisition_sc_;
|
||||
}
|
||||
else
|
||||
{
|
||||
return acquisition_cc_;
|
||||
}
|
||||
return acquisition_cc_;
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,6 @@
|
||||
#include "gnss_synchro.h"
|
||||
#include "acquisition_interface.h"
|
||||
#include "pcps_acquisition_cc.h"
|
||||
#include "pcps_acquisition_sc.h"
|
||||
#include "complex_byte_to_float_x2.h"
|
||||
#include <volk_gnsssdr/volk_gnsssdr.h>
|
||||
|
||||
@ -139,7 +138,6 @@ public:
|
||||
private:
|
||||
ConfigurationInterface* configuration_;
|
||||
pcps_acquisition_cc_sptr acquisition_cc_;
|
||||
pcps_acquisition_sc_sptr acquisition_sc_;
|
||||
gr::blocks::stream_to_vector::sptr stream_to_vector_;
|
||||
gr::blocks::float_to_complex::sptr float_to_complex_;
|
||||
complex_byte_to_float_x2_sptr cbyte_to_float_x2_;
|
||||
|
@ -84,21 +84,16 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition(
|
||||
if (item_type_.compare("cshort") == 0 )
|
||||
{
|
||||
item_size_ = sizeof(lv_16sc_t);
|
||||
acquisition_sc_ = pcps_make_acquisition_sc(1, max_dwells_,
|
||||
doppler_max_, if_, fs_in_, code_length_, code_length_,
|
||||
bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_, dump_filename_);
|
||||
DLOG(INFO) << "acquisition(" << acquisition_sc_->unique_id() << ")";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
item_size_ = sizeof(gr_complex);
|
||||
acquisition_cc_ = pcps_make_acquisition_cc(1, max_dwells_,
|
||||
doppler_max_, if_, fs_in_, code_length_, code_length_,
|
||||
bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_,
|
||||
dump_filename_);
|
||||
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
|
||||
}
|
||||
acquisition_cc_ = pcps_make_acquisition_cc(1, max_dwells_,
|
||||
doppler_max_, if_, fs_in_, code_length_, code_length_,
|
||||
bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_,
|
||||
dump_filename_, item_size_);
|
||||
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
|
||||
|
||||
stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_);
|
||||
DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id() << ")";
|
||||
@ -125,14 +120,7 @@ GpsL5iPcpsAcquisition::~GpsL5iPcpsAcquisition()
|
||||
void GpsL5iPcpsAcquisition::set_channel(unsigned int channel)
|
||||
{
|
||||
channel_ = channel;
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_channel(channel_);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_channel(channel_);
|
||||
}
|
||||
acquisition_cc_->set_channel(channel_);
|
||||
}
|
||||
|
||||
|
||||
@ -155,14 +143,7 @@ void GpsL5iPcpsAcquisition::set_threshold(float threshold)
|
||||
|
||||
DLOG(INFO) << "Channel " << channel_ <<" Threshold = " << threshold_;
|
||||
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_threshold(threshold_);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_threshold(threshold_);
|
||||
}
|
||||
acquisition_cc_->set_threshold(threshold_);
|
||||
}
|
||||
|
||||
|
||||
@ -170,14 +151,7 @@ void GpsL5iPcpsAcquisition::set_doppler_max(unsigned int doppler_max)
|
||||
{
|
||||
doppler_max_ = doppler_max;
|
||||
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_doppler_max(doppler_max_);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_doppler_max(doppler_max_);
|
||||
}
|
||||
acquisition_cc_->set_doppler_max(doppler_max_);
|
||||
}
|
||||
|
||||
|
||||
@ -187,14 +161,7 @@ void GpsL5iPcpsAcquisition::set_doppler_step(unsigned int doppler_step)
|
||||
{
|
||||
doppler_step_ = doppler_step;
|
||||
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_doppler_step(doppler_step_);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_doppler_step(doppler_step_);
|
||||
}
|
||||
acquisition_cc_->set_doppler_step(doppler_step_);
|
||||
}
|
||||
|
||||
|
||||
@ -202,41 +169,19 @@ void GpsL5iPcpsAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro)
|
||||
{
|
||||
gnss_synchro_ = gnss_synchro;
|
||||
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_gnss_synchro(gnss_synchro_);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_gnss_synchro(gnss_synchro_);
|
||||
}
|
||||
acquisition_cc_->set_gnss_synchro(gnss_synchro_);
|
||||
}
|
||||
|
||||
|
||||
signed int GpsL5iPcpsAcquisition::mag()
|
||||
{
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
return acquisition_sc_->mag();
|
||||
}
|
||||
else
|
||||
{
|
||||
return acquisition_cc_->mag();
|
||||
}
|
||||
return acquisition_cc_->mag();
|
||||
}
|
||||
|
||||
|
||||
void GpsL5iPcpsAcquisition::init()
|
||||
{
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->init();
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->init();
|
||||
}
|
||||
|
||||
acquisition_cc_->init();
|
||||
}
|
||||
|
||||
void GpsL5iPcpsAcquisition::set_local_code()
|
||||
@ -244,39 +189,18 @@ void GpsL5iPcpsAcquisition::set_local_code()
|
||||
|
||||
gps_l5i_code_gen_complex_sampled(code_, gnss_synchro_->PRN, fs_in_);
|
||||
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_local_code(code_);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_local_code(code_);
|
||||
}
|
||||
acquisition_cc_->set_local_code(code_);
|
||||
}
|
||||
|
||||
|
||||
void GpsL5iPcpsAcquisition::reset()
|
||||
{
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_active(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_active(true);
|
||||
}
|
||||
acquisition_cc_->set_active(true);
|
||||
}
|
||||
|
||||
void GpsL5iPcpsAcquisition::set_state(int state)
|
||||
{
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
acquisition_sc_->set_state(state);
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_cc_->set_state(state);
|
||||
}
|
||||
acquisition_cc_->set_state(state);
|
||||
}
|
||||
|
||||
|
||||
@ -309,7 +233,7 @@ void GpsL5iPcpsAcquisition::connect(gr::top_block_sptr top_block)
|
||||
}
|
||||
else if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
top_block->connect(stream_to_vector_, 0, acquisition_sc_, 0);
|
||||
top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0);
|
||||
}
|
||||
else if (item_type_.compare("cbyte") == 0)
|
||||
{
|
||||
@ -333,7 +257,7 @@ void GpsL5iPcpsAcquisition::disconnect(gr::top_block_sptr top_block)
|
||||
}
|
||||
else if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
top_block->disconnect(stream_to_vector_, 0, acquisition_sc_, 0);
|
||||
top_block->disconnect(stream_to_vector_, 0, acquisition_cc_, 0);
|
||||
}
|
||||
else if (item_type_.compare("cbyte") == 0)
|
||||
{
|
||||
@ -375,13 +299,6 @@ gr::basic_block_sptr GpsL5iPcpsAcquisition::get_left_block()
|
||||
|
||||
gr::basic_block_sptr GpsL5iPcpsAcquisition::get_right_block()
|
||||
{
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
return acquisition_sc_;
|
||||
}
|
||||
else
|
||||
{
|
||||
return acquisition_cc_;
|
||||
}
|
||||
return acquisition_cc_;
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,6 @@
|
||||
#include "gnss_synchro.h"
|
||||
#include "acquisition_interface.h"
|
||||
#include "pcps_acquisition_cc.h"
|
||||
#include "pcps_acquisition_sc.h"
|
||||
#include "complex_byte_to_float_x2.h"
|
||||
#include <volk_gnsssdr/volk_gnsssdr.h>
|
||||
|
||||
@ -139,7 +138,6 @@ public:
|
||||
private:
|
||||
ConfigurationInterface* configuration_;
|
||||
pcps_acquisition_cc_sptr acquisition_cc_;
|
||||
pcps_acquisition_sc_sptr acquisition_sc_;
|
||||
gr::blocks::stream_to_vector::sptr stream_to_vector_;
|
||||
gr::blocks::float_to_complex::sptr float_to_complex_;
|
||||
complex_byte_to_float_x2_sptr cbyte_to_float_x2_;
|
||||
|
@ -19,7 +19,6 @@
|
||||
|
||||
set(ACQ_GR_BLOCKS_SOURCES
|
||||
pcps_acquisition_cc.cc
|
||||
pcps_acquisition_sc.cc
|
||||
pcps_assisted_acquisition_cc.cc
|
||||
pcps_acquisition_fine_doppler_cc.cc
|
||||
pcps_tong_acquisition_cc.cc
|
||||
|
@ -39,7 +39,6 @@
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <matio.h>
|
||||
#include <volk/volk.h>
|
||||
#include <volk_gnsssdr/volk_gnsssdr.h>
|
||||
#include "GPS_L1_CA.h" //GPS_TWO_PI
|
||||
#include "GLONASS_L1_CA.h" //GLONASS_TWO_PI
|
||||
|
||||
@ -53,11 +52,11 @@ pcps_acquisition_cc_sptr pcps_make_acquisition_cc(
|
||||
int samples_per_ms, int samples_per_code,
|
||||
bool bit_transition_flag, bool use_CFAR_algorithm_flag,
|
||||
bool dump, bool blocking,
|
||||
std::string dump_filename)
|
||||
std::string dump_filename, size_t it_size)
|
||||
{
|
||||
return pcps_acquisition_cc_sptr(
|
||||
new pcps_acquisition_cc(sampled_ms, max_dwells, doppler_max, freq, fs_in, samples_per_ms,
|
||||
samples_per_code, bit_transition_flag, use_CFAR_algorithm_flag, dump, blocking, dump_filename));
|
||||
samples_per_code, bit_transition_flag, use_CFAR_algorithm_flag, dump, blocking, dump_filename, it_size));
|
||||
}
|
||||
|
||||
|
||||
@ -67,10 +66,10 @@ pcps_acquisition_cc::pcps_acquisition_cc(
|
||||
int samples_per_ms, int samples_per_code,
|
||||
bool bit_transition_flag, bool use_CFAR_algorithm_flag,
|
||||
bool dump, bool blocking,
|
||||
std::string dump_filename) :
|
||||
std::string dump_filename, size_t it_size) :
|
||||
gr::block("pcps_acquisition_cc",
|
||||
gr::io_signature::make(1, 1, sizeof(gr_complex) * sampled_ms * samples_per_ms * ( bit_transition_flag ? 2 : 1 )),
|
||||
gr::io_signature::make(0, 0, sizeof(gr_complex) * sampled_ms * samples_per_ms * ( bit_transition_flag ? 2 : 1 )) )
|
||||
gr::io_signature::make(1, 1, it_size * sampled_ms * samples_per_ms * ( bit_transition_flag ? 2 : 1 )),
|
||||
gr::io_signature::make(0, 0, it_size * sampled_ms * samples_per_ms * ( bit_transition_flag ? 2 : 1 )) )
|
||||
{
|
||||
this->message_port_register_out(pmt::mp("events"));
|
||||
|
||||
@ -97,6 +96,8 @@ pcps_acquisition_cc::pcps_acquisition_cc(
|
||||
d_code_phase = 0;
|
||||
d_test_statistics = 0.0;
|
||||
d_channel = 0;
|
||||
if(it_size == sizeof(gr_complex)) { d_cshort = false; }
|
||||
else { d_cshort = true; }
|
||||
|
||||
// COD:
|
||||
// Experimenting with the overlap/save technique for handling bit trannsitions
|
||||
@ -131,6 +132,10 @@ pcps_acquisition_cc::pcps_acquisition_cc(
|
||||
d_blocking = blocking;
|
||||
d_worker_active = false;
|
||||
d_data_buffer = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
|
||||
if(d_cshort)
|
||||
{
|
||||
d_data_buffer_sc = static_cast<lv_16sc_t*>(volk_gnsssdr_malloc(d_fft_size * sizeof(lv_16sc_t), volk_gnsssdr_get_alignment()));
|
||||
}
|
||||
grid_ = arma::fmat();
|
||||
}
|
||||
|
||||
@ -150,6 +155,7 @@ pcps_acquisition_cc::~pcps_acquisition_cc()
|
||||
delete d_ifft;
|
||||
delete d_fft_if;
|
||||
volk_gnsssdr_free(d_data_buffer);
|
||||
if(d_cshort) { volk_gnsssdr_free(d_data_buffer_sc); }
|
||||
}
|
||||
|
||||
|
||||
@ -360,7 +366,8 @@ int pcps_acquisition_cc::general_work(int noutput_items __attribute__((unused)),
|
||||
case 1:
|
||||
{
|
||||
// Copy the data to the core and let it know that new data is available
|
||||
memcpy(d_data_buffer, input_items[0], d_fft_size * sizeof(gr_complex));
|
||||
if(d_cshort) { memcpy(d_data_buffer_sc, input_items[0], d_fft_size * sizeof(lv_16sc_t)); }
|
||||
else { memcpy(d_data_buffer, input_items[0], d_fft_size * sizeof(gr_complex)); }
|
||||
if(d_blocking)
|
||||
{
|
||||
lk.unlock();
|
||||
@ -388,10 +395,9 @@ void pcps_acquisition_cc::acquisition_core( unsigned long int samp_count )
|
||||
int doppler;
|
||||
uint32_t indext = 0;
|
||||
float magt = 0.0;
|
||||
const gr_complex *in = d_data_buffer; //Get the input samples pointer
|
||||
|
||||
const gr_complex* in = d_data_buffer; //Get the input samples pointer
|
||||
int effective_fft_size = ( d_bit_transition_flag ? d_fft_size/2 : d_fft_size );
|
||||
|
||||
if(d_cshort) { volk_gnsssdr_16ic_convert_32fc(d_data_buffer, d_data_buffer_sc, d_fft_size); }
|
||||
float fft_normalization_factor = static_cast<float>(d_fft_size) * static_cast<float>(d_fft_size);
|
||||
|
||||
d_input_power = 0.0;
|
||||
|
@ -57,6 +57,7 @@
|
||||
#include <armadillo>
|
||||
#include <gnuradio/block.h>
|
||||
#include <gnuradio/fft/fft.h>
|
||||
#include <volk_gnsssdr/volk_gnsssdr.h>
|
||||
#include "gnss_synchro.h"
|
||||
|
||||
|
||||
@ -70,7 +71,7 @@ pcps_make_acquisition_cc(unsigned int sampled_ms, unsigned int max_dwells,
|
||||
int samples_per_ms, int samples_per_code,
|
||||
bool bit_transition_flag, bool use_CFAR_algorithm_flag,
|
||||
bool dump, bool blocking,
|
||||
std::string dump_filename);
|
||||
std::string dump_filename, size_t it_size);
|
||||
|
||||
/*!
|
||||
* \brief This class implements a Parallel Code Phase Search Acquisition.
|
||||
@ -87,14 +88,14 @@ private:
|
||||
int samples_per_ms, int samples_per_code,
|
||||
bool bit_transition_flag, bool use_CFAR_algorithm_flag,
|
||||
bool dump, bool blocking,
|
||||
std::string dump_filename);
|
||||
std::string dump_filename, size_t it_size);
|
||||
|
||||
pcps_acquisition_cc(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, bool use_CFAR_algorithm_flag,
|
||||
bool dump, bool blocking,
|
||||
std::string dump_filename);
|
||||
std::string dump_filename, size_t it_size);
|
||||
|
||||
void update_local_carrier(gr_complex* carrier_vector, int correlator_length_samples, float freq);
|
||||
void update_grid_doppler_wipeoffs();
|
||||
@ -112,6 +113,7 @@ private:
|
||||
bool d_dump;
|
||||
bool d_worker_active;
|
||||
bool d_blocking;
|
||||
bool d_cshort;
|
||||
float d_threshold;
|
||||
float d_mag;
|
||||
float d_input_power;
|
||||
@ -136,6 +138,7 @@ private:
|
||||
gr_complex** d_grid_doppler_wipeoffs;
|
||||
gr_complex* d_fft_codes;
|
||||
gr_complex* d_data_buffer;
|
||||
lv_16sc_t* d_data_buffer_sc;
|
||||
gr::fft::fft_complex* d_fft_if;
|
||||
gr::fft::fft_complex* d_ifft;
|
||||
Gnss_Synchro* d_gnss_synchro;
|
||||
|
@ -1,559 +0,0 @@
|
||||
/*!
|
||||
* \file pcps_acquisition_sc.cc
|
||||
* \brief This class implements a Parallel Code Phase Search Acquisition
|
||||
* \authors <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
|
||||
* <li> Cillian O'Driscoll, 2017. cillian(at)ieee.org
|
||||
* </ul>
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* GNSS-SDR is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNSS-SDR is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
#include "pcps_acquisition_sc.h"
|
||||
#include <sstream>
|
||||
#include <cstring>
|
||||
#include <matio.h>
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <glog/logging.h>
|
||||
#include <volk/volk.h>
|
||||
#include "control_message_factory.h"
|
||||
#include "GPS_L1_CA.h" //GPS_TWO_PI
|
||||
#include "GLONASS_L1_CA.h" //GLONASS_TWO_PI
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
pcps_acquisition_sc_sptr pcps_make_acquisition_sc(
|
||||
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, bool use_CFAR_algorithm_flag,
|
||||
bool dump, bool blocking,
|
||||
std::string dump_filename)
|
||||
{
|
||||
return pcps_acquisition_sc_sptr(
|
||||
new pcps_acquisition_sc(sampled_ms, max_dwells, doppler_max, freq, fs_in, samples_per_ms,
|
||||
samples_per_code, bit_transition_flag, use_CFAR_algorithm_flag, dump, blocking, dump_filename));
|
||||
}
|
||||
|
||||
|
||||
pcps_acquisition_sc::pcps_acquisition_sc(
|
||||
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, bool use_CFAR_algorithm_flag,
|
||||
bool dump, bool blocking,
|
||||
std::string dump_filename) :
|
||||
gr::block("pcps_acquisition_sc",
|
||||
gr::io_signature::make(1, 1, sizeof(lv_16sc_t) * sampled_ms * samples_per_ms * ( bit_transition_flag ? 2 : 1 )),
|
||||
gr::io_signature::make(0, 0, sizeof(lv_16sc_t) * sampled_ms * samples_per_ms * ( bit_transition_flag ? 2 : 1 )) )
|
||||
{
|
||||
this->message_port_register_out(pmt::mp("events"));
|
||||
|
||||
d_sample_counter = 0; // SAMPLE COUNTER
|
||||
d_active = false;
|
||||
d_state = 0;
|
||||
d_freq = freq;
|
||||
d_old_freq = freq;
|
||||
d_fs_in = fs_in;
|
||||
d_samples_per_ms = samples_per_ms;
|
||||
d_samples_per_code = samples_per_code;
|
||||
d_sampled_ms = sampled_ms;
|
||||
d_max_dwells = max_dwells;
|
||||
d_well_count = 0;
|
||||
d_doppler_max = doppler_max;
|
||||
d_fft_size = d_sampled_ms * d_samples_per_ms;
|
||||
d_mag = 0.0;
|
||||
d_input_power = 0.0;
|
||||
d_num_doppler_bins = 0;
|
||||
d_bit_transition_flag = bit_transition_flag;
|
||||
d_use_CFAR_algorithm_flag = use_CFAR_algorithm_flag;
|
||||
d_threshold = 0.0;
|
||||
d_doppler_step = 0;
|
||||
d_code_phase = 0;
|
||||
d_test_statistics = 0.0;
|
||||
d_channel = 0;
|
||||
|
||||
// COD:
|
||||
// Experimenting with the overlap/save technique for handling bit trannsitions
|
||||
// The problem: Circular correlation is asynchronous with the received code.
|
||||
// In effect the first code phase used in the correlation is the current
|
||||
// estimate of the code phase at the start of the input buffer. If this is 1/2
|
||||
// of the code period a bit transition would move all the signal energy into
|
||||
// adjacent frequency bands at +/- 1/T where T is the integration time.
|
||||
//
|
||||
// We can avoid this by doing linear correlation, effectively doubling the
|
||||
// size of the input buffer and padding the code with zeros.
|
||||
if( d_bit_transition_flag )
|
||||
{
|
||||
d_fft_size *= 2;
|
||||
d_max_dwells = 1; //Activation of d_bit_transition_flag invalidates the value of d_max_dwells
|
||||
}
|
||||
|
||||
d_fft_codes = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
|
||||
d_magnitude = static_cast<float*>(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment()));
|
||||
|
||||
//temporary storage for the input conversion from 16sc to float 32fc
|
||||
d_in_32fc = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
|
||||
|
||||
// Direct FFT
|
||||
d_fft_if = new gr::fft::fft_complex(d_fft_size, true);
|
||||
|
||||
// Inverse FFT
|
||||
d_ifft = new gr::fft::fft_complex(d_fft_size, false);
|
||||
|
||||
// For dumping samples into a file
|
||||
d_dump = dump;
|
||||
d_dump_filename = dump_filename;
|
||||
d_gnss_synchro = 0;
|
||||
d_grid_doppler_wipeoffs = 0;
|
||||
d_blocking = blocking;
|
||||
d_worker_active = false;
|
||||
d_data_buffer = static_cast<lv_16sc_t*>(volk_gnsssdr_malloc(d_fft_size * sizeof(lv_16sc_t), volk_gnsssdr_get_alignment()));
|
||||
grid_ = arma::fmat();
|
||||
}
|
||||
|
||||
|
||||
pcps_acquisition_sc::~pcps_acquisition_sc()
|
||||
{
|
||||
if (d_num_doppler_bins > 0)
|
||||
{
|
||||
for (unsigned int i = 0; i < d_num_doppler_bins; i++)
|
||||
{
|
||||
volk_gnsssdr_free(d_grid_doppler_wipeoffs[i]);
|
||||
}
|
||||
delete[] d_grid_doppler_wipeoffs;
|
||||
}
|
||||
volk_gnsssdr_free(d_fft_codes);
|
||||
volk_gnsssdr_free(d_magnitude);
|
||||
volk_gnsssdr_free(d_in_32fc);
|
||||
delete d_ifft;
|
||||
delete d_fft_if;
|
||||
volk_gnsssdr_free(d_data_buffer);
|
||||
}
|
||||
|
||||
|
||||
void pcps_acquisition_sc::set_local_code(std::complex<float> * code)
|
||||
{
|
||||
// reset the intermediate frequency
|
||||
d_freq = d_old_freq;
|
||||
// This will check if it's fdma, if yes will update the intermediate frequency and the doppler grid
|
||||
if( is_fdma() )
|
||||
{
|
||||
update_grid_doppler_wipeoffs();
|
||||
}
|
||||
// COD
|
||||
// Here we want to create a buffer that looks like this:
|
||||
// [ 0 0 0 ... 0 c_0 c_1 ... c_L]
|
||||
// where c_i is the local code and there are L zeros and L chips
|
||||
gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler
|
||||
if( d_bit_transition_flag )
|
||||
{
|
||||
int offset = d_fft_size / 2;
|
||||
std::fill_n( d_fft_if->get_inbuf(), offset, gr_complex( 0.0, 0.0 ) );
|
||||
memcpy(d_fft_if->get_inbuf() + offset, code, sizeof(gr_complex) * offset);
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(d_fft_if->get_inbuf(), code, sizeof(gr_complex) * d_fft_size);
|
||||
}
|
||||
|
||||
d_fft_if->execute(); // We need the FFT of local code
|
||||
volk_32fc_conjugate_32fc(d_fft_codes, d_fft_if->get_outbuf(), d_fft_size);
|
||||
}
|
||||
|
||||
|
||||
bool pcps_acquisition_sc::is_fdma()
|
||||
{
|
||||
// Dealing with FDMA system
|
||||
if( strcmp(d_gnss_synchro->Signal,"1G") == 0 )
|
||||
{
|
||||
d_freq += DFRQ1_GLO * GLONASS_PRN.at(d_gnss_synchro->PRN);
|
||||
LOG(INFO) << "Trying to acquire SV PRN " << d_gnss_synchro->PRN << " with freq " << DFRQ1_GLO * GLONASS_PRN.at(d_gnss_synchro->PRN) << " in Channel " << GLONASS_PRN.at(d_gnss_synchro->PRN) << std::endl;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void pcps_acquisition_sc::update_local_carrier(gr_complex* carrier_vector, int correlator_length_samples, float freq)
|
||||
{
|
||||
float phase_step_rad = GPS_TWO_PI * freq / static_cast<float>(d_fs_in);
|
||||
float _phase[1];
|
||||
_phase[0] = 0;
|
||||
volk_gnsssdr_s32f_sincos_32fc(carrier_vector, - phase_step_rad, _phase, correlator_length_samples);
|
||||
}
|
||||
|
||||
|
||||
void pcps_acquisition_sc::init()
|
||||
{
|
||||
d_gnss_synchro->Flag_valid_acquisition = false;
|
||||
d_gnss_synchro->Flag_valid_symbol_output = false;
|
||||
d_gnss_synchro->Flag_valid_pseudorange = false;
|
||||
d_gnss_synchro->Flag_valid_word = false;
|
||||
|
||||
d_gnss_synchro->Acq_delay_samples = 0.0;
|
||||
d_gnss_synchro->Acq_doppler_hz = 0.0;
|
||||
d_gnss_synchro->Acq_samplestamp_samples = 0;
|
||||
d_mag = 0.0;
|
||||
d_input_power = 0.0;
|
||||
|
||||
d_num_doppler_bins = ceil( static_cast<double>(static_cast<int>(d_doppler_max) - static_cast<int>(-d_doppler_max)) / static_cast<double>(d_doppler_step));
|
||||
|
||||
// Create the carrier Doppler wipeoff signals
|
||||
d_grid_doppler_wipeoffs = new gr_complex*[d_num_doppler_bins];
|
||||
|
||||
for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++)
|
||||
{
|
||||
d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
|
||||
int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
|
||||
update_local_carrier(d_grid_doppler_wipeoffs[doppler_index], d_fft_size, d_freq + doppler);
|
||||
}
|
||||
d_worker_active = false;
|
||||
|
||||
if(d_dump)
|
||||
{
|
||||
unsigned int effective_fft_size = (d_bit_transition_flag ? (d_fft_size / 2) : d_fft_size);
|
||||
grid_ = arma::fmat(effective_fft_size, d_num_doppler_bins, arma::fill::zeros);
|
||||
}
|
||||
}
|
||||
|
||||
void pcps_acquisition_sc::update_grid_doppler_wipeoffs()
|
||||
{
|
||||
// Create the carrier Doppler wipeoff signals
|
||||
d_grid_doppler_wipeoffs = new gr_complex*[d_num_doppler_bins];
|
||||
|
||||
for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++)
|
||||
{
|
||||
d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
|
||||
int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
|
||||
update_local_carrier(d_grid_doppler_wipeoffs[doppler_index], d_fft_size, d_freq + doppler);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void pcps_acquisition_sc::set_state(int state)
|
||||
{
|
||||
gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler
|
||||
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_active = true;
|
||||
}
|
||||
else if (d_state == 0)
|
||||
{}
|
||||
else
|
||||
{
|
||||
LOG(ERROR) << "State can only be set to 0 or 1";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void pcps_acquisition_sc::send_positive_acquisition()
|
||||
{
|
||||
// 6.1- Declare positive acquisition using a message port
|
||||
//0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL
|
||||
DLOG(INFO) << "positive acquisition"
|
||||
<< ", satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN
|
||||
<< ", sample_stamp " << d_sample_counter
|
||||
<< ", test statistics value " << d_test_statistics
|
||||
<< ", test statistics threshold " << d_threshold
|
||||
<< ", code phase " << d_gnss_synchro->Acq_delay_samples
|
||||
<< ", doppler " << d_gnss_synchro->Acq_doppler_hz
|
||||
<< ", magnitude " << d_mag
|
||||
<< ", input signal power " << d_input_power;
|
||||
|
||||
this->message_port_pub(pmt::mp("events"), pmt::from_long(1));
|
||||
}
|
||||
|
||||
|
||||
void pcps_acquisition_sc::send_negative_acquisition()
|
||||
{
|
||||
// 6.2- Declare negative acquisition using a message port
|
||||
//0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL
|
||||
DLOG(INFO) << "negative acquisition"
|
||||
<< ", satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN
|
||||
<< ", sample_stamp " << d_sample_counter
|
||||
<< ", test statistics value " << d_test_statistics
|
||||
<< ", test statistics threshold " << d_threshold
|
||||
<< ", code phase " << d_gnss_synchro->Acq_delay_samples
|
||||
<< ", doppler " << d_gnss_synchro->Acq_doppler_hz
|
||||
<< ", magnitude " << d_mag
|
||||
<< ", input signal power " << d_input_power;
|
||||
|
||||
this->message_port_pub(pmt::mp("events"), pmt::from_long(2));
|
||||
}
|
||||
|
||||
|
||||
int pcps_acquisition_sc::general_work(int noutput_items __attribute__((unused)),
|
||||
gr_vector_int &ninput_items, gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items __attribute__((unused)))
|
||||
{
|
||||
/*
|
||||
* By J.Arribas, L.Esteve and M.Molina
|
||||
* Acquisition strategy (Kay Borre book + CFAR threshold):
|
||||
* 1. Compute the input signal power estimation
|
||||
* 2. Doppler serial search loop
|
||||
* 3. Perform the FFT-based circular convolution (parallel time search)
|
||||
* 4. Record the maximum peak and the associated synchronization parameters
|
||||
* 5. Compute the test statistics and compare to the threshold
|
||||
* 6. Declare positive or negative acquisition using a message port
|
||||
*/
|
||||
|
||||
gr::thread::scoped_lock lk(d_setlock);
|
||||
if(!d_active || d_worker_active)
|
||||
{
|
||||
d_sample_counter += d_fft_size * ninput_items[0];
|
||||
consume_each(ninput_items[0]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch(d_state)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
//restart acquisition variables
|
||||
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_state = 1;
|
||||
d_sample_counter += d_fft_size * ninput_items[0]; // sample counter
|
||||
consume_each(ninput_items[0]);
|
||||
break;
|
||||
}
|
||||
|
||||
case 1:
|
||||
{
|
||||
// Copy the data to the core and let it know that new data is available
|
||||
memcpy(d_data_buffer, input_items[0], d_fft_size * sizeof(lv_16sc_t));
|
||||
if(d_blocking)
|
||||
{
|
||||
lk.unlock();
|
||||
acquisition_core(d_sample_counter);
|
||||
}
|
||||
else
|
||||
{
|
||||
gr::thread::thread d_worker(&pcps_acquisition_sc::acquisition_core, this, d_sample_counter);
|
||||
d_worker_active = true;
|
||||
}
|
||||
d_sample_counter += d_fft_size;
|
||||
consume_each(1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void pcps_acquisition_sc::acquisition_core( unsigned long int samp_count )
|
||||
{
|
||||
gr::thread::scoped_lock lk(d_setlock);
|
||||
|
||||
// initialize acquisition algorithm
|
||||
int doppler;
|
||||
uint32_t indext = 0;
|
||||
float magt = 0.0;
|
||||
const lv_16sc_t *in = d_data_buffer; //Get the input samples pointer
|
||||
|
||||
int effective_fft_size = ( d_bit_transition_flag ? d_fft_size/2 : d_fft_size );
|
||||
|
||||
float fft_normalization_factor = static_cast<float>(d_fft_size) * static_cast<float>(d_fft_size);
|
||||
|
||||
d_input_power = 0.0;
|
||||
d_mag = 0.0;
|
||||
d_well_count++;
|
||||
volk_gnsssdr_16ic_convert_32fc(d_in_32fc, in, effective_fft_size);
|
||||
|
||||
DLOG(INFO) << "Channel: " << d_channel
|
||||
<< " , doing acquisition of satellite: " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN
|
||||
<< " ,sample stamp: " << samp_count << ", threshold: "
|
||||
<< d_threshold << ", doppler_max: " << d_doppler_max
|
||||
<< ", doppler_step: " << d_doppler_step
|
||||
<< ", use_CFAR_algorithm_flag: " << ( d_use_CFAR_algorithm_flag ? "true" : "false" );
|
||||
|
||||
lk.unlock();
|
||||
if (d_use_CFAR_algorithm_flag)
|
||||
{
|
||||
// 1- (optional) Compute the input signal power estimation
|
||||
volk_32fc_magnitude_squared_32f(d_magnitude, d_in_32fc, d_fft_size);
|
||||
volk_32f_accumulator_s32f(&d_input_power, d_magnitude, d_fft_size);
|
||||
d_input_power /= static_cast<float>(d_fft_size);
|
||||
}
|
||||
// 2- Doppler frequency search loop
|
||||
for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++)
|
||||
{
|
||||
// doppler search steps
|
||||
doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
|
||||
|
||||
volk_32fc_x2_multiply_32fc(d_fft_if->get_inbuf(), d_in_32fc, d_grid_doppler_wipeoffs[doppler_index], d_fft_size);
|
||||
|
||||
// 3- Perform the FFT-based convolution (parallel time search)
|
||||
// Compute the FFT of the carrier wiped--off incoming signal
|
||||
d_fft_if->execute();
|
||||
|
||||
// Multiply carrier wiped--off, Fourier transformed incoming signal
|
||||
// with the local FFT'd code reference using SIMD operations with VOLK library
|
||||
volk_32fc_x2_multiply_32fc(d_ifft->get_inbuf(), d_fft_if->get_outbuf(), d_fft_codes, d_fft_size);
|
||||
|
||||
// compute the inverse FFT
|
||||
d_ifft->execute();
|
||||
|
||||
// Search maximum
|
||||
size_t offset = ( d_bit_transition_flag ? effective_fft_size : 0 );
|
||||
volk_32fc_magnitude_squared_32f(d_magnitude, d_ifft->get_outbuf() + offset, effective_fft_size);
|
||||
volk_gnsssdr_32f_index_max_32u(&indext, d_magnitude, effective_fft_size);
|
||||
magt = d_magnitude[indext];
|
||||
|
||||
if (d_use_CFAR_algorithm_flag)
|
||||
{
|
||||
// Normalize the maximum value to correct the scale factor introduced by FFTW
|
||||
magt = d_magnitude[indext] / (fft_normalization_factor * fft_normalization_factor);
|
||||
}
|
||||
// 4- record the maximum peak and the associated synchronization parameters
|
||||
if (d_mag < magt)
|
||||
{
|
||||
d_mag = magt;
|
||||
|
||||
if (!d_use_CFAR_algorithm_flag)
|
||||
{
|
||||
// Search grid noise floor approximation for this doppler line
|
||||
volk_32f_accumulator_s32f(&d_input_power, d_magnitude, effective_fft_size);
|
||||
d_input_power = (d_input_power - d_mag) / (effective_fft_size - 1);
|
||||
}
|
||||
|
||||
// In case that d_bit_transition_flag = true, we compare the potentially
|
||||
// new maximum test statistics (d_mag/d_input_power) with the value in
|
||||
// d_test_statistics. When the second dwell is being processed, the value
|
||||
// of d_mag/d_input_power could be lower than d_test_statistics (i.e,
|
||||
// the maximum test statistics in the previous dwell is greater than
|
||||
// current d_mag/d_input_power). Note that d_test_statistics is not
|
||||
// restarted between consecutive dwells in multidwell operation.
|
||||
|
||||
if (d_test_statistics < (d_mag / d_input_power) || !d_bit_transition_flag)
|
||||
{
|
||||
d_gnss_synchro->Acq_delay_samples = static_cast<double>(indext % d_samples_per_code);
|
||||
d_gnss_synchro->Acq_doppler_hz = static_cast<double>(doppler);
|
||||
d_gnss_synchro->Acq_samplestamp_samples = samp_count;
|
||||
|
||||
// 5- Compute the test statistics and compare to the threshold
|
||||
//d_test_statistics = 2 * d_fft_size * d_mag / d_input_power;
|
||||
d_test_statistics = d_mag / d_input_power;
|
||||
}
|
||||
}
|
||||
// Record results to file if required
|
||||
if (d_dump)
|
||||
{
|
||||
memcpy(grid_.colptr(doppler_index), d_magnitude, sizeof(float) * effective_fft_size);
|
||||
if(doppler_index == (d_num_doppler_bins - 1))
|
||||
{
|
||||
std::string filename = d_dump_filename;
|
||||
filename.append("_");
|
||||
filename.append(1, d_gnss_synchro->System);
|
||||
filename.append("_");
|
||||
filename.append(1, d_gnss_synchro->Signal[0]);
|
||||
filename.append(1, d_gnss_synchro->Signal[1]);
|
||||
filename.append("_sat_");
|
||||
filename.append(std::to_string(d_gnss_synchro->PRN));
|
||||
filename.append(".mat");
|
||||
mat_t* matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73);
|
||||
if(matfp == NULL)
|
||||
{
|
||||
std::cout << "Unable to create or open Acquisition dump file" << std::endl;
|
||||
d_dump = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
size_t dims[2] = {static_cast<size_t>(effective_fft_size), static_cast<size_t>(d_num_doppler_bins)};
|
||||
matvar_t* matvar = Mat_VarCreate("grid", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, grid_.memptr(), 0);
|
||||
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
|
||||
Mat_VarFree(matvar);
|
||||
|
||||
dims[0] = static_cast<size_t>(1);
|
||||
dims[1] = static_cast<size_t>(1);
|
||||
matvar = Mat_VarCreate("doppler_max", MAT_C_SINGLE, MAT_T_UINT32, 1, dims, &d_doppler_max, 0);
|
||||
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
|
||||
Mat_VarFree(matvar);
|
||||
|
||||
matvar = Mat_VarCreate("doppler_step", MAT_C_SINGLE, MAT_T_UINT32, 1, dims, &d_doppler_step, 0);
|
||||
Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE
|
||||
Mat_VarFree(matvar);
|
||||
|
||||
Mat_Close(matfp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
lk.lock();
|
||||
if (!d_bit_transition_flag)
|
||||
{
|
||||
if (d_test_statistics > d_threshold)
|
||||
{
|
||||
d_state = 0; // Positive acquisition
|
||||
d_active = false;
|
||||
send_positive_acquisition();
|
||||
}
|
||||
else if (d_well_count == d_max_dwells)
|
||||
{
|
||||
d_state = 0;
|
||||
d_active = false;
|
||||
send_negative_acquisition();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (d_well_count == d_max_dwells) // d_max_dwells = 2
|
||||
{
|
||||
if (d_test_statistics > d_threshold)
|
||||
{
|
||||
d_state = 0; // Positive acquisition
|
||||
d_active = false;
|
||||
send_positive_acquisition();
|
||||
}
|
||||
else
|
||||
{
|
||||
d_state = 0; // Negative acquisition
|
||||
d_active = false;
|
||||
send_negative_acquisition();
|
||||
}
|
||||
}
|
||||
}
|
||||
d_worker_active = false;
|
||||
}
|
@ -1,249 +0,0 @@
|
||||
/*!
|
||||
* \file pcps_acquisition_sc.h
|
||||
* \brief This class implements a Parallel Code Phase Search Acquisition
|
||||
*
|
||||
* Acquisition strategy (Kay Borre book + CFAR threshold).
|
||||
* <ol>
|
||||
* <li> Compute the input signal power estimation
|
||||
* <li> Doppler serial search loop
|
||||
* <li> Perform the FFT-based circular convolution (parallel time search)
|
||||
* <li> Record the maximum peak and the associated synchronization parameters
|
||||
* <li> Compute the test statistics and compare to the threshold
|
||||
* <li> Declare positive or negative acquisition using a message port
|
||||
* </ol>
|
||||
*
|
||||
* Kay Borre book: K.Borre, D.M.Akos, N.Bertelsen, P.Rinder, and S.H.Jensen,
|
||||
* "A Software-Defined GPS and Galileo Receiver. A Single-Frequency
|
||||
* Approach", Birkhauser, 2007. pp 81-84
|
||||
*
|
||||
* \authors <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
|
||||
* <li> Cillian O'Driscoll, 2017. cillian(at)ieee.org
|
||||
* </ul>
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* GNSS-SDR is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNSS-SDR is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef GNSS_SDR_PCPS_ACQUISITION_SC_H_
|
||||
#define GNSS_SDR_PCPS_ACQUISITION_SC_H_
|
||||
|
||||
#include <string>
|
||||
#include <armadillo>
|
||||
#include <gnuradio/block.h>
|
||||
#include <gnuradio/fft/fft.h>
|
||||
#include <volk_gnsssdr/volk_gnsssdr.h>
|
||||
#include "gnss_synchro.h"
|
||||
|
||||
|
||||
class pcps_acquisition_sc;
|
||||
|
||||
typedef boost::shared_ptr<pcps_acquisition_sc> pcps_acquisition_sc_sptr;
|
||||
|
||||
pcps_acquisition_sc_sptr
|
||||
pcps_make_acquisition_sc(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, bool use_CFAR_algorithm_flag,
|
||||
bool dump, bool blocking,
|
||||
std::string dump_filename);
|
||||
|
||||
/*!
|
||||
* \brief This class implements a Parallel Code Phase Search Acquisition.
|
||||
*
|
||||
* Check \ref Navitec2012 "An Open Source Galileo E1 Software Receiver",
|
||||
* Algorithm 1, for a pseudocode description of this implementation.
|
||||
*/
|
||||
class pcps_acquisition_sc: public gr::block
|
||||
{
|
||||
private:
|
||||
friend pcps_acquisition_sc_sptr
|
||||
pcps_make_acquisition_sc(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, bool use_CFAR_algorithm_flag,
|
||||
bool dump, bool blocking,
|
||||
std::string dump_filename);
|
||||
|
||||
pcps_acquisition_sc(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, bool use_CFAR_algorithm_flag,
|
||||
bool dump, bool blocking,
|
||||
std::string dump_filename);
|
||||
|
||||
void update_local_carrier(gr_complex* carrier_vector, int correlator_length_samples, float freq);
|
||||
|
||||
void acquisition_core( unsigned long int samp_count );
|
||||
|
||||
void update_grid_doppler_wipeoffs();
|
||||
bool is_fdma();
|
||||
|
||||
void send_negative_acquisition();
|
||||
void send_positive_acquisition();
|
||||
|
||||
bool d_bit_transition_flag;
|
||||
bool d_use_CFAR_algorithm_flag;
|
||||
bool d_active;
|
||||
bool d_dump;
|
||||
bool d_worker_active;
|
||||
bool d_blocking;
|
||||
float d_threshold;
|
||||
float d_mag;
|
||||
float d_input_power;
|
||||
float d_test_statistics;
|
||||
float* d_magnitude;
|
||||
long d_fs_in;
|
||||
long d_freq;
|
||||
long d_old_freq;
|
||||
int d_samples_per_ms;
|
||||
int d_samples_per_code;
|
||||
int d_state;
|
||||
unsigned int d_channel;
|
||||
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 int d_num_doppler_bins;
|
||||
unsigned int d_code_phase;
|
||||
unsigned long int d_sample_counter;
|
||||
lv_16sc_t* d_data_buffer;
|
||||
gr_complex** d_grid_doppler_wipeoffs;
|
||||
gr_complex* d_fft_codes;
|
||||
gr_complex* d_in_32fc;
|
||||
gr::fft::fft_complex* d_fft_if;
|
||||
gr::fft::fft_complex* d_ifft;
|
||||
Gnss_Synchro* d_gnss_synchro;
|
||||
std::string d_dump_filename;
|
||||
arma::fmat grid_;
|
||||
|
||||
public:
|
||||
/*!
|
||||
* \brief Default destructor.
|
||||
*/
|
||||
~pcps_acquisition_sc();
|
||||
|
||||
/*!
|
||||
* \brief Set acquisition/tracking common Gnss_Synchro object pointer
|
||||
* to exchange synchronization data between acquisition and tracking blocks.
|
||||
* \param p_gnss_synchro Satellite information shared by the processing blocks.
|
||||
*/
|
||||
inline void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
|
||||
{
|
||||
gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler
|
||||
d_gnss_synchro = p_gnss_synchro;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Returns the maximum peak of grid search.
|
||||
*/
|
||||
inline unsigned int mag() const
|
||||
{
|
||||
return d_mag;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Initializes acquisition algorithm.
|
||||
*/
|
||||
void init();
|
||||
|
||||
/*!
|
||||
* \brief Sets local code for PCPS acquisition algorithm.
|
||||
* \param code - Pointer to the PRN code.
|
||||
*/
|
||||
void set_local_code(std::complex<float> * code);
|
||||
|
||||
/*!
|
||||
* \brief Starts acquisition algorithm, turning from standby mode to
|
||||
* active mode
|
||||
* \param active - bool that activates/deactivates the block.
|
||||
*/
|
||||
inline void set_active(bool active)
|
||||
{
|
||||
gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler
|
||||
d_active = active;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief If set to 1, ensures that acquisition starts at the
|
||||
* first available sample.
|
||||
* \param state - int=1 forces start of acquisition
|
||||
*/
|
||||
void set_state(int state);
|
||||
|
||||
/*!
|
||||
* \brief Set acquisition channel unique ID
|
||||
* \param channel - receiver channel.
|
||||
*/
|
||||
inline void set_channel(unsigned int channel)
|
||||
{
|
||||
gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler
|
||||
d_channel = channel;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Set statistics threshold of PCPS algorithm.
|
||||
* \param threshold - Threshold for signal detection (check \ref Navitec2012,
|
||||
* Algorithm 1, for a definition of this threshold).
|
||||
*/
|
||||
inline void set_threshold(float threshold)
|
||||
{
|
||||
gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler
|
||||
d_threshold = threshold;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Set maximum Doppler grid search
|
||||
* \param doppler_max - Maximum Doppler shift considered in the grid search [Hz].
|
||||
*/
|
||||
inline void set_doppler_max(unsigned int doppler_max)
|
||||
{
|
||||
gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler
|
||||
d_doppler_max = doppler_max;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Set Doppler steps for the grid search
|
||||
* \param doppler_step - Frequency bin of the search grid [Hz].
|
||||
*/
|
||||
inline void set_doppler_step(unsigned int doppler_step)
|
||||
{
|
||||
gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler
|
||||
d_doppler_step = doppler_step;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Parallel Code Phase Search Acquisition signal processing.
|
||||
*/
|
||||
int general_work(int noutput_items, gr_vector_int &ninput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
|
||||
};
|
||||
|
||||
#endif /* GNSS_SDR_PCPS_ACQUISITION_SC_H_*/
|
Loading…
Reference in New Issue
Block a user