-
Notifications
You must be signed in to change notification settings - Fork 0
/
analyze.sh
executable file
·58 lines (45 loc) · 980 Bytes
/
analyze.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#! /bin/bash
# run this script to analyze audio samples
# check if there are even audio samples
if [[ `ls input/*` == "" ]]; then
echo "Error: no .wav file"
echo "Please insert any and try again"
exit 1
fi
# reset cache files
if [[ -d src/audio_dat ]]
then
rm -r src/audio_dat
fi
mkdir src/audio_dat
if [[ -d src/audio_datcp ]]
then
rm -r src/audio_datcp
fi
mkdir src/audio_datcp
if ! [[ -d output ]]
then
mkdir -p output/data
mkdir -p output/images
mkdir -p output/stats
fi
# create audio samples
source src/buildf/dat_create.sh
# proccess data with apx_coeff = 600
./build/REV 600
# move files to to output directory
for file in src/audio_datcp/*
do
var=$(echo $file | cut -d/ -f3)
cp $file output/data/$var
done
# plot data using gnuplot
./src/buildf/gnuplot.sh
# rename .png files
for file in output/images/*.dat.png
do
var=${file%.*}
mv $file ${var%.*}.png
done
# create additional statistical data
./build/STATS