mirror of https://github.com/m-labs/artiq.git
ad9912: add ftw_to_frequency
This commit is contained in:
parent
e518a1f1d0
commit
7d6a1b528d
|
@ -157,6 +157,13 @@ class AD9912:
|
||||||
"""
|
"""
|
||||||
return int64(round(self.ftw_per_hz*frequency))
|
return int64(round(self.ftw_per_hz*frequency))
|
||||||
|
|
||||||
|
@portable(flags={"fast-math"})
|
||||||
|
def ftw_to_frequency(self, ftw):
|
||||||
|
"""Returns the frequency corresponding to the given
|
||||||
|
frequency tuning word.
|
||||||
|
"""
|
||||||
|
return ftw/self.ftw_per_hz
|
||||||
|
|
||||||
@portable(flags={"fast-math"})
|
@portable(flags={"fast-math"})
|
||||||
def turns_to_pow(self, phase):
|
def turns_to_pow(self, phase):
|
||||||
"""Returns the phase offset word corresponding to the given
|
"""Returns the phase offset word corresponding to the given
|
||||||
|
|
Loading…
Reference in New Issue