How to count these spikes?
It can be done by using some high pass filter to remove DC bias, then you differentiate the signal to detect high dv/dt. At each high dv/dt you set a flip-flop. If the FF is set you compare the amplitude threshold and you clear the FF when dv/dt becomes negative.