Files
edgetx-gx12/radio/util/sinus.py
T
Bertrand Songis 99e42ceeb2 Different harmonics. Seem to be better. I would say that:
- all beeps from the radio need to be lowered.
- perhaps the low frequencies don't need to be amplified any more?
2014-02-20 23:26:34 +01:00

17 lines
384 B
Python

#!/bin/env python
import math
samples = 1024
amplitudes = (28000, 0, 28000, 0, 28000)
for i in range(samples):
sample = 0.0
for harmonic, amplitude in enumerate(amplitudes):
sample += math.sin(math.pi*2*i*(harmonic+1)/samples) * amplitude / 2
if sample > 32767 or sample < -32768:
print "erreur"
print "%d," % int(sample),
if i % 10 == 9:
print