mirror of https://github.com/m-labs/artiq.git
sawg: demo_2tone
This commit is contained in:
parent
a324f4faa1
commit
d6f6ebf066
|
@ -0,0 +1,46 @@
|
||||||
|
from artiq.experiment import *
|
||||||
|
|
||||||
|
|
||||||
|
class SAWGTest(EnvExperiment):
|
||||||
|
def build(self):
|
||||||
|
self.setattr_device("core")
|
||||||
|
self.setattr_device("led")
|
||||||
|
self.setattr_device("ttl_sma")
|
||||||
|
|
||||||
|
self.setattr_device("sawg0")
|
||||||
|
self.setattr_device("sawg1")
|
||||||
|
self.setattr_device("sawg2")
|
||||||
|
self.setattr_device("sawg3")
|
||||||
|
|
||||||
|
@kernel
|
||||||
|
def run(self):
|
||||||
|
self.core.break_realtime()
|
||||||
|
self.ttl_sma.output()
|
||||||
|
|
||||||
|
while True:
|
||||||
|
t_up = t_hold = t_down = 800*ns
|
||||||
|
a1 = .3
|
||||||
|
a2 = .4
|
||||||
|
order = 3
|
||||||
|
|
||||||
|
delay(20*ms)
|
||||||
|
self.sawg0.frequency0.set(10*MHz)
|
||||||
|
self.sawg0.phase0.set(0.)
|
||||||
|
self.sawg0.frequency1.set(1*MHz)
|
||||||
|
self.sawg0.phase1.set(0.)
|
||||||
|
self.sawg0.frequency2.set(9*MHz)
|
||||||
|
self.sawg0.phase2.set(0.)
|
||||||
|
with parallel:
|
||||||
|
self.sawg0.amplitude1.smooth(.0, a1, t_up, order)
|
||||||
|
self.sawg0.amplitude2.smooth(.0, a2, t_up, order)
|
||||||
|
self.sawg0.amplitude1.set(a1)
|
||||||
|
self.sawg0.amplitude2.set(a2)
|
||||||
|
delay(t_hold)
|
||||||
|
with parallel:
|
||||||
|
self.sawg0.amplitude1.smooth(a1, .0, t_down, order)
|
||||||
|
self.sawg0.amplitude2.smooth(a2, .0, t_down, order)
|
||||||
|
self.sawg0.amplitude1.set(.0)
|
||||||
|
self.sawg0.amplitude2.set(.0)
|
||||||
|
|
||||||
|
self.sawg1.amplitude1.set(.0)
|
||||||
|
self.sawg1.amplitude2.set(.0)
|
Loading…
Reference in New Issue