[y,Fs] = audioread('C:\Users\Casper\Desktop\3.3V.wav');
L=length(y); % series length
;
f = Fs/2*linspace(0,1,L/2+1); % single-sided positive frequency
X = fft(y)/L; % normalized fft
PSD=2*abs(X(1:L/2+1)); % one-sided amplitude spectrum
figure,plot(f,PSD);
grid
xlabel('freq(Hz)')
ylabel('amplitude')

 채택된 답변

Star Strider
Star Strider 2021년 12월 28일

1 개 추천

Try this —
idx = (f <= 1500) & (f <= 1800)
[rpm, freq] = findpeaks(PSD(idx), f(idx), 'MinPeakHeight',0.75E-3)
Without the data, I cannot experiment with that, however it should return the peak value as ‘rpm’ and the frequency as ‘freq’. If it does not, experiment with 'MinPeakProminence' instead of 'MinPeakHeight' since it cannot be determined from the plot that there are not more components to the desired peak.
.

댓글 수: 2

burak Kalayoglu
burak Kalayoglu 2021년 12월 28일
Thank you king
Star Strider
Star Strider 2021년 12월 28일
As always, my pleasure!
.

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

추가 답변 (1개)

Voss
Voss 2021년 12월 28일

0 개 추천

You could use Data Cursor to create a datatip, or you could try something like this:
idx = find(f(:) > 1000 & f(:) < 2500 & PSD(:) > 0.00075);

댓글 수: 3

burak Kalayoglu
burak Kalayoglu 2021년 12월 28일
편집: burak Kalayoglu 2021년 12월 28일
I want to find a value1698 (signed point in graph) but ı cant , ı want to find signed point and after ı can find rpm this signal
Voss
Voss 2021년 12월 28일
What does this do?
f(1698)
PSD(1698)
burak Kalayoglu
burak Kalayoglu 2021년 12월 28일
Because I want to see what corresponds to the same psd value in different signals

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

카테고리

제품

릴리스

R2021b

질문:

2021년 12월 28일

댓글:

2021년 12월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by