From 9628d6e6deaf1ebaefd72a67fac291557baf49c9 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Wed, 17 Nov 2021 19:39:53 +0100 Subject: Begin working on frame syncronization --- src/gr-fadingui/python/xor_frame_sync.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/gr-fadingui/python/xor_frame_sync.py (limited to 'src/gr-fadingui/python/xor_frame_sync.py') diff --git a/src/gr-fadingui/python/xor_frame_sync.py b/src/gr-fadingui/python/xor_frame_sync.py new file mode 100644 index 0000000..9d9064f --- /dev/null +++ b/src/gr-fadingui/python/xor_frame_sync.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# Copyright 2021 Naoki Pross. + + +import numpy +from gnuradio import gr + +class xor_frame_sync(gr.sync_block): + """ + docstring for block xor_frame_sync + """ + def __init__(self, sync_pattern): + gr.sync_block.__init__(self, + name="xor_frame_sync", + in_sig=[np.byte], + out_sig=[np.byte]) + + def work(self, input_items, output_items): + inp = input_items[0] + out = output_items[0] + + out[:] = inp + + return len(output_items[0]) + -- cgit v1.2.1