improve test-scripts

master
Rob Sykes 2015-08-20 20:31:13 +01:00
parent 0d60977179
commit 86e855d3e4
5 changed files with 53 additions and 18 deletions

View File

@ -0,0 +1,39 @@
#!/bin/bash
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 varying bandwidth.
tool=./3-options-input-fn
spec="spectrogram -z120 -Z-20 -wd -ho"
ext=f32; e=0
rate1=48000
rate2=44100
for n in 1 2; do
rate1n=`expr $rate1 / 2`
#sox -r $rate1 -n 0.$ext synth 1s sq pad .03 .03 gain -1
sox -r $rate1 -n 0.$ext synth 8 sin 0:$rate1n gain -1
for q in `seq 79 5 99`; do
f=bw1-$rate2-p`printf %02u $q`
$tool $rate1 $rate2 1 $e $e 4 0 $q < 0.$ext | sox -c1 -r$rate2 -t $ext - -n $spec $f.png
done
for q in `seq 79 5 99`; do
f=bw2-$rate2-p`printf %02u $q`
$tool $rate1 $rate2 1 $e $e 4 0 $q `expr 200 - $q` < 0.$ext | sox -c1 -r$rate2 -t $ext - -n $spec $f.png
done
r=$rate1; rate1=$rate2; rate2=$r
done
rm 0.$ext

View File

@ -1,10 +1,10 @@
#!/bin/bash
set -e
# SoX Resampler Library Copyright (c) 2007-14 robs@users.sourceforge.net
# SoX Resampler Library Copyright (c) 2007-15 robs@users.sourceforge.net
# Licence for this file: LGPL v2.1 See LICENCE for details.
# Exercise each example programme:
# Exercises each example programme.
@ -37,7 +37,6 @@ rm *.f32
# Exercise VR making sure that varied internal stage reconfigurations occur:
rm -f v?.png
for n in 0 1 2 3; do
$vg ./5-variable-rate $n | sox -tf32 -r44100 -c1 - -n spectrogram -z130 -hwd -o v$n.png -X 50
vg=""

View File

@ -1,7 +1,7 @@
#!/bin/bash
set -e
# SoX Resampler Library Copyright (c) 2007-13 robs@users.sourceforge.net
# SoX Resampler Library Copyright (c) 2007-15 robs@users.sourceforge.net
# Licence for this file: LGPL v2.1 See LICENCE for details.
# Tests IO
@ -23,8 +23,6 @@ do_one() {
n=`expr $n + 1`
}
rm -f io??.png
j=3; test z$1 != z && j=$1
for c in `seq 1 $j`; do

View File

@ -1,17 +1,16 @@
#!/bin/bash
set -e
# SoX Resampler Library Copyright (c) 2007-14 robs@users.sourceforge.net
# SoX Resampler Library Copyright (c) 2007-15 robs@users.sourceforge.net
# Licence for this file: LGPL v2.1 See LICENCE for details.
# Tests varying phase-response.
rm -f ph-*.png
tool=./3-options-input-fn
spec="spectrogram -z180 -Z-20 -wd -ho"
spec="spectrogram -z160 -Z-20 -wd -ho"
ext=f32; e=0
rate1=48000
rate2=44100

View File

@ -1,14 +1,14 @@
#!/bin/bash
set -e
# SoX Resampler Library Copyright (c) 2007-14 robs@users.sourceforge.net
# SoX Resampler Library Copyright (c) 2007-15 robs@users.sourceforge.net
# Licence for this file: LGPL v2.1 See LICENCE for details.
# Tests rate conversion time and generates spectrograms for qualities 0..7 & variable-rate.
# Tests rate conversion time and generates spectrograms for
# qualities 0..7 & variable-rate.
rm -f *.png *.wav
tool=./3-options-input-fn
spec="spectrogram -z180 -Z-20 -wd -ho"
@ -52,10 +52,10 @@ time $tool $rate1 $rate2 $c $e $e 4 20 < 0.$ext > /dev/null
sox -r $rate1 -n -c $c 0.$ext synth 8 sin 0:$rate1n gain -1
for q in `seq $q1 $q2`; do
f=$rate1-$rate2-a-$q
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
done
f=$rate1-$rate2-a-v
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
@ -66,16 +66,16 @@ $tool $rate1 $rate2 $c $e $e 4 20 < 0.$ext | sox -c$c -r$rate2 -t $ext - -n $spe
sox -r $rate1 -n 0.$ext synth 1s sq pad .03 .03 gain -1
for q in `seq $q1 $q2`; do
f=$rate1-$rate2-b-$q
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
done
f=$rate1-$rate2-b-v
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
# Combine impuse responses into multi-channel file (for inspection in Audacity):
sox -M $rate1-$rate2-b-?.wav $rate1-$rate2.wav
sox -M q$rate1-$rate2-b-?.wav q$rate1-$rate2.wav
rm $rate1-$rate2-b-?.wav
rm q$rate1-$rate2-b-?.wav
:
rate1=44100