Skip to content

Commit

Permalink
wavesynth: interpolate->coefficients
Browse files Browse the repository at this point in the history
jordens committed Apr 5, 2015
1 parent 0bab73e commit 7ea9250
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion artiq/devices/pdq2/driver.py
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@

import serial

from artiq.wavesynth.interpolate import discrete_compensate
from artiq.wavesynth.coefficients import discrete_compensate


logger = logging.getLogger(__name__)
Original file line number Diff line number Diff line change
@@ -24,11 +24,14 @@ def _interpolate(time, data, sample_times, order=3):


def discrete_compensate(c):
if len(c) > 2:
c[1] += c[2]/2
if len(c) > 3:
c[1] += c[3]/6
l = len(c)
if l > 2:
c[1] += c[2]/2.
if l > 3:
c[1] += c[3]/6.
c[2] += c[3]
if l > 4:
raise ValueError("only third-order splines supported")


def _zip_program(times, channels, target):
2 changes: 1 addition & 1 deletion artiq/wavesynth/compute_samples.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from copy import copy
from math import cos, pi

from artiq.wavesynth.interpolate import discrete_compensate
from artiq.wavesynth.coefficients import discrete_compensate


class Spline:

0 comments on commit 7ea9250

Please sign in to comment.