How do I read ".sig" file in Matlab?

19 visualizaciones (últimos 30 días)
Farhan Ali
Farhan Ali el 16 de En. de 2019
Respondida: Gleb Shalimov el 11 de Mayo de 2022
I have to read a binary files which have an extension of ".sig". how do i import them into matlab and plot it's data`?
  3 comentarios
Gleb Shalimov
Gleb Shalimov el 28 de Abr. de 2022
Have you solved this problem?
Jonas
Jonas el 28 de Abr. de 2022
can you provide an exemplary file and information about what should be the content

Iniciar sesión para comentar.

Respuestas (1)

Gleb Shalimov
Gleb Shalimov el 11 de Mayo de 2022
clear all;
close all;
global N_data; %колличество обрабатываемых отсчетов
N_data = 1048576; %колличество обрабатываемых отсчетов
i = sqrt(-1);
% выделение памяти для опорного сигнала и отраженного сигнала
op = zeros(1,N_data,'single')+i*zeros(1,N_data,'single');
kontrol = zeros(1,N_data,'single')+i*zeros(1,N_data,'single');
ima_faila = char('file's name');
ima_faila = strcat(ima_faila,'.sig');
signal = fopen(ima_faila,'rb');
if signal == -1
error('net faila');
end
input_s = fread(signal,N_data*4,'int16');
op(1:N_data) = input_s(1:4:N_data*4)+i*input_s(2:4:N_data*4); % опорный дальше от Е
kontrol(1:N_data) = input_s(3:4:N_data*4)+i*input_s(4:4:N_data*4); % контрольный ближе к Е

Categorías

Más información sobre Instrument Control Toolbox Supported Hardware en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by