Help understanding findpeaks function qualifier units?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
What are the units on things in find peaks, like MinPeakHeight, MinPeakProminence, Width, Threshold etc. Is it based on my units in the data and I can size these based on what I see on the Y and x axes, or is it based on like pixels or something? I ask because prominence and threshold seems to be all over place. Amd you can't one side threshold for example at least X higher than data to the right, versus the left .
0 Kommentare
Antworten (1)
Star Strider
am 16 Jan. 2018
The dependent ‘y’ variable units are whatever they are in your data.
The independent ‘x’ variable units are either the indices (that I find most useful) or the original x vector units, if you supply them.
Admittedly, findpeaks does not do well with wandering baselines, so one way of correcting for that is to use a highpass filter to eliminate the d-c or constant offset and low-frequency baseline variations. (First do a fft (link) on your data to find the best cutoff frequency for your filter, then design the filter.)
4 Kommentare
Star Strider
am 17 Jan. 2018
You can only get what findpeaks lets you have. See the documentation in the section on Peak Prominences (link).
For your findpeaks call:
[pks,locs,widths,proms] = findpeaks(Peakdata,'MinPeakHeight',30,'MinPeakDistance',50,'MinPeakProminence',10,'Annotate','extents');
Without data that would work with your findpeaks call, I cannot run it to verify that those arguments will return anything useful in the outputs.
However with different data and a slightly different findpeaks call:
figure
findpeaks(Peakdata,'MinPeakHeight',10,'MinPeakDistance',10,'MinPeakProminence',1,'Annotate','extents');
axChild = get(gca, 'Children')
yields:
axChild =
4×1 graphics array:
Line (HalfProminenceWidth)
Line (Prominence)
Line (Peak)
Line (Signal)
you can then query those with, for example:
Half_Prom_Wdth = axChild(1)
and so for the others.
I’m not certain if this is more information than findpeaks returns in the outputs it lets you have. Nevertheless, the data appear to be there if you want to get them.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!