# How to Access Received Data for Use In Changing RX Parameters

**URL:** <https://www.ruby-forum.com/t/how-to-access-received-data-for-use-in-changing-rx-parameters/240506>\
**Category:** GNU Radio\
**Created:** [April 17, 2014, 3:51pm UTC](https://www.ruby-forum.com/t/how-to-access-received-data-for-use-in-changing-rx-parameters/240506 "2014-04-17T15:51:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [April 17, 2014, 3:51pm UTC](https://www.ruby-forum.com/t/how-to-access-received-data-for-use-in-changing-rx-parameters/240506/1 "2014-04-17T15:51:45Z")

</div>

Hey List,

I have two scripts I am running, the ofdm\_v1\_tx\_freq\_test.py and the RX  
version of it (see flow graph images and attached transmitter Python  
script). I am transmitting a sinusoid using OFDM modulation over the  
USRP,  
it works perfectly.

I have made an alteration to the transmitter script by adding a  
frequency  
change function that goes off every 2.5 seconds. The frequency will  
inclemently go up 1 MHz 20 times before going back to the default. That  
code works; what I want to do now is to cease the sinusoid broadcast at  
every 2.5 seconds so I can transmit the new frequency to the receiver  
right  
before I change it. I think I can figure that part out, I may just use  
another vector source with the new frequency and have transmit five  
times.  
Probably use another flow graph to implement it. If there is a better  
way  
to do, I am open for ideas.

Now for my question: after receiving this new frequency on the RX side,  
how  
do I get my script to read this data and use it to change frequencies? I  
have a feeling that this may be simple to do but I am at a loss in  
figuring  
it out.

Please note, this is more of a proof of concept work, so there is a  
reason  
why I do not have identical frequency change functions in both TX and  
RX,  
the goal down the road is to get some DSA capabilities.

Thanks,

Jon

---

<div class="post-metadata">

**Author:** ![jfaulkenberry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c2a13f/32.png) [@jfaulkenberry](https://www.ruby-forum.com/u/jfaulkenberry)\
**Post date:** [April 17, 2014, 7:41pm UTC](https://www.ruby-forum.com/t/how-to-access-received-data-for-use-in-changing-rx-parameters/240506/2 "2014-04-17T19:41:57Z")

</div>

Jonathan F. wrote

> code works; what I want to do now is to cease the sinusoid broadcast at  
> have a feeling that this may be simple to do but I am at a loss in
> 
> * * *
> 
> Discuss-gnuradio mailing list

> Discuss-gnuradio@

> [Discuss-gnuradio Info Page](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)
> 
> ofdm\_v1\_tx\_freq\_test.py (7K)

\<[http://gnuradio.4.n7.nabble.com/attachment/47642/0/ofdm\_v1\_tx\_freq\_test.py&gt](http://gnuradio.4.n7.nabble.com/attachment/47642/0/ofdm_v1_tx_freq_test.py&gt);

> ofdm\_v1\_rx.png (97K)  
> \<[http://gnuradio.4.n7.nabble.com/attachment/47642/1/ofdm\_v1\_rx.png&gt](http://gnuradio.4.n7.nabble.com/attachment/47642/1/ofdm_v1_rx.png&gt);  
> ofdm\_v1\_tx.png (77K)  
> \<[http://gnuradio.4.n7.nabble.com/attachment/47642/2/ofdm\_v1\_tx.png&gt](http://gnuradio.4.n7.nabble.com/attachment/47642/2/ofdm_v1_tx.png&gt);

You can use a message queue to get data in and out of the flow from your  
Python script. I’m sure there are better ways, but this is what I have  
been  
experimenting with recently. It’s just a matter of polling the queue  
and  
clearing it when there is new data. This is a good write up:

> **[Intro to GNURadio and the USRP (Part 4, message blocks)](https://pwnhome.wordpress.com/2011/04/19/intro-to-gnuradio-and-the-usrp-part-4/)**
>
> This week I started playing with the message source and sink blocks within GNURadio and found them quite useful. Especially for accessing (sending and receiving) data outside of the actual GNURadio…

–  
View this message in context:  
[http://gnuradio.4.n7.nabble.com/How-to-Access-Received-Data-for-Use-In-Changing-RX-Parameters-tp47642p47655.html](http://gnuradio.4.n7.nabble.com/How-to-Access-Received-Data-for-Use-In-Changing-RX-Parameters-tp47642p47655.html)  
Sent from the GnuRadio mailing list archive at [Nabble.com](http://Nabble.com).
