From 7d6a1b528d6cc5ad7b01df11ea5b01fd50d40ed0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20J=C3=B6rdens?= Date: Thu, 2 Aug 2018 11:19:04 +0000 Subject: [PATCH] ad9912: add ftw_to_frequency --- artiq/coredevice/ad9912.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/artiq/coredevice/ad9912.py b/artiq/coredevice/ad9912.py index f8b139be8..56df7a7ea 100644 --- a/artiq/coredevice/ad9912.py +++ b/artiq/coredevice/ad9912.py @@ -157,6 +157,13 @@ class AD9912: """ 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"}) def turns_to_pow(self, phase): """Returns the phase offset word corresponding to the given