aboutsummaryrefslogtreecommitdiff
path: root/unittest/ofdm_phase_est_bw.sh
diff options
context:
space:
mode:
authorAuthor Name <[email protected]>2023-07-07 12:20:59 +0930
committerDavid Rowe <[email protected]>2023-07-07 12:29:06 +0930
commitac7c48b4dee99d4c772f133d70d8d1b38262fcd2 (patch)
treea2d0ace57a9c0e2e5b611c4987f6fed1b38b81e7 /unittest/ofdm_phase_est_bw.sh
shallow zip-file copy from codec2 e9d726bf20
Diffstat (limited to 'unittest/ofdm_phase_est_bw.sh')
-rwxr-xr-xunittest/ofdm_phase_est_bw.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/unittest/ofdm_phase_est_bw.sh b/unittest/ofdm_phase_est_bw.sh
new file mode 100755
index 0000000..7eb826a
--- /dev/null
+++ b/unittest/ofdm_phase_est_bw.sh
@@ -0,0 +1,24 @@
+#!/usr/bin/env bash
+#
+# ofdm_phase_est_bw.sh
+# David August 2019
+
+# Tests 2020 OFDM modem phase est bandwidth mode option. Locking the
+# phase est bandwidth to "high" is useful for High SNR channels with
+# fast fading or high phase noise. In this test we show that with
+# high bandwidth phase est mode, the BER is < 5% for the "--mpp" (1
+# Hz fading) channel model on a fairly high SNR channel.
+#
+# To run manually outside of ctest:
+# $ cd codec2/unittest
+# $ PATH=$PATH:../build_linux/src ./ofdm_phase_est_bw.sh
+
+results=$(mktemp)
+fading_dir=$1
+# BER should be < 5% for this test
+ofdm_mod --in /dev/zero --testframes 300 --mode 2020 --ldpc --verbose 0 | \
+ch - - --No -40 -f 10 --ssbfilt 1 --mpp --fading_dir $fading_dir | \
+ofdm_demod --out /dev/null --testframes --mode 2020 --verbose 2 --ldpc --bandwidth 1 2> $results
+cat $results
+cber=$(cat $results | sed -n "s/^Coded BER.* \([0-9..]*\) Tbits.*/\1/p")
+python3 -c "import sys; sys.exit(0) if $cber<=0.05 else sys.exit(1)"