Localmax: Difference between revisions
Jump to navigation
Jump to search
imported>Jeremy (Importing text file) |
imported>Jeremy (Importing text file) |
||
Line 1: | Line 1: | ||
===Purpose=== | ===Purpose=== | ||
Automated identification of local maxima | Automated identification of local maxima | ||
===Synopsis=== | ===Synopsis=== | ||
:i0 = localmax(x,w) | :i0 = localmax(x,w) | ||
===Description=== | ===Description=== | ||
Finds maxima in windows of width (w). Wider windowing is used to avoid local maxima that might be due to noise. The default window width is w=3. This function is called by PEAKFIND. | Finds maxima in windows of width (w). Wider windowing is used to avoid local maxima that might be due to noise. The default window width is w=3. This function is called by PEAKFIND. | ||
====INPUTS==== | ====INPUTS==== | ||
* '''x''' = matrix of measured traces containing peaks each row of (x) is an individual trace. | * '''x''' = matrix of measured traces containing peaks each row of (x) is an individual trace. | ||
====OPTIONAL INPUTS==== | ====OPTIONAL INPUTS==== | ||
* '''w''' = odd scalar window width for determining local maxima {default: w = 3}. | * '''w''' = odd scalar window width for determining local maxima {default: w = 3}. | ||
====OUTPUTS==== | ====OUTPUTS==== | ||
* '''i0''' = cell w/ indices of the location of the major peaks for each of the traces in each cell. | * '''i0''' = cell w/ indices of the location of the major peaks for each of the traces in each cell. | ||
===Examples=== | ===Examples=== | ||
:load nir_data | :load nir_data | ||
:plot(spec1.axisscale{2},spec1.data(1,:)) | :plot(spec1.axisscale{2},spec1.data(1,:)) | ||
:i0 = localmax(spec1.data(1,:)); | :i0 = localmax(spec1.data(1,:)); | ||
:vline(spec1.axisscale{2}(i0{1})) | :vline(spec1.axisscale{2}(i0{1})) | ||
:i0 = localmax(spec1.data(1,:),5); | :i0 = localmax(spec1.data(1,:),5); | ||
:vline(spec1.axisscale{2}(i0{1}),'r') | :vline(spec1.axisscale{2}(i0{1}),'r') | ||
===See Also=== | ===See Also=== | ||
[[fitpeaks]], [[peakfind]] | [[fitpeaks]], [[peakfind]] |
Revision as of 15:25, 3 September 2008
Purpose
Automated identification of local maxima
Synopsis
- i0 = localmax(x,w)
Description
Finds maxima in windows of width (w). Wider windowing is used to avoid local maxima that might be due to noise. The default window width is w=3. This function is called by PEAKFIND.
INPUTS
- x = matrix of measured traces containing peaks each row of (x) is an individual trace.
OPTIONAL INPUTS
- w = odd scalar window width for determining local maxima {default: w = 3}.
OUTPUTS
- i0 = cell w/ indices of the location of the major peaks for each of the traces in each cell.
Examples
- load nir_data
- plot(spec1.axisscale{2},spec1.data(1,:))
- i0 = localmax(spec1.data(1,:));
- vline(spec1.axisscale{2}(i0{1}))
- i0 = localmax(spec1.data(1,:),5);
- vline(spec1.axisscale{2}(i0{1}),'r')