Finding largest peaks in a graph

5 ビュー (過去 30 日間)
A
A 2013 年 1 月 28 日
Hello!
I am writing a little program to plot out the intensities of split spectral lines from a Zeeman experiment.
I get graphs that look like this:
I want to be able to find the major peaks of this plot. I've been using
[pks,locs]=findpeaks(smo);
to find the peaks, but this function finds all of the tiny insignificant peaks. I was thinking of thresholding intensity (i.e. ignoring peaks that are below 5 on the y axis for instance), but I wonder if there is a cleaner way to do this.
Thank you!

回答 (1 件)

Image Analyst
Image Analyst 2013 年 1 月 28 日
As explained in the help, set the 'MINPEAKHEIGHT' property to 5:
[peakValues, indexesOfPeaks] = findpeaks(smo, 'MINPEAKHEIGHT', 5);
or if you really want to set smo to zero below some threshold value, such as 7, you can do this first:
smo(smo<7) = 0;
[peakValues, indexesOfPeaks] = findpeaks(smo, 'MINPEAKHEIGHT', 5);
though I don't think that should be necessary with the data you've shown if you use the MinPeakHeight parameter.

カテゴリ

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