A simple demonstration script using the findpeaks function on noisy synthetic data.
Numbers the peaks and prints out the P matrix in the Matlab command window:
Peak # Position Height Width
P =
1.0000 10.0235 0.1814 1.7506
2.0000 29.9964 0.6412 1.9931
3.0000 50.0205 0.4315 2.1433
4.0000 70.0120 1.3935 2.0202
5.0000 79.9567 0.2580 1.8267
6.0000 100.0086 1.0862 2.0306
......
|
Interactive findpeaks script for your own data. Requires Matlab 6.5. This can be used to determine what values of the
parameters give the most reliable peak detection.
Load your data set into the vectors x and y (x = independent variable, y = dependent variable), then run this
m-file and adjust the sliders to change the four arguments of the peakfind function. The four sliders correspond to the arguments of the findpeaks function described above: SlopeThreshold (SlopeT), AmpThreshold (AmpT), SmoothWidth (Smooth), and FitWidth (Fit). The range of these sliders is easily changed in lines 65 - 70 to suit a wide range of data types. The BG button is used for baseline (background) subtraction: click once on the BG button, then click on the baseline at five points starting to the left of the lowest x-value and ending to the right of the higest x-value. The background will be subtracted. You can repeat as needed. (You can also change the number of baseline points by changing BaselinePoints in the function BG.m). Peak number and the estimated
position, height, and width of each peak is returned in the matrix P:
>> P
P =
1.0000 45.0095 0.1328 4.0102
2.0000 90.5301 0.3655 4.7127
3.0000 94.9673 1.4075 4.0967
......
|
| A self-contained interactive demonstration of FindPeakSliders applied to noisy synthetic data set consisting of a random number of narrow peaks superimposed on a gently curved background. Requires Matlab 6.5. Use the sliders to explore the effect of the variables SlopeThreshold (SlopeT), AmpThreshold (AmpT), SmoothWidth (Smooth), and FitWidth (Fit), and the baseline correct (BG) button. Peak number and the estimated position, height, and width of each peak is returned in the matrix P. |
A self-contained interactive demonstration of FindPeakSliders applied to
a data set containing four simple peaks with increasing peak height and peak width. Use this to understand the difference between the variables SlopeThreshold (SlopeT), which discriminates on the basis of peak width, and AmpThreshold (AmpT), which discriminates on the basis of peak amplitude. Peak number and the estimated
position, height, and width of each peak is returned in the matrix P:
>> P
P =
1.0000 49.9096 1.9895 20.1960
2.0000 126.1034 3.0585 42.3508
3.0000 201.3947 4.0752 63.3354
4.0000 299.9242 4.9925 82.2000
|
|
|
Tom O'Haver
Professor Emeritus
Department of Chemistry and Biochemistry
The University of Maryland at College Park
toh@umd.edu
http://www.wam.umd.edu/~toh