gen_values: fixed FM sample repetition bug

In the previous version, the FM modulator issued the last sample of the
previous frequency-time tuple twice, once as the last sample of the
previous tuple, once as the first sample (sample = 0) of the next one.
ironpython
András Veres-Szentkirályi 2013-11-22 17:00:53 +01:00
rodzic c434bdef04
commit 4d56f34a72
2 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -83,7 +83,7 @@ class SSTV(object):
freq_factor = freq * factor
for sample in xrange(tx):
yield sin(sample * freq_factor + offset)
offset += sample * freq_factor
offset += (sample + 1) * freq_factor
samples -= tx
def gen_freq_bits(self):

Wyświetl plik

@ -69,7 +69,7 @@ class TestSSTV(unittest.TestCase):
mock_open = MagicMock(return_value=sio)
with mock.patch('__builtin__.open', mock_open):
self.s.write_wav('unittest.wav')
expected = '8aa1d52b222b411e032ce2bce77d203a'
expected = 'dd7eed880ab3360fb79ce09c469deee2'
data = sio.getvalue()
actual = hashlib.md5(data).hexdigest()
self.assertEqual(expected, actual)