# Tracking.jl

Modular tracking algorithm for various Global Navigation Satellite Systems (GNSS)

Tracking.jl provides a modular and performant tracking algorithm.

## Installation

julia> ]
pkg> add Tracking

## Usage

Tracking.jl processes each satellite individually. That means for each satellite a tracking state TrackingState must be initialized. From there, the track function needs to be called for every state and for every incoming signal to update the tracking parameters. The required parameters to initialize the tracking state are the GNSS system, carrier Doppler and the code phase, e.g.

state = TrackingState(GPSL1, carrier_doppler, code_phase)

These parameters are usually provided by the acquisition process of the satellite. Refer to TrackingState to find about other optional parameters.

The signal is tracked by

results = track(signal, state, prn, sample_frequency)

where prn is the PRN and sample_frequency the sample frequency. Refer to track to find about other optional parameters. The result contains the current state as well as some additional information such as the last valid correlator output, found data bits, etc. For each of those parameters a helper function exists to get the parameter (e.g. get_prompt(results)) - see Tracking Results. The next track function needs the updated state:

next_results = track(next_signal, get_state(results), prn, sample_frequency)

Here is an example for a single PRN:

using Tracking
using Tracking: Hz, GPSL1
carrier_doppler = 1000Hz
code_phase = 50
sample_frequency = 2.5e6Hz
prn = 1
state = TrackingState(GPSL1, carrier_doppler, code_phase)
results = track(signal, state, prn, sample_frequency)
next_results = track(next_signal, get_state(results), prn, sample_frequency)

## Track multiple signals coherently

Tracking.jl provides a way to track multiple signals coherently, e.g. to track signals from a phased array. In that case the input signal should be a Matrix instead of a Vector, where the number of rows is equal to the number of antenna elements and the number of columns is equal to the number of samples. Furthermore, you need to specify the number of antenna elements to the tracking state:

state = TrackingState(GPSL1, carrier_doppler, code_phase, num_ants = NumAnts(4))

By default the track function will use the first antenna channel as the reference signal to drive the discriminators etc. However, an appropiate beamforming algorithm will probably suit better. For that, you'll have to pass a function post_corr_filter to the track function like the following:

results = track(signal, state, prn, sample_frequency, post_corr_filter = x -> x[end])

## Q/A

• Why are the correlator values zero?

The correlator output given in the tracking results is the correlation result after the code phase has reached the full code length or multiple of the code length depending on the maximal integration time max_integration_time (default: 1ms) you have set. If the current tracked signal does not include the end of the PRN sequency (or multiples of that), the correlator output will be zero. Moreover, a correlator output will only be valid, if the integration time has been at least the miminimum configured integration time min_integration_time (default: 0.75ms). Otherwise the correlator output will be zero as well. This case occurs at the beginning of the tracking.