Skip to content

Commit

Permalink
nbs14 1000-point test for PDEV
Browse files Browse the repository at this point in the history
  • Loading branch information
aewallin committed Nov 26, 2023
1 parent be11dab commit 2273962
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 12 deletions.
14 changes: 14 additions & 0 deletions tests/nbs14/pdev_nbs14.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# PDEV computed with SigmaTheta v3.0-29-g053a Wed Oct 11 12:59:22 2023
# PDEV of 1000-point NBS14 frequency dataset
#
# AF PDEV
1.0000000000000000e+00 2.9223187810675200e-01
2.0000000000000000e+00 2.1445233564252639e-01
4.0000000000000000e+00 1.5618112158618463e-01
8.0000000000000000e+00 1.1709745745448434e-01
1.6000000000000000e+01 6.9029585189839343e-02
3.2000000000000000e+01 4.9749707730398392e-02
6.4000000000000000e+01 3.8947417330713739e-02
1.2800000000000000e+02 3.0862392741372108e-02
2.5600000000000000e+02 1.2447414341332683e-02
5.0000000000000000e+02 9.3531187831254377e-04
33 changes: 21 additions & 12 deletions tests/nbs14/test_nbs14_1000point.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# import time
# import sys
import pytest

import numpy as np
import allantools as allan

# 1000 point deviations from:
Expand All @@ -40,24 +40,25 @@
[2.943883e-01, 1.052754e-01, 3.910860e-02], # 4 HDEV
[1.687202e-01, 3.563623e-01, 1.253382e-00], # 5 TDEV
[2.943883e-01, 9.581083e-02, 3.237638e-02], # 6 OHDEV
# 7 standard deviation, sample (not population)
[2.884664e-01, 9.296352e-02, 3.206656e-02],
[2.884664e-01, 9.296352e-02, 3.206656e-02], # 7 standard deviation, sample (not population)
[2.943883e-01, 9.614787e-02, 3.058103e-02], # 8 HTOTDEV
# [2.418528e-01, 6.499161e-02, 2.287774e-02], # 9 MTOTDEV (from published table, WITH bias correction)
# [2.418528e-01, 6.499161e-02, 2.287774e-02], # 9 MTOTDEV (from published table, WITH bias correction)
# MTOTDEV (from Stable32 v1.60 decade run, NO bias correction)
[2.0664e-01, 5.5529e-02, 1.9547e-02],
# [1.396338e-01, 3.752293e-01, 1.320847e-00], # 10 TTOTDEV (from published table, WITH bias correction)
# 10 TTOTDEV (from Stable 32 v1.60 decade run, NO bias correction)
[1.1930e-01, 3.2060e-01, 1.1285e+00],
[1.1930e-01, 3.2060e-01, 1.1285e+00], # 10 TTOTDEV (from Stable 32 v1.60 decade run, NO bias correction)
[1.0757e-01, 3.1789e-02, 5.0524e-03], ] # 11 THEO1 (tau= 10,100,1000, from Stable32, NO bias correction
# this generates the nbs14 1000 point frequency dataset.
# random number generator described in
# http://www.ieee-uffc.org/frequency-control/learning-riley.asp
# http://tf.nist.gov/general/pdf/2220.pdf page 107
# http://www.wriley.com/tst_suit.dat



def nbs14_1000():
"""
this generates the nbs14 1000 point frequency dataset.
random number generator described in
http://www.ieee-uffc.org/frequency-control/learning-riley.asp
http://tf.nist.gov/general/pdf/2220.pdf page 107
http://www.wriley.com/tst_suit.dat
"""
n = [0]*1000
n[0] = 1234567890
for i in range(999):
Expand Down Expand Up @@ -103,6 +104,14 @@ def test_ohdev(self):
self.nbs14_tester(allan.ohdev, None, fdata, nbs14_1000_devs[6])
self.nbs14_tester(allan.ohdev, pdata, None, nbs14_1000_devs[6])

def test_pdev(self):
d = np.loadtxt('pdev_nbs14.txt')
mytaus = d[:-1,0]
pdevs = d[:-1,1]
print(mytaus,pdevs)
self.nbs14_tester(allan.pdev, None, fdata, pdevs, taus = mytaus)
self.nbs14_tester(allan.pdev, pdata, None, pdevs, taus = mytaus)

def notest_mtotdev(self): # very slow, disable for now
self.nbs14_tester(allan.mtotdev, None, fdata,
nbs14_1000_devs[9], soft=False)
Expand Down Expand Up @@ -161,5 +170,5 @@ def check_devs(self, dev2, dev1, soft=False):

if __name__ == "__main__":
t = TestNBS14_1000Point()
t.test_theo1()
t.test_pdev()
pytest.main(["test_nbs14_1000point.py"])

0 comments on commit 2273962

Please sign in to comment.