Writing Binary Files: Difference between revisions

From GNU Radio
Jump to navigation Jump to search
Line 11: Line 11:


[[File:Storing_binary_files_file_sink_types_drop_down.png]]
[[File:Storing_binary_files_file_sink_types_drop_down.png]]


Another common type is ''float'', represented by '''<span style="color:orange">orange</span>''', which stores real samples as 32-bit floats.
Another common type is ''float'', represented by '''<span style="color:orange">orange</span>''', which stores real samples as 32-bit floats.


[[File:Storing_binary_files_file_sink_real_floats.png]]
[[File:Storing_binary_files_file_sink_real_floats.png]]
Data may also be stored as 16-bit integers using the short type. Both real and complex samples may be stored with this type, which will be discussed later in this tutorial.
[[File:Storing_binary_files_file_sink_short_ints.png]]
The '''File Sink''' also has a ''File'' parameter which needs to be defined. Click on the three dots:
[[File:Storing_binary_files_navigate_to_path.png]]
On Ubuntu a window will appear which will allows navigation to different directories so the file can be saved. The file can be saved anywhere, including the home directory although for this example it is saved in ''/opt/tutorials'' and the output filename is ''binary_file''.
[[File:Storing_binary_files_save_file.png]]

Revision as of 23:10, 5 April 2024

The File Sink block takes incoming samples and saves them to local storage.

Block Options for Data Types

By default the File Sink block uses a 32-bit float format for saving interleaved I and Q:

Storing binary files file sink complex floats.png


Opening the blocks properties, other formats can be selected from the drop down menu:

Storing binary files file sink types drop down.png


Another common type is float, represented by orange, which stores real samples as 32-bit floats.

Storing binary files file sink real floats.png


Data may also be stored as 16-bit integers using the short type. Both real and complex samples may be stored with this type, which will be discussed later in this tutorial.

Storing binary files file sink short ints.png


The File Sink also has a File parameter which needs to be defined. Click on the three dots:

Storing binary files navigate to path.png


On Ubuntu a window will appear which will allows navigation to different directories so the file can be saved. The file can be saved anywhere, including the home directory although for this example it is saved in /opt/tutorials and the output filename is binary_file.

Storing binary files save file.png