How to find proper frequency peaks within a frequency spectrum?

조회 수: 1 (최근 30일)
Zafer Duyenli
Zafer Duyenli 2022년 12월 18일
댓글: Mathieu NOE 2022년 12월 19일
Hello there,
I am trying to detect any mechanical issues these require maintenance by observing the feature's frequency spectrums created via data taken from accelerometer calculations which are made axial and radial (saved as .mat). I have to measure peak frequencies properly by using the code given by my instructor -he also insisted that I am obliged to use the code as it is- in order to get an idea about the condition of the system but I can't make programatical data tips that automatically detects peak frequencies in a reasonable threshold and margin. How can I get those data tips? My code is shown below, thank you for your time already.
clc
clear
load BR.mat %%%data file
x=BR; %%%%%%Data file name
sp=fft(x);
nn=length(x);
sp(1:2)=zeros(size(1:2));
sp(nn-1:nn)=zeros(size(1:2));
x=real(ifft(sp));
fss=5000;
T=1/fss;
upfreq=fss/2;
p1=length(x);
z=(2/p1)*abs(fft(x));
z=z(1:p1/2-1);
z(1,1)=0.5*z(1,1);
nff=length(z);
nf1=round(2*nff*upfreq/fss);
z=z(1:nf1);
freqspec=plot((0:nf1-1).*(fss/p1),abs(z)),
freqspec =
Line with properties: Color: [0 0.4470 0.7410] LineStyle: '-' LineWidth: 0.5000 Marker: 'none' MarkerSize: 6 MarkerFaceColor: 'none' XData: [0 0.1163 0.2325 0.3488 0.4650 0.5813 0.6975 0.8138 0.9301 1.0463 1.1626 1.2788 1.3951 1.5113 1.6276 1.7439 1.8601 1.9764 2.0926 2.2089 2.3251 2.4414 2.5577 2.6739 2.7902 2.9064 3.0227 3.1390 3.2552 3.3715 3.4877 3.6040 3.7202 … ] YData: [0 1.4019e-18 0.0011 5.5658e-04 3.8345e-04 4.5997e-04 0.0019 0.0036 0.0020 9.3827e-04 3.8793e-04 0.0013 0.0024 0.0032 0.0012 6.2368e-04 0.0020 9.6836e-04 7.2553e-04 4.0302e-04 8.8694e-04 0.0016 0.0011 0.0030 4.2645e-04 5.2585e-04 … ] Show all properties
set(gca,'FontSize',10), xlabel('Frequency (Hz)'),ylabel('Amplitude')
axis([0 2500 0 0.05])
zoom on
  댓글 수: 1
Mathieu NOE
Mathieu NOE 2022년 12월 19일
hello
look for findpeaks
you can also use text to create annotations inside the figure, once you know the x, y coordnates of the selected peaks

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by