discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] Re: Saving transmitted data from USRP2 to a file


From: Jamin Chan
Subject: [Discuss-gnuradio] Re: Saving transmitted data from USRP2 to a file
Date: Thu, 11 Jun 2009 19:07:41 +0200

hjaffer wrote:
> Hello All,
> 
> I am using the Python example program "usrp2_siggen_gui.py" and wanted 
> to
> save the transmitted data to a file. I added the following lines:
> 
>         self.u = usrp2.source_32fc(self.tb.interface_name(),
> self.tb.mac_addr())
>         self._sink = gr.file_sink(gr.sizeof_gr_complex, 'test.txt')
>         self.tb.connect(self.u, self._sink)
> 
> The addition of the above lines cause what appears to be random data
> (noise?) transmitted to my spectrum analyzer.
> 
> What is the correct way to record what is being transmitted? And does
> anybody know why there isn't a Python program that transmits a recorded
> file? I can record to a file and view it nicely in Matlab. I can 
> transmit a
> signal and view it on my spectrum analyzer nicely. But I cannot seem to
> record and play back a file.
> 
> 
> Thanks for answering my questions!
> 

this is the code i am using to write:

nsamples = 20000   #number of samples to write
filename = "rxsamples.dat"   #file name

self.dst_file = gr.file_sink(gr.sizeof_gr_complex, filename)
self.head = gr.head(gr.sizeof_gr_complex, nsamples)
self.connect(self.source_usrp, self.head, self.dst_file)

and to read:

self.src_file = gr.file_source(gr.sizeof_gr_complex, filename, True) 
#True for repeat data at end of file
self.connect(self.src_file, self.sink_usrp)
-- 
Posted via http://www.ruby-forum.com/.




reply via email to

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