binary - How to edit the file generated by file sink of Gnu Radio? -
i find file generated file sink block binary format, can not edit gedit under linux or else, how can edit file?
i send dat file contains "hello world" , want recieve file contains "hello world"
this asked often. here's link faq , excerpt:
all files in pure binary format. bits. that’s it. floating point data stream saved 32 bits in file, 1 after other. complex signal has 32 bits real part , 32 bits imaginary part. reading complex number means reading in 32 bits, saving real part of complex data structure, , reading in next 32 bits imaginary part of data structure. , keep reading data.
take @ octave , python files in
gr-utils
reading in data using octave , python’s scipy module.the exception format when using metadata file format. these files produced file meta sink: http://gnuradio.org/doc/doxygen/classgr_1_1blocks_1_1file__meta__sink.html block , read file meta source block. see manual page on metadata file format more information how deal these files.
a one-line python command read entire file numpy array is:
f = scipy.fromfile(open("filename"), dtype=scipy.uint8)
replace dtype scipy.int16, scipy.int32, scipy.float32, scipy.complex64 or whatever type using.
so question "how edit this?" boils down understanding raw data. can of course modify on byte level (e.g. using hexeditor), usually, you'd have (or write) program loads data in-program represenation (e.g. array of complex numbers) , @ that.
the way you're asking suggests you're not aware of you're looking @ (because don't mention how transmit string). maybe data has bit errors due symbol errors due noise? quite possibly, there's no synchronization done, received bits did not end on same byte order meant them sent etc.
i think might place point gnu radio guided tutorials.
Comments
Post a Comment