フィルターのクリア

FFT \ Peak points

6 ビュー (過去 30 日間)
LALE ASIK
LALE ASIK 2018 年 3 月 9 日
編集済み: LALE ASIK 2018 年 4 月 7 日
I am trying to find peak points of Fast Fourier transform (FFT). The graph looks like this:
Could you please help me to fix it?
% amplitude peaks
pks= findpeaks(mx(1:nfft/2));
n=min(n,length(pks));
pks_sort=sort(pks,'descend');%vector of spikes
for k = 1:n
locs=find(mx(1:nfft/2)==pks_sort(k));
f(k)=f_Axis(locs);
end

採用された回答

Akira Agata
Akira Agata 2018 年 3 月 9 日
Please change the 'amplitude peaks' section of your code to the following:
% amplitude peaks
[pks,locs] = findpeaks(mx(1:nfft/2),'SortStr','descend');
n = min(n,length(pks));
subplot(2,1,2);
plot(f_fft,mx)
hold on
plot(f_fft(locs(1:n)),pks(1:n),'rv','MarkerFaceColor','r')
xlabel('Frequency ')
ylabel(' Amplitutde')
  1 件のコメント
LALE ASIK
LALE ASIK 2018 年 3 月 9 日
Thank you so much for your help.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDescriptive Statistics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by