-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Frequency correction of timestamp events #6
Comments
Comment by pyuxiang The equation to compute for each timestamp Some observations first:
To avoid expensive multiplication with a floating point, we express Assume we use units of 1e-12 (or 2^-40) for the
The minimum required timing correction is thus at most on the order of 28 + 42 = 70 bits (excl. sign bit). |
Comment by pyuxiang In considering a possible optimization, maybe easier if we think of it in base-10? A full multiplication yields 976792.564321, with the unnecessary fractional part. In other words, the larger the multiplied value, the smaller the irrelevant part. In the worst case scenario with a 2^-12 (or 28-bit) offset in units of 2^-40, only 40-28-1=11 bits of the timestamp can be cut out, i.e. the maximum size of the resulting multiplication that must be performed is actually 28 + (54 - 11) = 71 bits (again excluding a sign bit), which has the following algorithm: This size can be reformulated as (40-12) + (54 - (40-(40-12)-1)) = (40-12) + (54 - 12 + 1) = 55 + 40 - 2*12 = 31 + 40 = 71 bits. |
Comment by pyuxiang To fit everything into a 64-bit signed multiplication result is then clear: if the maximum frequency difference is 2^-12, then the finest frequency offset resolution we can accept is 32 bits. Alternatively, we can have a maximum where |
Comment by pyuxiang One small note, due to the overflow of the timestamp after every 20 hours, the timestamp correction will become erroneous within 20 hours. We might need to consider a fix to this as well. |
Comment by pyuxiang Closed with commit franciumxzf/fpfind@82b84bd. |
Monday Jan 30, 2023 at 09:29 GMT
Originally opened as franciumxzf/fpfind#6
The text was updated successfully, but these errors were encountered: