Skip to content

Commit 7ea9250

Browse files
committedApr 5, 2015
wavesynth: interpolate->coefficients
1 parent 0bab73e commit 7ea9250

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed
 

Diff for: ‎artiq/devices/pdq2/driver.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import serial
88

9-
from artiq.wavesynth.interpolate import discrete_compensate
9+
from artiq.wavesynth.coefficients import discrete_compensate
1010

1111

1212
logger = logging.getLogger(__name__)

Diff for: ‎artiq/wavesynth/interpolate.py renamed to ‎artiq/wavesynth/coefficients.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,14 @@ def _interpolate(time, data, sample_times, order=3):
2424

2525

2626
def discrete_compensate(c):
27-
if len(c) > 2:
28-
c[1] += c[2]/2
29-
if len(c) > 3:
30-
c[1] += c[3]/6
27+
l = len(c)
28+
if l > 2:
29+
c[1] += c[2]/2.
30+
if l > 3:
31+
c[1] += c[3]/6.
3132
c[2] += c[3]
33+
if l > 4:
34+
raise ValueError("only third-order splines supported")
3235

3336

3437
def _zip_program(times, channels, target):

Diff for: ‎artiq/wavesynth/compute_samples.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from copy import copy
22
from math import cos, pi
33

4-
from artiq.wavesynth.interpolate import discrete_compensate
4+
from artiq.wavesynth.coefficients import discrete_compensate
55

66

77
class Spline:

0 commit comments

Comments
 (0)
Please sign in to comment.