2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-28 20:53:35 +08:00

dds: use fast math for asf computations

This commit is contained in:
Sebastien Bourdeauducq 2016-06-03 23:34:20 -04:00
parent e8aadd0a1a
commit 0ac0547bca

View File

@ -125,12 +125,12 @@ class _DDSGeneric:
word."""
return pow/2**self.pow_width
@portable
@portable(flags=["fast-math"])
def amplitude_to_asf(self, amplitude):
"""Returns amplitude scale factor corresponding to given amplitude."""
return round(amplitude*0x0fff)
@portable
@portable(flags=["fast-math"])
def asf_to_amplitude(self, asf):
"""Returns the amplitude corresponding to the given amplitude scale
factor."""