1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-01-07 07:50:32 +00:00

Merge branch 'next' into arribas_next

Conflicts:
	src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_cc.cc
This commit is contained in:
Javier 2015-05-06 16:49:11 +02:00
commit 37a346f3f6
48 changed files with 1237 additions and 741 deletions

View File

@ -35,16 +35,23 @@ file(RELATIVE_PATH RELATIVE_CMAKE_CALL ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRE
# Enable them here or at the command line by doing 'cmake -DENABLE_XXX=ON ../' # Enable them here or at the command line by doing 'cmake -DENABLE_XXX=ON ../'
######################################################################## ########################################################################
option(ENABLE_GN3S "Enable the use of the GN3S dongle as signal source (experimental)" OFF) # Support of optional RF front-ends
option(ENABLE_ARRAY "Enable the use of CTTC's antenna array front-end as signal source (experimental)" OFF)
option(ENABLE_FLEXIBAND "Enable the use of the signal source adater for the Teleorbit Flexiband GNURadio driver" OFF)
option(ENABLE_OSMOSDR "Enable the use of OsmoSDR and other front-ends (RTL-based dongles, HackRF, bladeRF, etc.) as signal source (experimental)" OFF) option(ENABLE_OSMOSDR "Enable the use of OsmoSDR and other front-ends (RTL-based dongles, HackRF, bladeRF, etc.) as signal source (experimental)" OFF)
option(ENABLE_OPENCL "Enable building of processing blocks implemented with OpenCL (experimental)" OFF) option(ENABLE_FLEXIBAND "Enable the use of the signal source adater for the Teleorbit Flexiband GNURadio driver" OFF)
option(ENABLE_ARRAY "Enable the use of CTTC's antenna array front-end as signal source (experimental)" OFF)
option(ENABLE_GN3S "Enable the use of the GN3S dongle as signal source (experimental)" OFF)
# Performance analysis tools
option(ENABLE_GPERFTOOLS "Enable linking to Gperftools libraries (tcmalloc and profiler)" OFF) option(ENABLE_GPERFTOOLS "Enable linking to Gperftools libraries (tcmalloc and profiler)" OFF)
option(ENABLE_GPROF "Enable the use of the GNU profiler tool 'gprof'" OFF)
# Acceleration
option(ENABLE_OPENCL "Enable building of processing blocks implemented with OpenCL (experimental)" OFF)
# Building and packaging options
option(ENABLE_GENERIC_ARCH "Builds a portable binary" OFF) option(ENABLE_GENERIC_ARCH "Builds a portable binary" OFF)
option(ENABLE_PACKAGING "Enable software packaging" OFF) option(ENABLE_PACKAGING "Enable software packaging" OFF)
option(ENABLE_OWN_GLOG "Download glog and link it to gflags" OFF) option(ENABLE_OWN_GLOG "Download glog and link it to gflags" OFF)
if(ENABLE_PACKAGING) if(ENABLE_PACKAGING)
set(ENABLE_GENERIC_ARCH ON) set(ENABLE_GENERIC_ARCH ON)
endif(ENABLE_PACKAGING) endif(ENABLE_PACKAGING)
@ -212,13 +219,15 @@ endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
#select the release build type by default to get optimization flags #select the release build type by default to get optimization flags
if(NOT CMAKE_BUILD_TYPE) if(NOT CMAKE_BUILD_TYPE)
if(ENABLE_GPERFTOOLS) if(ENABLE_GPERFTOOLS OR ENABLE_GPROF)
set(CMAKE_BUILD_TYPE "RelWithDebInfo") set(CMAKE_BUILD_TYPE "RelWithDebInfo")
message(STATUS "Build type not specified: defaulting to RelWithDebInfo.") message(STATUS "Build type not specified: defaulting to RelWithDebInfo.")
else(ENABLE_GPERFTOOLS) else(ENABLE_GPERFTOOLS OR ENABLE_GPROF)
set(CMAKE_BUILD_TYPE "Release") set(CMAKE_BUILD_TYPE "Release")
message(STATUS "Build type not specified: defaulting to Release.") message(STATUS "Build type not specified: defaulting to Release.")
endif(ENABLE_GPERFTOOLS) endif(ENABLE_GPERFTOOLS OR ENABLE_GPROF)
else(NOT CMAKE_BUILD_TYPE)
message(STATUS "Build type set to ${CMAKE_BUILD_TYPE}.")
endif(NOT CMAKE_BUILD_TYPE) endif(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "") set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "")
@ -696,8 +705,8 @@ if(NOT ARMADILLO_FOUND)
message(STATUS " Armadillo will be downloaded and built automatically ") message(STATUS " Armadillo will be downloaded and built automatically ")
message(STATUS " when doing 'make'. ") message(STATUS " when doing 'make'. ")
set(armadillo_RELEASE 4.650.4) set(armadillo_RELEASE 5.100.1)
set(armadillo_MD5 "e575dc01cf60e290a467c7c6d3171ef3") set(armadillo_MD5 "6926fbf81bde99d777e3d09d034b308a")
ExternalProject_Add( ExternalProject_Add(
armadillo-${armadillo_RELEASE} armadillo-${armadillo_RELEASE}
@ -1017,6 +1026,15 @@ if(ENABLE_GPERFTOOLS)
endif(GPERFTOOLS_FOUND) endif(GPERFTOOLS_FOUND)
endif(ENABLE_GPERFTOOLS) endif(ENABLE_GPERFTOOLS)
if(ENABLE_GPROF)
if(CMAKE_COMPILER_IS_GNUCXX)
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -pg")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pg")
endif(CMAKE_COMPILER_IS_GNUCXX)
endif(ENABLE_GPROF)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_CXX_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_CXX_FLAGS}")
if(OS_IS_LINUX) if(OS_IS_LINUX)

View File

@ -16,18 +16,18 @@ This section describes how to set up the compilation environment in GNU/Linux or
GNU/Linux GNU/Linux
---------- ----------
* Tested distributions: Ubuntu 14.04 LTS and 14.10, Debian 8.0 "jessie". * Tested distributions: Ubuntu 14.04 LTS, 14.10 and 15.04, Debian 8.0 "jessie", Linaro 15.03
* Known to work but not continually tested: Fedora 19 and 20, and openSUSE 13.1 * Known to work but not continually tested: Fedora 19 and 20, and openSUSE 13.1
* Supported microprocessor architectures: * Supported microprocessor architectures:
* i386: Intel x86 instruction set (32-bit microprocessors). * i386: Intel x86 instruction set (32-bit microprocessors).
* amd64: also known as x86-64, the 64-bit version of the x86 instruction set, originally created by AMD and implemented by AMD, Intel, VIA and others. * amd64: also known as x86-64, the 64-bit version of the x86 instruction set, originally created by AMD and implemented by AMD, Intel, VIA and others.
* armel: ARM embedded ABI, supported on ARM v4t and higher (for Debian only). * armel: ARM embedded ABI, supported on ARM v4t and higher.
* armhf: ARM hard float, ARMv7 + VFP3-D16 floating-point hardware extension + Thumb-2 instruction set and above (for Debian only). * armhf: ARM hard float, ARMv7 + VFP3-D16 floating-point hardware extension + Thumb-2 instruction set and above.
* arm64: ARM 64 bits or ARMv8 (for Debian only). * arm64: ARM 64 bits or ARMv8.
Older distribution releases might work as well, but you will need GCC 4.7 or newer. Older distribution releases might work as well, but you will need GCC 4.7 or newer.
Before building GNSS-SDR, you need to install all the required dependencies. If you are using Debian 8 or Ubuntu 14.10, this can be done by copying and pasting the following line in a terminal: Before building GNSS-SDR, you need to install all the required dependencies. If you are using Debian 8, Ubuntu 14.10 or above, this can be done by copying and pasting the following line in a terminal:
~~~~~~ ~~~~~~
$ sudo apt-get install build-essential cmake git libboost-dev libboost-date-time-dev \ $ sudo apt-get install build-essential cmake git libboost-dev libboost-date-time-dev \
@ -39,7 +39,7 @@ $ sudo apt-get install build-essential cmake git libboost-dev libboost-date-time
Once you have installed these packages, you can jump directly to [how to download the source code and build GNSS-SDR](#download-and-build-linux). Alternatively, if you need to manually install those libraries, please keep reading. Once you have installed these packages, you can jump directly to [how to download the source code and build GNSS-SDR](#download-and-build-linux). Alternatively, if you need to manually install those libraries, please keep reading.
Note for Ubuntu 14.04 LTS "trusty" users: you will need to build from source and install GNU Radio manually, as explained below, since GNSS-SDR requires gnuradio-dev >= 3.7.3, and Ubuntu 14.04 came with 3.7.2. Note for Ubuntu 14.04 LTS "trusty" users: you will need to build from source and install GNU Radio manually, as explained below, since GNSS-SDR requires gnuradio-dev >= 3.7.3, and Ubuntu 14.04 came with 3.7.2. Install all the packages above BUT EXCEPT ```libuhd-dev```, ```gnuradio-dev``` and ```gr-osmosdr``` (and remove them if they are already installed in your machine), and install those dependencies using PyBOMBS.
### Manual installation of GNU Radio ### Manual installation of GNU Radio
@ -94,9 +94,9 @@ In case you do not want to use PyBOMBS and prefer to build and install GNU Radio
$ sudo apt-get install libopenblas-dev liblapack-dev gfortran # For Debian/Ubuntu/LinuxMint $ sudo apt-get install libopenblas-dev liblapack-dev gfortran # For Debian/Ubuntu/LinuxMint
$ sudo yum install lapack-devel blas-devel gcc-fortran # For Fedora/CentOS/RHEL $ sudo yum install lapack-devel blas-devel gcc-fortran # For Fedora/CentOS/RHEL
$ sudo zypper install lapack-devel blas-devel gcc-fortran # For OpenSUSE $ sudo zypper install lapack-devel blas-devel gcc-fortran # For OpenSUSE
$ wget http://sourceforge.net/projects/arma/files/armadillo-4.650.4.tar.gz $ wget http://sourceforge.net/projects/arma/files/armadillo-5.100.1.tar.gz
$ tar xvfz armadillo-4.650.4.tar.gz $ tar xvfz armadillo-5.100.1.tar.gz
$ cd armadillo-4.650.4 $ cd armadillo-5.100.1
$ cmake . $ cmake .
$ make $ make
$ sudo make install $ sudo make install

View File

@ -27,6 +27,8 @@ FIND_LIBRARY(
${GNURADIO_INSTALL_PREFIX}/lib ${GNURADIO_INSTALL_PREFIX}/lib
) )
set(VOLK_VERSION ${PC_VOLK_VERSION})
INCLUDE(FindPackageHandleStandardArgs) INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(VOLK DEFAULT_MSG VOLK_LIBRARIES VOLK_INCLUDE_DIRS) FIND_PACKAGE_HANDLE_STANDARD_ARGS(VOLK DEFAULT_MSG VOLK_LIBRARIES VOLK_INCLUDE_DIRS)
MARK_AS_ADVANCED(VOLK_LIBRARIES VOLK_INCLUDE_DIRS) MARK_AS_ADVANCED(VOLK_LIBRARIES VOLK_INCLUDE_DIRS VOLK_VERSION)

View File

