Skip to content

Comments

Improved ramp algorithm#74

Merged
dihm merged 12 commits intoQTC-UMD:mainfrom
Json-To-String:ramp-alg
Apr 9, 2025
Merged

Improved ramp algorithm#74
dihm merged 12 commits intoQTC-UMD:mainfrom
Json-To-String:ramp-alg

Conversation

@Json-To-String
Copy link
Collaborator

This PR implements the continued fraction algorithm to determine a better integer ratio for sweeps by attempting to approximate the double provided by the user for sweep_rate.

The algorithm gets added to ad9959.c in the functions approx_double_32 and approx_double_16 to reduce clutter in the main dds-sweeper.c file, and modifies only the set command by changing logic in the parse_{amp, phase, freq}_ins functions.

The implementation attempts to respect the maximum and minimum integer values each tuning word (amp, phase, freq) can be.
To handle downward sweeps, the algorithm's maximum rate or denominator that it returns is set to 1.

Copy link
Contributor

@dihm dihm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should update the definition of sweep rate for the set commands and ensure the definition of sweep rate for seti/setb are correct/consistent.

Note: did not look at the notebooks.

@Json-To-String Json-To-String requested a review from dihm April 8, 2025 18:14
@Json-To-String
Copy link
Collaborator Author

Actually I realize I still need to add a bit to the README about the ramps

Copy link
Contributor

@dihm dihm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dihm dihm merged commit a9a9edb into QTC-UMD:main Apr 9, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants