diff options
| author | Author Name <[email protected]> | 2023-07-07 12:20:59 +0930 |
|---|---|---|
| committer | David Rowe <[email protected]> | 2023-07-07 12:29:06 +0930 |
| commit | ac7c48b4dee99d4c772f133d70d8d1b38262fcd2 (patch) | |
| tree | a2d0ace57a9c0e2e5b611c4987f6fed1b38b81e7 /unittest/spectrogram.sh | |
shallow zip-file copy from codec2 e9d726bf20
Diffstat (limited to 'unittest/spectrogram.sh')
| -rwxr-xr-x | unittest/spectrogram.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/unittest/spectrogram.sh b/unittest/spectrogram.sh new file mode 100755 index 0000000..87d3fa2 --- /dev/null +++ b/unittest/spectrogram.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# spectrogram.sh +# +# Render a spectrogram from a wave file. + +PATH=${PATH}:${HOME}/codec2/build_linux/src +CODEC2=${HOME}/codec2 + +fullfile=$1 +filename=$(basename -- "$fullfile") +extension="${filename##*.}" +filename="${filename%.*}" + +echo "pkg load signal; warning('off', 'all'); \ + s=load_raw('${fullfile}'); \ + plot_specgram(s, 8000, 500, 2500); print('${filename}.jpg', '-djpg'); \ + quit" | octave-cli -p ${CODEC2}/octave -qf > /dev/null |
