How to obtain peaks in the y-axis above a reference line in matlab plot
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I want to get all the pnts in yaxes for a matlab plot above reference line -70 db
0 Kommentare
Antworten (2)
KSSV
am 13 Jun. 2018
Let x,y be your data. And reference line is at y = y0. To extract data above y = y0:
idx = y>=y0 ;
x1 = x(idx) ;
y1 = y(idx) ;
1 Kommentar
Star Strider
am 13 Jun. 2018
If you have the Signal Processing Toolbox, use the findpeaks (link) function, and the 'MinPeakHeight' (and perhaps also the 'MinPeakDistance') values set to the appropriate thresholds. For 'MinPeakHeight that would be either -70 if your original data are in dB, or 3.162277660168379e-04 otherwise. You will have to experiment to get the correct 'MinPeakDistance' value.
If you do not, and you have R2017b or later, use the islocalmax (link) function. You will first have to threshold your data to present data only greater than -70 dB. Again, you will have to experiment to get the results you want.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Spectral Measurements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!