diff --git a/tests/io-test b/tests/io-test index 11530a3..360949f 100755 --- a/tests/io-test +++ b/tests/io-test @@ -17,9 +17,11 @@ ex=./3-options-input-fn types=(f32 f64 s32 s16) +zs=(160 160 160 120 180 180 120 120) + do_one() { $ex $ir $or $c $1 $2 $3 < $c.${types[$1]} | - sox -t ${types[$2]} -r $or -c $c - -n spectrogram -X50 -hwk -z180 -o io$c$n.png + sox -t ${types[$2]} -r $or -c $c - -n spectrogram -X50 -hwk -z${zs[$n]} -o io$c$n.png n=`expr $n + 1` } diff --git a/tests/q-test b/tests/q-test index 89cf64f..454a41a 100755 --- a/tests/q-test +++ b/tests/q-test @@ -11,16 +11,19 @@ set -e tool=./3-options-input-fn -spec="spectrogram -z180 -Z-20 -wd -ho" -ext=f32; e=0 ext=f64; e=1 -c=2 -q1=4; q2=4 +c=1 q1=0; q2=7 rates=48000 rates="48000 77773 96000" +z=(50 87 87 87 111 135 159 180 95) + +zz() { + echo "spectrogram -z${z[$1]} -Z-30 -wd -ho" +} + for rate0 in $rates; do rate1=$rate0 @@ -53,10 +56,11 @@ sox -r $rate1 -n -c $c 0.$ext synth 8 sin 0:$rate1n gain -1 for q in `seq $q1 $q2`; do f=q$rate1-$rate2-a-$q - $tool $rate1 $rate2 $c $e $e $q 0 < 0.$ext | sox -c$c -r$rate2 -t $ext - -n $spec $f.png + $tool $rate1 $rate2 $c $e $e $q 0 < 0.$ext | sox -c$c -r$rate2 -t $ext - -n $(zz $q) $f.png done +q=8 f=q$rate1-$rate2-a-v -$tool $rate1 $rate2 $c $e $e 4 20 < 0.$ext | sox -c$c -r$rate2 -t $ext - -n $spec $f.png +$tool $rate1 $rate2 $c $e $e 4 20 < 0.$ext | sox -c$c -r$rate2 -t $ext - -n $(zz $q) $f.png @@ -67,10 +71,11 @@ sox -r $rate1 -n 0.$ext synth 1s sq pad .03 .03 gain -1 for q in `seq $q1 $q2`; do f=q$rate1-$rate2-b-$q - $tool $rate1 $rate2 1 $e $e $q 0 < 0.$ext | sox -c1 -r$rate2 -t $ext - $f.wav $spec $f.png -X 2000 + $tool $rate1 $rate2 1 $e $e $q 0 < 0.$ext | sox -c1 -r$rate2 -t $ext - $f.wav $(zz $q) $f.png -X 2000 done +q=8 f=q$rate1-$rate2-b-v -$tool $rate1 $rate2 1 $e $e 4 20 < 0.$ext | sox -c1 -r$rate2 -t $ext - $f.wav $spec $f.png -X 2000 +$tool $rate1 $rate2 1 $e $e 4 20 < 0.$ext | sox -c1 -r$rate2 -t $ext - $f.wav $(zz $q) $f.png -X 2000 # Combine impuse responses into multi-channel file (for inspection in Audacity): sox -M q$rate1-$rate2-b-?.wav q$rate1-$rate2.wav