add estimation and compensation for sampling errors

This commit is contained in:
Roman Zeyde
2014-07-20 17:20:27 +03:00
parent 048e52574a
commit 8adfcc8e12
2 changed files with 22 additions and 13 deletions

View File

@@ -103,6 +103,7 @@ def drift(S):
x = np.arange(len(S))
x = x - np.mean(x)
y = np.unwrap(np.angle(S)) / (2*np.pi)
y = y - np.mean(y)
mean_y = np.mean(y)
y = y - mean_y
a = np.dot(x, y) / np.dot(x, x)
return a
return a, mean_y