2015-12-05 23:43:39 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# jt65 end-to-end simulator. Run enough cases to get a given
|
|
|
|
# number of successful decodes or a given number of errors
|
2016-01-03 18:14:17 -05:00
|
|
|
# For better performance, copy this script and jt65, jt65sim
|
|
|
|
# executables to a ramdisk and run from there.
|
2015-12-05 23:43:39 -05:00
|
|
|
|
|
|
|
nruns=0
|
|
|
|
ndecodes=0
|
|
|
|
ngood=0
|
|
|
|
nbad=0
|
2016-01-03 18:14:17 -05:00
|
|
|
snr=-26.0
|
2015-12-05 23:43:39 -05:00
|
|
|
|
2016-01-03 18:14:17 -05:00
|
|
|
#while [ $[ $nruns - $ngood ] -lt 200 ]
|
|
|
|
#while [ $ngood -lt 200 ]
|
|
|
|
while [ $nruns -lt 20000 ]
|
2015-12-05 23:43:39 -05:00
|
|
|
|
|
|
|
do
|
2016-01-03 18:14:17 -05:00
|
|
|
rm 000000_0001.wav
|
|
|
|
./jt65sim -n 1 -d 0.0 -s \\$snr > /dev/null
|
|
|
|
rm decoded.txt
|
|
|
|
./jt65 -a 10 -f 1500 -n 10 -s 000000_0001.wav > decoded.txt
|
|
|
|
if [ -e decoded.txt ]; then
|
|
|
|
nd=$( wc -l < decoded.txt )
|
|
|
|
ng=$( grep "K1ABC" decoded.txt | wc -l )
|
|
|
|
nb=$[$nd-$ng]
|
|
|
|
ndecodes=$[$ndecodes + $nd]
|
|
|
|
ngood=$[$ngood + $ng]
|
|
|
|
nbad=$[$nbad + $nb]
|
2015-12-05 23:43:39 -05:00
|
|
|
fi
|
2016-01-03 18:14:17 -05:00
|
|
|
nruns=$[$nruns + 1]
|
|
|
|
nmissed=$[$nruns-$ngood]
|
|
|
|
pe=$( echo "scale=5; $nmissed/$nruns" | bc -l )
|
|
|
|
ps=$( echo "scale=5; $ngood/$nruns" | bc -l )
|
|
|
|
echo -en snr: $snr nruns: $nruns ndecodes: $ndecodes ngood: $ngood nbad: $nbad nmissed: $nmissed wer: $pe success: $ps"\r"
|
2015-12-05 23:43:39 -05:00
|
|
|
done
|
2016-01-03 18:14:17 -05:00
|
|
|
echo snr: $snr nruns: $nruns ndecodes: $ndecodes ngood: $ngood nbad: $nbad nmissed: $nmissed wer: $pe success: $ps
|
2015-12-05 23:43:39 -05:00
|
|
|
|