mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-11 18:00:34 +00:00
Adding Labsat v2 and v3 single channel signal recorder file source
This commit is contained in:
parent
08abbc6752
commit
84fe651f0d
333
conf/gnss-sdr_galileo_E1_extended_correlator_labsat.conf
Normal file
333
conf/gnss-sdr_galileo_E1_extended_correlator_labsat.conf
Normal file
@ -0,0 +1,333 @@
|
||||
; Default configuration file
|
||||
; You can define your own receiver and invoke it by doing
|
||||
; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf
|
||||
;
|
||||
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=5456000
|
||||
|
||||
;######### SIGNAL_SOURCE CONFIG ############
|
||||
;#implementation: Use [File_Signal_Source] [Nsr_File_Signal_Source] or [UHD_Signal_Source] or [GN3S_Signal_Source] (experimental)
|
||||
SignalSource.implementation=Labsat_Signal_Source
|
||||
|
||||
SignalSource.selected_channel=1
|
||||
|
||||
;#filename: path to file with the captured GNSS signal samples to be processed
|
||||
;# Labsat sile source automatically increments the file name when the signal is splitted in several files
|
||||
;# the adapter adds "_0000.LS3" to this base path and filename. Next file will be "_0001.LS3" and so on
|
||||
;# in this example, the first file complete path will be ../signals/GPS_025_0000.LS3
|
||||
|
||||
SignalSource.filename=../signals/GPS_025 ; <- PUT YOUR FILE HERE
|
||||
|
||||
;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version.
|
||||
SignalSource.item_type=gr_complex
|
||||
|
||||
;#sampling_frequency: Original Signal sampling frequency in [Hz]
|
||||
SignalSource.sampling_frequency=16368000
|
||||
|
||||
;#freq: RF front-end center frequency in [Hz]
|
||||
SignalSource.freq=1575420000
|
||||
|
||||
;#samples: Number of samples to be processed. Notice that 0 indicates the entire file.
|
||||
SignalSource.samples=0
|
||||
|
||||
;#repeat: Repeat the processing file. Disable this option in this version
|
||||
SignalSource.repeat=false
|
||||
|
||||
;#dump: Dump the Signal source data to a file. Disable this option in this version
|
||||
SignalSource.dump=false
|
||||
|
||||
SignalSource.dump_filename=../data/signal_source.dat
|
||||
|
||||
|
||||
;#enable_throttle_control: Enabling this option tells the signal source to keep the delay between samples in post processing.
|
||||
; it helps to not overload the CPU, but the processing time will be longer.
|
||||
SignalSource.enable_throttle_control=false
|
||||
|
||||
;######### SIGNAL_CONDITIONER CONFIG ############
|
||||
;## It holds blocks to change data type, filter and resample input data.
|
||||
|
||||
;#implementation: Use [Pass_Through] or [Signal_Conditioner]
|
||||
;#[Pass_Through] disables this block and the [DataTypeAdapter], [InputFilter] and [Resampler] blocks
|
||||
;#[Signal_Conditioner] enables this block. Then you have to configure [DataTypeAdapter], [InputFilter] and [Resampler] blocks
|
||||
SignalConditioner.implementation=Signal_Conditioner
|
||||
|
||||
;######### DATA_TYPE_ADAPTER CONFIG ############
|
||||
;## Changes the type of input data.
|
||||
;#implementation: [Pass_Through] disables this block
|
||||
DataTypeAdapter.implementation=Pass_Through
|
||||
DataTypeAdapter.item_type=gr_complex
|
||||
|
||||
;######### INPUT_FILTER CONFIG ############
|
||||
;## Filter the input data. Can be combined with frequency translation for IF signals
|
||||
|
||||
;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter]
|
||||
;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation
|
||||
;# that shifts IF down to zero Hz.
|
||||
|
||||
InputFilter.implementation=Freq_Xlating_Fir_Filter
|
||||
|
||||
;#dump: Dump the filtered data to a file.
|
||||
InputFilter.dump=false
|
||||
|
||||
;#dump_filename: Log path and filename.
|
||||
InputFilter.dump_filename=../data/input_filter.dat
|
||||
|
||||
;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation.
|
||||
;#These options are based on parameters of gnuradio's function: gr_remez.
|
||||
;#These function calculates the optimal (in the Chebyshev/minimax sense) FIR filter inpulse
|
||||
;#reponse given a set of band edges, the desired reponse on those bands,
|
||||
;#and the weight given to the error in those bands.
|
||||
|
||||
;#input_item_type: Type and resolution for input signal samples. Use only gr_complex in this version.
|
||||
InputFilter.input_item_type=gr_complex
|
||||
|
||||
;#outut_item_type: Type and resolution for output filtered signal samples. Use only gr_complex in this version.
|
||||
InputFilter.output_item_type=gr_complex
|
||||
|
||||
;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version.
|
||||
InputFilter.taps_item_type=float
|
||||
|
||||
;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time
|
||||
InputFilter.number_of_taps=5
|
||||
|
||||
;#number_of _bands: Number of frequency bands in the filter.
|
||||
InputFilter.number_of_bands=2
|
||||
|
||||
;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...].
|
||||
;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2)
|
||||
;#The number of band_begin and band_end elements must match the number of bands
|
||||
|
||||
InputFilter.band1_begin=0.0
|
||||
InputFilter.band1_end=0.45
|
||||
InputFilter.band2_begin=0.55
|
||||
InputFilter.band2_end=1.0
|
||||
|
||||
;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...].
|
||||
;#The number of ampl_begin and ampl_end elements must match the number of bands
|
||||
|
||||
InputFilter.ampl1_begin=1.0
|
||||
InputFilter.ampl1_end=1.0
|
||||
InputFilter.ampl2_begin=0.0
|
||||
InputFilter.ampl2_end=0.0
|
||||
|
||||
;#band_error: weighting applied to each band (usually 1).
|
||||
;#The number of band_error elements must match the number of bands
|
||||
InputFilter.band1_error=1.0
|
||||
InputFilter.band2_error=1.0
|
||||
|
||||
;#filter_type: one of "bandpass", "hilbert" or "differentiator"
|
||||
InputFilter.filter_type=bandpass
|
||||
|
||||
;#grid_density: determines how accurately the filter will be constructed.
|
||||
;The minimum value is 16; higher values are slower to compute the filter.
|
||||
InputFilter.grid_density=16
|
||||
|
||||
;# Original sampling frequency stored in the signal file
|
||||
InputFilter.sampling_frequency=16368000
|
||||
|
||||
;#The following options are used only in Freq_Xlating_Fir_Filter implementation.
|
||||
;#InputFilter.IF is the intermediate frequency (in Hz) shifted down to zero Hz
|
||||
|
||||
InputFilter.IF=0
|
||||
|
||||
;# Decimation factor after the frequency tranaslating block
|
||||
InputFilter.decimation_factor=3
|
||||
|
||||
|
||||
;######### CHANNELS GLOBAL CONFIG ############
|
||||
;#count: Number of available GPS satellite channels.
|
||||
Channels_1C.count=0
|
||||
;#count: Number of available Galileo satellite channels.
|
||||
Channels_1B.count=6
|
||||
;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver
|
||||
Channels.in_acquisition=1
|
||||
|
||||
;#signal:
|
||||
;#if the option is disabled by default is assigned "1C" GPS L1 C/A
|
||||
Channel0.signal=1B
|
||||
Channel1.signal=1B
|
||||
Channel2.signal=1B
|
||||
Channel3.signal=1B
|
||||
Channel4.signal=1B
|
||||
Channel5.signal=1B
|
||||
Channel6.signal=1B
|
||||
Channel7.signal=1B
|
||||
Channel8.signal=1B
|
||||
Channel9.signal=1B
|
||||
Channel10.signal=1B
|
||||
Channel11.signal=1B
|
||||
Channel12.signal=1B
|
||||
Channel13.signal=1B
|
||||
Channel14.signal=1B
|
||||
Channel15.signal=1B
|
||||
|
||||
|
||||
;######### GPS ACQUISITION CONFIG ############
|
||||
|
||||
;#dump: Enable or disable the acquisition internal data file logging [true] or [false]
|
||||
Acquisition_1C.dump=false
|
||||
;#filename: Log path and filename
|
||||
Acquisition_1C.dump_filename=./acq_dump.dat
|
||||
;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version.
|
||||
Acquisition_1C.item_type=gr_complex
|
||||
;#if: Signal intermediate frequency in [Hz]
|
||||
Acquisition_1C.if=0
|
||||
;#sampled_ms: Signal block duration for the acquisition signal detection [ms]
|
||||
Acquisition_1C.sampled_ms=1
|
||||
;#implementation: Acquisition algorithm selection for this channel: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
|
||||
Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition
|
||||
Acquisition_1C.use_CFAR_algorithm=false;
|
||||
;#threshold: Acquisition threshold
|
||||
Acquisition_1C.threshold=22
|
||||
;#doppler_max: Maximum expected Doppler shift [Hz]
|
||||
Acquisition_1C.doppler_max=5000
|
||||
;#doppler_max: Doppler step in the grid search [Hz]
|
||||
Acquisition_1C.doppler_step=250
|
||||
|
||||
|
||||
;######### GALILEO ACQUISITION CONFIG ############
|
||||
|
||||
;#dump: Enable or disable the acquisition internal data file logging [true] or [false]
|
||||
Acquisition_1B.dump=false
|
||||
;#filename: Log path and filename
|
||||
Acquisition_1B.dump_filename=../data/acq_dump.dat
|
||||
;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version.
|
||||
Acquisition_1B.item_type=gr_complex
|
||||
;#if: Signal intermediate frequency in [Hz]
|
||||
Acquisition_1B.if=0
|
||||
;#sampled_ms: Signal block duration for the acquisition signal detection [ms]
|
||||
Acquisition_1B.sampled_ms=4
|
||||
;#implementation: Acquisition algorithm selection for this channel: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
|
||||
Acquisition_1B.implementation=Galileo_E1_PCPS_Ambiguous_Acquisition
|
||||
Acquisition_1B.acquire_pilot=true
|
||||
Acquisition_1B.use_CFAR_algorithm=false
|
||||
;#threshold: Acquisition threshold
|
||||
Acquisition_1B.threshold=22
|
||||
;#doppler_max: Maximum expected Doppler shift [Hz]
|
||||
Acquisition_1B.doppler_max=5000
|
||||
;#doppler_max: Doppler step in the grid search [Hz]
|
||||
Acquisition_1B.doppler_step=125
|
||||
Acquisition_1B.bit_transition_flag=true
|
||||
|
||||
;######### TRACKING GPS CONFIG ############
|
||||
|
||||
;#implementation: Selected tracking algorithm: [GPS_L1_CA_DLL_PLL_Tracking] or [GPS_L1_CA_DLL_PLL_C_Aid_Tracking] or [GPS_L1_CA_TCP_CONNECTOR_Tracking] or [Galileo_E1_DLL_PLL_VEML_Tracking]
|
||||
Tracking_1C.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_1C.item_type=gr_complex
|
||||
|
||||
;#sampling_frequency: Signal Intermediate Frequency in [Hz]
|
||||
Tracking_1C.if=0
|
||||
|
||||
;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false]
|
||||
Tracking_1C.dump=true
|
||||
|
||||
;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number.
|
||||
Tracking_1C.dump_filename=../data/epl_tracking_ch_
|
||||
|
||||
;#pll_bw_hz: PLL loop filter bandwidth [Hz]
|
||||
Tracking_1C.pll_bw_hz=40.0;
|
||||
|
||||
;#dll_bw_hz: DLL loop filter bandwidth [Hz]
|
||||
Tracking_1C.dll_bw_hz=2.0;
|
||||
|
||||
;#order: PLL/DLL loop filter order [2] or [3]
|
||||
Tracking_1C.order=3;
|
||||
|
||||
;######### TRACKING GALILEO CONFIG ############
|
||||
|
||||
;#implementation: Selected tracking algorithm: [GPS_L1_CA_DLL_PLL_Tracking] or [GPS_L1_CA_DLL_PLL_C_Aid_Tracking] or [GPS_L1_CA_TCP_CONNECTOR_Tracking] or [Galileo_E1_DLL_PLL_VEML_Tracking]
|
||||
Tracking_1B.implementation=Galileo_E1_DLL_PLL_VEML_Tracking
|
||||
;#item_type: Type and resolution for each of the signal samples.
|
||||
Tracking_1B.item_type=gr_complex
|
||||
|
||||
;#sampling_frequency: Signal Intermediate Frequency in [Hz]
|
||||
Tracking_1B.if=0
|
||||
|
||||
;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false]
|
||||
Tracking_1B.dump=true
|
||||
|
||||
;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number.
|
||||
Tracking_1B.dump_filename=../data/veml_tracking_ch_
|
||||
|
||||
Tracking_1B.track_pilot=true
|
||||
|
||||
;#pll_bw_hz: PLL loop filter bandwidth [Hz]
|
||||
Tracking_1B.pll_bw_hz=7.5;
|
||||
|
||||
;#dll_bw_hz: DLL loop filter bandwidth [Hz]
|
||||
Tracking_1B.dll_bw_hz=0.5;
|
||||
|
||||
;#pll_bw_hz: PLL loop filter bandwidth [Hz]
|
||||
Tracking_1B.pll_bw_narrow_hz=2.5;
|
||||
|
||||
;#dll_bw_hz: DLL loop filter bandwidth [Hz]
|
||||
Tracking_1B.dll_bw_narrow_hz=0.25;
|
||||
|
||||
Tracking_1B.extend_correlation_symbols=4;
|
||||
|
||||
;#order: PLL/DLL loop filter order [2] or [3]
|
||||
Tracking_1B.order=3;
|
||||
|
||||
;#early_late_space_chips: correlator early-late space [chips]. Use [0.5] for GPS and [0.15] for Galileo
|
||||
Tracking_1B.early_late_space_chips=0.15;
|
||||
|
||||
;#very_early_late_space_chips: only for [Galileo_E1_DLL_PLL_VEML_Tracking], correlator very early-late space [chips]. Use [0.6]
|
||||
Tracking_1B.very_early_late_space_chips=0.6;
|
||||
|
||||
;#early_late_space_chips: correlator early-late space [chips]. Use [0.5] for GPS and [0.15] for Galileo
|
||||
Tracking_1B.early_late_space_narrow_chips=0.15;
|
||||
|
||||
;#very_early_late_space_chips: only for [Galileo_E1_DLL_PLL_VEML_Tracking], correlator very early-late space [chips]. Use [0.6]
|
||||
Tracking_1B.very_early_late_space_narrow_chips=0.30;
|
||||
|
||||
|
||||
|
||||
;######### TELEMETRY DECODER GPS CONFIG ############
|
||||
;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L1 C/A
|
||||
TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder
|
||||
TelemetryDecoder_1C.dump=false
|
||||
|
||||
;######### TELEMETRY DECODER GALILEO CONFIG ############
|
||||
;#implementation: Use [Galileo_E1B_Telemetry_Decoder] for Galileo E1B
|
||||
TelemetryDecoder_1B.implementation=Galileo_E1B_Telemetry_Decoder
|
||||
TelemetryDecoder_1B.dump=false
|
||||
|
||||
;######### OBSERVABLES CONFIG ############
|
||||
;#implementation:
|
||||
Observables.implementation=Hybrid_Observables
|
||||
|
||||
;#dump: Enable or disable the Observables internal binary data file logging [true] or [false]
|
||||
Observables.dump=false
|
||||
|
||||
;#dump_filename: Log path and filename.
|
||||
Observables.dump_filename=./observables.dat
|
||||
|
||||
|
||||
;######### PVT CONFIG ############
|
||||
;#implementation: Position Velocity and Time (PVT) implementation:
|
||||
PVT.implementation=RTKLIB_PVT
|
||||
|
||||
PVT.positioning_mode=Single ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic
|
||||
PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX
|
||||
PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad
|
||||
|
||||
;#output_rate_ms: Period between two PVT outputs. Notice that the minimum period is equal to the tracking integration time (for GPS CA L1 is 1ms) [ms]
|
||||
PVT.output_rate_ms=100;
|
||||
|
||||
;#display_rate_ms: Position console print (std::out) interval [ms]. Notice that output_rate_ms<=display_rate_ms.
|
||||
PVT.display_rate_ms=500;
|
||||
|
||||
;#dump: Enable or disable the PVT internal binary data file logging [true] or [false]
|
||||
PVT.dump=false
|
||||
|
||||
PVT.flag_rtcm_server=false
|
||||
PVT.flag_rtcm_tty_port=false
|
||||
PVT.rtcm_dump_devname=/dev/pts/1
|
||||
|
||||
;#dump_filename: Log path and filename without extension. Notice that PVT will add ".dat" to the binary dump and ".kml" to GoogleEarth dump.
|
||||
PVT.dump_filename=./PVT
|
@ -141,6 +141,7 @@ set(SIGNAL_SOURCE_ADAPTER_SOURCES file_signal_source.cc
|
||||
spir_file_signal_source.cc
|
||||
spir_gss6450_file_signal_source.cc
|
||||
rtl_tcp_signal_source.cc
|
||||
labsat_signal_source.cc
|
||||
${OPT_DRIVER_SOURCES}
|
||||
)
|
||||
|
||||
|
122
src/algorithms/signal_source/adapters/labsat_signal_source.cc
Normal file
122
src/algorithms/signal_source/adapters/labsat_signal_source.cc
Normal file
@ -0,0 +1,122 @@
|
||||
/*!
|
||||
* \file labsat_signal_source.cc
|
||||
* \brief Labsat 2 and 3 front-end signal sampler driver
|
||||
* \author Javier Arribas, jarribas(at)cttc.es
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2018 (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 "labsat_signal_source.h"
|
||||
#include <gnuradio/blocks/file_sink.h>
|
||||
#include <gnuradio/msg_queue.h>
|
||||
#include <gflags/gflags.h>
|
||||
#include <glog/logging.h>
|
||||
#include "labsat23_source.h"
|
||||
#include "configuration_interface.h"
|
||||
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
LabsatSignalSource::LabsatSignalSource(ConfigurationInterface* configuration,
|
||||
std::string role, unsigned int in_stream, unsigned int out_stream, gr::msg_queue::sptr queue) :
|
||||
role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue)
|
||||
{
|
||||
std::string default_item_type = "gr_complex";
|
||||
std::string default_dump_file = "./data/source.bin";
|
||||
item_type_ = configuration->property(role + ".item_type", default_item_type);
|
||||
dump_ = configuration->property(role + ".dump", false);
|
||||
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file);
|
||||
|
||||
int channel_selector=configuration->property(role + ".selected_channel", 1);
|
||||
std::string default_filename = "./example_capture.LS3";
|
||||
|
||||
samples_ = configuration->property(role + ".samples", 0);
|
||||
filename_ = configuration->property(role + ".filename", default_filename);
|
||||
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
item_size_ = sizeof(gr_complex);
|
||||
labsat23_source_ = labsat23_make_source(filename_.c_str(),channel_selector);
|
||||
DLOG(INFO) << "Item size " << item_size_;
|
||||
DLOG(INFO) << "labsat23_source_(" << labsat23_source_->unique_id() << ")";
|
||||
}else
|
||||
{
|
||||
LOG(WARNING) << item_type_
|
||||
<< " unrecognized item type for LabSat source";
|
||||
item_size_ = sizeof(short);
|
||||
}
|
||||
if (dump_)
|
||||
{
|
||||
DLOG(INFO) << "Dumping output into file " << dump_filename_;
|
||||
file_sink_ = gr::blocks::file_sink::make(item_size_, dump_filename_.c_str());
|
||||
}
|
||||
if (dump_)
|
||||
{
|
||||
DLOG(INFO) << "file_sink(" << file_sink_->unique_id() << ")";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
LabsatSignalSource::~LabsatSignalSource()
|
||||
{}
|
||||
|
||||
|
||||
|
||||
void LabsatSignalSource::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (dump_)
|
||||
{
|
||||
top_block->connect(labsat23_source_, 0, file_sink_, 0);
|
||||
DLOG(INFO) << "connected labsat23_source_ to file sink";
|
||||
}
|
||||
else
|
||||
{
|
||||
DLOG(INFO) << "nothing to connect internally";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void LabsatSignalSource::disconnect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (dump_)
|
||||
{
|
||||
top_block->disconnect(labsat23_source_, 0, file_sink_, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
gr::basic_block_sptr LabsatSignalSource::get_left_block()
|
||||
{
|
||||
LOG(WARNING) << "Left block of a signal source should not be retrieved";
|
||||
return gr::block_sptr();
|
||||
}
|
||||
|
||||
|
||||
gr::basic_block_sptr LabsatSignalSource::get_right_block()
|
||||
{
|
||||
return labsat23_source_;
|
||||
}
|
94
src/algorithms/signal_source/adapters/labsat_signal_source.h
Normal file
94
src/algorithms/signal_source/adapters/labsat_signal_source.h
Normal file
@ -0,0 +1,94 @@
|
||||
/*!
|
||||
* \file labsat_signal_source.h
|
||||
* \brief Labsat 2 and 3 front-end signal sampler driver
|
||||
* \author Javier Arribas, jarribas(at)cttc.es
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2018 (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 LABSAT_SIGNAL_SOURCE_H_
|
||||
#define LABSAT_SIGNAL_SOURCE_H_
|
||||
|
||||
#include <string>
|
||||
#include <gnuradio/hier_block2.h>
|
||||
#include <gnuradio/msg_queue.h>
|
||||
#include <gnuradio/blocks/file_sink.h>
|
||||
#include "gnss_block_interface.h"
|
||||
|
||||
|
||||
class ConfigurationInterface;
|
||||
|
||||
/*!
|
||||
* \brief This class reads samples from a GN3S USB dongle, a RF front-end signal sampler
|
||||
*/
|
||||
class LabsatSignalSource: public GNSSBlockInterface
|
||||
{
|
||||
public:
|
||||
LabsatSignalSource(ConfigurationInterface* configuration,
|
||||
std::string role, unsigned int in_stream,
|
||||
unsigned int out_stream, gr::msg_queue::sptr queue);
|
||||
|
||||
virtual ~LabsatSignalSource();
|
||||
|
||||
inline std::string role() override
|
||||
{
|
||||
return role_;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Returns "LabsatSignalSource".
|
||||
*/
|
||||
inline std::string implementation() override
|
||||
{
|
||||
return "Labsat_Signal_Source";
|
||||
}
|
||||
|
||||
inline size_t item_size() override
|
||||
{
|
||||
return item_size_;
|
||||
}
|
||||
|
||||
void connect(gr::top_block_sptr top_block) override;
|
||||
void disconnect(gr::top_block_sptr top_block) override;
|
||||
gr::basic_block_sptr get_left_block() override;
|
||||
gr::basic_block_sptr get_right_block() override;
|
||||
|
||||
private:
|
||||
std::string role_;
|
||||
unsigned int in_stream_;
|
||||
unsigned int out_stream_;
|
||||
std::string item_type_;
|
||||
size_t item_size_;
|
||||
long samples_;
|
||||
std::string filename_;
|
||||
bool dump_;
|
||||
std::string dump_filename_;
|
||||
gr::block_sptr labsat23_source_;
|
||||
gr::blocks::file_sink::sptr file_sink_;
|
||||
boost::shared_ptr<gr::msg_queue> queue_;
|
||||
};
|
||||
|
||||
#endif /*LABSAT_SIGNAL_SOURCE_H_*/
|
@ -24,6 +24,7 @@ set(SIGNAL_SOURCE_GR_BLOCKS_SOURCES
|
||||
rtl_tcp_signal_source_c.cc
|
||||
unpack_2bit_samples.cc
|
||||
unpack_spir_gss6450_samples.cc
|
||||
labsat23_source.cc
|
||||
)
|
||||
|
||||
include_directories(
|
||||
|
474
src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc
Normal file
474
src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc
Normal file
@ -0,0 +1,474 @@
|
||||
/*!
|
||||
* \file labsat23_source.cc
|
||||
*
|
||||
* \brief Unpacks the Labsat 2 (ls2) and (ls3) capture files
|
||||
* \author Javier Arribas jarribas (at) cttc.es
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2015 (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 "labsat23_source.h"
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <sstream>
|
||||
|
||||
labsat23_source_sptr labsat23_make_source(const char *signal_file_basename, int channel_selector)
|
||||
{
|
||||
return labsat23_source_sptr(new labsat23_source(signal_file_basename, channel_selector));
|
||||
}
|
||||
|
||||
std::string labsat23_source::generate_filename()
|
||||
{
|
||||
std::ostringstream ss;
|
||||
ss << std::setw(4) << std::setfill('0') << d_current_file_number;
|
||||
return d_signal_file_basename + "_" + ss.str()+".LS3";
|
||||
|
||||
}
|
||||
|
||||
labsat23_source::labsat23_source(const char *signal_file_basename, int channel_selector) : gr::block("labsat23_source",
|
||||
gr::io_signature::make(0, 0, 0),
|
||||
gr::io_signature::make(1, 1, sizeof(gr_complex)))
|
||||
{
|
||||
if (channel_selector<1 or channel_selector>2)
|
||||
{
|
||||
std::cout<<"Labsat source config error: channel selection out of bounds, check gnss-sdr config file"<<std::endl;
|
||||
exit(1);
|
||||
}
|
||||
d_channel_selector_config=channel_selector;
|
||||
d_header_parsed=false;
|
||||
d_bits_per_sample=0;
|
||||
d_current_file_number=0;
|
||||
d_labsat_version=0;
|
||||
d_signal_file_basename=std::string(signal_file_basename);
|
||||
|
||||
std::string signal_file;
|
||||
this->set_output_multiple(8);
|
||||
signal_file=generate_filename();
|
||||
binary_input_file = new std::ifstream (signal_file.c_str(), std::ios::in|std::ios::binary);
|
||||
|
||||
if (binary_input_file->is_open())
|
||||
{
|
||||
std::cout<<"Labsat file source is reading samples from "<<signal_file<<std::endl;
|
||||
}else{
|
||||
std::cout<<"Labsat file "<<signal_file<<" could not be opened!"<<std::endl;
|
||||
delete binary_input_file;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
labsat23_source::~labsat23_source()
|
||||
{
|
||||
if (binary_input_file->is_open())
|
||||
{
|
||||
binary_input_file->close();
|
||||
}
|
||||
delete binary_input_file;
|
||||
}
|
||||
|
||||
int labsat23_source::getBit(uint8_t byte, int position)
|
||||
{
|
||||
return (byte >> position) & 0x01;
|
||||
}
|
||||
|
||||
void labsat23_source::decode_samples_one_channel(int16_t input_short, gr_complex* out, int type)
|
||||
{
|
||||
std::bitset<16> bs(input_short);
|
||||
switch(type)
|
||||
{
|
||||
case 2:
|
||||
//two bits per sample, 8 samples per int16
|
||||
for (int i=0;i<8;i++)
|
||||
{
|
||||
out[i]=gr_complex(static_cast<float>(bs[15-(2*i)]),
|
||||
static_cast<float>(bs[14-(2*i)]));
|
||||
out[i]=out[i]*gr_complex(2,0)-gr_complex(1,1);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
//four bits per sample, 4 samples per int16
|
||||
for (int i=0;i<4;i++)
|
||||
{
|
||||
out[i]=gr_complex(0.0,0.0);
|
||||
//In-Phase
|
||||
if (bs[15-4*i])
|
||||
{
|
||||
if (bs[13-4*i]) //11
|
||||
{
|
||||
out[i]+=gr_complex(-1,0);
|
||||
}
|
||||
else //10
|
||||
{
|
||||
out[i]+=gr_complex(-2,0);
|
||||
}
|
||||
}
|
||||
else{
|
||||
if (bs[13-4*i]) //01
|
||||
{
|
||||
out[i]+=gr_complex(1,0);
|
||||
}
|
||||
}
|
||||
|
||||
//Quadrature
|
||||
if (bs[14-4*i])
|
||||
{
|
||||
if (bs[12-4*i]) //11
|
||||
{
|
||||
out[i]+=gr_complex(0,-1);
|
||||
}
|
||||
else //10
|
||||
{
|
||||
out[i]+=gr_complex(0,-2);
|
||||
}
|
||||
}
|
||||
else{
|
||||
if (bs[12-4*i]) //01
|
||||
{
|
||||
out[i]+=gr_complex(0,1);
|
||||
}
|
||||
}
|
||||
out[i]+=gr_complex(0.5,0.5);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int labsat23_source::general_work(int noutput_items,
|
||||
__attribute__((unused)) gr_vector_int &ninput_items,
|
||||
__attribute__((unused)) gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items)
|
||||
{
|
||||
|
||||
gr_complex *out = reinterpret_cast<gr_complex *>(output_items[0]);
|
||||
|
||||
if (d_header_parsed==false)
|
||||
{
|
||||
|
||||
if (binary_input_file->eof()==false)
|
||||
{
|
||||
char memblock[1024];
|
||||
binary_input_file->read(memblock,1024);
|
||||
//parse Labsat header
|
||||
//check preamble
|
||||
int byte_counter=0;
|
||||
bool preamble_ok=true;
|
||||
for (int i=0;i<8;i++)
|
||||
{
|
||||
if (memblock[byte_counter]!=0x00) preamble_ok=false;
|
||||
//std::cout<<"H["<<i<<"]:"<<(int)memblock[byte_counter]<<std::endl;
|
||||
byte_counter++;
|
||||
}
|
||||
|
||||
if (preamble_ok==false)
|
||||
{
|
||||
std::cout<<"Labsat source do not detect the preamble in the selected file"<<std::endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
// check Labsat version
|
||||
if (memblock[byte_counter]==0x4C and memblock[byte_counter+1]==0x53 and memblock[byte_counter+2]==0x32)
|
||||
{
|
||||
d_labsat_version=2;
|
||||
std::cout<<"Labsat file version 2 detected"<<std::endl;
|
||||
}
|
||||
|
||||
if (memblock[byte_counter]==0x4C and memblock[byte_counter+1]==0x53 and memblock[byte_counter+2]==0x33)
|
||||
{
|
||||
d_labsat_version=3;
|
||||
std::cout<<"Labsat file version 3 detected"<<std::endl;
|
||||
}
|
||||
|
||||
if (d_labsat_version==0)
|
||||
{
|
||||
std::cout<<"Labsat source do not detect the labsat version in file header"<<std::endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
byte_counter+=3;
|
||||
|
||||
int sub_version=(int)memblock[byte_counter];
|
||||
|
||||
std::cout<<"Labsat file sub version "<<sub_version<<std::endl;
|
||||
|
||||
byte_counter++;
|
||||
|
||||
int header_bytes=0;
|
||||
header_bytes += memblock[byte_counter] | (memblock[byte_counter+1]<<8) | (memblock[byte_counter+2]<<16) | (memblock[byte_counter+3]<<24);
|
||||
|
||||
byte_counter+=4;
|
||||
//std::cout<<"header_bytes="<<header_bytes<<std::endl;
|
||||
|
||||
// read first section
|
||||
// section ID (little-endian)
|
||||
uint8_t section_id=(int)memblock[byte_counter]+(int)memblock[byte_counter+1]*256;
|
||||
//std::cout<<"Section ID: "<<(int)section_id<<std::endl;
|
||||
byte_counter+=2;
|
||||
|
||||
uint8_t section_lenght_bytes=0;
|
||||
section_lenght_bytes += memblock[byte_counter] | (memblock[byte_counter+1]<<8) | (memblock[byte_counter+2]<<16) | (memblock[byte_counter+3]<<24);
|
||||
//std::cout<<"section_lenght_bytes="<<(int)section_lenght_bytes<<std::endl;
|
||||
|
||||
byte_counter+=4;
|
||||
if (section_id==2)
|
||||
{
|
||||
d_ref_clock=(uint8_t)memblock[byte_counter];
|
||||
switch(d_ref_clock)
|
||||
{
|
||||
case 0:
|
||||
std::cout<<"Labsat reference clock: internal OXCO"<<std::endl;
|
||||
break;
|
||||
case 1:
|
||||
std::cout<<"Labsat reference clock: internal TXCO"<<std::endl;
|
||||
break;
|
||||
case 2:
|
||||
std::cout<<"Labsat reference clock: external 10 MHz"<<std::endl;
|
||||
break;
|
||||
case 3:
|
||||
std::cout<<"Labsat reference clock: external 16.386 MHz"<<std::endl;
|
||||
break;
|
||||
default:
|
||||
std::cout<<"Labsat Unknown reference clock ID "<<(int)d_ref_clock<<std::endl;
|
||||
}
|
||||
byte_counter++;
|
||||
d_bits_per_sample=(uint8_t)memblock[byte_counter];
|
||||
switch(d_bits_per_sample)
|
||||
{
|
||||
case 2:
|
||||
std::cout<<"Labsat is using 2 bits per sample"<<std::endl;
|
||||
break;
|
||||
case 4:
|
||||
std::cout<<"Labsat is using 4 bits per sample"<<std::endl;
|
||||
break;
|
||||
default:
|
||||
std::cout<<"Labsat Unknown bits per sample ID "<<(int)d_bits_per_sample<<std::endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
byte_counter++;
|
||||
d_channel_selector=(uint8_t)memblock[byte_counter];
|
||||
switch(d_channel_selector)
|
||||
{
|
||||
case 0:
|
||||
std::cout<<"Available channels: Channel A + B, 1 bit quantisation"<<std::endl;
|
||||
break;
|
||||
case 1:
|
||||
std::cout<<"Available channels: Channel A, 1 bit quantisation"<<std::endl;
|
||||
break;
|
||||
case 2:
|
||||
std::cout<<"Available channels: Channel B, 1 bit quantisation"<<std::endl;
|
||||
break;
|
||||
case 3:
|
||||
std::cout<<"Available channels: Channel A, 2 bit quantisation"<<std::endl;
|
||||
break;
|
||||
case 4:
|
||||
std::cout<<"Available channels: Channel B, 2 bit quantisation"<<std::endl;
|
||||
break;
|
||||
default:
|
||||
std::cout<<"Unknown channel selection ID "<<(int)d_channel_selector<<std::endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
//check if the selected channel in config file match the file encoding
|
||||
if (d_channel_selector_config==2 and d_channel_selector!=0)
|
||||
{
|
||||
std::cout<<"Labsat source channel config inconsistency: channel 2 is selected but the file has only one channel"<<std::endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
//todo: Add support for dual channel files
|
||||
if (d_channel_selector==0)
|
||||
{
|
||||
std::cout<<"ERROR: Labsat file contains more than one channel and it is not currently supported by Labsat signal source."<<std::endl;
|
||||
return -1;
|
||||
}
|
||||
byte_counter++;
|
||||
uint8_t quantization=(uint8_t)memblock[byte_counter];
|
||||
switch(quantization)
|
||||
{
|
||||
case 1:
|
||||
std::cout<<"1 bit per sample"<<std::endl;
|
||||
break;
|
||||
case 2:
|
||||
std::cout<<"2 bit per sample"<<std::endl;
|
||||
break;
|
||||
default:
|
||||
std::cout<<"Unknown quantization ID "<<(int)quantization<<std::endl;
|
||||
}
|
||||
byte_counter++;
|
||||
uint8_t channel_a_constellation=(uint8_t)memblock[byte_counter];
|
||||
switch(channel_a_constellation)
|
||||
{
|
||||
case 0:
|
||||
std::cout<<"Labsat Channel A is GPS"<<std::endl;
|
||||
break;
|
||||
case 1:
|
||||
std::cout<<"Labsat Channel A is GLONASS"<<std::endl;
|
||||
break;
|
||||
case 2:
|
||||
std::cout<<"Labsat Channel A is BDS"<<std::endl;
|
||||
break;
|
||||
default:
|
||||
std::cout<<"Unknown channel A constellation ID "<<(int)channel_a_constellation<<std::endl;
|
||||
}
|
||||
byte_counter++;
|
||||
uint8_t channel_b_constellation=(uint8_t)memblock[byte_counter];
|
||||
switch(channel_b_constellation)
|
||||
{
|
||||
case 0:
|
||||
std::cout<<"Labsat Channel B is GPS"<<std::endl;
|
||||
break;
|
||||
case 1:
|
||||
std::cout<<"Labsat Channel B is GLONASS"<<std::endl;
|
||||
break;
|
||||
case 2:
|
||||
std::cout<<"Labsat Channel B is BDS"<<std::endl;
|
||||
break;
|
||||
default:
|
||||
std::cout<<"Unknown channel B constellation ID "<<(int)channel_b_constellation<<std::endl;
|
||||
}
|
||||
|
||||
//end of header
|
||||
d_header_parsed=true;
|
||||
//seek file to the first signal sample
|
||||
binary_input_file->clear();
|
||||
binary_input_file->seekg(header_bytes, binary_input_file->beg);
|
||||
return 0;
|
||||
}else{
|
||||
std::cout<<"Labsat file header error: section 2 is not available."<<std::endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
}else{
|
||||
std::cout<<"Labsat file read error: file is empty."<<std::endl;
|
||||
return -1;
|
||||
}
|
||||
}else{
|
||||
//ready to start reading samples
|
||||
switch(d_bits_per_sample)
|
||||
{
|
||||
case 2:
|
||||
{
|
||||
switch(d_channel_selector)
|
||||
{
|
||||
case 0:
|
||||
// dual channel 2 bits per complex sample
|
||||
break;
|
||||
default:
|
||||
//single channel 2 bits per complex sample (1 bit I + 1 bit Q, 8 samples per int16)
|
||||
int n_int16_to_read=noutput_items/8;
|
||||
if (n_int16_to_read>0)
|
||||
{
|
||||
int16_t memblock[n_int16_to_read];
|
||||
binary_input_file->read((char*)memblock,n_int16_to_read*2);
|
||||
n_int16_to_read=binary_input_file->gcount()/2; //from bytes to int16
|
||||
if (n_int16_to_read>0)
|
||||
{
|
||||
int output_pointer=0;
|
||||
for (int i=0;i<n_int16_to_read;i++)
|
||||
{
|
||||
decode_samples_one_channel(memblock[i],&out[output_pointer], d_bits_per_sample);
|
||||
output_pointer+=8;
|
||||
}
|
||||
return output_pointer;
|
||||
}else{
|
||||
//trigger the read of the next file in the sequence
|
||||
std::cout<<"End of current file, reading the next Labsat file in sequence: "<<generate_filename()<<std::endl;
|
||||
|
||||
d_current_file_number++;
|
||||
binary_input_file->close();
|
||||
binary_input_file->open(generate_filename().c_str(), std::ios::in|std::ios::binary);
|
||||
if (binary_input_file->is_open())
|
||||
{
|
||||
std::cout<<"Labsat file source is reading samples from "<<generate_filename()<<std::endl;
|
||||
}else{
|
||||
std::cout<<"Last file reached, LabSat source stop"<<std::endl;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
switch(d_channel_selector)
|
||||
{
|
||||
case 0:
|
||||
// dual channel
|
||||
break;
|
||||
default:
|
||||
//single channel 4 bits per complex sample (2 bit I + 2 bit Q, 4 samples per int16)
|
||||
int n_int16_to_read=noutput_items/4;
|
||||
if (n_int16_to_read>0)
|
||||
{
|
||||
int16_t memblock[n_int16_to_read];
|
||||
binary_input_file->read((char*)memblock,n_int16_to_read*2);
|
||||
n_int16_to_read=binary_input_file->gcount()/2; //from bytes to int16
|
||||
if (n_int16_to_read>0)
|
||||
{
|
||||
int output_pointer=0;
|
||||
for (int i=0;i<n_int16_to_read;i++)
|
||||
{
|
||||
decode_samples_one_channel(memblock[i],&out[output_pointer], d_bits_per_sample);
|
||||
output_pointer+=4;
|
||||
}
|
||||
return output_pointer;
|
||||
}else{
|
||||
//trigger the read of the next file in the sequence
|
||||
std::cout<<"End of current file, reading the next Labsat file in sequence: "<<generate_filename()<<std::endl;
|
||||
|
||||
d_current_file_number++;
|
||||
binary_input_file->close();
|
||||
binary_input_file->open(generate_filename().c_str(), std::ios::in|std::ios::binary);
|
||||
if (binary_input_file->is_open())
|
||||
{
|
||||
std::cout<<"Labsat file source is reading samples from "<<generate_filename()<<std::endl;
|
||||
}else{
|
||||
std::cout<<"Last file reached, LabSat source stop"<<std::endl;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
std::cout<<"Warning!!"<<std::endl;
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
/*!
|
||||
* \file labsat23_source.h
|
||||
*
|
||||
* \brief Unpacks the Labsat 2 (ls2) and (ls3) capture files
|
||||
* \author Javier Arribas jarribas (at) cttc.es
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2018 (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 LABSAT23_SOURCE_H
|
||||
#define LABSAT23_SOURCE_H
|
||||
|
||||
#include <gnuradio/block.h>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <stdint.h>
|
||||
|
||||
class labsat23_source;
|
||||
|
||||
typedef boost::shared_ptr<labsat23_source> labsat23_source_sptr;
|
||||
|
||||
labsat23_source_sptr labsat23_make_source(const char *signal_file_basename, int channel_selector);
|
||||
|
||||
/*!
|
||||
* \brief This class implements conversion between Labsat2 and 3 format byte packet samples to gr_complex
|
||||
*/
|
||||
class labsat23_source: public gr::block
|
||||
{
|
||||
private:
|
||||
friend labsat23_source_sptr labsat23_make_source_sptr(const char *signal_file_basename, int channel_selector);
|
||||
std::string generate_filename();
|
||||
void decode_samples_one_channel(int16_t input_short, gr_complex* out, int type);
|
||||
int getBit(uint8_t byte, int position);
|
||||
bool d_header_parsed;
|
||||
uint8_t d_channel_selector;
|
||||
int d_channel_selector_config;
|
||||
int d_current_file_number;
|
||||
uint8_t d_labsat_version;
|
||||
std::string d_signal_file_basename;
|
||||
std::ifstream *binary_input_file;
|
||||
uint8_t d_ref_clock;
|
||||
uint8_t d_bits_per_sample;
|
||||
|
||||
public:
|
||||
labsat23_source(const char *signal_file_basename, int channel_selector);
|
||||
~labsat23_source();
|
||||
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
|
@ -51,6 +51,7 @@
|
||||
#include "spir_gss6450_file_signal_source.h"
|
||||
#include "rtl_tcp_signal_source.h"
|
||||
#include "two_bit_packed_file_signal_source.h"
|
||||
#include "labsat_signal_source.h"
|
||||
#include "channel.h"
|
||||
|
||||
#include "signal_conditioner.h"
|
||||
@ -896,6 +897,21 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetBlock(
|
||||
block = std::move(block_);
|
||||
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
std::cout << "GNSS-SDR program ended." << std::endl;
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
else if (implementation.compare("Labsat_Signal_Source") == 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
std::unique_ptr<GNSSBlockInterface> block_(new LabsatSignalSource(configuration.get(), role, in_streams,
|
||||
out_streams, queue));
|
||||
block = std::move(block_);
|
||||
}
|
||||
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
std::cout << "GNSS-SDR program ended." << std::endl;
|
||||
|
Loading…
Reference in New Issue
Block a user