Use 4 carriers wit QAM16 to achieve 16kbps.

This commit is contained in:
Roman Zeyde
2014-06-21 12:55:36 +03:00
parent 5c6304823d
commit fbbc404b45
7 changed files with 71 additions and 49 deletions

17
errors.py Normal file
View File

@@ -0,0 +1,17 @@
import common
import sys
tx, rx = sys.argv[1:]
tx = open(tx).read()
rx = open(rx).read()
L = min(len(tx), len(rx))
rx = list(common.to_bits(rx[:L]))
tx = list(common.to_bits(tx[:L]))
indices = [index for index, (r, t) in enumerate(zip(rx, tx)) if r != t]
if indices:
total = L*8
errors = len(indices)
print('{}/{} bit error rate: {:.3f}%'.format(errors, total, (100.0 * errors) / total))
sys.exit(1)