Request for review of FFT conversion results

조회 수: 2 (최근 30일)
J
J 2023년 12월 6일
답변: Sulaymon Eshkabilov 2023년 12월 6일
Although it is not data related to noise and vibration, I would like to do FFT on resistance values that change with a specific speed (10 rpm).
But as you can see in the picture, the maximum comes out at 0 Hz. I think the Peak value would occur in another area(Hz), so if you can look at the attachment and code and advise on how to solve it, I would appreciate it.
clear all
clc
A = xlsread('2F100.xlsx','0.2m','D3:F812');
t = A(:,1);
r = A(:,3);
subplot(2,1,1), plot(t, r, 'linewidth', 2)
xlim([0 80])
ylim([0 30])
xlabel('t (seconds)','fontsize',16,'FontName','Arial')
ylabel('Resistance (\Omega)','fontsize',16,'FontName','Arial')
set(gca,'FontName','Arial','FontSize',14,'FontWeight','bold','XTick',...
[0 10 20 30 40 50 60 70 80]);
Fs = 1000;
Y = fft(r);
L = length(r);
P2 = abs(Y/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1);
f = Fs*(0:(L/2))/L;
subplot(2,1,2), plot(f, P1, 'linewidth', 2) %semilogx(f,P1)
xlim([0 500])
ylim([0 10])

채택된 답변

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2023년 12월 6일
편집: Sulaymon Eshkabilov 2023년 12월 6일
One option is zeroing the DC component by removing the mean of the signal and/or setting DC component equal to zero:
A = xlsread('2F100.xlsx','0.2m','D3:F812');
t = A(:,1);
r = A(:,3);
% Remove mean of r
r=r-mean(r);
subplot(2,1,1), plot(t, r, 'linewidth', 2)
xlim([0 80])
ylim([0 30])
xlabel('t (seconds)','fontsize',16,'FontName','Arial')
ylabel('Resistance (\Omega)','fontsize',16,'FontName','Arial')
set(gca,'FontName','Arial','FontSize',14,'FontWeight','bold','XTick',...
[0 10 20 30 40 50 60 70 80]);
Fs = 1000;
Y = fft(r);
L = length(r);
P2 = abs(Y/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1);
f = Fs*(0:(L/2))/L;
% Set equal value 1 equal to "0"
%P1(1)=0;
subplot(2,1,2), plot(f, P1, 'linewidth', 2) %semilogx(f,P1)
xlim([0 500])
% Chnage the y-axis limits
ylim([0 3.5])
  댓글 수: 1
J
J 2023년 12월 6일
Thank you for your answer. In the time region(upper graph), the y value was shifted by about 10, and in the frequency region(lower graph), the y value decreased by one-third. Can I see this as the effect of zeroing through the removal of the average value?

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

추가 답변 (1개)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2023년 12월 6일
The two can be also compared:
A = xlsread('2F100.xlsx','0.2m','D3:F812');
t = A(:,1);
r = A(:,3);
% Remove mean of r
r1=r-mean(r);
subplot(2,1,1),
plot(t, r, 'linewidth', 2)
hold on
plot(t, r1, 'r-', 'linewidth', 1)
legend('Original', 'Mean removed')
xlim([0 80])
ylim([0 30])
xlabel('t (seconds)','fontsize',16,'FontName','Arial')
ylabel('Resistance (\Omega)','fontsize',16,'FontName','Arial')
set(gca,'FontName','Arial','FontSize',14,'FontWeight','bold','XTick',...
[0 10 20 30 40 50 60 70 80]);
Fs = 1000;
Y1 = fft(r1);
L = length(r1);
P2 = abs(Y1/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1);
f = Fs*(0:(L/2))/L;
subplot(2,1,2),
plot(f, P1, 'linewidth', 2) %semilogx(f,P1)
hold on
Y = fft(r);
L = length(r);
PP2 = abs(Y/L);
PP1 = PP2(1:L/2+1);
PP1(2:end-1) = 2*PP1(2:end-1);
f = Fs*(0:(L/2))/L;
% Set equal value 1 equal to "0"
PP1(1)=0;
plot(f, PP1, 'r-', 'LineWidth', 1)
legend('Mean removed', 'DC = 0')
xlim([0 500])
% Change the y-axis limits
ylim([0 3.5])
% FFT of : Mean removed and DC=0 matches quite well

카테고리

Help CenterFile Exchange에서 Spectral Analysis에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by