forked from M-Labs/artiq
sawg: documentation
This commit is contained in:
parent
695eb705b3
commit
5efd0fcea5
|
@ -13,13 +13,18 @@ class SAWG:
|
||||||
i_enable*Re(oscillators) +
|
i_enable*Re(oscillators) +
|
||||||
q_enable*Im(buddy_oscillators))
|
q_enable*Im(buddy_oscillators))
|
||||||
|
|
||||||
Where:
|
The nine spline interpolators are accessible as attributes:
|
||||||
* offset, amplitude1, amplitude2: in units of full scale
|
|
||||||
* phase0, phase1, phase2: in units of turns
|
* :attr:`offset`, :attr:`amplitude1`, :attr:`amplitude2`: in units
|
||||||
* frequency0, frequency1, frequency2: in units of Hz
|
of full scale
|
||||||
|
* :attr:`phase0`, :attr:`phase1`, :attr:`phase2`: in units of turns
|
||||||
|
* :attr:`frequency0`, :attr:`frequency1`, :attr:`frequency2`: in units
|
||||||
|
of Hz
|
||||||
|
|
||||||
:param channel_base: RTIO channel number of the first channel (amplitude).
|
:param channel_base: RTIO channel number of the first channel (amplitude).
|
||||||
Frequency and Phase are then assumed to be successive channels.
|
Frequency and Phase are then assumed to be successive channels.
|
||||||
|
:param parallelism: Number of output samples per coarse RTIO clock cycle.
|
||||||
|
:param core_device: Name of the core device that this SAWG is on.
|
||||||
"""
|
"""
|
||||||
kernel_invariants = {"channel_base", "core",
|
kernel_invariants = {"channel_base", "core",
|
||||||
"amplitude1", "frequency1", "phase1",
|
"amplitude1", "frequency1", "phase1",
|
||||||
|
@ -34,21 +39,21 @@ class SAWG:
|
||||||
cordic_gain = 1.646760258057163 # Cordic(width=16, guard=None).gain
|
cordic_gain = 1.646760258057163 # Cordic(width=16, guard=None).gain
|
||||||
# cfg: channel_base
|
# cfg: channel_base
|
||||||
self.offset = Spline(width, time_width, channel_base + 1,
|
self.offset = Spline(width, time_width, channel_base + 1,
|
||||||
self.core, 1/2)
|
self.core, 2.)
|
||||||
self.amplitude1 = Spline(width, time_width, channel_base + 2,
|
self.amplitude1 = Spline(width, time_width, channel_base + 2,
|
||||||
self.core, 1/(2*cordic_gain**2))
|
self.core, 2*cordic_gain**2)
|
||||||
self.frequency1 = Spline(3*width, time_width, channel_base + 3,
|
self.frequency1 = Spline(3*width, time_width, channel_base + 3,
|
||||||
self.core, self.core.coarse_ref_period)
|
self.core, 1/self.core.coarse_ref_period)
|
||||||
self.phase1 = Spline(width, time_width, channel_base + 4,
|
self.phase1 = Spline(width, time_width, channel_base + 4,
|
||||||
self.core, 1.)
|
self.core, 1.)
|
||||||
self.amplitude2 = Spline(width, time_width, channel_base + 5,
|
self.amplitude2 = Spline(width, time_width, channel_base + 5,
|
||||||
self.core, 1/(2*cordic_gain**2))
|
self.core, 2*cordic_gain**2)
|
||||||
self.frequency2 = Spline(3*width, time_width, channel_base + 6,
|
self.frequency2 = Spline(3*width, time_width, channel_base + 6,
|
||||||
self.core, self.core.coarse_ref_period)
|
self.core, 1/self.core.coarse_ref_period)
|
||||||
self.phase2 = Spline(width, time_width, channel_base + 7,
|
self.phase2 = Spline(width, time_width, channel_base + 7,
|
||||||
self.core, 1.)
|
self.core, 1.)
|
||||||
self.frequency0 = Spline(2*width, time_width, channel_base + 8,
|
self.frequency0 = Spline(2*width, time_width, channel_base + 8,
|
||||||
self.core,
|
self.core,
|
||||||
self.core.coarse_ref_period/parallelism)
|
parallelism/self.core.coarse_ref_period)
|
||||||
self.phase0 = Spline(width, time_width, channel_base + 9,
|
self.phase0 = Spline(width, time_width, channel_base + 9,
|
||||||
self.core, 1.)
|
self.core, 1.)
|
||||||
|
|
|
@ -5,7 +5,7 @@ from artiq.language.types import TInt32, TInt64, TFloat
|
||||||
|
|
||||||
|
|
||||||
class Spline:
|
class Spline:
|
||||||
"""Spline interpolating RTIO channel.
|
r"""Spline interpolating RTIO channel.
|
||||||
|
|
||||||
One knot of a polynomial basis spline (B-spline) :math:`u(t)`
|
One knot of a polynomial basis spline (B-spline) :math:`u(t)`
|
||||||
is defined by the coefficients :math:`u_n` up to order :math:`n = k`.
|
is defined by the coefficients :math:`u_n` up to order :math:`n = k`.
|
||||||
|
@ -13,8 +13,15 @@ class Spline:
|
||||||
:math:`u(t)` for :math:`t > t_0, t_0` is:
|
:math:`u(t)` for :math:`t > t_0, t_0` is:
|
||||||
|
|
||||||
.. math::
|
.. math::
|
||||||
u(t) = \sum_{n=0}^k \frac{u_n}{n!} (t - t_0)^n
|
u(t) &= \sum_{n=0}^k \frac{u_n}{n!} (t - t_0)^n \\
|
||||||
= u_0 + u_1 (t - t_0) + \frac{u_2}{2} (t - t_0)^2 + \dots
|
&= u_0 + u_1 (t - t_0) + \frac{u_2}{2} (t - t_0)^2 + \dots
|
||||||
|
|
||||||
|
:param width: Width in bits of the quantity that this spline controls
|
||||||
|
:param time_width: Width in bits of the time counter of this spline
|
||||||
|
:param channel: RTIO channel number
|
||||||
|
:param core_device: Core device that this spline is attached to
|
||||||
|
:param scale: Scale for conversion between machine units and physical
|
||||||
|
units; to be given as the "full scale physical value".
|
||||||
"""
|
"""
|
||||||
|
|
||||||
kernel_invariants = {"channel", "core", "scale", "width",
|
kernel_invariants = {"channel", "core", "scale", "width",
|
||||||
|
@ -24,7 +31,7 @@ class Spline:
|
||||||
self.core = core_device
|
self.core = core_device
|
||||||
self.channel = channel
|
self.channel = channel
|
||||||
self.width = width
|
self.width = width
|
||||||
self.scale = float((int64(1) << width) * scale)
|
self.scale = float((int64(1) << width) / scale)
|
||||||
self.time_width = time_width
|
self.time_width = time_width
|
||||||
self.time_scale = float((1 << time_width) *
|
self.time_scale = float((1 << time_width) *
|
||||||
core_device.coarse_ref_period)
|
core_device.coarse_ref_period)
|
||||||
|
|
|
@ -10,7 +10,7 @@ These drivers are for the core device and the peripherals closely integrated int
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
:mod:`artiq.coredevice.ttl` module
|
:mod:`artiq.coredevice.ttl` module
|
||||||
-----------------------------------
|
----------------------------------
|
||||||
|
|
||||||
.. automodule:: artiq.coredevice.ttl
|
.. automodule:: artiq.coredevice.ttl
|
||||||
:members:
|
:members:
|
||||||
|
@ -43,7 +43,7 @@ These drivers are for the core device and the peripherals closely integrated int
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
:mod:`artiq.coredevice.cache` module
|
:mod:`artiq.coredevice.cache` module
|
||||||
-----------------------------------------
|
------------------------------------
|
||||||
|
|
||||||
.. automodule:: artiq.coredevice.cache
|
.. automodule:: artiq.coredevice.cache
|
||||||
:members:
|
:members:
|
||||||
|
@ -54,6 +54,12 @@ These drivers are for the core device and the peripherals closely integrated int
|
||||||
.. automodule:: artiq.coredevice.exceptions
|
.. automodule:: artiq.coredevice.exceptions
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
|
:mod:`artiq.coredevice.spline` module
|
||||||
|
-------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: artiq.coredevice.spline
|
||||||
|
:members:
|
||||||
|
|
||||||
:mod:`artiq.coredevice.sawg` module
|
:mod:`artiq.coredevice.sawg` module
|
||||||
-----------------------------------
|
-----------------------------------
|
||||||
|
|
||||||
|
@ -61,7 +67,7 @@ These drivers are for the core device and the peripherals closely integrated int
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
:mod:`artiq.coredevice.ad9154` module
|
:mod:`artiq.coredevice.ad9154` module
|
||||||
-----------------------------------
|
-------------------------------------
|
||||||
|
|
||||||
.. automodule:: artiq.coredevice.ad9154
|
.. automodule:: artiq.coredevice.ad9154
|
||||||
:members:
|
:members:
|
||||||
|
|
Loading…
Reference in New Issue