Mercurial > hg > decimation
changeset 19:c2b64a1464f4
Add test script
author | Chris Cannam |
---|---|
date | Fri, 18 Oct 2013 15:57:28 +0100 |
parents | 23a1bf117b3a |
children | 7d4165ded830 |
files | run-tests.sh |
diffstat | 1 files changed, 47 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run-tests.sh Fri Oct 18 15:57:28 2013 +0100 @@ -0,0 +1,47 @@ +#!/bin/bash + +mydir="`dirname $0`" + +# Our input sweep is at 96kHz, so these factors correspond to 48, 24, +# 12, 6, 3, and 1.5kHz. + +factors="2 4 8 16 32 64" + +original=96000 + +do_src() { + factor="$1" + infile="$2" + outfile="$3" + sndfile-resample -to "$(($original/$factor))" "$infile" "$outfile" +} + +do_linear() { + factor="$1" + infile="$2" + outfile="$3" + sndfile-resample -to "$(($original/$factor))" -c 4 "$infile" "$outfile" +} + +do_resample() { + factor="$1" + infile="$2" + outfile="$3" + "$mydir/garage-resampler/resample" --to "$(($original/$factor))" "$infile" "$outfile" +} + +do_decimate() { + factor="$1" + infile="$2" + outfile="$3" + "$mydir/qm-dsp-decimate/decimate" --by "$factor" "$infile" "$outfile" +} + +mkdir -p "$mydir"/out + +for f in $factors; do + for impl in linear decimate resample src; do + do_$impl "$f" "$mydir/infinitewave-testsignals/Swept_float.wav" "$mydir"/out/"$impl"_"$factor".wav + done +done +