mirror of
https://github.com/dnet/pySSTV.git
synced 2026-04-21 06:03:43 +00:00
avoid min/max function calls per sample
This commit is contained in:
parent
1a469c43d5
commit
1f5e2963ef
1 changed files with 2 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue