フィルターのクリア

I've been given a signal, how can I find the peaks with the islocalmax function?

1 回表示 (過去 30 日間)
How can I find the peaks using the islocalmax function, with the attachment below as my only source of information?
  4 件のコメント
Image Analyst
Image Analyst 2018 年 12 月 22 日
編集済み: Image Analyst 2018 年 12 月 22 日
For example when the help documentation gave the example:
x = 1:100;
A = (1-cos(2*pi*0.01*x)).*sin(2*pi*0.15*x);
TF = islocalmax(A);
plot(x,A,x(TF),A(TF),'r*')
Is there some reason you couldn't replace the A with your data?
See my answer below where I did that for you.
Hannah Oduntan
Hannah Oduntan 2018 年 12 月 22 日
I have no idea, I’ve tried that code already, but I ended up figuring it out, thank you

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

採用された回答

Image Analyst
Image Analyst 2018 年 12 月 22 日
All you have to do is to put your signal in for the "A" in the help demo. Try this:
s = load('signals (1).mat')
signal = s.Signal;
% Find local max, following the demo in the help
x = 1 : length(signal);
TF = islocalmax(signal);
plot(x, signal, x(TF), signal(TF), 'r*')
grid on;
0000 Screenshot.png
  4 件のコメント
Image Analyst
Image Analyst 2018 年 12 月 29 日
OK thanks. Though it pretty much looks like my code except that you use black stars instead of red ones, plot in two lines of code instead of 1, and have different variable names. But it's substantially the same except for very minor differences. Would you mind "Accepting this answer" so others know it's solved.
Hannah Oduntan
Hannah Oduntan 2018 年 12 月 29 日
Yeah it is, and yes I will, thanks so much for the help!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMultirate Signal Processing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by