Editing benchmark_rx.py for spectrum access

Hi all,

This question is asked a number of times. And I believe it shouldn’t be
that
tough. Somebody explain where to put this logic in benchmark_rx.py

If no data received
set freq to freq number 2
else
stay on the current freq

Waiting for a response.

Umair N. wrote:

        stay on the current freq

Umair


Discuss-gnuradio mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Hi,

I’ve done this (not in benchmark_rx) by simply adding a timeout
(utilizing
wxpython see Timer) and a global variable that keeps track of which
frequency to switch to. If no data is received before the timeout, I
simply
switch to freq 2.

Regards,
Dan

View this message in context:
http://www.nabble.com/Editing-benchmark_rx.py-for-spectrum-access-tp24528535p24785911.html
Sent from the GnuRadio mailing list archive at Nabble.com.

Hi,
Did the flowgraph of the code (in which you added the timeout) involved
receive_path???

Regards,
Ali

Ali Siddiqi wrote:

If no data received

Dan
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Discuss-gnuradio mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Hi,

Here’s a short cut-out with the code I’ve used:


class transceiver(gr.top_block):
def init(self, rx_callback):
gr.top_block.init(self)
self.usrp_decim = 16
u=usrp.source_c(0, self.usrp_decim)
self.rxpath=oqpsk_rx_graph(rx_callback,u)
self.connect(self.rxpath)
self.txpath=transmit_path()
self.connect(self.txpath)

class cs_mac(wx.Frame):
def init(self, parent, id, title):
wx.Frame.init(self, parent, id, title, size=(0, 0))
self.SenseTimer=wx.Timer(self, id=0)
self.Bind(wx.EVT_TIMER, self.OnSenseTimer, id=0)

def OnSenseTimer(self,event):
    tb.rxpath.u.tune(tb.rxpath.subdev._which, tb.rxpath.subdev,

2405000000+(op.current_channel-11)*5000000)

class ieee_transceiver(wx.App):
def OnInit(self):
global tb
global frame

    frame=cs_mac(None, -1, '')

    tb=transceiver(frame.rx_callback)

    frame.Show(False)
    try:
        tb.start()
    except:
        print "start except"
    return True

if name == ‘main’:
try:
application=ieee_transceiver(0)
application.MainLoop()
except KeyboardInterrupt:
pass


As you can see the timer will change rx-frequency on timeout. Hope this
code
will be helpful even though it’s poorly commented.

Regards,
Dan

View this message in context:
http://www.nabble.com/Editing-benchmark_rx.py-for-spectrum-access-tp24528535p24786838.html
Sent from the GnuRadio mailing list archive at Nabble.com.

Ali Siddiqi wrote:

Hi,
Did the flowgraph of the code (in which you added the timeout)
involved

receive_path???

Regards,
Ali

On Mon, Aug 3, 2009 at 11:21 AM, Dan R. [email protected]
wrote:

Umair N. wrote:

Hi all,

This question is asked a number of times. And I believe it
shouldn’t be

that
tough. Somebody explain where to put this logic in
benchmark_rx.py

We have a project here at Virginia Tech where we modified the benchmark
example to perform spectrum sensing and essentially add a dynamic
spectrum access component to it. The primary goal was to integrate this
gnuradio script with CROSS, our open source cognitive engine, in order
to have CROSS select the channel based on previous experience. However,
we also have the option to run it without CROSS and select a channel
randomly if a primary user is detected. Check out the README for more
info on how to do this.

It’s a good basic script for figuring out how to do simple spectrum
sensing(probe)/transmission/reception all in one flowgraph.

The benchmark script needs to be copied into
gnuradio-examples/python/digital/ in order for it to function properly.

Basically if you have 2 nodes running this script they will rendezvous
and start exchanging bits. If another signal comes into the same
channel they will move to another channel. The channels are hard coded
in right now.

benchmark_dsa.py script:
https://cornet.wireless.vt.edu/trac/browser/vtcross/trunk/src/cognitive_
engines/DSA_CE/examples/gnuradio-examples

General Info about the cognitive engine:
https://cornet.wireless.vt.edu/trac/wiki/Cross

Tim

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs