TrackingLoopFilters.jl

Loop filters for GNSS tracking algorithms.

Installation

pkg> add TrackingLoopFilters

Quick Start

using TrackingLoopFilters
using Unitful: Hz, s

# Create a loop filter
lf = ThirdOrderBilinearLF()

# Process discriminator output
output, next_lf = filter_loop(lf, δθ, Δt, bandwidth)

API Reference

TrackingLoopFilters.TrackingLoopFiltersModule
TrackingLoopFilters

A Julia package implementing loop filters for GNSS tracking algorithms.

Provides first, second, and third order loop filters with boxcar and bilinear implementations. All filters support Unitful quantities for type-safe calculations.

Exported Types

Exported Functions

source
TrackingLoopFilters.FirstOrderLFType
struct FirstOrderLF <: TrackingLoopFilters.AbstractFirstOrderLF

First order loop filter (proportional only).

A stateless filter that provides proportional gain without integration. The natural frequency scaling factor is 4.0.

Example

lf = FirstOrderLF()
output, next_lf = filter_loop(lf, δθ, Δt, bandwidth)
source
TrackingLoopFilters.SecondOrderBilinearLFType
struct SecondOrderBilinearLF{T} <: TrackingLoopFilters.AbstractSecondOrderLF

Second order bilinear loop filter.

Uses bilinear transformation for improved frequency response. The natural frequency scaling factor is 1.89.

  • x::Any: Frequency state estimate

Example

lf = SecondOrderBilinearLF()
output, next_lf = filter_loop(lf, δθ, Δt, bandwidth)
source
TrackingLoopFilters.SecondOrderBoxcarLFType
struct SecondOrderBoxcarLF{T} <: TrackingLoopFilters.AbstractSecondOrderLF

Second order boxcar loop filter.

Uses boxcar (rectangular) integration for simpler implementation. The natural frequency scaling factor is 1.89.

  • x::Any: Frequency state estimate

Example

lf = SecondOrderBoxcarLF()
output, next_lf = filter_loop(lf, δθ, Δt, bandwidth)
source
TrackingLoopFilters.ThirdOrderAssistedBilinearLFType
struct ThirdOrderAssistedBilinearLF{T1, T2} <: TrackingLoopFilters.AbstractThirdOrderAssistedLF

Third order bilinear loop filter with second order assistance.

Combines a third order bilinear loop with a second order assisted loop for improved tracking performance. Accepts a two-element discriminator input vector [δθ_high, δθ_low].

  • x1::Any: Frequency state estimate

  • x2::Any: Frequency rate state estimate

Example

lf = ThirdOrderAssistedBilinearLF()
output, next_lf = filter_loop(lf, [δθ_high, δθ_low], Δt, bandwidth)
source
TrackingLoopFilters.ThirdOrderBilinearLFType
struct ThirdOrderBilinearLF{T1, T2} <: TrackingLoopFilters.AbstractThirdOrderLF

Third order bilinear loop filter.

Uses bilinear transformation for improved frequency response. The natural frequency scaling factor is 1.2.

  • x1::Any: Frequency state estimate

  • x2::Any: Frequency rate state estimate

Example

lf = ThirdOrderBilinearLF()
output, next_lf = filter_loop(lf, δθ, Δt, bandwidth)
source
TrackingLoopFilters.ThirdOrderBoxcarLFType
struct ThirdOrderBoxcarLF{T1, T2} <: TrackingLoopFilters.AbstractThirdOrderLF

Third order boxcar loop filter.

Uses boxcar (rectangular) integration for simpler implementation. The natural frequency scaling factor is 1.2.

  • x1::Any: Frequency state estimate

  • x2::Any: Frequency rate state estimate

Example

lf = ThirdOrderBoxcarLF()
output, next_lf = filter_loop(lf, δθ, Δt, bandwidth)
source
TrackingLoopFilters.filter_loopMethod
filter_loop(state, δθ, Δt, bandwidth)

Propagate the loop filter state and return both the filtered output and next state.

This is a convenience function that combines propagate and get_filtered_output into a single call.

Arguments

  • state: Current loop filter state
  • δθ: Phase discriminator output (dimensionless for standard filters, vector for assisted)
  • Δt: Integration time
  • bandwidth: Loop bandwidth

