1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-12 19:20:32 +00:00

Added GPS L2M Tracking and its unit test. Still experimental!

This commit is contained in:
Javier 2015-04-30 17:48:21 +02:00
parent 6618c220d0
commit 60b7fe8e08
10 changed files with 160 additions and 65 deletions

View File

@ -74,7 +74,7 @@ DataTypeAdapter0.item_type=gr_complex
InputFilter0.implementation=Freq_Xlating_Fir_Filter
;#dump: Dump the filtered data to a file.
InputFilter0.dump=true
InputFilter0.dump=false
;#dump_filename: Log path and filename.
InputFilter0.dump_filename=../data/input_filter_ch0.dat
@ -168,7 +168,7 @@ DataTypeAdapter1.item_type=gr_complex
InputFilter1.implementation=Freq_Xlating_Fir_Filter
;#dump: Dump the filtered data to a file.
InputFilter1.dump=true
InputFilter1.dump=false
;#dump_filename: Log path and filename.
InputFilter1.dump_filename=../data/input_filter_ch1.dat
@ -308,23 +308,21 @@ Acquisition_GPS0.item_type=gr_complex
;#if: Signal intermediate frequency in [Hz]
Acquisition_GPS0.if=0
;#sampled_ms: Signal block duration for the acquisition signal detection [ms]
Acquisition_GPS0.coherent_integration_time_ms=1
;#implementation: Acquisition algorithm selection for this channel:
Acquisition_GPS0.implementation=GPS_L1_CA_PCPS_Acquisition
;#threshold: Acquisition threshold. It will be ignored if pfa is defined.
Acquisition_GPS0.threshold=0.005
;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
Acquisition_GPS0.sampled_ms=1
;#implementation: Acquisition algorithm selection for this channel: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
Acquisition_GPS0.implementation=GPS_L1_CA_PCPS_Acquisition_Fine_Doppler
;#threshold: Acquisition threshold
Acquisition_GPS0.threshold=0.015
;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
;Acquisition_GPS0.pfa=0.0001
;#doppler_max: Maximum expected Doppler shift [Hz]
Acquisition_GPS0.doppler_max=5000
;#doppler_max: Doppler step in the grid search [Hz]
;#doppler_max: Maximum expected Doppler shift [Hz]
Acquisition_GPS0.doppler_min=-5000
;#doppler_step Doppler step in the grid search [Hz]
Acquisition_GPS0.doppler_step=250
;#bit_transition_flag: Enable or disable a strategy to deal with bit transitions in GPS signals: process two dwells and take
;#maximum test statistics. Only use with implementation: [GPS_L1_CA_PCPS_Acquisition]
;#(should not be used for Galileo_E1_PCPS_Ambiguous_Acquisition])
Acquisition_GPS0.bit_transition_flag=false
;#max_dwells: Maximum number of consecutive dwells to be processed. It will be ignored if bit_transition_flag=true
Acquisition_GPS0.max_dwells=1
;#maximum dwells
Acquisition_GPS0.max_dwells=2
;#dump: Enable or disable the acquisition internal data file logging [true] or [false]
Acquisition_GPS1.dump=false
@ -335,23 +333,21 @@ Acquisition_GPS1.item_type=gr_complex
;#if: Signal intermediate frequency in [Hz]
Acquisition_GPS1.if=0
;#sampled_ms: Signal block duration for the acquisition signal detection [ms]
Acquisition_GPS1.coherent_integration_time_ms=1
;#implementation: Acquisition algorithm selection for this channel:
Acquisition_GPS1.implementation=GPS_L2_M_PCPS_Acquisition
;#threshold: Acquisition threshold. It will be ignored if pfa is defined.
Acquisition_GPS1.threshold=0.001
;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
Acquisition_GPS1.sampled_ms=1
;#implementation: Acquisition algorithm selection for this channel: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
Acquisition_GPS1.implementation=GPS_L1_CA_PCPS_Acquisition_Fine_Doppler
;#threshold: Acquisition threshold
Acquisition_GPS1.threshold=0.015
;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
;Acquisition_GPS1.pfa=0.0001
;#doppler_max: Maximum expected Doppler shift [Hz]
Acquisition_GPS1.doppler_max=5000
;#doppler_max: Doppler step in the grid search [Hz]
;#doppler_max: Maximum expected Doppler shift [Hz]
Acquisition_GPS1.doppler_min=-5000
;#doppler_step Doppler step in the grid search [Hz]
Acquisition_GPS1.doppler_step=100
;#bit_transition_flag: Enable or disable a strategy to deal with bit transitions in GPS signals: process two dwells and take
;#maximum test statistics. Only use with implementation: [GPS_L1_CA_PCPS_Acquisition]
;#(should not be used for Galileo_E1_PCPS_Ambiguous_Acquisition])
Acquisition_GPS1.bit_transition_flag=false
;#max_dwells: Maximum number of consecutive dwells to be processed. It will be ignored if bit_transition_flag=true
Acquisition_GPS1.max_dwells=1
;#maximum dwells
Acquisition_GPS1.max_dwells=2
;######### ACQUISITION GLOBAL CONFIG ############
@ -369,7 +365,7 @@ Acquisition_GPS.coherent_integration_time_ms=1
;#implementation: Acquisition algorithm selection for this channel:
Acquisition_GPS.implementation=GPS_L2_M_PCPS_Acquisition
;#threshold: Acquisition threshold. It will be ignored if pfa is defined.
Acquisition_GPS.threshold=0.001
Acquisition_GPS.threshold=0.003
;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
;Acquisition_GPS.pfa=0.0001
;#doppler_max: Maximum expected Doppler shift [Hz]
@ -388,34 +384,72 @@ Acquisition_GPS.max_dwells=1
;#The following options are specific to each channel and overwrite the generic options
;######### TRACKING CHANNEL 0 CONFIG ############
;#implementation: Selected tracking algorithm: [GPS_L1_CA_DLL_PLL_Tracking] or [GPS_L1_CA_DLL_FLL_PLL_Tracking]
Tracking_GPS0.implementation=GPS_L1_CA_DLL_PLL_Tracking
;#item_type: Type and resolution for each of the signal samples. Use only [gr_complex] in this version.
Tracking_GPS0.item_type=gr_complex
;#sampling_frequency: Signal Intermediate Frequency in [Hz]
Tracking_GPS0.if=0
;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false]
Tracking_GPS0.dump=false
;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number.
Tracking_GPS0.dump_filename=./tracking_ch_
;#pll_bw_hz: PLL loop filter bandwidth [Hz]
Tracking_GPS0.pll_bw_hz=40.0;
;#dll_bw_hz: DLL loop filter bandwidth [Hz]
Tracking_GPS0.dll_bw_hz=3.0;
;#fll_bw_hz: FLL loop filter bandwidth [Hz]
Tracking_GPS0.fll_bw_hz=10.0;
;#order: PLL/DLL loop filter order [2] or [3]
Tracking_GPS0.order=3;
;#early_late_space_chips: correlator early-late space [chips]. Use [0.5]
Tracking_GPS0.early_late_space_chips=0.5;
;######### TRACKING CHANNEL 1 CONFIG ############
;#implementation: Selected tracking algorithm:
Tracking_GPS1.implementation=GPS_L2_M_DLL_PLL_Tracking
;#item_type: Type and resolution for each of the signal samples. Use only [gr_complex] in this version.
Tracking_GPS1.item_type=gr_complex
;#sampling_frequency: Signal Intermediate Frequency in [Hz]
Tracking_GPS1.if=0
;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false]
Tracking_GPS1.dump=false
;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number.
Tracking_GPS1.dump_filename=./tracking_ch_
;#pll_bw_hz: PLL loop filter bandwidth [Hz]
Tracking_GPS1.pll_bw_hz=40.0;
;#dll_bw_hz: DLL loop filter bandwidth [Hz]
Tracking_GPS1.dll_bw_hz=3.0;
;#fll_bw_hz: FLL loop filter bandwidth [Hz]
Tracking_GPS1.fll_bw_hz=10.0;
;#order: PLL/DLL loop filter order [2] or [3]
Tracking_GPS1.order=3;
;#early_late_space_chips: correlator early-late space [chips]. Use [0.5]
Tracking_GPS1.early_late_space_chips=0.5;
;######### TRACKING GLOBAL CONFIG ############
;#implementation: Selected tracking algorithm: [GPS_L1_CA_DLL_PLL_Tracking] or [GPS_L1_CA_DLL_FLL_PLL_Tracking]
Tracking_GPS.implementation=GPS_L1_CA_DLL_PLL_Tracking
;#item_type: Type and resolution for each of the signal samples. Use only [gr_complex] in this version.
Tracking_GPS.item_type=gr_complex
;#sampling_frequency: Signal Intermediate Frequency in [Hz]
Tracking_GPS.if=0
;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false]
Tracking_GPS.dump=false
;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number.
Tracking_GPS.dump_filename=./tracking_ch_
;#pll_bw_hz: PLL loop filter bandwidth [Hz]
Tracking_GPS.pll_bw_hz=40.0;
;#dll_bw_hz: DLL loop filter bandwidth [Hz]
Tracking_GPS.dll_bw_hz=3.0;
;#fll_bw_hz: FLL loop filter bandwidth [Hz]
Tracking_GPS.fll_bw_hz=10.0;
;#order: PLL/DLL loop filter order [2] or [3]
Tracking_GPS.order=3;
;#early_late_space_chips: correlator early-late space [chips]. Use [0.5]
Tracking_GPS.early_late_space_chips=0.5;

