File: fer

package info (click to toggle)
jtdx 2.2.159%2Bimproved-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 75,336 kB
  • sloc: cpp: 38,503; f90: 31,141; python: 27,061; ansic: 11,772; sh: 409; fortran: 353; makefile: 232
file content (38 lines) | stat: -rw-r--r-- 1,176 bytes parent folder | download
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
29
30
31
32
33
34
35
36
37
38
#!/bin/bash

# jt65 end-to-end simulator. Run enough cases to get a given
# number of successful decodes or a given number of errors
# For better performance, copy this script and jt65, jt65sim
# executables to a ramdisk and run from there.

nruns=0
ndecodes=0
ngood=0
nbad=0
snr=-26.0

#while [ $[ $nruns - $ngood ] -lt 200 ] 
#while [ $ngood -lt 200 ] 
while [ $nruns -lt 20000 ] 

do
  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]
  fi
  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"
done
echo snr: $snr nruns: $nruns ndecodes: $ndecodes ngood: $ngood nbad: $nbad nmissed: $nmissed wer: $pe success: $ps