From 741c091e18fedc482a9a938aca8dd0bbdded83d5 Mon Sep 17 00:00:00 2001 From: Damian Miralles Date: Wed, 13 Aug 2014 14:51:25 -0400 Subject: [PATCH] Final editing of the QuickSync algorithm in the GNSS-SDR platform. Cahnges include a better layout of the code test, bugs correction and the most significant is the modifiable option in the folding factor if the user requires it. --- conf/gnss-sdr_acq_QuickSync.conf | 192 +++----- conf/gnss-sdr_acq_QuickSync_Galileo.conf | 416 ++++++++++++++++++ ...e1_pcps_quicksync_ambiguous_acquisition.cc | 39 +- ..._e1_pcps_quicksync_ambiguous_acquisition.h | 4 - .../gps_l1_ca_pcps_quicksync_acquisition.cc | 29 +- .../gps_l1_ca_pcps_quicksync_acquisition.h | 4 - .../pcps_quicksync_acquisition_cc.cc | 30 +- .../pcps_quicksync_acquisition_cc.h | 1 + ...ync_ambiguous_acquisition_gsoc2014_test.cc | 258 +++++++++-- ...cps_quicksync_acquisition_gsoc2014_test.cc | 265 +++++++++-- 10 files changed, 964 insertions(+), 274 deletions(-) create mode 100644 conf/gnss-sdr_acq_QuickSync_Galileo.conf diff --git a/conf/gnss-sdr_acq_QuickSync.conf b/conf/gnss-sdr_acq_QuickSync.conf index 8fe7f8d69..bf6d09969 100644 --- a/conf/gnss-sdr_acq_QuickSync.conf +++ b/conf/gnss-sdr_acq_QuickSync.conf @@ -1,3 +1,4 @@ +; Default configuration file ; You can define your own receiver and invoke it by doing ; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf ; @@ -17,7 +18,7 @@ SignalSource.implementation=File_Signal_Source ;#filename: path to file with the captured GNSS signal samples to be processed SignalSource.filename=/home/dmiralles2009/Downloads/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat -;SignalSource.filename=/home/dmiralles2009/Downloads/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat + ;#item_type: Type and resolution for each of the signal samples. ;#Use gr_complex for 32 bits float I/Q or short for I/Q interleaved short integer. @@ -116,20 +117,12 @@ InputFilter.number_of_bands=2 ;#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 -#used for gps InputFilter.band1_begin=0.0 ;InputFilter.band1_end=0.8 InputFilter.band1_end=0.85 InputFilter.band2_begin=0.90 InputFilter.band2_end=1.0 -#used for galileo -InputFilter.band1_begin=0.0 -;InputFilter.band1_end=0.8 -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 @@ -184,16 +177,14 @@ Resampler.sample_freq_out=4000000 ;######### CHANNELS GLOBAL CONFIG ############ ;#count: Number of available satellite channels. -Channels.count=4 +Channels.count=5 ;#in_acquisition: Number of channels simultaneously acquiring Channels.in_acquisition=1 ;######### CHANNEL 0 CONFIG ############ ;#system: GPS, GLONASS, GALILEO, SBAS or COMPASS ;#if the option is disabled by default is assigned GPS -Channel.system = Galileo -;Channel.system = GPS - +Channel0.system=GPS ;#signal: ;# "1C" GPS L1 C/A @@ -203,10 +194,10 @@ Channel.system = Galileo ;# "1M" GPS L1 M ;# "1N" GPS L1 codeless ;# "2C" GPS L2 C/A -;# "2D" GPS L2 L1(C/A)(P2-P1) semi-codeless +;# "2D" GPS L2 L1(C/A)+(P2-P1) semi-codeless ;# "2S" GPS L2 L2C (M) ;# "2L" GPS L2 L2C (L) -;# "2X" GPS L2 L2C (ML) +;# "2X" GPS L2 L2C (M+L) ;# "2P" GPS L2 P ;# "2W" GPS L2 Z-tracking and similar (AS on) ;# "2Y" GPS L2 Y @@ -214,7 +205,7 @@ Channel.system = Galileo ;# "2N" GPS L2 codeless ;# "5I" GPS L5 I ;# "5Q" GPS L5 Q -;# "5X" GPS L5 IQ +;# "5X" GPS L5 I+Q ;# "1C" GLONASS G1 C/A ;# "1P" GLONASS G1 P ;# "2C" GLONASS G2 C/A (Glonass M) @@ -222,26 +213,26 @@ Channel.system = Galileo ;# "1A" GALILEO E1 A (PRS) ;# "1B" GALILEO E1 B (I/NAV OS/CS/SoL) ;# "1C" GALILEO E1 C (no data) -;# "1X" GALILEO E1 BC -;# "1Z" GALILEO E1 ABC +;# "1X" GALILEO E1 B+C +;# "1Z" GALILEO E1 A+B+C ;# "5I" GALILEO E5a I (F/NAV OS) ;# "5Q" GALILEO E5a Q (no data) -;# "5X" GALILEO E5a IQ +;# "5X" GALILEO E5a I+Q ;# "7I" GALILEO E5b I ;# "7Q" GALILEO E5b Q -;# "7X" GALILEO E5b IQ +;# "7X" GALILEO E5b I+Q ;# "8I" GALILEO E5 I ;# "8Q" GALILEO E5 Q -;# "8X" GALILEO E5 IQ +;# "8X" GALILEO E5 I+Q ;# "6A" GALILEO E6 A ;# "6B" GALILEO E6 B ;# "6C" GALILEO E6 C -;# "6X" GALILEO E6 BC -;# "6Z" GALILEO E6 ABC +;# "6X" GALILEO E6 B+C +;# "6Z" GALILEO E6 A+B+C ;# "1C" SBAS L1 C/A ;# "5I" SBAS L5 I ;# "5Q" SBAS L5 Q -;# "5X" SBAS L5 IQ +;# "5X" SBAS L5 I+Q ;# "2I" COMPASS E2 I ;# "2Q" COMPASS E2 Q ;# "2X" COMPASS E2 IQ @@ -257,150 +248,93 @@ Channel.system = Galileo ;#satellite: Satellite PRN ID for this channel. Disable this option to random search ;######### CHANNEL 0 CONFIG ############ -;### Uncoment these lines for GPS Systems -;Channel0.system=GPS -;Channel0.signal=1C -;Channel0.satellite=11 -;Channel0.repeat_satellite=true - -;### Uncoment these lines for Galileo Systems -Channel0.system=Galileo -Channel0.signal=1B -Channel0.satellite=20 -Channel0.repeat_satellite=true - +Channel0.system=GPS +Channel0.signal=1C +Channel0.satellite=1 +Channel0.repeat_satellite=false ;######### CHANNEL 1 CONFIG ############ -;### Uncoment these lines for GPS Systems -;Channel1.system=GPS -;Channel1.signal=1C -;Channel1.satellite=1 -;Channel1.repeat_satellite=true -;### Uncoment these lines for Galileo Systems -Channel1.system=Galileo -Channel1.signal=1B -Channel1.satellite=12 -Channel1.repeat_satellite=true +Channel1.system=GPS +Channel1.signal=1C +Channel1.satellite=11 +Channel1.repeat_satellite=false ;######### CHANNEL 2 CONFIG ############ -;### Uncoment these lines for GPS Systems -;Channel2.system=GPS -;Channel2.signal=1C -;Channel2.satellite=17 -;Channel2.repeat_satellite=true -;### Uncoment these lines for Galileo Systems -Channel2.system=Galileo -Channel2.signal=1B -Channel2.satellite=11 -Channel2.repeat_satellite=true +Channel2.system=GPS +Channel2.signal=1C +Channel2.satellite=17 +Channel2.repeat_satellite=false ;######### CHANNEL 3 CONFIG ############ -;### Uncoment these lines for GPS Systems -;Channel3.system=GPS -;Channel3.signal=1C -;Channel3.satellite=20 -;Channel3.repeat_satellite=false -;### Uncoment these lines for Galileo Systems -Channel3.system=Galileo -Channel3.signal=1B -Channel3.satellite=19 -Channel3.repeat_satellite=true +Channel3.system=GPS +Channel3.signal=1C +Channel3.satellite=20 +Channel3.repeat_satellite=false + +;######### CHANNEL 4 CONFIG ############ + +Channel4.system=GPS +Channel4.signal=1C +Channel4.satellite=32 +Channel4.repeat_satellite=false ;######### ACQUISITION GLOBAL CONFIG ############ ;#dump: Enable or disable the acquisition internal data file logging [true] or [false] -Acquisition.dump=false +Acquisition.dump=true ;#filename: Log path and filename -Acquisition.dump_filename=./acq_dump.dat +;Acquisition.dump_filename=./acq_dump.dat ;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version. Acquisition.item_type=gr_complex ;#if: Signal intermediate frequency in [Hz] Acquisition.if=0 ;#sampled_ms: Signal block duration for the acquisition signal detection [ms] -;Acquisition.coherent_integration_time_ms=4 -Acquisition.repeat_satellite=true +Acquisition.coherent-integration_time_ms=4 + ;######### ACQUISITION CHANNELS CONFIG ###### -;######### ACQUISITION CONFIG PARAMETERS ############ +;######### ACQUISITION CH 0 CONFIG ############ ;#implementation: Acquisition algorithm selection for this channel: [GPS_L1_CA_PCPS_Acquisition] -;Acquisition0.implementation=GPS_L1_CA_PCPS_QuickSync_Acquisition -;Acquisition0.implementation=Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition +Acquisition0.implementation=GPS_L1_CA_PCPS_QuickSync_Acquisition ;#threshold: Acquisition threshold -;Acquisition0.threshold=0.010 +Acquisition0.threshold=0.4 ;#doppler_max: Maximum expected Doppler shift [Hz] -;Acquisition0.doppler_max=10000 +Acquisition0.doppler_max=10000 ;#doppler_max: Doppler step in the grid search [Hz] -;Acquisition0.doppler_step=250 +Acquisition0.doppler_step=250 ;#repeat_satellite: Use only jointly with the satellte PRN ID option. -;######### ACQUISITION CH 0 CONFIG ############ - -;### Uncoment these lines for GPS Systems -;Acquisition0.implementation=GPS_L1_CA_PCPS_QuickSync_Acquisition -;Acquisition0.threshold=0.010 -;Acquisition0.doppler_step=250 -;Acquisition0.doppler_max=10000 -;Acquisition0.coherent_integration_time_ms=4 - -;### Uncoment these lines for Galileo Systems -Acquisition0.implementation=Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition -Acquisition0.doppler_step=62 -Acquisition0.threshold=0.002 -Acquisition0.doppler_max=10000 -Acquisition0.coherent_integration_time_ms=16 ;######### ACQUISITION CH 1 CONFIG ############ - -;### Uncoment these lines for GPS Systems -;Acquisition1.implementation=GPS_L1_CA_PCPS_QuickSync_Acquisition -;Acquisition1.threshold=0.010 -;Acquisition1.doppler_step=250 -;Acquisition1.doppler_max=10000 -;Acquisition1.coherent_integration_time_ms=4 - -;### Uncoment these lines for Galileo Systems -Acquisition1.implementation=Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition -Acquisition1.doppler_step=62 -Acquisition1.threshold=0.002 +Acquisition1.implementation=GPS_L1_CA_PCPS_QuickSync_Acquisition +Acquisition1.threshold=0.4 Acquisition1.doppler_max=10000 -Acquisition1.coherent_integration_time_ms=16 +Acquisition1.doppler_step=250 ;######### ACQUISITION CH 2 CONFIG ############ -;### Uncoment these lines for GPS Systems -;Acquisition2.implementation=GPS_L1_CA_PCPS_QuickSync_Acquisition -;Acquisition2.threshold=0.002 -;Acquisition2.doppler_max=10000 -;Acquisition2.doppler_step=250 -;Acquisition2.coherent_integration_time_ms=4 - -;### Uncoment these lines for Galileo Systems -Acquisition2.implementation=Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition -Acquisition2.threshold=0.6 +Acquisition2.implementation=GPS_L1_CA_PCPS_QuickSync_Acquisition +Acquisition2.threshold=0.5 Acquisition2.doppler_max=10000 -Acquisition2.doppler_step=62 -Acquisition2.coherent_integration_time_ms=16 +Acquisition2.doppler_step=250 ;######### ACQUISITION CH 3 CONFIG ############ -;### Uncoment these lines for GPS Systems -;Acquisition3.implementation=GPS_L1_CA_PCPS_QuickSync_Acquisition -;Acquisition3.threshold=0.002 -;Acquisition3.doppler_max=10000 -;Acquisition3.doppler_step=250 -;Acquisition3.coherent_integration_time_ms=4 - -;### Uncoment these lines for Galileo Systems -Acquisition3.implementation=Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition -Acquisition3.threshold=0.8 +Acquisition3.implementation=GPS_L1_CA_PCPS_QuickSync_Acquisition +Acquisition3.threshold=0.5 Acquisition3.doppler_max=10000 -Acquisition3.doppler_step=62 -Acquisition3.coherent_integration_time_ms=16 +Acquisition3.doppler_step=250 +;######### ACQUISITION CH 4 CONFIG ############ +Acquisition4.implementation=GPS_L1_CA_PCPS_QuickSync_Acquisition +Acquisition4.threshold=0.6 +Acquisition4.doppler_max=10000 +Acquisition4.doppler_step=250 + ;######### TRACKING GLOBAL CONFIG ############ ;#implementation: Selected tracking algorithm: [GPS_L1_CA_DLL_PLL_Tracking] or [GPS_L1_CA_DLL_FLL_PLL_Tracking] @@ -474,4 +408,4 @@ PVT.dump_filename=./PVT ;# 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 \ No newline at end of file +OutputFilter.item_type=gr_complex diff --git a/conf/gnss-sdr_acq_QuickSync_Galileo.conf b/conf/gnss-sdr_acq_QuickSync_Galileo.conf new file mode 100644 index 000000000..256f08a38 --- /dev/null +++ b/conf/gnss-sdr_acq_QuickSync_Galileo.conf @@ -0,0 +1,416 @@ +; 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=4000000 + +;######### CONTROL_THREAD CONFIG ############ +ControlThread.wait_for_flowgraph=false + +;######### SIGNAL_SOURCE CONFIG ############ +;#implementation: Use [File_Signal_Source] or [UHD_Signal_Source] or [GN3S_Signal_Source] or [Rtlsdr_Signal_Source] +SignalSource.implementation=File_Signal_Source + +;#filename: path to file with the captured GNSS signal samples to be processed +SignalSource.filename=/home/dmiralles2009/Downloads/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat + + +;#item_type: Type and resolution for each of the signal samples. +;#Use gr_complex for 32 bits float I/Q or short for I/Q interleaved short integer. +;#If short is selected you should have to instantiate the Ishort_To_Complex data_type_adapter. + +SignalSource.item_type=short + +;#sampling_frequency: Original Signal sampling frequency in [Hz] +SignalSource.sampling_frequency=4000000 + +;#freq: RF front-end center frequency in [Hz] +SignalSource.freq=1575420000 + +;#gain: Front-end Gain in [dB] +SignalSource.gain=60 + +;#AGC_enabled: RTLSDR AGC enabled [true or false] + +SignalSource.AGC_enabled=true + +;#subdevice: UHD subdevice specification (for USRP1 use A:0 or B:0) +SignalSource.subdevice=B:0 + +;#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. Please disable it in this version. +;#implementation: Use [Ishort_To_Complex] or [Pass_Through] +DataTypeAdapter.implementation=Ishort_To_Complex +;#dump: Dump the filtered data to a file. +DataTypeAdapter.dump=false +;#dump_filename: Log path and filename. +DataTypeAdapter.dump_filename=../data/data_type_adapter.dat + +;######### 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=Fir_Filter +;InputFilter.implementation=Freq_Xlating_Fir_Filter +InputFilter.implementation=Pass_Through + +;#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 + +#used for gps +InputFilter.band1_begin=0.0 +;InputFilter.band1_end=0.8 +InputFilter.band1_end=0.85 +InputFilter.band2_begin=0.90 +InputFilter.band2_end=1.0 + +#used for galileo +InputFilter.band1_begin=0.0 +;InputFilter.band1_end=0.8 +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 + +InputFilter.sampling_frequency=4000000 +InputFilter.IF=0 + + + +;######### RESAMPLER CONFIG ############ +;## Resamples the input data. + +;#implementation: Use [Pass_Through] or [Direct_Resampler] +;#[Pass_Through] disables this block +;#[Direct_Resampler] enables a resampler that implements a nearest neigbourhood interpolation +;Resampler.implementation=Direct_Resampler +Resampler.implementation=Pass_Through + +;#dump: Dump the resamplered data to a file. +Resampler.dump=false +;#dump_filename: Log path and filename. +Resampler.dump_filename=../data/resampler.dat + +;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version. +Resampler.item_type=gr_complex + +;#sample_freq_in: the sample frequency of the input signal +Resampler.sample_freq_in=4000000 + +;#sample_freq_out: the desired sample frequency of the output signal +Resampler.sample_freq_out=4000000 + + +;######### CHANNELS GLOBAL CONFIG ############ +;#count: Number of available satellite channels. +Channels.count=4 +;#in_acquisition: Number of channels simultaneously acquiring +Channels.in_acquisition=1 + +;######### CHANNEL 0 CONFIG ############ +;#system: GPS, GLONASS, GALILEO, SBAS or COMPASS +;#if the option is disabled by default is assigned GPS +Channel.system = Galileo +;Channel.system = GPS + + +;#signal: +;# "1C" GPS L1 C/A +;# "1P" GPS L1 P +;# "1W" GPS L1 Z-tracking and similar (AS on) +;# "1Y" GPS L1 Y +;# "1M" GPS L1 M +;# "1N" GPS L1 codeless +;# "2C" GPS L2 C/A +;# "2D" GPS L2 L1(C/A)+(P2-P1) semi-codeless +;# "2S" GPS L2 L2C (M) +;# "2L" GPS L2 L2C (L) +;# "2X" GPS L2 L2C (M+L) +;# "2P" GPS L2 P +;# "2W" GPS L2 Z-tracking and similar (AS on) +;# "2Y" GPS L2 Y +;# "2M" GPS GPS L2 M +;# "2N" GPS L2 codeless +;# "5I" GPS L5 I +;# "5Q" GPS L5 Q +;# "5X" GPS L5 I+Q +;# "1C" GLONASS G1 C/A +;# "1P" GLONASS G1 P +;# "2C" GLONASS G2 C/A (Glonass M) +;# "2P" GLONASS G2 P +;# "1A" GALILEO E1 A (PRS) +;# "1B" GALILEO E1 B (I/NAV OS/CS/SoL) +;# "1C" GALILEO E1 C (no data) +;# "1X" GALILEO E1 B+C +;# "1Z" GALILEO E1 A+B+C +;# "5I" GALILEO E5a I (F/NAV OS) +;# "5Q" GALILEO E5a Q (no data) +;# "5X" GALILEO E5a I+Q +;# "7I" GALILEO E5b I +;# "7Q" GALILEO E5b Q +;# "7X" GALILEO E5b I+Q +;# "8I" GALILEO E5 I +;# "8Q" GALILEO E5 Q +;# "8X" GALILEO E5 I+Q +;# "6A" GALILEO E6 A +;# "6B" GALILEO E6 B +;# "6C" GALILEO E6 C +;# "6X" GALILEO E6 B+C +;# "6Z" GALILEO E6 A+B+C +;# "1C" SBAS L1 C/A +;# "5I" SBAS L5 I +;# "5Q" SBAS L5 Q +;# "5X" SBAS L5 I+Q +;# "2I" COMPASS E2 I +;# "2Q" COMPASS E2 Q +;# "2X" COMPASS E2 IQ +;# "7I" COMPASS E5b I +;# "7Q" COMPASS E5b Q +;# "7X" COMPASS E5b IQ +;# "6I" COMPASS E6 I +;# "6Q" COMPASS E6 Q +;# "6X" COMPASS E6 IQ +;#if the option is disabled by default is assigned "1C" GPS L1 C/A + + +;#satellite: Satellite PRN ID for this channel. Disable this option to random search + +;######### CHANNEL 0 CONFIG ############ +;### Uncoment these lines for Galileo Systems +Channel0.system=Galileo +Channel0.signal=1B +Channel0.satellite=20 +;Channel0.repeat_satellite=true + + +;######### CHANNEL 1 CONFIG ############ +;### Uncoment these lines for Galileo Systems +Channel1.system=Galileo +Channel1.signal=1B +Channel1.satellite=12 +;Channel1.repeat_satellite=true + +;######### CHANNEL 2 CONFIG ############ +;### Uncoment these lines for Galileo Systems +Channel2.system=Galileo +Channel2.signal=1B +Channel2.satellite=19 +;Channel2.repeat_satellite=true + +;######### CHANNEL 3 CONFIG ############ +;### Uncoment these lines for Galileo Systems +Channel3.system=Galileo +Channel3.signal=1B +Channel3.satellite=11 +;Channel3.repeat_satellite=true + +;######### ACQUISITION GLOBAL CONFIG ############ + +;#dump: Enable or disable the acquisition internal data file logging [true] or [false] +Acquisition.dump=true +;#filename: Log path and filename +Acquisition.dump_filename=./acq_dump.dat +;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version. +Acquisition.item_type=gr_complex +;#if: Signal intermediate frequency in [Hz] +Acquisition.if=0 +;#sampled_ms: Signal block duration for the acquisition signal detection [ms]; +Acquisition.coherent_integration_time_ms=8 +Acquisition.repeat_satellite=true +;######### ACQUISITION CHANNELS CONFIG ###### + +;######### ACQUISITION CONFIG PARAMETERS ############ + +;######### ACQUISITION CH 0 CONFIG ############ +;### Uncoment these lines for Galileo Systems +Acquisition0.implementation=Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition +Acquisition0.doppler_step=125 +Acquisition0.threshold=0.05 +Acquisition0.doppler_max=10000 +Acquisition0.repeat_satellite=true + +;######### ACQUISITION CH 1 CONFIG ############ +;### Uncoment these lines for Galileo Systems +Acquisition1.implementation=Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition +Acquisition1.doppler_step=125 +Acquisition1.threshold=0.05 +Acquisition1.doppler_max=15000 +Acquisition1.repeat_satellite=true + +;######### ACQUISITION CH 2 CONFIG ############ +;### Uncoment these lines for Galileo Systems +Acquisition2.implementation=Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition +Acquisition2.threshold=0.04 +Acquisition2.doppler_max=10000 +Acquisition2.doppler_step=125 +Acquisition2.repeat_satellite=true + +;######### ACQUISITION CH 3 CONFIG ############ +;### Uncoment these lines for Galileo Systems +Acquisition3.implementation=Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition +Acquisition3.threshold=0.04 +Acquisition3.doppler_max=15000 +Acquisition3.doppler_step=62 +Acquisition3.repeat_satellite=true + +;######### ACQUISITION CH 1 CONFIG ############ +Acquisition.cboc=false + +;######### TRACKING GLOBAL CONFIG ############ + +;#implementation: Selected tracking algorithm: [GPS_L1_CA_DLL_PLL_Tracking] or [GPS_L1_CA_DLL_FLL_PLL_Tracking] or [GPS_L1_CA_TCP_CONNECTOR_Tracking] or [Galileo_E1_DLL_PLL_VEML_Tracking] +Tracking.implementation=Galileo_E1_DLL_PLL_VEML_Tracking +;#item_type: Type and resolution for each of the signal samples. Use only [gr_complex] in this version. +Tracking.item_type=gr_complex + +;#sampling_frequency: Signal Intermediate Frequency in [Hz] +Tracking.if=0 + +;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false] +Tracking.dump=true + +;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number. +Tracking.dump_filename=../data/veml_tracking_ch_ + +;#pll_bw_hz: PLL loop filter bandwidth [Hz] +Tracking.pll_bw_hz=20.0; + +;#dll_bw_hz: DLL loop filter bandwidth [Hz] +Tracking.dll_bw_hz=2.0; + +;#fll_bw_hz: FLL loop filter bandwidth [Hz] +Tracking.fll_bw_hz=10.0; + +;#order: PLL/DLL loop filter order [2] or [3] +Tracking.order=3; + +;#early_late_space_chips: correlator early-late space [chips]. Use [0.5] for GPS and [0.15] for Galileo +Tracking.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.very_early_late_space_chips=0.6; + +;######### TELEMETRY DECODER CONFIG ############ +;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L1 C/A or [Galileo_E1B_Telemetry_Decoder] for Galileo E1B +TelemetryDecoder.implementation=Galileo_E1B_Telemetry_Decoder +TelemetryDecoder.dump=false + +;######### OBSERVABLES CONFIG ############ +;#implementation: Use [GPS_L1_CA_Observables] for GPS L1 C/A. +Observables.implementation=Galileo_E1B_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=GALILEO_E1_PVT + +;#averaging_depth: Number of PVT observations in the moving average algorithm +PVT.averaging_depth=100 + +;#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; + +;#dump: Enable or disable the PVT internal binary data file logging [true] or [false] +PVT.dump=false + +;#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 + +;######### 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 diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc index f98c857e8..9e2e384e8 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc @@ -60,7 +60,7 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui if_ = configuration_->property(role + ".ifreq", 0); dump_ = configuration_->property(role + ".dump", false); shift_resolution_ = configuration_->property(role + ".doppler_max", 15); - sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 16); + sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 8); /*--- Find number of samples per spreading code (4 ms) -----------------*/ code_length_ = round( @@ -69,12 +69,17 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui / Galileo_E1_B_CODE_LENGTH_CHIPS)); int samples_per_ms = round(code_length_ / 4.0); - vector_length_ = sampled_ms_ * samples_per_ms; - - /*Calculate the folding factor value based on the calculations*/ - folding_factor_ = (unsigned int)ceil(sqrt(log2(code_length_))); + /*Calculate the folding factor value based on the formula described in the paper. + This may be a bug, but acquisition also work by variying the folding factor at va- + lues different that the expressed in the paper. In adition, it is important to point + out that by making the folding factor smaller we were able to get QuickSync work with + Galileo. Future work should be directed to test this asumption statistically.*/ + + //folding_factor_ = (unsigned int)ceil(sqrt(log2(code_length_))); + folding_factor_ = configuration_->property(role + ".folding_factor", 2); + if (sampled_ms_ % (folding_factor_*4) != 0) { LOG(WARNING) << "QuickSync Algorithm requires a coherent_integration_time" @@ -94,7 +99,8 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui << sampled_ms_ << " ms will be used."; } - + // vector_length_ = (sampled_ms_/folding_factor_) * code_length_; + vector_length_ = sampled_ms_ * samples_per_ms; bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); if (!bit_transition_flag_) @@ -110,7 +116,7 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui default_dump_filename); code_ = new gr_complex[code_length_]; - LOG(INFO) <<"Vector Length: "<unique_id() << ")"; DLOG(INFO) << "acquisition_quicksync(" << acquisition_cc_->unique_id() @@ -263,14 +269,14 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_local_code() galileo_e1_code_gen_complex_sampled(code, gnss_synchro_->Signal, cboc, gnss_synchro_->PRN, fs_in_, 0, false); - /* - for (unsigned int i = 0; i < sampled_ms_/4; i++) + + for (unsigned int i = 0; i < (sampled_ms_/(folding_factor_*4)); i++) { memcpy(&(code_[i*code_length_]), code, sizeof(gr_complex)*code_length_); } - */ - memcpy(code_, code,sizeof(gr_complex)*code_length_); + + // memcpy(code_, code,sizeof(gr_complex)*code_length_); acquisition_cc_->set_local_code(code_); delete[] code; @@ -298,10 +304,10 @@ float GalileoE1PcpsQuickSyncAmbiguousAcquisition::calculate_threshold(float pfa) DLOG(INFO) <<"Channel "<property(role + ".doppler_max", 15); sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4); + //--- Find number of samples per spreading code ------------------------- code_length_ = round(fs_in_ / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); - vector_length_ = code_length_ * sampled_ms_; - + /*Calculate the folding factor value based on the calculations*/ - folding_factor_ = (unsigned int)ceil(sqrt(log2(code_length_))); + unsigned int temp = (unsigned int)ceil(sqrt(log2(code_length_))); + folding_factor_ = configuration_->property(role + ".folding_factor", temp); if ( sampled_ms_ % folding_factor_ != 0) { @@ -91,7 +92,7 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition( << sampled_ms_ << " ms will be used instead."; } - + vector_length_ = code_length_ * sampled_ms_; bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); if (!bit_transition_flag_) @@ -109,7 +110,7 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition( code_= new gr_complex[code_length_]; /*Object relevant information for debugging*/ LOG(INFO) <<"Implementation: "<implementation() - <<", Vector Length: "<unique_id() << ")"; DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")"; @@ -252,14 +253,14 @@ void GpsL1CaPcpsQuickSyncAcquisition::set_local_code() gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0); - /* - for (unsigned int i = 0; i < sampled_ms_; i++) + + for (unsigned int i = 0; i < (sampled_ms_/folding_factor_); i++) { memcpy(&(code_[i*code_length_]), code, sizeof(gr_complex)*code_length_); } - */ - memcpy(code_, code,sizeof(gr_complex)*code_length_); + + //memcpy(code_, code,sizeof(gr_complex)*code_length_); acquisition_cc_->set_local_code(code_); delete[] code; @@ -285,10 +286,10 @@ float GpsL1CaPcpsQuickSyncAcquisition::calculate_threshold(float pfa) frequency_bins++; } DLOG(INFO) << "Channel " << channel_<< " Pfa = " << pfa; - unsigned int ncells = code_length_*frequency_bins; + unsigned int ncells = (code_length_/folding_factor_)*frequency_bins; double exponent = 1/(double)ncells; double val = pow(1.0 - pfa, exponent); - double lambda = double(code_length_); + double lambda = double((code_length_/folding_factor_)); boost::math::exponential_distribution mydist (lambda); float threshold = (float)quantile(mydist,val); @@ -327,7 +328,3 @@ gr::basic_block_sptr GpsL1CaPcpsQuickSyncAcquisition::get_right_block() } -unsigned int GpsL1CaPcpsQuickSyncAcquisition::get_folding_factor() -{ - return folding_factor_; -} diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.h index 1d6b6e01f..f56a8f14e 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.h @@ -132,10 +132,6 @@ public: */ void reset(); - /*! - * \brief Get the folding factor value - */ - unsigned int get_folding_factor(); private: ConfigurationInterface* configuration_; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc index fc2a29d8a..5a3ad81e8 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc @@ -104,7 +104,7 @@ pcps_quicksync_acquisition_cc::pcps_quicksync_acquisition_cc( if (posix_memalign((void**)&d_magnitude_folded, 16, d_fft_size * sizeof(float)) == 0){}; d_possible_delay = new unsigned int[d_folding_factor]; - + d_corr_output_f = new float[d_folding_factor]; /*Create the d_code signal , which would store the values of the code in its original form to perform later correlation in time domain*/ @@ -147,7 +147,8 @@ pcps_quicksync_acquisition_cc::~pcps_quicksync_acquisition_cc() d_code = NULL; delete d_possible_delay; d_possible_delay = NULL; - + delete d_corr_output_f; + d_corr_output_f = NULL; if (d_dump) { d_dump_file.close(); @@ -404,7 +405,7 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items, { unsigned int detected_delay_samples_folded = 0; detected_delay_samples_folded = (indext % d_samples_per_code); - float corr_output_f[d_folding_factor]; + //float d_corr_output_f[d_folding_factor]; gr_complex complex_acumulator[100]; //gr_complex complex_acumulator[d_folding_factor]; //const int ff = d_folding_factor; @@ -442,22 +443,11 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items, } /*Obtain maximun value of correlation given the possible delay selected */ - volk_32fc_magnitude_squared_32f_a(corr_output_f, + volk_32fc_magnitude_squared_32f_a(d_corr_output_f, complex_acumulator, d_folding_factor); - volk_32f_index_max_16u_a(&indext, corr_output_f, + volk_32f_index_max_16u_a(&indext, d_corr_output_f, d_folding_factor); - /*Display correlation results for galileo satellites*/ - /*Display correlation results for gps satellites*/ - LOG_IF(INFO, (d_possible_delay[0] == 351) || (d_possible_delay[0] == 2351)) - << " Doppler: " << doppler - << ", Mag: " << d_mag - << ", Corr_value: " - << corr_output_f[0] << " " - << corr_output_f[1] << " " - << corr_output_f[2] << " " - << corr_output_f[3] << "\n"; - /*Now save the real code phase in the gnss_syncro block for use in other stages*/ d_gnss_synchro->Acq_delay_samples = (double) @@ -553,8 +543,8 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items, DLOG(INFO) << "test statistics value " << d_test_statistics; DLOG(INFO) << "test statistics threshold " << d_threshold; DLOG(INFO) << "folding factor " << d_folding_factor; - DLOG(INFO) << "possible delay"; - for (int i = 0; i < (int)d_folding_factor; i++) DLOG(INFO) << d_possible_delay[i]; + DLOG(INFO) << "possible delay correlation output"; + for (int i = 0; i < (int)d_folding_factor; i++) DLOG(INFO) << d_possible_delay[i] <<"\t\t\t"<Acq_delay_samples; DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; DLOG(INFO) << "magnitude folded " << d_mag; @@ -582,8 +572,8 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items, DLOG(INFO) << "test statistics value " << d_test_statistics; DLOG(INFO) << "test statistics threshold " << d_threshold; DLOG(INFO) << "folding factor "<Acq_delay_samples; DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; DLOG(INFO) << "magnitude folded " << d_mag; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.h index 8d14f57c8..93a06aaa4 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.h @@ -114,6 +114,7 @@ private: unsigned int d_folding_factor; // also referred in the paper as 'p' float * d_corr_acumulator; unsigned int *d_possible_delay; + float *d_corr_output_f; float * d_magnitude_folded; gr_complex *d_signal_folded; gr_complex *d_code_folded; diff --git a/src/tests/gnss_block/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc b/src/tests/gnss_block/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc index d8e43c022..f0bf4324a 100644 --- a/src/tests/gnss_block/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc +++ b/src/tests/gnss_block/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc @@ -1,7 +1,7 @@ /*! * \file galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc * \brief This class implements an acquisition test for - * GalileoE1PcpsAmbiguousAcquisition class. + * GalileoE1PcpsQuickSyncAmbiguousAcquisition class. * \author Damian Miralles, 2014. dmiralles2009@gmail.com * * @@ -53,6 +53,9 @@ #include "gnss_sdr_valve.h" #include "galileo_e1_pcps_quicksync_ambiguous_acquisition.h" +DEFINE_double(e1_value_threshold, 0.3, "Value of the threshold for the acquisition"); +DEFINE_int32(e1_value_CN0_dB_0, 44, "Value for the CN0_dB_0 in channel 0"); + using google::LogMessage; class GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test: public ::testing::Test @@ -75,6 +78,7 @@ protected: void init(); void config_1(); void config_2(); + void config_3(); void start_queue(); void wait_message(); void process_message(); @@ -117,13 +121,8 @@ protected: double Pmd; // Probability of miss detection std::ofstream pdpfafile; - - double threshold_config2; unsigned int miss_detection_counter; - unsigned int CN0_dB_0; - unsigned int CN0_dB_1; - unsigned int CN0_dB_2; - unsigned int CN0_dB_3; + bool dump_test_results; }; @@ -143,10 +142,6 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::init() miss_detection_counter = 0; Pmd = 0; - CN0_dB_1 = 0; - CN0_dB_2 = 0; - CN0_dB_3 = 0; - } void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::config_1() @@ -156,7 +151,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::config_1() std::string signal = "1C"; signal.copy(gnss_synchro.Signal, 2, 0); - integration_time_ms = 16; + integration_time_ms = 8; fs_in = 4e6; expected_delay_chips = 600; @@ -214,9 +209,10 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::config_1() config->set_property("Acquisition.max_dwells", "1"); config->set_property("Acquisition.bit_transition_flag","false"); config->set_property("Acquisition.implementation", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition"); - config->set_property("Acquisition.threshold", "10"); + config->set_property("Acquisition.threshold", "1"); config->set_property("Acquisition.doppler_max", "10000"); config->set_property("Acquisition.doppler_step", "250"); + config->set_property("Acquisition.folding_factor", "2"); config->set_property("Acquisition.dump", "true"); } @@ -227,7 +223,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::config_2() std::string signal = "1C"; signal.copy(gnss_synchro.Signal, 2, 0); - integration_time_ms = 16; + integration_time_ms = 8; fs_in = 4e6; expected_delay_chips = 600; @@ -235,10 +231,11 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::config_2() max_doppler_error_hz = 2 / (3 * integration_time_ms * 1e-3); max_delay_error_chips = 0.50; - threshold_config2 = 3.0000; - CN0_dB_0 = 50; + /*Unset this flag to eliminates data logging for the Validation of results + probabilities test*/ + dump_test_results = true; - num_of_realizations = 100; + num_of_realizations = 10000; config = std::make_shared(); @@ -252,8 +249,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::config_2() config->set_property("SignalSource.system_0", "E"); config->set_property("SignalSource.PRN_0", "10"); - config->set_property("SignalSource.CN0_dB_0", - std::to_string(CN0_dB_0)); + config->set_property("SignalSource.CN0_dB_0", std::to_string(FLAGS_e1_value_CN0_dB_0)); config->set_property("SignalSource.doppler_Hz_0", std::to_string(expected_doppler_hz)); config->set_property("SignalSource.delay_chips_0", @@ -307,12 +303,104 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::config_2() config->set_property("Acquisition.max_dwells", "1"); config->set_property("Acquisition.bit_transition_flag","false"); config->set_property("Acquisition.implementation", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition"); - config->set_property("Acquisition.threshold", std::to_string(threshold_config2)); + config->set_property("Acquisition.threshold", std::to_string(FLAGS_e1_value_threshold)); config->set_property("Acquisition.doppler_max", "10000"); - config->set_property("Acquisition.doppler_step", "250"); + config->set_property("Acquisition.doppler_step", "125"); + config->set_property("Acquisition.folding_factor", "2"); config->set_property("Acquisition.dump", "false"); } + +void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::config_3() +{ + gnss_synchro.Channel_ID = 0; + gnss_synchro.System = 'E'; + std::string signal = "1C"; + signal.copy(gnss_synchro.Signal, 2, 0); + + integration_time_ms = 16; + fs_in = 4e6; + + expected_delay_chips = 600; + expected_doppler_hz = 750; + max_doppler_error_hz = 2 / (3 * integration_time_ms * 1e-3); + max_delay_error_chips = 0.50; + + num_of_realizations = 1; + + config = std::make_shared(); + + config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in)); + + config->set_property("SignalSource.fs_hz", std::to_string(fs_in)); + + config->set_property("SignalSource.item_type", "gr_complex"); + + config->set_property("SignalSource.num_satellites", "4"); + + config->set_property("SignalSource.system_0", "E"); + config->set_property("SignalSource.PRN_0", "10"); + config->set_property("SignalSource.CN0_dB_0", std::to_string(FLAGS_e1_value_CN0_dB_0)); + config->set_property("SignalSource.doppler_Hz_0", + std::to_string(expected_doppler_hz)); + config->set_property("SignalSource.delay_chips_0", + std::to_string(expected_delay_chips)); + + config->set_property("SignalSource.system_1", "E"); + config->set_property("SignalSource.PRN_1", "15"); + config->set_property("SignalSource.CN0_dB_1", "44"); + config->set_property("SignalSource.doppler_Hz_1", "1000"); + config->set_property("SignalSource.delay_chips_1", "100"); + + config->set_property("SignalSource.system_2", "E"); + config->set_property("SignalSource.PRN_2", "21"); + config->set_property("SignalSource.CN0_dB_2", "44"); + config->set_property("SignalSource.doppler_Hz_2", "2000"); + config->set_property("SignalSource.delay_chips_2", "200"); + + config->set_property("SignalSource.system_3", "E"); + config->set_property("SignalSource.PRN_3", "22"); + config->set_property("SignalSource.CN0_dB_3", "44"); + config->set_property("SignalSource.doppler_Hz_3", "3000"); + config->set_property("SignalSource.delay_chips_3", "300"); + + config->set_property("SignalSource.noise_flag", "true"); + config->set_property("SignalSource.data_flag", "true"); + config->set_property("SignalSource.BW_BB", "0.97"); + + config->set_property("InputFilter.implementation", "Fir_Filter"); + config->set_property("InputFilter.input_item_type", "gr_complex"); + config->set_property("InputFilter.output_item_type", "gr_complex"); + config->set_property("InputFilter.taps_item_type", "float"); + config->set_property("InputFilter.number_of_taps", "11"); + config->set_property("InputFilter.number_of_bands", "2"); + config->set_property("InputFilter.band1_begin", "0.0"); + config->set_property("InputFilter.band1_end", "0.97"); + config->set_property("InputFilter.band2_begin", "0.98"); + config->set_property("InputFilter.band2_end", "1.0"); + config->set_property("InputFilter.ampl1_begin", "1.0"); + config->set_property("InputFilter.ampl1_end", "1.0"); + config->set_property("InputFilter.ampl2_begin", "0.0"); + config->set_property("InputFilter.ampl2_end", "0.0"); + config->set_property("InputFilter.band1_error", "1.0"); + config->set_property("InputFilter.band2_error", "1.0"); + config->set_property("InputFilter.filter_type", "bandpass"); + config->set_property("InputFilter.grid_density", "16"); + + config->set_property("Acquisition.item_type", "gr_complex"); + config->set_property("Acquisition.if", "0"); + config->set_property("Acquisition.coherent_integration_time_ms", + std::to_string(integration_time_ms)); + config->set_property("Acquisition.max_dwells", "1"); + config->set_property("Acquisition.bit_transition_flag","false"); + config->set_property("Acquisition.implementation", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition"); + config->set_property("Acquisition.threshold", "0.2"); + config->set_property("Acquisition.doppler_max", "10000"); + config->set_property("Acquisition.doppler_step", "125"); + config->set_property("Acquisition.folding_factor", "4"); + config->set_property("Acquisition.dump", "true"); +} + void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::start_queue() { stop = false; @@ -508,7 +596,6 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul } acquisition->set_local_code(); - folding_factor = acquisition->get_folding_factor(); start_queue(); EXPECT_NO_THROW( { @@ -532,6 +619,90 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul } +TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResultsWithNoise) +{ + LOG(INFO)<<"Start validation of results with noise+interference test"; + config_3(); + + std::shared_ptr acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition", 1, 1, queue); + acquisition = std::dynamic_pointer_cast(acq_); + + ASSERT_NO_THROW( { + acquisition->set_channel(1); + }) << "Failure setting channel."<< std::endl; + + ASSERT_NO_THROW( { + acquisition->set_gnss_synchro(&gnss_synchro); + }) << "Failure setting gnss_synchro."<< std::endl; + + ASSERT_NO_THROW( { + acquisition->set_channel_queue(&channel_internal_queue); + }) << "Failure setting channel_internal_queue."<< std::endl; + + ASSERT_NO_THROW( { + acquisition->set_doppler_max(config->property("Acquisition.doppler_max", 10000)); + }) << "Failure setting doppler_max."<< std::endl; + + ASSERT_NO_THROW( { + acquisition->set_doppler_step(config->property("Acquisition.doppler_step", 125)); + }) << "Failure setting doppler_step."<< std::endl; + + ASSERT_NO_THROW( { + acquisition->set_threshold(config->property("Acquisition.threshold", 0.0)); + }) << "Failure setting threshold."<< std::endl; + + ASSERT_NO_THROW( { + acquisition->connect(top_block); + }) << "Failure connecting acquisition to the top_block." << std::endl; + + acquisition->init(); + + ASSERT_NO_THROW( { + boost::shared_ptr signal_source; + SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); + FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1, queue); + signal_source.reset(new GenSignalSource(config.get(), signal_generator, filter, "SignalSource", queue)); + signal_source->connect(top_block); + top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0); + }) << "Failure connecting the blocks of acquisition test." << std::endl; + + // i = 0 --> satellite in acquisition is visible + // i = 1 --> satellite in acquisition is not visible + for (unsigned int i = 0; i < 2; i++) + { + init(); + + if (i == 0) + { + gnss_synchro.PRN = 10; // This satellite is visible + } + else if (i == 1) + { + gnss_synchro.PRN = 20; // This satellite is not visible + } + + acquisition->set_local_code(); + start_queue(); + + EXPECT_NO_THROW( { + top_block->run(); // Start threads and wait + }) << "Failure running the top_block."<< std::endl; + + if (i == 0) + { + EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS."; + if (message == 1) + { + EXPECT_EQ((unsigned int)1, correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation."; + } + } + else if (i == 1) + { + EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL."; + } + } + LOG(INFO) << "End validation of results with noise+interference test"; +} TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResultsProbabilities) { @@ -607,32 +778,41 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul { std::cout << "Estimated probability of detection = " << Pd << std::endl; std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << std::endl; + std::cout << "Estimated probability of miss detection (satellite present) = " << Pmd << std::endl; std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + + if(dump_test_results) + { + std::stringstream filenamepd; + filenamepd.str(""); + filenamepd << "../data/test_statistics_" << gnss_synchro.System + << "_" << gnss_synchro.Signal << "_sat_" + << gnss_synchro.PRN << "CN0_dB_0_" << FLAGS_e1_value_CN0_dB_0 << "_dBHz.csv"; + + pdpfafile.open(filenamepd.str().c_str(), std::ios::app | std::ios::out); + pdpfafile << FLAGS_e1_value_threshold << "," << Pd << "," << Pfa_p << "," << Pmd << std::endl; + pdpfafile.close(); + } - std::stringstream filenamepd; - filenamepd.str(""); - filenamepd << "../data/test_statistics_" << gnss_synchro.System - <<"_" << gnss_synchro.Signal << "_sat_" - << gnss_synchro.PRN << "CN0_dB_0_" << CN0_dB_0 << "_dBHz.csv"; - pdpfafile.open(filenamepd.str().c_str(), std::ios::app | std::ios::out); - pdpfafile << threshold_config2 << "," << Pd << "," << Pfa_p << "," << Pmd << std::endl; - pdpfafile.close(); } else if (i == 1) { std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << std::endl; std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + + if(dump_test_results) + { + std::stringstream filenamepf; + filenamepf.str(""); + filenamepf << "../data/test_statistics_" << gnss_synchro.System + << "_" << gnss_synchro.Signal << "_sat_" + << gnss_synchro.PRN << "CN0_dB_0_" << FLAGS_e1_value_CN0_dB_0 << "_dBHz.csv"; - std::stringstream filenamepf; - filenamepf.str(""); - filenamepf << "../data/test_statistics_" << gnss_synchro.System - << "_" << gnss_synchro.Signal << "_sat_" - << gnss_synchro.PRN << "CN0_dB_0_" << CN0_dB_0 << "_dBHz.csv"; - - pdpfafile.open(filenamepf.str().c_str(), std::ios::app | std::ios::out); - pdpfafile << threshold_config2 << "," << Pfa_a << std::endl; - pdpfafile.close(); + pdpfafile.open(filenamepf.str().c_str(), std::ios::app | std::ios::out); + pdpfafile << FLAGS_e1_value_threshold << "," << Pfa_a << std::endl; + pdpfafile.close(); + } } } } diff --git a/src/tests/gnss_block/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc b/src/tests/gnss_block/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc index 974cb4e10..59f6ad8c0 100644 --- a/src/tests/gnss_block/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc +++ b/src/tests/gnss_block/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc @@ -49,6 +49,9 @@ #include "gnss_synchro.h" #include "gps_l1_ca_pcps_quicksync_acquisition.h" +DEFINE_double(value_threshold, 0.3, "Value of the threshold for the acquisition"); +DEFINE_int32(value_CN0_dB_0, 44, "Value for the CN0_dB_0 in channel 0"); + using google::LogMessage; class GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test: public ::testing::Test @@ -70,6 +73,7 @@ protected: void init(); void config_1(); void config_2(); + void config_3(); void start_queue(); void wait_message(); void process_message(); @@ -112,9 +116,8 @@ protected: double Pmd; std::ofstream pdpfafile; - double threshold_config2; unsigned int miss_detection_counter; - unsigned int CN0_dB_0; + bool dump_test_results; }; @@ -145,7 +148,7 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::config_1() signal.copy(gnss_synchro.Signal,2,0); integration_time_ms = 4; - fs_in = 4e6; + fs_in = 8e6; expected_delay_chips = 600; expected_doppler_hz = 750; @@ -155,7 +158,7 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::config_1() num_of_realizations = 1; config = std::make_shared(); - +Notice how config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in)); config->set_property("SignalSource.fs_hz", std::to_string(fs_in)); @@ -213,18 +216,18 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::config_2() signal.copy(gnss_synchro.Signal,2,0); integration_time_ms = 4; - fs_in = 4e6; + fs_in = 8e6; expected_delay_chips = 600; expected_doppler_hz = 750; max_doppler_error_hz = 2/(3*integration_time_ms*1e-3); max_delay_error_chips = 0.50; - - threshold_config2 = 1.7800; - CN0_dB_0 = 41; - - - num_of_realizations = 100; + + /*Unset this flag to eliminates data logging for the Validation of results + probabilities test*/ + dump_test_results = true; + + num_of_realizations = 10000; config = std::make_shared(); @@ -238,7 +241,7 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::config_2() config->set_property("SignalSource.system_0", "G"); config->set_property("SignalSource.PRN_0", "10"); - config->set_property("SignalSource.CN0_dB_0", std::to_string(CN0_dB_0)); + config->set_property("SignalSource.CN0_dB_0", std::to_string(FLAGS_value_CN0_dB_0)); config->set_property("SignalSource.doppler_Hz_0", std::to_string(expected_doppler_hz)); config->set_property("SignalSource.delay_chips_0", std::to_string(expected_delay_chips)); @@ -289,13 +292,104 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::config_2() std::to_string(integration_time_ms)); config->set_property("Acquisition.max_dwells", "1"); config->set_property("Acquisition.implementation", "GPS_L1_CA_PCPS_QuickSync_Acquisition"); - config->set_property("Acquisition.threshold", std::to_string(threshold_config2)); + config->set_property("Acquisition.threshold", std::to_string(FLAGS_value_threshold)); config->set_property("Acquisition.doppler_max", "10000"); config->set_property("Acquisition.doppler_step", "250"); config->set_property("Acquisition.bit_transition_flag", "false"); config->set_property("Acquisition.dump", "false"); } +void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::config_3() +{ + gnss_synchro.Channel_ID = 0; + gnss_synchro.System = 'G'; + std::string signal = "1C"; + signal.copy(gnss_synchro.Signal,2,0); + + integration_time_ms = 4; + fs_in = 4e6; + + expected_delay_chips = 600; + expected_doppler_hz = 750; + max_doppler_error_hz = 2/(3*integration_time_ms*1e-3); + max_delay_error_chips = 0.50; + + /*Unset this flag to eliminates data logging for the Validation of results + probabilities test*/ + dump_test_results = true; + + num_of_realizations = 1; + + config = std::make_shared(); + + config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in)); + + config->set_property("SignalSource.fs_hz", std::to_string(fs_in)); + + config->set_property("SignalSource.item_type", "gr_complex"); + + config->set_property("SignalSource.num_satellites", "4"); + + config->set_property("SignalSource.system_0", "G"); + config->set_property("SignalSource.PRN_0", "10"); + config->set_property("SignalSource.CN0_dB_0", std::to_string(FLAGS_value_CN0_dB_0)); + config->set_property("SignalSource.doppler_Hz_0", std::to_string(expected_doppler_hz)); + config->set_property("SignalSource.delay_chips_0", std::to_string(expected_delay_chips)); + + config->set_property("SignalSource.system_1", "G"); + config->set_property("SignalSource.PRN_1", "15"); + config->set_property("SignalSource.CN0_dB_1", "44"); + config->set_property("SignalSource.doppler_Hz_1", "1000"); + config->set_property("SignalSource.delay_chips_1", "100"); + + config->set_property("SignalSource.system_2", "G"); + config->set_property("SignalSource.PRN_2", "21"); + config->set_property("SignalSource.CN0_dB_2", "44"); + config->set_property("SignalSource.doppler_Hz_2", "2000"); + config->set_property("SignalSource.delay_chips_2", "200"); + + config->set_property("SignalSource.system_3", "G"); + config->set_property("SignalSource.PRN_3", "22"); + config->set_property("SignalSource.CN0_dB_3", "44"); + config->set_property("SignalSource.doppler_Hz_3", "3000"); + config->set_property("SignalSource.delay_chips_3", "300"); + + config->set_property("SignalSource.noise_flag", "true"); + config->set_property("SignalSource.data_flag", "true"); + config->set_property("SignalSource.BW_BB", "0.97"); + + config->set_property("InputFilter.implementation", "Fir_Filter"); + config->set_property("InputFilter.input_item_type", "gr_complex"); + config->set_property("InputFilter.output_item_type", "gr_complex"); + config->set_property("InputFilter.taps_item_type", "float"); + config->set_property("InputFilter.number_of_taps", "11"); + config->set_property("InputFilter.number_of_bands", "2"); + config->set_property("InputFilter.band1_begin", "0.0"); + config->set_property("InputFilter.band1_end", "0.97"); + config->set_property("InputFilter.band2_begin", "0.98"); + config->set_property("InputFilter.band2_end", "1.0"); + config->set_property("InputFilter.ampl1_begin", "1.0"); + config->set_property("InputFilter.ampl1_end", "1.0"); + config->set_property("InputFilter.ampl2_begin", "0.0"); + config->set_property("InputFilter.ampl2_end", "0.0"); + config->set_property("InputFilter.band1_error", "1.0"); + config->set_property("InputFilter.band2_error", "1.0"); + config->set_property("InputFilter.filter_type", "bandpass"); + config->set_property("InputFilter.grid_density", "16"); + + config->set_property("Acquisition.item_type", "gr_complex"); + config->set_property("Acquisition.if", "0"); + config->set_property("Acquisition.coherent_integration_time_ms", + std::to_string(integration_time_ms)); + config->set_property("Acquisition.max_dwells", "1"); + config->set_property("Acquisition.implementation", "GPS_L1_CA_PCPS_QuickSync_Acquisition"); + config->set_property("Acquisition.threshold", "1.2"); + config->set_property("Acquisition.doppler_max", "10000"); + config->set_property("Acquisition.doppler_step", "250"); + config->set_property("Acquisition.bit_transition_flag", "false"); + config->set_property("Acquisition.dump", "true"); +} + void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::start_queue() { stop = false; @@ -478,7 +572,6 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResults) } acquisition->set_local_code(); - folding_factor = acquisition->get_folding_factor(); start_queue(); EXPECT_NO_THROW( { @@ -506,6 +599,97 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResults) std::cout << "----Acquired: " << nsamples << " samples"<< std::endl; } + +TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResultsWithNoise) +{ + config_3(); + + acquisition = std::make_shared(config.get(), "Acquisition", 1, 1, queue); + + ASSERT_NO_THROW( { + acquisition->set_channel(1); + }) << "Failure setting channel."<< std::endl; + + ASSERT_NO_THROW( { + acquisition->set_gnss_synchro(&gnss_synchro); + }) << "Failure setting gnss_synchro."<< std::endl; + + ASSERT_NO_THROW( { + acquisition->set_channel_queue(&channel_internal_queue); + }) << "Failure setting channel_internal_queue."<< std::endl; + + ASSERT_NO_THROW( { + acquisition->set_doppler_max(config->property("Acquisition.doppler_max", 10000)); + }) << "Failure setting doppler_max."<< std::endl; + + ASSERT_NO_THROW( { + acquisition->set_doppler_step(config->property("Acquisition.doppler_step", 250)); + }) << "Failure setting doppler_step."<< std::endl; + + ASSERT_NO_THROW( { + acquisition->set_threshold(config->property("Acquisition.threshold", 0.0)); + }) << "Failure setting threshold."<< std::endl; + + ASSERT_NO_THROW( { + acquisition->connect(top_block); + }) << "Failure connecting acquisition to the top_block."<< std::endl; + + acquisition->init(); + + ASSERT_NO_THROW( { + boost::shared_ptr signal_source; + SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); + FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1, queue); + signal_source.reset(new GenSignalSource(config.get(), signal_generator, filter, "SignalSource", queue)); + signal_source->connect(top_block); + top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0); + }) << "Failure connecting the blocks of acquisition test." << std::endl; + + // i = 0 --> satellite in acquisition is visible + // i = 1 --> satellite in acquisition is not visible + + for (unsigned int i = 0; i < 2; i++) + { + init(); + + if (i == 0) + { + gnss_synchro.PRN = 10; // This satellite is visible + } + else if (i == 1) + { + gnss_synchro.PRN = 20; // This satellite is not visible + } + + acquisition->set_local_code(); + start_queue(); + + EXPECT_NO_THROW( { + top_block->run(); // Start threads and wait + }) << "Failure running the top_block." << std::endl; + + if (i == 0) + { + EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS."; + if (message == 1) + { + + EXPECT_EQ((unsigned int)1, correct_estimation_counter) + << "Acquisition failure. Incorrect parameters estimation."; + } + + } + else if (i == 1) + { + EXPECT_EQ(2, message) + << "Acquisition failure. Expected message: 2=ACQ FAIL."; + } + } + unsigned long int nsamples = gnss_synchro.Acq_samplestamp_samples; + std::cout << "----Acquired: " << nsamples << " samples"<< std::endl; +} + + TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResultsProbabilities) { config_2(); @@ -581,18 +765,20 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResultsProbabili std::cout << "Estimated probability of detection = " << Pd << std::endl; std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << std::endl; std::cout << "Estimated probability of miss detection (satellite present) = " << Pmd << std::endl; - std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + + if(dump_test_results) + { + std::stringstream filenamepd; + filenamepd.str(""); + filenamepd << "../data/test_statistics_" << gnss_synchro.System + << "_" << gnss_synchro.Signal << "_sat_" + << gnss_synchro.PRN << "CN0_dB_0_" << FLAGS_value_CN0_dB_0 << "_dBHz.csv"; - std::stringstream filenamepd; - filenamepd.str(""); - filenamepd << "../data/test_statistics_" << gnss_synchro.System - << "_" << gnss_synchro.Signal << "_sat_" - << gnss_synchro.PRN << "CN0_dB_0_" << CN0_dB_0 << "_dBHz.csv"; - - pdpfafile.open(filenamepd.str().c_str(), std::ios::app | std::ios::out); - pdpfafile << threshold_config2 << "," << Pd << "," << Pfa_p << "," << Pmd << std::endl; - pdpfafile.close(); + pdpfafile.open(filenamepd.str().c_str(), std::ios::app | std::ios::out); + pdpfafile << FLAGS_value_threshold << "," << Pd << "," << Pfa_p << "," << Pmd << std::endl; + pdpfafile.close(); + } } @@ -600,26 +786,19 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResultsProbabili { std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << std::endl; std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + + if(dump_test_results) + { + std::stringstream filenamepf; + filenamepf.str(""); + filenamepf << "../data/test_statistics_" << gnss_synchro.System + << "_" << gnss_synchro.Signal << "_sat_" + << gnss_synchro.PRN << "CN0_dB_0_" << FLAGS_value_CN0_dB_0 << "_dBHz.csv"; - std::stringstream filenamepf; - filenamepf.str(""); - filenamepf << "../data/test_statistics_" << gnss_synchro.System - << "_" << gnss_synchro.Signal << "_sat_" - << gnss_synchro.PRN << "CN0_dB_0_" << CN0_dB_0 << "_dBHz.csv"; - - std::cout << filenamepf.str().c_str() << std::endl; - pdpfafile.open(filenamepf.str().c_str(), std::ios::app | std::ios::out); - if (pdpfafile.is_open()) - { - std::cout << "File successfully open" << std::endl; - pdpfafile << threshold_config2 << "," << Pfa_a << std::endl; - pdpfafile.close(); - } - else - { - std::cout << "Error opening file" << std::endl; - } - + pdpfafile.open(filenamepf.str().c_str(), std::ios::app | std::ios::out); + pdpfafile << FLAGS_value_threshold << "," << Pfa_a << std::endl; + pdpfafile.close(); + } } } }