View File

@ -55,7 +55,7 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition(
std::string default_item_type = "gr_complex";
std::string default_dump_filename = "./data/acquisition.dat";
DLOG(INFO) << "role " << role;
LOG(INFO) << "role " << role;
item_type_ = configuration_->property(role + ".item_type",
default_item_type);

View File

@ -52,6 +52,24 @@ void gps_l2c_m_code(int32_t * _dest, unsigned int _prn)
}
}
void gps_l2c_m_code_gen_complex(std::complex<float>* _dest, unsigned int _prn)
{
int32_t _code[GPS_L2_M_CODE_LENGTH_CHIPS];
if (_prn>0 and _prn<51)
{
gps_l2c_m_code(_code, _prn);
}
for (signed int i=0; i<GPS_L2_M_CODE_LENGTH_CHIPS; i++)
{
_dest[i] = std::complex<float>(1.0-2.0*_code[i],0);
}
}
/*
* Generates complex GPS L2C M code for the desired SV ID and sampled to specific sampling frequency
*/
@ -76,7 +94,6 @@ void gps_l2c_m_code_gen_complex_sampled(std::complex<float>* _dest, unsigned int
//--- Find time constants --------------------------------------------------
_ts = 1/(float)_fs; // Sampling period in sec
_tc = 1/(float)_codeFreqBasis; // C/A chip period in sec
//gps_l1_ca_code_gen_complex(_code,_prn); //generate C/A code 1 sample per chip
for (signed int i=0; i<_samplesPerCode; i++)
{

View File

@ -37,7 +37,12 @@
#include <iostream>
#include "GPS_L2C.h"
//! Generates complex GPS L2C M code for the desired SV ID and code shift
//!Generates complex GPS L2C M code for the desired SV ID
void gps_l2c_m_code_gen_complex(std::complex<float>* _dest, unsigned int _prn);
//! Generates complex GPS L2C M code for the desired SV ID, and sampled to specific sampling frequency
void gps_l2c_m_code_gen_complex_sampled(std::complex<float>* _dest, unsigned int _prn, signed int _fs);
#endif /* GNSS_GPS_L2C_SIGNAL_H_ */

View File

@ -26,6 +26,7 @@ set(TRACKING_ADAPTER_SOURCES
gps_l1_ca_dll_pll_tracking.cc
gps_l1_ca_tcp_connector_tracking.cc
galileo_e5a_dll_pll_tracking.cc
gps_l2_m_dll_pll_tracking.cc
)
include_directories(

View File

@ -25,6 +25,7 @@ set(TRACKING_GR_BLOCKS_SOURCES
gps_l1_ca_dll_pll_tracking_cc.cc
gps_l1_ca_tcp_connector_tracking_cc.cc
galileo_e5a_dll_pll_tracking_cc.cc
gps_l2_m_dll_pll_tracking_cc.cc
)
include_directories(

View File

@ -162,6 +162,11 @@ Gps_L1_Ca_Dll_Pll_Tracking_cc::Gps_L1_Ca_Dll_Pll_Tracking_cc(
systemName["G"] = std::string("GPS");
systemName["S"] = std::string("SBAS");
set_relative_rate(1.0/((double)d_vector_length*2));
//set_min_output_buffer((long int)300);
}
@ -324,6 +329,14 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items, gr_vector_in
float code_error_chips;
float code_error_filt_chips;
// Block input data and block output stream pointers
const gr_complex* in = (gr_complex*) input_items[0]; //PRN start block alignment
Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0];
// GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder
Gnss_Synchro current_synchro_data;
if (d_enable_tracking == true)
{
// Receiver signal alignment
@ -340,19 +353,16 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items, gr_vector_in
d_sample_counter = d_sample_counter + samples_offset; //count for the processed samples
d_pull_in = false;
//std::cout<<" samples_offset="<<samples_offset<<"\r\n";
// Fill the acquisition data
current_synchro_data = *d_acquisition_gnss_synchro;
*out[0] = current_synchro_data;
consume_each(samples_offset); //shift input to perform alignment with local replica
return 1;
}
// GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder
Gnss_Synchro current_synchro_data;
// Fill the acquisition data
current_synchro_data = *d_acquisition_gnss_synchro;
// Block input data and block output stream pointers
const gr_complex* in = (gr_complex*) input_items[0]; //PRN start block alignment
Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0];
// Generate local code and carrier replicas (using \hat{f}_d(k-1))
update_local_code();
update_local_carrier();
@ -387,7 +397,6 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items, gr_vector_in
current_synchro_data.Flag_valid_pseudorange = false;
*out[0] = current_synchro_data;
return 1;
}
@ -538,10 +547,9 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items, gr_vector_in
*d_Early = gr_complex(0,0);
*d_Prompt = gr_complex(0,0);
*d_Late = gr_complex(0,0);
Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0]; //block output streams pointer
// GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder
d_acquisition_gnss_synchro->Flag_valid_pseudorange = false;
*out[0] = *d_acquisition_gnss_synchro;
current_synchro_data.Flag_valid_pseudorange = false;
*out[0] = current_synchro_data;
}
if(d_dump)

