Effacer les filtres
Effacer les filtres

How can I convert Rohde & Schwarz Oscillosope bin files to MATLAB compatible files?

40 vues (au cours des 30 derniers jours)
I have bin files from Rohde & Schwarz RTO2044 Oscillosope and now I want to use these in MATLAB. Is there any MATLAB function/code available to directly get the waveform out of the .bin file? There are function available for Keysight Agilent Scope but I couldn't find for Rohde and Schwarz.
  1 commentaire
dpb
dpb le 21 Mai 2022
Modifié(e) : dpb le 21 Mai 2022
Not familiar w/ Rohde & Schwarz; it might be expedient to use some of the vendor-supplied tools to convert to some other format first; they surely have ways to get to non-proprietary formats.
Lacking that, starting w/ the definition of the file structure, may have to build own import tool...surely they must have sample C or other code to read the files, one expedient way might be to wrap it into a mex function or class of functions.
rohde-schwarz.com/webhelp/RTO_HTML_UserManual> links to the description of output data files...

Connectez-vous pour commenter.

Réponse acceptée

Pedro
Pedro le 24 Août 2023
After many trials, I discovered that the binary encoding from Rohde & Schwarz oscilloscope is a Floating-point with 32 bits (4 bytes). Matlab has a special word for this precision type: 'single' (see more details in Read data from binary file - MATLAB fread (mathworks.com))
So, a simple fread function passing the precision argument 'single' will do the work. See example below.
fileName = 'D:\example.Wfm.bin';
fileID = fopen(fileName);
A = fread(fileID,'single');
Error using fread
Invalid file identifier. Use fopen to generate a valid file identifier.
Just be aware that your waveform will not start exactly at the first point in A, as usually there is a heading in the binary file. In the oscilloscope I'm using, I found the heading occupying the first 43 points in A, but this may vary.
  1 commentaire
Prerna Dhull
Prerna Dhull le 28 Août 2023
Modifié(e) : Prerna Dhull le 28 Août 2023
Thank You @Pedro. It worked for me. You are right, the waveform is not starting from the exact point and has some points at the start.

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by