[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Discuss-gnuradio] Help using simple_framer and simple_correlator
From: |
mjquinn |
Subject: |
[Discuss-gnuradio] Help using simple_framer and simple_correlator |
Date: |
Wed, 16 Nov 2005 11:22:28 -0500 |
User-agent: |
Internet Messaging Program (IMP) H3 (4.0.3) |
In order to gain a better understanding of how the simple_framer and the
simple_correlator work, I am trying to implement the following code. However,
when I run the program, I don't get any output. I'm not sure what I'm doing
incorrectly. Once I determine my error, I am also interested on how to use
lfsr_32k_source_s (to replace the file_source) and check_lfsr_32k to determine
error rates in this simple program. Any help would be appreciated.
Thank you,
Mike
#!/usr/bin/env python
from gnuradio import gr
from gnuradio.eng_option import eng_option
from optparse import OptionParser
from gnuradio.wxgui import scopesink
from gnuradio.wxgui import stdgui, fftsink
import wx
class test_loopback_graph (stdgui.gui_flow_graph):
def __init__(self, frame, panel, vbox, argv):
stdgui.gui_flow_graph.__init__ (self, frame, panel, vbox, argv)
parser = OptionParser (option_class=eng_option)
parser.add_option ("-f", "--filename", type="string",
default="payload.txt",
help="read data from FILENAME")
parser.add_option ("-R", "--repeat", action="store_true", default=False)
(options, args) = parser.parse_args ()
# ----------------------------------------------------------------
payload_size = 100 # bytes
# transmitter pipeline
src = gr.file_source (gr.sizeof_char, options.filename, options.repeat)
framer = gr.simple_framer (payload_size)
bytes_to_syms = gr.bytes_to_syms ()
self.connect (src, framer, bytes_to_syms)
# receiver pipeline
corr = gr.simple_correlator (payload_size)
filesink = gr.file_sink (gr.sizeof_char, "loopback_rx.txt")
self.connect (bytes_to_syms,corr, filesink)
def main ():
app = stdgui.stdapp (test_loopback_graph, "Test Loopback")
app.MainLoop ()
if __name__ == '__main__':
main ()