Skip to content

Commit

Permalink
documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
aewallin committed Dec 18, 2023
1 parent 52848cc commit 761ca1c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions allantools/realtime.py
Expand Up @@ -115,7 +115,9 @@ def add_phase(self, xnew):
self.update_af()

def update_S(self, idx):
""" update S, sum-of-squares """
""" update S, sum-of-squares.
Eqn (9) in Dobrogowski2007
"""
af = self.afs[idx]
i = len(self.x)-1 # last pt
S_new = pow(self.x[i] - 2*self.x[i-af] + self.x[i-2*af], 2)
Expand Down Expand Up @@ -195,7 +197,7 @@ def add_af(self):
self.So = numpy.append(self.So, 0)

def update_S3n(self, idx):
""" eqn (13) of paper """
""" Eqn (13) in Dobrogowski2007 """
af = self.afs[idx]
j = len(self.x)-1 # last pt
self.S[idx] = self.S[idx] + self.x[j] - 2*self.x[j-af] + self.x[j-2*af]
Expand All @@ -205,14 +207,16 @@ def update_S3n(self, idx):
self.update_dev(idx)

def update_dev(self, idx):
# Eqn (14)
""" Eqn (14) in Dobrogowski2007 """
num_pts = len(self.x)
af = self.afs[idx]
self.dev[idx] = numpy.sqrt(
(1.0/6.0)*(1.0/(num_pts-3*af+1.0))*(1.0/pow(af, 2))*(self.So[idx]))

def update_S(self, idx):
""" update S, sum-of-squares """
""" update S, sum-of-squares
Eqn (12) in Dobrogowski2007
"""
af = self.afs[idx]
assert(len(self.x) >= 3*af+1)
i = len(self.x)-1 # last pt
Expand Down

0 comments on commit 761ca1c

Please sign in to comment.