mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-12 02:10:34 +00:00
Acquisition assistance is now working!
git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@353 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
parent
e592672282
commit
cfeae47a29
6
README
6
README
@ -177,11 +177,15 @@ The default will be OSMOSDR_ROOT=/usr/local
|
||||
|
||||
$ cd gnss-sdr/build
|
||||
|
||||
- Configure and build the program:
|
||||
- Configure and build the program*:
|
||||
|
||||
$ cmake ../
|
||||
$ make
|
||||
|
||||
*By default, cmake is configured to build the release version. If you want to build the debug version, please use:
|
||||
|
||||
cmake ../ -DCMAKE_BUILD_TYPE=Debug
|
||||
|
||||
- Move the executables to the install folder
|
||||
|
||||
$ make install
|
||||
|
467
conf/gnss-sdr_acq_assistance_test.conf
Normal file
467
conf/gnss-sdr_acq_assistance_test.conf
Normal file
@ -0,0 +1,467 @@
|
||||
; 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=2045950
|
||||
|
||||
;######### CONTROL_THREAD CONFIG ############
|
||||
ControlThread.wait_for_flowgraph=false
|
||||
|
||||
;######### SUPL RRLP GPS assistance configuration #####
|
||||
GNSS-SDR.SUPL_gps_enabled=true
|
||||
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=214
|
||||
GNSS-SDR.SUPL_MNS=7
|
||||
GNSS-SDR.SUPL_LAC=861
|
||||
GNSS-SDR.SUPL_CI=40181
|
||||
|
||||
;######### SIGNAL_SOURCE CONFIG ############
|
||||
;#implementation: Use [File_Signal_Source] or [UHD_Signal_Source] or [GN3S_Signal_Source] (experimental)
|
||||
;SignalSource.implementation=UHD_Signal_Source
|
||||
SignalSource.implementation=File_Signal_Source
|
||||
|
||||
;#filename: path to file with the captured GNSS signal samples to be processed
|
||||
SignalSource.filename=/home/javier/signals/casa1_gn3s_d4.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]
|
||||
SignalSource.sampling_frequency=2045950
|
||||
|
||||
;#freq: RF front-end center frequency in [Hz]
|
||||
SignalSource.freq=1575420000
|
||||
|
||||
;#gain: Front-end Gain in [dB]
|
||||
SignalSource.gain=0
|
||||
|
||||
;#subdevice: UHD subdevice specification (for USRP1 use A:0 or B:0)
|
||||
SignalSource.subdevice=A: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
|
||||
SignalConditioner.implementation=Pass_Through
|
||||
|
||||
;######### 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=Fir_Filter
|
||||
;InputFilter.implementation=Freq_Xlating_Fir_Filter
|
||||
InputFilter.implementation=Pass_Through
|
||||
|
||||
;#dump: Dump the filtered data to a file.
|
||||
InputFilter.dump=false
|
||||
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
|
||||
|
||||
; 8183800/5 = 1 636760
|
||||
; 8183800/4 = 2 045950
|
||||
; 8183800/3 = 2 727933.33333333
|
||||
InputFilter.sampling_frequency=8183800
|
||||
InputFilter.IF=-38400
|
||||
|
||||
InputFilter.decimation_factor=5
|
||||
|
||||
;######### 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=8000000
|
||||
|
||||
;#sample_freq_out: the desired sample frequency of the output signal
|
||||
Resampler.sample_freq_out=2045950
|
||||
|
||||
|
||||
;######### 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
|
||||
Channel0.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
|
||||
Channel0.signal=1C
|
||||
|
||||
;#satellite: Satellite PRN ID for this channel. Disable this option to random search
|
||||
Channel0.satellite=15
|
||||
Channel0.repeat_satellite=false
|
||||
|
||||
;######### CHANNEL 1 CONFIG ############
|
||||
|
||||
Channel1.system=GPS
|
||||
Channel1.signal=1C
|
||||
Channel1.satellite=18
|
||||
Channel1.repeat_satellite=false
|
||||
|
||||
;######### CHANNEL 2 CONFIG ############
|
||||
|
||||
Channel2.system=GPS
|
||||
Channel2.signal=1C
|
||||
Channel2.satellite=16
|
||||
Channel2.repeat_satellite=false
|
||||
|
||||
;######### CHANNEL 3 CONFIG ############
|
||||
|
||||
Channel3.system=GPS
|
||||
Channel3.signal=1C
|
||||
Channel3.satellite=21
|
||||
Channel3.repeat_satellite=false
|
||||
|
||||
;######### CHANNEL 4 CONFIG ############
|
||||
|
||||
Channel4.system=GPS
|
||||
Channel4.signal=1C
|
||||
Channel4.satellite=3
|
||||
Channel4.repeat_satellite=false
|
||||
|
||||
;######### CHANNEL 5 CONFIG ############
|
||||
|
||||
Channel5.system=GPS
|
||||
Channel5.signal=1C
|
||||
;Channel5.satellite=21
|
||||
;Channel5.repeat_satellite=false
|
||||
|
||||
|
||||
;######### ACQUISITION GLOBAL CONFIG ############
|
||||
|
||||
;#dump: Enable or disable the acquisition internal data file logging [true] or [false]
|
||||
Acquisition.dump=false
|
||||
;#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
|
||||
|
||||
Acquisition.doppler_min=-5000;
|
||||
|
||||
;#sampled_ms: Signal block duration for the acquisition signal detection [ms]
|
||||
Acquisition.sampled_ms=1
|
||||
;#maximum dwells
|
||||
Acquisition.max_dwells=5
|
||||
|
||||
;######### ACQUISITION CHANNELS CONFIG ######
|
||||
|
||||
;######### ACQUISITION CH 0 CONFIG ############
|
||||
;#implementation: Acquisition algorithm selection for this channel: [GPS_L1_CA_PCPS_Acquisition]
|
||||
Acquisition0.implementation=GPS_L1_CA_PCPS_Assisted_Acquisition
|
||||
;#threshold: Acquisition threshold
|
||||
Acquisition0.threshold=30
|
||||
;#doppler_max: Maximum expected Doppler shift [Hz]
|
||||
Acquisition0.doppler_max=6000
|
||||
;#doppler_max: Doppler step in the grid search [Hz]
|
||||
Acquisition0.doppler_step=250
|
||||
;#repeat_satellite: Use only jointly with the satellte PRN ID option.
|
||||
|
||||
|
||||
;######### ACQUISITION CH 1 CONFIG ############
|
||||
Acquisition1.implementation=GPS_L1_CA_PCPS_Assisted_Acquisition
|
||||
Acquisition1.threshold=30
|
||||
Acquisition1.doppler_max=6000
|
||||
Acquisition1.doppler_step=250
|
||||
|
||||
|
||||
;######### ACQUISITION CH 2 CONFIG ############
|
||||
Acquisition2.implementation=GPS_L1_CA_PCPS_Assisted_Acquisition
|
||||
Acquisition2.threshold=30
|
||||
Acquisition2.doppler_max=6000
|
||||
Acquisition2.doppler_step=250
|
||||
|
||||
|
||||
;######### ACQUISITION CH 3 CONFIG ############
|
||||
Acquisition3.implementation=GPS_L1_CA_PCPS_Assisted_Acquisition
|
||||
Acquisition3.threshold=30
|
||||
Acquisition3.doppler_max=6000
|
||||
Acquisition3.doppler_step=250
|
||||
|
||||
|
||||
;######### ACQUISITION CH 4 CONFIG ############
|
||||
Acquisition4.implementation=GPS_L1_CA_PCPS_Assisted_Acquisition
|
||||
Acquisition4.threshold=20
|
||||
Acquisition4.doppler_max=6000
|
||||
Acquisition4.doppler_step=250
|
||||
|
||||
|
||||
;######### ACQUISITION CH 5 CONFIG ############
|
||||
Acquisition5.implementation=GPS_L1_CA_PCPS_Assisted_Acquisition
|
||||
Acquisition5.threshold=50
|
||||
Acquisition5.doppler_max=6000
|
||||
Acquisition5.doppler_step=250
|
||||
|
||||
|
||||
;######### ACQUISITION CH 6 CONFIG ############
|
||||
Acquisition6.implementation=GPS_L1_CA_PCPS_Assisted_Acquisition
|
||||
Acquisition6.threshold=15
|
||||
Acquisition6.doppler_max=10000
|
||||
Acquisition6.doppler_step=250
|
||||
|
||||
|
||||
;######### ACQUISITION CH 7 CONFIG ############
|
||||
Acquisition7.implementation=GPS_L1_CA_PCPS_Assisted_Acquisition
|
||||
Acquisition7.threshold=15
|
||||
Acquisition7.doppler_max=10000
|
||||
Acquisition7.doppler_step=250
|
||||
|
||||
|
||||
;######### ACQUISITION CH 8 CONFIG ############
|
||||
Acquisition8.implementation=GPS_L1_CA_PCPS_Assisted_Acquisition
|
||||
Acquisition8.threshold=15
|
||||
Acquisition8.doppler_max=10000
|
||||
Acquisition8.doppler_step=250
|
||||
|
||||
|
||||
|
||||
;######### TRACKING GLOBAL CONFIG ############
|
||||
|
||||
;#implementation: Selected tracking algorithm: [GPS_L1_CA_DLL_PLL_Tracking] or [GPS_L1_CA_DLL_FLL_PLL_Tracking]
|
||||
;Tracking.implementation=GPS_L1_CA_DLL_PLL_Optim_Tracking
|
||||
Tracking.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.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=false
|
||||
|
||||
;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number.
|
||||
Tracking.dump_filename=./tracking_ch_
|
||||
|
||||
;#pll_bw_hz: PLL loop filter bandwidth [Hz]
|
||||
Tracking.pll_bw_hz=50.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]
|
||||
Tracking.early_late_space_chips=0.5;
|
||||
|
||||
;######### TELEMETRY DECODER CONFIG ############
|
||||
;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L1 C/A.
|
||||
TelemetryDecoder.implementation=GPS_L1_CA_Telemetry_Decoder
|
||||
TelemetryDecoder.dump=false
|
||||
|
||||
;######### 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=true;
|
||||
|
||||
;#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=false
|
||||
|
||||
;######### 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
|
@ -62,7 +62,8 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition(
|
||||
fs_in_ = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
if_ = configuration->property(role + ".ifreq", 0);
|
||||
dump_ = configuration->property(role + ".dump", false);
|
||||
shift_resolution_ = configuration->property(role + ".doppler_max", 15);
|
||||
doppler_max_ = configuration->property(role + ".doppler_max", 5000);
|
||||
doppler_min_ = configuration->property(role + ".doppler_min", -5000);
|
||||
sampled_ms_ = configuration->property(role + ".sampled_ms", 1);
|
||||
max_dwells_= configuration->property(role + ".max_dwells", 1);
|
||||
dump_filename_ = configuration->property(role + ".dump_filename",
|
||||
@ -78,7 +79,7 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition(
|
||||
{
|
||||
item_size_ = sizeof(gr_complex);
|
||||
acquisition_cc_ = pcps_make_assisted_acquisition_cc(max_dwells_,sampled_ms_,
|
||||
shift_resolution_, if_, fs_in_, vector_length_, queue_,
|
||||
doppler_max_, doppler_min_, if_, fs_in_, vector_length_, queue_,
|
||||
dump_, dump_filename_);
|
||||
|
||||
}
|
||||
|
@ -133,9 +133,9 @@ private:
|
||||
//unsigned int satellite_;
|
||||
unsigned int channel_;
|
||||
float threshold_;
|
||||
unsigned int doppler_max_;
|
||||
int doppler_max_;
|
||||
unsigned int doppler_step_;
|
||||
unsigned int shift_resolution_;
|
||||
int doppler_min_;
|
||||
unsigned int sampled_ms_;
|
||||
int max_dwells_;
|
||||
long fs_in_;
|
||||
|
@ -34,4 +34,5 @@ include_directories(
|
||||
)
|
||||
|
||||
add_library(acq_gr_blocks ${ACQ_GR_BLOCKS_SOURCES})
|
||||
target_link_libraries(acq_gr_blocks ${GR_FFT_LIBRARIES} ${VOLK_LIBRARIES})
|
||||
target_link_libraries(acq_gr_blocks gnss_system_parameters ${GR_FFT_LIBRARIES} ${VOLK_LIBRARIES})
|
||||
|
||||
|
@ -1,9 +1,8 @@
|
||||
/*!
|
||||
* \file pcps_acquisition_cc.cc
|
||||
* \brief This class implements a Parallel Code Phase Search Acquisition
|
||||
* \file pcps_assisted_acquisition_cc.cc
|
||||
* \brief This class implements a Parallel Code Phase Search Acquisition with assistance and multi-dwells
|
||||
* \authors <ul>
|
||||
* <li> Javier Arribas, 2011. jarribas(at)cttc.es
|
||||
* <li> Luis Esteve, 2012. luis(at)epsilon-formacion.com
|
||||
* <li> Javier Arribas, 2013. jarribas(at)cttc.es
|
||||
* </ul>
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
@ -34,77 +33,95 @@
|
||||
#include "pcps_assisted_acquisition_cc.h"
|
||||
#include "gnss_signal_processing.h"
|
||||
#include "control_message_factory.h"
|
||||
#include "gps_acq_assist.h"
|
||||
#include <gnuradio/gr_io_signature.h>
|
||||
#include <sstream>
|
||||
#include <glog/log_severity.h>
|
||||
#include <glog/logging.h>
|
||||
#include <volk/volk.h>
|
||||
#include "nco_lib.h"
|
||||
#include "concurrent_map.h"
|
||||
|
||||
extern concurrent_map<Gps_Acq_Assist> global_gps_acq_assist_map;
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
pcps_assisted_acquisition_cc_sptr pcps_make_assisted_acquisition_cc(
|
||||
int max_dwells, unsigned int sampled_ms, unsigned int doppler_max, long freq,
|
||||
long fs_in, int samples_per_ms, gr_msg_queue_sptr queue, bool dump,
|
||||
std::string dump_filename)
|
||||
int max_dwells, unsigned int sampled_ms, int doppler_max, int doppler_min, long freq,
|
||||
long fs_in, int samples_per_ms, gr_msg_queue_sptr queue, bool dump,
|
||||
std::string dump_filename)
|
||||
{
|
||||
|
||||
return pcps_assisted_acquisition_cc_sptr(
|
||||
new pcps_assisted_acquisition_cc(max_dwells, sampled_ms, doppler_max, freq,
|
||||
fs_in, samples_per_ms, queue, dump, dump_filename));
|
||||
return pcps_assisted_acquisition_cc_sptr(
|
||||
new pcps_assisted_acquisition_cc(max_dwells, sampled_ms, doppler_max, doppler_min, freq,
|
||||
fs_in, samples_per_ms, queue, dump, dump_filename));
|
||||
}
|
||||
|
||||
|
||||
|
||||
pcps_assisted_acquisition_cc::pcps_assisted_acquisition_cc(
|
||||
int max_dwells, unsigned int sampled_ms, unsigned int doppler_max, long freq,
|
||||
long fs_in, int samples_per_ms, gr_msg_queue_sptr queue, bool dump,
|
||||
std::string dump_filename) :
|
||||
gr_block("pcps_assisted_acquisition_cc",
|
||||
gr_make_io_signature(1, 1, sizeof(gr_complex)),
|
||||
gr_make_io_signature(0, 0, sizeof(gr_complex)))
|
||||
int max_dwells, unsigned int sampled_ms, int doppler_max, int doppler_min, long freq,
|
||||
long fs_in, int samples_per_ms, gr_msg_queue_sptr queue, bool dump,
|
||||
std::string dump_filename) :
|
||||
gr_block("pcps_assisted_acquisition_cc",
|
||||
gr_make_io_signature(1, 1, sizeof(gr_complex)),
|
||||
gr_make_io_signature(0, 0, sizeof(gr_complex)))
|
||||
{
|
||||
d_sample_counter = 0; // SAMPLE COUNTER
|
||||
d_active = false;
|
||||
d_queue = queue;
|
||||
d_freq = freq;
|
||||
d_fs_in = fs_in;
|
||||
d_samples_per_ms = samples_per_ms;
|
||||
d_sampled_ms = sampled_ms;
|
||||
d_doppler_max = doppler_max;
|
||||
d_fft_size = d_sampled_ms * d_samples_per_ms;
|
||||
// HS Acquisition
|
||||
d_max_dwells= max_dwells;
|
||||
d_gnuradio_forecast_samples=d_fft_size*d_max_dwells;
|
||||
d_mag = 0;
|
||||
d_input_power = 0.0;
|
||||
d_sample_counter = 0; // SAMPLE COUNTER
|
||||
d_active = false;
|
||||
d_queue = queue;
|
||||
d_freq = freq;
|
||||
d_fs_in = fs_in;
|
||||
d_samples_per_ms = samples_per_ms;
|
||||
d_sampled_ms = sampled_ms;
|
||||
d_config_doppler_max = doppler_max;
|
||||
d_config_doppler_min=doppler_min;
|
||||
d_fft_size = d_sampled_ms * d_samples_per_ms;
|
||||
// HS Acquisition
|
||||
d_max_dwells= max_dwells;
|
||||
d_gnuradio_forecast_samples=d_fft_size*4;
|
||||
d_input_power = 0.0;
|
||||
d_state=0;
|
||||
d_disable_assist=false;
|
||||
//todo: do something if posix_memalign fails
|
||||
if (posix_memalign((void**)&d_carrier, 16, d_fft_size * sizeof(gr_complex)) == 0){};
|
||||
if (posix_memalign((void**)&d_fft_codes, 16, d_fft_size * sizeof(gr_complex)) == 0){};
|
||||
|
||||
//todo: do something if posix_memalign fails
|
||||
if (posix_memalign((void**)&d_carrier, 16, d_fft_size * sizeof(gr_complex)) == 0){};
|
||||
if (posix_memalign((void**)&d_fft_codes, 16, d_fft_size * sizeof(gr_complex)) == 0){};
|
||||
// Direct FFT
|
||||
d_fft_if = new gr::fft::fft_complex(d_fft_size, true);
|
||||
|
||||
// Direct FFT
|
||||
d_fft_if = new gr::fft::fft_complex(d_fft_size, true);
|
||||
// Inverse FFT
|
||||
d_ifft = new gr::fft::fft_complex(d_fft_size, false);
|
||||
|
||||
// Inverse FFT
|
||||
d_ifft = new gr::fft::fft_complex(d_fft_size, false);
|
||||
|
||||
// For dumping samples into a file
|
||||
d_dump = dump;
|
||||
d_dump_filename = dump_filename;
|
||||
// For dumping samples into a file
|
||||
d_dump = dump;
|
||||
d_dump_filename = dump_filename;
|
||||
}
|
||||
|
||||
void pcps_assisted_acquisition_cc::set_doppler_step(unsigned int doppler_step)
|
||||
{
|
||||
d_doppler_step = doppler_step;
|
||||
}
|
||||
|
||||
|
||||
void pcps_assisted_acquisition_cc::free_grid_memory()
|
||||
{
|
||||
for (int i=0;i<d_num_doppler_points;i++)
|
||||
{
|
||||
delete[] d_grid_data[i];
|
||||
delete[] d_grid_doppler_wipeoffs[i];
|
||||
}
|
||||
delete d_grid_data;
|
||||
}
|
||||
pcps_assisted_acquisition_cc::~pcps_assisted_acquisition_cc()
|
||||
{
|
||||
free(d_carrier);
|
||||
free(d_fft_codes);
|
||||
delete d_ifft;
|
||||
delete d_fft_if;
|
||||
if (d_dump)
|
||||
{
|
||||
d_dump_file.close();
|
||||
}
|
||||
free(d_carrier);
|
||||
free(d_fft_codes);
|
||||
delete d_ifft;
|
||||
delete d_fft_if;
|
||||
if (d_dump)
|
||||
{
|
||||
d_dump_file.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -118,194 +135,315 @@ void pcps_assisted_acquisition_cc::set_local_code(std::complex<float> * code)
|
||||
|
||||
void pcps_assisted_acquisition_cc::init()
|
||||
{
|
||||
d_gnss_synchro->Acq_delay_samples = 0.0;
|
||||
d_gnss_synchro->Acq_doppler_hz = 0.0;
|
||||
d_gnss_synchro->Acq_samplestamp_samples = 0;
|
||||
d_mag = 0.0;
|
||||
d_input_power = 0.0;
|
||||
d_gnss_synchro->Acq_delay_samples = 0.0;
|
||||
d_gnss_synchro->Acq_doppler_hz = 0.0;
|
||||
d_gnss_synchro->Acq_samplestamp_samples = 0;
|
||||
d_input_power = 0.0;
|
||||
|
||||
d_fft_if->execute(); // We need the FFT of local code
|
||||
d_state=0;
|
||||
|
||||
d_fft_if->execute(); // We need the FFT of local code
|
||||
|
||||
//Conjugate the local code
|
||||
volk_32fc_conjugate_32fc_a(d_fft_codes,d_fft_if->get_outbuf(),d_fft_size);
|
||||
|
||||
//Conjugate the local code
|
||||
for (unsigned int i = 0; i < d_fft_size; i++)
|
||||
{
|
||||
d_fft_codes[i] = std::complex<float>(conj(d_fft_if->get_outbuf()[i]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void pcps_assisted_acquisition_cc::forecast (int noutput_items,
|
||||
gr_vector_int &ninput_items_required)
|
||||
gr_vector_int &ninput_items_required)
|
||||
{
|
||||
ninput_items_required[0] = d_gnuradio_forecast_samples ; //set the required available samples in each call
|
||||
ninput_items_required[0] = d_gnuradio_forecast_samples ; //set the required available samples in each call
|
||||
}
|
||||
|
||||
|
||||
int pcps_assisted_acquisition_cc::general_work(int noutput_items,
|
||||
gr_vector_int &ninput_items, gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items)
|
||||
void pcps_assisted_acquisition_cc::get_assistance()
|
||||
{
|
||||
Gps_Acq_Assist gps_acq_assisistance;
|
||||
if (global_gps_acq_assist_map.read(this->d_gnss_synchro->PRN,gps_acq_assisistance)==true)
|
||||
{
|
||||
//TODO: use the LO tolerance here
|
||||
if (gps_acq_assisistance.dopplerUncertainty>=1000)
|
||||
{
|
||||
d_doppler_max=gps_acq_assisistance.d_Doppler0+gps_acq_assisistance.dopplerUncertainty*2;
|
||||
d_doppler_min=gps_acq_assisistance.d_Doppler0-gps_acq_assisistance.dopplerUncertainty*2;
|
||||
}else{
|
||||
d_doppler_max=gps_acq_assisistance.d_Doppler0+1000;
|
||||
d_doppler_min=gps_acq_assisistance.d_Doppler0-1000;
|
||||
}
|
||||
this->d_disable_assist=false;
|
||||
std::cout<<"Acq assist ENABLED for GPS SV "<<this->d_gnss_synchro->PRN<<" (Doppler max,Doppler min)=("
|
||||
<<d_doppler_max<<","<<d_doppler_min<<")"<<std::endl;
|
||||
}else{
|
||||
this->d_disable_assist=true;
|
||||
std::cout<<"Acq assist DISABLED for GPS SV "<<this->d_gnss_synchro->PRN<<std::endl;
|
||||
}
|
||||
}
|
||||
void pcps_assisted_acquisition_cc::reset_grid()
|
||||
{
|
||||
d_well_count=0;
|
||||
for (int i=0;i<d_num_doppler_points;i++)
|
||||
{
|
||||
for (unsigned int j=0;j<d_fft_size;j++)
|
||||
{
|
||||
d_grid_data[i][j]=0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
void pcps_assisted_acquisition_cc::redefine_grid()
|
||||
{
|
||||
if (this->d_disable_assist==true)
|
||||
{
|
||||
d_doppler_max=d_config_doppler_max;
|
||||
d_doppler_min=d_config_doppler_min;
|
||||
}
|
||||
// Create the search grid array
|
||||
d_num_doppler_points=floor(std::abs(d_doppler_max-d_doppler_min)/d_doppler_step);
|
||||
|
||||
d_grid_data=new float*[d_num_doppler_points];
|
||||
for (int i=0;i<d_num_doppler_points;i++)
|
||||
{
|
||||
d_grid_data[i]=new float[d_fft_size];
|
||||
}
|
||||
|
||||
// create the carrier Doppler wipeoff signals
|
||||
int doppler_hz;
|
||||
float phase_step_rad;
|
||||
d_grid_doppler_wipeoffs=new gr_complex*[d_num_doppler_points];
|
||||
for (int doppler_index=0;doppler_index<d_num_doppler_points;doppler_index++)
|
||||
{
|
||||
|
||||
doppler_hz=d_doppler_min+d_doppler_step*doppler_index;
|
||||
// doppler search steps
|
||||
// compute the carrier doppler wipe-off signal and store it
|
||||
phase_step_rad = (float)GPS_TWO_PI*doppler_hz / (float)d_fs_in;
|
||||
|
||||
d_grid_doppler_wipeoffs[doppler_index]=new gr_complex[d_fft_size];
|
||||
fxp_nco(d_grid_doppler_wipeoffs[doppler_index], d_fft_size,0, phase_step_rad);
|
||||
}
|
||||
}
|
||||
|
||||
double pcps_assisted_acquisition_cc::search_maximum()
|
||||
{
|
||||
float magt = 0.0;
|
||||
float fft_normalization_factor;
|
||||
int index_doppler = 0;
|
||||
unsigned int tmp_intex_t;
|
||||
unsigned int index_time = 0;
|
||||
|
||||
for (int i=0;i<d_num_doppler_points;i++)
|
||||
{
|
||||
volk_32f_index_max_16u_a(&tmp_intex_t,d_grid_data[i],d_fft_size);
|
||||
if (d_grid_data[i][tmp_intex_t] > magt)
|
||||
{
|
||||
magt = d_grid_data[i][index_time];
|
||||
index_doppler = i;
|
||||
index_time = tmp_intex_t;
|
||||
}
|
||||
}
|
||||
|
||||
// Normalize the maximum value to correct the scale factor introduced by FFTW
|
||||
fft_normalization_factor = (float)d_fft_size * (float)d_fft_size;
|
||||
magt = magt / (fft_normalization_factor * fft_normalization_factor);
|
||||
|
||||
// 5- Compute the test statistics and compare to the threshold
|
||||
d_test_statistics = 2 * d_fft_size * magt /(d_input_power*d_well_count);
|
||||
|
||||
// 4- record the maximum peak and the associated synchronization parameters
|
||||
d_gnss_synchro->Acq_delay_samples = (double)index_time;
|
||||
d_gnss_synchro->Acq_doppler_hz = (double)(index_doppler*d_doppler_step+d_doppler_min);
|
||||
d_gnss_synchro->Acq_samplestamp_samples = d_sample_counter;
|
||||
|
||||
// Record results to file if required
|
||||
if (d_dump)
|
||||
{
|
||||
std::stringstream filename;
|
||||
std::streamsize n = 2 * sizeof(float) * (d_fft_size); // complex file write
|
||||
filename.str("");
|
||||
filename << "../data/test_statistics_" << d_gnss_synchro->System
|
||||
<<"_" << d_gnss_synchro->Signal << "_sat_"
|
||||
<< d_gnss_synchro->PRN << "_doppler_" << d_gnss_synchro->Acq_doppler_hz << ".dat";
|
||||
d_dump_file.open(filename.str().c_str(), std::ios::out
|
||||
| std::ios::binary);
|
||||
d_dump_file.write((char*)d_grid_data[index_doppler], n); //write directly |abs(x)|^2 in this Doppler bin?
|
||||
d_dump_file.close();
|
||||
}
|
||||
|
||||
return d_test_statistics;
|
||||
}
|
||||
|
||||
float pcps_assisted_acquisition_cc::estimate_input_power(gr_vector_const_void_star &input_items)
|
||||
{
|
||||
const gr_complex *in = (const gr_complex *)input_items[0]; //Get the input samples pointer
|
||||
// 1- Compute the input signal power estimation
|
||||
float* p_tmp_vector;
|
||||
if (posix_memalign((void**)&p_tmp_vector, 16, d_fft_size * sizeof(float)) == 0){};
|
||||
volk_32fc_magnitude_squared_32f_u(p_tmp_vector, in, d_fft_size);
|
||||
|
||||
const float* p_const_tmp_vector=p_tmp_vector;
|
||||
float power;
|
||||
volk_32f_accumulator_s32f_a(&power, p_const_tmp_vector, d_fft_size);
|
||||
free(p_tmp_vector);
|
||||
return ( power / (float)d_fft_size);
|
||||
}
|
||||
|
||||
int pcps_assisted_acquisition_cc::compute_and_accumulate_grid(gr_vector_const_void_star &input_items)
|
||||
{
|
||||
// initialize acquisition algorithm
|
||||
const gr_complex *in = (const gr_complex *)input_items[0]; //Get the input samples pointer
|
||||
|
||||
DLOG(INFO) << "Channel: " << d_channel
|
||||
<< " , doing acquisition of satellite: " << d_gnss_synchro->System << " "<< d_gnss_synchro->PRN
|
||||
<< " ,sample stamp: " << d_sample_counter << ", threshold: "
|
||||
<< d_threshold << ", doppler_max: " << d_doppler_max
|
||||
<< ", doppler_step: " << d_doppler_step;
|
||||
|
||||
// 2- Doppler frequency search loop
|
||||
float* p_tmp_vector;
|
||||
if (posix_memalign((void**)&p_tmp_vector, 16, d_fft_size * sizeof(float)) == 0){};
|
||||
|
||||
for (int doppler_index=0;doppler_index<d_num_doppler_points;doppler_index++)
|
||||
{
|
||||
// doppler search steps
|
||||
// Perform the carrier wipe-off
|
||||
volk_32fc_x2_multiply_32fc_u(d_fft_if->get_inbuf(), in, d_grid_doppler_wipeoffs[doppler_index], d_fft_size);
|
||||
// 3- Perform the FFT-based convolution (parallel time search)
|
||||
// Compute the FFT of the carrier wiped--off incoming signal
|
||||
d_fft_if->execute();
|
||||
|
||||
// Multiply carrier wiped--off, Fourier transformed incoming signal
|
||||
// with the local FFT'd code reference using SIMD operations with VOLK library
|
||||
volk_32fc_x2_multiply_32fc_a(d_ifft->get_inbuf(), d_fft_if->get_outbuf(), d_fft_codes, d_fft_size);
|
||||
|
||||
// compute the inverse FFT
|
||||
d_ifft->execute();
|
||||
|
||||
// save the grid matrix delay file
|
||||
volk_32fc_magnitude_squared_32f_a(p_tmp_vector, d_ifft->get_outbuf(), d_fft_size);
|
||||
const float* old_vector=d_grid_data[doppler_index];
|
||||
volk_32f_x2_add_32f_a(d_grid_data[doppler_index],old_vector,p_tmp_vector,d_fft_size);
|
||||
|
||||
}
|
||||
free(p_tmp_vector);
|
||||
return d_fft_size;
|
||||
}
|
||||
int pcps_assisted_acquisition_cc::general_work(int noutput_items,
|
||||
gr_vector_int &ninput_items, gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items)
|
||||
{
|
||||
/*
|
||||
* By J.Arribas and L.Esteve
|
||||
* Acquisition strategy (Kay Borre book + CFAR threshold):
|
||||
* 1. Compute the input signal power estimation
|
||||
* 2. Doppler serial search loop
|
||||
* 3. Perform the FFT-based circular convolution (parallel time search)
|
||||
* 4. Record the maximum peak and the associated synchronization parameters
|
||||
* 5. Compute the test statistics and compare to the threshold
|
||||
* 6. Declare positive or negative acquisition using a message queue
|
||||
*/
|
||||
|
||||
/*!
|
||||
* TODO: High sensitivity acquisition algorithm:
|
||||
* 0. Define search grid with assistance information. Reset grid matrix
|
||||
* 1. Perform the FFT acqusition doppler and delay grid
|
||||
* 2. accumulate the search grid matrix (#doppler_bins x #fft_size)
|
||||
* 3. compare maximum to threshold and decide positive or negative
|
||||
* 4. positive: stop. negative: if dwell_count< max_dwells -> dwell_count++ and goto 1, else -> negative acquisition: stop.
|
||||
* State Mechine:
|
||||
* S0. StandBy. If d_active==1 -> S1
|
||||
* S1. GetAssist. Define search grid with assistance information. Reset grid matrix -> S2
|
||||
* S2. ComputeGrid. Perform the FFT acqusition doppler and delay grid.
|
||||
* Accumulate the search grid matrix (#doppler_bins x #fft_size)
|
||||
* Compare maximum to threshold and decide positive or negative
|
||||
* If T>=gamma -> S4 else
|
||||
* If d_well_count<max_dwells -> S2
|
||||
* else if !disable_assist -> S3
|
||||
* else -> S5.
|
||||
* S3. RedefineGrid. Open the grid search to unasisted acquisition. Reset counters and grid. -> S2
|
||||
* S4. Positive_Acq: Send message and stop acq -> S0
|
||||
* S5. Negative_Acq: Send message and stop acq -> S0
|
||||
*/
|
||||
if (!d_active)
|
||||
{
|
||||
d_sample_counter += d_fft_size * noutput_items; // sample counter
|
||||
consume_each(noutput_items);
|
||||
}
|
||||
else
|
||||
{
|
||||
// initialize acquisition algorithm
|
||||
int doppler;
|
||||
unsigned int indext = 0;
|
||||
float magt = 0.0;
|
||||
float tmp_magt = 0.0;
|
||||
const gr_complex *in = (const gr_complex *)input_items[0]; //Get the input samples pointer
|
||||
bool positive_acquisition = false;
|
||||
int acquisition_message = -1; //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL
|
||||
//aux vars
|
||||
unsigned int i;
|
||||
float fft_normalization_factor;
|
||||
|
||||
d_sample_counter += d_fft_size; // sample counter
|
||||
switch (d_state)
|
||||
{
|
||||
case 0: // S0. StandBy
|
||||
if (d_active==true) d_state=1;
|
||||
d_sample_counter += ninput_items[0]; // sample counter
|
||||
consume_each(ninput_items[0]);
|
||||
break;
|
||||
case 1: // S1. GetAssist
|
||||
get_assistance();
|
||||
redefine_grid();
|
||||
reset_grid();
|
||||
d_sample_counter += ninput_items[0]; // sample counter
|
||||
consume_each(ninput_items[0]);
|
||||
d_state=2;
|
||||
break;
|
||||
case 2: // S2. ComputeGrid
|
||||
int consumed_samples;
|
||||
consumed_samples=compute_and_accumulate_grid(input_items);
|
||||
d_well_count++;
|
||||
if (d_well_count>=d_max_dwells)
|
||||
{
|
||||
d_state=3;
|
||||
}
|
||||
d_sample_counter+=consumed_samples;
|
||||
consume_each(consumed_samples);
|
||||
break;
|
||||
case 3: // Compute test statistics and decide
|
||||
d_input_power=estimate_input_power(input_items);
|
||||
d_test_statistics=search_maximum();
|
||||
if (d_test_statistics > d_threshold)
|
||||
{
|
||||
d_state=5;
|
||||
}else{
|
||||
if (d_disable_assist==false)
|
||||
{
|
||||
d_disable_assist=true;
|
||||
std::cout<<"Acq assist DISABLED for GPS SV "<<this->d_gnss_synchro->PRN<<std::endl;
|
||||
d_state=4;
|
||||
}else{
|
||||
d_state=6;
|
||||
}
|
||||
}
|
||||
d_sample_counter += ninput_items[0]; // sample counter
|
||||
consume_each(ninput_items[0]);
|
||||
break;
|
||||
case 4: // RedefineGrid
|
||||
free_grid_memory();
|
||||
redefine_grid();
|
||||
reset_grid();
|
||||
d_sample_counter += ninput_items[0]; // sample counter
|
||||
consume_each(ninput_items[0]);
|
||||
d_state=2;
|
||||
break;
|
||||
case 5: // Positive_Acq
|
||||
DLOG(INFO) << "positive acquisition";
|
||||
DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN;
|
||||
DLOG(INFO) << "sample_stamp " << d_sample_counter;
|
||||
DLOG(INFO) << "test statistics value " << d_test_statistics;
|
||||
DLOG(INFO) << "test statistics threshold " << d_threshold;
|
||||
DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples;
|
||||
DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz;
|
||||
DLOG(INFO) << "input signal power " << d_input_power;
|
||||
|
||||
//restart acquisition variables
|
||||
d_gnss_synchro->Acq_delay_samples = 0.0;
|
||||
d_gnss_synchro->Acq_doppler_hz = 0.0;
|
||||
d_mag = 0.0;
|
||||
d_input_power = 0.0;
|
||||
d_active = false;
|
||||
// Send message to channel queue //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL
|
||||
d_channel_internal_queue->push(1); // 1-> positive acquisition
|
||||
free_grid_memory();
|
||||
// consume samples to not block the GNU Radio flowgraph
|
||||
d_sample_counter += ninput_items[0]; // sample counter
|
||||
consume_each(ninput_items[0]);
|
||||
d_state=0;
|
||||
break;
|
||||
case 6: // Negative_Acq
|
||||
DLOG(INFO) << "negative acquisition";
|
||||
DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN;
|
||||
DLOG(INFO) << "sample_stamp " << d_sample_counter;
|
||||
DLOG(INFO) << "test statistics value " << d_test_statistics;
|
||||
DLOG(INFO) << "test statistics threshold " << d_threshold;
|
||||
DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples;
|
||||
DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz;
|
||||
DLOG(INFO) << "input signal power " << d_input_power;
|
||||
|
||||
DLOG(INFO) << "Channel: " << d_channel
|
||||
<< " , doing acquisition of satellite: " << d_gnss_synchro->System << " "<< d_gnss_synchro->PRN
|
||||
<< " ,sample stamp: " << d_sample_counter << ", threshold: "
|
||||
<< d_threshold << ", doppler_max: " << d_doppler_max
|
||||
<< ", doppler_step: " << d_doppler_step;
|
||||
d_active = false;
|
||||
// Send message to channel queue //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL
|
||||
d_channel_internal_queue->push(2); // 2-> negative acquisition
|
||||
free_grid_memory();
|
||||
// consume samples to not block the GNU Radio flowgraph
|
||||
d_sample_counter += ninput_items[0]; // sample counter
|
||||
consume_each(ninput_items[0]);
|
||||
d_state=0;
|
||||
break;
|
||||
default:
|
||||
d_state=0;
|
||||
break;
|
||||
}
|
||||
|
||||
// 1- Compute the input signal power estimation
|
||||
for (i = 0; i < d_fft_size; i++)
|
||||
{
|
||||
d_input_power += std::norm(in[i]);
|
||||
}
|
||||
d_input_power = d_input_power / (float)d_fft_size;
|
||||
|
||||
// 2- Doppler frequency search loop
|
||||
for (doppler = (int)(-d_doppler_max); doppler < (int)d_doppler_max; doppler += d_doppler_step)
|
||||
{
|
||||
// doppler search steps
|
||||
// Perform the carrier wipe-off
|
||||
complex_exp_gen_conj(d_carrier, d_freq + doppler, d_fs_in, d_fft_size);
|
||||
|
||||
volk_32fc_x2_multiply_32fc_u(d_fft_if->get_inbuf(), in, d_carrier, d_fft_size);
|
||||
// 3- Perform the FFT-based convolution (parallel time search)
|
||||
// Compute the FFT of the carrier wiped--off incoming signal
|
||||
d_fft_if->execute();
|
||||
|
||||
// Multiply carrier wiped--off, Fourier transformed incoming signal
|
||||
// with the local FFT'd code reference using SIMD operations with VOLK library
|
||||
volk_32fc_x2_multiply_32fc_a(d_ifft->get_inbuf(), d_fft_if->get_outbuf(), d_fft_codes, d_fft_size);
|
||||
|
||||
// compute the inverse FFT
|
||||
d_ifft->execute();
|
||||
|
||||
// Search maximum
|
||||
indext = 0;
|
||||
magt = 0;
|
||||
fft_normalization_factor = (float)d_fft_size * (float)d_fft_size;
|
||||
for (i = 0; i < d_fft_size; i++)
|
||||
{
|
||||
tmp_magt = std::norm(d_ifft->get_outbuf()[i]);
|
||||
if (tmp_magt > magt)
|
||||
{
|
||||
magt = tmp_magt;
|
||||
indext = i;
|
||||
}
|
||||
}
|
||||
// Normalize the maximum value to correct the scale factor introduced by FFTW
|
||||
magt = magt / (fft_normalization_factor * fft_normalization_factor);
|
||||
|
||||
// 4- record the maximum peak and the associated synchronization parameters
|
||||
if (d_mag < magt)
|
||||
{
|
||||
d_mag = magt;
|
||||
d_gnss_synchro->Acq_delay_samples = (double)indext;
|
||||
d_gnss_synchro->Acq_doppler_hz = (double)doppler;
|
||||
}
|
||||
|
||||
// Record results to file if required
|
||||
if (d_dump)
|
||||
{
|
||||
std::stringstream filename;
|
||||
std::streamsize n = 2 * sizeof(float) * (d_fft_size); // complex file write
|
||||
filename.str("");
|
||||
filename << "../data/test_statistics_" << d_gnss_synchro->System
|
||||
<<"_" << d_gnss_synchro->Signal << "_sat_"
|
||||
<< d_gnss_synchro->PRN << "_doppler_" << doppler << ".dat";
|
||||
d_dump_file.open(filename.str().c_str(), std::ios::out
|
||||
| std::ios::binary);
|
||||
d_dump_file.write((char*)d_ifft->get_outbuf(), n); //write directly |abs(x)|^2 in this Doppler bin?
|
||||
d_dump_file.close();
|
||||
}
|
||||
}
|
||||
|
||||
// 5- Compute the test statistics and compare to the threshold
|
||||
d_test_statistics = 2 * d_fft_size * d_mag / d_input_power;
|
||||
|
||||
// 6- Declare positive or negative acquisition using a message queue
|
||||
if (d_test_statistics > d_threshold)
|
||||
{
|
||||
positive_acquisition = true;
|
||||
d_gnss_synchro->Acq_samplestamp_samples = d_sample_counter;
|
||||
DLOG(INFO) << "positive acquisition";
|
||||
DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN;
|
||||
DLOG(INFO) << "sample_stamp " << d_sample_counter;
|
||||
DLOG(INFO) << "test statistics value " << d_test_statistics;
|
||||
DLOG(INFO) << "test statistics threshold " << d_threshold;
|
||||
DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples;
|
||||
DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz;
|
||||
DLOG(INFO) << "magnitude " << d_mag;
|
||||
DLOG(INFO) << "input signal power " << d_input_power;
|
||||
}
|
||||
else
|
||||
{
|
||||
DLOG(INFO) << "negative acquisition";
|
||||
DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN;
|
||||
DLOG(INFO) << "sample_stamp " << d_sample_counter;
|
||||
DLOG(INFO) << "test statistics value " << d_test_statistics;
|
||||
DLOG(INFO) << "test statistics threshold " << d_threshold;
|
||||
DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples;
|
||||
DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz;
|
||||
DLOG(INFO) << "magnitude " << d_mag;
|
||||
DLOG(INFO) << "input signal power " << d_input_power;
|
||||
}
|
||||
|
||||
d_active = false;
|
||||
|
||||
if (positive_acquisition)
|
||||
{
|
||||
acquisition_message = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
acquisition_message = 2;
|
||||
}
|
||||
d_channel_internal_queue->push(acquisition_message);
|
||||
consume_each(1);
|
||||
}
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* \file pcps_assisted_acquisition_cc.h
|
||||
* \brief This class implements a Parallel Code Phase Search Acquisition
|
||||
* \brief This class implements a Parallel Code Phase Search Acquisition with assistance and multi-dwells
|
||||
*
|
||||
* Acquisition strategy (Kay Borre book + CFAR threshold).
|
||||
* <ol>
|
||||
@ -17,8 +17,7 @@
|
||||
* Approach", Birkha user, 2007. pp 81-84
|
||||
*
|
||||
* \authors <ul>
|
||||
* <li> Javier Arribas, 2011. jarribas(at)cttc.es
|
||||
* <li> Luis Esteve, 2012. luis(at)epsilon-formacion.com
|
||||
* <li> Javier Arribas, 2013. jarribas(at)cttc.es
|
||||
* </ul>
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
@ -65,7 +64,7 @@ typedef boost::shared_ptr<pcps_assisted_acquisition_cc>
|
||||
pcps_assisted_acquisition_cc_sptr;
|
||||
pcps_assisted_acquisition_cc_sptr
|
||||
pcps_make_assisted_acquisition_cc(int max_dwells, unsigned int sampled_ms,
|
||||
unsigned int doppler_max, long freq, long fs_in, int samples_per_ms,
|
||||
int doppler_max, int doppler_min, long freq, long fs_in, int samples_per_ms,
|
||||
gr_msg_queue_sptr queue, bool dump, std::string dump_filename);
|
||||
|
||||
/*!
|
||||
@ -80,18 +79,26 @@ class pcps_assisted_acquisition_cc: public gr_block
|
||||
private:
|
||||
friend pcps_assisted_acquisition_cc_sptr
|
||||
pcps_make_assisted_acquisition_cc(int max_dwells, unsigned int sampled_ms,
|
||||
unsigned int doppler_max, long freq, long fs_in,
|
||||
int doppler_max, int doppler_min, long freq, long fs_in,
|
||||
int samples_per_ms, gr_msg_queue_sptr queue, bool dump,
|
||||
std::string dump_filename);
|
||||
|
||||
pcps_assisted_acquisition_cc(int max_dwells, unsigned int sampled_ms,
|
||||
unsigned int doppler_max, long freq, long fs_in,
|
||||
int doppler_max, int doppler_min, long freq, long fs_in,
|
||||
int samples_per_ms, gr_msg_queue_sptr queue, bool dump,
|
||||
std::string dump_filename);
|
||||
|
||||
void calculate_magnitudes(gr_complex* fft_begin, int doppler_shift,
|
||||
int doppler_offset);
|
||||
|
||||
int compute_and_accumulate_grid(gr_vector_const_void_star &input_items);
|
||||
float estimate_input_power(gr_vector_const_void_star &input_items);
|
||||
double search_maximum();
|
||||
void get_assistance();
|
||||
void reset_grid();
|
||||
void redefine_grid();
|
||||
void free_grid_memory();
|
||||
|
||||
long d_fs_in;
|
||||
long d_freq;
|
||||
int d_samples_per_ms;
|
||||
@ -100,27 +107,39 @@ private:
|
||||
int d_gnuradio_forecast_samples;
|
||||
float d_threshold;
|
||||
std::string d_satellite_str;
|
||||
unsigned int d_doppler_max;
|
||||
unsigned int d_doppler_step;
|
||||
int d_doppler_max;
|
||||
int d_doppler_min;
|
||||
int d_config_doppler_max;
|
||||
int d_config_doppler_min;
|
||||
|
||||
int d_num_doppler_points;
|
||||
int d_doppler_step;
|
||||
unsigned int d_sampled_ms;
|
||||
unsigned int d_fft_size;
|
||||
unsigned long int d_sample_counter;
|
||||
gr_complex* d_carrier;
|
||||
gr_complex* d_fft_codes;
|
||||
|
||||
float** d_grid_data;
|
||||
gr_complex** d_grid_doppler_wipeoffs;
|
||||
|
||||
gr::fft::fft_complex* d_fft_if;
|
||||
gr::fft::fft_complex* d_ifft;
|
||||
Gnss_Synchro *d_gnss_synchro;
|
||||
unsigned int d_code_phase;
|
||||
float d_doppler_freq;
|
||||
float d_mag;
|
||||
float d_input_power;
|
||||
float d_test_statistics;
|
||||
gr_msg_queue_sptr d_queue;
|
||||
concurrent_queue<int> *d_channel_internal_queue;
|
||||
std::ofstream d_dump_file;
|
||||
int d_state;
|
||||
bool d_active;
|
||||
bool d_disable_assist;
|
||||
int d_well_count;
|
||||
bool d_dump;
|
||||
unsigned int d_channel;
|
||||
|
||||
std::string d_dump_filename;
|
||||
|
||||
public:
|
||||
@ -144,7 +163,7 @@ public:
|
||||
*/
|
||||
unsigned int mag()
|
||||
{
|
||||
return d_mag;
|
||||
return d_test_statistics;
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -200,10 +219,7 @@ public:
|
||||
* \brief Set Doppler steps for the grid search
|
||||
* \param doppler_step - Frequency bin of the search grid [Hz].
|
||||
*/
|
||||
void set_doppler_step(unsigned int doppler_step)
|
||||
{
|
||||
d_doppler_step = doppler_step;
|
||||
}
|
||||
void set_doppler_step(unsigned int doppler_step);
|
||||
|
||||
|
||||
/*!
|
||||
|
@ -66,6 +66,7 @@ FreqXlatingFirFilter::FreqXlatingFirFilter(ConfigurationInterface* configuration
|
||||
if (dump_)
|
||||
{
|
||||
DLOG(INFO) << "Dumping output into file " << dump_filename_;
|
||||
std::cout<<"Dumping output into file " << dump_filename_<<std::endl;
|
||||
file_sink_ = gr_make_file_sink(item_size, dump_filename_.c_str());
|
||||
}
|
||||
}
|
||||
|
@ -509,7 +509,7 @@ int Gps_L1_Ca_Dll_Pll_Optim_Tracking_cc::general_work (int noutput_items, gr_vec
|
||||
d_last_seg = floor(d_sample_counter / d_fs_in);
|
||||
std::cout << "Current input signal time = " << d_last_seg << " [s]" << std::endl;
|
||||
std::cout << "Tracking CH " << d_channel << ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN)
|
||||
<< ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]" << std::endl;
|
||||
<< ", Doppler="<<d_carrier_doppler_hz<<" [Hz] CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]" << std::endl;
|
||||
//std::cout<<"TRK CH "<<d_channel<<" Carrier_lock_test="<<d_carrier_lock_test<< std::endl;
|
||||
//if (d_last_seg==5) d_carrier_lock_fail_counter=500; //DEBUG: force unlock!
|
||||
}
|
||||
@ -520,8 +520,8 @@ int Gps_L1_Ca_Dll_Pll_Optim_Tracking_cc::general_work (int noutput_items, gr_vec
|
||||
{
|
||||
d_last_seg = floor(d_sample_counter / d_fs_in);
|
||||
std::cout << "Tracking CH " << d_channel << ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN)
|
||||
<< ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]" << std::endl;
|
||||
//std::cout<<"TRK CH "<<d_channel<<" Carrier_lock_test="<<d_carrier_lock_test<< std::endl;
|
||||
<< ", Doppler="<<d_carrier_doppler_hz<<" [Hz] CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]" << std::endl;
|
||||
//std::cout<<"TRK CH "<<d_channel<<" Carrier_lock_test="<<d_carrier_lock_test<< std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -306,6 +306,7 @@ void gnss_sdr_supl_client::read_supl_data()
|
||||
gps_acq_iterator->second.d_TOW=(double)assist.acq_time;
|
||||
gps_acq_iterator->second.d_Doppler0=(double)e->doppler0;
|
||||
gps_acq_iterator->second.d_Doppler1=(double)e->doppler1;
|
||||
gps_acq_iterator->second.dopplerUncertainty=(double)e->d_win;
|
||||
gps_acq_iterator->second.Code_Phase=(double)e->code_ph;
|
||||
gps_acq_iterator->second.Code_Phase_int=(double)e->code_ph_int;
|
||||
gps_acq_iterator->second.Code_Phase_window=(double)e->code_ph_win;
|
||||
|
@ -388,7 +388,7 @@ void ControlThread::gps_acq_assist_data_collector()
|
||||
|
||||
// DEBUG MESSAGE
|
||||
std::cout << "Acquisition assistance record has arrived from SAT ID "
|
||||
<< gps_acq.i_satellite_PRN << std::endl;
|
||||
<< gps_acq.i_satellite_PRN << " with Doppler " << gps_acq.d_Doppler0<<" [Hz] "<<std::endl;
|
||||
// insert new acq record to the global ephemeris map
|
||||
if (global_gps_acq_assist_map.read(gps_acq.i_satellite_PRN,gps_acq_old))
|
||||
{
|
||||
|
@ -68,14 +68,18 @@
|
||||
#include "gnuradio_block/direct_resampler_conditioner_cc_test.cc"
|
||||
#include "string_converter/string_converter_test.cc"
|
||||
|
||||
concurrent_queue<Gps_Ephemeris> global_gps_ephemeris_queue2;
|
||||
|
||||
concurrent_queue<Gps_Ephemeris> global_gps_ephemeris_queue;
|
||||
concurrent_queue<Gps_Iono> global_gps_iono_queue;
|
||||
concurrent_queue<Gps_Utc_Model> global_gps_utc_model_queue;
|
||||
concurrent_queue<Gps_Almanac> global_gps_almanac_queue;
|
||||
concurrent_queue<Gps_Acq_Assist> global_gps_acq_assist_queue;
|
||||
|
||||
concurrent_map<Gps_Ephemeris> global_gps_ephemeris_map;
|
||||
concurrent_map<Gps_Iono> global_gps_iono_map;
|
||||
concurrent_map<Gps_Utc_Model> global_gps_utc_model_map;
|
||||
concurrent_map<Gps_Almanac> global_gps_almanac_map;
|
||||
concurrent_map<Gps_Acq_Assist> global_gps_acq_assist_map;
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
|
Loading…
Reference in New Issue
Block a user