2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-18 16:06:30 +08:00

wrpll.filters: update to match Weida's MatLab simulations

This commit is contained in:
hartytp 2020-10-05 22:52:49 +01:00 committed by Sebastien Bourdeauducq
parent e9ab434fa7
commit b44b870452

View File

@ -3,8 +3,7 @@ helper_xn2 = 0
helper_yn0 = 0
helper_yn1 = 0
helper_yn2 = 0
previous_helper_tag = 0
helper_out = 0
main_xn1 = 0
main_xn2 = 0
@ -13,31 +12,31 @@ main_yn1 = 0
main_yn2 = 0
def helper(helper_tag):
def helper(tag_diff):
global helper_xn1, helper_xn2, helper_yn0, \
helper_yn1, helper_yn2, previous_helper_tag
helper_yn1, helper_yn2, helper_out
helper_xn0 = helper_tag - previous_helper_tag - 32768
helper_xn0 = 0 - tag_diff # *(2**22)
helper_yr = 4294967296
helper_yn2 = helper_yn1
helper_yn1 = helper_yn0
helper_yn0 = (
((284885689*((217319150*helper_xn0 >> 44) +
(-17591968725107*helper_xn1 >> 44))) >> 44) +
(-35184372088832*helper_yn1 >> 44) -
(17592186044416*helper_yn2 >> 44))
helper_yn0 = (284885690 * (helper_xn0
+ (217319150 * helper_xn1 >> 44)
- (17591968725108 * helper_xn2 >> 44)
) >> 44
) + (35184372088832*helper_yn1 >> 44) - helper_yn2
helper_xn2 = helper_xn1
helper_xn1 = helper_xn0
previous_helper_tag = helper_tag
helper_yn0 = min(helper_yn0, helper_yr)
helper_yn0 = max(helper_yn0, 0 - helper_yr)
helper_out = 268435456*helper_yn0 >> 44
return helper_yn0
return helper_out
def main(main_xn0):