diff options
author | Nao Pross <np@0hm.ch> | 2021-12-03 17:54:07 +0100 |
---|---|---|
committer | Nao Pross <np@0hm.ch> | 2021-12-03 18:04:29 +0100 |
commit | 0cb8ac7bd0e88d6d26c1fda3abcf0977c2e8150b (patch) | |
tree | e1854df3bb4cf7ba38fe3f9f691c2b895eb291d3 /tests/correlator/epy_block_1.py | |
parent | Improve frequency LPF (diff) | |
download | Fading-0cb8ac7bd0e88d6d26c1fda3abcf0977c2e8150b.tar.gz Fading-0cb8ac7bd0e88d6d26c1fda3abcf0977c2e8150b.zip |
Fix bug that makes jump estimated frequency to unreasonably high values
Diffstat (limited to '')
-rw-r--r-- | tests/correlator/epy_block_1.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/correlator/epy_block_1.py b/tests/correlator/epy_block_1.py new file mode 100644 index 0000000..d30c2eb --- /dev/null +++ b/tests/correlator/epy_block_1.py @@ -0,0 +1,27 @@ +""" +Embedded Python Blocks: + +Each time this file is saved, GRC will instantiate the first class it finds +to get ports and parameters of your block. The arguments to __init__ will +be the parameters. All of them are required to have default values! +""" + +import numpy as np +from gnuradio import gr + +np.set_printoptions(formatter={'int':hex}) + +class blk(gr.sync_block): + def __init__(self): + gr.sync_block.__init__( + self, + name='Printer', + in_sig=[np.byte], + out_sig=[] + ) + + def work(self, input_items, output_items): + inp = np.array(input_items[0], dtype=np.uint8) + print(f"Decoded {len(inp)} samples:\n{inp}") + + return len(inp) |