Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 1 file changed
  • 0 comments
  • 1 contributor

Showing 1 changed file with 51 additions and 0 deletions. Show diff stats Hide diff stats

  1. 51  peregrine/tracking.py
51  peregrine/tracking.py
@@ -27,6 +27,56 @@
27 27
   _progressbar_available = False
28 28
 
29 29
 
  30
+class TrackingLoop(object):
  31
+  """
  32
+  Abstract base class for a tracking loop.
  33
+
  34
+  Sub-classes should implement :meth:`update` and :meth:`start` and provide
  35
+  access to `code_freq` and `carr_freq` attributes or properties.
  36
+
  37
+  The tracking loop should initialise its constant parameters in its `__init__`
  38
+  method. :meth:`start` will be called to (re)initialise the tracking loop,
  39
+  passing in the initial carrier and code frequencies.
  40
+
  41
+  """
  42
+  __slots__ = ('code_freq', 'carr_freq')
  43
+
  44
+  def start(self, code_freq, carr_freq):
  45
+    """
  46
+    (Re-)initialise the tracking loop.
  47
+
  48
+    Parameters
  49
+    ----------
  50
+    code_freq : float
  51
+      The code phase rate (i.e. frequency).
  52
+    carr_freq : float
  53
+      The carrier frequency.
  54
+
  55
+    """
  56
+    raise NotImplementedError()
  57
+
  58
+  def update(self, e, p, l):
  59
+    """
  60
+    Tracking loop update step.
  61
+
  62
+    Parameters
  63
+    ----------
  64
+    e : complex, :math:`I_E + Q_E j`
  65
+      The early correlation. The real component contains the in-phase
  66
+      correlation and the imaginary component contains the quadrature
  67
+      correlation.
  68
+    p : complex, :math:`I_P + Q_P j`
  69
+      The prompt correlation.
  70
+    l : complex, :math:`I_L + Q_L j`
  71
+      The late correlation.
  72
+
  73
+    Returns
  74
+    -------
  75
+    out : (float, float)
  76
+      The tuple (code_freq, carrier_freq).
  77
+
  78
+    """
  79
+    raise NotImplementedError()
30 80
 
31 81
 default_loop_filter = swiftnav.track.SimpleTrackingLoop(
32 82
   (2, 0.7, 1),     # Code loop parameters
@@ -39,6 +89,7 @@
39 89
   (25, 0.7, 0.25), # Carrier loop parameters
40 90
   1e3,             # Loop frequency
41 91
   0.005,           # Tau
  92
+  1540,            # Carrier cycles per code
42 93
   1000             # Gain schedule after 1000 iterations (1s)
43 94
 )
44 95
 

No commit comments for this range

Something went wrong with that request. Please try again.