From 5ef7feb5d6eb5939f6fef3115188b240bf673f3b Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Fri, 18 Jul 2014 13:59:12 +0300 Subject: [PATCH] print ecc ratio --- send.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/send.py b/send.py index fb30a4f..204a104 100755 --- a/send.py +++ b/send.py @@ -61,7 +61,8 @@ def main(fname): log.info('%d bits to be send', len(data)*8) bits = list(to_bits(ecc.encode(data))) - log.info('%d bits modulated (with ECC)', len(bits)) + ecc_ratio = 1.0 - len(data)*8.0 / len(bits) + log.info('%d bits modulated (%.1f%% ECC)', len(bits), ecc_ratio * 100) modulate(fd, bits) data_size = fd.tell() - training_size log.info('%.3f seconds of data audio',