swa-matlab
swa-matlab copied to clipboard
swa_get_peaks fails to handle a special case
Checking for negative and positive peaks this way...
MNP = find(diff(sign(slope_data)) == 2);
MPP = find(diff(sign(slope_data)) == -2);
...fails to properly handle the case where the slope at the peak is exactly zero.
E.g. it catches peaks like / but misses peaks like _/.