@ -0,0 +1,308 @@
; 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].
;FOR USE GNSS-SDR WITH RTLSDR DONGLES USER MUST SET THE CALIBRATED SAMPLE RATE HERE
; i.e. using front-end-cal as reported here:http://www.cttc.es/publication/turning-a-television-into-a-gnss-receiver/
GNSS-SDR.internal_fs_hz=1999898
;######### CONTROL_THREAD CONFIG ############
ControlThread.wait_for_flowgraph=false
;######### SUPL RRLP GPS assistance configuration #####
GNSS-SDR.SUPL_gps_enabled=false
GNSS-SDR.SUPL_read_gps_assistance_xml=false
GNSS-SDR.SUPL_gps_ephemeris_server=supl.nokia.com
GNSS-SDR.SUPL_gps_ephemeris_port=7275
GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com
GNSS-SDR.SUPL_gps_acquisition_port=7275
GNSS-SDR.SUPL_MCC=244
GNSS-SDR.SUPL_MNS=5
GNSS-SDR.SUPL_LAC=0x59e2
GNSS-SDR.SUPL_CI=0x31b0
;######### SIGNAL_SOURCE CONFIG ############
;#implementation: Use [File_Signal_Source] or [UHD_Signal_Source] or [GN3S_Signal_Source] [Osmosdr_Signal_Source]
SignalSource.implementation=Osmosdr_Signal_Source
;#filename: path to file with the captured GNSS signal samples to be processed
SignalSource.filename=/media/DATALOGGER_/signals/RTL-SDR/geo/pmt4.dat
;#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]
;FOR USE GNSS-SDR WITH RTLSDR DONGLES USER MUST SET THE CALIBRATED SAMPLE RATE HERE
; i.e. using front-end-cal as reported here:http://www.cttc.es/publication/turning-a-television-into-a-gnss-receiver/
SignalSource.sampling_frequency=2000000
;#freq: RF front-end center frequency in [Hz]
SignalSource.freq=1575420000
;#gain: Front-end overall gain Gain in [dB]
SignalSource.gain=40
;#rf_gain: Front-end RF stage gain in [dB]
SignalSource.rf_gain=40
;#rf_gain: Front-end IF stage gain in [dB]
SignalSource.if_gain=30
;#AGC_enabled: Front-end AGC enabled or disabled
SignalSource.AGC_enabled = false
;#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
;#Send optional arguments to the OsmoSdr Gnuradio block
;#Arguments are comma-delimited. See http://sdr.osmocom.org/trac/wiki/GrOsmoSDR for documentation.
SignalSource.osmosdr_args=rtl_tcp,offset_tune=1
;######### 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. Please disable it in this version.
;#implementation: [Pass_Through] disables this block
DataTypeAdapter.implementation=Pass_Through
;######### 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]
;#[Pass_Through] disables this block
;#[Fir_Filter] enables a 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
;#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
;FOR USE GNSS-SDR WITH RTLSDR DONGLES USER MUST SET THE CALIBRATED SAMPLE RATE HERE
; i.e. using front-end-cal as reported here:http://www.cttc.es/publication/turning-a-television-into-a-gnss-receiver/
InputFilter.sampling_frequency=1999898
;# IF deviation due to front-end LO inaccuracies [HZ]
InputFilter.IF=80558
;######### RESAMPLER CONFIG ############
;## Resamples the input data.
;# DISABLED IN THE RTL-SDR REALTIME
;#implementation: Use [Pass_Through] or [Direct_Resampler]
;#[Pass_Through] disables this block
Resampler.implementation=Pass_Through
;######### CHANNELS GLOBAL CONFIG ############
;#count: Number of available GPS satellite channels.
Channels_GPS.count=4
;#count: Number of available Galileo satellite channels.
Channels_Galileo.count=0
;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver
Channels.in_acquisition=1
;#system: GPS, GLONASS, GALILEO, SBAS or COMPASS
;#if the option is disabled by default is assigned GPS
Channel.system=GPS
;#signal:
;#if the option is disabled by default is assigned "1C" GPS L1 C/A
Channel.signal=1C
Channel0.signal=1C
;######### ACQUISITION GLOBAL CONFIG ############
;#dump: Enable or disable the acquisition internal data file logging [true] or [false]
Acquisition_GPS.dump=false
;#filename: Log path and filename
Acquisition_GPS.dump_filename=./acq_dump.dat
;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version.
Acquisition_GPS.item_type=gr_complex
;#if: Signal intermediate frequency in [Hz]
Acquisition_GPS.if=0
;#sampled_ms: Signal block duration for the acquisition signal detection [ms]
Acquisition_GPS.sampled_ms=1
;#implementation: Acquisition algorithm selection for this channel: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
Acquisition_GPS.implementation=GPS_L1_CA_PCPS_Acquisition_Fine_Doppler
;#threshold: Acquisition threshold
Acquisition_GPS.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_GPS.pfa=0.0001
;#doppler_max: Maximum expected Doppler shift [Hz]
Acquisition_GPS.doppler_max=10000
;#doppler_max: Maximum expected Doppler shift [Hz]
Acquisition_GPS.doppler_min=-10000
;#doppler_step Doppler step in the grid search [Hz]
Acquisition_GPS.doppler_step=500
;#maximum dwells
Acquisition_GPS.max_dwells=15
;######### ACQUISITION CHANNELS CONFIG ######
;#The following options are specific to each channel and overwrite the generic options
;#repeat_satellite: Use only jointly with the satellite PRN ID option. The default value is false
;Acquisition0.repeat_satellite = false
;######### TRACKING GLOBAL CONFIG ############
;#implementation: Selected tracking algorithm: [GPS_L1_CA_DLL_PLL_Tracking] or [GPS_L1_CA_DLL_FLL_PLL_Tracking] [GPS_L1_CA_DLL_PLL_Optim_Tracking]
Tracking_GPS.implementation=GPS_L1_CA_DLL_PLL_Optim_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=2.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;
;######### TELEMETRY DECODER GPS CONFIG ############
;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L1 C/A
TelemetryDecoder_GPS.implementation=GPS_L1_CA_Telemetry_Decoder
TelemetryDecoder_GPS.dump=false
;#decimation factor
TelemetryDecoder_GPS.decimation_factor=1;
;######### OBSERVABLES CONFIG ############
;#implementation: Use [GPS_L1_CA_Observables] for GPS L1 C/A.
Observables.implementation=GPS_L1_CA_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 algorithm: Use [GPS_L1_CA_PVT] in this version.
PVT.implementation=GPS_L1_CA_PVT
;#averaging_depth: Number of PVT observations in the moving average algorithm
PVT.averaging_depth=10
;#flag_average: Enables the PVT averaging between output intervals (arithmetic mean) [true] or [false]
PVT.flag_averaging=true
;#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
;# RINEX, KML, and NMEA output configuration
;#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
;#nmea_dump_filename: NMEA log path and filename
PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea;
;#flag_nmea_tty_port: Enable or disable the NMEA log to a serial TTY port (Can be used with real hardware or virtual one)
PVT.flag_nmea_tty_port=false;
;#nmea_dump_devname: serial device descriptor for NMEA logging
PVT.nmea_dump_devname=/dev/pts/4
;#dump: Enable or disable the PVT internal binary data file logging [true] or [false]
PVT.dump=true
;######### OUTPUT_FILTER CONFIG ############
;# Receiver output filter: Leave this block disabled in this version
OutputFilter.implementation=Null_Sink_Output_Filter
OutputFilter.filename=data/gnss-sdr.dat
OutputFilter.item_type=gr_complex

View File

@ -340,7 +340,7 @@ int hybrid_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_items,
std::cout << "Dilution of Precision at " << boost::posix_time::to_simple_string(d_ls_pvt->d_position_UTC_time) std::cout << "Dilution of Precision at " << boost::posix_time::to_simple_string(d_ls_pvt->d_position_UTC_time)
<< " UTC using "<< d_ls_pvt->d_valid_observations<<" observations is HDOP = " << d_ls_pvt->d_HDOP << " VDOP = " << " UTC using "<< d_ls_pvt->d_valid_observations<<" observations is HDOP = " << d_ls_pvt->d_HDOP << " VDOP = "
<< d_ls_pvt->d_VDOP <<" TDOP = " << d_ls_pvt->d_TDOP << d_ls_pvt->d_VDOP <<" TDOP = " << d_ls_pvt->d_TDOP
<< " GDOP = " << d_ls_pvt->d_GDOP; << " GDOP = " << d_ls_pvt->d_GDOP << std::endl;
} }
// MULTIPLEXED FILE RECORDING - Record results to file // MULTIPLEXED FILE RECORDING - Record results to file

View File

@ -308,7 +308,7 @@ bool galileo_e1_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_pseudoranges_map
//end debug //end debug
// SV ECEF DEBUG OUTPUT // SV ECEF DEBUG OUTPUT
LOG(INFO) << "ECEF satellite SV ID=" << galileo_ephemeris_iter->second.i_satellite_PRN DLOG(INFO) << "ECEF satellite SV ID=" << galileo_ephemeris_iter->second.i_satellite_PRN
<< " X=" << galileo_ephemeris_iter->second.d_satpos_X << " X=" << galileo_ephemeris_iter->second.d_satpos_X
<< " [m] Y=" << galileo_ephemeris_iter->second.d_satpos_Y << " [m] Y=" << galileo_ephemeris_iter->second.d_satpos_Y
<< " [m] Z=" << galileo_ephemeris_iter->second.d_satpos_Z << " [m] Z=" << galileo_ephemeris_iter->second.d_satpos_Z
@ -345,7 +345,7 @@ bool galileo_e1_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_pseudoranges_map
// 22 August 1999 00:00 last Galileo start GST epoch (ICD sec 5.1.2) // 22 August 1999 00:00 last Galileo start GST epoch (ICD sec 5.1.2)
boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t); boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t);
d_position_UTC_time = p_time; d_position_UTC_time = p_time;
LOG(INFO) << "Galileo Position at TOW=" << galileo_current_time << " in ECEF (X,Y,Z) = " << mypos; DLOG(INFO) << "Galileo Position at TOW=" << galileo_current_time << " in ECEF (X,Y,Z) = " << mypos;
cart2geo(static_cast<double>(mypos(0)), static_cast<double>(mypos(1)), static_cast<double>(mypos(2)), 4); cart2geo(static_cast<double>(mypos(0)), static_cast<double>(mypos(1)), static_cast<double>(mypos(2)), 4);
//ToDo: Find an Observables/PVT random bug with some satellite configurations that gives an erratic PVT solution (i.e. height>50 km) //ToDo: Find an Observables/PVT random bug with some satellite configurations that gives an erratic PVT solution (i.e. height>50 km)

View File

