kopia lustrzana https://github.com/dnet/pySSTV
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
rodzic
c434bdef04
commit
4d56f34a72
|
@ -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):
|
||||
|
|
|
@ -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)
|
||||
|
|
Ładowanie…
Reference in New Issue