-1

I have saved a gnu radio binary file of my experiment, which I would like to open on Matlab for further post-processing. However, the normal fopen,fread doesn't seem to work as the array it generates contains only zeros, which contradicts the output seen on gnu radio when the file is used as a file source. Moreover, I have tried using read_complex_binary() function for gnu radio on Matlab which produces the same array like the one above mentioned. Please see the attached image.

My goal: open the gnu file on Matlab so that I get the same plot as figure 2

  • There's an [FAQ entry](https://wiki.gnuradio.org/index.php/FAQ#What_is_the_file_format_of_a_file_sink.3F_How_can_I_read_files_produced_by_a_file_sink.3F) for that. – Marcus Müller Mar 20 '19 at 15:53
  • I referred to the FAQ entry in gnuradio with Matlab, but the said method did not work for me to convert the data into complex values. Instead of `complex_v = values(1,:) + values(2,:)*i;`, try `complex_v = values(1:2:end) + values(2:2:end)*1i;` – Padmal Jun 28 '22 at 13:39

1 Answers1

0

fopen should work, maybe you have problem with encoding. Try this to force Big-Endian:

f = fopen(filename, 'rb'); 
v = fread(f,count); 
fclose(f);

But remember that MATLAB by default would treat data as integer. If there are different type (you didn't specified it in question) you need to declare it, for example v = fread (f, count, 'float').

Karls
  • 731
  • 7
  • 17