I have done the FFT analysis of a real time data. Please check weather am i right or not ?
7 次查看(过去 30 天)
显示 更早的评论
clc;
clear;
close all;
%%Time Domain Plot
vib1=readtimetable("sing2.txt","SampleRate",1);
tiledlayout(5,1)
nexttile
plot(vib1.Time,vib1.Sing1)
N=length(vib1.Sing1);
xlabel("Time(s)")
ylabel("Ampl(mm/s^2)")
%% FFt
fs=1;%Sampling Frequency
delt=seconds(1/fs); %time step
t=0:1:length(vib1.Sing1)-1;
Totaltime=(length(vib1.Sing1)-1);
my_fft=2/N*(fft(vib1.Sing1));%FFT of Signal
abs_fft=abs(my_fft); %Absolute value of fft
delf=1/Totaltime; %Frequency Resolution
n2=1:1:N/2; %fft results are plotted for N/2 data points
fk=delf*n2;% frequency values
nexttile
plot(fk,abs_fft(1:N/2))
[v,p]=findpeaks(abs_fft(1:N/2),fk,'Threshold',0.03);
findpeaks(abs_fft(1:N/2),fk,'MinPeakHeight',0.03)
xlabel("Frequency (Hz)")
ylabel("Ampl(mm/s^2)")
%%Spectral density
nexttile
pspectrum(vib1.Sing1,vib1.Time,"spectrogram")
0 个评论
采纳的回答
Abderrahim. B
2022-7-6
编辑:Abderrahim. B
2022-7-6
Hi!
Looks correct to me your spectral analysis!
HTH!
10 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spectral Estimation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!