From: Cement stratigraphy: image probes of cathodoluminescent facies
Step 1: detection of peaks and troughs |
---|
so n, the size of the signal to study |
so pi, the element at the position i in the signal |
so pi−1, the element at the position i−1 (preceding the element) |
so the boolean up (true if the curve is ascending, otherwise false) |
so the boolean down (true if the curve is descending, otherwise false) |
Buckle: from i = 2 until i = n |
{In the run i: if pi−1 < pi [up = true check in the run i−1 if down = true yes = presence of a trough] |
otherwise: if pi−1 > pi [down = true check in the run i−1 if up = true yes = presence of a peak]} |
Step 2: stacking of non-significant peaks and troughs |
---|
with the closest significant peak or trough |
Nb: signal2 is the result of step 1 |
so s, the standard deviation of the signal to study |
so k, an integer number |
so r = s/k, r is the threshold value (all lower variation than r is considered as being noise) |
[if the variation (up or down) between two points is lower than r, the peak is considered as |
non-significant, r is determined by the operator after observation of the data.] |
so m, the number of points extracted during step 1 (peaks and troughs) |
so pi, the element at the position i in signal2 |
so pi−1, the element at the position i-1 (preceding the element i) |
Buckle: from i = 1 until i = m |
{If pi−1 < pi (trough case): if pi-1 <=pi + r non-significant trough, stacking with the previous trough |
otherwise: if pi < pi−1 + r non-significant peak, stacking with the previous peak} |