I need to find the FFT plot of my excel data.
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Emimal M
el 5 de Feb. de 2022
Comentada: Emimal M
el 3 de Mzo. de 2022
Hi, am trying to get the FFT plot of my EMG data. Upon running the code am getting the numerical output of FFT but not getting the plot which I need and hereby attaching the code which I used. The file also I attach. Plz help me to get the plot.
clc
clear all
load Target1.mat
x = Target1.X;
Y = Target1.Tr;
plot(x,Y)
z = fft(x)
Fs = 1000; % Sampling frequency
T = 1/Fs; % Sampling period
L = 1000; % Length of signal
t = (0:L-1)*T; % Time vector
f = Fs*(0:(L/2))/L;
plot(z,f)
title('FFT of an EMG signal')
xlabel('f (Hz)')
ylabel('|Z(f)|')
0 comentarios
Respuesta aceptada
KSSV
el 5 de Feb. de 2022
Replace this line:
load Target1.mat
by
Target1 = readtable('Target1.xlsx') ;
Más respuestas (1)
Walter Roberson
el 5 de Feb. de 2022
Change
plot(z,f)
to
Z = z(1:length(f));
plot(f, real(Z), f, imag(Z))
legend({'real', 'imaginary'})
Ver también
Categorías
Más información sobre Spectral Measurements en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!