forked from M-Labs/artiq
1
0
Fork 0

sawg: artiq-python changes

This commit is contained in:
Robert Jördens 2016-11-29 16:58:26 +01:00
parent 82c651c17a
commit a3d9e21b8c
1 changed files with 7 additions and 6 deletions

View File

@ -90,15 +90,15 @@ class Spline:
vi = coeff[i] * self.scale vi = coeff[i] * self.scale
for j in range(i): for j in range(i):
vi *= self.time_scale vi *= self.time_scale
vi = int(round(vi)) ci = int(round(vi))
coeff64[i] = vi coeff64[i] = ci
# artiq.wavesynth.coefficients.discrete_compensate: # artiq.wavesynth.coefficients.discrete_compensate:
continue continue
if i == 2: if i == 2:
coeff64[1] += vi >> (self.time_width + 1) coeff64[1] += ci >> (self.time_width + 1)
elif i == 3: elif i == 3:
coeff64[2] += vi >> self.time_width coeff64[2] += ci >> self.time_width
coeff64[1] += (vi // 3) >> (2*self.time_width + 1) coeff64[1] += (ci // 3) >> (2*self.time_width + 1)
return self.pack_coeff_mu(coeff64) return self.pack_coeff_mu(coeff64)
@kernel @kernel
@ -111,7 +111,8 @@ class Spline:
self.set_list_mu(self.coeff_to_mu(value)) self.set_list_mu(self.coeff_to_mu(value))
@kernel(flags={"fast-math"}) @kernel(flags={"fast-math"})
def smooth(self, start, stop, duration, order): def smooth(self, start: TFloat, stop: TFloat, duration: TFloat,
order: TInt32):
"""Initiate an interpolated value change. """Initiate an interpolated value change.
The third order interpolation is constrained to have zero first The third order interpolation is constrained to have zero first