How to convert any periodic signal to a square wave signal using the Schmitt Trigger?
Use a series capacitor before schmitt trigger to remove offset and go to pulse counter.
(If you need more detailed answer you need to add schematics or some other information)