Skip to content

Commit 78a2b34

Browse files
committed
first pass at test script
1 parent 05d3423 commit 78a2b34

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

script/test_2020x.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash -x
2+
# test_2020x.sh
3+
# David Rowe Feb 2022
4+
#
5+
# Script to support testing experimental 2020A and 2020B modes and 700E control.
6+
7+
CODEC2_PATH=$HOME/codec2
8+
PATH=$PATH:$CODEC2_PATH/build_linux/src:$CODEC2_PATH/build_linux/misc
9+
FADING_DIR=$CODEC2_PATH/build_linux/unittest
10+
No_AWGN=-20
11+
No_Multipath=-25
12+
13+
function run_sim() {
14+
fullfile=$1
15+
filename=$(basename -- "$fullfile")
16+
extension="${filename##*.}"
17+
filename="${filename%.*}"
18+
mode=$2
19+
if [ "$mode" == "700E" ] || [ "$mode" == "700D" ]; then
20+
rateHz=8000
21+
else
22+
rateHz=16000
23+
fi
24+
clip=$3
25+
if [ "$clip" == "clip" ]; then
26+
clipflag=1
27+
else
28+
clipflag=0
29+
fi
30+
channel=$4
31+
if [ "$channel" == "awgn" ]; then
32+
channel_opt=""
33+
No=$No_AWGN
34+
else
35+
channel_opt='--'${channel}
36+
No=$No_Multipath
37+
fi
38+
39+
freedv_tx ${mode} ${fullfile} - --clip ${clipflag} | \
40+
ch - - --No $No ${channel_opt} --fading_dir ${FADING_DIR} | \
41+
freedv_rx ${mode} - - | \
42+
sox -t .s16 -r ${rateHz} -c 1 - ${filename}_${mode}_${clip}_${channel}.wav
43+
}
44+
45+
run_sim ~/LPCNet/wav/peter.wav 2020 noclip awgn
46+
run_sim ~/codec2/wav/big_dog.wav 700E clip mpp

0 commit comments

Comments
 (0)