How can I get the 2 highest peaks ?
조회 수: 4 (최근 30일)
이전 댓글 표시
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);
댓글 수: 0
채택된 답변
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
추가 답변 (1개)
Image Analyst
2016년 3월 22일
For #2, did you take a look at findpeaks()? (Requires the Signal Processing Toolbox.)
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!