How can I get the 2 highest peaks ?

4 ビュー (過去 30 日間)
Bob
Bob 2016 年 3 月 21 日
編集済み: Bob 2016 年 3 月 26 日
1)How can I get the 2 peaks from the picture below? Because these commands gives me the only the highest.
[gpeakG1,fpeakG1] = getPeakGain(G1);
gpeakG1_dB = 20*log10(gpeakG1);

採用された回答

Star Strider
Star Strider 2016 年 3 月 25 日
I would use the bode function with three output arguments, then use findpeaks with the ‘mag’ and ‘wout’ arguments:
[mag,phase,wout] = bode(sys);
[pks,locs] = findpeaks(mag, wout);
Add the name-value pair arguments you need to get the result you want. The findpeaks function has considerable flexibility, but how much depends on your version of MATLAB, so be sure to read the relevant documentation for your version.
  4 件のコメント
Bob
Bob 2016 年 3 月 25 日
Thank you it works.
Star Strider
Star Strider 2016 年 3 月 25 日
My pleasure.

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

その他の回答 (1 件)

Image Analyst
Image Analyst 2016 年 3 月 22 日
For #2, did you take a look at findpeaks()? (Requires the Signal Processing Toolbox.)

カテゴリ

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