summaryrefslogtreecommitdiff
path: root/gnuradio-examples
diff options
context:
space:
mode:
authorTom Rondeau2010-11-16 22:34:38 -0800
committerTom Rondeau2010-11-16 22:34:38 -0800
commit7930b1ebbb7328b69d78ac4dc3ea919e0d00c2ae (patch)
tree8f84008037f47a42f7b6219a3451c40e6bc8ba3a /gnuradio-examples
parente6751f477ba006923e9f0d2454ff870c52a6f0a5 (diff)
downloadgnuradio-7930b1ebbb7328b69d78ac4dc3ea919e0d00c2ae.tar.gz
gnuradio-7930b1ebbb7328b69d78ac4dc3ea919e0d00c2ae.tar.bz2
gnuradio-7930b1ebbb7328b69d78ac4dc3ea919e0d00c2ae.zip
Adding a simple example of using the tagger and tagging file.
Diffstat (limited to 'gnuradio-examples')
-rwxr-xr-xgnuradio-examples/python/tags/test_file_tags.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/gnuradio-examples/python/tags/test_file_tags.py b/gnuradio-examples/python/tags/test_file_tags.py
new file mode 100755
index 000000000..a658256c7
--- /dev/null
+++ b/gnuradio-examples/python/tags/test_file_tags.py
@@ -0,0 +1,29 @@
+#!/usr/bin/env python
+
+from gnuradio import gr
+import scipy
+
+def main():
+ data = scipy.arange(0, 32000, 1).tolist()
+ trig = 100*[0,] + 100*[1,]
+
+ src = gr.vector_source_s(data, True)
+ trigger = gr.vector_source_s(trig, True)
+
+ thr = gr.throttle(gr.sizeof_short, 10e3)
+ ann = gr.annotator_alltoall(1000000, gr.sizeof_short)
+ tagger = gr.burst_tagger(gr.sizeof_short)
+
+ fsnk = gr.tagged_file_sink(gr.sizeof_short)
+
+ tb = gr.top_block()
+ tb.connect(src, thr, (tagger, 0))
+ tb.connect(trigger, (tagger, 1))
+ tb.connect(tagger, fsnk)
+
+ tb.run()
+
+if __name__ == "__main__":
+ main()
+
+