View File

@ -82,6 +82,7 @@
#include "galileo_volk_e1_dll_pll_veml_tracking.h"
#include "galileo_e1_tcp_connector_tracking.h"
#include "galileo_e5a_dll_pll_tracking.h"
#include "gps_l2_m_dll_pll_tracking.h"
#include "gps_l1_ca_telemetry_decoder.h"
#include "galileo_e1b_telemetry_decoder.h"
#include "galileo_e5a_telemetry_decoder.h"
@ -307,7 +308,7 @@ std::unique_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> GNSSBlockFacto
{
std::string default_implementation = "Pass_Through";
unsigned int channel_count;
std::string tracking;
std::string tracking_implementation;
std::string telemetry_decoder;
std::string acquisition_implementation;
@ -320,12 +321,14 @@ std::unique_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> GNSSBlockFacto
LOG(INFO) << "Getting " << channel_count << " GPS channels";
tracking = configuration->property("Tracking_GPS.implementation", default_implementation);
tracking_implementation = configuration->property("Tracking_GPS.implementation", default_implementation);
telemetry_decoder = configuration->property("TelemetryDecoder_GPS.implementation", default_implementation);
acquisition_implementation = configuration->property("Acquisition_GPS.implementation", default_implementation);
for (unsigned int i = 0; i < channel_count; i++)
{
// Search for specific implementation of that particular channel in config file
//(i.e. Acquisition_GPS0.implementation=xxxx)
std::string acquisition_implementation_specific = configuration->property(
"Acquisition_GPS" + boost::lexical_cast<std::string>(i) + ".implementation",
default_implementation);
@ -334,8 +337,16 @@ std::unique_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> GNSSBlockFacto
acquisition_implementation = acquisition_implementation_specific;
}
std::string tracking_implementation_specific = configuration->property(
"Tracking_GPS" + boost::lexical_cast<std::string>(i) + ".implementation",
default_implementation);
if(tracking_implementation_specific.compare(default_implementation) != 0)
{
tracking_implementation = tracking_implementation_specific;
}
channels->push_back(std::move(GetChannel_GPS(configuration,
acquisition_implementation, tracking, telemetry_decoder, channel_absolute_id, queue)));
acquisition_implementation, tracking_implementation, telemetry_decoder, channel_absolute_id, queue)));
channel_absolute_id++;
}
@ -344,12 +355,14 @@ std::unique_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> GNSSBlockFacto
LOG(INFO) << "Getting " << channel_count << " Galileo channels";
tracking = configuration->property("Tracking_Galileo.implementation", default_implementation);
tracking_implementation = configuration->property("Tracking_Galileo.implementation", default_implementation);
telemetry_decoder = configuration->property("TelemetryDecoder_Galileo.implementation", default_implementation);
acquisition_implementation = configuration->property("Acquisition_Galileo.implementation", default_implementation);
for (unsigned int i = 0; i < channel_count; i++)
{
// Search for specific implementation of that particular channel in config file
//(i.e. Acquisition_Galileo0.implementation=xxxx)
std::string acquisition_implementation_specific = configuration->property(
"Acquisition_Galileo" + boost::lexical_cast<std::string>(i) + ".implementation",
default_implementation);
@ -357,8 +370,18 @@ std::unique_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> GNSSBlockFacto
{
acquisition_implementation = acquisition_implementation_specific;
}
std::string tracking_implementation_specific = configuration->property(
"Tracking_Galileo" + boost::lexical_cast<std::string>(i) + ".implementation",
default_implementation);
if(tracking_implementation_specific.compare(default_implementation) != 0)
{
tracking_implementation = tracking_implementation_specific;
}
channels->push_back(std::move(GetChannel_Galileo(configuration,
acquisition_implementation, tracking, telemetry_decoder, channel_absolute_id, queue)));
acquisition_implementation, tracking_implementation, telemetry_decoder, channel_absolute_id, queue)));
channel_absolute_id++;
}
return channels;
@ -942,7 +965,12 @@ std::unique_ptr<TrackingInterface> GNSSBlockFactory::GetTrkBlock(
out_streams, queue));
block = std::move(block_);
}
else if (implementation.compare("GPS_L2_M_DLL_PLL_Tracking") == 0)
{
std::unique_ptr<TrackingInterface> block_(new GpsL2MDllPllTracking(configuration.get(), role, in_streams,
out_streams, queue));
block = std::move(block_);
}
else
{
// Log fatal. This causes execution to stop.

View File

@ -700,14 +700,14 @@ void GNSSFlowgraph::set_signals_list()
// **** FOR DEBUGGING THE LIST OF GNSS SIGNALS ****
std::cout<<"default_system="<<default_system<<std::endl;
std::cout<<"default_signal="<<default_signal<<std::endl;
std::list<Gnss_Signal>::iterator available_gnss_list_iter;
for (available_gnss_list_iter = available_GNSS_signals_.begin(); available_gnss_list_iter
!= available_GNSS_signals_.end(); available_gnss_list_iter++)
{
std::cout << *available_gnss_list_iter << std::endl;
}
// std::cout<<"default_system="<<default_system<<std::endl;
// std::cout<<"default_signal="<<default_signal<<std::endl;
// std::list<Gnss_Signal>::iterator available_gnss_list_iter;
// for (available_gnss_list_iter = available_GNSS_signals_.begin(); available_gnss_list_iter
// != available_GNSS_signals_.end(); available_gnss_list_iter++)
// {
// std::cout << *available_gnss_list_iter << std::endl;
// }
}

View File

@ -108,6 +108,7 @@ DECLARE_string(log_dir);
//#include "gnss_block/galileo_e5a_pcps_acquisition_test_2.cc"
#include "gnss_block/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc"
#include "gnss_block/galileo_e5a_tracking_test.cc"
#include "gnss_block/gps_l2_m_dll_pll_tracking_test.cc"