MATLAB Answers

Interpreting FFT Graph with Noise Floor

조회 수: 4(최근 30일)
Raidah Zaman
Raidah Zaman 2021년 5월 10일
댓글: Star Strider 2021년 5월 11일
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
Raidah Zaman
Raidah Zaman 2021년 5월 10일
Here my apologies, I have attached it.

댓글을 달려면 로그인하십시오.

채택된 답변

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
Star Strider
Star Strider 2021년 5월 11일
As always, my pleasure!

댓글을 달려면 로그인하십시오.

추가 답변(0개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by