Interpreting FFT Graph with Noise Floor

49 visualizaciones (últimos 30 días)
Raidah Zaman
Raidah Zaman el 10 de Mayo de 2021
Comentada: Star Strider el 11 de Mayo de 2021
Hello,
I am trying to analyze data that I recorded from the Force Sensitive Resistors (FSRs) coded on Arduino through data streamer on excel. I used four FSRs, so there are 4 columns of data over a set of time (1200 rows, about 15 seconds). I seperated time from the FSR data so that I can graph the FFT of the FSR data against the time.
I succesfully made a correct code and have proper results from it, however I need help interpeting the graphs.
Code:
X = importdata('tapedata.csv');
t = importdata('tapetimefix.csv');
subplot(2,1,1);
plot(t,X);
grid
xlabel('Time')
ylabel('Amplitude')
title('FSR Recording (Tape)');
L = numel(X);
Ts = mean(diff(t));
% Tsd = std(mean(diff(t)))
Fs = 1/Ts;
Fn = Fs/2;
xft=fft(X-mean(X),[],1)/L;
xabs = abs(xft);
subplot(2,1,2);
plot(t,xabs);
Fv = linspace(0, 1, fix(L/2)+1)*Fn;
Iv = 1:numel(Fv);
xabs = abs(xft);
subplot(2,1,2);
plot(Fv,mag2db(xabs(Iv)*2))
grid
ylim([-75 50])
xlabel('Freqency [units]')
ylabel('Power [dB]')
title('FFT Analysis Graph (Tape)');
I was wondering is that just a lot noise or if there are no deviances from -50db meaning the FSRs is constant?
  6 comentarios
Star Strider
Star Strider el 10 de Mayo de 2021
It is not using whatever row or column that creates the yellow line to calculate the fft.
Since ‘tapedata.csv’ and ‘tapetimefix.csv’ are not provided, it is not possible to provide further details.
Raidah Zaman
Raidah Zaman el 10 de Mayo de 2021
Here my apologies, I have attached it.

Iniciar sesión para comentar.

Respuesta aceptada

Star Strider
Star Strider el 11 de Mayo de 2021
Try this —
X = readmatrix('https://www.mathworks.com/matlabcentral/answers/uploaded_files/613760/tapedata.csv');
t = readmatrix('https://www.mathworks.com/matlabcentral/answers/uploaded_files/613765/tapetimefix.csv');
SizeX = size(X)
SizeX = 1×2
1062 4
figure
for k = 1:size(X,2)
subplot(4,1,k)
plot(t, X(:,k))
title(sprintf('Column %d',k))
end
figure
subplot(3,1,1);
plot(t,X);
grid
xlabel('Time')
ylabel('Amplitude')
title('FSR Recording (Tape)');
L = size(X,1); % <= CHANGED
Ts = mean(diff(t));
% Tsd = std(mean(diff(t)))
Fs = 1/Ts;
Fn = Fs/2;
xft=fft(X-mean(X))/L;
xabs = abs(xft);
subplot(3,1,2);
plot(linspace(-Fn,Fn,numel(t)),mag2db(fftshift(xabs)*2));
grid
ylim([-75 50])
Fv = linspace(0, 1, fix(L/2)+1)*Fn;
Iv = 1:numel(Fv);
xabs = abs(xft(:,3)); % <= CHANGED
subplot(3,1,3);
plot(Fv,mag2db(xabs(Iv)*2))
grid
ylim([-75 50])
xlabel('Freqency [units]')
ylabel('Power [dB]')
title('FFT Analysis Graph (Tape)');
This appears to be close to the desired result.
  4 comentarios
Raidah Zaman
Raidah Zaman el 11 de Mayo de 2021
I see thank you, I was able to learn so much from this.
Star Strider
Star Strider el 11 de Mayo de 2021
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Spectral Measurements 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