@ -289,7 +289,7 @@ bool gps_l1_ca_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_pseudoranges_map,
valid_obs++; valid_obs++;
// SV ECEF DEBUG OUTPUT // SV ECEF DEBUG OUTPUT
LOG(INFO) << "(new)ECEF satellite SV ID=" << gps_ephemeris_iter->second.i_satellite_PRN DLOG(INFO) << "(new)ECEF satellite SV ID=" << gps_ephemeris_iter->second.i_satellite_PRN
<< " X=" << gps_ephemeris_iter->second.d_satpos_X << " X=" << gps_ephemeris_iter->second.d_satpos_X
<< " [m] Y=" << gps_ephemeris_iter->second.d_satpos_Y << " [m] Y=" << gps_ephemeris_iter->second.d_satpos_Y
<< " [m] Z=" << gps_ephemeris_iter->second.d_satpos_Z << " [m] Z=" << gps_ephemeris_iter->second.d_satpos_Z
@ -318,11 +318,11 @@ bool gps_l1_ca_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_pseudoranges_map,
if (valid_obs >= 4) if (valid_obs >= 4)
{ {
arma::vec mypos; arma::vec mypos;
LOG(INFO) << "satpos=" << satpos; DLOG(INFO) << "satpos=" << satpos;
LOG(INFO) << "obs=" << obs; DLOG(INFO) << "obs=" << obs;
LOG(INFO) << "W=" << W; DLOG(INFO) << "W=" << W;
mypos = leastSquarePos(satpos, obs, W); mypos = leastSquarePos(satpos, obs, W);
LOG(INFO) << "(new)Position at TOW=" << GPS_current_time << " in ECEF (X,Y,Z) = " << mypos; DLOG(INFO) << "(new)Position at TOW=" << GPS_current_time << " in ECEF (X,Y,Z) = " << mypos;
gps_l1_ca_ls_pvt::cart2geo(mypos(0), mypos(1), mypos(2), 4); gps_l1_ca_ls_pvt::cart2geo(mypos(0), mypos(1), mypos(2), 4);
//ToDo: Find an Observables/PVT random bug with some satellite configurations that gives an erratic PVT solution (i.e. height>50 km) //ToDo: Find an Observables/PVT random bug with some satellite configurations that gives an erratic PVT solution (i.e. height>50 km)
if (d_height_m > 50000) if (d_height_m > 50000)

View File

@ -318,7 +318,7 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_pseudoranges_map, do
//end debug //end debug
// SV ECEF DEBUG OUTPUT // SV ECEF DEBUG OUTPUT
LOG(INFO) << "ECEF satellite SV ID=" << galileo_ephemeris_iter->second.i_satellite_PRN DLOG(INFO) << "ECEF satellite SV ID=" << galileo_ephemeris_iter->second.i_satellite_PRN
<< " X=" << galileo_ephemeris_iter->second.d_satpos_X << " X=" << galileo_ephemeris_iter->second.d_satpos_X
<< " [m] Y=" << galileo_ephemeris_iter->second.d_satpos_Y << " [m] Y=" << galileo_ephemeris_iter->second.d_satpos_Y
<< " [m] Z=" << galileo_ephemeris_iter->second.d_satpos_Z << " [m] Z=" << galileo_ephemeris_iter->second.d_satpos_Z
@ -369,7 +369,7 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_pseudoranges_map, do
valid_obs++; valid_obs++;
valid_obs_GPS_counter++; valid_obs_GPS_counter++;
// SV ECEF DEBUG OUTPUT // SV ECEF DEBUG OUTPUT
LOG(INFO) << "(new)ECEF satellite SV ID=" << gps_ephemeris_iter->second.i_satellite_PRN DLOG(INFO) << "(new)ECEF satellite SV ID=" << gps_ephemeris_iter->second.i_satellite_PRN
<< " X=" << gps_ephemeris_iter->second.d_satpos_X << " X=" << gps_ephemeris_iter->second.d_satpos_X
<< " [m] Y=" << gps_ephemeris_iter->second.d_satpos_Y << " [m] Y=" << gps_ephemeris_iter->second.d_satpos_Y
<< " [m] Z=" << gps_ephemeris_iter->second.d_satpos_Z << " [m] Z=" << gps_ephemeris_iter->second.d_satpos_Z
@ -414,7 +414,7 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_pseudoranges_map, do
// 22 August 1999 00:00 last Galileo start GST epoch (ICD sec 5.1.2) // 22 August 1999 00:00 last Galileo start GST epoch (ICD sec 5.1.2)
boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t); boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t);
d_position_UTC_time = p_time; d_position_UTC_time = p_time;
LOG(INFO) << "HYBRID Position at TOW=" << hybrid_current_time << " in ECEF (X,Y,Z) = " << mypos; DLOG(INFO) << "HYBRID Position at TOW=" << hybrid_current_time << " in ECEF (X,Y,Z) = " << mypos;
cart2geo(static_cast<double>(mypos(0)), static_cast<double>(mypos(1)), static_cast<double>(mypos(2)), 4); cart2geo(static_cast<double>(mypos(0)), static_cast<double>(mypos(1)), static_cast<double>(mypos(2)), 4);
//ToDo: Find an Observables/PVT random bug with some satellite configurations that gives an erratic PVT solution (i.e. height>50 km) //ToDo: Find an Observables/PVT random bug with some satellite configurations that gives an erratic PVT solution (i.e. height>50 km)

View File

