The FFT plot does not shows up, it is empty

9 Ansichten (letzte 30 Tage)
Valeriya Kostyukova
Valeriya Kostyukova am 10 Jun. 2023
Kommentiert: Star Strider am 10 Jun. 2023
I want to get FFT of a vibration signal that is rrecorded in csv file. Fortunately, the figure with the plot of the signal displays correct data. However, when I try to perform fft, the figure is empty. I do not know of it is because of my code, the signal (or csv), or the MATLAB settings. Could you please help me to solve the problem.
Here is the code:
data = readtable('scope_0.csv');
column2 = data.Var2;
figure;
plot(column2(1:2000));
fs = 40000;
l1 = length(column2);
fft_result = fft(column2, l1);
fft_abs = abs(fft_result);
t = 0:1/fs:2000/fs;
freq = 0 : (1/t(end)) : fs/2 - (1/t(end));
figure;
plot(freq, fft_abs(1:length(freq)));
And the figures:
  2 Kommentare
Simon Chan
Simon Chan am 10 Jun. 2023
Could you restart MATLAB and try to run it again?
If it is still not successful, could you attach your data so that we can try to reproduce the same problem or not.
Valeriya Kostyukova
Valeriya Kostyukova am 10 Jun. 2023
I have attached the file, thanks

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Star Strider
Star Strider am 10 Jun. 2023
Perhaps:
data(isinf(data)) = NaN;
data = fillmissing(data, 'linear');
since there may be a NaN or Inf value in ‘data’ that is causing the problem.
It would help to have the ‘scope_0.csv’ file.
  4 Kommentare
Valeriya Kostyukova
Valeriya Kostyukova am 10 Jun. 2023
thanks a lot!
Star Strider
Star Strider am 10 Jun. 2023
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Vibration Analysis finden Sie in Help Center und File Exchange

Produkte


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by