summaryrefslogtreecommitdiff
path: root/gr-digital/python/digital/bindings/diff_encoder_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_encoder_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_encoder_bb_python.cc')
-rw-r--r--gr-digital/python/digital/bindings/diff_encoder_bb_python.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/gr-digital/python/digital/bindings/diff_encoder_bb_python.cc b/gr-digital/python/digital/bindings/diff_encoder_bb_python.cc
index d27c5feec2..817b2e3da1 100644
--- a/gr-digital/python/digital/bindings/diff_encoder_bb_python.cc
+++ b/gr-digital/python/digital/bindings/diff_encoder_bb_python.cc
@@ -14,7 +14,7 @@
/* BINDTOOL_GEN_AUTOMATIC(0) */
/* BINDTOOL_USE_PYGCCXML(0) */
/* BINDTOOL_HEADER_FILE(diff_encoder_bb.h) */
-/* BINDTOOL_HEADER_FILE_HASH(e817d23aac894b3563101df2958577de) */
+/* BINDTOOL_HEADER_FILE_HASH(866ae99d6fc12353e8d45ba2424bcecd) */
/***********************************************************************************/
#include <pybind11/complex.h>
@@ -41,6 +41,7 @@ void bind_diff_encoder_bb(py::module& m)
.def(py::init(&diff_encoder_bb::make),
py::arg("modulus"),
+ py::arg("coding") = ::gr::digital::DIFF_DIFFERENTIAL,
D(diff_encoder_bb, make))