This repository has been archived by the owner on May 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.sh
executable file
·127 lines (110 loc) · 3.57 KB
/
test.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#!/bin/bash
#
# This file is part of the demodulator distribution
# (https://github.com/peads/demodulator).
# with code originally part of the misc_snippets distribution
# (https://github.com/peads/misc_snippets).
# Copyright (c) 2023-2024 Patrick Eads.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#PREC="-DSET_PRECISION=ON"
BITS=32
if [ ! -z "$PREC" ]; then
BITS=64
fi
wavFile=SDRSharp_20160101_231914Z_12kHz_IQ.wav
wavFile2=FLEX_Pager_IQ_20150816_929613kHz_IQ.wav
audioOutOpts=""
compilers=()
if [ ! -z "$2" ]; then
wavFile=$2
fi
if [ ! -z "$3" ]; then
audioOutOpts="-w$3"
fi
function findCompiler() {
local __resultvar=$2
type $1 >/dev/null 2>&1
result="$?"
if [ "$result" == 0 ]; then
echo ":: COMPILER INFO"
echo "$(${1} --version)"
echo ":: END COMPILER INFO"
if [ "${1}" != nvcc ]; then
compilers+=("`which ${1}`")
fi
fi
eval $__resultvar="'$result'"
}
function executeTimedRun() {
time build/demodulator -i uint8.dat -o file -S96000 -l6500 ${1}
}
function executeRun() {
if [ ! -z "$2" ]; then
volumeIn=${2}
else
volumeIn="-v2"
fi
volumeOut=${3}
sox ${volumeIn} -q -D -twav ${wavFile} -traw -eunsigned-int -b8 -r192k - 2>/dev/null \
| tee -i uint8.dat \
| build/demodulator -i - -o - -m3 -l12500 -S96000 ${1} \
| sox ${volumeOut} -q -D -traw -b${BITS} -ef -r96k - -traw -es -b16 -r48k - 2>/dev/null \
| dsd -i - -o/dev/null -n
}
function executeRun2() {
sox -v55 -q -D -twav ${wavFile2} -traw -eunsigned-int -b8 -r192k - 2>/dev/null \
| tee -i uint8.dat \
| build/demodulator -m3 -i - -o - -l9600 -S96000 ${1} \
| sox -v0.5 -q -D -traw -b${BITS} -ef -r96k - -traw -es -r22050 -b16 - 2>/dev/null \
| multimon-ng -q -c -aFLEX_NEXT -i -
}
findCompiler gcc hasGcc
findCompiler clang hasClang
findCompiler icc hasIcc
findCompiler nvcc hasNvcc
set -e
i=0
for compiler in ${compilers[@]}; do
./cmake_build.sh "${PREC} -DCMAKE_C_COMPILER=${compiler} -DIS_NATIVE=ON" | grep "The C compiler identification"
executeRun
echo ":: STARTING TIMED RUNS 1 FOR: ${compiler} dsd no lowpass in"
executeTimedRun
executeTimedRun
executeTimedRun
echo ":: COMPLETED TIMED RUNS 1 FOR: ${compiler} dsd no lowpass in"
rm -rf file uint8.dat
executeRun2
echo ":: STARTING TIMED RUNS 2 FOR: ${compiler} multimon-ng no lowpass in"
executeTimedRun
executeTimedRun
executeTimedRun
echo ":: COMPLETED TIMED RUNS 2 FOR: ${compiler} multimon-ng no lowpass in"
rm -rf file uint8.dat
executeRun "-d5 -L12500"
echo ":: STARTING TIMED RUNS 1 FOR: ${compiler} dsd with lowpass in"
executeTimedRun "-d5 -L12500"
executeTimedRun "-d5 -L12500"
executeTimedRun "-d5 -L12500"
echo ":: COMPLETED TIMED RUNS 1 FOR: ${compiler} dsd with lowpass in"
rm -rf file uint8.dat
executeRun2 "-L12500"
echo ":: STARTING TIMED RUNS 2 FOR: ${compiler} multimon-ng with lowpass in"
executeTimedRun "-L12500"
executeTimedRun "-L12500"
executeTimedRun "-L12500"
echo ":: COMPLETED TIMED RUNS 2 FOR: ${compiler} multimon-ng with lowpass in"
rm -rf file uint8.dat
done
echo "Job's done."