mirror of https://github.com/m-labs/artiq.git
wavesynth: interpolate->coefficients
This commit is contained in:
parent
0bab73eece
commit
7ea9250b31
|
@ -6,7 +6,7 @@ import struct
|
|||
|
||||
import serial
|
||||
|
||||
from artiq.wavesynth.interpolate import discrete_compensate
|
||||
from artiq.wavesynth.coefficients import discrete_compensate
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
|
@ -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):
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue