Hi group,
I've release my rainflow cycle counting library on Github.
See <
https://github.com/ralph-schleicher/rainflow>. There
is also a Matlab/Octave MEX-file command with many nice
features (see below). And it is of course quite fast.
cc4fat -- cycle counting for fatigue analysis.
c = cc4fat(y, t, ...)
Count the cycles in a signal history and return a cycle counting
sequence.
First argument Y is the signal history. Value is a vector of
real numbers, logicals, or characters.
Optional second argument T are the corresponding signal labels.
Value is a vector of real numbers, logicals, or characters.
If argument T is omitted or empty, don't label signal values
unless implicit labeling of signal values is enabled.
The rest of the argument list are options.
Return value C is a cycle counting sequence. Each row in C is of
the form [SA, SM, N] where SA is the signal amplitude, SM is the
signal mean, and N is the cycle count. If signal labeling is in
effect, each row in C is of the form [SA, SM, N, T1, T2] where SA,
SM, and N have the same meaning as before, T1 is the signal label
of the trough value, and T2 is the signal label of the peak value.
Options:
-rainflow
Select the rainflow counting method. This is the default
cycle counting method.
-reservoir
Select the reservoir counting method. Reservoir counting
creates the same result as rainflow counting iff the signal
history starts and ends with the absolute signal maximum.
Otherwise, reservoir counting is slightly more conservative
than rainflow counting. Another property of reservoir
counting is that the resutling cycle counting sequence
only contains full cycles.
-label, -no-label
Turn on implicit labeling of signal values, i.e. assign a
one-based index to the signal values. This option has no
effect if the explicit signal labels argument T is supplied
and non-empty. Contrary to that, the '-no-label' option
always disables signal labeling even if argument T is
supplied.
-zero, -one
Use a zero-based index as implicit signal labels. Default
is to use a one-based index.
-no-merge, -merge
Don't merge similar consecutive cycles. Default is to
merge similar consecutive cycles by adding the individual
cycle counts. This optimization reduces the length of the
cycle counting sequence without loosing any information.
Cycles are similar if the signal amplitude, mean value,
and the optional signal labels are equal.
-sort, -no-sort
Sort cycles by amplitude and mean value in descending
order.
-half, -full
Express the cycle count N as the number of half cycles.
Default is to count the number of full cycles.
-time, -no-time
Interpret signal labels as time values. With that, each
cycle is of the form [SA, SM, N, T, P] where SA, SM, and N
have the usual meaning, T is the start time of the cycle,
and P is the period of one full cycle.
-transpose, -no-transpose
Transpose the resulting cycle counting sequence, i.e. each
cycle is a column vector instead of a row vector.
--
Ralph