mirror of
https://github.com/romanz/amodem.git
synced 2026-05-09 21:13:04 +08:00
calib: use shorter signals.
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user