discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] OFDM GRC block attempt


From: Josh Blum
Subject: Re: [Discuss-gnuradio] OFDM GRC block attempt
Date: Fri, 14 Sep 2007 22:30:50 -0400
User-agent: Thunderbird 2.0.0.0 (X11/20070326)

Its not quite that. I should explain. The packet modulator block in blks is weird for another reason, it takes another gnuradio block (a modulator) as an argument in the constructor. The problem being that this does not fit into GRC too well.

My "old" solution was to feed the constructor a dummy block (just to forward data). And then, to connect the actual modulator block to the output of the packet modulator. Something like: gr data stream -> message sink -> packet modulator w/ dummy (byte out) -> dpsk_mod (complex out) -> data sink

However, the "new" blks2 packet modulator has an io signature that requires a byte input and a complex output. The io signature will not allow a dummy block (one that just forwards data) because the data types will not match. I think it is best to just make my own packet modulator block that uses the code from the blks2.

This implementation of the packet modulator will take a data stream (of any type), read data from a message sink, packetize, write data to a message source. Then, a modulator (like dpsk) could be connected to the output of this packet modulator using top_block.connect.

...Similar story for the packet demodulator.

Maybe it would be useful to have a packet modulator/demodulator that fits into the typical gnuradio block model? Also, I was under the impression that the mblocks will eventually implement this kind of functionality (packets, error encoding, recovery..).

Thoughts?

-Josh

address@hidden wrote:
The conversion of all the example code and blks code on the trunk to the new 
3.1 flow graph code is nearly complete.

This is being done in the jcorgan/t162 developer branch if you want to take a 
look.

Once this is merged into the trunk, you'll be able to restore GRC functionality.

Sent via BlackBerry by AT&T

-----Original Message-----
From: Josh Blum <address@hidden>

Date: Fri, 14 Sep 2007 20:34:40 To:Dev Ramudit <address@hidden>
Cc:address@hidden
Subject: Re: [Discuss-gnuradio] OFDM GRC block attempt


In short, the GRC code for the packet modulator was no good after the "incompatible trunk check in". So, I just deleted the packet mod/demod code in GRC.

To restore the functionality of the packet mod/demod (in grc), i would have to cannibalize the current blks.pkt code. I will be glad to do this, especially if someone is using the blocks.

The only thing about the packet mod/demod blocks is that they are implemented poorly. For example, to implement a packet modulation block, you have to sample the gnuradio stream with a message sink and a thread, the error coding/packetizing is done in python with packet utils, and then the data is pushed back into the gnuradio stream with a message source. Not too efficient. Any suggestions before I go ahead with the message source/sink idea?

Anyway, it would be great to get ofdm working with GRC.

-Josh



Dev Ramudit wrote:
Hello all,

        I'm trying to write an OFDM mod/demod for the gnuradio companion and
I'm running into a problem. I'm following the (now deprecated?) packet
modulator code that was in GRC very closely. I have an OFDMDemod block
which creates the following class when its used:

---

class OFDMDemodHelper(gr.hier_block2):
        """Forward data from ofdm demod to the gr data stream."""
        def __init__(self, item_size, options):
                #create hier block
                gr.hier_block2.__init__(
                        self, 'ofdm_demod',
                        gr.io_signature(1, 1, Complex().get_num_bytes()),
                        gr.io_signature(1, 1, item_size)
                )
                #the message source (handles the output data stream)
                msg_source = gr.message_source(item_size, DEFAULT_QUEUE_LIMIT)
                msgq = msg_source.msgq()
                def callback(ok, payload):
                        if ok: msgq.insert_tail(gr.message_from_string(payload, 
0, item_size,
len(payload)/item_size))
                ofdm_demod = blks.ofdm_demod(
                        fg=self,
                        options=options,
                        callback=callback,
                )
                #connections
                self.connect(msg_source, self)
                self.connect(self, ofdm_demod.head)

---

This is basically the same as the old packet demod code, with a few
small changes for OFDM. Unfortunately, I get the following error:

---

 File "/home/dramudit/work/gnuradio/grc/src/SignalBlockDefs/Packet.py",
line 337, in __init__
    callback=callback,
  File
"/usr/local/lib/python2.4/site-packages/gnuradio/blksimpl/ofdm.py", line
218, in __init__
    options.log)
  File
"/usr/local/lib/python2.4/site-packages/gnuradio/blksimpl/ofdm_receiver.py",
line 56, in __init__
    self.fg.connect(self.chan_filt, self.ofdm_sync)
  File
"/usr/local/lib/python2.4/site-packages/gnuradio/gr/hier_block2.py",
line 46, in connect
    self._connect(points[i-1], points[i])
  File
"/usr/local/lib/python2.4/site-packages/gnuradio/gr/hier_block2.py",
line 50, in _connect
    (dst_block, dst_port) = self._coerce_endpoint(dst)
  File
"/usr/local/lib/python2.4/site-packages/gnuradio/gr/hier_block2.py",
line 61, in _coerce_endpoint
    raise ValueError("unable to coerce endpoint")
ValueError: unable to coerce endpoint

---

Any suggestions as far as fixing this error, or another approach?

Thanks,
Dev


_______________________________________________
Discuss-gnuradio mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio




_______________________________________________
Discuss-gnuradio mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio





reply via email to

[Prev in Thread] Current Thread [Next in Thread]