I need to count the number of 'patterns per second' in a signal. The problem is that the signal changes 'shape' a lot and unpredictably. It is still easy for a person to see the the pattern, but I don't know how to do this with code.
EDIT For extra clarity: say the first sample is 1 second. There are 17 copies of the pattern in this sample. So I want to compute "17 (patterns per second)". Also, it might be worth noting the samples below are from a continuous measurement, in this order.
Any ideas how to tackle this?
(It needs to count the pattern in realtime.)
Here are some samples of the signal. (Zoom level in both directions is identical for all images.)




