forked from M-Labs/artiq
1
0
Fork 0

wavesynth/compute_samples/: demonstrate dds clear

This commit is contained in:
Sebastien Bourdeauducq 2015-03-15 18:13:47 +01:00
parent 40bd101de0
commit 2257cfa952
1 changed files with 43 additions and 6 deletions

View File

@ -112,7 +112,7 @@ def main():
[ [
# segment 0 # segment 0
{ {
# line 0 # segment 0, line 0
"dac_divider": 1, "dac_divider": 1,
"duration": 100, "duration": 100,
"channel_data": [ "channel_data": [
@ -127,7 +127,7 @@ def main():
"jump": False "jump": False
}, },
{ {
# line 1 # segment 1, line 1
"dac_divider": 1, "dac_divider": 1,
"duration": 100, "duration": 100,
"channel_data": [ "channel_data": [
@ -145,7 +145,7 @@ def main():
[ [
# segment 1 # segment 1
{ {
# line 2 # segment 1, line 0
"dac_divider": 1, "dac_divider": 1,
"duration": 100, "duration": 100,
"channel_data": [ "channel_data": [
@ -160,28 +160,65 @@ def main():
"jump": False "jump": False
}, },
{ {
# line 3 # segment 1, line 1
"dac_divider": 1, "dac_divider": 1,
"duration": 100, "duration": 100,
"channel_data": [ "channel_data": [
{ {
# channel 0 # channel 0
"dds": {"amplitude": [50.5, -1.0, 0.01], "dds": {"amplitude": [50.5, -1.0, 0.01],
"phase": [0.0, 100.05, -0.0005], "phase": [0.0, 0.05, -0.0005],
"clear": False} "clear": False}
} }
], ],
"wait_trigger": False, "wait_trigger": False,
"jump": True "jump": True
} }
],
[
# segment 2
{
# segment 2, line 0
"dac_divider": 1,
"duration": 84,
"channel_data": [
{
# channel 0
"dds": {"amplitude": [100.0],
"phase": [0.0, 0.05],
"clear": False}
}
],
"wait_trigger": True,
"jump": False
},
{
# segment 2, line 1
"dac_divider": 1,
"duration": 116,
"channel_data": [
{
# channel 0
"dds": {"amplitude": [100.0],
"phase": [0.0, 0.05],
"clear": True}
}
],
"wait_trigger": False,
"jump": True
}
] ]
] ]
x = list(range(400)) x = list(range(600))
s = Synthesizer(1, program) s = Synthesizer(1, program)
r = s.trigger(0) r = s.trigger(0)
y = r[0] y = r[0]
r = s.trigger(2)
y += r[0]
r = s.trigger()
y += r[0]
r = s.trigger(1) r = s.trigger(1)
y += r[0] y += r[0]
cairoplot.scatter_plot("plot.png", [x, y]) cairoplot.scatter_plot("plot.png", [x, y])