Returns

  • output: Filtered frequency estimate
  • next_state: Propagated loop filter state
source
TrackingLoopFilters.get_filtered_outputMethod
get_filtered_output(state, δθ, Δt, bandwidth)

Calculate the filtered output for the first order loop filter.

Computes ω₀ * δθ where ω₀ = bandwidth * 4.0.

Arguments

  • state: Current loop filter state
  • δθ: Phase discriminator output
  • Δt: Integration time
  • bandwidth: Loop bandwidth

Returns

Filtered frequency estimate.

source
TrackingLoopFilters.get_filtered_outputMethod
get_filtered_output(state, δθ, Δt, bandwidth)

Calculate the filtered output for the second order bilinear loop filter.

Computes x + (√2 * ω₀ + ω₀² * Δt / 2) * δθ.

Arguments

  • state: Current loop filter state
  • δθ: Phase discriminator output
  • Δt: Integration time
  • bandwidth: Loop bandwidth

Returns

Filtered frequency estimate.

source
TrackingLoopFilters.get_filtered_outputMethod
get_filtered_output(state, δθ, Δt, bandwidth)

Calculate the filtered output for the second order boxcar loop filter.

Computes x + √2 * ω₀ * δθ.

Arguments

  • state: Current loop filter state
  • δθ: Phase discriminator output
  • Δt: Integration time
  • bandwidth: Loop bandwidth

Returns

Filtered frequency estimate.

source
TrackingLoopFilters.get_filtered_outputMethod
get_filtered_output(state, δθ, Δt, bandwidth)

Calculate the filtered output for the assisted third order bilinear loop filter.

Combines outputs from the third order loop and second order assisted loop.

Arguments

  • state: Current loop filter state
  • δθ: Two-element vector [δθ_high, δθ_low] with high and low order discriminator outputs
  • Δt: Integration time
  • bandwidth: Loop bandwidth

Returns

Filtered frequency estimate.

source
TrackingLoopFilters.get_filtered_outputMethod
get_filtered_output(state, δθ, Δt, bandwidth)

Calculate the filtered output for the third order bilinear loop filter.

Arguments

  • state: Current loop filter state
  • δθ: Phase discriminator output
  • Δt: Integration time
  • bandwidth: Loop bandwidth

Returns

Filtered frequency estimate.

source
TrackingLoopFilters.get_filtered_outputMethod
get_filtered_output(state, δθ, Δt, bandwidth)

Calculate the filtered output for the third order boxcar loop filter.

Arguments

  • state: Current loop filter state
  • δθ: Phase discriminator output
  • Δt: Integration time
  • bandwidth: Loop bandwidth

Returns

Filtered frequency estimate.

source
TrackingLoopFilters.propagateMethod
propagate(state, δθ, Δt, bandwidth)

Propagate the first order loop filter state.

Since the first order filter is stateless, this returns the input state unchanged.

Arguments

  • state: Current loop filter state
  • δθ: Phase discriminator output
  • Δt: Integration time
  • bandwidth: Loop bandwidth

Returns

The unchanged loop filter state.

source
TrackingLoopFilters.propagateMethod
propagate(state, δθ, Δt, bandwidth)

Propagate the second order loop filter state.

Updates the frequency state estimate using x_next = x + Δt * ω₀² * δθ.

Arguments

  • state: Current loop filter state
  • δθ: Phase discriminator output
  • Δt: Integration time
  • bandwidth: Loop bandwidth

Returns

New loop filter state with updated frequency estimate.

source
TrackingLoopFilters.propagateMethod
propagate(state, δθ, Δt, bandwidth)

Propagate the assisted third order loop filter state.

Updates both frequency and frequency rate state estimates using dual discriminator inputs.

Arguments

  • state: Current loop filter state
  • δθ: Two-element vector [δθ_high, δθ_low] with high and low order discriminator outputs
  • Δt: Integration time
  • bandwidth: Loop bandwidth

Returns

New loop filter state with updated estimates.

source
TrackingLoopFilters.propagateMethod
propagate(state, δθ, Δt, bandwidth)

Propagate the third order loop filter state.

Updates both frequency and frequency rate state estimates.

Arguments

  • state: Current loop filter state
  • δθ: Phase discriminator output
  • Δt: Integration time
  • bandwidth: Loop bandwidth

Returns

New loop filter state with updated estimates.

source