how to do FFT from signal figure

7 visualizaciones (últimos 30 días)
borhan VA
borhan VA el 20 de Dic. de 2018
Comentada: borhan VA el 23 de Dic. de 2018
Hi
i used this code to plot ecg signals, now how can i use FFT (fast fourie transform ) code to my signal ?
function plotATM(a02m)
infoName = strcat('a02m', '.info');
matName = strcat('a02m', '.mat');
Octave = exist('OCTAVE_VERSION');
load(matName);
fid = fopen(infoName, 'rt');
fgetl(fid);
fgetl(fid);
fgetl(fid);
[freqint] = sscanf(fgetl(fid), 'Sampling frequency: %f Hz Sampling interval: %f sec');
interval = freqint(2);
fgetl(fid);
if(Octave)
for i = 1:size(val, 1)
R = strsplit(fgetl(fid), char(9));
signal{i} = R{2};
gain(i) = str2num(R{3});
base(i) = str2num(R{4});
units{i} = R{5};
end
else
for i = 1:size(val, 1)
[row(i), signal(i), gain(i), base(i), units(i)]=strread(fgetl(fid),'%d%s%f%f%s','delimiter','\t');
end
end
fclose(fid);
val(val==-32768) = NaN;
for i = 1:size(val, 1)
val(i, :) = (val(i, :) - base(i)) / gain(i);
end
x = (1:size(val, 2)) * interval;
plot(x', val');
for i = 1:length(signal)
labels{i} = strcat(signal{i}, ' (', units{i}, ')');
end
legend(labels);
xlabel('Time (sec)');
% grid on
end
thanks

Respuesta aceptada

Mark Sherstan
Mark Sherstan el 21 de Dic. de 2018
Follow the example here.
  1 comentario
borhan VA
borhan VA el 23 de Dic. de 2018
hi thank you for your replying but i can't find something usefull ,
I just want to do FFT from my last signal figue that val of value is '4*60000 double' and value of 'x is 1*60000 double"
thanks alot

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by