mirror of
https://github.com/romanz/amodem.git
synced 2026-03-18 07:36:02 +08:00
remove hardcoded data files
This commit is contained in:
4
recv.py
4
recv.py
@@ -3,6 +3,7 @@ import numpy as np
|
||||
import logging
|
||||
import itertools
|
||||
import time
|
||||
import sys
|
||||
import os
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
@@ -194,8 +195,7 @@ def main(fname):
|
||||
return
|
||||
|
||||
log.info('Decoded %.3f kB', len(data) / 1e3)
|
||||
with file('data.recv', 'wb') as f:
|
||||
f.write(data)
|
||||
sys.stdout.write(data)
|
||||
|
||||
if __name__ == '__main__':
|
||||
logging.basicConfig(level=logging.INFO,
|
||||
|
||||
5
send.py
5
send.py
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
import numpy as np
|
||||
|
||||
import sys
|
||||
import logging
|
||||
import itertools
|
||||
|
||||
@@ -17,8 +17,7 @@ class Symbol(object):
|
||||
carrier = [np.exp(2j * np.pi * F * t) for F in frequencies]
|
||||
|
||||
sym = Symbol()
|
||||
|
||||
data = open('data.send', 'r').read()
|
||||
data = sys.stdin.read()
|
||||
|
||||
|
||||
def write(fd, sym, n=1):
|
||||
|
||||
4
test.sh
4
test.sh
@@ -3,7 +3,7 @@ set -u
|
||||
set -e
|
||||
|
||||
dd if=/dev/urandom of=data.send bs=1024 count=16 status=none
|
||||
./send.py tx.int16
|
||||
./send.py tx.int16 < data.send
|
||||
|
||||
killall arecord aplay || true
|
||||
|
||||
@@ -13,7 +13,7 @@ sleep 1
|
||||
|
||||
killall arecord aplay || true
|
||||
|
||||
./recv.py rx.int16
|
||||
./recv.py rx.int16 > data.recv
|
||||
./errors.py data.*
|
||||
if [ -z $? ]; then
|
||||
./show.py tx.int16 rx.int16
|
||||
|
||||
Reference in New Issue
Block a user