@ -262,13 +262,12 @@ void galileo_e5a_noncoherentIQ_acquisition_caf_cc::init()
{ {
d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex*>(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex*>(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()));
int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index; int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
complex_exp_gen_conj(d_grid_doppler_wipeoffs[doppler_index], complex_exp_gen_conj(d_grid_doppler_wipeoffs[doppler_index], d_freq + doppler, d_fs_in, d_fft_size);
d_freq + doppler, d_fs_in, d_fft_size);
} }
/* CAF Filtering to resolve doppler ambiguity. Phase and quadrature must be processed /* CAF Filtering to resolve doppler ambiguity. Phase and quadrature must be processed
* separately before non-coherent integration */ * separately before non-coherent integration */
// if (d_CAF_filter) // if (d_CAF_filter)
if (d_CAF_window_hz > 0) if (d_CAF_window_hz > 0)
{ {
d_CAF_vector = static_cast<float*>(volk_malloc(d_num_doppler_bins * sizeof(float), volk_get_alignment())); d_CAF_vector = static_cast<float*>(volk_malloc(d_num_doppler_bins * sizeof(float), volk_get_alignment()));
@ -480,14 +479,14 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
{ {
if (magt_IA >= magt_IB) if (magt_IA >= magt_IB)
{ {
// if (d_CAF_filter) {d_CAF_vector_I[doppler_index] = magt_IA;} // if (d_CAF_filter) {d_CAF_vector_I[doppler_index] = magt_IA;}
if (d_CAF_window_hz > 0) {d_CAF_vector_I[doppler_index] = d_magnitudeIA[indext_IA];} if (d_CAF_window_hz > 0) {d_CAF_vector_I[doppler_index] = d_magnitudeIA[indext_IA];}
if (d_both_signal_components) if (d_both_signal_components)
{ {
// Integrate non-coherently I+Q // Integrate non-coherently I+Q
if (magt_QA >= magt_QB) if (magt_QA >= magt_QB)
{ {
// if (d_CAF_filter) {d_CAF_vector_Q[doppler_index] = magt_QA;} // if (d_CAF_filter) {d_CAF_vector_Q[doppler_index] = magt_QA;}
if (d_CAF_window_hz > 0) {d_CAF_vector_Q[doppler_index] = d_magnitudeQA[indext_QA];} if (d_CAF_window_hz > 0) {d_CAF_vector_Q[doppler_index] = d_magnitudeQA[indext_QA];}
for (unsigned int i=0; i<d_fft_size; i++) for (unsigned int i=0; i<d_fft_size; i++)
{ {
@ -496,7 +495,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
} }
else else
{ {
// if (d_CAF_filter) {d_CAF_vector_Q[doppler_index] = magt_QB;} // if (d_CAF_filter) {d_CAF_vector_Q[doppler_index] = magt_QB;}
if (d_CAF_window_hz > 0) {d_CAF_vector_Q[doppler_index] = d_magnitudeQB[indext_QB];} if (d_CAF_window_hz > 0) {d_CAF_vector_Q[doppler_index] = d_magnitudeQB[indext_QB];}
for (unsigned int i=0; i<d_fft_size; i++) for (unsigned int i=0; i<d_fft_size; i++)
{ {
@ -509,7 +508,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
} }
else else
{ {
// if (d_CAF_filter) {d_CAF_vector_I[doppler_index] = magt_IB;} // if (d_CAF_filter) {d_CAF_vector_I[doppler_index] = magt_IB;}
if (d_CAF_window_hz > 0) {d_CAF_vector_I[doppler_index] = d_magnitudeIB[indext_IB];} if (d_CAF_window_hz > 0) {d_CAF_vector_I[doppler_index] = d_magnitudeIB[indext_IB];}
if (d_both_signal_components) if (d_both_signal_components)
{ {
@ -525,7 +524,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
} }
else else
{ {
// if (d_CAF_filter) {d_CAF_vector_Q[doppler_index] = magt_QB;} // if (d_CAF_filter) {d_CAF_vector_Q[doppler_index] = magt_QB;}
if (d_CAF_window_hz > 0) {d_CAF_vector_Q[doppler_index] = d_magnitudeQB[indext_QB];} if (d_CAF_window_hz > 0) {d_CAF_vector_Q[doppler_index] = d_magnitudeQB[indext_QB];}
for (unsigned int i=0; i<d_fft_size; i++) for (unsigned int i=0; i<d_fft_size; i++)
{ {
@ -539,11 +538,11 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
} }
else else
{ {
// if (d_CAF_filter) {d_CAF_vector_I[doppler_index] = magt_IA;} // if (d_CAF_filter) {d_CAF_vector_I[doppler_index] = magt_IA;}
if (d_CAF_window_hz > 0) {d_CAF_vector_I[doppler_index] = d_magnitudeIA[indext_IA];} if (d_CAF_window_hz > 0) {d_CAF_vector_I[doppler_index] = d_magnitudeIA[indext_IA];}
if (d_both_signal_components) if (d_both_signal_components)
{ {
// if (d_CAF_filter) {d_CAF_vector_Q[doppler_index] = magt_QA;} // if (d_CAF_filter) {d_CAF_vector_Q[doppler_index] = magt_QA;}
if (d_CAF_window_hz > 0) {d_CAF_vector_Q[doppler_index] = d_magnitudeQA[indext_QA];} if (d_CAF_window_hz > 0) {d_CAF_vector_Q[doppler_index] = d_magnitudeQA[indext_QA];}
// NON-Coherent integration of only 1 code // NON-Coherent integration of only 1 code
for (unsigned int i=0; i<d_fft_size; i++) for (unsigned int i=0; i<d_fft_size; i++)
@ -604,7 +603,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
d_dump_file.close(); d_dump_file.close();
} }
} }
// std::cout << "d_mag " << d_mag << ".d_sample_counter " << d_sample_counter << ". acq delay " << d_gnss_synchro->Acq_delay_samples<< " indext "<< indext << std::endl; // std::cout << "d_mag " << d_mag << ".d_sample_counter " << d_sample_counter << ". acq delay " << d_gnss_synchro->Acq_delay_samples<< " indext "<< indext << std::endl;
// 6 OPTIONAL: CAF filter to avoid Doppler ambiguity in bit transition. // 6 OPTIONAL: CAF filter to avoid Doppler ambiguity in bit transition.
if (d_CAF_window_hz > 0) if (d_CAF_window_hz > 0)
{ {
@ -622,7 +621,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
// volk_32f_accumulator_s32f_a(&d_CAF_vector[doppler_index], d_CAF_vector_I, CAF_bins_half+doppler_index+1); // volk_32f_accumulator_s32f_a(&d_CAF_vector[doppler_index], d_CAF_vector_I, CAF_bins_half+doppler_index+1);
for (int i = 0; i < CAF_bins_half + doppler_index + 1; i++) for (int i = 0; i < CAF_bins_half + doppler_index + 1; i++)
{ {
d_CAF_vector[doppler_index] += d_CAF_vector_I[i] * (1 - weighting_factor * static_cast<unsigned int>(abs(doppler_index - i))); d_CAF_vector[doppler_index] += d_CAF_vector_I[i] * (1 - weighting_factor * static_cast<unsigned int>((doppler_index - i)));
} }
// d_CAF_vector[doppler_index] /= CAF_bins_half+doppler_index+1; // d_CAF_vector[doppler_index] /= CAF_bins_half+doppler_index+1;
d_CAF_vector[doppler_index] /= 1 + CAF_bins_half+doppler_index - weighting_factor * CAF_bins_half * (CAF_bins_half + 1) / 2 - weighting_factor*doppler_index*(doppler_index+1)/2; // triangles = [n*(n+1)/2] d_CAF_vector[doppler_index] /= 1 + CAF_bins_half+doppler_index - weighting_factor * CAF_bins_half * (CAF_bins_half + 1) / 2 - weighting_factor*doppler_index*(doppler_index+1)/2; // triangles = [n*(n+1)/2]
@ -630,12 +629,12 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
{ {
accum[0] = 0; accum[0] = 0;
// volk_32f_accumulator_s32f_a(&accum[0], d_CAF_vector_Q, CAF_bins_half+doppler_index+1); // volk_32f_accumulator_s32f_a(&accum[0], d_CAF_vector_Q, CAF_bins_half+doppler_index+1);
for (int i = 0; i < CAF_bins_half+doppler_index+1; i++) for (int i = 0; i < CAF_bins_half + doppler_index + 1; i++)
{ {
accum[0] += d_CAF_vector_Q[i] * (1 - weighting_factor * static_cast<unsigned int>(abs(doppler_index - i))); accum[0] += d_CAF_vector_Q[i] * (1 - weighting_factor * static_cast<unsigned int>(abs(doppler_index - i)));
} }
// accum[0] /= CAF_bins_half+doppler_index+1; // accum[0] /= CAF_bins_half+doppler_index+1;
accum[0] /= 1+CAF_bins_half+doppler_index - weighting_factor * CAF_bins_half * (CAF_bins_half + 1) / 2 - weighting_factor * doppler_index * (doppler_index + 1) / 2; // triangles = [n*(n+1)/2] accum[0] /= 1 + CAF_bins_half + doppler_index - weighting_factor * CAF_bins_half * (CAF_bins_half + 1) / 2 - weighting_factor * doppler_index * (doppler_index + 1) / 2; // triangles = [n*(n+1)/2]
d_CAF_vector[doppler_index] += accum[0]; d_CAF_vector[doppler_index] += accum[0];
} }
} }
@ -644,27 +643,27 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
{ {
d_CAF_vector[doppler_index] = 0; d_CAF_vector[doppler_index] = 0;
// volk_32f_accumulator_s32f_a(&d_CAF_vector[doppler_index], &d_CAF_vector_I[doppler_index-CAF_bins_half], 2*CAF_bins_half+1); // volk_32f_accumulator_s32f_a(&d_CAF_vector[doppler_index], &d_CAF_vector_I[doppler_index-CAF_bins_half], 2*CAF_bins_half+1);
for (int i = doppler_index-CAF_bins_half; i < doppler_index+CAF_bins_half+1; i++) for (int i = doppler_index-CAF_bins_half; i < doppler_index+CAF_bins_half + 1; i++)
{ {
d_CAF_vector[doppler_index] += d_CAF_vector_I[i] * (1-weighting_factor * static_cast<unsigned int>(abs(doppler_index - i))); d_CAF_vector[doppler_index] += d_CAF_vector_I[i] * (1-weighting_factor * static_cast<unsigned int>((doppler_index - i)));
} }
// d_CAF_vector[doppler_index] /= 2*CAF_bins_half+1; // d_CAF_vector[doppler_index] /= 2*CAF_bins_half+1;
d_CAF_vector[doppler_index] /= 1 + 2 * CAF_bins_half - 2 *weighting_factor * CAF_bins_half * (CAF_bins_half + 1) / 2; d_CAF_vector[doppler_index] /= 1 + 2 * CAF_bins_half - 2 * weighting_factor * CAF_bins_half * (CAF_bins_half + 1) / 2;
if (d_both_signal_components) if (d_both_signal_components)
{ {
accum[0] = 0; accum[0] = 0;
// volk_32f_accumulator_s32f_a(&accum[0], &d_CAF_vector_Q[doppler_index-CAF_bins_half], 2*CAF_bins_half); // volk_32f_accumulator_s32f_a(&accum[0], &d_CAF_vector_Q[doppler_index-CAF_bins_half], 2*CAF_bins_half);
for (int i = doppler_index-CAF_bins_half; i < doppler_index+CAF_bins_half+1; i++) for (int i = doppler_index-CAF_bins_half; i < doppler_index + CAF_bins_half + 1; i++)
{ {
accum[0] += d_CAF_vector_Q[i] * (1 -weighting_factor * static_cast<unsigned int>(abs(doppler_index - i))); accum[0] += d_CAF_vector_Q[i] * (1 - weighting_factor * static_cast<unsigned int>((doppler_index - i)));
} }
// accum[0] /= 2*CAF_bins_half+1; // accum[0] /= 2*CAF_bins_half+1;
accum[0] /= 1+2*CAF_bins_half - 2*weighting_factor * CAF_bins_half * (CAF_bins_half + 1) / 2; accum[0] /= 1 + 2 * CAF_bins_half - 2 * weighting_factor * CAF_bins_half * (CAF_bins_half + 1) / 2;
d_CAF_vector[doppler_index] += accum[0]; d_CAF_vector[doppler_index] += accum[0];
} }
} }
// Final iterations // Final iterations
for (unsigned int doppler_index = d_num_doppler_bins - CAF_bins_half;doppler_index<d_num_doppler_bins;doppler_index++) for (int doppler_index = d_num_doppler_bins - CAF_bins_half; doppler_index < d_num_doppler_bins; doppler_index++)
{ {
d_CAF_vector[doppler_index] = 0; d_CAF_vector[doppler_index] = 0;
// volk_32f_accumulator_s32f_a(&d_CAF_vector[doppler_index], &d_CAF_vector_I[doppler_index-CAF_bins_half], CAF_bins_half + (d_num_doppler_bins-doppler_index)); // volk_32f_accumulator_s32f_a(&d_CAF_vector[doppler_index], &d_CAF_vector_I[doppler_index-CAF_bins_half], CAF_bins_half + (d_num_doppler_bins-doppler_index));
@ -673,7 +672,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
d_CAF_vector[doppler_index] += d_CAF_vector_I[i] * (1 - weighting_factor * (abs(doppler_index - i))); d_CAF_vector[doppler_index] += d_CAF_vector_I[i] * (1 - weighting_factor * (abs(doppler_index - i)));
} }
// d_CAF_vector[doppler_index] /= CAF_bins_half+(d_num_doppler_bins-doppler_index); // d_CAF_vector[doppler_index] /= CAF_bins_half+(d_num_doppler_bins-doppler_index);
d_CAF_vector[doppler_index] /= 1+CAF_bins_half+(d_num_doppler_bins-doppler_index-1) - weighting_factor * CAF_bins_half * (CAF_bins_half + 1) / 2 - weighting_factor * (d_num_doppler_bins - doppler_index - 1) * (d_num_doppler_bins - doppler_index) / 2; d_CAF_vector[doppler_index] /= 1 + CAF_bins_half + (d_num_doppler_bins - doppler_index - 1) - weighting_factor * CAF_bins_half * (CAF_bins_half + 1) / 2 - weighting_factor * (d_num_doppler_bins - doppler_index - 1) * (d_num_doppler_bins - doppler_index) / 2;
if (d_both_signal_components) if (d_both_signal_components)
{ {
accum[0] = 0; accum[0] = 0;
@ -698,8 +697,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
std::stringstream filename; std::stringstream filename;
std::streamsize n = sizeof(float) * (d_num_doppler_bins); // noncomplex file write std::streamsize n = sizeof(float) * (d_num_doppler_bins); // noncomplex file write
filename.str(""); filename.str("");
filename << "../data/test_statistics_E5a_sat_" filename << "../data/test_statistics_E5a_sat_" << d_gnss_synchro->PRN << "_CAF.dat";
<< d_gnss_synchro->PRN << "_CAF.dat";
d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary); d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary);
d_dump_file.write((char*)d_CAF_vector, n); d_dump_file.write((char*)d_CAF_vector, n);
d_dump_file.close(); d_dump_file.close();

View File

@ -356,14 +356,14 @@ int pcps_acquisition_fine_doppler_cc::estimate_Doppler(gr_vector_const_void_star
} }
// 5. Update the Doppler estimation in Hz // 5. Update the Doppler estimation in Hz
if (abs(fftFreqBins[tmp_index_freq] - d_gnss_synchro->Acq_doppler_hz) < 1000) if (std::abs(fftFreqBins[tmp_index_freq] - d_gnss_synchro->Acq_doppler_hz) < 1000)
{ {
d_gnss_synchro->Acq_doppler_hz = static_cast<double>(fftFreqBins[tmp_index_freq]); d_gnss_synchro->Acq_doppler_hz = static_cast<double>(fftFreqBins[tmp_index_freq]);
//std::cout<<"FFT maximum present at "<<fftFreqBins[tmp_index_freq]<<" [Hz]"<<std::endl; //std::cout<<"FFT maximum present at "<<fftFreqBins[tmp_index_freq]<<" [Hz]"<<std::endl;
} }
else else
{ {
DLOG(INFO) << "Abs(Grid Doppler - FFT Doppler)=" << abs(fftFreqBins[tmp_index_freq] - d_gnss_synchro->Acq_doppler_hz); DLOG(INFO) << "Abs(Grid Doppler - FFT Doppler)=" << std::abs(fftFreqBins[tmp_index_freq] - d_gnss_synchro->Acq_doppler_hz);
DLOG(INFO) << "Error estimating fine frequency Doppler"; DLOG(INFO) << "Error estimating fine frequency Doppler";
//debug log //debug log
// //

View File

@ -70,8 +70,8 @@ add_library(gnss_sp_libs ${GNSS_SPLIBS_SOURCES} ${GNSS_SPLIBS_HEADERS})
source_group(Headers FILES ${GNSS_SPLIBS_HEADERS}) source_group(Headers FILES ${GNSS_SPLIBS_HEADERS})
target_link_libraries(gnss_sp_libs ${GNURADIO_RUNTIME_LIBRARIES} target_link_libraries(gnss_sp_libs ${GNURADIO_RUNTIME_LIBRARIES}
${VOLK_LIBRARIES} ${VOLK_LIBRARIES} ${ORC_LIBRARIES}
${VOLK_GNSSSDR_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES}
${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES}
${GNURADIO_FFT_LIBRARIES} ${GNURADIO_FFT_LIBRARIES}
${GNURADIO_FILTER_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES}

View File

@ -32,43 +32,26 @@
*/ */
#include "gnss_signal_processing.h" #include "gnss_signal_processing.h"
#include <gnuradio/fxpt.h> // fixed point sine and cosine #include <gnuradio/fxpt_nco.h>
auto auxCeil2 = [](float x){ return static_cast<int>(static_cast<long>((x)+1)); };
void complex_exp_gen(std::complex<float>* _dest, double _f, double _fs, unsigned int _samps) void complex_exp_gen(std::complex<float>* _dest, double _f, double _fs, unsigned int _samps)
{ {
int phase_i = 0; gr::fxpt_nco d_nco;
int phase_step_i; d_nco.set_freq((GPS_TWO_PI * _f) / _fs);
float phase_step_f = (float)((GPS_TWO_PI * _f) / _fs); d_nco.sincos(_dest, _samps, 1);
phase_step_i = gr::fxpt::float_to_fixed(phase_step_f);
float sin_f, cos_f;
for(unsigned int i = 0; i < _samps; i++)
{
gr::fxpt::sincos(phase_i, &sin_f, &cos_f);
_dest[i] = std::complex<float>(cos_f, sin_f);
phase_i += phase_step_i;
}
} }
void complex_exp_gen_conj(std::complex<float>* _dest, double _f, double _fs, unsigned int _samps) void complex_exp_gen_conj(std::complex<float>* _dest, double _f, double _fs, unsigned int _samps)
{ {
int phase_i = 0; gr::fxpt_nco d_nco;
int phase_step_i; d_nco.set_freq(-(GPS_TWO_PI * _f) / _fs);
float phase_step_f = (float)((GPS_TWO_PI * _f) / _fs); d_nco.sincos(_dest, _samps, 1);
phase_step_i = gr::fxpt::float_to_fixed(phase_step_f);
float sin_f, cos_f;
for(unsigned int i = 0; i < _samps; i++)
{
gr::fxpt::sincos(phase_i, &sin_f, &cos_f);
_dest[i] = std::complex<float>(cos_f, -sin_f);
phase_i += phase_step_i;
}
} }
void hex_to_binary_converter(int * _dest, char _from) void hex_to_binary_converter(int * _dest, char _from)
{ {
switch(_from) switch(_from)
@ -177,6 +160,7 @@ void resampler(std::complex<float>* _from, std::complex<float>* _dest, float _fs
float _fs_out, unsigned int _length_in, unsigned int _length_out) float _fs_out, unsigned int _length_in, unsigned int _length_out)
{ {
unsigned int _codeValueIndex; unsigned int _codeValueIndex;
float aux;
//--- Find time constants -------------------------------------------------- //--- Find time constants --------------------------------------------------
const float _t_in = 1 / _fs_in; // Incoming sampling period in sec const float _t_in = 1 / _fs_in; // Incoming sampling period in sec
const float _t_out = 1 / _fs_out; // Out sampling period in sec const float _t_out = 1 / _fs_out; // Out sampling period in sec
@ -184,7 +168,10 @@ void resampler(std::complex<float>* _from, std::complex<float>* _dest, float _fs
{ {
//=== Digitizing ======================================================= //=== Digitizing =======================================================
//--- compute index array to read sampled values ------------------------- //--- compute index array to read sampled values -------------------------
_codeValueIndex = ceil((_t_out * ((float)i + 1)) / _t_in) - 1; //_codeValueIndex = ceil((_t_out * ((float)i + 1)) / _t_in) - 1;
aux = (_t_out * (i + 1)) / _t_in;
_codeValueIndex = auxCeil2(aux) - 1;
//if repeat the chip -> upsample by nearest neighborhood interpolation //if repeat the chip -> upsample by nearest neighborhood interpolation
_dest[i] = _from[_codeValueIndex]; _dest[i] = _from[_codeValueIndex];
} }

View File

@ -34,19 +34,24 @@
#include <stdlib.h> #include <stdlib.h>
#include <cmath> #include <cmath>
auto auxCeil = [](float x){ return static_cast<int>(static_cast<long>((x)+1)); };
void gps_l1_ca_code_gen_complex(std::complex<float>* _dest, signed int _prn, unsigned int _chip_shift) void gps_l1_ca_code_gen_complex(std::complex<float>* _dest, signed int _prn, unsigned int _chip_shift)
{ {
unsigned int G1[1023];
unsigned int G2[1023];
unsigned int G1_register[10], G2_register[10]; const unsigned int _code_length = 1023;
unsigned int feedback1, feedback2; bool G1[_code_length];
bool G2[_code_length];
bool G1_register[10], G2_register[10];
bool feedback1, feedback2;
bool aux;
unsigned int lcv, lcv2; unsigned int lcv, lcv2;
unsigned int delay; unsigned int delay;
signed int prn_idx; signed int prn_idx;
/* G2 Delays as defined in GPS-ISD-200D */ /* G2 Delays as defined in GPS-ISD-200D */
signed int delays[51] = {5 /*PRN1*/, 6, 7, 8, 17, 18, 139, 140, 141, 251, 252, 254 ,255, 256, 257, 258, 469, 470, 471, 472, const signed int delays[51] = {5 /*PRN1*/, 6, 7, 8, 17, 18, 139, 140, 141, 251, 252, 254 ,255, 256, 257, 258, 469, 470, 471, 472,
473, 474, 509, 512, 513, 514, 515, 516, 859, 860, 861, 862 /*PRN32*/, 473, 474, 509, 512, 513, 514, 515, 516, 859, 860, 861, 862 /*PRN32*/,
145 /*PRN120*/, 175, 52, 21, 237, 235, 886, 657, 634, 762, 145 /*PRN120*/, 175, 52, 21, 237, 235, 886, 657, 634, 762,
355, 1012, 176, 603, 130, 359, 595, 68, 386 /*PRN138*/}; 355, 1012, 176, 603, 130, 359, 595, 68, 386 /*PRN138*/};
@ -59,7 +64,7 @@ void gps_l1_ca_code_gen_complex(std::complex<float>* _dest, signed int _prn, uns
} }
else else
{ {
prn_idx = _prn-1; prn_idx = _prn - 1;
} }
/* A simple error check */ /* A simple error check */
@ -73,7 +78,7 @@ void gps_l1_ca_code_gen_complex(std::complex<float>* _dest, signed int _prn, uns
} }
/* Generate G1 & G2 Register */ /* Generate G1 & G2 Register */
for(lcv = 0; lcv < 1023; lcv++) for(lcv = 0; lcv < _code_length; lcv++)
{ {
G1[lcv] = G1_register[0]; G1[lcv] = G1_register[0];
G2[lcv] = G2_register[0]; G2[lcv] = G2_register[0];
@ -92,23 +97,29 @@ void gps_l1_ca_code_gen_complex(std::complex<float>* _dest, signed int _prn, uns
} }
/* Set the delay */ /* Set the delay */
delay = 1023 - delays[prn_idx]; delay = _code_length - delays[prn_idx];
delay += _chip_shift; delay += _chip_shift;
delay %= 1023; delay %= _code_length;
/* Generate PRN from G1 and G2 Registers */ /* Generate PRN from G1 and G2 Registers */
for(lcv = 0; lcv < 1023; lcv++) for(lcv = 0; lcv < _code_length; lcv++)
{ {
_dest[lcv] = std::complex<float>(G1[(lcv + _chip_shift)%1023]^G2[delay], 0); aux = G1[(lcv + _chip_shift) % _code_length]^G2[delay];
if(_dest[lcv].real() == 0.0) //javi if(aux == true)
{ {
_dest[lcv].real(-1.0); _dest[lcv] = std::complex<float>(1, 0);
}
else
{
_dest[lcv] = std::complex<float>(-1, 0);
} }
delay++; delay++;
delay %= 1023; delay %= _code_length;
} }
} }
/* /*
* Generates complex GPS L1 C/A code for the desired SV ID and sampled to specific sampling frequency * Generates complex GPS L1 C/A code for the desired SV ID and sampled to specific sampling frequency
*/ */
@ -119,6 +130,7 @@ void gps_l1_ca_code_gen_complex_sampled(std::complex<float>* _dest, unsigned int
signed int _samplesPerCode, _codeValueIndex; signed int _samplesPerCode, _codeValueIndex;
float _ts; float _ts;
float _tc; float _tc;
float aux;
const signed int _codeFreqBasis = 1023000; //Hz const signed int _codeFreqBasis = 1023000; //Hz
const signed int _codeLength = 1023; const signed int _codeLength = 1023;
@ -139,7 +151,9 @@ void gps_l1_ca_code_gen_complex_sampled(std::complex<float>* _dest, unsigned int
// number of samples per millisecond (because one C/A code period is one // number of samples per millisecond (because one C/A code period is one
// millisecond). // millisecond).
_codeValueIndex = ceil((_ts * ((float)i + 1)) / _tc) - 1; // _codeValueIndex = ceil((_ts * ((float)i + 1)) / _tc) - 1;
aux = (_ts * (i + 1)) / _tc;
_codeValueIndex = auxCeil( aux ) - 1;
//--- Make the digitized version of the C/A code ----------------------- //--- Make the digitized version of the C/A code -----------------------
// The "upsampled" code is made by selecting values form the CA code // The "upsampled" code is made by selecting values form the CA code
@ -157,6 +171,3 @@ void gps_l1_ca_code_gen_complex_sampled(std::complex<float>* _dest, unsigned int
} }
} }

View File

@ -18,7 +18,7 @@
*/ */
#include "volk_gnsssdr/volk_gnsssdr_malloc.h" #include "volk_gnsssdr/volk_gnsssdr_malloc.h"
#include <pthread.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@ -27,29 +27,6 @@
* see: http://linux.die.net/man/3/aligned_alloc * see: http://linux.die.net/man/3/aligned_alloc
*/ */
// Disabling use of aligned_alloc. This function requires that size be
// a multiple of alignment, which is too restrictive for many uses of
// VOLK.
//// If we are using C11 standard, use the aligned_alloc
//#ifdef _ISOC11_SOURCE
//
//void *volk_gnsssdr_malloc(size_t size, size_t alignment)
//{
// void *ptr = aligned_alloc(alignment, size);
// if(ptr == NULL) {
// fprintf(stderr, "VOLK: Error allocating memory (aligned_alloc)\n");
// }
// return ptr;
//}
//
//void volk_gnsssdr_free(void *ptr)
//{
// free(ptr);
//}
//
//#else // _ISOC11_SOURCE
// Otherwise, test if we are a POSIX or X/Open system // Otherwise, test if we are a POSIX or X/Open system
// This only has a restriction that alignment be a power of 2and a // This only has a restriction that alignment be a power of 2and a
// multiple of sizeof(void *). // multiple of sizeof(void *).

View File

@ -21,19 +21,17 @@
#include <string.h> #include <string.h>
#include <volk_gnsssdr/volk_gnsssdr_prefs.h> #include <volk_gnsssdr/volk_gnsssdr_prefs.h>
//#if defined(_WIN32)
//#include <Windows.h>
//#endif
void volk_gnsssdr_get_config_path(char *path) void volk_gnsssdr_get_config_path(char *path)
{ {
if (!path) return;
const char *suffix = "/.volk_gnsssdr/volk_gnsssdr_config"; const char *suffix = "/.volk_gnsssdr/volk_gnsssdr_config";
char *home = NULL; char *home = NULL;
if (home == NULL) home = getenv("HOME"); if (home == NULL) home = getenv("HOME");
if (home == NULL) home = getenv("APPDATA"); if (home == NULL) home = getenv("APPDATA");
if (home == NULL) if (home == NULL)
{ {
path = NULL; path[0] = 0;
return; return;
} }
strcpy(path, home); strcpy(path, home);
@ -49,7 +47,7 @@ size_t volk_gnsssdr_load_preferences(volk_gnsssdr_arch_pref_t **prefs_res)
//get the config path //get the config path
volk_gnsssdr_get_config_path(path); volk_gnsssdr_get_config_path(path);
if (path == NULL) return n_arch_prefs; //no prefs found if (!path[0]) return n_arch_prefs; //no prefs found
config_file = fopen(path, "r"); config_file = fopen(path, "r");
if(!config_file) return n_arch_prefs; //no prefs found if(!config_file) return n_arch_prefs; //no prefs found

View File

@ -35,7 +35,5 @@ source_group(Headers FILES ${SIGNAL_GENERATOR_BLOCK_HEADERS})
target_link_libraries(signal_generator_blocks gnss_system_parameters target_link_libraries(signal_generator_blocks gnss_system_parameters
${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES}
${GNURADIO_FFT_LIBRARIES} ${GNURADIO_FFT_LIBRARIES}
${VOLK_LIBRARIES} ${VOLK_LIBRARIES} ${ORC_LIBRARIES}
) )

View File

@ -114,7 +114,7 @@ NsrFileSignalSource::NsrFileSignalSource(ConfigurationInterface* configuration,
{ {
/*! /*!
* BUG workaround: The GNU Radio file source does not stop the receiver after reaching the End of File. * BUG workaround: The GNU Radio file source does not stop the receiver after reaching the End of File.
* A possible solution is to compute the file length in samples using file size, excluding the last 100 milliseconds, and enable always the * A possible solution is to compute the file length in samples using file size, excluding the last 2 milliseconds, and enable always the
* valve block * valve block
*/ */
std::ifstream file (filename_.c_str(), std::ios::in | std::ios::binary | std::ios::ate); std::ifstream file (filename_.c_str(), std::ios::in | std::ios::binary | std::ios::ate);

View File

@ -65,6 +65,7 @@ OsmosdrSignalSource::OsmosdrSignalSource(ConfigurationInterface* configuration,
if_gain_ = configuration->property(role + ".if_gain", (double)40.0); if_gain_ = configuration->property(role + ".if_gain", (double)40.0);
sample_rate_ = configuration->property(role + ".sampling_frequency", (double)2.0e6); sample_rate_ = configuration->property(role + ".sampling_frequency", (double)2.0e6);
item_type_ = configuration->property(role + ".item_type", default_item_type); item_type_ = configuration->property(role + ".item_type", default_item_type);
osmosdr_args_ = configuration->property(role + ".osmosdr_args", std::string( ));
if (item_type_.compare("short") == 0) if (item_type_.compare("short") == 0)
{ {
@ -76,7 +77,12 @@ OsmosdrSignalSource::OsmosdrSignalSource(ConfigurationInterface* configuration,
// 1. Make the driver instance // 1. Make the driver instance
try try
{ {
osmosdr_source_ = osmosdr::source::make(); if (!osmosdr_args_.empty())
{
std::cout << "OsmoSdr arguments: " << osmosdr_args_ << std::endl;
LOG(INFO) << "OsmoSdr arguments: " << osmosdr_args_;
}
osmosdr_source_ = osmosdr::source::make(osmosdr_args_);
} }
catch( boost::exception & e ) catch( boost::exception & e )
{ {

View File

@ -100,6 +100,7 @@ private:
std::string dump_filename_; std::string dump_filename_;
osmosdr::source::sptr osmosdr_source_; osmosdr::source::sptr osmosdr_source_;
std::string osmosdr_args_;
boost::shared_ptr<gr::block> valve_; boost::shared_ptr<gr::block> valve_;
gr::blocks::file_sink::sptr file_sink_; gr::blocks::file_sink::sptr file_sink_;

View File

@ -326,7 +326,7 @@ int galileo_e1b_telemetry_decoder_cc::general_work (int noutput_items, gr_vector
if (abs(corr_value) >= d_symbols_per_preamble) if (abs(corr_value) >= d_symbols_per_preamble)
{ {
//check preamble separation //check preamble separation
preamble_diff = abs(d_sample_counter - d_preamble_index); preamble_diff = d_sample_counter - d_preamble_index;
if (abs(preamble_diff - GALILEO_INAV_PREAMBLE_PERIOD_SYMBOLS) == 0) if (abs(preamble_diff - GALILEO_INAV_PREAMBLE_PERIOD_SYMBOLS) == 0)
{ {
//try to decode frame //try to decode frame

View File

@ -208,7 +208,7 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items, gr_vector_i
} }
else if (d_stat == 1) //check 6 seconds of preamble separation else if (d_stat == 1) //check 6 seconds of preamble separation
{ {
preamble_diff = abs(d_sample_counter - d_preamble_index); preamble_diff = d_sample_counter - d_preamble_index;
if (abs(preamble_diff - 6000) < 1) if (abs(preamble_diff - 6000) < 1)
{ {
d_GPS_FSM.Event_gps_word_preamble(); d_GPS_FSM.Event_gps_word_preamble();

View File

@ -49,7 +49,7 @@ endif(ENABLE_GENERIC_ARCH)
file(GLOB TRACKING_GR_BLOCKS_HEADERS "*.h") file(GLOB TRACKING_GR_BLOCKS_HEADERS "*.h")
add_library(tracking_gr_blocks ${TRACKING_GR_BLOCKS_SOURCES} ${TRACKING_GR_BLOCKS_HEADERS}) add_library(tracking_gr_blocks ${TRACKING_GR_BLOCKS_SOURCES} ${TRACKING_GR_BLOCKS_HEADERS})
source_group(Headers FILES ${TRACKING_GR_BLOCKS_HEADERS}) source_group(Headers FILES ${TRACKING_GR_BLOCKS_HEADERS})
target_link_libraries(tracking_gr_blocks tracking_lib ${GNURADIO_RUNTIME_LIBRARIES} gnss_sp_libs ${Boost_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ) target_link_libraries(tracking_gr_blocks tracking_lib ${GNURADIO_RUNTIME_LIBRARIES} gnss_sp_libs ${Boost_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES} )
if(NOT VOLK_GNSSSDR_FOUND) if(NOT VOLK_GNSSSDR_FOUND)
add_dependencies(tracking_gr_blocks volk_gnsssdr_module) add_dependencies(tracking_gr_blocks volk_gnsssdr_module)
endif(NOT VOLK_GNSSSDR_FOUND) endif(NOT VOLK_GNSSSDR_FOUND)

View File

@ -41,6 +41,7 @@
#include <sstream> #include <sstream>
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
#include <gnuradio/io_signature.h> #include <gnuradio/io_signature.h>
#include <gnuradio/fxpt.h> // fixed point sine and cosine
#include <glog/logging.h> #include <glog/logging.h>
#include "gnss_synchro.h" #include "gnss_synchro.h"
#include "galileo_e1_signal_processing.h" #include "galileo_e1_signal_processing.h"
@ -259,17 +260,19 @@ void galileo_e1_dll_pll_veml_tracking_cc::update_local_code()
memcpy(d_very_late_code, &d_very_early_code[2 * very_early_late_spc_samples], d_current_prn_length_samples * sizeof(gr_complex)); memcpy(d_very_late_code, &d_very_early_code[2 * very_early_late_spc_samples], d_current_prn_length_samples * sizeof(gr_complex));
} }
void galileo_e1_dll_pll_veml_tracking_cc::update_local_carrier() void galileo_e1_dll_pll_veml_tracking_cc::update_local_carrier()
{ {
float phase_rad, phase_step_rad; float sin_f, cos_f;
// Compute the carrier phase step for the K-1 carrier doppler estimation float phase_step_rad = static_cast<float>(2 * GALILEO_PI) * d_carrier_doppler_hz / static_cast<float>(d_fs_in);
phase_step_rad = static_cast<float>(GPS_TWO_PI) * d_carrier_doppler_hz / static_cast<float>(d_fs_in); int phase_step_rad_i = gr::fxpt::float_to_fixed(phase_step_rad);
// Initialize the carrier phase with the remanent carrier phase of the K-2 loop int phase_rad_i = gr::fxpt::float_to_fixed(d_rem_carr_phase_rad);
phase_rad = d_rem_carr_phase_rad;
for(int i = 0; i < d_current_prn_length_samples; i++) for(int i = 0; i < d_current_prn_length_samples; i++)
{ {
d_carr_sign[i] = gr_complex(cos(phase_rad), -sin(phase_rad)); gr::fxpt::sincos(phase_rad_i, &sin_f, &cos_f);
phase_rad += phase_step_rad; d_carr_sign[i] = std::complex<float>(cos_f, -sin_f);
phase_rad_i += phase_step_rad_i;
} }
} }

View File

@ -40,6 +40,7 @@
#include <sstream> #include <sstream>
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
#include <gnuradio/io_signature.h> #include <gnuradio/io_signature.h>
#include <gnuradio/fxpt.h> // fixed point sine and cosine
#include <glog/logging.h> #include <glog/logging.h>
#include "gnss_synchro.h" #include "gnss_synchro.h"
#include "galileo_e5_signal_processing.h" #include "galileo_e5_signal_processing.h"
@ -364,19 +365,23 @@ void Galileo_E5a_Dll_Pll_Tracking_cc::update_local_code()
} }
void Galileo_E5a_Dll_Pll_Tracking_cc::update_local_carrier() void Galileo_E5a_Dll_Pll_Tracking_cc::update_local_carrier()
{ {
float phase_rad, phase_step_rad; float sin_f, cos_f;
float phase_step_rad = static_cast<float>(2 * GALILEO_PI) * d_carrier_doppler_hz / static_cast<float>(d_fs_in);
int phase_step_rad_i = gr::fxpt::float_to_fixed(phase_step_rad);
int phase_rad_i = gr::fxpt::float_to_fixed(d_rem_carr_phase_rad);
phase_step_rad = 2 * static_cast<float>(GALILEO_PI) * d_carrier_doppler_hz / static_cast<float>(d_fs_in);
phase_rad = d_rem_carr_phase_rad;
for(int i = 0; i < d_current_prn_length_samples; i++) for(int i = 0; i < d_current_prn_length_samples; i++)
{ {
d_carr_sign[i] = gr_complex(cos(phase_rad), -sin(phase_rad)); gr::fxpt::sincos(phase_rad_i, &sin_f, &cos_f);
phase_rad += phase_step_rad; d_carr_sign[i] = std::complex<float>(cos_f, -sin_f);
phase_rad_i += phase_step_rad_i;
} }
} }
int Galileo_E5a_Dll_Pll_Tracking_cc::general_work (int noutput_items, gr_vector_int &ninput_items, int Galileo_E5a_Dll_Pll_Tracking_cc::general_work (int noutput_items, gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
{ {

View File

@ -41,6 +41,7 @@
#include <sstream> #include <sstream>
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
#include <gnuradio/io_signature.h> #include <gnuradio/io_signature.h>
#include <gnuradio/fxpt.h> // fixed point sine and cosine
#include <glog/logging.h> #include <glog/logging.h>
#include "gnss_synchro.h" #include "gnss_synchro.h"
#include "gps_sdr_signal_processing.h" #include "gps_sdr_signal_processing.h"
@ -182,7 +183,7 @@ void Gps_L1_Ca_Dll_Pll_Tracking_cc::start_tracking()
long int acq_trk_diff_samples; long int acq_trk_diff_samples;
float acq_trk_diff_seconds; float acq_trk_diff_seconds;
acq_trk_diff_samples = static_cast<long int>(d_sample_counter) - static_cast<long int>(d_acq_sample_stamp);//-d_vector_length; acq_trk_diff_samples = static_cast<long int>(d_sample_counter) - static_cast<long int>(d_acq_sample_stamp);//-d_vector_length;
LOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples; DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples;
acq_trk_diff_seconds = static_cast<float>(acq_trk_diff_samples) / static_cast<float>(d_fs_in); acq_trk_diff_seconds = static_cast<float>(acq_trk_diff_samples) / static_cast<float>(d_fs_in);
//doppler effect //doppler effect
// Fd=(C/(C+Vr))*F // Fd=(C/(C+Vr))*F
@ -286,14 +287,16 @@ void Gps_L1_Ca_Dll_Pll_Tracking_cc::update_local_code()
void Gps_L1_Ca_Dll_Pll_Tracking_cc::update_local_carrier() void Gps_L1_Ca_Dll_Pll_Tracking_cc::update_local_carrier()
{ {
float phase_rad, phase_step_rad; float sin_f, cos_f;
float phase_step_rad = static_cast<float>(GPS_TWO_PI) * d_carrier_doppler_hz / static_cast<float>(d_fs_in);
int phase_step_rad_i = gr::fxpt::float_to_fixed(phase_step_rad);
int phase_rad_i = gr::fxpt::float_to_fixed(d_rem_carr_phase_rad);
phase_step_rad = static_cast<float>(GPS_TWO_PI) * d_carrier_doppler_hz / static_cast<float>(d_fs_in);
phase_rad = d_rem_carr_phase_rad;
for(int i = 0; i < d_current_prn_length_samples; i++) for(int i = 0; i < d_current_prn_length_samples; i++)
{ {
d_carr_sign[i] = gr_complex(cos(phase_rad), -sin(phase_rad)); gr::fxpt::sincos(phase_rad_i, &sin_f, &cos_f);
phase_rad += phase_step_rad; d_carr_sign[i] = std::complex<float>(cos_f, -sin_f);
phase_rad_i += phase_step_rad_i;
} }
//d_rem_carr_phase_rad = fmod(phase_rad, GPS_TWO_PI); //d_rem_carr_phase_rad = fmod(phase_rad, GPS_TWO_PI);
//d_acc_carrier_phase_rad = d_acc_carrier_phase_rad + d_rem_carr_phase_rad; //d_acc_carrier_phase_rad = d_acc_carrier_phase_rad + d_rem_carr_phase_rad;
@ -519,9 +522,8 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items, gr_vector_in
if (floor(d_sample_counter / d_fs_in) != d_last_seg) if (floor(d_sample_counter / d_fs_in) != d_last_seg)
{ {
d_last_seg = floor(d_sample_counter / d_fs_in); d_last_seg = floor(d_sample_counter / d_fs_in);
DLOG(INFO) << "GPS L1 C/A Tracking CH " << d_channel << ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) DLOG(INFO) << "Tracking CH " << d_channel << ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN)
<< ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]"<< std::endl; << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]";
//std::cout<<"TRK CH "<<d_channel<<" Carrier_lock_test="<<d_carrier_lock_test<< std::endl;
} }
} }
} }

View File

@ -397,7 +397,7 @@ void GNSSFlowgraph::wait()
*/ */
void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what)
{ {
LOG(INFO) << "received " << what << " from " << who; DLOG(INFO) << "received " << what << " from " << who;
switch (what) switch (what)
{ {
@ -434,13 +434,10 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what)
channels_.at(i)->start_acquisition(); channels_.at(i)->start_acquisition();
break; break;
} }
DLOG(INFO) << "Channel " << i << " in state " << channels_state_[i];
} }
} }
for (unsigned int i = 0; i < channels_count_; i++)
{
LOG(INFO) << "Channel " << i << " in state " << channels_state_[i] << std::endl;
}
break; break;
case 2: case 2:
@ -457,16 +454,16 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what)
channels_.at(who)->standby(); channels_.at(who)->standby();
} }
for (unsigned int i = 0; i < channels_count_; i++) // for (unsigned int i = 0; i < channels_count_; i++)
{ // {
LOG(INFO) << "Channel " << i << " in state " << channels_state_[i] << std::endl; // LOG(INFO) << "Channel " << i << " in state " << channels_state_[i] << std::endl;
} // }
break; break;
default: default:
break; break;
} }
LOG(INFO) << "Number of available satellites: " << available_GNSS_signals_.size(); DLOG(INFO) << "Number of available satellites: " << available_GNSS_signals_.size();
} }
@ -594,7 +591,7 @@ void GNSSFlowgraph::set_signals_list()
* Loop to create GPS L1 C/A signals * Loop to create GPS L1 C/A signals
*/ */
std::set<unsigned int> available_gps_prn = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, std::set<unsigned int> available_gps_prn = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
29, 30, 31, 32 }; 29, 30, 31, 32 };
for (available_gnss_prn_iter = available_gps_prn.begin(); for (available_gnss_prn_iter = available_gps_prn.begin();
@ -729,11 +726,8 @@ void GNSSFlowgraph::set_channels_state()
} }
else else
channels_state_.push_back(0); channels_state_.push_back(0);
DLOG(INFO) << "Channel " << i << " in state " << channels_state_[i];
} }
acq_channels_count_ = max_acq_channels_; acq_channels_count_ = max_acq_channels_;
DLOG(INFO) << acq_channels_count_ << " channels in acquisition state"; DLOG(INFO) << acq_channels_count_ << " channels in acquisition state";
for (unsigned int i = 0; i < channels_count_; i++)
{
LOG(INFO) << "Channel " << i << " in state " << channels_state_[i];
}
} }

View File

@ -1,5 +1,5 @@
/*! /*!
* \file Galileo_Navigation_Message.cc * \file galileo_navigation_message.cc
* \brief Implementation of a Galileo I/NAV Data message * \brief Implementation of a Galileo I/NAV Data message
* as described in Galileo OS SIS ICD Issue 1.1 (Sept. 2010) * as described in Galileo OS SIS ICD Issue 1.1 (Sept. 2010)
* \author Mara Branzanti 2013. mara.branzanti(at)gmail.com * \author Mara Branzanti 2013. mara.branzanti(at)gmail.com

View File

@ -29,6 +29,7 @@
*/ */
#include "galileo_utc_model.h" #include "galileo_utc_model.h"
#include <cmath>
Galileo_Utc_Model::Galileo_Utc_Model() Galileo_Utc_Model::Galileo_Utc_Model()
{ {
@ -57,7 +58,7 @@ double Galileo_Utc_Model::GST_to_UTC_time(double t_e, int WN)
{ {
//Detect if the effectivity time and user's time is within six hours = 6 * 60 *60 = 21600 s //Detect if the effectivity time and user's time is within six hours = 6 * 60 *60 = 21600 s
int secondOfLeapSecondEvent = DN_6 * 24 * 60 * 60; int secondOfLeapSecondEvent = DN_6 * 24 * 60 * 60;
if (abs(t_e - secondOfLeapSecondEvent) > 21600) if (std::abs(t_e - secondOfLeapSecondEvent) > 21600)
{ {
/* 5.1.7a GST->UTC case a /* 5.1.7a GST->UTC case a
* Whenever the leap second adjusted time indicated by the WN_LSF and the DN values * Whenever the leap second adjusted time indicated by the WN_LSF and the DN values

View File

@ -31,6 +31,7 @@
*/ */
#include "gps_navigation_message.h" #include "gps_navigation_message.h"
#include <cmath>
#include "boost/date_time/posix_time/posix_time.hpp" #include "boost/date_time/posix_time/posix_time.hpp"
@ -697,7 +698,7 @@ double Gps_Navigation_Message::utc_time(const double gpstime_corrected) const
} }
else //we are in the same week than the leap second event else //we are in the same week than the leap second event
{ {
if (abs(gpstime_corrected - secondOfLeapSecondEvent) > 21600) if (std::abs(gpstime_corrected - secondOfLeapSecondEvent) > 21600)
{ {
/* 20.3.3.5.2.4a /* 20.3.3.5.2.4a
* Whenever the effectivity time indicated by the WN_LSF and the DN values * Whenever the effectivity time indicated by the WN_LSF and the DN values

View File

@ -29,6 +29,7 @@
*/ */
#include "gps_utc_model.h" #include "gps_utc_model.h"
#include <cmath>
Gps_Utc_Model::Gps_Utc_Model() Gps_Utc_Model::Gps_Utc_Model()
{ {
@ -62,7 +63,7 @@ double Gps_Utc_Model::utc_time(double gpstime_corrected, int i_GPS_week)
} }
else //we are in the same week than the leap second event else //we are in the same week than the leap second event
{ {
if (abs(gpstime_corrected - secondOfLeapSecondEvent) > 21600) if (std::abs(gpstime_corrected - secondOfLeapSecondEvent) > 21600)
{ {
/* 20.3.3.5.2.4a /* 20.3.3.5.2.4a
* Whenever the effectivity time indicated by the WN_LSF and the DN values * Whenever the effectivity time indicated by the WN_LSF and the DN values

View File

@ -28,10 +28,11 @@
* ------------------------------------------------------------------------- * -------------------------------------------------------------------------
*/ */
#include <stdarg.h> #include <cmath>
#include <stdio.h>
#include <cstring> #include <cstring>
#include <iostream> #include <iostream>
#include <stdarg.h>
#include <stdio.h>
#include <glog/logging.h> #include <glog/logging.h>
#include "sbas_telemetry_data.h" #include "sbas_telemetry_data.h"
#include "sbas_ionospheric_correction.h" #include "sbas_ionospheric_correction.h"
@ -722,7 +723,7 @@ int Sbas_Telemetry_Data::decode_sbstype9(const sbsmsg_t *msg, nav_t *nav)
seph.af1 = getbits(msg->msg, 218, 8)*P2_39/2.0; seph.af1 = getbits(msg->msg, 218, 8)*P2_39/2.0;
i = msg->prn-MINPRNSBS; i = msg->prn-MINPRNSBS;
if (!nav->seph || fabs(nav->seph[i].t0 - seph.t0) < 1E-3) if (!nav->seph || std::abs(nav->seph[i].t0 - seph.t0) < 1E-3)
{ /* not change */ { /* not change */
VLOG(FLOW) << "<<T>> no change in ephemeris -> won't parse"; VLOG(FLOW) << "<<T>> no change in ephemeris -> won't parse";
return 0; return 0;

View File

@ -0,0 +1,183 @@
/*!
* \file code_generation_test.cc
* \brief This file implements tests for the generation of complex exponentials.
* \author Carles Fernandez-Prades, 2014. cfernandez(at)cttc.es
*
*
* -------------------------------------------------------------------------
*
* 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 <complex>
#include <ctime>
#include "gps_sdr_signal_processing.h"
#include "gnss_signal_processing.h"
TEST(CodeGenGPSL1_Test, CodeGeneration)
{
std::complex<float>* _dest = new std::complex<float>[1023];
signed int _prn = 1;
unsigned int _chip_shift = 4;
int iterations = 100000;
struct timeval tv;
gettimeofday(&tv, NULL);
long long int begin = tv.tv_sec * 1000000 + tv.tv_usec;
for(int i = 0; i < iterations; i++)
{
gps_l1_ca_code_gen_complex( _dest, _prn, _chip_shift);
}
gettimeofday(&tv, NULL);
long long int end = tv.tv_sec * 1000000 + tv.tv_usec;
ASSERT_LE(0, end - begin);
std::cout << "Generation completed in " << (end - begin) << " microseconds" << std::endl;
delete[] _dest;
/* std::complex<float>* _dest2 = new std::complex<float>[1023];gettimeofday(&tv, NULL);
long long int begin2 = tv.tv_sec * 1000000 + tv.tv_usec;
for(int i = 0; i < iterations; i++)
{
gps_l1_ca_code_gen_complex2( _dest2, _prn, _chip_shift);
}
gettimeofday(&tv, NULL);
long long int end2 = tv.tv_sec * 1000000 + tv.tv_usec;
std::cout << "Generation 2 completed in " << (end2 - begin2) << " microseconds" << std::endl;
for (int j=0; j<1023;j++)
{
if(_dest[j] != _dest2[j]) std::cout << "Error!" << std::endl;
}
delete _dest2; */
}
TEST(CodeGenGPSL1Sampled_Test, CodeGeneration)
{
signed int _prn = 1;
unsigned int _chip_shift = 4;
int _fs = 8000000;
const signed int _codeFreqBasis = 1023000; //Hz
const signed int _codeLength = 1023;
int _samplesPerCode = round(_fs / (_codeFreqBasis / _codeLength));
std::complex<float>* _dest = new std::complex<float>[_samplesPerCode];
int iterations = 10000;
struct timeval tv;
gettimeofday(&tv, NULL);
long long int begin = tv.tv_sec * 1000000 + tv.tv_usec;
for(int i = 0; i < iterations; i++)
{
gps_l1_ca_code_gen_complex_sampled( _dest, _prn, _fs, _chip_shift);
}
gettimeofday(&tv, NULL);
long long int end = tv.tv_sec * 1000000 + tv.tv_usec;
ASSERT_LE(0, end - begin);
std::cout << "Generation completed in " << (end - begin) << " microseconds" << std::endl;
delete[] _dest;
/* std::complex<float>* _dest2 = new std::complex<float>[_samplesPerCode];
gettimeofday(&tv, NULL);
long long int begin2 = tv.tv_sec * 1000000 + tv.tv_usec;
for(int i = 0; i < iterations; i++)
{
gps_l1_ca_code_gen_complex_sampled2( _dest2, _prn, _fs, _chip_shift);
}
gettimeofday(&tv, NULL);
long long int end2 = tv.tv_sec * 1000000 + tv.tv_usec;
std::cout << "Generation completed in " << (end2 - begin2) << " microseconds (New)" << std::endl;
for (int j=0; j<_samplesPerCode;j++)
{
if(_dest[j] != _dest2[j]) std::cout << "Error!" << std::endl;
}
delete[] _dest2; */
}
TEST(ComplexCarrier_Test, CodeGeneration)
{
//signed int _prn = 1;
//unsigned int _chip_shift = 4;
double _fs = 8000000;
double _f = 4000;
const signed int _codeFreqBasis = 1023000; //Hz
const signed int _codeLength = 1023;
int _samplesPerCode = round(_fs / (_codeFreqBasis / _codeLength));
std::complex<float>* _dest = new std::complex<float>[_samplesPerCode];
int iterations = 100000;
struct timeval tv;
gettimeofday(&tv, NULL);
long long int begin = tv.tv_sec * 1000000 + tv.tv_usec;
for(int i = 0; i < iterations; i++)
{
//gps_l1_ca_code_gen_complex_sampled( _dest, _prn, _fs, _chip_shift);
complex_exp_gen_conj( _dest, _f, _fs, _samplesPerCode);
}
gettimeofday(&tv, NULL);
long long int end = tv.tv_sec * 1000000 + tv.tv_usec;
ASSERT_LE(0, end - begin);
std::cout << "Carrier generation completed in " << (end - begin) << " microseconds" << std::endl;
/* std::complex<float>* _dest2 = new std::complex<float>[_samplesPerCode];
gettimeofday(&tv, NULL);
long long int begin2 = tv.tv_sec * 1000000 + tv.tv_usec;
for(int i = 0; i < iterations; i++)
{
complex_exp_gen_conj2( _dest2, _f, _fs, _samplesPerCode);
}
gettimeofday(&tv, NULL);
long long int end2 = tv.tv_sec * 1000000 + tv.tv_usec;
std::cout << "Carrier generation completed in " << (end2 - begin2) << " microseconds (New)" << std::endl;
for (int j=0; j<_samplesPerCode;j++)
{
if(std::abs(_dest[j] - _dest2[j]) > 0.1) std::cout << "Error!" << std::endl;
}
std::cout << _dest[10] << "and " << _dest2[10] << std::endl;
delete[] _dest2;*/
delete[] _dest;
}

View File

@ -320,8 +320,8 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::process_message()
detection_counter++; detection_counter++;
// The term -5 is here to correct the additional delay introduced by the FIR filter // The term -5 is here to correct the additional delay introduced by the FIR filter
double delay_error_chips = abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*1023.0/((double)fs_in*1e-3)); double delay_error_chips = std::abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*1023.0/((double)fs_in*1e-3));
double doppler_error_hz = abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz); double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
mse_delay += std::pow(delay_error_chips, 2); mse_delay += std::pow(delay_error_chips, 2);
mse_doppler += std::pow(doppler_error_hz, 2); mse_doppler += std::pow(doppler_error_hz, 2);

View File

@ -323,8 +323,8 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test::process_message()
detection_counter++; detection_counter++;
// The term -5 is here to correct the additional delay introduced by the FIR filter // The term -5 is here to correct the additional delay introduced by the FIR filter
double delay_error_chips = abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*1023.0/((double)fs_in*1e-3)); double delay_error_chips = std::abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*1023.0/((double)fs_in*1e-3));
double doppler_error_hz = abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz); double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
mse_delay += std::pow(delay_error_chips, 2); mse_delay += std::pow(delay_error_chips, 2);
mse_doppler += std::pow(doppler_error_hz, 2); mse_doppler += std::pow(doppler_error_hz, 2);

View File

@ -240,9 +240,9 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ValidationOfResults)
std::cout << "Delay: " << gnss_synchro.Acq_delay_samples << std::endl; std::cout << "Delay: " << gnss_synchro.Acq_delay_samples << std::endl;
std::cout << "Doppler: " << gnss_synchro.Acq_doppler_hz << std::endl; std::cout << "Doppler: " << gnss_synchro.Acq_doppler_hz << std::endl;
double delay_error_samples = abs(expected_delay_samples - gnss_synchro.Acq_delay_samples); double delay_error_samples = std::abs(expected_delay_samples - gnss_synchro.Acq_delay_samples);
float delay_error_chips = (float)(delay_error_samples * 1023 / 4000000); float delay_error_chips = (float)(delay_error_samples * 1023 / 4000000);
double doppler_error_hz = abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz); double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
EXPECT_LE(doppler_error_hz, 166) << "Doppler error exceeds the expected value: 166 Hz = 2/(3*integration period)"; EXPECT_LE(doppler_error_hz, 166) << "Doppler error exceeds the expected value: 166 Hz = 2/(3*integration period)";
EXPECT_LT(delay_error_chips, 0.175) << "Delay error exceeds the expected value: 0.175 chips"; EXPECT_LT(delay_error_chips, 0.175) << "Delay error exceeds the expected value: 0.175 chips";

View File

@ -321,8 +321,8 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::process_message()
detection_counter++; detection_counter++;
// The term -5 is here to correct the additional delay introduced by the FIR filter // The term -5 is here to correct the additional delay introduced by the FIR filter
double delay_error_chips = abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*1023.0/((double)fs_in*1e-3)); double delay_error_chips = std::abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*1023.0/((double)fs_in*1e-3));
double doppler_error_hz = abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz); double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
mse_delay += std::pow(delay_error_chips, 2); mse_delay += std::pow(delay_error_chips, 2);
mse_doppler += std::pow(doppler_error_hz, 2); mse_doppler += std::pow(doppler_error_hz, 2);

View File

@ -436,8 +436,8 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::process_message()
detection_counter++; detection_counter++;
// The term -5 is here to correct the additional delay introduced by the FIR filter // The term -5 is here to correct the additional delay introduced by the FIR filter
double delay_error_chips = abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples - 5) * 1023.0 / ((double)fs_in * 1e-3)); double delay_error_chips = std::abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples - 5) * 1023.0 / ((double)fs_in * 1e-3));
double doppler_error_hz = abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz); double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
mse_delay += std::pow(delay_error_chips, 2); mse_delay += std::pow(delay_error_chips, 2);
mse_doppler += std::pow(doppler_error_hz, 2); mse_doppler += std::pow(doppler_error_hz, 2);

View File

@ -328,8 +328,8 @@ void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::process_message()
detection_counter++; detection_counter++;
// The term -5 is here to correct the additional delay introduced by the FIR filter // The term -5 is here to correct the additional delay introduced by the FIR filter
double delay_error_chips = abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*1023.0/((double)fs_in*1e-3)); double delay_error_chips = std::abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*1023.0/((double)fs_in*1e-3));
double doppler_error_hz = abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz); double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
mse_delay += std::pow(delay_error_chips, 2); mse_delay += std::pow(delay_error_chips, 2);
mse_doppler += std::pow(doppler_error_hz, 2); mse_doppler += std::pow(doppler_error_hz, 2);

View File

@ -446,20 +446,20 @@ void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::process_message()
switch (sat) switch (sat)
{ {
case 0: case 0:
delay_error_chips = abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*10230.0/((double)fs_in*1e-3)); delay_error_chips = std::abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*10230.0/((double)fs_in*1e-3));
doppler_error_hz = abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz); doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
break; break;
case 1: case 1:
delay_error_chips = abs((double)expected_delay_chips1 - (double)(gnss_synchro.Acq_delay_samples-5)*10230.0/((double)fs_in*1e-3)); delay_error_chips = std::abs((double)expected_delay_chips1 - (double)(gnss_synchro.Acq_delay_samples-5)*10230.0/((double)fs_in*1e-3));
doppler_error_hz = abs(expected_doppler_hz1 - gnss_synchro.Acq_doppler_hz); doppler_error_hz = std::abs(expected_doppler_hz1 - gnss_synchro.Acq_doppler_hz);
break; break;
case 2: case 2:
delay_error_chips = abs((double)expected_delay_chips2 - (double)(gnss_synchro.Acq_delay_samples-5)*10230.0/((double)fs_in*1e-3)); delay_error_chips = std::abs((double)expected_delay_chips2 - (double)(gnss_synchro.Acq_delay_samples-5)*10230.0/((double)fs_in*1e-3));
doppler_error_hz = abs(expected_doppler_hz2 - gnss_synchro.Acq_doppler_hz); doppler_error_hz = std::abs(expected_doppler_hz2 - gnss_synchro.Acq_doppler_hz);
break; break;
case 3: case 3:
delay_error_chips = abs((double)expected_delay_chips3 - (double)(gnss_synchro.Acq_delay_samples-5)*10230.0/((double)fs_in*1e-3)); delay_error_chips = std::abs((double)expected_delay_chips3 - (double)(gnss_synchro.Acq_delay_samples-5)*10230.0/((double)fs_in*1e-3));
doppler_error_hz = abs(expected_doppler_hz3 - gnss_synchro.Acq_doppler_hz); doppler_error_hz = std::abs(expected_doppler_hz3 - gnss_synchro.Acq_doppler_hz);
break; break;
default: // case 3 default: // case 3
std::cout << "Error: message from unexpected acquisition channel" << std::endl; std::cout << "Error: message from unexpected acquisition channel" << std::endl;

View File

@ -318,8 +318,8 @@ void GpsL1CaPcpsAcquisitionGSoC2013Test::process_message()
detection_counter++; detection_counter++;
// The term -5 is here to correct the additional delay introduced by the FIR filter // The term -5 is here to correct the additional delay introduced by the FIR filter
double delay_error_chips = abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*1023.0/((double)fs_in*1e-3)); double delay_error_chips = std::abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*1023.0/((double)fs_in*1e-3));
double doppler_error_hz = abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz); double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
mse_delay += std::pow(delay_error_chips, 2); mse_delay += std::pow(delay_error_chips, 2);
mse_doppler += std::pow(doppler_error_hz, 2); mse_doppler += std::pow(doppler_error_hz, 2);

View File

@ -322,8 +322,8 @@ void GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test::process_message()
detection_counter++; detection_counter++;
// The term -5 is here to correct the additional delay introduced by the FIR filter // The term -5 is here to correct the additional delay introduced by the FIR filter
double delay_error_chips = abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*1023.0/((double)fs_in*1e-3)); double delay_error_chips = std::abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*1023.0/((double)fs_in*1e-3));
double doppler_error_hz = abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz); double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
mse_delay += std::pow(delay_error_chips, 2); mse_delay += std::pow(delay_error_chips, 2);
mse_doppler += std::pow(doppler_error_hz, 2); mse_doppler += std::pow(doppler_error_hz, 2);

View File

@ -317,8 +317,8 @@ void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::process_message()
detection_counter++; detection_counter++;
// The term -5 is here to correct the additional delay introduced by the FIR filter // The term -5 is here to correct the additional delay introduced by the FIR filter
double delay_error_chips = abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples- 5 )*1023.0/((double)fs_in*1e-3)); double delay_error_chips = std::abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples- 5 )*1023.0/((double)fs_in*1e-3));
double doppler_error_hz = abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz); double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
mse_delay += std::pow(delay_error_chips, 2); mse_delay += std::pow(delay_error_chips, 2);
mse_doppler += std::pow(doppler_error_hz, 2); mse_doppler += std::pow(doppler_error_hz, 2);

