Rainflow
Fast rainflow counting written in C (C99)
...Peak-Valley Filtering
3. Discretization
4. Four Point Counting Method:
These steps are fully documented in standards such as ASTM E1049 "Standard Practices for Cycle Counting in Fatigue Analysis" [1].
This implementation uses the 4-point algorithm mentioned in [2].
To take the residue into account, you may implement a custom method or use some predefined functions.
[1] ASTM Standard E 1049, 1985 (2011). "Standard Practices for Cycle Counting in Fatigue Analysis", West Conshohocken, PA: ASTM International, 2011...