peakdetection_gui

See command line for batch option (output below).

To add a peak: right-click on the blue line in the top graph.

To delete a peak: right-click a peak (the following trough will be removed too).

Running from Matlab:

load D:\Working\WHH\all3101

% run_pd
x = D.recording{1}.ts.pleth.Time * 60;
y = squeeze( D.recording{1}.ts.pleth.Data );

O = peakdetect_gui( y, x );

Parameters

In the GUI, set these then "Run" to re-calculate peaks. This will overwrite any manual peak editing you did.

GUI ParameterCommand Line ParameterMeaningChange
Moving avg. window (secs.)mawindowwindow length for moving averagereduce to allow for faster baseline trend changes
Threshold decay time constant Pkdecaytimeconstpk decay time constant for peaksreduce to detect more peaks; this determines how fast the peak threshold decays down from the previous peak towards.
Threshold decay time constant Trdecaytimeconsttrdecay time constant for troughsreduce to detect more troughs; this determines how fast the peak threshold decays up from the previous trough.
Threshold limit (%last peaks/troughs) Pkthreshlimpk percent of peak height above moving average mean (sets lower bound for peak decay)decrease to detect more peaks (can be negative)
Threshold limit (%last peaks/troughs) Trthreshlimtrpercent of trough depth below moving average mean (sets upper bound for trough decay)decrease to detect more peaks (can be negative)
Min. interval (checkbox)flagmininterval flag for using/not using mininternvalset to 0 for not using (useful if you want to have a flags structure to test, but don't want to constantly change or remove "mininterval")
Min. interval (text box)mininterval minimum interval allowed between peaks (or troughts)set so that no non-physiologic values are found (e.g. in seconds, 0.25 ~ 4 Hz ~ 240 bpm)

 

Outputs

 FieldMeaning 
Core output 
 pxpeak timepoint 
 pypeak height 
 txtrough timepoint 
 tytrough height 
New channels 
 ratexrate timepointtimepoints at which we have a rate caluclation
 rateyrate valuebpm (beats/breaths per minute)
 intervalxinterval timepointtimepoints at which we have an interval calculation (inverse of rate)
 intervalytime from previous peak 
 heightxheight timepoint 
 heightypeak-to-trough amplitudeau (arbitrary units)
 ratex_secondsrate timepoint in seconds(batch only)
 ratey_Hzrate in Hertz(batch only)
 ratey_bpmrate in cycles/minute(batch only)
peak_numtotal number of peaks + troughts 
Other fields: parameters for automatic peak detection 

O =

peak_num: 2619
px: [1x1310 double]
py: [1x1310 double]
tx: [1x1309 double]
ty: [1x1309 double]
meany: [1x81200 double]
limit_pk: [1x81200 double]
threshold_pk: [1x81200 double]
limit_tr: [1x81200 double]
threshold_tr: [1x81200 double]
all_valpx: [1x1310 double]
all_valpy: [1x1310 double]
all_valtx: [1x1310 double]
all_valty: [1x1310 double]
all_px: [1x2102 double]
all_py: [1x2102 double]
all_tx: [1x2101 double]
all_ty: [1x2101 double]
px_auto: [1x1310 double]
py_auto: [1x1310 double]
tx_auto: [1x1309 double]
ty_auto: [1x1309 double]
ratex: [1x1309 double]
ratey: [1x1309 double]
intervalx: [1x1309 double]
intervaly: [1x1309 double]
heightx: [1x1309 double]
heighty: [1x1309 double]