View File

@ -429,8 +429,8 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::process_message()
detection_counter++; detection_counter++;
// The term -5 is here to correct the additional delay introduced by the FIR filter // The term -5 is here to correct the additional delay introduced by the FIR filter
double delay_error_chips = abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples - 5) * 1023.0/ ((double)fs_in * 1e-3)); double delay_error_chips = std::abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples - 5) * 1023.0/ ((double)fs_in * 1e-3));
double doppler_error_hz = abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz); double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
mse_delay += std::pow(delay_error_chips, 2); mse_delay += std::pow(delay_error_chips, 2);
mse_doppler += std::pow(doppler_error_hz, 2); mse_doppler += std::pow(doppler_error_hz, 2);

View File

@ -319,8 +319,8 @@ void GpsL1CaPcpsTongAcquisitionGSoC2013Test::process_message()
detection_counter++; detection_counter++;
// The term -5 is here to correct the additional delay introduced by the FIR filter // The term -5 is here to correct the additional delay introduced by the FIR filter
double delay_error_chips = abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*1023.0/((double)fs_in*1e-3)); double delay_error_chips = std::abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*1023.0/((double)fs_in*1e-3));
double doppler_error_hz = abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz); double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
mse_delay += std::pow(delay_error_chips, 2); mse_delay += std::pow(delay_error_chips, 2);
mse_doppler += std::pow(doppler_error_hz, 2); mse_doppler += std::pow(doppler_error_hz, 2);

