Created
June 14, 2022 14:06
-
-
Save tspspi/7988fb97625b4ccf02a870ee12d8d38f to your computer and use it in GitHub Desktop.
Simple Allan deviation in time domain
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple and direct overlapping Allan deviation | |
# for stability analysis in time domain (i.e. "phase" samples) | |
def overlappingAlanDeviationTimeDomain(timestamps, samples, overlapWindowSize = 2): | |
oadev = [] | |
taus = [] | |
tau0 = (timestamps[len(timestamps)-1] - timestamps[0]) / (len(timestamps)) | |
for nLimit in range(2*overlapWindowSize, len(timestamps)): | |
tau = tau0 * nLimit | |
sum = 0 | |
for i in range(nLimit - 2*overlapWindowSize): | |
sum = sum + (samples[i + 2*overlapWindowSize] - 2 * samples[i + overlapWindowSize] + samples[i])**2.0 | |
sum = sum / (2 * (nLimit - 2*overlapWindowSize) * tau**2) | |
oadev.append(sum) | |
taus.append(len(taus) * tau0) | |
return taus, oadev |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment