calib: use shorter signals.

This commit is contained in:
Roman Zeyde
2015-01-06 12:39:13 +02:00
parent a30ee7f92c
commit b3510c18b3

View File

@@ -11,11 +11,12 @@ ALLOWED_EXCEPTIONS = (IOError, KeyboardInterrupt)
def send(config, dst, src=None, verbose=False): def send(config, dst, src=None, verbose=False):
calibration_symbols = int(1.0 * config.Fs) calibration_symbols = int(1.0 * config.Fs)
t = np.arange(0, calibration_symbols) * config.Ts t = np.arange(0, calibration_symbols) * config.Ts
signal = [np.sin(2 * np.pi * f * t) for f in config.frequencies] signals = [np.sin(2 * np.pi * f * t) for f in config.frequencies]
signal = common.dumps(np.concatenate(signal)) signals = map(common.dumps, signals)
try: try:
while True: while True:
for signal in signals:
dst.write(signal) dst.write(signal)
except ALLOWED_EXCEPTIONS: except ALLOWED_EXCEPTIONS:
pass pass