comparison run-tests.sh @ 28:69ee50c19c0c tip

Add decimate-b
author Chris Cannam
date Tue, 22 Oct 2013 08:59:42 +0100
parents 20ed07459176
children
comparison
equal deleted inserted replaced
27:ece2031120c9 28:69ee50c19c0c
5 # Our input sweep is at 96kHz, so these factors correspond to 48, 24, 5 # Our input sweep is at 96kHz, so these factors correspond to 48, 24,
6 # 12, 6, 3, and 1.5kHz. 6 # 12, 6, 3, and 1.5kHz.
7 7
8 factors="2 4 8 16 32 64" 8 factors="2 4 8 16 32 64"
9 signals="sweep lengthy" 9 signals="sweep lengthy"
10 impls="zoh decimate resample_hq resample_mq resample_lq src" 10 impls="zoh decimate decimate_b resample_hq resample_mq resample_lq src"
11 11
12 original=96000 12 original=96000
13 13
14 resample="$mydir/qm-dsp-resample/resample" 14 resample="$mydir/qm-dsp-resample/resample"
15 decimate="$mydir/qm-dsp-decimate/decimate" 15 decimate="$mydir/qm-dsp-decimate/decimate"
16 decimate_b="$mydir/qm-dsp-decimate/decimate-b"
16 17
17 indir="$mydir"/testsignals 18 indir="$mydir"/testsignals
18 19
19 outdir="$mydir"/out 20 outdir="$mydir"/out
20 mkdir -p "$outdir" 21 mkdir -p "$outdir"
24 exit 1 25 exit 1
25 fi 26 fi
26 27
27 if [ ! -x "$decimate" ]; then 28 if [ ! -x "$decimate" ]; then
28 echo "Program $decimate not found: make not run, or make failed?" 29 echo "Program $decimate not found: make not run, or make failed?"
30 exit 1
31 fi
32
33 if [ ! -x "$decimate_b" ]; then
34 echo "Program $decimate_b not found: make not run, or make failed?"
29 exit 1 35 exit 1
30 fi 36 fi
31 37
32 if ! sndfile-resample 2>&1 | grep -q samplerate ; then 38 if ! sndfile-resample 2>&1 | grep -q samplerate ; then
33 echo "Program sndfile-resample not found in PATH?" 39 echo "Program sndfile-resample not found in PATH?"
94 64) decimate_twice 8 8 "$infile" "$outfile";; 100 64) decimate_twice 8 8 "$infile" "$outfile";;
95 *) "$decimate" --by "$factor" "$infile" "$outfile";; 101 *) "$decimate" --by "$factor" "$infile" "$outfile";;
96 esac 102 esac
97 } 103 }
98 104
105 do_decimate_b() {
106 factor="$1"
107 infile="$2"
108 outfile="$3"
109 time "$decimate_b" --by "$factor" "$infile" "$outfile"
110 }
111
99 for s in $signals; do 112 for s in $signals; do
100 for f in $factors; do 113 for f in $factors; do
101 for impl in $impls; do 114 for impl in $impls; do
102 echo "signal $s, factor $f, impl $impl..." 115 echo "signal $s, factor $f, impl $impl..."
103 stem="$s"_"$f"_"$impl" 116 stem="$s"_"$f"_"$impl"