View File

@ -29,6 +29,7 @@
* ------------------------------------------------------------------------- * -------------------------------------------------------------------------
*/ */
#include <cmath>
#include <iostream> #include <iostream>
#include <queue> #include <queue>
#include <boost/thread.hpp> #include <boost/thread.hpp>

View File

@ -29,9 +29,7 @@
* ------------------------------------------------------------------------- * -------------------------------------------------------------------------
*/ */
#include <cmath>
#include <iostream> #include <iostream>
#include <queue> #include <queue>
#include <memory> #include <memory>
@ -72,6 +70,7 @@ DECLARE_string(log_dir);
#include "arithmetic/conjugate_test.cc" #include "arithmetic/conjugate_test.cc"
#include "arithmetic/magnitude_squared_test.cc" #include "arithmetic/magnitude_squared_test.cc"
#include "arithmetic/multiply_test.cc" #include "arithmetic/multiply_test.cc"
#include "arithmetic/code_generation_test.cc"
#include "configuration/file_configuration_test.cc" #include "configuration/file_configuration_test.cc"
#include "configuration/in_memory_configuration_test.cc" #include "configuration/in_memory_configuration_test.cc"
#include "control_thread/control_message_factory_test.cc" #include "control_thread/control_message_factory_test.cc"

View File

@ -74,6 +74,7 @@ if(ENABLE_OSMOSDR)
gnss_rx gnss_rx
gnss_sp_libs gnss_sp_libs
front_end_cal_lib front_end_cal_lib
${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES}
) )
install(TARGETS front-end-cal install(TARGETS front-end-cal