-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpipes-clientserver.sh
28 lines (24 loc) · 1.02 KB
/
pipes-clientserver.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
MATRIX=1024-512-8.txt
CLIENTES=$1
RSBYTES=223
FILE=test.txt
# generamos archivo random,32 Megabits
dd if=/dev/urandom of=test.txt count=16
SCRAMBLEBLOCK=$(echo "${RSBYTES}*4" | bc)
echo "----------------------------------------"
echo "Scrambler block:" ${SCRAMBLEBLOCK}
python -c "print 'Aprovechamiento: %f' % (((${CLIENTES}/330.0)/1)*(${RSBYTES}/(${RSBYTES} + 32.0)))"
# filtro via files
rm *.out
./rsenc <${FILE} | ./scrambler ${SCRAMBLEBLOCK} >rs.out
./raw2bin < rs.out >ldpc.out
#./bfenc ${CLIENTES} < ldpc.out | ./noisesim 120 100db 100db | ./bfdec ${CLIENTES} >bf.out
./bfenc ${CLIENTES} < ldpc.out | ./bfdec ${CLIENTES} >bf.out
#./bfenc-orig ${CLIENTES} < ldpc.out | ./bfdec-orig ${CLIENTES} >bf.out
./bin2raw <bf.out >ldpcdec.out
./descramble ${SCRAMBLEBLOCK} <ldpcdec.out | ./rsdec >rsdec.out
echo "BER post-bloomfilter: " `./ber ldpc.out bf.out`
echo "BER post-ldpc: " `./ber rs.out ldpcdec.out`
echo "BER post-reed-solomon: " `./ber ${FILE} rsdec.out`
echo ${CLIENTES} " " `./ber ${FILE} rsdec.out`