Sir
I am trying to build an SID SDR receiver,where i require a file sink…
When i run my flow graph,i get a file of format octet-stream being
written
into my computer.
But i am not able to access or open my dat octet-stream file.
Sir may i know how can i access the data being written into it?
Thank you
On Mon, May 21, 2012 at 12:19 AM, ambily joseph [email protected]
wrote:
Discuss-gnuradio mailing list
[email protected]
Discuss-gnuradio Info Page
The file sink is just a dump of the data stream. If the data stream
content was simple bytes then the content of the file is
straightforward. If the data stream contained complex numbers then the
file will contain a list of complex numbers where each complex number
is given by two floats and each float by (usually) 4 bytes.
See the files gnuradio/gnuradio-core/src/lib/io/gr_file_sink.cc and
gr_file_source.cc for the implementations of the gnuradio file reading
and writing blocks.
You could also use python and gnuradio to convert the files into some
other format.
from gnuradio import gr
Assuming the data stream was complex numbers.
src = gr.file_source(gr.sizeof_gr_complex, “the_file_name”)
snk = gr.vector_sink_c()
tb = gr.top_block()
tb.connect(src, snk)
tb.run()
The complex numbers are then accessible as a python list.
data = snk.data()
Ben
It depends what you mean by readable format. If you just want to get
an idea of the values and the file isn’t to big then do:
from gnuradio import gr
src = gr.file_source(1, “the_file_name”)
snk = gr.vector_sink_b()
tb = gr.top_block()
tb.connect(src, snk)
tb.run()
The bytes will be presented as a list of integers in python.
data = snk.data()
print(data)