Skip to content

Commit 6f2bcad

Browse files
committed
building up listening test script
1 parent 7d2d44f commit 6f2bcad

File tree

1 file changed

+68
-5
lines changed

1 file changed

+68
-5
lines changed

script/test_2020x.sh

Lines changed: 68 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ PATH=$PATH:$CODEC2_PATH/build_linux/src:$CODEC2_PATH/build_linux/misc
99
FADING_DIR=$CODEC2_PATH/build_linux/unittest
1010
No_AWGN=-20
1111
No_Multipath=-25
12+
serial=0
1213

1314
function run_sim() {
1415
fullfile=$1
@@ -24,23 +25,85 @@ function run_sim() {
2425
clip=$3
2526
if [ "$clip" == "clip" ]; then
2627
clipflag=1
28+
clip_html="yes"
2729
else
2830
clipflag=0
31+
clip_html="no"
2932
fi
3033
channel=$4
34+
No=-100
3135
if [ "$channel" == "awgn" ]; then
3236
channel_opt=""
3337
No=$No_AWGN
34-
else
38+
fi
39+
if [ "$channel" == "mpp" ] || [ "$channel" == "mpd" ]; then
3540
channel_opt='--'${channel}
3641
No=$No_Multipath
3742
fi
43+
44+
indopt=$5
45+
indopt_flag=""
46+
indopt_html="no"
47+
indopt_str=""
48+
if [ "$indopt" == "indopt" ]; then
49+
indopt_flag="--indopt 1"
50+
indopt_str="_indopt"
51+
indopt_html="yes"
52+
fi
53+
if [ "$indopt" == "no_indopt" ]; then
54+
indopt_flag="--indopt 0"
55+
indopt_str="_no_indopt"
56+
fi
3857

39-
freedv_tx ${mode} ${fullfile} - --clip ${clipflag} | \
58+
fn=${filename}_${mode}_${clip}_${channel}${indopt_str}.wav
59+
freedv_tx ${mode} ${fullfile} - --clip ${clipflag} ${indopt_flag} | \
4060
ch - - --No $No ${channel_opt} --fading_dir ${FADING_DIR} | \
4161
freedv_rx ${mode} - - | \
42-
sox -t .s16 -r ${rateHz} -c 1 - ${filename}_${mode}_${clip}_${channel}.wav
62+
sox -t .s16 -r ${rateHz} -c 1 - ${fn} trim 0 6
63+
64+
echo "<tr>"
65+
echo "<td><a href=\"${fn}\">${serial}</a></td><td>${mode}</td><td>${clip_html}</td><td>${indopt_html}</td><td>${channel}</td>"
66+
echo "</tr>"
67+
serial=$((serial+1))
4368
}
4469

45-
run_sim ~/LPCNet/wav/peter.wav 2020 noclip awgn
46-
run_sim ~/codec2/wav/big_dog.wav 700E clip mpp
70+
# convert speech input file to format we need
71+
SPEECH_IN_16k_WAV=~/Downloads/speech_orig_16k.wav
72+
SPEECH_IN_16k_RAW=speech_orig_16k.raw
73+
SPEECH_IN_8k_RAW=speech_orig_8k.raw
74+
sox $SPEECH_IN_16k_WAV -t .s16 $SPEECH_IN_16k_RAW
75+
sox $SPEECH_IN_16k_WAV -t .s16 -r 8000 $SPEECH_IN_8k_RAW
76+
77+
echo "<html><table>"
78+
echo "<tr><th>Serial</th><th>Mode</th><th>Clip</th><th>index_opt</th><th>Channel</th></tr>"
79+
80+
# run simulations
81+
82+
run_sim $SPEECH_IN_16k_RAW 2020 noclip clean
83+
run_sim $SPEECH_IN_8k_RAW 700E clip clean
84+
85+
run_sim $SPEECH_IN_16k_RAW 2020 noclip awgn
86+
run_sim $SPEECH_IN_16k_RAW 2020 noclip mpp
87+
run_sim $SPEECH_IN_16k_RAW 2020 noclip mpd
88+
run_sim $SPEECH_IN_16k_RAW 2020 clip awgn
89+
run_sim $SPEECH_IN_16k_RAW 2020 clip mpp
90+
run_sim $SPEECH_IN_16k_RAW 2020 clip mpd
91+
92+
run_sim $SPEECH_IN_16k_RAW 2020A clip awgn indopt
93+
run_sim $SPEECH_IN_16k_RAW 2020A clip mpp indopt
94+
run_sim $SPEECH_IN_16k_RAW 2020A clip mpp no_indopt
95+
run_sim $SPEECH_IN_16k_RAW 2020A clip mpd indopt
96+
run_sim $SPEECH_IN_16k_RAW 2020A clip mpd no_indopt
97+
98+
run_sim $SPEECH_IN_16k_RAW 2020B clip awgn indopt
99+
run_sim $SPEECH_IN_16k_RAW 2020B clip mpp indopt
100+
run_sim $SPEECH_IN_16k_RAW 2020B clip mpp no_indopt
101+
run_sim $SPEECH_IN_16k_RAW 2020B clip mpd indopt
102+
run_sim $SPEECH_IN_16k_RAW 2020B clip mpd no_indopt
103+
104+
run_sim $SPEECH_IN_8k_RAW 700E clip awgn
105+
run_sim $SPEECH_IN_8k_RAW 700E clip mpp
106+
run_sim $SPEECH_IN_8k_RAW 700E clip mpd
107+
108+
109+
exit

0 commit comments

Comments
 (0)