mirror of
https://github.com/romanz/amodem.git
synced 2026-03-24 03:11:15 +08:00
calib: pep8
This commit is contained in:
@@ -9,9 +9,9 @@ from . import config
|
|||||||
from . import wave
|
from . import wave
|
||||||
|
|
||||||
CALIBRATION_SYMBOLS = int(1.0 * config.Fs)
|
CALIBRATION_SYMBOLS = int(1.0 * config.Fs)
|
||||||
|
|
||||||
ALLOWED_EXCEPTIONS = (IOError, KeyboardInterrupt)
|
ALLOWED_EXCEPTIONS = (IOError, KeyboardInterrupt)
|
||||||
|
|
||||||
|
|
||||||
def send(wave_play=wave.play):
|
def send(wave_play=wave.play):
|
||||||
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]
|
signal = [np.sin(2 * np.pi * f * t) for f in config.frequencies]
|
||||||
@@ -30,6 +30,7 @@ def send(wave_play=wave.play):
|
|||||||
|
|
||||||
FRAME_LENGTH = 100 * config.Nsym
|
FRAME_LENGTH = 100 * config.Nsym
|
||||||
|
|
||||||
|
|
||||||
def recorder(process):
|
def recorder(process):
|
||||||
frame_size = int(wave.bytes_per_sample * FRAME_LENGTH)
|
frame_size = int(wave.bytes_per_sample * FRAME_LENGTH)
|
||||||
fd = process.stdout
|
fd = process.stdout
|
||||||
@@ -46,6 +47,7 @@ def recorder(process):
|
|||||||
finally:
|
finally:
|
||||||
process.kill()
|
process.kill()
|
||||||
|
|
||||||
|
|
||||||
def recv(wave_record=wave.record, log=sys.stdout.write):
|
def recv(wave_record=wave.record, log=sys.stdout.write):
|
||||||
t = np.arange(0, FRAME_LENGTH) * config.Ts
|
t = np.arange(0, FRAME_LENGTH) * config.Ts
|
||||||
carriers = [np.exp(2j * np.pi * f * t) for f in config.frequencies]
|
carriers = [np.exp(2j * np.pi * f * t) for f in config.frequencies]
|
||||||
|
|||||||
Reference in New Issue
Block a user