Skip to content

Instantly share code, notes, and snippets.

@aewallin
Last active March 16, 2018 08:27
Show Gist options
  • Save aewallin/c1c02bd8f0519329f9e58e59b3367a72 to your computer and use it in GitHub Desktop.
Save aewallin/c1c02bd8f0519329f9e58e59b3367a72 to your computer and use it in GitHub Desktop.
TDEV and MTIE masks for ITU synchronizatio / clock standards
"""
TDEV and MTIE masks for ITU Standards
AW2017-2018
ITU Primary Reference Clock
https://www.itu.int/rec/T-REC-G.811/en
ITU Primary Reference Time Clock
https://www.itu.int/rec/T-REC-G.8272/en
ITU Enhanced Primary Reference Time Clock
https://www.itu.int/rec/T-REC-G.8272.1/en
"""
def eprtc_tdev(tau):
""" Time Deviation, ITU Enhanced Primary Reference Time Clock """
if tau<30e3:
return 1e-9
if tau<300e3:
return 3.33333e-5*1.0e-9*tau
else:
return 10e-9
def eprtc_mtie(tau):
""" MTIE
ITU Enhanced Primary Reference Time Clock
"""
if tau<=1:
return 1e-9
if tau <= 100:
return 1e-9*(0.11114*tau+3.89)
if tau<= 400000:
return 1e-9*(0.0375e-3*tau+15)
else:
return 1e-9*30 # 30 ns
def prtc_tdev(tau):
""" Time Deviation
ITU Primary Reference Time Clock
"""
if tau<100:
return 3e-9
if tau<1000:
return 0.03e-9*tau
else:
return 30e-9
def prtc_mtie(tau):
""" MTIE
ITU Primary Reference Time Clock
"""
if tau<273:
return 1e-6* (0.275e-3*tau + 0.025)
else:
return 1e-6*0.1 # 100ns
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment