mirror of
https://github.com/dnet/pySSTV.git
synced 2026-01-06 16:50:00 +01:00
gen_values: precalculate sin() param factor
This commit is contained in:
parent
105fa7b051
commit
dcb194a5f0
|
|
@ -75,13 +75,13 @@ class SSTV(object):
|
|||
spms = self.samples_per_sec / 1000
|
||||
param = 0
|
||||
samples = 0
|
||||
factor = 2 * pi / self.samples_per_sec
|
||||
for freq, msec in self.gen_freq_bits():
|
||||
offset = param
|
||||
samples += spms * msec
|
||||
tx = floor(samples)
|
||||
for sample in xrange(int(tx)):
|
||||
t = sample / self.samples_per_sec
|
||||
param = t * freq * 2 * pi + offset
|
||||
param = sample * freq * factor + offset
|
||||
yield sin(param)
|
||||
samples -= tx
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue