discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] file sink issue


From: Ben Reynwar
Subject: Re: [Discuss-gnuradio] file sink issue
Date: Mon, 21 May 2012 07:14:37 -0700

On Mon, May 21, 2012 at 12:19 AM, ambily joseph <address@hidden> wrote:
> 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
>
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
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



reply via email to

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