mirror of
https://github.com/dnet/pySSTV.git
synced 2026-01-20 23:40:26 +01:00
avoid min/max function calls per sample
This commit is contained in:
parent
1a469c43d5
commit
1f5e2963ef
|
|
@ -61,7 +61,8 @@ class SSTV(object):
|
|||
for value in self.gen_values():
|
||||
sample = int(round(value * amp + alias * (random() - 0.5)))
|
||||
for chan in chans:
|
||||
yield max(min(highest, sample), lowest)
|
||||
yield (lowest if sample <= lowest else
|
||||
sample if sample <= highest else highest)
|
||||
|
||||
def gen_values(self):
|
||||
"""generates samples between -1 and +1 from gen_freq_bits()
|
||||
|
|
|
|||
Loading…
Reference in a new issue