diff --git a/test/leandvb_bench.gnuplot b/test/leandvb_bench.gnuplot index aba41a2..d535027 100644 --- a/test/leandvb_bench.gnuplot +++ b/test/leandvb_bench.gnuplot @@ -14,25 +14,30 @@ set grid #set term wxt size 800,480 #set term qt size 800,480 -#set term gif medium size 800,480 +set term gif medium size 1280,768 set output "leandvb_bench_results.gif" set object rectangle from 0,1e-7 to 4.5,2e-4 behind fillcolor rgbcolor "black" fillstyle solid 0.1 noborder -set label "DVB-S\nerror performance\nrequirements" at 2.8,1.1e-5 center rotate by 90 +set label "DVB-S\nerror performance\nrequirements\n(vber 2e-4 at 4.5 dB)" at 2.8,1.1e-5 center rotate by 90 plot "leandvb_bench_results.txt" index "1.2sps-hs." using 4:($8+$9)/2:8:9 with yerrorlines title "1.2sps-hs (HamTV on Raspberry Pi 2)" , \ "leandvb_bench_results.txt" index "2.4sps-hs." using 4:($8+$9)/2:8:9 with yerrorlines title "2.4sps-hs" , \ "leandvb_bench_results.txt" index "4.2sps-hs." using 4:($8+$9)/2:8:9 with yerrorlines title "4.2sps-hs" , \ "leandvb_bench_results.txt" index "1.2sps." using 4:($8+$9)/2:8:9 with yerrorlines title "1.2sps (HamTV on tablet)" , \ "leandvb_bench_results.txt" index "4.2sps." using 4:($8+$9)/2:8:9 with yerrorlines title "4.2sps" , \ - "leandvb_bench_results.txt" index "4.2sps-resample." using 4:($8+$9)/2:8:9 with yerrorlines title "4.2sps-resample" , \ + "leandvb_bench_results.txt" index "4.2sps-rrc." using 4:($8+$9)/2:8:9 with yerrorlines title "4.2sps-rrc" , \ "leandvb_bench_results.txt" index "1.2sps-viterbi." using 4:($8+$9)/2:8:9 with yerrorlines title "1.2sps-viterbi (HamTV on desktop)" , \ - "leandvb_bench_results.txt" index "1.2sps-viterbi-resample." using 4:($8+$9)/2:8:9 with yerrorlines title "1.2sps-viterbi-resample" , \ - "leandvb_bench_results.txt" index "2.4sps-viterbi-resample." using 4:($8+$9)/2:8:9 with yerrorlines title "2.4sps-viterbi-resample" , \ - "leandvb_bench_results.txt" index "4sps-viterbi-resample." using 4:($8+$9)/2:8:9 with yerrorlines title "4sps-viterbi-resample" , \ - 0.5*erfc(sqrt(10**((x-1.16-3)/10))) with lines title "QPSK-3dB-1.16dB" , \ - 0.5*erfc(sqrt(10**(x/10))) with lines title "QPSK" , \ - "leandvb_bench_results.txt" index "4.2sps-viterbi-resample." using 4:($8+$9)/2:8:9 with yerrorlines title "4.2sps-viterbi-resample" , \ + 0.5*erfc(sqrt(10**(x/10))) with lines title "Uncoded QPSK" , \ + "leandvb_bench_results.txt" index "1.2sps-viterbi-rrc." using 4:($8+$9)/2:8:9 with yerrorlines title "1.2sps-viterbi-rrc" , \ + "leandvb_bench_results.txt" index "2.4sps-viterbi-rrc." using 4:($8+$9)/2:8:9 with yerrorlines title "2.4sps-viterbi-rrc" , \ + "leandvb_bench_results.txt" index "4sps-viterbi-rrc." using 4:($8+$9)/2:8:9 with yerrorlines title "4sps-viterbi-rrc" , \ + "leandvb_bench_results.txt" index "4.2sps-viterbi-rrc." using 4:($8+$9)/2:8:9 with yerrorlines title "4.2sps-viterbi-rrc" , \ "leandvb_bench_results.txt" index "8.2sps." using 4:($8+$9)/2:8:9 with yerrorlines title "8.2sps" , \ - "leandvb_bench_results.txt" index "8sps-viterbi-resample." using 4:($8+$9)/2:8:9 with yerrorlines title "8sps-viterbi-resample" , \ + "leandvb_bench_results.txt" index "8sps-viterbi-rrc." using 4:($8+$9)/2:8:9 with yerrorlines title "8sps-viterbi-rrc" , \ + "leandvb_bench_results.txt" index "32sps-viterbi-rrc." using 4:($8+$9)/2:8:9 with yerrorlines title "32sps-viterbi-rrc" , \ + "leandvb_bench_results.txt" index "test." using 4:($8+$9)/2:8:9 with yerrorlines title "test" , \ + "leandvb_bench_results.txt" index "satmodem4200-60sps." using 4:($8+$9)/2:8:9 with yerrorlines title "satmodem4200-60sps" , \ 2e-4 with lines title "Quasi-error-free threshold" + +set term qt size 2048, 1024 +replot \ No newline at end of file diff --git a/test/leandvb_bench.sh b/test/leandvb_bench.sh index 7d44866..7c96cda 100755 --- a/test/leandvb_bench.sh +++ b/test/leandvb_bench.sh @@ -9,6 +9,7 @@ COMMIT="git:$(git rev-parse --short HEAD)" case $(cat /proc/cpuinfo) in *i3-2357M*) PLATFORM="laptop_i3_1300M" ;; + *i5-3337U*) PLATFORM="laptop_i5_1800M" ;; *i7-4770R*) PLATFORM="desktop_i7_3200M" ;; *ARMv7*) PLATFORM="raspberry_pi_2" ;; *) PLATFORM="other" ;; @@ -17,24 +18,42 @@ esac run() { echo $* 1>&1 local ratio="$1" + local snrtarget="$2" + local flags="$3" + local symbrate=1000000 local samprate=$(echo "$symbrate*$ratio" | bc) - local noise="$2" # RMS total noise - local ibnoise=$(echo "$noise/sqrt($ratio)" | bc -l) # RMS in-band noise - local rxsnr=$(echo "20 * l(75/$ibnoise)/l(10)" | bc -l) + local noisepow sigpow float_scale=0 + if [ "$flags" = "--u8 --hs" ]; then + # In HS mode we expect the receiver gain to be set + # so that the u8 modulation amplitude matches cstln_amp. + sigpow="37.5" + noisepow=$(echo "$sigpow - $snrtarget" | bc -l) + else + # Otherwise, set arbitrary fixed noise floor + # and adjust display scale accordingly. + sigpow="$snrtarget" + noisepow=0 + float_scale=$(echo "10*sqrt($ratio)" | bc -l) + fi + local rxsnr=$(echo "$sigpow - $noisepow" | bc -l) rxsnr=$(printf "%.2f" $rxsnr) - local flags="$3" local cnr= [ $samprate -gt $((3*symbrate)) ] && cnr="--cnr" local ou8= [ "$flags" = "--u8 --hs" ] && ou8="--ou8" - cmd="$BINDIR/leantsgen -c 2000 \ - | $BINDIR/leandvbtx -f $ratio \ - | $BINDIR/leanchansim --awgn $noise --deterministic $ou8 \ - | $BINDIR/leandvb --f32 -f $samprate --sr $symbrate --anf 0 \ - $cnr --gui --fd-info 2 $flags 2>&1 > /dev/null" + # How long to try to lock onto the signal. + local NPACKETS=3000 + # Measurement window. Should contain at least 10/BER bits. + local MINPACKETS=1000 + + cmd="$BINDIR/leantsgen -c $NPACKETS \ + | $BINDIR/leandvbtx -f $ratio --power $sigpow --agc \ + | $BINDIR/leanchansim --awgn $noisepow --deterministic $ou8 \ + | $BINDIR/leandvb --f32 --float-scale $float_scale -f $samprate --sr $symbrate --anf 0 \ + $cnr --gui --fd-info 2 $flags 2>&1 > /dev/null" echo $cmd 1>&2 eval $cmd | ( local cnr ss mer vbermin vbermax @@ -59,7 +78,7 @@ run() { CNR) cnr=$arg ;; SS) ss=$arg ;; MER) mer=$arg ;; - LOCKTIME) if [ $arg -ge 1000 ]; then success=1; break; fi ;; + LOCKTIME) if [ $arg -ge $MINPACKETS ]; then success=1; break; fi ;; esac done; if [ "$success" = 1 ]; then @@ -81,134 +100,38 @@ index() { ###################################################################### -index "1.2sps-hs" -run 6/5 5 "--u8 --hs" -run 6/5 6 "--u8 --hs" -run 6/5 8 "--u8 --hs" -run 6/5 10 "--u8 --hs" -run 6/5 12 "--u8 --hs" -run 6/5 14 "--u8 --hs" -# run 6/5 16 "--u8 --hs" -# run 6/5 18 "--u8 --hs" -# run 6/5 20 "--u8 --hs" +SELECTED_SERIES="$1" -index "2.4sps-hs" -run 12/5 9 "--u8 --hs" -run 12/5 10 "--u8 --hs" -run 12/5 12 "--u8 --hs" -run 12/5 15 "--u8 --hs" -run 12/5 20 "--u8 --hs" -run 12/5 25 "--u8 --hs" -# run 12/5 30 "--u8 --hs" +test_series() { + local name="$1" + local ratio="$2" + local cnrvals="$3" + local options="$4" -index "4.2sps-hs" -run 21/5 12 "--u8 --hs" -run 21/5 15 "--u8 --hs" -run 21/5 18 "--u8 --hs" -run 21/5 20 "--u8 --hs" -run 21/5 22 "--u8 --hs" -run 21/5 25 "--u8 --hs" -# run 12/5 30 "--u8 --hs" + [ -n "$SELECTED_SERIES" -a "$name" != "$SELECTED_SERIES" ] && return; -index "1.2sps" -run 6/5 8 -run 6/5 9 -run 6/5 10 -run 6/5 11 -run 6/5 12 -run 6/5 13 -run 6/5 14 - run 6/5 15 + index "$name" + for cnr in $cnrvals; do + run $ratio $cnr "$options" + done +} -if false; then -index "4sps-viterbi-resample" -run 4 60 "--viterbi --resample" -run 4 65 "--viterbi --resample" -run 4 70 "--viterbi --resample" -run 4 75 "--viterbi --resample" -run 4 80 "--viterbi --resample" -fi +test_series "1.2sps-hs" 6/5 "20 19 18 17 16 15 14 13 12 11 10" "--u8 --hs" +test_series "2.4sps-hs" 12/5 "20 18 16 14 12 10" "--u8 --hs" +test_series "4.2sps-hs" 21/5 "20 18 16 14 12 10" "--u8 --hs" +test_series "1.2sps" 6/5 "22 21 20 19 18 17 16 15" +test_series "4sps-viterbi-rrc" 4 "6.5 6.0 5.5 5.0 4.5" "--viterbi --sampler rrc" +test_series "4.2sps" 21/5 "20 19 18 17 16 15 14" +test_series "8.2sps" 41/5 "21 20 19 18" +test_series "4.2sps-rrc" 21/5 "16 15 14 13 12 11 10" "--sampler rrc" +test_series "1.2sps-viterbi" 6/5 "12 11 10.5 10 9.5 9 8.5" "--viterbi" +test_series "1.2sps-viterbi-rrc" 6/5 "10 9 8.5 8 7 6 5 4" "--viterbi --sampler rrc" +test_series "2.4sps-viterbi-rrc" 12/5 "8 7 6 5.8 5.6 5.4 5.2 5.0 4.8" "--viterbi --sampler rrc" +test_series "4.2sps-viterbi-rrc" 21/5 "6 5 4.8 4.6 4.5 4.4 4.3 4.2 4.0 3.8" "--viterbi --sampler rrc" +test_series "8sps-viterbi-rrc" 8 "6 5 4.8 4.6 4.5 4.4 4.3 4.2 4.0 3.8" "--viterbi --sampler rrc" +test_series "32sps-viterbi-rrc" 32 "6 5 4.8 4.6 4.5 4.4 4.3 4.2 4.0 3.8" "--viterbi --sampler rrc" -index "4.2sps" -run 21/5 15 -run 21/5 18 -run 21/5 20 -run 21/5 22 -run 21/5 25 -run 21/5 30 -# run 21/5 35 -# run 21/5 40 - -if false; then -index "8.2sps" -run 41/5 10 -run 41/5 15 -run 41/5 20 -run 41/5 22 -run 41/5 25 -run 41/5 30 -fi - -index "4.2sps-resample" -run 21/5 18 "--resample" -run 21/5 20 "--resample" -run 21/5 22 "--resample" -run 21/5 24 "--resample" -run 21/5 26 "--resample" -run 21/5 28 "--resample" -run 21/5 30 "--resample" -run 21/5 32 "--resample" -run 21/5 34 "--resample" - -index "1.2sps-viterbi" -run 6/5 26.0 "--viterbi" -run 6/5 27.0 "--viterbi" -run 6/5 28.0 "--viterbi" - - -if false; then -index "1.2sps-viterbi-resample" -run 6/5 24.0 "--viterbi --resample" -run 6/5 24.1 "--viterbi --resample" -run 6/5 24.2 "--viterbi --resample" -fi - -if false; then -index "2.4sps-viterbi-resample" -run 12/5 46 "--viterbi --resample" -run 12/5 47 "--viterbi --resample" -run 12/5 48 "--viterbi --resample" -run 12/5 49.0 "--viterbi --resample" -run 12/5 49.2 "--viterbi --resample" -run 12/5 49.4 "--viterbi --resample" -run 12/5 49.6 "--viterbi --resample" -run 12/5 49.8 "--viterbi --resample" -run 12/5 50.0 "--viterbi --resample" -fi - -index "4.2sps-viterbi-resample" -#run 21/5 50 "--viterbi --resample" -#run 21/5 55 "--viterbi --resample" -run 21/5 60 "--viterbi --resample" -run 21/5 65 "--viterbi --resample" -run 21/5 70 "--viterbi --resample" -run 21/5 75 "--viterbi --resample" -run 21/5 80 "--viterbi --resample" -run 21/5 85 "--viterbi --resample" -run 21/5 90 "--viterbi --resample" - -if false; then -index "8sps-viterbi-resample" -run 8 75 "--viterbi --resample" -run 8 80 "--viterbi --resample" -run 8 85 "--viterbi --resample" -run 8 90 "--viterbi --resample" -run 8 95 "--viterbi --resample" -run 8 100 "--viterbi --resample" -run 8 105 "--viterbi --resample" -run 8 110 "--viterbi --resample" -run 8 115 "--viterbi --resample" -fi +test_series "satmodem4200-60sps" 60 "6 5.2 5 4.8 4.6 4.4 4.2 4.0 3.8" "--viterbi --sampler rrc" ######################################################################