summaryrefslogtreecommitdiff
path: root/gr-digital/python/digital/bindings/diff_decoder_bb_python.cc
diff options
context:
space:
mode:
authorDaniel Estévez <daniel@destevez.net>2021-06-06 11:25:57 +0200
committermormj <34754695+mormj@users.noreply.github.com>2021-06-12 12:01:12 -0400
commit51c504ebb1ca21c5f7071826c1af03e45e391a65 (patch)
treedbabf0b0b825f834cff2067248d193fe8d951dd8 /gr-digital/python/digital/bindings/diff_decoder_bb_python.cc
parent16d1b0215d59c52009b09867fbfce0b4c3585add (diff)
digital: Add NRZI option to differential en/decoder
This adds an option to the differential encoder an decoder blocks to perform NRZI encoding and decoding. NRZI only makes sense with a modulus of 2, so the blocks constructors will throw and exception if passed nrzi = true and a modulus different from 2. The GRC blocks handle this by hiding the modulus field if the user selects NRZI encoding. A new unit test for the NRZI version of the blocks is added. Besides checking that encode plus decode gives the original, this test also compares the C++ implementation results against a Numpy implementation. Additionally, a faster implementation of differential encoding/ decoding for modulus 2 is included here. Signed-off-by: Daniel Estévez <daniel@destevez.net>
Diffstat (limited to 'gr-digital/python/digital/bindings/diff_decoder_bb_python.cc')
-rw-r--r--gr-digital/python/digital/bindings/diff_decoder_bb_python.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/gr-digital/python/digital/bindings/diff_decoder_bb_python.cc b/gr-digital/python/digital/bindings/diff_decoder_bb_python.cc
index f7fb6b0943..a5628fb372 100644
--- a/gr-digital/python/digital/bindings/diff_decoder_bb_python.cc
+++ b/gr-digital/python/digital/bindings/diff_decoder_bb_python.cc
@@ -14,7 +14,7 @@
/* BINDTOOL_GEN_AUTOMATIC(0) */
/* BINDTOOL_USE_PYGCCXML(0) */
/* BINDTOOL_HEADER_FILE(diff_decoder_bb.h) */
-/* BINDTOOL_HEADER_FILE_HASH(3814f3ba5b3a9425eae5611e1a4876ec) */
+/* BINDTOOL_HEADER_FILE_HASH(92f143bcb3f067b3cdf8292a75956d31) */
/***********************************************************************************/
#include <pybind11/complex.h>
@@ -41,6 +41,7 @@ void bind_diff_decoder_bb(py::module& m)
.def(py::init(&diff_decoder_bb::make),
py::arg("modulus"),
+ py::arg("nrzi") = ::gr::digital::DIFF_DIFFERENTIAL,
D(diff_decoder_bb, make))