# Store data with usrp\_spectrum\_sense.py

**URL:** <https://www.ruby-forum.com/t/store-data-with-usrp-spectrum-sense-py/207256>\
**Category:** GNU Radio\
**Created:** [May 21, 2011, 8:25pm UTC](https://www.ruby-forum.com/t/store-data-with-usrp-spectrum-sense-py/207256 "2011-05-21T20:25:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [May 21, 2011, 8:25pm UTC](https://www.ruby-forum.com/t/store-data-with-usrp-spectrum-sense-py/207256/1 "2011-05-21T20:25:52Z")

</div>

Hi everyone,  
I am new in GNUradio and I want to sense the spectrum of Wifi from 2.4G  
to 2.5 G with a USRP.  
I have been reading through a lot of discussions in the forum but I have  
not been able to store any data using usrp\_spectrum\_sense.py. I want to  
analyze this data with matlab, but I dont get any suitable file after  
running spectrum sense. I know that I have to modify the script, but I  
dont know how. I am quite bad at programming, so I would appreciate so  
much a way to find the solution(it must be very easy, but I am usless in  
programming)  
Thanks in advance for your help

---

<div class="post-metadata">

**Author:** ![Miguel\_Angel\_Sanz\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc29f/32.png) [@Miguel\_Angel\_Sanz\_R](https://www.ruby-forum.com/u/Miguel_Angel_Sanz_R)\
**Post date:** [May 22, 2011, 2:30am UTC](https://www.ruby-forum.com/t/store-data-with-usrp-spectrum-sense-py/207256/2 "2011-05-22T02:30:55Z")

</div>

Hi,

maybe you can try to catch them into a file, you know, write python  
script  
like f.open() and f.write(), that stuff. You can google it for its  
usage.  
Hope this helps.

On Sun, May 22, 2011 at 2:04 AM, Miguel Angel Sanz Rodriguez \<

---

<div class="post-metadata">

**Author:** ![Miguel\_Angel\_Sanz\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc29f/32.png) [@Miguel\_Angel\_Sanz\_R](https://www.ruby-forum.com/u/Miguel_Angel_Sanz_R)\
**Post date:** [May 23, 2011, 10:03am UTC](https://www.ruby-forum.com/t/store-data-with-usrp-spectrum-sense-py/207256/3 "2011-05-23T10:03:13Z")

</div>

On Sat, May 21, 2011 at 7:04 PM, Miguel Angel Sanz Rodriguez \<  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:

> 

Have a look at usrp\_rx\_cfile.py. This saves the data from the USRP  
directly  
to a file. You can then mix this and the usrp\_spectrum\_sense.py to  
probably  
get what you want.

Tom

---

<div class="post-metadata">

**Author:** ![Miguel\_Angel\_Sanz\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc29f/32.png) [@Miguel\_Angel\_Sanz\_R](https://www.ruby-forum.com/u/Miguel_Angel_Sanz_R)\
**Post date:** [May 26, 2011, 10:11pm UTC](https://www.ruby-forum.com/t/store-data-with-usrp-spectrum-sense-py/207256/4 "2011-05-26T22:11:03Z")

</div>

I did a project similar to this. Look at this structure

m = parse\_msg(tb.msgq.delete\_head())

There is a field called data (I think) that contains the magnitude of  
the  
sweep. You record m.data to a file (like a csv, hdf5, or binary file).  
Keep in mind that you have to do the equivalent of fftshift.

Hope that helps.

On Sat, May 21, 2011 at 2:04 PM, Miguel Angel Sanz Rodriguez \<
