tests: use dolph window if available, kaiser otherwise
parent
4aa773ff0d
commit
e923db11ad
|
@ -9,8 +9,9 @@ set -e
|
|||
|
||||
|
||||
tool=./3-options-input-fn
|
||||
w=$(echo -e "`sox --ver |sed 's/.*SoX v//'` d\n14.4.1 k"|sort -Vr|head -1|sed 's/.* //')
|
||||
|
||||
spec="spectrogram -z120 -Z-20 -wd -ho"
|
||||
spec="spectrogram -z120 -Z-20 -w$w -ho"
|
||||
ext=f32; e=0
|
||||
rate1=48000
|
||||
rate2=44100
|
||||
|
@ -23,12 +24,12 @@ rate1n=`expr $rate1 / 2`
|
|||
sox -r $rate1 -n 0.$ext synth 8 sin 0:$rate1n gain -1
|
||||
|
||||
for pass in `seq 79 5 99`; do
|
||||
f=bw1-$rate2-p`printf %02u $pass`
|
||||
f=bw1-$rate2-p`printf %02u $pass`-$w
|
||||
$tool $rate1 $rate2 1 $e $e 4 0 $pass < 0.$ext | sox -c1 -r$rate2 -t $ext - -n $spec $f.png -c "bw-test pass:$pass stop:100"
|
||||
done
|
||||
|
||||
for pass in `seq 79 5 99`; do
|
||||
f=bw2-$rate2-p`printf %02u $pass`
|
||||
f=bw2-$rate2-p`printf %02u $pass`-$w
|
||||
stop=`expr 200 - $pass`
|
||||
$tool $rate1 $rate2 1 $e $e 4 0 $pass $stop < 0.$ext | sox -c1 -r$rate2 -t $ext - -n $spec $f.png -c "bw-test pass:$pass stop:$stop"
|
||||
done
|
||||
|
|
|
@ -9,6 +9,7 @@ set -e
|
|||
|
||||
|
||||
len=8
|
||||
w=$(echo -e "`sox --ver |sed 's/.*SoX v//'` d\n14.4.1 k"|sort -Vr|head -1|sed 's/.* //')
|
||||
#vg="valgrind --leak-check=full --show-reachable=yes"
|
||||
|
||||
|
||||
|
@ -42,6 +43,6 @@ signals=(sine-wave saw-tooth-wave)
|
|||
for n in 0 1 2 3; do
|
||||
signal=${signals[`expr $n % 2 || true`]}
|
||||
variation=${variations[`expr $n / 2 || true`]}
|
||||
$vg ./5-variable-rate $n | sox -tf32 -r44100 -c1 - -n spectrogram -z130 -hwd -o v$n.png -X 50 -c "variation:$variation signal:$signal"
|
||||
$vg ./5-variable-rate $n | sox -tf32 -r44100 -c1 - -n spectrogram -z130 -hw$w -o v$n-$w.png -X 50 -c "variation:$variation signal:$signal"
|
||||
vg=""
|
||||
done
|
||||
|
|
|
@ -14,6 +14,7 @@ len=16
|
|||
f=1/32768
|
||||
g=32768:0
|
||||
tool=./3-options-input-fn
|
||||
w=$(echo -e "`sox --ver |sed 's/.*SoX v//'` d\n14.4.1 k"|sort -Vr|head -1|sed 's/.* //')
|
||||
|
||||
types=(f32 f64 s32 s16)
|
||||
|
||||
|
@ -22,7 +23,7 @@ zs=(180 180 180 180 180 120 120 120 120)
|
|||
do_one() {
|
||||
it=${types[$1]}; ot=${types[`expr $2 % 4 || true`]}
|
||||
$tool $ir $or $c $1 $2 $3 < $c.$it > a.$ot
|
||||
sox -r $or -c $c a.$ot -n spectrogram -X50 -hwk -z${zs[$n]} -o io$c$n.png -c "io-test i:$it o:$ot ($2) q:$3"
|
||||
sox -r $or -c $c a.$ot -n spectrogram -X50 -hw$w -z${zs[$n]} -o io$c$n$w.png -c "io-test i:$it o:$ot ($2) q:$3"
|
||||
./4-split-channels $ir $or $c $1 $2 $3 < $c.$it > b.$ot
|
||||
[ $2 != 3 ] && cmp a.$ot b.$ot ||
|
||||
test $(sox -mv-1 -r$or -c$c a.$ot -r$or -c$c b.$ot -n stats 2>&1 |grep Pk\ l|tr ' ' '\n'|grep '[0-9]'|uniq) = -84.29
|
||||
|
|
|
@ -4,20 +4,19 @@ set -e
|
|||
# SoX Resampler Library Copyright (c) 2007-15 robs@users.sourceforge.net
|
||||
# Licence for this file: LGPL v2.1 See LICENCE for details.
|
||||
|
||||
# Tests interpolating then decimating be the same, large ratio.
|
||||
# Tests interpolating then decimating by the same, large ratio.
|
||||
|
||||
tool=../examples/3-options-input-fn
|
||||
w=$(echo -e "`sox --ver |sed 's/.*SoX v//'` d\n14.4.1 k"|sort -Vr|head -1|sed 's/.* //')
|
||||
q=6
|
||||
ratio=2e4
|
||||
srate=8000
|
||||
nrate=`expr $srate / 2`
|
||||
|
||||
rm -f lr.png
|
||||
|
||||
../tests/vector-gen $srate 0 8 $nrate .9375 1.s32
|
||||
|
||||
$tool 1 $ratio 1 2 1 $q < 1.s32 | $tool $ratio 1 1 1 2 $q > 2.s32
|
||||
|
||||
sox -M -r $srate -c1 1.s32 -r $srate -c1 2.s32 -n spectrogram -hwd -Z-10 -z180 -o lr.png -c "large-ratio-test q:$q ratio:$ratio"
|
||||
sox -M -r $srate -c1 1.s32 -r $srate -c1 2.s32 -n spectrogram -hw$w -Z-10 -z180 -o lr-$w.png -c "large-ratio-test q:$q ratio:$ratio"
|
||||
|
||||
rm [12].s32
|
||||
|
|
|
@ -7,7 +7,8 @@ set -e
|
|||
# Tests varying phase-response.
|
||||
|
||||
tool=./3-options-input-fn
|
||||
spec="spectrogram -z160 -Z-20 -X 2000 -wd -ho"
|
||||
w=$(echo -e "`sox --ver |sed 's/.*SoX v//'` d\n14.4.1 k"|sort -Vr|head -1|sed 's/.* //')
|
||||
spec="spectrogram -z160 -Z-20 -X 2000 -w$w -ho"
|
||||
ext=f32; e=0
|
||||
rate1=48000
|
||||
rate2=44100
|
||||
|
@ -20,7 +21,7 @@ for n in 1 2; do
|
|||
filters=(standard-filter steep-filter)
|
||||
|
||||
for q in `seq 0 7`; do
|
||||
f=ph-$rate2-q$q
|
||||
f=ph-$rate2-q$q-$w
|
||||
name=${names[`expr $q % 4 || true`]}
|
||||
filter=${filters[`expr $q / 4 || true`]}
|
||||
$tool $rate1 $rate2 1 $e $e $q'6' < 0.$ext | sox -c1 -r$rate2 -t $ext - -n $spec $f.png -c "ph-test $filter $name"
|
||||
|
@ -28,7 +29,7 @@ for n in 1 2; do
|
|||
|
||||
# Test specific phase-response percentages:
|
||||
for q in `seq 0 20 100`; do
|
||||
f=ph-$rate2-p`printf %03u $q`
|
||||
f=ph-$rate2-p`printf %03u $q`-$w
|
||||
$tool $rate1 $rate2 1 $e $e 46 0 0 0 $q < 0.$ext | sox -c1 -r$rate2 -t $ext - -n $spec $f.png -c "ph-test phase:${q}%"
|
||||
done
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ set -e
|
|||
|
||||
|
||||
tool=./3-options-input-fn
|
||||
w=$(echo -e "`sox --ver |sed 's/.*SoX v//'` d\n14.4.1 k"|sort -Vr|head -1|sed 's/.* //')
|
||||
ext=f64; e=1
|
||||
c=1
|
||||
q1=0; q2=7
|
||||
|
@ -16,7 +17,7 @@ rates=48000
|
|||
zs=(50 87 87 87 111 135 159 180 95)
|
||||
|
||||
zz() {
|
||||
echo "spectrogram -z${zs[$1]} -Z-30 -wd -ho"
|
||||
echo "spectrogram -z${zs[$1]} -Z-30 -w$w -ho"
|
||||
}
|
||||
|
||||
for rate0 in $rates; do
|
||||
|
@ -36,11 +37,11 @@ sox -r $rate1 -n -c $c 0.$ext synth 8 sin 0:$rate1n gain -1
|
|||
|
||||
for q in `seq $q1 $q2`; do
|
||||
f=qa-$rate1-$rate2-$q
|
||||
$tool $rate1 $rate2 $c $e $e $q 0 < 0.$ext | sox -c$c -r$rate2 -t $ext - -n $(zz $q) $f.png -c $f
|
||||
$tool $rate1 $rate2 $c $e $e $q 0 < 0.$ext | sox -c$c -r$rate2 -t $ext - -n $(zz $q) $f-$w.png -c $f
|
||||
done
|
||||
q=8
|
||||
f=qa-$rate1-$rate2-v
|
||||
$tool $rate1 $rate2 $c $e $e 4 20 < 0.$ext | sox -c$c -r$rate2 -t $ext - -n $(zz $q) $f.png -c $f
|
||||
$tool $rate1 $rate2 $c $e $e 4 20 < 0.$ext | sox -c$c -r$rate2 -t $ext - -n $(zz $q) $f-$w.png -c $f
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue