aewallin / allantools

Allan deviation and related time & frequency statistics library in Python
GNU Lesser General Public License v3.0
222 stars 76 forks source link

add bias correction to totdev(), mtotdev(), htotdev(), theo1() #22

Open aewallin opened 8 years ago

aewallin commented 8 years ago

I implemented a first try at htotdev() following the description in NIST SP 1065. The algorithm seems very similar to mtotdev(), but using frequency input data where mtotdev uses phase input data.

However the numbers produced by the algorithm seem incorrect. Should be fixed.

aewallin commented 8 years ago

output of htotdev() test, as compared to Stable32 is below. If the correct bias-correction at AF=1 (tau= 1*tau0) is 0.5 and 0.995 for other tau, then the values seem correct.

Tau N DEV(Stable32) DEV(allantools) rel.error bias ERROR 1 998 0.29439 0.208164 -0.292897 0.5000 ERROR 2 995 0.20297 0.202466 -0.002482 0.9950 ERROR 4 989 0.14252 0.142165 -0.002493 0.9950 ERROR 8 977 0.10822 0.107953 -0.002469 0.9951 ERROR 16 953 0.065265 0.065102 -0.002497 0.9950 ERROR 32 905 0.044644 0.0445319 -0.002510 0.9950 ERROR 64 809 0.033576 0.0334922 -0.002496 0.9950 128 617 0.02879 0.0287899 -0.000002 1.0000 OK! 256 233 0.014773 0.0147734 0.000027 1.0001 OK!

aewallin commented 8 years ago

Updated the title to include all functions that need bias correction.