FFT of vibration data, Help me please.
3 次查看(过去 30 天)
显示 更早的评论
Dear friends
I have vibration data from the device, I need to convert it into Freq Domain (Magnitude vs Freq). I've tried several times and still stuck, I can't import that data into the formula/function. I've attached an excel file I got from the device. maybe you can download and see the excel files for complete information. Could you guys help me, what function/formula should I write? and how to find the max point in the plot?
0 个评论
采纳的回答
Star Strider
2022-5-11
Try this —
T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/994895/fantest.xlsx%20-%20Sheet2.xlsx', 'VariableNamingRule','preserve')
VN = T1.Properties.VariableNames
L = size(T1,1);
% QQ1 = nnz(diff(T1{:,1}) ~= 1)
Ts = T1.hours(2) - T1.hours(1); % Sampling Interval
Fs = 1/Ts; % Sampling Frequency
Fn = Fs/2; % Nyquist Frequency
NFFT = 2^nextpow2(L); % For Efficiency
FT_T1 = fft(T1{:,2:end} - mean(T1{:,2:end}), NFFT)/L; % Fourier Transform (Mean Subtracted To Show Other Peaks More Clearly)
Fv = linspace(0, 1, NFFT/2+1)*Fn; % Frequency Vector
Iv = 1:numel(Fv); % Index Vector
figure
plot(Fv, abs(FT_T1(Iv,:))*2)
grid
xlabel('Frequency (hr^{-1})')
ylabel('Amplitude')
legend(VN{2:end}, 'Location','best')
NrSp = size(FT_T1,2);
figure
for k = 1:NrSp
subplot(NrSp,1,k)
plot(Fv, abs(FT_T1(Iv,k))*2)
grid
ylabel('Amplitude')
title(VN(k+1))
end
xlabel('Frequency (hr^{-1})')
.
4 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!