2022-08-03 22:10:19 +00:00
|
|
|
#!/usr/bin/env bash
|
2016-03-23 05:33:14 +00:00
|
|
|
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
|
2022-08-03 22:10:19 +00:00
|
|
|
w=$(echo -e "`sox --ver |sed 's/.*SoX v//'` d\n14.4.1 k"|sort -Vr|head -1|sed 's/.* //')
|
2016-03-23 05:33:14 +00:00
|
|
|
|
2022-08-03 22:10:19 +00:00
|
|
|
spec="spectrogram -z120 -Z-20 -w$w -ho"
|
2016-03-23 05:33:14 +00:00
|
|
|
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 pass in `seq 79 5 99`; do
|
2022-08-03 22:10:19 +00:00
|
|
|
f=bw1-$rate2-p`printf %02u $pass`-$w
|
2016-03-23 05:33:14 +00:00
|
|
|
$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
|
2022-08-03 22:10:19 +00:00
|
|
|
f=bw2-$rate2-p`printf %02u $pass`-$w
|
2016-03-23 05:33:14 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
r=$rate1; rate1=$rate2; rate2=$r
|
|
|
|
|
|
|
|
done
|
|
|
|
|
|
|
|
rm 0.$ext
|