필터 지우기
필터 지우기

find peaks in power spectral density

조회 수: 6 (최근 30일)
prosper evergreen
prosper evergreen 2020년 5월 5일
답변: Ayush Gupta 2020년 6월 10일
I have the power spectral density of an audio file and i need to find the frequency of all the peaks in the PSD. please help
[y1,fs]=audioread('4.WAV');
Fs=2800;
S=y1(:,1);
S_filtered= (S);
N= length(S);
T=1/Fs;
tmax=N/Fs
t=0:T:tmax-T;
axes(hAxes1)
plot(t,S_filtered);
ylabel('Amplitude,db');
xlabel('time,s');
title('ossilogram');
handles.fs=Fs;
%СПМ
handles.nfft=handles.fs;
Nw=1024;
s=handles.fs/24;
Fmax=1400;
noverlap=512;
%window=hanning(Nw);
df=handles.fs/handles.nfft;
Nf=fix(Fmax/df);
handles.f=0:handles.fs/2;
[handles.Pxx1,handles.f]=pwelch(S_filtered,window,noverlap,handles.nfft,handles.fs);
%Спектр
figure
plot(handles.f(1:Nf),handles.Pxx1(1:Nf));
%title('Спектрограмма');
ylabel('');
xlabel();
[pks,locs] = findpeaks(handles.f,handles.Pxx1);
  댓글 수: 2
Image Analyst
Image Analyst 2020년 5월 5일
You forgot to attach 4.wav. Zip it up and attach with the paper clip icon.
prosper evergreen
prosper evergreen 2020년 5월 6일
sorry, here's the file. thanks

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

답변 (1개)

Ayush Gupta
Ayush Gupta 2020년 6월 10일
Try following this approach, it returns the out array with frequency count of each peak:
[pks,locs] = findpeaks(y1);
un = unique(pks)
out = [un,histc(pks(:),un)];

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by