Interpreting FFT Graph with Noise Floor

49 次查看(过去 30 天)
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 个评论
Star Strider
Star Strider 2021-5-10
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.

请先登录,再进行评论。

采纳的回答

Star Strider
Star Strider 2021-5-11
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 个评论
Raidah Zaman
Raidah Zaman 2021-5-11
I see thank you, I was able to learn so much from this.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Spectral Measurements 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by