mirror of
https://github.com/romanz/amodem.git
synced 2026-04-18 20:25:59 +08:00
call recv.py and send.py with filename as an argument
This commit is contained in:
9
send.py
9
send.py
@@ -42,11 +42,11 @@ def modulate(sig, bits):
|
||||
if all(symbols == 0):
|
||||
break
|
||||
|
||||
def main():
|
||||
def main(fname):
|
||||
import ecc
|
||||
log.info('Running MODEM @ {:.1f} kbps'.format(sigproc.modem_bps / 1e3))
|
||||
|
||||
with open('tx.int16', 'wb') as fd:
|
||||
with open(fname, 'wb') as fd:
|
||||
start(fd, sym.carrier[carrier_index])
|
||||
for c in sym.carrier:
|
||||
training(fd, c)
|
||||
@@ -55,5 +55,6 @@ def main():
|
||||
modulate(fd, bits)
|
||||
|
||||
if __name__ == '__main__':
|
||||
logging.basicConfig(level=logging.DEBUG, format='%(message)s')
|
||||
main()
|
||||
import sys
|
||||
logging.basicConfig(level=logging.INFO, format='%(asctime)s %(levelname)-12s %(message)s')
|
||||
main(fname=sys.argv[1])
|
||||
|
||||
Reference in New Issue
Block a user