Finding Peaks
Show older comments
I'm in the process of writing some code to find peaks (beginning, maximum, and end) of very large datasets (each file is 50000 + rows) and there are 100s of files), so I need it to be fast.
I've looked at a couple of methods and was wondering what other peoples opinions are about accomplishing this task.
- Method 1:
- 1) Simply finding the max(signal) and x value of the max index of the baseline corrected signal.
- 2) find the first and last occurrence of a signal that is 3*sigma of the baseline.
-this method finds the peaks OK, but the peak extents are horrible since my data is quite noisy.
- Method 2:
- 1) find maximum similar to method 1, or use the minimum of the 2nd derivative to find the max signal
- 2) then use the 3rd derivative to find the peak extents
better, but more computationally intensive.
- Method 3
- 1) use built in functions of the Mass Spectrometry portion of the Bioinformatics toolbox:
- -msbackadj (to adjust for noisy background)
- -mspeaks (to find a list of peaks, fwhm, and extents)
- again, easier, but sometimes the extents are way off.
So I'm just curious about how other people have done this and see what people feel is the most robust method of finding peaks in some noisy signal.
Cheers!
Answers (3)
Sean de Wolski
on 19 Oct 2011
0 votes
I'll just put in my vote AGAINST taking the derivative of noisy data - especially three of 'em. Derivatives of noise amplify noise.
Wayne King
on 19 Oct 2011
0 votes
I agree with Sean.
mspeaks implements some wavelet denoising, but perhaps you would be better to experiment with wden() first if you have the Wavelet Toolbox, there you have access to many more wavelets (so perhaps you can select a better option for your data then the one used in mspeaks).
Also, you have more options for adjusting the denoising. Perhaps, you can:
- Denoise the signal using wavelet denoising
- Apply findpeaks to the output of #1.
Image Analyst
on 19 Oct 2011
0 votes
Here's another one: http://billauer.co.il/peakdet.html or you can find some more in the File Exchange.
Categories
Find more on Descriptive Statistics in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!