forked from M-Labs/artiq
1
0
Fork 0

wavesynth: cleanup

This commit is contained in:
Robert Jördens 2016-02-18 14:13:38 +01:00
parent b4ea318e6d
commit 1891725e12
2 changed files with 6 additions and 6 deletions

View File

@ -14,7 +14,7 @@ class TestSplineCoef(unittest.TestCase):
self.s = coefficients.SplineSource(self.x, self.y, order=4) self.s = coefficients.SplineSource(self.x, self.y, order=4)
def test_get_segment(self): def test_get_segment(self):
return list(self.s.get_segment_data(start=1.5, stop=3.2, scale=.01)) return list(self.s.get_segment(start=1.5, stop=3.2, scale=.01))
def test_synth(self): def test_synth(self):
d = self.test_get_segment() d = self.test_get_segment()
@ -34,7 +34,7 @@ class TestSplineCoef(unittest.TestCase):
def test_compare(self): def test_compare(self):
scale = 100 scale = 100
d = list(self.s.get_segment_data(start=0, stop=4, scale=1/scale)) d = list(self.s.get_segment(start=0, stop=4, scale=1/scale))
d[0]["trigger"] = True d[0]["trigger"] = True
s = compute_samples.Synthesizer(self.y.shape[0], [d]) s = compute_samples.Synthesizer(self.y.shape[0], [d])
s.select(0) s.select(0)

View File

@ -120,9 +120,9 @@ class CoefficientSource:
with `n` being the number of channels.""" with `n` being the number of channels."""
raise NotImplementedError raise NotImplementedError
def get_segment_data(self, start, stop, scale, *, cutoff=1e-12, def get_segment(self, start, stop, scale, *, cutoff=1e-12,
target="bias", variable="amplitude"): target="bias", variable="amplitude"):
"""Build wavesynth segment data. """Build wavesynth segment.
:param start: see `crop_x()`. :param start: see `crop_x()`.
:param stop: see `crop_x()`. :param stop: see `crop_x()`.
@ -147,7 +147,7 @@ class CoefficientSource:
See `get_segment()` for arguments. See `get_segment()` for arguments.
""" """
for i, line in enumerate(self.get_segment_data(*args, **kwargs)): for line in self.get_segment(*args, **kwargs):
segment.add_line(**line) segment.add_line(**line)